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 100114 - Libraries modifier - enhancement required by visual web framework
Summary: Libraries modifier - enhancement required by visual web framework
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Radko Najman
URL:
Keywords:
Depends on:
Blocks: 101642
  Show dependency tree
 
Reported: 2007-04-05 15:17 UTC by Radko Najman
Modified: 2007-08-01 12:26 UTC (History)
6 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 Radko Najman 2007-04-05 15:17:04 UTC
Visual web framework requires to add different kind of libraries,
e.g.,
    1st set of libraries: (e.g., libs.jsf-support.classpath) these libraries
       will be used for both Compile and WAR file.
       I think in the project customizer, it is shown in category 'Libraries',
       with 'Package' checked.

    2nd set of libraries: (e.g., libs.jdbcsupport-designtime.classpath) these
       libraries will only be used for Compile but not in the WAR file.
       I think in the project customizer, it is shown in category 'Libraries',
       with 'Package' un-checked.

    3rd set of libraries:(e.g., libs.jdbcsupport-runtime.classpath) these
       libraries will only be used for WAR file but not for Compile.
       I think in the project customizer, it is shown in category 
       'Build->Packaging', Path in WAR
Comment 1 Radko Najman 2007-04-05 15:29:45 UTC
The first requirement was addressed by WebProjectClassPathModifier (issue
#73198). Last two requirements can be addressed by WebProjectLibrariesModifier
which can be get from project's lookup.

Checking in api/WebProjectLibrariesModifier.java;
/cvs/web/project/src/org/netbeans/modules/web/project/api/WebProjectLibrariesModifier.java,v
 <--  WebProjectLibrariesModifier.java
initial revision: 1.1
done
Checking in classpath/WebProjectLibrariesModifierImpl.java;
/cvs/web/project/src/org/netbeans/modules/web/project/classpath/WebProjectLibrariesModifierImpl.java,v
 <--  WebProjectLibrariesModifierImpl.java
initial revision: 1.1
done
Checking in WebProject.java;
/cvs/web/project/src/org/netbeans/modules/web/project/WebProject.java,v  <-- 
WebProject.java
new revision: 1.110; previous revision: 1.109
done
Comment 2 _ potingwu 2007-04-13 20:20:29 UTC
Both addCompileLibraries and addPackageLibraries work great! But addCompileRoots
and addPackageRoots do not work. I don't see the added roots in the project
customizer.
Comment 3 _ potingwu 2007-04-19 20:37:18 UTC
Add Radko's comments here for tracking this API enhancement:
    //TODO: implement remove* methods" in WebProjectLibrariesModifier.

I need to change 'Enhancement' to 'Defect' because add*Root methods are not
working. It afects adding visualweb I18N localized jars, websvc, ...
Comment 4 Radko Najman 2007-04-20 13:13:35 UTC
Fixed problem with add*Root methods. Missing "!" in the condition, I'm sorry.
Downgrading to P3 and leaving opened till remove* methods are implemented.

Checking in WebProjectLibrariesModifierImpl.java;
/cvs/web/project/src/org/netbeans/modules/web/project/classpath/WebProjectLibrariesModifierImpl.java,v
 <--  WebProjectLibrariesModifierImpl.java
new revision: 1.2; previous revision: 1.1
done
Comment 5 _ potingwu 2007-04-20 21:05:04 UTC
Thanks! But looks like there is a regression now; addPackageRoots will remove
addPackageLibraries.

I.e., if only calls addPackageLibraries, then works good.
      if also calls addPackageRoots, then only 'roots' remained, 'libraries' gone!
Comment 6 Radko Najman 2007-04-23 15:08:58 UTC
Temporary using the visual model for additional package roots till the real
source of missing libraries problem is fixed.

Checking in ui/customizer/WarIncludesUiSupport.java;
/cvs/web/project/src/org/netbeans/modules/web/project/ui/customizer/WarIncludesUiSupport.java,v
 <--  WarIncludesUiSupport.java
new revision: 1.5; previous revision: 1.4
done
Checking in classpath/WebProjectLibrariesModifierImpl.java;
/cvs/web/project/src/org/netbeans/modules/web/project/classpath/WebProjectLibrariesModifierImpl.java,v
 <--  WebProjectLibrariesModifierImpl.java
new revision: 1.3; previous revision: 1.2
done
Comment 7 _ potingwu 2007-06-08 17:59:02 UTC
//TODO: implement remove* methods" in WebProjectLibrariesModifier.

Is it possible these methods been implemented for 6.0M10? Complib migration is
dependent on these APIs.

Besides, is it possible to add 'hasCompileLibrary', 'hasPackageLibrary',
'hasCompileRoot', and 'hasPackageRoot' APIs? Visual Web EJB needs these methods,
Edwin may have more details here. Or, the client site can code itself for
getting this info.
Comment 8 Radko Najman 2007-06-08 18:07:20 UTC
I'm aware of it, it is on my tasklist.
Comment 9 Radko Najman 2007-06-20 18:23:42 UTC
Remove* methods implemented.

Test must be written before closing the issue.


Checking in api/WebProjectLibrariesModifier.java;
/cvs/web/project/src/org/netbeans/modules/web/project/api/WebProjectLibrariesModifier.java,v  <-- 
WebProjectLibrariesModifier.java
new revision: 1.2; previous revision: 1.1
done
Checking in classpath/WebProjectLibrariesModifierImpl.java;
/cvs/web/project/src/org/netbeans/modules/web/project/classpath/WebProjectLibrariesModifierImpl.java,v  <-- 
WebProjectLibrariesModifierImpl.java
new revision: 1.5; previous revision: 1.4
done
Comment 10 _ edwingo 2007-07-11 21:50:48 UTC
I am trying to fix the following migration bug #101642 in visualweb where a Creator 2 project is opened in NB6. The
problem is that the UI shows there are unresolved references and asks the user to fix them. As part of project
migration, these references should just be deleted and this is possible to do manually with the UI. However, this should
be done automatically by the IDE so I would like to add code to my module to resolve these refs so the user does not
have to as part of a migration step. However, as I understand it, there is not an API to do this. I need help resolving
this issue. Po-ting tells me that I need to talk to Petr Pisl. Could Petr suggest a solution?
Comment 11 _ potingwu 2007-07-11 22:01:18 UTC
You can just use the remove* APIs under this issue to remove the references (they are already available). I think your
request is to add has* APIs to detect the no-longer-needed references.
Comment 12 _ edwingo 2007-07-11 22:27:13 UTC
But, how do I enumerate the references? I'd like to enumerate the broken references in the "Libraries" and
"Build->Packaging" sections and delete them. This is easy to do in the UI but how do I do this programmatically? Also,
this needs to be done before the code that asks the user to resolve the broken references gets invoked or there may be a
race condition. To be safe, it should also be possible find out the name of the references and delete only some of them.
That way if the project had some other broken references that are unrelated to component libraries, the user would be
able to fix them using the normal NetBeans UI.
Comment 13 Petr Jiricka 2007-07-16 21:47:38 UTC
This last comment is too far away from the original report, I think we got too far away. Can you please file it as a
separate issue, if this is a request?
Comment 14 Petr Pisl 2007-07-17 09:21:40 UTC
I agree with Petr Jiricka that Edwin's comment doesn't fit the original problem. Closing this. File a different issue. 
Comment 15 _ edwingo 2007-07-17 17:16:11 UTC
I created issue 110040 and would appreciate any help.
Comment 16 Satyaranjan D 2007-07-30 18:11:18 UTC
We have the same requirement for Compile time classpaths in PortalPack project (http://portalpack.netbeans.org). FYI,
Portal Pack project is a netbeans.org project for Portlet support. This module provides a "Portlet Support" framework
which can be added to a web application. In this module we have the same requirement of adding some libraries which are
required only during compile time. I saw that this issue is fixed but as these apis are not public and Portal Pack is
not a friend package of web project, we can't actually use these api in our Portlet Web Framework. Could you please
suggest any way to use these apis ? 

I would really appreciate any help on this.

Thanks
Comment 17 Petr Pisl 2007-07-31 10:29:18 UTC
For NetBeans 6.0 you have to possibilities. You can have implementation dependency (I don't recommend this) or better
way - write the name of your module and I will put your module as a friend of the api. 
Comment 18 Satyaranjan D 2007-07-31 19:33:57 UTC
Thanks for your response. 
The module name is org.netbeans.modules.portalpack.portlets.genericportlets
Could you please add it as a friend module ?
Comment 19 Petr Pisl 2007-08-01 12:26:11 UTC
Done.  org.netbeans.modules.portalpack.portlets.genericportlets module is in the list of friend modules.