This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 126179 - Visual JSF Portlet support seems to be broken
Summary: Visual JSF Portlet support seems to be broken
Status: VERIFIED FIXED
Alias: None
Product: contrib
Classification: Unclassified
Component: Portalpack (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P1 blocker (vote)
Assignee: Satyaranjan D
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-29 11:06 UTC by Dan Kolar
Modified: 2009-03-17 07:25 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Kolar 2008-01-29 11:06:43 UTC
Product Version: NetBeans IDE 6.0.1 (Build 200801231200)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b02
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

PortalPack installed

1) Create new Web application with portlet framework
2) Create new Visual JSF portlet Page on this project

Portlet support for Visual JSF is broken:no portlet entry addet to portlet.xml, project can't be deployed (and ide
throws an exception), setting page mode doesn't work...
Creator 2 imported projects work as they should.
Comment 1 Satyaranjan D 2008-01-29 11:56:04 UTC
Please follow the following steps to create a JSF Portlet
- Create a Web application without selecting "Portlet Support" or "Visual Server Faces" framework.
- Then create a Visual Portlet Page and deploy

The problem occurs when 'Portlet Support' framework is selected. 
Cause: When Portlet Support framework is selected, it creates a portlet.xml file with a default portlet(if create
portlet checkbox is  checked). Now when user tries to create a Visual Portlet Page, it should add a new portlet entry
for the visual portlet inside portlet.xml . But currently it doesn't add a portlet entry for a Visual Portlet Page, if
portlet.xml is already there with some other portlets.
IMO, during visual portlet page creation, plugin should check if there is any visual portlet entry present inside
portlet.xml, if no, add a new one for newly created visual portlet page.
if yes, update the existing portlet element if required.

Comment 2 _ potingwu 2008-01-29 17:57:48 UTC
Yes, it's a known issue that interaction between Portal-Pack and VW-Portlet is not fully implemented. I think they are
all minor UI issues that all have workarounds. We may just fix them in 6.1 or later.

If the portlet.xml has any valid <application>, then you can use the context menu of the newly created Visual Web
Portlet page to set as the Initial View/Edit/Help Mode Page. The deployment will work.

Here is what we should do:
- When add Visual Web Portlet Page, currently it checks if there is portlet.xml file. If not, then add it. If yes, then
do nothing; it should add a new valid <application> if there is no any and add itself as the initial page.
- When deploy the project, we may also need to check whether there is a valid <application> and a valid initial page set.
Comment 3 Petr Blaha 2008-02-04 10:54:34 UTC
Sorry, but suggested workaround (don't choose Portlet support framework and then add portlet further) isn't very
intuitive. The issue is considered as stopper.
Comment 4 Mark Dey 2008-02-05 01:08:31 UTC
Anyone who is at all interested in creating a portlet (visual or non visual) will be naturally drawn to the Portlet Framework option in the project wizard. If the 
user selects this framework, it must do the right thing with respect to Visual Portlets otherwise the feature appears broken out of the box. I agree that this 
bug should be fixed before considering this feature beta-ready.
Comment 5 Satyaranjan D 2008-02-08 09:40:43 UTC
This issue is fixed. Code diff can be found at http://hg.netbeans.org/main/contrib/rev/f78f575569c9

Summary of Fix:
- JSF Portlet Page can only be supported in Portlet 1.0 (JSR 168) project.
- When JSF Portlet page is created, before updating portlet.xml, check if portlet.xml is present
            - If not present, create a portlet entry for the new JSF Portlet
            - If present, then check if there is any VisualJSFPortlet exists inside portlet.xml(It checks
<portlet-class> tag to find out if it's a portlet tag for JSF Portlet or not)
                            - If no VisualJSFPortlet exists, create a new one for the newly created jsf portlet page
                            - If a Visual JSFPortlet exists, then do nothing.
Comment 6 Petr Blaha 2008-02-12 09:36:14 UTC
Dan, please verify the bug ASAP. Thanks
Comment 7 Dan Kolar 2008-02-12 10:08:08 UTC
It works, as it should, BUT:

1) Create web app w/o framework
2) Create JSF portlet page in it
3) Create JSR-168 portlet in it

Portlet 1.0(JSR-168) library isn't added to the project, so JSR-168 portlet class is uncompilable due to missing
javax.portlet packages.
Comment 8 Petr Blaha 2008-02-12 10:46:04 UTC
Dane, this is different issue, please track this in new one.
Comment 9 Dan Kolar 2008-02-12 12:10:05 UTC
Works as desired.
Comment 10 Dan Kolar 2008-02-12 12:19:08 UTC
v.