[nbdev] Re: How to rip existing wizard from Netbeans Source

  • From: Kay Wrobel < >
  • To:
  • Subject: [nbdev] Re: How to rip existing wizard from Netbeans Source
  • Date: Thu, 17 Jan 2013 09:08:48 -0600

There's one thing I have to figure out still. The default web.xml file maps "faces/*" for the facelet container and has a /faces/index.xhtml welcome page entry, but my code really depends on a mapping for "*.xhtml" and just index.xhtml as welcome page. Is there any way to rewrite a section of the web.xml file?

And the other thing I need to figure out is, I need to find out at runtime if the primefaces library is part of the project and what version. I found some snippet already in the wizard usign LibraryManager.getDefault().getLibrary("somename"). But I tried that and it seems to simply look at the Netbeans installed libraries rather than libraries associated with the current project. Any ideas or pointers on that? Thanks.

Will prepare an initial repository now.

Kay

On 01/17/2013 05:16 AM, Geertjan Wielenga wrote:
" type="cite">
On 01/17/2013 10:31 AM, Kay Wrobel wrote:
" type="cite">
So: I finally pulled the trigger and created a new project on SourceForge called "PrimeFaces CRUD Generator for NetBeans". You can find it at http://sourceforge.net/projects/nbpfcrudgen/ .


Looks great! Looking forward to seeing the code there.

Gj

" type="cite">
Since I just created the project, it doesn't show up in SourceForge's search yet, but I'm sure it will eventually. I set the status to Planning, but once the code is up, I'll put it in Pre-Alpha state. I will upload the source code as soon as I get to work.

There are portions of the generated code that I haven't tested yet, but you will see what the application will look like.

Any feedback will be greatly appreciated.

Kay


On 1/16/2013 5:02 PM, Geertjan Wielenga wrote:
" type="cite">
On 01/17/2013 12:00 AM, Kay Wrobel wrote:
" type="cite">
Yup. It compiles and runs fine. So, hm.... Not quite sure what to do about that. I bet you that most dependencies are not even required for the work this wizard does. I hate to do this, but I may have to literally take all the components that the wizard actually uses and make them IDE agnostic (if that's the right term). Clean up the dependencies, so to day.


Sure, go for it. Cut it down to its absolute most minimum set of dependencies and throw away as much code as you can.

Also, try and create an NBM on your Mac and then try install it on your other, non-Mac, system.

Gj

" type="cite">

Kay

On 01/16/2013 04:51 PM, Geertjan Wielenga wrote:
" type="cite">



Can you try and open the project on the Mac and rebuild it there, thanks.

The impl dependencies are needed -- because some internal code in those dependencies are needed. They're not public APIs, in all cases, that are used by that wizard, which makes sense since I ripped it out of the NetBeans sources where it was meant to stay.

Gj

On 01/16/2013 11:48 PM, Kay Wrobel wrote:
" type="cite">
I'm looking through the list of module dependencies and some (the ones that error out) like "HTML Editor" have "Implementation Version" selected, not Specification Version. Could that be it, and what does it imply? Can I simply flip that to "Specification Version" ?

Thanks.

Kay

On 01/16/2013 04:46 PM, Geertjan Wielenga wrote:
" type="cite">


See what happens when you check the project out on your Mac and try and rebuild the sources there.

Gj

On 01/16/2013 11:43 PM, Kay Wrobel wrote:
" type="cite">
I just tested this with my own Mac which also has Netbeans 7.2.1. I am able to create and deploy Web projects just fine. And I also get the same dependency problems. Is there something wrong with my project settings?

Kay

On 01/16/2013 04:34 PM, Geertjan Wielenga wrote:
" type="cite">


Your colleague probably only has a JavaSE installation of the IDE, not a JavaEE installation or a full installation.

Is he able to create any web applications at all? Probably not.

Gj

On 01/16/2013 11:31 PM, Kay Wrobel wrote:
" type="cite">
Hi again.

Ok, I'm now at a point where my module is completely separate and code is merged back with my changes. Module runs from within my Development IDE and properly generates code. Now I tried to share this module with my collegue, who is on Netbeans 7.2.1 for the Mac (I'm on Linux). I created an NBM file and sent it off to him. When he tries to install the plugin, he gets a whole bunch of dependency issues, like so:


And there's a whole lot more. Can you help me?

Kay

On 01/15/2013 10:19 PM, Geertjan Wielenga wrote:
" type="cite">
On 01/16/2013 04:20 AM, Kay Wrobel wrote:
" type="cite">
Just to clarify this: I don't have to create this project on Java.net. Right? I could also go with sourceforge? Since I also have an account there. What is the recommendation here for such a small project?

Whatever you like.

Gj


" type="cite">

Kay

On 1/15/2013 9:03 PM, Kay Wrobel wrote:
" type="cite">
On 1/15/2013 5:17 PM, Geertjan Wielenga wrote:
" type="cite">
On 01/16/2013 12:04 AM, Kay Wrobel wrote:
" type="cite">
Hey, Geertjan,

Thank you sooo much. You have helped me a lot today. I checked (SVN) out the project you created, and heavily refactored package names, String constants, and basically the entire project structure so it doesn't conflict with anything. And thanks to your edits in the layer.xml, I can now finally see a little better how I can further customize that. I will now basically add back my changes and customize this so it is completely the way I had the original wizard modified.

I am now using org.modules.netbeans.web.primefaces.crudgenerator as my code base name, and the Project Module is now called PrimeFaces CRUD Generator so that there is no confusion as to what it is and provides.

Above sounds good.

" type="cite">

Once I'm happy with what I have, I will put it out there. Since I registered on the Java.net site today, I think I will use that as my repository. Or do you have other suggestions? Thanks.


Give me your name on java.net and I will give you write access to the project so you can check in your changes -- or you can create your own project and check in your project there.
I think I'll go with option 2 here and create my own project. That way it's entirely standalone, which is what I was aiming for anyway. Thanks.

Kay

" type="cite">
Gj


" type="cite">
Kay

On 01/15/2013 03:22 PM, Geertjan Wielenga wrote:
" type="cite">


https://blogs.oracle.com/geertjan/entry/how_to_create_a_custom

Gj


On 01/15/2013 09:56 PM, Geertjan Wielenga wrote:
" type="cite">



...can be generated.

Gj



On 01/15/2013 09:46 PM, Geertjan Wielenga wrote:
" type="cite">


Well, there already is such a thing as PrimeFaces support.

What you're creating, i.e., what I checked in today, is the starting point for a custom "JSF Pages from Entity Classes" wizard.

You can call that module whatever you like. But the point is that you can now add content to it, and modify it, so that the PrimeFaces-oriented artifacts that you're interested in

Gj

On 01/15/2013 08:47 PM, Kay Wrobel wrote:
" type="cite">
No need to. I just signed up and am going to follow the checkout. Sounds like this is the starting point that I need to reapply my changes. So really this should then become it's own plugin, like I'm thinking about calling it "PrimeFaces Support" with a code-base-name of org.nedbeans.modules.web.jsf.primefaces. Does that sound acceptable?

Kay Wrobel

MIS Associate
Hawk Electronics, Inc.
800-THE-HAWK
800-843-4295
> "> >
On 01/15/2013 01:44 PM, Geertjan Wielenga wrote:
" type="cite">On 01/15/2013 08:40 PM, Kay Wrobel wrote:
Trying to follow that. So I haven't checked out anything just yet. So you're saying the code you have there right now is just the wizard and any resources related to it? Or is it still the entire JSF Plugin, just as a forked plogin?

It's most of the plugin.

But I removed a bunch of things that conflicted with the existing JSF Plugin. I.e., the fork has the same package structure and HAD the same files and layer entries as the JSF plugin that is installed in the IDE. That causes conflicts. So now I've removed a lot of the classes that are not needed for what you're trying to do, as well as a lot of layer entries.

Sorry again for the noobnessness here. My mind is still kinda bent on completely ripping that JSF Plugin and then getting rid of stuff that's not needed. Also, I feel lost with the many tutorials that are out there. Not even sure how to check out your code. I saw the link and followed it, but couldn't find a download.

There's a very clear "Checkout URL" link on that page. Sorry, I'm not going to spend time explaining how Subversion works.

Gj






On 01/15/2013 01:33 PM, Geertjan Wielenga wrote:


Do a fresh checkout, or update your checkout, because I committed many changes and now it works as you'd want.

When you compile and run the module, create a new web application, then generate entity classes, then go to the New File dialog, where you'll see a category "Kay's Wizards", containing one wizard, named "Kay's JSF Pages from Entity Classes". In one of the subsequent dialogs you'll see a label "Hi Kay", to prove that anything can now be changed from within the source code in the repo.

Gj

On 01/15/2013 06:02 PM, Kay Wrobel wrote:
Thank you.

On 01/15/2013 10:52 AM, Geertjan Wielenga wrote:


PS: I used 7.2.1 when creating that module. I suggest you use 7.2.1 or later when working with it.



On 01/15/2013 05:51 PM, Geertjan Wielenga wrote:
On 01/15/2013 05:46 PM, Kay Wrobel wrote:
That was my thought initially and probably why I opted to just modify existing code and wizard. Alright let me take a look at how to change versions and make this a deployable module again.

I did it for you over the last few minutes and removed the parts which you probably don't need:

http://java.net/projects/nb-api-samples/sources/api-samples/show/versions/7.2/misc/ForkedJSFSupport

The above compiled and it includes the wizard code that you're interested in.

Can you tell me how I can get the new template files imported into the plugin and have them register in the IDE under the new module?


It really makes sense to spend some time with the tutorials:

http://netbeans.org/kb/trails/platform.html

For example, your question about file templates is dealt with in the File Template Module Tutorial, which you'll find on the above page.



Also, this is code I believe everyone would benefit from, not just my colleagues. We have discussed this briefly here at work, but we are willing to share this code with the community. Just don't know how.

Create a new issue in NetBeans issuezilla and attach a patch.

Gj



Kay

On 01/15/2013 10:02 AM, Geertjan Wielenga wrote:


Yeah, what you sent is too intertwined to form the basis of a separate module. I suggest you open the web.jsf module in your IDE, make your changes, increment the version (in the Project Properties dialog, as you'll see when you follow the tutorials and other documentation), and then create a new NBM from that to distribute among your colleagues.

Gj

On 01/15/2013 04:43 PM, Kay Wrobel wrote:
Gregg: I'm a dude ;-) Thanks ma and pa. It should have been an "i" not a "y" but they wanted the name to be special.

Anyway, I have done exactly what you suggested and send it off to Geertjan for review.

Kay (speeks: Kai)

On 01/15/2013 09:27 AM, Gregg Wonderly wrote:
It should be possible for her to do a tree diff against the code version that she started with, and take those diffs and review/apply them as patches back on top the existing development branch, and perform refactoring that might be necessary to try and separate the code into a separate module.

Are there others in the community which have interests in PrimeFaces who might like to help her put together a new module?

If she can get the original sources back from the netbeans site, a script, something like the following, would create diffs of everything under the tree.

#!/bin/bash

root=`pwd`  #run this at the root of kay's changes

#  This should be the same relative tree root as 'root'
oldroot=/path/to/original/tree

find . -type f -print | while read x
do
    if [ ! -f ${oldroot}/$x ]; then
        echo "added: $x"
    elif diff ${x} ${oldroot}/${x} >/dev/null; then
        echo no changes for $x >&2
    else
        # Context diffs with spaces ignored.
        diff -cb ${oldroot}/${x} ${x} >`dirname $x`/`basename $x`.diff
    fi
done

On the output of the script will be the list of new files. In the directories will be .diff files for each file different from the original.

Gregg Wonderly

On 1/15/2013 9:04 AM, Geertjan Wielenga wrote:

But, if you can, the ideal thing would be to copy out all the classes that
you're interested in and put those into a brand new module of your own.

Gj

On 01/15/2013 04:01 PM, Geertjan Wielenga wrote:


You can't. I advise, if you really want to do what you're doing, to publish
that whole module as a new version once you have made changes to it.

Gj

On 01/15/2013 03:35 PM, Kay Wrobel wrote:
So,

I just want to ping the developer community again on this topic. How can I
properly rip the "JSF Pages from Entity Classes" wizard out of the JSF Plugin
and turn it into a standalone module? Anybody?

Thanks,

Kay

On 01/11/2013 08:46 AM, Kay Wrobel wrote:
Hi Netbeans developers. This is my first post on this list. I have a
question that may have been asked before, but I was unable to find an answer
(maybe not the right search terms).

I have downloaded the NetBeans 7.2.1 source code and heavily modified
portions of the "JSF Plugin". Particularly I have modified the "JSF Pages
from Entity Classes" wizard to support PrimeFaces. I touched so many files
in the source, I almost can't even remember where I laid my hands on. I
actually can now generate a nice CRUD application that is completely
PrimeFaces compatible with dialogs and menu items and all. This is right now
triggered by a new CheckBox that I added on the second page of the wizard to
support PrimeFaces.

Now I realize that what I have done is maybe not the best approach because
now, I can't even distribute my solution to anybody because it's something
embedded deep in the JSF Plugin. What I would really love to do is create a
new Plugin (or module) and just completely rip this wizard from the original
source. But the wizard depends on other portions of the Plugin, i.e. for
generating the Entity facades and so forth.

Long story short, I need to create my own custom "PrimeFaces pages from
Entity Classes" and need some assistance on what to do. Please help.

Thank you

Kay
























The information in this e-mail is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, you may not print, save or otherwise store the e-mail or any of the contents thereof in electronic or physical form, nor copy, use or disseminate the information contained in the email.  If you are not an intended recipient,  please notify the sender of this email immediately.






The information in this e-mail is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, you may not print, save or otherwise store the e-mail or any of the contents thereof in electronic or physical form, nor copy, use or disseminate the information contained in the email.  If you are not an intended recipient,  please notify the sender of this email immediately.





The information in this e-mail is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, you may not print, save or otherwise store the e-mail or any of the contents thereof in electronic or physical form, nor copy, use or disseminate the information contained in the email.  If you are not an intended recipient,  please notify the sender of this email immediately.




The information in this e-mail is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, you may not print, save or otherwise store the e-mail or any of the contents thereof in electronic or physical form, nor copy, use or disseminate the information contained in the email.  If you are not an intended recipient,  please notify the sender of this email immediately.




The information in this e-mail is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, you may not print, save or otherwise store the e-mail or any of the contents thereof in electronic or physical form, nor copy, use or disseminate the information contained in the email.  If you are not an intended recipient,  please notify the sender of this email immediately.




The information in this e-mail is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, you may not print, save or otherwise store the e-mail or any of the contents thereof in electronic or physical form, nor copy, use or disseminate the information contained in the email.  If you are not an intended recipient,  please notify the sender of this email immediately.




The information in this e-mail is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, you may not print, save or otherwise store the e-mail or any of the contents thereof in electronic or physical form, nor copy, use or disseminate the information contained in the email.  If you are not an intended recipient,  please notify the sender of this email immediately.




The information in this e-mail is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, you may not print, save or otherwise store the e-mail or any of the contents thereof in electronic or physical form, nor copy, use or disseminate the information contained in the email.  If you are not an intended recipient,  please notify the sender of this email immediately.




The information in this e-mail is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, you may not print, save or otherwise store the e-mail or any of the contents thereof in electronic or physical form, nor copy, use or disseminate the information contained in the email.  If you are not an intended recipient,  please notify the sender of this email immediately.


[nbdev] Re: How to rip existing wizard from Netbeans Source

(continued)

[nbdev] Re: How to rip existing wizard from Netbeans Source

Kay Wrobel 01/16/2013

[nbdev] Re: How to rip existing wizard from Netbeans Source

Geertjan Wielenga 01/16/2013

[nbdev] Re: How to rip existing wizard from Netbeans Source

Kay Wrobel 01/16/2013

[nbdev] Re: How to rip existing wizard from Netbeans Source

Geertjan Wielenga 01/16/2013

[nbdev] Re: How to rip existing wizard from Netbeans Source

Kay Wrobel 01/16/2013

[nbdev] Re: How to rip existing wizard from Netbeans Source

Geertjan Wielenga 01/16/2013

[nbdev] Re: How to rip existing wizard from Netbeans Source

Kay Wrobel 01/16/2013

[nbdev] Re: How to rip existing wizard from Netbeans Source

Geertjan Wielenga 01/16/2013

[nbdev] Re: How to rip existing wizard from Netbeans Source

Kay Wrobel 01/17/2013

[nbdev] Re: How to rip existing wizard from Netbeans Source

Geertjan Wielenga 01/17/2013

[nbdev] Re: How to rip existing wizard from Netbeans Source

Kay Wrobel 01/17/2013

[nbdev] Re: How to rip existing wizard from Netbeans Source

Kay Wrobel 01/15/2013

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close