NB 7.0 specific changes and merge with 9849513fd3c5
authorsatyaranjan@netbeans.org
Sun, 26 Jun 2011 10:25:14 +0800
changeset 1750985837f379ed8
parent 17506 0eb63ba1cc95
child 17510 180ed2653ebd
NB 7.0 specific changes and merge with 9849513fd3c5
portalpack.cms/l10n/build.xml
portalpack.cms/l10n/js/placeholder.txt
portalpack.cms/l10n/pt_BR/placeholder.txt
portalpack.cms/l10n/zh_CN/placeholder.txt
portalpack.cms/manifest.mf
portalpack.cms/nbproject/project.properties
portalpack.cms/nbproject/project.xml
portalpack.cms/src/org/netbeans/modules/portalpack/cms/layer.xml
portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/AuthContext.xml
portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/Category.xml
portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/Content.xml
portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentByNames.xml
portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentType.xml
portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentVersions.xml
portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentView.xml
portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentsByType.xml
portalpack.commons.palette/l10n/build.xml
portalpack.commons.palette/l10n/js/placeholder.txt
portalpack.commons.palette/l10n/pt_BR/placeholder.txt
portalpack.commons.palette/l10n/zh_CN/placeholder.txt
portalpack.commons.palette/manifest.mf
portalpack.commons.palette/nbproject/project.properties
portalpack.commons.palette/nbproject/project.xml
portalpack.commons/external/json-license.txt
portalpack.commons/l10n/build.xml
portalpack.commons/l10n/js/placeholder.txt
portalpack.commons/l10n/pt_BR/placeholder.txt
portalpack.commons/l10n/zh_CN/placeholder.txt
portalpack.commons/license.txt
portalpack.commons/manifest.mf
portalpack.commons/nbproject/project.properties
portalpack.commons/nbproject/project.xml
portalpack.commons/src/org/netbeans/modules/portalpack/commons/LibraryHelper.java
portalpack.commons/src/org/netbeans/modules/portalpack/commons/resources/Bundle.properties
portalpack.commons/src/org/netbeans/modules/portalpack/commons/ruby/RubyPlatformUtil.java
portalpack.jsfportletbridge/build.xml
portalpack.jsfportletbridge/external/binaries-list
portalpack.jsfportletbridge/manifest.mf
portalpack.jsfportletbridge/nbproject/project.properties
portalpack.jsfportletbridge/src/org/netbeans/modules/portalpack/jsfportletbridge/jsf-portlet-runtime.xml
portalpack.jsfportletbridge/src/org/netbeans/modules/portalpack/jsfportletbridge/jsfportletbridge-1-2.xml
portalpack.jsfportletbridge/src/org/netbeans/modules/portalpack/jsfportletbridge/portlet-runtime.xml
portalpack.portlets.genericportlets/build.xml
portalpack.portlets.genericportlets/manifest.mf
portalpack.portlets.genericportlets/nbproject/project.properties
portalpack.portlets.genericportlets/nbproject/project.xml
portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/core/actions/util/PortletProjectUtils.java
portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/core/util/NetbeansUtil.java
portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/frameworks/jsr168/JSR168WebFrameworkProvider.java
portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/layer.xml
portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/node/ddloaders/ElementNode.java
portalpack.portlets.spring/l10n/build.xml
portalpack.portlets.spring/l10n/js/placeholder.txt
portalpack.portlets.spring/l10n/pt_BR/placeholder.txt
portalpack.portlets.spring/l10n/zh_CN/placeholder.txt
portalpack.portlets.spring/manifest.mf
portalpack.portlets.spring/nbproject/project.properties
portalpack.portlets.spring/nbproject/project.xml
portalpack.portlets.spring/src/org/netbeans/modules/portalpack/portlets/spring/resources/layer.xml
portalpack.portlets.spring/src/org/netbeans/modules/portalpack/portlets/spring/ui/SpringDetailsPanelGUI.java
portalpack.saw/l10n/build.xml
portalpack.saw/l10n/js/placeholder.txt
portalpack.saw/l10n/pt_BR/placeholder.txt
portalpack.saw/l10n/zh_CN/placeholder.txt
portalpack.saw/manifest.mf
portalpack.saw/nbproject/project.xml
portalpack.saw/src/org/netbeans/modules/portalpack/saw/layer.xml
portalpack.servers.base_psframework/build.xml
portalpack.servers.base_psframework/manifest.mf
portalpack.servers.base_psframework/nbproject/project.properties
portalpack.servers.base_psframework/nbproject/project.xml
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/JSR88DeploymentHandler.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSConfigCallBackHandler.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSDeployerImpl.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSJ2eePlatformImpl.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSModuleConfiguration.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSModuleID.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSStartServer.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/WS70StartServer.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/WizardPropertyReader.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/api/Bundle.properties
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/api/PSDeploymentFactory.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/api/PSDeploymentManager.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/api/PSStartServerInf.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/common/ServerConstants.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/common/ShortCircuitProgressObject.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/DefaultStartServerImpl.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/config/SunPSModuleConfiguration.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/DefaultJEEServerLibraries.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/DefaultServerDeployHandler.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/JEEServerLibraries.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/JEEServerLibrariesFactory.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/ServerDeployHandler.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/ServerDeployerHandlerFactory.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBConfigPanel.form
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBConfigPanel.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBConfigUtil.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBConstant.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBDeployHandler.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBFindJSPServlet.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBShutdownException.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBStartServer.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBossJEELabraries.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/Bundle.properties
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/GlassFishJMXHandler.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/GlassFishServerDeployHandler.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/GlassFishV3JMXHandler.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/GlassfishV3ConfigUtil.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/MasterPasswordInputDialog.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/MasterPasswordInputPanel.form
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/MasterPasswordInputPanel.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/PortDetector.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppConfigUtil.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppIncrementalDeployment.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerConfigPanel.form
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerConfigPanel.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerConstants.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerJEELibraries.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerStartServer.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatConfigPanel.form
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatConfigPanel.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatDeployHandler.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatIncrementalDeployment.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatJEELibraries.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatStartServer.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/nodes/actions/ShowServerLogAction.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/nodes/actions/UndeployAction.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/util/Base64Routines.java
portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/util/PSConfigObject.java
portalpack.servers.opensourcepc/build.xml
portalpack.servers.opensourcepc/manifest.mf
portalpack.servers.opensourcepc/nbproject/project.properties
portalpack.servers.opensourcepc/nbproject/project.xml
portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/JNPCDeploymentManager.java
portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/JNPCJ2eePlatformImpl.java
portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/impl/JNPCTaskHandler.java
portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/pc20/Bundle.properties
portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/pc20/PC20TaskHandler.java
portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/ui/PCConfigPanel.form
portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/ui/PCConfigPanel.java
portalpack.servers.sunps/build.xml
portalpack.servers.sunps/manifest.mf
portalpack.servers.sunps/nbproject/project.xml
portalpack.servers.websynergy/l10n/build.xml
portalpack.servers.websynergy/l10n/js/placeholder.txt
portalpack.servers.websynergy/l10n/org/netbeans/modules/portalpack/servers/liferay/Bundle.properties
portalpack.servers.websynergy/l10n/org/netbeans/modules/portalpack/servers/liferay/impl/Bundle.properties
portalpack.servers.websynergy/l10n/org/netbeans/modules/portalpack/servers/liferay/portlets/php/Bundle.properties
portalpack.servers.websynergy/l10n/org/netbeans/modules/portalpack/servers/liferay/portlets/php/actions/Bundle.properties
portalpack.servers.websynergy/l10n/org/netbeans/modules/portalpack/servers/liferay/resources/Bundle.properties
portalpack.servers.websynergy/l10n/org/netbeans/modules/portalpack/servers/liferay/ui/Bundle.properties
portalpack.servers.websynergy/l10n/pt_BR/placeholder.txt
portalpack.servers.websynergy/l10n/zh_CN/placeholder.txt
portalpack.servers.websynergy/manifest.mf
portalpack.servers.websynergy/nbproject/project.properties
portalpack.servers.websynergy/nbproject/project.xml
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/Bundle.properties
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ContainerStartHandlerFactory.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/LiferayConfigPanelManagerImpl.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/LiferayDeploymentManager.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/LiferayJ2eePlatformImpl.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/LiferayNodeConfiguration.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/catalog/LiferayDTDCatalog.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/catalog/LiferayDTDDef.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/common/LiferayConstants.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/common/WSConstants.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/common/WebSpacePropertiesUtil.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/config/Bundle.properties
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/config/LiferayPortletXMLListener.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/config/LiferayXMLUtil.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/impl/Bundle.properties
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/impl/JBossStartStopServerListener.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/impl/LiferayHelper.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/impl/LiferayTaskHandler.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/Bundle.properties
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/HookChildrenNode.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/HookHolderNode.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/HookNode.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/LiferayNodeConstants.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/ThemeChildrenNode.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/ThemeHolderNode.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/ThemeNode.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/actions/Bundle.properties
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/actions/UndeployAction.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/Bundle.properties
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_4_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_5_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_5_1_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_5_2_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_6_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-hook_5_1_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-hook_5_2_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-hook_6_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-layout-templates_6_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-look-and-feel_6_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-plugin-package_4_3_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-plugin-package_6_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-plugin-repository_6_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_4_4_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_5_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_5_1_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_5_2_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_6_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-service-builder_5_1_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-service-builder_5_2_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-service-builder_6_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-theme-loader_6_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/hook.png
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/layer.xml
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/liferay-display_4_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/liferay-display_5_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/liferay-plugin-package_4_3_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/liferay-portlet-app_4_4_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/liferay-portlet-app_5_0_0.dtd
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/mfolder.gif
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/theme.png
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/wait.gif
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/Bundle.properties
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/CustomProperties.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/LiferayConfigPanel.form
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/LiferayConfigPanel.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/PortalEXTModifier.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/WSConfigPanel.form
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/WSConfigPanel.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/util/TemplateNotFoundException.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/util/TemplateUtil.java
portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ws/Bundle.properties
portalpack.servers.websynergy/src/templates/liferay-display-400.template
portalpack.servers.websynergy/src/templates/liferay-display.template
portalpack.servers.websynergy/src/templates/liferay-plugin-package-430.template
portalpack.servers.websynergy/src/templates/liferay-plugin-package.template
portalpack.servers.websynergy/src/templates/liferay-portlet-440.template
portalpack.servers.websynergy/src/templates/liferay-portlet.template
portalpack.servers.websynergy/src/templates/portal-developer.properties
portalpack.visualweb/manifest.mf
portalpack.visualweb/nbproject/project.xml
portalpack.visualweb/src/org/netbeans/modules/portalpack/visualweb/layer.xml
portalpack.visualweb/src/org/netbeans/modules/portalpack/visualweb/templates/PortletPage.jsp.template
portalpack.webflow/l10n/build.xml
portalpack.webflow/l10n/js/placeholder.txt
portalpack.webflow/l10n/pt_BR/placeholder.txt
portalpack.webflow/l10n/zh_CN/placeholder.txt
portalpack.webflow/nbproject/project.properties
portalpack.webflow/nbproject/project.xml
portalpack.webflow/src/META-INF/services/org.netbeans.modules.portalpack.webflow.api.WebFlowEditorViewFactory
portalpack.webflow/src/org/netbeans/modules/portalpack/webflow/WebFlowEditorViewFactoryImpl.java
portalpack.webflow/src/org/netbeans/modules/portalpack/webflow/WebFlowEditorViewFactoryStoryBoardImpl.java
portalpack.webflow/src/org/netbeans/modules/portalpack/webflow/resources/layer.xml
portalpack.websynergy.palette/l10n/build.xml
portalpack.websynergy.palette/l10n/js/placeholder.txt
portalpack.websynergy.palette/l10n/pt_BR/placeholder.txt
portalpack.websynergy.palette/l10n/zh_CN/placeholder.txt
portalpack.websynergy.palette/manifest.mf
portalpack.websynergy.palette/nbproject/project.properties
portalpack.websynergy.palette/nbproject/project.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleResourceByPK.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearch.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchByKeywords.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchCount.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchCountByKeywords.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articlesById.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/authContext.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearch.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchByKeywords.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchCount.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchCountByKeywords.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/latestArticleById.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/layoutIdsByArticleId.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureById.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearch.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchByKeywords.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchCount.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchCountByKeywords.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureTemplatesById.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateById.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearch.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchByKeywords.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchCount.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchCountByKeywords.xml
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/resources/Bundle.properties
portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/resources/layer.xml
portalpack.websynergy.portlets/l10n/build.xml
portalpack.websynergy.portlets/l10n/js/placeholder.txt
portalpack.websynergy.portlets/l10n/pt_BR/placeholder.txt
portalpack.websynergy.portlets/l10n/zh_CN/placeholder.txt
portalpack.websynergy.portlets/manifest.mf
portalpack.websynergy.portlets/nbproject/project.properties
portalpack.websynergy.portlets/nbproject/project.xml
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/WebSpacePrivilegedTemplates.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/groovy/resources/Groovy.html
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/Bundle.properties
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/api/ConfigPanel.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/api/DefaultConfigPanel.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/api/HookType.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/api/HookTypeFactory.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/api/HookTypeHandler.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/api/WizardDescriptorPanelWrapper.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/events/Bundle.properties
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/events/EventHandlerConfigPanel.form
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/events/EventHandlerConfigPanel.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/events/EventHandlerTypeHandler.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/model/Bundle.properties
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/model/ModelListenerConfigPanel.form
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/model/ModelListenerConfigPanel.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/model/ModelListenerTypeHandler.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/portalproperties/Bundle.properties
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/portalproperties/PortalPropertiesConfigPanel.form
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/portalproperties/PortalPropertiesConfigPanel.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/portalproperties/PortalPropertiesTypeHandler.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/jsp/Bundle.properties
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/jsp/JSPHookConfigPanel.form
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/jsp/JSPHookConfigPanel.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/jsp/JSPHookTypeHandler.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/resources/Hook.html
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/resources/hook.png
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/resources/search.png
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/eventhook.template
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/liferay-hook-template.xml
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/mdllsnrhook.template
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/mdllsnrhook_5_2_3.template
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/portal-props-template.properties
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/startupeventhook.template
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/ui/Bundle.properties
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/ui/HookDetailsPanel.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/ui/HookDetailsPanelGUI.form
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/ui/HookDetailsPanelGUI.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/ui/HookPluginWizardIterator.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/nonjava/Bundle.properties
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/php/resources/PHP.html
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/resources/Bundle.properties
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/resources/layer.xml
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/ruby/RubyPortletBuilder.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/ruby/RubyPortletProjectUtil.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/ruby/resources/Ruby.html
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/helper/LookAndFeelXMLHelper.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/resources/theme.png
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/resources/theme2.png
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/templates/liferay-look-and-feel.template
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/ThemeDetailsHandler.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/ThemeWizardVisualPanel.form
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/ThemeWizardVisualPanel.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/ThemeWizardWizardIterator.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/ThemeWizardWizardPanel.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/themeWizard.html
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/util/PluginXMLUtil.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/util/PortalPropertyUtil.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/util/ui/Bundle.properties
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/util/ui/DirectoryTree.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/vm/codecompletion/MethodInfo.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/vm/codecompletion/VelocityCompletionItem.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/vm/codecompletion/VelocityCompletionProvider.java
portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/vm/resources/Velocity.xml
portalpack.websynergy.servicebuilder/external/binaries-list
portalpack.websynergy.servicebuilder/l10n/build.xml
portalpack.websynergy.servicebuilder/l10n/js/placeholder.txt
portalpack.websynergy.servicebuilder/l10n/pt_BR/placeholder.txt
portalpack.websynergy.servicebuilder/l10n/zh_CN/placeholder.txt
portalpack.websynergy.servicebuilder/manifest.mf
portalpack.websynergy.servicebuilder/nbproject/project.properties
portalpack.websynergy.servicebuilder/nbproject/project.xml
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/catalog/RegisterDTDCatalog.java
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/Bundle.properties
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ColumnWidget.java
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/DesignView.java
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/AddColumnUI.form
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/AddColumnUI.java
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/AddServiceUI.form
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/AddServiceUI.java
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/Bundle.properties
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/PreferencesUI.form
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/PreferencesUI.java
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/widgets/TableWidget.java
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/helper/Bundle.properties
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/helper/GenerateServiceHelper.java
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/Bundle.properties
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/ServiceBuilderTemplate.xml
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/ServiceDescription.html
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/build-service.xml
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/layer.xml
portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/liferay-service-builder_6_0_0.dtd
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/portalpack.cms/l10n/build.xml	Sun Jun 26 10:25:14 2011 +0800
     1.3 @@ -0,0 +1,60 @@
     1.4 +<?xml version="1.0" encoding="UTF-8"?>
     1.5 +
     1.6 +<!--
     1.7 +The contents of this file are subject to the terms of the Common Development
     1.8 +and Distribution License (the License). You may not use this file except in
     1.9 +compliance with the License.
    1.10 +
    1.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
    1.12 +or http://www.netbeans.org/cddl.txt.
    1.13 +
    1.14 +When distributing Covered Code, include this CDDL Header Notice in each file
    1.15 +and include the License file at http://www.netbeans.org/cddl.txt.
    1.16 +If applicable, add the following below the CDDL Header, with the fields
    1.17 +enclosed by brackets [] replaced by your own identifying information:
    1.18 +"Portions Copyrighted [year] [name of copyright owner]"
    1.19 +
    1.20 + The Original Software is NetBeans. The Initial Developer of the Original
    1.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
    1.22 + Microsystems, Inc. All Rights Reserved.
    1.23 +-->
    1.24 +
    1.25 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
    1.26 +<!-- for some information on what you could do (e.g. targets to override). -->
    1.27 +<!-- If you delete this file and reopen the project it will be recreated. -->
    1.28 +<project name="ml-build" default="netbeans" basedir="../">
    1.29 +    
    1.30 +    <description>Portal Pack ML build</description>
    1.31 +    <import file="../build.xml"/>
    1.32 +    <target name="create-l10n-kit">
    1.33 +         <property name="l10nkit-dir" value="build/l10n"/>
    1.34 +         <property name="l10nkit-zip" value="build/portalpack-cms-l10nkit.zip"/>
    1.35 +         <delete dir="${l10nkit-dir}"/>
    1.36 +         <delete file="${l10nkit-zip}"/>
    1.37 +         
    1.38 +         <mkdir dir="${l10nkit-dir}"/>
    1.39 +         
    1.40 +         <copydir src="src" includes="**/Bundle.properties,**/*.html,**/*.htm" dest="${l10nkit-dir}/src"/>
    1.41 +
    1.42 +         <zip destfile="${l10nkit-zip}"
    1.43 +           basedir="${l10nkit-dir}"
    1.44 +         />
    1.45 +    </target>
    1.46 +    
    1.47 +    <target name="compile" depends="contrib/portalpack.cms.compile">
    1.48 +        <copy todir="build/classes">
    1.49 +             <fileset dir="l10n/ja"/>
    1.50 +             <fileset dir="l10n/pt_BR"/>
    1.51 +             <fileset dir="l10n/zh_CN"/>  
    1.52 +         </copy>
    1.53 +     </target>
    1.54 +	 
    1.55 +	 <target name="copyL10n">
    1.56 +		 <echo message="${l10n.src.dir}"/>
    1.57 +		 <copy todir=".">
    1.58 +			<fileset dir="${l10n.src.dir}"/>			
    1.59 +			<mapper type="glob" from="src" to="l10n/${locale}"/>
    1.60 +		 </copy>
    1.61 +	 </target>
    1.62 +      
    1.63 +</project>
     2.1 --- a/portalpack.cms/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
     2.2 +++ b/portalpack.cms/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
     2.3 @@ -2,5 +2,5 @@
     2.4  OpenIDE-Module: org.netbeans.modules.portalpack.cms
     2.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/cms/layer.xml
     2.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/cms/Bundle.properties
     2.7 -OpenIDE-Module-Specification-Version: 0.99
     2.8 +OpenIDE-Module-Specification-Version: 1.0.4
     2.9  
     3.1 --- a/portalpack.cms/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
     3.2 +++ b/portalpack.cms/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
     3.3 @@ -44,5 +44,4 @@
     3.4  
     3.5  # By defualt, license.file points to portalpack's default license file. It can be
     3.6  # changed to point module specific license file.
     3.7 -license.file=../../LICENSE
     3.8  nbm.homepage=http://portalpack.netbeans.org
     4.1 --- a/portalpack.cms/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
     4.2 +++ b/portalpack.cms/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
     4.3 @@ -49,24 +49,6 @@
     4.4                      </run-dependency>
     4.5                  </dependency>
     4.6                  <dependency>
     4.7 -                    <code-name-base>org.netbeans.modules.editor</code-name-base>
     4.8 -                    <build-prerequisite/>
     4.9 -                    <compile-dependency/>
    4.10 -                    <run-dependency>
    4.11 -                        <release-version>3</release-version>
    4.12 -                        <specification-version>1.53</specification-version>
    4.13 -                    </run-dependency>
    4.14 -                </dependency>
    4.15 -                <dependency>
    4.16 -                    <code-name-base>org.netbeans.modules.editor.lib</code-name-base>
    4.17 -                    <build-prerequisite/>
    4.18 -                    <compile-dependency/>
    4.19 -                    <run-dependency>
    4.20 -                        <release-version>3</release-version>
    4.21 -                        <specification-version>3.1</specification-version>
    4.22 -                    </run-dependency>
    4.23 -                </dependency>
    4.24 -                <dependency>
    4.25                      <code-name-base>org.netbeans.modules.java.editor.lib</code-name-base>
    4.26                      <build-prerequisite/>
    4.27                      <compile-dependency/>
     5.1 --- a/portalpack.cms/src/org/netbeans/modules/portalpack/cms/layer.xml	Fri Jun 10 09:46:37 2011 +0200
     5.2 +++ b/portalpack.cms/src/org/netbeans/modules/portalpack/cms/layer.xml	Sun Jun 26 10:25:14 2011 +0800
     5.3 @@ -5,28 +5,28 @@
     5.4          <folder name="CMS">
     5.5              <attr name="position" intvalue="642"/>
     5.6              <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.portalpack.cms.Bundle"/>
     5.7 -            <file name="AuthContext.xml" url="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/AuthContext.xml"/>
     5.8 -            <file name="Category.xml" url="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/Category.xml"/>
     5.9 -            <file name="ContentType.xml" url="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentType.xml"/>
    5.10 -            <file name="Content.xml" url="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/Content.xml"/>
    5.11 -            <file name="ContentView.xml" url="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentView.xml"/>
    5.12 -            <file name="ContentVersions.xml" url="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentVersions.xml"/>
    5.13 -            <file name="ContentsByType.xml" url="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentsByType.xml"/>
    5.14 -            <file name="ContentByNames.xml" url="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentByNames.xml"/>
    5.15 +            <file name="AuthContext.xml" url="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/AuthContext.xml"/>
    5.16 +            <file name="Category.xml" url="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/Category.xml"/>
    5.17 +            <file name="ContentType.xml" url="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/ContentType.xml"/>
    5.18 +            <file name="Content.xml" url="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/Content.xml"/>
    5.19 +            <file name="ContentView.xml" url="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/ContentView.xml"/>
    5.20 +            <file name="ContentVersions.xml" url="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/ContentVersions.xml"/>
    5.21 +            <file name="ContentsByType.xml" url="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/ContentsByType.xml"/>
    5.22 +            <file name="ContentByNames.xml" url="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/ContentByNames.xml"/>
    5.23          </folder>
    5.24      </folder>
    5.25  	
    5.26  	<folder name="portalpack">
    5.27  		  <folder name="palette">
    5.28  			  <folder name="cms">
    5.29 -				  <file name="authcontext.template" url="nbresloc:/templates/authcontext.template"/>
    5.30 -				  <file name="category.template" url="nbresloc:/templates/category.template"/>
    5.31 -				  <file name="content.template" url="nbresloc:/templates/content.template"/> 
    5.32 -                                   <file name="content-by-names.template" url="nbresloc:/templates/content-by-names.template"/>
    5.33 -				  <file name="contenttype-by-id.template" url="nbresloc:/templates/contenttype-by-id.template"/>
    5.34 -				  <file name="contentversions.template" url="nbresloc:/templates/contentversions.template"/> 
    5.35 -                                  <file name="contentview.template" url="nbresloc:/templates/contentview.template"/> 
    5.36 -                                  <file name="contents-by-type-id.template" url="nbresloc:/templates/contents-by-type-id.template"/> 
    5.37 +				  <file name="authcontext.template" url="nbresloc:templates/authcontext.template"/>
    5.38 +				  <file name="category.template" url="nbresloc:templates/category.template"/>
    5.39 +				  <file name="content.template" url="nbresloc:templates/content.template"/> 
    5.40 +                                   <file name="content-by-names.template" url="nbresloc:templates/content-by-names.template"/>
    5.41 +				  <file name="contenttype-by-id.template" url="nbresloc:templates/contenttype-by-id.template"/>
    5.42 +				  <file name="contentversions.template" url="nbresloc:templates/contentversions.template"/> 
    5.43 +                                  <file name="contentview.template" url="nbresloc:templates/contentview.template"/> 
    5.44 +                                  <file name="contents-by-type-id.template" url="nbresloc:templates/contents-by-type-id.template"/> 
    5.45  			  </folder>
    5.46  		  </folder>
    5.47  	  </folder>
     6.1 --- a/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/AuthContext.xml	Fri Jun 10 09:46:37 2011 +0200
     6.2 +++ b/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/AuthContext.xml	Sun Jun 26 10:25:14 2011 +0800
     6.3 @@ -25,8 +25,8 @@
     6.4  <editor_palette_item version="1.0">
     6.5      <class name="org.netbeans.modules.portalpack.cms.palette.items.AuthContext" />
     6.6  
     6.7 -     <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/auth-context16.PNG" />
     6.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/auth-context32.PNG" />
     6.9 +     <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/auth-context16.PNG" />
    6.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/auth-context32.PNG" />
    6.11      <description localizing-bundle="org.netbeans.modules.portalpack.cms.palette.items.resources.Bundle"
    6.12                 display-name-key="NAME_AuthContext"
    6.13                 tooltip-key="HINT_AuthContext" />
     7.1 --- a/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/Category.xml	Fri Jun 10 09:46:37 2011 +0200
     7.2 +++ b/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/Category.xml	Sun Jun 26 10:25:14 2011 +0800
     7.3 @@ -25,8 +25,8 @@
     7.4  <editor_palette_item version="1.0">
     7.5      <class name="org.netbeans.modules.portalpack.cms.palette.items.Category" />
     7.6  
     7.7 -     <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/category16.PNG" />
     7.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/category32.PNG" />
     7.9 +     <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/category16.PNG" />
    7.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/category32.PNG" />
    7.11      <description localizing-bundle="org.netbeans.modules.portalpack.cms.palette.items.resources.Bundle"
    7.12                 display-name-key="NAME_Category"
    7.13                 tooltip-key="HINT_Category" />
     8.1 --- a/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/Content.xml	Fri Jun 10 09:46:37 2011 +0200
     8.2 +++ b/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/Content.xml	Sun Jun 26 10:25:14 2011 +0800
     8.3 @@ -25,8 +25,8 @@
     8.4  <editor_palette_item version="1.0">
     8.5      <class name="org.netbeans.modules.portalpack.cms.palette.items.Content" />
     8.6  
     8.7 -     <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/content16.PNG" />
     8.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/content32.PNG" />
     8.9 +     <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/content16.PNG" />
    8.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/content32.PNG" />
    8.11      <description localizing-bundle="org.netbeans.modules.portalpack.cms.palette.items.resources.Bundle"
    8.12                 display-name-key="NAME_Content"
    8.13                 tooltip-key="HINT_Content" />
     9.1 --- a/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentByNames.xml	Fri Jun 10 09:46:37 2011 +0200
     9.2 +++ b/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentByNames.xml	Sun Jun 26 10:25:14 2011 +0800
     9.3 @@ -25,8 +25,8 @@
     9.4  <editor_palette_item version="1.0">
     9.5      <class name="org.netbeans.modules.portalpack.cms.palette.items.ContentByNames" />
     9.6  
     9.7 -     <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/content16.PNG" />
     9.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/content32.PNG" />
     9.9 +     <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/content16.PNG" />
    9.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/content32.PNG" />
    9.11      <description localizing-bundle="org.netbeans.modules.portalpack.cms.palette.items.resources.Bundle"
    9.12                 display-name-key="NAME_ContentByNames"
    9.13                 tooltip-key="HINT_ContentByNames" />
    10.1 --- a/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentType.xml	Fri Jun 10 09:46:37 2011 +0200
    10.2 +++ b/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentType.xml	Sun Jun 26 10:25:14 2011 +0800
    10.3 @@ -25,8 +25,8 @@
    10.4  <editor_palette_item version="1.0">
    10.5      <class name="org.netbeans.modules.portalpack.cms.palette.items.ContentTypeById" />
    10.6  
    10.7 -     <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/content-type16.PNG" />
    10.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/content-type32.PNG" />
    10.9 +     <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/content-type16.PNG" />
   10.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/content-type32.PNG" />
   10.11      <description localizing-bundle="org.netbeans.modules.portalpack.cms.palette.items.resources.Bundle"
   10.12                 display-name-key="NAME_ContentType"
   10.13                 tooltip-key="HINT_ContentType" />
    11.1 --- a/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentVersions.xml	Fri Jun 10 09:46:37 2011 +0200
    11.2 +++ b/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentVersions.xml	Sun Jun 26 10:25:14 2011 +0800
    11.3 @@ -25,8 +25,8 @@
    11.4  <editor_palette_item version="1.0">
    11.5      <class name="org.netbeans.modules.portalpack.cms.palette.items.ContentVersions" />
    11.6  
    11.7 -     <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/content-versions16.PNG" />
    11.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/content-versions32.PNG" />
    11.9 +     <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/content-versions16.PNG" />
   11.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/content-versions32.PNG" />
   11.11      <description localizing-bundle="org.netbeans.modules.portalpack.cms.palette.items.resources.Bundle"
   11.12                 display-name-key="NAME_ContentVersions"
   11.13                 tooltip-key="HINT_ContentVersions" />
    12.1 --- a/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentView.xml	Fri Jun 10 09:46:37 2011 +0200
    12.2 +++ b/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentView.xml	Sun Jun 26 10:25:14 2011 +0800
    12.3 @@ -25,8 +25,8 @@
    12.4  <editor_palette_item version="1.0">
    12.5      <class name="org.netbeans.modules.portalpack.cms.palette.items.ContentView" />
    12.6  
    12.7 -     <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/content-view16.PNG" />
    12.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/content-view32.PNG" />
    12.9 +     <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/content-view16.PNG" />
   12.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/content-view32.PNG" />
   12.11      <description localizing-bundle="org.netbeans.modules.portalpack.cms.palette.items.resources.Bundle"
   12.12                 display-name-key="NAME_ContentView"
   12.13                 tooltip-key="HINT_ContentView" />
    13.1 --- a/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentsByType.xml	Fri Jun 10 09:46:37 2011 +0200
    13.2 +++ b/portalpack.cms/src/org/netbeans/modules/portalpack/cms/palette/items/resources/ContentsByType.xml	Sun Jun 26 10:25:14 2011 +0800
    13.3 @@ -25,8 +25,8 @@
    13.4  <editor_palette_item version="1.0">
    13.5      <class name="org.netbeans.modules.portalpack.cms.palette.items.ContentsByTypeId" />
    13.6  
    13.7 -     <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/contents-bytype16.PNG" />
    13.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/cms/palette/items/resources/contents-bytype32.PNG" />
    13.9 +     <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/contents-bytype16.PNG" />
   13.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/cms/palette/items/resources/contents-bytype32.PNG" />
   13.11      <description localizing-bundle="org.netbeans.modules.portalpack.cms.palette.items.resources.Bundle"
   13.12                 display-name-key="NAME_ContentsByType"
   13.13                 tooltip-key="HINT_ContentsByType" />
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/portalpack.commons.palette/l10n/build.xml	Sun Jun 26 10:25:14 2011 +0800
    14.3 @@ -0,0 +1,60 @@
    14.4 +<?xml version="1.0" encoding="UTF-8"?>
    14.5 +
    14.6 +<!--
    14.7 +The contents of this file are subject to the terms of the Common Development
    14.8 +and Distribution License (the License). You may not use this file except in
    14.9 +compliance with the License.
   14.10 +
   14.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
   14.12 +or http://www.netbeans.org/cddl.txt.
   14.13 +
   14.14 +When distributing Covered Code, include this CDDL Header Notice in each file
   14.15 +and include the License file at http://www.netbeans.org/cddl.txt.
   14.16 +If applicable, add the following below the CDDL Header, with the fields
   14.17 +enclosed by brackets [] replaced by your own identifying information:
   14.18 +"Portions Copyrighted [year] [name of copyright owner]"
   14.19 +
   14.20 + The Original Software is NetBeans. The Initial Developer of the Original
   14.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
   14.22 + Microsystems, Inc. All Rights Reserved.
   14.23 +-->
   14.24 +
   14.25 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
   14.26 +<!-- for some information on what you could do (e.g. targets to override). -->
   14.27 +<!-- If you delete this file and reopen the project it will be recreated. -->
   14.28 +<project name="ml-build" default="netbeans" basedir="../">
   14.29 +    
   14.30 +    <description>Portal Pack ML build</description>
   14.31 +    <import file="../build.xml"/>
   14.32 +    <target name="create-l10n-kit">
   14.33 +         <property name="l10nkit-dir" value="build/l10n"/>
   14.34 +         <property name="l10nkit-zip" value="build/portalpack-commons-palette-l10nkit.zip"/>
   14.35 +         <delete dir="${l10nkit-dir}"/>
   14.36 +         <delete file="${l10nkit-zip}"/>
   14.37 +         
   14.38 +         <mkdir dir="${l10nkit-dir}"/>
   14.39 +         
   14.40 +         <copydir src="src" includes="**/Bundle.properties,**/*.html,**/*.htm" dest="${l10nkit-dir}/src"/>
   14.41 +
   14.42 +         <zip destfile="${l10nkit-zip}"
   14.43 +           basedir="${l10nkit-dir}"
   14.44 +         />
   14.45 +    </target>
   14.46 +    
   14.47 +    <target name="compile" depends="contrib/portalpack.commons.palette.compile">
   14.48 +        <copy todir="build/classes">
   14.49 +             <fileset dir="l10n/ja"/>
   14.50 +             <fileset dir="l10n/pt_BR"/>
   14.51 +             <fileset dir="l10n/zh_CN"/>  
   14.52 +         </copy>
   14.53 +     </target>
   14.54 +	 
   14.55 +	 <target name="copyL10n">
   14.56 +		 <echo message="${l10n.src.dir}"/>
   14.57 +		 <copy todir=".">
   14.58 +			<fileset dir="${l10n.src.dir}"/>			
   14.59 +			<mapper type="glob" from="src" to="l10n/${locale}"/>
   14.60 +		 </copy>
   14.61 +	 </target>
   14.62 +      
   14.63 +</project>
    15.1 --- a/portalpack.commons.palette/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
    15.2 +++ b/portalpack.commons.palette/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
    15.3 @@ -2,5 +2,5 @@
    15.4  OpenIDE-Module: org.netbeans.modules.portalpack.commons.palette
    15.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/commons/palette/resources/layer.xml
    15.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/commons/palette/resources/Bundle.properties
    15.7 -OpenIDE-Module-Specification-Version: 0.99
    15.8 +OpenIDE-Module-Specification-Version: 1.0.5
    15.9  
    16.1 --- a/portalpack.commons.palette/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
    16.2 +++ b/portalpack.commons.palette/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
    16.3 @@ -1,2 +1,3 @@
    16.4 -javac.source=1.5
    16.5 +javac.source=1.6
    16.6  javac.compilerargs=-Xlint -Xlint:-serial
    16.7 +nbm.homepage=http://portalpack.netbeans.org
    17.1 --- a/portalpack.commons.palette/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
    17.2 +++ b/portalpack.commons.palette/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
    17.3 @@ -37,7 +37,7 @@
    17.4                      <compile-dependency/>
    17.5                      <run-dependency>
    17.6                          <release-version>3</release-version>
    17.7 -                        <specification-version>1.53</specification-version>
    17.8 +                        <specification-version>1.41.1</specification-version>
    17.9                      </run-dependency>
   17.10                  </dependency>
   17.11                  <dependency>
   17.12 @@ -45,8 +45,8 @@
   17.13                      <build-prerequisite/>
   17.14                      <compile-dependency/>
   17.15                      <run-dependency>
   17.16 -                        <release-version>3</release-version>
   17.17 -                        <specification-version>3.1</specification-version>
   17.18 +                        <release-version>1</release-version>
   17.19 +                        <specification-version>1.29.1</specification-version>
   17.20                      </run-dependency>
   17.21                  </dependency>
   17.22                  <dependency>
   17.23 @@ -123,9 +123,7 @@
   17.24                      <build-prerequisite/>
   17.25                      <compile-dependency/>
   17.26                      <run-dependency>
   17.27 -                        <specification-version>7.0</specification-version>
   17.28 -                        <!-- For NB 7.0 -->
   17.29 -                        <!-- specification-version>7.19</specification-version -->
   17.30 +                        <specification-version>7.19</specification-version>
   17.31                      </run-dependency>
   17.32                  </dependency>
   17.33                  <dependency>
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/portalpack.commons/external/json-license.txt	Sun Jun 26 10:25:14 2011 +0800
    18.3 @@ -0,0 +1,24 @@
    18.4 +The JSON License
    18.5 +--------------------------------
    18.6 +
    18.7 +Copyright (c) 2002 JSON.org
    18.8 +
    18.9 +Permission is hereby granted, free of charge, to any person obtaining a copy
   18.10 +of this software and associated documentation files (the "Software"), to deal
   18.11 +in the Software without restriction, including without limitation the rights
   18.12 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   18.13 +copies of the Software, and to permit persons to whom the Software is
   18.14 +furnished to do so, subject to the following conditions:
   18.15 +
   18.16 +The above copyright notice and this permission notice shall be included in all
   18.17 +copies or substantial portions of the Software.
   18.18 +
   18.19 +The Software shall be used for Good, not Evil.
   18.20 +
   18.21 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   18.22 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   18.23 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   18.24 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   18.25 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   18.26 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   18.27 +SOFTWARE.
   18.28 \ No newline at end of file
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/portalpack.commons/l10n/build.xml	Sun Jun 26 10:25:14 2011 +0800
    19.3 @@ -0,0 +1,60 @@
    19.4 +<?xml version="1.0" encoding="UTF-8"?>
    19.5 +
    19.6 +<!--
    19.7 +The contents of this file are subject to the terms of the Common Development
    19.8 +and Distribution License (the License). You may not use this file except in
    19.9 +compliance with the License.
   19.10 +
   19.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
   19.12 +or http://www.netbeans.org/cddl.txt.
   19.13 +
   19.14 +When distributing Covered Code, include this CDDL Header Notice in each file
   19.15 +and include the License file at http://www.netbeans.org/cddl.txt.
   19.16 +If applicable, add the following below the CDDL Header, with the fields
   19.17 +enclosed by brackets [] replaced by your own identifying information:
   19.18 +"Portions Copyrighted [year] [name of copyright owner]"
   19.19 +
   19.20 + The Original Software is NetBeans. The Initial Developer of the Original
   19.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
   19.22 + Microsystems, Inc. All Rights Reserved.
   19.23 +-->
   19.24 +
   19.25 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
   19.26 +<!-- for some information on what you could do (e.g. targets to override). -->
   19.27 +<!-- If you delete this file and reopen the project it will be recreated. -->
   19.28 +<project name="ml-build" default="netbeans" basedir="../">
   19.29 +    
   19.30 +    <description>Portal Pack ML build</description>
   19.31 +    <import file="../build.xml"/>
   19.32 +    <target name="create-l10n-kit">
   19.33 +         <property name="l10nkit-dir" value="build/l10n"/>
   19.34 +         <property name="l10nkit-zip" value="build/portalpack-commons-l10nkit.zip"/>
   19.35 +         <delete dir="${l10nkit-dir}"/>
   19.36 +         <delete file="${l10nkit-zip}"/>
   19.37 +         
   19.38 +         <mkdir dir="${l10nkit-dir}"/>
   19.39 +         
   19.40 +         <copydir src="src" includes="**/Bundle.properties,**/*.html,**/*.htm" dest="${l10nkit-dir}/src"/>
   19.41 +
   19.42 +         <zip destfile="${l10nkit-zip}"
   19.43 +           basedir="${l10nkit-dir}"
   19.44 +         />
   19.45 +    </target>
   19.46 +    
   19.47 +    <target name="compile" depends="contrib/portalpack.commons.compile">
   19.48 +        <copy todir="build/classes">
   19.49 +             <fileset dir="l10n/ja"/>
   19.50 +             <fileset dir="l10n/pt_BR"/>
   19.51 +             <fileset dir="l10n/zh_CN"/>  
   19.52 +         </copy>
   19.53 +     </target>
   19.54 +	 
   19.55 +	 <target name="copyL10n">
   19.56 +		 <echo message="${l10n.src.dir}"/>
   19.57 +		 <copy todir=".">
   19.58 +			<fileset dir="${l10n.src.dir}"/>			
   19.59 +			<mapper type="glob" from="src" to="l10n/${locale}"/>
   19.60 +		 </copy>
   19.61 +	 </target>
   19.62 +      
   19.63 +</project>
    20.1 --- a/portalpack.commons/license.txt	Fri Jun 10 09:46:37 2011 +0200
    20.2 +++ b/portalpack.commons/license.txt	Sun Jun 26 10:25:14 2011 +0800
    20.3 @@ -338,29 +338,3 @@
    20.4  
    20.5  ----------------------------------------------------------------
    20.6  
    20.7 -
    20.8 -The JSON License
    20.9 ---------------------------------
   20.10 -
   20.11 -Copyright (c) 2002 JSON.org
   20.12 -
   20.13 -Permission is hereby granted, free of charge, to any person obtaining a copy
   20.14 -of this software and associated documentation files (the "Software"), to deal
   20.15 -in the Software without restriction, including without limitation the rights
   20.16 -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   20.17 -copies of the Software, and to permit persons to whom the Software is
   20.18 -furnished to do so, subject to the following conditions:
   20.19 -
   20.20 -The above copyright notice and this permission notice shall be included in all
   20.21 -copies or substantial portions of the Software.
   20.22 -
   20.23 -The Software shall be used for Good, not Evil.
   20.24 -
   20.25 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   20.26 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   20.27 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   20.28 -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   20.29 -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   20.30 -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   20.31 -SOFTWARE.
   20.32 -
    21.1 --- a/portalpack.commons/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
    21.2 +++ b/portalpack.commons/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
    21.3 @@ -2,5 +2,5 @@
    21.4  OpenIDE-Module: org.netbeans.modules.portalpack.commons
    21.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/commons/resources/layer.xml
    21.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/commons/resources/Bundle.properties
    21.7 -OpenIDE-Module-Specification-Version: 0.99
    21.8 +OpenIDE-Module-Specification-Version: 1.0.5
    21.9  
    22.1 --- a/portalpack.commons/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
    22.2 +++ b/portalpack.commons/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
    22.3 @@ -1,2 +1,5 @@
    22.4 -javac.source=1.5
    22.5 +javac.source=1.6
    22.6  javac.compilerargs=-Xlint -Xlint:-serial
    22.7 +
    22.8 +extra.license.files=external/json-license.txt
    22.9 +nbm.homepage=http://portalpack.netbeans.org
    23.1 --- a/portalpack.commons/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
    23.2 +++ b/portalpack.commons/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
    23.3 @@ -40,24 +40,6 @@
    23.4                      </run-dependency>
    23.5                  </dependency>
    23.6                  <dependency>
    23.7 -                    <code-name-base>org.netbeans.modules.editor</code-name-base>
    23.8 -                    <build-prerequisite/>
    23.9 -                    <compile-dependency/>
   23.10 -                    <run-dependency>
   23.11 -                        <release-version>3</release-version>
   23.12 -                        <specification-version>1.53</specification-version>
   23.13 -                    </run-dependency>
   23.14 -                </dependency>
   23.15 -                <dependency>
   23.16 -                    <code-name-base>org.netbeans.modules.editor.lib</code-name-base>
   23.17 -                    <build-prerequisite/>
   23.18 -                    <compile-dependency/>
   23.19 -                    <run-dependency>
   23.20 -                        <release-version>3</release-version>
   23.21 -                        <specification-version>3.1</specification-version>
   23.22 -                    </run-dependency>
   23.23 -                </dependency>
   23.24 -                <dependency>
   23.25                      <code-name-base>org.netbeans.modules.java.editor.lib</code-name-base>
   23.26                      <build-prerequisite/>
   23.27                      <compile-dependency/>
   23.28 @@ -148,8 +130,7 @@
   23.29                      <build-prerequisite/>
   23.30                      <compile-dependency/>
   23.31                      <run-dependency>
   23.32 -                        <specification-version>7.0</specification-version>
   23.33 -                        <!--For NB 7.0 specification-version>7.19</specification-version -->
   23.34 +                        <specification-version>7.19</specification-version>
   23.35                      </run-dependency>
   23.36                  </dependency>
   23.37                  <dependency>
    24.1 --- a/portalpack.commons/src/org/netbeans/modules/portalpack/commons/LibraryHelper.java	Fri Jun 10 09:46:37 2011 +0200
    24.2 +++ b/portalpack.commons/src/org/netbeans/modules/portalpack/commons/LibraryHelper.java	Sun Jun 26 10:25:14 2011 +0800
    24.3 @@ -39,10 +39,17 @@
    24.4  package org.netbeans.modules.portalpack.commons;
    24.5  
    24.6  import java.io.IOException;
    24.7 +import java.lang.reflect.Method;
    24.8  import java.net.URL;
    24.9 +import org.netbeans.api.java.classpath.ClassPath;
   24.10 +import org.netbeans.api.java.project.JavaProjectConstants;
   24.11 +import org.netbeans.api.java.project.classpath.ProjectClassPathModifier;
   24.12  import org.netbeans.api.project.Project;
   24.13 +import org.netbeans.api.project.SourceGroup;
   24.14 +import org.netbeans.api.project.Sources;
   24.15  import org.openide.util.Lookup;
   24.16  import org.netbeans.modules.web.project.api.WebProjectLibrariesModifier;
   24.17 +import org.openide.filesystems.FileObject;
   24.18  
   24.19  /**
   24.20   *
   24.21 @@ -56,10 +63,104 @@
   24.22          Object modifierObj = lookup.lookup(WebProjectLibrariesModifier.class);
   24.23          if (modifierObj != null && (modifierObj instanceof WebProjectLibrariesModifier)) {
   24.24              try {
   24.25 -                ((WebProjectLibrariesModifier) modifierObj).addCompileRoots(roots);
   24.26 +                //((WebProjectLibrariesModifier) modifierObj).addCompileRoots(roots);
   24.27 +                
   24.28 +                Class[] paramTypes = {URL[].class};
   24.29 +                Method method = WebProjectLibrariesModifier.class.getMethod("addCompileRoots", paramTypes);
   24.30 +                    
   24.31 +                method.invoke(modifierObj, new Object[]{roots});
   24.32 +            } catch (Exception ex) {
   24.33 +                ex.printStackTrace();
   24.34 +            }
   24.35 +        }else {
   24.36 +            try {
   24.37 +                ProjectClassPathModifier.addRoots(roots, getSourceRoot(project), ClassPath.COMPILE);
   24.38              } catch (IOException ex) {
   24.39                  ex.printStackTrace();
   24.40 +            } catch (UnsupportedOperationException ex) {
   24.41 +                ex.printStackTrace();
   24.42              }
   24.43          }
   24.44 +                
   24.45 +    }
   24.46 +    
   24.47 +    public static void addPackageRoot(Project project,URL[] roots, String path) {
   24.48 +        
   24.49 +        Lookup lookup = project.getLookup();
   24.50 +        Object modifierObj = lookup.lookup(WebProjectLibrariesModifier.class);
   24.51 +        if (modifierObj != null && (modifierObj instanceof WebProjectLibrariesModifier)) {
   24.52 +            try {
   24.53 +                //((WebProjectLibrariesModifier) modifierObj).addPackageRoots(roots, path);
   24.54 +                 Class[] paramTypes = {URL[].class, String.class};
   24.55 +                 Method method = WebProjectLibrariesModifier.class.getMethod("addPackageRoots", paramTypes);
   24.56 +                    
   24.57 +                 method.invoke(modifierObj, new Object[]{roots,path});
   24.58 +                
   24.59 +            } catch (Exception ex) {
   24.60 +                ex.printStackTrace();
   24.61 +            }
   24.62 +        }else {
   24.63 +            try {
   24.64 +                ProjectClassPathModifier.addRoots(roots, getSourceRoot(project), ClassPath.COMPILE);
   24.65 +            } catch (IOException ex) {
   24.66 +                ex.printStackTrace();
   24.67 +            } catch (UnsupportedOperationException ex) {
   24.68 +                ex.printStackTrace();
   24.69 +            }
   24.70 +        }
   24.71 +                
   24.72 +    }
   24.73 +    
   24.74 +    public static void removePackageRoot(Project project,URL[] roots, String path) {
   24.75 +        
   24.76 +        Lookup lookup = project.getLookup();
   24.77 +        Object modifierObj = lookup.lookup(WebProjectLibrariesModifier.class);
   24.78 +        if (modifierObj != null && (modifierObj instanceof WebProjectLibrariesModifier)) {
   24.79 +            try {
   24.80 +                //boolean ret = ((WebProjectLibrariesModifier) modifierObj).removePackageRoots(roots, path);
   24.81 +                
   24.82 +                Class[] paramTypes = {URL[].class, String.class};
   24.83 +                Method method = WebProjectLibrariesModifier.class.getMethod("removePackageRoots", paramTypes);
   24.84 +                    
   24.85 +                method.invoke(modifierObj, new Object[]{roots,path});
   24.86 +               
   24.87 +            } catch (Exception ex) {
   24.88 +                ex.printStackTrace();
   24.89 +            }
   24.90 +        }else {
   24.91 +            try {
   24.92 +                ProjectClassPathModifier.removeRoots(roots, getSourceRoot(project), ClassPath.COMPILE);
   24.93 +            } catch (IOException ex) {
   24.94 +                ex.printStackTrace();
   24.95 +            } catch (UnsupportedOperationException ex) {
   24.96 +                ex.printStackTrace();
   24.97 +            }
   24.98 +        }
   24.99 +                
  24.100 +    }
  24.101 +    
  24.102 +    /**
  24.103 +     * Convenience method to obtain the source root folder.
  24.104 +     * @param project the Project object
  24.105 +     * @return the FileObject of the source root folder
  24.106 +     */
  24.107 +    public static FileObject getSourceRoot(Project project) {
  24.108 +        if (project == null) {
  24.109 +            return null;
  24.110 +        }
  24.111 +        Sources src = (Sources)project.getLookup().lookup(Sources.class);
  24.112 +        
  24.113 +        SourceGroup[] grp = src.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
  24.114 +        for (int i = 0; i < grp.length; i++) {
  24.115 +            if ("${src.dir}".equals(grp[i].getName())) { // NOI18N
  24.116 +
  24.117 +                return grp[i].getRootFolder();
  24.118 +            }
  24.119 +        }
  24.120 +        if (grp.length != 0) {
  24.121 +            return grp[0].getRootFolder();
  24.122 +        }
  24.123 +
  24.124 +        return null;
  24.125      }
  24.126  }
    25.1 --- a/portalpack.commons/src/org/netbeans/modules/portalpack/commons/resources/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
    25.2 +++ b/portalpack.commons/src/org/netbeans/modules/portalpack/commons/resources/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
    25.3 @@ -1,6 +1,6 @@
    25.4  OpenIDE-Module-Display-Category=PortalPack
    25.5  OpenIDE-Module-Long-Description=\
    25.6      A  Common Library Module for Portal Pack. \
    25.7 -    This library is used by Portal Pack WebSynergy Plug-ins.
    25.8 -OpenIDE-Module-Name=Portal Pack WebSynergy Commons
    25.9 -OpenIDE-Module-Short-Description=Portal Pack  WebSynergy Common Library Module
   25.10 +    This library is used by Portal Pack WebSpace Plug-ins.
   25.11 +OpenIDE-Module-Name=Portal Pack WebSpace Commons
   25.12 +OpenIDE-Module-Short-Description=Portal Pack WebSpace Common Library Module
    26.1 --- a/portalpack.commons/src/org/netbeans/modules/portalpack/commons/ruby/RubyPlatformUtil.java	Fri Jun 10 09:46:37 2011 +0200
    26.2 +++ b/portalpack.commons/src/org/netbeans/modules/portalpack/commons/ruby/RubyPlatformUtil.java	Sun Jun 26 10:25:14 2011 +0800
    26.3 @@ -39,8 +39,8 @@
    26.4  
    26.5  package org.netbeans.modules.portalpack.commons.ruby;
    26.6  
    26.7 -import org.netbeans.api.ruby.platform.RubyPlatform;
    26.8 -import org.netbeans.api.ruby.platform.RubyPlatformManager;
    26.9 +//import org.netbeans.api.ruby.platform.RubyPlatform;
   26.10 +//import org.netbeans.api.ruby.platform.RubyPlatformManager;
   26.11  import org.openide.filesystems.FileObject;
   26.12  
   26.13  /**
   26.14 @@ -51,8 +51,9 @@
   26.15      
   26.16      public static String getRubyLibDir() {
   26.17          
   26.18 -        RubyPlatform rubyPlatform = RubyPlatformManager.getDefaultPlatform();
   26.19 -        return rubyPlatform.getLibDir();
   26.20 +//        RubyPlatform rubyPlatform = RubyPlatformManager.getDefaultPlatform();
   26.21 +//        return rubyPlatform.getLibDir();
   26.22 +        return null;
   26.23          
   26.24      }
   26.25  }
    27.1 --- a/portalpack.jsfportletbridge/build.xml	Fri Jun 10 09:46:37 2011 +0200
    27.2 +++ b/portalpack.jsfportletbridge/build.xml	Sun Jun 26 10:25:14 2011 +0800
    27.3 @@ -10,7 +10,7 @@
    27.4          <mkdir dir="${cluster}/modules/ext/portalpack/jsfportletbridge"/>
    27.5          
    27.6          <copy file="external/jsf-portlet-1.2.jar"
    27.7 -            tofile="${cluster}/modules/ext/portalpack/jsfportletbridge/ajsf-portlet-1.2.3.jar"/>
    27.8 +            tofile="${cluster}/modules/ext/portalpack/jsfportletbridge/ajsf-portlet-1.2.4.jar"/>
    27.9          <copy file="external/jsf-portlet-1.1.5.jar"
   27.10              tofile="${cluster}/modules/ext/portalpack/jsfportletbridge/ajsf-portlet-1.1.5.jar"/>
   27.11      </target>
    28.1 --- a/portalpack.jsfportletbridge/external/binaries-list	Fri Jun 10 09:46:37 2011 +0200
    28.2 +++ b/portalpack.jsfportletbridge/external/binaries-list	Sun Jun 26 10:25:14 2011 +0800
    28.3 @@ -1,2 +1,2 @@
    28.4  89C3C741F2E3EA4D53EDE98C287A1A9884D0DB80 jsf-portlet-1.1.5.jar
    28.5 -96F99ED6B3F2F305A814503CD2F1E1A3E3E2DB49 jsf-portlet-1.2.jar
    28.6 +D025AB2E031EDBE92D0D4828783730F69FAF0158 jsf-portlet-1.2.jar
    29.1 --- a/portalpack.jsfportletbridge/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
    29.2 +++ b/portalpack.jsfportletbridge/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
    29.3 @@ -2,5 +2,5 @@
    29.4  OpenIDE-Module: org.netbeans.modules.portalpack.jsfportletbridge
    29.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/jsfportletbridge/layer.xml
    29.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/jsfportletbridge/Bundle.properties
    29.7 -OpenIDE-Module-Specification-Version: 1.99
    29.8 +OpenIDE-Module-Specification-Version: 2.0.4
    29.9  
    30.1 --- a/portalpack.jsfportletbridge/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
    30.2 +++ b/portalpack.jsfportletbridge/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
    30.3 @@ -19,7 +19,7 @@
    30.4  
    30.5  extra.module.files=\
    30.6      modules/ext/portalpack/jsfportletbridge/ajsf-portlet-1.1.5.jar,\
    30.7 -    modules/ext/portalpack/jsfportletbridge/ajsf-portlet-1.2.3.jar
    30.8 +    modules/ext/portalpack/jsfportletbridge/ajsf-portlet-1.2.4.jar
    30.9  javac.source=1.5
   30.10  javadoc.arch=${basedir}/arch.xml
   30.11  license.file=../../LICENSE
    31.1 --- a/portalpack.jsfportletbridge/src/org/netbeans/modules/portalpack/jsfportletbridge/jsf-portlet-runtime.xml	Fri Jun 10 09:46:37 2011 +0200
    31.2 +++ b/portalpack.jsfportletbridge/src/org/netbeans/modules/portalpack/jsfportletbridge/jsf-portlet-runtime.xml	Sun Jun 26 10:25:14 2011 +0800
    31.3 @@ -24,9 +24,13 @@
    31.4      <localizing-bundle>org/netbeans/modules/portalpack/jsfportletbridge/Bundle</localizing-bundle>
    31.5      <volume>
    31.6          <type>classpath</type>
    31.7 -        <resource>jar:nbinst:///modules/ext/portalpack/jsfportletbridge/ajsf-portlet-1.2.3.jar!/</resource>
    31.8 +        <resource>jar:nbinst:///modules/ext/portalpack/jsfportletbridge/ajsf-portlet-1.2.4.jar!/</resource>
    31.9      </volume>
   31.10      <volume>
   31.11          <type>javadoc</type>
   31.12      </volume>
   31.13 +     <volume>
   31.14 +        <type>maven-pom</type>
   31.15 +        <resource>http://download.java.net/maven/2/com/sun/faces/portlet/jsf-portlet/1.2.4/jsf-portlet-1.2.4.pom</resource>
   31.16 +    </volume>
   31.17  </library>
    32.1 --- a/portalpack.jsfportletbridge/src/org/netbeans/modules/portalpack/jsfportletbridge/jsfportletbridge-1-2.xml	Fri Jun 10 09:46:37 2011 +0200
    32.2 +++ b/portalpack.jsfportletbridge/src/org/netbeans/modules/portalpack/jsfportletbridge/jsfportletbridge-1-2.xml	Sun Jun 26 10:25:14 2011 +0800
    32.3 @@ -24,13 +24,13 @@
    32.4      <localizing-bundle>org/netbeans/modules/portalpack/jsfportletbridge/Bundle</localizing-bundle>
    32.5      <volume>
    32.6          <type>classpath</type>
    32.7 -        <resource>jar:nbinst:///modules/ext/portalpack/jsfportletbridge/ajsf-portlet-1.2.3.jar!/</resource>
    32.8 +        <resource>jar:nbinst:///modules/ext/portalpack/jsfportletbridge/ajsf-portlet-1.2.4.jar!/</resource>
    32.9      </volume>
   32.10      <volume>
   32.11          <type>javadoc</type>
   32.12      </volume>
   32.13      <volume>
   32.14          <type>maven-pom</type>
   32.15 -        <resource>http://download.java.net/maven/2/com/sun/faces/portlet/jsf-portlet/1.2.3/jsf-portlet-1.2.3.pom</resource>
   32.16 +        <resource>http://download.java.net/maven/2/com/sun/faces/portlet/jsf-portlet/1.2.4/jsf-portlet-1.2.4.pom</resource>
   32.17      </volume>
   32.18  </library>
   32.19 \ No newline at end of file
    33.1 --- a/portalpack.jsfportletbridge/src/org/netbeans/modules/portalpack/jsfportletbridge/portlet-runtime.xml	Fri Jun 10 09:46:37 2011 +0200
    33.2 +++ b/portalpack.jsfportletbridge/src/org/netbeans/modules/portalpack/jsfportletbridge/portlet-runtime.xml	Sun Jun 26 10:25:14 2011 +0800
    33.3 @@ -24,9 +24,13 @@
    33.4      <localizing-bundle>org/netbeans/modules/portalpack/jsfportletbridge/Bundle</localizing-bundle>
    33.5      <volume>
    33.6          <type>classpath</type>
    33.7 -        <resource>jar:nbinst:///modules/ext/portalpack/jsfportletbridge/ajsf-portlet-1.2.3.jar!/</resource>
    33.8 +        <resource>jar:nbinst:///modules/ext/portalpack/jsfportletbridge/ajsf-portlet-1.2.4.jar!/</resource>
    33.9      </volume>
   33.10      <volume>
   33.11          <type>javadoc</type>
   33.12      </volume>
   33.13 +    <volume>
   33.14 +        <type>maven-pom</type>
   33.15 +        <resource>http://download.java.net/maven/2/com/sun/faces/portlet/jsf-portlet/1.2.4/jsf-portlet-1.2.4.pom</resource>
   33.16 +    </volume>
   33.17  </library>
    34.1 --- a/portalpack.portlets.genericportlets/build.xml	Fri Jun 10 09:46:37 2011 +0200
    34.2 +++ b/portalpack.portlets.genericportlets/build.xml	Sun Jun 26 10:25:14 2011 +0800
    34.3 @@ -26,7 +26,7 @@
    34.4      
    34.5      <description>Builds, tests, and runs the project org.netbeans.modules.portalpack.portlets.genericportlets.</description>
    34.6      <import file="../../nbbuild/templates/projectized.xml"/>
    34.7 -    <property name="base.nbm.target.dir" value="build"/>
    34.8 +   
    34.9      <property name="s2b_res_root" location="src/org/netbeans/modules/portalpack/portlets/genericportlets"/>
   34.10      <property name="s2b_root_1_0" location="src/org/netbeans/modules/portalpack/portlets/genericportlets/ddapi/impl/model_1_0"/>
   34.11      <property name="s2b_root_2_0" location="src/org/netbeans/modules/portalpack/portlets/genericportlets/ddapi/impl/model_2_0"/>
    35.1 --- a/portalpack.portlets.genericportlets/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
    35.2 +++ b/portalpack.portlets.genericportlets/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
    35.3 @@ -3,7 +3,7 @@
    35.4  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/portlets/genericportlets/layer.xml
    35.5  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/portlets/genericportlets/Bundle.properties
    35.6  OpenIDE-Module-Install: org/netbeans/modules/portalpack/portlets/genericportlets/ModuleInitializer.class
    35.7 -OpenIDE-Module-Specification-Version: 2.99
    35.8 +OpenIDE-Module-Specification-Version: 3.0.5
    35.9  
   35.10  Name: org/netbeans/modules/portalpack/portlets/genericportlets/node/ddloaders/PortletXMLDataLoader.class
   35.11  OpenIDE-Module-Class: Loader
    36.1 --- a/portalpack.portlets.genericportlets/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
    36.2 +++ b/portalpack.portlets.genericportlets/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
    36.3 @@ -23,8 +23,6 @@
    36.4      modules/ext/portalpack/portlettaglib.jar,\
    36.5      modules/ext/portalpack/portlet-api-2.0-doc.jar,\
    36.6      modules/ext/portalpack/portlet-api-1.0-doc.jar
    36.7 -javac.source=1.5
    36.8 +javac.source=1.6
    36.9  javadoc.arch=${basedir}/arch.xml
   36.10 -license.file=../../LICENSE
   36.11 -extra.license.files=../../LICENSE
   36.12  nbm.homepage=http://portalpack.netbeans.org
    37.1 --- a/portalpack.portlets.genericportlets/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
    37.2 +++ b/portalpack.portlets.genericportlets/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
    37.3 @@ -111,6 +111,15 @@
    37.4                      </run-dependency>
    37.5                  </dependency>
    37.6                  <dependency>
    37.7 +                    <code-name-base>org.netbeans.modules.j2ee.core</code-name-base>
    37.8 +                    <build-prerequisite/>
    37.9 +                    <compile-dependency/>
   37.10 +                    <run-dependency>
   37.11 +                        <release-version>0-1</release-version>
   37.12 +                        <specification-version>1.7.1</specification-version>
   37.13 +                    </run-dependency>
   37.14 +                </dependency>
   37.15 +                <dependency>
   37.16                      <code-name-base>org.netbeans.modules.j2ee.dd</code-name-base>
   37.17                      <build-prerequisite/>
   37.18                      <compile-dependency/>
   37.19 @@ -159,8 +168,8 @@
   37.20                      <build-prerequisite/>
   37.21                      <compile-dependency/>
   37.22                      <run-dependency>
   37.23 -                        <release-version>0-1</release-version>
   37.24 -                        <specification-version>1.3.12</specification-version>
   37.25 +                        <release-version>1</release-version>
   37.26 +                        <specification-version>1.21.1</specification-version>
   37.27                      </run-dependency>
   37.28                  </dependency>
   37.29                  <dependency>
   37.30 @@ -231,7 +240,7 @@
   37.31                      <build-prerequisite/>
   37.32                      <compile-dependency/>
   37.33                      <run-dependency>
   37.34 -                        <specification-version>1.6</specification-version>
   37.35 +                        <specification-version>1.31.1</specification-version>
   37.36                      </run-dependency>
   37.37                  </dependency>
   37.38                  <dependency>
   37.39 @@ -280,8 +289,7 @@
   37.40                      <build-prerequisite/>
   37.41                      <compile-dependency/>
   37.42                      <run-dependency>
   37.43 -                        <specification-version>6.4.1</specification-version>
   37.44 -                        <!-- For NB 7.0 specification-version>7.19</specification-version -->
   37.45 +                        <specification-version>7.19</specification-version>
   37.46                      </run-dependency>
   37.47                  </dependency>
   37.48                  <dependency>
   37.49 @@ -333,6 +341,14 @@
   37.50                      </run-dependency>
   37.51                  </dependency>
   37.52                  <dependency>
   37.53 +                    <code-name-base>org.openide.util.lookup</code-name-base>
   37.54 +                    <build-prerequisite/>
   37.55 +                    <compile-dependency/>
   37.56 +                    <run-dependency>
   37.57 +                        <specification-version>8.6.1</specification-version>
   37.58 +                    </run-dependency>
   37.59 +                </dependency>
   37.60 +                <dependency>
   37.61                      <code-name-base>org.openide.windows</code-name-base>
   37.62                      <build-prerequisite/>
   37.63                      <compile-dependency/>
    38.1 --- a/portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/core/actions/util/PortletProjectUtils.java	Fri Jun 10 09:46:37 2011 +0200
    38.2 +++ b/portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/core/actions/util/PortletProjectUtils.java	Sun Jun 26 10:25:14 2011 +0800
    38.3 @@ -47,6 +47,7 @@
    38.4  import java.io.BufferedWriter;
    38.5  import java.io.InputStreamReader;
    38.6  import java.io.OutputStreamWriter;
    38.7 +import java.lang.reflect.Method;
    38.8  
    38.9  import org.netbeans.api.java.classpath.ClassPath;
   38.10  import org.openide.filesystems.FileObject;
   38.11 @@ -55,18 +56,22 @@
   38.12  import org.openide.util.Utilities;
   38.13  
   38.14  import org.netbeans.api.java.project.JavaProjectConstants;
   38.15 +import org.netbeans.api.java.project.classpath.ProjectClassPathModifier;
   38.16  import org.netbeans.spi.java.queries.SourceLevelQueryImplementation;
   38.17  import org.netbeans.api.project.Project;
   38.18  import org.netbeans.api.project.ProjectUtils;
   38.19  import org.netbeans.api.project.Sources;
   38.20  import org.netbeans.api.project.SourceGroup;
   38.21 +import org.netbeans.api.project.libraries.Library;
   38.22 +import org.netbeans.api.project.libraries.LibraryManager;
   38.23  import org.netbeans.modules.web.api.webmodule.WebModule;
   38.24  import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
   38.25  
   38.26  // XXX WebProjectLibrariesModifier and WebPropertyEvaluator in org.netbeans.modules.web.project
   38.27 -import org.netbeans.spi.project.AuxiliaryConfiguration;
   38.28 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.util.NetbeanConstants;
   38.29 +import org.netbeans.modules.web.project.api.WebProjectLibrariesModifier;
   38.30  // are not accessible under NetBeans 6.0; need friend-package
   38.31 -import org.w3c.dom.Element;
   38.32 +import org.openide.util.Lookup;
   38.33  // We now access these APIs by org.netbeans.modules.portalpack.portlets.genericportlets.core.util.NetbeansUtil
   38.34  // import org.netbeans.modules.web.project.api.WebProjectLibrariesModifier;
   38.35  // import org.netbeans.modules.web.project.api.WebPropertyEvaluator;
   38.36 @@ -609,4 +614,46 @@
   38.37          else
   38.38              return pkg;
   38.39      }
   38.40 +
   38.41 +    public static boolean addPortletLibraryToProject(Project project,String portletVersion) {
   38.42 +
   38.43 +        if(project == null)
   38.44 +            return false;
   38.45 +        WebModule wm = getWebModule(project);
   38.46 +        if(wm == null)
   38.47 +            return false;
   38.48 +        ClassPath cp = ClassPath.getClassPath(wm.getDocumentBase(), ClassPath.COMPILE);
   38.49 +
   38.50 +        if (cp != null && cp.findResource("javax/portlet/GenericPortlet.class") != null) { //NOI18N
   38.51 +            return true;
   38.52 +        }
   38.53 +
   38.54 +         try{
   38.55 +             Library bpLibrary = null;
   38.56 +             if (portletVersion.equals(NetbeanConstants.PORTLET_2_0)) {
   38.57 +                 bpLibrary = LibraryManager.getDefault().getLibrary("Portlet-2.0-Lib"); //NOI18N
   38.58 +             } else {
   38.59 +                 bpLibrary = LibraryManager.getDefault().getLibrary("Portlet-1.0-Lib"); //NOI18N
   38.60 +             }
   38.61 +             Lookup lookup = project.getLookup();
   38.62 +             Object modifierObj = lookup.lookup(WebProjectLibrariesModifier.class);
   38.63 +             if (modifierObj != null && (modifierObj instanceof WebProjectLibrariesModifier)) {
   38.64 +                 //((WebProjectLibrariesModifier) modifierObj).addCompileLibraries(new Library[]{bpLibrary});
   38.65 +                 //As the friend-api relationship is now broken. This has to be done through reflection.
   38.66 +                 Library[] libs = {bpLibrary};           
   38.67 +                 Class[] paramTypes = {Library[].class};
   38.68 +                 Method method = WebProjectLibrariesModifier.class.getMethod("addCompileLibraries", paramTypes);
   38.69 +                    
   38.70 +                 method.invoke(modifierObj, new Object[]{libs});
   38.71 +             } else {
   38.72 +                 ProjectClassPathModifier.addLibraries(new Library[]{bpLibrary}, getSourceRoot(project), ClassPath.COMPILE);
   38.73 +             }
   38.74 +
   38.75 +         }catch(Exception e){
   38.76 +             return false;
   38.77 +         }
   38.78 +
   38.79 +        return true;
   38.80 +
   38.81 +    }
   38.82  }
    39.1 --- a/portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/core/util/NetbeansUtil.java	Fri Jun 10 09:46:37 2011 +0200
    39.2 +++ b/portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/core/util/NetbeansUtil.java	Sun Jun 26 10:25:14 2011 +0800
    39.3 @@ -22,6 +22,7 @@
    39.4  import java.io.File;
    39.5  import java.io.IOException;
    39.6  import java.io.OutputStream;
    39.7 +import java.lang.reflect.Method;
    39.8  import java.util.logging.Level;
    39.9  import java.util.logging.Logger;
   39.10  import javax.swing.JOptionPane;
   39.11 @@ -187,9 +188,31 @@
   39.12          }
   39.13  
   39.14          if (ClassPath.COMPILE.equals(type)) {
   39.15 -            return wplm.addCompileLibraries(libraries);
   39.16 +            
   39.17 +            try { 
   39.18 +                Class[] paramTypes = {Library[].class};
   39.19 +                Method method = WebProjectLibrariesModifier.class.getMethod("addCompileLibraries", paramTypes);
   39.20 +                    
   39.21 +                method.invoke(wplm, new Object[]{libraries});
   39.22 +                return true;
   39.23 +            } catch (Exception e) {
   39.24 +                logger.log(Level.SEVERE, type, e);
   39.25 +                return false;
   39.26 +            }
   39.27 +            //return wplm.addCompileLibraries(libraries);
   39.28          } else if (ClassPath.EXECUTE.equals(type)) {
   39.29 -            return wplm.addPackageLibraries(libraries, "WEB-INF/lib"); // NOI18N
   39.30 +            
   39.31 +            try { 
   39.32 +                Class[] paramTypes = {Library[].class, String.class};
   39.33 +                Method method = WebProjectLibrariesModifier.class.getMethod("addPackageLibraries", paramTypes);
   39.34 +                    
   39.35 +                method.invoke(wplm, new Object[]{libraries,"WEB-INF/lib"});
   39.36 +                return true;
   39.37 +            } catch (Exception e) {
   39.38 +                logger.log(Level.SEVERE, type, e);
   39.39 +                return false;
   39.40 +            }
   39.41 +            //return wplm.addPackageLibraries(libraries, "WEB-INF/lib"); // NOI18N
   39.42          }
   39.43  
   39.44          return false;
    40.1 --- a/portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/frameworks/jsr168/JSR168WebFrameworkProvider.java	Fri Jun 10 09:46:37 2011 +0200
    40.2 +++ b/portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/frameworks/jsr168/JSR168WebFrameworkProvider.java	Sun Jun 26 10:25:14 2011 +0800
    40.3 @@ -20,6 +20,7 @@
    40.4  package org.netbeans.modules.portalpack.portlets.genericportlets.frameworks.jsr168;
    40.5  
    40.6  import java.io.File;
    40.7 +import java.lang.reflect.Method;
    40.8  import java.util.LinkedHashSet;
    40.9  import java.util.Map;
   40.10  import java.util.Set;
   40.11 @@ -42,7 +43,9 @@
   40.12  import org.netbeans.modules.web.spi.webmodule.WebFrameworkProvider;
   40.13  import org.netbeans.modules.web.spi.webmodule.WebModuleExtender;
   40.14  import org.openide.filesystems.FileObject;
   40.15 +import org.openide.filesystems.FileStateInvalidException;
   40.16  import org.openide.filesystems.FileUtil;
   40.17 +import org.openide.util.Exceptions;
   40.18  import org.openide.util.Lookup;
   40.19  import org.openide.util.NbBundle;
   40.20  
   40.21 @@ -89,7 +92,12 @@
   40.22                  Object modifierObj = lookup.lookup(WebProjectLibrariesModifier.class);
   40.23                  if(modifierObj != null && (modifierObj instanceof WebProjectLibrariesModifier))
   40.24                  {
   40.25 -                    ((WebProjectLibrariesModifier)modifierObj).addCompileLibraries(new Library[]{bpLibrary});
   40.26 +                    Library[] libs = {bpLibrary};
   40.27 +                    //((WebProjectLibrariesModifier)modifierObj).addCompileLibraries(new Library[]{bpLibrary});             
   40.28 +                    Class[] paramTypes = {Library[].class};
   40.29 +                    Method method = WebProjectLibrariesModifier.class.getMethod("addCompileLibraries", paramTypes);
   40.30 +                    
   40.31 +                    method.invoke(modifierObj, new Object[]{libs});
   40.32                  }else {
   40.33                      ProjectClassPathModifier.addLibraries(new Library[]{bpLibrary}, getSourceRoot(project), ClassPath.COMPILE);
   40.34                  }
   40.35 @@ -114,6 +122,10 @@
   40.36           {
   40.37              PortletFrameworkUtil.createPkgAndClass(srcFolder, project, wm,pkg,context);
   40.38              resultSet.add(srcFolder);
   40.39 +
   40.40 +			try{
   40.41 +				FileUtil.refreshFor(FileUtil.toFile(srcFolder));
   40.42 +			}catch(Exception e){}
   40.43           }
   40.44           else
   40.45           {
   40.46 @@ -126,7 +138,14 @@
   40.47                  ex.printStackTrace();
   40.48              }
   40.49          }
   40.50 -        return null;
   40.51 +
   40.52 +        try {
   40.53 +            documentBase.getFileSystem().refresh(true);
   40.54 +        } catch (FileStateInvalidException ex) {
   40.55 +           ex.printStackTrace();
   40.56 +        }
   40.57 +
   40.58 +        return resultSet;
   40.59          
   40.60      }
   40.61  
    41.1 --- a/portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/layer.xml	Fri Jun 10 09:46:37 2011 +0200
    41.2 +++ b/portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/layer.xml	Sun Jun 26 10:25:14 2011 +0800
    41.3 @@ -29,58 +29,40 @@
    41.4          <folder name="text">
    41.5              <folder name="x-dd-portlet1.0">
    41.6                  <folder name="Actions">
    41.7 +                    <file name="org-openide-actions-OpenAction.instance"/>
    41.8                      <attr name="org-openide-actions-OpenAction.instance/org-openide-actions-FileSystemAction.instance" boolvalue="true"/>
    41.9 +                    <file name="org-openide-actions-FileSystemAction.instance"/>
   41.10                      <attr name="org-openide-actions-FileSystemAction.instance/sep-1.instance" boolvalue="true"/>
   41.11 -                    <file name="org-openide-actions-CopyAction.shadow">
   41.12 -                        <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-CopyAction.instance"/>
   41.13 -                    </file>
   41.14 -                    <file name="org-openide-actions-CutAction.shadow">
   41.15 -                        <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-CutAction.instance"/>
   41.16 -                    </file>
   41.17 -                    <file name="org-openide-actions-DeleteAction.shadow">
   41.18 -                        <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-DeleteAction.instance"/>
   41.19 -                    </file>
   41.20 -                    <file name="org-openide-actions-FileSystemAction.shadow">
   41.21 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-FileSystemAction.instance"/>
   41.22 -                    </file>
   41.23 -                    <file name="org-openide-actions-OpenAction.shadow">
   41.24 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-OpenAction.instance"/>
   41.25 -                    </file>
   41.26 -                    <file name="org-openide-actions-PropertiesAction.shadow">
   41.27 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-PropertiesAction.instance"/>
   41.28 -                    </file>
   41.29 -                    <file name="org-openide-actions-RenameAction.shadow">
   41.30 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-RenameAction.instance"/>
   41.31 -                    </file>
   41.32 -                    <file name="org-openide-actions-SaveAsTemplateAction.shadow">
   41.33 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-SaveAsTemplateAction.instance"/>
   41.34 -                    </file>
   41.35 -                    <file name="org-openide-actions-ToolsAction.shadow">
   41.36 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-ToolsAction.instance"/>
   41.37 -                    </file>
   41.38                      <file name="sep-1.instance">
   41.39                          <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
   41.40                      </file>
   41.41                      <attr name="sep-1.instance/org-openide-actions-CutAction.instance" boolvalue="true"/>
   41.42 +                    <file name="org-openide-actions-CutAction.instance"/>
   41.43                      <attr name="org-openide-actions-CutAction.instance/org-openide-actions-CopyAction.instance" boolvalue="true"/>
   41.44 +                    <file name="org-openide-actions-CopyAction.instance"/>
   41.45                      <attr name="org-openide-actions-CopyAction.instance/sep-2.instance" boolvalue="true"/>
   41.46                      <file name="sep-2.instance">
   41.47                          <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
   41.48                      </file>
   41.49                      <attr name="sep-2.instance/org-openide-actions-DeleteAction.instance" boolvalue="true"/>
   41.50 +                    <file name="org-openide-actions-DeleteAction.instance"/>
   41.51                      <attr name="org-openide-actions-DeleteAction.instance/org-openide-actions-RenameAction.instance" boolvalue="true"/>
   41.52 +                    <file name="org-openide-actions-RenameAction.instance"/>
   41.53                      <attr name="org-openide-actions-RenameAction.instance/sep-3.instance" boolvalue="true"/>
   41.54                      <file name="sep-3.instance">
   41.55                          <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
   41.56                      </file>
   41.57                      <attr name="sep-3.instance/org-openide-actions-SaveAsTemplateAction.instance" boolvalue="true"/>
   41.58 +                    <file name="org-openide-actions-SaveAsTemplateAction.instance"/>
   41.59                      <attr name="org-openide-actions-SaveAsTemplateAction.instance/sep-4.instance" boolvalue="true"/>
   41.60                      <file name="sep-4.instance">
   41.61                          <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
   41.62                      </file>
   41.63                      <attr name="sep-4.instance/org-openide-actions-ToolsAction.instance" boolvalue="true"/>
   41.64 +                    <file name="org-openide-actions-ToolsAction.instance"/>
   41.65                      <attr name="org-openide-actions-ToolsAction.instance/org-openide-actions-PropertiesAction.instance" boolvalue="true"/>
   41.66 -                    </folder>
   41.67 +                    <file name="org-openide-actions-PropertiesAction.instance"/>
   41.68 +                </folder>
   41.69              </folder>
   41.70              <folder name="x-portlet">
   41.71                  <folder name="Actions">
   41.72 @@ -123,40 +105,31 @@
   41.73              
   41.74              <folder name="x-dd-portlet20+xml">
   41.75                  <folder name="Actions">
   41.76 -                    <file name="org-openide-actions-CopyAction.shadow">
   41.77 -                        <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-CopyAction.instance"/>
   41.78 +                    <file name="org-openide-actions-CopyAction.instance">
   41.79                          <attr name="position" intvalue="500"/>
   41.80                      </file>
   41.81 -                    <file name="org-openide-actions-CutAction.shadow">
   41.82 -                        <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-CutAction.instance"/>
   41.83 +                    <file name="org-openide-actions-CutAction.instance">
   41.84                          <attr name="position" intvalue="400"/>
   41.85                      </file>
   41.86 -                    <file name="org-openide-actions-DeleteAction.shadow">
   41.87 -                        <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-DeleteAction.instance"/>
   41.88 +                    <file name="org-openide-actions-DeleteAction.instance">
   41.89                          <attr name="position" intvalue="700"/>
   41.90                      </file>
   41.91 -                    <file name="org-openide-actions-FileSystemAction.shadow">
   41.92 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-FileSystemAction.instance"/>
   41.93 +                    <file name="org-openide-actions-FileSystemAction.instance">
   41.94                          <attr name="position" intvalue="200"/>
   41.95                      </file>
   41.96 -                    <file name="org-openide-actions-OpenAction.shadow">
   41.97 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-OpenAction.instance"/>
   41.98 +                    <file name="org-openide-actions-OpenAction.instance">
   41.99                          <attr name="position" intvalue="100"/>
  41.100                      </file>
  41.101 -                    <file name="org-openide-actions-PropertiesAction.shadow">
  41.102 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-PropertiesAction.instance"/>
  41.103 +                    <file name="org-openide-actions-PropertiesAction.instance">
  41.104                          <attr name="position" intvalue="1300"/>
  41.105                      </file>
  41.106 -                    <file name="org-openide-actions-RenameAction.shadow">
  41.107 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-RenameAction.instance"/>
  41.108 +                    <file name="org-openide-actions-RenameAction.instance">
  41.109                          <attr name="position" intvalue="800"/>
  41.110                      </file>
  41.111 -                    <file name="org-openide-actions-SaveAsTemplateAction.shadow">
  41.112 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-SaveAsTemplateAction.instance"/>
  41.113 +                    <file name="org-openide-actions-SaveAsTemplateAction.instance">
  41.114                          <attr name="position" intvalue="1000"/>
  41.115                      </file>
  41.116 -                    <file name="org-openide-actions-ToolsAction.shadow">
  41.117 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-ToolsAction.instance"/>
  41.118 +                    <file name="org-openide-actions-ToolsAction.instance">
  41.119                          <attr name="position" intvalue="1200"/>
  41.120                      </file>
  41.121                      <file name="sep-1.instance">
  41.122 @@ -211,8 +184,8 @@
  41.123                  <attr name="template" boolvalue="true"/>
  41.124                  <attr name="position" intvalue="503"/>
  41.125                  <attr name="templateCategory" stringvalue="web-types"/>
  41.126 -                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/portalpack/portlets/genericportlets/resources/portletapp.gif"/>
  41.127 -                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/portalpack/portlets/genericportlets/filetype/jsr168/netbeansNewPortletClass.html"/>
  41.128 +                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:org/netbeans/modules/portalpack/portlets/genericportlets/resources/portletapp.gif"/>
  41.129 +                <attr name="templateWizardURL" urlvalue="nbresloc:org/netbeans/modules/portalpack/portlets/genericportlets/filetype/jsr168/netbeansNewPortletClass.html"/>
  41.130              </file>
  41.131              <file name="PortletFilter">
  41.132                  <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.portalpack.portlets.genericportlets.Bundle"/>
  41.133 @@ -220,7 +193,7 @@
  41.134                  <attr name="template" boolvalue="true"/>
  41.135                  <attr name="position" intvalue="504"/>
  41.136                  <attr name="templateCategory" stringvalue="servlet-types"/>
  41.137 -                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/portalpack/portlets/genericportlets/resources/portletapp.gif"/>
  41.138 +                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:org/netbeans/modules/portalpack/portlets/genericportlets/resources/portletapp.gif"/>
  41.139                  <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/portalpack/portlets/genericportlets/filetype/filters/newFilterWizard.html"/>
  41.140              </file>
  41.141              
  41.142 @@ -252,46 +225,46 @@
  41.143      -->
  41.144      <folder name="genericportlets"> 
  41.145          <folder name="templates">
  41.146 -            <file name="jsr168portlet.java" url="nbresloc:/templates/jsr168portlet.template">
  41.147 +            <file name="jsr168portlet.java" url="nbresloc:templates/jsr168portlet.template">
  41.148                  <attr name="position" intvalue="0"/>
  41.149                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  41.150              </file>
  41.151 -            <file name="jsr168portletwithjsp.java" url="nbresloc:/templates/jsr168portletwithjsp.template">
  41.152 +            <file name="jsr168portletwithjsp.java" url="nbresloc:templates/jsr168portletwithjsp.template">
  41.153                  <attr name="position" intvalue="0"/>
  41.154                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  41.155              </file>    
  41.156 -            <file name="portlet168-portlet.template" url="nbresloc:/templates/portlet168-portlet.template">
  41.157 +            <file name="portlet168-portlet.template" url="nbresloc:templates/portlet168-portlet.template">
  41.158                  <attr name="position" intvalue="0"/>
  41.159                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  41.160              </file>    
  41.161 -            <file name="portlet168-xml.template" url="nbresloc:/templates/portlet168-xml.template">
  41.162 +            <file name="portlet168-xml.template" url="nbresloc:templates/portlet168-xml.template">
  41.163                  <attr name="position" intvalue="0"/>
  41.164                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  41.165              </file>    
  41.166 -            <file name="jsptemplate.jsp" url="nbresloc:/templates/jsptemplate.jsp">
  41.167 +            <file name="jsptemplate.jsp" url="nbresloc:templates/jsptemplate.jsp">
  41.168                  <attr name="position" intvalue="0"/>
  41.169                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  41.170              </file>
  41.171              <!-- portlet20 related entries -->
  41.172 -            <file name="portlet20-xml.template" url="nbresloc:/templates/portlet20-xml.template">
  41.173 +            <file name="portlet20-xml.template" url="nbresloc:templates/portlet20-xml.template">
  41.174                  <attr name="position" intvalue="0"/>
  41.175                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  41.176              </file>
  41.177 -            <file name="portlet20-portlet.template" url="nbresloc:/templates/portlet20-portlet.template">
  41.178 +            <file name="portlet20-portlet.template" url="nbresloc:templates/portlet20-portlet.template">
  41.179                  <attr name="position" intvalue="0"/>
  41.180                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  41.181              </file>
  41.182 -            <file name="portlet20-filter.java" url="nbresloc:/templates/portletfilter.template">
  41.183 +            <file name="portlet20-filter.java" url="nbresloc:templates/portletfilter.template">
  41.184                  <attr name="position" intvalue="0"/>
  41.185                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  41.186              </file>
  41.187              <!-- Eventing templates -->
  41.188              
  41.189 -            <file name="processevent.template" url="nbresloc:/templates/processevent.template">
  41.190 +            <file name="processevent.template" url="nbresloc:templates/processevent.template">
  41.191                  <attr name="position" intvalue="0"/>
  41.192                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  41.193              </file>
  41.194 -            <file name="publishevent.template" url="nbresloc:/templates/publishevent.template">
  41.195 +            <file name="publishevent.template" url="nbresloc:templates/publishevent.template">
  41.196                  <attr name="position" intvalue="0"/>
  41.197                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  41.198              </file>
  41.199 @@ -299,9 +272,9 @@
  41.200      </folder>
  41.201      
  41.202      <folder name="portlet-libraries">
  41.203 -        <file name="portlet-api-1.0.jar" url="nbresloc:/templates/lib/portlet-api-1.0.jar"/> 
  41.204 -        <file name="portlettaglib-1.0.jar" url="nbresloc:/templates/lib/portlettaglib-1.0.jar"/> 
  41.205 -        <file name="portlet.tld" url="nbresloc:/templates/lib/portlet.tld"/> 
  41.206 +        <file name="portlet-api-1.0.jar" url="nbresloc:templates/lib/portlet-api-1.0.jar"/> 
  41.207 +        <file name="portlettaglib-1.0.jar" url="nbresloc:templates/lib/portlettaglib-1.0.jar"/> 
  41.208 +        <file name="portlet.tld" url="nbresloc:templates/lib/portlet.tld"/> 
  41.209      </folder>
  41.210      
  41.211      <!-- Portlet WebFramework -->
    42.1 --- a/portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/node/ddloaders/ElementNode.java	Fri Jun 10 09:46:37 2011 +0200
    42.2 +++ b/portalpack.portlets.genericportlets/src/org/netbeans/modules/portalpack/portlets/genericportlets/node/ddloaders/ElementNode.java	Sun Jun 26 10:25:14 2011 +0800
    42.3 @@ -21,7 +21,6 @@
    42.4  import org.netbeans.modules.schema2beans.BaseBean;
    42.5  import org.openide.loaders.DataNode;
    42.6  import org.openide.nodes.Children;
    42.7 -import org.openide.nodes.Node;
    42.8  import org.openide.util.Lookup;
    42.9  
   42.10  /**
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/portalpack.portlets.spring/l10n/build.xml	Sun Jun 26 10:25:14 2011 +0800
    43.3 @@ -0,0 +1,60 @@
    43.4 +<?xml version="1.0" encoding="UTF-8"?>
    43.5 +
    43.6 +<!--
    43.7 +The contents of this file are subject to the terms of the Common Development
    43.8 +and Distribution License (the License). You may not use this file except in
    43.9 +compliance with the License.
   43.10 +
   43.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
   43.12 +or http://www.netbeans.org/cddl.txt.
   43.13 +
   43.14 +When distributing Covered Code, include this CDDL Header Notice in each file
   43.15 +and include the License file at http://www.netbeans.org/cddl.txt.
   43.16 +If applicable, add the following below the CDDL Header, with the fields
   43.17 +enclosed by brackets [] replaced by your own identifying information:
   43.18 +"Portions Copyrighted [year] [name of copyright owner]"
   43.19 +
   43.20 + The Original Software is NetBeans. The Initial Developer of the Original
   43.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
   43.22 + Microsystems, Inc. All Rights Reserved.
   43.23 +-->
   43.24 +
   43.25 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
   43.26 +<!-- for some information on what you could do (e.g. targets to override). -->
   43.27 +<!-- If you delete this file and reopen the project it will be recreated. -->
   43.28 +<project name="ml-build" default="netbeans" basedir="../">
   43.29 +    
   43.30 +    <description>Portal Pack ML build</description>
   43.31 +    <import file="../build.xml"/>
   43.32 +    <target name="create-l10n-kit">
   43.33 +         <property name="l10nkit-dir" value="build/l10n"/>
   43.34 +         <property name="l10nkit-zip" value="build/portalpack-portlets-spring-l10nkit.zip"/>
   43.35 +         <delete dir="${l10nkit-dir}"/>
   43.36 +         <delete file="${l10nkit-zip}"/>
   43.37 +         
   43.38 +         <mkdir dir="${l10nkit-dir}"/>
   43.39 +         
   43.40 +         <copydir src="src" includes="**/Bundle.properties,**/*.html,**/*.htm" dest="${l10nkit-dir}/src"/>
   43.41 +
   43.42 +         <zip destfile="${l10nkit-zip}"
   43.43 +           basedir="${l10nkit-dir}"
   43.44 +         />
   43.45 +    </target>
   43.46 +    
   43.47 +    <target name="compile" depends="contrib/portalpack.portlets.spring.compile">
   43.48 +        <copy todir="build/classes">
   43.49 +             <fileset dir="l10n/ja"/>
   43.50 +             <fileset dir="l10n/pt_BR"/>
   43.51 +             <fileset dir="l10n/zh_CN"/>  
   43.52 +         </copy>
   43.53 +     </target>
   43.54 +	 
   43.55 +	 <target name="copyL10n">
   43.56 +		 <echo message="${l10n.src.dir}"/>
   43.57 +		 <copy todir=".">
   43.58 +			<fileset dir="${l10n.src.dir}"/>			
   43.59 +			<mapper type="glob" from="src" to="l10n/${locale}"/>
   43.60 +		 </copy>
   43.61 +	 </target>
   43.62 +      
   43.63 +</project>
    44.1 --- a/portalpack.portlets.spring/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
    44.2 +++ b/portalpack.portlets.spring/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
    44.3 @@ -2,5 +2,5 @@
    44.4  OpenIDE-Module: org.netbeans.modules.portalpack.portlets.spring
    44.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/portlets/spring/resources/layer.xml
    44.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/portlets/spring/resources/Bundle.properties
    44.7 -OpenIDE-Module-Specification-Version: 0.99
    44.8 +OpenIDE-Module-Specification-Version: 1.0.5
    44.9  
    45.1 --- a/portalpack.portlets.spring/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
    45.2 +++ b/portalpack.portlets.spring/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
    45.3 @@ -1,4 +1,7 @@
    45.4  extra.module.files=\
    45.5      modules/ext/portalpack/spring-webmvc-portlet-2.5.jar
    45.6 -javac.source=1.5
    45.7 +javac.source=1.6
    45.8  javac.compilerargs=-Xlint -Xlint:-serial
    45.9 +
   45.10 +extra.license.files=external/spring-webmvc-portlet-license.txt
   45.11 +nbm.homepage=http://portalpack.netbeans.org
    46.1 --- a/portalpack.portlets.spring/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
    46.2 +++ b/portalpack.portlets.spring/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
    46.3 @@ -70,7 +70,7 @@
    46.4                      <build-prerequisite/>
    46.5                      <compile-dependency/>
    46.6                      <run-dependency>
    46.7 -                        <specification-version>2.92</specification-version>
    46.8 +                        <specification-version>3.0</specification-version>
    46.9                      </run-dependency>
   46.10                  </dependency>
   46.11                  <dependency>
   46.12 @@ -161,8 +161,7 @@
   46.13                      <build-prerequisite/>
   46.14                      <compile-dependency/>
   46.15                      <run-dependency>
   46.16 -                        <specification-version>6.2</specification-version>
   46.17 -                        <!-- For NB 7.0 specification-version>7.19</specification-version -->
   46.18 +                        <specification-version>7.19</specification-version>
   46.19                      </run-dependency>
   46.20                  </dependency>
   46.21                  <dependency>
   46.22 @@ -188,6 +187,14 @@
   46.23                      </run-dependency>
   46.24                  </dependency>
   46.25                  <dependency>
   46.26 +                    <code-name-base>org.openide.util.lookup</code-name-base>
   46.27 +                    <build-prerequisite/>
   46.28 +                    <compile-dependency/>
   46.29 +                    <run-dependency>
   46.30 +                        <specification-version>8.6.1</specification-version>
   46.31 +                    </run-dependency>
   46.32 +                </dependency>
   46.33 +                <dependency>
   46.34                      <code-name-base>org.openide.windows</code-name-base>
   46.35                      <build-prerequisite/>
   46.36                      <compile-dependency/>
    47.1 --- a/portalpack.portlets.spring/src/org/netbeans/modules/portalpack/portlets/spring/resources/layer.xml	Fri Jun 10 09:46:37 2011 +0200
    47.2 +++ b/portalpack.portlets.spring/src/org/netbeans/modules/portalpack/portlets/spring/resources/layer.xml	Sun Jun 26 10:25:14 2011 +0800
    47.3 @@ -11,7 +11,7 @@
    47.4                  <attr name="templateWizardIterator" newvalue="org.netbeans.modules.portalpack.portlets.spring.ui.SpringPortletWizardIterator"/>
    47.5                  <attr name="template" boolvalue="true"/>
    47.6                  <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/portalpack/portlets/spring/ui/springportlet.html"/>
    47.7 -                 <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/portalpack/portlets/spring/resources/spring.png"/>
    47.8 +                 <attr name="SystemFileSystem.icon" urlvalue="nbresloc:org/netbeans/modules/portalpack/portlets/spring/resources/spring.png"/>
    47.9                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
   47.10              </file>
   47.11          </folder>
   47.12 @@ -24,36 +24,36 @@
   47.13      
   47.14      <folder name="spring-portlet">
   47.15          <folder name="templates">
   47.16 -            <file name="portlet-context.xml" url="nbresloc:/org/netbeans/modules/portalpack/portlets/spring/templates/portlet-context.template">
   47.17 +            <file name="portlet-context.xml" url="nbresloc:org/netbeans/modules/portalpack/portlets/spring/templates/portlet-context.template">
   47.18                  <attr name="position" intvalue="0"/>
   47.19                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
   47.20              </file>
   47.21 -            <file name="applicationContext.xml" url="nbresloc:/org/netbeans/modules/portalpack/portlets/spring/templates/applicationContext.template">
   47.22 +            <file name="applicationContext.xml" url="nbresloc:org/netbeans/modules/portalpack/portlets/spring/templates/applicationContext.template">
   47.23                  <attr name="position" intvalue="0"/>
   47.24                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
   47.25              </file>
   47.26 -            <file name="portletcontroller.java" url="nbresloc:/org/netbeans/modules/portalpack/portlets/spring/templates/portletcontroller.template">
   47.27 +            <file name="portletcontroller.java" url="nbresloc:org/netbeans/modules/portalpack/portlets/spring/templates/portletcontroller.template">
   47.28                  <attr name="position" intvalue="1"/>
   47.29                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
   47.30              </file>
   47.31 -            <file name="formcontroller.java" url="nbresloc:/org/netbeans/modules/portalpack/portlets/spring/templates/formcontroller.template">
   47.32 +            <file name="formcontroller.java" url="nbresloc:org/netbeans/modules/portalpack/portlets/spring/templates/formcontroller.template">
   47.33                  <attr name="position" intvalue="2"/>
   47.34                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
   47.35              </file>
   47.36 -            <file name="commandbean.java" url="nbresloc:/org/netbeans/modules/portalpack/portlets/spring/templates/commandbean.template">
   47.37 +            <file name="commandbean.java" url="nbresloc:org/netbeans/modules/portalpack/portlets/spring/templates/commandbean.template">
   47.38                  <attr name="position" intvalue="3"/>
   47.39                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
   47.40              </file>
   47.41  
   47.42 -            <file name="jsptemplate.jsp" url="nbresloc:/org/netbeans/modules/portalpack/portlets/spring/templates/jsptemplate.jsp">
   47.43 +            <file name="jsptemplate.jsp" url="nbresloc:org/netbeans/modules/portalpack/portlets/spring/templates/jsptemplate.jsp">
   47.44                  <attr name="position" intvalue="4"/>
   47.45                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
   47.46              </file>
   47.47 -             <file name="form.jsp" url="nbresloc:/org/netbeans/modules/portalpack/portlets/spring/templates/form.jsp">
   47.48 +             <file name="form.jsp" url="nbresloc:org/netbeans/modules/portalpack/portlets/spring/templates/form.jsp">
   47.49                  <attr name="position" intvalue="5"/>
   47.50                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
   47.51              </file>
   47.52 -             <file name="success_view.jsp" url="nbresloc:/org/netbeans/modules/portalpack/portlets/spring/templates/success_view.jsp">
   47.53 +             <file name="success_view.jsp" url="nbresloc:org/netbeans/modules/portalpack/portlets/spring/templates/success_view.jsp">
   47.54                  <attr name="position" intvalue="6"/>
   47.55                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
   47.56              </file>
    48.1 --- a/portalpack.portlets.spring/src/org/netbeans/modules/portalpack/portlets/spring/ui/SpringDetailsPanelGUI.java	Fri Jun 10 09:46:37 2011 +0200
    48.2 +++ b/portalpack.portlets.spring/src/org/netbeans/modules/portalpack/portlets/spring/ui/SpringDetailsPanelGUI.java	Sun Jun 26 10:25:14 2011 +0800
    48.3 @@ -364,8 +364,10 @@
    48.4                  enableTextField(helpJspTf, false);
    48.5              }
    48.6              
    48.7 -            String portletName = context.getPortletName();
    48.8 -            configFileTf.setText(portletName+"-portlet.xml");
    48.9 +            //String portletName = context.getPortletName();
   48.10 +            String configFileName = configFileTf.getText();
   48.11 +            if(configFileName == null || configFileName.trim().length() == 0)
   48.12 +                configFileTf.setText(context.getPortletName()+"-portlet.xml");
   48.13          }
   48.14                  
   48.15      }
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/portalpack.saw/l10n/build.xml	Sun Jun 26 10:25:14 2011 +0800
    49.3 @@ -0,0 +1,60 @@
    49.4 +<?xml version="1.0" encoding="UTF-8"?>
    49.5 +
    49.6 +<!--
    49.7 +The contents of this file are subject to the terms of the Common Development
    49.8 +and Distribution License (the License). You may not use this file except in
    49.9 +compliance with the License.
   49.10 +
   49.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
   49.12 +or http://www.netbeans.org/cddl.txt.
   49.13 +
   49.14 +When distributing Covered Code, include this CDDL Header Notice in each file
   49.15 +and include the License file at http://www.netbeans.org/cddl.txt.
   49.16 +If applicable, add the following below the CDDL Header, with the fields
   49.17 +enclosed by brackets [] replaced by your own identifying information:
   49.18 +"Portions Copyrighted [year] [name of copyright owner]"
   49.19 +
   49.20 + The Original Software is NetBeans. The Initial Developer of the Original
   49.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
   49.22 + Microsystems, Inc. All Rights Reserved.
   49.23 +-->
   49.24 +
   49.25 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
   49.26 +<!-- for some information on what you could do (e.g. targets to override). -->
   49.27 +<!-- If you delete this file and reopen the project it will be recreated. -->
   49.28 +<project name="ml-build" default="netbeans" basedir="../">
   49.29 +    
   49.30 +    <description>Portal Pack ML build</description>
   49.31 +    <import file="../build.xml"/>
   49.32 +    <target name="create-l10n-kit">
   49.33 +         <property name="l10nkit-dir" value="build/l10n"/>
   49.34 +         <property name="l10nkit-zip" value="build/portalpack-saw-l10nkit.zip"/>
   49.35 +         <delete dir="${l10nkit-dir}"/>
   49.36 +         <delete file="${l10nkit-zip}"/>
   49.37 +         
   49.38 +         <mkdir dir="${l10nkit-dir}"/>
   49.39 +         
   49.40 +         <copydir src="src" includes="**/Bundle.properties,**/*.html,**/*.htm" dest="${l10nkit-dir}/src"/>
   49.41 +
   49.42 +         <zip destfile="${l10nkit-zip}"
   49.43 +           basedir="${l10nkit-dir}"
   49.44 +         />
   49.45 +    </target>
   49.46 +    
   49.47 +    <target name="compile" depends="contrib/portalpack.saw.compile">
   49.48 +        <copy todir="build/classes">
   49.49 +             <fileset dir="l10n/ja"/>
   49.50 +             <fileset dir="l10n/pt_BR"/>
   49.51 +             <fileset dir="l10n/zh_CN"/>  
   49.52 +         </copy>
   49.53 +     </target>
   49.54 +	 
   49.55 +	 <target name="copyL10n">
   49.56 +		 <echo message="${l10n.src.dir}"/>
   49.57 +		 <copy todir=".">
   49.58 +			<fileset dir="${l10n.src.dir}"/>			
   49.59 +			<mapper type="glob" from="src" to="l10n/${locale}"/>
   49.60 +		 </copy>
   49.61 +	 </target>
   49.62 +      
   49.63 +</project>
    50.1 --- a/portalpack.saw/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
    50.2 +++ b/portalpack.saw/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
    50.3 @@ -2,5 +2,5 @@
    50.4  OpenIDE-Module: org.netbeans.modules.portalpack.saw
    50.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/saw/layer.xml
    50.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/saw/Bundle.properties
    50.7 -OpenIDE-Module-Specification-Version: 0.99
    50.8 +OpenIDE-Module-Specification-Version: 1.0.4
    50.9  
    51.1 --- a/portalpack.saw/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
    51.2 +++ b/portalpack.saw/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
    51.3 @@ -49,24 +49,6 @@
    51.4                      </run-dependency>
    51.5                  </dependency>
    51.6                  <dependency>
    51.7 -                    <code-name-base>org.netbeans.modules.editor</code-name-base>
    51.8 -                    <build-prerequisite/>
    51.9 -                    <compile-dependency/>
   51.10 -                    <run-dependency>
   51.11 -                        <release-version>3</release-version>
   51.12 -                        <specification-version>1.53</specification-version>
   51.13 -                    </run-dependency>
   51.14 -                </dependency>
   51.15 -                <dependency>
   51.16 -                    <code-name-base>org.netbeans.modules.editor.lib</code-name-base>
   51.17 -                    <build-prerequisite/>
   51.18 -                    <compile-dependency/>
   51.19 -                    <run-dependency>
   51.20 -                        <release-version>3</release-version>
   51.21 -                        <specification-version>3.1</specification-version>
   51.22 -                    </run-dependency>
   51.23 -                </dependency>
   51.24 -                <dependency>
   51.25                      <code-name-base>org.netbeans.modules.java.editor.lib</code-name-base>
   51.26                      <build-prerequisite/>
   51.27                      <compile-dependency/>
    52.1 --- a/portalpack.saw/src/org/netbeans/modules/portalpack/saw/layer.xml	Fri Jun 10 09:46:37 2011 +0200
    52.2 +++ b/portalpack.saw/src/org/netbeans/modules/portalpack/saw/layer.xml	Sun Jun 26 10:25:14 2011 +0800
    52.3 @@ -69,36 +69,36 @@
    52.4      </folder>
    52.5      <folder name="templates">
    52.6          <folder name="saw">
    52.7 -            <file name="SAW.tld" url="nbresloc:/templates/SAW.tld"/>
    52.8 -            <file name="WorkflowConfig.template" url="nbresloc:/templates/WorkflowConfig.template"/>
    52.9 +            <file name="SAW.tld" url="nbresloc:templates/SAW.tld"/>
   52.10 +            <file name="WorkflowConfig.template" url="nbresloc:templates/WorkflowConfig.template"/>
   52.11          </folder>
   52.12      </folder>
   52.13      <folder name="portalpack">
   52.14          <folder name="palette">
   52.15              <folder name="saw">
   52.16 -                <file name="gettaskbyid.template" url="nbresloc:/templates/gettaskbyid.template"/>
   52.17 -                <file name="gettasks.template" url="nbresloc:/templates/gettasks.template"/>
   52.18 -                <file name="count.template" url="nbresloc:/templates/count.template"/>
   52.19 -                <file name="checkout.template" url="nbresloc:/templates/checkout.template"/>
   52.20 -                <file name="checkout-method.xml" url="nbresloc:/templates/checkout-method.xml"/>
   52.21 -                <file name="checkin.template" url="nbresloc:/templates/checkin.template"/>
   52.22 -                <file name="checkin-method.xml" url="nbresloc:/templates/checkin-method.xml"/>
   52.23 -                <file name="complete.template" url="nbresloc:/templates/complete.template"/>
   52.24 -                <file name="complete-method.xml" url="nbresloc:/templates/complete-method.xml"/>
   52.25 -                <file name="delete.template" url="nbresloc:/templates/delete.template"/>
   52.26 -                <file name="delete-method.xml" url="nbresloc:/templates/delete-method.xml"/>
   52.27 -                <file name="escalate.template" url="nbresloc:/templates/escalate.template"/>
   52.28 -                <file name="escalate-method.xml" url="nbresloc:/templates/escalate-method.xml"/>
   52.29 -                <file name="getworkflow.template" url="nbresloc:/templates/getworkflow.template"/>
   52.30 -                <file name="getworkflow-method.xml" url="nbresloc:/templates/getworkflow-method.xml"/>
   52.31 -                <file name="getworkflow_prop.template" url="nbresloc:/templates/getworkflow_prop.template"/>
   52.32 -                <file name="getworkflow_prop-method.xml" url="nbresloc:/templates/getworkflow_prop-method.xml"/>
   52.33 -                <file name="reassign.template" url="nbresloc:/templates/reassign.template"/>
   52.34 -                <file name="reassign-method.xml" url="nbresloc:/templates/reassign-method.xml"/>
   52.35 -                <file name="savetask.template" url="nbresloc:/templates/savetask.template"/>
   52.36 -                <file name="savetask-method.xml" url="nbresloc:/templates/savetask-method.xml"/>
   52.37 -                <file name="showaudithistory.template" url="nbresloc:/templates/showaudithistory.template"/>
   52.38 -                <file name="showaudithistory-method.xml" url="nbresloc:/templates/showaudithistory-method.xml"/>
   52.39 +                <file name="gettaskbyid.template" url="nbresloc:templates/gettaskbyid.template"/>
   52.40 +                <file name="gettasks.template" url="nbresloc:templates/gettasks.template"/>
   52.41 +                <file name="count.template" url="nbresloc:templates/count.template"/>
   52.42 +                <file name="checkout.template" url="nbresloc:templates/checkout.template"/>
   52.43 +                <file name="checkout-method.xml" url="nbresloc:templates/checkout-method.xml"/>
   52.44 +                <file name="checkin.template" url="nbresloc:templates/checkin.template"/>
   52.45 +                <file name="checkin-method.xml" url="nbresloc:templates/checkin-method.xml"/>
   52.46 +                <file name="complete.template" url="nbresloc:templates/complete.template"/>
   52.47 +                <file name="complete-method.xml" url="nbresloc:templates/complete-method.xml"/>
   52.48 +                <file name="delete.template" url="nbresloc:templates/delete.template"/>
   52.49 +                <file name="delete-method.xml" url="nbresloc:templates/delete-method.xml"/>
   52.50 +                <file name="escalate.template" url="nbresloc:templates/escalate.template"/>
   52.51 +                <file name="escalate-method.xml" url="nbresloc:templates/escalate-method.xml"/>
   52.52 +                <file name="getworkflow.template" url="nbresloc:templates/getworkflow.template"/>
   52.53 +                <file name="getworkflow-method.xml" url="nbresloc:templates/getworkflow-method.xml"/>
   52.54 +                <file name="getworkflow_prop.template" url="nbresloc:templates/getworkflow_prop.template"/>
   52.55 +                <file name="getworkflow_prop-method.xml" url="nbresloc:templates/getworkflow_prop-method.xml"/>
   52.56 +                <file name="reassign.template" url="nbresloc:templates/reassign.template"/>
   52.57 +                <file name="reassign-method.xml" url="nbresloc:templates/reassign-method.xml"/>
   52.58 +                <file name="savetask.template" url="nbresloc:templates/savetask.template"/>
   52.59 +                <file name="savetask-method.xml" url="nbresloc:templates/savetask-method.xml"/>
   52.60 +                <file name="showaudithistory.template" url="nbresloc:templates/showaudithistory.template"/>
   52.61 +                <file name="showaudithistory-method.xml" url="nbresloc:templates/showaudithistory-method.xml"/>
   52.62              </folder>
   52.63          </folder>
   52.64      </folder>
    53.1 --- a/portalpack.servers.base_psframework/build.xml	Fri Jun 10 09:46:37 2011 +0200
    53.2 +++ b/portalpack.servers.base_psframework/build.xml	Sun Jun 26 10:25:14 2011 +0800
    53.3 @@ -24,7 +24,7 @@
    53.4  <project name="contrib/portalpack.servers.base_psframework" default="netbeans" basedir=".">
    53.5      <description>Builds, tests, and runs the project org.netbeans.modules.portalpack.servers.core.</description>
    53.6       <import file="../../nbbuild/templates/projectized.xml"/>
    53.7 -     <property name="base.nbm.target.dir" value="build"/>
    53.8 +     
    53.9  <target name="netbeans-extra" depends="release"/>
   53.10  
   53.11  <target name="release" depends="init">
    54.1 --- a/portalpack.servers.base_psframework/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
    54.2 +++ b/portalpack.servers.base_psframework/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
    54.3 @@ -2,4 +2,4 @@
    54.4  OpenIDE-Module: org.netbeans.modules.portalpack.servers.base_psframework
    54.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/servers/core/resources/layer.xml
    54.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/servers/core/resources/Bundle.properties
    54.7 -OpenIDE-Module-Specification-Version: 2.99
    54.8 +OpenIDE-Module-Specification-Version: 3.0.5
    55.1 --- a/portalpack.servers.base_psframework/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
    55.2 +++ b/portalpack.servers.base_psframework/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
    55.3 @@ -18,6 +18,6 @@
    55.4  #
    55.5  
    55.6  is.autoload=true
    55.7 -javac.source=1.5
    55.8 +javac.source=1.6
    55.9  license.file=../../LICENSE
   55.10  nbm.homepage=http://portalpack.netbeans.org
    56.1 --- a/portalpack.servers.base_psframework/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
    56.2 +++ b/portalpack.servers.base_psframework/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
    56.3 @@ -28,7 +28,7 @@
    56.4                      <compile-dependency/>
    56.5                      <run-dependency>
    56.6                          <release-version>3</release-version>
    56.7 -                        <specification-version>3.24.1.1</specification-version>
    56.8 +                        <specification-version>3.32.1</specification-version>
    56.9                      </run-dependency>
   56.10                  </dependency>
   56.11                  <dependency>
   56.12 @@ -76,51 +76,6 @@
   56.13                      </run-dependency>
   56.14                  </dependency>
   56.15                  <dependency>
   56.16 -                    <code-name-base>org.netbeans.libs.commons_logging</code-name-base>
   56.17 -                    <build-prerequisite/>
   56.18 -                    <compile-dependency/>
   56.19 -                    <run-dependency>
   56.20 -                        <release-version>1</release-version>
   56.21 -                        <specification-version>1.3.1</specification-version>
   56.22 -                    </run-dependency>
   56.23 -                </dependency>
   56.24 -                <dependency>
   56.25 -                    <code-name-base>org.netbeans.modules.classfile</code-name-base>
   56.26 -                    <build-prerequisite/>
   56.27 -                    <compile-dependency/>
   56.28 -                    <run-dependency>
   56.29 -                        <release-version>1</release-version>
   56.30 -                        <specification-version>1.18.1</specification-version>
   56.31 -                    </run-dependency>
   56.32 -                </dependency>
   56.33 -                <dependency>
   56.34 -                    <code-name-base>org.netbeans.modules.editor.deprecated.pre61settings</code-name-base>
   56.35 -                    <build-prerequisite/>
   56.36 -                    <compile-dependency/>
   56.37 -                    <run-dependency>
   56.38 -                        <release-version>0-1</release-version>
   56.39 -                        <specification-version>1.0</specification-version>
   56.40 -                    </run-dependency>
   56.41 -                </dependency>
   56.42 -                <dependency>
   56.43 -                    <code-name-base>org.netbeans.modules.editor.lib</code-name-base>
   56.44 -                    <build-prerequisite/>
   56.45 -                    <compile-dependency/>
   56.46 -                    <run-dependency>
   56.47 -                        <release-version>3</release-version>
   56.48 -                        <specification-version>3.1</specification-version>
   56.49 -                    </run-dependency>
   56.50 -                </dependency>
   56.51 -                <dependency>
   56.52 -                    <code-name-base>org.netbeans.modules.editor.util</code-name-base>
   56.53 -                    <build-prerequisite/>
   56.54 -                    <compile-dependency/>
   56.55 -                    <run-dependency>
   56.56 -                        <release-version>1</release-version>
   56.57 -                        <specification-version>1.8.12</specification-version>
   56.58 -                    </run-dependency>
   56.59 -                </dependency>
   56.60 -                <dependency>
   56.61                      <code-name-base>org.netbeans.modules.j2ee.dd</code-name-base>
   56.62                      <build-prerequisite/>
   56.63                      <compile-dependency/>
   56.64 @@ -202,14 +157,6 @@
   56.65                      </run-dependency>
   56.66                  </dependency>
   56.67                  <dependency>
   56.68 -                    <code-name-base>org.netbeans.swing.plaf</code-name-base>
   56.69 -                    <build-prerequisite/>
   56.70 -                    <compile-dependency/>
   56.71 -                    <run-dependency>
   56.72 -                        <specification-version>1.5.12</specification-version>
   56.73 -                    </run-dependency>
   56.74 -                </dependency>
   56.75 -                <dependency>
   56.76                      <code-name-base>org.openide.awt</code-name-base>
   56.77                      <build-prerequisite/>
   56.78                      <compile-dependency/>
   56.79 @@ -298,6 +245,14 @@
   56.80                      </run-dependency>
   56.81                  </dependency>
   56.82                  <dependency>
   56.83 +                    <code-name-base>org.openide.util.lookup</code-name-base>
   56.84 +                    <build-prerequisite/>
   56.85 +                    <compile-dependency/>
   56.86 +                    <run-dependency>
   56.87 +                        <specification-version>8.6.1</specification-version>
   56.88 +                    </run-dependency>
   56.89 +                </dependency>
   56.90 +                <dependency>
   56.91                      <code-name-base>org.openide.windows</code-name-base>
   56.92                      <build-prerequisite/>
   56.93                      <compile-dependency/>
   56.94 @@ -310,6 +265,7 @@
   56.95                  <friend>org.netbeans.modules.portalpack.servers.opensourcepc</friend>
   56.96                  <friend>org.netbeans.modules.portalpack.servers.sunps</friend>
   56.97                  <friend>org.netbeans.modules.portalpack.servers.websynergy</friend>
   56.98 +                <friend>org.netbeans.modules.portalpack.websynergy.portlets</friend>
   56.99                  <friend>org.netbeans.modules.portalpack.websynergy.servicebuilder</friend>
  56.100                  <package>org.netbeans.modules.portalpack.servers.core</package>
  56.101                  <package>org.netbeans.modules.portalpack.servers.core.api</package>
  56.102 @@ -318,6 +274,7 @@
  56.103                  <package>org.netbeans.modules.portalpack.servers.core.impl</package>
  56.104                  <package>org.netbeans.modules.portalpack.servers.core.impl.config</package>
  56.105                  <package>org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api</package>
  56.106 +                <package>org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss</package>
  56.107                  <package>org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver</package>
  56.108                  <package>org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.tomcat</package>
  56.109                  <package>org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.ui</package>
    57.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/JSR88DeploymentHandler.java	Fri Jun 10 09:46:37 2011 +0200
    57.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/JSR88DeploymentHandler.java	Sun Jun 26 10:25:14 2011 +0800
    57.3 @@ -18,6 +18,7 @@
    57.4  import javax.enterprise.deploy.spi.status.ProgressListener;
    57.5  import javax.enterprise.deploy.spi.status.ProgressObject;
    57.6  import org.netbeans.modules.portalpack.servers.core.common.DeploymentException;
    57.7 +import org.openide.util.Exceptions;
    57.8  import org.openide.windows.InputOutput;
    57.9  import org.openide.windows.OutputWriter;
   57.10  
   57.11 @@ -235,6 +236,42 @@
   57.12          }
   57.13      }
   57.14  
   57.15 +    public void restart(String warContext) throws DeploymentException {
   57.16 +         try {
   57.17 +            TargetModuleID[] ids = getDeploymentManager().getRunningModules(ModuleType.WAR, getDeploymentManager().getTargets());
   57.18 +            TargetModuleID[] myIDs = new TargetModuleID[1];
   57.19 +            for (TargetModuleID id : ids) {
   57.20 +                if (warContext.equals(id.getModuleID())) {
   57.21 +                    myIDs[0] = id;
   57.22 +                    ProgressObject po = getDeploymentManager().stop(new TargetModuleID[]{id});
   57.23 +                    while(po.getDeploymentStatus().isRunning()) {
   57.24 +
   57.25 +                    }
   57.26 +                    ProgressObject pl = getDeploymentManager().start(new TargetModuleID[]{id});
   57.27 +                    while(pl.getDeploymentStatus().isRunning()) {
   57.28 +
   57.29 +                    }
   57.30 +                    return;
   57.31 +                }
   57.32 +            }
   57.33 +        } catch (IllegalStateException ex) {
   57.34 +            ex.printStackTrace(errWriter);
   57.35 +        } catch (TargetException ex) {
   57.36 +            ex.printStackTrace(errWriter);
   57.37 +        }
   57.38 +    }
   57.39 +
   57.40 +    public TargetModuleID[] getRunningModules() {
   57.41 +        try {
   57.42 +            return getDeploymentManager().getRunningModules(ModuleType.WAR, getDeploymentManager().getTargets());
   57.43 +        } catch (TargetException ex) {
   57.44 +            ex.printStackTrace();
   57.45 +        } catch (IllegalStateException ex) {
   57.46 +            ex.printStackTrace();
   57.47 +        }
   57.48 +        return new TargetModuleID[]{};
   57.49 +    }
   57.50 +
   57.51      public void releaseDeploymentManager() {
   57.52          if (null != deploymentManager) {
   57.53              deploymentManager.release();
    58.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSConfigCallBackHandler.java	Fri Jun 10 09:46:37 2011 +0200
    58.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSConfigCallBackHandler.java	Sun Jun 26 10:25:14 2011 +0800
    58.3 @@ -86,5 +86,8 @@
    58.4      public boolean isDirectoryDeployment();
    58.5      
    58.6      public Properties getProperties();
    58.7 +
    58.8 +    public void setEnvProperties(String envProperties);
    58.9 +    public String getEnvProperties();
   58.10      
   58.11  }
    59.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSDeployerImpl.java	Fri Jun 10 09:46:37 2011 +0200
    59.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSDeployerImpl.java	Sun Jun 26 10:25:14 2011 +0800
    59.3 @@ -20,9 +20,6 @@
    59.4  package org.netbeans.modules.portalpack.servers.core;
    59.5  
    59.6  import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
    59.7 -import org.netbeans.modules.portalpack.servers.core.PSCommandType;
    59.8 -import org.netbeans.modules.portalpack.servers.core.PSModuleID;
    59.9 -import org.netbeans.modules.portalpack.servers.core.PSDeployer;
   59.10  import org.netbeans.modules.portalpack.servers.core.util.ProgressEventSupport;
   59.11  import org.netbeans.modules.portalpack.servers.core.util.Status;
   59.12  import org.netbeans.modules.portalpack.servers.core.util.NetbeanConstants;
   59.13 @@ -41,6 +38,7 @@
   59.14  import javax.enterprise.deploy.spi.status.ProgressObject;
   59.15  import javax.management.MBeanException;
   59.16  import org.netbeans.modules.j2ee.deployment.plugins.api.UISupport;
   59.17 +import org.openide.util.Exceptions;
   59.18  import org.openide.util.NbBundle;
   59.19  import org.openide.util.RequestProcessor;
   59.20  
   59.21 @@ -69,8 +67,20 @@
   59.22      
   59.23           
   59.24          logger.log(Level.FINEST,"Inside Deploy of Deploy71.....");
   59.25 -         
   59.26 -         module_id = new PSModuleID(target, file1.getName() );
   59.27 +        
   59.28 +        String moduleId = file1.getName();
   59.29 +        if(file1.getName().endsWith(".war")) {
   59.30 +            String fName = file1.getName();
   59.31 +            moduleId = fName.substring(0,fName.lastIndexOf("."));
   59.32 +
   59.33 +        }
   59.34 +
   59.35 +        if(file1.isDirectory()) {
   59.36 +            String fName = file2.getName();
   59.37 +            moduleId = fName.substring(0,fName.lastIndexOf("."));
   59.38 +        }
   59.39 +
   59.40 +         module_id = new PSModuleID(target, moduleId, file1.getName() );
   59.41          
   59.42         
   59.43              String server_url = "http://" + host+":"+port;
   59.44 @@ -127,7 +137,7 @@
   59.45  
   59.46      /** JSR88 method. */
   59.47      public void stop() throws OperationUnsupportedException {
   59.48 -        throw new OperationUnsupportedException("stop not supported in WS deployment"); // NOI18N
   59.49 +       throw new OperationUnsupportedException("stop not supported in WS deployment"); // NOI18N
   59.50      }
   59.51  
   59.52      /** JSR88 method. */
   59.53 @@ -195,13 +205,12 @@
   59.54          UISupport.getServerIO(uri).select();
   59.55      }
   59.56  
   59.57 -    public ProgressObject startModule(TargetModuleID[] module) {
   59.58 -        logger.log(Level.FINEST,">>>>>>>>>>>>>>>> Inside startModule");
   59.59 +    public ProgressObject stopModule(TargetModuleID[] module) {
   59.60          return this;
   59.61      }
   59.62  
   59.63 -    public ProgressObject stopModule(TargetModuleID[] module) {
   59.64 -        return this;
   59.65 +    public ProgressObject startModule(final TargetModuleID[] module) {
   59.66 +         return this;
   59.67      }
   59.68      
   59.69      
   59.70 @@ -209,7 +218,7 @@
   59.71      public ProgressObject undeploy(final String portletAppName, final String dn) {
   59.72           cmdType = PSCommandType.UNDEPLOY;
   59.73           pes.fireHandleProgressEvent(null,
   59.74 -                                    new Status(ActionType.EXECUTE, CommandType.UNDEPLOY,
   59.75 +                                    new Status(ActionType.EXECUTE, PSCommandType.UNDEPLOY,
   59.76                                                 NbBundle.getMessage(PSDeployerImpl.class, "START_UNDEPLOY"),
   59.77                                                 StateType.RUNNING));
   59.78  
   59.79 @@ -225,7 +234,7 @@
   59.80                      logger.log(Level.SEVERE,"Deployment failed for application "+portletAppName,ex);
   59.81                      writeToOutput(dm.getUri(),portletAppName + " " +org.openide.util.NbBundle.getMessage(PSDeployerImpl.class, "MSG_UNDEPLYOMENT_FAILED"));
   59.82                      pes.fireHandleProgressEvent(null,
   59.83 -                                new Status(ActionType.EXECUTE, cmdType,
   59.84 +                                new Status(ActionType.EXECUTE, PSCommandType.UNDEPLOY,
   59.85                                             org.openide.util.NbBundle.getMessage(PSDeployerImpl.class, "MSG_UNDEPLYOMENT_FAILED"),
   59.86                                             StateType.FAILED));
   59.87                      return;
   59.88 @@ -233,7 +242,7 @@
   59.89                  
   59.90                  
   59.91                  pes.fireHandleProgressEvent(null,
   59.92 -                                new Status(ActionType.EXECUTE, cmdType,
   59.93 +                                new Status(ActionType.EXECUTE, PSCommandType.UNDEPLOY,
   59.94                                             NbBundle.getMessage(PSDeployerImpl.class, "MSG_UNDEPLOYED"),
   59.95                                             StateType.COMPLETED));
   59.96              }
   59.97 @@ -260,6 +269,13 @@
   59.98      public ProgressObject createContainer(String dn, String container, String provider) {
   59.99          return this;
  59.100      }
  59.101 +
  59.102 +    public void fireHandleProgressEvent(CommandType cmdType,String msg,StateType stateType) {
  59.103 +        pes.fireHandleProgressEvent(null,
  59.104 +                                new Status(ActionType.EXECUTE, cmdType,
  59.105 +                                           msg,
  59.106 +                                           stateType));
  59.107 +    }
  59.108         
  59.109  }
  59.110  
    60.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSJ2eePlatformImpl.java	Fri Jun 10 09:46:37 2011 +0200
    60.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSJ2eePlatformImpl.java	Sun Jun 26 10:25:14 2011 +0800
    60.3 @@ -35,6 +35,8 @@
    60.4  import org.netbeans.modules.j2ee.deployment.common.api.J2eeLibraryTypeProvider;
    60.5  import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
    60.6  import org.netbeans.modules.j2ee.deployment.plugins.spi.J2eePlatformImpl;
    60.7 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibraries;
    60.8 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibrariesFactory;
    60.9  import org.netbeans.spi.project.libraries.LibraryImplementation;
   60.10  import org.openide.filesystems.FileUtil;
   60.11  
   60.12 @@ -62,11 +64,16 @@
   60.13          libraries.add(lib);
   60.14      }
   60.15      public boolean isToolSupported(String toolName) {
   60.16 -        return false;
   60.17 +         JEEServerLibraries jeeServerLibraries =
   60.18 +                JEEServerLibrariesFactory.getJEEServerLibraries(psconfig.getServerType());
   60.19 +
   60.20 +         return jeeServerLibraries.isToolSupported(toolName,psconfig);
   60.21      }
   60.22      
   60.23      public File[] getToolClasspathEntries(String toolName) {
   60.24 -        return new File[0];
   60.25 +        JEEServerLibraries jeeServerLibraries =
   60.26 +                JEEServerLibrariesFactory.getJEEServerLibraries(psconfig.getServerType());
   60.27 +        return jeeServerLibraries.getToolClasspathEntries(toolName,psconfig);
   60.28      }
   60.29      
   60.30      public Set getSupportedSpecVersions() {
   60.31 @@ -86,7 +93,11 @@
   60.32      }
   60.33      
   60.34      public java.io.File[] getPlatformRoots() {
   60.35 -        return new File[]{new File(psconfig.getPSHome())};
   60.36 +
   60.37 +        String root = psconfig.getPSHome();
   60.38 +        if(root == null || root.trim().length() == 0)
   60.39 +            root = psconfig.getServerHome();
   60.40 +        return new File[]{new File(root)};
   60.41      }
   60.42      
   60.43     public void notifyLibrariesChanged() {
    61.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSModuleConfiguration.java	Fri Jun 10 09:46:37 2011 +0200
    61.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSModuleConfiguration.java	Sun Jun 26 10:25:14 2011 +0800
    61.3 @@ -18,7 +18,10 @@
    61.4   */
    61.5  package org.netbeans.modules.portalpack.servers.core;
    61.6  
    61.7 +import java.io.OutputStream;
    61.8 +import org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException;
    61.9  import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
   61.10 +import org.netbeans.modules.j2ee.deployment.plugins.spi.config.DeploymentPlanConfiguration;
   61.11  import org.netbeans.modules.j2ee.deployment.plugins.spi.config.ModuleConfiguration;
   61.12  import org.openide.util.Lookup;
   61.13  import org.openide.util.lookup.Lookups;
   61.14 @@ -27,15 +30,19 @@
   61.15   *
   61.16   * @author Satyaranjan
   61.17   */
   61.18 -public class PSModuleConfiguration implements ModuleConfiguration{
   61.19 +public class PSModuleConfiguration implements ModuleConfiguration, DeploymentPlanConfiguration{
   61.20      private J2eeModule j2eeModule;
   61.21 +    private Lookup lookup;
   61.22      public PSModuleConfiguration(J2eeModule j2eeModule) {
   61.23          this.j2eeModule = j2eeModule;
   61.24          createConfiguration();
   61.25      }
   61.26  
   61.27      public Lookup getLookup() {
   61.28 -        return Lookups.fixed(this);
   61.29 +        if (null == lookup) {
   61.30 +            lookup = Lookups.fixed(this);
   61.31 +        }
   61.32 +        return lookup;
   61.33      }
   61.34  
   61.35      public J2eeModule getJ2eeModule() {
   61.36 @@ -51,4 +58,8 @@
   61.37          
   61.38      }
   61.39  
   61.40 +    public void save(OutputStream outputStream) throws ConfigurationException {
   61.41 +        //do nothing.
   61.42 +    }
   61.43 +
   61.44  }
    62.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSModuleID.java	Fri Jun 10 09:46:37 2011 +0200
    62.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSModuleID.java	Sun Jun 26 10:25:14 2011 +0800
    62.3 @@ -33,15 +33,17 @@
    62.4      private Target target;
    62.5      private String jar_name;
    62.6      private String context_url;
    62.7 +    private String moduleId;
    62.8  
    62.9      Vector childs = new Vector();
   62.10      TargetModuleID  parent = null;
   62.11      public PSModuleID(Target target){
   62.12 -        this( target, "");
   62.13 +        this( target, "", "");
   62.14      }
   62.15 -    public PSModuleID(Target target, String jar_name  ){
   62.16 +    public PSModuleID(Target target, String moduleId, String jar_name  ){
   62.17          this.target = target;
   62.18          this.setJARName(jar_name);
   62.19 +        this.moduleId = moduleId;
   62.20          
   62.21      }    
   62.22      public void setContextURL( String context_url ){
   62.23 @@ -66,7 +68,7 @@
   62.24      }
   62.25      //Retrieve a list of identifiers of the children of this deployed module.
   62.26      public java.lang.String     getModuleID(){
   62.27 -        return jar_name ;
   62.28 +        return moduleId ;
   62.29      }
   62.30      //         Retrieve the id assigned to represent the deployed module.
   62.31      public TargetModuleID     getParentTargetModuleID(){
   62.32 @@ -83,7 +85,7 @@
   62.33      }
   62.34      //If this TargetModulID represents a web module retrieve the URL for it.
   62.35      public java.lang.String     toString() {
   62.36 -        return getModuleID() +  hashCode();
   62.37 +        return getModuleID();
   62.38      }
   62.39      
   62.40  }
    63.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSStartServer.java	Fri Jun 10 09:46:37 2011 +0200
    63.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/PSStartServer.java	Sun Jun 26 10:25:14 2011 +0800
    63.3 @@ -41,6 +41,7 @@
    63.4  import org.netbeans.modules.j2ee.deployment.plugins.api.ServerDebugInfo;
    63.5  import org.netbeans.modules.j2ee.deployment.plugins.spi.StartServer;
    63.6  import org.netbeans.modules.j2ee.deployment.plugins.api.UISupport;
    63.7 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
    63.8  import org.openide.util.NbBundle;
    63.9  import org.openide.util.RequestProcessor;
   63.10  
   63.11 @@ -225,17 +226,21 @@
   63.12      
   63.13      // Ruunable run implementation
   63.14      public synchronized void run(){
   63.15 -        
   63.16 +
   63.17 +        String[] env = null;
   63.18 +        PSConfigObject psConfig = dm.getPSConfig();
   63.19 +        if(psConfig != null) {
   63.20 +            env = psConfig.getEnvProperties();
   63.21 +        }
   63.22          Object lock = new Object();
   63.23          if (cmdType.equals(PSCommandType.START)) {
   63.24              
   63.25              logger.log(Level.FINEST,"Just before starting server ****");
   63.26              try{
   63.27 -                
   63.28 -                
   63.29 +
   63.30                  //start admin server
   63.31                  writeToOutput(org.openide.util.NbBundle.getMessage(PSStartServer.class, "MSG_STARTING_ADMIN_SERVER"));
   63.32 -                startServerHandler.startServer(); 
   63.33 +                startServerHandler.startServer(env);
   63.34                  pes.fireHandleProgressEvent(null,
   63.35                          new Status(ActionType.EXECUTE, cmdType,
   63.36                          NbBundle.getMessage(PSStartServer.class,"MSG_ADMIN_SERVER_STARTED"),
   63.37 @@ -250,7 +255,7 @@
   63.38          } else if(cmdType.equals(PSCommandType.STOP)) {
   63.39              try{
   63.40                              
   63.41 -                startServerHandler.stopServer();
   63.42 +                startServerHandler.stopServer(env);
   63.43                  
   63.44                  pes.fireHandleProgressEvent(null,
   63.45                          new Status(ActionType.EXECUTE, cmdType,
   63.46 @@ -276,7 +281,7 @@
   63.47                   
   63.48                  //start admin server
   63.49                  writeToOutput(org.openide.util.NbBundle.getMessage(PSStartServer.class, "MSG_STARTING_ADMIN_SERVER"));
   63.50 -                startServerHandler.startDebug(); 
   63.51 +                startServerHandler.startDebug(env);
   63.52                  pes.fireHandleProgressEvent(null,
   63.53                          new Status(ActionType.EXECUTE, cmdType,
   63.54                          NbBundle.getMessage(PSStartServer.class,"MSG_ADMIN_SERVER_STARTED"),
    64.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/WS70StartServer.java	Fri Jun 10 09:46:37 2011 +0200
    64.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/WS70StartServer.java	Sun Jun 26 10:25:14 2011 +0800
    64.3 @@ -52,14 +52,14 @@
    64.4          
    64.5      }
    64.6      
    64.7 -    public void doStartServer() throws Exception {
    64.8 +    public void doStartServer(String[] env) throws Exception {
    64.9          runProcess(makeProcessString("start"), true); //NO I18N  
   64.10          if(!dm.isRunningInstanceServer()) {
   64.11              runProcess(makeProcessStringForDomain("start"),true);
   64.12          }
   64.13      }
   64.14      
   64.15 -    public void doStopServer() throws Exception {
   64.16 +    public void doStopServer(String[] env) throws Exception {
   64.17          
   64.18          runProcess(makeProcessString("stop"), true); //NO I18N
   64.19          if(dm.isRunningInstanceServer()) {
   64.20 @@ -132,10 +132,10 @@
   64.21          }
   64.22      }
   64.23  
   64.24 -    public void doStartDebug() throws Exception {
   64.25 +    public void doStartDebug(String[] env) throws Exception {
   64.26      }
   64.27  
   64.28 -    public void doStopDebug() throws Exception {
   64.29 +    public void doStopDebug(String[] env) throws Exception {
   64.30      }
   64.31  
   64.32      public int getDebugPort() {
    65.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/WizardPropertyReader.java	Fri Jun 10 09:46:37 2011 +0200
    65.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/WizardPropertyReader.java	Sun Jun 26 10:25:14 2011 +0800
    65.3 @@ -33,7 +33,7 @@
    65.4      
    65.5      private WizardDescriptor desc;
    65.6      private Properties _addProperties;
    65.7 -    
    65.8 +
    65.9      private static String ADD_PP_LIST_KEY = "ADD_PROP_LIST_KEY";
   65.10      private List addPropNameList;
   65.11      /** Creates a new instance of WizardPropertyReader */
   65.12 @@ -221,6 +221,15 @@
   65.13          _setProperty("PORTAL_URI",uri);
   65.14      }
   65.15  
   65.16 +    public void setEnvProperties(String envProperties) {
   65.17 +
   65.18 +        _setProperty("SERVER_ENV_PROPERTIES", envProperties);
   65.19 +    }
   65.20 +
   65.21 +    public String getEnvProperties() {
   65.22 +        return _getProperty("SERVER_ENV_PROPERTIES");
   65.23 +    }
   65.24 +
   65.25      public Properties getProperties() {
   65.26          
   65.27          Properties prop = new Properties();
    66.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/api/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
    66.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/api/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
    66.3 @@ -36,4 +36,5 @@
    66.4  
    66.5  MSG_DEPLOYED=Deployed Successfully.
    66.6  
    66.7 -MSG_UNDEPLOYED=UnDeployed Successfully
    66.8 \ No newline at end of file
    66.9 +MSG_UNDEPLOYED=UnDeployed Successfully
   66.10 +MSG_UNDEPLOYMENT_NOT_REQUIRED=Undeployment not required
   66.11 \ No newline at end of file
    67.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/api/PSDeploymentFactory.java	Fri Jun 10 09:46:37 2011 +0200
    67.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/api/PSDeploymentFactory.java	Sun Jun 26 10:25:14 2011 +0800
    67.3 @@ -19,39 +19,81 @@
    67.4  
    67.5  package org.netbeans.modules.portalpack.servers.core.api;
    67.6  
    67.7 -import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager;
    67.8 +import java.util.HashMap;
    67.9 +import java.util.Map;
   67.10  import javax.enterprise.deploy.spi.DeploymentManager;
   67.11  import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException;
   67.12  import javax.enterprise.deploy.spi.factories.DeploymentFactory;
   67.13 -import org.openide.util.NbBundle;
   67.14 +import org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment;
   67.15 +import org.netbeans.modules.j2ee.deployment.devmodules.spi.InstanceListener;
   67.16  
   67.17  /**
   67.18   * @author Satya
   67.19   */
   67.20 -public abstract class PSDeploymentFactory implements DeploymentFactory {
   67.21 -     
   67.22 +public abstract class PSDeploymentFactory implements DeploymentFactory, InstanceListener {
   67.23 +
   67.24 +    final private Map<String,DeploymentManager> dms = new HashMap<String,DeploymentManager>();
   67.25 +    private boolean instanceListenerAdded;
   67.26 +
   67.27      public boolean handlesURI(String uri) {
   67.28          return uri != null && uri.startsWith(getURIPrefix());
   67.29      }
   67.30      
   67.31      public DeploymentManager getDeploymentManager(String uri, String uname, String passwd) throws DeploymentManagerCreationException {
   67.32 +        registerInstanceListener();
   67.33          if (!handlesURI(uri)) {
   67.34              throw new DeploymentManagerCreationException("Invalid URI:" + uri); // NOI18N
   67.35          }
   67.36 -        return getPSDeploymentManager(uri,getPSVersion());
   67.37 +
   67.38 +        synchronized(dms) {
   67.39 +            DeploymentManager dm = (DeploymentManager)dms.get(uri);
   67.40 +            if(dm == null) {
   67.41 +                dm = getPSDeploymentManager(uri,getPSVersion());
   67.42 +                dms.put(uri,dm);
   67.43 +            }
   67.44 +            return dm;
   67.45 +        }
   67.46      }
   67.47      
   67.48      public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException {
   67.49 +        registerInstanceListener();
   67.50          if (!handlesURI(uri)) {
   67.51              throw new DeploymentManagerCreationException("Invalid URI:" + uri); // NOI18N
   67.52          }
   67.53 -        return getPSDeploymentManager(uri,getPSVersion());
   67.54 +        synchronized(dms) {
   67.55 +            DeploymentManager dm = (DeploymentManager)dms.get(uri);
   67.56 +            if(dm == null) {
   67.57 +                dm = getPSDeploymentManager(uri,getPSVersion());
   67.58 +                dms.put(uri,dm);
   67.59 +            }
   67.60 +            return dm;
   67.61 +        }
   67.62      }
   67.63      
   67.64      public String getProductVersion() {
   67.65          return "0.1"; // NOI18N
   67.66      }
   67.67 -    
   67.68 +
   67.69 +    private void registerInstanceListener() {
   67.70 +        synchronized(dms) {
   67.71 +            if(!instanceListenerAdded) {
   67.72 +                Deployment.getDefault().addInstanceListener(this);
   67.73 +                instanceListenerAdded = true;
   67.74 +            }
   67.75 +        }
   67.76 +    }
   67.77 +
   67.78 +    public void instanceAdded(String serverInstanceID) {
   67.79 +
   67.80 +    }
   67.81 +
   67.82 +    public void instanceRemoved(String serverInstanceID) {
   67.83 +        synchronized (dms) {
   67.84 +            // serverInstanceID is really the URI of this installed server :)
   67.85 +            dms.remove(serverInstanceID);
   67.86 +        }
   67.87 +    }
   67.88 +
   67.89      public abstract DeploymentManager getPSDeploymentManager(String uri,String psVersion);
   67.90      public abstract String getDisplayName();
   67.91      
    68.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/api/PSDeploymentManager.java	Fri Jun 10 09:46:37 2011 +0200
    68.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/api/PSDeploymentManager.java	Sun Jun 26 10:25:14 2011 +0800
    68.3 @@ -36,8 +36,10 @@
    68.4  import java.util.logging.Level;
    68.5  import java.util.logging.Logger;
    68.6  import javax.enterprise.deploy.model.DeployableObject;
    68.7 +import javax.enterprise.deploy.shared.CommandType;
    68.8  import javax.enterprise.deploy.shared.DConfigBeanVersionType;
    68.9  import javax.enterprise.deploy.shared.ModuleType;
   68.10 +import javax.enterprise.deploy.shared.StateType;
   68.11  import javax.enterprise.deploy.spi.DeploymentConfiguration;
   68.12  import javax.enterprise.deploy.spi.DeploymentManager;
   68.13  import javax.enterprise.deploy.spi.Target;
   68.14 @@ -49,10 +51,14 @@
   68.15  import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
   68.16  import org.netbeans.modules.j2ee.sun.api.SunURIManager;
   68.17  import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
   68.18 +import org.netbeans.modules.portalpack.servers.core.common.ShortCircuitProgressObject;
   68.19 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.ServerDeployHandler;
   68.20 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.ServerDeployerHandlerFactory;
   68.21  import org.openide.ErrorManager;
   68.22  import org.openide.filesystems.FileLock;
   68.23  import org.openide.filesystems.FileObject;
   68.24  import org.openide.filesystems.FileUtil;
   68.25 +import org.openide.util.NbBundle;
   68.26  
   68.27  /**
   68.28   * @author Satya
   68.29 @@ -67,6 +73,7 @@
   68.30      private String psVersion;
   68.31      private LogManager logManager;
   68.32      private PSJ2eePlatformImpl psPlatformImpl;
   68.33 +    private ServerDeployHandler serverDeployHandler;
   68.34      
   68.35      public PSDeploymentManager(String uri,String psVersion)
   68.36      {
   68.37 @@ -80,6 +87,7 @@
   68.38              port = 80;
   68.39          }
   68.40          logManager = new LogManager(this);
   68.41 +        serverDeployHandler = getServerDeployHandler();
   68.42        
   68.43          psconfig.addPropertyChangeListener(new PropertyChangeListener() {
   68.44              public void propertyChange(PropertyChangeEvent evt) {
   68.45 @@ -151,7 +159,10 @@
   68.46  
   68.47      public ProgressObject redeploy(TargetModuleID[] targetModuleID, InputStream inputStream, InputStream inputStream2) throws UnsupportedOperationException, IllegalStateException {
   68.48          logger.log(Level.FINEST,"Inside redeploy ***");
   68.49 -        return null;
   68.50 +        return new ShortCircuitProgressObject(CommandType.REDEPLOY,
   68.51 +                        "",
   68.52 +                        StateType.COMPLETED, targetModuleID);
   68.53 +//        return null;
   68.54      }
   68.55  
   68.56      public ProgressObject distribute(Target[] target, InputStream inputStream, InputStream inputStream2) throws IllegalStateException {
   68.57 @@ -161,7 +172,20 @@
   68.58  
   68.59      public ProgressObject undeploy(TargetModuleID[] targetModuleID) throws IllegalStateException {
   68.60          logger.log(Level.FINEST,"Inside undeploy ***");
   68.61 -        return null;
   68.62 +        
   68.63 +        if(!psconfig.isRemote() && psconfig.isDirectoryDeployment()) {
   68.64 +            PSDeployerImpl depl = new PSDeployerImpl(this,host,port);
   68.65 +            if(targetModuleID != null && targetModuleID.length != 0) {
   68.66 +                String moduleID = targetModuleID[0].getModuleID();
   68.67 +                depl.undeploy(moduleID,null);
   68.68 +                return depl;
   68.69 +            }
   68.70 +        }
   68.71 +
   68.72 +        return new ShortCircuitProgressObject(CommandType.UNDEPLOY,
   68.73 +                        "",
   68.74 +                        StateType.COMPLETED, targetModuleID);
   68.75 +    
   68.76      }
   68.77  
   68.78      public ProgressObject stop(TargetModuleID[] targetModuleID) throws IllegalStateException {
   68.79 @@ -185,7 +209,12 @@
   68.80  
   68.81      public TargetModuleID[] getAvailableModules(ModuleType moduleType, Target[] target) throws TargetException, IllegalStateException {
   68.82          logger.log(Level.FINEST,"Inside getAvailableModules ***");
   68.83 -        return new TargetModuleID[]{};
   68.84 +
   68.85 +        if(!psconfig.isRemote() && serverDeployHandler != null) {
   68.86 +            return serverDeployHandler.getAvailableModules(target);
   68.87 +        }
   68.88 +
   68.89 +        return  new TargetModuleID[0];
   68.90      }
   68.91  
   68.92      public TargetModuleID[] getNonRunningModules(ModuleType moduleType, Target[] target) throws TargetException, IllegalStateException {
   68.93 @@ -195,12 +224,22 @@
   68.94  
   68.95      public TargetModuleID[] getRunningModules(ModuleType moduleType, Target[] target) throws TargetException, IllegalStateException {
   68.96          logger.log(Level.FINEST,"Insidee getRunningModule ***");
   68.97 -        return new TargetModuleID[]{};
   68.98 +        if(!psconfig.isRemote() && serverDeployHandler != null) {
   68.99 +            return serverDeployHandler.getAvailableModules(target);
  68.100 +        }
  68.101 +
  68.102 +        return  new TargetModuleID[0];
  68.103      }
  68.104  
  68.105      public ProgressObject redeploy(TargetModuleID[] targetModuleID, File file, File file2) throws UnsupportedOperationException, IllegalStateException {
  68.106          logger.log(Level.FINEST,"Inside redeploy file file *");
  68.107 -        return null;
  68.108 +        PSDeployer depl = new PSDeployerImpl(this,host,port);
  68.109 +        ProgressObject po = depl.deploy(targetModuleID[0].getTarget(),file,file2);
  68.110 +        return po;
  68.111 +  //      return new ShortCircuitProgressObject(CommandType.REDEPLOY,
  68.112 +    //                    "",
  68.113 +    //                    StateType.COMPLETED, targetModuleID);
  68.114 +        //return null;
  68.115      }
  68.116  
  68.117      public void setDConfigBeanVersion(DConfigBeanVersionType dConfigBeanVersionType) throws DConfigBeanVersionUnsupportedException {
  68.118 @@ -248,9 +287,11 @@
  68.119      
  68.120      public boolean isRunning(){        
  68.121         
  68.122 -        if(isRunningAdminServer() && isRunningInstanceServer())
  68.123 -            return true;
  68.124 -        else
  68.125 +        if(isRunningAdminServer() && isRunningInstanceServer()) {
  68.126 +            if(getServerDeployHandler() == null)
  68.127 +                return true;
  68.128 +            return getServerDeployHandler().isServerRunning();
  68.129 +        }else
  68.130              return false;
  68.131      }
  68.132      
  68.133 @@ -382,7 +423,7 @@
  68.134         return false;
  68.135     }
  68.136     
  68.137 -   public void showServerLog()
  68.138 +   public void showServerLog(boolean createNew)
  68.139     {
  68.140         //do nothing
  68.141     }
  68.142 @@ -390,6 +431,15 @@
  68.143     public String getServerIcon() {
  68.144         return null;
  68.145     }
  68.146 +
  68.147 +   public ServerDeployHandler getServerDeployHandler() {
  68.148 +       if(serverDeployHandler == null) {
  68.149 +            serverDeployHandler =
  68.150 +                    ServerDeployerHandlerFactory.getServerDeployerHandler(this);
  68.151 +       }
  68.152 +       return serverDeployHandler;
  68.153 +   }
  68.154 +
  68.155     public abstract PSTaskHandler getTaskHandler();
  68.156     public abstract PSConfigPanelManager getPSConfigPanelManager();
  68.157     public PSNodeConfiguration getPSNodeConfiguration()
    69.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/api/PSStartServerInf.java	Fri Jun 10 09:46:37 2011 +0200
    69.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/api/PSStartServerInf.java	Sun Jun 26 10:25:14 2011 +0800
    69.3 @@ -26,33 +26,54 @@
    69.4   * @author Satya
    69.5   */
    69.6  public abstract class PSStartServerInf {
    69.7 -    
    69.8 +
    69.9 +    public static String USE_CUSTOM_STARTUP_SCRIPT = "use_custom_startup_script";
   69.10      private List listeners;
   69.11 +    public final void startServer(String[] env) throws Exception
   69.12 +    {
   69.13 +        fireStartStopEvent(StartStopEvent.BEFORE_START);
   69.14 +        doStartServer(env);
   69.15 +        fireStartStopEvent(StartStopEvent.AFTER_START);
   69.16 +    }
   69.17 +
   69.18      public final void startServer() throws Exception
   69.19      {
   69.20 +        startServer(null);
   69.21 +    }
   69.22 +    public final void stopServer(String[] env) throws Exception
   69.23 +    {
   69.24 +        fireStartStopEvent(StartStopEvent.BEFORE_STOP);
   69.25 +        doStopServer(env);
   69.26 +        fireStartStopEvent(StartStopEvent.AFTER_STOP);
   69.27 +    }
   69.28 +
   69.29 +    public final void stopServer() throws Exception
   69.30 +    {
   69.31 +        startServer(null);
   69.32 +    }
   69.33 +    
   69.34 +    public final void startDebug(String[] env) throws Exception
   69.35 +    {
   69.36          fireStartStopEvent(StartStopEvent.BEFORE_START);
   69.37 -        doStartServer();
   69.38 +        doStartDebug(env);
   69.39          fireStartStopEvent(StartStopEvent.AFTER_START);
   69.40      }
   69.41 -    public final void stopServer() throws Exception
   69.42 -    {
   69.43 -        fireStartStopEvent(StartStopEvent.BEFORE_STOP);
   69.44 -        doStopServer();
   69.45 -        fireStartStopEvent(StartStopEvent.AFTER_STOP);
   69.46 -    }
   69.47 -    
   69.48 +
   69.49      public final void startDebug() throws Exception
   69.50      {
   69.51 +        startDebug(null);
   69.52 +    }
   69.53 +
   69.54 +    public final void stopDebug(String[] env) throws Exception
   69.55 +    {
   69.56          fireStartStopEvent(StartStopEvent.BEFORE_START);
   69.57 -        doStartDebug();
   69.58 +        doStopDebug(env);
   69.59          fireStartStopEvent(StartStopEvent.AFTER_START);
   69.60      }
   69.61  
   69.62      public final void stopDebug() throws Exception
   69.63      {
   69.64 -        fireStartStopEvent(StartStopEvent.BEFORE_START);
   69.65 -        doStopDebug();
   69.66 -        fireStartStopEvent(StartStopEvent.AFTER_START);
   69.67 +        stopDebug(null);
   69.68      }
   69.69      public void addListener(ServerStartStopListener listener)
   69.70      {
   69.71 @@ -85,10 +106,10 @@
   69.72          }
   69.73      }
   69.74      
   69.75 -    public abstract void doStartServer() throws Exception;
   69.76 -    public abstract void doStopServer() throws Exception;
   69.77 -    public abstract void doStartDebug() throws Exception;
   69.78 -    public abstract void doStopDebug() throws Exception;
   69.79 +    public abstract void doStartServer(String[] env) throws Exception;
   69.80 +    public abstract void doStopServer(String[] env) throws Exception;
   69.81 +    public abstract void doStartDebug(String[] env) throws Exception;
   69.82 +    public abstract void doStopDebug(String[] env) throws Exception;
   69.83      public abstract int  getDebugPort(); 
   69.84      //Implement this menthod to make debugger find the generated jsps
   69.85      public abstract FindJSPServlet getFindJSPServlet(PSDeploymentManager dm);  
    70.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/common/ServerConstants.java	Fri Jun 10 09:46:37 2011 +0200
    70.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/common/ServerConstants.java	Sun Jun 26 10:25:14 2011 +0800
    70.3 @@ -1,8 +1,8 @@
    70.4  /*
    70.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    70.6 - * 
    70.7 + *
    70.8   * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
    70.9 - * 
   70.10 + *
   70.11   * The contents of this file are subject to the terms of either the GNU
   70.12   * General Public License Version 2 only ("GPL") or the Common
   70.13   * Development and Distribution License("CDDL") (collectively, the
   70.14 @@ -20,7 +20,7 @@
   70.15   * License Header, with the fields enclosed by brackets [] replaced by
   70.16   * your own identifying information:
   70.17   * "Portions Copyrighted [year] [name of copyright owner]"
   70.18 - * 
   70.19 + *
   70.20   * If you wish your version of this file to be governed by only the CDDL
   70.21   * or only the GPL Version 2, indicate your decision by adding
   70.22   * "[Contributor] elects to include this software in this distribution
   70.23 @@ -31,9 +31,9 @@
   70.24   * However, if you add GPL Version 2 code and therefore, elected the GPL
   70.25   * Version 2 license, then the option applies only if the new code is
   70.26   * made subject to such option by the copyright holder.
   70.27 - * 
   70.28 + *
   70.29   * Contributor(s):
   70.30 - * 
   70.31 + *
   70.32   * Portions Copyrighted 2008 Sun Microsystems, Inc.
   70.33   */
   70.34  
   70.35 @@ -47,4 +47,5 @@
   70.36      public static String SUN_APP_SERVER_9 = "SUN_APP_SERVER_9";
   70.37      public static String TOMCAT_5_X = "TOMCAT_5_X";
   70.38      public static String TOMCAT_6_X = "Tomcat_6_X";
   70.39 +    public static String JBOSS_5_X = "JBOSS_5_X";
   70.40  }
    71.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/common/ShortCircuitProgressObject.java	Sun Jun 26 10:25:14 2011 +0800
    71.3 @@ -0,0 +1,179 @@
    71.4 +/*
    71.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    71.6 + *
    71.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    71.8 + *
    71.9 + * The contents of this file are subject to the terms of either the GNU
   71.10 + * General Public License Version 2 only ("GPL") or the Common
   71.11 + * Development and Distribution License("CDDL") (collectively, the
   71.12 + * "License"). You may not use this file except in compliance with the
   71.13 + * License. You can obtain a copy of the License at
   71.14 + * http://www.netbeans.org/cddl-gplv2.html
   71.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   71.16 + * specific language governing permissions and limitations under the
   71.17 + * License.  When distributing the software, include this License Header
   71.18 + * Notice in each file and include the License file at
   71.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   71.20 + * particular file as subject to the "Classpath" exception as provided
   71.21 + * by Sun in the GPL Version 2 section of the License file that
   71.22 + * accompanied this code. If applicable, add the following below the
   71.23 + * License Header, with the fields enclosed by brackets [] replaced by
   71.24 + * your own identifying information:
   71.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   71.26 + *
   71.27 + * If you wish your version of this file to be governed by only the CDDL
   71.28 + * or only the GPL Version 2, indicate your decision by adding
   71.29 + * "[Contributor] elects to include this software in this distribution
   71.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   71.31 + * single choice of license, a recipient has the option to distribute
   71.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   71.33 + * to extend the choice of license to its licensees as provided above.
   71.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   71.35 + * Version 2 license, then the option applies only if the new code is
   71.36 + * made subject to such option by the copyright holder.
   71.37 + *
   71.38 + * Contributor(s):
   71.39 + *
   71.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   71.41 + */
   71.42 +
   71.43 +package org.netbeans.modules.portalpack.servers.core.common;
   71.44 +
   71.45 +import javax.enterprise.deploy.shared.ActionType;
   71.46 +import javax.enterprise.deploy.shared.CommandType;
   71.47 +import javax.enterprise.deploy.shared.StateType;
   71.48 +import javax.enterprise.deploy.spi.TargetModuleID;
   71.49 +import javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException;
   71.50 +import javax.enterprise.deploy.spi.status.ClientConfiguration;
   71.51 +import javax.enterprise.deploy.spi.status.DeploymentStatus;
   71.52 +import javax.enterprise.deploy.spi.status.ProgressListener;
   71.53 +import javax.enterprise.deploy.spi.status.ProgressObject;
   71.54 +import org.netbeans.modules.portalpack.servers.core.util.ProgressEventSupport;
   71.55 +
   71.56 +/**
   71.57 + *
   71.58 + * @author vkraemer
   71.59 + */
   71.60 +public class ShortCircuitProgressObject implements ProgressObject {
   71.61 +
   71.62 +    private CommandType ct;
   71.63 +    private String message;
   71.64 +    private StateType st;
   71.65 +    private TargetModuleID[] tmids;
   71.66 +    ProgressEventSupport pes = new ProgressEventSupport(this);
   71.67 +
   71.68 +    /**
   71.69 +     *
   71.70 +     * @param ct
   71.71 +     * @param message
   71.72 +     * @param st
   71.73 +     * @param tmids
   71.74 +     */
   71.75 +    public ShortCircuitProgressObject(CommandType ct, String message, StateType st, TargetModuleID[] tmids) {
   71.76 +        this.ct = ct;
   71.77 +        this.message = message;
   71.78 +        this.st = st;
   71.79 +        this.tmids = tmids;
   71.80 +    }
   71.81 +
   71.82 +    /**
   71.83 +     *
   71.84 +     * @return
   71.85 +     */
   71.86 +    public DeploymentStatus getDeploymentStatus() {
   71.87 +        return new DeploymentStatus() {
   71.88 +
   71.89 +            public ActionType getAction() {
   71.90 +                return ActionType.EXECUTE;
   71.91 +            }
   71.92 +
   71.93 +            public CommandType getCommand() {
   71.94 +                return ct;
   71.95 +            }
   71.96 +
   71.97 +            public String getMessage() {
   71.98 +                return message;
   71.99 +            }
  71.100 +
  71.101 +            public StateType getState() {
  71.102 +                return st;
  71.103 +            }
  71.104 +
  71.105 +            public boolean isCompleted() {
  71.106 +                return st.equals(StateType.COMPLETED);
  71.107 +            }
  71.108 +
  71.109 +            public boolean isFailed() {
  71.110 +                return st.equals(StateType.FAILED);
  71.111 +            }
  71.112 +
  71.113 +            public boolean isRunning() {
  71.114 +                return st.equals(StateType.RUNNING);
  71.115 +            }
  71.116 +        };
  71.117 +    }
  71.118 +
  71.119 +    /**
  71.120 +     *
  71.121 +     * @return
  71.122 +     */
  71.123 +    public TargetModuleID[] getResultTargetModuleIDs() {
  71.124 +        return tmids;
  71.125 +    }
  71.126 +
  71.127 +    /**
  71.128 +     *
  71.129 +     * @param targetModuleID
  71.130 +     * @return
  71.131 +     */
  71.132 +    public ClientConfiguration getClientConfiguration(TargetModuleID targetModuleID) {
  71.133 +        return null;
  71.134 +    }
  71.135 +
  71.136 +    /**
  71.137 +     *
  71.138 +     * @return
  71.139 +     */
  71.140 +    public boolean isCancelSupported() {
  71.141 +        return false;
  71.142 +    }
  71.143 +
  71.144 +    /**
  71.145 +     *
  71.146 +     * @throws javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException
  71.147 +     */
  71.148 +    public void cancel() throws OperationUnsupportedException {
  71.149 +    }
  71.150 +
  71.151 +    /**
  71.152 +     *
  71.153 +     * @return
  71.154 +     */
  71.155 +    public boolean isStopSupported() {
  71.156 +        return false;
  71.157 +    }
  71.158 +
  71.159 +    /**
  71.160 +     *
  71.161 +     * @throws javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException
  71.162 +     */
  71.163 +    public void stop() throws OperationUnsupportedException {
  71.164 +    }
  71.165 +
  71.166 +    /**
  71.167 +     *
  71.168 +     * @param progressListener
  71.169 +     */
  71.170 +    public void addProgressListener(ProgressListener progressListener) {
  71.171 +        pes.addProgressListener(progressListener);
  71.172 +    }
  71.173 +
  71.174 +    /**
  71.175 +     *
  71.176 +     * @param progressListener
  71.177 +     */
  71.178 +    public void removeProgressListener(ProgressListener progressListener) {
  71.179 +        pes.removeProgressListener(progressListener);
  71.180 +    }
  71.181 +}
  71.182 +
    72.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/DefaultStartServerImpl.java	Fri Jun 10 09:46:37 2011 +0200
    72.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/DefaultStartServerImpl.java	Sun Jun 26 10:25:14 2011 +0800
    72.3 @@ -33,19 +33,19 @@
    72.4      public DefaultStartServerImpl() {
    72.5      }
    72.6  
    72.7 -    public void doStartServer() throws Exception {
    72.8 +    public void doStartServer(String[] env) throws Exception {
    72.9          System.out.println("StartServer is not implemented yet...");
   72.10      }
   72.11  
   72.12 -    public void doStopServer() throws Exception {
   72.13 +    public void doStopServer(String[] env) throws Exception {
   72.14          
   72.15          System.out.println("StartServer is not implemented yet...");
   72.16      }
   72.17  
   72.18 -    public void doStartDebug() throws Exception {
   72.19 +    public void doStartDebug(String[] env) throws Exception {
   72.20      }
   72.21  
   72.22 -    public void doStopDebug() throws Exception {
   72.23 +    public void doStopDebug(String[] env) throws Exception {
   72.24      }
   72.25  
   72.26      public int getDebugPort(){
    73.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/config/SunPSModuleConfiguration.java	Fri Jun 10 09:46:37 2011 +0200
    73.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/config/SunPSModuleConfiguration.java	Sun Jun 26 10:25:14 2011 +0800
    73.3 @@ -53,7 +53,11 @@
    73.4                      if (file.exists())
    73.5                          return;
    73.6                      String text = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
    73.7 -                                +"<portlet-app-extension xmlns=\"http://www.sun.com/software/xml/ns/portal_server\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:sunportal=\"http://www.sun.com/software/xml/ns/portal_server\" xsi:noNamespaceSchemaLocation=\"http://www.sun.com/software/xml/ns/portal_server\" version=\"1.0\">\n"
    73.8 +                                +"<portlet-app-extension xmlns=\"http://portlet-container.dev.java.net/xml/ns/sun-portlet_2_0.xsd\" " +
    73.9 +                                "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
   73.10 +                                "xmlns:sunportal=\"http://portlet-container.dev.java.net/xml/ns/sun-portlet_2_0.xsd\" " +
   73.11 +                                "xsi:noNamespaceSchemaLocation=\"http://portlet-container.dev.java.net/xml/ns/sun-portlet_2_0.xsd\" " +
   73.12 +                                "version=\"2.0\">\n"
   73.13                                  +"</portlet-app-extension>";
   73.14                      try{
   73.15                          writer = new java.io.FileWriter(file);
    74.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/DefaultJEEServerLibraries.java	Sun Jun 26 10:25:14 2011 +0800
    74.3 @@ -0,0 +1,100 @@
    74.4 +/*
    74.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    74.6 + *
    74.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    74.8 + *
    74.9 + * The contents of this file are subject to the terms of either the GNU
   74.10 + * General Public License Version 2 only ("GPL") or the Common
   74.11 + * Development and Distribution License("CDDL") (collectively, the
   74.12 + * "License"). You may not use this file except in compliance with the
   74.13 + * License. You can obtain a copy of the License at
   74.14 + * http://www.netbeans.org/cddl-gplv2.html
   74.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   74.16 + * specific language governing permissions and limitations under the
   74.17 + * License.  When distributing the software, include this License Header
   74.18 + * Notice in each file and include the License file at
   74.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   74.20 + * particular file as subject to the "Classpath" exception as provided
   74.21 + * by Sun in the GPL Version 2 section of the License file that
   74.22 + * accompanied this code. If applicable, add the following below the
   74.23 + * License Header, with the fields enclosed by brackets [] replaced by
   74.24 + * your own identifying information:
   74.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   74.26 + *
   74.27 + * If you wish your version of this file to be governed by only the CDDL
   74.28 + * or only the GPL Version 2, indicate your decision by adding
   74.29 + * "[Contributor] elects to include this software in this distribution
   74.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   74.31 + * single choice of license, a recipient has the option to distribute
   74.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   74.33 + * to extend the choice of license to its licensees as provided above.
   74.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   74.35 + * Version 2 license, then the option applies only if the new code is
   74.36 + * made subject to such option by the copyright holder.
   74.37 + *
   74.38 + * Contributor(s):
   74.39 + *
   74.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   74.41 + */
   74.42 +
   74.43 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api;
   74.44 +
   74.45 +import java.io.File;
   74.46 +import java.util.Collections;
   74.47 +import java.util.List;
   74.48 +import org.netbeans.modules.portalpack.servers.core.WizardPropertyReader;
   74.49 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
   74.50 +
   74.51 +/**
   74.52 + *
   74.53 + * @author satyaranjan
   74.54 + */
   74.55 +public class DefaultJEEServerLibraries implements JEEServerLibraries{
   74.56 +
   74.57 +	public DefaultJEEServerLibraries() {
   74.58 +	}
   74.59 +
   74.60 +	public List<File> getJEEServerLibraries(PSConfigObject psconfig) {
   74.61 +		return Collections.EMPTY_LIST;
   74.62 +	}
   74.63 +
   74.64 +	public String getPortalServerLibraryLocation(WizardPropertyReader wr) {
   74.65 +		return null;
   74.66 +	}
   74.67 +
   74.68 +	public String getPortalServerLibraryLocation(PSConfigObject pc) {
   74.69 +		return null;
   74.70 +	}
   74.71 +
   74.72 +	public String getWebAppInstallDirectory(WizardPropertyReader wr) {
   74.73 +		return null;
   74.74 +	}
   74.75 +
   74.76 +	public String getWebAppInstallDirectory(PSConfigObject pc) {
   74.77 +		return null;
   74.78 +	}
   74.79 +
   74.80 +	public String getJEELibraryLocation(WizardPropertyReader wr) {
   74.81 +		return null;
   74.82 +	}
   74.83 +
   74.84 +	public String getJEELibraryLocation(PSConfigObject pc) {
   74.85 +		return null;
   74.86 +	}
   74.87 +
   74.88 +	public String getAppServerLibraryLocation(WizardPropertyReader wr) {
   74.89 +		return null;
   74.90 +	}
   74.91 +
   74.92 +	public String getAppServerLibraryLocation(PSConfigObject pc) {
   74.93 +		return null;
   74.94 +	}
   74.95 +
   74.96 +    public boolean isToolSupported(String toolName, PSConfigObject psconfig) {
   74.97 +        return false;
   74.98 +    }
   74.99 +
  74.100 +    public File[] getToolClasspathEntries(String toolName, PSConfigObject psconfig) {
  74.101 +        return new File[0];
  74.102 +    }
  74.103 +}
    75.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/DefaultServerDeployHandler.java	Fri Jun 10 09:46:37 2011 +0200
    75.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/DefaultServerDeployHandler.java	Sun Jun 26 10:25:14 2011 +0800
    75.3 @@ -39,6 +39,10 @@
    75.4  
    75.5  package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api;
    75.6  
    75.7 +import java.io.File;
    75.8 +import javax.enterprise.deploy.spi.Target;
    75.9 +import javax.enterprise.deploy.spi.TargetModuleID;
   75.10 +
   75.11  /**
   75.12   *
   75.13   * @author satyaranjan
   75.14 @@ -61,4 +65,23 @@
   75.15          throw new UnsupportedOperationException("Not supported yet.");
   75.16      }
   75.17  
   75.18 +    public void restart(String contextRoot) throws Exception {
   75.19 +        
   75.20 +    }
   75.21 +
   75.22 +    public boolean isDeployOnSaveSupported() {
   75.23 +        return false;
   75.24 +    }
   75.25 +
   75.26 +    public TargetModuleID[] getAvailableModules(Target[] targets) {
   75.27 +        return new TargetModuleID[0];
   75.28 +    }
   75.29 +
   75.30 +    public boolean isServerRunning() {
   75.31 +        return true;
   75.32 +    }
   75.33 +
   75.34 +    public File getModuleDirectory(TargetModuleID module) {
   75.35 +        return null;
   75.36 +    }
   75.37  }
    76.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/JEEServerLibraries.java	Sun Jun 26 10:25:14 2011 +0800
    76.3 @@ -0,0 +1,71 @@
    76.4 +/*
    76.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    76.6 + * 
    76.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    76.8 + * 
    76.9 + * The contents of this file are subject to the terms of either the GNU
   76.10 + * General Public License Version 2 only ("GPL") or the Common
   76.11 + * Development and Distribution License("CDDL") (collectively, the
   76.12 + * "License"). You may not use this file except in compliance with the
   76.13 + * License. You can obtain a copy of the License at
   76.14 + * http://www.netbeans.org/cddl-gplv2.html
   76.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   76.16 + * specific language governing permissions and limitations under the
   76.17 + * License.  When distributing the software, include this License Header
   76.18 + * Notice in each file and include the License file at
   76.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   76.20 + * particular file as subject to the "Classpath" exception as provided
   76.21 + * by Sun in the GPL Version 2 section of the License file that
   76.22 + * accompanied this code. If applicable, add the following below the
   76.23 + * License Header, with the fields enclosed by brackets [] replaced by
   76.24 + * your own identifying information:
   76.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   76.26 + * 
   76.27 + * If you wish your version of this file to be governed by only the CDDL
   76.28 + * or only the GPL Version 2, indicate your decision by adding
   76.29 + * "[Contributor] elects to include this software in this distribution
   76.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   76.31 + * single choice of license, a recipient has the option to distribute
   76.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   76.33 + * to extend the choice of license to its licensees as provided above.
   76.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   76.35 + * Version 2 license, then the option applies only if the new code is
   76.36 + * made subject to such option by the copyright holder.
   76.37 + * 
   76.38 + * Contributor(s):
   76.39 + * 
   76.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   76.41 + */
   76.42 +
   76.43 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api;
   76.44 +
   76.45 +import java.io.File;
   76.46 +import java.util.List;
   76.47 +import org.netbeans.modules.portalpack.servers.core.WizardPropertyReader;
   76.48 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
   76.49 +
   76.50 +/**
   76.51 + * This interface can be implemented for different kind of application server.
   76.52 + * It contains methods specific to container.
   76.53 + * @author satyaranjan
   76.54 + */
   76.55 +public interface JEEServerLibraries {
   76.56 +    
   76.57 +    public List<File> getJEEServerLibraries(PSConfigObject psconfig);
   76.58 +    
   76.59 +    public String getPortalServerLibraryLocation(WizardPropertyReader wr);
   76.60 +    public String getPortalServerLibraryLocation(PSConfigObject pc);
   76.61 +    
   76.62 +    public String getWebAppInstallDirectory(WizardPropertyReader wr);
   76.63 +    public String getWebAppInstallDirectory(PSConfigObject pc);
   76.64 +    
   76.65 +    public String getJEELibraryLocation(WizardPropertyReader wr);
   76.66 +    public String getJEELibraryLocation(PSConfigObject pc);
   76.67 +    
   76.68 +    public String getAppServerLibraryLocation(WizardPropertyReader wr);
   76.69 +    public String getAppServerLibraryLocation(PSConfigObject pc);
   76.70 +
   76.71 +    public boolean isToolSupported(String toolName,PSConfigObject psconfig);
   76.72 +    public File[] getToolClasspathEntries(String toolName,PSConfigObject psconfig);
   76.73 +    
   76.74 +}
    77.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/JEEServerLibrariesFactory.java	Sun Jun 26 10:25:14 2011 +0800
    77.3 @@ -0,0 +1,72 @@
    77.4 +/*
    77.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    77.6 + * 
    77.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    77.8 + * 
    77.9 + * The contents of this file are subject to the terms of either the GNU
   77.10 + * General Public License Version 2 only ("GPL") or the Common
   77.11 + * Development and Distribution License("CDDL") (collectively, the
   77.12 + * "License"). You may not use this file except in compliance with the
   77.13 + * License. You can obtain a copy of the License at
   77.14 + * http://www.netbeans.org/cddl-gplv2.html
   77.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   77.16 + * specific language governing permissions and limitations under the
   77.17 + * License.  When distributing the software, include this License Header
   77.18 + * Notice in each file and include the License file at
   77.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   77.20 + * particular file as subject to the "Classpath" exception as provided
   77.21 + * by Sun in the GPL Version 2 section of the License file that
   77.22 + * accompanied this code. If applicable, add the following below the
   77.23 + * License Header, with the fields enclosed by brackets [] replaced by
   77.24 + * your own identifying information:
   77.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   77.26 + * 
   77.27 + * If you wish your version of this file to be governed by only the CDDL
   77.28 + * or only the GPL Version 2, indicate your decision by adding
   77.29 + * "[Contributor] elects to include this software in this distribution
   77.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   77.31 + * single choice of license, a recipient has the option to distribute
   77.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   77.33 + * to extend the choice of license to its licensees as provided above.
   77.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   77.35 + * Version 2 license, then the option applies only if the new code is
   77.36 + * made subject to such option by the copyright holder.
   77.37 + * 
   77.38 + * Contributor(s):
   77.39 + * 
   77.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   77.41 + */
   77.42 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api;
   77.43 +
   77.44 +import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
   77.45 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss.JBossJEELabraries;
   77.46 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver.SunAppServerJEELibraries;
   77.47 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.tomcat.TomcatJEELibraries;
   77.48 +
   77.49 +/**
   77.50 + *
   77.51 + * @author satyaranjan
   77.52 + */
   77.53 +public class JEEServerLibrariesFactory {
   77.54 +
   77.55 +    public static JEEServerLibraries getJEEServerLibraries(String serverType) {
   77.56 +        return _getJEEServerLibraries(serverType);
   77.57 +    }
   77.58 +
   77.59 +    private static JEEServerLibraries _getJEEServerLibraries(String serverType) {
   77.60 +		if(serverType == null)
   77.61 +			return new DefaultJEEServerLibraries();
   77.62 +
   77.63 +        if (serverType.equals(ServerConstants.SUN_APP_SERVER_9)) {
   77.64 +
   77.65 +            return new SunAppServerJEELibraries();
   77.66 +        } else if (serverType.equals(ServerConstants.TOMCAT_5_X) || serverType.equals(ServerConstants.TOMCAT_6_X)) {
   77.67 +
   77.68 +            return new TomcatJEELibraries();
   77.69 +		} else if(serverType.equals(ServerConstants.JBOSS_5_X)) {
   77.70 +			return new JBossJEELabraries();
   77.71 +        } else {
   77.72 +            return null;
   77.73 +        }
   77.74 +    }
   77.75 +}
    78.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/ServerDeployHandler.java	Fri Jun 10 09:46:37 2011 +0200
    78.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/ServerDeployHandler.java	Sun Jun 26 10:25:14 2011 +0800
    78.3 @@ -19,6 +19,10 @@
    78.4  
    78.5  package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api;
    78.6  
    78.7 +import java.io.File;
    78.8 +import javax.enterprise.deploy.spi.Target;
    78.9 +import javax.enterprise.deploy.spi.TargetModuleID;
   78.10 +
   78.11  /**
   78.12   *
   78.13   * @author Satya
   78.14 @@ -29,5 +33,9 @@
   78.15      public boolean undeploy(String appName) throws Exception;
   78.16      public boolean install() throws Exception;
   78.17      public boolean deploy(String dir,String contextName) throws Exception;
   78.18 -    
   78.19 +    public void restart(String contextRoot) throws Exception;
   78.20 +    public boolean isDeployOnSaveSupported();
   78.21 +    public TargetModuleID[] getAvailableModules(Target[] targets);
   78.22 +    public boolean isServerRunning();
   78.23 +    public File  getModuleDirectory(TargetModuleID module);
   78.24  }
    79.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/ServerDeployerHandlerFactory.java	Fri Jun 10 09:46:37 2011 +0200
    79.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/api/ServerDeployerHandlerFactory.java	Sun Jun 26 10:25:14 2011 +0800
    79.3 @@ -21,6 +21,7 @@
    79.4  
    79.5  import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
    79.6  import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
    79.7 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss.JBDeployHandler;
    79.8  import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver.GlassFishServerDeployHandler;
    79.9  import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.tomcat.TomcatDeployHandler;
   79.10  import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
   79.11 @@ -31,21 +32,27 @@
   79.12   * @author root
   79.13   */
   79.14  public class ServerDeployerHandlerFactory {
   79.15 -    
   79.16 +
   79.17      /** Creates a new instance of ServerDeployerHandlerFactory */
   79.18      private ServerDeployerHandlerFactory() {
   79.19      }
   79.20 -    
   79.21 +
   79.22      public static ServerDeployHandler getServerDeployerHandler(PSDeploymentManager dm)
   79.23      {
   79.24           PSConfigObject psconfig = dm.getPSConfig();
   79.25 +         if(psconfig.getServerType() == null || psconfig.getServerType().trim().length() == 0)
   79.26 +             return new DefaultServerDeployHandler();
   79.27 +
   79.28           if(psconfig.getServerType().equals(ServerConstants.SUN_APP_SERVER_9))
   79.29           {
   79.30               return new GlassFishServerDeployHandler(dm);
   79.31           }
   79.32 +         else if(psconfig.getServerType().equals(ServerConstants.JBOSS_5_X)) {
   79.33 +             return new JBDeployHandler(dm);
   79.34 +        }
   79.35           else{
   79.36               return new TomcatDeployHandler(dm);
   79.37           }
   79.38      }
   79.39 -    
   79.40 +
   79.41  }
    80.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
    80.3 @@ -0,0 +1,63 @@
    80.4 +#
    80.5 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    80.6 +#
    80.7 +# Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
    80.8 +#
    80.9 +# The contents of this file are subject to the terms of either the GNU
   80.10 +# General Public License Version 2 only ("GPL") or the Common
   80.11 +# Development and Distribution License("CDDL") (collectively, the
   80.12 +# "License"). You may not use this file except in compliance with the
   80.13 +# License. You can obtain a copy of the License at
   80.14 +# http://www.netbeans.org/cddl-gplv2.html
   80.15 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   80.16 +# specific language governing permissions and limitations under the
   80.17 +# License.  When distributing the software, include this License Header
   80.18 +# Notice in each file and include the License file at
   80.19 +# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   80.20 +# particular file as subject to the "Classpath" exception as provided
   80.21 +# by Sun in the GPL Version 2 section of the License file that
   80.22 +# accompanied this code. If applicable, add the following below the
   80.23 +# License Header, with the fields enclosed by brackets [] replaced by
   80.24 +# your own identifying information:
   80.25 +# "Portions Copyrighted [year] [name of copyright owner]"
   80.26 +#
   80.27 +# Contributor(s):
   80.28 +#
   80.29 +# The Original Software is NetBeans. The Initial Developer of the Original
   80.30 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
   80.31 +# Microsystems, Inc. All Rights Reserved.
   80.32 +#
   80.33 +# If you wish your version of this file to be governed by only the CDDL
   80.34 +# or only the GPL Version 2, indicate your decision by adding
   80.35 +# "[Contributor] elects to include this software in this distribution
   80.36 +# under the [CDDL or GPL Version 2] license." If you do not indicate a
   80.37 +# single choice of license, a recipient has the option to distribute
   80.38 +# your version of this file under either the CDDL, the GPL Version 2 or
   80.39 +# to extend the choice of license to its licensees as provided above.
   80.40 +# However, if you add GPL Version 2 code and therefore, elected the GPL
   80.41 +# Version 2 license, then the option applies only if the new code is
   80.42 +# made subject to such option by the copyright holder.
   80.43 +#
   80.44 +
   80.45 +JBConfigPanel.jbossRootLabel.text=JBoss Root:
   80.46 +JBConfigPanel.jbossRootTextField.text=
   80.47 +JBConfigPanel.jbossInstanceLabel.text=JBoss Instance:
   80.48 +JBConfigPanel.javaHomeLabel.text=Java Home:
   80.49 +JBConfigPanel.httpPortLabel.text=HTTP Port:
   80.50 +JBConfigPanel.httpPortTextField.text=
   80.51 +JBConfigPanel.secureCheckbox.text=Secure
   80.52 +JBConfigPanel.debugPortLabel.text=Debug Port:
   80.53 +JBConfigPanel.debugPortTextField.text=
   80.54 +LBL_JBOSS=JBoss
   80.55 +MSG_INVALID_JBOSS_ROOT=The JBoss root directory is not set to a valid JBoss installation.
   80.56 +MSG_INVALID_JBOSS_INSTANCE=The JBoss server instance is not set to a valid JBoss server instance.
   80.57 +MSG_INVALID_JAVA_HOME=The Java Home directory must be set to the path of a Java installation.
   80.58 +MSG_INVALID_HTTP_PORT=The HTTP port must be set to a valid HTTP port.
   80.59 +MSG_INVALID_DEBUG_PORT=The Debug port must be set to a valid debug port.
   80.60 +JBConfigPanel.jbossRootBrowseButton.text=Browse...
   80.61 +LBL_BrowseButton=OK
   80.62 +LBL_ChooserName=Choose JBoss Application Server Root Directory
   80.63 +JBConfigPanel.userNameTextField.text=
   80.64 +JBConfigPanel.userNameLabel.text=User Name:
   80.65 +JBConfigPanel.passwordTextField.text=
   80.66 +JBConfigPanel.passwordLabel.text=Password:
    81.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBConfigPanel.form	Sun Jun 26 10:25:14 2011 +0800
    81.3 @@ -0,0 +1,234 @@
    81.4 +<?xml version="1.0" encoding="UTF-8" ?>
    81.5 +
    81.6 +<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
    81.7 +  <AuxValues>
    81.8 +    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
    81.9 +    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
   81.10 +    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
   81.11 +    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
   81.12 +    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
   81.13 +    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
   81.14 +    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
   81.15 +    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
   81.16 +    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
   81.17 +  </AuxValues>
   81.18 +
   81.19 +  <Layout>
   81.20 +    <DimensionLayout dim="0">
   81.21 +      <Group type="103" groupAlignment="0" attributes="0">
   81.22 +          <Group type="102" attributes="0">
   81.23 +              <EmptySpace min="-2" max="-2" attributes="0"/>
   81.24 +              <Group type="103" groupAlignment="0" attributes="0">
   81.25 +                  <Component id="jbossInstanceLabel" alignment="0" min="-2" max="-2" attributes="0"/>
   81.26 +                  <Component id="jbossRootLabel" alignment="0" min="-2" max="-2" attributes="0"/>
   81.27 +                  <Component id="javaHomeLabel" alignment="0" min="-2" max="-2" attributes="0"/>
   81.28 +                  <Component id="httpPortLabel" alignment="0" min="-2" max="-2" attributes="0"/>
   81.29 +                  <Component id="debugPortLabel" alignment="0" min="-2" max="-2" attributes="0"/>
   81.30 +                  <Component id="userNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
   81.31 +                  <Component id="passwordLabel" alignment="0" min="-2" max="-2" attributes="0"/>
   81.32 +              </Group>
   81.33 +              <EmptySpace min="-2" max="-2" attributes="0"/>
   81.34 +              <Group type="103" groupAlignment="0" attributes="0">
   81.35 +                  <Group type="102" alignment="1" attributes="0">
   81.36 +                      <Component id="jbossRootTextField" pref="220" max="32767" attributes="1"/>
   81.37 +                      <EmptySpace max="-2" attributes="0"/>
   81.38 +                      <Component id="jbossRootBrowseButton" min="-2" max="-2" attributes="0"/>
   81.39 +                  </Group>
   81.40 +                  <Component id="jbossInstanceComboBox" alignment="1" pref="305" max="32767" attributes="1"/>
   81.41 +                  <Group type="102" alignment="0" attributes="0">
   81.42 +                      <Group type="103" groupAlignment="1" max="-2" attributes="0">
   81.43 +                          <Component id="debugPortTextField" alignment="0" max="32767" attributes="1"/>
   81.44 +                          <Component id="httpPortTextField" alignment="0" pref="76" max="32767" attributes="1"/>
   81.45 +                      </Group>
   81.46 +                      <EmptySpace type="unrelated" max="-2" attributes="0"/>
   81.47 +                      <Component id="secureCheckbox" min="-2" max="-2" attributes="0"/>
   81.48 +                  </Group>
   81.49 +                  <Component id="javaHomeComboBox" alignment="0" pref="305" max="32767" attributes="0"/>
   81.50 +                  <Group type="102" alignment="0" attributes="0">
   81.51 +                      <Group type="103" groupAlignment="1" attributes="0">
   81.52 +                          <Component id="passwordTextField" alignment="0" pref="169" max="32767" attributes="1"/>
   81.53 +                          <Component id="userNameTextField" alignment="0" pref="169" max="32767" attributes="2"/>
   81.54 +                      </Group>
   81.55 +                      <EmptySpace min="136" pref="136" max="136" attributes="0"/>
   81.56 +                  </Group>
   81.57 +              </Group>
   81.58 +              <EmptySpace min="-2" max="-2" attributes="0"/>
   81.59 +          </Group>
   81.60 +      </Group>
   81.61 +    </DimensionLayout>
   81.62 +    <DimensionLayout dim="1">
   81.63 +      <Group type="103" groupAlignment="0" attributes="0">
   81.64 +          <Group type="102" alignment="0" attributes="0">
   81.65 +              <EmptySpace max="-2" attributes="0"/>
   81.66 +              <Group type="103" groupAlignment="3" attributes="0">
   81.67 +                  <Component id="jbossRootLabel" alignment="3" min="-2" max="-2" attributes="0"/>
   81.68 +                  <Component id="jbossRootTextField" alignment="3" min="-2" max="-2" attributes="0"/>
   81.69 +                  <Component id="jbossRootBrowseButton" alignment="3" min="-2" max="-2" attributes="0"/>
   81.70 +              </Group>
   81.71 +              <EmptySpace max="-2" attributes="0"/>
   81.72 +              <Group type="103" groupAlignment="3" attributes="0">
   81.73 +                  <Component id="jbossInstanceLabel" alignment="3" min="-2" max="-2" attributes="0"/>
   81.74 +                  <Component id="jbossInstanceComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
   81.75 +              </Group>
   81.76 +              <EmptySpace max="-2" attributes="0"/>
   81.77 +              <Group type="103" groupAlignment="3" attributes="0">
   81.78 +                  <Component id="javaHomeLabel" alignment="3" min="-2" max="-2" attributes="0"/>
   81.79 +                  <Component id="javaHomeComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
   81.80 +              </Group>
   81.81 +              <EmptySpace max="-2" attributes="0"/>
   81.82 +              <Group type="103" groupAlignment="3" attributes="0">
   81.83 +                  <Component id="httpPortLabel" alignment="3" min="-2" max="-2" attributes="0"/>
   81.84 +                  <Component id="httpPortTextField" alignment="3" min="-2" max="-2" attributes="0"/>
   81.85 +                  <Component id="secureCheckbox" alignment="3" min="-2" max="-2" attributes="0"/>
   81.86 +              </Group>
   81.87 +              <EmptySpace max="-2" attributes="0"/>
   81.88 +              <Group type="103" groupAlignment="3" attributes="0">
   81.89 +                  <Component id="debugPortLabel" alignment="3" min="-2" max="-2" attributes="0"/>
   81.90 +                  <Component id="debugPortTextField" alignment="3" min="-2" max="-2" attributes="0"/>
   81.91 +              </Group>
   81.92 +              <EmptySpace max="-2" attributes="0"/>
   81.93 +              <Group type="103" groupAlignment="3" attributes="0">
   81.94 +                  <Component id="userNameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
   81.95 +                  <Component id="userNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
   81.96 +              </Group>
   81.97 +              <EmptySpace max="-2" attributes="0"/>
   81.98 +              <Group type="103" groupAlignment="3" attributes="0">
   81.99 +                  <Component id="passwordTextField" alignment="3" min="-2" max="-2" attributes="0"/>
  81.100 +                  <Component id="passwordLabel" alignment="3" min="-2" max="-2" attributes="0"/>
  81.101 +              </Group>
  81.102 +              <EmptySpace max="32767" attributes="0"/>
  81.103 +          </Group>
  81.104 +      </Group>
  81.105 +    </DimensionLayout>
  81.106 +  </Layout>
  81.107 +  <SubComponents>
  81.108 +    <Component class="javax.swing.JLabel" name="jbossRootLabel">
  81.109 +      <Properties>
  81.110 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.111 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.jbossRootLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.112 +        </Property>
  81.113 +      </Properties>
  81.114 +    </Component>
  81.115 +    <Component class="javax.swing.JTextField" name="jbossRootTextField">
  81.116 +      <Properties>
  81.117 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.118 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.jbossRootTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.119 +        </Property>
  81.120 +      </Properties>
  81.121 +      <Events>
  81.122 +        <EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="jbossRootFocusLost"/>
  81.123 +      </Events>
  81.124 +    </Component>
  81.125 +    <Component class="javax.swing.JButton" name="jbossRootBrowseButton">
  81.126 +      <Properties>
  81.127 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.128 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.jbossRootBrowseButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.129 +        </Property>
  81.130 +      </Properties>
  81.131 +      <Events>
  81.132 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onJbossRootBrowse"/>
  81.133 +      </Events>
  81.134 +    </Component>
  81.135 +    <Component class="javax.swing.JLabel" name="jbossInstanceLabel">
  81.136 +      <Properties>
  81.137 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.138 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.jbossInstanceLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.139 +        </Property>
  81.140 +      </Properties>
  81.141 +    </Component>
  81.142 +    <Component class="javax.swing.JComboBox" name="jbossInstanceComboBox">
  81.143 +      <Properties>
  81.144 +        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
  81.145 +          <StringArray count="0"/>
  81.146 +        </Property>
  81.147 +      </Properties>
  81.148 +      <Events>
  81.149 +        <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="onJbossInstanceItemStateChanged"/>
  81.150 +        <EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="onJbossInstanceFocusLost"/>
  81.151 +      </Events>
  81.152 +    </Component>
  81.153 +    <Component class="javax.swing.JLabel" name="javaHomeLabel">
  81.154 +      <Properties>
  81.155 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.156 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.javaHomeLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.157 +        </Property>
  81.158 +      </Properties>
  81.159 +    </Component>
  81.160 +    <Component class="javax.swing.JComboBox" name="javaHomeComboBox">
  81.161 +      <Properties>
  81.162 +        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
  81.163 +          <StringArray count="0"/>
  81.164 +        </Property>
  81.165 +      </Properties>
  81.166 +    </Component>
  81.167 +    <Component class="javax.swing.JLabel" name="httpPortLabel">
  81.168 +      <Properties>
  81.169 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.170 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.httpPortLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.171 +        </Property>
  81.172 +      </Properties>
  81.173 +    </Component>
  81.174 +    <Component class="javax.swing.JTextField" name="httpPortTextField">
  81.175 +      <Properties>
  81.176 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.177 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.httpPortTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.178 +        </Property>
  81.179 +      </Properties>
  81.180 +      <Events>
  81.181 +        <EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="onHttpPortFocusLost"/>
  81.182 +      </Events>
  81.183 +    </Component>
  81.184 +    <Component class="javax.swing.JCheckBox" name="secureCheckbox">
  81.185 +      <Properties>
  81.186 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.187 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.secureCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.188 +        </Property>
  81.189 +      </Properties>
  81.190 +    </Component>
  81.191 +    <Component class="javax.swing.JLabel" name="debugPortLabel">
  81.192 +      <Properties>
  81.193 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.194 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.debugPortLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.195 +        </Property>
  81.196 +      </Properties>
  81.197 +    </Component>
  81.198 +    <Component class="javax.swing.JTextField" name="debugPortTextField">
  81.199 +      <Properties>
  81.200 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.201 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.debugPortTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.202 +        </Property>
  81.203 +      </Properties>
  81.204 +      <Events>
  81.205 +        <EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="onDebugPortFocusLost"/>
  81.206 +      </Events>
  81.207 +    </Component>
  81.208 +    <Component class="javax.swing.JLabel" name="userNameLabel">
  81.209 +      <Properties>
  81.210 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.211 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.userNameLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.212 +        </Property>
  81.213 +      </Properties>
  81.214 +    </Component>
  81.215 +    <Component class="javax.swing.JTextField" name="userNameTextField">
  81.216 +      <Properties>
  81.217 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.218 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.userNameTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.219 +        </Property>
  81.220 +      </Properties>
  81.221 +    </Component>
  81.222 +    <Component class="javax.swing.JLabel" name="passwordLabel">
  81.223 +      <Properties>
  81.224 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.225 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.passwordLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.226 +        </Property>
  81.227 +      </Properties>
  81.228 +    </Component>
  81.229 +    <Component class="javax.swing.JPasswordField" name="passwordTextField">
  81.230 +      <Properties>
  81.231 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  81.232 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/Bundle.properties" key="JBConfigPanel.passwordTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  81.233 +        </Property>
  81.234 +      </Properties>
  81.235 +    </Component>
  81.236 +  </SubComponents>
  81.237 +</Form>
    82.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBConfigPanel.java	Sun Jun 26 10:25:14 2011 +0800
    82.3 @@ -0,0 +1,721 @@
    82.4 +/*
    82.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    82.6 + *
    82.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    82.8 + *
    82.9 + * The contents of this file are subject to the terms of either the GNU
   82.10 + * General Public License Version 2 only ("GPL") or the Common
   82.11 + * Development and Distribution License("CDDL") (collectively, the
   82.12 + * "License"). You may not use this file except in compliance with the
   82.13 + * License. You can obtain a copy of the License at
   82.14 + * http://www.netbeans.org/cddl-gplv2.html
   82.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   82.16 + * specific language governing permissions and limitations under the
   82.17 + * License.  When distributing the software, include this License Header
   82.18 + * Notice in each file and include the License file at
   82.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   82.20 + * particular file as subject to the "Classpath" exception as provided
   82.21 + * by Sun in the GPL Version 2 section of the License file that
   82.22 + * accompanied this code. If applicable, add the following below the
   82.23 + * License Header, with the fields enclosed by brackets [] replaced by
   82.24 + * your own identifying information:
   82.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   82.26 + *
   82.27 + * If you wish your version of this file to be governed by only the CDDL
   82.28 + * or only the GPL Version 2, indicate your decision by adding
   82.29 + * "[Contributor] elects to include this software in this distribution
   82.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   82.31 + * single choice of license, a recipient has the option to distribute
   82.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   82.33 + * to extend the choice of license to its licensees as provided above.
   82.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   82.35 + * Version 2 license, then the option applies only if the new code is
   82.36 + * made subject to such option by the copyright holder.
   82.37 + *
   82.38 + * Contributor(s):
   82.39 + * John Platts
   82.40 + *
   82.41 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   82.42 + * Portions Copyrighted 2009 John Platts
   82.43 + */
   82.44 +
   82.45 +/*
   82.46 + * JBConfigPanel.java
   82.47 + *
   82.48 + * Created on Apr 12, 2009, 8:42:18 PM
   82.49 + */
   82.50 +
   82.51 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss;
   82.52 +
   82.53 +import java.io.File;
   82.54 +import java.io.FileFilter;
   82.55 +import java.io.IOException;
   82.56 +import javax.swing.JFileChooser;
   82.57 +import javax.swing.SwingUtilities;
   82.58 +import javax.swing.event.DocumentEvent;
   82.59 +import javax.swing.event.DocumentListener;
   82.60 +import org.netbeans.api.java.platform.JavaPlatform;
   82.61 +import org.netbeans.api.java.platform.JavaPlatformManager;
   82.62 +import org.netbeans.api.java.platform.Specification;
   82.63 +import org.netbeans.modules.portalpack.servers.core.WizardPropertyReader;
   82.64 +import org.netbeans.modules.portalpack.servers.core.api.ConfigPanel;
   82.65 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss.JBConfigUtil.GetHttpPortResult;
   82.66 +import org.netbeans.modules.portalpack.servers.core.util.DirectoryChooser;
   82.67 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
   82.68 +import org.openide.WizardDescriptor;
   82.69 +import org.openide.filesystems.FileObject;
   82.70 +import org.openide.filesystems.FileUtil;
   82.71 +import org.openide.util.NbBundle;
   82.72 +
   82.73 +/**
   82.74 + * Config Panel for JBoss Application Server
   82.75 + * @author John Platts
   82.76 + */
   82.77 +public class JBConfigPanel extends ConfigPanel implements DocumentListener {
   82.78 +    private static String DEFAULT_DEBUG_PORT = "8787";
   82.79 +
   82.80 +    /** Creates new form JBConfigPanel */
   82.81 +    public JBConfigPanel() {
   82.82 +        initComponents();
   82.83 +        initData();
   82.84 +
   82.85 +        httpPortTextField.getDocument().addDocumentListener(this);
   82.86 +        debugPortTextField.getDocument().addDocumentListener(this);
   82.87 +    }
   82.88 +
   82.89 +    private void initData() {
   82.90 +        setJavaPlatform();
   82.91 +        debugPortTextField.setText(DEFAULT_DEBUG_PORT);
   82.92 +    }
   82.93 +
   82.94 +    /** This method is called from within the constructor to
   82.95 +     * initialize the form.
   82.96 +     * WARNING: Do NOT modify this code. The content of this method is
   82.97 +     * always regenerated by the Form Editor.
   82.98 +     */
   82.99 +    @SuppressWarnings("unchecked")
  82.100 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  82.101 +    private void initComponents() {
  82.102 +
  82.103 +        jbossRootLabel = new javax.swing.JLabel();
  82.104 +        jbossRootTextField = new javax.swing.JTextField();
  82.105 +        jbossRootBrowseButton = new javax.swing.JButton();
  82.106 +        jbossInstanceLabel = new javax.swing.JLabel();
  82.107 +        jbossInstanceComboBox = new javax.swing.JComboBox();
  82.108 +        javaHomeLabel = new javax.swing.JLabel();
  82.109 +        javaHomeComboBox = new javax.swing.JComboBox();
  82.110 +        httpPortLabel = new javax.swing.JLabel();
  82.111 +        httpPortTextField = new javax.swing.JTextField();
  82.112 +        secureCheckbox = new javax.swing.JCheckBox();
  82.113 +        debugPortLabel = new javax.swing.JLabel();
  82.114 +        debugPortTextField = new javax.swing.JTextField();
  82.115 +        userNameLabel = new javax.swing.JLabel();
  82.116 +        userNameTextField = new javax.swing.JTextField();
  82.117 +        passwordLabel = new javax.swing.JLabel();
  82.118 +        passwordTextField = new javax.swing.JPasswordField();
  82.119 +
  82.120 +        jbossRootLabel.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.jbossRootLabel.text")); // NOI18N
  82.121 +
  82.122 +        jbossRootTextField.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.jbossRootTextField.text")); // NOI18N
  82.123 +        jbossRootTextField.addFocusListener(new java.awt.event.FocusAdapter() {
  82.124 +            public void focusLost(java.awt.event.FocusEvent evt) {
  82.125 +                jbossRootFocusLost(evt);
  82.126 +            }
  82.127 +        });
  82.128 +
  82.129 +        jbossRootBrowseButton.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.jbossRootBrowseButton.text")); // NOI18N
  82.130 +        jbossRootBrowseButton.addActionListener(new java.awt.event.ActionListener() {
  82.131 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  82.132 +                onJbossRootBrowse(evt);
  82.133 +            }
  82.134 +        });
  82.135 +
  82.136 +        jbossInstanceLabel.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.jbossInstanceLabel.text")); // NOI18N
  82.137 +
  82.138 +        jbossInstanceComboBox.addItemListener(new java.awt.event.ItemListener() {
  82.139 +            public void itemStateChanged(java.awt.event.ItemEvent evt) {
  82.140 +                onJbossInstanceItemStateChanged(evt);
  82.141 +            }
  82.142 +        });
  82.143 +        jbossInstanceComboBox.addFocusListener(new java.awt.event.FocusAdapter() {
  82.144 +            public void focusLost(java.awt.event.FocusEvent evt) {
  82.145 +                onJbossInstanceFocusLost(evt);
  82.146 +            }
  82.147 +        });
  82.148 +
  82.149 +        javaHomeLabel.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.javaHomeLabel.text")); // NOI18N
  82.150 +
  82.151 +        httpPortLabel.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.httpPortLabel.text")); // NOI18N
  82.152 +
  82.153 +        httpPortTextField.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.httpPortTextField.text")); // NOI18N
  82.154 +        httpPortTextField.addFocusListener(new java.awt.event.FocusAdapter() {
  82.155 +            public void focusLost(java.awt.event.FocusEvent evt) {
  82.156 +                onHttpPortFocusLost(evt);
  82.157 +            }
  82.158 +        });
  82.159 +
  82.160 +        secureCheckbox.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.secureCheckbox.text")); // NOI18N
  82.161 +
  82.162 +        debugPortLabel.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.debugPortLabel.text")); // NOI18N
  82.163 +
  82.164 +        debugPortTextField.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.debugPortTextField.text")); // NOI18N
  82.165 +        debugPortTextField.addFocusListener(new java.awt.event.FocusAdapter() {
  82.166 +            public void focusLost(java.awt.event.FocusEvent evt) {
  82.167 +                onDebugPortFocusLost(evt);
  82.168 +            }
  82.169 +        });
  82.170 +
  82.171 +        userNameLabel.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.userNameLabel.text")); // NOI18N
  82.172 +
  82.173 +        userNameTextField.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.userNameTextField.text")); // NOI18N
  82.174 +
  82.175 +        passwordLabel.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.passwordLabel.text")); // NOI18N
  82.176 +
  82.177 +        passwordTextField.setText(org.openide.util.NbBundle.getMessage(JBConfigPanel.class, "JBConfigPanel.passwordTextField.text")); // NOI18N
  82.178 +
  82.179 +        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
  82.180 +        this.setLayout(layout);
  82.181 +        layout.setHorizontalGroup(
  82.182 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  82.183 +            .add(layout.createSequentialGroup()
  82.184 +                .addContainerGap()
  82.185 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  82.186 +                    .add(jbossInstanceLabel)
  82.187 +                    .add(jbossRootLabel)
  82.188 +                    .add(javaHomeLabel)
  82.189 +                    .add(httpPortLabel)
  82.190 +                    .add(debugPortLabel)
  82.191 +                    .add(userNameLabel)
  82.192 +                    .add(passwordLabel))
  82.193 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  82.194 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  82.195 +                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
  82.196 +                        .add(jbossRootTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
  82.197 +                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  82.198 +                        .add(jbossRootBrowseButton))
  82.199 +                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jbossInstanceComboBox, 0, 305, Short.MAX_VALUE)
  82.200 +                    .add(layout.createSequentialGroup()
  82.201 +                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
  82.202 +                            .add(org.jdesktop.layout.GroupLayout.LEADING, debugPortTextField)
  82.203 +                            .add(org.jdesktop.layout.GroupLayout.LEADING, httpPortTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE))
  82.204 +                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
  82.205 +                        .add(secureCheckbox))
  82.206 +                    .add(javaHomeComboBox, 0, 305, Short.MAX_VALUE)
  82.207 +                    .add(layout.createSequentialGroup()
  82.208 +                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
  82.209 +                            .add(org.jdesktop.layout.GroupLayout.LEADING, passwordTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)
  82.210 +                            .add(org.jdesktop.layout.GroupLayout.LEADING, userNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE))
  82.211 +                        .add(136, 136, 136)))
  82.212 +                .addContainerGap())
  82.213 +        );
  82.214 +        layout.setVerticalGroup(
  82.215 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  82.216 +            .add(layout.createSequentialGroup()
  82.217 +                .addContainerGap()
  82.218 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  82.219 +                    .add(jbossRootLabel)
  82.220 +                    .add(jbossRootTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  82.221 +                    .add(jbossRootBrowseButton))
  82.222 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  82.223 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  82.224 +                    .add(jbossInstanceLabel)
  82.225 +                    .add(jbossInstanceComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  82.226 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  82.227 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  82.228 +                    .add(javaHomeLabel)
  82.229 +                    .add(javaHomeComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  82.230 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  82.231 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  82.232 +                    .add(httpPortLabel)
  82.233 +                    .add(httpPortTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  82.234 +                    .add(secureCheckbox))
  82.235 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  82.236 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  82.237 +                    .add(debugPortLabel)
  82.238 +                    .add(debugPortTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  82.239 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  82.240 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  82.241 +                    .add(userNameLabel)
  82.242 +                    .add(userNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  82.243 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  82.244 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  82.245 +                    .add(passwordTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  82.246 +                    .add(passwordLabel))
  82.247 +                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  82.248 +        );
  82.249 +    }// </editor-fold>//GEN-END:initComponents
  82.250 +
  82.251 +    private void jbossRootFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jbossRootFocusLost
  82.252 +        populateAllDefaultValues();
  82.253 +    }//GEN-LAST:event_jbossRootFocusLost
  82.254 +
  82.255 +    private void onJbossInstanceFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_onJbossInstanceFocusLost
  82.256 +        populateAllDefaultValues();
  82.257 +    }//GEN-LAST:event_onJbossInstanceFocusLost
  82.258 +
  82.259 +    private void onHttpPortFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_onHttpPortFocusLost
  82.260 +        validate(null);
  82.261 +    }//GEN-LAST:event_onHttpPortFocusLost
  82.262 +
  82.263 +    private void onDebugPortFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_onDebugPortFocusLost
  82.264 +        validate(null);
  82.265 +    }//GEN-LAST:event_onDebugPortFocusLost
  82.266 +
  82.267 +    private void onJbossRootBrowse(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onJbossRootBrowse
  82.268 +        DirectoryChooser chooser = new DirectoryChooser();
  82.269 +        String dir = browseInstallLocation(System.getProperty("netbeans.user"));
  82.270 +        if(dir != null) {
  82.271 +            jbossRootTextField.setText(dir);
  82.272 +            populateAllDefaultValues();
  82.273 +        }
  82.274 +    }//GEN-LAST:event_onJbossRootBrowse
  82.275 +
  82.276 +    private void onJbossInstanceItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_onJbossInstanceItemStateChanged
  82.277 +        
  82.278 +    }//GEN-LAST:event_onJbossInstanceItemStateChanged
  82.279 +
  82.280 +    private String browseInstallLocation(String defaultDir){
  82.281 +        String insLocation = null;
  82.282 +        JFileChooser chooser = getJFileChooser(defaultDir);
  82.283 +        int returnValue = chooser.showDialog(SwingUtilities.getWindowAncestor(this),
  82.284 +                NbBundle.getMessage(JBConfigPanel.class, "LBL_BrowseButton")); //NOI18N
  82.285 +
  82.286 +        if(returnValue == JFileChooser.APPROVE_OPTION){
  82.287 +            insLocation = chooser.getSelectedFile().getAbsolutePath();
  82.288 +        }
  82.289 +        return insLocation;
  82.290 +    }
  82.291 +
  82.292 +    private JFileChooser getJFileChooser(String defaultDir){
  82.293 +        JFileChooser chooser = new JFileChooser();
  82.294 +        chooser.setDialogTitle(NbBundle.getMessage(JBConfigPanel.class, "LBL_ChooserName")); //NOI18N
  82.295 +        chooser.setDialogType(JFileChooser.CUSTOM_DIALOG);
  82.296 +
  82.297 +        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  82.298 +        chooser.setApproveButtonMnemonic("Choose_Button_Mnemonic".charAt(0)); //NOI18N
  82.299 +        chooser.setMultiSelectionEnabled(false);
  82.300 +        chooser.setApproveButtonToolTipText(NbBundle.getMessage(JBConfigPanel.class, "LBL_ChooserName")); //NOI18N
  82.301 +
  82.302 +        chooser.getAccessibleContext().setAccessibleName(NbBundle.getMessage(JBConfigPanel.class, "LBL_ChooserName")); //NOI18N
  82.303 +        chooser.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(JBConfigPanel.class, "LBL_ChooserName")); //NOI18N
  82.304 +
  82.305 +        // set the current directory
  82.306 +        File file = new File(defaultDir);
  82.307 +        if(file != null)
  82.308 +            chooser.setSelectedFile(file);
  82.309 +
  82.310 +        return chooser;
  82.311 +    }
  82.312 +
  82.313 +    @Override
  82.314 +    public void populateDataForCustomizer(PSConfigObject object) {
  82.315 +        String jbossRoot = object.getProperty(JBConstant.ROOT_DIR);
  82.316 +        jbossRootTextField.setText(jbossRoot);
  82.317 +
  82.318 +        oldJbossRoot = null;
  82.319 +        populateJbossInstanceComboBox();
  82.320 +
  82.321 +        String instanceName = object.getProperty(JBConstant.SERVER);
  82.322 +        if(instanceName != null) {
  82.323 +            for(int i = 0; i < jbossInstanceComboBox.getItemCount(); i++) {
  82.324 +                String item =
  82.325 +                        getStringFromObject(jbossInstanceComboBox.getItemAt(i));
  82.326 +
  82.327 +                if(item.equals(instanceName)) {
  82.328 +                    jbossInstanceComboBox.setSelectedIndex(i);
  82.329 +                    jbossInstanceComboBox.setEnabled(false);
  82.330 +                    break;
  82.331 +                }
  82.332 +            }
  82.333 +        }
  82.334 +
  82.335 +        String javaHome = object.getProperty(JBConstant.JAVA_HOME);
  82.336 +        JavaHome javaHomeObject = findJavaHomeObject(javaHome);
  82.337 +
  82.338 +        if(javaHomeObject != null) {
  82.339 +            javaHomeComboBox.setSelectedItem(javaHomeObject);
  82.340 +            javaHomeComboBox.setEnabled(false);
  82.341 +        } else {
  82.342 +            setJavaPlatform();
  82.343 +        }
  82.344 +
  82.345 +        httpPortTextField.setText(object.getPort());
  82.346 +
  82.347 +        String securePropertyValue = object.getProperty(JBConstant.SECURE);
  82.348 +
  82.349 +        secureCheckbox.setSelected(securePropertyValue != null &&
  82.350 +                "true".equalsIgnoreCase(securePropertyValue.trim()));
  82.351 +        debugPortTextField.setText(object.getProperty(JBConstant.DEBUG_PORT));
  82.352 +
  82.353 +        userNameTextField.setText(object.getProperty(JBConstant.SERVER_USER));
  82.354 +        passwordTextField.setText(object.getProperty(JBConstant.SERVER_PASSWORD));
  82.355 +    }
  82.356 +
  82.357 +    @Override
  82.358 +    public void read(WizardDescriptor wizardDescriptor) {
  82.359 +    }
  82.360 +
  82.361 +    @Override
  82.362 +    public void store(WizardDescriptor wizardDescriptor) {
  82.363 +        WizardPropertyReader wr = new WizardPropertyReader(wizardDescriptor);
  82.364 +
  82.365 +        File rootDir = new File(jbossRootTextField.getText());
  82.366 +
  82.367 +        try {
  82.368 +            rootDir = rootDir.getCanonicalFile();
  82.369 +        } catch(IOException e) {
  82.370 +            rootDir = rootDir.getAbsoluteFile();
  82.371 +        }
  82.372 +
  82.373 +        String rootDirStr = rootDir.toString();
  82.374 +        wr.setProperty(JBConstant.ROOT_DIR, rootDirStr);
  82.375 +        wr.setServerHome(rootDirStr);
  82.376 +
  82.377 +        String instanceName =
  82.378 +                getStringFromObject(jbossInstanceComboBox.getSelectedItem());
  82.379 +        wr.setProperty(JBConstant.SERVER, instanceName);
  82.380 +
  82.381 +        wr.setProperty(JBConstant.SERVER_DIR,
  82.382 +                new File(rootDir, "server" + File.separator + instanceName)
  82.383 +                .toString());
  82.384 +
  82.385 +        JavaHome javaHome = (JavaHome)javaHomeComboBox.getSelectedItem();
  82.386 +        wr.setProperty(JBConstant.JAVA_HOME, javaHome.getJavaHome());
  82.387 +
  82.388 +        String httpPort = httpPortTextField.getText();
  82.389 +        wr.setPort(httpPort);
  82.390 +        wr.setAdminPort(httpPort);
  82.391 +        wr.setProperty(JBConstant.SECURE,
  82.392 +                secureCheckbox.isSelected() ? "true" : "false");
  82.393 +
  82.394 +        wr.setProperty(JBConstant.DEBUG_PORT,
  82.395 +                debugPortTextField.getText());
  82.396 +
  82.397 +        String userName = userNameTextField.getText();
  82.398 +        wr.setProperty(JBConstant.SERVER_USER,
  82.399 +                userName);
  82.400 +        wr.setAdminUser(userName);
  82.401 +
  82.402 +        char[] pwdChars = passwordTextField.getPassword();
  82.403 +        String pwdString = (pwdChars != null) ? new String(pwdChars) : null;
  82.404 +        wr.setProperty(JBConstant.SERVER_PASSWORD,
  82.405 +                pwdString);
  82.406 +        wr.setAdminPassWord(pwdString);
  82.407 +    }
  82.408 +
  82.409 +    @Override
  82.410 +    public boolean validate(Object wizardDescriptor) {
  82.411 +        File jbossRoot = getJbossRoot();
  82.412 +
  82.413 +        String instanceName =
  82.414 +                getStringFromObject(jbossInstanceComboBox.getSelectedItem());
  82.415 +        if(instanceName == null || instanceName.length() < 1) {
  82.416 +            setInvalidJbossRootErrorMessage();
  82.417 +            return false;
  82.418 +        }
  82.419 +
  82.420 +        File serverDirectory =
  82.421 +                new File(jbossRoot, "server" + File.separator +
  82.422 +                instanceName);
  82.423 +        if(!JBConfigUtil.isValidJbossInstanceDirectory(serverDirectory)) {
  82.424 +            setInvalidJbossInstanceErrorMessage();
  82.425 +            return false;
  82.426 +        }
  82.427 +
  82.428 +        if(!JBConfigUtil.isValidPort(httpPortTextField.getText())) {
  82.429 +            setInvalidHttpPortErrorMessage();
  82.430 +            return false;
  82.431 +        }
  82.432 +        if(!JBConfigUtil.isValidPort(debugPortTextField.getText())) {
  82.433 +            setInvalidDebugPortErrorMessage();
  82.434 +            return false;
  82.435 +        }
  82.436 +
  82.437 +        setErrorMessage("");
  82.438 +
  82.439 +        return true;
  82.440 +    }
  82.441 +
  82.442 +    @Override
  82.443 +    public String getDescription() {
  82.444 +        return NbBundle.getMessage(
  82.445 +                JBConfigPanel.class, "LBL_JBOSS");
  82.446 +    }
  82.447 +
  82.448 +    public void setJavaPlatform() {
  82.449 +        JavaPlatformManager jpm = JavaPlatformManager.getDefault();
  82.450 +        JavaPlatform[] installedPlatforms = jpm.getPlatforms(null, new Specification("J2SE", null)); // NOI18N
  82.451 +
  82.452 +        JavaPlatform defaultPlatform  = jpm.getDefaultPlatform();
  82.453 +        JavaHome javaHomeObj = new JavaHome(defaultPlatform.getDisplayName(),getJavaHome(defaultPlatform));
  82.454 +        String javaHome = javaHomeObj.getJavaHome();
  82.455 +        javaHomeComboBox.addItem(javaHomeObj);
  82.456 +
  82.457 +        for (int i = 0; i < installedPlatforms.length; i++) {
  82.458 +            String sjavaHome = getJavaHome(installedPlatforms[i]);
  82.459 +            if(sjavaHome == null)
  82.460 +                continue;
  82.461 +
  82.462 +            if(!sjavaHome.equals(javaHome)) {
  82.463 +                JavaHome pjavaHome = new JavaHome(installedPlatforms[i].getDisplayName(),sjavaHome);
  82.464 +                javaHomeComboBox.addItem(pjavaHome);
  82.465 +            }
  82.466 +        }
  82.467 +    }
  82.468 +
  82.469 +    private String getJavaHome(JavaPlatform platform) {
  82.470 +        try{
  82.471 +            FileObject fo = (FileObject)platform.getInstallFolders().iterator().next();
  82.472 +            return FileUtil.toFile(fo).getAbsolutePath();
  82.473 +        }catch(Exception e){
  82.474 +            return null;
  82.475 +        }
  82.476 +    }
  82.477 +
  82.478 +    public void insertUpdate(DocumentEvent e) {
  82.479 +        fireChangeEvent();
  82.480 +    }
  82.481 +
  82.482 +    public void removeUpdate(DocumentEvent e) {
  82.483 +        fireChangeEvent();
  82.484 +    }
  82.485 +
  82.486 +    public void changedUpdate(DocumentEvent e) {
  82.487 +        fireChangeEvent();
  82.488 +    }
  82.489 +
  82.490 +    private static String getStringFromObject(Object o) {
  82.491 +        if(o instanceof String) {
  82.492 +            return ((String)o);
  82.493 +        } else if(o != null) {
  82.494 +            return o.toString();
  82.495 +        } else {
  82.496 +            return null;
  82.497 +        }
  82.498 +    }
  82.499 +
  82.500 +    private void setInvalidJbossRootErrorMessage() {
  82.501 +        setErrorMessage(NbBundle.getMessage(
  82.502 +                JBConfigPanel.class, "MSG_INVALID_JBOSS_ROOT"));
  82.503 +    }
  82.504 +    private void setInvalidJbossInstanceErrorMessage() {
  82.505 +        setErrorMessage(NbBundle.getMessage(
  82.506 +                JBConfigPanel.class, "MSG_INVALID_JBOSS_INSTANCE"));
  82.507 +    }
  82.508 +    private void setInvalidJavaHomeErrorMessage() {
  82.509 +        setErrorMessage(NbBundle.getMessage(
  82.510 +                JBConfigPanel.class, "MSG_INVALID_JAVA_HOME"));
  82.511 +    }
  82.512 +    private void setInvalidHttpPortErrorMessage() {
  82.513 +        setErrorMessage(NbBundle.getMessage(
  82.514 +                JBConfigPanel.class, "MSG_INVALID_HTTP_PORT"));
  82.515 +    }
  82.516 +    private void setInvalidDebugPortErrorMessage() {
  82.517 +        setErrorMessage(NbBundle.getMessage(
  82.518 +                JBConfigPanel.class, "MSG_INVALID_DEBUG_PORT"));
  82.519 +    }
  82.520 +
  82.521 +    private void populateJbossInstanceComboBox() {
  82.522 +        File jbossRoot = getJbossRoot();
  82.523 +
  82.524 +        populateJbossInstanceComboBox(jbossRoot,
  82.525 +                JBConfigUtil.isValidJbossRootDirectory(jbossRoot));
  82.526 +    }
  82.527 +    private void populateJbossInstanceComboBox(File jbossRoot,
  82.528 +            boolean isValidJbossRoot) {
  82.529 +        if(oldJbossRoot == null || jbossRoot == null ||
  82.530 +                !jbossRoot.equals(oldJbossRoot)) {
  82.531 +            File[] instanceDirectories = null;
  82.532 +
  82.533 +            if(isValidJbossRoot) {
  82.534 +                File serverInstancesDirectory =
  82.535 +                        new File(jbossRoot, "server");
  82.536 +
  82.537 +                if(serverInstancesDirectory.isDirectory()) {
  82.538 +                    instanceDirectories =
  82.539 +                            serverInstancesDirectory.listFiles(new FileFilter() {
  82.540 +                                public boolean accept(File pathname) {
  82.541 +                                    return JBConfigUtil.isValidJbossInstanceDirectory(pathname);
  82.542 +                                }
  82.543 +                            });
  82.544 +                }
  82.545 +            }
  82.546 +
  82.547 +            Object oldSelectedItem =
  82.548 +                    getStringFromObject(jbossInstanceComboBox.getSelectedItem());
  82.549 +
  82.550 +            jbossInstanceComboBox.removeAllItems();
  82.551 +
  82.552 +            if(instanceDirectories != null) {
  82.553 +                int selectedIndex = -1;
  82.554 +
  82.555 +                for(int i = 0; i < instanceDirectories.length; i++) {
  82.556 +                    String itemName =
  82.557 +                            instanceDirectories[i].getName();
  82.558 +
  82.559 +                    if(itemName.equals(oldSelectedItem)) {
  82.560 +                        selectedIndex = i;
  82.561 +                    }
  82.562 +
  82.563 +                    jbossInstanceComboBox.addItem(itemName);
  82.564 +                }
  82.565 +
  82.566 +                if(selectedIndex >= 0) {
  82.567 +                    jbossInstanceComboBox.setSelectedIndex(selectedIndex);
  82.568 +                }
  82.569 +            }
  82.570 +
  82.571 +            oldJbossRoot = jbossRoot;
  82.572 +        }
  82.573 +    }
  82.574 +    private void populateAllDefaultValues() {
  82.575 +        File jbossRoot = getJbossRoot();
  82.576 +
  82.577 +        boolean isValidJbossRoot =
  82.578 +                JBConfigUtil.isValidJbossRootDirectory(jbossRoot);
  82.579 +
  82.580 +        populateJbossInstanceComboBox(jbossRoot, isValidJbossRoot);
  82.581 +
  82.582 +        if(!isValidJbossRoot) {
  82.583 +            setInvalidJbossRootErrorMessage();
  82.584 +            return;
  82.585 +        }
  82.586 +
  82.587 +        String instanceName =
  82.588 +                getStringFromObject(jbossInstanceComboBox.getSelectedItem());
  82.589 +        File instanceDir =
  82.590 +                (isValidJbossRoot && instanceName != null) ?
  82.591 +                    new File(jbossRoot, "server" + File.separator + instanceName) :
  82.592 +                    null;
  82.593 +
  82.594 +        boolean validInstanceDir =
  82.595 +                JBConfigUtil.isValidJbossInstanceDirectory(instanceDir);
  82.596 +
  82.597 +        if(validInstanceDir) {
  82.598 +            String httpPortTextFieldValue =
  82.599 +                    httpPortTextField.getText();
  82.600 +
  82.601 +            if(httpPortTextFieldValue == null ||
  82.602 +                    (httpPortTextFieldValue = httpPortTextFieldValue.trim()).length() < 1) {
  82.603 +                GetHttpPortResult portResult =
  82.604 +                       JBConfigUtil.getHttpPort(instanceDir.getAbsolutePath());
  82.605 +                if(portResult != null) {
  82.606 +                    httpPortTextField.setText(Integer.toString(portResult.getPort()));
  82.607 +                    secureCheckbox.setSelected(portResult.isSecure());
  82.608 +                }
  82.609 +            }
  82.610 +        } else {
  82.611 +            setInvalidJbossInstanceErrorMessage();
  82.612 +            return;
  82.613 +        }
  82.614 +
  82.615 +        if(javaHomeComboBox.getSelectedItem() == null) {
  82.616 +            if(javaHomeComboBox.getItemCount() >= 1) {
  82.617 +                setJavaPlatform();
  82.618 +            }
  82.619 +
  82.620 +            if(javaHomeComboBox.getSelectedItem() == null) {
  82.621 +                setInvalidJavaHomeErrorMessage();
  82.622 +                return;
  82.623 +            }
  82.624 +        }
  82.625 +
  82.626 +        if(!JBConfigUtil.isValidPort(httpPortTextField.getText())) {
  82.627 +            setInvalidHttpPortErrorMessage();
  82.628 +            return;
  82.629 +        }
  82.630 +
  82.631 +        String debugPortTextFieldValue =
  82.632 +                debugPortTextField.getText();
  82.633 +
  82.634 +        if(debugPortTextFieldValue == null ||
  82.635 +                (debugPortTextFieldValue = debugPortTextFieldValue.trim()).length() < 1) {
  82.636 +
  82.637 +            debugPortTextFieldValue =
  82.638 +                    Integer.toString(JBStartServer.DEFAULT_DEBUG_PORT);
  82.639 +            debugPortTextField.setText(debugPortTextFieldValue);
  82.640 +        } else if(!JBConfigUtil.isValidPort(debugPortTextFieldValue)) {
  82.641 +            setInvalidDebugPortErrorMessage();
  82.642 +            return;
  82.643 +        }
  82.644 +
  82.645 +        setErrorMessage("");
  82.646 +        fireChangeEvent();
  82.647 +    }
  82.648 +
  82.649 +    public File getJbossRoot() {
  82.650 +        String jbossRootText = jbossRootTextField.getText();
  82.651 +
  82.652 +        if(jbossRootText == null ||
  82.653 +                (jbossRootText = jbossRootText.trim()).length() < 1) {
  82.654 +            return null;
  82.655 +        }
  82.656 +
  82.657 +        File file = new File(jbossRootText);
  82.658 +
  82.659 +        try {
  82.660 +            return file.getCanonicalFile();
  82.661 +        } catch(IOException e) {
  82.662 +            return file.getAbsoluteFile();
  82.663 +        }
  82.664 +    }
  82.665 +
  82.666 +    private JavaHome findJavaHomeObject(String javaHome) {
  82.667 +        JavaPlatformManager jpm = JavaPlatformManager.getDefault();
  82.668 +        JavaPlatform[] installedPlatforms = jpm.getPlatforms(null, new Specification("J2SE", null)); // NOI18N
  82.669 +
  82.670 +        for (int i = 0; i < installedPlatforms.length; i++) {
  82.671 +
  82.672 +            String sjavaHome = getJavaHome(installedPlatforms[i]);
  82.673 +
  82.674 +            if(sjavaHome == null)
  82.675 +                continue;
  82.676 +
  82.677 +            if(sjavaHome.equalsIgnoreCase(javaHome))
  82.678 +                return new JavaHome(installedPlatforms[i].getDisplayName(),getJavaHome(installedPlatforms[i]));
  82.679 +
  82.680 +        }
  82.681 +
  82.682 +        return null;
  82.683 +
  82.684 +    }
  82.685 +
  82.686 +    // Variables declaration - do not modify//GEN-BEGIN:variables
  82.687 +    private javax.swing.JLabel debugPortLabel;
  82.688 +    private javax.swing.JTextField debugPortTextField;
  82.689 +    private javax.swing.JLabel httpPortLabel;
  82.690 +    private javax.swing.JTextField httpPortTextField;
  82.691 +    private javax.swing.JComboBox javaHomeComboBox;
  82.692 +    private javax.swing.JLabel javaHomeLabel;
  82.693 +    private javax.swing.JComboBox jbossInstanceComboBox;
  82.694 +    private javax.swing.JLabel jbossInstanceLabel;
  82.695 +    private javax.swing.JButton jbossRootBrowseButton;
  82.696 +    private javax.swing.JLabel jbossRootLabel;
  82.697 +    private javax.swing.JTextField jbossRootTextField;
  82.698 +    private javax.swing.JLabel passwordLabel;
  82.699 +    private javax.swing.JPasswordField passwordTextField;
  82.700 +    private javax.swing.JCheckBox secureCheckbox;
  82.701 +    private javax.swing.JLabel userNameLabel;
  82.702 +    private javax.swing.JTextField userNameTextField;
  82.703 +    // End of variables declaration//GEN-END:variables
  82.704 +
  82.705 +    class JavaHome {
  82.706 +        public String displayName;
  82.707 +        public String javaHome;
  82.708 +        public JavaHome(String displayName,String javaHome) {
  82.709 +            this.displayName = displayName;
  82.710 +            this.javaHome = javaHome;
  82.711 +        }
  82.712 +
  82.713 +        @Override
  82.714 +        public String toString() {
  82.715 +            return displayName + " (" + javaHome + ")";
  82.716 +        }
  82.717 +
  82.718 +        public String getJavaHome() {
  82.719 +            return javaHome;
  82.720 +        }
  82.721 +    }
  82.722 +
  82.723 +    private File oldJbossRoot;
  82.724 +}
    83.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBConfigUtil.java	Sun Jun 26 10:25:14 2011 +0800
    83.3 @@ -0,0 +1,362 @@
    83.4 +/*
    83.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    83.6 + *
    83.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    83.8 + *
    83.9 + * The contents of this file are subject to the terms of either the GNU
   83.10 + * General Public License Version 2 only ("GPL") or the Common
   83.11 + * Development and Distribution License("CDDL") (collectively, the
   83.12 + * "License"). You may not use this file except in compliance with the
   83.13 + * License. You can obtain a copy of the License at
   83.14 + * http://www.netbeans.org/cddl-gplv2.html
   83.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   83.16 + * specific language governing permissions and limitations under the
   83.17 + * License.  When distributing the software, include this License Header
   83.18 + * Notice in each file and include the License file at
   83.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   83.20 + * particular file as subject to the "Classpath" exception as provided
   83.21 + * by Sun in the GPL Version 2 section of the License file that
   83.22 + * accompanied this code. If applicable, add the following below the
   83.23 + * License Header, with the fields enclosed by brackets [] replaced by
   83.24 + * your own identifying information:
   83.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   83.26 + *
   83.27 + * If you wish your version of this file to be governed by only the CDDL
   83.28 + * or only the GPL Version 2, indicate your decision by adding
   83.29 + * "[Contributor] elects to include this software in this distribution
   83.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   83.31 + * single choice of license, a recipient has the option to distribute
   83.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   83.33 + * to extend the choice of license to its licensees as provided above.
   83.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   83.35 + * Version 2 license, then the option applies only if the new code is
   83.36 + * made subject to such option by the copyright holder.
   83.37 + *
   83.38 + * Contributor(s):
   83.39 + * John Platts
   83.40 + *
   83.41 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   83.42 + * Portions Copyrighted 2009 John Platts
   83.43 + */
   83.44 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss;
   83.45 +
   83.46 +import java.io.File;
   83.47 +import java.io.FileInputStream;
   83.48 +import java.io.InputStream;
   83.49 +import java.io.Serializable;
   83.50 +import java.util.Locale;
   83.51 +import java.util.logging.Level;
   83.52 +import java.util.logging.Logger;
   83.53 +import javax.xml.parsers.DocumentBuilderFactory;
   83.54 +import javax.xml.parsers.SAXParser;
   83.55 +import javax.xml.parsers.SAXParserFactory;
   83.56 +import org.openide.util.Utilities;
   83.57 +import org.w3c.dom.Document;
   83.58 +import org.w3c.dom.Element;
   83.59 +import org.w3c.dom.Node;
   83.60 +import org.w3c.dom.NodeList;
   83.61 +import org.xml.sax.Attributes;
   83.62 +import org.xml.sax.SAXException;
   83.63 +import org.xml.sax.helpers.DefaultHandler;
   83.64 +
   83.65 +/**
   83.66 + * Configuration utility class for JBoss Application Server
   83.67 + * @author John Platts
   83.68 + */
   83.69 +public class JBConfigUtil {
   83.70 +
   83.71 +    private JBConfigUtil() {
   83.72 +    }
   83.73 +    public static final String LIB = "lib" + File.separator; //NOI18N
   83.74 +    public static final String CLIENT = "client" + File.separator; //NOI18N
   83.75 +    private static final Logger LOGGER = Logger.getLogger(JBConfigUtil.class.getName());
   83.76 +
   83.77 +    public static String getJnpPort(String domainDir) {
   83.78 +        String serviceXml = domainDir + File.separator + "conf" + File.separator + "jboss-service.xml"; //NOI18N
   83.79 +        File xmlFile = new File(serviceXml);
   83.80 +        if (!xmlFile.exists()) {
   83.81 +            return "";
   83.82 +        }
   83.83 +
   83.84 +        InputStream inputStream = null;
   83.85 +        Document document = null;
   83.86 +        try {
   83.87 +            inputStream = new FileInputStream(xmlFile);
   83.88 +            document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
   83.89 +
   83.90 +            // get the root element
   83.91 +            Element root = document.getDocumentElement();
   83.92 +
   83.93 +            // get the child nodes
   83.94 +            NodeList children = root.getChildNodes();
   83.95 +            for (int i = 0; i < children.getLength(); i++) {
   83.96 +                Node child = children.item(i);
   83.97 +                if (child.getNodeName().equals("mbean")) {  // NOI18N
   83.98 +                    NodeList nl = child.getChildNodes();
   83.99 +                    if (!child.getAttributes().getNamedItem("name").getNodeValue().equals("jboss:service=Naming")) //NOI18N
  83.100 +                    {
  83.101 +                        continue;
  83.102 +                    }
  83.103 +                    for (int j = 0; j < nl.getLength(); j++) {
  83.104 +                        Node ch = nl.item(j);
  83.105 +
  83.106 +                        if (ch.getNodeName().equals("attribute")) {  // NOI18N
  83.107 +                            if (!ch.getAttributes().getNamedItem("name").getNodeValue().equals("Port")) //NOI18N
  83.108 +                            {
  83.109 +                                continue;
  83.110 +                            }
  83.111 +                            return ch.getFirstChild().getNodeValue();
  83.112 +                        }
  83.113 +                    }
  83.114 +                }
  83.115 +            }
  83.116 +        } catch (Exception e) {
  83.117 +            Logger.getLogger("global").log(Level.INFO, null, e);
  83.118 +        } finally {
  83.119 +            if(inputStream != null) {
  83.120 +                try {
  83.121 +                    inputStream.close();
  83.122 +                } catch(Exception e) {
  83.123 +                }
  83.124 +            }
  83.125 +        }
  83.126 +        
  83.127 +        return "";
  83.128 +    }
  83.129 +    
  83.130 +    public static boolean isValidJbossRootDirectory(File jbossRootDir) {
  83.131 +        if(jbossRootDir == null || !jbossRootDir.isDirectory()) {
  83.132 +            return false;
  83.133 +        }
  83.134 +        
  83.135 +        File runScript = new File(jbossRootDir, "bin" +
  83.136 +                File.separator + (Utilities.isWindows() ?
  83.137 +                    JBStartServer.RUN_BAT : JBStartServer.RUN_SH));
  83.138 +
  83.139 +        if(!runScript.isFile()) {
  83.140 +            return false;
  83.141 +        }
  83.142 +
  83.143 +        return true;
  83.144 +    }
  83.145 +
  83.146 +    public static boolean isValidJbossInstanceDirectory(File instanceDir) {
  83.147 +        if(instanceDir == null || !instanceDir.isDirectory()) {
  83.148 +            return false;
  83.149 +        }
  83.150 +
  83.151 +        File confDir = new File(instanceDir, "conf");
  83.152 +        if(!confDir.isDirectory()) {
  83.153 +            return false;
  83.154 +        }
  83.155 +
  83.156 +        File jbossServiceXmlFile = new File(confDir, "jboss-service.xml");
  83.157 +        if(!jbossServiceXmlFile.isFile()) {
  83.158 +            return false;
  83.159 +        }
  83.160 +
  83.161 +        File deployDir = new File(instanceDir, "deploy");
  83.162 +        if(!deployDir.isDirectory()) {
  83.163 +            return false;
  83.164 +        }
  83.165 +
  83.166 +        File jbosswebSar = new File(deployDir, "jbossweb.sar");
  83.167 +        if(!jbosswebSar.isDirectory()) {
  83.168 +            return false;
  83.169 +        }
  83.170 +
  83.171 +        File serverXml = new File(jbosswebSar, "server.xml");
  83.172 +        if(!serverXml.exists()) {
  83.173 +            return false;
  83.174 +        }
  83.175 +
  83.176 +        return true;
  83.177 +    }
  83.178 +
  83.179 +    public static class GetHttpPortResult implements Serializable {
  83.180 +        private static final long serialVersionUID = -10L;
  83.181 +        public GetHttpPortResult(int port, boolean secure) {
  83.182 +            this.port = port;
  83.183 +            this.secure = secure;
  83.184 +        }
  83.185 +
  83.186 +        public int getPort() {
  83.187 +            return port;
  83.188 +        }
  83.189 +
  83.190 +        public boolean isSecure() {
  83.191 +            return secure;
  83.192 +        }
  83.193 +
  83.194 +        private int port;
  83.195 +        private boolean secure;
  83.196 +    }
  83.197 +    private static class GetHttpPortStopProcessingException extends SAXException {
  83.198 +    }
  83.199 +    private static class GetHttpPortContentHandler extends DefaultHandler {
  83.200 +        public void startElement(String uri, String localName, String qName,
  83.201 +                Attributes atts) throws SAXException {
  83.202 +            String elemName = getElementName(localName, qName);
  83.203 +
  83.204 +            if("Service".equals(elemName)) {
  83.205 +                insideServiceElement = true;
  83.206 +            }
  83.207 +            if("Connector".equals(elemName)) {
  83.208 +                String protocolAttr = null;
  83.209 +                String secureAttr = null;
  83.210 +                String schemeAttr = null;
  83.211 +                String portAttr = null;
  83.212 +
  83.213 +                if(atts != null) {
  83.214 +                    for(int i = 0; i < atts.getLength(); i++) {
  83.215 +                        String attrLocalName = atts.getLocalName(i);
  83.216 +                        String attrQname = atts.getQName(i);
  83.217 +                        String attrName = getElementName(attrLocalName,
  83.218 +                                attrQname);
  83.219 +
  83.220 +                        if("protocol".equals(attrName)) {
  83.221 +                            protocolAttr = atts.getValue(i);
  83.222 +                        }
  83.223 +                        if("secure".equals(attrName)) {
  83.224 +                            secureAttr = atts.getValue(i);
  83.225 +                        }
  83.226 +                        if("scheme".equals(attrName)) {
  83.227 +                            schemeAttr = atts.getValue(i);
  83.228 +                        }
  83.229 +                        if("port".equals(attrName)) {
  83.230 +                            portAttr = atts.getValue(i);
  83.231 +                        }
  83.232 +                    }
  83.233 +                }
  83.234 +
  83.235 +                String uppercaseProtocol = (protocolAttr != null) ?
  83.236 +                        protocolAttr.toUpperCase(Locale.ENGLISH) : "";
  83.237 +                boolean isHttp =
  83.238 +                        !uppercaseProtocol.contains("AJP") &&
  83.239 +                        !uppercaseProtocol.contains("HTTP");
  83.240 +
  83.241 +                boolean isSecure =
  83.242 +                        (secureAttr != null &&
  83.243 +                         (secureAttr = secureAttr.trim()).equalsIgnoreCase("true")) ||
  83.244 +                        (schemeAttr != null &&
  83.245 +                         (schemeAttr = schemeAttr.trim()).equalsIgnoreCase("https"));
  83.246 +
  83.247 +                if(portAttr != null) {
  83.248 +                    int port;
  83.249 +                    try {
  83.250 +                        port = Integer.parseInt(portAttr);
  83.251 +                    } catch(NumberFormatException e) {
  83.252 +                        port = -1;
  83.253 +                    }
  83.254 +
  83.255 +                    if(isValidPort(port)) {
  83.256 +                        if(isSecure) {
  83.257 +                            secureResult =
  83.258 +                                    new GetHttpPortResult(port, true);
  83.259 +                        } else {
  83.260 +                            result = new GetHttpPortResult(port, false);
  83.261 +                        }
  83.262 +                    }
  83.263 +                }
  83.264 +
  83.265 +                if(result != null) {
  83.266 +                    // End processing here because we have found a non-HTTPS
  83.267 +                    // HTTP connector
  83.268 +                    throw new GetHttpPortStopProcessingException();
  83.269 +                }
  83.270 +            }
  83.271 +        }
  83.272 +
  83.273 +        public void endElement(String uri, String localName, String qName)
  83.274 +                throws SAXException {
  83.275 +            String elemName = getElementName(localName, qName);
  83.276 +
  83.277 +            if("Service".equals(elemName)) {
  83.278 +                insideServiceElement = true;
  83.279 +            }
  83.280 +        }
  83.281 +        
  83.282 +        protected String getElementName(String localName, String qName) {
  83.283 +            if (localName != null && localName.length() >= 1) {
  83.284 +                return localName;
  83.285 +            } else {
  83.286 +                if(qName == null) {
  83.287 +                    return null;
  83.288 +                }
  83.289 +
  83.290 +                int i = qName.indexOf(':');
  83.291 +                if(i == -1) {
  83.292 +                    return qName;
  83.293 +                } else {
  83.294 +                    return qName.substring(1, qName.length());
  83.295 +                }
  83.296 +            }
  83.297 +        }
  83.298 +
  83.299 +        public GetHttpPortResult getResult() {
  83.300 +            return ((result != null) ? result :
  83.301 +                ((secureResult != null) ? secureResult : null));
  83.302 +        }
  83.303 +
  83.304 +        private boolean insideServiceElement = false;
  83.305 +        private GetHttpPortResult result = null;
  83.306 +        private GetHttpPortResult secureResult = null;
  83.307 +    }
  83.308 +
  83.309 +    public static GetHttpPortResult getHttpPort(String domainDir) {
  83.310 +        String serverXml = "deploy" + File.separator + "jbossweb.sar" +
  83.311 +                File.separator + "server.xml"; //NOI18N
  83.312 +        File xmlFile = new File(domainDir, serverXml);
  83.313 +        if (!xmlFile.exists()) {
  83.314 +            return null;
  83.315 +        }
  83.316 +
  83.317 +        InputStream inputStream = null;
  83.318 +        Document document = null;
  83.319 +        try {
  83.320 +            inputStream = new FileInputStream(xmlFile);
  83.321 +
  83.322 +            SAXParserFactory saxParserFactory =
  83.323 +                    SAXParserFactory.newInstance();
  83.324 +
  83.325 +            SAXParser saxParser = saxParserFactory.newSAXParser();
  83.326 +            GetHttpPortContentHandler contentHandler =
  83.327 +                    new GetHttpPortContentHandler();
  83.328 +
  83.329 +            try {
  83.330 +                saxParser.parse(inputStream, contentHandler);
  83.331 +            } catch(GetHttpPortStopProcessingException e) {
  83.332 +                // Ignore a GetHttpPortStopProcessingException exception
  83.333 +                // that is thrown because this is simply thrown to stop SAX
  83.334 +                // processing
  83.335 +            }
  83.336 +
  83.337 +            return contentHandler.getResult();
  83.338 +        } catch (Exception e) {
  83.339 +            Logger.getLogger("global").log(Level.INFO, null, e);
  83.340 +        } finally {
  83.341 +            if(inputStream != null) {
  83.342 +                try {
  83.343 +                    inputStream.close();
  83.344 +                } catch(Exception e) {
  83.345 +                }
  83.346 +            }
  83.347 +        }
  83.348 +        return null;
  83.349 +    }
  83.350 +
  83.351 +    public static boolean isValidPort(int port) {
  83.352 +        return ((port > 0) && (port < 65536));
  83.353 +    }
  83.354 +    public static boolean isValidPort(String port) {
  83.355 +        if(port == null || (port = port.trim()).length() < 1) {
  83.356 +            return false;
  83.357 +        }
  83.358 +
  83.359 +        try {
  83.360 +            return isValidPort(Integer.parseInt(port));
  83.361 +        } catch(NumberFormatException e) {
  83.362 +            return false;
  83.363 +        }
  83.364 +    }
  83.365 +}
    84.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBConstant.java	Sun Jun 26 10:25:14 2011 +0800
    84.3 @@ -0,0 +1,57 @@
    84.4 +/*
    84.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    84.6 + *
    84.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    84.8 + *
    84.9 + * The contents of this file are subject to the terms of either the GNU
   84.10 + * General Public License Version 2 only ("GPL") or the Common
   84.11 + * Development and Distribution License("CDDL") (collectively, the
   84.12 + * "License"). You may not use this file except in compliance with the
   84.13 + * License. You can obtain a copy of the License at
   84.14 + * http://www.netbeans.org/cddl-gplv2.html
   84.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   84.16 + * specific language governing permissions and limitations under the
   84.17 + * License.  When distributing the software, include this License Header
   84.18 + * Notice in each file and include the License file at
   84.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   84.20 + * particular file as subject to the "Classpath" exception as provided
   84.21 + * by Sun in the GPL Version 2 section of the License file that
   84.22 + * accompanied this code. If applicable, add the following below the
   84.23 + * License Header, with the fields enclosed by brackets [] replaced by
   84.24 + * your own identifying information:
   84.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   84.26 + *
   84.27 + * If you wish your version of this file to be governed by only the CDDL
   84.28 + * or only the GPL Version 2, indicate your decision by adding
   84.29 + * "[Contributor] elects to include this software in this distribution
   84.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   84.31 + * single choice of license, a recipient has the option to distribute
   84.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   84.33 + * to extend the choice of license to its licensees as provided above.
   84.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   84.35 + * Version 2 license, then the option applies only if the new code is
   84.36 + * made subject to such option by the copyright holder.
   84.37 + *
   84.38 + * Contributor(s):
   84.39 + * John Platts
   84.40 + *
   84.41 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   84.42 + * Portions Copyrighted 2009 John Platts
   84.43 + */
   84.44 +
   84.45 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss;
   84.46 +
   84.47 +/**
   84.48 + * Constants for JBoss-specific settings
   84.49 + * @author John
   84.50 + */
   84.51 +public interface JBConstant {
   84.52 +    public static String ROOT_DIR = "root-dir"; //NOI18N
   84.53 +    public static String SERVER = "server"; //NOI18N
   84.54 +    public static String SERVER_DIR = "server-dir"; //NOI18N
   84.55 +    public static String DEBUG_PORT = "debug_port"; //NOI18N
   84.56 +    public static String JAVA_HOME = "JAVA_HOME"; //NOI18N
   84.57 +    public static String SERVER_USER = "SERVER_USER"; //NOI18N
   84.58 +    public static String SERVER_PASSWORD = "SERVER_PASSWORD"; //NOI18N
   84.59 +    public static String SECURE = "SECURE"; //NOI18N
   84.60 +}
    85.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBDeployHandler.java	Sun Jun 26 10:25:14 2011 +0800
    85.3 @@ -0,0 +1,162 @@
    85.4 +/*
    85.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    85.6 + *
    85.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    85.8 + *
    85.9 + * The contents of this file are subject to the terms of either the GNU
   85.10 + * General Public License Version 2 only ("GPL") or the Common
   85.11 + * Development and Distribution License("CDDL") (collectively, the
   85.12 + * "License"). You may not use this file except in compliance with the
   85.13 + * License. You can obtain a copy of the License at
   85.14 + * http://www.netbeans.org/cddl-gplv2.html
   85.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   85.16 + * specific language governing permissions and limitations under the
   85.17 + * License.  When distributing the software, include this License Header
   85.18 + * Notice in each file and include the License file at
   85.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   85.20 + * particular file as subject to the "Classpath" exception as provided
   85.21 + * by Sun in the GPL Version 2 section of the License file that
   85.22 + * accompanied this code. If applicable, add the following below the
   85.23 + * License Header, with the fields enclosed by brackets [] replaced by
   85.24 + * your own identifying information:
   85.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   85.26 + *
   85.27 + * If you wish your version of this file to be governed by only the CDDL
   85.28 + * or only the GPL Version 2, indicate your decision by adding
   85.29 + * "[Contributor] elects to include this software in this distribution
   85.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   85.31 + * single choice of license, a recipient has the option to distribute
   85.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   85.33 + * to extend the choice of license to its licensees as provided above.
   85.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   85.35 + * Version 2 license, then the option applies only if the new code is
   85.36 + * made subject to such option by the copyright holder.
   85.37 + *
   85.38 + * Contributor(s):
   85.39 + * John Platts
   85.40 + *
   85.41 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   85.42 + * Portions Copyrighted 2009 John Platts
   85.43 + */
   85.44 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss;
   85.45 +
   85.46 +import java.io.File;
   85.47 +import java.util.logging.Level;
   85.48 +import java.util.logging.Logger;
   85.49 +import javax.enterprise.deploy.spi.Target;
   85.50 +import javax.enterprise.deploy.spi.TargetModuleID;
   85.51 +import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
   85.52 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.ServerDeployHandler;
   85.53 +import org.netbeans.modules.portalpack.servers.core.util.NetbeanConstants;
   85.54 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
   85.55 +import org.openide.util.Exceptions;
   85.56 +
   85.57 +/**
   85.58 + * Deployment handler for JBoss Application Server
   85.59 + * @author John Platts
   85.60 + */
   85.61 +public class JBDeployHandler implements ServerDeployHandler {
   85.62 +
   85.63 +	private PSConfigObject psconfig;
   85.64 +	private PSDeploymentManager dm;
   85.65 +	private static Logger logger = Logger.getLogger(NetbeanConstants.PORTAL_LOGGER);
   85.66 +
   85.67 +	/**
   85.68 +	 * Creates a new instance of JBDeployHandler
   85.69 +	 */
   85.70 +	public JBDeployHandler(PSDeploymentManager dm) {
   85.71 +		this.dm = dm;
   85.72 +		this.psconfig = dm.getPSConfig();
   85.73 +	}
   85.74 +
   85.75 +	public boolean deploy(String warFile) throws Exception {
   85.76 +		// Only called if deploying on Glassfish
   85.77 +
   85.78 +		// Return false
   85.79 +		return false;
   85.80 +	}
   85.81 +
   85.82 +	private boolean undeployFromJBoss(String appName) throws Exception {
   85.83 +		File warFile = null;
   85.84 +		if(!appName.endsWith(".war"))
   85.85 +			warFile = new File(psconfig.getProperty(JBConstant.SERVER_DIR) + File.separator + "deploy" + File.separator + appName + ".war");
   85.86 +		else
   85.87 +			warFile = new File(psconfig.getProperty(JBConstant.SERVER_DIR) + File.separator + "deploy" + File.separator + appName);
   85.88 +
   85.89 +		if (warFile.exists()) {
   85.90 +			if (warFile.isDirectory()) {
   85.91 +				undeployDir(warFile);
   85.92 +			} else {
   85.93 +				warFile.delete();
   85.94 +			}
   85.95 +		}
   85.96 +
   85.97 +		try {
   85.98 +			Thread.sleep(5000);
   85.99 +		} catch (InterruptedException ex) {
  85.100 +			Exceptions.printStackTrace(ex);
  85.101 +		}
  85.102 +
  85.103 +		return true;
  85.104 +	}
  85.105 +
  85.106 +	protected void undeployDir(File dir) {
  85.107 +
  85.108 +		String files[] = dir.list();
  85.109 +		if (files == null) {
  85.110 +			files = new String[0];
  85.111 +		}
  85.112 +		for (int i = 0; i < files.length; i++) {
  85.113 +			File file = new File(dir, files[i]);
  85.114 +			if (file.isDirectory()) {
  85.115 +				undeployDir(file);
  85.116 +			} else {
  85.117 +				file.delete();
  85.118 +			}
  85.119 +			dir.delete();
  85.120 +		}
  85.121 +	}
  85.122 +
  85.123 +	public boolean undeploy(String appName) throws Exception {
  85.124 +		try {
  85.125 +			//undeployOnTomcat(appName);
  85.126 +			return undeployFromJBoss(appName);
  85.127 +		} catch (Exception e) {
  85.128 +			logger.log(Level.SEVERE, "Error", e);
  85.129 +			return false;
  85.130 +		}
  85.131 +	}
  85.132 +
  85.133 +	public boolean install() throws Exception {
  85.134 +		return true;
  85.135 +	}
  85.136 +
  85.137 +	public boolean deploy(String dir, String contextName) throws Exception {
  85.138 +		// Only called if deploying on Glassfish
  85.139 +
  85.140 +		// Return false
  85.141 +		return false;
  85.142 +	}
  85.143 +
  85.144 +	public void restart(String contextRoot) throws Exception {
  85.145 +		//throw new UnsupportedOperationException("Not supported yet.");
  85.146 +	}
  85.147 +
  85.148 +	public boolean isDeployOnSaveSupported() {
  85.149 +		return false;
  85.150 +	//throw new UnsupportedOperationException("Not supported yet.");
  85.151 +	}
  85.152 +
  85.153 +	public boolean isServerRunning() {
  85.154 +		return true;
  85.155 +	}
  85.156 +
  85.157 +	public File getModuleDirectory(TargetModuleID module) {
  85.158 +		return null;
  85.159 +	}
  85.160 +
  85.161 +	public TargetModuleID[] getAvailableModules(Target[] targets) {
  85.162 +		return new TargetModuleID[0];
  85.163 +	}
  85.164 +	
  85.165 +}
    86.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBFindJSPServlet.java	Sun Jun 26 10:25:14 2011 +0800
    86.3 @@ -0,0 +1,122 @@
    86.4 +/*
    86.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    86.6 + *
    86.7 + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
    86.8 + *
    86.9 + * The contents of this file are subject to the terms of either the GNU
   86.10 + * General Public License Version 2 only ("GPL") or the Common
   86.11 + * Development and Distribution License("CDDL") (collectively, the
   86.12 + * "License"). You may not use this file except in compliance with the
   86.13 + * License. You can obtain a copy of the License at
   86.14 + * http://www.netbeans.org/cddl-gplv2.html
   86.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   86.16 + * specific language governing permissions and limitations under the
   86.17 + * License.  When distributing the software, include this License Header
   86.18 + * Notice in each file and include the License file at
   86.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   86.20 + * particular file as subject to the "Classpath" exception as provided
   86.21 + * by Sun in the GPL Version 2 section of the License file that
   86.22 + * accompanied this code. If applicable, add the following below the
   86.23 + * License Header, with the fields enclosed by brackets [] replaced by
   86.24 + * your own identifying information:
   86.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   86.26 + *
   86.27 + * Contributor(s):
   86.28 + * John Platts
   86.29 + *
   86.30 + * The Original Software is NetBeans. The Initial Developer of the Original
   86.31 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
   86.32 + * Microsystems, Inc. Portions Copyrighted 2009 John Platts. All Rights Reserved.
   86.33 + *
   86.34 + * If you wish your version of this file to be governed by only the CDDL
   86.35 + * or only the GPL Version 2, indicate your decision by adding
   86.36 + * "[Contributor] elects to include this software in this distribution
   86.37 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   86.38 + * single choice of license, a recipient has the option to distribute
   86.39 + * your version of this file under either the CDDL, the GPL Version 2 or
   86.40 + * to extend the choice of license to its licensees as provided above.
   86.41 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   86.42 + * Version 2 license, then the option applies only if the new code is
   86.43 + * made subject to such option by the copyright holder.
   86.44 + */
   86.45 +
   86.46 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss;
   86.47 +
   86.48 +import java.io.File;
   86.49 +import org.netbeans.modules.j2ee.deployment.plugins.spi.FindJSPServlet;
   86.50 +import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
   86.51 +import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
   86.52 +import org.netbeans.modules.portalpack.servers.core.util.JspNameUtil;
   86.53 +
   86.54 +/**
   86.55 + * FindJSPServlet implementation for JBoss
   86.56 + * @author Libor Kotouc, John Platts
   86.57 + */
   86.58 +public class JBFindJSPServlet implements FindJSPServlet {
   86.59 +    
   86.60 +    PSDeploymentManager dm;
   86.61 +    
   86.62 +    public JBFindJSPServlet(PSDeploymentManager manager) {
   86.63 +        dm = manager;
   86.64 +    }
   86.65 +
   86.66 +    public File getServletTempDirectory(String moduleContextPath) {
   86.67 +        String domainPath = dm.getPSConfig().getProperty(JBConstant.SERVER_DIR);
   86.68 +        File servletRoot = new File(domainPath, "work/jboss.web/localhost".replace('/', File.separatorChar)); // NOI18N
   86.69 +        String contextRootPath = getContextRootPath(moduleContextPath);
   86.70 +        File workDir = new File(servletRoot, contextRootPath);
   86.71 +        return workDir;
   86.72 +    }
   86.73 +
   86.74 +    private String getContextRootPath(String moduleContextPath) {
   86.75 +        if (moduleContextPath.startsWith("/")) {
   86.76 +            moduleContextPath = moduleContextPath.substring(1);
   86.77 +        }
   86.78 +        if (moduleContextPath.length() == 0) {
   86.79 +            moduleContextPath = "/";
   86.80 +        }
   86.81 +        
   86.82 +        return moduleContextPath.replace('/', '_');
   86.83 +    }
   86.84 +    
   86.85 +    public String getServletResourcePath(String moduleContextPath, String jspResourcePath) {
   86.86 +
   86.87 +        String path = null;
   86.88 +        
   86.89 +        String extension = jspResourcePath.substring(jspResourcePath.lastIndexOf("."));
   86.90 +        if (".jsp".equals(extension)) { // NOI18N
   86.91 +            String pkgName = getServletPackageName(jspResourcePath);
   86.92 +            String pkgPath = pkgName.replace('.', '/');
   86.93 +            String clzName = getServletClassName(jspResourcePath);
   86.94 +            path = pkgPath + '/' + clzName + ".java"; // NOI18N
   86.95 +        }
   86.96 +        
   86.97 +        return path;
   86.98 +    }
   86.99 +
  86.100 +    // copied from org.apache.jasper.JspCompilationContext
  86.101 +    public String getServletPackageName(String jspUri) {
  86.102 +        String dPackageName = getDerivedPackageName(jspUri);
  86.103 +        if (dPackageName.length() == 0) {
  86.104 +            return JspNameUtil.JSP_PACKAGE_NAME;
  86.105 +        }
  86.106 +        return JspNameUtil.JSP_PACKAGE_NAME + '.' + getDerivedPackageName(jspUri);
  86.107 +    }
  86.108 +    
  86.109 +    // copied from org.apache.jasper.JspCompilationContext
  86.110 +    private String getDerivedPackageName(String jspUri) {
  86.111 +        int iSep = jspUri.lastIndexOf('/');
  86.112 +        return (iSep > 0) ? JspNameUtil.makeJavaPackage(jspUri.substring(0,iSep)) : "";
  86.113 +    }
  86.114 +    
  86.115 +    // copied from org.apache.jasper.JspCompilationContext
  86.116 +    public String getServletClassName(String jspUri) {
  86.117 +        int iSep = jspUri.lastIndexOf('/') + 1;
  86.118 +        return JspNameUtil.makeJavaIdentifier(jspUri.substring(iSep));
  86.119 +    }
  86.120 +    
  86.121 +    public String getServletEncoding(String moduleContextPath, String jspResourcePath) {
  86.122 +        return "UTF8"; // NOI18N
  86.123 +    }
  86.124 +      
  86.125 +}
    87.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBShutdownException.java	Sun Jun 26 10:25:14 2011 +0800
    87.3 @@ -0,0 +1,56 @@
    87.4 +/*
    87.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    87.6 + *
    87.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    87.8 + *
    87.9 + * The contents of this file are subject to the terms of either the GNU
   87.10 + * General Public License Version 2 only ("GPL") or the Common
   87.11 + * Development and Distribution License("CDDL") (collectively, the
   87.12 + * "License"). You may not use this file except in compliance with the
   87.13 + * License. You can obtain a copy of the License at
   87.14 + * http://www.netbeans.org/cddl-gplv2.html
   87.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   87.16 + * specific language governing permissions and limitations under the
   87.17 + * License.  When distributing the software, include this License Header
   87.18 + * Notice in each file and include the License file at
   87.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   87.20 + * particular file as subject to the "Classpath" exception as provided
   87.21 + * by Sun in the GPL Version 2 section of the License file that
   87.22 + * accompanied this code. If applicable, add the following below the
   87.23 + * License Header, with the fields enclosed by brackets [] replaced by
   87.24 + * your own identifying information:
   87.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   87.26 + *
   87.27 + * If you wish your version of this file to be governed by only the CDDL
   87.28 + * or only the GPL Version 2, indicate your decision by adding
   87.29 + * "[Contributor] elects to include this software in this distribution
   87.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   87.31 + * single choice of license, a recipient has the option to distribute
   87.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   87.33 + * to extend the choice of license to its licensees as provided above.
   87.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   87.35 + * Version 2 license, then the option applies only if the new code is
   87.36 + * made subject to such option by the copyright holder.
   87.37 + *
   87.38 + * Contributor(s):
   87.39 + * John Platts
   87.40 + *
   87.41 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   87.42 + * Portions Copyrighted 2009 John Platts
   87.43 + */
   87.44 +
   87.45 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss;
   87.46 +
   87.47 +/**
   87.48 + * Exception thrown if shutdown by {@link JBStartServer#doStopServer()} or
   87.49 + * {@link JBStartServer#doStopDebug()} fails.
   87.50 + * @author John Platts
   87.51 + */
   87.52 +public class JBShutdownException extends Exception {
   87.53 +    public JBShutdownException(String message) {
   87.54 +        super(message);
   87.55 +    }
   87.56 +    public JBShutdownException(String message, Throwable cause) {
   87.57 +        super(message, cause);
   87.58 +    }
   87.59 +}
    88.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBStartServer.java	Sun Jun 26 10:25:14 2011 +0800
    88.3 @@ -0,0 +1,543 @@
    88.4 +/*
    88.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    88.6 + *
    88.7 + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
    88.8 + *
    88.9 + * The contents of this file are subject to the terms of either the GNU
   88.10 + * General Public License Version 2 only ("GPL") or the Common
   88.11 + * Development and Distribution License("CDDL") (collectively, the
   88.12 + * "License"). You may not use this file except in compliance with the
   88.13 + * License. You can obtain a copy of the License at
   88.14 + * http://www.netbeans.org/cddl-gplv2.html
   88.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   88.16 + * specific language governing permissions and limitations under the
   88.17 + * License.  When distributing the software, include this License Header
   88.18 + * Notice in each file and include the License file at
   88.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   88.20 + * particular file as subject to the "Classpath" exception as provided
   88.21 + * by Sun in the GPL Version 2 section of the License file that
   88.22 + * accompanied this code. If applicable, add the following below the
   88.23 + * License Header, with the fields enclosed by brackets [] replaced by
   88.24 + * your own identifying information:
   88.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   88.26 + *
   88.27 + * Contributor(s):
   88.28 + * John Platts
   88.29 + *
   88.30 + * The Original Software is NetBeans. The Initial Developer of the Original
   88.31 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
   88.32 + * Microsystems, Inc. Portions Copyrighted 2009 John Platts. All Rights Reserved.
   88.33 + *
   88.34 + * If you wish your version of this file to be governed by only the CDDL
   88.35 + * or only the GPL Version 2, indicate your decision by adding
   88.36 + * "[Contributor] elects to include this software in this distribution
   88.37 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   88.38 + * single choice of license, a recipient has the option to distribute
   88.39 + * your version of this file under either the CDDL, the GPL Version 2 or
   88.40 + * to extend the choice of license to its licensees as provided above.
   88.41 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   88.42 + * Version 2 license, then the option applies only if the new code is
   88.43 + * made subject to such option by the copyright holder.
   88.44 + */
   88.45 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss;
   88.46 +
   88.47 +import java.io.BufferedReader;
   88.48 +import java.io.File;
   88.49 +import java.io.IOException;
   88.50 +import java.io.InputStreamReader;
   88.51 +import java.io.PrintWriter;
   88.52 +import java.io.Writer;
   88.53 +import java.net.InetSocketAddress;
   88.54 +import java.net.Socket;
   88.55 +import java.nio.ByteBuffer;
   88.56 +import java.nio.CharBuffer;
   88.57 +import java.nio.channels.Channels;
   88.58 +import java.nio.channels.SocketChannel;
   88.59 +import java.nio.charset.Charset;
   88.60 +import java.util.ArrayList;
   88.61 +import java.util.HashMap;
   88.62 +import java.util.List;
   88.63 +import java.util.Map;
   88.64 +import java.util.regex.Matcher;
   88.65 +import java.util.regex.Pattern;
   88.66 +import org.netbeans.modules.j2ee.deployment.plugins.spi.FindJSPServlet;
   88.67 +import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
   88.68 +import org.netbeans.modules.portalpack.servers.core.api.PSStartServerInf;
   88.69 +import org.netbeans.modules.portalpack.servers.core.common.LogManager;
   88.70 +import org.netbeans.modules.portalpack.servers.core.util.Base64Routines;
   88.71 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
   88.72 +import org.openide.execution.NbProcessDescriptor;
   88.73 +import org.openide.util.RequestProcessor;
   88.74 +import org.openide.util.Utilities;
   88.75 +
   88.76 +/**
   88.77 + *
   88.78 + * @author Kirill Sorokin
   88.79 + */
   88.80 +public class JBStartServer extends PSStartServerInf implements JBConstant {
   88.81 +
   88.82 +    private PSConfigObject psconfig;
   88.83 +    private PSDeploymentManager dm;
   88.84 +
   88.85 +    public static final String RUN_SH = "run.sh"; //NOI18N
   88.86 +    public static final String RUN_BAT = "run.bat"; //NOI18N
   88.87 +
   88.88 +    public static final String JAVA_EXECUTABLE =
   88.89 +            "bin" + File.separator + "java"; //NOI18N
   88.90 +
   88.91 +    private static int CMD_START = 0;
   88.92 +    private static int CMD_STOP = 1;
   88.93 +
   88.94 +    /** For how long should we keep trying to get response from the server. */
   88.95 +    private static final long TIMEOUT_DELAY = 180000;
   88.96 +
   88.97 +    /** Creates a new instance of TomcatStartServer */
   88.98 +    public JBStartServer(PSDeploymentManager dm) {
   88.99 +        this.dm = dm;
  88.100 +        this.psconfig = dm.getPSConfig();
  88.101 +    }
  88.102 +
  88.103 +    @Override
  88.104 +    public void doStartServer(String[] env) throws Exception {
  88.105 +        startJBossServer(env,false);
  88.106 +    }
  88.107 +
  88.108 +    private static final String JBOSS_SHUTDOWN_URL =
  88.109 +            "/jmx-console/HtmlAdaptor";
  88.110 +    private static final String JBOSS_SHUTDOWN_PARAMS =
  88.111 +            "action=invokeOpByName" +
  88.112 +            "&name=jboss.system%3Atype%3DServer" +
  88.113 +            "&methodName=shutdown";
  88.114 +    @Override
  88.115 +    public void doStopServer(String[] env) throws Exception {
  88.116 +        shutdownJBossServer();
  88.117 +    }
  88.118 +
  88.119 +    public int shutdownJBossServer() throws Exception {
  88.120 +        sendShutdownMessage(null, null);
  88.121 +
  88.122 +        if(hasStopCommandSucceeded()) {
  88.123 +            return 1;
  88.124 +        }
  88.125 +
  88.126 +        return 0;
  88.127 +    }
  88.128 +
  88.129 +    private static final String HTTP_RESPONSE_PATTERN_STRING =
  88.130 +            "^HTTP/1.1 ([1-5][0-9][0-9]) (.*)$";
  88.131 +    private static final Pattern HTTP_RESPONSE_PATTERN =
  88.132 +            Pattern.compile(HTTP_RESPONSE_PATTERN_STRING);
  88.133 +
  88.134 +    public void sendShutdownMessage(String userName,
  88.135 +            String password) throws Exception {
  88.136 +        String authorization = null;
  88.137 +        if(userName != null) {
  88.138 +            StringBuilder sbUserNamePassword =
  88.139 +                    new StringBuilder();
  88.140 +            sbUserNamePassword.append(userName);
  88.141 +            sbUserNamePassword.append(':');
  88.142 +            sbUserNamePassword.append(password);
  88.143 +
  88.144 +            ByteBuffer passwordByteBuf =
  88.145 +                    Charset.forName("ISO-8859-1").encode(
  88.146 +                    CharBuffer.wrap(sbUserNamePassword));
  88.147 +
  88.148 +            authorization = "Basic " +
  88.149 +                    Base64Routines.base64Encode(passwordByteBuf);
  88.150 +        }
  88.151 +
  88.152 +        int serverPort;
  88.153 +        try {
  88.154 +            String portStr = psconfig.getPort();
  88.155 +
  88.156 +            if(portStr == null ||
  88.157 +                    (portStr = portStr.trim()).length() < 1) {
  88.158 +                serverPort = 80;
  88.159 +            } else {
  88.160 +                serverPort = Integer.parseInt(portStr);
  88.161 +
  88.162 +                if(serverPort < 0) {
  88.163 +                    serverPort = 80;
  88.164 +                }
  88.165 +            }
  88.166 +        } catch(NumberFormatException e) {
  88.167 +            serverPort = 80;
  88.168 +        }
  88.169 +
  88.170 +        SocketChannel socketChannel =
  88.171 +                SocketChannel.open();
  88.172 +        try {
  88.173 +            socketChannel.configureBlocking(true);
  88.174 +
  88.175 +            Socket socket = socketChannel.socket();
  88.176 +
  88.177 +            socket.connect(new InetSocketAddress("localhost", serverPort),
  88.178 +                    20000);
  88.179 +            socket.setSoTimeout(20000);
  88.180 +
  88.181 +            Writer socketWriter =
  88.182 +                    Channels.newWriter(socketChannel, "ISO-8859-1");
  88.183 +
  88.184 +            socketWriter.write("POST " + JBOSS_SHUTDOWN_URL +
  88.185 +                    " HTTP/1.1\r\n");
  88.186 +            socketWriter.write("Host: localhost" +
  88.187 +                    ((serverPort != 80) ?
  88.188 +                        (":" + Integer.toString(serverPort)) : "") + "\r\n");
  88.189 +            socketWriter.write("Content-Type: application/x-www-form-urlencoded;charset=ISO-8859-1\r\n");
  88.190 +            socketWriter.write("Content-Length: " + JBOSS_SHUTDOWN_PARAMS.length() + "\r\n");
  88.191 +            if(authorization != null) {
  88.192 +                socketWriter.write("Authorization: " + authorization + "\r\n");
  88.193 +            }
  88.194 +            socketWriter.write("Connection: close\r\n");
  88.195 +            socketWriter.write("\r\n");
  88.196 +            socketWriter.write(JBOSS_SHUTDOWN_PARAMS);
  88.197 +
  88.198 +            socketWriter.flush();
  88.199 +
  88.200 +            BufferedReader socketReader =
  88.201 +                    new BufferedReader(
  88.202 +                    new InputStreamReader(socket.getInputStream()));
  88.203 +
  88.204 +            String statusLine = socketReader.readLine();
  88.205 +            Matcher statusLineMatcher;
  88.206 +            if(statusLine == null ||
  88.207 +                    !(statusLineMatcher =
  88.208 +                    HTTP_RESPONSE_PATTERN.matcher(statusLine)).matches() ||
  88.209 +                    statusLineMatcher.groupCount() < 2) {
  88.210 +                throw new JBShutdownException("A response was not returned by " +
  88.211 +                        "the HTTP server.");
  88.212 +            }
  88.213 +
  88.214 +            int statusCode;
  88.215 +            try {
  88.216 +                statusCode = Integer.parseInt(statusLineMatcher.group(1));
  88.217 +            } catch(NumberFormatException e) {
  88.218 +                statusCode = -1;
  88.219 +            }
  88.220 +
  88.221 +            if(statusCode == 200) {
  88.222 +                return;
  88.223 +            }
  88.224 +
  88.225 +            if(statusCode == 401) {
  88.226 +                if(userName != null) {
  88.227 +                    throw new JBShutdownException("An invalid username or " +
  88.228 +                            "password was specified.");
  88.229 +                }
  88.230 +
  88.231 +                String adminUser = psconfig.getAdminUser();
  88.232 +                String adminPassword = psconfig.getAdminPassWord();
  88.233 +
  88.234 +                if(adminUser != null &&
  88.235 +                        (adminUser = adminUser.trim()).length() > 1) {
  88.236 +                    if(adminPassword == null) {
  88.237 +                        adminPassword = "";
  88.238 +                    }
  88.239 +
  88.240 +                    sendShutdownMessage(adminUser, adminPassword);
  88.241 +                    return;
  88.242 +                }
  88.243 +            }
  88.244 +
  88.245 +            throw new JBShutdownException("An response other than a 200 OK " +
  88.246 +                    "response was returned by the HTTP server.");
  88.247 +        } finally {
  88.248 +            socketChannel.close();
  88.249 +        }
  88.250 +    }
  88.251 +
  88.252 +    @Override
  88.253 +    public void doStartDebug(String[] env) throws Exception {
  88.254 +        startJBossServer(env,true);
  88.255 +    }
  88.256 +
  88.257 +    @Override
  88.258 +    public void doStopDebug(String[] env) throws Exception {
  88.259 +        doStopServer(env);
  88.260 +    }
  88.261 +
  88.262 +    public int startJBossServer(String[] env, boolean debug) throws Exception {
  88.263 +        final String serverName = psconfig.getProperty(JBConstant.SERVER);
  88.264 +        final String jbossRootLocation = psconfig.getProperty(JBConstant.ROOT_DIR);
  88.265 +        final String javaHome = psconfig.getProperty(JBConstant.JAVA_HOME);
  88.266 +        File jbossRoot = (new File(jbossRootLocation)).getAbsoluteFile();
  88.267 +        File jbossBin = new File(jbossRoot, "bin");
  88.268 +
  88.269 +        String runScript =
  88.270 +                (Utilities.isWindows()) ? RUN_BAT : RUN_SH;
  88.271 +
  88.272 +        File runScriptFile = new File(jbossBin, runScript);
  88.273 +
  88.274 +        if(!runScriptFile.isFile()) {
  88.275 +            throw new Exception("The " + runScript + " script file must exist " +
  88.276 +                    "in the JBoss bin directory.");
  88.277 +        }
  88.278 +
  88.279 +        StringBuilder sbArguments = new StringBuilder();
  88.280 +        if("all".equals(serverName)) {
  88.281 +            sbArguments.append("-b 127.0.0.1 ");
  88.282 +        }
  88.283 +        sbArguments.append("-c ").append(serverName);
  88.284 +
  88.285 +		StringBuilder sbJavaOpts = new StringBuilder();
  88.286 +
  88.287 +		if (env != null) {
  88.288 +			for(String e:env) {
  88.289 +				if(e.startsWith("JAVA_OPTS=")) {
  88.290 +					sbJavaOpts.append(e.replace("\"", ""));
  88.291 +					sbJavaOpts.append(" ");
  88.292 +				}
  88.293 +			}
  88.294 +		}
  88.295 +
  88.296 +		if(sbJavaOpts.length() == 0)
  88.297 +			sbJavaOpts.append("JAVA_OPTS=");
  88.298 +
  88.299 +        if(debug) {
  88.300 +            sbJavaOpts.append("-Xdebug -Xrunjdwp:transport=dt_socket,address=" +
  88.301 +                    Integer.toString(getDebugPort()) + ",server=y,suspend=n");
  88.302 +        }
  88.303 +
  88.304 +		System.out.println("************* " + sbJavaOpts.toString());
  88.305 +
  88.306 +        NbProcessDescriptor nbProcessDescriptor =
  88.307 +                new NbProcessDescriptor(runScriptFile.getAbsolutePath(),
  88.308 +                sbArguments.toString().trim());
  88.309 +
  88.310 +        Process process = nbProcessDescriptor.exec(null,
  88.311 +                new String[] { sbJavaOpts.toString(),
  88.312 +                ("JAVA_HOME=" + javaHome),
  88.313 +                "JAVA="},
  88.314 +                true, jbossBin);
  88.315 +
  88.316 +        LogManager manager = new LogManager(dm);
  88.317 +        manager.openServerLog(process, nbProcessDescriptor.getProcessName());
  88.318 +
  88.319 +        if(hasStartCommandSucceeded(process)) {
  88.320 +            return 1;
  88.321 +        }
  88.322 +
  88.323 +        return 0;
  88.324 +    }
  88.325 +
  88.326 +    public static final int DEFAULT_DEBUG_PORT = 8787;
  88.327 +
  88.328 +    @Override
  88.329 +    public int getDebugPort() {
  88.330 +        try {
  88.331 +            int debugPort =
  88.332 +                    Integer.parseInt(psconfig.getProperty(JBConstant.DEBUG_PORT));
  88.333 +            return debugPort;
  88.334 +        } catch(NumberFormatException e) {
  88.335 +        }
  88.336 +        return DEFAULT_DEBUG_PORT;
  88.337 +    }
  88.338 +
  88.339 +    @Override
  88.340 +    public FindJSPServlet getFindJSPServlet(PSDeploymentManager dm) {
  88.341 +        return new JBFindJSPServlet(dm);
  88.342 +    }
  88.343 +
  88.344 +    /**
  88.345 +     * Try to get response from the server, whether the START/STOP command has
  88.346 +     * succeeded.
  88.347 +     *
  88.348 +     * @return <code>true</code> if START/STOP command completion was verified,
  88.349 +     *         <code>false</code> if time-out ran out.
  88.350 +     */
  88.351 +    private boolean hasStartCommandSucceeded(Process p) {
  88.352 +        ///long timeout = System.currentTimeMillis() + TIMEOUT_DELAY;
  88.353 +        while (true) {
  88.354 +            boolean isRunning = isRunning(p, (int) TIMEOUT_DELAY, true);
  88.355 +
  88.356 +            if (isRunning) {
  88.357 +                return true;
  88.358 +            }
  88.359 +        }
  88.360 +    }
  88.361 +
  88.362 +    private boolean hasStopCommandSucceeded() {
  88.363 +        while(true) {
  88.364 +            if(isStopped((int)TIMEOUT_DELAY)) {
  88.365 +                return true;
  88.366 +            }
  88.367 +
  88.368 +            // give server a few secs to finish its shutdown, not responding
  88.369 +            // does not necessarily mean its is still not running
  88.370 +            try {
  88.371 +                Thread.sleep(2000);
  88.372 +            } catch (InterruptedException ie) {
  88.373 +            }
  88.374 +        }
  88.375 +    }
  88.376 +
  88.377 +    private boolean isStopped(int timeout) {
  88.378 +        return !isReallyRunning(timeout);
  88.379 +    }
  88.380 +
  88.381 +    public boolean isRunning(Process proc, int timeout, boolean checkResponse) {
  88.382 +        ////Process proc = getTomcatProcess();
  88.383 +        if (proc != null) {
  88.384 +            try {
  88.385 +                // process is stopped
  88.386 +                proc.exitValue();
  88.387 +                return false;
  88.388 +            } catch (IllegalThreadStateException e) {
  88.389 +                // process is running
  88.390 +                if (!checkResponse) {
  88.391 +                    return true;
  88.392 +                }
  88.393 +            }
  88.394 +        }
  88.395 +        if (checkResponse) {
  88.396 +            return isReallyRunning(timeout);
  88.397 +        } else {
  88.398 +            return false; // cannot resolve the state
  88.399 +
  88.400 +        }
  88.401 +    }
  88.402 +
  88.403 +    public boolean isReallyRunning(int timeout) {
  88.404 +        return safeTrueTest(new IsRunningSafeTrueTest(), timeout);
  88.405 +    }
  88.406 +
  88.407 +    private class IsRunningSafeTrueTest extends SafeTrueTest {
  88.408 +        @Override
  88.409 +        public void run() {
  88.410 +            int serverPort;
  88.411 +            try {
  88.412 +                String portStr = psconfig.getPort();
  88.413 +
  88.414 +                if(portStr == null ||
  88.415 +                        (portStr = portStr.trim()).length() < 1) {
  88.416 +                    serverPort = 80;
  88.417 +                } else {
  88.418 +                    serverPort = Integer.parseInt(portStr);
  88.419 +
  88.420 +                    if(serverPort < 0) {
  88.421 +                        serverPort = 80;
  88.422 +                    }
  88.423 +                }
  88.424 +            } catch(NumberFormatException e) {
  88.425 +                serverPort = 80;
  88.426 +            }
  88.427 +
  88.428 +            result = pingJBoss(serverPort, 20000);
  88.429 +        }
  88.430 +    }
  88.431 +    public static boolean pingJBoss(int port, int timeout) {
  88.432 +        // checking whether a socket can be created is not reliable enough, see #47048
  88.433 +        SocketChannel socketChannel = null;
  88.434 +        try {
  88.435 +            try {
  88.436 +                socketChannel = SocketChannel.open();
  88.437 +                socketChannel.configureBlocking(true);
  88.438 +                
  88.439 +                Socket socket = socketChannel.socket();
  88.440 +
  88.441 +                socket.connect(new InetSocketAddress("localhost", port),
  88.442 +                        timeout); // NOI18N
  88.443 +
  88.444 +                socket.setSoTimeout(timeout);
  88.445 +                PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
  88.446 +                try {
  88.447 +                    BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
  88.448 +                    try {
  88.449 +                        // request
  88.450 +                        out.println("HEAD /netbeans-tomcat-status-test HTTP/1.1\r\n" +
  88.451 +                                "Host: localhost:" + port + "\r\n"); // NOI18N
  88.452 +
  88.453 +                        // response
  88.454 +                        String text = in.readLine();
  88.455 +                        if (text == null || !text.startsWith("HTTP/")) { // NOI18N
  88.456 +
  88.457 +                            return false; // not an http response
  88.458 +
  88.459 +                        }
  88.460 +                        Map headerFields = new HashMap();
  88.461 +                        while ((text = in.readLine()) != null && text.length() > 0) {
  88.462 +                            int colon = text.indexOf(':');
  88.463 +                            if (colon <= 0) {
  88.464 +                                return false; // not an http header
  88.465 +
  88.466 +                            }
  88.467 +                            String name = text.substring(0, colon).trim();
  88.468 +                            String value = text.substring(colon + 1).trim();
  88.469 +                            List list = (List) headerFields.get(name);
  88.470 +                            if (list == null) {
  88.471 +                                list = new ArrayList();
  88.472 +                                headerFields.put(name, list);
  88.473 +                            }
  88.474 +                            list.add(value);
  88.475 +                        }
  88.476 +                        List/*<String>*/ server = (List/*<String>*/) headerFields.get("Server"); // NIO18N
  88.477 +
  88.478 +                        if (server != null) {
  88.479 +                            if (server.contains("Apache-Coyote/1.1")) { // NOI18N
  88.480 +
  88.481 +                                List xPoweredBy = (List)headerFields.get("X-Powered-By");
  88.482 +                                if(xPoweredBy != null) {
  88.483 +                                    boolean poweredByJBoss = false;
  88.484 +
  88.485 +                                    for(Object o : xPoweredBy) {
  88.486 +                                        if(o == null) {
  88.487 +                                            continue;
  88.488 +                                        }
  88.489 +
  88.490 +                                        String s = o.toString();
  88.491 +                                        if(s == null) {
  88.492 +                                            continue;
  88.493 +                                        }
  88.494 +
  88.495 +                                        if(s.contains("JBoss")) {
  88.496 +                                            poweredByJBoss = true;
  88.497 +                                            break;
  88.498 +                                        }
  88.499 +                                    }
  88.500 +
  88.501 +                                    if(poweredByJBoss) {
  88.502 +                                        return true;
  88.503 +                                    }
  88.504 +                                } else {
  88.505 +                                    return true;
  88.506 +                                }
  88.507 +                            }
  88.508 +                        }
  88.509 +                        return false;
  88.510 +                    } finally {
  88.511 +                        in.close();
  88.512 +                    }
  88.513 +                } finally {
  88.514 +                    out.close();
  88.515 +                }
  88.516 +            } finally {
  88.517 +                if(socketChannel != null) {
  88.518 +                    socketChannel.close();
  88.519 +                }
  88.520 +            }
  88.521 +        } catch (IOException ioe) {
  88.522 +            return false;
  88.523 +        }
  88.524 +    }
  88.525 +
  88.526 +    /** Safe true/false test useful. */
  88.527 +    private abstract static class SafeTrueTest implements Runnable {
  88.528 +        protected boolean result = false;
  88.529 +
  88.530 +        public abstract void run();
  88.531 +
  88.532 +        public final boolean result() {
  88.533 +            return result;
  88.534 +        }
  88.535 +    };
  88.536 +
  88.537 +    /** Return the result of the test or false if the given time-out ran out. */
  88.538 +    private boolean safeTrueTest(SafeTrueTest test, int timeout) {
  88.539 +        try {
  88.540 +            new RequestProcessor().post(test).waitFinished(timeout);
  88.541 +        } catch (InterruptedException ie) {
  88.542 +            // no op
  88.543 +        }
  88.544 +        return test.result();
  88.545 +    }
  88.546 +}
    89.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/jboss/JBossJEELabraries.java	Sun Jun 26 10:25:14 2011 +0800
    89.3 @@ -0,0 +1,170 @@
    89.4 +/*
    89.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    89.6 + *
    89.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    89.8 + *
    89.9 + * The contents of this file are subject to the terms of either the GNU
   89.10 + * General Public License Version 2 only ("GPL") or the Common
   89.11 + * Development and Distribution License("CDDL") (collectively, the
   89.12 + * "License"). You may not use this file except in compliance with the
   89.13 + * License. You can obtain a copy of the License at
   89.14 + * http://www.netbeans.org/cddl-gplv2.html
   89.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   89.16 + * specific language governing permissions and limitations under the
   89.17 + * License.  When distributing the software, include this License Header
   89.18 + * Notice in each file and include the License file at
   89.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   89.20 + * particular file as subject to the "Classpath" exception as provided
   89.21 + * by Sun in the GPL Version 2 section of the License file that
   89.22 + * accompanied this code. If applicable, add the following below the
   89.23 + * License Header, with the fields enclosed by brackets [] replaced by
   89.24 + * your own identifying information:
   89.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   89.26 + *
   89.27 + * If you wish your version of this file to be governed by only the CDDL
   89.28 + * or only the GPL Version 2, indicate your decision by adding
   89.29 + * "[Contributor] elects to include this software in this distribution
   89.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   89.31 + * single choice of license, a recipient has the option to distribute
   89.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   89.33 + * to extend the choice of license to its licensees as provided above.
   89.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   89.35 + * Version 2 license, then the option applies only if the new code is
   89.36 + * made subject to such option by the copyright holder.
   89.37 + *
   89.38 + * Contributor(s):
   89.39 + * Satyaranjan
   89.40 + *
   89.41 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   89.42 + */
   89.43 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss;
   89.44 +
   89.45 +import java.io.File;
   89.46 +import java.util.ArrayList;
   89.47 +import java.util.List;
   89.48 +import org.netbeans.modules.portalpack.servers.core.WizardPropertyReader;
   89.49 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibraries;
   89.50 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
   89.51 +
   89.52 +/**
   89.53 + *
   89.54 + * @author satyaranjan
   89.55 + */
   89.56 +public class JBossJEELabraries implements JEEServerLibraries {
   89.57 +
   89.58 +	public List<File> getJEEServerLibraries(PSConfigObject psconfig) {
   89.59 +		List<File> jars = new ArrayList();
   89.60 +		String serverInstanceDir =
   89.61 +				psconfig.getProperty(JBConstant.SERVER_DIR);
   89.62 +
   89.63 +		String jbosswebSarDir =
   89.64 +				serverInstanceDir + File.separator + "deploy" + File.separator + "jbossweb.sar";
   89.65 +		String[] jbosswebLibs = {"jstl.jar",
   89.66 +			"jsf-libs" + File.separator + "jsf-api.jar"};
   89.67 +		for (int i = 0; i < jbosswebLibs.length; i++) {
   89.68 +			File libJar = new File(jbosswebSarDir +
   89.69 +					File.separator + jbosswebLibs[i]);
   89.70 +			if (libJar.exists()) {
   89.71 +				jars.add(libJar);
   89.72 +			}
   89.73 +		}
   89.74 +
   89.75 +		String jbossRootDir =
   89.76 +                    psconfig.getProperty(JBConstant.ROOT_DIR);
   89.77 +
   89.78 +            String commonLibDir =
   89.79 +                    jbossRootDir +
   89.80 +                    File.separator + "common" + File.separator + "lib";
   89.81 +            String[] commonLibs = {"jboss-javaee.jar", "servlet-api.jar",
   89.82 +            "jsp-api.jar", "el-api.jar", "mail.jar", "jboss-jsr77.jar",
   89.83 +            "ejb3-persistence.jar", "jbossws-native-jaxws.jar",
   89.84 +            "jbossws-native-jaxws-ext.jar", "jbossws-native-jaxrpc.jar",
   89.85 +            "jbossws-native-saaj.jar"};
   89.86 +            for(int i = 0; i < commonLibs.length; i++) {
   89.87 +                File libJar = new File(commonLibDir +
   89.88 +                        File.separator + commonLibs[i]);
   89.89 +                if (libJar.exists()) {
   89.90 +                    jars.add(libJar);
   89.91 +                }
   89.92 +            }
   89.93 +
   89.94 +			String endorsedLibDir =
   89.95 +                    jbossRootDir +
   89.96 +                    File.separator + "lib" + File.separator + "endorsed";
   89.97 +            String[] endorsedLibs = {"activation.jar", "jaxb-api.jar",
   89.98 +            "stax-api.jar"};
   89.99 +            for(int i = 0; i < endorsedLibs.length; i++) {
  89.100 +                File libJar = new File(endorsedLibDir +
  89.101 +                        File.separator + endorsedLibs[i]);
  89.102 +                if (libJar.exists()) {
  89.103 +                    jars.add(libJar);
  89.104 +                }
  89.105 +            }
  89.106 +
  89.107 +		return jars;
  89.108 +	}
  89.109 +
  89.110 +	public String getPortalServerLibraryLocation(WizardPropertyReader wr) {
  89.111 +		String serverInstanceDir =
  89.112 +                    wr.getProperty(JBConstant.SERVER_DIR);
  89.113 +		return _getPortalServerLibraryLocation(serverInstanceDir);
  89.114 +
  89.115 +	}
  89.116 +
  89.117 +	public String getPortalServerLibraryLocation(PSConfigObject pc) {
  89.118 +		String serverInstanceDir =
  89.119 +                    pc.getProperty(JBConstant.SERVER_DIR);
  89.120 +		return _getPortalServerLibraryLocation(serverInstanceDir);
  89.121 +	}
  89.122 +
  89.123 +	private String _getPortalServerLibraryLocation(String serverInstanceDir) {
  89.124 +		return serverInstanceDir + File.separator + "lib";
  89.125 +	}
  89.126 +
  89.127 +	public String getWebAppInstallDirectory(WizardPropertyReader wr) {
  89.128 +		String serverInstanceDir =
  89.129 +                    wr.getProperty(JBConstant.SERVER_DIR);
  89.130 +		return serverInstanceDir + File.separator + "deploy";
  89.131 +	}
  89.132 +
  89.133 +	public String getWebAppInstallDirectory(PSConfigObject pc) {
  89.134 +		String serverInstanceDir =
  89.135 +                    pc.getProperty(JBConstant.SERVER_DIR);
  89.136 +		return serverInstanceDir + File.separator + "deploy";
  89.137 +	}
  89.138 +
  89.139 +	public String getJEELibraryLocation(WizardPropertyReader wr) {
  89.140 +		String jbossRootDir =
  89.141 +                    wr.getProperty(JBConstant.ROOT_DIR);
  89.142 +		return _getJEELibraryLocation(jbossRootDir);
  89.143 +	}
  89.144 +
  89.145 +	public String getJEELibraryLocation(PSConfigObject pc) {
  89.146 +		String jbossRootDir =
  89.147 +                    pc.getProperty(JBConstant.ROOT_DIR);
  89.148 +		return _getJEELibraryLocation(jbossRootDir);
  89.149 +	}
  89.150 +
  89.151 +	private String _getJEELibraryLocation(String jbossRootDir) {
  89.152 +            String commonLibDir =
  89.153 +                    jbossRootDir +
  89.154 +                    File.separator + "common" + File.separator + "lib";
  89.155 +			return commonLibDir;
  89.156 +	}
  89.157 +
  89.158 +	public String getAppServerLibraryLocation(WizardPropertyReader wr) {
  89.159 +		return getJEELibraryLocation(wr);
  89.160 +	}
  89.161 +
  89.162 +	public String getAppServerLibraryLocation(PSConfigObject pc) {
  89.163 +		return getJEELibraryLocation(pc);
  89.164 +	}
  89.165 +
  89.166 +    public boolean isToolSupported(String toolName, PSConfigObject psconfig) {
  89.167 +        return false;
  89.168 +    }
  89.169 +
  89.170 +    public File[] getToolClasspathEntries(String toolName, PSConfigObject psconfig) {
  89.171 +        return new File[0];
  89.172 +    }
  89.173 +}
    90.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
    90.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
    90.3 @@ -49,4 +49,9 @@
    90.4  LBL_ChooserName=Choose Directory
    90.5  
    90.6  MSG_DEPLOY_ON_GLASSFISH_FAILED=Deployment on Glassfish failed
    90.7 -MSG_UNDEPLOY_ON_GLASSFISH_FAILED=UnDeployment on Glassfish failed
    90.8 \ No newline at end of file
    90.9 +MSG_UNDEPLOY_ON_GLASSFISH_FAILED=UnDeployment on Glassfish failed
   90.10 +
   90.11 +#MasterPasswordInputDialog dialog
   90.12 +MasterPasswordInputDialog_title=Enter Master Password
   90.13 +MasterPasswordInputDialog_longtext=Your domain's master password is unsaved. Please enter the master password to start this domain.\n\nTo save the master password in the domain, use the asadmin command change-master-password with the --savemasterpassword\=true option.
   90.14 +MasterPasswordInputDialog_text=&Master Password\: 
   90.15 \ No newline at end of file
    91.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/GlassFishJMXHandler.java	Sun Jun 26 10:25:14 2011 +0800
    91.3 @@ -0,0 +1,346 @@
    91.4 +/*
    91.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    91.6 + *
    91.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    91.8 + *
    91.9 + * The contents of this file are subject to the terms of either the GNU
   91.10 + * General Public License Version 2 only ("GPL") or the Common
   91.11 + * Development and Distribution License("CDDL") (collectively, the
   91.12 + * "License"). You may not use this file except in compliance with the
   91.13 + * License. You can obtain a copy of the License at
   91.14 + * http://www.netbeans.org/cddl-gplv2.html
   91.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   91.16 + * specific language governing permissions and limitations under the
   91.17 + * License.  When distributing the software, include this License Header
   91.18 + * Notice in each file and include the License file at
   91.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   91.20 + * particular file as subject to the "Classpath" exception as provided
   91.21 + * by Sun in the GPL Version 2 section of the License file that
   91.22 + * accompanied this code. If applicable, add the following below the
   91.23 + * License Header, with the fields enclosed by brackets [] replaced by
   91.24 + * your own identifying information:
   91.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   91.26 + *
   91.27 + * If you wish your version of this file to be governed by only the CDDL
   91.28 + * or only the GPL Version 2, indicate your decision by adding
   91.29 + * "[Contributor] elects to include this software in this distribution
   91.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   91.31 + * single choice of license, a recipient has the option to distribute
   91.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   91.33 + * to extend the choice of license to its licensees as provided above.
   91.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   91.35 + * Version 2 license, then the option applies only if the new code is
   91.36 + * made subject to such option by the copyright holder.
   91.37 + *
   91.38 + * Contributor(s):
   91.39 + *
   91.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   91.41 + */
   91.42 +
   91.43 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver;
   91.44 +
   91.45 +import java.io.File;
   91.46 +import java.io.ObjectInputStream;
   91.47 +import java.io.ObjectOutputStream;
   91.48 +import java.net.URL;
   91.49 +import java.net.URLConnection;
   91.50 +import java.util.HashMap;
   91.51 +import java.util.Map;
   91.52 +import javax.enterprise.deploy.spi.TargetModuleID;
   91.53 +import javax.management.MBeanServerConnection;
   91.54 +import javax.management.ObjectName;
   91.55 +import javax.management.remote.JMXConnector;
   91.56 +import javax.management.remote.JMXConnectorFactory;
   91.57 +import javax.management.remote.JMXServiceURL;
   91.58 +
   91.59 +
   91.60 +/**
   91.61 + * Small Util to reload/restart a WebModule using JMX.
   91.62 + *
   91.63 + * @author Jeanfrancois Arcand
   91.64 + */
   91.65 +public class GlassFishJMXHandler{
   91.66 +
   91.67 +
   91.68 +    protected final static String webModuleMBeanName = "com.sun.appserv:"
   91.69 +             + "J2EEApplication=null,J2EEServer=server,"
   91.70 +             + "j2eeType=WebModule,name=//server";
   91.71 +
   91.72 +    private final static String serverMBeanName = "com.sun.appserv:type=domain,category=config";
   91.73 +
   91.74 +    private  URLConnection conn = null;
   91.75 +    private  URL url;
   91.76 +    private  ObjectOutputStream objectWriter = null;
   91.77 +    private  ObjectInputStream objectReader = null;
   91.78 +    protected  String adminUser = null;
   91.79 +    protected  String adminPassword = null;
   91.80 +    protected  int adminPort = 4848;
   91.81 +    //private  String contextRoot= "";
   91.82 +    protected  String host = "localhost";
   91.83 +
   91.84 +//    public static void main(String args[]) throws Exception{
   91.85 +//        try{
   91.86 +//            String command = args[0];
   91.87 +//            host = args[1];
   91.88 +//            contextRoot = "/" + args[2];
   91.89 +//            adminUser = args[3];
   91.90 +//            adminPassword = args[4];
   91.91 +//            adminPort = Integer.parseInt(args[5]);
   91.92 +//
   91.93 +//            if ( command.equals("--restart")){
   91.94 +//                restart(mBeanName + contextRoot);
   91.95 +//            } else if (command.equals("--reload")){
   91.96 +//                reload(mBeanName + contextRoot);
   91.97 +//            }
   91.98 +//            System.out.println("DEPLOYMENT SUCCESS");
   91.99 +//        } catch(Throwable ex){
  91.100 +//            System.out.println("Usage\n");
  91.101 +//            System.out.println("jmxReload --reload|restart");
  91.102 +//            System.out.print(" [contextRoot]");
  91.103 +//            ex.printStackTrace();
  91.104 +//            System.out.println("DEPLOYMENT FAILED");
  91.105 +//        }
  91.106 +//    }
  91.107 +
  91.108 + public GlassFishJMXHandler(String host, String adminUser,
  91.109 +                            String password, int adminPort){
  91.110 +
  91.111 +
  91.112 +            this.host = host;
  91.113 +            this.adminUser = adminUser;
  91.114 +            this.adminPassword = password;
  91.115 +            this.adminPort = adminPort;
  91.116 +
  91.117 +    }
  91.118 +
  91.119 +
  91.120 +
  91.121 +    public void restart(String contextRoot) throws Throwable{
  91.122 +        contextRoot = "/" + contextRoot;
  91.123 +        String oName = webModuleMBeanName + contextRoot;
  91.124 +        ObjectName appMBean = new ObjectName(oName);
  91.125 +
  91.126 +        try {
  91.127 +            restartHttp(appMBean);
  91.128 +        } catch (Throwable t){
  91.129 +            restartHttps(appMBean);
  91.130 +        }
  91.131 +        System.out.println("RESTART Successful : "+contextRoot);
  91.132 +    }
  91.133 +
  91.134 +
  91.135 +    public void reload(String contextRoot) throws Throwable{
  91.136 +        contextRoot = "/" + contextRoot;
  91.137 +        String oName = webModuleMBeanName + contextRoot;
  91.138 +        ObjectName appMBean = new ObjectName(oName);
  91.139 +
  91.140 +        try {
  91.141 +            reloadHttp(appMBean);
  91.142 +        } catch (Throwable t){
  91.143 +            t.printStackTrace();
  91.144 +            reloadHttps(appMBean);
  91.145 +        }
  91.146 +        System.out.println("RELOAD Successful : "+contextRoot);
  91.147 +     }
  91.148 +
  91.149 +     public Object getConfigDirectory() throws Throwable{
  91.150 +        String oName = serverMBeanName;
  91.151 +        ObjectName appMBean = new ObjectName(oName);
  91.152 +        try{
  91.153 +            return getConfigDirectoryHttp(appMBean);
  91.154 +        }catch (Throwable t) {
  91.155 +            t.printStackTrace();
  91.156 +            return getConfigDirectoryHttps(appMBean);
  91.157 +        }
  91.158 +     }
  91.159 +
  91.160 +     public File getModuleDirectory(TargetModuleID module ) throws Throwable{
  91.161 +         String mid = module.getModuleID();
  91.162 +         if(mid == null || mid.trim().length() == 0)
  91.163 +             return null;
  91.164 +         ObjectName aaaa = new ObjectName("com.sun.appserv:type=web-module,name="+mid+",category=config");
  91.165 +         try{
  91.166 +             return getModuleDirectoryHttp(aaaa);
  91.167 +         } catch(Throwable t) {
  91.168 +             t.printStackTrace();
  91.169 +             return getModuleDirectoryHttps(aaaa);
  91.170 +         }
  91.171 +     }
  91.172 +
  91.173 +    /**
  91.174 +     * Reload the Context using JMX and HTTP.
  91.175 +     */
  91.176 +    private void reloadHttp(ObjectName appMBean) throws Throwable {
  91.177 +
  91.178 +        Object[] params = new Object[0];
  91.179 +        String[] signature = new String[0];
  91.180 +       // System.out.println("Reload Context: " + contextRoot);
  91.181 +
  91.182 +        Object o= getMBeanServerConnection().
  91.183 +            invoke(appMBean, "reload", params, signature);
  91.184 +    }
  91.185 +
  91.186 +
  91.187 +    /**
  91.188 +     * Reload the Context using JMX and HTTP.
  91.189 +     */
  91.190 +    private void restartHttp(ObjectName appMBean) throws Throwable {
  91.191 +        Object[] params = new Object[0];
  91.192 +        String[] signature = new String[0];
  91.193 +       // System.out.println("Stopping Context: " + contextRoot);
  91.194 +
  91.195 +        Object o= getMBeanServerConnection().
  91.196 +            invoke(appMBean, "stop", params, signature);
  91.197 +
  91.198 +        //System.out.println("Starting Context: " + contextRoot);
  91.199 +
  91.200 +        o= getMBeanServerConnection()
  91.201 +            .invoke(appMBean, "start", params, signature);
  91.202 +    }
  91.203 +
  91.204 +    private Object getConfigDirectoryHttp(ObjectName appMBean) throws Throwable {
  91.205 +        Object[] params = new Object[0];
  91.206 +        String[] signature = new String[0];
  91.207 +       // System.out.println("Stopping Context: " + contextRoot);
  91.208 +
  91.209 +        Object o= getMBeanServerConnection().
  91.210 +            invoke(appMBean, "getConfigDir", params, signature);
  91.211 +        return o;
  91.212 +    }
  91.213 +
  91.214 +    private File getModuleDirectoryHttp(ObjectName appMBean) throws Throwable {
  91.215 +       File dirLocation =new java.io.File(""+getMBeanServerConnection().getAttribute(appMBean,"location"));
  91.216 +       return dirLocation;
  91.217 +    }
  91.218 +
  91.219 +
  91.220 +    /**
  91.221 +     * Local the MBeanServer.
  91.222 +     */
  91.223 +    private MBeanServerConnection getMBeanServerConnection()
  91.224 +                                                            throws Throwable{
  91.225 +        return getMBeanServerConnection(host,adminPort,adminUser,adminPassword);
  91.226 +    }
  91.227 +
  91.228 +
  91.229 +    /**
  91.230 +     * Get an Server Connection.
  91.231 +     */
  91.232 +    protected MBeanServerConnection getMBeanServerConnection
  91.233 +                                            (String host,
  91.234 +                                             int port,
  91.235 +                                             String user,
  91.236 +                                             String password) throws Throwable{
  91.237 +
  91.238 +        final JMXServiceURL url =
  91.239 +            new JMXServiceURL("service:jmx:s1ashttp://" + host + ":" + port);
  91.240 +        final Map env = new HashMap();
  91.241 +        final String PKGS = "com.sun.enterprise.admin.jmx.remote.protocol";
  91.242 +
  91.243 +        env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, PKGS);
  91.244 +        env.put(ADMIN_USER_ENV_PROPERTY_NAME, user );
  91.245 +        env.put( ADMIN_PASSWORD_ENV_PROPERTY_NAME, password);
  91.246 +        env.put(HTTP_AUTH_PROPERTY_NAME, DEFAULT_HTTP_AUTH_SCHEME);
  91.247 +        final JMXConnector conn = JMXConnectorFactory.connect(url, env);
  91.248 +        return conn.getMBeanServerConnection();
  91.249 +    }
  91.250 +
  91.251 +
  91.252 +    /**
  91.253 +     * Reload the Context using JMX and HTTPs
  91.254 +     */
  91.255 +    private void reloadHttps(ObjectName appMBean) throws Throwable {
  91.256 +        Object[] params = new Object[0];
  91.257 +        String[] signature = new String[0];
  91.258 +       // System.out.println("Reloading Context: " + contextRoot);
  91.259 +
  91.260 +        Object o= getSecureMBeanServerConnection()
  91.261 +                    .invoke(appMBean, "reload", params, signature);
  91.262 +
  91.263 +    }
  91.264 +
  91.265 +
  91.266 +    /**
  91.267 +     * Reload the Context using JMX and HTTPs
  91.268 +     */
  91.269 +    private void restartHttps(ObjectName appMBean) throws Throwable {
  91.270 +        Object[] params = new Object[0];
  91.271 +        String[] signature = new String[0];
  91.272 +       // System.out.println("Stopping Context: " + contextRoot);
  91.273 +
  91.274 +        Object o= getSecureMBeanServerConnection()
  91.275 +                    .invoke(appMBean, "stop", params, signature);
  91.276 +
  91.277 +       // System.out.println("Starting Context: " + contextRoot);
  91.278 +
  91.279 +        o= getSecureMBeanServerConnection().invoke(
  91.280 +            appMBean, "start", params, signature);
  91.281 +    }
  91.282 +
  91.283 +    private Object getConfigDirectoryHttps(ObjectName appMBean) throws Throwable {
  91.284 +        Object[] params = new Object[0];
  91.285 +        String[] signature = new String[0];
  91.286 +       // System.out.println("Stopping Context: " + contextRoot);
  91.287 +
  91.288 +        Object o= getSecureMBeanServerConnection().
  91.289 +            invoke(appMBean, "getConfigDir", params, signature);
  91.290 +        return o;
  91.291 +    }
  91.292 +
  91.293 +    private File getModuleDirectoryHttps(ObjectName appMBean) throws Throwable {
  91.294 +       File dirLocation =new java.io.File(""+getSecureMBeanServerConnection().getAttribute(appMBean,"location"));
  91.295 +       return dirLocation;
  91.296 +    }
  91.297 +
  91.298 +    /**
  91.299 +     * Get a secure JMX connection.
  91.300 +     */
  91.301 +    private MBeanServerConnection getSecureMBeanServerConnection()
  91.302 +                                                            throws Throwable{
  91.303 +       return getSecureMBeanServerConnection(host,adminPort,adminUser,
  91.304 +                adminPassword);
  91.305 +    }
  91.306 +
  91.307 +
  91.308 +    /**
  91.309 +     * Get a secure JMX connection.
  91.310 +     */
  91.311 +    protected MBeanServerConnection
  91.312 +        getSecureMBeanServerConnection(String host,
  91.313 +                                       int port,
  91.314 +                                       String user,
  91.315 +                                       String password) throws Throwable{
  91.316 +
  91.317 +        final JMXServiceURL url = new JMXServiceURL("service:jmx:s1ashttps://" +
  91.318 +                                  host + ":" + port);
  91.319 +        final Map env = new HashMap();
  91.320 +        final String PKGS = "com.sun.enterprise.admin.jmx.remote.protocol";
  91.321 +
  91.322 +        env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, PKGS);
  91.323 +        env.put(ADMIN_USER_ENV_PROPERTY_NAME, user );
  91.324 +        env.put( ADMIN_PASSWORD_ENV_PROPERTY_NAME, password);
  91.325 +        env.put(HTTP_AUTH_PROPERTY_NAME, DIGEST_HTTP_AUTH_SCHEME);
  91.326 +        final JMXConnector conn = JMXConnectorFactory.connect(url, env);
  91.327 +        return conn.getMBeanServerConnection();
  91.328 +    }
  91.329 +
  91.330 +// --------------------------------------------------------------- AMX related
  91.331 +
  91.332 +
  91.333 +    public static final String ADMIN_USER_ENV_PROPERTY_NAME = "USER";
  91.334 +    public static final String ADMIN_PASSWORD_ENV_PROPERTY_NAME = "PASSWORD";
  91.335 +    public static final String TRUST_MANAGER_PROPERTY_NAME = "TRUST_MANAGER_KEY";
  91.336 +    public static final String KEY_MANAGER_PROPERTY_NAME= "KEYMANAGER_KEY";
  91.337 +    public static final String SSL_SOCKET_FACTORY = "SSL_SOCKET_FACTORY";
  91.338 +    public static final String HOSTNAME_VERIFIER_PROPERTY_NAME = "HOSTNAME_VERIFIER_KEY";
  91.339 +    public static final String STRING_MANAGER_CLASS_NAME = "STRING_MANAGER_CLASS_KEY";
  91.340 +    public static final String DEFAULT_TRUST_MANAGER  = "com.sun.enterprise.security.trustmanager.SunOneBasicX509TrustManager";
  91.341 +    public static final String SERVLET_CONTEXT_PROPERTY_NAME = "com.sun.enterprise.as.context.root";
  91.342 +    public static final String HTTP_AUTH_PROPERTY_NAME = "com.sun.enterprise.as.http.auth";
  91.343 +    public static final String DEFAULT_SERVLET_CONTEXT_ROOT = "/web1/remotejmx"; /* This is to be in sync with the web.xml */
  91.344 +    public static final String DEFAULT_HTTP_AUTH_SCHEME = "BASIC";
  91.345 +    public static final String DIGEST_HTTP_AUTH_SCHEME = "Digest";
  91.346 +
  91.347 +    public static final String S1_HTTP_PROTOCOL = "s1ashttp";
  91.348 +    public static final String S1_HTTPS_PROTOCOL = "s1ashttps";
  91.349 +}
    92.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/GlassFishServerDeployHandler.java	Fri Jun 10 09:46:37 2011 +0200
    92.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/GlassFishServerDeployHandler.java	Sun Jun 26 10:25:14 2011 +0800
    92.3 @@ -23,11 +23,18 @@
    92.4  import java.io.FileNotFoundException;
    92.5  import java.io.FileOutputStream;
    92.6  import java.io.IOException;
    92.7 +import java.lang.reflect.Constructor;
    92.8 +import java.lang.reflect.Method;
    92.9 +import java.util.ArrayList;
   92.10 +import java.util.List;
   92.11  import java.util.Properties;
   92.12  import java.util.logging.Level;
   92.13  import java.util.logging.Logger;
   92.14 +import javax.enterprise.deploy.spi.Target;
   92.15 +import javax.enterprise.deploy.spi.TargetModuleID;
   92.16  import org.netbeans.modules.j2ee.deployment.plugins.api.UISupport;
   92.17  import org.netbeans.modules.portalpack.servers.core.JSR88DeploymentHandler;
   92.18 +import org.netbeans.modules.portalpack.servers.core.PSModuleID;
   92.19  import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
   92.20  import org.netbeans.modules.portalpack.servers.core.common.DeploymentException;
   92.21  import org.netbeans.modules.portalpack.servers.core.common.ExtendedClassLoader;
   92.22 @@ -48,6 +55,10 @@
   92.23      private PSDeploymentManager dm;
   92.24      private String uri;
   92.25      private ExtendedClassLoader loader;
   92.26 +    private ExtendedClassLoader jmxLoader;
   92.27 +    private boolean isSecure;
   92.28 +    private boolean secureCheckDone;
   92.29 +    
   92.30      /**
   92.31       * Creates a new instance of SunAppServerDeployHandler
   92.32       */
   92.33 @@ -74,28 +85,57 @@
   92.34              fout.flush();
   92.35              fout.close();
   92.36          }
   92.37 -        
   92.38 +
   92.39 +        String gfVersion = getGlassFishVersion();
   92.40 +
   92.41          Command cmd = new Command();
   92.42          String ext = "";
   92.43           if (org.openide.util.Utilities.isWindows()){
   92.44              ext = ".bat";
   92.45          }
   92.46 -        cmd.add(psconfig.getServerHome() + File.separator + "bin" + File.separator + "asadmin" + ext);
   92.47 -        cmd.add("deploy");
   92.48 -        cmd.add("--precompilejsp=false");
   92.49 -        cmd.add("--port");
   92.50 -        cmd.add(psconfig.getAdminPort());
   92.51 -        cmd.add("-u");
   92.52 -        cmd.add(psconfig.getProperty(SunAppServerConstants.SERVER_USER));
   92.53 -        cmd.add("--passwordfile");
   92.54 -        cmd.add(file.getAbsolutePath());
   92.55 -        if(contextroot != null) {
   92.56 -            cmd.add("--contextroot");
   92.57 -            cmd.add(contextroot);
   92.58 -            cmd.add("--name");
   92.59 -            cmd.add(contextroot);
   92.60 +
   92.61 +        if(SunAppServerConstants.GLASSFISH_V2.equals(gfVersion)) {
   92.62 +
   92.63 +            cmd.add(psconfig.getServerHome() + File.separator + "bin" + File.separator + "asadmin" + ext);
   92.64 +            cmd.add("deploy");
   92.65 +            cmd.add("--precompilejsp=false");
   92.66 +            cmd.add("--port");
   92.67 +            cmd.add(psconfig.getAdminPort());
   92.68 +            cmd.add("--user");
   92.69 +            cmd.add(psconfig.getProperty(SunAppServerConstants.SERVER_USER));
   92.70 +            cmd.add("--passwordfile");
   92.71 +            cmd.add(file.getAbsolutePath());
   92.72 +            if(contextroot != null) {
   92.73 +                cmd.add("--contextroot");
   92.74 +                cmd.add(contextroot);
   92.75 +                cmd.add("--name");
   92.76 +                cmd.add(contextroot);
   92.77 +            }
   92.78 +
   92.79 +            cmd.add("--force=true");
   92.80 +            cmd.add(warFile);
   92.81 +        } else if(SunAppServerConstants.GLASSFISH_V3.equals(gfVersion)){
   92.82 +            cmd.add(psconfig.getServerHome() + File.separator + "bin" + File.separator + "asadmin" + ext);
   92.83 +            
   92.84 +            cmd.add("--port");
   92.85 +            cmd.add(psconfig.getAdminPort());
   92.86 +            cmd.add("--user");
   92.87 +            cmd.add(psconfig.getProperty(SunAppServerConstants.SERVER_USER));
   92.88 +            cmd.add("--passwordfile");
   92.89 +            cmd.add(file.getAbsolutePath());
   92.90 +            cmd.add("deploy");
   92.91 +            cmd.add("--precompilejsp=false");
   92.92 +            if(contextroot != null) {
   92.93 +                cmd.add("--contextroot");
   92.94 +                cmd.add(contextroot);
   92.95 +                cmd.add("--name");
   92.96 +                cmd.add(contextroot);
   92.97 +            }
   92.98 +
   92.99 +            cmd.add("--force=true");
  92.100 +
  92.101 +            cmd.add(warFile);
  92.102          }
  92.103 -        cmd.add(warFile);
  92.104                  
  92.105          logger.info(cmd.toString());
  92.106          try {
  92.107 @@ -109,6 +149,56 @@
  92.108          logger.info("Password file: "+file.getAbsolutePath());
  92.109          
  92.110      }
  92.111 +
  92.112 +    private String getGlassFishVersion() {
  92.113 +        String gfVersion = psconfig.getProperty(SunAppServerConstants.GLASSFISH_VERSON);
  92.114 +        if (gfVersion == null || gfVersion.trim().length() == 0) {
  92.115 +            gfVersion = SunAppServerConstants.GLASSFISH_V2;
  92.116 +        }
  92.117 +        return gfVersion;
  92.118 +    }
  92.119 +
  92.120 +    private Properties getJSR88Properties() {
  92.121 +
  92.122 +        String gfVersion = getGlassFishVersion();
  92.123 +        Properties props = new Properties();
  92.124 +        if (isSecure) {
  92.125 +            props.put("jsr88.dm.id", "deployer:Sun:AppServer::" + psconfig.getHost() + ":" + psconfig.getAdminPort() + ":https");
  92.126 +        } else {
  92.127 +            props.put("jsr88.dm.id", "deployer:Sun:AppServer::" + psconfig.getHost() + ":" + psconfig.getAdminPort());
  92.128 +        }
  92.129 +        props.put("jsr88.dm.user", psconfig.getProperty(SunAppServerConstants.SERVER_USER));
  92.130 +        props.put("jsr88.dm.passwd", psconfig.getProperty(SunAppServerConstants.SERVER_PASSWORD));
  92.131 +        
  92.132 +        if (SunAppServerConstants.GLASSFISH_V2.equals(gfVersion)) {
  92.133 +            props.put("jsr88.df.classname", "com.sun.enterprise.deployapi.SunDeploymentFactory");
  92.134 +        } else {
  92.135 +            // for V3
  92.136 +            props.put("jsr88.df.classname", "org.glassfish.deployapi.SunDeploymentFactory");
  92.137 +        }
  92.138 +        return props;
  92.139 +    }
  92.140 +
  92.141 +    private String getJMXHandlerClassName(String gfVersion) {
  92.142 +
  92.143 +        if (SunAppServerConstants.GLASSFISH_V2.equals(gfVersion)) {
  92.144 +            return "org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver.GlassFishJMXHandler";
  92.145 +        } else if (SunAppServerConstants.GLASSFISH_V3.equals(gfVersion)) {
  92.146 +            return "org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver.GlassFishV3JMXHandler";
  92.147 +        } else
  92.148 +            return "org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver.GlassFishJMXHandler";
  92.149 +
  92.150 +    }
  92.151 +
  92.152 +    private String getJMXConnectorPort(String gfVersion) {
  92.153 +
  92.154 +        if (SunAppServerConstants.GLASSFISH_V2.equals(gfVersion)) {
  92.155 +            return psconfig.getAdminPort();
  92.156 +        } else if (SunAppServerConstants.GLASSFISH_V3.equals(gfVersion)) {
  92.157 +            return psconfig.getProperty(SunAppServerConstants.JMX_CONNECTOR_PORT);
  92.158 +        } else
  92.159 +            return psconfig.getProperty(SunAppServerConstants.JMX_CONNECTOR_PORT);   
  92.160 +    }
  92.161       
  92.162       
  92.163       private void unDeployFromGlassFish(String appName) throws Exception
  92.164 @@ -179,7 +269,8 @@
  92.165             if(gfVersion == null || gfVersion.trim().length() == 0)
  92.166                 gfVersion = SunAppServerConstants.GLASSFISH_V2;
  92.167             
  92.168 -           if(gfVersion.equals(SunAppServerConstants.GLASSFISH_V2)) {
  92.169 +           if(gfVersion.equals(SunAppServerConstants.GLASSFISH_V2)
  92.170 +                   || gfVersion.equals(SunAppServerConstants.GLASSFISH_V3)) {
  92.171                 
  92.172                 _deploy(warFile);
  92.173                 
  92.174 @@ -196,10 +287,22 @@
  92.175      }
  92.176  
  92.177      public boolean undeploy(String appName) throws Exception {
  92.178 +
  92.179 +        String gfVersion = psconfig.getProperty(SunAppServerConstants.GLASSFISH_VERSON);
  92.180 +        if(gfVersion == null || gfVersion.trim().length() == 0)
  92.181 +            gfVersion = SunAppServerConstants.GLASSFISH_V2;
  92.182 +
  92.183          try{
  92.184 -            //Uncomment the following line to undeploy using asadmin...
  92.185 -            //unDeployFromGlassFish(appName);
  92.186 -            _undeploy(appName);
  92.187 +           
  92.188 +            if(gfVersion.equals(SunAppServerConstants.GLASSFISH_V2)
  92.189 +                    || gfVersion.equals(SunAppServerConstants.GLASSFISH_V3)) {
  92.190 +                
  92.191 +                _undeploy(appName);
  92.192 +
  92.193 +            } else {
  92.194 +                unDeployFromGlassFish(appName);
  92.195 +            }
  92.196 +
  92.197          }catch(Exception e){
  92.198              logger.log(Level.SEVERE, "Error",e);
  92.199              throw e;
  92.200 @@ -219,15 +322,23 @@
  92.201      {
  92.202          _deploy(warFile,null);
  92.203      }
  92.204 -    
  92.205 +
  92.206 +    private void doSecureCheck() {
  92.207 +         if (secureCheckDone == false) {
  92.208 +            try{
  92.209 +                isSecure = PortDetector.isSecurePort(psconfig.getHost(), Integer.parseInt(psconfig.getAdminPort()));
  92.210 +                secureCheckDone = true;
  92.211 +
  92.212 +            } catch(Exception e){
  92.213 +            }
  92.214 +        }
  92.215 +
  92.216 +    }
  92.217      //context should be passed as null for war deployment.
  92.218      public void _deploy(String warFile, String context) throws DeploymentException
  92.219      {
  92.220 -        Properties props = new Properties();
  92.221 -        props.put("jsr88.dm.id","deployer:Sun:AppServer::" + psconfig.getHost() + ":" + psconfig.getAdminPort());
  92.222 -        props.put("jsr88.dm.user",psconfig.getAdminUser());
  92.223 -        props.put("jsr88.dm.passwd",psconfig.getProperty(SunAppServerConstants.SERVER_PASSWORD));
  92.224 -        props.put("jsr88.df.classname","com.sun.enterprise.deployapi.SunDeploymentFactory");
  92.225 +        doSecureCheck();
  92.226 +        Properties props = getJSR88Properties();
  92.227          
  92.228          ClassLoader ld = getServerClassLoader(new File(psconfig.getServerHome()));
  92.229           
  92.230 @@ -245,11 +356,8 @@
  92.231      
  92.232      public void _undeploy(String appName) throws DeploymentException
  92.233      {
  92.234 -        Properties props = new Properties();
  92.235 -        props.put("jsr88.dm.id","deployer:Sun:AppServer::" + psconfig.getHost() + ":" + psconfig.getAdminPort());
  92.236 -        props.put("jsr88.dm.user",psconfig.getAdminUser());
  92.237 -        props.put("jsr88.dm.passwd",psconfig.getProperty(SunAppServerConstants.SERVER_PASSWORD));
  92.238 -        props.put("jsr88.df.classname","com.sun.enterprise.deployapi.SunDeploymentFactory");
  92.239 +        doSecureCheck();
  92.240 +        Properties props = getJSR88Properties();
  92.241          
  92.242          ClassLoader ld = getServerClassLoader(new File(psconfig.getServerHome()));
  92.243           
  92.244 @@ -258,39 +366,167 @@
  92.245          deploymentHandler.undeployApp(appName);
  92.246          deploymentHandler.releaseDeploymentManager();
  92.247      }
  92.248 +
  92.249 +    public void restartJSR88(String appName) throws DeploymentException
  92.250 +    {
  92.251 +        doSecureCheck();
  92.252 +        Properties props = getJSR88Properties();
  92.253 +
  92.254 +        ClassLoader ld = getServerClassLoader(new File(psconfig.getServerHome()));
  92.255 +
  92.256 +        JSR88DeploymentHandler deploymentHandler = new JSR88DeploymentHandler(ld,props,UISupport.getServerIO(uri));
  92.257 +
  92.258 +        deploymentHandler.restart(appName);
  92.259 +        deploymentHandler.releaseDeploymentManager();
  92.260 +    }
  92.261 +
  92.262 +    public void restart(String appName) throws Exception{
  92.263 +        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
  92.264 +
  92.265 +        String gfVersion = getGlassFishVersion();
  92.266 +        try{
  92.267 +
  92.268 +            int adminPort = 4848;
  92.269 +            try {
  92.270 +                adminPort = Integer.parseInt(getJMXConnectorPort(gfVersion));
  92.271 +            } catch (Exception e) {
  92.272 +            }
  92.273 +            ClassLoader ld = getJMXClassLoader(new File(psconfig.getServerHome()));
  92.274 +            Thread.currentThread().setContextClassLoader(ld);
  92.275 +            
  92.276 +            Class clazz = ld.loadClass(getJMXHandlerClassName(gfVersion));
  92.277 +            Constructor con = clazz.getConstructor(String.class,String.class,String.class,int.class);
  92.278 +            Object instance = con.newInstance(psconfig.getHost(), psconfig.getAdminUser(), psconfig.getProperty(SunAppServerConstants.SERVER_PASSWORD), adminPort);
  92.279 +            //GlassFishJMXHandler jmxHandler = new GlassFishJMXHandler(psconfig.getHost(), psconfig.getAdminUser(), psconfig.getAdminPassWord(), adminPort);
  92.280 +            
  92.281 +            Method method = clazz.getMethod("reload", String.class);
  92.282 +            method.invoke(instance, appName);
  92.283 +
  92.284 +        }catch(Throwable ex){
  92.285 +            ex.printStackTrace();
  92.286 +        }finally {
  92.287 +            Thread.currentThread().setContextClassLoader(contextClassLoader);
  92.288 +        }
  92.289 +    }
  92.290 +
  92.291 +    public TargetModuleID[] getAvailableModules(Target[] target) {
  92.292 +
  92.293 +        try{
  92.294 +            
  92.295 +            doSecureCheck();
  92.296 +            Properties props = getJSR88Properties();
  92.297 +
  92.298 +
  92.299 +            ClassLoader ld = getServerClassLoader(new File(psconfig.getServerHome()));
  92.300 +
  92.301 +            JSR88DeploymentHandler deploymentHandler = new JSR88DeploymentHandler(ld,props,UISupport.getServerIO(uri));
  92.302 +
  92.303 +
  92.304 +            TargetModuleID[] tmids = deploymentHandler.getRunningModules();
  92.305 +
  92.306 +            List<TargetModuleID> list = new ArrayList();
  92.307 +            for(TargetModuleID tmid:tmids) {
  92.308 +                //PSModuleID psMid = new PSModuleID(tmid.getTarget(), tmid.getModuleID(), "");
  92.309 +                PSModuleID psMid = new PSModuleID(target[0], tmid.getModuleID(), "");
  92.310 +                list.add(psMid);
  92.311 +            }
  92.312 +            return (TargetModuleID[]) list.toArray(new TargetModuleID[0]);
  92.313 +
  92.314 +        }catch(Exception e) {
  92.315 +            logger.log(Level.SEVERE,"error",e);
  92.316 +            return new TargetModuleID[0];
  92.317 +        }
  92.318 +    }
  92.319      
  92.320 -    private static void updatePluginLoader(File platformLocation, ExtendedClassLoader loader) throws Exception{
  92.321 +    private  void updatePluginLoader(File platformLocation, ExtendedClassLoader loader) throws Exception{
  92.322          try {
  92.323              java.io.File f = platformLocation;
  92.324              if (null == f || !f.exists()){
  92.325                  return;
  92.326              }
  92.327 -            String installRoot = f.getAbsolutePath();
  92.328 -            f = new File(installRoot+"/lib/appserv-admin.jar");//NOI18N
  92.329 -	    loader.addURL(f);
  92.330 -	    f = new File(installRoot+"/lib/appserv-ext.jar");//NOI18N
  92.331 -	    loader.addURL(f);
  92.332 -	    f = new File(installRoot+"/lib/appserv-rt.jar");//NOI18N
  92.333 -	    loader.addURL(f);
  92.334 -	    f = new File(installRoot+"/lib/appserv-cmp.jar");//NOI18N
  92.335 -	    loader.addURL(f);
  92.336 -	    f = new File(installRoot+"/lib/commons-logging.jar");//NOI18N
  92.337 -	    loader.addURL(f);
  92.338 -	    f = new File(installRoot+"/lib/admin-cli.jar");//NOI18N
  92.339 -	    loader.addURL(f);
  92.340 -	    f = new File(installRoot+"/lib/common-laucher.jar");//NOI18N
  92.341 -	    loader.addURL(f);
  92.342 -	    f = new File(installRoot+"/lib/j2ee.jar");//NOI18N
  92.343 -	    loader.addURL(f);
  92.344 -	    f = new File(installRoot+"/lib/install/applications/jmsra/imqjmsra.jar");//NOI18N
  92.345 -	    loader.addURL(f);
  92.346 +
  92.347 +            String gfVersion = getGlassFishVersion();
  92.348 +            if(SunAppServerConstants.GLASSFISH_V3.equals(gfVersion)) {
  92.349 +
  92.350 +                String installRoot = f.getAbsolutePath();
  92.351 +                f = new File(installRoot+"/modules/deployment-client.jar");//NOI18N
  92.352 +                loader.addURL(f);
  92.353 +                f = new File(installRoot+"/modules/javax.enterprise.deploy.jar");//NOI18N
  92.354 +                loader.addURL(f);
  92.355 +                f = new File(installRoot+"/modules/common-util.jar");//NOI18N
  92.356 +                loader.addURL(f);
  92.357 +                f = new File(installRoot+"/modules/deployment-common.jar");//NOI18N
  92.358 +                loader.addURL(f);
  92.359 +                f = new File(installRoot+"/modules/deployment-javaee-core.jar");//NOI18N
  92.360 +                loader.addURL(f);
  92.361 +                f = new File(installRoot+"/modules/admin-cli.jar");//NOI18N
  92.362 +                loader.addURL(f);
  92.363 +                f = new File(installRoot+"/modules/admin-core.jar");//NOI18N
  92.364 +                loader.addURL(f);
  92.365 +                f = new File(installRoot+"/modules/admin-util.jar");//NOI18N
  92.366 +                loader.addURL(f);
  92.367 +
  92.368 +            } else { //for Glassfish V2
  92.369 +
  92.370 +                String installRoot = f.getAbsolutePath();
  92.371 +                f = new File(installRoot+"/lib/appserv-admin.jar");//NOI18N
  92.372 +                loader.addURL(f);
  92.373 +                f = new File(installRoot+"/lib/appserv-ext.jar");//NOI18N
  92.374 +                loader.addURL(f);
  92.375 +                f = new File(installRoot+"/lib/appserv-rt.jar");//NOI18N
  92.376 +                loader.addURL(f);
  92.377 +                f = new File(installRoot+"/lib/appserv-cmp.jar");//NOI18N
  92.378 +                loader.addURL(f);
  92.379 +                f = new File(installRoot+"/lib/commons-logging.jar");//NOI18N
  92.380 +                loader.addURL(f);
  92.381 +                f = new File(installRoot+"/lib/admin-cli.jar");//NOI18N
  92.382 +                loader.addURL(f);
  92.383 +                f = new File(installRoot+"/lib/common-laucher.jar");//NOI18N
  92.384 +                loader.addURL(f);
  92.385 +                f = new File(installRoot+"/lib/j2ee.jar");//NOI18N
  92.386 +                loader.addURL(f);
  92.387 +                f = new File(installRoot+"/lib/install/applications/jmsra/imqjmsra.jar");//NOI18N
  92.388 +                loader.addURL(f);
  92.389 +            }
  92.390  	    
  92.391  	} catch (Exception ex2) {
  92.392  	    throw new Exception(ex2.getLocalizedMessage());
  92.393  	}
  92.394      }
  92.395 +
  92.396 +    private void updateJMXPluginLoader(File platformLocation, ExtendedClassLoader loader) throws Exception{
  92.397 +        try {
  92.398 +            java.io.File f = platformLocation;
  92.399 +            if (null == f || !f.exists()){
  92.400 +                return;
  92.401 +            }
  92.402 +            
  92.403 +            String installRoot = f.getAbsolutePath();
  92.404 +            String gfVersion = getGlassFishVersion();
  92.405 +
  92.406 +            if(SunAppServerConstants.GLASSFISH_V3.equals(gfVersion)) {
  92.407 +                
  92.408 +                f = new File(installRoot+"/modules/deployment-client.jar");//NOI18N
  92.409 +                loader.addURL(f);
  92.410 +                f = new File(installRoot+"/modules/jmxremote_optional-repackaged.jar");//NOI18N
  92.411 +                loader.addURL(f);
  92.412 +
  92.413 +            } else { //GF V2
  92.414 +
  92.415 +                f = new File(installRoot+"/lib/appserv-deployment-client.jar");//NOI18N
  92.416 +                loader.addURL(f);
  92.417 +                f = new File(installRoot+"/lib/jmxremote_optional.jar");//NOI18N
  92.418 +                loader.addURL(f);
  92.419 +                f = new File(installRoot+"/lib/appserv-ext.jar");//NOI18N
  92.420 +                loader.addURL(f);
  92.421 +            }
  92.422 +
  92.423 +	} catch (Exception ex2) {
  92.424 +	    throw new Exception(ex2.getLocalizedMessage());
  92.425 +	}
  92.426 +    }
  92.427      
  92.428 -    private synchronized ClassLoader getServerClassLoader(File platformLocation) {
  92.429 +    synchronized ClassLoader getServerClassLoader(File platformLocation) {
  92.430  	
  92.431  	if(loader==null){        
  92.432  	    try {
  92.433 @@ -303,6 +539,100 @@
  92.434  	
  92.435  	return loader;
  92.436      }
  92.437 +
  92.438 +    private synchronized ClassLoader getJMXClassLoader(File platformLocation) {
  92.439 +
  92.440 +	if(jmxLoader==null){
  92.441 +	    try {
  92.442 +                jmxLoader = new ExtendedClassLoader(new Empty().getClass().getClassLoader());
  92.443 +                updateJMXPluginLoader(platformLocation, jmxLoader);
  92.444 +	    } catch (Exception ex2) {
  92.445 +		org.openide.ErrorManager.getDefault().notify(ex2);
  92.446 +	    }
  92.447 +        }
  92.448 +
  92.449 +	return jmxLoader;
  92.450 +    }
  92.451 +
  92.452 +    public boolean isDeployOnSaveSupported() {
  92.453 +        return true;
  92.454 +    }
  92.455 +
  92.456 +    public boolean isServerRunning() {
  92.457 +        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
  92.458 +        String gfVersion = getGlassFishVersion();
  92.459 +
  92.460 +        try{
  92.461 +
  92.462 +            int adminPort = 4848;
  92.463 +            try {
  92.464 +                adminPort = Integer.parseInt(getJMXConnectorPort(gfVersion));
  92.465 +            } catch (Exception e) {
  92.466 +            }
  92.467 +            ClassLoader ld = getJMXClassLoader(new File(psconfig.getServerHome()));
  92.468 +            Thread.currentThread().setContextClassLoader(ld);
  92.469 +
  92.470 +            Class clazz = ld.loadClass(getJMXHandlerClassName(gfVersion));
  92.471 +            Constructor con = clazz.getConstructor(String.class,String.class,String.class,int.class);
  92.472 +            Object instance = con.newInstance(psconfig.getHost(), psconfig.getAdminUser(), psconfig.getProperty(SunAppServerConstants.SERVER_PASSWORD), adminPort);
  92.473 +            //GlassFishJMXHandler jmxHandler = new GlassFishJMXHandler(psconfig.getHost(), psconfig.getAdminUser(), psconfig.getAdminPassWord(), adminPort);
  92.474 +
  92.475 +            Method method = clazz.getMethod("getConfigDirectory");
  92.476 +            Object object = method.invoke(instance);
  92.477 +            if(object == null)
  92.478 +                return true; //damage control..incase MBean doesn't exist
  92.479 +
  92.480 +            if(!(object instanceof String))
  92.481 +                return true;
  92.482 +
  92.483 +            String domainDirPath = new File((String)object).getParentFile().getCanonicalPath();
  92.484 +            //System.out.println("ConfigDir:::: " +domainDirPath);
  92.485 +            String domainPath = new File(psconfig.getDomainDir()).getCanonicalPath();
  92.486 +            if(domainDirPath.equals(domainPath))
  92.487 +                return true;
  92.488 +            else
  92.489 +                return false;
  92.490 +
  92.491 +        }catch(Throwable ex){
  92.492 +            ex.printStackTrace();
  92.493 +            return true;
  92.494 +        }finally {
  92.495 +            Thread.currentThread().setContextClassLoader(contextClassLoader);
  92.496 +        }
  92.497 +
  92.498 +    }
  92.499 +
  92.500 +    public File getModuleDirectory(TargetModuleID module) {
  92.501 +        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
  92.502 +        String gfVersion = getGlassFishVersion();
  92.503 +        try{
  92.504 +
  92.505 +            int adminPort = 4848;
  92.506 +            try {
  92.507 +                adminPort = Integer.parseInt(getJMXConnectorPort(gfVersion));
  92.508 +            } catch (Exception e) {
  92.509 +            }
  92.510 +            ClassLoader ld = getJMXClassLoader(new File(psconfig.getServerHome()));
  92.511 +            Thread.currentThread().setContextClassLoader(ld);
  92.512 +
  92.513 +            Class clazz = ld.loadClass(getJMXHandlerClassName(gfVersion));
  92.514 +            Constructor con = clazz.getConstructor(String.class,String.class,String.class,int.class);
  92.515 +            Object instance = con.newInstance(psconfig.getHost(), psconfig.getAdminUser(), psconfig.getProperty(SunAppServerConstants.SERVER_PASSWORD), adminPort);
  92.516 +            //GlassFishJMXHandler jmxHandler = new GlassFishJMXHandler(psconfig.getHost(), psconfig.getAdminUser(), psconfig.getAdminPassWord(), adminPort);
  92.517 +
  92.518 +            Method method = clazz.getMethod("getModuleDirectory", TargetModuleID.class);
  92.519 +            return (File)method.invoke(instance, module);
  92.520 +
  92.521 +        }catch(Throwable ex){
  92.522 +            //ex.printStackTrace();
  92.523 +        }finally {
  92.524 +            Thread.currentThread().setContextClassLoader(contextClassLoader);
  92.525 +        }
  92.526 +
  92.527 +        return null;
  92.528 +    }
  92.529 +
  92.530 +
  92.531      
  92.532      static class Empty{
  92.533          
    93.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/GlassFishV3JMXHandler.java	Sun Jun 26 10:25:14 2011 +0800
    93.3 @@ -0,0 +1,232 @@
    93.4 +/*
    93.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    93.6 + *
    93.7 + * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
    93.8 + *
    93.9 + * The contents of this file are subject to the terms of either the GNU
   93.10 + * General Public License Version 2 only ("GPL") or the Common
   93.11 + * Development and Distribution License("CDDL") (collectively, the
   93.12 + * "License"). You may not use this file except in compliance with the
   93.13 + * License. You can obtain a copy of the License at
   93.14 + * http://www.netbeans.org/cddl-gplv2.html
   93.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   93.16 + * specific language governing permissions and limitations under the
   93.17 + * License.  When distributing the software, include this License Header
   93.18 + * Notice in each file and include the License file at
   93.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   93.20 + * particular file as subject to the "Classpath" exception as provided
   93.21 + * by Sun in the GPL Version 2 section of the License file that
   93.22 + * accompanied this code. If applicable, add the following below the
   93.23 + * License Header, with the fields enclosed by brackets [] replaced by
   93.24 + * your own identifying information:
   93.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   93.26 + *
   93.27 + * If you wish your version of this file to be governed by only the CDDL
   93.28 + * or only the GPL Version 2, indicate your decision by adding
   93.29 + * "[Contributor] elects to include this software in this distribution
   93.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   93.31 + * single choice of license, a recipient has the option to distribute
   93.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   93.33 + * to extend the choice of license to its licensees as provided above.
   93.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   93.35 + * Version 2 license, then the option applies only if the new code is
   93.36 + * made subject to such option by the copyright holder.
   93.37 + *
   93.38 + * Contributor(s):
   93.39 + *
   93.40 + * Portions Copyrighted 2010 Sun Microsystems, Inc.
   93.41 + */
   93.42 +
   93.43 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver;
   93.44 +
   93.45 +import java.io.File;
   93.46 +import java.util.HashMap;
   93.47 +import java.util.Map;
   93.48 +import java.util.logging.Level;
   93.49 +import java.util.logging.Logger;
   93.50 +import javax.enterprise.deploy.spi.TargetModuleID;
   93.51 +import javax.management.MBeanServerConnection;
   93.52 +import javax.management.ObjectName;
   93.53 +import javax.management.remote.JMXConnector;
   93.54 +import javax.management.remote.JMXConnectorFactory;
   93.55 +import javax.management.remote.JMXServiceURL;
   93.56 +
   93.57 +/**
   93.58 + *
   93.59 + * @author satya
   93.60 + */
   93.61 +public class GlassFishV3JMXHandler extends GlassFishJMXHandler {
   93.62 +
   93.63 +    private static Logger logger = Logger.getLogger(GlassFishV3JMXHandler.class.getName());
   93.64 +
   93.65 +    private final static String applicationMBeanName = "v3:pp=/domain/applications,type=application";
   93.66 +
   93.67 +    private final static String serverMBeanName = "v3:pp=,type=DomainRoot,name=v3";
   93.68 +
   93.69 +    public GlassFishV3JMXHandler(String host, String adminUser,
   93.70 +            String password, int adminPort){
   93.71 +
   93.72 +        super(host,adminUser,password,adminPort);
   93.73 +
   93.74 +    }
   93.75 +
   93.76 +    private MBeanServerConnection getMBeanServerConnection()
   93.77 +                                                            throws Throwable{
   93.78 +        return getMBeanServerConnection(host,adminPort,adminUser,adminPassword);
   93.79 +    }
   93.80 +
   93.81 +    @Override
   93.82 +    protected MBeanServerConnection
   93.83 +        getSecureMBeanServerConnection(String host,
   93.84 +                                       int port,
   93.85 +                                       String user,
   93.86 +                                       String password) throws Throwable{
   93.87 +
   93.88 +        
   93.89 +        return getMBeanServerConnection(host, port, user, password);
   93.90 +    }
   93.91 +
   93.92 +    @Override
   93.93 +    protected MBeanServerConnection getMBeanServerConnection
   93.94 +                                            (String host,
   93.95 +                                             int port,
   93.96 +                                             String user,
   93.97 +                                             String password) throws Throwable{
   93.98 +
   93.99 +        final JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +
  93.100 +                                  host + ":" + port +"/jmxrmi");
  93.101 +
  93.102 +        final Map env = new HashMap();
  93.103 +
  93.104 +        String[] credentials = new String[]{user,password};
  93.105 +        env.put(JMXConnector.CREDENTIALS, credentials);
  93.106 +
  93.107 +       // final String PKGS = "com.sun.enterprise.admin.jmx.remote.protocol";
  93.108 +
  93.109 +        //env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, PKGS);
  93.110 +//        env.put(ADMIN_USER_ENV_PROPERTY_NAME, user );
  93.111 +//        env.put( ADMIN_PASSWORD_ENV_PROPERTY_NAME, password);
  93.112 +//        env.put(HTTP_AUTH_PROPERTY_NAME, DEFAULT_HTTP_AUTH_SCHEME);
  93.113 +        final JMXConnector conn = JMXConnectorFactory.connect(url, env);
  93.114 +        return conn.getMBeanServerConnection();
  93.115 +    }
  93.116 +
  93.117 +
  93.118 +    //Because of reload bug in V3 through MBean, reload is done through .reload file. Comment this method, once the bug is fixed.
  93.119 +    @Override
  93.120 +    public void reload(String contextRoot) throws Throwable{
  93.121 + //       contextRoot = "/" + contextRoot;
  93.122 +
  93.123 +        try {
  93.124 +            File moduleDir = getModuleDirectory(contextRoot);
  93.125 +            if(moduleDir != null)
  93.126 +                reloadThroughFile(moduleDir);
  93.127 +        } catch (Throwable t){
  93.128 +            t.printStackTrace();
  93.129 +        }
  93.130 +        System.out.println("RELOAD Successful : "+contextRoot);
  93.131 +     }
  93.132 +
  93.133 +    @Override
  93.134 +     public Object getConfigDirectory() throws Throwable{
  93.135 +        String oName = serverMBeanName;
  93.136 +        ObjectName appMBean = new ObjectName(oName);
  93.137 +        try{
  93.138 +            return null;
  93.139 +            //return getMBeanServerConnection().getAttribute(appMBean,"ConfigDir");
  93.140 +        }catch (Throwable t) {
  93.141 +            logger.log(Level.WARNING,"error",t);
  93.142 +            return null;
  93.143 +        }
  93.144 +     }
  93.145 +
  93.146 +    @Override
  93.147 +     public File getModuleDirectory(TargetModuleID module ) throws Throwable{
  93.148 +         String mid = module.getModuleID();
  93.149 +         if(mid == null || mid.trim().length() == 0)
  93.150 +             return null;
  93.151 +
  93.152 +         String contextRoot = "/" + module;
  93.153 +         String oName = webModuleMBeanName + contextRoot;
  93.154 +         ObjectName webModuleMBean = new ObjectName(oName);
  93.155 +
  93.156 +         try{
  93.157 +            return getModuleDirectory(webModuleMBean);
  93.158 +         }catch (Throwable t) {
  93.159 +            t.printStackTrace();
  93.160 +            return null;
  93.161 +         }
  93.162 +
  93.163 +         //ObjectName aaaa = new ObjectName(applicationMBeanName + ",name="+mid);
  93.164 +
  93.165 +//         try{
  93.166 +//             return getModuleDirectory(webModuleMBean);
  93.167 +//         } catch(Throwable t) {
  93.168 +//             t.printStackTrace();
  93.169 +//             return null;
  93.170 +//         }
  93.171 +     }
  93.172 +
  93.173 +
  93.174 +//     public File getModuleDirectory(String module) throws Throwable{
  93.175 +//
  93.176 +//         if(module == null || module.trim().length() == 0)
  93.177 +//             return null;
  93.178 +//         ObjectName aaaa = new ObjectName(applicationMBeanName + ",name="+module);
  93.179 +//         try{
  93.180 +//             return getModuleDirectory(aaaa);
  93.181 +//         } catch(Throwable t) {
  93.182 +//             t.printStackTrace();
  93.183 +//             return null;
  93.184 +//         }
  93.185 +//     }
  93.186 +
  93.187 +     public File getModuleDirectory(String module) throws Throwable{
  93.188 +
  93.189 +         if(module == null || module.trim().length() == 0)
  93.190 +             return null;
  93.191 +         String contextRoot = null;
  93.192 +
  93.193 +         if(!module.startsWith("/"))
  93.194 +            contextRoot = "/" + module;
  93.195 +         else
  93.196 +            contextRoot = module;
  93.197 +
  93.198 +         String oName = webModuleMBeanName + contextRoot;
  93.199 +         ObjectName webModuleMBean = new ObjectName(oName);
  93.200 +
  93.201 +         try{
  93.202 +             return getModuleDirectory(webModuleMBean);
  93.203 +         } catch(Throwable t) {
  93.204 +             t.printStackTrace();
  93.205 +             return null;
  93.206 +         }
  93.207 +     }
  93.208 +
  93.209 +
  93.210 +    private void reloadThroughFile(File moduleDir) throws Throwable {
  93.211 +
  93.212 +        File reloadFile = new File(moduleDir, ".reload");
  93.213 +        if(reloadFile.exists()) {
  93.214 +            reloadFile.setLastModified(System.currentTimeMillis());
  93.215 +        } else {
  93.216 +            if(moduleDir.exists())
  93.217 +                reloadFile.createNewFile();
  93.218 +        }
  93.219 +    }
  93.220 +
  93.221 +    private File getModuleDirectory(ObjectName appMBean) throws Throwable {
  93.222 +       //String path = "" + getMBeanServerConnection().getAttribute(appMBean,"Location");
  93.223 +       String path = "" + getMBeanServerConnection().getAttribute(appMBean,"docBase");
  93.224 +
  93.225 +       //for error in GF V3 which returns location as file:/User/... on MacOS
  93.226 +       if(path.startsWith("file:/") && !path.startsWith("file://")) {
  93.227 +
  93.228 +           path = path.replaceFirst("file:", "");
  93.229 +       }
  93.230 +
  93.231 +       File dirLocation =new java.io.File(path);
  93.232 +       return dirLocation;
  93.233 +    }
  93.234 +
  93.235 +}
    94.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/GlassfishV3ConfigUtil.java	Sun Jun 26 10:25:14 2011 +0800
    94.3 @@ -0,0 +1,148 @@
    94.4 +/*
    94.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    94.6 + *
    94.7 + * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
    94.8 + *
    94.9 + * The contents of this file are subject to the terms of either the GNU
   94.10 + * General Public License Version 2 only ("GPL") or the Common
   94.11 + * Development and Distribution License("CDDL") (collectively, the
   94.12 + * "License"). You may not use this file except in compliance with the
   94.13 + * License. You can obtain a copy of the License at
   94.14 + * http://www.netbeans.org/cddl-gplv2.html
   94.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   94.16 + * specific language governing permissions and limitations under the
   94.17 + * License.  When distributing the software, include this License Header
   94.18 + * Notice in each file and include the License file at
   94.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   94.20 + * particular file as subject to the "Classpath" exception as provided
   94.21 + * by Sun in the GPL Version 2 section of the License file that
   94.22 + * accompanied this code. If applicable, add the following below the
   94.23 + * License Header, with the fields enclosed by brackets [] replaced by
   94.24 + * your own identifying information:
   94.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   94.26 + *
   94.27 + * If you wish your version of this file to be governed by only the CDDL
   94.28 + * or only the GPL Version 2, indicate your decision by adding
   94.29 + * "[Contributor] elects to include this software in this distribution
   94.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   94.31 + * single choice of license, a recipient has the option to distribute
   94.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   94.33 + * to extend the choice of license to its licensees as provided above.
   94.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   94.35 + * Version 2 license, then the option applies only if the new code is
   94.36 + * made subject to such option by the copyright holder.
   94.37 + *
   94.38 + * Contributor(s):
   94.39 + *
   94.40 + * Portions Copyrighted 2010 Sun Microsystems, Inc.
   94.41 + */
   94.42 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver;
   94.43 +
   94.44 +import java.io.File;
   94.45 +import java.io.IOException;
   94.46 +import java.util.logging.Level;
   94.47 +import java.util.logging.Logger;
   94.48 +import javax.xml.parsers.ParserConfigurationException;
   94.49 +import javax.xml.xpath.XPathExpressionException;
   94.50 +import org.netbeans.modules.portalpack.servers.core.util.NetbeanConstants;
   94.51 +import org.xml.sax.SAXException;
   94.52 +
   94.53 +/**
   94.54 + *
   94.55 + * @author satya
   94.56 + */
   94.57 +public class GlassfishV3ConfigUtil extends SunAppConfigUtil {
   94.58 +
   94.59 +    private static Logger logger = Logger.getLogger(NetbeanConstants.PORTAL_LOGGER);
   94.60 +
   94.61 +    public GlassfishV3ConfigUtil(File domainDir)
   94.62 +            throws IOException, SAXException, ParserConfigurationException, ReadAccessDeniedException {
   94.63 +        super(domainDir);
   94.64 +    }
   94.65 +
   94.66 +    @Override
   94.67 +    public String getPort() {
   94.68 +        String port = "";
   94.69 +        if (getDocument() == null) {
   94.70 +            return "";
   94.71 +        }
   94.72 +
   94.73 +        String listenerName = "";
   94.74 +        try {
   94.75 +
   94.76 +            listenerName = getXPath().evaluate("/domain/configs/config[@name='server-config']/http-service/virtual-server[@id='server']/@network-listeners", getDocument());
   94.77 +        } catch (XPathExpressionException ex) {
   94.78 +            ex.printStackTrace();
   94.79 +        }
   94.80 +
   94.81 +        if (listenerName != null) {
   94.82 +            listenerName = listenerName.split(",")[0];
   94.83 +        }
   94.84 +        try {
   94.85 +            port = getXPath().evaluate("/domain/configs/config[@name='server-config']/network-config/network-listeners/network-listener[@name=\'" + listenerName + "\']/@port", getDocument());
   94.86 +        } catch (XPathExpressionException ex) {
   94.87 +            logger.log(Level.SEVERE, "ParseError", ex);
   94.88 +        }
   94.89 +
   94.90 +        if (port == null) {
   94.91 +            return "";
   94.92 +        }
   94.93 +
   94.94 +        return port.trim();
   94.95 +    }
   94.96 +
   94.97 +    @Override
   94.98 +    public String getAdminPort() {
   94.99 +        String port = "";
  94.100 +        if (getDocument() == null) {
  94.101 +            return "";
  94.102 +        }
  94.103 +
  94.104 +        String listenerName = "";
  94.105 +        try {
  94.106 +
  94.107 +            listenerName = getXPath().evaluate("/domain/configs/config[@name='server-config']/http-service/virtual-server[@id='__asadmin']/@network-listeners", getDocument());
  94.108 +        } catch (XPathExpressionException ex) {
  94.109 +            ex.printStackTrace();
  94.110 +        }
  94.111 +
  94.112 +        if (listenerName != null) {
  94.113 +            listenerName = listenerName.split(",")[0];
  94.114 +        }
  94.115 +        try {
  94.116 +            port = getXPath().evaluate("/domain/configs/config[@name='server-config']/network-config/network-listeners/network-listener[@name=\'" + listenerName + "\']/@port", getDocument());
  94.117 +        } catch (XPathExpressionException ex) {
  94.118 +            logger.log(Level.SEVERE, "ParseError", ex);
  94.119 +        }
  94.120 +
  94.121 +
  94.122 +        if (port == null) {
  94.123 +            return "";
  94.124 +        }
  94.125 +
  94.126 +        return port.trim();
  94.127 +    }
  94.128 +
  94.129 +
  94.130 +    @Override
  94.131 +    public String getJMXConnectorPort() {
  94.132 +        String port = "";
  94.133 +        if (getDocument() == null) {
  94.134 +            return "";
  94.135 +        }
  94.136 +
  94.137 +        try {
  94.138 +
  94.139 +            port = getXPath().evaluate("/domain/configs/config[@name='server-config']/admin-service/jmx-connector/@port", getDocument());
  94.140 +        } catch (XPathExpressionException ex) {
  94.141 +            ex.printStackTrace();
  94.142 +        }
  94.143 +
  94.144 +
  94.145 +        if (port == null || port.trim().length() == 0) {
  94.146 +            return "8686";
  94.147 +        }
  94.148 +
  94.149 +        return port.trim();
  94.150 +    }
  94.151 +}
    95.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/MasterPasswordInputDialog.java	Sun Jun 26 10:25:14 2011 +0800
    95.3 @@ -0,0 +1,75 @@
    95.4 +/*
    95.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    95.6 + *
    95.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    95.8 + *
    95.9 + * The contents of this file are subject to the terms of either the GNU
   95.10 + * General Public License Version 2 only ("GPL") or the Common
   95.11 + * Development and Distribution License("CDDL") (collectively, the
   95.12 + * "License"). You may not use this file except in compliance with the
   95.13 + * License. You can obtain a copy of the License at
   95.14 + * http://www.netbeans.org/cddl-gplv2.html
   95.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   95.16 + * specific language governing permissions and limitations under the
   95.17 + * License.  When distributing the software, include this License Header
   95.18 + * Notice in each file and include the License file at
   95.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   95.20 + * particular file as subject to the "Classpath" exception as provided
   95.21 + * by Sun in the GPL Version 2 section of the License file that
   95.22 + * accompanied this code. If applicable, add the following below the
   95.23 + * License Header, with the fields enclosed by brackets [] replaced by
   95.24 + * your own identifying information:
   95.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   95.26 + *
   95.27 + * If you wish your version of this file to be governed by only the CDDL
   95.28 + * or only the GPL Version 2, indicate your decision by adding
   95.29 + * "[Contributor] elects to include this software in this distribution
   95.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   95.31 + * single choice of license, a recipient has the option to distribute
   95.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   95.33 + * to extend the choice of license to its licensees as provided above.
   95.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   95.35 + * Version 2 license, then the option applies only if the new code is
   95.36 + * made subject to such option by the copyright holder.
   95.37 + *
   95.38 + * Contributor(s):
   95.39 + *
   95.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   95.41 + */
   95.42 +
   95.43 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver;
   95.44 +
   95.45 +import org.openide.NotifyDescriptor;
   95.46 +import org.openide.util.NbBundle;
   95.47 +
   95.48 +/**
   95.49 + *
   95.50 + * @author ludo
   95.51 + */
   95.52 +public class MasterPasswordInputDialog extends NotifyDescriptor {
   95.53 +
   95.54 +    /**
   95.55 +     * The text field used to enter the input.
   95.56 +     */
   95.57 +    protected MasterPasswordInputPanel panel=new MasterPasswordInputPanel();
   95.58 +    static protected final String title =
   95.59 +            NbBundle.getMessage(MasterPasswordInputDialog.class, "MasterPasswordInputDialog_title");
   95.60 +
   95.61 +    /** Construct dialog with the specified title and label text.
   95.62 +     * @param text label text
   95.63 +     * @param title title of the dialog
   95.64 +     */
   95.65 +    public MasterPasswordInputDialog() {
   95.66 +        super(null, title, NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.PLAIN_MESSAGE, null, null);
   95.67 +        super.setMessage(panel);
   95.68 +    }
   95.69 +
   95.70 +    /**
   95.71 +     * Get the text which the user typed into the input line.
   95.72 +     * @return the text entered by the user
   95.73 +     */
   95.74 +    public String getInputText() {
   95.75 +        return panel.getMasterPassword();
   95.76 +    }
   95.77 +
   95.78 +}
   95.79 \ No newline at end of file
    96.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/MasterPasswordInputPanel.form	Sun Jun 26 10:25:14 2011 +0800
    96.3 @@ -0,0 +1,92 @@
    96.4 +<?xml version="1.0" encoding="UTF-8" ?>
    96.5 +
    96.6 +<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
    96.7 +  <Properties>
    96.8 +    <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
    96.9 +      <Dimension value="[310, 157]"/>
   96.10 +    </Property>
   96.11 +    <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
   96.12 +      <Dimension value="[310, 157]"/>
   96.13 +    </Property>
   96.14 +  </Properties>
   96.15 +  <AuxValues>
   96.16 +    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
   96.17 +    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
   96.18 +    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
   96.19 +    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
   96.20 +    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
   96.21 +    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
   96.22 +    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
   96.23 +    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="1"/>
   96.24 +    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-71,0,0,1,55"/>
   96.25 +  </AuxValues>
   96.26 +
   96.27 +  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
   96.28 +  <SubComponents>
   96.29 +    <Component class="javax.swing.JTextArea" name="jTextArea1">
   96.30 +      <Properties>
   96.31 +        <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
   96.32 +          <Color blue="c0" green="c0" red="c0" type="rgb"/>
   96.33 +        </Property>
   96.34 +        <Property name="editable" type="boolean" value="false"/>
   96.35 +        <Property name="lineWrap" type="boolean" value="true"/>
   96.36 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   96.37 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/Bundle.properties" key="MasterPasswordInputDialog_longtext" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
   96.38 +        </Property>
   96.39 +        <Property name="wrapStyleWord" type="boolean" value="true"/>
   96.40 +        <Property name="focusable" type="boolean" value="false"/>
   96.41 +        <Property name="opaque" type="boolean" value="false"/>
   96.42 +      </Properties>
   96.43 +      <AccessibilityProperties>
   96.44 +        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   96.45 +          <ResourceString bundle="org/netbeans/modules/j2ee/sun/ide/j2ee/ui/Bundle.properties" key="MasterPasswordInputDialog_longtext" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
   96.46 +        </Property>
   96.47 +      </AccessibilityProperties>
   96.48 +      <Constraints>
   96.49 +        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   96.50 +          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="3" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="12" insetsBottom="5" insetsRight="12" anchor="10" weightX="1.0" weightY="0.0"/>
   96.51 +        </Constraint>
   96.52 +      </Constraints>
   96.53 +    </Component>
   96.54 +    <Component class="javax.swing.JLabel" name="jLabel1">
   96.55 +      <Properties>
   96.56 +        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
   96.57 +          <ComponentRef name="jPasswordField1"/>
   96.58 +        </Property>
   96.59 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   96.60 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/Bundle.properties" key="MasterPasswordInputDialog_text" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
   96.61 +        </Property>
   96.62 +      </Properties>
   96.63 +      <AccessibilityProperties>
   96.64 +        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   96.65 +          <ResourceString bundle="org/netbeans/modules/j2ee/sun/ide/j2ee/ui/Bundle.properties" key="MasterPasswordInputDialog_text" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
   96.66 +        </Property>
   96.67 +      </AccessibilityProperties>
   96.68 +      <AuxValues>
   96.69 +        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
   96.70 +      </AuxValues>
   96.71 +      <Constraints>
   96.72 +        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   96.73 +          <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="12" insetsBottom="6" insetsRight="6" anchor="10" weightX="0.0" weightY="0.0"/>
   96.74 +        </Constraint>
   96.75 +      </Constraints>
   96.76 +    </Component>
   96.77 +    <Component class="javax.swing.JPasswordField" name="jPasswordField1">
   96.78 +      <AccessibilityProperties>
   96.79 +        <Property name="AccessibleContext.accessibleName" type="java.lang.String" value="password"/>
   96.80 +      </AccessibilityProperties>
   96.81 +      <Constraints>
   96.82 +        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   96.83 +          <GridBagConstraints gridX="1" gridY="1" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="6" insetsBottom="6" insetsRight="12" anchor="10" weightX="0.0" weightY="0.0"/>
   96.84 +        </Constraint>
   96.85 +      </Constraints>
   96.86 +    </Component>
   96.87 +    <Component class="javax.swing.JLabel" name="jLabel2">
   96.88 +      <Constraints>
   96.89 +        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
   96.90 +          <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="3" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="1.0"/>
   96.91 +        </Constraint>
   96.92 +      </Constraints>
   96.93 +    </Component>
   96.94 +  </SubComponents>
   96.95 +</Form>
    97.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    97.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/MasterPasswordInputPanel.java	Sun Jun 26 10:25:14 2011 +0800
    97.3 @@ -0,0 +1,137 @@
    97.4 +/*
    97.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    97.6 + *
    97.7 + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
    97.8 + *
    97.9 + * The contents of this file are subject to the terms of either the GNU
   97.10 + * General Public License Version 2 only ("GPL") or the Common
   97.11 + * Development and Distribution License("CDDL") (collectively, the
   97.12 + * "License"). You may not use this file except in compliance with the
   97.13 + * License. You can obtain a copy of the License at
   97.14 + * http://www.netbeans.org/cddl-gplv2.html
   97.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   97.16 + * specific language governing permissions and limitations under the
   97.17 + * License.  When distributing the software, include this License Header
   97.18 + * Notice in each file and include the License file at
   97.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   97.20 + * particular file as subject to the "Classpath" exception as provided
   97.21 + * by Sun in the GPL Version 2 section of the License file that
   97.22 + * accompanied this code. If applicable, add the following below the
   97.23 + * License Header, with the fields enclosed by brackets [] replaced by
   97.24 + * your own identifying information:
   97.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   97.26 + *
   97.27 + * Contributor(s):
   97.28 + *
   97.29 + * The Original Software is NetBeans. The Initial Developer of the Original
   97.30 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
   97.31 + * Microsystems, Inc. All Rights Reserved.
   97.32 + *
   97.33 + * If you wish your version of this file to be governed by only the CDDL
   97.34 + * or only the GPL Version 2, indicate your decision by adding
   97.35 + * "[Contributor] elects to include this software in this distribution
   97.36 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   97.37 + * single choice of license, a recipient has the option to distribute
   97.38 + * your version of this file under either the CDDL, the GPL Version 2 or
   97.39 + * to extend the choice of license to its licensees as provided above.
   97.40 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   97.41 + * Version 2 license, then the option applies only if the new code is
   97.42 + * made subject to such option by the copyright holder.
   97.43 + */
   97.44 +
   97.45 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver;
   97.46 +
   97.47 +/**
   97.48 + *
   97.49 + * @author  ludo
   97.50 + */
   97.51 +public class MasterPasswordInputPanel extends javax.swing.JPanel {
   97.52 +
   97.53 +    /** Creates new form NewJPanel */
   97.54 +    public MasterPasswordInputPanel() {
   97.55 +        initComponents();
   97.56 +        jPasswordField1.setText("");
   97.57 +        jPasswordField1.requestFocus();
   97.58 +
   97.59 +        javax.swing.KeyStroke enter = javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER, 0);
   97.60 +        javax.swing.text.Keymap map = jPasswordField1.getKeymap();
   97.61 +
   97.62 +        map.removeKeyStrokeBinding(enter);
   97.63 +    }
   97.64 +    /**
   97.65 +     * Get the text which the user typed into the input line.
   97.66 +     * @return the text entered by the user
   97.67 +     */
   97.68 +    public String getMasterPassword() {
   97.69 +        return String.valueOf(jPasswordField1.getPassword());
   97.70 +    }    
   97.71 +    /** This method is called from within the constructor to
   97.72 +     * initialize the form.
   97.73 +     * WARNING: Do NOT modify this code. The content of this method is
   97.74 +     * always regenerated by the Form Editor.
   97.75 +     */
   97.76 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
   97.77 +    private void initComponents() {
   97.78 +        java.awt.GridBagConstraints gridBagConstraints;
   97.79 +
   97.80 +        jTextArea1 = new javax.swing.JTextArea();
   97.81 +        jLabel1 = new javax.swing.JLabel();
   97.82 +        jPasswordField1 = new javax.swing.JPasswordField();
   97.83 +        jLabel2 = new javax.swing.JLabel();
   97.84 +
   97.85 +        setMinimumSize(new java.awt.Dimension(310, 157));
   97.86 +        setPreferredSize(new java.awt.Dimension(310, 157));
   97.87 +        setLayout(new java.awt.GridBagLayout());
   97.88 +
   97.89 +        jTextArea1.setBackground(new java.awt.Color(192, 192, 192));
   97.90 +        jTextArea1.setEditable(false);
   97.91 +        jTextArea1.setLineWrap(true);
   97.92 +        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/Bundle"); // NOI18N
   97.93 +        jTextArea1.setText(bundle.getString("MasterPasswordInputDialog_longtext")); // NOI18N
   97.94 +        jTextArea1.setWrapStyleWord(true);
   97.95 +        jTextArea1.setFocusable(false);
   97.96 +        jTextArea1.setOpaque(false);
   97.97 +        gridBagConstraints = new java.awt.GridBagConstraints();
   97.98 +        gridBagConstraints.gridwidth = 3;
   97.99 +        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
  97.100 +        gridBagConstraints.weightx = 1.0;
  97.101 +        gridBagConstraints.insets = new java.awt.Insets(12, 12, 5, 12);
  97.102 +        add(jTextArea1, gridBagConstraints);
  97.103 +        jTextArea1.getAccessibleContext().setAccessibleDescription("null");
  97.104 +
  97.105 +        jLabel1.setLabelFor(jPasswordField1);
  97.106 +        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, bundle.getString("MasterPasswordInputDialog_text")); // NOI18N
  97.107 +        gridBagConstraints = new java.awt.GridBagConstraints();
  97.108 +        gridBagConstraints.gridx = 0;
  97.109 +        gridBagConstraints.gridy = 1;
  97.110 +        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
  97.111 +        gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 6);
  97.112 +        add(jLabel1, gridBagConstraints);
  97.113 +        jLabel1.getAccessibleContext().setAccessibleDescription("null");
  97.114 +
  97.115 +        gridBagConstraints = new java.awt.GridBagConstraints();
  97.116 +        gridBagConstraints.gridx = 1;
  97.117 +        gridBagConstraints.gridy = 1;
  97.118 +        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
  97.119 +        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
  97.120 +        gridBagConstraints.insets = new java.awt.Insets(6, 6, 6, 12);
  97.121 +        add(jPasswordField1, gridBagConstraints);
  97.122 +        jPasswordField1.getAccessibleContext().setAccessibleName("password");
  97.123 +
  97.124 +        gridBagConstraints = new java.awt.GridBagConstraints();
  97.125 +        gridBagConstraints.gridx = 0;
  97.126 +        gridBagConstraints.gridy = 2;
  97.127 +        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
  97.128 +        gridBagConstraints.weighty = 1.0;
  97.129 +        add(jLabel2, gridBagConstraints);
  97.130 +    }// </editor-fold>//GEN-END:initComponents
  97.131 +    
  97.132 +    
  97.133 +    // Variables declaration - do not modify//GEN-BEGIN:variables
  97.134 +    public javax.swing.JLabel jLabel1;
  97.135 +    public javax.swing.JLabel jLabel2;
  97.136 +    public javax.swing.JPasswordField jPasswordField1;
  97.137 +    public javax.swing.JTextArea jTextArea1;
  97.138 +    // End of variables declaration//GEN-END:variables
  97.139 +    
  97.140 +}
    98.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/PortDetector.java	Sun Jun 26 10:25:14 2011 +0800
    98.3 @@ -0,0 +1,174 @@
    98.4 +/*
    98.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    98.6 + *
    98.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
    98.8 + *
    98.9 + * The contents of this file are subject to the terms of either the GNU
   98.10 + * General Public License Version 2 only ("GPL") or the Common
   98.11 + * Development and Distribution License("CDDL") (collectively, the
   98.12 + * "License"). You may not use this file except in compliance with the
   98.13 + * License. You can obtain a copy of the License at
   98.14 + * http://www.netbeans.org/cddl-gplv2.html
   98.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   98.16 + * specific language governing permissions and limitations under the
   98.17 + * License.  When distributing the software, include this License Header
   98.18 + * Notice in each file and include the License file at
   98.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   98.20 + * particular file as subject to the "Classpath" exception as provided
   98.21 + * by Sun in the GPL Version 2 section of the License file that
   98.22 + * accompanied this code. If applicable, add the following below the
   98.23 + * License Header, with the fields enclosed by brackets [] replaced by
   98.24 + * your own identifying information:
   98.25 + * "Portions Copyrighted [year] [name of copyright owner]"
   98.26 + *
   98.27 + * If you wish your version of this file to be governed by only the CDDL
   98.28 + * or only the GPL Version 2, indicate your decision by adding
   98.29 + * "[Contributor] elects to include this software in this distribution
   98.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   98.31 + * single choice of license, a recipient has the option to distribute
   98.32 + * your version of this file under either the CDDL, the GPL Version 2 or
   98.33 + * to extend the choice of license to its licensees as provided above.
   98.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   98.35 + * Version 2 license, then the option applies only if the new code is
   98.36 + * made subject to such option by the copyright holder.
   98.37 + *
   98.38 + * Contributor(s):
   98.39 + *
   98.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
   98.41 + */
   98.42 +
   98.43 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver;
   98.44 +
   98.45 +import java.io.IOException;
   98.46 +import java.net.ConnectException;
   98.47 +import java.net.InetSocketAddress;
   98.48 +import java.net.Socket;
   98.49 +import java.net.SocketException;
   98.50 +import java.net.SocketTimeoutException;
   98.51 +import java.util.Locale;
   98.52 +
   98.53 +/* new algo to test of an app server(8.1 and 9.0) is secured or not
   98.54 + * @author ludo champenois, and Jean Francois Arcand
   98.55 + *
   98.56 + **/
   98.57 +
   98.58 +public class PortDetector {
   98.59 +
   98.60 +    private static final int PORT_CHECK_TIMEOUT = 4000; // Port check timeout in ms
   98.61 +
   98.62 +    /**
   98.63 +     *  This method accepts a hostname and port #.  It uses this information
   98.64 +     *  to attempt to connect to the port, send a test query, analyze the
   98.65 +     *  result to determine if the port is secure or unsecure (currently only
   98.66 +     *  http / https is supported).
   98.67 +     * it might emit a warning in the server log for GlassFish cases
   98.68 +     * No Harm, just an annoying warning, so we need to use this call only when really needed
   98.69 +     */
   98.70 +    public static boolean isSecurePort(String hostname, int port)
   98.71 +            throws IOException, ConnectException, SocketTimeoutException {
   98.72 +        // Open the socket with a short timeout for connects and reads.
   98.73 +        Socket socket = new Socket();
   98.74 +        try {
   98.75 +            socket.connect(new InetSocketAddress(hostname, port), PORT_CHECK_TIMEOUT);
   98.76 +            socket.setSoTimeout(PORT_CHECK_TIMEOUT);
   98.77 +        } catch(SocketException ex) { // this could be bug 70020 due to SOCKs proxy not having localhost
   98.78 +            String socksNonProxyHosts = System.getProperty("socksNonProxyHosts");
   98.79 +            if(socksNonProxyHosts != null && socksNonProxyHosts.indexOf("localhost") < 0) {
   98.80 +                String localhost = socksNonProxyHosts.length() > 0 ? "|localhost" : "localhost";
   98.81 +                System.setProperty("socksNonProxyHosts",  socksNonProxyHosts + localhost);
   98.82 +                ConnectException ce = new ConnectException();
   98.83 +                ce.initCause(ex);
   98.84 +                throw ce; //status unknow at this point
   98.85 +                //next call, we'll be ok and it will really detect if we are secure or not
   98.86 +            }
   98.87 +        }
   98.88 +
   98.89 +        // Send an https query (w/ trailing http query)
   98.90 +        java.io.OutputStream ostream = socket.getOutputStream();
   98.91 +        ostream.write(TEST_QUERY);
   98.92 +
   98.93 +        // Get the result
   98.94 +        java.io.InputStream istream = socket.getInputStream();
   98.95 +        byte[] input = new byte[8192];
   98.96 +        istream.read(input);
   98.97 +
   98.98 +        // Close the socket
   98.99 +        socket.close();
  98.100 +
  98.101 +        // Determine protocol from result
  98.102 +        // Can't read https response w/ OpenSSL (or equiv), so use as
  98.103 +        // default & try to detect an http response.
  98.104 +        String response = new String(input).toLowerCase(Locale.ENGLISH);
  98.105 +        boolean isSecure = true;
  98.106 +        if (response.length() == 0) {
  98.107 +            //isSecure = false;
  98.108 +            throw new ConnectException();
  98.109 +        } else if (response.startsWith("http/1.")) {
  98.110 +            isSecure = false;
  98.111 +        } else if (response.indexOf("<html") != -1) {
  98.112 +            isSecure = false;
  98.113 +        } else if (response.indexOf("</html") != -1) {
  98.114 +            // New test added to resolve 106245
  98.115 +            // when the user has the IDE use a proxy (like webcache.foo.bar.com),
  98.116 +            // the response comes back as "d><title>....</html>".  It looks like
  98.117 +            // something eats the "<html><hea" off the front of the data that
  98.118 +            // gets returned.
  98.119 +            //
  98.120 +            // This test makes an allowance for that behavior. I figure testing
  98.121 +            // the likely "last bit" is better than testing a bit that is close
  98.122 +            // to the data that seems to get eaten.
  98.123 +            //
  98.124 +            isSecure = false;
  98.125 +        } else if (response.indexOf("connection: ") != -1) {
  98.126 +            isSecure = false;
  98.127 +        }
  98.128 +        return isSecure;
  98.129 +    }
  98.130 +
  98.131 +
  98.132 +    public static void main(String[] args) throws IOException{
  98.133 +        String host = args[0];
  98.134 +        int port = Integer.parseInt(args[1]);
  98.135 +        System.out.println("host: " + " port: " + port);
  98.136 +        System.out.println("isSecure: " + isSecurePort(host,port));
  98.137 +    }
  98.138 +
  98.139 +
  98.140 +    /**
  98.141 +     *  This is the test query used to ping the server in an attempt to
  98.142 +     *  determine if it is secure or not.
  98.143 +     */
  98.144 +    public static byte [] TEST_QUERY = new byte [] {
  98.145 +        // The following SSL query is from nmap (http://www.insecure.org)
  98.146 +        // This HTTPS request should work for most (all?) https servers
  98.147 +        (byte)0x16, (byte)0x03, (byte)0x00, (byte)0x00, (byte) 'S', (byte)0x01,
  98.148 +        (byte)0x00, (byte)0x00, (byte) 'O', (byte)0x03, (byte)0x00, (byte) '?',
  98.149 +        (byte) 'G', (byte)0xd7, (byte)0xf7, (byte)0xba, (byte) ',', (byte)0xee,
  98.150 +        (byte)0xea, (byte)0xb2, (byte) '`', (byte) '~', (byte)0xf3, (byte)0x00,
  98.151 +        (byte)0xfd, (byte)0x82, (byte) '{', (byte)0xb9, (byte)0xd5, (byte)0x96,
  98.152 +        (byte)0xc8, (byte) 'w', (byte)0x9b, (byte)0xe6, (byte)0xc4, (byte)0xdb,
  98.153 +        (byte) '<', (byte) '=', (byte)0xdb, (byte) 'o', (byte)0xef, (byte)0x10,
  98.154 +        (byte) 'n', (byte)0x00, (byte)0x00, (byte) '(', (byte)0x00, (byte)0x16,
  98.155 +        (byte)0x00, (byte)0x13, (byte)0x00, (byte)0x0a, (byte)0x00, (byte) 'f',
  98.156 +        (byte)0x00, (byte)0x05, (byte)0x00, (byte)0x04, (byte)0x00, (byte) 'e',
  98.157 +        (byte)0x00, (byte) 'd', (byte)0x00, (byte) 'c', (byte)0x00, (byte) 'b',
  98.158 +        (byte)0x00, (byte) 'a', (byte)0x00, (byte) '`', (byte)0x00, (byte)0x15,
  98.159 +        (byte)0x00, (byte)0x12, (byte)0x00, (byte)0x09, (byte)0x00, (byte)0x14,
  98.160 +        (byte)0x00, (byte)0x11, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x06,
  98.161 +        (byte)0x00, (byte)0x03, (byte)0x01, (byte)0x00,
  98.162 +        // The following is a HTTP request, some HTTP servers won't
  98.163 +        // respond unless the following is also sent
  98.164 +        (byte) 'G', (byte) 'E', (byte) 'T', (byte) ' ', (byte) '/',
  98.165 +        // change the detector to request something that the monitor knows to filter
  98.166 +        //  out.  This will work-around 109891. Use the longest filtered prefix to
  98.167 +        //  avoid false positives....
  98.168 +        (byte) 'c', (byte) 'o', (byte) 'm', (byte) '_', (byte) 's', (byte) 'u',
  98.169 +        (byte) 'n', (byte) '_', (byte) 'w', (byte) 'e', (byte) 'b', (byte) '_',
  98.170 +        (byte) 'u', (byte) 'i',
  98.171 +        (byte) ' ',
  98.172 +        (byte) 'H', (byte) 'T', (byte) 'T', (byte) 'P', (byte) '/', (byte) '1',
  98.173 +        (byte) '.', (byte) '0', (byte)'\n', (byte)'\n'
  98.174 +    };
  98.175 +}
  98.176 +
  98.177 +
    99.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppConfigUtil.java	Fri Jun 10 09:46:37 2011 +0200
    99.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppConfigUtil.java	Sun Jun 26 10:25:14 2011 +0800
    99.3 @@ -65,9 +65,8 @@
    99.4                  throw new ReadAccessDeniedException();
    99.5              }
    99.6           }
    99.7 +        
    99.8            logger.log(Level.FINEST,"XmlRoot is :: "+xmlRoot);
    99.9 -          InputSource inputSource = 
   99.10 -              new InputSource(new FileInputStream(xmlRoot));
   99.11            
   99.12            doc = createDocumentFromXml(xmlRoot);   
   99.13            
   99.14 @@ -230,7 +229,12 @@
   99.15          
   99.16          return debugOptionsVal;
   99.17      }
   99.18 -    private XPath getXPath()
   99.19 +
   99.20 +    public String getJMXConnectorPort() {
   99.21 +        return getAdminPort();
   99.22 +    }
   99.23 +    
   99.24 +    protected XPath getXPath()
   99.25      {
   99.26          XPathFactory xpathFactory = XPathFactory.newInstance();
   99.27          XPath xpath = xpathFactory.newXPath();
   99.28 @@ -250,6 +254,10 @@
   99.29          Document document = builder.parse(file);
   99.30          return document;
   99.31      }
   99.32 +
   99.33 +    public Document getDocument() {
   99.34 +        return doc;
   99.35 +    }
   99.36      
   99.37      
   99.38      public static void main(String[] args) throws SAXException, IOException, ParserConfigurationException
   100.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppIncrementalDeployment.java	Fri Jun 10 09:46:37 2011 +0200
   100.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppIncrementalDeployment.java	Sun Jun 26 10:25:14 2011 +0800
   100.3 @@ -41,17 +41,21 @@
   100.4  
   100.5  import java.io.File;
   100.6  import java.io.IOException;
   100.7 -import javax.enterprise.deploy.spi.DeploymentManager;
   100.8 +import javax.enterprise.deploy.shared.CommandType;
   100.9 +import javax.enterprise.deploy.shared.StateType;
  100.10  import javax.enterprise.deploy.spi.Target;
  100.11  import javax.enterprise.deploy.spi.TargetModuleID;
  100.12  import javax.enterprise.deploy.spi.status.ProgressObject;
  100.13  import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
  100.14  import org.netbeans.modules.j2ee.deployment.plugins.api.AppChangeDescriptor;
  100.15 +import org.netbeans.modules.j2ee.deployment.plugins.api.DeploymentChangeDescriptor;
  100.16  import org.netbeans.modules.j2ee.deployment.plugins.spi.IncrementalDeployment;
  100.17  import org.netbeans.modules.j2ee.deployment.plugins.spi.config.ModuleConfiguration;
  100.18  import org.netbeans.modules.portalpack.servers.core.PSDeployer;
  100.19  import org.netbeans.modules.portalpack.servers.core.PSDeployerImpl;
  100.20  import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  100.21 +import org.netbeans.modules.portalpack.servers.core.common.ShortCircuitProgressObject;
  100.22 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.ServerDeployHandler;
  100.23  import org.openide.filesystems.FileObject;
  100.24  import org.openide.filesystems.FileUtil;
  100.25  import org.openide.util.Exceptions;
  100.26 @@ -86,13 +90,42 @@
  100.27  
  100.28      @Override
  100.29      public ProgressObject incrementalDeploy(TargetModuleID module, AppChangeDescriptor changes) {
  100.30 -        PSDeployer deployer = new PSDeployerImpl((PSDeploymentManager)dm, "",0);
  100.31 -        return deployer;
  100.32 +      if(changes.classesChanged() || changes.descriptorChanged()
  100.33 +              || changes.serverDescriptorChanged()) {
  100.34 +            final ServerDeployHandler deployHandler = dm.getServerDeployHandler();
  100.35 +            if(deployHandler == null) {
  100.36 +                return new ShortCircuitProgressObject(CommandType.REDEPLOY,
  100.37 +                        "No Deployment Required",
  100.38 +                        StateType.COMPLETED,new TargetModuleID[] { module });
  100.39 +            }
  100.40 +
  100.41 +            try {
  100.42 +                String moduleID = module.getModuleID();
  100.43 +                deployHandler.restart(moduleID);
  100.44 +            } catch (Exception ex) {
  100.45 +                ex.printStackTrace();
  100.46 +            }
  100.47 +
  100.48 +            return new ShortCircuitProgressObject(CommandType.REDEPLOY,
  100.49 +                        "DEPLOYMENT_DONE",
  100.50 +                        StateType.COMPLETED,new TargetModuleID[] { module });
  100.51 +            
  100.52 +        } else {
  100.53 +            return new ShortCircuitProgressObject(CommandType.REDEPLOY,
  100.54 +                        "No Deployment Required",
  100.55 +                        StateType.COMPLETED,new TargetModuleID[] { module });
  100.56 +        }
  100.57          
  100.58      }
  100.59  
  100.60      @Override
  100.61 -    public boolean canFileDeploy(Target target, J2eeModule deployable) {
  100.62 +    public ProgressObject deployOnSave(TargetModuleID module, DeploymentChangeDescriptor desc) {
  100.63 +        return incrementalDeploy(module, desc);
  100.64 +    }
  100.65 +
  100.66 +
  100.67 +    @Override
  100.68 +    public boolean canFileDeploy(Target target, J2eeModule deployable) {        
  100.69           if(dm.getPSConfig().isDirectoryDeployment())
  100.70              return true;
  100.71          else
  100.72 @@ -108,17 +141,28 @@
  100.73  
  100.74      @Override
  100.75      public File getDirectoryForNewModule(File appDir, String uri, J2eeModule module, ModuleConfiguration configuration) {
  100.76 -        throw new UnsupportedOperationException("Not supported yet.");
  100.77 +        return null;
  100.78      }
  100.79  
  100.80      @Override
  100.81      public File getDirectoryForModule(TargetModuleID module) {
  100.82 -        throw new UnsupportedOperationException("Not supported yet.");
  100.83 +        ServerDeployHandler deployHandler = dm.getServerDeployHandler();
  100.84 +        if(deployHandler == null)
  100.85 +            return null;
  100.86 +
  100.87 +        File f = deployHandler.getModuleDirectory(module);
  100.88 +        
  100.89 +        return f;
  100.90 +       
  100.91      }
  100.92  
  100.93      @Override
  100.94      public boolean isDeployOnSaveSupported() {
  100.95 -        return true;
  100.96 +        ServerDeployHandler deployHandler = dm.getServerDeployHandler();
  100.97 +        if(deployHandler == null)
  100.98 +            return false;
  100.99 +
 100.100 +        return deployHandler.isDeployOnSaveSupported();
 100.101      }
 100.102      
 100.103  }
   101.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerConfigPanel.form	Fri Jun 10 09:46:37 2011 +0200
   101.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerConfigPanel.form	Sun Jun 26 10:25:14 2011 +0800
   101.3 @@ -9,6 +9,7 @@
   101.4    <AuxValues>
   101.5      <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
   101.6      <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
   101.7 +    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
   101.8      <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
   101.9      <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
  101.10      <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
   102.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerConfigPanel.java	Fri Jun 10 09:46:37 2011 +0200
   102.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerConfigPanel.java	Sun Jun 26 10:25:14 2011 +0800
   102.3 @@ -32,13 +32,16 @@
   102.4  import javax.swing.text.AbstractDocument;
   102.5  import javax.swing.text.Document;
   102.6  import javax.swing.text.DocumentFilter;
   102.7 +import javax.xml.parsers.ParserConfigurationException;
   102.8  import org.netbeans.modules.portalpack.servers.core.WizardPropertyReader;
   102.9  import org.netbeans.modules.portalpack.servers.core.api.ConfigPanel;
  102.10 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver.SunAppConfigUtil.ReadAccessDeniedException;
  102.11  import org.netbeans.modules.portalpack.servers.core.util.NetbeanConstants;
  102.12  import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  102.13  import org.netbeans.modules.portalpack.servers.core.util.Util;
  102.14  import org.openide.WizardDescriptor;
  102.15  import org.openide.util.NbBundle;
  102.16 +import org.xml.sax.SAXException;
  102.17  import org.xml.sax.SAXParseException;
  102.18  
  102.19  /**
  102.20 @@ -48,7 +51,7 @@
  102.21  public class SunAppServerConfigPanel extends ConfigPanel implements SunAppServerConstants, DocumentListener{
  102.22      
  102.23      private static Logger logger = Logger.getLogger(NetbeanConstants.PORTAL_LOGGER);
  102.24 -    
  102.25 +
  102.26      /** Creates new form SunAppServerConfigPanel */
  102.27      public SunAppServerConfigPanel() {
  102.28          initComponents();
  102.29 @@ -342,9 +345,10 @@
  102.30      private void populateAllDefaultValues()
  102.31      {
  102.32          String domainDir = domainDirTf.getText();
  102.33 +        String homeDir = homeTf.getText();
  102.34          SunAppConfigUtil configUtil = null;
  102.35          try {
  102.36 -            configUtil = new SunAppConfigUtil(new File(domainDir));
  102.37 +           configUtil = getConfigUtil(homeDir,domainDir);
  102.38          } catch (SAXParseException ex) {      
  102.39              setErrorMessage(NbBundle.getMessage(SunAppServerConfigPanel.class,"INVALID_DOMAIN_XML"));
  102.40              fireChangeEvent();
  102.41 @@ -370,7 +374,7 @@
  102.42              return;
  102.43          }
  102.44           
  102.45 -         setErrorMessage("");
  102.46 +        setErrorMessage("");
  102.47          String port = configUtil.getPort();
  102.48          portTf.setText(port);
  102.49          String adminPort =  configUtil.getAdminPort();
  102.50 @@ -378,6 +382,16 @@
  102.51          domainTf.setText(configUtil.getDomainName());
  102.52          fireChangeEvent();
  102.53      }
  102.54 +
  102.55 +    private SunAppConfigUtil getConfigUtil(String homeDir,String domainDir)
  102.56 +            throws IOException, SAXException, ParserConfigurationException, ReadAccessDeniedException {
  102.57 +
  102.58 +        if(SunAppServerJEELibraries.getGlassFishVersion(homeDir).equals(
  102.59 +                    SunAppServerConstants.GLASSFISH_V2))
  102.60 +             return new SunAppConfigUtil(new File(domainDir));
  102.61 +         else
  102.62 +             return new GlassfishV3ConfigUtil(new File(domainDir));
  102.63 +    }
  102.64      
  102.65      private void clearDomainXmlData()
  102.66      {
  102.67 @@ -418,9 +432,23 @@
  102.68          wr.setDomainDir(domainDirTf.getText());
  102.69          wr.setAdminPort(adminPortTf.getText());
  102.70          wr.setDefaultDomain(domainTf.getText());
  102.71 +        wr.setAdminUser(userNameTf.getText());//same as server user
  102.72          wr.setProperty(SERVER_USER,userNameTf.getText());
  102.73          wr.setProperty(SERVER_PASSWORD,new String(passwordTf.getPassword()));
  102.74          wr.setPort(portTf.getText());
  102.75 +
  102.76 +        String gf_version = SunAppServerJEELibraries.getGlassFishVersion(wr.getServerHome());
  102.77 +        wr.setProperty(SunAppServerConstants.GLASSFISH_VERSON, gf_version);
  102.78 +        
  102.79 +        SunAppConfigUtil configUtil = null;
  102.80 +        try {
  102.81 +           configUtil = getConfigUtil(wr.getServerHome(),wr.getDomainDir());
  102.82 +           wr.setProperty(SunAppServerConstants.JMX_CONNECTOR_PORT, configUtil.getJMXConnectorPort());
  102.83 +        } catch (Exception ex) {      
  102.84 +            ex.printStackTrace();
  102.85 +            wr.setProperty(SunAppServerConstants.JMX_CONNECTOR_PORT, "8989");
  102.86 +        }
  102.87 +
  102.88      }
  102.89  
  102.90      public boolean validate(Object wizardDescriptor) {
  102.91 @@ -439,7 +467,7 @@
  102.92          String domainDir = domainDirTf.getText();
  102.93          SunAppConfigUtil configUtil = null;
  102.94          try {
  102.95 -            configUtil = new SunAppConfigUtil(new File(domainDir));
  102.96 +            configUtil = getConfigUtil(home,domainDir);
  102.97          } catch (SAXParseException ex) {
  102.98              
  102.99              setErrorMessage(NbBundle.getMessage(SunAppServerConfigPanel.class,"INVALID_DOMAIN_XML"));
   103.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerConstants.java	Fri Jun 10 09:46:37 2011 +0200
   103.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerConstants.java	Sun Jun 26 10:25:14 2011 +0800
   103.3 @@ -26,6 +26,7 @@
   103.4  public interface SunAppServerConstants {
   103.5      public static String SERVER_USER = "SERVER_USER";
   103.6      public static String SERVER_PASSWORD = "SERVER_PASSWORD";
   103.7 +    public static String JMX_CONNECTOR_PORT = "jmx_connector_port";
   103.8      
   103.9      public static String GLASSFISH_VERSON = "Glassfish_version";
  103.10      
   104.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   104.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerJEELibraries.java	Sun Jun 26 10:25:14 2011 +0800
   104.3 @@ -0,0 +1,222 @@
   104.4 +/*
   104.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   104.6 + * 
   104.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   104.8 + * 
   104.9 + * The contents of this file are subject to the terms of either the GNU
  104.10 + * General Public License Version 2 only ("GPL") or the Common
  104.11 + * Development and Distribution License("CDDL") (collectively, the
  104.12 + * "License"). You may not use this file except in compliance with the
  104.13 + * License. You can obtain a copy of the License at
  104.14 + * http://www.netbeans.org/cddl-gplv2.html
  104.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  104.16 + * specific language governing permissions and limitations under the
  104.17 + * License.  When distributing the software, include this License Header
  104.18 + * Notice in each file and include the License file at
  104.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  104.20 + * particular file as subject to the "Classpath" exception as provided
  104.21 + * by Sun in the GPL Version 2 section of the License file that
  104.22 + * accompanied this code. If applicable, add the following below the
  104.23 + * License Header, with the fields enclosed by brackets [] replaced by
  104.24 + * your own identifying information:
  104.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  104.26 + * 
  104.27 + * If you wish your version of this file to be governed by only the CDDL
  104.28 + * or only the GPL Version 2, indicate your decision by adding
  104.29 + * "[Contributor] elects to include this software in this distribution
  104.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  104.31 + * single choice of license, a recipient has the option to distribute
  104.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  104.33 + * to extend the choice of license to its licensees as provided above.
  104.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  104.35 + * Version 2 license, then the option applies only if the new code is
  104.36 + * made subject to such option by the copyright holder.
  104.37 + * 
  104.38 + * Contributor(s):
  104.39 + * 
  104.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  104.41 + */
  104.42 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver;
  104.43 +
  104.44 +import java.io.File;
  104.45 +import java.io.FilenameFilter;
  104.46 +import java.util.ArrayList;
  104.47 +import java.util.List;
  104.48 +import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform;
  104.49 +import org.netbeans.modules.portalpack.servers.core.WizardPropertyReader;
  104.50 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibraries;
  104.51 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  104.52 +import org.openide.WizardDescriptor;
  104.53 +
  104.54 +/**
  104.55 + *
  104.56 + * @author satyaranjan
  104.57 + */
  104.58 +public class SunAppServerJEELibraries implements JEEServerLibraries {
  104.59 +
  104.60 +    public List<File> getJEEServerLibraries(PSConfigObject psconfig) {
  104.61 +
  104.62 +        String version = getGlassFishVersion(psconfig.getServerHome());
  104.63 +
  104.64 +        List<File> jars = new ArrayList();
  104.65 +
  104.66 +        if (version.equals(SunAppServerConstants.GLASSFISH_V2)) {
  104.67 +            String[] libs = {"javaee.jar", "appserv-jstl.jar"};
  104.68 +
  104.69 +            for (int k = 0; k < libs.length; k++) {
  104.70 +                File libJar = new File(psconfig.getServerHome() + File.separator + "lib" + File.separator + libs[k]);
  104.71 +                if (libJar.exists()) {
  104.72 +                    jars.add(libJar);
  104.73 +                }
  104.74 +            }
  104.75 +        } else {
  104.76 +
  104.77 +            File modulesFolder = new File(psconfig.getServerHome() + File.separator + "modules");
  104.78 +            File[] files = modulesFolder.listFiles(new FilenameFilter() {
  104.79 +
  104.80 +                public boolean accept(File dir, String name) {
  104.81 +
  104.82 +                    if (name.startsWith("javax.")) {
  104.83 +                        return true;
  104.84 +                    }
  104.85 +                    return false;
  104.86 +                }
  104.87 +            });
  104.88 +
  104.89 +            if (files != null && files.length != 0) {
  104.90 +                for (File f : files) {
  104.91 +                    jars.add(f);
  104.92 +                }
  104.93 +            }
  104.94 +
  104.95 +            File webFolder = new File(modulesFolder, "web");
  104.96 +            File jstlJar = new File(webFolder, "jstl-impl.jar");
  104.97 +            if (jstlJar.exists()) {
  104.98 +
  104.99 +                jars.add(jstlJar);
 104.100 +            }
 104.101 +        }
 104.102 +
 104.103 +        return jars;
 104.104 +
 104.105 +    }
 104.106 +
 104.107 +    public String getPortalServerLibraryLocation(WizardPropertyReader wr) {
 104.108 +        String domainDir = wr.getDomainDir();
 104.109 +        return domainDir + File.separator + "lib";
 104.110 +    }
 104.111 +
 104.112 +    public String getPortalServerLibraryLocation(PSConfigObject pc) {
 104.113 +        String domainDir = pc.getDomainDir();
 104.114 +        return domainDir + File.separator + "lib";
 104.115 +    }
 104.116 +
 104.117 +    public String getWebAppInstallDirectory(WizardPropertyReader wr) {
 104.118 +        return _getGlassfishApplicationDeployDir(wr.getDomainDir(), wr.getServerHome());
 104.119 +    }
 104.120 +
 104.121 +    public String getWebAppInstallDirectory(PSConfigObject pc) {
 104.122 +        return _getGlassfishApplicationDeployDir(pc.getDomainDir(), pc.getServerHome());
 104.123 +    }
 104.124 +
 104.125 +    public String getJEELibraryLocation(WizardPropertyReader wr) {
 104.126 +        return _getGlassfishJavaEELibraryLocation(wr.getServerHome());
 104.127 +    }
 104.128 +
 104.129 +    public String getJEELibraryLocation(PSConfigObject pc) {
 104.130 +        return _getGlassfishJavaEELibraryLocation(pc.getServerHome());
 104.131 +    }
 104.132 +
 104.133 +    public String getAppServerLibraryLocation(WizardPropertyReader wr) {
 104.134 +        return _getGlassfishJavaEELibraryLocation(wr.getServerHome());
 104.135 +    }
 104.136 +
 104.137 +    public String getAppServerLibraryLocation(PSConfigObject pc) {
 104.138 +        return _getGlassfishJavaEELibraryLocation(pc.getServerHome());
 104.139 +    }
 104.140 +
 104.141 +    public static String getGlassFishVersion(String glassfishHome) {
 104.142 +
 104.143 +        File javaeeFile = new File(glassfishHome + File.separator + "lib" + File.separator + "javaee.jar");
 104.144 +        File module = new File(glassfishHome + File.separator + "modules");
 104.145 +
 104.146 +        if (!javaeeFile.exists() && module.exists()) {
 104.147 +            return SunAppServerConstants.GLASSFISH_V3;
 104.148 +        }
 104.149 +
 104.150 +        if(javaeeFile.exists() && module.exists()) {
 104.151 +            File ejbJar = new File(module,"javax.servlet.jar");
 104.152 +            if(ejbJar.exists()) {
 104.153 +                return SunAppServerConstants.GLASSFISH_V3;
 104.154 +            }
 104.155 +        }
 104.156 +
 104.157 +        return SunAppServerConstants.GLASSFISH_V2;
 104.158 +    }
 104.159 +
 104.160 +    private static String _getGlassfishApplicationDeployDir(String domainDir, String serverHome) {
 104.161 +
 104.162 +        String version = getGlassFishVersion(serverHome);
 104.163 +        String deployDir = null;
 104.164 +
 104.165 +        if (version.equals(SunAppServerConstants.GLASSFISH_V2)) {
 104.166 +            deployDir = domainDir + File.separator +
 104.167 +                    "applications" + File.separator +
 104.168 +                    "j2ee-modules";
 104.169 +        } else {
 104.170 +            deployDir = domainDir + File.separator +
 104.171 +                    "applications";
 104.172 +        }
 104.173 +
 104.174 +        return deployDir;
 104.175 +    }
 104.176 +
 104.177 +    private static String _getGlassfishJavaEELibraryLocation(String serverHome) {
 104.178 +
 104.179 +        String version = getGlassFishVersion(serverHome);
 104.180 +
 104.181 +        if (version.equals(SunAppServerConstants.GLASSFISH_V2)) {
 104.182 +            return serverHome + File.separator + "lib";
 104.183 +
 104.184 +        } else {
 104.185 +            return serverHome + File.separator + "modules";
 104.186 +        }
 104.187 +
 104.188 +    }
 104.189 +
 104.190 +    public boolean isToolSupported(String toolName, PSConfigObject psconfig) {
 104.191 +         if (J2eePlatform.TOOL_WSCOMPILE.equals(toolName)) {
 104.192 +             return true;
 104.193 +         }
 104.194 +         return false;
 104.195 +    }
 104.196 +
 104.197 +    private static final String APPSERV_WS_JAR = "lib/appserv-ws.jar"; //NOI18N
 104.198 +     // wsit jars
 104.199 +    private static final String WEBSERVICES_RT_JAR = "lib/webservices-rt.jar"; //NOI18N
 104.200 +    private static final String WEBSERVICES_TOOLS_JAR = "lib/webservices-tools.jar"; //NOI18N
 104.201 +
 104.202 +    public File[] getToolClasspathEntries(String toolName, PSConfigObject psconfig) {
 104.203 +         if (J2eePlatform.TOOL_WSCOMPILE.equals(toolName)) {
 104.204 +
 104.205 +            String serverHome = psconfig.getServerHome();
 104.206 +            String serverLib = serverHome + File.separator + "lib";
 104.207 +            String version = serverHome;
 104.208 +            
 104.209 +                return new File[] {
 104.210 +                    new File(serverLib, "j2ee.jar"),             //NOI18N
 104.211 +                    new File(serverLib, "saaj-api.jar"),         //NOI18N
 104.212 +                    new File(serverLib, "saaj-impl.jar"),        //NOI18N
 104.213 +                    new File(serverLib, "jaxrpc-api.jar"),       //NOI18N
 104.214 +                    new File(serverLib, "jaxrpc-impl.jar"),      //NOI18N
 104.215 +                    new File(serverLib, "endorsed/jaxp-api.jar"),//NOI18N
 104.216 +                    new File(serverHome, APPSERV_WS_JAR),        // possibly for AS 9
 104.217 +                    new File(serverHome, WEBSERVICES_TOOLS_JAR), // possibly for AS 9.1
 104.218 +                    new File(serverHome, WEBSERVICES_RT_JAR),    // possibly for AS 9.1
 104.219 +                };
 104.220 +            
 104.221 +        }
 104.222 +
 104.223 +       return new File[0];
 104.224 +    }
 104.225 +}
   105.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerStartServer.java	Fri Jun 10 09:46:37 2011 +0200
   105.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/sunappserver/SunAppServerStartServer.java	Sun Jun 26 10:25:14 2011 +0800
   105.3 @@ -34,7 +34,9 @@
   105.4  import org.netbeans.modules.portalpack.servers.core.util.Command;
   105.5  import org.netbeans.modules.portalpack.servers.core.util.NetbeanConstants;
   105.6  import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
   105.7 +import org.openide.DialogDisplayer;
   105.8  import org.openide.ErrorManager;
   105.9 +import org.openide.NotifyDescriptor;
  105.10  import org.xml.sax.SAXException;
  105.11  
  105.12  /**
  105.13 @@ -45,25 +47,26 @@
  105.14      private static Logger logger = Logger.getLogger(NetbeanConstants.PORTAL_LOGGER);
  105.15      private PSDeploymentManager dm;
  105.16      private PSConfigObject psconfig;
  105.17 +    private String storedMPW = null;
  105.18      /** Creates a new instance of SunAppServerStartServer */
  105.19      public SunAppServerStartServer(PSDeploymentManager dm) {
  105.20          this.dm = dm;
  105.21          this.psconfig = dm.getPSConfig();
  105.22      }
  105.23  
  105.24 -    public void doStartServer() throws Exception {  
  105.25 +    public void doStartServer(String[] env) throws Exception {
  105.26          File pwdFile = prepareTempPWDFile();
  105.27 -        runProcess(makeStartCommand(pwdFile), true); //NO I18N
  105.28 +        runProcess(makeStartCommand(pwdFile),env, true); //NO I18N
  105.29          pwdFile.delete();
  105.30          viewAdminLogs();      
  105.31      }
  105.32          
  105.33 -    public void doStopServer() throws Exception {       
  105.34 -        runProcess(makeStopCommand(), true); //NO I18N       
  105.35 +    public void doStopServer(String[] env) throws Exception {
  105.36 +        runProcess(makeStopCommand(),env, true); //NO I18N
  105.37      }
  105.38       
  105.39 -    private int runProcess(Command cmd, boolean wait) throws Exception {
  105.40 -        final Process child = Runtime.getRuntime().exec(cmd.getCmdArray());
  105.41 +    private int runProcess(Command cmd, String[] env,boolean wait) throws Exception {
  105.42 +        final Process child = Runtime.getRuntime().exec(cmd.getCmdArray(),setEnv(env));
  105.43               
  105.44          LogManager manager = new LogManager(dm);
  105.45          manager.openServerLog(child,cmd.toString() + System.currentTimeMillis());
  105.46 @@ -72,16 +75,52 @@
  105.47          return child.exitValue(); 
  105.48          
  105.49      }
  105.50 +
  105.51 +     private String[] setEnv(String[] addEnv) {
  105.52 +
  105.53 +        if(addEnv == null)
  105.54 +            return null;
  105.55 +        int addLength = addEnv.length;
  105.56 +        String[] env = new String[1 + addLength];
  105.57 +
  105.58 +        //needed for Windows OS
  105.59 +        String systemRoot = System.getenv("SystemRoot");
  105.60 +        if (systemRoot == null) {
  105.61 +            systemRoot = "";
  105.62 +        }
  105.63 +        env[0] = "SystemRoot=" + systemRoot;
  105.64 +        System.out.println(System.getenv("SystemRoot"));
  105.65 +        if(addLength > 0) {
  105.66 +            for(int i=0;i<addEnv.length;i++) {
  105.67 +                env[1+i] = addEnv[i];
  105.68 +            }
  105.69 +        }
  105.70 +
  105.71 +        return env;
  105.72 +    }
  105.73      
  105.74 -    private File prepareTempPWDFile() throws IOException
  105.75 +    private File prepareTempPWDFile() throws Exception
  105.76      {   
  105.77          File file = File.createTempFile("pwd", null);
  105.78          if(file.exists())
  105.79              file.deleteOnExit();
  105.80          FileOutputStream fout = null;
  105.81 +        String mpw = null;
  105.82 +        try{
  105.83 +            mpw = readMasterPasswordFile();
  105.84 +            if(mpw == null) {
  105.85 +                throw new Exception("Bad Master Password. Could not start the server.");
  105.86 +            }
  105.87 +        }catch(IllegalStateException e) {
  105.88 +            throw new Exception("Could not start server without Master Password.");
  105.89 +        }
  105.90          try {
  105.91               fout = new FileOutputStream(file);
  105.92               fout.write(new String("AS_ADMIN_PASSWORD="+psconfig.getProperty(SunAppServerConstants.SERVER_PASSWORD)).getBytes());
  105.93 +             fout.write(new String("\nAS_ADMIN_ADMINPASSWORD="+psconfig.getProperty(SunAppServerConstants.SERVER_PASSWORD)).getBytes());
  105.94 +             if(mpw != null && mpw.trim().length() != 0)
  105.95 +                fout.write(new String("\nAS_ADMIN_MASTERPASSWORD="+mpw).getBytes());
  105.96 +
  105.97               fout.flush();
  105.98          } catch (FileNotFoundException ex) {
  105.99              throw ex;
 105.100 @@ -105,12 +144,28 @@
 105.101              ext = ".bat";
 105.102          }
 105.103          cmd.add(psconfig.getServerHome() + File.separator + "bin" + File.separator + "asadmin" + ext);
 105.104 -        cmd.add("start-domain"); 
 105.105 -        cmd.add("--user");
 105.106 -        cmd.add(psconfig.getProperty(SunAppServerConstants.SERVER_USER));
 105.107 -        cmd.add("--passwordfile");
 105.108 -        cmd.add(passwordFile.getAbsolutePath());
 105.109 -        cmd.add(psconfig.getDefaultDomain());
 105.110 +
 105.111 +        String gfVersion = getGlassFishVersion();
 105.112 +
 105.113 +        if(SunAppServerConstants.GLASSFISH_V2.equals(gfVersion)) {
 105.114 +
 105.115 +            cmd.add("start-domain");
 105.116 +            cmd.add("--user");
 105.117 +            cmd.add(psconfig.getProperty(SunAppServerConstants.SERVER_USER));
 105.118 +            cmd.add("--passwordfile");
 105.119 +            cmd.add(passwordFile.getAbsolutePath());
 105.120 +            cmd.add(psconfig.getDefaultDomain());
 105.121 +
 105.122 +        } else if(SunAppServerConstants.GLASSFISH_V3.equals(gfVersion)) {
 105.123 +
 105.124 +            cmd.add("--user");
 105.125 +            cmd.add(psconfig.getProperty(SunAppServerConstants.SERVER_USER));
 105.126 +            cmd.add("--passwordfile");
 105.127 +            cmd.add(passwordFile.getAbsolutePath());
 105.128 +            cmd.add("start-domain");
 105.129 +            cmd.add(psconfig.getDefaultDomain());
 105.130 +
 105.131 +        }
 105.132                  
 105.133          logger.info(cmd.toString());    
 105.134          logger.info("Password file: "+passwordFile.toString());
 105.135 @@ -141,13 +196,29 @@
 105.136              ext = ".bat";
 105.137          }
 105.138          cmd.add(psconfig.getServerHome() + File.separator + "bin" + File.separator + "asadmin" + ext);
 105.139 -        cmd.add("start-domain"); 
 105.140 -        cmd.add("--user");
 105.141 -        cmd.add(psconfig.getProperty(SunAppServerConstants.SERVER_USER));
 105.142 -        cmd.add("--passwordfile");
 105.143 -        cmd.add(passwordFile.getAbsolutePath());
 105.144 -        cmd.add("--debug=true");
 105.145 -        cmd.add(psconfig.getDefaultDomain());
 105.146 +
 105.147 +        String gfVersion = getGlassFishVersion();
 105.148 +
 105.149 +        if(SunAppServerConstants.GLASSFISH_V2.equals(gfVersion)) {
 105.150 +
 105.151 +            cmd.add("start-domain");
 105.152 +            cmd.add("--user");
 105.153 +            cmd.add(psconfig.getProperty(SunAppServerConstants.SERVER_USER));
 105.154 +            cmd.add("--passwordfile");
 105.155 +            cmd.add(passwordFile.getAbsolutePath());
 105.156 +            cmd.add("--debug=true");
 105.157 +            cmd.add(psconfig.getDefaultDomain());
 105.158 +            
 105.159 +        } else if(SunAppServerConstants.GLASSFISH_V3.equals(gfVersion)) {
 105.160 +
 105.161 +            cmd.add("--user");
 105.162 +            cmd.add(psconfig.getProperty(SunAppServerConstants.SERVER_USER));
 105.163 +            cmd.add("--passwordfile");
 105.164 +            cmd.add(passwordFile.getAbsolutePath());
 105.165 +            cmd.add("start-domain"); 
 105.166 +            cmd.add("--debug=true");
 105.167 +            cmd.add(psconfig.getDefaultDomain());
 105.168 +        }
 105.169                  
 105.170          logger.info(cmd.toString());    
 105.171          logger.info("Password file: "+passwordFile.toString());
 105.172 @@ -166,15 +237,15 @@
 105.173          }
 105.174      }
 105.175  
 105.176 -    public void doStartDebug() throws Exception {
 105.177 +    public void doStartDebug(String[] env) throws Exception {
 105.178          File pwdFile = prepareTempPWDFile();
 105.179 -        runProcess(makeStartDebugCommand(pwdFile), true); //NO I18N
 105.180 +        runProcess(makeStartDebugCommand(pwdFile),env, true); //NO I18N
 105.181          pwdFile.delete();
 105.182          viewAdminLogs();
 105.183      }
 105.184  
 105.185 -    public void doStopDebug() throws Exception {
 105.186 -        doStopServer();
 105.187 +    public void doStopDebug(String[] env) throws Exception {
 105.188 +        doStopServer(env);
 105.189      }
 105.190  
 105.191      public int getDebugPort(){
 105.192 @@ -192,7 +263,7 @@
 105.193              logger.log(Level.SEVERE,"Error",ex);
 105.194              return 0;
 105.195          } catch (IOException ex) {
 105.196 -            logger.log(Level.SEVERE,"Error",ex);
 105.197 +            ex.printStackTrace();
 105.198              return 0;
 105.199          } catch(Exception ex){
 105.200              logger.log(Level.SEVERE,"Error",ex);
 105.201 @@ -202,8 +273,131 @@
 105.202          
 105.203      }
 105.204  
 105.205 +    /* can return null if no mpw is known or entered by user
 105.206 +     **/
 105.207 +    private static final String MASTER_PASSWORD_ALIAS="master-password";//NOI18N
 105.208 +    private char[] getMasterPasswordPassword() {
 105.209 +        return MASTER_PASSWORD_ALIAS.toCharArray();
 105.210 +    }
 105.211 +    private String readMasterPasswordFile() throws IllegalStateException {
 105.212 +        String mpw= "changeit";//NOI18N
 105.213 +
 105.214 +        //String lDomain = psconfig.getDefaultDomain();
 105.215 +        String lDomainDir = psconfig.getDomainDir();
 105.216 +        //final File pwdFile = new File(lDomainDir + File.separator + lDomain  +File.separator+"master-password");
 105.217 +        final File pwdFile = new File(lDomainDir + File.separator+"master-password");
 105.218 +        if (pwdFile.exists()) {
 105.219 +            try {
 105.220 +                ClassLoader loader = ((GlassFishServerDeployHandler)dm.getServerDeployHandler()).getServerClassLoader(new File(psconfig.getServerHome()));
 105.221 +                Class pluginRootFactoryClass =loader.loadClass("com.sun.enterprise.security.store.PasswordAdapter");//NOI18N
 105.222 +                java.lang.reflect.Constructor constructor =pluginRootFactoryClass.getConstructor(new Class[] {String.class, getMasterPasswordPassword().getClass()});
 105.223 +                Object PasswordAdapter =constructor.newInstance(new Object[] {pwdFile.getAbsolutePath(),getMasterPasswordPassword() });
 105.224 +                Class PasswordAdapterClazz = PasswordAdapter.getClass();
 105.225 +                java.lang.reflect.Method method =PasswordAdapterClazz.getMethod("getPasswordForAlias", new Class[]{  MASTER_PASSWORD_ALIAS.getClass()});//NOI18N
 105.226 +                mpw = (String)method.invoke(PasswordAdapter, new Object[] {MASTER_PASSWORD_ALIAS });
 105.227 +
 105.228 +                return mpw;
 105.229 +            } catch (Exception ex) {
 105.230 +                //    ex.printStackTrace();
 105.231 +                return mpw;
 105.232 +            }
 105.233 +        } else {
 105.234 +            if (null == storedMPW) {
 105.235 +                MasterPasswordInputDialog d = new MasterPasswordInputDialog();
 105.236 +                if (DialogDisplayer.getDefault().notify(d) == NotifyDescriptor.OK_OPTION) {
 105.237 +                    mpw = d.getInputText();
 105.238 +                    //now validate the password:
 105.239 +                    try {
 105.240 +
 105.241 +                        File pwdFile2 = new File(lDomainDir + File.separator + "config/domain-passwords");
 105.242 +                        ClassLoader loader = ((GlassFishServerDeployHandler)dm.getServerDeployHandler()).getServerClassLoader(new File(psconfig.getServerHome()));
 105.243 +                        Class pluginRootFactoryClass = loader.loadClass("com.sun.enterprise.security.store.PasswordAdapter");//NOI18N
 105.244 +                        java.lang.reflect.Constructor constructor = pluginRootFactoryClass.getConstructor(new Class[]{String.class, getMasterPasswordPassword().getClass()});
 105.245 +                        //this would throw an ioexception of the password is not the good one
 105.246 +                        constructor.newInstance(new Object[]{pwdFile2.getAbsolutePath(), mpw.toCharArray()});
 105.247 +                        storedMPW = mpw;
 105.248 +                        return mpw;
 105.249 +
 105.250 +                    } catch (Exception ex) {
 105.251 +                        ex.printStackTrace();
 105.252 +                        return null;
 105.253 +                    }
 105.254 +                } else {
 105.255 +                    throw new IllegalStateException();
 105.256 +                }
 105.257 +            } else {
 105.258 +                return storedMPW;
 105.259 +            }
 105.260 +        }
 105.261 +    }
 105.262 +
 105.263 +//    public String getStartUpScripts() {
 105.264 +//        String ext = "";
 105.265 +//        String varName = "$JAVA_OPTS";
 105.266 +//        String customScript = psconfig.getProperty(PSStartServerInf.USE_CUSTOM_STARTUP_SCRIPT);
 105.267 +//        if(customScript == null || customScript.trim().length() == 0)
 105.268 +//            return "asadmin";
 105.269 +//
 105.270 +//        try {
 105.271 +//            if (org.openide.util.Utilities.isWindows()) {
 105.272 +//                ext = ".bat";
 105.273 +//                varName = "%JAVA_OPTS%";
 105.274 +//            }
 105.275 +//            File customAsAdmin = new File(psconfig.getServerHome() + File.separator + "bin" + File.separator + "asadmin_netbeans" + ext);
 105.276 +//            if (customAsAdmin.exists()) {
 105.277 +//                return "asadmin_netbeans";
 105.278 +//            }
 105.279 +//            File binFolder = new File(psconfig.getServerHome() + File.separator + "bin");
 105.280 +//            File asAdmin = new File(binFolder, "asadmin" + ext);
 105.281 +//            //FileUtil.copyFile(FileUtil.toFileObject(asAdmin), FileUtil.toFileObject(binFolder), "asadmin_netbeans");
 105.282 +//
 105.283 +//            BufferedReader rd = new BufferedReader(new FileReader(asAdmin));
 105.284 +//            BufferedWriter bw = new BufferedWriter(new FileWriter(customAsAdmin));
 105.285 +//
 105.286 +//            String line = rd.readLine();
 105.287 +//
 105.288 +//            while(line != null) {
 105.289 +//
 105.290 +//                StringTokenizer st = new StringTokenizer(line," ");
 105.291 +//                if(st.hasMoreTokens()) {
 105.292 +//                    String token = st.nextToken();
 105.293 +//                    if(token.indexOf("java") != -1) {
 105.294 +//                        line = line.replace(token, token + " " + varName + " ");
 105.295 +//                    }
 105.296 +//                }
 105.297 +//                bw.write(line);
 105.298 +//                bw.write("\n");
 105.299 +//                line = rd.readLine();
 105.300 +//                System.out.println(line);
 105.301 +//            }
 105.302 +//
 105.303 +//            if(bw != null) {
 105.304 +//                bw.flush();
 105.305 +//                bw.close();
 105.306 +//            }
 105.307 +//
 105.308 +//            if(rd != null) {
 105.309 +//                rd.close();
 105.310 +//            }
 105.311 +//
 105.312 +//        } catch (IOException ex) {
 105.313 +//            ex.printStackTrace();
 105.314 +//        }
 105.315 +//
 105.316 +//        return "asadmin_netbeans";
 105.317 +//
 105.318 +//    }
 105.319 +
 105.320      public FindJSPServlet getFindJSPServlet(PSDeploymentManager dm) {
 105.321          return new SunAppFindJSPServletImpl(dm);
 105.322      }
 105.323 +
 105.324 +    private String getGlassFishVersion() {
 105.325 +        String gfVersion = psconfig.getProperty(SunAppServerConstants.GLASSFISH_VERSON);
 105.326 +        if (gfVersion == null || gfVersion.trim().length() == 0) {
 105.327 +            gfVersion = SunAppServerConstants.GLASSFISH_V2;
 105.328 +        }
 105.329 +        return gfVersion;
 105.330 +    }
 105.331      
 105.332  }
   106.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatConfigPanel.form	Fri Jun 10 09:46:37 2011 +0200
   106.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatConfigPanel.form	Sun Jun 26 10:25:14 2011 +0800
   106.3 @@ -40,13 +40,9 @@
   106.4                    </Group>
   106.5                </Group>
   106.6                <Group type="103" groupAlignment="0" attributes="0">
   106.7 -                  <Group type="102" alignment="0" attributes="0">
   106.8 -                      <Group type="103" groupAlignment="1" max="-2" attributes="0">
   106.9 -                          <Component id="debugPortTf" linkSize="1" alignment="0" pref="122" max="32767" attributes="1"/>
  106.10 -                          <Component id="portTf" linkSize="1" alignment="0" pref="122" max="32767" attributes="1"/>
  106.11 -                      </Group>
  106.12 -                      <EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
  106.13 -                      <Component id="isSecureCB" min="-2" max="-2" attributes="0"/>
  106.14 +                  <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
  106.15 +                      <Component id="debugPortTf" linkSize="1" alignment="0" pref="122" max="32767" attributes="1"/>
  106.16 +                      <Component id="portTf" linkSize="1" alignment="0" pref="122" max="32767" attributes="1"/>
  106.17                    </Group>
  106.18                    <Group type="102" alignment="0" attributes="0">
  106.19                        <Group type="103" groupAlignment="1" max="-2" attributes="0">
  106.20 @@ -89,7 +85,6 @@
  106.21                <Group type="103" groupAlignment="3" attributes="0">
  106.22                    <Component id="portTf" alignment="3" min="-2" max="-2" attributes="0"/>
  106.23                    <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
  106.24 -                  <Component id="isSecureCB" alignment="3" max="32767" attributes="0"/>
  106.25                </Group>
  106.26                <EmptySpace min="-2" max="-2" attributes="0"/>
  106.27                <Group type="103" groupAlignment="3" attributes="0">
  106.28 @@ -180,15 +175,5 @@
  106.29      </Component>
  106.30      <Component class="javax.swing.JTextField" name="debugPortTf">
  106.31      </Component>
  106.32 -    <Component class="javax.swing.JCheckBox" name="isSecureCB">
  106.33 -      <Properties>
  106.34 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  106.35 -          <ResourceString bundle="org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/Bundle.properties" key="LBL_IS_SECURE" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  106.36 -        </Property>
  106.37 -      </Properties>
  106.38 -      <Events>
  106.39 -        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="isSecureCBActionPerformed"/>
  106.40 -      </Events>
  106.41 -    </Component>
  106.42    </SubComponents>
  106.43  </Form>
   107.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatConfigPanel.java	Fri Jun 10 09:46:37 2011 +0200
   107.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatConfigPanel.java	Sun Jun 26 10:25:14 2011 +0800
   107.3 @@ -86,7 +86,6 @@
   107.4          portTf = new javax.swing.JTextField();
   107.5          jLabel7 = new javax.swing.JLabel();
   107.6          debugPortTf = new javax.swing.JTextField();
   107.7 -        isSecureCB = new javax.swing.JCheckBox();
   107.8  
   107.9          jLabel1.setText(org.openide.util.NbBundle.getMessage(TomcatConfigPanel.class, "LBL_CATALINA_HOME")); // NOI18N
  107.10  
  107.11 @@ -126,13 +125,6 @@
  107.12          jLabel7.setLabelFor(debugPortTf);
  107.13          jLabel7.setText(org.openide.util.NbBundle.getMessage(TomcatConfigPanel.class, "LBL_DEBUG_PORT")); // NOI18N
  107.14  
  107.15 -        isSecureCB.setText(org.openide.util.NbBundle.getMessage(TomcatConfigPanel.class, "LBL_IS_SECURE")); // NOI18N
  107.16 -        isSecureCB.addActionListener(new java.awt.event.ActionListener() {
  107.17 -            public void actionPerformed(java.awt.event.ActionEvent evt) {
  107.18 -                isSecureCBActionPerformed(evt);
  107.19 -            }
  107.20 -        });
  107.21 -
  107.22          org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
  107.23          this.setLayout(layout);
  107.24          layout.setHorizontalGroup(
  107.25 @@ -156,12 +148,9 @@
  107.26                          .add(jLabel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE)
  107.27                          .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)))
  107.28                  .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  107.29 -                    .add(layout.createSequentialGroup()
  107.30 -                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
  107.31 -                            .add(org.jdesktop.layout.GroupLayout.LEADING, debugPortTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE)
  107.32 -                            .add(org.jdesktop.layout.GroupLayout.LEADING, portTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE))
  107.33 -                        .add(28, 28, 28)
  107.34 -                        .add(isSecureCB))
  107.35 +                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
  107.36 +                        .add(org.jdesktop.layout.GroupLayout.LEADING, debugPortTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE)
  107.37 +                        .add(org.jdesktop.layout.GroupLayout.LEADING, portTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE))
  107.38                      .add(layout.createSequentialGroup()
  107.39                          .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
  107.40                              .add(baseTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
  107.41 @@ -174,10 +163,10 @@
  107.42                  .addContainerGap())
  107.43          );
  107.44  
  107.45 +        layout.linkSize(new java.awt.Component[] {baseTf, homeTf, javacombo}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
  107.46 +
  107.47          layout.linkSize(new java.awt.Component[] {debugPortTf, portTf}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
  107.48  
  107.49 -        layout.linkSize(new java.awt.Component[] {baseTf, homeTf, javacombo}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
  107.50 -
  107.51          layout.setVerticalGroup(
  107.52              layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  107.53              .add(layout.createSequentialGroup()
  107.54 @@ -198,8 +187,7 @@
  107.55                  .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  107.56                  .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  107.57                      .add(portTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  107.58 -                    .add(jLabel6)
  107.59 -                    .add(isSecureCB, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  107.60 +                    .add(jLabel6))
  107.61                  .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  107.62                  .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  107.63                      .add(debugPortTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  107.64 @@ -225,7 +213,7 @@
  107.65      private void baseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_baseButtonActionPerformed
  107.66          
  107.67          DirectoryChooser chooser = new DirectoryChooser();
  107.68 -        String dir = browseInstallLocation(System.getProperty("netbeans.user"));
  107.69 +        String dir = browseInstallLocation(System.getProperty("user.home"));
  107.70          if(dir != null) {
  107.71              baseTf.setText(dir);
  107.72              populateAllDefaultValues();
  107.73 @@ -236,7 +224,7 @@
  107.74  // TODO add your handling code here:
  107.75          
  107.76          DirectoryChooser chooser = new DirectoryChooser();
  107.77 -        String dir = browseInstallLocation(System.getProperty("netbeans.user"));
  107.78 +        String dir = browseInstallLocation(System.getProperty("user.home"));
  107.79          if(dir != null)
  107.80              homeTf.setText(dir);
  107.81          if(!checkIfValueAlreadySet(baseTf))
  107.82 @@ -248,10 +236,6 @@
  107.83              populateAllDefaultValues();
  107.84      }//GEN-LAST:event_homeButtonActionPerformed
  107.85  
  107.86 -    private void isSecureCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_isSecureCBActionPerformed
  107.87 -        // TODO add your handling code here:
  107.88 -}//GEN-LAST:event_isSecureCBActionPerformed
  107.89 -
  107.90      private String browseInstallLocation(String defaultDir){
  107.91          String insLocation = null;
  107.92          JFileChooser chooser = getJFileChooser(defaultDir);
  107.93 @@ -361,6 +345,12 @@
  107.94          
  107.95          homeTf.setText(object.getProperty(CATALINA_HOME));
  107.96          baseTf.setText(object.getProperty(CATALINA_BASE));
  107.97 +        homeTf.setEnabled(false);
  107.98 +        baseTf.setEnabled(false);
  107.99 +        
 107.100 +        homeButton.setEnabled(false);
 107.101 +        baseButton.setEnabled(false);
 107.102 +        
 107.103          //tomcatUserNameTf.setText(object.getProperty(MANAGER_USER));
 107.104          //tomcatPasswordTf.setText(object.getProperty(MANAGER_PASSWORD));
 107.105          
 107.106 @@ -369,7 +359,7 @@
 107.107          if(javaHomeObject != null)
 107.108          {
 107.109              javacombo.setSelectedItem(javaHomeObject);
 107.110 -            javacombo.setEnabled(false);
 107.111 +            //javacombo.setEnabled(false);
 107.112          }
 107.113          else{
 107.114             
 107.115 @@ -382,7 +372,7 @@
 107.116      
 107.117      public void read(WizardDescriptor wizardDescriptor) {
 107.118          //wd = wizardDescriptor;
 107.119 -        logger.info("Inside read of TomcatConfigPanel...................");
 107.120 +        //logger.info("Inside read of TomcatConfigPanel...................");
 107.121                  
 107.122      }
 107.123      
 107.124 @@ -538,7 +528,6 @@
 107.125      private javax.swing.JTextField debugPortTf;
 107.126      private javax.swing.JButton homeButton;
 107.127      private javax.swing.JTextField homeTf;
 107.128 -    private javax.swing.JCheckBox isSecureCB;
 107.129      private javax.swing.JLabel jLabel1;
 107.130      private javax.swing.JLabel jLabel4;
 107.131      private javax.swing.JLabel jLabel5;
 107.132 @@ -563,7 +552,19 @@
 107.133          public String getJavaHome() {
 107.134              return javaHome;
 107.135          }
 107.136 -        
 107.137 +
 107.138 +        @Override
 107.139 +        public boolean equals(Object obj) {
 107.140 +            if(obj == null)
 107.141 +                return false;
 107.142 +            if(!(obj instanceof JavaHome))
 107.143 +                return false;
 107.144 +            if(this.toString().equalsIgnoreCase(((JavaHome)obj).toString()))
 107.145 +                return true;
 107.146 +            else
 107.147 +                return false;
 107.148 +        }
 107.149 +      
 107.150      }
 107.151      
 107.152      
   108.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatDeployHandler.java	Fri Jun 10 09:46:37 2011 +0200
   108.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatDeployHandler.java	Sun Jun 26 10:25:14 2011 +0800
   108.3 @@ -18,29 +18,45 @@
   108.4   */
   108.5  package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.tomcat;
   108.6  
   108.7 +import java.io.BufferedReader;
   108.8  import java.io.File;
   108.9  import java.io.FileNotFoundException;
  108.10  import java.io.FileOutputStream;
  108.11  import java.io.IOException;
  108.12  import java.io.InputStream;
  108.13 +import java.io.InputStreamReader;
  108.14  import java.io.OutputStream;
  108.15 +import java.io.PrintWriter;
  108.16 +import java.net.InetSocketAddress;
  108.17 +import java.net.Socket;
  108.18 +import java.util.ArrayList;
  108.19 +import java.util.HashMap;
  108.20 +import java.util.List;
  108.21 +import java.util.Map;
  108.22  import java.util.Properties;
  108.23  import java.util.logging.Level;
  108.24  import java.util.logging.Logger;
  108.25 +import javax.enterprise.deploy.spi.Target;
  108.26 +import javax.enterprise.deploy.spi.TargetModuleID;
  108.27 +import javax.xml.parsers.DocumentBuilder;
  108.28 +import javax.xml.parsers.DocumentBuilderFactory;
  108.29  import org.apache.tools.ant.module.api.support.ActionUtils;
  108.30 +import org.netbeans.modules.portalpack.servers.core.PSModuleID;
  108.31  import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  108.32 -import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.ServerDeployHandler;
  108.33 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.DefaultServerDeployHandler;
  108.34  import org.netbeans.modules.portalpack.servers.core.util.NetbeanConstants;
  108.35  import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  108.36  import org.openide.filesystems.FileObject;
  108.37  import org.openide.filesystems.FileUtil;
  108.38  import org.openide.util.Exceptions;
  108.39 +import org.w3c.dom.Document;
  108.40 +import org.w3c.dom.Element;
  108.41  
  108.42  /**
  108.43   *
  108.44   * @author root
  108.45   */
  108.46 -public class TomcatDeployHandler implements ServerDeployHandler {
  108.47 +public class TomcatDeployHandler extends DefaultServerDeployHandler {
  108.48  
  108.49      private static Logger logger = Logger.getLogger(NetbeanConstants.PORTAL_LOGGER);
  108.50      private PSConfigObject psconfig;
  108.51 @@ -227,4 +243,139 @@
  108.52      public boolean deploy(String deployDir, String contextName) {
  108.53          throw new UnsupportedOperationException("Not supported yet.");
  108.54      }
  108.55 +
  108.56 +    @Override
  108.57 +    public boolean isDeployOnSaveSupported() {
  108.58 +        return true;
  108.59 +    }
  108.60 +
  108.61 +    @Override
  108.62 +    public TargetModuleID[] getAvailableModules(Target[] target) {
  108.63 +        String[] portlets = dm.getTaskHandler().getPortlets(null);
  108.64 +        if(portlets == null || portlets.length ==0)
  108.65 +            return new TargetModuleID[0];
  108.66 +        if(target == null || target.length == 0)
  108.67 +            return new TargetModuleID[0];
  108.68 +
  108.69 +        Map map = new HashMap();
  108.70 +        List<TargetModuleID> list = new ArrayList();
  108.71 +        for(String portlet:portlets) {
  108.72 +
  108.73 +            String appName = portlet;
  108.74 +            int index = appName.lastIndexOf(".");
  108.75 +            if(index != -1) {
  108.76 +                appName = portlet.substring(0,index);
  108.77 +            }
  108.78 +
  108.79 +            if(map.get(appName) == null) {
  108.80 +                map.put(appName, appName);
  108.81 +                list.add(new PSModuleID(target[0], appName, appName + ".war"));
  108.82 +            }
  108.83 +        }
  108.84 +        return  (TargetModuleID[]) list.toArray(new TargetModuleID[0]);
  108.85 +    }
  108.86 +
  108.87 +    @Override
  108.88 +    public void restart(String contextRoot) throws Exception {
  108.89 +        File confDir = new File(psconfig.getProperty(TomcatConstant.CATALINA_HOME)
  108.90 +                                        + File.separator + TOMCAT_CONF_DIR);
  108.91 +        String contextXml = contextRoot + ".xml";
  108.92 +
  108.93 +        File contextXmlFile = new File(confDir,contextXml);
  108.94 +        contextXmlFile.setLastModified(System.currentTimeMillis());
  108.95 +    }
  108.96 +
  108.97 +    @Override
  108.98 +    public boolean isServerRunning() {
  108.99 +        /** Return true if a Tomcat server is running on the specifed port */
 108.100 +        int timeout = 2000;
 108.101 +        int port = Integer.parseInt(psconfig.getPort());
 108.102 +        // checking whether a socket can be created is not reliable enough, see #47048
 108.103 +        Socket socket = new Socket();
 108.104 +        try {
 108.105 +            try {
 108.106 +                socket.connect(new InetSocketAddress("localhost", port), timeout); // NOI18N
 108.107 +                socket.setSoTimeout(timeout);
 108.108 +                PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
 108.109 +                try {
 108.110 +                    BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
 108.111 +                    try {
 108.112 +                        // request
 108.113 +                        out.println("HEAD /netbeans-tomcat-status-test HTTP/1.1\nHost: localhost:" + port + "\n"); // NOI18N
 108.114 +
 108.115 +                        // response
 108.116 +                        String text = in.readLine();
 108.117 +                        if (text == null || !text.startsWith("HTTP/")) { // NOI18N
 108.118 +                            return false; // not an http response
 108.119 +                        }
 108.120 +                        Map headerFileds = new HashMap();
 108.121 +                        while ((text = in.readLine()) != null && text.length() > 0) {
 108.122 +                            int colon = text.indexOf(':');
 108.123 +                            if (colon <= 0) {
 108.124 +                                return false; // not an http header
 108.125 +                            }
 108.126 +                            String name = text.substring(0, colon).trim();
 108.127 +                            String value = text.substring(colon + 1).trim();
 108.128 +                            List list = (List) headerFileds.get(name);
 108.129 +                            if (list == null) {
 108.130 +                                list = new ArrayList();
 108.131 +                                headerFileds.put(name, list);
 108.132 +                            }
 108.133 +                            list.add(value);
 108.134 +                        }
 108.135 +                        List/*<String>*/ server = (List/*<String>*/) headerFileds.get("Server"); // NIO18N
 108.136 +                        if (server != null) {
 108.137 +                            if (server.contains("Apache-Coyote/1.1")) { // NOI18N
 108.138 +                                if (headerFileds.get("X-Powered-By") == null) { // NIO18N
 108.139 +                                    // if X-Powered-By header is set, it is probably jboss
 108.140 +                                    return true;
 108.141 +                                }
 108.142 +                            } else if (server.contains("Sun-Java-System/Web-Services-Pack-1.4")) {  // NOI18N
 108.143 +                                // it is probably Tomcat with JWSDP installed
 108.144 +                                return true;
 108.145 +                            }
 108.146 +                        }
 108.147 +                        return false;
 108.148 +                    } finally {
 108.149 +                        in.close();
 108.150 +                    }
 108.151 +                } finally {
 108.152 +                    out.close();
 108.153 +                }
 108.154 +            } finally {
 108.155 +                socket.close();
 108.156 +            }
 108.157 +        } catch (Exception ioe) {
 108.158 +            return false;
 108.159 +        }
 108.160 +    }
 108.161 +
 108.162 +    @Override
 108.163 +    public File getModuleDirectory(TargetModuleID module) {
 108.164 +        try{
 108.165 +            String contextRoot = module.getModuleID();
 108.166 +            File confDir = new File(psconfig.getProperty(TomcatConstant.CATALINA_HOME) + File.separator + TOMCAT_CONF_DIR);
 108.167 +            String contextXml = contextRoot + ".xml";
 108.168 +
 108.169 +            File contextXmlFile = new File(confDir, contextXml);
 108.170 +            if (!contextXmlFile.exists()) {
 108.171 +                return null;
 108.172 +            }
 108.173 +
 108.174 +            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
 108.175 +            DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
 108.176 +            Document doc = docBuilder.parse(contextXmlFile);
 108.177 +            Element elm = doc.getDocumentElement();
 108.178 +            String docBase = elm.getAttribute("docBase");
 108.179 +            File docBaseFile = new File(docBase);
 108.180 +            if(docBaseFile.exists())
 108.181 +                return docBaseFile;
 108.182 +            else
 108.183 +                return null;
 108.184 +        }catch(Throwable t) {
 108.185 +            return null;
 108.186 +        }
 108.187 +
 108.188 +    }
 108.189 +    
 108.190  }
   109.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatIncrementalDeployment.java	Fri Jun 10 09:46:37 2011 +0200
   109.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatIncrementalDeployment.java	Sun Jun 26 10:25:14 2011 +0800
   109.3 @@ -41,16 +41,21 @@
   109.4  
   109.5  import java.io.File;
   109.6  import java.io.IOException;
   109.7 +import javax.enterprise.deploy.shared.CommandType;
   109.8 +import javax.enterprise.deploy.shared.StateType;
   109.9  import javax.enterprise.deploy.spi.Target;
  109.10  import javax.enterprise.deploy.spi.TargetModuleID;
  109.11  import javax.enterprise.deploy.spi.status.ProgressObject;
  109.12  import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
  109.13  import org.netbeans.modules.j2ee.deployment.plugins.api.AppChangeDescriptor;
  109.14 +import org.netbeans.modules.j2ee.deployment.plugins.api.DeploymentChangeDescriptor;
  109.15  import org.netbeans.modules.j2ee.deployment.plugins.spi.IncrementalDeployment;
  109.16  import org.netbeans.modules.j2ee.deployment.plugins.spi.config.ModuleConfiguration;
  109.17  import org.netbeans.modules.portalpack.servers.core.PSDeployer;
  109.18  import org.netbeans.modules.portalpack.servers.core.PSDeployerImpl;
  109.19  import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  109.20 +import org.netbeans.modules.portalpack.servers.core.common.ShortCircuitProgressObject;
  109.21 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.ServerDeployHandler;
  109.22  import org.openide.filesystems.FileObject;
  109.23  import org.openide.filesystems.FileUtil;
  109.24  import org.openide.util.Exceptions;
  109.25 @@ -84,11 +89,40 @@
  109.26  
  109.27      @Override
  109.28      public ProgressObject incrementalDeploy(TargetModuleID module, AppChangeDescriptor changes) {
  109.29 -        PSDeployer deployer = new PSDeployerImpl((PSDeploymentManager)dm, "",0);
  109.30 -        return deployer;
  109.31 +
  109.32 +        if(changes.classesChanged() || changes.serverDescriptorChanged()
  109.33 +                   || changes.descriptorChanged()) {
  109.34 +            final ServerDeployHandler deployHandler = dm.getServerDeployHandler();
  109.35 +            if(deployHandler == null) {
  109.36 +                return new ShortCircuitProgressObject(CommandType.REDEPLOY,
  109.37 +                        "No Deployment Required",
  109.38 +                        StateType.COMPLETED,new TargetModuleID[] { module });
  109.39 +            }
  109.40 +
  109.41 +            try {
  109.42 +                String moduleID = module.getModuleID();
  109.43 +                deployHandler.restart(moduleID);
  109.44 +            } catch (Exception ex) {
  109.45 +                ex.printStackTrace();
  109.46 +            }
  109.47 +            return new ShortCircuitProgressObject(CommandType.REDEPLOY,
  109.48 +                "DEPLOYMENT_DONE",
  109.49 +                StateType.COMPLETED,new TargetModuleID[] { module });
  109.50 +            
  109.51 +        } else {
  109.52 +            return new ShortCircuitProgressObject(CommandType.REDEPLOY,
  109.53 +                        "No Deployment Required",
  109.54 +                        StateType.COMPLETED,new TargetModuleID[] { module });
  109.55 +        }
  109.56          
  109.57      }
  109.58  
  109.59 +     @Override
  109.60 +    public ProgressObject deployOnSave(TargetModuleID module, DeploymentChangeDescriptor desc) {
  109.61 +
  109.62 +        return incrementalDeploy(module, desc);
  109.63 +    }
  109.64 +
  109.65      @Override
  109.66      public boolean canFileDeploy(Target target, J2eeModule deployable) {
  109.67          
  109.68 @@ -106,16 +140,25 @@
  109.69  
  109.70      @Override
  109.71      public File getDirectoryForNewModule(File appDir, String uri, J2eeModule module, ModuleConfiguration configuration) {
  109.72 -        throw new UnsupportedOperationException("Not supported yet.");
  109.73 +        return null;
  109.74      }
  109.75  
  109.76      @Override
  109.77      public File getDirectoryForModule(TargetModuleID module) {
  109.78 -        throw new UnsupportedOperationException("Not supported yet.");
  109.79 +        ServerDeployHandler deployHandler = dm.getServerDeployHandler();
  109.80 +        if(deployHandler == null)
  109.81 +            return null;
  109.82 +
  109.83 +        File f = deployHandler.getModuleDirectory(module);
  109.84 +        return f;
  109.85      }
  109.86  
  109.87      @Override
  109.88      public boolean isDeployOnSaveSupported() {
  109.89 -        return true;
  109.90 +        ServerDeployHandler deployHandler = dm.getServerDeployHandler();
  109.91 +        if(deployHandler == null)
  109.92 +            return false;
  109.93 +
  109.94 +        return deployHandler.isDeployOnSaveSupported();
  109.95      }
  109.96  }
   110.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatJEELibraries.java	Sun Jun 26 10:25:14 2011 +0800
   110.3 @@ -0,0 +1,170 @@
   110.4 +/*
   110.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   110.6 + * 
   110.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   110.8 + * 
   110.9 + * The contents of this file are subject to the terms of either the GNU
  110.10 + * General Public License Version 2 only ("GPL") or the Common
  110.11 + * Development and Distribution License("CDDL") (collectively, the
  110.12 + * "License"). You may not use this file except in compliance with the
  110.13 + * License. You can obtain a copy of the License at
  110.14 + * http://www.netbeans.org/cddl-gplv2.html
  110.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  110.16 + * specific language governing permissions and limitations under the
  110.17 + * License.  When distributing the software, include this License Header
  110.18 + * Notice in each file and include the License file at
  110.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  110.20 + * particular file as subject to the "Classpath" exception as provided
  110.21 + * by Sun in the GPL Version 2 section of the License file that
  110.22 + * accompanied this code. If applicable, add the following below the
  110.23 + * License Header, with the fields enclosed by brackets [] replaced by
  110.24 + * your own identifying information:
  110.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  110.26 + * 
  110.27 + * If you wish your version of this file to be governed by only the CDDL
  110.28 + * or only the GPL Version 2, indicate your decision by adding
  110.29 + * "[Contributor] elects to include this software in this distribution
  110.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  110.31 + * single choice of license, a recipient has the option to distribute
  110.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  110.33 + * to extend the choice of license to its licensees as provided above.
  110.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  110.35 + * Version 2 license, then the option applies only if the new code is
  110.36 + * made subject to such option by the copyright holder.
  110.37 + * 
  110.38 + * Contributor(s):
  110.39 + * 
  110.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  110.41 + */
  110.42 +package org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.tomcat;
  110.43 +
  110.44 +import java.io.File;
  110.45 +import java.util.ArrayList;
  110.46 +import java.util.List;
  110.47 +import org.netbeans.modules.portalpack.servers.core.WizardPropertyReader;
  110.48 +import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
  110.49 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibraries;
  110.50 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  110.51 +
  110.52 +/**
  110.53 + *
  110.54 + * @author satyaranjan
  110.55 + */
  110.56 +public class TomcatJEELibraries implements JEEServerLibraries {
  110.57 +
  110.58 +    public List<File> getJEEServerLibraries(PSConfigObject psconfig) {
  110.59 +
  110.60 +        List<File> jars = new ArrayList();
  110.61 +
  110.62 +        String[] libs = {"servlet-api.jar", "jsp-api.jar", "annotations-api.jar"};
  110.63 +        String serverLibDir = getJEELibraryLocation(psconfig);
  110.64 +        for (int k = 0; k < libs.length; k++) {
  110.65 +            File libJar = new File(serverLibDir + File.separator + libs[k]);
  110.66 +            if (libJar.exists()) {
  110.67 +
  110.68 +                jars.add(libJar);
  110.69 +            }
  110.70 +        }
  110.71 +        
  110.72 +        return jars;
  110.73 +    }
  110.74 +
  110.75 +    public String getPortalServerLibraryLocation(WizardPropertyReader wr) {
  110.76 +        String serverType = wr.getServerType();
  110.77 +        String tomcatHome = wr.getProperty(TomcatConstant.CATALINA_HOME);
  110.78 +        return _getPortalServerLibraryLocation(serverType, tomcatHome);
  110.79 +    }
  110.80 +
  110.81 +    public String getPortalServerLibraryLocation(PSConfigObject pc) {
  110.82 +        String serverType = pc.getServerType();
  110.83 +        String tomcatHome = pc.getProperty(TomcatConstant.CATALINA_HOME);
  110.84 +        return _getPortalServerLibraryLocation(serverType, tomcatHome);
  110.85 +    }
  110.86 +
  110.87 +    private String _getPortalServerLibraryLocation(String serverType, String tomcatHome) {
  110.88 +        
  110.89 +        if (serverType.equals(ServerConstants.TOMCAT_5_X)) {
  110.90 +
  110.91 +            return tomcatHome + File.separator + "common" +
  110.92 +                    File.separator + "lib" +
  110.93 +                    File.separator + "ext";
  110.94 +
  110.95 +        } else if (serverType.equals(ServerConstants.TOMCAT_6_X)) {
  110.96 +
  110.97 +            return tomcatHome + File.separator + "lib" + File.separator + "ext";
  110.98 +        }
  110.99 +        return "";
 110.100 +    }
 110.101 +
 110.102 +    public String getWebAppInstallDirectory(WizardPropertyReader wr) {
 110.103 +        String tomcatHome = wr.getProperty(TomcatConstant.CATALINA_HOME);
 110.104 +        return tomcatHome + File.separator + "webapps";
 110.105 +    }
 110.106 +
 110.107 +    public String getWebAppInstallDirectory(PSConfigObject pc) {
 110.108 +        String tomcatHome = pc.getProperty(TomcatConstant.CATALINA_HOME);
 110.109 +        return tomcatHome + File.separator + "webapps";
 110.110 +    }
 110.111 +
 110.112 +    public String getJEELibraryLocation(WizardPropertyReader wr) {
 110.113 +        String serverType = wr.getServerType();
 110.114 +        String tomcatHome = wr.getProperty(TomcatConstant.CATALINA_HOME);
 110.115 +        return _getJEELibraryLocation(serverType, tomcatHome);
 110.116 +    }
 110.117 +
 110.118 +    public String getJEELibraryLocation(PSConfigObject pc) {
 110.119 +        String serverType = pc.getServerType();
 110.120 +        String tomcatHome = pc.getProperty(TomcatConstant.CATALINA_HOME);
 110.121 +        return _getJEELibraryLocation(serverType, tomcatHome);
 110.122 +    }
 110.123 +
 110.124 +    private String _getJEELibraryLocation(String serverType, String tomcatHome) {
 110.125 +        if (serverType.equals(ServerConstants.TOMCAT_5_X)) {
 110.126 +
 110.127 +            return tomcatHome + File.separator + "common" +
 110.128 +                    File.separator + "lib";
 110.129 +
 110.130 +        } else if (serverType.equals(ServerConstants.TOMCAT_6_X)) {
 110.131 +
 110.132 +            return tomcatHome + File.separator + "lib";
 110.133 +
 110.134 +        }
 110.135 +        return "";
 110.136 +    }
 110.137 +
 110.138 +    public String getAppServerLibraryLocation(WizardPropertyReader wr) {
 110.139 +        String serverType = wr.getServerType();
 110.140 +        String tomcatHome = wr.getProperty(TomcatConstant.CATALINA_HOME);
 110.141 +
 110.142 +        return _getAppServerLibraryLocation(serverType, tomcatHome);
 110.143 +    }
 110.144 +
 110.145 +    public String getAppServerLibraryLocation(PSConfigObject pc) {
 110.146 +        String serverType = pc.getServerType();
 110.147 +        String tomcatHome = pc.getProperty(TomcatConstant.CATALINA_HOME);
 110.148 +
 110.149 +        return _getAppServerLibraryLocation(serverType, tomcatHome);
 110.150 +    }
 110.151 +
 110.152 +    private String _getAppServerLibraryLocation(String serverType, String tomcatHome) {
 110.153 +        if (serverType.equals(ServerConstants.TOMCAT_5_X)) {
 110.154 +
 110.155 +            return tomcatHome + File.separator + "server" +
 110.156 +                    File.separator + "lib";
 110.157 +
 110.158 +        } else if (serverType.equals(ServerConstants.TOMCAT_6_X)) {
 110.159 +
 110.160 +            return tomcatHome + File.separator + "lib";
 110.161 +        }
 110.162 +
 110.163 +        return "";
 110.164 +    }
 110.165 +
 110.166 +    public boolean isToolSupported(String toolName, PSConfigObject psconfig) {
 110.167 +        return false;
 110.168 +    }
 110.169 +
 110.170 +    public File[] getToolClasspathEntries(String toolName, PSConfigObject psconfig) {
 110.171 +        return new File[0];
 110.172 +    }
 110.173 +}
   111.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatStartServer.java	Fri Jun 10 09:46:37 2011 +0200
   111.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/impl/j2eeservers/tomcat/TomcatStartServer.java	Sun Jun 26 10:25:14 2011 +0800
   111.3 @@ -74,25 +74,25 @@
   111.4          this.psconfig = dm.getPSConfig();
   111.5      }
   111.6  
   111.7 -    public void doStartServer() throws Exception {
   111.8 +    public void doStartServer(String[] env) throws Exception {
   111.9          NbProcessDescriptor nd = defaultExecDesc(TAG_EXEC_CMD, TAG_EXEC_STARTUP);
  111.10 -        runProcess(CMD_START, nd, setEnv(), true);
  111.11 +        runProcess(CMD_START, nd, setEnv(env), true);
  111.12      //viewLogs();
  111.13      }
  111.14  
  111.15 -    public void doStopServer() throws Exception {
  111.16 +    public void doStopServer(String[] env) throws Exception {
  111.17          NbProcessDescriptor nd = defaultExecDesc(TAG_EXEC_CMD, TAG_EXEC_SHUTDOWN);
  111.18 -        runProcess(CMD_STOP, nd, setEnv(), true);
  111.19 +        runProcess(CMD_STOP, nd, setEnv(env), true);
  111.20      }
  111.21      
  111.22 -    public void doStartDebug() throws Exception {
  111.23 +    public void doStartDebug(String[] env) throws Exception {
  111.24          NbProcessDescriptor nd = defaultDebugStartDesc (TAG_DEBUG_CMD, TAG_JPDA_STARTUP);
  111.25          runProcess(CMD_START, nd, setDebugEnv(), true);
  111.26      }
  111.27  
  111.28 -    public void doStopDebug() throws Exception {
  111.29 +    public void doStopDebug(String[] env) throws Exception {
  111.30          NbProcessDescriptor nd = defaultExecDesc(TAG_EXEC_CMD, TAG_EXEC_SHUTDOWN);
  111.31 -        runProcess(CMD_STOP, nd, setEnv(), true);
  111.32 +        runProcess(CMD_STOP, nd, setEnv(env), true);
  111.33      }
  111.34  
  111.35      public int getDebugPort() {
  111.36 @@ -169,9 +169,12 @@
  111.37          return 0;
  111.38  
  111.39      }
  111.40 -    private String[] setEnv() {
  111.41 +    private String[] setEnv(String[] addEnv) {
  111.42  
  111.43 -        String[] env = new String[5];
  111.44 +        int addLength = 0;
  111.45 +        if(addEnv != null)
  111.46 +            addLength = addEnv.length;
  111.47 +        String[] env = new String[5 + addLength];
  111.48          env[0] = "CATALINA_HOME=" + psconfig.getProperty(CATALINA_HOME);
  111.49          env[1] = "CATALINA_BASE=" + psconfig.getProperty(CATALINA_BASE);
  111.50          env[2] = "JRE_HOME=" + psconfig.getProperty(JAVA_HOME);
  111.51 @@ -185,6 +188,11 @@
  111.52          }
  111.53          env[4] = "SystemRoot=" + systemRoot;
  111.54          System.out.println(System.getenv("SystemRoot"));
  111.55 +        if(addLength > 0) {
  111.56 +            for(int i=0;i<addEnv.length;i++) {
  111.57 +                env[5+i] = addEnv[i];
  111.58 +            }
  111.59 +        }
  111.60  
  111.61          return env;
  111.62      }
   112.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/nodes/actions/ShowServerLogAction.java	Fri Jun 10 09:46:37 2011 +0200
   112.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/nodes/actions/ShowServerLogAction.java	Sun Jun 26 10:25:14 2011 +0800
   112.3 @@ -81,7 +81,7 @@
   112.4                          logger.log(Level.WARNING,"Deployment Manager is Null");
   112.5                          return;
   112.6                      } else {
   112.7 -                        manager.showServerLog();
   112.8 +                        manager.showServerLog(true);
   112.9                      }   
  112.10                  }
  112.11                  catch (Exception e){
   113.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/nodes/actions/UndeployAction.java	Fri Jun 10 09:46:37 2011 +0200
   113.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/nodes/actions/UndeployAction.java	Sun Jun 26 10:25:14 2011 +0800
   113.3 @@ -55,7 +55,7 @@
   113.4                   continue;
   113.5              
   113.6              String name = cookie.getName();
   113.7 -            int index = name.indexOf(".");
   113.8 +            int index = name.lastIndexOf(".");
   113.9              if(index != -1)
  113.10              {
  113.11                  name = name.substring(0,index);
   114.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   114.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/util/Base64Routines.java	Sun Jun 26 10:25:14 2011 +0800
   114.3 @@ -0,0 +1,476 @@
   114.4 +/*
   114.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   114.6 + *
   114.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   114.8 + *
   114.9 + * The contents of this file are subject to the terms of either the GNU
  114.10 + * General Public License Version 2 only ("GPL") or the Common
  114.11 + * Development and Distribution License("CDDL") (collectively, the
  114.12 + * "License"). You may not use this file except in compliance with the
  114.13 + * License. You can obtain a copy of the License at
  114.14 + * http://www.netbeans.org/cddl-gplv2.html
  114.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  114.16 + * specific language governing permissions and limitations under the
  114.17 + * License.  When distributing the software, include this License Header
  114.18 + * Notice in each file and include the License file at
  114.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  114.20 + * particular file as subject to the "Classpath" exception as provided
  114.21 + * by Sun in the GPL Version 2 section of the License file that
  114.22 + * accompanied this code. If applicable, add the following below the
  114.23 + * License Header, with the fields enclosed by brackets [] replaced by
  114.24 + * your own identifying information:
  114.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  114.26 + *
  114.27 + * If you wish your version of this file to be governed by only the CDDL
  114.28 + * or only the GPL Version 2, indicate your decision by adding
  114.29 + * "[Contributor] elects to include this software in this distribution
  114.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  114.31 + * single choice of license, a recipient has the option to distribute
  114.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  114.33 + * to extend the choice of license to its licensees as provided above.
  114.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  114.35 + * Version 2 license, then the option applies only if the new code is
  114.36 + * made subject to such option by the copyright holder.
  114.37 + *
  114.38 + * Contributor(s):
  114.39 + * John Platts
  114.40 + *
  114.41 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  114.42 + * Portions Copyrighted 2009 John Platts
  114.43 + */
  114.44 +
  114.45 +package org.netbeans.modules.portalpack.servers.core.util;
  114.46 +
  114.47 +import java.io.Serializable;
  114.48 +import java.lang.ref.WeakReference;
  114.49 +import java.nio.ByteBuffer;
  114.50 +import java.nio.CharBuffer;
  114.51 +import java.util.Arrays;
  114.52 +import java.util.Collections;
  114.53 +import java.util.SortedMap;
  114.54 +import java.util.TreeMap;
  114.55 +
  114.56 +/**
  114.57 + * A class containing routines for encoding and decoding Base64 strings.
  114.58 + * @author John Platts
  114.59 + */
  114.60 +public final class Base64Routines {
  114.61 +    private Base64Routines() {}
  114.62 +
  114.63 +    private static final char BASE64_ALPHABET[] =
  114.64 +            ("ABCDEFGH" +
  114.65 +             "IJKLMNOP" +
  114.66 +             "QRSTUVWX" +
  114.67 +             "YZabcdef" +
  114.68 +             "ghijklmn" +
  114.69 +             "opqrstuv" +
  114.70 +             "wxyz0123" +
  114.71 +             "456789+/").toCharArray();
  114.72 +    private static final char BASE64_PAD_CHAR = '=';
  114.73 +    private static final SortedMap<Character, Integer>
  114.74 +            BASE64_ALPHABET_CHAR_TO_INDEX_MAP =
  114.75 +            createCharToIndexMap(BASE64_ALPHABET, BASE64_PAD_CHAR);
  114.76 +
  114.77 +    private static final SortedMap<Character, Integer> createCharToIndexMap(
  114.78 +            char[] alphabet, char padChar) {
  114.79 +        TreeMap<Character, Integer> treeMap =
  114.80 +                new TreeMap<Character, Integer>();
  114.81 +
  114.82 +        for(int i = 0; i < 64; i++) {
  114.83 +            treeMap.put(alphabet[i], i);
  114.84 +        }
  114.85 +
  114.86 +        treeMap.put(padChar, 64);
  114.87 +
  114.88 +        return Collections.unmodifiableSortedMap(treeMap);
  114.89 +    }
  114.90 +
  114.91 +    private static final int getBase64AlphabetIndex(char ch) {
  114.92 +        Integer index =
  114.93 +                BASE64_ALPHABET_CHAR_TO_INDEX_MAP.get(ch);
  114.94 +
  114.95 +        if(index == null) {
  114.96 +            return -1;
  114.97 +        } else {
  114.98 +            int idx = index.intValue();
  114.99 +
 114.100 +            if(idx >= 0 && idx <= 64) {
 114.101 +                return idx;
 114.102 +            } else {
 114.103 +                return -1;
 114.104 +            }
 114.105 +        }
 114.106 +    }
 114.107 +
 114.108 +    public static CharBuffer base64Encode(ByteBuffer byteBuf) {
 114.109 +        if(byteBuf == null) {
 114.110 +            return null;
 114.111 +        }
 114.112 +
 114.113 +        CharBuffer charBuf =
 114.114 +                CharBuffer.allocate(((byteBuf.remaining() + 2) / 3) << 2);
 114.115 +
 114.116 +        while(byteBuf.hasRemaining()) {
 114.117 +            int b1 = byteBuf.get() & 0x000000FF;
 114.118 +
 114.119 +            int b2, b3, n;
 114.120 +            
 114.121 +            if(byteBuf.hasRemaining()) {
 114.122 +                b2 = byteBuf.get() & 0x000000FF;
 114.123 +                
 114.124 +                if(byteBuf.hasRemaining()) {
 114.125 +                    b3 = byteBuf.get() & 0x000000FF;
 114.126 +                    n = 3;
 114.127 +                } else {
 114.128 +                    b3 = 0;
 114.129 +                    n = 2;
 114.130 +                }
 114.131 +            } else {
 114.132 +                b2 = 0;
 114.133 +                b3 = 0;
 114.134 +                n = 1;
 114.135 +            }
 114.136 +
 114.137 +            /* +--first octet--+-second octet--+--third octet--+ */
 114.138 +            /* |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| */
 114.139 +            /* +-----------+---+-------+-------+---+-----------+ */
 114.140 +            /* |5 4 3 2 1 0|5 4 3 2 1 0|5 4 3 2 1 0|5 4 3 2 1 0| */
 114.141 +            /* +--1.index--+--2.index--+--3.index--+--4.index--+ */
 114.142 +
 114.143 +            /* +--first octet--+ */
 114.144 +            /* |7 6 5 4 3 2 1 0| */
 114.145 +            /* +-----------+---+ */
 114.146 +            /* |5 4 3 2 1 0|     */
 114.147 +            /* +--1.index--+     */
 114.148 +            charBuf.put(BASE64_ALPHABET[(b1 >>> 2) & 0x3F]);
 114.149 +
 114.150 +            /* +--first octet--+-second octet--+ */
 114.151 +            /* |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| */
 114.152 +            /* +-----------+---+-------+-------+ */
 114.153 +            /*             |5 4 3 2 1 0|         */
 114.154 +            /*             +--2.index--+         */
 114.155 +            charBuf.put(BASE64_ALPHABET[((b1 << 4) & 0x30) |
 114.156 +                    ((b2 >>> 4) & 0x0F)]);
 114.157 +
 114.158 +            if(n >= 2) {
 114.159 +                /* +-second octet--+--third octet--+ */
 114.160 +                /* |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| */
 114.161 +                /* +-------+-------+---+-----------+ */
 114.162 +                /*         |5 4 3 2 1 0|             */
 114.163 +                /*         +--3.index--+             */
 114.164 +
 114.165 +                charBuf.put(BASE64_ALPHABET[((b2 << 2) & 0x3C) |
 114.166 +                        ((b3 >>> 6) & 0x03)]);
 114.167 +
 114.168 +                if(n >= 3) {
 114.169 +                    /* +--third octet--+ */
 114.170 +                    /* |7 6 5 4 3 2 1 0| */
 114.171 +                    /* +---+-----------+ */
 114.172 +                    /*     |5 4 3 2 1 0| */
 114.173 +                    /*     +--4.index--+ */
 114.174 +
 114.175 +                    charBuf.put(BASE64_ALPHABET[b3 & 0x3F]);
 114.176 +                    continue;
 114.177 +                } else {
 114.178 +                    charBuf.put('=');
 114.179 +                    break;
 114.180 +                }
 114.181 +            } else {
 114.182 +                charBuf.put("==");
 114.183 +                break;
 114.184 +            }
 114.185 +        }
 114.186 +
 114.187 +        charBuf.flip();
 114.188 +        return charBuf;
 114.189 +    }
 114.190 +    public static CharBuffer base64EncodeUnpadded(ByteBuffer byteBuf) {
 114.191 +        CharBuffer paddedByteBuffer = base64Encode(byteBuf);
 114.192 +
 114.193 +        if(paddedByteBuffer != null) {
 114.194 +            while(paddedByteBuffer.hasRemaining() &&
 114.195 +                    paddedByteBuffer.get(paddedByteBuffer.limit() - 1) ==
 114.196 +                    BASE64_PAD_CHAR) {
 114.197 +                paddedByteBuffer.limit(paddedByteBuffer.limit() - 1);
 114.198 +            }
 114.199 +        }
 114.200 +        
 114.201 +        return paddedByteBuffer;
 114.202 +    }
 114.203 +
 114.204 +    public static final class UnpaddedBase64CharSequenceWrapper
 114.205 +            implements CharSequence, Serializable {
 114.206 +        private static final long serialVersionUID = -7050670133860565990L;
 114.207 +        public UnpaddedBase64CharSequenceWrapper(CharSequence baseSequence) {
 114.208 +            if(baseSequence == null || baseSequence.length() == 0) {
 114.209 +                this.baseSequence = "";
 114.210 +                this.totalLength = 0;
 114.211 +            } else {
 114.212 +                int baseSequenceLength = baseSequence.length();
 114.213 +                int baseSequenceRemainder = baseSequenceLength & 0x03;
 114.214 +
 114.215 +                for(int i = baseSequenceLength - 1; i >= 0; i--) {
 114.216 +                    if(baseSequence.charAt(i) == BASE64_PAD_CHAR) {
 114.217 +                        throw new IllegalArgumentException("baseSequence " +
 114.218 +                                "must not contain any padding characters.");
 114.219 +                    }
 114.220 +                }
 114.221 +
 114.222 +                this.baseSequence = baseSequence;
 114.223 +                switch(baseSequenceRemainder) {
 114.224 +                    case 0:
 114.225 +                        this.totalLength = baseSequenceLength;
 114.226 +                        break;
 114.227 +                    case 2:
 114.228 +                        this.totalLength = baseSequenceLength + 2;
 114.229 +                        break;
 114.230 +                    case 3:
 114.231 +                        this.totalLength = baseSequenceLength + 1;
 114.232 +                        break;
 114.233 +                    default:
 114.234 +                        throw new IllegalArgumentException("The baseSequence " +
 114.235 +                                "must have (baseSequence.length() mod 4) equal " +
 114.236 +                                "to 0, 2, or 3.");
 114.237 +                }
 114.238 +            }
 114.239 +        }
 114.240 +        private UnpaddedBase64CharSequenceWrapper(
 114.241 +                UnpaddedBase64CharSequenceWrapper wrapper,
 114.242 +                int start, int end) {
 114.243 +            this.baseSequence = wrapper.baseSequence.subSequence(start,
 114.244 +                    Math.min(end, wrapper.baseSequence.length()));
 114.245 +            this.totalLength = end - start;
 114.246 +        }
 114.247 +
 114.248 +        public int length() {
 114.249 +            return totalLength;
 114.250 +        }
 114.251 +
 114.252 +        public char charAt(int index) {
 114.253 +            if(index < 0) {
 114.254 +                throw new IndexOutOfBoundsException();
 114.255 +            } else if(index >= 0 && index < baseSequence.length()) {
 114.256 +                return baseSequence.charAt(index);
 114.257 +            } else if(index < totalLength) {
 114.258 +                return BASE64_PAD_CHAR;
 114.259 +            } else {
 114.260 +                throw new IndexOutOfBoundsException();
 114.261 +            }
 114.262 +        }
 114.263 +
 114.264 +        public CharSequence subSequence(int start, int end) {
 114.265 +            if(start < 0 || end < 0 || end > totalLength || start > end) {
 114.266 +                throw new IndexOutOfBoundsException();
 114.267 +            }
 114.268 +
 114.269 +            if(start == end) {
 114.270 +                return "";
 114.271 +            } else if(end <= baseSequence.length()) {
 114.272 +                return baseSequence.subSequence(start, end);
 114.273 +            } else if(start < baseSequence.length()) {
 114.274 +                return new UnpaddedBase64CharSequenceWrapper(this,
 114.275 +                        start, end);
 114.276 +            } else {
 114.277 +                int length = end - start;
 114.278 +                char[] chars = (subsequenceBufferWeakRef != null) ?
 114.279 +                    subsequenceBufferWeakRef.get() : null;
 114.280 +                if(chars == null || chars.length < length) {
 114.281 +                    chars = new char[length];
 114.282 +
 114.283 +                    subsequenceBufferWeakRef =
 114.284 +                            new WeakReference<char[]>(chars);
 114.285 +                }
 114.286 +
 114.287 +                Arrays.fill(chars, 0, length, BASE64_PAD_CHAR);
 114.288 +
 114.289 +                return new String(chars, 0, length);
 114.290 +            }
 114.291 +        }
 114.292 +
 114.293 +        @Override
 114.294 +        public String toString() {
 114.295 +            int baseSequenceLength = baseSequence.length();
 114.296 +
 114.297 +            if(baseSequenceLength == totalLength) {
 114.298 +                return baseSequence.toString();
 114.299 +            }
 114.300 +
 114.301 +            char[] chars =
 114.302 +                    (sequenceCharsWeakRef != null) ?
 114.303 +                        sequenceCharsWeakRef.get() : null;
 114.304 +            
 114.305 +            if(chars == null) {
 114.306 +                chars = new char[totalLength];
 114.307 +                for(int i = 0; i < baseSequenceLength; i++) {
 114.308 +                    chars[i] = baseSequence.charAt(i);
 114.309 +                }
 114.310 +
 114.311 +                Arrays.fill(chars, baseSequenceLength,
 114.312 +                        totalLength, BASE64_PAD_CHAR);
 114.313 +
 114.314 +                sequenceCharsWeakRef =
 114.315 +                        new WeakReference<char[]>(chars);
 114.316 +            }
 114.317 +
 114.318 +            return new String(chars);
 114.319 +        }
 114.320 +
 114.321 +        @Override
 114.322 +        public int hashCode() {
 114.323 +            return toString().hashCode();
 114.324 +        }
 114.325 +        @Override
 114.326 +        public boolean equals(Object o) {
 114.327 +            if(!(o instanceof UnpaddedBase64CharSequenceWrapper)) {
 114.328 +                return false;
 114.329 +            }
 114.330 +
 114.331 +            if(this == o) {
 114.332 +                return true;
 114.333 +            }
 114.334 +
 114.335 +            UnpaddedBase64CharSequenceWrapper other =
 114.336 +                    (UnpaddedBase64CharSequenceWrapper)o;
 114.337 +
 114.338 +            if(this.baseSequence != other.baseSequence) {
 114.339 +                int len1 = this.baseSequence.length();
 114.340 +                int len2 = other.baseSequence.length();
 114.341 +
 114.342 +                if(len1 != len2) {
 114.343 +                    return false;
 114.344 +                }
 114.345 +
 114.346 +                for(int i = 0; i < len1; i++) {
 114.347 +                    if(this.baseSequence.charAt(i) !=
 114.348 +                            other.baseSequence.charAt(i)) {
 114.349 +                        return false;
 114.350 +                    }
 114.351 +                }
 114.352 +            }
 114.353 +
 114.354 +            if(this.totalLength != other.totalLength) {
 114.355 +                return false;
 114.356 +            }
 114.357 +
 114.358 +            return true;
 114.359 +        }
 114.360 +
 114.361 +        private CharSequence baseSequence;
 114.362 +        private int totalLength;
 114.363 +        private transient WeakReference<char[]> sequenceCharsWeakRef;
 114.364 +        private transient WeakReference<char[]> subsequenceBufferWeakRef;
 114.365 +    }
 114.366 +    public static ByteBuffer base64DecodeUnpadded(CharSequence charSeq) {
 114.367 +        if(charSeq == null) {
 114.368 +            return null;
 114.369 +        } else {
 114.370 +            return base64Decode(new UnpaddedBase64CharSequenceWrapper(charSeq));
 114.371 +        }
 114.372 +    }
 114.373 +    public static ByteBuffer base64Decode(CharSequence charSeq) {
 114.374 +        if(charSeq == null) {
 114.375 +            return null;
 114.376 +        }
 114.377 +
 114.378 +        int len = charSeq.length();
 114.379 +
 114.380 +        if((len & 0x03) != 0) {
 114.381 +            throw new IllegalArgumentException("charSeq must have a length " +
 114.382 +                    "that is a multiple of 4.");
 114.383 +        }
 114.384 +
 114.385 +        ByteBuffer byteBuf = ByteBuffer.allocate((len >>> 2) * 3);
 114.386 +
 114.387 +        for(int i = 0; i < len; i += 4) {
 114.388 +            int idx1 =
 114.389 +                    getBase64AlphabetIndex(charSeq.charAt(i));
 114.390 +            int idx2 =
 114.391 +                    getBase64AlphabetIndex(charSeq.charAt(i + 1));
 114.392 +            int idx3 =
 114.393 +                    getBase64AlphabetIndex(charSeq.charAt(i + 2));
 114.394 +            int idx4 =
 114.395 +                    getBase64AlphabetIndex(charSeq.charAt(i + 3));
 114.396 +
 114.397 +            if(idx1 == -1 || idx1 == 64 || idx2 == -1 || idx2 == 64 ||
 114.398 +                    idx3 == -1 ||
 114.399 +                    (idx3 == 64 && idx4 != 64) || idx4 == -1) {
 114.400 +            throw new IllegalArgumentException("charSeq is a malformed " +
 114.401 +                    "Base64 sequence.");
 114.402 +            }
 114.403 +
 114.404 +            int n;
 114.405 +            if(idx3 == 64) {
 114.406 +                n = 1;
 114.407 +            } else if(idx4 == 64) {
 114.408 +                n = 2;
 114.409 +            } else {
 114.410 +                n = 3;
 114.411 +            }
 114.412 +
 114.413 +            if(n < 3 && ((i + 4) < len)) {
 114.414 +                throw new IllegalArgumentException("Padding characters are " +
 114.415 +                        "only valid at the end of the Base64-encoded sequence.");
 114.416 +            }
 114.417 +
 114.418 +            if(n < 1) {
 114.419 +                break;
 114.420 +            } else {
 114.421 +                /* +--first octet--+         */
 114.422 +                /* |7 6 5 4 3 2 1 0|         */
 114.423 +                /* +-----------+---+-------+ */
 114.424 +                /* |5 4 3 2 1 0|5 4 3 2 1 0| */
 114.425 +                /* +--1.index--+--2.index--+ */
 114.426 +
 114.427 +                byteBuf.put((byte)((idx1 << 2) | (idx2 >>> 4)));
 114.428 +
 114.429 +                if(n >= 2) {
 114.430 +                    /*     +-second octet--+     */
 114.431 +                    /*     |7 6 5 4 3 2 1 0|     */
 114.432 +                    /* +---+-------+-------+---+ */
 114.433 +                    /* |5 4 3 2 1 0|5 4 3 2 1 0| */
 114.434 +                    /* +--2.index--+--3.index--+ */
 114.435 +
 114.436 +                    byteBuf.put((byte)((idx2 << 4) | (idx3 >>> 2)));
 114.437 +
 114.438 +                    if(n >= 3) {
 114.439 +                        /*         +--third octet--+ */
 114.440 +                        /*         |7 6 5 4 3 2 1 0| */
 114.441 +                        /* +-------+---+-----------+ */
 114.442 +                        /* |5 4 3 2 1 0|5 4 3 2 1 0| */
 114.443 +                        /* +--3.index--+--4.index--+ */
 114.444 +
 114.445 +                        byteBuf.put((byte)((idx3 << 6) | idx4));
 114.446 +                        continue;
 114.447 +                    } else {
 114.448 +                        /*         +--third octet--+ */
 114.449 +                        /*         |7 6 5 4 3 2 1 0| */
 114.450 +                        /* +-------+---+-----------+ */
 114.451 +                        /* |5 4 3 2 1 0|5 4 3 2 1 0| */
 114.452 +                        /* +--3.index--+--4.index--+ */
 114.453 +                        if((idx3 & 0x03) != 0) {
 114.454 +                            throw new IllegalArgumentException("charSeq is a " +
 114.455 +                                "malformed Base64 sequence.");
 114.456 +                        }
 114.457 +
 114.458 +                        break;
 114.459 +                    }
 114.460 +                } else {
 114.461 +                    /*     +-second octet--+     */
 114.462 +                    /*     |7 6 5 4 3 2 1 0|     */
 114.463 +                    /* +---+-------+-------+---+ */
 114.464 +                    /* |5 4 3 2 1 0|5 4 3 2 1 0| */
 114.465 +                    /* +--2.index--+--3.index--+ */
 114.466 +                    if((idx2 & 0x0F) != 0) {
 114.467 +                        throw new IllegalArgumentException("charSeq is a " +
 114.468 +                                "malformed Base64 sequence.");
 114.469 +                    }
 114.470 +
 114.471 +                    break;
 114.472 +                }
 114.473 +            }
 114.474 +        }
 114.475 +
 114.476 +        byteBuf.flip();
 114.477 +        return byteBuf;
 114.478 +    }
 114.479 +}
   115.1 --- a/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/util/PSConfigObject.java	Fri Jun 10 09:46:37 2011 +0200
   115.2 +++ b/portalpack.servers.base_psframework/src/org/netbeans/modules/portalpack/servers/core/util/PSConfigObject.java	Sun Jun 26 10:25:14 2011 +0800
   115.3 @@ -22,11 +22,12 @@
   115.4  import java.beans.PropertyChangeListener;
   115.5  import javax.enterprise.deploy.spi.DeploymentManager;
   115.6  import org.netbeans.modules.portalpack.servers.core.PSConfigCallBackHandler;
   115.7 -import java.io.File;
   115.8 +import java.util.ArrayList;
   115.9  import java.util.Enumeration;
  115.10 -import java.util.Iterator;
  115.11 +import java.util.List;
  115.12  import java.util.WeakHashMap;
  115.13  import java.util.Properties;
  115.14 +import java.util.StringTokenizer;
  115.15  import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
  115.16  import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  115.17  
  115.18 @@ -64,6 +65,8 @@
  115.19      private Properties props = null;
  115.20      
  115.21      private boolean newInstance = false;
  115.22 +
  115.23 +    private String[] envProperties;
  115.24     // private boolean libraryChanged = false;
  115.25      
  115.26      private static PSConfigObject instance = null;
  115.27 @@ -173,6 +176,14 @@
  115.28      public void setDirectoryDeployment(boolean directoryDeployment) {
  115.29          this.directoryDeployment = directoryDeployment;
  115.30      }
  115.31 +
  115.32 +    public void setEnvProperties(String[] envProperties) {
  115.33 +        this.envProperties = envProperties;
  115.34 +    }
  115.35 +
  115.36 +    public String[] getEnvProperties() {
  115.37 +        return envProperties;
  115.38 +    }
  115.39      
  115.40   //comment start
  115.41      
  115.42 @@ -295,6 +306,8 @@
  115.43          setAdminPort(ip.getProperty("ADMIN_PORT"));
  115.44          setClassPath(ip.getProperty("CLASSPATH"));
  115.45          setPortalUri(ip.getProperty("PORTAL_URI"));
  115.46 +
  115.47 +        setEnvProperties(decodeEnvProperties(ip.getProperty("SERVER_ENV_PROPERTIES")));
  115.48          
  115.49          //load specific properties
  115.50          Enumeration keys = ip.propertyNames();
  115.51 @@ -334,6 +347,8 @@
  115.52          handler.setClassPath(getClassPath());
  115.53          handler.setPortalUri(getPortalUri());
  115.54          handler.setDirectoryDeployment(isDirectoryDeployment());
  115.55 +
  115.56 +        handler.setEnvProperties(encodeEnvProperties(getEnvProperties()));
  115.57    
  115.58      }
  115.59    
  115.60 @@ -368,7 +383,8 @@
  115.61          ip.setProperty("ADMIN_PORT",getAdminPort());
  115.62          ip.setProperty("CLASSPATH",getClassPath());
  115.63          ip.setProperty("PORTAL_URI",getPortalUri());
  115.64 -        
  115.65 +        ip.setProperty("SERVER_ENV_PROPERTIES", encodeEnvProperties(getEnvProperties()) );
  115.66 +
  115.67          if(props != null)
  115.68          {
  115.69             Enumeration keys = props.propertyNames();
  115.70 @@ -466,6 +482,39 @@
  115.71          key = PSConfigCallBackHandler.ADD_PROP_PREFIX + key;
  115.72          return props.getProperty(key);
  115.73      }
  115.74 +
  115.75 +    private String encodeEnvProperties(String[] env) {
  115.76 +        if(env == null)
  115.77 +            return null;
  115.78 +
  115.79 +        StringBuilder envBuf = new StringBuilder();
  115.80 +        for(String e:env) {
  115.81 +            envBuf.append(e);
  115.82 +            envBuf.append(",");
  115.83 +        }
  115.84 +        return envBuf.toString();
  115.85 +    }
  115.86 +
  115.87 +    private String[] decodeEnvProperties(String encodeStr) {
  115.88 +
  115.89 +        List<String> envs = null;
  115.90 +        if(encodeStr == null)
  115.91 +            return null;
  115.92 +        StringTokenizer st = new StringTokenizer(encodeStr,",");
  115.93 +        while(st.hasMoreTokens()) {
  115.94 +            if(envs == null)
  115.95 +                envs = new ArrayList();
  115.96 +            String token = st.nextToken();
  115.97 +            if(token != null && token.trim().length() != 0) {
  115.98 +                envs.add(token);
  115.99 +            }
 115.100 +        }
 115.101 +
 115.102 +        if(envs == null || envs.size() == 0)
 115.103 +            return null;
 115.104 +
 115.105 +        return envs.toArray(new String[0]);
 115.106 +    }
 115.107      
 115.108      public synchronized void populate(PSConfigCallBackHandler handler)
 115.109      {
 115.110 @@ -487,6 +536,7 @@
 115.111          setPortalUri(handler.getPortalUri());
 115.112          
 115.113          setDirectoryDeployment(handler.isDirectoryDeployment());
 115.114 +        setEnvProperties(decodeEnvProperties(handler.getEnvProperties()));
 115.115          
 115.116          props = new Properties(handler.getProperties());
 115.117          
   116.1 --- a/portalpack.servers.opensourcepc/build.xml	Fri Jun 10 09:46:37 2011 +0200
   116.2 +++ b/portalpack.servers.opensourcepc/build.xml	Sun Jun 26 10:25:14 2011 +0800
   116.3 @@ -25,7 +25,7 @@
   116.4  <project name="contrib/portalpack.servers.opensourcepc" default="netbeans" basedir=".">
   116.5      <description>Builds, tests, and runs the project org.netbeans.modules.portalpack.servers.jnpc.</description>
   116.6      <import file="../../nbbuild/templates/projectized.xml"/>
   116.7 -    <property name="base.nbm.target.dir" value="build"/>
   116.8 +    
   116.9     <!-- <target name="nbm" depends="init,netbeans" description="Build NBM archive.">
  116.10          <mkdir dir="build"/>
  116.11          <makenbm file="build/${nbm}"
   117.1 --- a/portalpack.servers.opensourcepc/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
   117.2 +++ b/portalpack.servers.opensourcepc/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
   117.3 @@ -2,4 +2,4 @@
   117.4  OpenIDE-Module: org.netbeans.modules.portalpack.servers.opensourcepc
   117.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/servers/jnpc/resources/layer.xml
   117.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/servers/jnpc/resources/Bundle.properties
   117.7 -OpenIDE-Module-Specification-Version: 2.99
   117.8 +OpenIDE-Module-Specification-Version: 3.0.5
   118.1 --- a/portalpack.servers.opensourcepc/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
   118.2 +++ b/portalpack.servers.opensourcepc/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
   118.3 @@ -15,6 +15,6 @@
   118.4  # Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
   118.5  # Microsystems, Inc. All Rights Reserved.
   118.6  
   118.7 -javac.source=1.5
   118.8 +javac.source=1.6
   118.9  license.file=../../LICENSE
  118.10  nbm.homepage=http://portalpack.netbeans.org
   119.1 --- a/portalpack.servers.opensourcepc/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
   119.2 +++ b/portalpack.servers.opensourcepc/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
   119.3 @@ -82,7 +82,7 @@
   119.4                      <build-prerequisite/>
   119.5                      <compile-dependency/>
   119.6                      <run-dependency>
   119.7 -                        <specification-version>2.92</specification-version>
   119.8 +                        <specification-version>3.0</specification-version>
   119.9                      </run-dependency>
  119.10                  </dependency>
  119.11                  <dependency>
   120.1 --- a/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/JNPCDeploymentManager.java	Fri Jun 10 09:46:37 2011 +0200
   120.2 +++ b/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/JNPCDeploymentManager.java	Sun Jun 26 10:25:14 2011 +0800
   120.3 @@ -84,7 +84,7 @@
   120.4      }
   120.5  
   120.6      @Override
   120.7 -    public void showServerLog() {
   120.8 +    public void showServerLog(boolean createNew) {
   120.9          try {
  120.10              
  120.11              FileLogViewerSupport.removeLogViewerSupport(getUri());
   121.1 --- a/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/JNPCJ2eePlatformImpl.java	Fri Jun 10 09:46:37 2011 +0200
   121.2 +++ b/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/JNPCJ2eePlatformImpl.java	Sun Jun 26 10:25:14 2011 +0800
   121.3 @@ -1,22 +1,21 @@
   121.4  /*
   121.5 -  * The contents of this file are subject to the terms of the Common Development
   121.6 -  * and Distribution License (the License). You may not use this file except in
   121.7 -  * compliance with the License.
   121.8 -  *
   121.9 -  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  121.10 -  * or http://www.netbeans.org/cddl.txt.
  121.11 -  *
  121.12 -  * When distributing Covered Code, include this CDDL Header Notice in each file
  121.13 -  * and include the License file at http://www.netbeans.org/cddl.txt.
  121.14 -  * If applicable, add the following below the CDDL Header, with the fields
  121.15 -  * enclosed by brackets [] replaced by your own identifying information:
  121.16 -  * "Portions Copyrighted [year] [name of copyright owner]"
  121.17 -  *
  121.18 -  * The Original Software is NetBeans. The Initial Developer of the Original
  121.19 -  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  121.20 -  * Microsystems, Inc. All Rights Reserved.
  121.21 -  */
  121.22 -
  121.23 + * The contents of this file are subject to the terms of the Common Development
  121.24 + * and Distribution License (the License). You may not use this file except in
  121.25 + * compliance with the License.
  121.26 + *
  121.27 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  121.28 + * or http://www.netbeans.org/cddl.txt.
  121.29 + *
  121.30 + * When distributing Covered Code, include this CDDL Header Notice in each file
  121.31 + * and include the License file at http://www.netbeans.org/cddl.txt.
  121.32 + * If applicable, add the following below the CDDL Header, with the fields
  121.33 + * enclosed by brackets [] replaced by your own identifying information:
  121.34 + * "Portions Copyrighted [year] [name of copyright owner]"
  121.35 + *
  121.36 + * The Original Software is NetBeans. The Initial Developer of the Original
  121.37 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  121.38 + * Microsystems, Inc. All Rights Reserved.
  121.39 + */
  121.40  package org.netbeans.modules.portalpack.servers.jnpc;
  121.41  
  121.42  import java.io.File;
  121.43 @@ -28,6 +27,8 @@
  121.44  import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
  121.45  import org.netbeans.modules.portalpack.servers.core.PSJ2eePlatformImpl;
  121.46  import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
  121.47 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibraries;
  121.48 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibrariesFactory;
  121.49  import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  121.50  import org.netbeans.modules.portalpack.servers.core.util.Util;
  121.51  
  121.52 @@ -35,12 +36,13 @@
  121.53   *
  121.54   * @author satya
  121.55   */
  121.56 -public class JNPCJ2eePlatformImpl extends PSJ2eePlatformImpl{
  121.57 +public class JNPCJ2eePlatformImpl extends PSJ2eePlatformImpl {
  121.58 +
  121.59      /** Creates a new instance of JNPCJ2eePlatformImpl */
  121.60      public JNPCJ2eePlatformImpl(PSConfigObject psconfig) {
  121.61          super(psconfig);
  121.62      }
  121.63 -    
  121.64 +
  121.65      public Set getSupportedSpecVersions() {
  121.66          Set result = new HashSet();
  121.67          result.add(J2eeModule.J2EE_13);
  121.68 @@ -48,61 +50,52 @@
  121.69          result.add(J2eeModule.JAVA_EE_5);
  121.70          return result;
  121.71      }
  121.72 +
  121.73      protected List getCustomLibraries() {
  121.74 -         List classPath = new ArrayList();
  121.75 -         
  121.76 -         String[] libFiles = {"portlet-api-1.0.jar","portlettaglib-1.0.jar","portletappengine-1.0.jar"};
  121.77 -         //PSConfigObject psconfig = psconfig.getPSConfig();
  121.78 -         
  121.79 -         for(int i=0;i<libFiles.length;i++)
  121.80 -         {
  121.81 +        List classPath = new ArrayList();
  121.82 +
  121.83 +        String[] libFiles = {"portlet-api-1.0.jar", "portlettaglib-1.0.jar", "portletappengine-1.0.jar"};
  121.84 +        //PSConfigObject psconfig = psconfig.getPSConfig();
  121.85 +
  121.86 +        for (int i = 0; i < libFiles.length; i++) {
  121.87              String portletJarUri = psconfig.getPSHome() + File.separator + "lib" + File.separator + libFiles[i];
  121.88              File portletJar = new File(portletJarUri);
  121.89 -            if(portletJar.exists())
  121.90 -            {
  121.91 +            if (portletJar.exists()) {
  121.92                  try {
  121.93                      classPath.add(fileToUrl(portletJar));
  121.94                  } catch (MalformedURLException ex) {
  121.95                      ex.printStackTrace();
  121.96                  }
  121.97              }
  121.98 -         }
  121.99 -         
 121.100 -         //If glassfish then add javaee.jar
 121.101 -         if(psconfig.getServerType().equals(ServerConstants.SUN_APP_SERVER_9))
 121.102 -         {
 121.103 -             String[] libs = {"javaee.jar","appserv-jstl.jar"};
 121.104 -             for(int k=0;k<libs.length;k++)
 121.105 -             {
 121.106 -                 File libJar = new File(psconfig.getServerHome() + File.separator + "lib" + File.separator + libs[k]);
 121.107 -                 if(libJar.exists())
 121.108 -                 {
 121.109 -                    try {
 121.110 -                        classPath.add(fileToUrl(libJar));
 121.111 -                    } catch (MalformedURLException ex) {
 121.112 -                      ex.printStackTrace();
 121.113 -                    }
 121.114 -                 }
 121.115 -             } 
 121.116 -         }
 121.117 -         
 121.118 +        }
 121.119  
 121.120 -         String[] encClassPaths = Util.decodeClassPath(psconfig.getClassPath());
 121.121 -         for(int i=0;i<encClassPaths.length;i++)
 121.122 -         {
 121.123 -             File classpathJar = new File(encClassPaths[i]);
 121.124 -             if(classpathJar.exists())
 121.125 -             {
 121.126 +        JEEServerLibraries jeeServerLibraries =
 121.127 +                JEEServerLibrariesFactory.getJEEServerLibraries(psconfig.getServerType());
 121.128 +        //add javaee jars
 121.129 +        List<File> javaeeJars = jeeServerLibraries.getJEEServerLibraries(psconfig);
 121.130 +
 121.131 +        for (int k = 0; k < javaeeJars.size(); k++) {
 121.132 +
 121.133 +            if (javaeeJars.get(k).exists()) {
 121.134 +                try {
 121.135 +                    classPath.add(fileToUrl(javaeeJars.get(k)));
 121.136 +                } catch (MalformedURLException ex) {
 121.137 +                    ex.printStackTrace();
 121.138 +                }
 121.139 +            }
 121.140 +        }
 121.141 +
 121.142 +        String[] encClassPaths = Util.decodeClassPath(psconfig.getClassPath());
 121.143 +        for (int i = 0; i < encClassPaths.length; i++) {
 121.144 +            File classpathJar = new File(encClassPaths[i]);
 121.145 +            if (classpathJar.exists()) {
 121.146                  try {
 121.147                      classPath.add(fileToUrl(classpathJar));
 121.148                  } catch (MalformedURLException ex) {
 121.149                      ex.printStackTrace();
 121.150                  }
 121.151 -             }
 121.152 -         }
 121.153 -         return classPath;     
 121.154 +            }
 121.155 +        }
 121.156 +        return classPath;
 121.157      }
 121.158 -    
 121.159 -    
 121.160 -    
 121.161  }
   122.1 --- a/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/impl/JNPCTaskHandler.java	Fri Jun 10 09:46:37 2011 +0200
   122.2 +++ b/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/impl/JNPCTaskHandler.java	Sun Jun 26 10:25:14 2011 +0800
   122.3 @@ -80,7 +80,7 @@
   122.4                  logger.log(Level.SEVERE,"Error creating classLoader for portletcontainer",ex);
   122.5              }
   122.6          }
   122.7 -        deployerHandler = ServerDeployerHandlerFactory.getServerDeployerHandler(dm);
   122.8 +        deployerHandler = dm.getServerDeployHandler();
   122.9      }
  122.10  
  122.11  
  122.12 @@ -124,6 +124,14 @@
  122.13          copyFilesFromWar(jarFile, webInfDir, "WEB-INF/sun-portlet.tld", "sun-portlet.tld");
  122.14          copyFilesFromWar(jarFile, webInfDir, "WEB-INF/sun-portlet_2_0.tld", "sun-portlet_2_0.tld");
  122.15          
  122.16 +        try{
  122.17 +            String jsDir = deployedDir + File.separator + "js";
  122.18 +            File jsDirFile = new File(jsDir);
  122.19 +            if(!jsDirFile.exists()) {
  122.20 +                jsDirFile.mkdir();
  122.21 +            }
  122.22 +            copyFilesFromWar(jarFile, jsDir, "js/XMLPortletRequest.js","XMLPortletRequest.js");
  122.23 +        }catch(Exception e) {}
  122.24          //For backward compatibility for PC 2.0
  122.25          copyFilesFromWar(jarFile, webInfDir, "WEB-INF/portlet.tld", "portlet.tld");
  122.26          copyFilesFromWar(jarFile, webInfDir, "WEB-INF/portlet_2_0.tld", "portlet_2_0.tld");   
   123.1 --- a/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/pc20/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   123.2 +++ b/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/pc20/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   123.3 @@ -16,4 +16,5 @@
   123.4  # Microsystems, Inc. All Rights Reserved.
   123.5  
   123.6  Open_Portal_Portlet_Container_2_0=OpenPortal Portlet Container 2.x
   123.7 +UNDEPLOYMENT_FAILED=Undeployment Failed
   123.8  
   124.1 --- a/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/pc20/PC20TaskHandler.java	Fri Jun 10 09:46:37 2011 +0200
   124.2 +++ b/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/pc20/PC20TaskHandler.java	Sun Jun 26 10:25:14 2011 +0800
   124.3 @@ -16,15 +16,28 @@
   124.4   */
   124.5  package org.netbeans.modules.portalpack.servers.jnpc.pc20;
   124.6  
   124.7 +import java.io.BufferedReader;
   124.8 +import java.io.File;
   124.9 +import java.io.IOException;
  124.10 +import java.io.InputStream;
  124.11 +import java.io.InputStreamReader;
  124.12  import java.lang.reflect.InvocationTargetException;
  124.13  import java.lang.reflect.Method;
  124.14 +import java.net.HttpURLConnection;
  124.15 +import java.net.MalformedURLException;
  124.16 +import java.net.URL;
  124.17 +import java.net.URLEncoder;
  124.18 +import java.util.ArrayList;
  124.19  import java.util.List;
  124.20  import java.util.Properties;
  124.21 +import java.util.jar.JarFile;
  124.22  import java.util.logging.Level;
  124.23  import java.util.zip.ZipException;
  124.24  import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  124.25  import org.netbeans.modules.portalpack.servers.core.common.DeploymentException;
  124.26 +import org.netbeans.modules.portalpack.servers.jnpc.common.JNPCConstants;
  124.27  import org.netbeans.modules.portalpack.servers.jnpc.impl.JNPCTaskHandler;
  124.28 +import org.openide.util.Exceptions;
  124.29  
  124.30  /**
  124.31   *
  124.32 @@ -42,9 +55,48 @@
  124.33          super(dm);
  124.34      }
  124.35  
  124.36 +    //Directory deployment can be done through url deployment
  124.37 +    @Override
  124.38 +    public String deploy(String deployedDir, String warfile, String serveruri) throws Exception {
  124.39 +
  124.40 +        File warFileObj = new File(warfile);
  124.41 +        if(checkIfURLDeploymentSupported()) {
  124.42 +
  124.43 +            doUrlDeployment(warFileObj.getName(), deployedDir);
  124.44 +        } else{
  124.45 +            super.deploy(deployedDir, warfile, serveruri);
  124.46 +            return org.openide.util.NbBundle.getMessage(JNPCTaskHandler.class, "Deployed_Successfully");
  124.47 +        }
  124.48 +
  124.49 +        String appName = warFileObj.getName().substring(0,warFileObj.getName().indexOf("."));
  124.50 +
  124.51 +        try{
  124.52 +            deployerHandler.deploy(deployedDir,appName);
  124.53 +        }catch(Exception e){
  124.54 +            try{
  124.55 +               // String fileName = warFileObj.getName();
  124.56 +
  124.57 +                _undeployFromPC(appName,false);
  124.58 +            }catch(Exception ex){
  124.59 +               // ex.printStackTrace();
  124.60 +            }
  124.61 +            //writeErrorToOutput(uri,e);
  124.62 +            throw e;
  124.63 +        }
  124.64 +        return org.openide.util.NbBundle.getMessage(JNPCTaskHandler.class, "Deployed_Successfully");
  124.65 +
  124.66 +    }
  124.67 +
  124.68      @Override
  124.69      protected void _deployOnPC(final String warfile) throws Exception {
  124.70  
  124.71 +        if(checkIfURLDeploymentSupported()) {
  124.72 +            File warFileObj = new File(warfile);
  124.73 +
  124.74 +            doUrlDeployment(warFileObj.getName(), warFileObj.getAbsolutePath());
  124.75 +            return;
  124.76 +        }
  124.77 +
  124.78          ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
  124.79          try {
  124.80              Thread.currentThread().setContextClassLoader(loader);
  124.81 @@ -92,6 +144,11 @@
  124.82      @Override
  124.83      protected void _undeployFromPC(final String portletAppName, boolean logError) throws Exception {
  124.84  
  124.85 +        if(checkIfURLDeploymentSupported()) {
  124.86 +            doUrlUnDeployment(portletAppName);
  124.87 +            return;
  124.88 +        }
  124.89 +
  124.90          ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
  124.91          try {
  124.92              Thread.currentThread().setContextClassLoader(loader);
  124.93 @@ -132,6 +189,31 @@
  124.94      @Override
  124.95      public String[] getPortlets(String dn) {
  124.96  
  124.97 +         if(checkIfURLDeploymentSupported()) {
  124.98 +            String contextUri = getContextUri();
  124.99 +            if(contextUri == null)
 124.100 +                return new String[0];
 124.101 +
 124.102 +            URL url = null;
 124.103 +            try {
 124.104 +                url = new URL("http://" + psconfig.getHost() + ":" + psconfig.getPort() + "/" + contextUri + "/list");
 124.105 +            } catch (MalformedURLException ex) {
 124.106 +                logger.log(Level.SEVERE, ex.getMessage(), ex);
 124.107 +            }
 124.108 +            String content = getContentFromHttpURL(url);
 124.109 +            if(content == null)
 124.110 +                return new String[0];
 124.111 +
 124.112 +            String[] portlets = content.split(",");
 124.113 +            List portletList = new ArrayList();
 124.114 +            for(String portlet:portlets) {
 124.115 +                if(portlet != null && portlet.trim().length() != 0)
 124.116 +                    portletList.add(portlet);
 124.117 +            }
 124.118 +
 124.119 +            return (String[]) portletList.toArray(new String[0]);
 124.120 +        }
 124.121 +
 124.122          ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
 124.123          try {
 124.124              Thread.currentThread().setContextClassLoader(loader);
 124.125 @@ -189,4 +271,187 @@
 124.126              //ignore exception incase of class not found.
 124.127          }
 124.128      }
 124.129 +
 124.130 +
 124.131 +    private boolean doUrlDeployment(String warFileName,String warPath) throws Exception {
 124.132 +        String  contextUri = getContextUri();
 124.133 +
 124.134 +        if(contextUri == null)
 124.135 +            return false;
 124.136 +
 124.137 +        warFileName = URLEncoder.encode(warFileName, "UTF-8");
 124.138 +        warPath = URLEncoder.encode(warPath, "UTF-8");
 124.139 +        
 124.140 +        URL url;
 124.141 +        HttpURLConnection urlConnection = null;
 124.142 +        try {
 124.143 +            url = new URL("http://" + psconfig.getHost() + ":" + psconfig.getPort() + "/" + contextUri + "/deploy?dt.war="+warFileName+"&dt.path="+warPath);
 124.144 +            int responseCode;
 124.145 +            urlConnection =  (HttpURLConnection) url.openConnection();
 124.146 +            responseCode = urlConnection.getResponseCode();
 124.147 +
 124.148 +            if(responseCode == 500) {
 124.149 +                String errorMsg = urlConnection.getResponseMessage();
 124.150 +                throw new DeploymentException(errorMsg);
 124.151 +            }
 124.152 +
 124.153 +        } catch (Exception ex) {
 124.154 +            writeErrorToOutput(uri,ex);
 124.155 +            writeToOutput(uri, ex.getMessage());
 124.156 +            throw ex;
 124.157 +        } finally {
 124.158 +            try{
 124.159 +                urlConnection.disconnect();
 124.160 +            }catch(Exception e){}
 124.161 +        }
 124.162 +
 124.163 +        return true;
 124.164 +
 124.165 +    }
 124.166 +
 124.167 +    private boolean doUrlUnDeployment(String appName) throws Exception {
 124.168 +        String  contextUri = getContextUri();
 124.169 +
 124.170 +        if(contextUri == null)
 124.171 +            return false;
 124.172 +
 124.173 +        appName = URLEncoder.encode(appName, "UTF-8");
 124.174 +        
 124.175 +        URL url;
 124.176 +        HttpURLConnection urlConnection = null;
 124.177 +        try {
 124.178 +            url = new URL("http://" + psconfig.getHost() + ":" + psconfig.getPort() + "/" + contextUri + "/undeploy?dt.war="+appName);
 124.179 +            int responseCode;
 124.180 +            urlConnection =  (HttpURLConnection) url.openConnection();
 124.181 +            responseCode = urlConnection.getResponseCode();
 124.182 +
 124.183 +            if(responseCode == 500) {
 124.184 +                String errorMsg = urlConnection.getResponseMessage();
 124.185 +                throw new DeploymentException(errorMsg);
 124.186 +            }
 124.187 +           
 124.188 +        } catch (Exception ex) {
 124.189 +            writeErrorToOutput(uri,ex);
 124.190 +            writeToOutput(uri, ex.getMessage());
 124.191 +            throw ex;
 124.192 +        } finally {
 124.193 +            try{
 124.194 +                urlConnection.disconnect();
 124.195 +            }catch(Exception e){}
 124.196 +        }
 124.197 +
 124.198 +        return true;
 124.199 +
 124.200 +    }
 124.201 +
 124.202 +
 124.203 +    private String getContextUri() {
 124.204 +        String  contextUri = psconfig.getPortalUri();
 124.205 +
 124.206 +        if(contextUri == null)
 124.207 +            return null;
 124.208 +
 124.209 +        String[] segments = contextUri.split("/");
 124.210 +
 124.211 +        for(String segment:segments) {
 124.212 +            if(segment != null && segment.trim().length() != 0) {
 124.213 +                contextUri = segment;
 124.214 +                break;
 124.215 +            }
 124.216 +        }
 124.217 +
 124.218 +        return contextUri;
 124.219 +    }
 124.220 +    /*
 124.221 +     * This will check if the pc version is 2.1.1 or later
 124.222 +     */
 124.223 +    private boolean checkIfURLDeploymentSupported() {
 124.224 +
 124.225 +        String  contextUri = getContextUri();
 124.226 +
 124.227 +        if(contextUri == null)
 124.228 +            return false;
 124.229 +
 124.230 +        URL url;
 124.231 +        try {
 124.232 +            url = new URL("http://" + psconfig.getHost() + ":" + psconfig.getPort() + "/" + contextUri + "/deploy");
 124.233 +            int responseCode;
 124.234 +            HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
 124.235 +            responseCode = urlConnection.getResponseCode();
 124.236 +            if(responseCode == 404 || responseCode == 503) //Not Found
 124.237 +            {
 124.238 +              logger.info("404 - Not Found Exception for deploy url .....");
 124.239 +              return false;
 124.240 +            }
 124.241 +            try{
 124.242 +                urlConnection.disconnect();
 124.243 +            }catch(Exception e) {}
 124.244 +        } catch (IOException ex) {
 124.245 +            logger.log(Level.SEVERE, ex.getMessage(), ex);
 124.246 +            return false;
 124.247 +        }
 124.248 +
 124.249 +        return true;
 124.250 +     }
 124.251 +
 124.252 +    private  String getContentFromHttpURL(URL url) {
 124.253 +        BufferedReader br = null;
 124.254 +        try {
 124.255 +            // TODO code application logic here
 124.256 +            HttpURLConnection con = (HttpURLConnection) url.openConnection();
 124.257 +            con.setDoOutput(true);
 124.258 +            InputStream ins = con.getInputStream();
 124.259 +
 124.260 +            br = new BufferedReader(new InputStreamReader(ins));
 124.261 +            String content = "";
 124.262 +            String line = br.readLine();
 124.263 +            while (line != null) {
 124.264 +                content += line;
 124.265 +                line = br.readLine();
 124.266 +            }
 124.267 +
 124.268 +            return content;
 124.269 +        } catch (Exception e) {
 124.270 +            //logger.log(Level.SEVERE, "Error", e);
 124.271 +            logger.log(Level.SEVERE, e.getMessage(), e);
 124.272 +            return null;
 124.273 +        } finally {
 124.274 +            if (br != null) {
 124.275 +                try {
 124.276 +                    br.close();
 124.277 +                } catch (IOException ex) {
 124.278 +                }
 124.279 +            }
 124.280 +        }
 124.281 +    }
 124.282 +
 124.283 +    private  String getErrorStream(HttpURLConnection urlCon) {
 124.284 +        BufferedReader br = null;
 124.285 +        try {
 124.286 +
 124.287 +            InputStream ins = urlCon.getErrorStream();
 124.288 +            br = new BufferedReader(new InputStreamReader(ins));
 124.289 +            String content = "";
 124.290 +            String line = br.readLine();
 124.291 +            while (line != null) {
 124.292 +                content += line;
 124.293 +                line = br.readLine();
 124.294 +            }
 124.295 +
 124.296 +            return content;
 124.297 +        } catch (Exception e) {
 124.298 +            //logger.log(Level.SEVERE, "Error", e);
 124.299 +            logger.log(Level.SEVERE, e.getMessage(), e);
 124.300 +            return null;
 124.301 +        } finally {
 124.302 +            if (br != null) {
 124.303 +                try {
 124.304 +                    br.close();
 124.305 +                } catch (IOException ex) {
 124.306 +                }
 124.307 +            }
 124.308 +        }
 124.309 +
 124.310 +    }
 124.311 +
 124.312  }
   125.1 --- a/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/ui/PCConfigPanel.form	Fri Jun 10 09:46:37 2011 +0200
   125.2 +++ b/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/ui/PCConfigPanel.form	Sun Jun 26 10:25:14 2011 +0800
   125.3 @@ -9,6 +9,7 @@
   125.4    <AuxValues>
   125.5      <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
   125.6      <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
   125.7 +    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
   125.8      <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
   125.9      <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
  125.10      <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
  125.11 @@ -20,50 +21,50 @@
  125.12    <Layout>
  125.13      <DimensionLayout dim="0">
  125.14        <Group type="103" groupAlignment="0" attributes="0">
  125.15 -          <Component id="jSeparator1" alignment="0" pref="533" max="32767" attributes="0"/>
  125.16 +          <Component id="jSeparator1" alignment="0" pref="586" max="32767" attributes="0"/>
  125.17            <Group type="102" alignment="0" attributes="0">
  125.18                <EmptySpace min="-2" pref="155" max="-2" attributes="0"/>
  125.19                <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
  125.20 -              <EmptySpace pref="239" max="32767" attributes="0"/>
  125.21 +              <EmptySpace pref="252" max="32767" attributes="0"/>
  125.22            </Group>
  125.23            <Group type="102" alignment="1" attributes="0">
  125.24                <EmptySpace min="-2" max="-2" attributes="0"/>
  125.25                <Group type="103" groupAlignment="0" attributes="0">
  125.26                    <Group type="102" alignment="0" attributes="0">
  125.27 -                      <Component id="jLabel2" max="32767" attributes="0"/>
  125.28 +                      <Component id="jLabel2" pref="61" max="32767" attributes="0"/>
  125.29                        <EmptySpace min="49" pref="49" max="49" attributes="0"/>
  125.30                    </Group>
  125.31                    <Group type="102" alignment="0" attributes="0">
  125.32 -                      <Component id="jLabel3" max="32767" attributes="0"/>
  125.33 +                      <Component id="jLabel3" pref="82" max="32767" attributes="0"/>
  125.34                        <EmptySpace min="28" pref="28" max="28" attributes="0"/>
  125.35                    </Group>
  125.36                    <Group type="102" alignment="0" attributes="0">
  125.37 -                      <Component id="jLabel4" max="32767" attributes="0"/>
  125.38 +                      <Component id="jLabel4" pref="83" max="32767" attributes="0"/>
  125.39                        <EmptySpace min="27" pref="27" max="27" attributes="0"/>
  125.40                    </Group>
  125.41                    <Group type="102" alignment="0" attributes="0">
  125.42 -                      <Component id="jLabel5" max="32767" attributes="0"/>
  125.43 +                      <Component id="jLabel5" pref="84" max="32767" attributes="0"/>
  125.44                        <EmptySpace min="26" pref="26" max="26" attributes="0"/>
  125.45                    </Group>
  125.46 -                  <Component id="jLabel6" pref="75" max="32767" attributes="0"/>
  125.47 +                  <Component id="jLabel6" pref="110" max="32767" attributes="0"/>
  125.48                </Group>
  125.49                <EmptySpace min="-2" max="-2" attributes="0"/>
  125.50                <Group type="103" groupAlignment="0" attributes="0">
  125.51                    <Group type="102" alignment="0" attributes="0">
  125.52                        <Group type="103" groupAlignment="1" attributes="0">
  125.53 -                          <Component id="adminConsoleUriTf" alignment="0" pref="173" max="32767" attributes="2"/>
  125.54 -                          <Component id="portalUri" alignment="0" pref="173" max="32767" attributes="2"/>
  125.55 -                          <Component id="portletUriTf" alignment="0" pref="173" max="32767" attributes="2"/>
  125.56 +                          <Component id="adminConsoleUriTf" alignment="0" pref="185" max="32767" attributes="2"/>
  125.57 +                          <Component id="portalUri" alignment="0" pref="185" max="32767" attributes="2"/>
  125.58 +                          <Component id="portletUriTf" alignment="0" pref="185" max="32767" attributes="2"/>
  125.59                        </Group>
  125.60                        <EmptySpace min="-2" pref="168" max="-2" attributes="0"/>
  125.61                    </Group>
  125.62                    <Group type="102" alignment="0" attributes="0">
  125.63                        <Group type="103" groupAlignment="1" attributes="0">
  125.64 -                          <Component id="hostTf" alignment="0" pref="299" max="32767" attributes="2"/>
  125.65 +                          <Component id="hostTf" alignment="0" pref="303" max="32767" attributes="2"/>
  125.66                            <Component id="homeTf" alignment="0" min="-2" pref="299" max="-2" attributes="2"/>
  125.67                        </Group>
  125.68                        <EmptySpace min="-2" max="-2" attributes="0"/>
  125.69 -                      <Component id="homeChooseButton" pref="36" max="32767" attributes="0"/>
  125.70 +                      <Component id="homeChooseButton" pref="41" max="32767" attributes="0"/>
  125.71                    </Group>
  125.72                </Group>
  125.73                <EmptySpace min="-2" pref="103" max="-2" attributes="0"/>
   126.1 --- a/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/ui/PCConfigPanel.java	Fri Jun 10 09:46:37 2011 +0200
   126.2 +++ b/portalpack.servers.opensourcepc/src/org/netbeans/modules/portalpack/servers/jnpc/ui/PCConfigPanel.java	Sun Jun 26 10:25:14 2011 +0800
   126.3 @@ -233,9 +233,8 @@
   126.4                  return false;
   126.5              }
   126.6          }
   126.7 -        File config = new File(homeDir,"config" + File.separator + "pcenv.conf");
   126.8          File lib = new File(homeDir,"lib");
   126.9 -        if(!config.exists() || !lib.exists())
  126.10 +        if(!lib.exists())
  126.11          {           
  126.12              setErrorMessage(NbBundle.getMessage(PCConfigPanel.class,"MSG_INVALID_PC_HOME"));
  126.13              return false;
   127.1 --- a/portalpack.servers.sunps/build.xml	Fri Jun 10 09:46:37 2011 +0200
   127.2 +++ b/portalpack.servers.sunps/build.xml	Sun Jun 26 10:25:14 2011 +0800
   127.3 @@ -24,8 +24,8 @@
   127.4  <!-- If you delete this file and reopen the project it will be recreated. -->
   127.5  <project name="contrib/portalpack.servers.sunps" default="netbeans" basedir=".">
   127.6      <description>Builds, tests, and runs the project org.netbeans.modules.portals.sunps7.</description>
   127.7 -      <import file="../../nbbuild/templates/projectized.xml"/>
   127.8 -     <property name="base.nbm.target.dir" value="build"/>
   127.9 +     <import file="../../nbbuild/templates/projectized.xml"/>
  127.10 +     
  127.11       <target name="netbeans-extra" depends="release"/>
  127.12  
  127.13       <target name="compile" depends="projectized-common.compile">
   128.1 --- a/portalpack.servers.sunps/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
   128.2 +++ b/portalpack.servers.sunps/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
   128.3 @@ -3,4 +3,4 @@
   128.4  OpenIDE-Module-Install: org/netbeans/modules/portalpack/servers/sunps7/Installer.class
   128.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/servers/sunps7/resources/layer.xml
   128.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/servers/sunps7/resources/Bundle.properties
   128.7 -OpenIDE-Module-Specification-Version: 2.99
   128.8 +OpenIDE-Module-Specification-Version: 3.0.4
   129.1 --- a/portalpack.servers.sunps/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
   129.2 +++ b/portalpack.servers.sunps/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
   129.3 @@ -82,7 +82,7 @@
   129.4                      <build-prerequisite/>
   129.5                      <compile-dependency/>
   129.6                      <run-dependency>
   129.7 -                        <specification-version>2.0.4</specification-version>
   129.8 +                        <specification-version>3.0</specification-version>
   129.9                      </run-dependency>
  129.10                  </dependency>
  129.11                  <dependency>
   130.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   130.2 +++ b/portalpack.servers.websynergy/l10n/build.xml	Sun Jun 26 10:25:14 2011 +0800
   130.3 @@ -0,0 +1,60 @@
   130.4 +<?xml version="1.0" encoding="UTF-8"?>
   130.5 +
   130.6 +<!--
   130.7 +The contents of this file are subject to the terms of the Common Development
   130.8 +and Distribution License (the License). You may not use this file except in
   130.9 +compliance with the License.
  130.10 +
  130.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  130.12 +or http://www.netbeans.org/cddl.txt.
  130.13 +
  130.14 +When distributing Covered Code, include this CDDL Header Notice in each file
  130.15 +and include the License file at http://www.netbeans.org/cddl.txt.
  130.16 +If applicable, add the following below the CDDL Header, with the fields
  130.17 +enclosed by brackets [] replaced by your own identifying information:
  130.18 +"Portions Copyrighted [year] [name of copyright owner]"
  130.19 +
  130.20 + The Original Software is NetBeans. The Initial Developer of the Original
  130.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  130.22 + Microsystems, Inc. All Rights Reserved.
  130.23 +-->
  130.24 +
  130.25 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
  130.26 +<!-- for some information on what you could do (e.g. targets to override). -->
  130.27 +<!-- If you delete this file and reopen the project it will be recreated. -->
  130.28 +<project name="ml-build" default="netbeans" basedir="../">
  130.29 +    
  130.30 +    <description>Portal Pack ML build</description>
  130.31 +    <import file="../build.xml"/>
  130.32 +    <target name="create-l10n-kit">
  130.33 +         <property name="l10nkit-dir" value="build/l10n"/>
  130.34 +         <property name="l10nkit-zip" value="build/portalpack-servers-websynergy-l10nkit.zip"/>
  130.35 +         <delete dir="${l10nkit-dir}"/>
  130.36 +         <delete file="${l10nkit-zip}"/>
  130.37 +         
  130.38 +         <mkdir dir="${l10nkit-dir}"/>
  130.39 +         
  130.40 +         <copydir src="src" includes="**/Bundle.properties,**/*.html,**/*.htm" dest="${l10nkit-dir}/src"/>
  130.41 +
  130.42 +         <zip destfile="${l10nkit-zip}"
  130.43 +           basedir="${l10nkit-dir}"
  130.44 +         />
  130.45 +    </target>
  130.46 +    
  130.47 +    <target name="compile" depends="contrib/portalpack.servers.websynergy.compile">
  130.48 +        <copy todir="build/classes">
  130.49 +             <fileset dir="l10n/ja"/>
  130.50 +             <fileset dir="l10n/pt_BR"/>
  130.51 +             <fileset dir="l10n/zh_CN"/>  
  130.52 +         </copy>
  130.53 +     </target>
  130.54 +	 
  130.55 +	 <target name="copyL10n">
  130.56 +		 <echo message="${l10n.src.dir}"/>
  130.57 +		 <copy todir=".">
  130.58 +			<fileset dir="${l10n.src.dir}"/>			
  130.59 +			<mapper type="glob" from="src" to="l10n/${locale}"/>
  130.60 +		 </copy>
  130.61 +	 </target>
  130.62 +      
  130.63 +</project>
   131.1 --- a/portalpack.servers.websynergy/l10n/org/netbeans/modules/portalpack/servers/liferay/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   131.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   131.3 @@ -1,22 +0,0 @@
   131.4 -# The contents of this file are subject to the terms of the Common Development
   131.5 -# and Distribution License (the License). You may not use this file except in
   131.6 -# compliance with the License.
   131.7 -# 
   131.8 -# You can obtain a copy of the License at http://www.netbeans.org/cddl.html
   131.9 -# or http://www.netbeans.org/cddl.txt.
  131.10 -# 
  131.11 -# When distributing Covered Code, include this CDDL Header Notice in each file
  131.12 -# and include the License file at http://www.netbeans.org/cddl.txt.
  131.13 -# If applicable, add the following below the CDDL Header, with the fields
  131.14 -# enclosed by brackets [] replaced by your own identifying information:
  131.15 -# "Portions Copyrighted [year] [name of copyright owner]"
  131.16 -# 
  131.17 -# The Original Software is NetBeans. The Initial Developer of the Original
  131.18 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  131.19 -# Microsystems, Inc. All Rights Reserved.
  131.20 -
  131.21 -# Sample ResourceBundle properties file
  131.22 -
  131.23 -Sun_Java_System_AppServer_9=GlassFish / Sun Java System AppServer 9.x
  131.24 -
  131.25 -LBL_LifeRay=WebSynergy Server (Early Access)
   132.1 --- a/portalpack.servers.websynergy/l10n/org/netbeans/modules/portalpack/servers/liferay/impl/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   132.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   132.3 @@ -1,46 +0,0 @@
   132.4 -# The contents of this file are subject to the terms of the Common Development
   132.5 -# and Distribution License (the License). You may not use this file except in
   132.6 -# compliance with the License.
   132.7 -# 
   132.8 -# You can obtain a copy of the License at http://www.netbeans.org/cddl.html
   132.9 -# or http://www.netbeans.org/cddl.txt.
  132.10 -# 
  132.11 -# When distributing Covered Code, include this CDDL Header Notice in each file
  132.12 -# and include the License file at http://www.netbeans.org/cddl.txt.
  132.13 -# If applicable, add the following below the CDDL Header, with the fields
  132.14 -# enclosed by brackets [] replaced by your own identifying information:
  132.15 -# "Portions Copyrighted [year] [name of copyright owner]"
  132.16 -# 
  132.17 -# The Original Software is NetBeans. The Initial Developer of the Original
  132.18 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  132.19 -# Microsystems, Inc. All Rights Reserved.
  132.20 -
  132.21 -
  132.22 -Deployment_failed=Deployment failed
  132.23 -
  132.24 -Problem_preparing_war=Problem preparing war.
  132.25 -
  132.26 -Deployed_Successfully=Portlet deployed successfully.\
  132.27 -
  132.28 -UNDEPLOYMENT_FAILED=UnDeployment failed
  132.29 -
  132.30 -PROBLEM_IN_UNREGISTER=Problem in unregister
  132.31 -
  132.32 -INSTALLING_PORTLET_CONTAINER=Installing Portlet Container
  132.33 -
  132.34 -SETUP_XML_NOT_FOUND=Setup.xml not found. PC cannot be installed on AppServer
  132.35 -
  132.36 -STARTING_APPSERVER=Starting Glassfish
  132.37 -
  132.38 -ERROR_INSTALLING_PC=Error installing PC on AppServer
  132.39 -
  132.40 -PORTLET_CONTAINER_IS_NOT_INSTALLED=Portlet Container may not have been installed properly on GlassFish.\nIt may take several seconds to install portlet container during first time server start up.\nWait for some time and check the url {0} \nto verify portlet container installation. \nIf not installed then install it using command \n"java -jar portlet-container-configurator.jar <AppServerInstallRoot>  <DomainDir>" 
  132.41 -
  132.42 -CHECK_PORTLET_CONTAINER_INSTALLATION=Checking Portlet Container Installation ...
  132.43 -
  132.44 -MSG_ASADMIN_COMMAND_FAILED=asadmin command failed.
  132.45 -
  132.46 -MSG_DEPLOY_ON_GLASSFISH_FAILED=Deployment on Glassfish failed
  132.47 -
  132.48 -MSG_UNDEPLOY_ON_GLASSFISH_FAILED=UnDeployment on Glassfish failed
  132.49 -Deployment_Done=Deployment on WebSynergy Portal Server is done. Check Server log in output tab for more details.
   133.1 --- a/portalpack.servers.websynergy/l10n/org/netbeans/modules/portalpack/servers/liferay/portlets/php/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   133.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   133.3 @@ -1,426 +0,0 @@
   133.4 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   133.5 -#
   133.6 -# Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
   133.7 -#
   133.8 -# The contents of this file are subject to the terms of either the GNU
   133.9 -# General Public License Version 2 only ("GPL") or the Common
  133.10 -# Development and Distribution License("CDDL") (collectively, the
  133.11 -# "License"). You may not use this file except in compliance with the
  133.12 -# License. You can obtain a copy of the License at
  133.13 -# http://www.netbeans.org/cddl-gplv2.html
  133.14 -# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  133.15 -# specific language governing permissions and limitations under the
  133.16 -# License.  When distributing the software, include this License Header
  133.17 -# Notice in each file and include the License file at
  133.18 -# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  133.19 -# particular file as subject to the "Classpath" exception as provided
  133.20 -# by Sun in the GPL Version 2 section of the License file that
  133.21 -# accompanied this code. If applicable, add the following below the
  133.22 -# License Header, with the fields enclosed by brackets [] replaced by
  133.23 -# your own identifying information:
  133.24 -# "Portions Copyrighted [year] [name of copyright owner]"
  133.25 -#
  133.26 -# Contributor(s):
  133.27 -#
  133.28 -# The Original Software is NetBeans. The Initial Developer of the Original
  133.29 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
  133.30 -# Microsystems, Inc. All Rights Reserved.
  133.31 -#
  133.32 -# If you wish your version of this file to be governed by only the CDDL
  133.33 -# or only the GPL Version 2, indicate your decision by adding
  133.34 -# "[Contributor] elects to include this software in this distribution
  133.35 -# under the [CDDL or GPL Version 2] license." If you do not indicate a
  133.36 -# single choice of license, a recipient has the option to distribute
  133.37 -# your version of this file under either the CDDL, the GPL Version 2 or
  133.38 -# to extend the choice of license to its licensees as provided above.
  133.39 -# However, if you add GPL Version 2 code and therefore, elected the GPL
  133.40 -# Version 2 license, then the option applies only if the new code is
  133.41 -# made subject to such option by the copyright holder.
  133.42 -
  133.43 -
  133.44 -# <RAVE> Copy from projects/projectui/src/org/netbeans/modules/project/ui
  133.45 -OpenIDE-Module-Name=Project UI
  133.46 -OpenIDE-Module-Display-Category=Infrastructure
  133.47 -OpenIDE-Module-Short-Description=Supplies the basic user interface for projects in the IDE.
  133.48 -OpenIDE-Module-Long-Description=\
  133.49 -    GUI infrastructure for working with projects in the IDE: the Projects and Files windows, \
  133.50 -    the project chooser dialog, the project-sensitive New File wizard, etc.
  133.51 -
  133.52 -Templates/LiferayPortlets/PHPPortlet.php=Php Portlet for Liferay
  133.53 -Templates/LiferayPortlets=Liferay Portlets
  133.54 -# ProjectXMLCatalogReader
  133.55 -LBL_project_xml_schemas=Project XML Schemas
  133.56 -HINT_project_xml_schemas=Permits validation of project.xml and private.xml files from the IDE.
  133.57 -
  133.58 -#BrowseFolders
  133.59 -BTN_BrowseFolders_Select_Option=Select Folder
  133.60 -BTN_BrowseFolders_Cancel_Option=Cancel
  133.61 -ACSN_BrowseFolders_Cancel_Option=Cancel
  133.62 -ACSD_BrowseFolders_Cancel_Option=N/A
  133.63 -MNE_BrowseFolders_Select_Option=S
  133.64 -ACSN_BrowseFolders_Select_Option=Select Folder
  133.65 -ACSD_BrowseFolders_Select_Option=N/A
  133.66 -LBL_BrowseFolders_jLabel1=Folders:
  133.67 -MNE_BrowseFolders_jLabel1=F
  133.68 -LBL_BrowseFolders_Dialog=Browse Folders
  133.69 -# ProjectTab
  133.70 -#LBL_ProjectTab=Projects
  133.71 -LBL_projectTab_tc=Files
  133.72 -LBL_projectTabLogical_tc=Projects
  133.73 -
  133.74 -LBL_ProjectMode=Projects
  133.75 -LBL_ProjectsPhysicalTabAction_Name=&Files
  133.76 -LBL_ProjectsLogicalTabAction_Name=Pro&jects
  133.77 -
  133.78 -# {0} Display name of the group, {1} Display name of the project,
  133.79 -# {2} Original name of the folder,
  133.80 -FMT_PhysicalView_GroupName={1} - {0}
  133.81 -
  133.82 -#Nodes
  133.83 -LBL_OpenProjectsNode_Name=Projects
  133.84 -
  133.85 -#Badged version of the project name {0} = orignal name
  133.86 -LBL_MainProject_BadgedNamePattern={0} [Main]
  133.87 -
  133.88 -#Dialogs
  133.89 -LBL_PrjChooser_Title=Open Project
  133.90 -BTN_PrjChooser_ApproveButtonText=Open Project Folder
  133.91 -BTN_PrjChooser_ApproveButtonTooltipText=Opens the project located in the selected folder.
  133.92 -MNM_PrjChooser_ApproveButtonText=O
  133.93 -LBL_PrjChooser_ProjectDirectoryFilter_Name=Project Folder
  133.94 -LBL_PrjChooser_ProjectName_Label=&Project Name\:
  133.95 -LBL_PrjChooser_Main_CheckBox=Open as &Main Project
  133.96 -LBL_PrjChooser_Subprojects_CheckBox=Open &Required Projects\:
  133.97 -MSG_PrjChooser_WaitMessage=... Please wait ...
  133.98 -# {0} number of projects
  133.99 -LBL_PrjChooser_Multiselection={0} Projects
 133.100 -# {0} - display name of subproject
 133.101 -# {1} - location of subproject on disk
 133.102 -LBL_PrjChooser_SubprojectName_Format={0} ({1})
 133.103 -
 133.104 -#SystemFile system
 133.105 -  #Menus
 133.106 -Menu/File/New=New
 133.107 -Menu/File/New/org-netbeans-core-actions-NewTemplateCallableAction.instance=Folder/File...
 133.108 -Menu/File/Open=Open
 133.109 -Menu/File/Open/org-netbeans-modules-project-ui-OpenProjectAction.instance=Project...
 133.110 -
 133.111 -Menu/BuildProject=&Build
 133.112 -Menu/RunProject=&Run
 133.113 -Menu/RunProject/RunOther=Ru&n File
 133.114 -Mount/PrjAllRoots.instance=This Computer
 133.115 -
 133.116 -Actions/Project=Project
 133.117 -Actions/Build=Build
 133.118 -
 133.119 -Templates/Project=Project
 133.120 -Templates/Project/Import=Projects with Existing Sources
 133.121 -Templates/Project/Samples=Samples
 133.122 -Toolbars/Build=Build
 133.123 -
 133.124 -# PhysicalViewFactoryImpl
 133.125 -HINT_project=Project in {0}
 133.126 -HINT_group=Source folder in {0}
 133.127 -
 133.128 -#NoMainProjectWarning
 133.129 -LBL_NoMainProjectWarning_jLabel1=The main project has not been set.
 133.130 -LBL_NoMainProjectWarning_jLabel2=&Select the main project\:
 133.131 -MNE_NoMainProjectWarning_jLabel2=S
 133.132 -LBL_NoMainClassWarning_ChooseMainProject_OK=OK
 133.133 -AD_NoMainClassWarning_ChooseMainProject_OK=N/A
 133.134 -CTL_NoMainProjectWarning_Title=Warning
 133.135 -
 133.136 -ACC_InfiniteProgressName=Infinite Progress Bar
 133.137 -ACC_InfiniteProgressDesc=Shows some tasks are in progress.
 133.138 -
 133.139 -# ExitDialog
 133.140 -CTL_ExitTitle=Save
 133.141 -# Note that the '&' goes just before the mnemonic character
 133.142 -CTL_Save=Save
 133.143 -CTL_Save_MNM=S
 133.144 -ACSD_Save=Save.
 133.145 -# Note that the '&' goes just before the mnemonic character
 133.146 -CTL_SaveAll=Save All
 133.147 -CTL_SaveAll_MNM=A
 133.148 -ACSD_SaveAll=Save all.
 133.149 -# Note that the '&' goes just before the mnemonic character
 133.150 -CTL_DiscardAll=Discard All
 133.151 -CTL_DiscardAll_MNM=D
 133.152 -ACSD_DiscardAll=Discard all.
 133.153 -EXC_Save=An exception occurred while saving
 133.154 -ACSN_ListOfChangedFiles=List
 133.155 -ACSD_ListOfChangedFiles=List of changed files for save
 133.156 -ACSD_ExitDialog=Dialog for save any changes
 133.157 -
 133.158 -#ProjectOpenListSettings
 133.159 -TXT_SelectTemplate=Select Project
 133.160 -TXT_UISettings=UISettings
 133.161 -CTL_Categories=Categories\:
 133.162 -CTL_Projects=Projects\:
 133.163 -CTL_Files=File Types\:
 133.164 -MNE_Categories=C
 133.165 -MNE_Projects=P
 133.166 -MNE_Files=F
 133.167 -
 133.168 -TXT_NoDescription=No description.
 133.169 -
 133.170 -CTL_Description=&Description\:
 133.171 -
 133.172 -#TemplateChooserPanelGUI
 133.173 -LBL_TemplateChooserPanelGUI_Name=Choose File Type
 133.174 -LBL_TemplateChooserPanelGUI_jLabel1=Project:
 133.175 -MNE_TemplateChooserPanelGUI_jLabel1=P
 133.176 -LBL_TemplateChooserPanelGUI_jLabel2=File types:
 133.177 -LBL_TemplateChooserPanelGUI_jLabel3=Description:
 133.178 -LBL_TemplateChooserPanelGUI_jTextArea=No description
 133.179 -LBL_TemplateChooserPanelGUI_showRecommendedTemplatesCheckBox=Only Show File Types Supported in Selected Project
 133.180 -LBL_TargetChooser_FileName_Label=File Name\:
 133.181 -LBL_TargetChooser_FolderName_Label=Folder Name\:
 133.182 -LBL_TargetChooser_Project_Label=Project\:
 133.183 -LBL_TargetChooser_Folder_Label=Folder\:
 133.184 -LBL_TargetChooser_ParentFolder_Label=Parent Folder\:
 133.185 -LBL_TargetChooser_Browse_Button=Browse...
 133.186 -LBL_TargetChooser_CreatedFile_Label=Created File\:
 133.187 -LBL_TargetChooser_CreatedFolder_Label=Created Folder\:
 133.188 -LBL_TargetChooser_Location_Label=Location\:
 133.189 -MNE_TargetChooser_FileName_Label=N
 133.190 -MNE_TargetChooser_FolderName_Label=N
 133.191 -MNE_TargetChooser_Project_Label=P
 133.192 -MNE_TargetChooser_Folder_Label=l
 133.193 -MNE_TargetChooser_ParentFolder_Label=r
 133.194 -MNE_TargetChooser_Browse_Button=w
 133.195 -MNE_TargetChooser_CreatedFile_Label=C
 133.196 -MNE_TargetChooser_CreatedFolder_Label=C
 133.197 -MNE_TargetChooser_Location_Label=t
 133.198 -# 0 - name of group, 1 - name of project
 133.199 -FMT_TargetChooser_GroupProjectNameBadge={0} [{1}]
 133.200 -
 133.201 -#NewFileWizard
 133.202 -LBL_NewFileWizard_Title=New File
 133.203 -LBL_NewFileWizard_Subtitle=New
 133.204 -LBL_NewFileWizard_MessageFormat={0} {1}
 133.205 -ACSN_NewFileWizard=New file wizard
 133.206 -ACSD_NewFileWizard=Choose new file type
 133.207 -
 133.208 -#NewProjectWizard
 133.209 -LBL_NewProjectWizard_Title=New Project
 133.210 -LBL_NewProjectWizard_Subtitle=New
 133.211 -LBL_NewProjectWizard_MessageFormat={0} {1}
 133.212 -ACSN_NewProjectWizard=New project wizard
 133.213 -ACSD_NewProjectWizard=Choose type of new project
 133.214 -LBL_NewProjectWizard_Name=Choose Project
 133.215 -LBL_NewProjectWizard_Dots=...
 133.216 -
 133.217 -LBL_TemplatesPanel_Name=Choose File Type
 133.218 -LBL_TemplatesPanel_Dots=...
 133.219 -LBL_TemplatesPanel_PleaseWait=Please wait...
 133.220 -
 133.221 -LBL_PageLayoutsPanel_Name=Select Page Layout
 133.222 -
 133.223 -#Templates
 133.224 -Templates/Other/Folder=Folder
 133.225 -
 133.226 -#Dialog for new File/Folder outside of project
 133.227 -LBL_NonProject_OK_Button=OK
 133.228 -LBL_NonProject_Cancel_Button=Cancel
 133.229 -LBL_NonProject_File_Name=&File Name\:
 133.230 -LBL_NonProject_File_Title=New Empty File
 133.231 -LBL_NonProject_Folder_Name=&Folder Name\:
 133.232 -LBL_NonProject_Folder_Title=New Folder
 133.233 -ACD_NonProject_File_TextField=File Name to Create
 133.234 -ACD_NonProject_File_Dialog=New File
 133.235 -ACD_NonProject_Folder_TextField=Folder Name to Create
 133.236 -ACD_NonProject_Folder_Dialog=New Folder
 133.237 -
 133.238 -CTL_Templates=Templates\:
 133.239 -MNE_Templates=T
 133.240 -
 133.241 -#SimpleTargetChooserPanel
 133.242 -LBL_SimpleTargetChooserPanel_Name=Name and Location
 133.243 -LBL_SimpleTargetChooserPanelGUI_NewFilePrefix=new
 133.244 -
 133.245 -#ProjectUtilities
 133.246 -MSG_fs_or_folder_does_not_exist=The target folder does not exist.
 133.247 -MSG_fs_is_readonly=The target folder is read-only.
 133.248 -# {0} - name of the existing file
 133.249 -MSG_file_already_exist=The file {0} already exists.
 133.250 -MSG_NodeNotFound_ProjectsTab=The document node could not be found in the Projects window.
 133.251 -MSG_NodeNotFound_FilesTab=The document node could not be found in the Files window.
 133.252 -#Hacks
 133.253 -LBL_MultipleProjects=Multiple Projects
 133.254 -
 133.255 -#TemplatesPanelGUI
 133.256 -ACSN_CategoriesPanel=Categories of types new objects
 133.257 -ACSD_CategoriesPanel=List of categories of new objects which can be choosen
 133.258 -ACSN_TemplatesPanel=Types of new objects
 133.259 -ACSD_TemplatesPanel=List of types of new objects which can be choosen
 133.260 -
 133.261 -ACSN_jLabel1=Project
 133.262 -
 133.263 -ACSD_jLabel1=List of available projects
 133.264 -
 133.265 -ACSN_BrowseFolders_jLabel1=Folders\:
 133.266 -ACSN_BrowseFolders_folderPanel=Folders:
 133.267 -ACSD_BrowseFolders_folderPanel=The tree contains the folders contained in the project's directory
 133.268 -
 133.269 -ACSN_BrowseFolders=Browse folders to choose a target folder
 133.270 -
 133.271 -ACSD_ProjectChooserAccessory_jCheckBoxMain=N/A
 133.272 -ACSD_ProjectChooserAccessory_jCheckBoxSubprojects=Opens also the projects of which depends the selected project
 133.273 -
 133.274 -ACSN_ProjectChooserAccessory_jListSubprojects=List of the subprojects
 133.275 -
 133.276 -ACSD_ProjectChooserAccessory_jListSubprojects=List of the projects of which depends the selected project
 133.277 -
 133.278 -AD_SimpleTargetChooserPanelGUI=N/A
 133.279 -
 133.280 -AD_documentNameTextField=N/A
 133.281 -
 133.282 -AD_projectTextField=N/A
 133.283 -
 133.284 -AD_locationComboBox=N/A
 133.285 -
 133.286 -AD_folderTextField=N/A
 133.287 -
 133.288 -AD_browseButton=N/A
 133.289 -
 133.290 -AD_fileTextField=N/A
 133.291 -
 133.292 -AN_ProjectChooserAccessory=N/A
 133.293 -AD_ProjectChooserAccessory=N/A
 133.294 -
 133.295 -AN_ProjectName=N/A
 133.296 -AD_ProjectName=N/A
 133.297 -
 133.298 -AD_NoMainProjectWarning_jList1=N/A
 133.299 -
 133.300 -AD_NoMainProjectWarninig=N/A
 133.301 -# {0} - name of the file
 133.302 -# {1} - an integer representing the invalid characters:
 133.303 -#       0: both '/' and '\\' are invalid
 133.304 -#       1: '\\' is invalid
 133.305 -MSG_not_valid_filename=The filename {0} is not permitted as it contains {1,choice,0#a slash (/) or a backslash (\\)|1#a backslash (\\)}.
 133.306 -# {0} - name of the file
 133.307 -# {1} - an integer representing the invalid characters:
 133.308 -#       0: both '/' and '\\' are invalid
 133.309 -#       1: '\\' is invalid
 133.310 -MSG_not_valid_folder=The folder name {0} is not permitted as it contains {1,choice,0#a slash (/) or a backslash (\\)|1#a backslash (\\)}.
 133.311 -
 133.312 -#OpenProjectList:
 133.313 -#Dialog caption:
 133.314 -CAP_Opening_Projects=Opening Projects
 133.315 -LBL_Opening_Projects_Progress=Opening Projects
 133.316 -LBL_Opening_Projects=Opening Project:
 133.317 -
 133.318 -# <RAVE>
 133.319 -# Window System API
 133.320 -
 133.321 -# TopComponent
 133.322 -LBL_component_name=<name of component>
 133.323 -#LBL_mode_name=<name of mode>
 133.324 -#LBL_workspace_name=<name of workspace>
 133.325 -
 133.326 -# WizardDescriptor
 133.327 -# Dialog title:
 133.328 -TITLE_wizard=My Wizard
 133.329 -
 133.330 -# WizardDescriptor.Iterator
 133.331 -# Label the sequence #. Appears at top of pane:
 133.332 -# e.g. "Panel Name (1 of 3)"
 133.333 -TITLE_x_of_y={0} of {1}
 133.334 -# Provide list of steps to show in left pane:
 133.335 -#LBL_step_1=Select First Thing
 133.336 -#LBL_step_2=Configure Details
 133.337 -
 133.338 -# WizardDescriptor.Panel
 133.339 -# Will appear in dialog title; see above
 133.340 -TITLE_WizardPanel=Panel Name
 133.341 -# {0} name of folder
 133.342 -TXT_CantCreatePage=Can not create a new page into {0} folder.
 133.343 -TXT_CantUpdatePortletXML=Can not update portlet.xml
 133.344 -
 133.345 -# CallableSystemAction
 133.346 -LBL_Action=Run Action
 133.347 -
 133.348 -# PageIterator
 133.349 -# {0} web form name
 133.350 -MSG_NotInWebProject=<html>Visual Web items cannot be created under non-Web project.</html>
 133.351 -MSG_NotSupportProperties=<html>Visual Web items cannot be created because the target project does not support Auxiliary Configuration for saving project properties.</html>
 133.352 -MSG_InvalidJavaFileName=<html>Name "{0}" is an invalid file name. Please specify a name that is a legal Java identifier.</html>
 133.353 -MSG_InvalidJavaFolderName=<html>Name "{0}" is an invalid folder name. Please specify a name that is a legal Java identifier.</html>
 133.354 -MSG_NotUnderTargetFolder=<html>Folder "{0}" is not under the valid target folder "{1}"</html>
 133.355 -MSG_InvalidTargetFolder=<html>Folder "{0}" is an invalid folder name</html>
 133.356 -MSG_NoSourceRoot=<html>No valid Source Package Folder defined in the project.</html>
 133.357 -MSG_PortletIncompatible=<html>Mixture of Visual Web JSF regular page and Portlet page is currently not supported.</html>
 133.358 -MSG_PageBeanNameConflict=<html>Java file "{0}" corresponding to page name "{1}" already exists. Please select another name.</html>
 133.359 -MSG_FileDifferentByCase=<html>The file name you have specified is similar to that of an existing file in this folder, differing only by letter case. This will cause problems if you attempt to work with this project on a system with case-insensitive filenames.<br>It is recommended that you rename the file so that it is unique.</html>
 133.360 -MSG_InvalidPackageName=<html>Name "{0}" is an invalid package name. Please specify a name that is a legal Java identifier.</html>
 133.361 -MSG_NotAPortlet10Application=<html>Visual JSF Portlet can be created only for Portlet 1.0 application</html>
 133.362 -
 133.363 -LBL_PagebeanPackagePanel_Name=Page Bean Package
 133.364 -LBL_PagebeanPackage_Label=Default Java Package\:
 133.365 -MNE_PagebeanPackage_Label=B
 133.366 -AD_PagebeanPackagePanelGUI=N/A
 133.367 -AD_packageTextField=N/A
 133.368 -NO_PREVIEW_TEXT=Preview not available
 133.369 -PREVIEW_TITLE=Preview
 133.370 -NO_DESCRIPTION_TEXT=Description not available
 133.371 -
 133.372 -# Visual Web JSF Backwards Compatibility Kit
 133.373 -LBL_MissingJSF=<li>The <b>JavaServer Faces 1.1 Reference Implementation (RI)</b> \
 133.374 -    is required for the J2EE 1.4 projects.</li>
 133.375 -LBL_MissingJAXRPC=<li>The <b>Web Services JAX-RPC Libraries</b> \
 133.376 -    is required for the J2EE 1.4 projects.</li>
 133.377 -LBL_MissingRowset=<li>The <b>Rowset Reference Implementation (RI)</b> \
 133.378 -    is required for projects that use J2SE 1.4.</li>
 133.379 -LBL_MissingOne=RI is
 133.380 -LBL_MissingMany=RIs are
 133.381 -LBL_MissingNBM=<html>The following {0} not installed in the IDE.  \
 133.382 -    Please use the Plugins to install the <b>Visual Web JSF Backwards Compatibility Kit</b>.\
 133.383 -    <ul>{1}</ul></html>
 133.384 -
 133.385 -MNE_TargetChooser_FileName_Label_1=
 133.386 -
 133.387 -#Portlet details
 133.388 -LBL_PORTLET_NAME=&Portlet Name:
 133.389 -LBL_PORTLET_DISPLAY_NAME=Portlet &Display Name:
 133.390 -LBL_PORTLET_DESC=Portlet Des&cription:
 133.391 -LBL_PORTLET_TITLE=Portlet &Title:
 133.392 -LBL_PORTLET_SHORT_TITLE=Portlet S&hort Title:
 133.393 -LBL_PORTLET_MODE=Portlet &Mode:
 133.394 -LBL_VIEW=&VIEW
 133.395 -
 133.396 -LB_EDIT=&EDIT
 133.397 -
 133.398 -LBL_HELP=&HELP
 133.399 -
 133.400 -MSG_INVALID_PORTLET_NAME=Invalid Portlet Name
 133.401 -
 133.402 -MSG_INVALID_PORTLET_TITLE=Invalid Portlet Title
 133.403 -
 133.404 -MSG_INVALID_PORTLET_SHORT_TITLE=Invalid Portlet Short Title
 133.405 -
 133.406 -MSG_INVALID_PORTLET_DISPLAY_NAME=Invalid Display Name
 133.407 -
 133.408 -MSG_INVALID_PORTLET_DESC=Invalid Portlet Description
 133.409 -
 133.410 -MSG_PORTLET_ALREADY_PRESENT=A Portlet with same name already exists
 133.411 -ErrorVisualPanel.jLabel1.text=This operation is only allowed for a Portlet Applications
 133.412 -
 133.413 -TTL_NEW_PORTLET=New Portlet Class
 133.414 -TTL_JSP_PANEL=Create Jsps for Portlet
 133.415 -ACSN_Portlet_Name=&PortletName
 133.416 -ACSD_Portlet_Name=Portlet Name
 133.417 -ACSD_Portlet_Display_Name=Portlet Display Name
 133.418 -ACSD_Portlet_Description=Portlet Description
 133.419 -ACSD_Portlet_Title=Portlet Title
 133.420 -ACSD_Portlet_Short_Title=Portlet Short Title
 133.421 -ACSD_VIEW=View Mode
 133.422 -ACSD_EDIT=Edit Mode
 133.423 -ACSD_HELP=Help Mode
 133.424 -ACSD_VIEW_JSP=View Jsp
 133.425 -ACSD_EDIT_JSP=Edit Jsp
 133.426 -ACSD_HELP_JSP=Help Jsp
 133.427 -ACSD_CREATE_JSPS=Create Jsps
 133.428 -
 133.429 -TXT_CantUpdatePortletXML=Could not update portlet.xml
 133.430 \ No newline at end of file
   134.1 --- a/portalpack.servers.websynergy/l10n/org/netbeans/modules/portalpack/servers/liferay/portlets/php/actions/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   134.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   134.3 @@ -1,58 +0,0 @@
   134.4 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   134.5 -#
   134.6 -# Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
   134.7 -#
   134.8 -# The contents of this file are subject to the terms of either the GNU
   134.9 -# General Public License Version 2 only ("GPL") or the Common
  134.10 -# Development and Distribution License("CDDL") (collectively, the
  134.11 -# "License"). You may not use this file except in compliance with the
  134.12 -# License. You can obtain a copy of the License at
  134.13 -# http://www.netbeans.org/cddl-gplv2.html
  134.14 -# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  134.15 -# specific language governing permissions and limitations under the
  134.16 -# License.  When distributing the software, include this License Header
  134.17 -# Notice in each file and include the License file at
  134.18 -# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  134.19 -# particular file as subject to the "Classpath" exception as provided
  134.20 -# by Sun in the GPL Version 2 section of the License file that
  134.21 -# accompanied this code. If applicable, add the following below the
  134.22 -# License Header, with the fields enclosed by brackets [] replaced by
  134.23 -# your own identifying information:
  134.24 -# "Portions Copyrighted [year] [name of copyright owner]"
  134.25 -#
  134.26 -# Contributor(s):
  134.27 -#
  134.28 -# The Original Software is NetBeans. The Initial Developer of the Original
  134.29 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
  134.30 -# Microsystems, Inc. All Rights Reserved.
  134.31 -#
  134.32 -# If you wish your version of this file to be governed by only the CDDL
  134.33 -# or only the GPL Version 2, indicate your decision by adding
  134.34 -# "[Contributor] elects to include this software in this distribution
  134.35 -# under the [CDDL or GPL Version 2] license." If you do not indicate a
  134.36 -# single choice of license, a recipient has the option to distribute
  134.37 -# your version of this file under either the CDDL, the GPL Version 2 or
  134.38 -# to extend the choice of license to its licensees as provided above.
  134.39 -# However, if you add GPL Version 2 code and therefore, elected the GPL
  134.40 -# Version 2 license, then the option applies only if the new code is
  134.41 -# made subject to such option by the copyright holder.
  134.42 -
  134.43 -
  134.44 -# SetStartPageAction
  134.45 -LBL_SetAsStartPage=Set As Start Page
  134.46 -LBL_SetInitalPageAction_SETINITIALVIEWPAGE=Set as Initial Page
  134.47 -LBL_InitialViewShortDesc=Initial VIEW Page
  134.48 -LBL_InitialEditShortDesc=Initial EDIT Page
  134.49 -LBL_InitialHelpShortDesc=Initial HELP Page
  134.50 -MSG_StartPageChanged=Start Page has been set to\:
  134.51 -MSG_NoStartPage=No start page defined for application.
  134.52 -MSG_UnableToSetDefaultIcon=Can\'t find data object for file {0} to set default icon.
  134.53 -MNU_VIEWMODE=View Mode Page
  134.54 -MNU_EDITMODE=Edit Mode Page
  134.55 -MNU_HELPMODE=Help Mode Page
  134.56 -MNU_NONEMODE=No Initial Page
  134.57 -MNE_VIEWMODE=V
  134.58 -MNE_EDITMODE=E
  134.59 -MNE_HELPMODE=H
  134.60 -MNE_NONEMODE=N
  134.61 -
   135.1 --- a/portalpack.servers.websynergy/l10n/org/netbeans/modules/portalpack/servers/liferay/resources/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   135.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   135.3 @@ -1,6 +0,0 @@
   135.4 -OpenIDE-Module-Display-Category=PortalPack
   135.5 -OpenIDE-Module-Long-Description=\
   135.6 -    This plug-in can be used to deploy portlets on Synergy Server.
   135.7 -OpenIDE-Module-Name=Synergy Plugin
   135.8 -OpenIDE-Module-Short-Description=Plugin to develop and deploy portlets on WebSynergy.
   135.9 -Templates/asmFiles/phpPortlet=Liferay Php Portlet
   136.1 --- a/portalpack.servers.websynergy/l10n/org/netbeans/modules/portalpack/servers/liferay/ui/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   136.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   136.3 @@ -1,32 +0,0 @@
   136.4 -LBL_OPEN_SOURCE_PORTLET_CONTAINER=OpenPortal Portlet Container
   136.5 -
   136.6 -LBL_PC_HOME=PC Home\:
   136.7 -
   136.8 -LBL_HOST=Host\:
   136.9 -LBL_PORTAL_URI=Portal Uri:
  136.10 -
  136.11 -LBL_ADMIN_URI=Admin Uri\:
  136.12 -
  136.13 -MSG_NOT_A_VALID_HOST=Not a valid host
  136.14 -
  136.15 -MSG_NOT_A_VALID_PORTAL_URI=Not a valid portal uri
  136.16 -
  136.17 -MSG_NOT_A_VALID_ADMIN_URI=Not a valid admin uri
  136.18 -
  136.19 -MSG_NOT_A_VALID_PORTLET_URI=Not a valid portlet uri
  136.20 -
  136.21 -MSG_INVALID_PC_HOME=Invalid Portlet Container Home
  136.22 -
  136.23 -MSG_INVALID_PC_2_0_HOME=Not a Valid OpenPortal Portlet Container 2.0 Home
  136.24 -
  136.25 -MSG_PC_2_0_HOME_NEED_PC_1_0_Home=PC 2.0 installation is selected. But PC 1.0 installation is required.
  136.26 -LBL_PORTLET_URI=Portlet Uri:
  136.27 -LBL_LIFE_RAY_PORTAL_SERVER=Liferay Portal Server
  136.28 -LBL_LIFE_RAY_INSTALLATION_HOME=Liferay Home
  136.29 -LBL_LIFERAY_PORTAL_SERVER=WebSynergy Portal Server
  136.30 -
  136.31 -DESC_LIFE_RAY=WebSynergy
  136.32 -LBL_Auto_Deploy_Dir=Auto Deploy Dir:
  136.33 -LBL_BrowseButton=Browse
  136.34 -LBL_ChooserName=Browse
  136.35 -MSG_NO_LIFERAY_INSTALLATION_FOUND=No WebSynergy Installation Found in this GlassFish domain.
   137.1 --- a/portalpack.servers.websynergy/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
   137.2 +++ b/portalpack.servers.websynergy/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
   137.3 @@ -2,5 +2,5 @@
   137.4  OpenIDE-Module: org.netbeans.modules.portalpack.servers.websynergy
   137.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/servers/websynergy/resources/layer.xml
   137.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/servers/websynergy/resources/Bundle.properties
   137.7 -OpenIDE-Module-Specification-Version: 0.99
   137.8 +OpenIDE-Module-Specification-Version: 1.0.5
   137.9  
   138.1 --- a/portalpack.servers.websynergy/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
   138.2 +++ b/portalpack.servers.websynergy/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
   138.3 @@ -16,5 +16,5 @@
   138.4  # Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
   138.5  # Microsystems, Inc. All Rights Reserved.
   138.6  #
   138.7 -javac.source=1.5
   138.8 +javac.source=1.6
   138.9  nbm.homepage=http://portalpack.netbeans.org
   139.1 --- a/portalpack.servers.websynergy/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
   139.2 +++ b/portalpack.servers.websynergy/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
   139.3 @@ -60,6 +60,15 @@
   139.4                      </run-dependency>
   139.5                  </dependency>
   139.6                  <dependency>
   139.7 +                    <code-name-base>org.netbeans.api.progress</code-name-base>
   139.8 +                    <build-prerequisite/>
   139.9 +                    <compile-dependency/>
  139.10 +                    <run-dependency>
  139.11 +                        <release-version>1</release-version>
  139.12 +                        <specification-version>1.12.1</specification-version>
  139.13 +                    </run-dependency>
  139.14 +                </dependency>
  139.15 +                <dependency>
  139.16                      <code-name-base>org.netbeans.api.web.webmodule</code-name-base>
  139.17                      <build-prerequisite/>
  139.18                      <compile-dependency/>
  139.19 @@ -107,7 +116,7 @@
  139.20                      <build-prerequisite/>
  139.21                      <compile-dependency/>
  139.22                      <run-dependency>
  139.23 -                        <specification-version>2.92</specification-version>
  139.24 +                        <specification-version>3.0</specification-version>
  139.25                      </run-dependency>
  139.26                  </dependency>
  139.27                  <dependency>
  139.28 @@ -170,6 +179,15 @@
  139.29                      </run-dependency>
  139.30                  </dependency>
  139.31                  <dependency>
  139.32 +                    <code-name-base>org.netbeans.modules.xml.catalog</code-name-base>
  139.33 +                    <build-prerequisite/>
  139.34 +                    <compile-dependency/>
  139.35 +                    <run-dependency>
  139.36 +                        <release-version>2</release-version>
  139.37 +                        <specification-version>1.14.1</specification-version>
  139.38 +                    </run-dependency>
  139.39 +                </dependency>
  139.40 +                <dependency>
  139.41                      <code-name-base>org.openide.actions</code-name-base>
  139.42                      <build-prerequisite/>
  139.43                      <compile-dependency/>
  139.44 @@ -215,7 +233,6 @@
  139.45                      <compile-dependency/>
  139.46                      <run-dependency>
  139.47                          <specification-version>7.0</specification-version>
  139.48 -                        <!-- For NB 7.0 specification-version>7.19</specification-version -->
  139.49                      </run-dependency>
  139.50                  </dependency>
  139.51                  <dependency>
  139.52 @@ -250,8 +267,20 @@
  139.53                          <specification-version>7.10.1.1</specification-version>
  139.54                      </run-dependency>
  139.55                  </dependency>
  139.56 +                <dependency>
  139.57 +                    <code-name-base>org.openide.util.lookup</code-name-base>
  139.58 +                    <build-prerequisite/>
  139.59 +                    <compile-dependency/>
  139.60 +                    <run-dependency>
  139.61 +                        <specification-version>8.6.1</specification-version>
  139.62 +                    </run-dependency>
  139.63 +                </dependency>
  139.64              </module-dependencies>
  139.65 -            <public-packages/>
  139.66 +            <friend-packages>
  139.67 +                <friend>org.netbeans.modules.portalpack.websynergy.portlets</friend>
  139.68 +                <friend>org.netbeans.modules.portalpack.websynergy.servicebuilder</friend>
  139.69 +                <package>org.netbeans.modules.portalpack.servers.websynergy.common</package>
  139.70 +            </friend-packages>
  139.71          </data>
  139.72      </configuration>
  139.73  </project>
   140.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   140.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   140.3 @@ -19,6 +19,7 @@
   140.4  
   140.5  Sun_Java_System_AppServer_9=GlassFish / Sun Java System AppServer 9.x
   140.6  
   140.7 -LBL_LifeRay=Liferay Portal Server 5.1.x
   140.8 +LBL_LifeRay=Liferay Portal Server 5.1.x/5.2.x/6.x
   140.9  Tomcat_5_x=Tomcat 5.x
  140.10  Tomcat_6_x=Tomcat 6.x
  140.11 +JBoss_5_x=JBoss Application Server 5.x
   141.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ContainerStartHandlerFactory.java	Fri Jun 10 09:46:37 2011 +0200
   141.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ContainerStartHandlerFactory.java	Sun Jun 26 10:25:14 2011 +0800
   141.3 @@ -23,9 +23,11 @@
   141.4  import org.netbeans.modules.portalpack.servers.core.api.PSStartServerInf;
   141.5  import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
   141.6  import org.netbeans.modules.portalpack.servers.core.impl.DefaultStartServerImpl;
   141.7 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss.JBStartServer;
   141.8  import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver.SunAppServerStartServer;
   141.9  import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.tomcat.TomcatStartServer;
  141.10  import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  141.11 +import org.netbeans.modules.portalpack.servers.websynergy.impl.JBossStartStopServerListener;
  141.12  import org.netbeans.modules.portalpack.servers.websynergy.impl.SunASStartStopListener;
  141.13  import org.netbeans.modules.portalpack.servers.websynergy.impl.TomcatStartStopServerListener;
  141.14  
  141.15 @@ -34,14 +36,14 @@
  141.16   * @author satya
  141.17   */
  141.18  public class ContainerStartHandlerFactory implements ServerConstants{
  141.19 -    
  141.20 +
  141.21  
  141.22      public static PSStartServerInf getStartServerHandler(PSDeploymentManager dm)
  141.23      {
  141.24          PSConfigObject psconfig = dm.getPSConfig();
  141.25          if(psconfig.getServerType() == null)
  141.26              return new DefaultStartServerImpl();
  141.27 -        
  141.28 +
  141.29          if(psconfig.getServerType().equals(SUN_APP_SERVER_9))
  141.30          {
  141.31              PSStartServerInf startHandler = new SunAppServerStartServer(dm);
  141.32 @@ -55,10 +57,15 @@
  141.33              startHandler.addListener(new TomcatStartStopServerListener(dm));
  141.34              return startHandler;
  141.35          }
  141.36 +        else if(psconfig.getServerType().equals(JBOSS_5_X)) {
  141.37 +            PSStartServerInf startHandler = new JBStartServer(dm);
  141.38 +            startHandler.addListener(new JBossStartStopServerListener(dm));
  141.39 +            return startHandler;
  141.40 +        }
  141.41          else
  141.42              return new DefaultStartServerImpl();
  141.43 -        
  141.44 +
  141.45      }
  141.46  
  141.47 -    
  141.48 +
  141.49  }
   142.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/LiferayConfigPanelManagerImpl.java	Fri Jun 10 09:46:37 2011 +0200
   142.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/LiferayConfigPanelManagerImpl.java	Sun Jun 26 10:25:14 2011 +0800
   142.3 @@ -22,6 +22,7 @@
   142.4  import org.netbeans.modules.portalpack.servers.core.api.ConfigPanel;
   142.5  import org.netbeans.modules.portalpack.servers.core.api.PSConfigPanelManager;
   142.6  import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
   142.7 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss.JBConfigPanel;
   142.8  import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver.SunAppServerConfigPanel;
   142.9  import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.tomcat.TomcatConfigPanel;
  142.10  import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.ui.ClasspathConfigPanel;
  142.11 @@ -34,8 +35,8 @@
  142.12   * @author Satya
  142.13   */
  142.14  public class LiferayConfigPanelManagerImpl implements PSConfigPanelManager, ServerConstants{
  142.15 -    
  142.16 -    
  142.17 +
  142.18 +
  142.19      /**
  142.20       * Creates a new instance of LifeRayConfigPanelManagerImpl
  142.21       */
  142.22 @@ -43,26 +44,27 @@
  142.23      }
  142.24  
  142.25      public InstallPanel[] getInstallPanels(String psVersion) {
  142.26 -        
  142.27 +
  142.28          return new InstallPanel[]{new InstallPanel(getServerConfigPanel()),
  142.29                                    new InstallPanel(new LiferayConfigPanel(psVersion),true)};
  142.30 -        
  142.31 +
  142.32      }
  142.33  
  142.34      public ConfigPanel[] getConfigPanels(String psVersion) {
  142.35 -        
  142.36 -        
  142.37 +
  142.38 +
  142.39          return new ConfigPanel[]{new LiferayConfigPanel(psVersion),
  142.40                                      getServerConfigPanel(),new ClasspathConfigPanel()};
  142.41 -        
  142.42 +
  142.43      }
  142.44 -    
  142.45 +
  142.46      private ConfigPanel getServerConfigPanel()
  142.47      {
  142.48          DefaultServerConfigPanel serverConfigPanel = new DefaultServerConfigPanel();
  142.49          serverConfigPanel.registerServerConfigPanel(new SunAppServerConfigPanel(),SUN_APP_SERVER_9,org.openide.util.NbBundle.getMessage(LiferayConfigPanelManagerImpl.class, "Sun_Java_System_AppServer_9"));
  142.50          serverConfigPanel.registerServerConfigPanel(new TomcatConfigPanel(),TOMCAT_5_X,org.openide.util.NbBundle.getMessage(LiferayConfigPanelManagerImpl.class, "Tomcat_5_x"));
  142.51          serverConfigPanel.registerServerConfigPanel(new TomcatConfigPanel(),TOMCAT_6_X,org.openide.util.NbBundle.getMessage(LiferayConfigPanelManagerImpl.class, "Tomcat_6_x"));
  142.52 +        serverConfigPanel.registerServerConfigPanel(new JBConfigPanel(),JBOSS_5_X,org.openide.util.NbBundle.getMessage(LiferayConfigPanelManagerImpl.class, "JBoss_5_x"));
  142.53          return serverConfigPanel;
  142.54      }
  142.55  }
   143.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/LiferayDeploymentManager.java	Fri Jun 10 09:46:37 2011 +0200
   143.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/LiferayDeploymentManager.java	Sun Jun 26 10:25:14 2011 +0800
   143.3 @@ -28,6 +28,7 @@
   143.4  import org.netbeans.modules.portalpack.servers.core.api.PSTaskHandler;
   143.5  import org.netbeans.modules.portalpack.servers.core.common.FileLogViewerSupport;
   143.6  import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
   143.7 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss.JBConstant;
   143.8  import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
   143.9  import org.netbeans.modules.portalpack.servers.websynergy.common.LiferayConstants;
  143.10  import org.netbeans.modules.portalpack.servers.websynergy.common.WSConstants;
  143.11 @@ -84,13 +85,14 @@
  143.12      }
  143.13  
  143.14      @Override
  143.15 -    public void showServerLog() {
  143.16 +    public void showServerLog(boolean createNew) {
  143.17  
  143.18          if (getPSConfig().getServerType().equals(ServerConstants.SUN_APP_SERVER_9)) {
  143.19              
  143.20              try {
  143.21 -
  143.22 -                FileLogViewerSupport.removeLogViewerSupport(getUri());
  143.23 +				if(createNew) {
  143.24 +					FileLogViewerSupport.removeLogViewerSupport(getUri());
  143.25 +				}
  143.26                  File f = new File(getPSConfig().getDomainDir() + File.separator + "/logs/server.log");
  143.27                  FileLogViewerSupport p = FileLogViewerSupport.getLogViewerSupport(f, getUri(), 2000, true);
  143.28                  p.showLogViewer(true);
  143.29 @@ -98,6 +100,21 @@
  143.30                  Exceptions.printStackTrace(ex);
  143.31              }
  143.32          }
  143.33 +
  143.34 +		if (getPSConfig().getServerType().equals(ServerConstants.JBOSS_5_X)) {
  143.35 +			try {
  143.36 +				if(createNew) {
  143.37 +					FileLogViewerSupport.removeLogViewerSupport(getUri());
  143.38 +				}
  143.39 +                File f = new File(getPSConfig().getProperty(JBConstant.SERVER_DIR) +
  143.40 +						File.separator + "log" + File.separator + "server.log");
  143.41 +				System.out.println("Log file Location: " + f.getAbsolutePath());
  143.42 +                FileLogViewerSupport p = FileLogViewerSupport.getLogViewerSupport(f, getUri(), 2000, true);
  143.43 +                p.showLogViewer(true);
  143.44 +            } catch (IOException ex) {
  143.45 +                Exceptions.printStackTrace(ex);
  143.46 +            }
  143.47 +		}
  143.48      }
  143.49  
  143.50      @Override
   144.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/LiferayJ2eePlatformImpl.java	Fri Jun 10 09:46:37 2011 +0200
   144.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/LiferayJ2eePlatformImpl.java	Sun Jun 26 10:25:14 2011 +0800
   144.3 @@ -19,7 +19,6 @@
   144.4  package org.netbeans.modules.portalpack.servers.websynergy;
   144.5  
   144.6  import java.io.File;
   144.7 -import java.io.FilenameFilter;
   144.8  import java.net.MalformedURLException;
   144.9  import java.util.ArrayList;
  144.10  import java.util.HashSet;
  144.11 @@ -27,12 +26,11 @@
  144.12  import java.util.Set;
  144.13  import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
  144.14  import org.netbeans.modules.portalpack.servers.core.PSJ2eePlatformImpl;
  144.15 -import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
  144.16 -import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.tomcat.TomcatConstant;
  144.17 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibraries;
  144.18 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibrariesFactory;
  144.19  import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  144.20  import org.netbeans.modules.portalpack.servers.core.util.Util;
  144.21  import org.netbeans.modules.portalpack.servers.websynergy.common.LiferayConstants;
  144.22 -import org.openide.util.Exceptions;
  144.23  
  144.24  /**
  144.25   *
  144.26 @@ -56,142 +54,40 @@
  144.27      protected List getCustomLibraries() {
  144.28          List classPath = new ArrayList();
  144.29  
  144.30 -        String[] libFiles = {"portal-service.jar", "portal-kernel.jar","annotations.jar","portlet-container.jar"};
  144.31 +        String[] libFiles = {"portal-service.jar", "portal-kernel.jar", "annotations.jar", "portlet-container.jar"};
  144.32          //PSConfigObject psconfig = psconfig.getPSConfig();
  144.33 +        JEEServerLibraries jeeServerLibraries =
  144.34 +                JEEServerLibrariesFactory.getJEEServerLibraries(psconfig.getServerType());
  144.35  
  144.36 -        //If glassfish then add javaee.jar
  144.37 -        if (psconfig.getServerType().equals(ServerConstants.SUN_APP_SERVER_9)) {
  144.38 -            String portalLibDir = psconfig.getDomainDir() + File.separator + "lib";
  144.39 -            for (int i = 0; i < libFiles.length; i++) {
  144.40 -                String portletJarUri = portalLibDir + File.separator + libFiles[i];
  144.41 -                File portletJar = new File(portletJarUri);
  144.42 -                if (portletJar.exists()) {
  144.43 -                    try {
  144.44 -                        classPath.add(fileToUrl(portletJar));
  144.45 -                    } catch (MalformedURLException ex) {
  144.46 -                        ex.printStackTrace();
  144.47 -                    }
  144.48 -                }
  144.49 -            }
  144.50 -
  144.51 -            String[] libs = {"javaee.jar","appserv-jstl.jar"};
  144.52 -
  144.53 -            File javaeeJar = new File(psconfig.getServerHome() + File.separator + "lib" + File.separator + "javaee.jar");
  144.54 -            if (!javaeeJar.exists()) {
  144.55 -                //Means GV3
  144.56 -
  144.57 -                File modulesFolder = new File(psconfig.getServerHome() + File.separator + "modules");
  144.58 -                File[] files = modulesFolder.listFiles(new FilenameFilter() {
  144.59 -
  144.60 -                    public boolean accept(File dir, String name) {
  144.61 -
  144.62 -                        if (name.startsWith("javax.")) {
  144.63 -                            return true;
  144.64 -                        }
  144.65 -                        return false;
  144.66 -                    }
  144.67 -                });
  144.68 -
  144.69 -                if (files != null && files.length != 0) {
  144.70 -                    for(File f:files) {
  144.71 -                        try {
  144.72 -                            classPath.add(fileToUrl(f));
  144.73 -                        } catch (MalformedURLException ex) {
  144.74 -                            // Exceptions.printStackTrace(ex);
  144.75 -                        }
  144.76 -                    }
  144.77 -                }
  144.78 -                
  144.79 -                File webFolder = new File(modulesFolder,"web");
  144.80 -                File jstlJar = new File(webFolder,"jstl-impl.jar");
  144.81 -                if(jstlJar.exists()) {
  144.82 -                    try {
  144.83 -                        classPath.add(fileToUrl(jstlJar));
  144.84 -                    } catch (MalformedURLException ex) {
  144.85 -                        //Exceptions.printStackTrace(ex);
  144.86 -                    }
  144.87 -                }
  144.88 -                
  144.89 -            }
  144.90 -
  144.91 -            for (int k = 0; k < libs.length; k++) {
  144.92 -                File libJar = new File(psconfig.getServerHome() + File.separator + "lib" + File.separator + libs[k]);
  144.93 -                if (libJar.exists()) {
  144.94 -                    try {
  144.95 -                        classPath.add(fileToUrl(libJar));
  144.96 -                    } catch (MalformedURLException ex) {
  144.97 -                        ex.printStackTrace();
  144.98 -                    }
  144.99 +        String portalLibDir = jeeServerLibraries.getPortalServerLibraryLocation(psconfig);
 144.100 +        for (int i = 0; i < libFiles.length; i++) {
 144.101 +            String portletJarUri = portalLibDir + File.separator + libFiles[i];
 144.102 +            File portletJar = new File(portletJarUri);
 144.103 +            if (portletJar.exists()) {
 144.104 +                try {
 144.105 +                    classPath.add(fileToUrl(portletJar));
 144.106 +                } catch (MalformedURLException ex) {
 144.107 +                    ex.printStackTrace();
 144.108                  }
 144.109              }
 144.110          }
 144.111  
 144.112 -        if (psconfig.getServerType().equals(ServerConstants.TOMCAT_5_X)) {
 144.113 +        //add javaee jars
 144.114 +        List<File> javaeeJars = jeeServerLibraries.getJEEServerLibraries(psconfig);
 144.115  
 144.116 -            String portalLibDir = psconfig.getProperty(TomcatConstant.CATALINA_HOME) + File.separator +
 144.117 -                    "common" + File.separator + "lib" + File.separator + "ext";
 144.118 +        for (int k = 0; k < javaeeJars.size(); k++) {
 144.119  
 144.120 -            for (int i = 0; i < libFiles.length; i++) {
 144.121 -                String portalJarUri = portalLibDir + File.separator + libFiles[i];
 144.122 -                File portletJar = new File(portalJarUri);
 144.123 -                if (portletJar.exists()) {
 144.124 -                    try {
 144.125 -                        classPath.add(fileToUrl(portletJar));
 144.126 -                    } catch (MalformedURLException ex) {
 144.127 -                        ex.printStackTrace();
 144.128 -                    }
 144.129 -                }
 144.130 -            }
 144.131 -
 144.132 -            String[] libs = {"servlet-api.jar", "jsp-api.jar"};
 144.133 -            String serverLibDir = psconfig.getProperty(TomcatConstant.CATALINA_HOME) + File.separator +
 144.134 -                    "common" + File.separator + "lib";
 144.135 -            for (int k = 0; k < libs.length; k++) {
 144.136 -                File libJar = new File(serverLibDir + File.separator + libs[k]);
 144.137 -                if (libJar.exists()) {
 144.138 -                    try {
 144.139 -                        classPath.add(fileToUrl(libJar));
 144.140 -                    } catch (MalformedURLException ex) {
 144.141 -                        ex.printStackTrace();
 144.142 -                    }
 144.143 -                }
 144.144 -            }
 144.145 -        }
 144.146 -        
 144.147 -        //FOR Tomcat 6.x
 144.148 -        if (psconfig.getServerType().equals(ServerConstants.TOMCAT_6_X)) {
 144.149 -
 144.150 -            String portalLibDir = psconfig.getProperty(TomcatConstant.CATALINA_HOME)
 144.151 -                        + File.separator + "lib" + File.separator + "ext";
 144.152 -
 144.153 -            for (int i = 0; i < libFiles.length; i++) {
 144.154 -                String portalJarUri = portalLibDir + File.separator + libFiles[i];
 144.155 -                File portletJar = new File(portalJarUri);
 144.156 -                if (portletJar.exists()) {
 144.157 -                    try {
 144.158 -                        classPath.add(fileToUrl(portletJar));
 144.159 -                    } catch (MalformedURLException ex) {
 144.160 -                        ex.printStackTrace();
 144.161 -                    }
 144.162 -                }
 144.163 -            }
 144.164 -
 144.165 -            String[] libs = {"servlet-api.jar", "jsp-api.jar","annotations-api.jar"};
 144.166 -            String serverLibDir = psconfig.getProperty(TomcatConstant.CATALINA_HOME) + File.separator + "lib";
 144.167 -            for (int k = 0; k < libs.length; k++) {
 144.168 -                File libJar = new File(serverLibDir + File.separator + libs[k]);
 144.169 -                if (libJar.exists()) {
 144.170 -                    try {
 144.171 -                        classPath.add(fileToUrl(libJar));
 144.172 -                    } catch (MalformedURLException ex) {
 144.173 -                        ex.printStackTrace();
 144.174 -                    }
 144.175 +            if (javaeeJars.get(k).exists()) {
 144.176 +                try {
 144.177 +                    classPath.add(fileToUrl(javaeeJars.get(k)));
 144.178 +                } catch (MalformedURLException ex) {
 144.179 +                    ex.printStackTrace();
 144.180                  }
 144.181              }
 144.182          }
 144.183  
 144.184          //add util-java.jar,util-taglib.jar
 144.185 -        String[] lrJars = {"util-java.jar", "util-taglib.jar","commons-logging.jar"};
 144.186 +        String[] lrJars = {"util-java.jar", "util-taglib.jar", "commons-logging.jar"};
 144.187          String portalAppDepDir = psconfig.getProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR);
 144.188          if (portalAppDepDir != null && portalAppDepDir.trim().length() != 0) {
 144.189              String webInfLoc = portalAppDepDir + File.separator + "WEB-INF" + File.separator + "lib";
   145.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/LiferayNodeConfiguration.java	Fri Jun 10 09:46:37 2011 +0200
   145.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/LiferayNodeConfiguration.java	Sun Jun 26 10:25:14 2011 +0800
   145.3 @@ -20,12 +20,18 @@
   145.4  package org.netbeans.modules.portalpack.servers.websynergy;
   145.5  
   145.6  import javax.swing.Action;
   145.7 +import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
   145.8  import org.netbeans.modules.portalpack.servers.core.api.PSNodeConfiguration;
   145.9  import org.netbeans.modules.portalpack.servers.core.impl.DefaultPSNodeConfiguration;
  145.10 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  145.11 +import org.netbeans.modules.portalpack.servers.websynergy.common.LiferayConstants;
  145.12 +import org.netbeans.modules.portalpack.servers.websynergy.nodes.HookHolderNode;
  145.13 +import org.netbeans.modules.portalpack.servers.websynergy.nodes.ThemeHolderNode;
  145.14 +import org.openide.nodes.Node;
  145.15  
  145.16  /**
  145.17   *
  145.18 - * @author root
  145.19 + * @author Satya
  145.20   */
  145.21  public class LiferayNodeConfiguration extends DefaultPSNodeConfiguration{
  145.22      
  145.23 @@ -64,4 +70,21 @@
  145.24          //newActions[1] = SystemAction.get(ShowMultiplePortletsAction.class);
  145.25          return newActions;
  145.26      }
  145.27 +
  145.28 +    @Override
  145.29 +    public Node[] getCustomChildrenForDnNode(PSDeploymentManager dm, String baseDn, String key) {
  145.30 +        PSConfigObject psconfig = dm.getPSConfig();
  145.31 +        String lrVersionStr = psconfig.getProperty(LiferayConstants.LR_VERSION);
  145.32 +        int liferayVersion = -1;
  145.33 +        try {
  145.34 +          liferayVersion = Integer.parseInt(lrVersionStr);
  145.35 +        } catch (Exception e) {
  145.36 +        }
  145.37 +
  145.38 +        if(liferayVersion >= 5203) {
  145.39 +            return new Node[]{new HookHolderNode(dm, key), new ThemeHolderNode(dm, key)};
  145.40 +        }
  145.41 +        return new Node[]{new HookHolderNode(dm, key)};
  145.42 +    }
  145.43 +
  145.44  }
   146.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   146.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/catalog/LiferayDTDCatalog.java	Sun Jun 26 10:25:14 2011 +0800
   146.3 @@ -0,0 +1,142 @@
   146.4 +/*
   146.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   146.6 + *
   146.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   146.8 + *
   146.9 + * The contents of this file are subject to the terms of either the GNU
  146.10 + * General Public License Version 2 only ("GPL") or the Common
  146.11 + * Development and Distribution License("CDDL") (collectively, the
  146.12 + * "License"). You may not use this file except in compliance with the
  146.13 + * License. You can obtain a copy of the License at
  146.14 + * http://www.netbeans.org/cddl-gplv2.html
  146.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  146.16 + * specific language governing permissions and limitations under the
  146.17 + * License.  When distributing the software, include this License Header
  146.18 + * Notice in each file and include the License file at
  146.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  146.20 + * particular file as subject to the "Classpath" exception as provided
  146.21 + * by Sun in the GPL Version 2 section of the License file that
  146.22 + * accompanied this code. If applicable, add the following below the
  146.23 + * License Header, with the fields enclosed by brackets [] replaced by
  146.24 + * your own identifying information:
  146.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  146.26 + *
  146.27 + * If you wish your version of this file to be governed by only the CDDL
  146.28 + * or only the GPL Version 2, indicate your decision by adding
  146.29 + * "[Contributor] elects to include this software in this distribution
  146.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  146.31 + * single choice of license, a recipient has the option to distribute
  146.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  146.33 + * to extend the choice of license to its licensees as provided above.
  146.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  146.35 + * Version 2 license, then the option applies only if the new code is
  146.36 + * made subject to such option by the copyright holder.
  146.37 + *
  146.38 + * Contributor(s):
  146.39 + *
  146.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  146.41 + */
  146.42 +
  146.43 +package org.netbeans.modules.portalpack.servers.websynergy.catalog;
  146.44 +
  146.45 +import java.awt.Image;
  146.46 +import java.beans.PropertyChangeListener;
  146.47 +import java.io.IOException;
  146.48 +import java.util.ArrayList;
  146.49 +import java.util.Iterator;
  146.50 +import java.util.List;
  146.51 +import org.netbeans.modules.xml.catalog.spi.CatalogDescriptor;
  146.52 +import org.netbeans.modules.xml.catalog.spi.CatalogListener;
  146.53 +import org.netbeans.modules.xml.catalog.spi.CatalogReader;
  146.54 +import org.xml.sax.EntityResolver;
  146.55 +import org.xml.sax.InputSource;
  146.56 +import org.xml.sax.SAXException;
  146.57 +
  146.58 +/**
  146.59 + *
  146.60 + * @author Satyaranjan
  146.61 + */
  146.62 +public class LiferayDTDCatalog implements CatalogReader, CatalogDescriptor, EntityResolver {
  146.63 +
  146.64 +    public LiferayDTDCatalog() {
  146.65 +
  146.66 +    }
  146.67 +    public Iterator getPublicIDs() {
  146.68 +        List<String> list = new ArrayList<String>();
  146.69 +
  146.70 +        for(LiferayDTDDef dtdDef:LiferayDTDDef.values()) {
  146.71 +            list.add(dtdDef.getPublicID());
  146.72 +        }
  146.73 +        
  146.74 +        return list.listIterator();
  146.75 +    }
  146.76 +
  146.77 +    public void refresh() {
  146.78 +
  146.79 +    }
  146.80 +
  146.81 +    public String getSystemID(String publicId) {
  146.82 +
  146.83 +        for(LiferayDTDDef dtdDef:LiferayDTDDef.values()) {
  146.84 +            if(publicId.equals(dtdDef.getPublicID())) {
  146.85 +                return dtdDef.getResLocation();
  146.86 +            }
  146.87 +        }
  146.88 +        return null;
  146.89 +
  146.90 +    }
  146.91 +
  146.92 +
  146.93 +    public String resolveURI(String name) {
  146.94 +        return null;
  146.95 +    }
  146.96 +
  146.97 +    public String resolvePublic(String publicId) {
  146.98 +        return null;
  146.99 +    }
 146.100 +
 146.101 +    public void addCatalogListener(CatalogListener l) {
 146.102 +
 146.103 +    }
 146.104 +
 146.105 +    public void removeCatalogListener(CatalogListener l) {
 146.106 +
 146.107 +    }
 146.108 +
 146.109 +    public Image getIcon(int type) {
 146.110 +        return null;
 146.111 +    }
 146.112 +
 146.113 +    public String getDisplayName() {
 146.114 +        return "Liferay XML Catalog";
 146.115 +    }
 146.116 +
 146.117 +    public String getShortDescription() {
 146.118 +        return "XML Catalog for Liferay";
 146.119 +    }
 146.120 +
 146.121 +    public void addPropertyChangeListener(PropertyChangeListener l) {
 146.122 +
 146.123 +    }
 146.124 +
 146.125 +    public void removePropertyChangeListener(PropertyChangeListener l) {
 146.126 +
 146.127 +    }
 146.128 +
 146.129 +    public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
 146.130 +
 146.131 +        for(LiferayDTDDef dtdDef:LiferayDTDDef.values()) {
 146.132 +            if(dtdDef.getURL().equals(systemId)) {
 146.133 +                return new org.xml.sax.InputSource(dtdDef.getResLocation());
 146.134 +            }
 146.135 +        }
 146.136 +
 146.137 +        for(LiferayDTDDef dtdDef:LiferayDTDDef.values()) {
 146.138 +            if(systemId != null && systemId.endsWith(dtdDef.getDTD())) {
 146.139 +                return new org.xml.sax.InputSource(dtdDef.getResLocation());
 146.140 +            }
 146.141 +        }
 146.142 +
 146.143 +        return null;
 146.144 +    }
 146.145 +}
   147.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   147.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/catalog/LiferayDTDDef.java	Sun Jun 26 10:25:14 2011 +0800
   147.3 @@ -0,0 +1,124 @@
   147.4 +/*
   147.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   147.6 + *
   147.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   147.8 + *
   147.9 + * The contents of this file are subject to the terms of either the GNU
  147.10 + * General Public License Version 2 only ("GPL") or the Common
  147.11 + * Development and Distribution License("CDDL") (collectively, the
  147.12 + * "License"). You may not use this file except in compliance with the
  147.13 + * License. You can obtain a copy of the License at
  147.14 + * http://www.netbeans.org/cddl-gplv2.html
  147.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  147.16 + * specific language governing permissions and limitations under the
  147.17 + * License.  When distributing the software, include this License Header
  147.18 + * Notice in each file and include the License file at
  147.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  147.20 + * particular file as subject to the "Classpath" exception as provided
  147.21 + * by Sun in the GPL Version 2 section of the License file that
  147.22 + * accompanied this code. If applicable, add the following below the
  147.23 + * License Header, with the fields enclosed by brackets [] replaced by
  147.24 + * your own identifying information:
  147.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  147.26 + *
  147.27 + * If you wish your version of this file to be governed by only the CDDL
  147.28 + * or only the GPL Version 2, indicate your decision by adding
  147.29 + * "[Contributor] elects to include this software in this distribution
  147.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  147.31 + * single choice of license, a recipient has the option to distribute
  147.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  147.33 + * to extend the choice of license to its licensees as provided above.
  147.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  147.35 + * Version 2 license, then the option applies only if the new code is
  147.36 + * made subject to such option by the copyright holder.
  147.37 + *
  147.38 + * Contributor(s):
  147.39 + *
  147.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  147.41 + */
  147.42 +package org.netbeans.modules.portalpack.servers.websynergy.catalog;
  147.43 +
  147.44 +/**
  147.45 + *
  147.46 + * @author satyaranjan
  147.47 + */
  147.48 +public enum LiferayDTDDef {
  147.49 +
  147.50 +    //Liferay 5.0.0 dtds
  147.51 +    LR_DISPLAY_5_0_0("liferay-display_5_0_0.dtd",
  147.52 +    "http://www.liferay.com/dtd/liferay-display_5_0_0.dtd",
  147.53 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_5_0_0.dtd"),
  147.54 +    LR_PORTLET_APP_5_0_0("liferay-portlet-app_5_0_0.dtd",
  147.55 +    "http://www.liferay.com/dtd/liferay-portlet-app_5_0_0.dtd",
  147.56 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_5_0_0.dtd"),
  147.57 +
  147.58 +    //Liferay 5.1.0 dtds
  147.59 +    LR_DISPLAY_5_1_0("liferay-display_5_1_0.dtd",
  147.60 +    "http://www.liferay.com/dtd/liferay-display_5_1_0.dtd",
  147.61 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_5_1_0.dtd"),
  147.62 +    LR_PORTLET_APP_5_1_0("liferay-portlet-app_5_1_0.dtd",
  147.63 +    "http://www.liferay.com/dtd/liferay-portlet-app_5_1_0.dtd",
  147.64 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_5_1_0.dtd"),
  147.65 +    LR_HOOK_5_1_0("liferay-hook_5_1_0.dtd",
  147.66 +    "http://www.liferay.com/dtd/liferay-hook_5_1_0.dtd",
  147.67 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-hook_5_1_0.dtd"),
  147.68 +    LR_SERVICE_BUILDER_5_1_0("liferay-service-builder_5_1_0.dtd",
  147.69 +    "http://www.liferay.com/dtd/liferay-service-builder_5_1_0.dtd",
  147.70 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-service-builder_5_1_0.dtd"),
  147.71 +
  147.72 +    //Liferay 5.2.0 dtds
  147.73 +    LR_DISPLAY_5_2_0("liferay-display_5_2_0.dtd",
  147.74 +    "http://www.liferay.com/dtd/liferay-display_5_2_0.dtd",
  147.75 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_5_2_0.dtd"),
  147.76 +    LR_PORTLET_APP_5_2_0("liferay-portlet-app_5_2_0.dtd",
  147.77 +    "http://www.liferay.com/dtd/liferay-portlet-app_5_2_0.dtd",
  147.78 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_5_2_0.dtd"),
  147.79 +    LR_HOOK_5_2_0("liferay-hook_5_2_0.dtd",
  147.80 +    "http://www.liferay.com/dtd/liferay-hook_5_2_0.dtd",
  147.81 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-hook_5_2_0.dtd"),
  147.82 +    LR_SERVICE_BUILDER_5_2_0("liferay-service-builder_5_2_0.dtd",
  147.83 +    "http://www.liferay.com/dtd/liferay-service-builder_5_2_0.dtd",
  147.84 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-service-builder_5_2_0.dtd"),
  147.85 +    
  147.86 +    
  147.87 +    //Liferay 6.0.0 dtds
  147.88 +    LR_DISPLAY_6_0_0("liferay-display_6_0_0.dtd",
  147.89 +    "http://www.liferay.com/dtd/liferay-display_6_0_0.dtd",
  147.90 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_6_0_0.dtd"),
  147.91 +    LR_PORTLET_APP_6_0_0("liferay-portlet-app_6_0_0.dtd",
  147.92 +    "http://www.liferay.com/dtd/liferay-portlet-app_6_0_0.dtd",
  147.93 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_6_0_0.dtd"),
  147.94 +    LR_HOOK_6_0_0("liferay-hook_6_0_0.dtd",
  147.95 +    "http://www.liferay.com/dtd/liferay-hook_6_0_0.dtd",
  147.96 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-hook_6_0_0.dtd"),
  147.97 +    LR_SERVICE_BUILDER_6_0_0("liferay-service-builder_6_0_0.dtd",
  147.98 +    "http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd",
  147.99 +    "nbres:/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-service-builder_6_0_0.dtd");
 147.100 +
 147.101 +    private String dtd;
 147.102 +    private String url;
 147.103 +    private String resLocation;
 147.104 +
 147.105 +    LiferayDTDDef(String dtd, String url, String resLocation) {
 147.106 +        this.dtd = dtd;
 147.107 +        this.url = url;
 147.108 +        this.resLocation = resLocation;
 147.109 +    }
 147.110 +
 147.111 +    public String getDTD() {
 147.112 +        return dtd;
 147.113 +    }
 147.114 +
 147.115 +    public String getURL() {
 147.116 +        return url;
 147.117 +    }
 147.118 +
 147.119 +    public String getResLocation() {
 147.120 +        return resLocation;
 147.121 +    }
 147.122 +
 147.123 +    public String getPublicID() {
 147.124 +
 147.125 +        return "SCHEMA:" + url;
 147.126 +    }
 147.127 +}
   148.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/common/LiferayConstants.java	Fri Jun 10 09:46:37 2011 +0200
   148.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/common/LiferayConstants.java	Sun Jun 26 10:25:14 2011 +0800
   148.3 @@ -26,8 +26,10 @@
   148.4   */
   148.5  public class LiferayConstants {
   148.6      
   148.7 -    public static String LR_1_0 = "lr_1_0";
   148.8 -    public static String LR_1_0_URI_PREFIX = "liferay_1_0";
   148.9 +    public static String LR_1_0 = "lr_2_0";
  148.10 +    public static String LR_1_0_URI_PREFIX = "liferay_2_0";
  148.11 +    
  148.12 +    public static String LR_PREFIX = "liferay";
  148.13      
  148.14      //config parameters
  148.15      public static String ADMIN_CONSOLE_URI = "ADMIN_CONSOLE_URI";
  148.16 @@ -37,4 +39,11 @@
  148.17      public static String LR_LOGGER = "org.netbeans.modules.portalpack.servers.liferay.logger";
  148.18      public static String AUTO_DEPLOY_DIR = "lr_auto_deploy_dir";
  148.19      public static String LR_PORTAL_DEPLOY_DIR = "lr_portal_deploy_dir";
  148.20 +    public static String LR_VERSION = "liferay.version";
  148.21 +    public static String LR_DEVELOPER_MODE = "lr_developer_mode";
  148.22 +    
  148.23 +    //Liferay Version
  148.24 +    public static final int LR_5_1_0 = 5100;
  148.25 +    public static final int LR_5_2_0 = 5200;
  148.26 +	public static final int LR_5_2_3 = 5230;
  148.27  }
   149.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/common/WSConstants.java	Fri Jun 10 09:46:37 2011 +0200
   149.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/common/WSConstants.java	Sun Jun 26 10:25:14 2011 +0800
   149.3 @@ -45,7 +45,11 @@
   149.4   */
   149.5  public class WSConstants {
   149.6  
   149.7 -    public static String WS_1_0 = "ws_1_0";
   149.8 -    public static String WS_1_0_URI_PREFIX = "websynergy_1_0";
   149.9 +    public static String WS_1_0 = "ws_2_0";
  149.10 +    public static String WS_1_0_URI_PREFIX = "webspace_2_0";
  149.11 +    
  149.12 +    public static String WS_APPLICATION_NAME = "webspace";
  149.13 +    
  149.14 +    public static String WS_PREFIX = "webspace";
  149.15  
  149.16  }
   150.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   150.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/common/WebSpacePropertiesUtil.java	Sun Jun 26 10:25:14 2011 +0800
   150.3 @@ -0,0 +1,101 @@
   150.4 +/*
   150.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   150.6 + * 
   150.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   150.8 + * 
   150.9 + * The contents of this file are subject to the terms of either the GNU
  150.10 + * General Public License Version 2 only ("GPL") or the Common
  150.11 + * Development and Distribution License("CDDL") (collectively, the
  150.12 + * "License"). You may not use this file except in compliance with the
  150.13 + * License. You can obtain a copy of the License at
  150.14 + * http://www.netbeans.org/cddl-gplv2.html
  150.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  150.16 + * specific language governing permissions and limitations under the
  150.17 + * License.  When distributing the software, include this License Header
  150.18 + * Notice in each file and include the License file at
  150.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  150.20 + * particular file as subject to the "Classpath" exception as provided
  150.21 + * by Sun in the GPL Version 2 section of the License file that
  150.22 + * accompanied this code. If applicable, add the following below the
  150.23 + * License Header, with the fields enclosed by brackets [] replaced by
  150.24 + * your own identifying information:
  150.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  150.26 + * 
  150.27 + * If you wish your version of this file to be governed by only the CDDL
  150.28 + * or only the GPL Version 2, indicate your decision by adding
  150.29 + * "[Contributor] elects to include this software in this distribution
  150.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  150.31 + * single choice of license, a recipient has the option to distribute
  150.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  150.33 + * to extend the choice of license to its licensees as provided above.
  150.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  150.35 + * Version 2 license, then the option applies only if the new code is
  150.36 + * made subject to such option by the copyright holder.
  150.37 + * 
  150.38 + * Contributor(s):
  150.39 + * 
  150.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  150.41 + */
  150.42 +
  150.43 +package org.netbeans.modules.portalpack.servers.websynergy.common;
  150.44 +
  150.45 +import org.netbeans.api.project.Project;
  150.46 +import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
  150.47 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  150.48 +
  150.49 +/**
  150.50 + *
  150.51 + * @author satyaranjan
  150.52 + */
  150.53 +public class WebSpacePropertiesUtil {
  150.54 +
  150.55 +    public static PSConfigObject getSelectedServerProperties(Project prj) {
  150.56 +
  150.57 +        if (prj == null) {
  150.58 +            return null;
  150.59 +        }
  150.60 +        J2eeModuleProvider jmp =
  150.61 +                (J2eeModuleProvider) prj.getLookup().lookup(J2eeModuleProvider.class);
  150.62 +
  150.63 +        if(jmp == null)
  150.64 +            return null;
  150.65 +        String serverID = jmp.getServerInstanceID();
  150.66 +
  150.67 +        if (serverID == null || (!serverID.startsWith(LiferayConstants.LR_PREFIX)
  150.68 +                             && !serverID.startsWith(WSConstants.WS_PREFIX))) {
  150.69 +            return null;
  150.70 +        }
  150.71 +        PSConfigObject pc = PSConfigObject.getPSConfigObject(serverID);
  150.72 +        return pc;
  150.73 +    }
  150.74 +
  150.75 +    public static boolean isWebSynergyServer(Project prj) {
  150.76 +        if (prj == null) {
  150.77 +            return false;
  150.78 +        }
  150.79 +        J2eeModuleProvider jmp =
  150.80 +                (J2eeModuleProvider) prj.getLookup().lookup(J2eeModuleProvider.class);
  150.81 +
  150.82 +        if(jmp == null)
  150.83 +            return false;
  150.84 +        String serverID = jmp.getServerInstanceID();
  150.85 +
  150.86 +        if (serverID == null || (!serverID.startsWith(LiferayConstants.LR_PREFIX)
  150.87 +                             && !serverID.startsWith(WSConstants.WS_PREFIX))) {
  150.88 +            return false;
  150.89 +        }
  150.90 +
  150.91 +        return true;
  150.92 +    }
  150.93 +    
  150.94 +    public static int getLiferayVersion(PSConfigObject psConfig) {
  150.95 +        
  150.96 +        if(psConfig == null)
  150.97 +            return -1;
  150.98 +        try{
  150.99 +            return Integer.parseInt(psConfig.getProperty(LiferayConstants.LR_VERSION));
 150.100 +        }catch(Exception e) {
 150.101 +            return 1;
 150.102 +        }
 150.103 +    }
 150.104 +}
   151.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   151.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/config/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   151.3 @@ -0,0 +1,39 @@
   151.4 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   151.5 +#
   151.6 +# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   151.7 +#
   151.8 +# The contents of this file are subject to the terms of either the GNU
   151.9 +# General Public License Version 2 only ("GPL") or the Common
  151.10 +# Development and Distribution License("CDDL") (collectively, the
  151.11 +# "License"). You may not use this file except in compliance with the
  151.12 +# License. You can obtain a copy of the License at
  151.13 +# http://www.netbeans.org/cddl-gplv2.html
  151.14 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  151.15 +# specific language governing permissions and limitations under the
  151.16 +# License.  When distributing the software, include this License Header
  151.17 +# Notice in each file and include the License file at
  151.18 +# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  151.19 +# particular file as subject to the "Classpath" exception as provided
  151.20 +# by Sun in the GPL Version 2 section of the License file that
  151.21 +# accompanied this code. If applicable, add the following below the
  151.22 +# License Header, with the fields enclosed by brackets [] replaced by
  151.23 +# your own identifying information:
  151.24 +# "Portions Copyrighted [year] [name of copyright owner]"
  151.25 +#
  151.26 +# If you wish your version of this file to be governed by only the CDDL
  151.27 +# or only the GPL Version 2, indicate your decision by adding
  151.28 +# "[Contributor] elects to include this software in this distribution
  151.29 +# under the [CDDL or GPL Version 2] license." If you do not indicate a
  151.30 +# single choice of license, a recipient has the option to distribute
  151.31 +# your version of this file under either the CDDL, the GPL Version 2 or
  151.32 +# to extend the choice of license to its licensees as provided above.
  151.33 +# However, if you add GPL Version 2 code and therefore, elected the GPL
  151.34 +# Version 2 license, then the option applies only if the new code is
  151.35 +# made subject to such option by the copyright holder.
  151.36 +#
  151.37 +# Contributor(s):
  151.38 +#
  151.39 +# Portions Copyrighted 2009 Sun Microsystems, Inc.
  151.40 +
  151.41 +MSG_PORTLET_NOT_ALLOWED_IN_HOOK_PROJECT=<html><body>You are adding a portlet inside a hook application. The application name ending with "-hook" <br>\
  151.42 +                                        is reserved for hook type plug-ins as per the Web Space/Liferay naming convention. So your portlet might be ignored by the server during deployment.</body></html>
  151.43 \ No newline at end of file
   152.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/config/LiferayPortletXMLListener.java	Fri Jun 10 09:46:37 2011 +0200
   152.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/config/LiferayPortletXMLListener.java	Sun Jun 26 10:25:14 2011 +0800
   152.3 @@ -9,20 +9,26 @@
   152.4  import java.io.FileOutputStream;
   152.5  import java.io.IOException;
   152.6  import java.io.InputStream;
   152.7 -import java.io.OutputStream;
   152.8  import java.util.Properties;
   152.9  import java.util.logging.Logger;
  152.10 +import org.netbeans.api.project.FileOwnerQuery;
  152.11 +import org.netbeans.api.project.Project;
  152.12 +import org.netbeans.api.project.ProjectUtils;
  152.13  import org.netbeans.modules.portalpack.portlets.genericportlets.core.AppContext;
  152.14  import org.netbeans.modules.portalpack.portlets.genericportlets.core.PortletContext;
  152.15  import org.netbeans.modules.portalpack.portlets.genericportlets.core.listeners.PortletXMLChangeListener;
  152.16  import org.netbeans.modules.portalpack.portlets.genericportlets.core.util.CoreUtil;
  152.17  import org.netbeans.modules.portalpack.portlets.genericportlets.core.util.NetbeansUtil;
  152.18 +import org.netbeans.modules.portalpack.servers.websynergy.common.WebSpacePropertiesUtil;
  152.19  import org.netbeans.modules.portalpack.servers.websynergy.dd.ld.impl400.Category;
  152.20  import org.netbeans.modules.portalpack.servers.websynergy.dd.ld.impl400.Display;
  152.21  import org.netbeans.modules.portalpack.servers.websynergy.dd.lp.impl440.LiferayPortletApp;
  152.22  import org.netbeans.modules.portalpack.servers.websynergy.dd.lp.impl440.Portlet;
  152.23 -import org.netbeans.modules.schema2beans.BaseBean;
  152.24 -import org.openide.util.Exceptions;
  152.25 +import org.openide.DialogDisplayer;
  152.26 +import org.openide.NotifyDescriptor;
  152.27 +import org.openide.filesystems.FileObject;
  152.28 +import org.openide.filesystems.FileUtil;
  152.29 +import org.openide.util.NbBundle;
  152.30  
  152.31  /**
  152.32   *
  152.33 @@ -32,12 +38,41 @@
  152.34  
  152.35      private static Logger logger = Logger.getLogger(CoreUtil.CORE_LOGGER);
  152.36      public static String SPRING_PORTLET = "org.springframework.web.portlet.DispatcherPortlet";
  152.37 +    public static String JSF_PORTLET = "com.sun.faces.portlet.FacesPortlet";
  152.38 +    public static String RUBY_PORTLET = "com.liferay.util.bridges.ruby.RubyPortlet";
  152.39  
  152.40      public void addPortlet(PortletContext portletContext, AppContext appContext, String webInfDir) {
  152.41  
  152.42          addPortletToLifeRayPortletFile(portletContext, appContext, webInfDir);
  152.43          addPortletToLifeRayDisplayFile(portletContext, appContext, webInfDir);
  152.44 -        addDependencyJars(portletContext, webInfDir);
  152.45 +
  152.46 +        Properties pluginPackageProperties = getPluginPackageProperties(webInfDir);
  152.47 +
  152.48 +        boolean addJars = addDependencyJars(pluginPackageProperties, portletContext, webInfDir);
  152.49 +        boolean addProps = addPluginPackageProperties(pluginPackageProperties, portletContext, webInfDir);
  152.50 +
  152.51 +        if (addJars || addProps) {
  152.52 +            storePluginPackageProperties(pluginPackageProperties, webInfDir);
  152.53 +        }
  152.54 +
  152.55 +        FileObject webInfFO = FileUtil.toFileObject(new File(webInfDir));
  152.56 +        if(webInfFO != null) {
  152.57 +            Project prj = FileOwnerQuery.getOwner(webInfFO);
  152.58 +            if(prj != null) {
  152.59 +                //check if Liferay/WebSpace
  152.60 +                boolean isLiferay = WebSpacePropertiesUtil.isWebSynergyServer(prj);
  152.61 +                if(isLiferay) {
  152.62 +                    String prjName = ProjectUtils.getInformation(prj).getName();
  152.63 +                    if(prjName != null && prjName.endsWith("-hook")) {
  152.64 +                        NotifyDescriptor nd = new NotifyDescriptor.Message(
  152.65 +                                NbBundle.getMessage(LiferayPortletXMLListener.class,
  152.66 +                                "MSG_PORTLET_NOT_ALLOWED_IN_HOOK_PROJECT"),NotifyDescriptor.WARNING_MESSAGE);
  152.67 +                        DialogDisplayer.getDefault().notify(nd);
  152.68 +                    }
  152.69 +                }
  152.70 +            }
  152.71 +
  152.72 +        }
  152.73      }
  152.74  
  152.75      private void addPortletToLifeRayDisplayFile(PortletContext portletContext, AppContext appContext, String webInfDir) {
  152.76 @@ -94,23 +129,12 @@
  152.77  
  152.78      }
  152.79  
  152.80 -    private void addDependencyJars(PortletContext pc, String webInfDir) {
  152.81 +    private boolean addDependencyJars(Properties pluginPackageProp, PortletContext pc, String webInfDir) {
  152.82  
  152.83          String className = pc.getPortletClass();
  152.84          if (className != null && className.equals(SPRING_PORTLET)) {
  152.85  
  152.86 -            InputStream in = null;
  152.87 -            OutputStream out = null;
  152.88              try {
  152.89 -                File file = new File(webInfDir + File.separator + "liferay-plugin-package.properties");
  152.90 -
  152.91 -                if (!file.exists()) {
  152.92 -                    return;
  152.93 -                }
  152.94 -                in = new FileInputStream(file);
  152.95 -
  152.96 -                Properties pluginPackageProp = new Properties();
  152.97 -                pluginPackageProp.load(in);
  152.98  
  152.99                  String depJar = pluginPackageProp.getProperty("portal.dependency.jars");
 152.100  
 152.101 @@ -119,7 +143,7 @@
 152.102                  } else {
 152.103  
 152.104                      if (depJar.indexOf("commons-fileupload.jar") != -1) {
 152.105 -                        return;
 152.106 +                        return false;
 152.107                      }
 152.108                      if (depJar.endsWith(",")) {
 152.109                          depJar += "commons-fileupload.jar";
 152.110 @@ -127,35 +151,105 @@
 152.111                          depJar += "," + "commons-fileupload.jar";
 152.112                      }
 152.113                      pluginPackageProp.setProperty("portal.dependency.jars", depJar);
 152.114 +                }
 152.115  
 152.116 -                    if (in != null) {
 152.117 -                        try {
 152.118 -                            in.close();
 152.119 -                        } catch (IOException ex) {
 152.120 -                            //Exceptions.printStackTrace(ex);
 152.121 -                        }
 152.122 +            } catch (Exception e) {
 152.123 +            }
 152.124 +            return true;
 152.125 +        } else if (className != null && className.equals(RUBY_PORTLET)) {
 152.126 +
 152.127 +            
 152.128 +            try {
 152.129 +
 152.130 +                String depJar = pluginPackageProp.getProperty("portal.dependency.jars");
 152.131 +
 152.132 +                if (depJar == null || depJar.trim().length() == 0) {
 152.133 +                    pluginPackageProp.setProperty("portal.dependency.jars", "bsf.jar");
 152.134 +                } else {
 152.135 +
 152.136 +                    if (depJar.indexOf("bsf.jar") != -1) {
 152.137 +                        return false;
 152.138                      }
 152.139 -                    try {
 152.140 -                        out = new FileOutputStream(file);
 152.141 -                        pluginPackageProp.store(out, "");
 152.142 -                        out.flush();
 152.143 -                        out.close();
 152.144 -                    } catch (Exception e) {
 152.145 -                        logger.info(e.getMessage());
 152.146 +                    if (depJar.endsWith(",")) {
 152.147 +                        depJar += "bsf.jar";
 152.148 +                    } else {
 152.149 +                        depJar += "," + "bsf.jar";
 152.150                      }
 152.151 +                    pluginPackageProp.setProperty("portal.dependency.jars", depJar);
 152.152 +                }
 152.153  
 152.154 -                }
 152.155              } catch (Exception e) {
 152.156 -            }finally {
 152.157 -                if(out != null) {
 152.158 -                    try {
 152.159 -                        out.close();
 152.160 -                    } catch (IOException ex) {
 152.161 -                        
 152.162 -                    }
 152.163 +            }
 152.164 +            return true;
 152.165 +        }
 152.166 +
 152.167 +        return false;
 152.168 +    }
 152.169 +
 152.170 +    private boolean addPluginPackageProperties(Properties pluginPackage, PortletContext portletContext, String webInfDir) {
 152.171 +        String className = portletContext.getPortletClass();
 152.172 +        if (className != null && className.equals(JSF_PORTLET)) {
 152.173 +
 152.174 +            String speedFilterEnabled =
 152.175 +                    pluginPackage.getProperty("speed-filters-enabled");
 152.176 +            if (speedFilterEnabled == null || speedFilterEnabled.trim().length() == 0) {
 152.177 +
 152.178 +                pluginPackage.setProperty("speed-filters-enabled", "false");
 152.179 +                return true;
 152.180 +            }
 152.181 +
 152.182 +            return false;
 152.183 +
 152.184 +        }
 152.185 +
 152.186 +        return false;
 152.187 +    }
 152.188 +
 152.189 +    private Properties getPluginPackageProperties(String webInfDir) {
 152.190 +        InputStream in = null;
 152.191 +        try {
 152.192 +            File file = new File(webInfDir + File.separator + "liferay-plugin-package.properties");
 152.193 +
 152.194 +            if (!file.exists()) {
 152.195 +                return new Properties();
 152.196 +            }
 152.197 +            in = new FileInputStream(file);
 152.198 +
 152.199 +            Properties pluginPackageProp = new Properties();
 152.200 +            pluginPackageProp.load(in);
 152.201 +
 152.202 +            return pluginPackageProp;
 152.203 +        } catch (Exception e) {
 152.204 +        } finally {
 152.205 +            if (in != null) {
 152.206 +                try {
 152.207 +                    in.close();
 152.208 +                } catch (IOException ex) {
 152.209 +                    //Exceptions.printStackTrace(ex);
 152.210                  }
 152.211              }
 152.212 +        }
 152.213 +        return new Properties();
 152.214 +    }
 152.215  
 152.216 +    private void storePluginPackageProperties(Properties pluginPackage, String webInfDir) {
 152.217 +        File file = new File(webInfDir + File.separator + "liferay-plugin-package.properties");
 152.218 +        FileOutputStream out = null;
 152.219 +        try {
 152.220 +            out = new FileOutputStream(file);
 152.221 +            pluginPackage.store(out, "");
 152.222 +            out.flush();
 152.223 +            out.close();
 152.224 +        } catch (Exception e) {
 152.225 +            logger.info(e.getMessage());
 152.226 +        } finally {
 152.227 +            if (out != null) {
 152.228 +                try {
 152.229 +                    out.close();
 152.230 +                } catch (IOException ex) {
 152.231 +                }
 152.232 +            }
 152.233          }
 152.234 +
 152.235      }
 152.236  }
   153.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/config/LiferayXMLUtil.java	Fri Jun 10 09:46:37 2011 +0200
   153.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/config/LiferayXMLUtil.java	Sun Jun 26 10:25:14 2011 +0800
   153.3 @@ -41,13 +41,21 @@
   153.4  
   153.5  import java.io.File;
   153.6  import java.io.IOException;
   153.7 -import java.util.logging.Level;
   153.8 +import java.util.HashMap;
   153.9 +import java.util.Map;
  153.10  import java.util.logging.Logger;
  153.11 -import org.netbeans.modules.portalpack.portlets.genericportlets.core.util.TemplateNotFoundException;
  153.12 +import org.netbeans.api.project.FileOwnerQuery;
  153.13 +import org.netbeans.api.project.Project;
  153.14 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.actions.util.PortletProjectUtils;
  153.15 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  153.16  import org.netbeans.modules.portalpack.servers.websynergy.common.LiferayConstants;
  153.17 +import org.netbeans.modules.portalpack.servers.websynergy.common.WebSpacePropertiesUtil;
  153.18 +import org.netbeans.modules.portalpack.servers.websynergy.util.TemplateNotFoundException;
  153.19 +import org.netbeans.modules.portalpack.servers.websynergy.util.TemplateUtil;
  153.20  import org.openide.filesystems.FileObject;
  153.21  import org.openide.filesystems.FileUtil;
  153.22  import org.openide.filesystems.Repository;
  153.23 +import org.openide.loaders.DataObjectNotFoundException;
  153.24  import org.openide.util.Exceptions;
  153.25  
  153.26  /**
  153.27 @@ -56,24 +64,28 @@
  153.28   */
  153.29  public class LiferayXMLUtil {
  153.30  
  153.31 -    public static String LR_PORTLET_TEMPLATE = "liferay-portlet-440.template";
  153.32 -    public static String LR_DISPLAY_TEMPLATE = "liferay-display-400.template";
  153.33 -    public static String LR_PLUGIN_PACKAGE_TEMPLATE = "liferay-plugin-package-430.template";
  153.34 +    public static String LR_PORTLET_TEMPLATE = "liferay-portlet.xml";
  153.35 +    public static String LR_DISPLAY_TEMPLATE = "liferay-display.xml";
  153.36 +    public static String LR_PLUGIN_PACKAGE_TEMPLATE = "liferay-plugin-package.xml";
  153.37      
  153.38      private static String templateFolder = "liferay/templates";
  153.39 -    private static FileObject folder;
  153.40 +    
  153.41      protected static Logger logger = Logger.getLogger(LiferayConstants.LR_LOGGER);
  153.42      
  153.43      public static boolean createLRXMLFile(String templateName,String destFolder,String fileName)
  153.44      {
  153.45 -        FileObject templateFile = getTemplateFile(templateName);
  153.46 -        if(templateFile == null)
  153.47 -        {
  153.48 -            logger.severe("Template File "+templateName + " not found !!!");
  153.49 -            return false;
  153.50 +        TemplateUtil templateUtil = new TemplateUtil(templateFolder);
  153.51 +        FileObject templateFile = null;
  153.52 +        try {
  153.53 +            templateFile = templateUtil.getTemplateFile(templateName);
  153.54 +        } catch (TemplateNotFoundException ex) {
  153.55 +            Exceptions.printStackTrace(ex);
  153.56          }
  153.57          
  153.58          File destDir = new File(destFolder);
  153.59 +
  153.60 +        Project project = FileOwnerQuery.getOwner(FileUtil.toFileObject(destDir));
  153.61 +
  153.62          if(destDir == null || !destDir.exists())
  153.63          {
  153.64              logger.severe("Destination Folder "+ destFolder + " doesn't exist !!!");
  153.65 @@ -86,37 +98,39 @@
  153.66              logger.severe("Destination Object for folder "+ destFolder + " is null !!!");
  153.67              return false;
  153.68          }
  153.69 +
  153.70 +        PSConfigObject psconfig = WebSpacePropertiesUtil.getSelectedServerProperties(project);
  153.71 +        int liferayVersion = 0;
  153.72 +        String version = "5_1_0";
  153.73 +        String dtdVersion = "5.1.0";
  153.74 +        if (psconfig != null) {
  153.75 +            liferayVersion = WebSpacePropertiesUtil.getLiferayVersion(psconfig);
  153.76 +            
  153.77 +            if(liferayVersion >= 6000) {
  153.78 +                version = "6_0_0";
  153.79 +                dtdVersion = "6.0.0";
  153.80 +            } else if (liferayVersion >= 5200) {
  153.81 +                version = "5_2_0";
  153.82 +                dtdVersion = "5.2.0";
  153.83 +            } else {
  153.84 +                version = "5_1_0";
  153.85 +                dtdVersion = "5.1.0";
  153.86 +            }
  153.87 +        }
  153.88 +        Map values = new HashMap();
  153.89 +       
  153.90 +        values.put("DTD_VERSION", dtdVersion);
  153.91 +        values.put("VERSION", version);
  153.92 +
  153.93          try {
  153.94 -            FileUtil.copyFile(templateFile, destObj, fileName, "xml");
  153.95 +            templateUtil.mergeTemplateToFile(templateFile, FileUtil.toFileObject(new File(destFolder)), fileName, values);
  153.96 +        } catch (DataObjectNotFoundException ex) {
  153.97 +            Exceptions.printStackTrace(ex);
  153.98          } catch (IOException ex) {
  153.99 -            logger.log(Level.SEVERE, "Error creating lr xml file : " + fileName, ex);
 153.100 -            return false;
 153.101 +            Exceptions.printStackTrace(ex);
 153.102          }
 153.103 +
 153.104          return true;
 153.105      }
 153.106 -    /**
 153.107 -     * It returns the template FileObject
 153.108 -     * 
 153.109 -     * @param name Template name. Template name is usually specified in the layer.xml 
 153.110 -     * @return Template FileObject
 153.111 -     **/
 153.112 -    public static FileObject getTemplateFile(String name) {
 153.113 -        FileObject fo = getFolder() != null ? getFolder().getFileObject(name) : null;
 153.114 -        return fo;
 153.115 -    }
 153.116 -
 153.117 -    public static FileObject getFolder() {
 153.118 -        if (folder == null) {
 153.119 -            folder = Repository.getDefault().getDefaultFileSystem().findResource(templateFolder);
 153.120 -            //For NB 7.0
 153.121 -            //folder = FileUtil.getConfigFile(templateFolder);
 153.122 -
 153.123 -        }
 153.124 -        return folder;
 153.125 -    }
 153.126 -
 153.127 -    public static void setFolder(FileObject folder) {
 153.128 -        folder = folder;
 153.129 -    }
 153.130  
 153.131  }
   154.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/impl/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   154.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/impl/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   154.3 @@ -43,4 +43,8 @@
   154.4  MSG_DEPLOY_ON_GLASSFISH_FAILED=Deployment on Glassfish failed
   154.5  
   154.6  MSG_UNDEPLOY_ON_GLASSFISH_FAILED=UnDeployment on Glassfish failed
   154.7 -Deployment_Done=Deployment on WebSynergy Portal Server is done. Check Server log in the output tab for more details.
   154.8 +Deployment_Done=Deployment on WebSpace Server is done. Check Server log in the output tab for more details.
   154.9 +LBL_AUTO_DEPLOY_DIR_IS_NOT_SET=Auto Deploy Directory is not set. Please set it in the Server Configuration Panel.
  154.10 +
  154.11 +DIR_DEPLOYMENT_NOT_ALLOWED_FOR_HOOK=<html><body>Directory deployment is not supported for <b>Hook Type</b> Application.\
  154.12 +                                        <br>Please uncheck the "Directory Deployment Enabled" option in Server Config Panel and try again.</body></html>
  154.13 \ No newline at end of file
   155.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   155.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/impl/JBossStartStopServerListener.java	Sun Jun 26 10:25:14 2011 +0800
   155.3 @@ -0,0 +1,39 @@
   155.4 +/*
   155.5 +  * The contents of this file are subject to the terms of the Common Development
   155.6 +  * and Distribution License (the License). You may not use this file except in
   155.7 +  * compliance with the License.
   155.8 +  *
   155.9 +  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  155.10 +  * or http://www.netbeans.org/cddl.txt.
  155.11 +  *
  155.12 +  * When distributing Covered Code, include this CDDL Header Notice in each file
  155.13 +  * and include the License file at http://www.netbeans.org/cddl.txt.
  155.14 +  * If applicable, add the following below the CDDL Header, with the fields
  155.15 +  * enclosed by brackets [] replaced by your own identifying information:
  155.16 +  * "Portions Copyrighted [year] [name of copyright owner]"
  155.17 +  *
  155.18 +  * The Original Software is NetBeans. The Initial Developer of the Original
  155.19 +  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  155.20 +  * Microsystems, Inc. Portions Copyright 2009 John Platts. All Rights Reserved.
  155.21 +  */
  155.22 +
  155.23 +package org.netbeans.modules.portalpack.servers.websynergy.impl;
  155.24 +
  155.25 +import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  155.26 +import org.netbeans.modules.portalpack.servers.core.api.ServerStartStopListener;
  155.27 +import org.netbeans.modules.portalpack.servers.core.api.StartStopEvent;
  155.28 +
  155.29 +/**
  155.30 + * Implementation of ServerStartStopListener for JBoss.
  155.31 + * @author John Platts
  155.32 + */
  155.33 +public class JBossStartStopServerListener implements ServerStartStopListener{
  155.34 +    
  155.35 +    /** Creates a new instance of JBossStartStopServerListener */
  155.36 +    public JBossStartStopServerListener(PSDeploymentManager dm) {
  155.37 +    }
  155.38 +
  155.39 +    public void performAction(StartStopEvent evt) {
  155.40 +    }
  155.41 +    
  155.42 +}
   156.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   156.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/impl/LiferayHelper.java	Sun Jun 26 10:25:14 2011 +0800
   156.3 @@ -0,0 +1,184 @@
   156.4 +/*
   156.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   156.6 + *
   156.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   156.8 + *
   156.9 + * The contents of this file are subject to the terms of either the GNU
  156.10 + * General Public License Version 2 only ("GPL") or the Common
  156.11 + * Development and Distribution License("CDDL") (collectively, the
  156.12 + * "License"). You may not use this file except in compliance with the
  156.13 + * License. You can obtain a copy of the License at
  156.14 + * http://www.netbeans.org/cddl-gplv2.html
  156.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  156.16 + * specific language governing permissions and limitations under the
  156.17 + * License.  When distributing the software, include this License Header
  156.18 + * Notice in each file and include the License file at
  156.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  156.20 + * particular file as subject to the "Classpath" exception as provided
  156.21 + * by Sun in the GPL Version 2 section of the License file that
  156.22 + * accompanied this code. If applicable, add the following below the
  156.23 + * License Header, with the fields enclosed by brackets [] replaced by
  156.24 + * your own identifying information:
  156.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  156.26 + *
  156.27 + * If you wish your version of this file to be governed by only the CDDL
  156.28 + * or only the GPL Version 2, indicate your decision by adding
  156.29 + * "[Contributor] elects to include this software in this distribution
  156.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  156.31 + * single choice of license, a recipient has the option to distribute
  156.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  156.33 + * to extend the choice of license to its licensees as provided above.
  156.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  156.35 + * Version 2 license, then the option applies only if the new code is
  156.36 + * made subject to such option by the copyright holder.
  156.37 + *
  156.38 + * Contributor(s):
  156.39 + *
  156.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  156.41 + */
  156.42 +package org.netbeans.modules.portalpack.servers.websynergy.impl;
  156.43 +
  156.44 +import java.io.BufferedReader;
  156.45 +import java.io.File;
  156.46 +import java.io.IOException;
  156.47 +import java.io.InputStream;
  156.48 +import java.io.InputStreamReader;
  156.49 +import java.net.HttpURLConnection;
  156.50 +import java.net.MalformedURLException;
  156.51 +import java.net.URL;
  156.52 +import java.util.logging.Level;
  156.53 +import java.util.logging.Logger;
  156.54 +import org.json.JSONException;
  156.55 +import org.json.JSONObject;
  156.56 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.util.NetbeanConstants;
  156.57 +import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
  156.58 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.tomcat.TomcatConstant;
  156.59 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  156.60 +import org.netbeans.modules.portalpack.servers.websynergy.common.LiferayConstants;
  156.61 +import org.openide.filesystems.FileUtil;
  156.62 +
  156.63 +/**
  156.64 + *
  156.65 + * @author Santh Chetan Chadalavada
  156.66 + */
  156.67 +public class LiferayHelper {
  156.68 +
  156.69 +    protected static Logger logger = Logger.getLogger(NetbeanConstants.PORTAL_LOGGER);
  156.70 +
  156.71 +    public static String getAutoDeployDirectory(PSConfigObject psconfig) {
  156.72 +        return getAutoDeployDirectory(psconfig, Boolean.FALSE);
  156.73 +    }
  156.74 +    public static String getAutoDeployDirectory(PSConfigObject psconfig,boolean force) {
  156.75 +
  156.76 +        String v = psconfig.getProperty(LiferayConstants.LR_VERSION);
  156.77 +        if (v == null || v.trim().length() == 0) {
  156.78 +            return psconfig.getProperty(LiferayConstants.AUTO_DEPLOY_DIR);
  156.79 +        }
  156.80 +
  156.81 +        String aDepDir = psconfig.getProperty(LiferayConstants.AUTO_DEPLOY_DIR);
  156.82 +        if (aDepDir != null && aDepDir.trim().length() != 0 && !force) {
  156.83 +            return psconfig.getProperty(LiferayConstants.AUTO_DEPLOY_DIR);
  156.84 +        }
  156.85 +
  156.86 +        int version = 1;
  156.87 +
  156.88 +        try {
  156.89 +            version = Integer.parseInt(v);
  156.90 +        } catch (Exception e) {
  156.91 +            return psconfig.getProperty(LiferayConstants.AUTO_DEPLOY_DIR);
  156.92 +        }
  156.93 +
  156.94 +        if (version <= 5200) {
  156.95 +            return psconfig.getProperty(LiferayConstants.AUTO_DEPLOY_DIR);
  156.96 +        }
  156.97 +
  156.98 +        /*String defaultAutoDeployDir = "";
  156.99 +        if (psconfig.getServerType().equals(ServerConstants.SUN_APP_SERVER_9)) {
 156.100 +        defaultAutoDeployDir = new File(psconfig.getServerHome()).getParentFile().getAbsolutePath() + File.separator + "deploy";
 156.101 +        } else {
 156.102 +        defaultAutoDeployDir = new File(psconfig.getProperty(TomcatConstant.CATALINA_BASE)).getParentFile().getAbsolutePath() + File.separator + "deploy";
 156.103 +        }*/
 156.104 +        try {
 156.105 +            String portalUri = LiferayHelper.normalizeURL(psconfig.getPortalUri());
 156.106 +			URL url = null;
 156.107 +            String urlStr = "http://" + psconfig.getHost() + ":" + psconfig.getPort() + portalUri + "/c/portal/" + "json_service?serviceClassName=" + "com.liferay.portal.service.http.PortalServiceJSON" + "&serviceMethodName=getAutoDeployDirectory";
 156.108 +            if(getLiferayBuildNumber(psconfig) >= 5203) {
 156.109 +                urlStr = "http://" + psconfig.getHost() + ":" + psconfig.getPort() + portalUri +"/c/portal/" + "json_service?serviceClassName=" + "com.liferay.portal.service.PortalServiceUtil" + "&serviceMethodName=getAutoDeployDirectory";
 156.110 +            }
 156.111 +            try {
 156.112 +                url = new URL(urlStr);
 156.113 +            } catch (MalformedURLException e) {
 156.114 +                logger.warning("Failed to create URL for the websynergy json service ");
 156.115 +                logger.warning(e.getMessage());
 156.116 +                //return defaultAutoDeployDir;
 156.117 +                return null;
 156.118 +            }
 156.119 +
 156.120 +            String jsonString = getContentFromHttpURL(url);
 156.121 +            if (jsonString == null) {
 156.122 +                //return defaultAutoDeployDir;
 156.123 +                return null;
 156.124 +            }
 156.125 +
 156.126 +            JSONObject json = new JSONObject(jsonString);
 156.127 +            String autoDeployDir = json.getString("returnValue");
 156.128 +
 156.129 +            psconfig.setAndSaveProperty(LiferayConstants.AUTO_DEPLOY_DIR,
 156.130 +                    FileUtil.normalizeFile(new File(autoDeployDir)).getAbsolutePath());
 156.131 +
 156.132 +            return autoDeployDir;
 156.133 +        } catch (JSONException ex) {
 156.134 +            logger.log(Level.SEVERE, "Error", ex);
 156.135 +            return null;
 156.136 +        }
 156.137 +
 156.138 +    }
 156.139 + public static String getContentFromHttpURL(URL url) {
 156.140 +        BufferedReader br = null;
 156.141 +        try {
 156.142 +            // TODO code application logic here
 156.143 +            HttpURLConnection con = (HttpURLConnection) url.openConnection();
 156.144 +            con.setDoOutput(true);
 156.145 +            InputStream ins = con.getInputStream();
 156.146 +
 156.147 +            br = new BufferedReader(new InputStreamReader(ins));
 156.148 +            String content = "";
 156.149 +            String line = br.readLine();
 156.150 +            while (line != null) {
 156.151 +                content += line;
 156.152 +                line = br.readLine();
 156.153 +            }
 156.154 +
 156.155 +            return content;
 156.156 +        } catch (Exception e) {
 156.157 +            //logger.log(Level.SEVERE, "Error", e);
 156.158 +            return null;
 156.159 +        } finally {
 156.160 +            if (br != null) {
 156.161 +                try {
 156.162 +                    br.close();
 156.163 +                } catch (IOException ex) {
 156.164 +                }
 156.165 +            }
 156.166 +        }
 156.167 +    }
 156.168 +
 156.169 +    public static String normalizeURL(String portalUri) {
 156.170 +		if (portalUri == null || portalUri.trim().length() == 0 || portalUri.trim().equals("/")) {
 156.171 +			portalUri = "";
 156.172 +		} else if (!portalUri.startsWith("/")) {
 156.173 +			portalUri = "/" + portalUri;
 156.174 +		}
 156.175 +
 156.176 +		return portalUri;
 156.177 +	}
 156.178 +
 156.179 +    private static int getLiferayBuildNumber(PSConfigObject psconfig) {
 156.180 +        try{
 156.181 +            return Integer.parseInt(
 156.182 +                    psconfig.getProperty(LiferayConstants.LR_VERSION));
 156.183 +        }catch(Exception e) {
 156.184 +            return 1;
 156.185 +        }
 156.186 +    }
 156.187 +}
   157.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/impl/LiferayTaskHandler.java	Fri Jun 10 09:46:37 2011 +0200
   157.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/impl/LiferayTaskHandler.java	Sun Jun 26 10:25:14 2011 +0800
   157.3 @@ -18,21 +18,19 @@
   157.4   */
   157.5  package org.netbeans.modules.portalpack.servers.websynergy.impl;
   157.6  
   157.7 -import java.io.BufferedReader;
   157.8  import java.io.File;
   157.9  import java.io.FileInputStream;
  157.10  import java.io.FileOutputStream;
  157.11  import java.io.IOException;
  157.12 -import java.io.InputStream;
  157.13 -import java.io.InputStreamReader;
  157.14  import java.lang.reflect.Method;
  157.15 -import java.net.HttpURLConnection;
  157.16  import java.net.MalformedURLException;
  157.17  import java.net.URL;
  157.18  import java.util.ArrayList;
  157.19  import java.util.List;
  157.20 +import java.util.jar.JarFile;
  157.21  import java.util.logging.Level;
  157.22  import java.util.logging.Logger;
  157.23 +import java.util.zip.ZipEntry;
  157.24  import org.json.JSONArray;
  157.25  import org.json.JSONException;
  157.26  import org.json.JSONObject;
  157.27 @@ -43,18 +41,23 @@
  157.28  import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  157.29  import org.netbeans.modules.portalpack.servers.core.common.DeploymentException;
  157.30  import org.netbeans.modules.portalpack.servers.core.common.ExtendedClassLoader;
  157.31 -import org.netbeans.modules.portalpack.servers.core.common.FileLogViewerSupport;
  157.32  import org.netbeans.modules.portalpack.servers.core.common.LogManager;
  157.33  import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
  157.34  import org.netbeans.modules.portalpack.servers.core.impl.DefaultPSTaskHandler;
  157.35 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibraries;
  157.36 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibrariesFactory;
  157.37  import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.ServerDeployHandler;
  157.38 -import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.ServerDeployerHandlerFactory;
  157.39 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.jboss.JBConstant;
  157.40  import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.tomcat.TomcatConstant;
  157.41  import org.netbeans.modules.portalpack.servers.core.util.NetbeanConstants;
  157.42  import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  157.43  import org.netbeans.modules.portalpack.servers.websynergy.common.LiferayConstants;
  157.44 +import org.netbeans.modules.portalpack.servers.websynergy.common.WSConstants;
  157.45 +import org.openide.DialogDisplayer;
  157.46 +import org.openide.NotifyDescriptor;
  157.47  import org.openide.filesystems.FileObject;
  157.48  import org.openide.filesystems.FileUtil;
  157.49 +import org.openide.util.NbBundle;
  157.50  import org.openide.util.RequestProcessor;
  157.51  
  157.52  /**
  157.53 @@ -68,7 +71,7 @@
  157.54      protected PSConfigObject psconfig;
  157.55      protected ServerDeployHandler deployerHandler;
  157.56      protected String uri;
  157.57 -    private static String WS_PREFIX = "websynergy";
  157.58 +    
  157.59  
  157.60      /** Creates a new instance of LifeRayTaskHandler */
  157.61      public LiferayTaskHandler(PSDeploymentManager dm) {
  157.62 @@ -76,10 +79,10 @@
  157.63          this.psconfig = dm.getPSConfig();
  157.64          this.uri = dm.getUri();
  157.65  
  157.66 -        deployerHandler = ServerDeployerHandlerFactory.getServerDeployerHandler(dm);
  157.67 +        deployerHandler = dm.getServerDeployHandler();
  157.68      }
  157.69  
  157.70 -    public void _deployOnGF(String warfile, String serveruri) throws Exception {
  157.71 +    public void _deployOnGF(String warfile, String autoDeployDir, String serveruri) throws Exception {
  157.72          File warF = new File(warfile);
  157.73          
  157.74          File tempDir = new File(System.getProperty("java.io.tmpdir") + File.separator
  157.75 @@ -110,7 +113,6 @@
  157.76          }
  157.77          
  157.78          //Copy that file
  157.79 -        String autoDeployDir = psconfig.getProperty(LiferayConstants.AUTO_DEPLOY_DIR);
  157.80          File deployDirFile = new File(autoDeployDir);
  157.81          if (!deployDirFile.exists()) {
  157.82              deployDirFile.mkdirs();
  157.83 @@ -144,9 +146,11 @@
  157.84          }
  157.85          
  157.86          if(counter >= 300) {
  157.87 -            final String errorMsg = "Massaging could not been done properly." +
  157.88 -                    "\n Autodeploy scanner might not be responding." +
  157.89 -                    "\n Please restart your sever and try again... ";
  157.90 +            final String errorMsg = "Massaging could not be done properly. Possible reasons :" +
  157.91 +                    "\n1. Auto deploy directory is not set properly. If so please go to the server" +
  157.92 +                    "config panel and set the auto deploy directory correctly." +
  157.93 +                    "\n2. Autodeploy scanner might not be responding. " +
  157.94 +                    "\n3. Please restart your sever and try again... ";
  157.95              writeErrorToOutput(uri, new Exception(errorMsg));
  157.96              
  157.97              throw new DeploymentException(errorMsg);
  157.98 @@ -178,7 +182,7 @@
  157.99          //System.out.println("Time taken to massaging :::: "+(t2-t1));
 157.100          
 157.101          //For backward compatiblility when server is Liferay.
 157.102 -        if(!isWebSynergy()) 
 157.103 +        if(!isWebSynergy() && getLiferayBuildNumber() < 5200) 
 157.104              verifyDisplayName(tempDir.getAbsolutePath(), context);
 157.105          
 157.106          File destWar = new File(tempDir.getParentFile(),warF.getName());
 157.107 @@ -233,14 +237,31 @@
 157.108      
 157.109      public String deploy(String warfile, String serveruri) throws Exception {
 157.110  
 157.111 +        String deployDir = LiferayHelper.getAutoDeployDirectory(psconfig);
 157.112 +        
 157.113 +        if(deployDir == null || deployDir.trim().length() == 0) {
 157.114 +           DialogDisplayer.getDefault().notify(
 157.115 +                   new NotifyDescriptor.Message(NbBundle.getMessage(
 157.116 +                   LiferayTaskHandler.class, "LBL_AUTO_DEPLOY_DIR_IS_NOT_SET")));
 157.117 +           throw new Exception("Auto Deploy Directory is not set. Please set it in Server Configuration Panel.");
 157.118 +        }
 157.119 +        
 157.120 +        //For Hook plugins when there is no portlet.xml
 157.121 +        //starts
 157.122 +     
 157.123 +        JarFile jarFile = new JarFile(new File(warfile));
 157.124 +        ZipEntry portletXml = jarFile.getEntry("WEB-INF/portlet.xml");      
 157.125 +     
 157.126 +        //ends
 157.127 +        
 157.128          if (psconfig.getServerType().equals(ServerConstants.SUN_APP_SERVER_9)
 157.129 -                && isDirectoryDeploymentSupported()) {
 157.130 +                && isDirectoryDeploymentSupported() && portletXml != null) {
 157.131              
 157.132 -            _deployOnGF(warfile, serveruri);
 157.133 +            _deployOnGF(warfile, deployDir, serveruri);
 157.134              return "deployed";
 157.135          }
 157.136          
 157.137 -        String deployDir = psconfig.getProperty(LiferayConstants.AUTO_DEPLOY_DIR);
 157.138 +        
 157.139          File deployDirFile = new File(deployDir);
 157.140          if (!deployDirFile.exists()) {
 157.141              deployDirFile.mkdirs();
 157.142 @@ -248,15 +269,13 @@
 157.143          long baseTime = System.currentTimeMillis();
 157.144          copy(warfile, deployDir);
 157.145          showServerLog();
 157.146 -        return getDeploymentMessage(warfile, baseTime);
 157.147 +        return getDeploymentMessage(warfile, deployDir, baseTime);
 157.148      }
 157.149  
 157.150 -    public String getDeploymentMessage(String warfile, long baseTime) throws Exception {
 157.151 +    public String getDeploymentMessage(String warfile, String deployDir, long baseTime) throws Exception {
 157.152          File warFile = new File(warfile);
 157.153          String warName = warFile.getName();
 157.154  
 157.155 -        String deployDir = psconfig.getProperty(LiferayConstants.AUTO_DEPLOY_DIR);
 157.156 -
 157.157          File warInLRAutoDeployDir = new File(deployDir + File.separator + warName);
 157.158          int counter = 0;
 157.159          while (warInLRAutoDeployDir.exists()) {
 157.160 @@ -275,10 +294,15 @@
 157.161              return _getGlassFishDeploymentMessage(warName, baseTime);
 157.162          }
 157.163          
 157.164 -        if(psconfig.getServerType().equals(ServerConstants.TOMCAT_5_X)) {
 157.165 +        if(psconfig.getServerType().equals(ServerConstants.TOMCAT_5_X)
 157.166 +				|| psconfig.getServerType().equals(ServerConstants.TOMCAT_6_X)) {
 157.167              return _getTomcatDeploymentMessage(warName, baseTime);
 157.168          }
 157.169          
 157.170 +		if(psconfig.getServerType().equals(ServerConstants.JBOSS_5_X)) {
 157.171 +			return _getJBOSSDeploymentMessage(warName, baseTime);
 157.172 +		}
 157.173 +
 157.174          return org.openide.util.NbBundle.getMessage(LiferayTaskHandler.class, "Deployment_Done");
 157.175          
 157.176      }
 157.177 @@ -358,9 +382,44 @@
 157.178          }
 157.179      }
 157.180      
 157.181 +	private String _getJBOSSDeploymentMessage(String warName,long baseTime)
 157.182 +        throws DeploymentException{
 157.183      
 157.184 +        String appDir = warName;
 157.185 +
 157.186 +        File appDeployDir = new File(psconfig.getProperty(JBConstant.SERVER_DIR)
 157.187 +									+ File.separator + "deploy" + File.separator + appDir);
 157.188 +
 157.189 +        int counter = 0;
 157.190 +        while (true) {
 157.191 +            if (appDeployDir.exists()) {
 157.192 +                if (appDeployDir.lastModified() >= baseTime) {
 157.193 +                    try {
 157.194 +                        Thread.sleep(3000);
 157.195 +                    } catch (InterruptedException ex) {
 157.196 +                        //do nothing.
 157.197 +                    }
 157.198 +
 157.199 +                    return warName + " deployed successfully. Check log for more message.";
 157.200 +                }
 157.201 +            }
 157.202 +
 157.203 +            try {
 157.204 +
 157.205 +                Thread.sleep(300);
 157.206 +            } catch (InterruptedException ex) {
 157.207 +                logger.info(ex.getMessage());
 157.208 +            }
 157.209 +            counter++;
 157.210 +            if (counter >= 50) {
 157.211 +                return "Deployment done. Check server log for the status.";
 157.212 +            }
 157.213 +        }
 157.214 +    }
 157.215 +
 157.216 +
 157.217      private boolean isWebSynergy() {
 157.218 -        if(uri.startsWith(WS_PREFIX))
 157.219 +        if(uri.startsWith(WSConstants.WS_PREFIX))
 157.220              return true;
 157.221          else
 157.222              return false;
 157.223 @@ -371,6 +430,9 @@
 157.224          //For liferay directory deployment is always supported..
 157.225          if(!isWebSynergy())
 157.226              return true;
 157.227 +        
 157.228 +        if(getLiferayBuildNumber() > 5200)
 157.229 +            return true;
 157.230  
 157.231          //check if the directory deployment is supported...
 157.232          File portletContainerJar = new File(
 157.233 @@ -468,6 +530,20 @@
 157.234           }catch(Exception e){
 157.235               e.printStackTrace();
 157.236           }*/
 157.237 +        File hookXml = new File(deployedDir + File.separator + "WEB-INF"
 157.238 +                                    + File.separator + "liferay-hook.xml");
 157.239 +        File portletXml = new File(deployedDir + File.separator + "WEB-INF" 
 157.240 +                                    + File.separator + "portlet.xml");
 157.241 +        if(hookXml.exists() && !portletXml.exists()) {
 157.242 +           
 157.243 +           NotifyDescriptor nd = new NotifyDescriptor.Message(
 157.244 +                   NbBundle.getMessage(LiferayTaskHandler.class,
 157.245 +                   "DIR_DEPLOYMENT_NOT_ALLOWED_FOR_HOOK"),  NotifyDescriptor.WARNING_MESSAGE);
 157.246 +           DialogDisplayer.getDefault().notify(nd);
 157.247 +           throw new DeploymentException(NbBundle.getMessage(LiferayTaskHandler.class,
 157.248 +                   "DIR_DEPLOYMENT_NOT_ALLOWED_FOR_HOOK"));
 157.249 +        }
 157.250 +
 157.251          File deployXmlFile = File.createTempFile("deploy",".xml");
 157.252          FileOutputStream fout = new FileOutputStream(deployXmlFile);
 157.253          String xml = "<Context docBase=\""+ deployedDir + "\"></Context>"; 
 157.254 @@ -483,7 +559,14 @@
 157.255          }
 157.256          
 157.257          //Copy that file
 157.258 -        String autoDeployDir = psconfig.getProperty(LiferayConstants.AUTO_DEPLOY_DIR);
 157.259 +        String autoDeployDir = LiferayHelper.getAutoDeployDirectory(psconfig);
 157.260 +        if(autoDeployDir == null || autoDeployDir.trim().length() == 0) {
 157.261 +           DialogDisplayer.getDefault().notify(
 157.262 +                   new NotifyDescriptor.Message(NbBundle.getMessage(
 157.263 +                   LiferayTaskHandler.class, "LBL_AUTO_DEPLOY_DIR_IS_NOT_SET")));
 157.264 +           throw new Exception("Auto Deploy Directory is not set. Please set it in Server Configuration Panel.");
 157.265 +        }
 157.266 +        
 157.267          File deployDirFile = new File(autoDeployDir);
 157.268          if (!deployDirFile.exists()) {
 157.269              deployDirFile.mkdirs();
 157.270 @@ -518,9 +601,11 @@
 157.271          }
 157.272          
 157.273           if(counter >= 300) {
 157.274 -            final String errorMsg = "Massaging could not been done properly." +
 157.275 -                    "\n Autodeploy scanner might not be responding." +
 157.276 -                    "\n Please restart your sever and try again... ";
 157.277 +            final String errorMsg = "Massaging could not be done properly. Possible reasons :" +
 157.278 +                    "\n1. Auto deploy directory is not set properly. If so please go to the server" +
 157.279 +                    "config panel and set the auto deploy directory correctly." +
 157.280 +                    "\n2. Autodeploy scanner might not be responding. " +
 157.281 +                    "\n3. Please restart your sever and try again... ";
 157.282              writeErrorToOutput(uri, new Exception(errorMsg));
 157.283              
 157.284              throw new DeploymentException(errorMsg);
 157.285 @@ -546,7 +631,7 @@
 157.286          if(confDir != null)
 157.287              deleteDir(confDir);
 157.288          
 157.289 -        if(!isWebSynergy())
 157.290 +        if(!isWebSynergy() && getLiferayBuildNumber() < 5200)
 157.291              verifyDisplayName(deployedDir, context);
 157.292          
 157.293          showServerLog();
 157.294 @@ -580,9 +665,12 @@
 157.295      
 157.296      public String[] getPortlets(String dn) {
 157.297          try {
 157.298 -
 157.299 +			String portalUri = LiferayHelper.normalizeURL(psconfig.getPortalUri());
 157.300              URL url = null;
 157.301 -            String urlStr = "http://" + psconfig.getHost() + ":" + psconfig.getPort() + "/c/" + psconfig.getPortalUri() + "/" + "json_service?serviceClassName=" + "com.liferay.portal.service.http.PortletServiceJSON" + "&serviceMethodName=getWARPortlets";
 157.302 +            String urlStr = "http://" + psconfig.getHost() + ":" + psconfig.getPort() + portalUri +"/c/portal/" + "json_service?serviceClassName=" + "com.liferay.portal.service.http.PortletServiceJSON" + "&serviceMethodName=getWARPortlets";
 157.303 +             if(getLiferayBuildNumber() >= 5203) {
 157.304 +                urlStr = "http://" + psconfig.getHost() + ":" + psconfig.getPort() + portalUri +"/c/portal/" + "json_service?serviceClassName=" + "com.liferay.portal.service.PortletServiceUtil" + "&serviceMethodName=getWARPortlets";
 157.305 +            }
 157.306              try {
 157.307                  url = new URL(urlStr);
 157.308              } catch (MalformedURLException e) {
 157.309 @@ -591,7 +679,7 @@
 157.310                  return new String[0];
 157.311              }
 157.312  
 157.313 -            String jsonString = getContentFromHttpURL(url);
 157.314 +            String jsonString = LiferayHelper.getContentFromHttpURL(url);
 157.315              if (jsonString == null) {
 157.316                  return new String[0];
 157.317              }
 157.318 @@ -610,6 +698,68 @@
 157.319              return new String[0];
 157.320          }
 157.321      }
 157.322 +    
 157.323 +    public String[] getHooks() {
 157.324 +        JEEServerLibraries jEEServerLibraries = 
 157.325 +                JEEServerLibrariesFactory.getJEEServerLibraries(psconfig.getServerType());
 157.326 +        String webAppInstallDir = jEEServerLibraries.getWebAppInstallDirectory(psconfig);
 157.327 +        
 157.328 +        File webAppDir = new File(webAppInstallDir);
 157.329 +        if(webAppDir == null || !webAppDir.isDirectory())
 157.330 +            return new String[]{};
 157.331 +        
 157.332 +        File[] dirs = webAppDir.listFiles();
 157.333 +        
 157.334 +        List hooks = new ArrayList();
 157.335 +        for(File dir:dirs) {
 157.336 +            if(dir.isFile())
 157.337 +                continue;
 157.338 +            File hookXml = new File(dir,"WEB-INF/liferay-hook.xml");
 157.339 +            if(hookXml.exists()) {
 157.340 +                if(dir.getName().equals("ROOT")
 157.341 +                        || dir.getName().equals("webspace")
 157.342 +                        || dir.getName().equals("liferay-portal")) {
 157.343 +                    continue;
 157.344 +                }
 157.345 +                hooks.add(dir.getName());
 157.346 +            }
 157.347 +        }
 157.348 +        return (String [])hooks.toArray(new String[0]);
 157.349 +    }
 157.350 +    
 157.351 +    public String[] getThemes() {
 157.352 +       try {
 157.353 +            String portalUri = LiferayHelper.normalizeURL(psconfig.getPortalUri());
 157.354 +            URL url = null;
 157.355 +            String urlStr = "http://" + psconfig.getHost() + ":" + psconfig.getPort() + portalUri +"/c/portal/" + "json_service?serviceClassName=" + "com.liferay.portal.service.ThemeServiceUtil" + "&serviceMethodName=getWARThemes";
 157.356 +            try {
 157.357 +                url = new URL(urlStr);
 157.358 +            } catch (MalformedURLException e) {
 157.359 +                logger.warning("Failed to create URL for the websynergy json service ");
 157.360 +                logger.warning(e.getMessage());
 157.361 +                return new String[0];
 157.362 +            }
 157.363 +
 157.364 +            String jsonString = LiferayHelper.getContentFromHttpURL(url);
 157.365 +            if (jsonString == null) {
 157.366 +                return new String[0];
 157.367 +            }
 157.368 +            JSONArray jsonArray = new JSONArray(jsonString);
 157.369 +            List<String> themes = new ArrayList();
 157.370 +            for (int i = 0; i < jsonArray.length(); i++) {
 157.371 +                JSONObject jsonObject = jsonArray.getJSONObject(i);
 157.372 +                String themeID = jsonObject.getString("theme_id");
 157.373 +                //String themeName = jsonObject.getString("theme_name");
 157.374 +                String appName = jsonObject.getString("servlet_context_name");
 157.375 +                themes.add(appName + "." + themeID);
 157.376 +            }
 157.377 +
 157.378 +            return (String[]) themes.toArray(new String[0]);
 157.379 +        } catch (JSONException ex) {
 157.380 +            logger.log(Level.SEVERE, "Error", ex);
 157.381 +            return new String[0];
 157.382 +        }
 157.383 +    }
 157.384  
 157.385      public String constructPortletViewURL(String dn, String portlet) {
 157.386  
 157.387 @@ -652,35 +802,13 @@
 157.388          }
 157.389          return "http://" + psconfig.getHost() + ":" + psconfig.getPort() + "/" + contextUri;
 157.390      }
 157.391 -
 157.392 -    public String getContentFromHttpURL(URL url) {
 157.393 -        BufferedReader br = null;
 157.394 -        try {
 157.395 -            // TODO code application logic here
 157.396 -            HttpURLConnection con = (HttpURLConnection) url.openConnection();
 157.397 -            con.setDoOutput(true);
 157.398 -            InputStream ins = con.getInputStream();
 157.399 -
 157.400 -            br = new BufferedReader(new InputStreamReader(ins));
 157.401 -            String content = "";
 157.402 -            String line = br.readLine();
 157.403 -            while (line != null) {
 157.404 -                content += line;
 157.405 -                line = br.readLine();
 157.406 -            }
 157.407 -
 157.408 -            return content;
 157.409 -        } catch (Exception e) {
 157.410 -            logger.log(Level.SEVERE, "Error", e);
 157.411 -            return null;
 157.412 -        } finally {
 157.413 -            if (br != null) {
 157.414 -                try {
 157.415 -                    br.close();
 157.416 -                } catch (IOException ex) {
 157.417 -                    //Exceptions.printStackTrace(ex);
 157.418 -                }
 157.419 -            }
 157.420 +    
 157.421 +    private int getLiferayBuildNumber() {
 157.422 +        try{
 157.423 +            return Integer.parseInt(
 157.424 +                    psconfig.getProperty(LiferayConstants.LR_VERSION));
 157.425 +        }catch(Exception e) {
 157.426 +            return 1;
 157.427          }
 157.428      }
 157.429  
 157.430 @@ -775,13 +903,9 @@
 157.431      public void showServerLog() {
 157.432          
 157.433          try {
 157.434 +			dm.showServerLog(false);
 157.435              
 157.436 -            File f = new File(psconfig.getDomainDir() + File.separator + "logs"
 157.437 -                              + File.separator + "server.log");
 157.438 -            FileLogViewerSupport p = FileLogViewerSupport.getLogViewerSupport(f, dm.getUri(), 2000, true);
 157.439 -            p.showLogViewer(false);
 157.440 -            
 157.441 -        } catch (IOException ex) {
 157.442 +        } catch (Exception ex) {
 157.443              //Exceptions.printStackTrace(ex);
 157.444          }
 157.445      }
   158.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   158.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   158.3 @@ -0,0 +1,1 @@
   158.4 +LBL_WaitNode_DisplayName=Loading ...
   158.5 \ No newline at end of file
   159.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   159.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/HookChildrenNode.java	Sun Jun 26 10:25:14 2011 +0800
   159.3 @@ -0,0 +1,134 @@
   159.4 +/*
   159.5 +  * The contents of this file are subject to the terms of the Common Development
   159.6 +  * and Distribution License (the License). You may not use this file except in
   159.7 +  * compliance with the License.
   159.8 +  *
   159.9 +  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  159.10 +  * or http://www.netbeans.org/cddl.txt.
  159.11 +  *
  159.12 +  * When distributing Covered Code, include this CDDL Header Notice in each file
  159.13 +  * and include the License file at http://www.netbeans.org/cddl.txt.
  159.14 +  * If applicable, add the following below the CDDL Header, with the fields
  159.15 +  * enclosed by brackets [] replaced by your own identifying information:
  159.16 +  * "Portions Copyrighted [year] [name of copyright owner]"
  159.17 +  *
  159.18 +  * The Original Software is NetBeans. The Initial Developer of the Original
  159.19 +  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  159.20 +  * Microsystems, Inc. All Rights Reserved.
  159.21 +  */
  159.22 +
  159.23 +package org.netbeans.modules.portalpack.servers.websynergy.nodes;
  159.24 +
  159.25 +import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  159.26 +import org.netbeans.modules.portalpack.servers.core.api.PSTaskHandler;
  159.27 +import org.netbeans.modules.portalpack.servers.core.util.NetbeanConstants;
  159.28 +import java.util.HashMap;
  159.29 +import java.util.TreeSet;
  159.30 +import java.util.logging.Level;
  159.31 +import java.util.logging.Logger;
  159.32 +import org.netbeans.modules.portalpack.servers.websynergy.impl.LiferayTaskHandler;
  159.33 +import org.openide.nodes.AbstractNode;
  159.34 +import org.openide.nodes.Children;
  159.35 +import org.openide.nodes.Node;
  159.36 +import org.openide.util.NbBundle;
  159.37 +import org.openide.util.RequestProcessor;
  159.38 +
  159.39 +/**
  159.40 + * @author Satya
  159.41 + */
  159.42 +public class HookChildrenNode extends Children.Keys {
  159.43 +    
  159.44 +    private static Logger logger = Logger.getLogger(NetbeanConstants.PORTAL_LOGGER);
  159.45 +    private static final String WAIT_NODE = "wait_node"; //NOI18N
  159.46 +    private static String WAIT_ICON_BASE = "org/netbeans/modules/portalpack/servers/websynergy/resources/wait.gif";
  159.47 +    private String type;
  159.48 +    private java.util.Map nodeDataMap;
  159.49 +    private String baseDN;
  159.50 +    private PSDeploymentManager dm;
  159.51 +    
  159.52 +    
  159.53 +    HookChildrenNode(PSDeploymentManager dm, String type, String dn) {
  159.54 +        this.type = type;
  159.55 +        this.nodeDataMap = new HashMap();
  159.56 +        this.baseDN = dn;
  159.57 +        logger.log(Level.FINEST,"Setting base DN to ::: "+baseDN);
  159.58 +        this.dm = dm;
  159.59 +    }
  159.60 +    
  159.61 +    public void updateKeys(){
  159.62 +       TreeSet ts = new TreeSet();
  159.63 +       ts.add(WAIT_NODE);
  159.64 +       
  159.65 +       setKeys(ts); 
  159.66 +       
  159.67 +        RequestProcessor.getDefault().post(new Runnable() {
  159.68 +            public void run () {
  159.69 +              
  159.70 +                if(type.equals(LiferayNodeConstants.HOOK_NODE_TYPE))
  159.71 +                {
  159.72 +                    
  159.73 +                    PSTaskHandler handler = dm.getTaskHandler();
  159.74 +                    if(handler instanceof LiferayTaskHandler) {
  159.75 +                        String[] hooks = ((LiferayTaskHandler)handler).getHooks();
  159.76 +                        TreeSet list = new TreeSet();
  159.77 +                        for(int i=0;i<hooks.length;i++)
  159.78 +                        {
  159.79 +                            list.add(hooks[i]);
  159.80 +                        }
  159.81 +                        setKeys(list);
  159.82 +
  159.83 +                    }
  159.84 +                    
  159.85 +                }
  159.86 +       
  159.87 +            }
  159.88 +        }, 0);
  159.89 +       
  159.90 +    }
  159.91 +    
  159.92 +    protected void addNotify() {
  159.93 +        updateKeys();
  159.94 +    }
  159.95 +   
  159.96 +    protected void removeNotify() {
  159.97 +        setKeys(java.util.Collections.EMPTY_SET);
  159.98 +    }
  159.99 +        
 159.100 +    protected org.openide.nodes.Node[] createNodes(Object key) {
 159.101 +        if (key instanceof String){
 159.102 +            
 159.103 +            if (key.equals(WAIT_NODE))
 159.104 +                return new Node[]{createWaitNode ()};
 159.105 +            
 159.106 +                
 159.107 +            HookNode node = new HookNode(dm,(String) key,baseDN);
 159.108 +            return new Node[]{node};
 159.109 +        }
 159.110 +        return null;
 159.111 +    }
 159.112 +    
 159.113 +    /* Creates and returns the instance of the node
 159.114 +    * representing the status 'WAIT' of the node.
 159.115 +    * It is used when it spent more time to create elements hierarchy.
 159.116 +    * @return the wait node.
 159.117 +    */
 159.118 +    private Node createWaitNode () {
 159.119 +        AbstractNode n = new AbstractNode(Children.LEAF);
 159.120 +        n.setName(NbBundle.getMessage(HookChildrenNode.class, "LBL_WaitNode_DisplayName")); //NOI18N
 159.121 +        n.setIconBaseWithExtension(WAIT_ICON_BASE); // NOI18N
 159.122 +        return n;
 159.123 +    }
 159.124 +    
 159.125 +    
 159.126 +    class RefreshHookChildren implements Node.Cookie {
 159.127 +        HookChildrenNode children;
 159.128 +        RefreshHookChildren(HookChildrenNode children){
 159.129 +            this.children = children;
 159.130 +        }
 159.131 +
 159.132 +        public void refresh() {
 159.133 +            children.updateKeys();
 159.134 +        }
 159.135 +    }
 159.136 +
 159.137 +}
   160.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   160.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/HookHolderNode.java	Sun Jun 26 10:25:14 2011 +0800
   160.3 @@ -0,0 +1,57 @@
   160.4 +/*
   160.5 +  * The contents of this file are subject to the terms of the Common Development
   160.6 +  * and Distribution License (the License). You may not use this file except in
   160.7 +  * compliance with the License.
   160.8 +  *
   160.9 +  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  160.10 +  * or http://www.netbeans.org/cddl.txt.
  160.11 +  *
  160.12 +  * When distributing Covered Code, include this CDDL Header Notice in each file
  160.13 +  * and include the License file at http://www.netbeans.org/cddl.txt.
  160.14 +  * If applicable, add the following below the CDDL Header, with the fields
  160.15 +  * enclosed by brackets [] replaced by your own identifying information:
  160.16 +  * "Portions Copyrighted [year] [name of copyright owner]"
  160.17 +  *
  160.18 +  * The Original Software is NetBeans. The Initial Developer of the Original
  160.19 +  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  160.20 +  * Microsystems, Inc. All Rights Reserved.
  160.21 +  */
  160.22 +
  160.23 +package org.netbeans.modules.portalpack.servers.websynergy.nodes;
  160.24 +
  160.25 +import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  160.26 +import org.netbeans.modules.portalpack.servers.core.nodes.actions.RefreshPortletsAction;
  160.27 +import org.netbeans.modules.portalpack.servers.core.nodes.actions.RefreshCookie;
  160.28 +import org.openide.nodes.AbstractNode;
  160.29 +import org.openide.util.Lookup;
  160.30 +import org.openide.util.actions.SystemAction;
  160.31 +
  160.32 +    
  160.33 +    
  160.34 + public class HookHolderNode extends AbstractNode {
  160.35 +        
  160.36 +        private static String ICON_BASE = "org/netbeans/modules/portalpack/servers/websynergy/resources/mfolder.gif";  
  160.37 +        public HookHolderNode (PSDeploymentManager dm,String dn){
  160.38 +            super(new HookChildrenNode(dm,LiferayNodeConstants.HOOK_NODE_TYPE,dn));
  160.39 +            setDisplayName("Hooks");  // NOI18N            
  160.40 +            setIconBaseWithExtension(ICON_BASE);        
  160.41 +            setShortDescription(getShortDescription());
  160.42 +            getCookieSet().add(new RefreshHookChildren ((HookChildrenNode)getChildren()));
  160.43 +        }
  160.44 +        
  160.45 +        public javax.swing.Action[] getActions(boolean context) {
  160.46 +            return new SystemAction[] {
  160.47 +                   SystemAction.get(RefreshPortletsAction.class)
  160.48 +               };    
  160.49 +        }
  160.50 +    }
  160.51 +    class RefreshHookChildren implements RefreshCookie {
  160.52 +        HookChildrenNode children;
  160.53 +        RefreshHookChildren (HookChildrenNode children){
  160.54 +            this.children = children;
  160.55 +        }
  160.56 +
  160.57 +        public void refresh() {
  160.58 +            children.updateKeys();
  160.59 +        }
  160.60 +    }
   161.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   161.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/HookNode.java	Sun Jun 26 10:25:14 2011 +0800
   161.3 @@ -0,0 +1,93 @@
   161.4 +/*
   161.5 +  * The contents of this file are subject to the terms of the Common Development
   161.6 +  * and Distribution License (the License). You may not use this file except in
   161.7 +  * compliance with the License.
   161.8 +  *
   161.9 +  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  161.10 +  * or http://www.netbeans.org/cddl.txt.
  161.11 +  *
  161.12 +  * When distributing Covered Code, include this CDDL Header Notice in each file
  161.13 +  * and include the License file at http://www.netbeans.org/cddl.txt.
  161.14 +  * If applicable, add the following below the CDDL Header, with the fields
  161.15 +  * enclosed by brackets [] replaced by your own identifying information:
  161.16 +  * "Portions Copyrighted [year] [name of copyright owner]"
  161.17 +  *
  161.18 +  * The Original Software is NetBeans. The Initial Developer of the Original
  161.19 +  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  161.20 +  * Microsystems, Inc. All Rights Reserved.
  161.21 +  */
  161.22 +
  161.23 +package org.netbeans.modules.portalpack.servers.websynergy.nodes;
  161.24 +
  161.25 +import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  161.26 +import org.netbeans.modules.portalpack.servers.core.common.enterprise.NodeTypeConstants;
  161.27 +import org.netbeans.modules.portalpack.servers.core.nodes.BaseNode;
  161.28 +
  161.29 +import org.netbeans.modules.portalpack.servers.websynergy.nodes.actions.UndeployAction;
  161.30 +import org.openide.nodes.Children;
  161.31 +import org.openide.nodes.Node;
  161.32 +import org.openide.util.actions.SystemAction;
  161.33 +
  161.34 +/**
  161.35 + * @author Satya
  161.36 + */
  161.37 +public class HookNode extends BaseNode implements Node.Cookie {
  161.38 +    
  161.39 +    private static String ICON_BASE = "org/netbeans/modules/portalpack/servers/websynergy/resources/hook.png"; // NOI18N
  161.40 +    private String key = "";
  161.41 +    private String dn;
  161.42 +    private PSDeploymentManager dm;
  161.43 +    
  161.44 +    
  161.45 +    public HookNode(PSDeploymentManager dm,String key,String dn) {
  161.46 +        
  161.47 +        super(Children.LEAF);
  161.48 +        this.key = key;
  161.49 +        this.dn = dn;
  161.50 +        this.dm = dm;
  161.51 +        
  161.52 +        getCookieSet().add(this);
  161.53 +        setIconBaseWithExtension(ICON_BASE);
  161.54 +        setDisplayName(key);
  161.55 +        setShortDescription(getShortDescription()); 
  161.56 +        setName(key);
  161.57 +    }
  161.58 +    
  161.59 +    public PSDeploymentManager getDeploymentManager()
  161.60 +    {
  161.61 +        return dm;
  161.62 +    }
  161.63 +        
  161.64 +    public String getDN()
  161.65 +    {
  161.66 +        return dn;
  161.67 +    }
  161.68 +    public String getShortDescription() {
  161.69 +        return key; // NOI18N
  161.70 +    }
  161.71 +    
  161.72 +    public javax.swing.Action[] getActions(boolean context) {
  161.73 +        
  161.74 +       javax.swing.Action[]  newActions = new javax.swing.Action[2] ;
  161.75 +       newActions[0]=(null);        
  161.76 +       newActions[1]= (SystemAction.get(UndeployAction.class));
  161.77 +       return newActions;      
  161.78 +        
  161.79 +    }
  161.80 +    
  161.81 +    public boolean hasCustomizer() {
  161.82 +        return true;
  161.83 +    }
  161.84 +
  161.85 +    public String getKey() {
  161.86 +        return key;
  161.87 +    }
  161.88 +
  161.89 +    public String getDn() {
  161.90 +        return dn;
  161.91 +    }
  161.92 +
  161.93 +    public String getType() {
  161.94 +        return LiferayNodeConstants.HOOK_NODE_TYPE;
  161.95 +    }    
  161.96 +}
   162.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   162.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/LiferayNodeConstants.java	Sun Jun 26 10:25:14 2011 +0800
   162.3 @@ -0,0 +1,51 @@
   162.4 +/*
   162.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   162.6 + * 
   162.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   162.8 + * 
   162.9 + * The contents of this file are subject to the terms of either the GNU
  162.10 + * General Public License Version 2 only ("GPL") or the Common
  162.11 + * Development and Distribution License("CDDL") (collectively, the
  162.12 + * "License"). You may not use this file except in compliance with the
  162.13 + * License. You can obtain a copy of the License at
  162.14 + * http://www.netbeans.org/cddl-gplv2.html
  162.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  162.16 + * specific language governing permissions and limitations under the
  162.17 + * License.  When distributing the software, include this License Header
  162.18 + * Notice in each file and include the License file at
  162.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  162.20 + * particular file as subject to the "Classpath" exception as provided
  162.21 + * by Sun in the GPL Version 2 section of the License file that
  162.22 + * accompanied this code. If applicable, add the following below the
  162.23 + * License Header, with the fields enclosed by brackets [] replaced by
  162.24 + * your own identifying information:
  162.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  162.26 + * 
  162.27 + * If you wish your version of this file to be governed by only the CDDL
  162.28 + * or only the GPL Version 2, indicate your decision by adding
  162.29 + * "[Contributor] elects to include this software in this distribution
  162.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  162.31 + * single choice of license, a recipient has the option to distribute
  162.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  162.33 + * to extend the choice of license to its licensees as provided above.
  162.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  162.35 + * Version 2 license, then the option applies only if the new code is
  162.36 + * made subject to such option by the copyright holder.
  162.37 + * 
  162.38 + * Contributor(s):
  162.39 + * 
  162.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  162.41 + */
  162.42 +
  162.43 +package org.netbeans.modules.portalpack.servers.websynergy.nodes;
  162.44 +
  162.45 +/**
  162.46 + *
  162.47 + * @author satyaranjan
  162.48 + */
  162.49 +public class LiferayNodeConstants {
  162.50 +    
  162.51 +    public static final String HOOK_NODE_TYPE = "Hook Node Type";
  162.52 +    public static final String THEME_NODE_TYPE = "Theme Node Type";
  162.53 +
  162.54 +}
   163.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   163.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/ThemeChildrenNode.java	Sun Jun 26 10:25:14 2011 +0800
   163.3 @@ -0,0 +1,154 @@
   163.4 +/*
   163.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   163.6 + *
   163.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   163.8 + *
   163.9 + * The contents of this file are subject to the terms of either the GNU
  163.10 + * General Public License Version 2 only ("GPL") or the Common
  163.11 + * Development and Distribution License("CDDL") (collectively, the
  163.12 + * "License"). You may not use this file except in compliance with the
  163.13 + * License. You can obtain a copy of the License at
  163.14 + * http://www.netbeans.org/cddl-gplv2.html
  163.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  163.16 + * specific language governing permissions and limitations under the
  163.17 + * License.  When distributing the software, include this License Header
  163.18 + * Notice in each file and include the License file at
  163.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  163.20 + * particular file as subject to the "Classpath" exception as provided
  163.21 + * by Sun in the GPL Version 2 section of the License file that
  163.22 + * accompanied this code. If applicable, add the following below the
  163.23 + * License Header, with the fields enclosed by brackets [] replaced by
  163.24 + * your own identifying information:
  163.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  163.26 + *
  163.27 + * If you wish your version of this file to be governed by only the CDDL
  163.28 + * or only the GPL Version 2, indicate your decision by adding
  163.29 + * "[Contributor] elects to include this software in this distribution
  163.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  163.31 + * single choice of license, a recipient has the option to distribute
  163.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  163.33 + * to extend the choice of license to its licensees as provided above.
  163.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  163.35 + * Version 2 license, then the option applies only if the new code is
  163.36 + * made subject to such option by the copyright holder.
  163.37 + *
  163.38 + * Contributor(s):
  163.39 + *
  163.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  163.41 + */
  163.42 +package org.netbeans.modules.portalpack.servers.websynergy.nodes;
  163.43 +
  163.44 +import java.util.HashMap;
  163.45 +import java.util.TreeSet;
  163.46 +import java.util.logging.Level;
  163.47 +import java.util.logging.Logger;
  163.48 +import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  163.49 +import org.netbeans.modules.portalpack.servers.core.api.PSTaskHandler;
  163.50 +import org.netbeans.modules.portalpack.servers.core.util.NetbeanConstants;
  163.51 +import org.netbeans.modules.portalpack.servers.websynergy.impl.LiferayTaskHandler;
  163.52 +import org.openide.nodes.AbstractNode;
  163.53 +import org.openide.nodes.Children;
  163.54 +import org.openide.nodes.Node;
  163.55 +import org.openide.util.NbBundle;
  163.56 +import org.openide.util.RequestProcessor;
  163.57 +
  163.58 +/**
  163.59 + *
  163.60 + * @author Santh Chetan Chadalavada
  163.61 + */
  163.62 +class ThemeChildrenNode extends Children.Keys {
  163.63 +
  163.64 +    private static Logger logger = Logger.getLogger(NetbeanConstants.PORTAL_LOGGER);
  163.65 +    private static final String WAIT_NODE = "wait_node"; //NOI18N
  163.66 +    private static String WAIT_ICON_BASE = "org/netbeans/modules/portalpack/servers/websynergy/resources/wait.gif";
  163.67 +    private String type;
  163.68 +    private String baseDN;
  163.69 +    private PSDeploymentManager dm;
  163.70 +
  163.71 +    public ThemeChildrenNode(PSDeploymentManager dm, String type, String dn) {
  163.72 +        this.type = type;
  163.73 +        this.baseDN = dn;
  163.74 +        logger.log(Level.FINEST, "Setting base DN to ::: " + baseDN);
  163.75 +        this.dm = dm;
  163.76 +    }
  163.77 +
  163.78 +    public void updateKeys() {
  163.79 +        TreeSet ts = new TreeSet();
  163.80 +        ts.add(WAIT_NODE);
  163.81 +
  163.82 +        setKeys(ts);
  163.83 +
  163.84 +        RequestProcessor.getDefault().post(new Runnable() {
  163.85 +
  163.86 +            public void run() {
  163.87 +
  163.88 +                if (type.equals(LiferayNodeConstants.THEME_NODE_TYPE)) {
  163.89 +
  163.90 +                    PSTaskHandler handler = dm.getTaskHandler();
  163.91 +                    if (handler instanceof LiferayTaskHandler) {
  163.92 +                        String[] themes = ((LiferayTaskHandler) handler).getThemes();
  163.93 +                        TreeSet list = new TreeSet();
  163.94 +                        for (int i = 0; i < themes.length; i++) {
  163.95 +                            list.add(themes[i]);
  163.96 +                        }
  163.97 +                        setKeys(list);
  163.98 +
  163.99 +                    }
 163.100 +
 163.101 +                }
 163.102 +
 163.103 +            }
 163.104 +        }, 0);
 163.105 +
 163.106 +    }
 163.107 +
 163.108 +    @Override
 163.109 +    protected void addNotify() {
 163.110 +        updateKeys();
 163.111 +    }
 163.112 +
 163.113 +    @Override
 163.114 +    protected void removeNotify() {
 163.115 +        setKeys(java.util.Collections.EMPTY_SET);
 163.116 +    }
 163.117 +
 163.118 +    @Override
 163.119 +    protected org.openide.nodes.Node[] createNodes(Object key) {
 163.120 +        if (key instanceof String) {
 163.121 +
 163.122 +            if (key.equals(WAIT_NODE)) {
 163.123 +                return new Node[]{createWaitNode()};
 163.124 +            }
 163.125 +
 163.126 +
 163.127 +            ThemeNode node = new ThemeNode(dm, (String) key, baseDN);
 163.128 +            return new Node[]{node};
 163.129 +        }
 163.130 +        return null;
 163.131 +    }
 163.132 +
 163.133 +    /* Creates and returns the instance of the node
 163.134 +     * representing the status 'WAIT' of the node.
 163.135 +     * It is used when it spent more time to create elements hierarchy.
 163.136 +     * @return the wait node.
 163.137 +     */
 163.138 +    private Node createWaitNode() {
 163.139 +        AbstractNode n = new AbstractNode(Children.LEAF);
 163.140 +        n.setName(NbBundle.getMessage(ThemeChildrenNode.class, "LBL_WaitNode_DisplayName")); //NOI18N
 163.141 +        n.setIconBaseWithExtension(WAIT_ICON_BASE); // NOI18N
 163.142 +        return n;
 163.143 +    }
 163.144 +
 163.145 +    class RefreshThemeChildren implements Node.Cookie {
 163.146 +
 163.147 +        ThemeChildrenNode children;
 163.148 +
 163.149 +        RefreshThemeChildren(ThemeChildrenNode children) {
 163.150 +            this.children = children;
 163.151 +        }
 163.152 +
 163.153 +        public void refresh() {
 163.154 +            children.updateKeys();
 163.155 +        }
 163.156 +    }
 163.157 +}
   164.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   164.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/ThemeHolderNode.java	Sun Jun 26 10:25:14 2011 +0800
   164.3 @@ -0,0 +1,78 @@
   164.4 +/*
   164.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   164.6 + *
   164.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   164.8 + *
   164.9 + * The contents of this file are subject to the terms of either the GNU
  164.10 + * General Public License Version 2 only ("GPL") or the Common
  164.11 + * Development and Distribution License("CDDL") (collectively, the
  164.12 + * "License"). You may not use this file except in compliance with the
  164.13 + * License. You can obtain a copy of the License at
  164.14 + * http://www.netbeans.org/cddl-gplv2.html
  164.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  164.16 + * specific language governing permissions and limitations under the
  164.17 + * License.  When distributing the software, include this License Header
  164.18 + * Notice in each file and include the License file at
  164.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  164.20 + * particular file as subject to the "Classpath" exception as provided
  164.21 + * by Sun in the GPL Version 2 section of the License file that
  164.22 + * accompanied this code. If applicable, add the following below the
  164.23 + * License Header, with the fields enclosed by brackets [] replaced by
  164.24 + * your own identifying information:
  164.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  164.26 + *
  164.27 + * If you wish your version of this file to be governed by only the CDDL
  164.28 + * or only the GPL Version 2, indicate your decision by adding
  164.29 + * "[Contributor] elects to include this software in this distribution
  164.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  164.31 + * single choice of license, a recipient has the option to distribute
  164.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  164.33 + * to extend the choice of license to its licensees as provided above.
  164.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  164.35 + * Version 2 license, then the option applies only if the new code is
  164.36 + * made subject to such option by the copyright holder.
  164.37 + *
  164.38 + * Contributor(s):
  164.39 + *
  164.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  164.41 + */
  164.42 +
  164.43 +package org.netbeans.modules.portalpack.servers.websynergy.nodes;
  164.44 +
  164.45 +import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  164.46 +import org.netbeans.modules.portalpack.servers.core.nodes.actions.RefreshCookie;
  164.47 +import org.netbeans.modules.portalpack.servers.core.nodes.actions.RefreshPortletsAction;
  164.48 +import org.openide.nodes.AbstractNode;
  164.49 +import org.openide.util.actions.SystemAction;
  164.50 +
  164.51 +/**
  164.52 + *
  164.53 + * @author Santh Chetan Chadalavada
  164.54 + */
  164.55 +public class ThemeHolderNode extends AbstractNode {
  164.56 +
  164.57 +    private static String ICON_BASE = "org/netbeans/modules/portalpack/servers/websynergy/resources/mfolder.gif";
  164.58 +        public ThemeHolderNode (PSDeploymentManager dm,String dn){
  164.59 +            super(new ThemeChildrenNode(dm,LiferayNodeConstants.THEME_NODE_TYPE,dn));
  164.60 +            setDisplayName("Themes");  // NOI18N
  164.61 +            setIconBaseWithExtension(ICON_BASE);
  164.62 +            setShortDescription(getShortDescription());
  164.63 +            getCookieSet().add(new RefreshThemeChildren ((ThemeChildrenNode)getChildren()));
  164.64 +        }
  164.65 +        public javax.swing.Action[] getActions(boolean context) {
  164.66 +            return new SystemAction[] {
  164.67 +                   SystemAction.get(RefreshPortletsAction.class)
  164.68 +               };
  164.69 +        }
  164.70 +}
  164.71 +
  164.72 +class RefreshThemeChildren implements RefreshCookie {
  164.73 +        ThemeChildrenNode children;
  164.74 +        RefreshThemeChildren (ThemeChildrenNode children){
  164.75 +            this.children = children;
  164.76 +        }
  164.77 +
  164.78 +        public void refresh() {
  164.79 +            children.updateKeys();
  164.80 +        }
  164.81 +    }
   165.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   165.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/ThemeNode.java	Sun Jun 26 10:25:14 2011 +0800
   165.3 @@ -0,0 +1,112 @@
   165.4 +/*
   165.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   165.6 + *
   165.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   165.8 + *
   165.9 + * The contents of this file are subject to the terms of either the GNU
  165.10 + * General Public License Version 2 only ("GPL") or the Common
  165.11 + * Development and Distribution License("CDDL") (collectively, the
  165.12 + * "License"). You may not use this file except in compliance with the
  165.13 + * License. You can obtain a copy of the License at
  165.14 + * http://www.netbeans.org/cddl-gplv2.html
  165.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  165.16 + * specific language governing permissions and limitations under the
  165.17 + * License.  When distributing the software, include this License Header
  165.18 + * Notice in each file and include the License file at
  165.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  165.20 + * particular file as subject to the "Classpath" exception as provided
  165.21 + * by Sun in the GPL Version 2 section of the License file that
  165.22 + * accompanied this code. If applicable, add the following below the
  165.23 + * License Header, with the fields enclosed by brackets [] replaced by
  165.24 + * your own identifying information:
  165.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  165.26 + *
  165.27 + * If you wish your version of this file to be governed by only the CDDL
  165.28 + * or only the GPL Version 2, indicate your decision by adding
  165.29 + * "[Contributor] elects to include this software in this distribution
  165.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  165.31 + * single choice of license, a recipient has the option to distribute
  165.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  165.33 + * to extend the choice of license to its licensees as provided above.
  165.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  165.35 + * Version 2 license, then the option applies only if the new code is
  165.36 + * made subject to such option by the copyright holder.
  165.37 + *
  165.38 + * Contributor(s):
  165.39 + *
  165.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  165.41 + */
  165.42 +
  165.43 +package org.netbeans.modules.portalpack.servers.websynergy.nodes;
  165.44 +
  165.45 +import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  165.46 +import org.netbeans.modules.portalpack.servers.core.nodes.BaseNode;
  165.47 +import org.netbeans.modules.portalpack.servers.websynergy.nodes.actions.UndeployAction;
  165.48 +import org.openide.nodes.Children;
  165.49 +import org.openide.nodes.Node;
  165.50 +import org.openide.util.actions.SystemAction;
  165.51 +/**
  165.52 + *
  165.53 + * @author Santh Chetan Chadalavada
  165.54 + */
  165.55 +public class ThemeNode extends BaseNode implements Node.Cookie {
  165.56 +
  165.57 +    private static String ICON_BASE = "org/netbeans/modules/portalpack/servers/websynergy/resources/theme.png"; // NOI18N
  165.58 +    private String key = "";
  165.59 +    private String dn;
  165.60 +    private PSDeploymentManager dm;
  165.61 +    
  165.62 +    
  165.63 +    public ThemeNode(PSDeploymentManager dm,String key,String dn) {
  165.64 +        
  165.65 +        super(Children.LEAF);
  165.66 +        this.key = key;
  165.67 +        this.dn = dn;
  165.68 +        this.dm = dm;
  165.69 +        
  165.70 +        getCookieSet().add(this);
  165.71 +        setIconBaseWithExtension(ICON_BASE);
  165.72 +        setDisplayName(key);
  165.73 +        setShortDescription(getShortDescription()); 
  165.74 +        setName(key);
  165.75 +    }
  165.76 +
  165.77 +    public PSDeploymentManager getDeploymentManager()
  165.78 +    {
  165.79 +        return dm;
  165.80 +    }
  165.81 +
  165.82 +    public String getDN()
  165.83 +    {
  165.84 +        return dn;
  165.85 +    }
  165.86 +    public String getShortDescription() {
  165.87 +        return key; // NOI18N
  165.88 +    }
  165.89 +
  165.90 +    public javax.swing.Action[] getActions(boolean context) {
  165.91 +
  165.92 +       javax.swing.Action[]  newActions = new javax.swing.Action[2] ;
  165.93 +       newActions[0]=(null);
  165.94 +       newActions[1]= (SystemAction.get(UndeployAction.class));
  165.95 +       return newActions;
  165.96 +
  165.97 +    }
  165.98 +
  165.99 +    public boolean hasCustomizer() {
 165.100 +        return true;
 165.101 +    }
 165.102 +
 165.103 +    public String getKey() {
 165.104 +        return key;
 165.105 +    }
 165.106 +
 165.107 +    public String getDn() {
 165.108 +        return dn;
 165.109 +    }
 165.110 +
 165.111 +    public String getType() {
 165.112 +        return LiferayNodeConstants.THEME_NODE_TYPE;
 165.113 +    }
 165.114 +
 165.115 +}
   166.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   166.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/actions/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   166.3 @@ -0,0 +1,41 @@
   166.4 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   166.5 +# 
   166.6 +# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   166.7 +# 
   166.8 +# The contents of this file are subject to the terms of either the GNU
   166.9 +# General Public License Version 2 only ("GPL") or the Common
  166.10 +# Development and Distribution License("CDDL") (collectively, the
  166.11 +# "License"). You may not use this file except in compliance with the
  166.12 +# License. You can obtain a copy of the License at
  166.13 +# http://www.netbeans.org/cddl-gplv2.html
  166.14 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  166.15 +# specific language governing permissions and limitations under the
  166.16 +# License.  When distributing the software, include this License Header
  166.17 +# Notice in each file and include the License file at
  166.18 +# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  166.19 +# particular file as subject to the "Classpath" exception as provided
  166.20 +# by Sun in the GPL Version 2 section of the License file that
  166.21 +# accompanied this code. If applicable, add the following below the
  166.22 +# License Header, with the fields enclosed by brackets [] replaced by
  166.23 +# your own identifying information:
  166.24 +# "Portions Copyrighted [year] [name of copyright owner]"
  166.25 +# 
  166.26 +# If you wish your version of this file to be governed by only the CDDL
  166.27 +# or only the GPL Version 2, indicate your decision by adding
  166.28 +# "[Contributor] elects to include this software in this distribution
  166.29 +# under the [CDDL or GPL Version 2] license." If you do not indicate a
  166.30 +# single choice of license, a recipient has the option to distribute
  166.31 +# your version of this file under either the CDDL, the GPL Version 2 or
  166.32 +# to extend the choice of license to its licensees as provided above.
  166.33 +# However, if you add GPL Version 2 code and therefore, elected the GPL
  166.34 +# Version 2 license, then the option applies only if the new code is
  166.35 +# made subject to such option by the copyright holder.
  166.36 +# 
  166.37 +# Contributor(s):
  166.38 +# 
  166.39 +# Portions Copyrighted 2009 Sun Microsystems, Inc.
  166.40 +
  166.41 +ACT_UNDEPLOY=Undeploy
  166.42 +MSG_UNDEPLOYED_SUCCESSFULLY=Undeployed Successfully.
  166.43 +MSG_UNDEPLOY=Undeploy
  166.44 +MSG_START_UNDEPLOYMENT=Undeployment Started for 
  166.45 \ No newline at end of file
   167.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   167.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/nodes/actions/UndeployAction.java	Sun Jun 26 10:25:14 2011 +0800
   167.3 @@ -0,0 +1,170 @@
   167.4 +/*
   167.5 +  * The contents of this file are subject to the terms of the Common Development
   167.6 +  * and Distribution License (the License). You may not use this file except in
   167.7 +  * compliance with the License.
   167.8 +  *
   167.9 +  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  167.10 +  * or http://www.netbeans.org/cddl.txt.
  167.11 +  *
  167.12 +  * When distributing Covered Code, include this CDDL Header Notice in each file
  167.13 +  * and include the License file at http://www.netbeans.org/cddl.txt.
  167.14 +  * If applicable, add the following below the CDDL Header, with the fields
  167.15 +  * enclosed by brackets [] replaced by your own identifying information:
  167.16 +  * "Portions Copyrighted [year] [name of copyright owner]"
  167.17 +  *
  167.18 +  * The Original Software is NetBeans. The Initial Developer of the Original
  167.19 +  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  167.20 +  * Microsystems, Inc. All Rights Reserved.
  167.21 +  */
  167.22 +
  167.23 +package org.netbeans.modules.portalpack.servers.websynergy.nodes.actions;
  167.24 +
  167.25 +import org.netbeans.modules.portalpack.servers.core.nodes.actions.ActionUtil;
  167.26 +
  167.27 +import org.netbeans.modules.portalpack.servers.websynergy.nodes.HookNode;
  167.28 +import org.netbeans.modules.portalpack.servers.core.api.PSDeploymentManager;
  167.29 +import org.netbeans.modules.portalpack.servers.core.util.NetbeanConstants;
  167.30 +import java.util.logging.Level;
  167.31 +import java.util.logging.Logger;
  167.32 +import javax.enterprise.deploy.shared.CommandType;
  167.33 +import javax.enterprise.deploy.shared.StateType;
  167.34 +import javax.enterprise.deploy.spi.status.DeploymentStatus;
  167.35 +import javax.enterprise.deploy.spi.status.ProgressEvent;
  167.36 +import javax.enterprise.deploy.spi.status.ProgressListener;
  167.37 +import javax.enterprise.deploy.spi.status.ProgressObject;
  167.38 +import org.netbeans.api.progress.ProgressHandle;
  167.39 +import org.netbeans.api.progress.ProgressHandleFactory;
  167.40 +import org.netbeans.modules.portalpack.servers.core.nodes.BaseNode;
  167.41 +import org.netbeans.modules.portalpack.servers.websynergy.nodes.ThemeNode;
  167.42 +import org.openide.DialogDisplayer;
  167.43 +import org.openide.NotifyDescriptor;
  167.44 +import org.openide.awt.StatusDisplayer;
  167.45 +import org.openide.nodes.Node;
  167.46 +import org.openide.util.HelpCtx;
  167.47 +import org.openide.util.actions.CookieAction;
  167.48 +
  167.49 +/**
  167.50 + * @author Satya
  167.51 + */
  167.52 +public final class UndeployAction extends CookieAction {
  167.53 +    private static Logger logger = Logger.getLogger(NetbeanConstants.PORTAL_LOGGER);
  167.54 +    protected void performAction(Node[] nodes) {
  167.55 +        logger.log(Level.FINE,"Length: "+nodes.length);
  167.56 +        if( (nodes == null) || (nodes.length < 1) )
  167.57 +             return;
  167.58 +        for(int i=0;i<nodes.length;i++)
  167.59 +        {
  167.60 +            BaseNode cookie = null;
  167.61 +			String name = null;
  167.62 +            cookie = (HookNode)nodes[i].getCookie(HookNode.class);
  167.63 +            if (cookie == null)
  167.64 +            {
  167.65 +                cookie = (ThemeNode)nodes[i].getCookie(ThemeNode.class);
  167.66 +
  167.67 +				if(cookie == null)
  167.68 +					return;
  167.69 +
  167.70 +				name = cookie.getName();
  167.71 +				int index = name.lastIndexOf(".");
  167.72 +				if(index != -1)
  167.73 +				{
  167.74 +					name = name.substring(0,index);
  167.75 +				}
  167.76 +				
  167.77 +            } else {
  167.78 +				name = cookie.getName();
  167.79 +			}
  167.80 +            if (cookie == null)
  167.81 +                continue;
  167.82 +       
  167.83 +            PSDeploymentManager manager = cookie.getDeploymentManager();
  167.84 +            
  167.85 +            StatusDisplayer.getDefault().setStatusText(org.openide.util.NbBundle.getMessage(UndeployAction.class, "MSG_START_UNDEPLOYMENT")+name); 
  167.86 +            ProgressObject po = manager.undeploy(name,cookie.getDn());
  167.87 +            
  167.88 +            po.addProgressListener(new UnDeployManagerProgressListener(cookie,name));
  167.89 +                              
  167.90 +        }
  167.91 +    }
  167.92 +    
  167.93 +    protected int mode() {
  167.94 +        return CookieAction.MODE_EXACTLY_ONE;
  167.95 +    }
  167.96 +    
  167.97 +    public String getName() {
  167.98 +        return org.openide.util.NbBundle.getMessage(UndeployAction.class, "ACT_UNDEPLOY");
  167.99 +    }
 167.100 +    
 167.101 +    protected Class[] cookieClasses() {
 167.102 +        return new Class[] {};
 167.103 +    }
 167.104 +    
 167.105 +    protected void initialize() {
 167.106 +        super.initialize();
 167.107 +        putValue("noIconInMenu", Boolean.TRUE);
 167.108 +    }
 167.109 +    
 167.110 +    public HelpCtx getHelpCtx() {
 167.111 +        return HelpCtx.DEFAULT_HELP;
 167.112 +    }
 167.113 +    protected boolean enable(Node[] nodes) {
 167.114 +
 167.115 +        if (nodes == null)
 167.116 +            return false;
 167.117 +        if(nodes.length == 1)
 167.118 +            return true;
 167.119 +        else
 167.120 +            return false;
 167.121 +        
 167.122 +    }
 167.123 +    
 167.124 +    protected boolean asynchronous() {
 167.125 +        return true;
 167.126 +    }
 167.127 +    
 167.128 +    class UnDeployManagerProgressListener implements ProgressListener {
 167.129 +        
 167.130 +        private ProgressHandle handle;
 167.131 +        private Node node;
 167.132 +        public UnDeployManagerProgressListener(Node node,String name)
 167.133 +        {
 167.134 +            this.node = node;
 167.135 +            handle = ProgressHandleFactory.createHandle(org.openide.util.NbBundle.getMessage(UndeployAction.class, "MSG_UNDEPLOY")+name);
 167.136 +            handle.start();
 167.137 +        }
 167.138 +        public void handleProgressEvent(ProgressEvent progressEvent) {
 167.139 +            DeploymentStatus deployStatus = progressEvent.getDeploymentStatus();
 167.140 +            
 167.141 +            logger.log(Level.FINEST,"Status type is :****" + deployStatus.getState()+"   command: "+deployStatus.getCommand());
 167.142 +            
 167.143 +            logger.log(Level.FINEST,"constant value :****" + StateType.COMPLETED +"   command: "+CommandType.UNDEPLOY);
 167.144 +            
 167.145 +            if (deployStatus.getState() == StateType.COMPLETED) {
 167.146 +                CommandType command = deployStatus.getCommand();           
 167.147 +                
 167.148 +                logger.log(Level.FINEST,"Status is completed............" + command);
 167.149 +                handle.finish();
 167.150 +               
 167.151 +                                
 167.152 +                if (command.getValue() == CommandType.START.getValue() || command.getValue() == CommandType.STOP.getValue()) {
 167.153 +
 167.154 +                } else if (command.getValue() == CommandType.UNDEPLOY.getValue()) {
 167.155 +                         StatusDisplayer.getDefault().setStatusText(org.openide.util.NbBundle.getMessage(UndeployAction.class, "MSG_UNDEPLOYED_SUCCESSFULLY"));                
 167.156 +                
 167.157 +                }
 167.158 +            } else if (deployStatus.getState().equals(StateType.FAILED)) {
 167.159 +                handle.finish();
 167.160 +                NotifyDescriptor notDesc = new NotifyDescriptor.Message(
 167.161 +                        deployStatus.getMessage(), 
 167.162 +                        NotifyDescriptor.ERROR_MESSAGE);
 167.163 +                DialogDisplayer.getDefault().notify(notDesc);
 167.164 +                StatusDisplayer.getDefault().setStatusText(deployStatus.getMessage());                
 167.165 +            }
 167.166 +            
 167.167 +            if(node != null)
 167.168 +                ActionUtil.refresh(node);
 167.169 +        }
 167.170 +    }
 167.171 +    
 167.172 +}
 167.173 +
   168.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   168.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   168.3 @@ -1,6 +1,6 @@
   168.4  OpenIDE-Module-Display-Category=PortalPack
   168.5  OpenIDE-Module-Long-Description=\
   168.6 -    This plug-in can be used to deploy/undeploy portlets on the Project WebSynergy/Liferay Portal Server.
   168.7 -OpenIDE-Module-Name=WebSynergy Plugin
   168.8 -OpenIDE-Module-Short-Description=Plugin to develop and deploy portlets on WebSynergy.
   168.9 +    This plug-in can be used to deploy/undeploy portlets on the Sun Glassfish Web Space(Project WebSynergy)/Liferay Portal Server.
  168.10 +OpenIDE-Module-Name=WebSpace Server Plugin
  168.11 +OpenIDE-Module-Short-Description=Plugin to develop and deploy portlets on Sun Glassfish Web Space/Liferay Portal Server.
  168.12  Templates/asmFiles/phpPortlet=Liferay Php Portlet
   169.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   169.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_4_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   169.3 @@ -0,0 +1,45 @@
   169.4 +<!--
   169.5 +This is the DTD for the Display parameters for Liferay Portal.
   169.6 +
   169.7 +<!DOCTYPE display PUBLIC
   169.8 +	"-//Liferay//DTD Display 4.0.0//EN"
   169.9 +	"http://www.liferay.com/dtd/liferay-display_4_0_0.dtd">
  169.10 +-->
  169.11 +
  169.12 +<!--
  169.13 +The display element is the root of the deployment descriptor that describes how
  169.14 +portlets are categorized and displayed for users to choose when personalizing a
  169.15 +page in Liferay Portal.
  169.16 +-->
  169.17 +<!ELEMENT display (category*)>
  169.18 +
  169.19 +<!--
  169.20 +The category element organizes a set of portlets. A portlet can exist in more
  169.21 +than one category.
  169.22 +-->
  169.23 +<!ELEMENT category (category*, portlet*)>
  169.24 +
  169.25 +<!--
  169.26 +The name of a category is mapped to the portal's Language properties. If the
  169.27 +category name is "test", then the key in the portal's resource bundle will be
  169.28 +"category.test".
  169.29 +
  169.30 +See:
  169.31 +
  169.32 +http://www.liferay.com/page/guest/documentation/development/languages
  169.33 +-->
  169.34 +<!ATTLIST category
  169.35 +	name CDATA #REQUIRED
  169.36 +>
  169.37 +
  169.38 +<!--
  169.39 +The portlet element represents a portlet.
  169.40 +-->
  169.41 +<!ELEMENT portlet (#PCDATA)>
  169.42 +
  169.43 +<!--
  169.44 +The id must match the unique portlet-name specified in portlet.xml.
  169.45 +-->
  169.46 +<!ATTLIST portlet
  169.47 +	id CDATA #REQUIRED
  169.48 +>
  169.49 \ No newline at end of file
   170.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   170.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_5_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   170.3 @@ -0,0 +1,45 @@
   170.4 +<!--
   170.5 +This is the DTD for the Display parameters for Liferay Portal.
   170.6 +
   170.7 +<!DOCTYPE display PUBLIC
   170.8 +	"-//Liferay//DTD Display 5.0.0//EN"
   170.9 +	"http://www.liferay.com/dtd/liferay-display_5_0_0.dtd">
  170.10 +-->
  170.11 +
  170.12 +<!--
  170.13 +The display element is the root of the deployment descriptor that describes how
  170.14 +portlets are categorized and displayed for users to choose when personalizing a
  170.15 +page in Liferay Portal.
  170.16 +-->
  170.17 +<!ELEMENT display (category*)>
  170.18 +
  170.19 +<!--
  170.20 +The category element organizes a set of portlets. A portlet can exist in more
  170.21 +than one category.
  170.22 +-->
  170.23 +<!ELEMENT category (category*, portlet*)>
  170.24 +
  170.25 +<!--
  170.26 +The name of a category is mapped to the portal's Language properties. If the
  170.27 +category name is "test", then the key in the portal's resource bundle will be
  170.28 +"category.test".
  170.29 +
  170.30 +See:
  170.31 +
  170.32 +http://www.liferay.com/page/guest/documentation/development/languages
  170.33 +-->
  170.34 +<!ATTLIST category
  170.35 +	name CDATA #REQUIRED
  170.36 +>
  170.37 +
  170.38 +<!--
  170.39 +The portlet element represents a portlet.
  170.40 +-->
  170.41 +<!ELEMENT portlet (#PCDATA)>
  170.42 +
  170.43 +<!--
  170.44 +The id must match the unique portlet-name specified in portlet.xml.
  170.45 +-->
  170.46 +<!ATTLIST portlet
  170.47 +	id CDATA #REQUIRED
  170.48 +>
  170.49 \ No newline at end of file
   171.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   171.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_5_1_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   171.3 @@ -0,0 +1,45 @@
   171.4 +<!--
   171.5 +This is the DTD for the Display parameters for Liferay Portal.
   171.6 +
   171.7 +<!DOCTYPE display PUBLIC
   171.8 +	"-//Liferay//DTD Display 5.1.0//EN"
   171.9 +	"http://www.liferay.com/dtd/liferay-display_5_1_0.dtd">
  171.10 +-->
  171.11 +
  171.12 +<!--
  171.13 +The display element is the root of the deployment descriptor that describes how
  171.14 +portlets are categorized and displayed for users to choose when personalizing a
  171.15 +page in Liferay Portal.
  171.16 +-->
  171.17 +<!ELEMENT display (category*)>
  171.18 +
  171.19 +<!--
  171.20 +The category element organizes a set of portlets. A portlet can exist in more
  171.21 +than one category.
  171.22 +-->
  171.23 +<!ELEMENT category (category*, portlet*)>
  171.24 +
  171.25 +<!--
  171.26 +The name of a category is mapped to the portal's Language properties. If the
  171.27 +category name is "test", then the key in the portal's resource bundle will be
  171.28 +"category.test".
  171.29 +
  171.30 +See:
  171.31 +
  171.32 +http://www.liferay.com/page/guest/documentation/development/languages
  171.33 +-->
  171.34 +<!ATTLIST category
  171.35 +	name CDATA #REQUIRED
  171.36 +>
  171.37 +
  171.38 +<!--
  171.39 +The portlet element represents a portlet.
  171.40 +-->
  171.41 +<!ELEMENT portlet (#PCDATA)>
  171.42 +
  171.43 +<!--
  171.44 +The id must match the unique portlet-name specified in portlet.xml.
  171.45 +-->
  171.46 +<!ATTLIST portlet
  171.47 +	id CDATA #REQUIRED
  171.48 +>
  171.49 \ No newline at end of file
   172.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   172.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_5_2_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   172.3 @@ -0,0 +1,45 @@
   172.4 +<!--
   172.5 +This is the DTD for the Display parameters for Liferay Portal.
   172.6 +
   172.7 +<!DOCTYPE display PUBLIC
   172.8 +	"-//Liferay//DTD Display 5.2.0//EN"
   172.9 +	"http://www.liferay.com/dtd/liferay-display_5_2_0.dtd">
  172.10 +-->
  172.11 +
  172.12 +<!--
  172.13 +The display element is the root of the deployment descriptor that describes how
  172.14 +portlets are categorized and displayed for users to choose when personalizing a
  172.15 +page in Liferay Portal.
  172.16 +-->
  172.17 +<!ELEMENT display (category*)>
  172.18 +
  172.19 +<!--
  172.20 +The category element organizes a set of portlets. A portlet can exist in more
  172.21 +than one category.
  172.22 +-->
  172.23 +<!ELEMENT category (category*, portlet*)>
  172.24 +
  172.25 +<!--
  172.26 +The name of a category is mapped to the portal's Language properties. If the
  172.27 +category name is "test", then the key in the portal's resource bundle will be
  172.28 +"category.test".
  172.29 +
  172.30 +See:
  172.31 +
  172.32 +http://www.liferay.com/page/guest/documentation/development/languages
  172.33 +-->
  172.34 +<!ATTLIST category
  172.35 +	name CDATA #REQUIRED
  172.36 +>
  172.37 +
  172.38 +<!--
  172.39 +The portlet element represents a portlet.
  172.40 +-->
  172.41 +<!ELEMENT portlet (#PCDATA)>
  172.42 +
  172.43 +<!--
  172.44 +The id must match the unique portlet-name specified in portlet.xml.
  172.45 +-->
  172.46 +<!ATTLIST portlet
  172.47 +	id CDATA #REQUIRED
  172.48 +>
  172.49 \ No newline at end of file
   173.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   173.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-display_6_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   173.3 @@ -0,0 +1,45 @@
   173.4 +<!--
   173.5 +This is the DTD for the Display parameters for Liferay Portal.
   173.6 +
   173.7 +<!DOCTYPE display PUBLIC
   173.8 +	"-//Liferay//DTD Display 6.0.0//EN"
   173.9 +	"http://www.liferay.com/dtd/liferay-display_6_0_0.dtd">
  173.10 +-->
  173.11 +
  173.12 +<!--
  173.13 +The display element is the root of the deployment descriptor that describes how
  173.14 +portlets are categorized and displayed for users to choose when personalizing a
  173.15 +page in Liferay Portal.
  173.16 +-->
  173.17 +<!ELEMENT display (category*)>
  173.18 +
  173.19 +<!--
  173.20 +The category element organizes a set of portlets. A portlet can exist in more
  173.21 +than one category.
  173.22 +-->
  173.23 +<!ELEMENT category (category*, portlet*)>
  173.24 +
  173.25 +<!--
  173.26 +The name of a category is mapped to the portal's Language properties. If the
  173.27 +category name is "test", then the key in the portal's resource bundle will be
  173.28 +"category.test".
  173.29 +
  173.30 +See:
  173.31 +
  173.32 +http://www.liferay.com/page/guest/documentation/development/languages
  173.33 +-->
  173.34 +<!ATTLIST category
  173.35 +	name CDATA #REQUIRED
  173.36 +>
  173.37 +
  173.38 +<!--
  173.39 +The portlet element represents a portlet.
  173.40 +-->
  173.41 +<!ELEMENT portlet (#PCDATA)>
  173.42 +
  173.43 +<!--
  173.44 +The id must match the unique portlet-name specified in portlet.xml.
  173.45 +-->
  173.46 +<!ATTLIST portlet
  173.47 +	id CDATA #REQUIRED
  173.48 +>
  173.49 \ No newline at end of file
   174.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   174.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-hook_5_1_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   174.3 @@ -0,0 +1,53 @@
   174.4 +<!--
   174.5 +This is the DTD for the Hook parameters for Liferay Portal.
   174.6 +
   174.7 +<!DOCTYPE hook PUBLIC
   174.8 +	"-//Liferay//DTD Hook 5.1.0//EN"
   174.9 +	"http://www.liferay.com/dtd/liferay-hook_5_1_0.dtd">
  174.10 +-->
  174.11 +
  174.12 +<!ELEMENT hook (event*, model-listener*, portal-properties?, custom-jsp-dir?)>
  174.13 +
  174.14 +<!ELEMENT event (event-class, event-type)>
  174.15 +
  174.16 +<!ELEMENT event-class (#PCDATA)>
  174.17 +
  174.18 +<!ELEMENT event-type (#PCDATA)>
  174.19 +
  174.20 +<!ELEMENT model-listener (model-listener-class, model-name)>
  174.21 +
  174.22 +<!ELEMENT model-listener-class (#PCDATA)>
  174.23 +
  174.24 +<!ELEMENT model-name (#PCDATA)>
  174.25 +
  174.26 +<!--
  174.27 +Not all portal properties can be overridden via a hook. The supported properties
  174.28 +are:
  174.29 +
  174.30 +auth.forward.by.last.path
  174.31 +javascript.fast.load
  174.32 +layout.template.cache.enabled
  174.33 +layout.user.private.layouts.auto.create
  174.34 +layout.user.private.layouts.enabled
  174.35 +layout.user.private.layouts.modifiable
  174.36 +layout.user.public.layouts.auto.create
  174.37 +layout.user.public.layouts.enabled
  174.38 +layout.user.public.layouts.modifiable
  174.39 +my.places.show.community.private.sites.with.no.layouts
  174.40 +my.places.show.community.public.sites.with.no.layouts
  174.41 +my.places.show.organization.private.sites.with.no.layouts
  174.42 +my.places.show.organization.public.sites.with.no.layouts
  174.43 +my.places.show.user.private.sites.with.no.layouts
  174.44 +my.places.show.user.public.sites.with.no.layouts
  174.45 +terms.of.use.required
  174.46 +theme.css.fast.load
  174.47 +theme.images.fast.load
  174.48 +
  174.49 +passwords.passwordpolicytoolkit.generator
  174.50 +passwords.passwordpolicytoolkit.static
  174.51 +
  174.52 +layout.static.portlets.all
  174.53 +-->
  174.54 +<!ELEMENT portal-properties (#PCDATA)>
  174.55 +
  174.56 +<!ELEMENT custom-jsp-dir (#PCDATA)>
  174.57 \ No newline at end of file
   175.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   175.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-hook_5_2_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   175.3 @@ -0,0 +1,54 @@
   175.4 +<!--
   175.5 +This is the DTD for the Hook parameters for Liferay Portal.
   175.6 +
   175.7 +<!DOCTYPE hook PUBLIC
   175.8 +	"-//Liferay//DTD Hook 5.2.0//EN"
   175.9 +	"http://www.liferay.com/dtd/liferay-hook_5_2_0.dtd">
  175.10 +-->
  175.11 +
  175.12 +<!ELEMENT hook (portal-properties?, language-properties*, custom-jsp-dir?)>
  175.13 +
  175.14 +<!--
  175.15 +Not all portal properties can be overridden via a hook. The supported properties
  175.16 +are:
  175.17 +
  175.18 +auth.forward.by.last.path
  175.19 +javascript.fast.load
  175.20 +layout.template.cache.enabled
  175.21 +layout.user.private.layouts.auto.create
  175.22 +layout.user.private.layouts.enabled
  175.23 +layout.user.private.layouts.modifiable
  175.24 +layout.user.public.layouts.auto.create
  175.25 +layout.user.public.layouts.enabled
  175.26 +layout.user.public.layouts.modifiable
  175.27 +my.places.show.community.private.sites.with.no.layouts
  175.28 +my.places.show.community.public.sites.with.no.layouts
  175.29 +my.places.show.organization.private.sites.with.no.layouts
  175.30 +my.places.show.organization.public.sites.with.no.layouts
  175.31 +my.places.show.user.private.sites.with.no.layouts
  175.32 +my.places.show.user.public.sites.with.no.layouts
  175.33 +terms.of.use.required
  175.34 +theme.css.fast.load
  175.35 +theme.images.fast.load
  175.36 +
  175.37 +passwords.passwordpolicytoolkit.generator
  175.38 +passwords.passwordpolicytoolkit.static
  175.39 +
  175.40 +layout.static.portlets.all
  175.41 +
  175.42 +auto.login.hooks
  175.43 +
  175.44 +application.startup.events
  175.45 +
  175.46 +login.events.post
  175.47 +login.events.pre
  175.48 +logout.events.post
  175.49 +logout.events.pre
  175.50 +servlet.service.events.post
  175.51 +servlet.service.events.pre
  175.52 +-->
  175.53 +<!ELEMENT portal-properties (#PCDATA)>
  175.54 +
  175.55 +<!ELEMENT language-properties (#PCDATA)>
  175.56 +
  175.57 +<!ELEMENT custom-jsp-dir (#PCDATA)>
  175.58 \ No newline at end of file
   176.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   176.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-hook_6_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   176.3 @@ -0,0 +1,84 @@
   176.4 +<!--
   176.5 +This is the DTD for the Hook parameters for Liferay Portal.
   176.6 +
   176.7 +<!DOCTYPE hook PUBLIC
   176.8 +	"-//Liferay//DTD Hook 6.0.0//EN"
   176.9 +	"http://www.liferay.com/dtd/liferay-hook_6_0_0.dtd">
  176.10 +-->
  176.11 +
  176.12 +<!ELEMENT hook (portal-properties?, language-properties*, custom-jsp-dir?,
  176.13 +service*)>
  176.14 +
  176.15 +<!--
  176.16 +Not all portal properties can be overridden via a hook. The supported properties
  176.17 +are:
  176.18 +
  176.19 +auth.forward.by.last.path
  176.20 +auto.deploy.listeners
  176.21 +application.startup.events
  176.22 +auth.failure
  176.23 +auth.max.failures
  176.24 +auth.pipeline.post
  176.25 +auth.pipeline.pre
  176.26 +auto.login.hooks
  176.27 +captcha.check.portal.create_account
  176.28 +control.panel.entry.class.default
  176.29 +default.landing.page.path
  176.30 +dl.hook.impl
  176.31 +field.enable.com.liferay.portal.model.Contact.birthday
  176.32 +field.enable.com.liferay.portal.model.Contact.male
  176.33 +field.enable.com.liferay.portal.model.Organization.status
  176.34 +hot.deploy.listeners
  176.35 +image.hook.impl
  176.36 +javascript.fast.load
  176.37 +layout.static.portlets.all
  176.38 +layout.template.cache.enabled
  176.39 +layout.user.private.layouts.auto.create
  176.40 +layout.user.private.layouts.enabled
  176.41 +layout.user.private.layouts.modifiable
  176.42 +layout.user.public.layouts.auto.create
  176.43 +layout.user.public.layouts.enabled
  176.44 +layout.user.public.layouts.modifiable
  176.45 +ldap.attrs.transformer.impl
  176.46 +login.create.account.allow.custom.password
  176.47 +login.events.post
  176.48 +login.events.pre
  176.49 +logout.events.post
  176.50 +logout.events.pre
  176.51 +mail.hook.impl
  176.52 +my.places.show.community.private.sites.with.no.layouts
  176.53 +my.places.show.community.public.sites.with.no.layouts
  176.54 +my.places.show.organization.private.sites.with.no.layouts
  176.55 +my.places.show.organization.public.sites.with.no.layouts
  176.56 +my.places.show.user.private.sites.with.no.layouts
  176.57 +my.places.show.user.public.sites.with.no.layouts
  176.58 +passwords.passwordpolicytoolkit.generator
  176.59 +passwords.passwordpolicytoolkit.static
  176.60 +servlet.session.create.events
  176.61 +servlet.session.destroy.events
  176.62 +servlet.service.events.post
  176.63 +servlet.service.events.pre
  176.64 +session.phishing.protected.attributes
  176.65 +terms.of.use.required
  176.66 +theme.css.fast.load
  176.67 +theme.images.fast.load
  176.68 +upgrade.processes
  176.69 +users.email.address.generator
  176.70 +users.email.address.required
  176.71 +users.full.name.validator
  176.72 +users.screen.name.always.autogenerate
  176.73 +users.screen.name.generator
  176.74 +users.screen.name.validator
  176.75 +value.object.listener.*
  176.76 +-->
  176.77 +<!ELEMENT portal-properties (#PCDATA)>
  176.78 +
  176.79 +<!ELEMENT language-properties (#PCDATA)>
  176.80 +
  176.81 +<!ELEMENT custom-jsp-dir (#PCDATA)>
  176.82 +
  176.83 +<!ELEMENT service (service-type, service-impl)>
  176.84 +
  176.85 +<!ELEMENT service-type (#PCDATA)>
  176.86 +
  176.87 +<!ELEMENT service-impl (#PCDATA)>
  176.88 \ No newline at end of file
   177.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   177.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-layout-templates_6_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   177.3 @@ -0,0 +1,41 @@
   177.4 +<!--
   177.5 +This is the DTD for the Layout Templates parameters for Liferay Portal.
   177.6 +
   177.7 +<!DOCTYPE layout-templates PUBLIC
   177.8 +	"-//Liferay//DTD Layout Templates 6.0.0//EN"
   177.9 +	"http://www.liferay.com/dtd/liferay-layout-templates_6_0_0.dtd">
  177.10 +-->
  177.11 +
  177.12 +<!ELEMENT layout-templates (standard?, custom?)>
  177.13 +
  177.14 +<!ELEMENT standard (layout-template*)>
  177.15 +
  177.16 +<!ELEMENT layout-template (template-path, wap-template-path, thumbnail-path?,
  177.17 +roles?)>
  177.18 +
  177.19 +<!ATTLIST layout-template
  177.20 +	id CDATA #REQUIRED
  177.21 +	name CDATA #IMPLIED
  177.22 +>
  177.23 +
  177.24 +<!ELEMENT template-path (#PCDATA)>
  177.25 +
  177.26 +<!ELEMENT wap-template-path (#PCDATA)>
  177.27 +
  177.28 +<!ELEMENT thumbnail-path (#PCDATA)>
  177.29 +
  177.30 +<!ELEMENT screenshot-path (#PCDATA)>
  177.31 +
  177.32 +<!--
  177.33 +The roles element contains a list of role names. Users which have any of these
  177.34 +roles will be able to use this layout template for their layouts. Anyone can use
  177.35 +this layout template if no role names are set.
  177.36 +-->
  177.37 +<!ELEMENT roles (role-name)>
  177.38 +
  177.39 +<!--
  177.40 +The role-name designates the name of a security role.
  177.41 +-->
  177.42 +<!ELEMENT role-name (#PCDATA)>
  177.43 +
  177.44 +<!ELEMENT custom (layout-template*)>
  177.45 \ No newline at end of file
   178.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   178.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-look-and-feel_6_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   178.3 @@ -0,0 +1,349 @@
   178.4 +<!--
   178.5 +This is the DTD for the Look and Feel parameters for Liferay Portal.
   178.6 +
   178.7 +<!DOCTYPE look-and-feel PUBLIC
   178.8 +	"-//Liferay//DTD Look and Feel 6.0.0//EN"
   178.9 +	"http://www.liferay.com/dtd/liferay-look-and-feel_6_0_0.dtd">
  178.10 +-->
  178.11 +
  178.12 +<!--
  178.13 +The look-and-feel element is the root of the deployment descriptor for
  178.14 +a Liferay look and feel archive. The look and feel archive will hereafter
  178.15 +be referred to as a LAF archive.
  178.16 +-->
  178.17 +<!ELEMENT look-and-feel (compatibility, company-limit?, group-limit?, theme*)>
  178.18 +
  178.19 +<!--
  178.20 +The compatibility element specifies a list of Liferay Portal versions that will
  178.21 +properly deploy the themes in this LAF archive.
  178.22 +-->
  178.23 +<!ELEMENT compatibility (version+)>
  178.24 +
  178.25 +<!--
  178.26 +The version element specifies a specific Liferay Portal version number. For
  178.27 +example, if its value is "3.5.0", that means the themes in this LAF archive will
  178.28 +deploy correctly in Liferay Portal 3.5.0. The portal will not deploy themes from
  178.29 +a LAF archive unless the version numbers match.
  178.30 +-->
  178.31 +<!ELEMENT version (#PCDATA)>
  178.32 +
  178.33 +<!--
  178.34 +The company-limit element specifies a list of company ids that can access the
  178.35 +themes in this LAF archive. If company-limit is not set, then every company in
  178.36 +the portal has access to all of the themes in this LAF archive. If company-limit
  178.37 +is set, then the company ids will be included or excluded based on the
  178.38 +company-includes and company-excludes elements. If there is a disagreement
  178.39 +between company-includes and company-excludes, company-excludes takes
  178.40 +precedence.
  178.41 +-->
  178.42 +<!ELEMENT company-limit (company-includes?, company-excludes?)>
  178.43 +
  178.44 +<!--
  178.45 +The company-includes element specifies a list of company ids that will have
  178.46 +access to the themes in this LAF archive.
  178.47 +-->
  178.48 +<!ELEMENT company-includes (company-id*)>
  178.49 +
  178.50 +<!--
  178.51 +The company-excludes element specifies a list of company ids that will not have
  178.52 +access to the themes in this LAF archive.
  178.53 +-->
  178.54 +<!ELEMENT company-excludes (company-id*)>
  178.55 +
  178.56 +<!--
  178.57 +The company-id element must have either the name or pattern attributes
  178.58 +specified. If the name attribute is specified, then the exact company id is
  178.59 +either included or excluded, depending on whether the company-id element is
  178.60 +inside the company-includes element or company-excludes element. If the pattern
  178.61 +attribute is specified, then a regular expression match is applied to the
  178.62 +pattern which will determine whether a company id is included or excluded.
  178.63 +-->
  178.64 +<!ELEMENT company-id (#PCDATA)>
  178.65 +
  178.66 +<!--
  178.67 +See the comments in the company-id element.
  178.68 +-->
  178.69 +<!ATTLIST company-id
  178.70 +	name CDATA #IMPLIED
  178.71 +	pattern CDATA #IMPLIED
  178.72 +>
  178.73 +
  178.74 +<!--
  178.75 +The group-limit element specifies a list of group ids that can access the themes
  178.76 +in this LAF archive. If group-limit is not set, then every group in the portal
  178.77 +has access to all of the themes in this LAF archive. If group-limit is set, then
  178.78 +the group ids will be included or excluded based on the group-includes and
  178.79 +group-excludes elements. If there is a disagreement between group-includes and
  178.80 +group-excludes, group-excludes takes precedence.
  178.81 +-->
  178.82 +<!ELEMENT group-limit (group-includes?, group-excludes?)>
  178.83 +
  178.84 +<!--
  178.85 +The group-includes element specifies a list of group ids that will have access
  178.86 +to the themes in this LAF archive.
  178.87 +-->
  178.88 +<!ELEMENT group-includes (group-id*)>
  178.89 +
  178.90 +<!--
  178.91 +The group-excludes element specifies a list of group ids that will not have
  178.92 +access to the themes in this LAF archive.
  178.93 +-->
  178.94 +<!ELEMENT group-excludes (group-id*)>
  178.95 +
  178.96 +<!--
  178.97 +The group-id element must have either the name or pattern attributes specified.
  178.98 +If the name attribute is specified, then the exact group id is either included
  178.99 +or excluded, depending on whether the group-id element is inside the
 178.100 +group-includes element or group-excludes element. If the pattern attribute is
 178.101 +specified, then a regular expression match is applied to the pattern which will
 178.102 +determine whether a group id is included or excluded.
 178.103 +-->
 178.104 +<!ELEMENT group-id (#PCDATA)>
 178.105 +
 178.106 +<!--
 178.107 +See the comments in the group-id element.
 178.108 +-->
 178.109 +<!ATTLIST group-id
 178.110 +	name CDATA #IMPLIED
 178.111 +	pattern CDATA #IMPLIED
 178.112 +>
 178.113 +
 178.114 +<!--
 178.115 +The theme element contains the declarative data of a theme.
 178.116 +-->
 178.117 +<!ELEMENT theme (root-path?, templates-path?, css-path?, images-path?,
 178.118 +javascript-path?, virtual-path?, template-extension?, settings?, wap-theme?,
 178.119 +roles?, color-scheme*, layout-templates?)>
 178.120 +
 178.121 +<!--
 178.122 +The id attribute specifies the unique key for a theme. For convenience, the id
 178.123 +attribute can be referenced in the rest of the theme element as ${theme-id}.
 178.124 +
 178.125 +The name attribute specifies the friendly name of a theme that is displayed to
 178.126 +the user.
 178.127 +-->
 178.128 +<!ATTLIST theme
 178.129 +	id CDATA #REQUIRED
 178.130 +	name CDATA #REQUIRED
 178.131 +>
 178.132 +
 178.133 +<!--
 178.134 +The root-path value sets the location of the root path for the theme. For
 178.135 +example, the root path for the Classic theme is "/html/themes/classic". This
 178.136 +means you can find the files for the Classic theme in
 178.137 +/docroot/html/themes/classic.
 178.138 +
 178.139 +For convenience, the root-path attribute can be referenced in the rest of the
 178.140 +theme element as ${root-path}.
 178.141 +
 178.142 +The default value is "/".
 178.143 +-->
 178.144 +<!ELEMENT root-path (#PCDATA)>
 178.145 +
 178.146 +<!--
 178.147 +The templates-path value sets the location of the templates path for the theme.
 178.148 +For example, the templates path for the Classic theme is
 178.149 +"/html/themes/classic/templates". This means you can find the JSP or VM
 178.150 +templates for the Classic theme in /docroot/html/themes/classic/templates.
 178.151 +
 178.152 +For convenience, the templates-path attribute can be referenced in the rest of
 178.153 +the theme element as ${templates-path}.
 178.154 +
 178.155 +The default value is "${root-path}/templates".
 178.156 +-->
 178.157 +<!ELEMENT templates-path (#PCDATA)>
 178.158 +
 178.159 +<!--
 178.160 +The css-path value sets the location of the css path for the theme. For example,
 178.161 +the css path for the Classic theme is "/html/themes/classic/css". This means you
 178.162 +can find css for the Classic theme in /docroot/html/themes/classic/css.
 178.163 +
 178.164 +For convenience, the css-path attribute can be referenced in the rest of the
 178.165 +theme element as ${css-path}.
 178.166 +
 178.167 +The default value is "${root-path}/css".
 178.168 +-->
 178.169 +<!ELEMENT css-path (#PCDATA)>
 178.170 +
 178.171 +<!--
 178.172 +The images-path value sets the location of the images path for the theme. For
 178.173 +example, the images path for the Classic theme is "/html/themes/classic/images".
 178.174 +This means you can find images for the Classic theme in
 178.175 +/docroot/html/themes/classic/images.
 178.176 +
 178.177 +For convenience, the images-path attribute can be referenced in the rest of the
 178.178 +theme element as ${images-path}.
 178.179 +
 178.180 +The default value is "${root-path}/images".
 178.181 +-->
 178.182 +<!ELEMENT images-path (#PCDATA)>
 178.183 +
 178.184 +<!--
 178.185 +The javascript-path value sets the location of the JavaScript path for the
 178.186 +theme. For example, the JavaScript path for the Classic theme is
 178.187 +"/html/themes/classic/javascript". This means you can find JavaScript for the
 178.188 +Classic theme in /docroot/html/themes/classic/javascript.
 178.189 +
 178.190 +For convenience, the javascript-path attribute can be referenced in the rest of
 178.191 +the theme element as ${javascript-path}.
 178.192 +
 178.193 +The default value is "${root-path}/javascript".
 178.194 +-->
 178.195 +<!ELEMENT javascript-path (#PCDATA)>
 178.196 +
 178.197 +<!--
 178.198 +The virtual-path value sets the virtual path used to fetch the CSS, images, and
 178.199 +JavaScript files. By default, the portal returns the theme's servlet path. This
 178.200 +setting allows you to override it.
 178.201 +
 178.202 +For example, suppose your theme is deployed to the servlet path "/test-theme"
 178.203 +and your theme image-path is "/xyz/images". By default, the portal will return
 178.204 +"/test-theme/xyz/images" for the path of the theme's images. You can override it
 178.205 +by setting virtual-path to "/virtual" and have the portal return
 178.206 +"/virtual/xyz/images". This is useful when you want all static files to be
 178.207 +served by Apache for better performance.
 178.208 +
 178.209 +The default value is "" which means this is not used.
 178.210 +-->
 178.211 +<!ELEMENT virtual-path (#PCDATA)>
 178.212 +
 178.213 +<!--
 178.214 +The templates-extension value sets the file extension of the files located in
 178.215 +the templates directory. If you specify the value "jsp", then the portal will
 178.216 +look for files such as portal_nav.jsp in the templates directory. If you specify
 178.217 +the value "vm", then the portal will look for files such as portal_nav.vm in the
 178.218 +templates directory. Specifying "vm" means you can use Velocity to create your
 178.219 +theme. New extensions will be supported in the future to allow for even more
 178.220 +flexibility in the creation of themes.
 178.221 +
 178.222 +The default value is "vm".
 178.223 +-->
 178.224 +<!ELEMENT template-extension (#PCDATA)>
 178.225 +
 178.226 +<!--
 178.227 +The settings element contain a list of settings or properties that are available
 178.228 +to the theme object at runtime. They are described with a key value pair.
 178.229 +
 178.230 +For example, you can access it with the command: theme.getSetting("hello").
 178.231 +-->
 178.232 +<!ELEMENT settings (setting*)>
 178.233 +
 178.234 +<!--
 178.235 +See the comments in the settings element.
 178.236 +-->
 178.237 +<!ELEMENT setting (#PCDATA)>
 178.238 +
 178.239 +<!--
 178.240 +See the comments in the settings element.
 178.241 +-->
 178.242 +<!ATTLIST setting
 178.243 +	key CDATA #REQUIRED
 178.244 +	value CDATA #REQUIRED
 178.245 +>
 178.246 +
 178.247 +<!--
 178.248 +Set the wap-theme value to true if the theme is designed for cellular phones or
 178.249 +other mobile devices. The default value is false.
 178.250 +-->
 178.251 +<!ELEMENT wap-theme (#PCDATA)>
 178.252 +
 178.253 +<!--
 178.254 +The roles element contains a list of role names. Users which have any of these
 178.255 +roles will be able to use this theme for their layouts and layout sets. Anyone
 178.256 +can use this theme if no role names are set.
 178.257 +-->
 178.258 +<!ELEMENT roles (role-name)>
 178.259 +
 178.260 +<!--
 178.261 +The role-name designates the name of a security role.
 178.262 +-->
 178.263 +<!ELEMENT role-name (#PCDATA)>
 178.264 +
 178.265 +<!--
 178.266 +A theme can have many color schemes. It works very similar to Windows. The
 178.267 +Windows XP theme has one set of color schemes, and the Windows Classic theme
 178.268 +has another set of color schemes. Each color scheme references a css class name
 178.269 +and defines an image path for the location of the color scheme's images.
 178.270 +-->
 178.271 +<!ELEMENT color-scheme (default-cs?, css-class, color-scheme-images-path?)>
 178.272 +
 178.273 +<!--
 178.274 +The id attribute specifies the key for a color scheme that is unique for its
 178.275 +parent theme. For convenience, the id attribute can be referenced in the rest of
 178.276 +the color-scheme element as ${color-scheme-id}.
 178.277 +
 178.278 +The name attribute specifies the friendly name of a color scheme
 178.279 +that is displayed to the user.
 178.280 +-->
 178.281 +<!ATTLIST color-scheme
 178.282 +	id CDATA #REQUIRED
 178.283 +	name CDATA #REQUIRED
 178.284 +>
 178.285 +
 178.286 +<!--
 178.287 +Set the default-cs value to true if this is the default color scheme. The
 178.288 +default value is false.
 178.289 +-->
 178.290 +<!ELEMENT default-cs (#PCDATA)>
 178.291 +
 178.292 +<!--
 178.293 +The css-class value is a css class name that represents the color scheme.
 178.294 +
 178.295 +For convenience, the css-class attribute can be referenced in the rest of the
 178.296 +color-scheme element as ${css-class}.
 178.297 +-->
 178.298 +<!ELEMENT css-class (#PCDATA)>
 178.299 +
 178.300 +<!--
 178.301 +The color-scheme-images-path value sets the location of the images path for the
 178.302 +color scheme.
 178.303 +
 178.304 +For convenience, the color-scheme-images-path attribute can be referenced in the
 178.305 +rest of the theme element as ${color-scheme-images-path}.
 178.306 +
 178.307 +The default value is "${root-path}/images/color_schemes/${css-class}".
 178.308 +-->
 178.309 +<!ELEMENT color-scheme-images-path (#PCDATA)>
 178.310 +
 178.311 +<!--
 178.312 +See liferay-layout-templates_6_0_0.dtd.
 178.313 +-->
 178.314 +<!ELEMENT layout-templates (standard?, custom?)>
 178.315 +
 178.316 +<!--
 178.317 +See liferay-layout-templates_6_0_0.dtd.
 178.318 +-->
 178.319 +<!ELEMENT standard (layout-template*)>
 178.320 +
 178.321 +<!--
 178.322 +See liferay-layout-templates_6_0_0.dtd.
 178.323 +-->
 178.324 +<!ELEMENT layout-template (template-path, wap-template-path, thumbnail-path?)>
 178.325 +
 178.326 +<!--
 178.327 +See liferay-layout-templates_6_0_0.dtd.
 178.328 +-->
 178.329 +<!ATTLIST layout-template
 178.330 +	id CDATA #REQUIRED
 178.331 +	name CDATA #IMPLIED
 178.332 +>
 178.333 +
 178.334 +<!--
 178.335 +See liferay-layout-templates_6_0_0.dtd.
 178.336 +-->
 178.337 +<!ELEMENT template-path (#PCDATA)>
 178.338 +
 178.339 +<!--
 178.340 +See liferay-layout-templates_6_0_0.dtd.
 178.341 +-->
 178.342 +<!ELEMENT wap-template-path (#PCDATA)>
 178.343 +
 178.344 +<!--
 178.345 +See liferay-layout-templates_6_0_0.dtd.
 178.346 +-->
 178.347 +<!ELEMENT thumbnail-path (#PCDATA)>
 178.348 +
 178.349 +<!--
 178.350 +See liferay-layout-templates_6_0_0.dtd.
 178.351 +-->
 178.352 +<!ELEMENT custom (layout-template*)>
 178.353 \ No newline at end of file
   179.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   179.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-plugin-package_4_3_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   179.3 @@ -0,0 +1,188 @@
   179.4 +<!--
   179.5 +This is the DTD for the Liferay Plugins XML file that lists the plugins
   179.6 +available in a plugin repository
   179.7 +
   179.8 +<!DOCTYPE plugin-package PUBLIC
   179.9 +	"-//Liferay//DTD Plugin Package 4.3.0//EN"
  179.10 +	"http://www.liferay.com/dtd/liferay-plugin-package_4_3_0.dtd">
  179.11 +-->
  179.12 +
  179.13 +<!--
  179.14 +A boolean type is the string representation of a boolean (true or false)
  179.15 +variable.
  179.16 +-->
  179.17 +<!ENTITY % boolean "(true|false|yes|no)">
  179.18 +
  179.19 +<!--
  179.20 +The plugin-package element contains the declarative data of a plugin.
  179.21 +-->
  179.22 +<!ELEMENT plugin-package (name, module-id, recommended-deployment-context?,
  179.23 +types, tags?, short-description, long-description?, change-log, page-url?,
  179.24 +screenshots?, author, licenses, liferay-versions, deployment-settings?)>
  179.25 +
  179.26 +<!--
  179.27 +The name element contains the name of the plugin package that will be shown to
  179.28 +users.
  179.29 +-->
  179.30 +<!ELEMENT name (#PCDATA)>
  179.31 +
  179.32 +<!--
  179.33 +The module-id element contains the full identifier of the plugin using the
  179.34 +Maven based syntax: groupId/artifactId/version/file-type.
  179.35 +
  179.36 +Example: liferay-samples/sample-struts-portlet/4.3.0/war
  179.37 +-->
  179.38 +<!ELEMENT module-id (#PCDATA)>
  179.39 +
  179.40 +<!--
  179.41 +The recommended-deployment-context element determines the context to which this
  179.42 +plugin should be deployed. Some portlet packages require this because their own
  179.43 +code references itself through URLs that include the context.
  179.44 +-->
  179.45 +<!ELEMENT recommended-deployment-context (#PCDATA)>
  179.46 +
  179.47 +<!--
  179.48 +The types element contains a list of plugin types included in the package.
  179.49 +-->
  179.50 +<!ELEMENT types (type)+>
  179.51 +
  179.52 +<!--
  179.53 +The type element contains the type of the plugin. Valid values are: portlets,
  179.54 +layout-templates, and themes.
  179.55 +-->
  179.56 +<!ELEMENT type (#PCDATA)>
  179.57 +
  179.58 +<!--
  179.59 +The tags element contains a list of tags to categorize the plugin.
  179.60 +-->
  179.61 +<!ELEMENT tags (tag)*>
  179.62 +
  179.63 +<!--
  179.64 +The tag element contains a tag that categorizes the plugin.
  179.65 +-->
  179.66 +<!ELEMENT tag (#PCDATA)>
  179.67 +
  179.68 +<!--
  179.69 +The short-description element contains a short description of the plugin.
  179.70 +-->
  179.71 +<!ELEMENT short-description (#PCDATA)>
  179.72 +
  179.73 +<!--
  179.74 +The long-description element contains a detailed description of the plugin. It
  179.75 +is recommended that installation or update instructions are provided if the
  179.76 +portal administrator has to perform extra steps to be able to use the plugin
  179.77 +after it is deployed.
  179.78 +
  179.79 +Note: the text of this element might contain simple HTML formatting if encoded
  179.80 +within a CDATA section.
  179.81 +-->
  179.82 +<!ELEMENT long-description (#PCDATA)>
  179.83 +
  179.84 +<!--
  179.85 +The change-log element contains an explanation of the changes made in the latest
  179.86 +release. It is recommended to try to offer all the information that a user
  179.87 +might need to decide whether to update a previous version.
  179.88 +
  179.89 +Note: the text of this element might contain simple HTML formatting if encoded
  179.90 +within a CDATA section.
  179.91 +-->
  179.92 +<!ELEMENT change-log (#PCDATA)>
  179.93 +
  179.94 +<!--
  179.95 +The page-url element contains the URL of the home page of the plugin.
  179.96 +-->
  179.97 +<!ELEMENT page-url (#PCDATA)>
  179.98 +
  179.99 +<!--
 179.100 +The screenshots element contains a list of screenshots for the plugin.
 179.101 +-->
 179.102 +<!ELEMENT screenshots (screenshot)+>
 179.103 +
 179.104 +<!--
 179.105 +The screenshot element contains two URLs for the thumbnail and large images
 179.106 +versions of the screenshot
 179.107 +-->
 179.108 +<!ELEMENT screenshot (thumbnail-url, large-image-url)>
 179.109 +
 179.110 +<!--
 179.111 +The thumbnail-url element contains the URL of a thumbnail screenshot of the
 179.112 +plugin. It is recommended that the width of the images is 120 pixels and that
 179.113 +the height is in the same size range.
 179.114 +-->
 179.115 +<!ELEMENT thumbnail-url (#PCDATA)>
 179.116 +
 179.117 +<!--
 179.118 +The large-image-url element contains the URL of a large image screenshot of the
 179.119 +plugin.
 179.120 +-->
 179.121 +<!ELEMENT large-image-url (#PCDATA)>
 179.122 +
 179.123 +<!--
 179.124 +The author element contains the name of the author of the plugin.
 179.125 +-->
 179.126 +<!ELEMENT author (#PCDATA)>
 179.127 +
 179.128 +<!--
 179.129 +The licenses element contains a list of licences under which the plugin is
 179.130 +provided.
 179.131 +-->
 179.132 +<!ELEMENT licenses (license)+>
 179.133 +
 179.134 +<!--
 179.135 +The license element contains the name of a licence under which the plugin is
 179.136 +provided.
 179.137 +-->
 179.138 +<!ELEMENT license (#PCDATA)>
 179.139 +
 179.140 +<!--
 179.141 +The osi-approved attribute specifies if the license is open source, approved by
 179.142 +the Open Source Initiative (OSI). In that case it's value is true.
 179.143 +-->
 179.144 +<!ATTLIST license
 179.145 +	osi-approved %boolean; #REQUIRED
 179.146 +>
 179.147 +
 179.148 +<!--
 179.149 +The url attribute specifies a URL of a page that describes the license.
 179.150 +-->
 179.151 +<!ATTLIST license
 179.152 +	url CDATA #IMPLIED
 179.153 +>
 179.154 +
 179.155 +<!--
 179.156 +The liferay-versions element contains a list of Liferay Portal versions that
 179.157 +are supported by the plugin.
 179.158 +-->
 179.159 +<!ELEMENT liferay-versions (liferay-version)+>
 179.160 +
 179.161 +<!--
 179.162 +The liferay-version element contains a version of Liferay Portal that is
 179.163 +supported by the plugin.
 179.164 +-->
 179.165 +<!ELEMENT liferay-version (#PCDATA)>
 179.166 +
 179.167 +<!--
 179.168 +The deployment-settings element contains a list of parameters that specify how
 179.169 +the package should be deployed.
 179.170 +-->
 179.171 +<!ELEMENT deployment-settings (setting)+>
 179.172 +
 179.173 +<!--
 179.174 +The setting element specifies a name value pair that provides information of how
 179.175 +the package should be deployed.
 179.176 +-->
 179.177 +<!ELEMENT setting (#PCDATA)>
 179.178 +
 179.179 +<!--
 179.180 +The name attribute specifies the name of the setting.
 179.181 +-->
 179.182 +<!ATTLIST setting
 179.183 +	name CDATA #IMPLIED
 179.184 +>
 179.185 +
 179.186 +<!--
 179.187 +The value attribute specifies the value of the setting.
 179.188 +-->
 179.189 +<!ATTLIST setting
 179.190 +	value CDATA #IMPLIED
 179.191 +>
 179.192 \ No newline at end of file
   180.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   180.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-plugin-package_6_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   180.3 @@ -0,0 +1,188 @@
   180.4 +<!--
   180.5 +This is the DTD for the Liferay Plugins XML file that lists the plugins
   180.6 +available in a plugin repository
   180.7 +
   180.8 +<!DOCTYPE plugin-package PUBLIC
   180.9 +	"-//Liferay//DTD Plugin Package 6.0.0//EN"
  180.10 +	"http://www.liferay.com/dtd/liferay-plugin-package_6_0_0.dtd">
  180.11 +-->
  180.12 +
  180.13 +<!--
  180.14 +A boolean type is the string representation of a boolean (true or false)
  180.15 +variable.
  180.16 +-->
  180.17 +<!ENTITY % boolean "(true|false|yes|no)">
  180.18 +
  180.19 +<!--
  180.20 +The plugin-package element contains the declarative data of a plugin.
  180.21 +-->
  180.22 +<!ELEMENT plugin-package (name, module-id, recommended-deployment-context?,
  180.23 +types, tags?, short-description, long-description?, change-log, page-url?,
  180.24 +screenshots?, author, licenses, liferay-versions, deployment-settings?)>
  180.25 +
  180.26 +<!--
  180.27 +The name element contains the name of the plugin package that will be shown to
  180.28 +users.
  180.29 +-->
  180.30 +<!ELEMENT name (#PCDATA)>
  180.31 +
  180.32 +<!--
  180.33 +The module-id element contains the full identifier of the plugin using the
  180.34 +Maven based syntax: groupId/artifactId/version/file-type.
  180.35 +
  180.36 +Example: liferay-samples/sample-struts-portlet/6.0.0/war
  180.37 +-->
  180.38 +<!ELEMENT module-id (#PCDATA)>
  180.39 +
  180.40 +<!--
  180.41 +The recommended-deployment-context element determines the context to which this
  180.42 +plugin should be deployed. Some portlet packages require this because their own
  180.43 +code references itself through URLs that include the context.
  180.44 +-->
  180.45 +<!ELEMENT recommended-deployment-context (#PCDATA)>
  180.46 +
  180.47 +<!--
  180.48 +The types element contains a list of plugin types included in the package.
  180.49 +-->
  180.50 +<!ELEMENT types (type)+>
  180.51 +
  180.52 +<!--
  180.53 +The type element contains the type of the plugin. Valid values are: portlets,
  180.54 +layout-templates, and themes.
  180.55 +-->
  180.56 +<!ELEMENT type (#PCDATA)>
  180.57 +
  180.58 +<!--
  180.59 +The tags element contains a list of tags to categorize the plugin.
  180.60 +-->
  180.61 +<!ELEMENT tags (tag)*>
  180.62 +
  180.63 +<!--
  180.64 +The tag element contains a tag that categorizes the plugin.
  180.65 +-->
  180.66 +<!ELEMENT tag (#PCDATA)>
  180.67 +
  180.68 +<!--
  180.69 +The short-description element contains a short description of the plugin.
  180.70 +-->
  180.71 +<!ELEMENT short-description (#PCDATA)>
  180.72 +
  180.73 +<!--
  180.74 +The long-description element contains a detailed description of the plugin. It
  180.75 +is recommended that installation or update instructions are provided if the
  180.76 +portal administrator has to perform extra steps to be able to use the plugin
  180.77 +after it is deployed.
  180.78 +
  180.79 +Note: the text of this element might contain simple HTML formatting if encoded
  180.80 +within a CDATA section.
  180.81 +-->
  180.82 +<!ELEMENT long-description (#PCDATA)>
  180.83 +
  180.84 +<!--
  180.85 +The change-log element contains an explanation of the changes made in the latest
  180.86 +release. It is recommended to try to offer all the information that a user
  180.87 +might need to decide whether to update a previous version.
  180.88 +
  180.89 +Note: the text of this element might contain simple HTML formatting if encoded
  180.90 +within a CDATA section.
  180.91 +-->
  180.92 +<!ELEMENT change-log (#PCDATA)>
  180.93 +
  180.94 +<!--
  180.95 +The page-url element contains the URL of the home page of the plugin.
  180.96 +-->
  180.97 +<!ELEMENT page-url (#PCDATA)>
  180.98 +
  180.99 +<!--
 180.100 +The screenshots element contains a list of screenshots for the plugin.
 180.101 +-->
 180.102 +<!ELEMENT screenshots (screenshot)+>
 180.103 +
 180.104 +<!--
 180.105 +The screenshot element contains two URLs for the thumbnail and large images
 180.106 +versions of the screenshot
 180.107 +-->
 180.108 +<!ELEMENT screenshot (thumbnail-url, large-image-url)>
 180.109 +
 180.110 +<!--
 180.111 +The thumbnail-url element contains the URL of a thumbnail screenshot of the
 180.112 +plugin. It is recommended that the width of the images is 120 pixels and that
 180.113 +the height is in the same size range.
 180.114 +-->
 180.115 +<!ELEMENT thumbnail-url (#PCDATA)>
 180.116 +
 180.117 +<!--
 180.118 +The large-image-url element contains the URL of a large image screenshot of the
 180.119 +plugin.
 180.120 +-->
 180.121 +<!ELEMENT large-image-url (#PCDATA)>
 180.122 +
 180.123 +<!--
 180.124 +The author element contains the name of the author of the plugin.
 180.125 +-->
 180.126 +<!ELEMENT author (#PCDATA)>
 180.127 +
 180.128 +<!--
 180.129 +The licenses element contains a list of licences under which the plugin is
 180.130 +provided.
 180.131 +-->
 180.132 +<!ELEMENT licenses (license)+>
 180.133 +
 180.134 +<!--
 180.135 +The license element contains the name of a licence under which the plugin is
 180.136 +provided.
 180.137 +-->
 180.138 +<!ELEMENT license (#PCDATA)>
 180.139 +
 180.140 +<!--
 180.141 +The osi-approved attribute specifies if the license is open source, approved by
 180.142 +the Open Source Initiative (OSI). In that case it's value is true.
 180.143 +-->
 180.144 +<!ATTLIST license
 180.145 +	osi-approved %boolean; #REQUIRED
 180.146 +>
 180.147 +
 180.148 +<!--
 180.149 +The url attribute specifies a URL of a page that describes the license.
 180.150 +-->
 180.151 +<!ATTLIST license
 180.152 +	url CDATA #IMPLIED
 180.153 +>
 180.154 +
 180.155 +<!--
 180.156 +The liferay-versions element contains a list of Liferay Portal versions that
 180.157 +are supported by the plugin.
 180.158 +-->
 180.159 +<!ELEMENT liferay-versions (liferay-version)+>
 180.160 +
 180.161 +<!--
 180.162 +The liferay-version element contains a version of Liferay Portal that is
 180.163 +supported by the plugin.
 180.164 +-->
 180.165 +<!ELEMENT liferay-version (#PCDATA)>
 180.166 +
 180.167 +<!--
 180.168 +The deployment-settings element contains a list of parameters that specify how
 180.169 +the package should be deployed.
 180.170 +-->
 180.171 +<!ELEMENT deployment-settings (setting)+>
 180.172 +
 180.173 +<!--
 180.174 +The setting element specifies a name value pair that provides information of how
 180.175 +the package should be deployed.
 180.176 +-->
 180.177 +<!ELEMENT setting (#PCDATA)>
 180.178 +
 180.179 +<!--
 180.180 +The name attribute specifies the name of the setting.
 180.181 +-->
 180.182 +<!ATTLIST setting
 180.183 +	name CDATA #IMPLIED
 180.184 +>
 180.185 +
 180.186 +<!--
 180.187 +The value attribute specifies the value of the setting.
 180.188 +-->
 180.189 +<!ATTLIST setting
 180.190 +	value CDATA #IMPLIED
 180.191 +>
 180.192 \ No newline at end of file
   181.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   181.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-plugin-repository_6_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   181.3 @@ -0,0 +1,219 @@
   181.4 +<!--
   181.5 +This is the DTD for the Liferay Plugins XML file that lists the plugins
   181.6 +available in a plugin repository
   181.7 +
   181.8 +<!DOCTYPE plugin-repository PUBLIC
   181.9 +	"-//Liferay//DTD Plugin Repository 6.0.0//EN"
  181.10 +	"http://www.liferay.com/dtd/liferay-plugin-repository_6_0_0.dtd">
  181.11 +-->
  181.12 +
  181.13 +<!--
  181.14 +A boolean type is the string representation of a boolean (true or false)
  181.15 +variable.
  181.16 +-->
  181.17 +<!ENTITY % boolean "(true|false|yes|no)">
  181.18 +
  181.19 +<!--
  181.20 +The liferay-versions is the root of the XML file listing the available plugins
  181.21 +in a repository.
  181.22 +-->
  181.23 +<!ELEMENT plugin-repository (settings?, plugin-package)*>
  181.24 +
  181.25 +<!--
  181.26 +The settings element contains a list of settings that specify how a client
  181.27 +should interact with the repository
  181.28 +-->
  181.29 +<!ELEMENT settings (setting)+>
  181.30 +
  181.31 +<!ELEMENT setting (#PCDATA)>
  181.32 +
  181.33 +<!--
  181.34 +Setting name and value. Current supported names are:
  181.35 +- use-download-url: set to true to use the download-url of each package instead
  181.36 +  of downloading from this repository. The default is false.
  181.37 +-->
  181.38 +<!ATTLIST setting
  181.39 +	name CDATA #REQUIRED
  181.40 +	value CDATA #REQUIRED
  181.41 +>
  181.42 +
  181.43 +<!--
  181.44 +The plugin element contains the declarative data of a plugin.
  181.45 +-->
  181.46 +<!ELEMENT plugin-package (name, module-id, recommended-deployment-context?,
  181.47 +types, tags?, short-description, long-description?, change-log, page-url?,
  181.48 +download-url?, screenshots?, author, licenses, liferay-versions,
  181.49 +deployment-settings?)>
  181.50 +
  181.51 +<!--
  181.52 +The name element contains the name of the plugin package that will be shown to
  181.53 +users.
  181.54 +-->
  181.55 +<!ELEMENT name (#PCDATA)>
  181.56 +
  181.57 +<!--
  181.58 +The module-id element contains the full identifier of the plugin using the
  181.59 +Maven based syntax: groupId/artifactId/version/file-type.
  181.60 +
  181.61 +Example: liferay-samples/sample-struts-portlet/4.3.0/war
  181.62 +-->
  181.63 +<!ELEMENT module-id (#PCDATA)>
  181.64 +
  181.65 +<!--
  181.66 +The recommended-deployment-context element determines the context to which this
  181.67 +plugin should be deployed. Some portlet packages require this because their own
  181.68 +code references itself through URLs that include the context.
  181.69 +-->
  181.70 +<!ELEMENT recommended-deployment-context (#PCDATA)>
  181.71 +
  181.72 +<!--
  181.73 +The types element contains a list of plugin types included in the package.
  181.74 +-->
  181.75 +<!ELEMENT types (type)+>
  181.76 +
  181.77 +<!--
  181.78 +The type element contains the type of the plugin. Valid values are: portlets,
  181.79 +layout-templates, and themes.
  181.80 +-->
  181.81 +<!ELEMENT type (#PCDATA)>
  181.82 +
  181.83 +<!--
  181.84 +The tags element contains a list of tags to categorize the plugin.
  181.85 +-->
  181.86 +<!ELEMENT tags (tag)*>
  181.87 +
  181.88 +<!--
  181.89 +The tag element contains a tag that categorizes the plugin.
  181.90 +-->
  181.91 +<!ELEMENT tag (#PCDATA)>
  181.92 +
  181.93 +<!--
  181.94 +The short-description element contains a short description of the plugin.
  181.95 +-->
  181.96 +<!ELEMENT short-description (#PCDATA)>
  181.97 +
  181.98 +<!--
  181.99 +The long-description element contains a detailed description of the plugin. It
 181.100 +is recommended that installation or update instructions are provided if the
 181.101 +portal administrator has to perform extra steps to be able to use the plugin
 181.102 +after it is deployed.
 181.103 +
 181.104 +Note: the text of this element might contain simple HTML formatting if encoded
 181.105 +within a CDATA section.
 181.106 +-->
 181.107 +<!ELEMENT long-description (#PCDATA)>
 181.108 +
 181.109 +<!--
 181.110 +The change-log element contains an explanation of the changes made in the latest
 181.111 +release. It is recommended to try to offer all the information that a user
 181.112 +might need to decide whether to update a previous version.
 181.113 +
 181.114 +Note: the text of this element might contain simple HTML formatting if encoded
 181.115 +within a CDATA section.
 181.116 +-->
 181.117 +<!ELEMENT change-log (#PCDATA)>
 181.118 +
 181.119 +<!--
 181.120 +The page-url element contains the URL of the home page of the plugin.
 181.121 +-->
 181.122 +<!ELEMENT page-url (#PCDATA)>
 181.123 +
 181.124 +<!--
 181.125 +The download-url element contains the URL to download the plugin.
 181.126 +-->
 181.127 +<!ELEMENT download-url (#PCDATA)>
 181.128 +
 181.129 +<!--
 181.130 +The screenshots element contains a list of screenshots for the plugin.
 181.131 +-->
 181.132 +<!ELEMENT screenshots (screenshot)+>
 181.133 +
 181.134 +<!--
 181.135 +The screenshot element contains two URLs for the thumbnail and large images
 181.136 +versions of the screenshot
 181.137 +-->
 181.138 +<!ELEMENT screenshot (thumbnail-url, large-image-url)>
 181.139 +
 181.140 +<!--
 181.141 +The thumbnail-url element contains the URL of a screenshot of the plugin. It is
 181.142 +recommended that the width of the images is 120 pixels and that the height is in
 181.143 +the same size range.
 181.144 +-->
 181.145 +<!ELEMENT thumbnail-url (#PCDATA)>
 181.146 +
 181.147 +<!--
 181.148 +The large-image-url element contains the URL of a screenshot of the plugin. It
 181.149 +is recommended that the width of the images is 120 pixels and that the height is
 181.150 +in the same size range.
 181.151 +-->
 181.152 +<!ELEMENT large-image-url (#PCDATA)>
 181.153 +
 181.154 +<!--
 181.155 +The author element contains the name of the author of the plugin.
 181.156 +-->
 181.157 +<!ELEMENT author (#PCDATA)>
 181.158 +
 181.159 +<!--
 181.160 +The licenses element contains a list of licences under which the plugin is
 181.161 +provided.
 181.162 +-->
 181.163 +<!ELEMENT licenses (license)+>
 181.164 +
 181.165 +<!--
 181.166 +The license element contains the name of a licence under which the plugin is
 181.167 +provided.
 181.168 +-->
 181.169 +<!ELEMENT license (#PCDATA)>
 181.170 +
 181.171 +<!--
 181.172 +The osi-approved attribute specifies if the license is open source, approved by
 181.173 +the Open Source Initiative (OSI). In that case it's value is true.
 181.174 +-->
 181.175 +<!ATTLIST license
 181.176 +	osi-approved %boolean; #REQUIRED
 181.177 +>
 181.178 +
 181.179 +<!--
 181.180 +The url attribute specifies a URL of a page that describes the license.
 181.181 +-->
 181.182 +<!ATTLIST license
 181.183 +	url CDATA #IMPLIED
 181.184 +>
 181.185 +
 181.186 +<!--
 181.187 +The liferay-versions element contains a list of Liferay Portal versions that
 181.188 +are supported by the plugin.
 181.189 +-->
 181.190 +<!ELEMENT liferay-versions (liferay-version)+>
 181.191 +
 181.192 +<!--
 181.193 +The liferay-version element contains a version of Liferay Portal that is
 181.194 +supported by the plugin.
 181.195 +-->
 181.196 +<!ELEMENT liferay-version (#PCDATA)>
 181.197 +
 181.198 +<!--
 181.199 +The deployment-settings element contains a list of parameters that specify how
 181.200 +the package should be deployed.
 181.201 +-->
 181.202 +<!ELEMENT deployment-settings (deployment-setting)+>
 181.203 +
 181.204 +<!--
 181.205 +The deployment-setting element specifies a name value pair that provides
 181.206 +information of how the package should be deployed.
 181.207 +-->
 181.208 +<!ELEMENT deployment-setting (#PCDATA)>
 181.209 +
 181.210 +<!--
 181.211 +The name attribute specifies the name of the setting.
 181.212 +-->
 181.213 +<!ATTLIST setting
 181.214 +	name CDATA #IMPLIED
 181.215 +>
 181.216 +
 181.217 +<!--
 181.218 +The value attribute specifies the value of the setting.
 181.219 +-->
 181.220 +<!ATTLIST setting
 181.221 +	value CDATA #IMPLIED
 181.222 +>
 181.223 \ No newline at end of file
   182.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   182.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_4_4_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   182.3 @@ -0,0 +1,537 @@
   182.4 +<!--
   182.5 +This is the DTD for the Portlet Application parameters that are specific to
   182.6 +Liferay Portal.
   182.7 +
   182.8 +<!DOCTYPE liferay-portlet-app PUBLIC
   182.9 +	"-//Liferay//DTD Portlet Application 4.4.0//EN"
  182.10 +	"http://www.liferay.com/dtd/liferay-portlet-app_4_4_0.dtd">
  182.11 +-->
  182.12 +
  182.13 +<!--
  182.14 +The liferay-portlet-app element is the root of the deployment descriptor for
  182.15 +a Liferay portlet application.
  182.16 +-->
  182.17 +<!ELEMENT liferay-portlet-app (portlet*, role-mapper*, custom-user-attribute*)>
  182.18 +
  182.19 +<!--
  182.20 +The portlet element contains the declarative data of a portlet.
  182.21 +-->
  182.22 +<!ELEMENT portlet (portlet-name, icon?, virtual-path?, struts-path?,
  182.23 +configuration-path?, configuration-action-class?, indexer-class?,
  182.24 +open-search-class?, scheduler-class?, portlet-url-class?,
  182.25 +friendly-url-mapper-class?, url-encoder-class?, portlet-data-handler-class?,
  182.26 +portlet-layout-listener-class?, activity-tracker-interpreter-class?,
  182.27 +smtp-message-listener-class?, preferences-company-wide?,
  182.28 +preferences-unique-per-layout?, preferences-owned-by-group?,
  182.29 +use-default-template?, show-portlet-access-denied?, show-portlet-inactive?,
  182.30 +action-url-redirect?, restore-current-view?, maximize-edit?, maximize-help?,
  182.31 +pop-up-print?, layout-cacheable?, instanceable?, private-request-attributes?,
  182.32 +private-session-attributes?, render-weight?, ajaxable?, header-portal-css*,
  182.33 +header-portlet-css*, header-portal-javascript*, header-portlet-javascript*,
  182.34 +footer-portal-css*, footer-portlet-css*, footer-portal-javascript*,
  182.35 +footer-portlet-javascript*, css-class-wrapper?, add-default-resource?, system?,
  182.36 +active?, include?)>
  182.37 +
  182.38 +<!--
  182.39 +The portlet-name element contains the unique name of the portlet. This name must
  182.40 +match the portlet-name specified in portlet.xml.
  182.41 +-->
  182.42 +<!ELEMENT portlet-name (#PCDATA)>
  182.43 +
  182.44 +<!--
  182.45 +The icon element specifies an image that represents the portlet.
  182.46 +-->
  182.47 +<!ELEMENT icon (#PCDATA)>
  182.48 +
  182.49 +<!--
  182.50 +The virtual-path value sets the virtual path used to override the default
  182.51 +servlet context path.
  182.52 +
  182.53 +For example, suppose your portlet is deployed to the servlet path
  182.54 +"/test-portlet". By default, the portal will return "/test-portlet" for the
  182.55 +servlet context path. You can override it by setting virtual-path to "/virtual"
  182.56 +and have the portal return "/virtual" for the servlet context path.
  182.57 +
  182.58 +The default value is "" which means this is not used.
  182.59 +-->
  182.60 +<!ELEMENT virtual-path (#PCDATA)>
  182.61 +
  182.62 +<!--
  182.63 +Supppose the struts-path value is "mail". This tells the portal that all
  182.64 +requests with the path mail/* are considered part of this portlet's scope. Users
  182.65 +who request paths that match mail/* will only be granted access if they also
  182.66 +have access to this portlet. This is true for both portlet requests and regular
  182.67 +servlet requests.
  182.68 +-->
  182.69 +<!ELEMENT struts-path (#PCDATA)>
  182.70 +
  182.71 +<!--
  182.72 +The configuration-path value is no longer available. Use
  182.73 +configuration-action-class instead.
  182.74 +-->
  182.75 +<!ELEMENT configuration-path (#PCDATA)>
  182.76 +
  182.77 +<!--
  182.78 +The configuration-action-class value must be a class that implements
  182.79 +com.liferay.portal.kernel.portlet.ConfigurationAction and is called to allow
  182.80 +users to configure the portlet at runtime.
  182.81 +
  182.82 +See:
  182.83 +
  182.84 +http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/messageboards/action/ConfigurationActionImpl.html
  182.85 +-->
  182.86 +<!ELEMENT configuration-action-class (#PCDATA)>
  182.87 +
  182.88 +<!--
  182.89 +The indexer-class value must be a class that implements
  182.90 +com.liferay.portal.kernel.search.Indexer and is called to create or update a
  182.91 +search index for the portlet.
  182.92 +
  182.93 +See:
  182.94 +
  182.95 +http://docs.liferay.com/4.4/javadocs/portal-kernel/com/liferay/portal/kernel/search/Indexer.html
  182.96 +http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/messageboards/util/Indexer.html
  182.97 +http://lucene.apache.org
  182.98 +-->
  182.99 +<!ELEMENT indexer-class (#PCDATA)>
 182.100 +
 182.101 +<!--
 182.102 +The open-search-class value must be a class that implements
 182.103 +com.liferay.portal.kernel.search.OpenSearch and is called to get search results
 182.104 +in the OpenSearch 1.1 standard.
 182.105 +
 182.106 +See:
 182.107 +
 182.108 +http://docs.liferay.com/4.4/javadocs/portal-kernel/com/liferay/portal/kernel/search/OpenSearch.html
 182.109 +http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/alfrescocontent/util/OpenSearch.html
 182.110 +http://www.opensearch.org
 182.111 +-->
 182.112 +<!ELEMENT open-search-class (#PCDATA)>
 182.113 +
 182.114 +<!--
 182.115 +The scheduler-class value must be a class that implements
 182.116 +com.liferay.portal.job.Scheduler and is called to schedule Quartz jobs for this
 182.117 +portlet.
 182.118 +
 182.119 +See:
 182.120 +
 182.121 +http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portal/job/Scheduler.html
 182.122 +http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/calendar/job/Scheduler.html
 182.123 +http://www.opensymphony.com/quartz
 182.124 +-->
 182.125 +<!ELEMENT scheduler-class (#PCDATA)>
 182.126 +
 182.127 +<!--
 182.128 +The portlet-url-class value must be a class that extends
 182.129 +com.liferay.portlet.PortletURLImplWrapper. Set this class to override the
 182.130 +default portlet URL implementation.
 182.131 +
 182.132 +See:
 182.133 +
 182.134 +http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portal/struts/StrutsActionPortletURL.html
 182.135 +-->
 182.136 +<!ELEMENT portlet-url-class (#PCDATA)>
 182.137 +
 182.138 +<!--
 182.139 +The friendly-url-mapper-class value must be a class that implements
 182.140 +com.liferay.portal.kernel.portlet.FriendlyURLMapper. Use this if content inside
 182.141 +a portlet needs to have a friendly URL. See the Message Boards portlet for an
 182.142 +example of its uses.
 182.143 +
 182.144 +See:
 182.145 +
 182.146 +http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/messageboards/MBFriendlyURLMapper.html
 182.147 +-->
 182.148 +<!ELEMENT friendly-url-mapper-class (#PCDATA)>
 182.149 +
 182.150 +<!--
 182.151 +The url-encoder-class value must be a class that implements
 182.152 +com.liferay.portal.kernel.servlet.URLEncoder. Use this to set a custom
 182.153 +URLEncoder that is used by the RenderResponse class to implement the encodeURL
 182.154 +method. This is useful if you need to add custom logic to rewrite URLs.
 182.155 +-->
 182.156 +<!ELEMENT url-encoder-class (#PCDATA)>
 182.157 +
 182.158 +<!--
 182.159 +The portlet-data-handler-class value must be a class that implements
 182.160 +com.liferay.portal.kernel.lar.PortletDataHandler and is called when archiving
 182.161 +tasks are run.
 182.162 +
 182.163 +See:
 182.164 +
 182.165 +http://docs.liferay.com/4.4/javadocs/portal-kernel/com/liferay/portal/kernel/lar/PortletDataHandler.html
 182.166 +http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/journal/lar/PortletDataHandlerImpl.html
 182.167 +-->
 182.168 +<!ELEMENT portlet-data-handler-class (#PCDATA)>
 182.169 +
 182.170 +<!--
 182.171 +The portlet-layout-listener-class value must be a class that implements
 182.172 +com.liferay.portal.kernel.portlet.PortletLayoutListener and is called when a portlet
 182.173 +is added, moved, or removed from a layout.
 182.174 +
 182.175 +See:
 182.176 +
 182.177 +http://docs.liferay.com/4.4/javadocs/portal-kernel/com/liferay/portal/kernel/portlet/PortletLayoutListener.html
 182.178 +http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/journalcontent/JournalContentPortletLayoutListener.html
 182.179 +-->
 182.180 +<!ELEMENT portlet-layout-listener-class (#PCDATA)>
 182.181 +
 182.182 +<!--
 182.183 +The activity-tracker-interpreter-class value must be a class that implements
 182.184 +com.liferay.portal.model.ActivityTrackerInterpreter and is called to interpret
 182.185 +activities into friendly messages that are easily understandable by a human
 182.186 +being.
 182.187 +
 182.188 +See:
 182.189 +
 182.190 +http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portal/model/ActivityTrackerInterpreter.html
 182.191 +http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/messageboards/MBActivityTrackerInterpreter.html
 182.192 +-->
 182.193 +<!ELEMENT activity-tracker-interpreter-class (#PCDATA)>
 182.194 +
 182.195 +<!--
 182.196 +The smtp-message-listener-class value must be a class that implements
 182.197 +com.liferay.portal.kernel.smtp.MessageListener and is called when processing
 182.198 +emails.
 182.199 +
 182.200 +See:
 182.201 +
 182.202 +http://docs.liferay.com/4.4/javadocs/portal-kernel/com/liferay/portal/kernel/smtp/MessageListener.html
 182.203 +http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/messageboards/smtp/MessageListenerImpl.html
 182.204 +-->
 182.205 +<!ELEMENT smtp-message-listener-class (#PCDATA)>
 182.206 +
 182.207 +<!--
 182.208 +Set the preferences-company-wide value to true if the preferences for the
 182.209 +portlet are across the entire company. Setting this value to true means
 182.210 +the value for preferences-unique-per-layout and preferences-owned-by-group are
 182.211 +not used. The default value is false.
 182.212 +
 182.213 +For example, an administrator could set the preferences to an Announcements
 182.214 +portlet that would save a message in the portlet's preferences. This message
 182.215 +would then be used across all pages for that company. The portlet must not be
 182.216 +instanceable because instanceable portlets have uniquely generated portlet ids.
 182.217 +
 182.218 +The default behavior of the bundled Announcements portlet sets the instanceable
 182.219 +value to true so that normal users cannot create company wide messages. A future
 182.220 +release would include permissions for the edit mode versus the view mode which
 182.221 +would allow an administrator to set the message while users would just view the
 182.222 +message.
 182.223 +-->
 182.224 +<!ELEMENT preferences-company-wide (#PCDATA)>
 182.225 +
 182.226 +<!--
 182.227 +Set the preferences-unique-per-layout value to true if the preferences for the
 182.228 +portlet are unique across all pages. If set to false, the preferences for the
 182.229 +portlet are shared across all pages. The default value is true.
 182.230 +
 182.231 +The preferences-unique-per-layout element is used in combination with the
 182.232 +preferences-owned-by-group element. See the comments for the
 182.233 +preferences-owned-by-group element for more information.
 182.234 +-->
 182.235 +<!ELEMENT preferences-unique-per-layout (#PCDATA)>
 182.236 +
 182.237 +<!--
 182.238 +Set the preferences-owned-by-group value to true if the preferences for the
 182.239 +portlet are owned by the group when the portlet is shown in a group page. If
 182.240 +set to false, the preferences are owned by the user at all times. The default
 182.241 +value is true.
 182.242 +
 182.243 +Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 182.244 +preferences-owned-by-group set to false. Users can set a different list of
 182.245 +stocks for every personal page. Users can set a different list of stocks for
 182.246 +every community page.
 182.247 +
 182.248 +Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 182.249 +preferences-owned-by-group set to false. Users can set one list of stocks to be
 182.250 +shared across all personal pages. Users can set one list of stocks to be shared
 182.251 +across a community's set of pages.
 182.252 +
 182.253 +Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 182.254 +preferences-owned-by-group set to true. Users can set a different list of stocks
 182.255 +for every personal page. Administrators set the portlet preferences for users in
 182.256 +a community page. Administrators can set a different list of stocks for every
 182.257 +community page that are then shared by all users within a community.
 182.258 +
 182.259 +Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 182.260 +preferences-owned-by-group set to true. Users can set one list of stocks to be
 182.261 +shared across all personal pages. Administrators set the portlet preferences for
 182.262 +users in a community page. Administrators can set one list of stocks to be
 182.263 +shared by all users across a community's set of pages.
 182.264 +-->
 182.265 +<!ELEMENT preferences-owned-by-group (#PCDATA)>
 182.266 +
 182.267 +<!--
 182.268 +Set the use-default-template value to true if the portlet uses the default
 182.269 +template to decorate and wrap content. Setting this to false allows the
 182.270 +developer to own and maintain the portlet's entire outputted content. The
 182.271 +default value is true.
 182.272 +
 182.273 +The most common use of this is if you want the portlet to look different from
 182.274 +the other portlets or if you want the portlet to not have borders around the
 182.275 +outputted content.
 182.276 +-->
 182.277 +<!ELEMENT use-default-template (#PCDATA)>
 182.278 +
 182.279 +<!--
 182.280 +Set the show-portlet-access-denied value to true if users are shown the portlet
 182.281 +with an access denied message if they do not have access to the portlet. If set
 182.282 +to false, users are never shown the portlet if they do not have access to the
 182.283 +portlet. The default value is set in portal.properties.
 182.284 +
 182.285 +See:
 182.286 +
 182.287 +http://www.liferay.com/page/guest/documentation/development/properties
 182.288 +-->
 182.289 +<!ELEMENT show-portlet-access-denied (#PCDATA)>
 182.290 +
 182.291 +<!--
 182.292 +Set the show-portlet-inactive value to true if users are shown the portlet
 182.293 +with an inactive message if the portlet is inactive. If set to false, users are
 182.294 +never shown the portlet if the portlet is inactive. The default value is set in
 182.295 +portal.properties.
 182.296 +
 182.297 +http://www.liferay.com/page/guest/documentation/development/properties
 182.298 +-->
 182.299 +<!ELEMENT show-portlet-inactive (#PCDATA)>
 182.300 +
 182.301 +<!--
 182.302 +Set the action-url-redirect value to true if an action URL for this portlet
 182.303 +should cause an auto redirect. This helps prevent double submits. The default
 182.304 +value is false.
 182.305 +-->
 182.306 +<!ELEMENT action-url-redirect (#PCDATA)>
 182.307 +
 182.308 +<!--
 182.309 +Set the restore-current-view value to true if the portlet restores to the
 182.310 +current view when toggling between maximized and normal states. If set to false,
 182.311 +the portlet will reset the current view when toggling between maximized and
 182.312 +normal states. The default value is true.
 182.313 +-->
 182.314 +<!ELEMENT restore-current-view (#PCDATA)>
 182.315 +
 182.316 +<!--
 182.317 +Set the maximize-edit value to true if the portlet goes into the maximized state
 182.318 +when the user goes into the edit mode. This only affects the default portal
 182.319 +icons and not what may be programmatically set by the portlet developer.
 182.320 +The default value is false.
 182.321 +-->
 182.322 +<!ELEMENT maximize-edit (#PCDATA)>
 182.323 +
 182.324 +<!--
 182.325 +Set the maximize-help value to true if the portlet goes into the maximized state
 182.326 +when the user goes into the help mode. This only affects the default portal
 182.327 +icons and not what may be programmatically set by the portlet developer.
 182.328 +The default value is false.
 182.329 +-->
 182.330 +<!ELEMENT maximize-help (#PCDATA)>
 182.331 +
 182.332 +<!--
 182.333 +Set the pop-up-print value to true if the portlet goes into the pop up state
 182.334 +when the user goes into the print mode. This only affects the default portal
 182.335 +icons and not what may be programmatically set by the portlet developer.
 182.336 +The default value is true.
 182.337 +-->
 182.338 +<!ELEMENT pop-up-print (#PCDATA)>
 182.339 +
 182.340 +<!--
 182.341 +Set the layout-cacheable flag to true if the data contained in this portlet can
 182.342 +will never change unless the layout or Journal portlet entry is changed.
 182.343 +-->
 182.344 +<!ELEMENT layout-cacheable (#PCDATA)>
 182.345 +
 182.346 +<!--
 182.347 +Set the instanceable value to true if the portlet can appear multiple times on a
 182.348 +page. If set to false, the portlet can only appear once on a page. The default
 182.349 +value is false.
 182.350 +-->
 182.351 +<!ELEMENT instanceable (#PCDATA)>
 182.352 +
 182.353 +<!--
 182.354 +Set the private-request-attributes value to true if the portlet does not share
 182.355 +request attributes with the portal or any other portlet. The default value is
 182.356 +true. The property "request.shared.attributes" in portal.properties specifies
 182.357 +which request attributes are shared even when the private-request-attributes
 182.358 +value is true.
 182.359 +-->
 182.360 +<!ELEMENT private-request-attributes (#PCDATA)>
 182.361 +
 182.362 +<!--
 182.363 +Set the private-session-attributes value to true if the portlet does not share
 182.364 +session attributes with the portal. The default value is true. The property
 182.365 +"session.shared.attributes" in portal.properties specifies which session
 182.366 +attributes are shared even when the private-session-attributes value is true.
 182.367 +-->
 182.368 +<!ELEMENT private-session-attributes (#PCDATA)>
 182.369 +
 182.370 +<!--
 182.371 +The default value of render-weight is 1. If set to a value less than 1, the
 182.372 +portlet is rendered in parallel. If set to a value of 1 or greater, then the
 182.373 +portlet is rendered serially. Portlets with a greater render weight have greater
 182.374 +priority and will be rendered before portlets with a lower render weight.
 182.375 +
 182.376 +If the ajaxable value is set to false, then render-weight is always set to 1
 182.377 +if it is set to a value less than 1. This means ajaxable can override
 182.378 +render-weight if ajaxable is set to false.
 182.379 +-->
 182.380 +<!ELEMENT render-weight (#PCDATA)>
 182.381 +
 182.382 +<!--
 182.383 +The default value of ajaxable is true. If set to false, then this portlet can
 182.384 +never be displayed via Ajax.
 182.385 +-->
 182.386 +<!ELEMENT ajaxable (#PCDATA)>
 182.387 +
 182.388 +<!--
 182.389 +Set the path of CSS that will be referenced in the page's header relative to the
 182.390 +portal's context path.
 182.391 +-->
 182.392 +<!ELEMENT header-portal-css (#PCDATA)>
 182.393 +
 182.394 +<!--
 182.395 +Set the path of CSS that will be referenced in the page's header relative to the
 182.396 +portlet's context path.
 182.397 +-->
 182.398 +<!ELEMENT header-portlet-css (#PCDATA)>
 182.399 +
 182.400 +<!--
 182.401 +Set the path of JavaScript that will be referenced in the page's header relative
 182.402 +to the portal's context path.
 182.403 +-->
 182.404 +<!ELEMENT header-portal-javascript (#PCDATA)>
 182.405 +
 182.406 +<!--
 182.407 +Set the path of JavaScript that will be referenced in the page's header relative
 182.408 +to the portlet's context path.
 182.409 +-->
 182.410 +<!ELEMENT header-portlet-javascript (#PCDATA)>
 182.411 +
 182.412 +<!--
 182.413 +Set the path of CSS that will be referenced in the page's footer relative to the
 182.414 +portal's context path.
 182.415 +-->
 182.416 +<!ELEMENT footer-portal-css (#PCDATA)>
 182.417 +
 182.418 +<!--
 182.419 +Set the path of CSS that will be referenced in the page's footer relative to the
 182.420 +portlet's context path.
 182.421 +-->
 182.422 +<!ELEMENT footer-portlet-css (#PCDATA)>
 182.423 +
 182.424 +<!--
 182.425 +Set the path of JavaScript that will be referenced in the page's footer relative
 182.426 +to the portal's context path.
 182.427 +-->
 182.428 +<!ELEMENT footer-portal-javascript (#PCDATA)>
 182.429 +
 182.430 +<!--
 182.431 +Set the path of JavaScript that will be referenced in the page's footer relative
 182.432 +to the portlet's context path.
 182.433 +-->
 182.434 +<!ELEMENT footer-portlet-javascript (#PCDATA)>
 182.435 +
 182.436 +<!--
 182.437 +Set name of the CSS class that will be injected in the DIV that wraps this
 182.438 +portlet.
 182.439 +-->
 182.440 +<!ELEMENT css-class-wrapper (#PCDATA)>
 182.441 +
 182.442 +<!--
 182.443 +If the add-default-resource value is set to false, and the portlet does not
 182.444 +belong to the page but has been dynamically added, then the user will see that
 182.445 +he does not have permissions to view the portlet. If the add-default-resource
 182.446 +value is set to true, the default portlet resources and permissions are added to
 182.447 +the page. The user can then view the portlet. Most portlets are harmless and can
 182.448 +benefit from this flexibility. However, to prevent security loop holes, the
 182.449 +default value is false.
 182.450 +-->
 182.451 +<!ELEMENT add-default-resource (#PCDATA)>
 182.452 +
 182.453 +<!--
 182.454 +Set the system value to true if the portlet is a system portlet that a user
 182.455 +cannot manually add to their page. The default value is false.
 182.456 +-->
 182.457 +<!ELEMENT system (#PCDATA)>
 182.458 +
 182.459 +<!--
 182.460 +Set the active value to true if the portlet is active and available to users.
 182.461 +If set to false, the portlet will not be active or available to users. The
 182.462 +default value is true.
 182.463 +
 182.464 +This value can be changed at runtime via the Admin portlet.
 182.465 +-->
 182.466 +<!ELEMENT active (#PCDATA)>
 182.467 +
 182.468 +<!--
 182.469 +Set the include value to true to if the portlet is available to the portal. If
 182.470 +set to false, the portlet is not available to the portal. The default value is
 182.471 +true.
 182.472 +
 182.473 +Portlets that are not included as part of the portal are never available to the
 182.474 +user to be made active or inactive. As far the user knows, the portlets do not
 182.475 +even exist in the system. This allows the Liferay developers to bundle a lot of
 182.476 +portlets in one core package, and yet allow custom deployments to turn on or off
 182.477 +individual portlets or sets of portlets. This follows the Siebel and Microsoft
 182.478 +model of bundling everything in one core package, but using XML configuration or
 182.479 +registry settings to turn on and off features or sets of features.
 182.480 +
 182.481 +We do not recommend that custom deployers modify the core source by removing
 182.482 +specific portlets because this prevents an easy upgrade process in the future.
 182.483 +The best way to turn on and off portlets is to set the include element. The
 182.484 +advantage of this way of doing things is that it becomes very easy to deploy
 182.485 +Liferay. All features are available in one package. The disadvantage is that by
 182.486 +not utilizing all of the portlets, you are wasting disk space and may even take
 182.487 +a small but static memory footprint. However, we feel that the extra disk space
 182.488 +and memory usage is a cheap price to pay in order to provide an easy
 182.489 +installation and upgrade path.
 182.490 +-->
 182.491 +<!ELEMENT include (#PCDATA)>
 182.492 +
 182.493 +<!--
 182.494 +The role-mapper contains two names specified by role-name and role-link. The
 182.495 +role-name value must be a role specified in portlet.xml. The role-link value
 182.496 +must be the name of a Liferay role that exists in the database. The role-mapper
 182.497 +element pairs up these two values to map roles from portlet.xml to roles in
 182.498 +the Liferay database.
 182.499 +
 182.500 +This is needed because Liferay roles may contain spaces whereas roles in
 182.501 +portlet.xml cannot contain spaces. This also adds extra flexibility where the
 182.502 +portlet vendor does not need to have any knowledge about Liferay's roles.
 182.503 +-->
 182.504 +<!ELEMENT role-mapper (role-name, role-link)>
 182.505 +
 182.506 +<!--
 182.507 +See the comments in role-mapper element.
 182.508 +-->
 182.509 +<!ELEMENT role-name (#PCDATA)>
 182.510 +
 182.511 +<!--
 182.512 +See the comments in role-mapper element.
 182.513 +-->
 182.514 +<!ELEMENT role-link (#PCDATA)>
 182.515 +
 182.516 +<!--
 182.517 +The custom-user-attribute contains a list of names that are retrieved using a
 182.518 +custom class that extends com.liferay.portlet.CustomUserAttributes.
 182.519 +
 182.520 +Download the sample hot deployable portlet WAR named test.war. Look for the
 182.521 +class com.liferay.portlet.teststruts.TestStrutsUserAttributes to see how it
 182.522 +associates the custom user attribute "user.name.test" with the value
 182.523 +"Test Name". This class could be modified to read custom user attributes from
 182.524 +another datasource that may be a database, a LDAP server, or a web service.
 182.525 +
 182.526 +See:
 182.527 +
 182.528 +http://www.liferay.com/page/guest/documentation/development/hot_deploy
 182.529 +-->
 182.530 +<!ELEMENT custom-user-attribute (name+, custom-class)>
 182.531 +
 182.532 +<!--
 182.533 +See the comments in custom-user-attribute element.
 182.534 +-->
 182.535 +<!ELEMENT name (#PCDATA)>
 182.536 +
 182.537 +<!--
 182.538 +See the comments in custom-user-attribute element.
 182.539 +-->
 182.540 +<!ELEMENT custom-class (#PCDATA)>
 182.541 \ No newline at end of file
   183.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   183.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_5_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   183.3 @@ -0,0 +1,567 @@
   183.4 +<!--
   183.5 +This is the DTD for the Portlet Application parameters that are specific to
   183.6 +Liferay Portal.
   183.7 +
   183.8 +<!DOCTYPE liferay-portlet-app PUBLIC
   183.9 +	"-//Liferay//DTD Portlet Application 5.0.0//EN"
  183.10 +	"http://www.liferay.com/dtd/liferay-portlet-app_5_0_0.dtd">
  183.11 +-->
  183.12 +
  183.13 +<!--
  183.14 +The liferay-portlet-app element is the root of the deployment descriptor for
  183.15 +a Liferay portlet application.
  183.16 +-->
  183.17 +<!ELEMENT liferay-portlet-app (portlet*, role-mapper*, custom-user-attribute*)>
  183.18 +
  183.19 +<!--
  183.20 +The portlet element contains the declarative data of a portlet.
  183.21 +-->
  183.22 +<!ELEMENT portlet (portlet-name, icon?, virtual-path?, struts-path?,
  183.23 +configuration-path?, configuration-action-class?, indexer-class?,
  183.24 +open-search-class?, scheduler-class?, portlet-url-class?,
  183.25 +friendly-url-mapper-class?, url-encoder-class?, portlet-data-handler-class?,
  183.26 +portlet-layout-listener-class?, pop-message-listener-class?,
  183.27 +social-activity-interpreter-class?, social-request-interpreter-class?,
  183.28 +preferences-company-wide?, preferences-unique-per-layout?,
  183.29 +preferences-owned-by-group?, use-default-template?, show-portlet-access-denied?,
  183.30 +show-portlet-inactive?, action-url-redirect?, restore-current-view?,
  183.31 +maximize-edit?, maximize-help?, pop-up-print?, layout-cacheable?, instanceable?,
  183.32 +user-principal-strategy?, private-request-attributes?,
  183.33 +private-session-attributes?, render-weight?, ajaxable?, header-portal-css*,
  183.34 +header-portlet-css*, header-portal-javascript*, header-portlet-javascript*,
  183.35 +footer-portal-css*, footer-portlet-css*, footer-portal-javascript*,
  183.36 +footer-portlet-javascript*, css-class-wrapper?, facebook-integration?,
  183.37 +add-default-resource?, system?, active?, include?)>
  183.38 +
  183.39 +<!--
  183.40 +The portlet-name element contains the unique name of the portlet. This name must
  183.41 +match the portlet-name specified in portlet.xml.
  183.42 +-->
  183.43 +<!ELEMENT portlet-name (#PCDATA)>
  183.44 +
  183.45 +<!--
  183.46 +The icon element specifies an image that represents the portlet.
  183.47 +-->
  183.48 +<!ELEMENT icon (#PCDATA)>
  183.49 +
  183.50 +<!--
  183.51 +The virtual-path value sets the virtual path used to override the default
  183.52 +servlet context path.
  183.53 +
  183.54 +For example, suppose your portlet is deployed to the servlet path
  183.55 +"/test-portlet". By default, the portal will return "/test-portlet" for the
  183.56 +servlet context path. You can override it by setting virtual-path to "/virtual"
  183.57 +and have the portal return "/virtual" for the servlet context path.
  183.58 +
  183.59 +The default value is "" which means this is not used.
  183.60 +-->
  183.61 +<!ELEMENT virtual-path (#PCDATA)>
  183.62 +
  183.63 +<!--
  183.64 +Supppose the struts-path value is "mail". This tells the portal that all
  183.65 +requests with the path mail/* are considered part of this portlet's scope. Users
  183.66 +who request paths that match mail/* will only be granted access if they also
  183.67 +have access to this portlet. This is true for both portlet requests and regular
  183.68 +servlet requests.
  183.69 +-->
  183.70 +<!ELEMENT struts-path (#PCDATA)>
  183.71 +
  183.72 +<!--
  183.73 +The configuration-path value is no longer available. Use
  183.74 +configuration-action-class instead.
  183.75 +-->
  183.76 +<!ELEMENT configuration-path (#PCDATA)>
  183.77 +
  183.78 +<!--
  183.79 +The configuration-action-class value must be a class that implements
  183.80 +com.liferay.portal.kernel.portlet.ConfigurationAction and is called to allow
  183.81 +users to configure the portlet at runtime.
  183.82 +
  183.83 +See:
  183.84 +
  183.85 +http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/messageboards/action/ConfigurationActionImpl.html
  183.86 +-->
  183.87 +<!ELEMENT configuration-action-class (#PCDATA)>
  183.88 +
  183.89 +<!--
  183.90 +The indexer-class value must be a class that implements
  183.91 +com.liferay.portal.kernel.search.Indexer and is called to create or update a
  183.92 +search index for the portlet.
  183.93 +
  183.94 +See:
  183.95 +
  183.96 +http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/messageboards/util/Indexer.html
  183.97 +http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/search/Indexer.html
  183.98 +http://lucene.apache.org
  183.99 +-->
 183.100 +<!ELEMENT indexer-class (#PCDATA)>
 183.101 +
 183.102 +<!--
 183.103 +The open-search-class value must be a class that implements
 183.104 +com.liferay.portal.kernel.search.OpenSearch and is called to get search results
 183.105 +in the OpenSearch 1.1 standard.
 183.106 +
 183.107 +See:
 183.108 +
 183.109 +http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/alfrescocontent/util/OpenSearch.html
 183.110 +http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/search/OpenSearch.html
 183.111 +http://www.opensearch.org
 183.112 +-->
 183.113 +<!ELEMENT open-search-class (#PCDATA)>
 183.114 +
 183.115 +<!--
 183.116 +The scheduler-class value must be a class that implements
 183.117 +com.liferay.portal.kernel.job.Scheduler and is called to schedule jobs for this
 183.118 +portlet.
 183.119 +
 183.120 +See:
 183.121 +
 183.122 +http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/calendar/job/CalendarScheduler.html
 183.123 +http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/job/Scheduler.html
 183.124 +http://www.opensymphony.com/quartz
 183.125 +-->
 183.126 +<!ELEMENT scheduler-class (#PCDATA)>
 183.127 +
 183.128 +<!--
 183.129 +The portlet-url-class value must be a class that extends
 183.130 +com.liferay.portlet.PortletURLImplWrapper. Set this class to override the
 183.131 +default portlet URL implementation.
 183.132 +
 183.133 +See:
 183.134 +
 183.135 +http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portal/struts/StrutsActionPortletURL.html
 183.136 +-->
 183.137 +<!ELEMENT portlet-url-class (#PCDATA)>
 183.138 +
 183.139 +<!--
 183.140 +The friendly-url-mapper-class value must be a class that implements
 183.141 +com.liferay.portal.kernel.portlet.FriendlyURLMapper. Use this if content inside
 183.142 +a portlet needs to have a friendly URL. See the Message Boards portlet for an
 183.143 +example of its uses.
 183.144 +
 183.145 +See:
 183.146 +
 183.147 +http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/messageboards/MBFriendlyURLMapper.html
 183.148 +http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/portlet/FriendlyURLMapper.html
 183.149 +-->
 183.150 +<!ELEMENT friendly-url-mapper-class (#PCDATA)>
 183.151 +
 183.152 +<!--
 183.153 +The url-encoder-class value must be a class that implements
 183.154 +com.liferay.portal.kernel.servlet.URLEncoder. Use this to set a custom
 183.155 +URLEncoder that is used by the RenderResponse class to implement the encodeURL
 183.156 +method. This is useful if you need to add custom logic to rewrite URLs.
 183.157 +-->
 183.158 +<!ELEMENT url-encoder-class (#PCDATA)>
 183.159 +
 183.160 +<!--
 183.161 +The portlet-data-handler-class value must be a class that implements
 183.162 +com.liferay.portal.kernel.lar.PortletDataHandler and is called when archiving
 183.163 +tasks are run.
 183.164 +
 183.165 +See:
 183.166 +
 183.167 +http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/journal/lar/PortletDataHandlerImpl.html
 183.168 +http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/lar/PortletDataHandler.html
 183.169 +-->
 183.170 +<!ELEMENT portlet-data-handler-class (#PCDATA)>
 183.171 +
 183.172 +<!--
 183.173 +The portlet-layout-listener-class value must be a class that implements
 183.174 +com.liferay.portal.kernel.portlet.PortletLayoutListener and is called when a portlet
 183.175 +is added, moved, or removed from a layout.
 183.176 +
 183.177 +See:
 183.178 +
 183.179 +http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/journalcontent/JournalContentPortletLayoutListener.html
 183.180 +http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/portlet/PortletLayoutListener.html
 183.181 +-->
 183.182 +<!ELEMENT portlet-layout-listener-class (#PCDATA)>
 183.183 +
 183.184 +<!--
 183.185 +The pop-message-listener-class value must be a class that implements
 183.186 +com.liferay.portal.kernel.pop.MessageListener and is called when processing
 183.187 +emails.
 183.188 +
 183.189 +See:
 183.190 +
 183.191 +http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/messageboards/pop/MessageListenerImpl.html
 183.192 +http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/pop/MessageListener.html
 183.193 +-->
 183.194 +<!ELEMENT pop-message-listener-class (#PCDATA)>
 183.195 +
 183.196 +<!--
 183.197 +The social-activity-interpreter-class value must be a class that implements
 183.198 +com.liferay.portlet.social.model.SocialActivityInterpreter and is called to
 183.199 +interpret activities into friendly messages that are easily understandable by a
 183.200 +human being.
 183.201 +
 183.202 +See:
 183.203 +
 183.204 +http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/messageboards/social/MBActivityInterpreter.html
 183.205 +http://docs.liferay.com/5.0/javadocs/portal-service/com/liferay/portlet/social/model/SocialActivityInterpreter.html
 183.206 +-->
 183.207 +<!ELEMENT social-activity-interpreter-class (#PCDATA)>
 183.208 +
 183.209 +<!--
 183.210 +The social-request-interpreter-class value must be a class that implements
 183.211 +com.liferay.portlet.social.model.SocialRequestInterpreter and is called to
 183.212 +interpret requests into friendly messages that are easily understandable by a
 183.213 +human being.
 183.214 +
 183.215 +See:
 183.216 +
 183.217 +http://docs.liferay.com/5.0/javadocs/portal-service/com/liferay/portlet/social/model/SocialRequestInterpreter.html
 183.218 +-->
 183.219 +<!ELEMENT social-request-interpreter-class (#PCDATA)>
 183.220 +
 183.221 +<!--
 183.222 +Set the preferences-company-wide value to true if the preferences for the
 183.223 +portlet are across the entire company. Setting this value to true means
 183.224 +the value for preferences-unique-per-layout and preferences-owned-by-group are
 183.225 +not used. The default value is false.
 183.226 +
 183.227 +For example, an administrator could set the preferences to an Announcements
 183.228 +portlet that would save a message in the portlet's preferences. This message
 183.229 +would then be used across all pages for that company. The portlet must not be
 183.230 +instanceable because instanceable portlets have uniquely generated portlet ids.
 183.231 +
 183.232 +The default behavior of the bundled Announcements portlet sets the instanceable
 183.233 +value to true so that normal users cannot create company wide messages. A future
 183.234 +release would include permissions for the edit mode versus the view mode which
 183.235 +would allow an administrator to set the message while users would just view the
 183.236 +message.
 183.237 +-->
 183.238 +<!ELEMENT preferences-company-wide (#PCDATA)>
 183.239 +
 183.240 +<!--
 183.241 +Set the preferences-unique-per-layout value to true if the preferences for the
 183.242 +portlet are unique across all pages. If set to false, the preferences for the
 183.243 +portlet are shared across all pages. The default value is true.
 183.244 +
 183.245 +The preferences-unique-per-layout element is used in combination with the
 183.246 +preferences-owned-by-group element. See the comments for the
 183.247 +preferences-owned-by-group element for more information.
 183.248 +-->
 183.249 +<!ELEMENT preferences-unique-per-layout (#PCDATA)>
 183.250 +
 183.251 +<!--
 183.252 +Set the preferences-owned-by-group value to true if the preferences for the
 183.253 +portlet are owned by the group when the portlet is shown in a group page. If
 183.254 +set to false, the preferences are owned by the user at all times. The default
 183.255 +value is true.
 183.256 +
 183.257 +Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 183.258 +preferences-owned-by-group set to false. Users can set a different list of
 183.259 +stocks for every personal page. Users can set a different list of stocks for
 183.260 +every community page.
 183.261 +
 183.262 +Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 183.263 +preferences-owned-by-group set to false. Users can set one list of stocks to be
 183.264 +shared across all personal pages. Users can set one list of stocks to be shared
 183.265 +across a community's set of pages.
 183.266 +
 183.267 +Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 183.268 +preferences-owned-by-group set to true. Users can set a different list of stocks
 183.269 +for every personal page. Administrators set the portlet preferences for users in
 183.270 +a community page. Administrators can set a different list of stocks for every
 183.271 +community page that are then shared by all users within a community.
 183.272 +
 183.273 +Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 183.274 +preferences-owned-by-group set to true. Users can set one list of stocks to be
 183.275 +shared across all personal pages. Administrators set the portlet preferences for
 183.276 +users in a community page. Administrators can set one list of stocks to be
 183.277 +shared by all users across a community's set of pages.
 183.278 +-->
 183.279 +<!ELEMENT preferences-owned-by-group (#PCDATA)>
 183.280 +
 183.281 +<!--
 183.282 +Set the use-default-template value to true if the portlet uses the default
 183.283 +template to decorate and wrap content. Setting this to false allows the
 183.284 +developer to own and maintain the portlet's entire outputted content. The
 183.285 +default value is true.
 183.286 +
 183.287 +The most common use of this is if you want the portlet to look different from
 183.288 +the other portlets or if you want the portlet to not have borders around the
 183.289 +outputted content.
 183.290 +-->
 183.291 +<!ELEMENT use-default-template (#PCDATA)>
 183.292 +
 183.293 +<!--
 183.294 +Set the show-portlet-access-denied value to true if users are shown the portlet
 183.295 +with an access denied message if they do not have access to the portlet. If set
 183.296 +to false, users are never shown the portlet if they do not have access to the
 183.297 +portlet. The default value is set in portal.properties.
 183.298 +
 183.299 +See:
 183.300 +
 183.301 +http://www.liferay.com/page/guest/documentation/development/properties
 183.302 +-->
 183.303 +<!ELEMENT show-portlet-access-denied (#PCDATA)>
 183.304 +
 183.305 +<!--
 183.306 +Set the show-portlet-inactive value to true if users are shown the portlet
 183.307 +with an inactive message if the portlet is inactive. If set to false, users are
 183.308 +never shown the portlet if the portlet is inactive. The default value is set in
 183.309 +portal.properties.
 183.310 +
 183.311 +http://www.liferay.com/page/guest/documentation/development/properties
 183.312 +-->
 183.313 +<!ELEMENT show-portlet-inactive (#PCDATA)>
 183.314 +
 183.315 +<!--
 183.316 +Set the action-url-redirect value to true if an action URL for this portlet
 183.317 +should cause an auto redirect. This helps prevent double submits. The default
 183.318 +value is false.
 183.319 +-->
 183.320 +<!ELEMENT action-url-redirect (#PCDATA)>
 183.321 +
 183.322 +<!--
 183.323 +Set the restore-current-view value to true if the portlet restores to the
 183.324 +current view when toggling between maximized and normal states. If set to false,
 183.325 +the portlet will reset the current view when toggling between maximized and
 183.326 +normal states. The default value is true.
 183.327 +-->
 183.328 +<!ELEMENT restore-current-view (#PCDATA)>
 183.329 +
 183.330 +<!--
 183.331 +Set the maximize-edit value to true if the portlet goes into the maximized state
 183.332 +when the user goes into the edit mode. This only affects the default portal
 183.333 +icons and not what may be programmatically set by the portlet developer.
 183.334 +The default value is false.
 183.335 +-->
 183.336 +<!ELEMENT maximize-edit (#PCDATA)>
 183.337 +
 183.338 +<!--
 183.339 +Set the maximize-help value to true if the portlet goes into the maximized state
 183.340 +when the user goes into the help mode. This only affects the default portal
 183.341 +icons and not what may be programmatically set by the portlet developer.
 183.342 +The default value is false.
 183.343 +-->
 183.344 +<!ELEMENT maximize-help (#PCDATA)>
 183.345 +
 183.346 +<!--
 183.347 +Set the pop-up-print value to true if the portlet goes into the pop up state
 183.348 +when the user goes into the print mode. This only affects the default portal
 183.349 +icons and not what may be programmatically set by the portlet developer.
 183.350 +The default value is true.
 183.351 +-->
 183.352 +<!ELEMENT pop-up-print (#PCDATA)>
 183.353 +
 183.354 +<!--
 183.355 +Set the layout-cacheable flag to true if the data contained in this portlet can
 183.356 +will never change unless the layout or Journal portlet entry is changed.
 183.357 +-->
 183.358 +<!ELEMENT layout-cacheable (#PCDATA)>
 183.359 +
 183.360 +<!--
 183.361 +Set the instanceable value to true if the portlet can appear multiple times on a
 183.362 +page. If set to false, the portlet can only appear once on a page. The default
 183.363 +value is false.
 183.364 +-->
 183.365 +<!ELEMENT instanceable (#PCDATA)>
 183.366 +
 183.367 +<!--
 183.368 +Set the user-principal-strategy value to either "userId" or "screenName".
 183.369 +Calling request.getRemoteUser() will normally return the user id. However, some
 183.370 +portlets may need the user principal returned to be screen name instead.
 183.371 +-->
 183.372 +<!ELEMENT user-principal-strategy (#PCDATA)>
 183.373 +
 183.374 +<!--
 183.375 +Set the private-request-attributes value to true if the portlet does not share
 183.376 +request attributes with the portal or any other portlet. The default value is
 183.377 +true. The property "request.shared.attributes" in portal.properties specifies
 183.378 +which request attributes are shared even when the private-request-attributes
 183.379 +value is true.
 183.380 +-->
 183.381 +<!ELEMENT private-request-attributes (#PCDATA)>
 183.382 +
 183.383 +<!--
 183.384 +Set the private-session-attributes value to true if the portlet does not share
 183.385 +session attributes with the portal. The default value is true. The property
 183.386 +"session.shared.attributes" in portal.properties specifies which session
 183.387 +attributes are shared even when the private-session-attributes value is true.
 183.388 +-->
 183.389 +<!ELEMENT private-session-attributes (#PCDATA)>
 183.390 +
 183.391 +<!--
 183.392 +The default value of render-weight is 1. If set to a value less than 1, the
 183.393 +portlet is rendered in parallel. If set to a value of 1 or greater, then the
 183.394 +portlet is rendered serially. Portlets with a greater render weight have greater
 183.395 +priority and will be rendered before portlets with a lower render weight.
 183.396 +
 183.397 +If the ajaxable value is set to false, then render-weight is always set to 1
 183.398 +if it is set to a value less than 1. This means ajaxable can override
 183.399 +render-weight if ajaxable is set to false.
 183.400 +-->
 183.401 +<!ELEMENT render-weight (#PCDATA)>
 183.402 +
 183.403 +<!--
 183.404 +The default value of ajaxable is true. If set to false, then this portlet can
 183.405 +never be displayed via Ajax.
 183.406 +-->
 183.407 +<!ELEMENT ajaxable (#PCDATA)>
 183.408 +
 183.409 +<!--
 183.410 +Set the path of CSS that will be referenced in the page's header relative to the
 183.411 +portal's context path.
 183.412 +-->
 183.413 +<!ELEMENT header-portal-css (#PCDATA)>
 183.414 +
 183.415 +<!--
 183.416 +Set the path of CSS that will be referenced in the page's header relative to the
 183.417 +portlet's context path.
 183.418 +-->
 183.419 +<!ELEMENT header-portlet-css (#PCDATA)>
 183.420 +
 183.421 +<!--
 183.422 +Set the path of JavaScript that will be referenced in the page's header relative
 183.423 +to the portal's context path.
 183.424 +-->
 183.425 +<!ELEMENT header-portal-javascript (#PCDATA)>
 183.426 +
 183.427 +<!--
 183.428 +Set the path of JavaScript that will be referenced in the page's header relative
 183.429 +to the portlet's context path.
 183.430 +-->
 183.431 +<!ELEMENT header-portlet-javascript (#PCDATA)>
 183.432 +
 183.433 +<!--
 183.434 +Set the path of CSS that will be referenced in the page's footer relative to the
 183.435 +portal's context path.
 183.436 +-->
 183.437 +<!ELEMENT footer-portal-css (#PCDATA)>
 183.438 +
 183.439 +<!--
 183.440 +Set the path of CSS that will be referenced in the page's footer relative to the
 183.441 +portlet's context path.
 183.442 +-->
 183.443 +<!ELEMENT footer-portlet-css (#PCDATA)>
 183.444 +
 183.445 +<!--
 183.446 +Set the path of JavaScript that will be referenced in the page's footer relative
 183.447 +to the portal's context path.
 183.448 +-->
 183.449 +<!ELEMENT footer-portal-javascript (#PCDATA)>
 183.450 +
 183.451 +<!--
 183.452 +Set the path of JavaScript that will be referenced in the page's footer relative
 183.453 +to the portlet's context path.
 183.454 +-->
 183.455 +<!ELEMENT footer-portlet-javascript (#PCDATA)>
 183.456 +
 183.457 +<!--
 183.458 +Set name of the CSS class that will be injected in the DIV that wraps this
 183.459 +portlet.
 183.460 +-->
 183.461 +<!ELEMENT css-class-wrapper (#PCDATA)>
 183.462 +
 183.463 +<!--
 183.464 +Set the facebook-integration value to either "fbml" or "iframe". The default
 183.465 +value is "iframe" because IFrame integration will work without requiring any
 183.466 +changes to your code. See the Message Boards portlet for minor changes that were
 183.467 +made to make it FBML compliant. Note that the Liferay tag libraries already
 183.468 +output FBML automatically if a request is made by Facebook.
 183.469 +-->
 183.470 +<!ELEMENT facebook-integration (#PCDATA)>
 183.471 +
 183.472 +<!--
 183.473 +If the add-default-resource value is set to false, and the portlet does not
 183.474 +belong to the page but has been dynamically added, then the user will see that
 183.475 +he does not have permissions to view the portlet. If the add-default-resource
 183.476 +value is set to true, the default portlet resources and permissions are added to
 183.477 +the page. The user can then view the portlet. Most portlets are harmless and can
 183.478 +benefit from this flexibility. However, to prevent security loop holes, the
 183.479 +default value is false.
 183.480 +-->
 183.481 +<!ELEMENT add-default-resource (#PCDATA)>
 183.482 +
 183.483 +<!--
 183.484 +Set the system value to true if the portlet is a system portlet that a user
 183.485 +cannot manually add to their page. The default value is false.
 183.486 +-->
 183.487 +<!ELEMENT system (#PCDATA)>
 183.488 +
 183.489 +<!--
 183.490 +Set the active value to true if the portlet is active and available to users.
 183.491 +If set to false, the portlet will not be active or available to users. The
 183.492 +default value is true.
 183.493 +
 183.494 +This value can be changed at runtime via the Admin portlet.
 183.495 +-->
 183.496 +<!ELEMENT active (#PCDATA)>
 183.497 +
 183.498 +<!--
 183.499 +Set the include value to true to if the portlet is available to the portal. If
 183.500 +set to false, the portlet is not available to the portal. The default value is
 183.501 +true.
 183.502 +
 183.503 +Portlets that are not included as part of the portal are never available to the
 183.504 +user to be made active or inactive. As far the user knows, the portlets do not
 183.505 +even exist in the system. This allows the Liferay developers to bundle a lot of
 183.506 +portlets in one core package, and yet allow custom deployments to turn on or off
 183.507 +individual portlets or sets of portlets. This follows the Siebel and Microsoft
 183.508 +model of bundling everything in one core package, but using XML configuration or
 183.509 +registry settings to turn on and off features or sets of features.
 183.510 +
 183.511 +We do not recommend that custom deployers modify the core source by removing
 183.512 +specific portlets because this prevents an easy upgrade process in the future.
 183.513 +The best way to turn on and off portlets is to set the include element. The
 183.514 +advantage of this way of doing things is that it becomes very easy to deploy
 183.515 +Liferay. All features are available in one package. The disadvantage is that by
 183.516 +not utilizing all of the portlets, you are wasting disk space and may even take
 183.517 +a small but static memory footprint. However, we feel that the extra disk space
 183.518 +and memory usage is a cheap price to pay in order to provide an easy
 183.519 +installation and upgrade path.
 183.520 +-->
 183.521 +<!ELEMENT include (#PCDATA)>
 183.522 +
 183.523 +<!--
 183.524 +The role-mapper contains two names specified by role-name and role-link. The
 183.525 +role-name value must be a role specified in portlet.xml. The role-link value
 183.526 +must be the name of a Liferay role that exists in the database. The role-mapper
 183.527 +element pairs up these two values to map roles from portlet.xml to roles in
 183.528 +the Liferay database.
 183.529 +
 183.530 +This is needed because Liferay roles may contain spaces whereas roles in
 183.531 +portlet.xml cannot contain spaces. This also adds extra flexibility where the
 183.532 +portlet vendor does not need to have any knowledge about Liferay's roles.
 183.533 +-->
 183.534 +<!ELEMENT role-mapper (role-name, role-link)>
 183.535 +
 183.536 +<!--
 183.537 +See the comments in role-mapper element.
 183.538 +-->
 183.539 +<!ELEMENT role-name (#PCDATA)>
 183.540 +
 183.541 +<!--
 183.542 +See the comments in role-mapper element.
 183.543 +-->
 183.544 +<!ELEMENT role-link (#PCDATA)>
 183.545 +
 183.546 +<!--
 183.547 +The custom-user-attribute contains a list of names that are retrieved using a
 183.548 +custom class that extends com.liferay.portlet.CustomUserAttributes.
 183.549 +
 183.550 +Download the sample hot deployable portlet WAR named test.war. Look for the
 183.551 +class com.sample.strutsliferay.portlet.SampleUserAttributes to see how it
 183.552 +associates the custom user attribute "user.name.test" with the value
 183.553 +"Test Name". This class could be modified to read custom user attributes from
 183.554 +another datasource that may be a database, a LDAP server, or a web service.
 183.555 +
 183.556 +See:
 183.557 +
 183.558 +http://www.liferay.com/page/guest/documentation/development/hot_deploy
 183.559 +-->
 183.560 +<!ELEMENT custom-user-attribute (name+, custom-class)>
 183.561 +
 183.562 +<!--
 183.563 +See the comments in custom-user-attribute element.
 183.564 +-->
 183.565 +<!ELEMENT name (#PCDATA)>
 183.566 +
 183.567 +<!--
 183.568 +See the comments in custom-user-attribute element.
 183.569 +-->
 183.570 +<!ELEMENT custom-class (#PCDATA)>
 183.571 \ No newline at end of file
   184.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   184.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_5_1_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   184.3 @@ -0,0 +1,567 @@
   184.4 +<!--
   184.5 +This is the DTD for the Portlet Application parameters that are specific to
   184.6 +Liferay Portal.
   184.7 +
   184.8 +<!DOCTYPE liferay-portlet-app PUBLIC
   184.9 +	"-//Liferay//DTD Portlet Application 5.1.0//EN"
  184.10 +	"http://www.liferay.com/dtd/liferay-portlet-app_5_1_0.dtd">
  184.11 +-->
  184.12 +
  184.13 +<!--
  184.14 +The liferay-portlet-app element is the root of the deployment descriptor for
  184.15 +a Liferay portlet application.
  184.16 +-->
  184.17 +<!ELEMENT liferay-portlet-app (portlet*, role-mapper*, custom-user-attribute*)>
  184.18 +
  184.19 +<!--
  184.20 +The portlet element contains the declarative data of a portlet.
  184.21 +-->
  184.22 +<!ELEMENT portlet (portlet-name, icon?, virtual-path?, struts-path?,
  184.23 +configuration-path?, configuration-action-class?, indexer-class?,
  184.24 +open-search-class?, scheduler-class?, portlet-url-class?,
  184.25 +friendly-url-mapper-class?, url-encoder-class?, portlet-data-handler-class?,
  184.26 +portlet-layout-listener-class?, pop-message-listener-class?,
  184.27 +social-activity-interpreter-class?, social-request-interpreter-class?,
  184.28 +preferences-company-wide?, preferences-unique-per-layout?,
  184.29 +preferences-owned-by-group?, use-default-template?, show-portlet-access-denied?,
  184.30 +show-portlet-inactive?, action-url-redirect?, restore-current-view?,
  184.31 +maximize-edit?, maximize-help?, pop-up-print?, layout-cacheable?, instanceable?,
  184.32 +user-principal-strategy?, private-request-attributes?,
  184.33 +private-session-attributes?, render-weight?, ajaxable?, header-portal-css*,
  184.34 +header-portlet-css*, header-portal-javascript*, header-portlet-javascript*,
  184.35 +footer-portal-css*, footer-portlet-css*, footer-portal-javascript*,
  184.36 +footer-portlet-javascript*, css-class-wrapper?, facebook-integration?,
  184.37 +add-default-resource?, system?, active?, include?)>
  184.38 +
  184.39 +<!--
  184.40 +The portlet-name element contains the unique name of the portlet. This name must
  184.41 +match the portlet-name specified in portlet.xml.
  184.42 +-->
  184.43 +<!ELEMENT portlet-name (#PCDATA)>
  184.44 +
  184.45 +<!--
  184.46 +The icon element specifies an image that represents the portlet.
  184.47 +-->
  184.48 +<!ELEMENT icon (#PCDATA)>
  184.49 +
  184.50 +<!--
  184.51 +The virtual-path value sets the virtual path used to override the default
  184.52 +servlet context path.
  184.53 +
  184.54 +For example, suppose your portlet is deployed to the servlet path
  184.55 +"/test-portlet". By default, the portal will return "/test-portlet" for the
  184.56 +servlet context path. You can override it by setting virtual-path to "/virtual"
  184.57 +and have the portal return "/virtual" for the servlet context path.
  184.58 +
  184.59 +The default value is "" which means this is not used.
  184.60 +-->
  184.61 +<!ELEMENT virtual-path (#PCDATA)>
  184.62 +
  184.63 +<!--
  184.64 +Supppose the struts-path value is "mail". This tells the portal that all
  184.65 +requests with the path mail/* are considered part of this portlet's scope. Users
  184.66 +who request paths that match mail/* will only be granted access if they also
  184.67 +have access to this portlet. This is true for both portlet requests and regular
  184.68 +servlet requests.
  184.69 +-->
  184.70 +<!ELEMENT struts-path (#PCDATA)>
  184.71 +
  184.72 +<!--
  184.73 +The configuration-path value is no longer available. Use
  184.74 +configuration-action-class instead.
  184.75 +-->
  184.76 +<!ELEMENT configuration-path (#PCDATA)>
  184.77 +
  184.78 +<!--
  184.79 +The configuration-action-class value must be a class that implements
  184.80 +com.liferay.portal.kernel.portlet.ConfigurationAction and is called to allow
  184.81 +users to configure the portlet at runtime.
  184.82 +
  184.83 +See:
  184.84 +
  184.85 +http://docs.liferay.com/portal/5.1/javadocs/portal-impl/com/liferay/portlet/messageboards/action/ConfigurationActionImpl.html
  184.86 +-->
  184.87 +<!ELEMENT configuration-action-class (#PCDATA)>
  184.88 +
  184.89 +<!--
  184.90 +The indexer-class value must be a class that implements
  184.91 +com.liferay.portal.kernel.search.Indexer and is called to create or update a
  184.92 +search index for the portlet.
  184.93 +
  184.94 +See:
  184.95 +
  184.96 +http://docs.liferay.com/portal/5.1/javadocs/portal-impl/com/liferay/portlet/messageboards/util/Indexer.html
  184.97 +http://docs.liferay.com/portal/5.1/javadocs/portal-kernel/com/liferay/portal/kernel/search/Indexer.html
  184.98 +http://lucene.apache.org
  184.99 +-->
 184.100 +<!ELEMENT indexer-class (#PCDATA)>
 184.101 +
 184.102 +<!--
 184.103 +The open-search-class value must be a class that implements
 184.104 +com.liferay.portal.kernel.search.OpenSearch and is called to get search results
 184.105 +in the OpenSearch 1.1 standard.
 184.106 +
 184.107 +See:
 184.108 +
 184.109 +http://docs.liferay.com/portal/5.1/javadocs/portal-impl/com/liferay/portlet/alfrescocontent/util/OpenSearch.html
 184.110 +http://docs.liferay.com/portal/5.1/javadocs/portal-kernel/com/liferay/portal/kernel/search/OpenSearch.html
 184.111 +http://www.opensearch.org
 184.112 +-->
 184.113 +<!ELEMENT open-search-class (#PCDATA)>
 184.114 +
 184.115 +<!--
 184.116 +The scheduler-class value must be a class that implements
 184.117 +com.liferay.portal.kernel.job.Scheduler and is called to schedule jobs for this
 184.118 +portlet.
 184.119 +
 184.120 +See:
 184.121 +
 184.122 +http://docs.liferay.com/portal/5.1/javadocs/portal-impl/com/liferay/portlet/calendar/job/CalendarScheduler.html
 184.123 +http://docs.liferay.com/portal/5.1/javadocs/portal-kernel/com/liferay/portal/kernel/job/Scheduler.html
 184.124 +http://www.opensymphony.com/quartz
 184.125 +-->
 184.126 +<!ELEMENT scheduler-class (#PCDATA)>
 184.127 +
 184.128 +<!--
 184.129 +The portlet-url-class value must be a class that extends
 184.130 +com.liferay.portlet.PortletURLImplWrapper. Set this class to override the
 184.131 +default portlet URL implementation.
 184.132 +
 184.133 +See:
 184.134 +
 184.135 +http://docs.liferay.com/portal/5.1/javadocs/portal-impl/com/liferay/portal/struts/StrutsActionPortletURL.html
 184.136 +-->
 184.137 +<!ELEMENT portlet-url-class (#PCDATA)>
 184.138 +
 184.139 +<!--
 184.140 +The friendly-url-mapper-class value must be a class that implements
 184.141 +com.liferay.portal.kernel.portlet.FriendlyURLMapper. Use this if content inside
 184.142 +a portlet needs to have a friendly URL. See the Message Boards portlet for an
 184.143 +example of its uses.
 184.144 +
 184.145 +See:
 184.146 +
 184.147 +http://docs.liferay.com/portal/5.1/javadocs/portal-impl/com/liferay/portlet/messageboards/MBFriendlyURLMapper.html
 184.148 +http://docs.liferay.com/portal/5.1/javadocs/portal-kernel/com/liferay/portal/kernel/portlet/FriendlyURLMapper.html
 184.149 +-->
 184.150 +<!ELEMENT friendly-url-mapper-class (#PCDATA)>
 184.151 +
 184.152 +<!--
 184.153 +The url-encoder-class value must be a class that implements
 184.154 +com.liferay.portal.kernel.servlet.URLEncoder. Use this to set a custom
 184.155 +URLEncoder that is used by the RenderResponse class to implement the encodeURL
 184.156 +method. This is useful if you need to add custom logic to rewrite URLs.
 184.157 +-->
 184.158 +<!ELEMENT url-encoder-class (#PCDATA)>
 184.159 +
 184.160 +<!--
 184.161 +The portlet-data-handler-class value must be a class that implements
 184.162 +com.liferay.portal.kernel.lar.PortletDataHandler and is called when archiving
 184.163 +tasks are run.
 184.164 +
 184.165 +See:
 184.166 +
 184.167 +http://docs.liferay.com/portal/5.1/javadocs/portal-impl/com/liferay/portlet/journal/lar/PortletDataHandlerImpl.html
 184.168 +http://docs.liferay.com/portal/5.1/javadocs/portal-kernel/com/liferay/portal/kernel/lar/PortletDataHandler.html
 184.169 +-->
 184.170 +<!ELEMENT portlet-data-handler-class (#PCDATA)>
 184.171 +
 184.172 +<!--
 184.173 +The portlet-layout-listener-class value must be a class that implements
 184.174 +com.liferay.portal.kernel.portlet.PortletLayoutListener and is called when a portlet
 184.175 +is added, moved, or removed from a layout.
 184.176 +
 184.177 +See:
 184.178 +
 184.179 +http://docs.liferay.com/portal/5.1/javadocs/portal-impl/com/liferay/portlet/journalcontent/JournalContentPortletLayoutListener.html
 184.180 +http://docs.liferay.com/portal/5.1/javadocs/portal-kernel/com/liferay/portal/kernel/portlet/PortletLayoutListener.html
 184.181 +-->
 184.182 +<!ELEMENT portlet-layout-listener-class (#PCDATA)>
 184.183 +
 184.184 +<!--
 184.185 +The pop-message-listener-class value must be a class that implements
 184.186 +com.liferay.portal.kernel.pop.MessageListener and is called when processing
 184.187 +emails.
 184.188 +
 184.189 +See:
 184.190 +
 184.191 +http://docs.liferay.com/portal/5.1/javadocs/portal-impl/com/liferay/portlet/messageboards/pop/MessageListenerImpl.html
 184.192 +http://docs.liferay.com/portal/5.1/javadocs/portal-kernel/com/liferay/portal/kernel/pop/MessageListener.html
 184.193 +-->
 184.194 +<!ELEMENT pop-message-listener-class (#PCDATA)>
 184.195 +
 184.196 +<!--
 184.197 +The social-activity-interpreter-class value must be a class that implements
 184.198 +com.liferay.portlet.social.model.SocialActivityInterpreter and is called to
 184.199 +interpret activities into friendly messages that are easily understandable by a
 184.200 +human being.
 184.201 +
 184.202 +See:
 184.203 +
 184.204 +http://docs.liferay.com/portal/5.1/javadocs/portal-impl/com/liferay/portlet/messageboards/social/MBActivityInterpreter.html
 184.205 +http://docs.liferay.com/portal/5.1/javadocs/portal-service/com/liferay/portlet/social/model/SocialActivityInterpreter.html
 184.206 +-->
 184.207 +<!ELEMENT social-activity-interpreter-class (#PCDATA)>
 184.208 +
 184.209 +<!--
 184.210 +The social-request-interpreter-class value must be a class that implements
 184.211 +com.liferay.portlet.social.model.SocialRequestInterpreter and is called to
 184.212 +interpret requests into friendly messages that are easily understandable by a
 184.213 +human being.
 184.214 +
 184.215 +See:
 184.216 +
 184.217 +http://docs.liferay.com/portal/5.1/javadocs/portal-service/com/liferay/portlet/social/model/SocialRequestInterpreter.html
 184.218 +-->
 184.219 +<!ELEMENT social-request-interpreter-class (#PCDATA)>
 184.220 +
 184.221 +<!--
 184.222 +Set the preferences-company-wide value to true if the preferences for the
 184.223 +portlet are across the entire company. Setting this value to true means
 184.224 +the value for preferences-unique-per-layout and preferences-owned-by-group are
 184.225 +not used. The default value is false.
 184.226 +
 184.227 +For example, an administrator could set the preferences to an Announcements
 184.228 +portlet that would save a message in the portlet's preferences. This message
 184.229 +would then be used across all pages for that company. The portlet must not be
 184.230 +instanceable because instanceable portlets have uniquely generated portlet ids.
 184.231 +
 184.232 +The default behavior of the bundled Announcements portlet sets the instanceable
 184.233 +value to true so that normal users cannot create company wide messages. A future
 184.234 +release would include permissions for the edit mode versus the view mode which
 184.235 +would allow an administrator to set the message while users would just view the
 184.236 +message.
 184.237 +-->
 184.238 +<!ELEMENT preferences-company-wide (#PCDATA)>
 184.239 +
 184.240 +<!--
 184.241 +Set the preferences-unique-per-layout value to true if the preferences for the
 184.242 +portlet are unique across all pages. If set to false, the preferences for the
 184.243 +portlet are shared across all pages. The default value is true.
 184.244 +
 184.245 +The preferences-unique-per-layout element is used in combination with the
 184.246 +preferences-owned-by-group element. See the comments for the
 184.247 +preferences-owned-by-group element for more information.
 184.248 +-->
 184.249 +<!ELEMENT preferences-unique-per-layout (#PCDATA)>
 184.250 +
 184.251 +<!--
 184.252 +Set the preferences-owned-by-group value to true if the preferences for the
 184.253 +portlet are owned by the group when the portlet is shown in a group page. If
 184.254 +set to false, the preferences are owned by the user at all times. The default
 184.255 +value is true.
 184.256 +
 184.257 +Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 184.258 +preferences-owned-by-group set to false. Users can set a different list of
 184.259 +stocks for every personal page. Users can set a different list of stocks for
 184.260 +every community page.
 184.261 +
 184.262 +Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 184.263 +preferences-owned-by-group set to false. Users can set one list of stocks to be
 184.264 +shared across all personal pages. Users can set one list of stocks to be shared
 184.265 +across a community's set of pages.
 184.266 +
 184.267 +Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 184.268 +preferences-owned-by-group set to true. Users can set a different list of stocks
 184.269 +for every personal page. Administrators set the portlet preferences for users in
 184.270 +a community page. Administrators can set a different list of stocks for every
 184.271 +community page that are then shared by all users within a community.
 184.272 +
 184.273 +Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 184.274 +preferences-owned-by-group set to true. Users can set one list of stocks to be
 184.275 +shared across all personal pages. Administrators set the portlet preferences for
 184.276 +users in a community page. Administrators can set one list of stocks to be
 184.277 +shared by all users across a community's set of pages.
 184.278 +-->
 184.279 +<!ELEMENT preferences-owned-by-group (#PCDATA)>
 184.280 +
 184.281 +<!--
 184.282 +Set the use-default-template value to true if the portlet uses the default
 184.283 +template to decorate and wrap content. Setting this to false allows the
 184.284 +developer to own and maintain the portlet's entire outputted content. The
 184.285 +default value is true.
 184.286 +
 184.287 +The most common use of this is if you want the portlet to look different from
 184.288 +the other portlets or if you want the portlet to not have borders around the
 184.289 +outputted content.
 184.290 +-->
 184.291 +<!ELEMENT use-default-template (#PCDATA)>
 184.292 +
 184.293 +<!--
 184.294 +Set the show-portlet-access-denied value to true if users are shown the portlet
 184.295 +with an access denied message if they do not have access to the portlet. If set
 184.296 +to false, users are never shown the portlet if they do not have access to the
 184.297 +portlet. The default value is set in portal.properties.
 184.298 +
 184.299 +See:
 184.300 +
 184.301 +http://www.liferay.com/page/guest/documentation/development/properties
 184.302 +-->
 184.303 +<!ELEMENT show-portlet-access-denied (#PCDATA)>
 184.304 +
 184.305 +<!--
 184.306 +Set the show-portlet-inactive value to true if users are shown the portlet
 184.307 +with an inactive message if the portlet is inactive. If set to false, users are
 184.308 +never shown the portlet if the portlet is inactive. The default value is set in
 184.309 +portal.properties.
 184.310 +
 184.311 +http://www.liferay.com/page/guest/documentation/development/properties
 184.312 +-->
 184.313 +<!ELEMENT show-portlet-inactive (#PCDATA)>
 184.314 +
 184.315 +<!--
 184.316 +Set the action-url-redirect value to true if an action URL for this portlet
 184.317 +should cause an auto redirect. This helps prevent double submits. The default
 184.318 +value is false.
 184.319 +-->
 184.320 +<!ELEMENT action-url-redirect (#PCDATA)>
 184.321 +
 184.322 +<!--
 184.323 +Set the restore-current-view value to true if the portlet restores to the
 184.324 +current view when toggling between maximized and normal states. If set to false,
 184.325 +the portlet will reset the current view when toggling between maximized and
 184.326 +normal states. The default value is true.
 184.327 +-->
 184.328 +<!ELEMENT restore-current-view (#PCDATA)>
 184.329 +
 184.330 +<!--
 184.331 +Set the maximize-edit value to true if the portlet goes into the maximized state
 184.332 +when the user goes into the edit mode. This only affects the default portal
 184.333 +icons and not what may be programmatically set by the portlet developer.
 184.334 +The default value is false.
 184.335 +-->
 184.336 +<!ELEMENT maximize-edit (#PCDATA)>
 184.337 +
 184.338 +<!--
 184.339 +Set the maximize-help value to true if the portlet goes into the maximized state
 184.340 +when the user goes into the help mode. This only affects the default portal
 184.341 +icons and not what may be programmatically set by the portlet developer.
 184.342 +The default value is false.
 184.343 +-->
 184.344 +<!ELEMENT maximize-help (#PCDATA)>
 184.345 +
 184.346 +<!--
 184.347 +Set the pop-up-print value to true if the portlet goes into the pop up state
 184.348 +when the user goes into the print mode. This only affects the default portal
 184.349 +icons and not what may be programmatically set by the portlet developer.
 184.350 +The default value is true.
 184.351 +-->
 184.352 +<!ELEMENT pop-up-print (#PCDATA)>
 184.353 +
 184.354 +<!--
 184.355 +Set the layout-cacheable flag to true if the data contained in this portlet can
 184.356 +will never change unless the layout or Journal portlet entry is changed.
 184.357 +-->
 184.358 +<!ELEMENT layout-cacheable (#PCDATA)>
 184.359 +
 184.360 +<!--
 184.361 +Set the instanceable value to true if the portlet can appear multiple times on a
 184.362 +page. If set to false, the portlet can only appear once on a page. The default
 184.363 +value is false.
 184.364 +-->
 184.365 +<!ELEMENT instanceable (#PCDATA)>
 184.366 +
 184.367 +<!--
 184.368 +Set the user-principal-strategy value to either "userId" or "screenName".
 184.369 +Calling request.getRemoteUser() will normally return the user id. However, some
 184.370 +portlets may need the user principal returned to be screen name instead.
 184.371 +-->
 184.372 +<!ELEMENT user-principal-strategy (#PCDATA)>
 184.373 +
 184.374 +<!--
 184.375 +Set the private-request-attributes value to true if the portlet does not share
 184.376 +request attributes with the portal or any other portlet. The default value is
 184.377 +true. The property "request.shared.attributes" in portal.properties specifies
 184.378 +which request attributes are shared even when the private-request-attributes
 184.379 +value is true.
 184.380 +-->
 184.381 +<!ELEMENT private-request-attributes (#PCDATA)>
 184.382 +
 184.383 +<!--
 184.384 +Set the private-session-attributes value to true if the portlet does not share
 184.385 +session attributes with the portal. The default value is true. The property
 184.386 +"session.shared.attributes" in portal.properties specifies which session
 184.387 +attributes are shared even when the private-session-attributes value is true.
 184.388 +-->
 184.389 +<!ELEMENT private-session-attributes (#PCDATA)>
 184.390 +
 184.391 +<!--
 184.392 +The default value of render-weight is 1. If set to a value less than 1, the
 184.393 +portlet is rendered in parallel. If set to a value of 1 or greater, then the
 184.394 +portlet is rendered serially. Portlets with a greater render weight have greater
 184.395 +priority and will be rendered before portlets with a lower render weight.
 184.396 +
 184.397 +If the ajaxable value is set to false, then render-weight is always set to 1
 184.398 +if it is set to a value less than 1. This means ajaxable can override
 184.399 +render-weight if ajaxable is set to false.
 184.400 +-->
 184.401 +<!ELEMENT render-weight (#PCDATA)>
 184.402 +
 184.403 +<!--
 184.404 +The default value of ajaxable is true. If set to false, then this portlet can
 184.405 +never be displayed via Ajax.
 184.406 +-->
 184.407 +<!ELEMENT ajaxable (#PCDATA)>
 184.408 +
 184.409 +<!--
 184.410 +Set the path of CSS that will be referenced in the page's header relative to the
 184.411 +portal's context path.
 184.412 +-->
 184.413 +<!ELEMENT header-portal-css (#PCDATA)>
 184.414 +
 184.415 +<!--
 184.416 +Set the path of CSS that will be referenced in the page's header relative to the
 184.417 +portlet's context path.
 184.418 +-->
 184.419 +<!ELEMENT header-portlet-css (#PCDATA)>
 184.420 +
 184.421 +<!--
 184.422 +Set the path of JavaScript that will be referenced in the page's header relative
 184.423 +to the portal's context path.
 184.424 +-->
 184.425 +<!ELEMENT header-portal-javascript (#PCDATA)>
 184.426 +
 184.427 +<!--
 184.428 +Set the path of JavaScript that will be referenced in the page's header relative
 184.429 +to the portlet's context path.
 184.430 +-->
 184.431 +<!ELEMENT header-portlet-javascript (#PCDATA)>
 184.432 +
 184.433 +<!--
 184.434 +Set the path of CSS that will be referenced in the page's footer relative to the
 184.435 +portal's context path.
 184.436 +-->
 184.437 +<!ELEMENT footer-portal-css (#PCDATA)>
 184.438 +
 184.439 +<!--
 184.440 +Set the path of CSS that will be referenced in the page's footer relative to the
 184.441 +portlet's context path.
 184.442 +-->
 184.443 +<!ELEMENT footer-portlet-css (#PCDATA)>
 184.444 +
 184.445 +<!--
 184.446 +Set the path of JavaScript that will be referenced in the page's footer relative
 184.447 +to the portal's context path.
 184.448 +-->
 184.449 +<!ELEMENT footer-portal-javascript (#PCDATA)>
 184.450 +
 184.451 +<!--
 184.452 +Set the path of JavaScript that will be referenced in the page's footer relative
 184.453 +to the portlet's context path.
 184.454 +-->
 184.455 +<!ELEMENT footer-portlet-javascript (#PCDATA)>
 184.456 +
 184.457 +<!--
 184.458 +Set name of the CSS class that will be injected in the DIV that wraps this
 184.459 +portlet.
 184.460 +-->
 184.461 +<!ELEMENT css-class-wrapper (#PCDATA)>
 184.462 +
 184.463 +<!--
 184.464 +Set the facebook-integration value to either "fbml" or "iframe". The default
 184.465 +value is "iframe" because IFrame integration will work without requiring any
 184.466 +changes to your code. See the Message Boards portlet for minor changes that were
 184.467 +made to make it FBML compliant. Note that the Liferay tag libraries already
 184.468 +output FBML automatically if a request is made by Facebook.
 184.469 +-->
 184.470 +<!ELEMENT facebook-integration (#PCDATA)>
 184.471 +
 184.472 +<!--
 184.473 +If the add-default-resource value is set to false, and the portlet does not
 184.474 +belong to the page but has been dynamically added, then the user will see that
 184.475 +he does not have permissions to view the portlet. If the add-default-resource
 184.476 +value is set to true, the default portlet resources and permissions are added to
 184.477 +the page. The user can then view the portlet. Most portlets are harmless and can
 184.478 +benefit from this flexibility. However, to prevent security loop holes, the
 184.479 +default value is false.
 184.480 +-->
 184.481 +<!ELEMENT add-default-resource (#PCDATA)>
 184.482 +
 184.483 +<!--
 184.484 +Set the system value to true if the portlet is a system portlet that a user
 184.485 +cannot manually add to their page. The default value is false.
 184.486 +-->
 184.487 +<!ELEMENT system (#PCDATA)>
 184.488 +
 184.489 +<!--
 184.490 +Set the active value to true if the portlet is active and available to users.
 184.491 +If set to false, the portlet will not be active or available to users. The
 184.492 +default value is true.
 184.493 +
 184.494 +This value can be changed at runtime via the Admin portlet.
 184.495 +-->
 184.496 +<!ELEMENT active (#PCDATA)>
 184.497 +
 184.498 +<!--
 184.499 +Set the include value to true to if the portlet is available to the portal. If
 184.500 +set to false, the portlet is not available to the portal. The default value is
 184.501 +true.
 184.502 +
 184.503 +Portlets that are not included as part of the portal are never available to the
 184.504 +user to be made active or inactive. As far the user knows, the portlets do not
 184.505 +even exist in the system. This allows the Liferay developers to bundle a lot of
 184.506 +portlets in one core package, and yet allow custom deployments to turn on or off
 184.507 +individual portlets or sets of portlets. This follows the Siebel and Microsoft
 184.508 +model of bundling everything in one core package, but using XML configuration or
 184.509 +registry settings to turn on and off features or sets of features.
 184.510 +
 184.511 +We do not recommend that custom deployers modify the core source by removing
 184.512 +specific portlets because this prevents an easy upgrade process in the future.
 184.513 +The best way to turn on and off portlets is to set the include element. The
 184.514 +advantage of this way of doing things is that it becomes very easy to deploy
 184.515 +Liferay. All features are available in one package. The disadvantage is that by
 184.516 +not utilizing all of the portlets, you are wasting disk space and may even take
 184.517 +a small but static memory footprint. However, we feel that the extra disk space
 184.518 +and memory usage is a cheap price to pay in order to provide an easy
 184.519 +installation and upgrade path.
 184.520 +-->
 184.521 +<!ELEMENT include (#PCDATA)>
 184.522 +
 184.523 +<!--
 184.524 +The role-mapper contains two names specified by role-name and role-link. The
 184.525 +role-name value must be a role specified in portlet.xml. The role-link value
 184.526 +must be the name of a Liferay role that exists in the database. The role-mapper
 184.527 +element pairs up these two values to map roles from portlet.xml to roles in
 184.528 +the Liferay database.
 184.529 +
 184.530 +This is needed because Liferay roles may contain spaces whereas roles in
 184.531 +portlet.xml cannot contain spaces. This also adds extra flexibility where the
 184.532 +portlet vendor does not need to have any knowledge about Liferay's roles.
 184.533 +-->
 184.534 +<!ELEMENT role-mapper (role-name, role-link)>
 184.535 +
 184.536 +<!--
 184.537 +See the comments in role-mapper element.
 184.538 +-->
 184.539 +<!ELEMENT role-name (#PCDATA)>
 184.540 +
 184.541 +<!--
 184.542 +See the comments in role-mapper element.
 184.543 +-->
 184.544 +<!ELEMENT role-link (#PCDATA)>
 184.545 +
 184.546 +<!--
 184.547 +The custom-user-attribute contains a list of names that are retrieved using a
 184.548 +custom class that extends com.liferay.portlet.CustomUserAttributes.
 184.549 +
 184.550 +Download the sample hot deployable portlet WAR named test.war. Look for the
 184.551 +class com.sample.strutsliferay.portlet.SampleUserAttributes to see how it
 184.552 +associates the custom user attribute "user.name.test" with the value
 184.553 +"Test Name". This class could be modified to read custom user attributes from
 184.554 +another datasource that may be a database, a LDAP server, or a web service.
 184.555 +
 184.556 +See:
 184.557 +
 184.558 +http://www.liferay.com/page/guest/documentation/development/hot_deploy
 184.559 +-->
 184.560 +<!ELEMENT custom-user-attribute (name+, custom-class)>
 184.561 +
 184.562 +<!--
 184.563 +See the comments in custom-user-attribute element.
 184.564 +-->
 184.565 +<!ELEMENT name (#PCDATA)>
 184.566 +
 184.567 +<!--
 184.568 +See the comments in custom-user-attribute element.
 184.569 +-->
 184.570 +<!ELEMENT custom-class (#PCDATA)>
 184.571 \ No newline at end of file
   185.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   185.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_5_2_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   185.3 @@ -0,0 +1,625 @@
   185.4 +<!--
   185.5 +This is the DTD for the Portlet Application parameters that are specific to
   185.6 +Liferay Portal.
   185.7 +
   185.8 +<!DOCTYPE liferay-portlet-app PUBLIC
   185.9 +	"-//Liferay//DTD Portlet Application 5.2.0//EN"
  185.10 +	"http://www.liferay.com/dtd/liferay-portlet-app_5_2_0.dtd">
  185.11 +-->
  185.12 +
  185.13 +<!--
  185.14 +The liferay-portlet-app element is the root of the deployment descriptor for
  185.15 +a Liferay portlet application.
  185.16 +-->
  185.17 +<!ELEMENT liferay-portlet-app (portlet*, role-mapper*, custom-user-attribute*)>
  185.18 +
  185.19 +<!--
  185.20 +The portlet element contains the declarative data of a portlet.
  185.21 +-->
  185.22 +<!ELEMENT portlet (portlet-name, icon?, virtual-path?, struts-path?,
  185.23 +configuration-path?, configuration-action-class?, indexer-class?,
  185.24 +open-search-class?, scheduler-class?, portlet-url-class?,
  185.25 +friendly-url-mapper-class?, url-encoder-class?, portlet-data-handler-class?,
  185.26 +portlet-layout-listener-class?, pop-message-listener-class?,
  185.27 +social-activity-interpreter-class?, social-request-interpreter-class?,
  185.28 +webdav-storage-token?, webdav-storage-class?, control-panel-entry-category?,
  185.29 +control-panel-entry-weight?, control-panel-entry-class?,
  185.30 +preferences-company-wide?, preferences-unique-per-layout?,
  185.31 +preferences-owned-by-group?, use-default-template?, show-portlet-access-denied?,
  185.32 +show-portlet-inactive?, action-url-redirect?, restore-current-view?,
  185.33 +maximize-edit?, maximize-help?, pop-up-print?, layout-cacheable?, instanceable?,
  185.34 +scopeable?, user-principal-strategy?, private-request-attributes?,
  185.35 +private-session-attributes?, render-weight?, ajaxable?, header-portal-css*,
  185.36 +header-portlet-css*, header-portal-javascript*, header-portlet-javascript*,
  185.37 +footer-portal-css*, footer-portlet-css*, footer-portal-javascript*,
  185.38 +footer-portlet-javascript*, css-class-wrapper?, facebook-integration?,
  185.39 +add-default-resource?, system?, active?, include?)>
  185.40 +
  185.41 +<!--
  185.42 +The portlet-name element contains the unique name of the portlet. This name must
  185.43 +match the portlet-name specified in portlet.xml.
  185.44 +-->
  185.45 +<!ELEMENT portlet-name (#PCDATA)>
  185.46 +
  185.47 +<!--
  185.48 +The icon element specifies an image that represents the portlet.
  185.49 +-->
  185.50 +<!ELEMENT icon (#PCDATA)>
  185.51 +
  185.52 +<!--
  185.53 +The virtual-path value sets the virtual path used to override the default
  185.54 +servlet context path.
  185.55 +
  185.56 +For example, suppose your portlet is deployed to the servlet path
  185.57 +"/test-portlet". By default, the portal will return "/test-portlet" for the
  185.58 +servlet context path. You can override it by setting virtual-path to "/virtual"
  185.59 +and have the portal return "/virtual" for the servlet context path.
  185.60 +
  185.61 +The default value is "" which means this is not used.
  185.62 +-->
  185.63 +<!ELEMENT virtual-path (#PCDATA)>
  185.64 +
  185.65 +<!--
  185.66 +Supppose the struts-path value is "mail". This tells the portal that all
  185.67 +requests with the path mail/* are considered part of this portlet's scope. Users
  185.68 +who request paths that match mail/* will only be granted access if they also
  185.69 +have access to this portlet. This is true for both portlet requests and regular
  185.70 +servlet requests.
  185.71 +-->
  185.72 +<!ELEMENT struts-path (#PCDATA)>
  185.73 +
  185.74 +<!--
  185.75 +The configuration-path value is no longer available. Use
  185.76 +configuration-action-class instead.
  185.77 +-->
  185.78 +<!ELEMENT configuration-path (#PCDATA)>
  185.79 +
  185.80 +<!--
  185.81 +The configuration-action-class value must be a class that implements
  185.82 +com.liferay.portal.kernel.portlet.ConfigurationAction and is called to allow
  185.83 +users to configure the portlet at runtime.
  185.84 +
  185.85 +See:
  185.86 +
  185.87 +http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portlet/messageboards/action/ConfigurationActionImpl.html
  185.88 +-->
  185.89 +<!ELEMENT configuration-action-class (#PCDATA)>
  185.90 +
  185.91 +<!--
  185.92 +The indexer-class value must be a class that implements
  185.93 +com.liferay.portal.kernel.search.Indexer and is called to create or update a
  185.94 +search index for the portlet.
  185.95 +
  185.96 +See:
  185.97 +
  185.98 +http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portlet/messageboards/util/Indexer.html
  185.99 +http://docs.liferay.com/portal/5.2/javadocs/portal-kernel/com/liferay/portal/kernel/search/Indexer.html
 185.100 +http://lucene.apache.org
 185.101 +-->
 185.102 +<!ELEMENT indexer-class (#PCDATA)>
 185.103 +
 185.104 +<!--
 185.105 +The open-search-class value must be a class that implements
 185.106 +com.liferay.portal.kernel.search.OpenSearch and is called to get search results
 185.107 +in the OpenSearch 1.1 standard.
 185.108 +
 185.109 +See:
 185.110 +
 185.111 +http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portlet/alfrescocontent/util/OpenSearch.html
 185.112 +http://docs.liferay.com/portal/5.2/javadocs/portal-kernel/com/liferay/portal/kernel/search/OpenSearch.html
 185.113 +http://www.opensearch.org
 185.114 +-->
 185.115 +<!ELEMENT open-search-class (#PCDATA)>
 185.116 +
 185.117 +<!--
 185.118 +The scheduler-class value must be a class that implements
 185.119 +com.liferay.portal.kernel.job.Scheduler and is called to schedule jobs for this
 185.120 +portlet.
 185.121 +
 185.122 +See:
 185.123 +
 185.124 +http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portlet/calendar/job/CalendarScheduler.html
 185.125 +http://docs.liferay.com/portal/5.2/javadocs/portal-kernel/com/liferay/portal/kernel/job/Scheduler.html
 185.126 +http://www.opensymphony.com/quartz
 185.127 +-->
 185.128 +<!ELEMENT scheduler-class (#PCDATA)>
 185.129 +
 185.130 +<!--
 185.131 +The portlet-url-class value must be a class that extends
 185.132 +com.liferay.portlet.PortletURLImplWrapper. Set this class to override the
 185.133 +default portlet URL implementation.
 185.134 +
 185.135 +See:
 185.136 +
 185.137 +http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portal/struts/StrutsActionPortletURL.html
 185.138 +-->
 185.139 +<!ELEMENT portlet-url-class (#PCDATA)>
 185.140 +
 185.141 +<!--
 185.142 +The friendly-url-mapper-class value must be a class that implements
 185.143 +com.liferay.portal.kernel.portlet.FriendlyURLMapper. Use this if content inside
 185.144 +a portlet needs to have a friendly URL. See the Message Boards portlet for an
 185.145 +example of its uses.
 185.146 +
 185.147 +See:
 185.148 +
 185.149 +http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portlet/messageboards/MBFriendlyURLMapper.html
 185.150 +http://docs.liferay.com/portal/5.2/javadocs/portal-kernel/com/liferay/portal/kernel/portlet/FriendlyURLMapper.html
 185.151 +-->
 185.152 +<!ELEMENT friendly-url-mapper-class (#PCDATA)>
 185.153 +
 185.154 +<!--
 185.155 +The url-encoder-class value must be a class that implements
 185.156 +com.liferay.portal.kernel.servlet.URLEncoder. Use this to set a custom
 185.157 +URLEncoder that is used by the RenderResponse class to implement the encodeURL
 185.158 +method. This is useful if you need to add custom logic to rewrite URLs.
 185.159 +-->
 185.160 +<!ELEMENT url-encoder-class (#PCDATA)>
 185.161 +
 185.162 +<!--
 185.163 +The portlet-data-handler-class value must be a class that implements
 185.164 +com.liferay.portal.kernel.lar.PortletDataHandler and is called when archiving
 185.165 +tasks are run.
 185.166 +
 185.167 +See:
 185.168 +
 185.169 +http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portlet/journal/lar/PortletDataHandlerImpl.html
 185.170 +http://docs.liferay.com/portal/5.2/javadocs/portal-kernel/com/liferay/portal/kernel/lar/PortletDataHandler.html
 185.171 +-->
 185.172 +<!ELEMENT portlet-data-handler-class (#PCDATA)>
 185.173 +
 185.174 +<!--
 185.175 +The portlet-layout-listener-class value must be a class that implements
 185.176 +com.liferay.portal.kernel.portlet.PortletLayoutListener and is called when a portlet
 185.177 +is added, moved, or removed from a layout.
 185.178 +
 185.179 +See:
 185.180 +
 185.181 +http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portlet/journalcontent/JournalContentPortletLayoutListener.html
 185.182 +http://docs.liferay.com/portal/5.2/javadocs/portal-kernel/com/liferay/portal/kernel/portlet/PortletLayoutListener.html
 185.183 +-->
 185.184 +<!ELEMENT portlet-layout-listener-class (#PCDATA)>
 185.185 +
 185.186 +<!--
 185.187 +The pop-message-listener-class value must be a class that implements
 185.188 +com.liferay.portal.kernel.pop.MessageListener and is called when processing
 185.189 +emails.
 185.190 +
 185.191 +See:
 185.192 +
 185.193 +http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portlet/messageboards/pop/MessageListenerImpl.html
 185.194 +http://docs.liferay.com/portal/5.2/javadocs/portal-kernel/com/liferay/portal/kernel/pop/MessageListener.html
 185.195 +-->
 185.196 +<!ELEMENT pop-message-listener-class (#PCDATA)>
 185.197 +
 185.198 +<!--
 185.199 +The social-activity-interpreter-class value must be a class that implements
 185.200 +com.liferay.portlet.social.model.SocialActivityInterpreter and is called to
 185.201 +interpret activities into friendly messages that are easily understandable by a
 185.202 +human being.
 185.203 +
 185.204 +See:
 185.205 +
 185.206 +http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portlet/messageboards/social/MBActivityInterpreter.html
 185.207 +http://docs.liferay.com/portal/5.2/javadocs/portal-service/com/liferay/portlet/social/model/SocialActivityInterpreter.html
 185.208 +-->
 185.209 +<!ELEMENT social-activity-interpreter-class (#PCDATA)>
 185.210 +
 185.211 +<!--
 185.212 +The social-request-interpreter-class value must be a class that implements
 185.213 +com.liferay.portlet.social.model.SocialRequestInterpreter and is called to
 185.214 +interpret requests into friendly messages that are easily understandable by a
 185.215 +human being.
 185.216 +
 185.217 +See:
 185.218 +
 185.219 +http://docs.liferay.com/portal/5.2/javadocs/portal-service/com/liferay/portlet/social/model/SocialRequestInterpreter.html
 185.220 +-->
 185.221 +<!ELEMENT social-request-interpreter-class (#PCDATA)>
 185.222 +
 185.223 +<!--
 185.224 +The webdav-storage-token value is the WebDAV directory name for data managed by
 185.225 +this portlet.
 185.226 +
 185.227 +See:
 185.228 +
 185.229 +http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portlet/documentlibrary/webdav/DLWebDAVStorageImpl.html
 185.230 +-->
 185.231 +<!ELEMENT webdav-storage-token (#PCDATA)>
 185.232 +
 185.233 +<!--
 185.234 +The webdav-storage-class value must be a class that implements
 185.235 +com.liferay.portal.webdav.WebDAVStorage and allows data to be exposed via the
 185.236 +WebDAV protocol.
 185.237 +
 185.238 +See:
 185.239 +
 185.240 +http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portlet/documentlibrary/webdav/DLWebDAVStorageImpl.html
 185.241 +-->
 185.242 +<!ELEMENT webdav-storage-class (#PCDATA)>
 185.243 +
 185.244 +<!--
 185.245 +Set the control-panel-entry-category value to "my", "content", "portal" or
 185.246 +"server" to make this portlet available in the Control Panel under that
 185.247 +category. Note that the portlet will only be visible to the Adminisitrator
 185.248 +unless a control-panel-entry-class is specified.
 185.249 +-->
 185.250 +<!ELEMENT control-panel-entry-category (#PCDATA)>
 185.251 +
 185.252 +<!--
 185.253 +Set the control-panel-entry-weight value to a double number to control the
 185.254 +position of the entry within its Control Panel category. Higher values mean
 185.255 +that the entry will appear lower in the Control Panel menu.
 185.256 +-->
 185.257 +<!ELEMENT control-panel-entry-weight (#PCDATA)>
 185.258 +
 185.259 +<!--
 185.260 +The control-panel-entry-class value must be a class that implements
 185.261 +com.liferay.portlet.ControlPanelEntry and is called by the Control Panel.
 185.262 +
 185.263 +See:
 185.264 +
 185.265 +http://docs.liferay.com/portal/5.2/javadocs/portal-service/com/liferay/portlet/ControlPanelEntry.html
 185.266 +-->
 185.267 +<!ELEMENT control-panel-entry-class (#PCDATA)>
 185.268 +
 185.269 +<!--
 185.270 +Set the preferences-company-wide value to true if the preferences for the
 185.271 +portlet are across the entire company. Setting this value to true means
 185.272 +the value for preferences-unique-per-layout and preferences-owned-by-group are
 185.273 +not used. The default value is false.
 185.274 +
 185.275 +For example, an administrator could set the preferences to an Announcements
 185.276 +portlet that would save a message in the portlet's preferences. This message
 185.277 +would then be used across all pages for that company. The portlet must not be
 185.278 +instanceable because instanceable portlets have uniquely generated portlet ids.
 185.279 +
 185.280 +The default behavior of the bundled Announcements portlet sets the instanceable
 185.281 +value to true so that normal users cannot create company wide messages. A future
 185.282 +release would include permissions for the edit mode versus the view mode which
 185.283 +would allow an administrator to set the message while users would just view the
 185.284 +message.
 185.285 +-->
 185.286 +<!ELEMENT preferences-company-wide (#PCDATA)>
 185.287 +
 185.288 +<!--
 185.289 +Set the preferences-unique-per-layout value to true if the preferences for the
 185.290 +portlet are unique across all pages. If set to false, the preferences for the
 185.291 +portlet are shared across all pages. The default value is true.
 185.292 +
 185.293 +The preferences-unique-per-layout element is used in combination with the
 185.294 +preferences-owned-by-group element. See the comments for the
 185.295 +preferences-owned-by-group element for more information.
 185.296 +-->
 185.297 +<!ELEMENT preferences-unique-per-layout (#PCDATA)>
 185.298 +
 185.299 +<!--
 185.300 +Set the preferences-owned-by-group value to true if the preferences for the
 185.301 +portlet are owned by the group when the portlet is shown in a group page. If
 185.302 +set to false, the preferences are owned by the user at all times. The default
 185.303 +value is true.
 185.304 +
 185.305 +Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 185.306 +preferences-owned-by-group set to false. Users can set a different list of
 185.307 +stocks for every personal page. Users can set a different list of stocks for
 185.308 +every community page.
 185.309 +
 185.310 +Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 185.311 +preferences-owned-by-group set to false. Users can set one list of stocks to be
 185.312 +shared across all personal pages. Users can set one list of stocks to be shared
 185.313 +across a community's set of pages.
 185.314 +
 185.315 +Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 185.316 +preferences-owned-by-group set to true. Users can set a different list of stocks
 185.317 +for every personal page. Administrators set the portlet preferences for users in
 185.318 +a community page. Administrators can set a different list of stocks for every
 185.319 +community page that are then shared by all users within a community.
 185.320 +
 185.321 +Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 185.322 +preferences-owned-by-group set to true. Users can set one list of stocks to be
 185.323 +shared across all personal pages. Administrators set the portlet preferences for
 185.324 +users in a community page. Administrators can set one list of stocks to be
 185.325 +shared by all users across a community's set of pages.
 185.326 +-->
 185.327 +<!ELEMENT preferences-owned-by-group (#PCDATA)>
 185.328 +
 185.329 +<!--
 185.330 +Set the use-default-template value to true if the portlet uses the default
 185.331 +template to decorate and wrap content. Setting this to false allows the
 185.332 +developer to own and maintain the portlet's entire outputted content. The
 185.333 +default value is true.
 185.334 +
 185.335 +The most common use of this is if you want the portlet to look different from
 185.336 +the other portlets or if you want the portlet to not have borders around the
 185.337 +outputted content.
 185.338 +-->
 185.339 +<!ELEMENT use-default-template (#PCDATA)>
 185.340 +
 185.341 +<!--
 185.342 +Set the show-portlet-access-denied value to true if users are shown the portlet
 185.343 +with an access denied message if they do not have access to the portlet. If set
 185.344 +to false, users are never shown the portlet if they do not have access to the
 185.345 +portlet. The default value is set in portal.properties.
 185.346 +
 185.347 +See:
 185.348 +
 185.349 +http://www.liferay.com/page/guest/documentation/development/properties
 185.350 +-->
 185.351 +<!ELEMENT show-portlet-access-denied (#PCDATA)>
 185.352 +
 185.353 +<!--
 185.354 +Set the show-portlet-inactive value to true if users are shown the portlet
 185.355 +with an inactive message if the portlet is inactive. If set to false, users are
 185.356 +never shown the portlet if the portlet is inactive. The default value is set in
 185.357 +portal.properties.
 185.358 +
 185.359 +http://www.liferay.com/page/guest/documentation/development/properties
 185.360 +-->
 185.361 +<!ELEMENT show-portlet-inactive (#PCDATA)>
 185.362 +
 185.363 +<!--
 185.364 +Set the action-url-redirect value to true if an action URL for this portlet
 185.365 +should cause an auto redirect. This helps prevent double submits. The default
 185.366 +value is false.
 185.367 +-->
 185.368 +<!ELEMENT action-url-redirect (#PCDATA)>
 185.369 +
 185.370 +<!--
 185.371 +Set the restore-current-view value to true if the portlet restores to the
 185.372 +current view when toggling between maximized and normal states. If set to false,
 185.373 +the portlet will reset the current view when toggling between maximized and
 185.374 +normal states. The default value is true.
 185.375 +-->
 185.376 +<!ELEMENT restore-current-view (#PCDATA)>
 185.377 +
 185.378 +<!--
 185.379 +Set the maximize-edit value to true if the portlet goes into the maximized state
 185.380 +when the user goes into the edit mode. This only affects the default portal
 185.381 +icons and not what may be programmatically set by the portlet developer.
 185.382 +The default value is false.
 185.383 +-->
 185.384 +<!ELEMENT maximize-edit (#PCDATA)>
 185.385 +
 185.386 +<!--
 185.387 +Set the maximize-help value to true if the portlet goes into the maximized state
 185.388 +when the user goes into the help mode. This only affects the default portal
 185.389 +icons and not what may be programmatically set by the portlet developer.
 185.390 +The default value is false.
 185.391 +-->
 185.392 +<!ELEMENT maximize-help (#PCDATA)>
 185.393 +
 185.394 +<!--
 185.395 +Set the pop-up-print value to true if the portlet goes into the pop up state
 185.396 +when the user goes into the print mode. This only affects the default portal
 185.397 +icons and not what may be programmatically set by the portlet developer.
 185.398 +The default value is true.
 185.399 +-->
 185.400 +<!ELEMENT pop-up-print (#PCDATA)>
 185.401 +
 185.402 +<!--
 185.403 +Set the layout-cacheable flag to true if the data contained in this portlet can
 185.404 +will never change unless the layout or Journal portlet entry is changed.
 185.405 +-->
 185.406 +<!ELEMENT layout-cacheable (#PCDATA)>
 185.407 +
 185.408 +<!--
 185.409 +Set the instanceable value to true if the portlet can appear multiple times on a
 185.410 +page. If set to false, the portlet can only appear once on a page. The default
 185.411 +value is false.
 185.412 +-->
 185.413 +<!ELEMENT instanceable (#PCDATA)>
 185.414 +
 185.415 +<!--
 185.416 +If the scopeable is set to true, an administrator will be able to configure the
 185.417 +scope of the data of the portlet to either the current community (default),
 185.418 +the current layout, or the scope of any other layout of the community that
 185.419 +already exists. Portlets that want to support this must be programmed to obtain
 185.420 +the proper scope group id according to the configuration and scope their data
 185.421 +accordingly. The default is false.
 185.422 +-->
 185.423 +<!ELEMENT scopeable (#PCDATA)>
 185.424 +
 185.425 +<!--
 185.426 +Set the user-principal-strategy value to either "userId" or "screenName".
 185.427 +Calling request.getRemoteUser() will normally return the user id. However, some
 185.428 +portlets may need the user principal returned to be screen name instead.
 185.429 +-->
 185.430 +<!ELEMENT user-principal-strategy (#PCDATA)>
 185.431 +
 185.432 +<!--
 185.433 +Set the private-request-attributes value to true if the portlet does not share
 185.434 +request attributes with the portal or any other portlet. The default value is
 185.435 +true. The property "request.shared.attributes" in portal.properties specifies
 185.436 +which request attributes are shared even when the private-request-attributes
 185.437 +value is true.
 185.438 +-->
 185.439 +<!ELEMENT private-request-attributes (#PCDATA)>
 185.440 +
 185.441 +<!--
 185.442 +Set the private-session-attributes value to true if the portlet does not share
 185.443 +session attributes with the portal. The default value is true. The property
 185.444 +"session.shared.attributes" in portal.properties specifies which session
 185.445 +attributes are shared even when the private-session-attributes value is true.
 185.446 +-->
 185.447 +<!ELEMENT private-session-attributes (#PCDATA)>
 185.448 +
 185.449 +<!--
 185.450 +The default value of render-weight is 1. If set to a value less than 1, the
 185.451 +portlet is rendered in parallel. If set to a value of 1 or greater, then the
 185.452 +portlet is rendered serially. Portlets with a greater render weight have greater
 185.453 +priority and will be rendered before portlets with a lower render weight.
 185.454 +
 185.455 +If the ajaxable value is set to false, then render-weight is always set to 1
 185.456 +if it is set to a value less than 1. This means ajaxable can override
 185.457 +render-weight if ajaxable is set to false.
 185.458 +-->
 185.459 +<!ELEMENT render-weight (#PCDATA)>
 185.460 +
 185.461 +<!--
 185.462 +The default value of ajaxable is true. If set to false, then this portlet can
 185.463 +never be displayed via Ajax.
 185.464 +-->
 185.465 +<!ELEMENT ajaxable (#PCDATA)>
 185.466 +
 185.467 +<!--
 185.468 +Set the path of CSS that will be referenced in the page's header relative to the
 185.469 +portal's context path.
 185.470 +-->
 185.471 +<!ELEMENT header-portal-css (#PCDATA)>
 185.472 +
 185.473 +<!--
 185.474 +Set the path of CSS that will be referenced in the page's header relative to the
 185.475 +portlet's context path.
 185.476 +-->
 185.477 +<!ELEMENT header-portlet-css (#PCDATA)>
 185.478 +
 185.479 +<!--
 185.480 +Set the path of JavaScript that will be referenced in the page's header relative
 185.481 +to the portal's context path.
 185.482 +-->
 185.483 +<!ELEMENT header-portal-javascript (#PCDATA)>
 185.484 +
 185.485 +<!--
 185.486 +Set the path of JavaScript that will be referenced in the page's header relative
 185.487 +to the portlet's context path.
 185.488 +-->
 185.489 +<!ELEMENT header-portlet-javascript (#PCDATA)>
 185.490 +
 185.491 +<!--
 185.492 +Set the path of CSS that will be referenced in the page's footer relative to the
 185.493 +portal's context path.
 185.494 +-->
 185.495 +<!ELEMENT footer-portal-css (#PCDATA)>
 185.496 +
 185.497 +<!--
 185.498 +Set the path of CSS that will be referenced in the page's footer relative to the
 185.499 +portlet's context path.
 185.500 +-->
 185.501 +<!ELEMENT footer-portlet-css (#PCDATA)>
 185.502 +
 185.503 +<!--
 185.504 +Set the path of JavaScript that will be referenced in the page's footer relative
 185.505 +to the portal's context path.
 185.506 +-->
 185.507 +<!ELEMENT footer-portal-javascript (#PCDATA)>
 185.508 +
 185.509 +<!--
 185.510 +Set the path of JavaScript that will be referenced in the page's footer relative
 185.511 +to the portlet's context path.
 185.512 +-->
 185.513 +<!ELEMENT footer-portlet-javascript (#PCDATA)>
 185.514 +
 185.515 +<!--
 185.516 +Set name of the CSS class that will be injected in the DIV that wraps this
 185.517 +portlet.
 185.518 +-->
 185.519 +<!ELEMENT css-class-wrapper (#PCDATA)>
 185.520 +
 185.521 +<!--
 185.522 +Set the facebook-integration value to either "fbml" or "iframe". The default
 185.523 +value is "iframe" because IFrame integration will work without requiring any
 185.524 +changes to your code. See the Message Boards portlet for minor changes that were
 185.525 +made to make it FBML compliant. Note that the Liferay tag libraries already
 185.526 +output FBML automatically if a request is made by Facebook.
 185.527 +-->
 185.528 +<!ELEMENT facebook-integration (#PCDATA)>
 185.529 +
 185.530 +<!--
 185.531 +If the add-default-resource value is set to false, and the portlet does not
 185.532 +belong to the page but has been dynamically added, then the user will see that
 185.533 +he does not have permissions to view the portlet. If the add-default-resource
 185.534 +value is set to true, the default portlet resources and permissions are added to
 185.535 +the page. The user can then view the portlet. Most portlets are harmless and can
 185.536 +benefit from this flexibility. However, to prevent security loop holes, the
 185.537 +default value is false.
 185.538 +-->
 185.539 +<!ELEMENT add-default-resource (#PCDATA)>
 185.540 +
 185.541 +<!--
 185.542 +Set the system value to true if the portlet is a system portlet that a user
 185.543 +cannot manually add to their page. The default value is false.
 185.544 +-->
 185.545 +<!ELEMENT system (#PCDATA)>
 185.546 +
 185.547 +<!--
 185.548 +Set the active value to true if the portlet is active and available to users.
 185.549 +If set to false, the portlet will not be active or available to users. The
 185.550 +default value is true.
 185.551 +
 185.552 +This value can be changed at runtime via the Admin portlet.
 185.553 +-->
 185.554 +<!ELEMENT active (#PCDATA)>
 185.555 +
 185.556 +<!--
 185.557 +Set the include value to true to if the portlet is available to the portal. If
 185.558 +set to false, the portlet is not available to the portal. The default value is
 185.559 +true.
 185.560 +
 185.561 +Portlets that are not included as part of the portal are never available to the
 185.562 +user to be made active or inactive. As far the user knows, the portlets do not
 185.563 +even exist in the system. This allows the Liferay developers to bundle a lot of
 185.564 +portlets in one core package, and yet allow custom deployments to turn on or off
 185.565 +individual portlets or sets of portlets. This follows the Siebel and Microsoft
 185.566 +model of bundling everything in one core package, but using XML configuration or
 185.567 +registry settings to turn on and off features or sets of features.
 185.568 +
 185.569 +We do not recommend that custom deployers modify the core source by removing
 185.570 +specific portlets because this prevents an easy upgrade process in the future.
 185.571 +The best way to turn on and off portlets is to set the include element. The
 185.572 +advantage of this way of doing things is that it becomes very easy to deploy
 185.573 +Liferay. All features are available in one package. The disadvantage is that by
 185.574 +not utilizing all of the portlets, you are wasting disk space and may even take
 185.575 +a small but static memory footprint. However, we feel that the extra disk space
 185.576 +and memory usage is a cheap price to pay in order to provide an easy
 185.577 +installation and upgrade path.
 185.578 +-->
 185.579 +<!ELEMENT include (#PCDATA)>
 185.580 +
 185.581 +<!--
 185.582 +The role-mapper contains two names specified by role-name and role-link. The
 185.583 +role-name value must be a role specified in portlet.xml. The role-link value
 185.584 +must be the name of a Liferay role that exists in the database. The role-mapper
 185.585 +element pairs up these two values to map roles from portlet.xml to roles in
 185.586 +the Liferay database.
 185.587 +
 185.588 +This is needed because Liferay roles may contain spaces whereas roles in
 185.589 +portlet.xml cannot contain spaces. This also adds extra flexibility where the
 185.590 +portlet vendor does not need to have any knowledge about Liferay's roles.
 185.591 +-->
 185.592 +<!ELEMENT role-mapper (role-name, role-link)>
 185.593 +
 185.594 +<!--
 185.595 +See the comments in role-mapper element.
 185.596 +-->
 185.597 +<!ELEMENT role-name (#PCDATA)>
 185.598 +
 185.599 +<!--
 185.600 +See the comments in role-mapper element.
 185.601 +-->
 185.602 +<!ELEMENT role-link (#PCDATA)>
 185.603 +
 185.604 +<!--
 185.605 +The custom-user-attribute contains a list of names that are retrieved using a
 185.606 +custom class that extends com.liferay.portlet.CustomUserAttributes.
 185.607 +
 185.608 +Download the sample hot deployable portlet WAR named test.war. Look for the
 185.609 +class com.sample.strutsliferay.portlet.SampleUserAttributes to see how it
 185.610 +associates the custom user attribute "user.name.test" with the value
 185.611 +"Test Name". This class could be modified to read custom user attributes from
 185.612 +another datasource that may be a database, a LDAP server, or a web service.
 185.613 +
 185.614 +See:
 185.615 +
 185.616 +http://www.liferay.com/page/guest/documentation/development/hot_deploy
 185.617 +-->
 185.618 +<!ELEMENT custom-user-attribute (name+, custom-class)>
 185.619 +
 185.620 +<!--
 185.621 +See the comments in custom-user-attribute element.
 185.622 +-->
 185.623 +<!ELEMENT name (#PCDATA)>
 185.624 +
 185.625 +<!--
 185.626 +See the comments in custom-user-attribute element.
 185.627 +-->
 185.628 +<!ELEMENT custom-class (#PCDATA)>
 185.629 \ No newline at end of file
   186.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   186.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-portlet-app_6_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   186.3 @@ -0,0 +1,728 @@
   186.4 +<!--
   186.5 +This is the DTD for the Portlet Application parameters that are specific to
   186.6 +Liferay Portal.
   186.7 +
   186.8 +<!DOCTYPE liferay-portlet-app PUBLIC
   186.9 +	"-//Liferay//DTD Portlet Application 6.0.0//EN"
  186.10 +	"http://www.liferay.com/dtd/liferay-portlet-app_6_0_0.dtd">
  186.11 +-->
  186.12 +
  186.13 +<!--
  186.14 +The liferay-portlet-app element is the root of the deployment descriptor for
  186.15 +a Liferay portlet application.
  186.16 +-->
  186.17 +<!ELEMENT liferay-portlet-app (portlet*, role-mapper*, custom-user-attribute*)>
  186.18 +
  186.19 +<!--
  186.20 +The portlet element contains the declarative data of a portlet.
  186.21 +-->
  186.22 +<!ELEMENT portlet (portlet-name, icon?, virtual-path?, struts-path?,
  186.23 +configuration-path?, configuration-action-class?, indexer-class?,
  186.24 +open-search-class?, scheduler-class?, scheduler-entry*, portlet-url-class?,
  186.25 +friendly-url-mapper-class?, url-encoder-class?, portlet-data-handler-class?,
  186.26 +portlet-layout-listener-class?, poller-processor-class?,
  186.27 +pop-message-listener-class?, social-activity-interpreter-class?,
  186.28 +social-request-interpreter-class?, webdav-storage-token?, webdav-storage-class?,
  186.29 +control-panel-entry-category?, control-panel-entry-weight?,
  186.30 +control-panel-entry-class?, asset-renderer-factory*, custom-attributes-display*,
  186.31 +workflow-handler*, preferences-company-wide?, preferences-unique-per-layout?,
  186.32 +preferences-owned-by-group?, use-default-template?, show-portlet-access-denied?,
  186.33 +show-portlet-inactive?, action-url-redirect?, restore-current-view?,
  186.34 +maximize-edit?, maximize-help?, pop-up-print?, layout-cacheable?, instanceable?,
  186.35 +scopeable?, user-principal-strategy?, private-request-attributes?,
  186.36 +private-session-attributes?, render-weight?, ajaxable?, header-portal-css*,
  186.37 +header-portlet-css*, header-portal-javascript*, header-portlet-javascript*,
  186.38 +footer-portal-css*, footer-portlet-css*, footer-portal-javascript*,
  186.39 +footer-portlet-javascript*, css-class-wrapper?, facebook-integration?,
  186.40 +add-default-resource?, system?, active?, include?)>
  186.41 +
  186.42 +<!--
  186.43 +The portlet-name element contains the unique name of the portlet. This name must
  186.44 +match the portlet-name specified in portlet.xml.
  186.45 +-->
  186.46 +<!ELEMENT portlet-name (#PCDATA)>
  186.47 +
  186.48 +<!--
  186.49 +The icon element specifies an image that represents the portlet.
  186.50 +-->
  186.51 +<!ELEMENT icon (#PCDATA)>
  186.52 +
  186.53 +<!--
  186.54 +The virtual-path value sets the virtual path used to override the default
  186.55 +servlet context path.
  186.56 +
  186.57 +For example, suppose your portlet is deployed to the servlet path
  186.58 +"/test-portlet". By default, the portal will return "/test-portlet" for the
  186.59 +servlet context path. You can override it by setting virtual-path to "/virtual"
  186.60 +and have the portal return "/virtual" for the servlet context path.
  186.61 +
  186.62 +The default value is "" which means this is not used.
  186.63 +-->
  186.64 +<!ELEMENT virtual-path (#PCDATA)>
  186.65 +
  186.66 +<!--
  186.67 +Supppose the struts-path value is "mail". This tells the portal that all
  186.68 +requests with the path mail/* are considered part of this portlet's scope. Users
  186.69 +who request paths that match mail/* will only be granted access if they also
  186.70 +have access to this portlet. This is true for both portlet requests and regular
  186.71 +servlet requests.
  186.72 +-->
  186.73 +<!ELEMENT struts-path (#PCDATA)>
  186.74 +
  186.75 +<!--
  186.76 +The configuration-path value is no longer available. Use
  186.77 +configuration-action-class instead.
  186.78 +-->
  186.79 +<!ELEMENT configuration-path (#PCDATA)>
  186.80 +
  186.81 +<!--
  186.82 +The configuration-action-class value must be a class that implements
  186.83 +com.liferay.portal.kernel.portlet.ConfigurationAction and is called to allow
  186.84 +users to configure the portlet at runtime.
  186.85 +
  186.86 +See:
  186.87 +
  186.88 +http://docs.liferay.com/portal/6.0/javadocs/portal-impl/com/liferay/portlet/messageboards/action/ConfigurationActionImpl.html
  186.89 +-->
  186.90 +<!ELEMENT configuration-action-class (#PCDATA)>
  186.91 +
  186.92 +<!--
  186.93 +The indexer-class value must be a class that implements
  186.94 +com.liferay.portal.kernel.search.Indexer and is called to create or update a
  186.95 +search index for the portlet.
  186.96 +
  186.97 +See:
  186.98 +
  186.99 +http://docs.liferay.com/portal/6.0/javadocs/portal-impl/com/liferay/portlet/messageboards/util/Indexer.html
 186.100 +http://docs.liferay.com/portal/6.0/javadocs/portal-kernel/com/liferay/portal/kernel/search/Indexer.html
 186.101 +http://lucene.apache.org
 186.102 +-->
 186.103 +<!ELEMENT indexer-class (#PCDATA)>
 186.104 +
 186.105 +<!--
 186.106 +The open-search-class value must be a class that implements
 186.107 +com.liferay.portal.kernel.search.OpenSearch and is called to get search results
 186.108 +in the OpenSearch 1.1 standard.
 186.109 +
 186.110 +See:
 186.111 +
 186.112 +http://docs.liferay.com/portal/6.0/javadocs/portal-impl/com/liferay/portlet/alfrescocontent/util/OpenSearch.html
 186.113 +http://docs.liferay.com/portal/6.0/javadocs/portal-kernel/com/liferay/portal/kernel/search/OpenSearch.html
 186.114 +http://www.opensearch.org
 186.115 +-->
 186.116 +<!ELEMENT open-search-class (#PCDATA)>
 186.117 +
 186.118 +<!--
 186.119 +The scheduler-class value must be a class that implements
 186.120 +com.liferay.portal.kernel.job.Scheduler and is called to schedule jobs for this
 186.121 +portlet.
 186.122 +
 186.123 +See:
 186.124 +
 186.125 +http://docs.liferay.com/portal/6.0/javadocs/portal-impl/com/liferay/portlet/calendar/job/CalendarScheduler.html
 186.126 +http://docs.liferay.com/portal/6.0/javadocs/portal-kernel/com/liferay/portal/kernel/job/Scheduler.html
 186.127 +http://www.opensymphony.com/quartz
 186.128 +-->
 186.129 +<!ELEMENT scheduler-class (#PCDATA)>
 186.130 +
 186.131 +<!--
 186.132 +The scheduler-entry element contains the declarative data of a scheduler.
 186.133 +-->
 186.134 +<!ELEMENT scheduler-entry (scheduler-description?,
 186.135 +scheduler-event-listener-class, trigger)>
 186.136 +
 186.137 +<!--
 186.138 +The scheduler-description value describes a scheduler.
 186.139 +-->
 186.140 +<!ELEMENT scheduler-description (#PCDATA)>
 186.141 +
 186.142 +<!--
 186.143 +The scheduler-event-listener-class value must be a class that implements
 186.144 +com.liferay.portal.kernel.messaging.MessageListener. This class will receive
 186.145 +a message at a regular interval specified by the trigger element.
 186.146 +-->
 186.147 +<!ELEMENT scheduler-event-listener-class (#PCDATA)>
 186.148 +
 186.149 +<!--
 186.150 +The trigger element contains configuration data to indictate when to trigger the
 186.151 +class specified in scheduler-event-listener-class.
 186.152 +-->
 186.153 +<!ELEMENT trigger (cron | simple)>
 186.154 +
 186.155 +<!--
 186.156 +The cron element specifies a cron style trigger for a scheduler.
 186.157 +-->
 186.158 +<!ELEMENT cron (property-key | cron-trigger-value)>
 186.159 +
 186.160 +<!--
 186.161 +The property-key value specifies a property key that will be queried from
 186.162 +portal.properties to create a trigger.
 186.163 +
 186.164 +For a cron trigger, the queried value should be a cron text.
 186.165 +
 186.166 +For a simple trigger, the queried value should be a number that represents a
 186.167 +time interval. The unit of measure is based on the value of time-unit element.
 186.168 +-->
 186.169 +<!ELEMENT property-key (#PCDATA)>
 186.170 +
 186.171 +<!--
 186.172 +The cron-trigger-value value should be a cron text.
 186.173 +-->
 186.174 +<!ELEMENT cron-trigger-value (#PCDATA)>
 186.175 +
 186.176 +<!--
 186.177 +The simple element specifies an interval trigger for a scheduler.
 186.178 +-->
 186.179 +<!ELEMENT simple ((property-key | simple-trigger-value), time-unit)>
 186.180 +
 186.181 +<!--
 186.182 +The simple-trigger-value value is a number that represents how often to trigger
 186.183 +a scheduler.
 186.184 +-->
 186.185 +<!ELEMENT simple-trigger-value (#PCDATA)>
 186.186 +
 186.187 +<!--
 186.188 +The time-unit value is the unit of measure for the time specified in
 186.189 +property-key or simple-trigger-value. Valid values for this element are "DAY",
 186.190 +"HOUR", "MINUTE", "SECOND", or "WEEK". The default value is "SECOND".
 186.191 +-->
 186.192 +<!ELEMENT time-unit (#PCDATA)>
 186.193 +
 186.194 +<!--
 186.195 +The portlet-url-class value must be a class that extends
 186.196 +com.liferay.portlet.PortletURLImplWrapper. Set this class to override the
 186.197 +default portlet URL implementation.
 186.198 +
 186.199 +See:
 186.200 +
 186.201 +http://docs.liferay.com/portal/6.0/javadocs/portal-impl/com/liferay/portal/struts/StrutsActionPortletURL.html
 186.202 +-->
 186.203 +<!ELEMENT portlet-url-class (#PCDATA)>
 186.204 +
 186.205 +<!--
 186.206 +The friendly-url-mapper-class value must be a class that implements
 186.207 +com.liferay.portal.kernel.portlet.FriendlyURLMapper. Use this if content inside
 186.208 +a portlet needs to have a friendly URL. See the Message Boards portlet for an
 186.209 +example of its uses.
 186.210 +
 186.211 +See:
 186.212 +
 186.213 +http://docs.liferay.com/portal/6.0/javadocs/portal-impl/com/liferay/portlet/messageboards/MBFriendlyURLMapper.html
 186.214 +http://docs.liferay.com/portal/6.0/javadocs/portal-kernel/com/liferay/portal/kernel/portlet/FriendlyURLMapper.html
 186.215 +-->
 186.216 +<!ELEMENT friendly-url-mapper-class (#PCDATA)>
 186.217 +
 186.218 +<!--
 186.219 +The url-encoder-class value must be a class that implements
 186.220 +com.liferay.portal.kernel.servlet.URLEncoder. Use this to set a custom
 186.221 +URLEncoder that is used by the RenderResponse class to implement the encodeURL
 186.222 +method. This is useful if you need to add custom logic to rewrite URLs.
 186.223 +-->
 186.224 +<!ELEMENT url-encoder-class (#PCDATA)>
 186.225 +
 186.226 +<!--
 186.227 +The portlet-data-handler-class value must be a class that implements
 186.228 +com.liferay.portal.kernel.lar.PortletDataHandler and is called when archiving
 186.229 +tasks are run.
 186.230 +
 186.231 +See:
 186.232 +
 186.233 +http://docs.liferay.com/portal/6.0/javadocs/portal-impl/com/liferay/portlet/journal/lar/PortletDataHandlerImpl.html
 186.234 +http://docs.liferay.com/portal/6.0/javadocs/portal-kernel/com/liferay/portal/kernel/lar/PortletDataHandler.html
 186.235 +-->
 186.236 +<!ELEMENT portlet-data-handler-class (#PCDATA)>
 186.237 +
 186.238 +<!--
 186.239 +The portlet-layout-listener-class value must be a class that implements
 186.240 +com.liferay.portal.kernel.portlet.PortletLayoutListener and is called when a portlet
 186.241 +is added, moved, or removed from a layout.
 186.242 +
 186.243 +See:
 186.244 +
 186.245 +http://docs.liferay.com/portal/6.0/javadocs/portal-impl/com/liferay/portlet/journalcontent/JournalContentPortletLayoutListener.html
 186.246 +http://docs.liferay.com/portal/6.0/javadocs/portal-kernel/com/liferay/portal/kernel/portlet/PortletLayoutListener.html
 186.247 +-->
 186.248 +<!ELEMENT portlet-layout-listener-class (#PCDATA)>
 186.249 +
 186.250 +<!--
 186.251 +The poller-processor-class value must be a class that implements
 186.252 +com.liferay.portal.kernel.poller.PollerProcessor and is triggered by the
 186.253 +JavaScript class Liferay.Poller. It allows a portlet to use polling to be
 186.254 +notified of data changes. See the Chat portlet for a real world implementation.
 186.255 +
 186.256 +See:
 186.257 +
 186.258 +http://docs.liferay.com/portal/6.0/javadocs/portal-kernel/com/liferay/portal/kernel/poller/PollerProcessor.html
 186.259 +-->
 186.260 +<!ELEMENT poller-processor-class (#PCDATA)>
 186.261 +
 186.262 +<!--
 186.263 +The pop-message-listener-class value must be a class that implements
 186.264 +com.liferay.portal.kernel.pop.MessageListener and is called when processing
 186.265 +emails.
 186.266 +
 186.267 +See:
 186.268 +
 186.269 +http://docs.liferay.com/portal/6.0/javadocs/portal-impl/com/liferay/portlet/messageboards/pop/MessageListenerImpl.html
 186.270 +http://docs.liferay.com/portal/6.0/javadocs/portal-kernel/com/liferay/portal/kernel/pop/MessageListener.html
 186.271 +-->
 186.272 +<!ELEMENT pop-message-listener-class (#PCDATA)>
 186.273 +
 186.274 +<!--
 186.275 +The social-activity-interpreter-class value must be a class that implements
 186.276 +com.liferay.portlet.social.model.SocialActivityInterpreter and is called to
 186.277 +interpret activities into friendly messages that are easily understandable by a
 186.278 +human being.
 186.279 +
 186.280 +See:
 186.281 +
 186.282 +http://docs.liferay.com/portal/6.0/javadocs/portal-impl/com/liferay/portlet/messageboards/social/MBActivityInterpreter.html
 186.283 +http://docs.liferay.com/portal/6.0/javadocs/portal-service/com/liferay/portlet/social/model/SocialActivityInterpreter.html
 186.284 +-->
 186.285 +<!ELEMENT social-activity-interpreter-class (#PCDATA)>
 186.286 +
 186.287 +<!--
 186.288 +The social-request-interpreter-class value must be a class that implements
 186.289 +com.liferay.portlet.social.model.SocialRequestInterpreter and is called to
 186.290 +interpret requests into friendly messages that are easily understandable by a
 186.291 +human being.
 186.292 +
 186.293 +See:
 186.294 +
 186.295 +http://docs.liferay.com/portal/6.0/javadocs/portal-service/com/liferay/portlet/social/model/SocialRequestInterpreter.html
 186.296 +-->
 186.297 +<!ELEMENT social-request-interpreter-class (#PCDATA)>
 186.298 +
 186.299 +<!--
 186.300 +The webdav-storage-token value is the WebDAV directory name for data managed by
 186.301 +this portlet.
 186.302 +
 186.303 +See:
 186.304 +
 186.305 +http://docs.liferay.com/portal/6.0/javadocs/portal-impl/com/liferay/portlet/documentlibrary/webdav/DLWebDAVStorageImpl.html
 186.306 +-->
 186.307 +<!ELEMENT webdav-storage-token (#PCDATA)>
 186.308 +
 186.309 +<!--
 186.310 +The webdav-storage-class value must be a class that implements
 186.311 +com.liferay.portal.webdav.WebDAVStorage and allows data to be exposed via the
 186.312 +WebDAV protocol.
 186.313 +
 186.314 +See:
 186.315 +
 186.316 +http://docs.liferay.com/portal/6.0/javadocs/portal-impl/com/liferay/portlet/documentlibrary/webdav/DLWebDAVStorageImpl.html
 186.317 +-->
 186.318 +<!ELEMENT webdav-storage-class (#PCDATA)>
 186.319 +
 186.320 +<!--
 186.321 +Set the control-panel-entry-category value to "my", "content", "portal" or
 186.322 +"server" to make this portlet available in the Control Panel under that
 186.323 +category.
 186.324 +-->
 186.325 +<!ELEMENT control-panel-entry-category (#PCDATA)>
 186.326 +
 186.327 +<!--
 186.328 +Set the control-panel-entry-weight value to a double number to control the
 186.329 +position of the entry within its Control Panel category. Higher values mean
 186.330 +that the entry will appear lower in the Control Panel menu.
 186.331 +-->
 186.332 +<!ELEMENT control-panel-entry-weight (#PCDATA)>
 186.333 +
 186.334 +<!--
 186.335 +The control-panel-entry-class value must be a class that implements
 186.336 +com.liferay.portlet.ControlPanelEntry and is called by the Control Panel to
 186.337 +decide whether the portlet should be shown to a specific user in a specific
 186.338 +context. The default value is set in portal.properties.
 186.339 +
 186.340 +See:
 186.341 +
 186.342 +http://docs.liferay.com/portal/6.0/javadocs/portal-service/com/liferay/portlet/ControlPanelEntry.html
 186.343 +-->
 186.344 +<!ELEMENT control-panel-entry-class (#PCDATA)>
 186.345 +
 186.346 +<!--
 186.347 +The asset-renderer-factory value must be a class that implements
 186.348 +com.liferay.portlet.asset.model.AssetRendererFactory and is called by the Asset
 186.349 +Publisher.
 186.350 +
 186.351 +See:
 186.352 +
 186.353 +http://docs.liferay.com/portal/6.0/javadocs/portal-service/com/liferay/portlet/asset/model/AssetRendererFactory.html
 186.354 +-->
 186.355 +<!ELEMENT asset-renderer-factory (#PCDATA)>
 186.356 +
 186.357 +<!--
 186.358 +The custom-attributes-display value must be a class that implements
 186.359 +com.liferay.portlet.expando.model.CustomAttributesDisplay and is called by the
 186.360 +custom fields administration UI.
 186.361 +
 186.362 +See:
 186.363 +
 186.364 +http://docs.liferay.com/portal/6.0/javadocs/portal-service/com/liferay/portlet/expando/model/CustomAttributesDisplay.html
 186.365 +-->
 186.366 +<!ELEMENT custom-attributes-display (#PCDATA)>
 186.367 +
 186.368 +<!--
 186.369 +-->
 186.370 +<!ELEMENT workflow-handler (#PCDATA)>
 186.371 +
 186.372 +<!--
 186.373 +Set the preferences-company-wide value to true if the preferences for the
 186.374 +portlet are across the entire company. Setting this value to true means
 186.375 +the value for preferences-unique-per-layout and preferences-owned-by-group are
 186.376 +not used. The default value is false.
 186.377 +
 186.378 +For example, an administrator could set the preferences to an Announcements
 186.379 +portlet that would save a message in the portlet's preferences. This message
 186.380 +would then be used across all pages for that company. The portlet must not be
 186.381 +instanceable because instanceable portlets have uniquely generated portlet ids.
 186.382 +
 186.383 +The default behavior of the bundled Announcements portlet sets the instanceable
 186.384 +value to true so that normal users cannot create company wide messages. A future
 186.385 +release would include permissions for the edit mode versus the view mode which
 186.386 +would allow an administrator to set the message while users would just view the
 186.387 +message.
 186.388 +-->
 186.389 +<!ELEMENT preferences-company-wide (#PCDATA)>
 186.390 +
 186.391 +<!--
 186.392 +Set the preferences-unique-per-layout value to true if the preferences for the
 186.393 +portlet are unique across all pages. If set to false, the preferences for the
 186.394 +portlet are shared across all pages. The default value is true.
 186.395 +
 186.396 +The preferences-unique-per-layout element is used in combination with the
 186.397 +preferences-owned-by-group element. See the comments for the
 186.398 +preferences-owned-by-group element for more information.
 186.399 +-->
 186.400 +<!ELEMENT preferences-unique-per-layout (#PCDATA)>
 186.401 +
 186.402 +<!--
 186.403 +Set the preferences-owned-by-group value to true if the preferences for the
 186.404 +portlet are owned by the group when the portlet is shown in a group page. If
 186.405 +set to false, the preferences are owned by the user at all times. The default
 186.406 +value is true.
 186.407 +
 186.408 +Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 186.409 +preferences-owned-by-group set to false. Users can set a different list of
 186.410 +stocks for every personal page. Users can set a different list of stocks for
 186.411 +every community page.
 186.412 +
 186.413 +Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 186.414 +preferences-owned-by-group set to false. Users can set one list of stocks to be
 186.415 +shared across all personal pages. Users can set one list of stocks to be shared
 186.416 +across a community's set of pages.
 186.417 +
 186.418 +Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 186.419 +preferences-owned-by-group set to true. Users can set a different list of stocks
 186.420 +for every personal page. Administrators set the portlet preferences for users in
 186.421 +a community page. Administrators can set a different list of stocks for every
 186.422 +community page that are then shared by all users within a community.
 186.423 +
 186.424 +Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 186.425 +preferences-owned-by-group set to true. Users can set one list of stocks to be
 186.426 +shared across all personal pages. Administrators set the portlet preferences for
 186.427 +users in a community page. Administrators can set one list of stocks to be
 186.428 +shared by all users across a community's set of pages.
 186.429 +-->
 186.430 +<!ELEMENT preferences-owned-by-group (#PCDATA)>
 186.431 +
 186.432 +<!--
 186.433 +Set the use-default-template value to true if the portlet uses the default
 186.434 +template to decorate and wrap content. Setting this to false allows the
 186.435 +developer to own and maintain the portlet's entire outputted content. The
 186.436 +default value is true.
 186.437 +
 186.438 +The most common use of this is if you want the portlet to look different from
 186.439 +the other portlets or if you want the portlet to not have borders around the
 186.440 +outputted content.
 186.441 +-->
 186.442 +<!ELEMENT use-default-template (#PCDATA)>
 186.443 +
 186.444 +<!--
 186.445 +Set the show-portlet-access-denied value to true if users are shown the portlet
 186.446 +with an access denied message if they do not have access to the portlet. If set
 186.447 +to false, users are never shown the portlet if they do not have access to the
 186.448 +portlet. The default value is set in portal.properties.
 186.449 +
 186.450 +See:
 186.451 +
 186.452 +http://www.liferay.com/page/guest/documentation/development/properties
 186.453 +-->
 186.454 +<!ELEMENT show-portlet-access-denied (#PCDATA)>
 186.455 +
 186.456 +<!--
 186.457 +Set the show-portlet-inactive value to true if users are shown the portlet
 186.458 +with an inactive message if the portlet is inactive. If set to false, users are
 186.459 +never shown the portlet if the portlet is inactive. The default value is set in
 186.460 +portal.properties.
 186.461 +
 186.462 +http://www.liferay.com/page/guest/documentation/development/properties
 186.463 +-->
 186.464 +<!ELEMENT show-portlet-inactive (#PCDATA)>
 186.465 +
 186.466 +<!--
 186.467 +Set the action-url-redirect value to true if an action URL for this portlet
 186.468 +should cause an auto redirect. This helps prevent double submits. The default
 186.469 +value is false.
 186.470 +-->
 186.471 +<!ELEMENT action-url-redirect (#PCDATA)>
 186.472 +
 186.473 +<!--
 186.474 +Set the restore-current-view value to true if the portlet restores to the
 186.475 +current view when toggling between maximized and normal states. If set to false,
 186.476 +the portlet will reset the current view when toggling between maximized and
 186.477 +normal states. The default value is true.
 186.478 +-->
 186.479 +<!ELEMENT restore-current-view (#PCDATA)>
 186.480 +
 186.481 +<!--
 186.482 +Set the maximize-edit value to true if the portlet goes into the maximized state
 186.483 +when the user goes into the edit mode. This only affects the default portal
 186.484 +icons and not what may be programmatically set by the portlet developer.
 186.485 +The default value is false.
 186.486 +-->
 186.487 +<!ELEMENT maximize-edit (#PCDATA)>
 186.488 +
 186.489 +<!--
 186.490 +Set the maximize-help value to true if the portlet goes into the maximized state
 186.491 +when the user goes into the help mode. This only affects the default portal
 186.492 +icons and not what may be programmatically set by the portlet developer.
 186.493 +The default value is false.
 186.494 +-->
 186.495 +<!ELEMENT maximize-help (#PCDATA)>
 186.496 +
 186.497 +<!--
 186.498 +Set the pop-up-print value to true if the portlet goes into the pop up state
 186.499 +when the user goes into the print mode. This only affects the default portal
 186.500 +icons and not what may be programmatically set by the portlet developer.
 186.501 +The default value is true.
 186.502 +-->
 186.503 +<!ELEMENT pop-up-print (#PCDATA)>
 186.504 +
 186.505 +<!--
 186.506 +Set the layout-cacheable flag to true if the data contained in this portlet can
 186.507 +will never change unless the layout or Journal portlet entry is changed.
 186.508 +-->
 186.509 +<!ELEMENT layout-cacheable (#PCDATA)>
 186.510 +
 186.511 +<!--
 186.512 +Set the instanceable value to true if the portlet can appear multiple times on a
 186.513 +page. If set to false, the portlet can only appear once on a page. The default
 186.514 +value is false.
 186.515 +-->
 186.516 +<!ELEMENT instanceable (#PCDATA)>
 186.517 +
 186.518 +<!--
 186.519 +If the scopeable is set to true, an administrator will be able to configure the
 186.520 +scope of the data of the portlet to either the current community (default),
 186.521 +the current layout, or the scope of any other layout of the community that
 186.522 +already exists. Portlets that want to support this must be programmed to obtain
 186.523 +the proper scope group id according to the configuration and scope their data
 186.524 +accordingly. The default is false.
 186.525 +-->
 186.526 +<!ELEMENT scopeable (#PCDATA)>
 186.527 +
 186.528 +<!--
 186.529 +Set the user-principal-strategy value to either "userId" or "screenName".
 186.530 +Calling request.getRemoteUser() will normally return the user id. However, some
 186.531 +portlets may need the user principal returned to be screen name instead.
 186.532 +-->
 186.533 +<!ELEMENT user-principal-strategy (#PCDATA)>
 186.534 +
 186.535 +<!--
 186.536 +Set the private-request-attributes value to true if the portlet does not share
 186.537 +request attributes with the portal or any other portlet. The default value is
 186.538 +true. The property "request.shared.attributes" in portal.properties specifies
 186.539 +which request attributes are shared even when the private-request-attributes
 186.540 +value is true.
 186.541 +-->
 186.542 +<!ELEMENT private-request-attributes (#PCDATA)>
 186.543 +
 186.544 +<!--
 186.545 +Set the private-session-attributes value to true if the portlet does not share
 186.546 +session attributes with the portal. The default value is true. The property
 186.547 +"session.shared.attributes" in portal.properties specifies which session
 186.548 +attributes are shared even when the private-session-attributes value is true.
 186.549 +-->
 186.550 +<!ELEMENT private-session-attributes (#PCDATA)>
 186.551 +
 186.552 +<!--
 186.553 +The default value of render-weight is 1. If set to a value less than 1, the
 186.554 +portlet is rendered in parallel. If set to a value of 1 or greater, then the
 186.555 +portlet is rendered serially. Portlets with a greater render weight have greater
 186.556 +priority and will be rendered before portlets with a lower render weight.
 186.557 +
 186.558 +If the ajaxable value is set to false, then render-weight is always set to 1
 186.559 +if it is set to a value less than 1. This means ajaxable can override
 186.560 +render-weight if ajaxable is set to false.
 186.561 +-->
 186.562 +<!ELEMENT render-weight (#PCDATA)>
 186.563 +
 186.564 +<!--
 186.565 +The default value of ajaxable is true. If set to false, then this portlet can
 186.566 +never be displayed via Ajax.
 186.567 +-->
 186.568 +<!ELEMENT ajaxable (#PCDATA)>
 186.569 +
 186.570 +<!--
 186.571 +Set the path of CSS that will be referenced in the page's header relative to the
 186.572 +portal's context path.
 186.573 +-->
 186.574 +<!ELEMENT header-portal-css (#PCDATA)>
 186.575 +
 186.576 +<!--
 186.577 +Set the path of CSS that will be referenced in the page's header relative to the
 186.578 +portlet's context path.
 186.579 +-->
 186.580 +<!ELEMENT header-portlet-css (#PCDATA)>
 186.581 +
 186.582 +<!--
 186.583 +Set the path of JavaScript that will be referenced in the page's header relative
 186.584 +to the portal's context path.
 186.585 +-->
 186.586 +<!ELEMENT header-portal-javascript (#PCDATA)>
 186.587 +
 186.588 +<!--
 186.589 +Set the path of JavaScript that will be referenced in the page's header relative
 186.590 +to the portlet's context path.
 186.591 +-->
 186.592 +<!ELEMENT header-portlet-javascript (#PCDATA)>
 186.593 +
 186.594 +<!--
 186.595 +Set the path of CSS that will be referenced in the page's footer relative to the
 186.596 +portal's context path.
 186.597 +-->
 186.598 +<!ELEMENT footer-portal-css (#PCDATA)>
 186.599 +
 186.600 +<!--
 186.601 +Set the path of CSS that will be referenced in the page's footer relative to the
 186.602 +portlet's context path.
 186.603 +-->
 186.604 +<!ELEMENT footer-portlet-css (#PCDATA)>
 186.605 +
 186.606 +<!--
 186.607 +Set the path of JavaScript that will be referenced in the page's footer relative
 186.608 +to the portal's context path.
 186.609 +-->
 186.610 +<!ELEMENT footer-portal-javascript (#PCDATA)>
 186.611 +
 186.612 +<!--
 186.613 +Set the path of JavaScript that will be referenced in the page's footer relative
 186.614 +to the portlet's context path.
 186.615 +-->
 186.616 +<!ELEMENT footer-portlet-javascript (#PCDATA)>
 186.617 +
 186.618 +<!--
 186.619 +Set name of the CSS class that will be injected in the DIV that wraps this
 186.620 +portlet.
 186.621 +-->
 186.622 +<!ELEMENT css-class-wrapper (#PCDATA)>
 186.623 +
 186.624 +<!--
 186.625 +Set the facebook-integration value to either "fbml" or "iframe". The default
 186.626 +value is "iframe" because IFrame integration will work without requiring any
 186.627 +changes to your code. See the Message Boards portlet for minor changes that were
 186.628 +made to make it FBML compliant. Note that the Liferay tag libraries already
 186.629 +output FBML automatically if a request is made by Facebook.
 186.630 +-->
 186.631 +<!ELEMENT facebook-integration (#PCDATA)>
 186.632 +
 186.633 +<!--
 186.634 +If the add-default-resource value is set to false, and the portlet does not
 186.635 +belong to the page but has been dynamically added, then the user will see that
 186.636 +he does not have permissions to view the portlet. If the add-default-resource
 186.637 +value is set to true, the default portlet resources and permissions are added to
 186.638 +the page. The user can then view the portlet. Most portlets are harmless and can
 186.639 +benefit from this flexibility. However, to prevent security loop holes, the
 186.640 +default value is false.
 186.641 +-->
 186.642 +<!ELEMENT add-default-resource (#PCDATA)>
 186.643 +
 186.644 +<!--
 186.645 +Set the system value to true if the portlet is a system portlet that a user
 186.646 +cannot manually add to their page. The default value is false.
 186.647 +-->
 186.648 +<!ELEMENT system (#PCDATA)>
 186.649 +
 186.650 +<!--
 186.651 +Set the active value to true if the portlet is active and available to users.
 186.652 +If set to false, the portlet will not be active or available to users. The
 186.653 +default value is true.
 186.654 +
 186.655 +This value can be changed at runtime via the Admin portlet.
 186.656 +-->
 186.657 +<!ELEMENT active (#PCDATA)>
 186.658 +
 186.659 +<!--
 186.660 +Set the include value to true to if the portlet is available to the portal. If
 186.661 +set to false, the portlet is not available to the portal. The default value is
 186.662 +true.
 186.663 +
 186.664 +Portlets that are not included as part of the portal are never available to the
 186.665 +user to be made active or inactive. As far the user knows, the portlets do not
 186.666 +even exist in the system. This allows the Liferay developers to bundle a lot of
 186.667 +portlets in one core package, and yet allow custom deployments to turn on or off
 186.668 +individual portlets or sets of portlets. This follows the Siebel and Microsoft
 186.669 +model of bundling everything in one core package, but using XML configuration or
 186.670 +registry settings to turn on and off features or sets of features.
 186.671 +
 186.672 +We do not recommend that custom deployers modify the core source by removing
 186.673 +specific portlets because this prevents an easy upgrade process in the future.
 186.674 +The best way to turn on and off portlets is to set the include element. The
 186.675 +advantage of this way of doing things is that it becomes very easy to deploy
 186.676 +Liferay. All features are available in one package. The disadvantage is that by
 186.677 +not utilizing all of the portlets, you are wasting disk space and may even take
 186.678 +a small but static memory footprint. However, we feel that the extra disk space
 186.679 +and memory usage is a cheap price to pay in order to provide an easy
 186.680 +installation and upgrade path.
 186.681 +-->
 186.682 +<!ELEMENT include (#PCDATA)>
 186.683 +
 186.684 +<!--
 186.685 +The role-mapper contains two names specified by role-name and role-link. The
 186.686 +role-name value must be a role specified in portlet.xml. The role-link value
 186.687 +must be the name of a Liferay role that exists in the database. The role-mapper
 186.688 +element pairs up these two values to map roles from portlet.xml to roles in
 186.689 +the Liferay database.
 186.690 +
 186.691 +This is needed because Liferay roles may contain spaces whereas roles in
 186.692 +portlet.xml cannot contain spaces. This also adds extra flexibility where the
 186.693 +portlet vendor does not need to have any knowledge about Liferay's roles.
 186.694 +-->
 186.695 +<!ELEMENT role-mapper (role-name, role-link)>
 186.696 +
 186.697 +<!--
 186.698 +See the comments in role-mapper element.
 186.699 +-->
 186.700 +<!ELEMENT role-name (#PCDATA)>
 186.701 +
 186.702 +<!--
 186.703 +See the comments in role-mapper element.
 186.704 +-->
 186.705 +<!ELEMENT role-link (#PCDATA)>
 186.706 +
 186.707 +<!--
 186.708 +The custom-user-attribute contains a list of names that are retrieved using a
 186.709 +custom class that extends com.liferay.portlet.CustomUserAttributes.
 186.710 +
 186.711 +Download the sample hot deployable portlet WAR named test.war. Look for the
 186.712 +class com.sample.strutsliferay.portlet.SampleUserAttributes to see how it
 186.713 +associates the custom user attribute "user.name.test" with the value
 186.714 +"Test Name". This class could be modified to read custom user attributes from
 186.715 +another datasource that may be a database, a LDAP server, or a web service.
 186.716 +
 186.717 +See:
 186.718 +
 186.719 +http://www.liferay.com/page/guest/documentation/development/hot_deploy
 186.720 +-->
 186.721 +<!ELEMENT custom-user-attribute (name+, custom-class)>
 186.722 +
 186.723 +<!--
 186.724 +See the comments in custom-user-attribute element.
 186.725 +-->
 186.726 +<!ELEMENT name (#PCDATA)>
 186.727 +
 186.728 +<!--
 186.729 +See the comments in custom-user-attribute element.
 186.730 +-->
 186.731 +<!ELEMENT custom-class (#PCDATA)>
 186.732 \ No newline at end of file
   187.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   187.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-service-builder_5_1_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   187.3 @@ -0,0 +1,406 @@
   187.4 +<!--
   187.5 +This is the DTD for the Service Builder parameters for Liferay Portal.
   187.6 +
   187.7 +<!DOCTYPE service-builder PUBLIC
   187.8 +	"-//Liferay//DTD Service Builder 5.1.0//EN"
   187.9 +	"http://www.liferay.com/dtd/liferay-service-builder_5_1_0.dtd">
  187.10 +-->
  187.11 +
  187.12 +<!--
  187.13 +The service-builder element is the root of the deployment descriptor for
  187.14 +a Service Builder descriptor that is used to generate services available to
  187.15 +portlets. The Service Builder saves the developer time by generating Spring
  187.16 +utilities, SOAP utilities, and Hibernate persistence classes to ease the
  187.17 +development of services.
  187.18 +-->
  187.19 +<!ELEMENT service-builder (author?, namespace, entity+, exceptions?)>
  187.20 +
  187.21 +<!--
  187.22 +The package-path value specifies the package of the generated code.
  187.23 +-->
  187.24 +<!ATTLIST service-builder
  187.25 +	package-path CDATA #REQUIRED
  187.26 +>
  187.27 +
  187.28 +<!--
  187.29 +The author element is the name of the user associated with the generated code.
  187.30 +-->
  187.31 +<!ELEMENT author (#PCDATA)>
  187.32 +
  187.33 +<!--
  187.34 +The namespace element must be a unique namespace for this component. Table names
  187.35 +will be prepended with this namespace. Generated JSON JavaScript will be scoped
  187.36 +to this namespace as well (i.e., Liferay.Service.Test.* if the namespace is
  187.37 +Test).
  187.38 +-->
  187.39 +<!ELEMENT namespace (#PCDATA)>
  187.40 +
  187.41 +<!--
  187.42 +An entity usually represents a business facade and a table in the database. If
  187.43 +an entity does not have any columns, then it only represents a business facade.
  187.44 +The Service Builder will always generate an empty business facade POJO if it
  187.45 +does not exist. Upon subsequent generations, the Service Builder will check to
  187.46 +see if the business facade already exists. If it exists and has additional
  187.47 +methods, then the Service Builder will also update the SOAP wrappers.
  187.48 +
  187.49 +If an entity does have columns, then the value object, the POJO class that
  187.50 +is mapped to the database, and other persistence utilities are also generated
  187.51 +based on the order and finder elements.
  187.52 +-->
  187.53 +<!ELEMENT entity (column*, order?, finder*, reference*, tx-required*)>
  187.54 +
  187.55 +<!--
  187.56 +The name value specifies the name of the entity.
  187.57 +
  187.58 +The table value specifies the name of the table that this entity maps to in the
  187.59 +database. If this value is not set, then the name of the table is the same as
  187.60 +the name of the entity name.
  187.61 +
  187.62 +If the uuid value is true, then the service will generate a UUID column for the
  187.63 +service. This column will automatically be populated with a UUID. Developers
  187.64 +will also be able to find and remove based on that UUID. The default value is
  187.65 +false.
  187.66 +
  187.67 +If the local-service value is true, then the service will generate the local
  187.68 +interfaces for the service. The default value is false.
  187.69 +
  187.70 +If the remote-service value is true, then the service will generate remote
  187.71 +interfaces for the service. The default value is true.
  187.72 +
  187.73 +The persistence-class value specifies the name of your custom persistence class.
  187.74 +This class must implmeent the generated persistence interface or extend the
  187.75 +generated persistence class. This allows you to override default behavior
  187.76 +without modifying the generated persistence class.
  187.77 +
  187.78 +You can generate classes to use a custom data source and session factory.
  187.79 +Point "spring.configs" in portal.properties to load your custom Spring XML with
  187.80 +the defintions of your custom data source and session factory. Then set the
  187.81 +data-source and session-factory values to your custom values.
  187.82 +
  187.83 +The data-source value specifies the data source target that is set to the
  187.84 +persistence class. The default value is the Liferay data source. This is used in
  187.85 +conjunction with session-factory. See data-source-spring.xml.
  187.86 +
  187.87 +The session-factory value specifies the session factory that is set to the
  187.88 +persistence class. The default value is the Liferay session factory. This is
  187.89 +used in conjunction with data-source. See data-source-spring.xml.
  187.90 +
  187.91 +The tx-manager value specifies the transaction manager that Spring uses. The
  187.92 +default value is the Spring Hibernate transaction manager that wraps the Liferay
  187.93 +data source and session factory. See data-source-spring.xml. Set this attribute
  187.94 +to "none" to disable transaction management.
  187.95 +
  187.96 +The cache-enabled value specifies whether or not to cache this queries for this
  187.97 +entity. Set this to false if data in the table will be updated by other
  187.98 +programs. The default value is true.
  187.99 +-->
 187.100 +<!ATTLIST entity
 187.101 +	name CDATA #REQUIRED
 187.102 +	table CDATA #IMPLIED
 187.103 +	uuid CDATA #IMPLIED
 187.104 +	local-service CDATA #IMPLIED
 187.105 +	remote-service CDATA #IMPLIED
 187.106 +	persistence-class CDATA #IMPLIED
 187.107 +	data-source CDATA #IMPLIED
 187.108 +	session-factory CDATA #IMPLIED
 187.109 +	tx-manager CDATA #IMPLIED
 187.110 +	cache-enabled CDATA #IMPLIED
 187.111 +>
 187.112 +
 187.113 +<!--
 187.114 +The column element represents a column in the database.
 187.115 +-->
 187.116 +<!ELEMENT column (#PCDATA)>
 187.117 +
 187.118 +<!--
 187.119 +The name value specifies the getter and setter name in the entity.
 187.120 +
 187.121 +The type value specifies whether the column is a String, Boolean, or int, etc.
 187.122 +
 187.123 +For example:
 187.124 +
 187.125 +<column name="companyId" db-name="companyId" type="String" />
 187.126 +
 187.127 +The above column specifies that there will be a getter called
 187.128 +pojo.getCompanyId() that will return a String.
 187.129 +
 187.130 +Set db-name to map the field to a physical database column that is different
 187.131 +from the column name.
 187.132 +
 187.133 +If the primary value is set to true, then this column is part of the primary key
 187.134 +of the entity. If multiple columns have the primary value set to true, then a
 187.135 +compound key will be created.
 187.136 +
 187.137 +See com.liferay.portal.service.persistence.LayoutPK for an example of a compound
 187.138 +primary key.
 187.139 +
 187.140 +If the entity and mapping-key attributes are specified and mapping-table is not,
 187.141 +then the Service Builder will assume you are specifying a one to many
 187.142 +relationship.
 187.143 +
 187.144 +For example:
 187.145 +
 187.146 +<column
 187.147 +	name="shoppingItemPrices"
 187.148 +	type="Collection"
 187.149 +	entity="ShoppingItemPrice"
 187.150 +	mapping-key="itemId"
 187.151 +/>
 187.152 +
 187.153 +The above column specifies that there will be a getter called
 187.154 +pojo.getShoppingItemPrices() that will return a collection. It will map to a
 187.155 +column called itemId in the table that maps to the entity ShoppingItemPrice.
 187.156 +
 187.157 +If the entity and mapping-table attributes are specified and mapping-key is not,
 187.158 +then the Service Builder will assume you are specifying a many to many
 187.159 +relationship.
 187.160 +
 187.161 +For example:
 187.162 +
 187.163 +<column
 187.164 +	name="roles"
 187.165 +	type="Collection"
 187.166 +	entity="Role"
 187.167 +	mapping-table="Groups_Roles"
 187.168 +/>
 187.169 +
 187.170 +The above column specifies that there will be a getter called
 187.171 +pojo.getRoles() that will return a collection. It will use a mapping table
 187.172 +called Groups_Roles to give a many to many relationship between groups and
 187.173 +roles.
 187.174 +
 187.175 +The id-type and id-param values are used in order to create an auto-generated, 
 187.176 +auto-incrementing primary key when inserting records into a table. This can be 
 187.177 +implemented in 4 different ways, depending on the type of database being used. 
 187.178 +In all cases, the primary key of the model object should be assigned a value of 
 187.179 +null, and hibernate will know to replace the null value with an auto-generated, 
 187.180 +auto-incremented value. If no id-type value is used, it is assumed that the 
 187.181 +primary key will be assigned and not auto-generated.
 187.182 +
 187.183 +The first implementation uses a class to generate a primary key. 
 187.184 +
 187.185 +For example:
 187.186 +
 187.187 +<column 
 187.188 +	name="id" 
 187.189 +	type="Integer" 
 187.190 +	primary="true" 
 187.191 +	id-type="class" 
 187.192 +	id-param="com.liferay.counter.service.persistence.IDGenerator" 
 187.193 +/>
 187.194 +
 187.195 +In this implementation, the class specified in the id-param value will be called
 187.196 +to retrieve a unique identifier (in the example above, an Integer) that will be 
 187.197 +used as the primary key for the new record. This implementation works for all 
 187.198 +supported databases.
 187.199 +
 187.200 +The second implementation generates identifiers that are unique only when no 
 187.201 +other process is inserting data into the same table. This implementation should
 187.202 +NOT be used in a clustered environment, but it does work for all supported 
 187.203 +databases.
 187.204 +
 187.205 +For example:
 187.206 +
 187.207 +<column 
 187.208 +	name="id" 
 187.209 +	type="Integer" 
 187.210 +	primary="true" 
 187.211 +	id-type="increment" 
 187.212 +/>
 187.213 +
 187.214 +The third implementation uses an identity column to generate a primary key.
 187.215 +
 187.216 +For example:
 187.217 +
 187.218 +<column 
 187.219 +	name="id" 
 187.220 +	type="Integer" 
 187.221 +	primary="true" 
 187.222 +	id-type="identity" 
 187.223 +/>
 187.224 +
 187.225 +In this implementation, the create table SQL generated for this entity will 
 187.226 +create an identity column that natively auto-generates a primary key whenever
 187.227 +an insert occurs. This implementation is only supported by DB2, MySQL, and
 187.228 +MS SQL Server.
 187.229 +
 187.230 +The fourth implementation uses a sequence to generate a primary key.
 187.231 +
 187.232 +For example:
 187.233 +
 187.234 +<column 
 187.235 +	name="id" 
 187.236 +	type="Integer" 
 187.237 +	primary="true" 
 187.238 +	id-type="sequence" 
 187.239 +	id-param="id_sequence" 
 187.240 +/>
 187.241 +
 187.242 +In this implementation, a create sequence SQL statement is created based on
 187.243 +the id-param value (stored in /sql/sequences.sql). This sequence is then 
 187.244 +accessed to generate a unique identifier whenever an insert occurs. This
 187.245 +implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.
 187.246 +
 187.247 +The convert-null value specifies whether or not the column value is
 187.248 +automatically converted to a non null value if it is null. This only applies if
 187.249 +the type value is String. This is particularly useful if your entity is
 187.250 +referencing a read only table or a database view so that Hibernate does not try
 187.251 +to issue unnecessary updates. The default value is true.
 187.252 +-->
 187.253 +<!ATTLIST column
 187.254 +	name CDATA #REQUIRED
 187.255 +	db-name CDATA #IMPLIED
 187.256 +	type CDATA #REQUIRED
 187.257 +	primary CDATA #IMPLIED
 187.258 +	entity CDATA #IMPLIED
 187.259 +	mapping-key CDATA #IMPLIED
 187.260 +	mapping-table CDATA #IMPLIED
 187.261 +	id-type CDATA #IMPLIED
 187.262 +	id-param CDATA #IMPLIED
 187.263 +	convert-null CDATA #IMPLIED
 187.264 +>
 187.265 +
 187.266 +<!--
 187.267 +The order element specifies a default ordering and sorting of the entities when
 187.268 +they are retrieved from the database.
 187.269 +-->
 187.270 +<!ELEMENT order (order-column+)>
 187.271 +
 187.272 +<!--
 187.273 +Set the by attribute to "asc" or "desc" to order by ascending or descending.
 187.274 +-->
 187.275 +<!ATTLIST order
 187.276 +	by CDATA #IMPLIED
 187.277 +>
 187.278 +
 187.279 +<!--
 187.280 +The order-column element allows you to order the entities by specific columns.
 187.281 +-->
 187.282 +<!ELEMENT order-column (#PCDATA)>
 187.283 +
 187.284 +<!--
 187.285 +The attributes of the order-column element allows you to fine tune the ordering
 187.286 +of the entity.
 187.287 +
 187.288 +For example:
 187.289 +
 187.290 +<order by="asc">
 187.291 +	<order-column name="parentLayoutId" />
 187.292 +	<order-column name="priority" />
 187.293 +</order>
 187.294 +
 187.295 +The above settings will order by parentLayoutId and then by priority in an
 187.296 +ascending manner.
 187.297 +
 187.298 +For example:
 187.299 +
 187.300 +<order by="asc">
 187.301 +	<order-column name="name" case-sensitive="false" />
 187.302 +</order>
 187.303 +
 187.304 +The above settings will order by name and will not be case sensitive.
 187.305 +
 187.306 +For example:
 187.307 +
 187.308 +<order>
 187.309 +	<order-column name="articleId" order-by="asc" />
 187.310 +	<order-column name="version" order-by="desc" />
 187.311 +</order>
 187.312 +
 187.313 +The above settings will order by articleId in an ascending manner and then by
 187.314 +version in a descending manner.
 187.315 +-->
 187.316 +<!ATTLIST order-column
 187.317 +	name CDATA #REQUIRED
 187.318 +	case-sensitive CDATA #IMPLIED
 187.319 +	order-by CDATA #IMPLIED
 187.320 +>
 187.321 +
 187.322 +<!--
 187.323 +The finder element represents a generated finder method.
 187.324 +-->
 187.325 +<!ELEMENT finder (finder-column+)>
 187.326 +
 187.327 +<!--
 187.328 +-->
 187.329 +<!ATTLIST finder
 187.330 +	name CDATA #REQUIRED
 187.331 +	return-type CDATA #REQUIRED
 187.332 +	where CDATA #IMPLIED
 187.333 +	db-index CDATA #IMPLIED
 187.334 +>
 187.335 +
 187.336 +<!--
 187.337 +The finder-column element specifies the columns to find by.
 187.338 +-->
 187.339 +<!ELEMENT finder-column (#PCDATA)>
 187.340 +
 187.341 +<!--
 187.342 +The name value specifies the name of the finder method.
 187.343 +
 187.344 +For example:
 187.345 +
 187.346 +<finder name="CompanyId" return-type="Collection">
 187.347 +	<finder-column name="companyId" />
 187.348 +</finder>
 187.349 +
 187.350 +The above settings will create a finder with the name findByCompanyId that will
 187.351 +return a Collection and require a given companyId. It will also generate
 187.352 +several more findByCompanyId methods that take in pagination fields (int begin,
 187.353 +int end) and more sorting options. The easiest way to understand this is to
 187.354 +look at a generated PersistenceImpl class. The Service Builder will also
 187.355 +generate removeByCompanyId and countByCompanyId.
 187.356 +
 187.357 +See com.liferay.portal.service.persistence.LayoutPersistenceImpl for a good
 187.358 +example.
 187.359 +
 187.360 +The attribute comparator takes in the values =, !=, <, <=, >, >=, or LIKE and is
 187.361 +used to compare this column.
 187.362 +
 187.363 +The attribute case-sensitive is a boolean value and is only used if the column
 187.364 +is a String value.
 187.365 +-->
 187.366 +<!ATTLIST finder-column
 187.367 +	name CDATA #REQUIRED
 187.368 +	case-sensitive CDATA #IMPLIED
 187.369 +	comparator CDATA #IMPLIED
 187.370 +>
 187.371 +
 187.372 +<!--
 187.373 +The reference element allows you to inject services from another service.xml
 187.374 +within the same class loader. For example, if you inject the Resource entity,
 187.375 +then you'll be able to reference the Resource services from your service
 187.376 +implementation via the methods getResourceLocalService and getResourceService.
 187.377 +You'll also be able to reference the Resource services via the variables
 187.378 +resourceLocalService and resourceService.
 187.379 +-->
 187.380 +<!ELEMENT reference (#PCDATA)>
 187.381 +
 187.382 +<!--
 187.383 +See the comments in reference element.
 187.384 +-->
 187.385 +<!ATTLIST reference
 187.386 +	package-path CDATA #IMPLIED
 187.387 +	entity CDATA #IMPLIED
 187.388 +>
 187.389 +
 187.390 +<!--
 187.391 +The tx-required element has a text value that will be used to match method names
 187.392 +that require transactions. By default, the methods: add*, check*, clear*,
 187.393 +delete*, set*, and update* require propagation of transactions. All other
 187.394 +methods support transactions but are assumed to be read only. If you want
 187.395 +additional methods to fall under transactions, add the method name to this
 187.396 +element.
 187.397 +-->
 187.398 +<!ELEMENT tx-required (#PCDATA)>
 187.399 +
 187.400 +<!--
 187.401 +The exceptions element contain a list of generated exceptions. This doesn't save
 187.402 +a lot of typing, but can still be helpful.
 187.403 +-->
 187.404 +<!ELEMENT exceptions (exception*)>
 187.405 +
 187.406 +<!--
 187.407 +See the comments in exceptions element.
 187.408 +-->
 187.409 +<!ELEMENT exception (#PCDATA)>
 187.410 \ No newline at end of file
   188.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   188.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-service-builder_5_2_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   188.3 @@ -0,0 +1,406 @@
   188.4 +<!--
   188.5 +This is the DTD for the Service Builder parameters for Liferay Portal.
   188.6 +
   188.7 +<!DOCTYPE service-builder PUBLIC
   188.8 +	"-//Liferay//DTD Service Builder 5.2.0//EN"
   188.9 +	"http://www.liferay.com/dtd/liferay-service-builder_5_2_0.dtd">
  188.10 +-->
  188.11 +
  188.12 +<!--
  188.13 +The service-builder element is the root of the deployment descriptor for
  188.14 +a Service Builder descriptor that is used to generate services available to
  188.15 +portlets. The Service Builder saves the developer time by generating Spring
  188.16 +utilities, SOAP utilities, and Hibernate persistence classes to ease the
  188.17 +development of services.
  188.18 +-->
  188.19 +<!ELEMENT service-builder (author?, namespace, entity+, exceptions?)>
  188.20 +
  188.21 +<!--
  188.22 +The package-path value specifies the package of the generated code.
  188.23 +-->
  188.24 +<!ATTLIST service-builder
  188.25 +	package-path CDATA #REQUIRED
  188.26 +>
  188.27 +
  188.28 +<!--
  188.29 +The author element is the name of the user associated with the generated code.
  188.30 +-->
  188.31 +<!ELEMENT author (#PCDATA)>
  188.32 +
  188.33 +<!--
  188.34 +The namespace element must be a unique namespace for this component. Table names
  188.35 +will be prepended with this namespace. Generated JSON JavaScript will be scoped
  188.36 +to this namespace as well (i.e., Liferay.Service.Test.* if the namespace is
  188.37 +Test).
  188.38 +-->
  188.39 +<!ELEMENT namespace (#PCDATA)>
  188.40 +
  188.41 +<!--
  188.42 +An entity usually represents a business facade and a table in the database. If
  188.43 +an entity does not have any columns, then it only represents a business facade.
  188.44 +The Service Builder will always generate an empty business facade POJO if it
  188.45 +does not exist. Upon subsequent generations, the Service Builder will check to
  188.46 +see if the business facade already exists. If it exists and has additional
  188.47 +methods, then the Service Builder will also update the SOAP wrappers.
  188.48 +
  188.49 +If an entity does have columns, then the value object, the POJO class that
  188.50 +is mapped to the database, and other persistence utilities are also generated
  188.51 +based on the order and finder elements.
  188.52 +-->
  188.53 +<!ELEMENT entity (column*, order?, finder*, reference*, tx-required*)>
  188.54 +
  188.55 +<!--
  188.56 +The name value specifies the name of the entity.
  188.57 +
  188.58 +The table value specifies the name of the table that this entity maps to in the
  188.59 +database. If this value is not set, then the name of the table is the same as
  188.60 +the name of the entity name.
  188.61 +
  188.62 +If the uuid value is true, then the service will generate a UUID column for the
  188.63 +service. This column will automatically be populated with a UUID. Developers
  188.64 +will also be able to find and remove based on that UUID. The default value is
  188.65 +false.
  188.66 +
  188.67 +If the local-service value is true, then the service will generate the local
  188.68 +interfaces for the service. The default value is false.
  188.69 +
  188.70 +If the remote-service value is true, then the service will generate remote
  188.71 +interfaces for the service. The default value is true.
  188.72 +
  188.73 +The persistence-class value specifies the name of your custom persistence class.
  188.74 +This class must implmeent the generated persistence interface or extend the
  188.75 +generated persistence class. This allows you to override default behavior
  188.76 +without modifying the generated persistence class.
  188.77 +
  188.78 +You can generate classes to use a custom data source and session factory.
  188.79 +Point "spring.configs" in portal.properties to load your custom Spring XML with
  188.80 +the defintions of your custom data source and session factory. Then set the
  188.81 +data-source and session-factory values to your custom values.
  188.82 +
  188.83 +The data-source value specifies the data source target that is set to the
  188.84 +persistence class. The default value is the Liferay data source. This is used in
  188.85 +conjunction with session-factory. See data-source-spring.xml.
  188.86 +
  188.87 +The session-factory value specifies the session factory that is set to the
  188.88 +persistence class. The default value is the Liferay session factory. This is
  188.89 +used in conjunction with data-source. See data-source-spring.xml.
  188.90 +
  188.91 +The tx-manager value specifies the transaction manager that Spring uses. The
  188.92 +default value is the Spring Hibernate transaction manager that wraps the Liferay
  188.93 +data source and session factory. See data-source-spring.xml. Set this attribute
  188.94 +to "none" to disable transaction management.
  188.95 +
  188.96 +The cache-enabled value specifies whether or not to cache this queries for this
  188.97 +entity. Set this to false if data in the table will be updated by other
  188.98 +programs. The default value is true.
  188.99 +-->
 188.100 +<!ATTLIST entity
 188.101 +	name CDATA #REQUIRED
 188.102 +	table CDATA #IMPLIED
 188.103 +	uuid CDATA #IMPLIED
 188.104 +	local-service CDATA #IMPLIED
 188.105 +	remote-service CDATA #IMPLIED
 188.106 +	persistence-class CDATA #IMPLIED
 188.107 +	data-source CDATA #IMPLIED
 188.108 +	session-factory CDATA #IMPLIED
 188.109 +	tx-manager CDATA #IMPLIED
 188.110 +	cache-enabled CDATA #IMPLIED
 188.111 +>
 188.112 +
 188.113 +<!--
 188.114 +The column element represents a column in the database.
 188.115 +-->
 188.116 +<!ELEMENT column (#PCDATA)>
 188.117 +
 188.118 +<!--
 188.119 +The name value specifies the getter and setter name in the entity.
 188.120 +
 188.121 +The type value specifies whether the column is a String, Boolean, or int, etc.
 188.122 +
 188.123 +For example:
 188.124 +
 188.125 +<column name="companyId" db-name="companyId" type="String" />
 188.126 +
 188.127 +The above column specifies that there will be a getter called
 188.128 +pojo.getCompanyId() that will return a String.
 188.129 +
 188.130 +Set db-name to map the field to a physical database column that is different
 188.131 +from the column name.
 188.132 +
 188.133 +If the primary value is set to true, then this column is part of the primary key
 188.134 +of the entity. If multiple columns have the primary value set to true, then a
 188.135 +compound key will be created.
 188.136 +
 188.137 +See com.liferay.portal.service.persistence.LayoutPK for an example of a compound
 188.138 +primary key.
 188.139 +
 188.140 +If the entity and mapping-key attributes are specified and mapping-table is not,
 188.141 +then the Service Builder will assume you are specifying a one to many
 188.142 +relationship.
 188.143 +
 188.144 +For example:
 188.145 +
 188.146 +<column
 188.147 +	name="shoppingItemPrices"
 188.148 +	type="Collection"
 188.149 +	entity="ShoppingItemPrice"
 188.150 +	mapping-key="itemId"
 188.151 +/>
 188.152 +
 188.153 +The above column specifies that there will be a getter called
 188.154 +pojo.getShoppingItemPrices() that will return a collection. It will map to a
 188.155 +column called itemId in the table that maps to the entity ShoppingItemPrice.
 188.156 +
 188.157 +If the entity and mapping-table attributes are specified and mapping-key is not,
 188.158 +then the Service Builder will assume you are specifying a many to many
 188.159 +relationship.
 188.160 +
 188.161 +For example:
 188.162 +
 188.163 +<column
 188.164 +	name="roles"
 188.165 +	type="Collection"
 188.166 +	entity="Role"
 188.167 +	mapping-table="Groups_Roles"
 188.168 +/>
 188.169 +
 188.170 +The above column specifies that there will be a getter called
 188.171 +pojo.getRoles() that will return a collection. It will use a mapping table
 188.172 +called Groups_Roles to give a many to many relationship between groups and
 188.173 +roles.
 188.174 +
 188.175 +The id-type and id-param values are used in order to create an auto-generated, 
 188.176 +auto-incrementing primary key when inserting records into a table. This can be 
 188.177 +implemented in 4 different ways, depending on the type of database being used. 
 188.178 +In all cases, the primary key of the model object should be assigned a value of 
 188.179 +null, and hibernate will know to replace the null value with an auto-generated, 
 188.180 +auto-incremented value. If no id-type value is used, it is assumed that the 
 188.181 +primary key will be assigned and not auto-generated.
 188.182 +
 188.183 +The first implementation uses a class to generate a primary key. 
 188.184 +
 188.185 +For example:
 188.186 +
 188.187 +<column 
 188.188 +	name="id" 
 188.189 +	type="Integer" 
 188.190 +	primary="true" 
 188.191 +	id-type="class" 
 188.192 +	id-param="com.liferay.counter.service.persistence.IDGenerator" 
 188.193 +/>
 188.194 +
 188.195 +In this implementation, the class specified in the id-param value will be called
 188.196 +to retrieve a unique identifier (in the example above, an Integer) that will be 
 188.197 +used as the primary key for the new record. This implementation works for all 
 188.198 +supported databases.
 188.199 +
 188.200 +The second implementation generates identifiers that are unique only when no 
 188.201 +other process is inserting data into the same table. This implementation should
 188.202 +NOT be used in a clustered environment, but it does work for all supported 
 188.203 +databases.
 188.204 +
 188.205 +For example:
 188.206 +
 188.207 +<column 
 188.208 +	name="id" 
 188.209 +	type="Integer" 
 188.210 +	primary="true" 
 188.211 +	id-type="increment" 
 188.212 +/>
 188.213 +
 188.214 +The third implementation uses an identity column to generate a primary key.
 188.215 +
 188.216 +For example:
 188.217 +
 188.218 +<column 
 188.219 +	name="id" 
 188.220 +	type="Integer" 
 188.221 +	primary="true" 
 188.222 +	id-type="identity" 
 188.223 +/>
 188.224 +
 188.225 +In this implementation, the create table SQL generated for this entity will 
 188.226 +create an identity column that natively auto-generates a primary key whenever
 188.227 +an insert occurs. This implementation is only supported by DB2, MySQL, and
 188.228 +MS SQL Server.
 188.229 +
 188.230 +The fourth implementation uses a sequence to generate a primary key.
 188.231 +
 188.232 +For example:
 188.233 +
 188.234 +<column 
 188.235 +	name="id" 
 188.236 +	type="Integer" 
 188.237 +	primary="true" 
 188.238 +	id-type="sequence" 
 188.239 +	id-param="id_sequence" 
 188.240 +/>
 188.241 +
 188.242 +In this implementation, a create sequence SQL statement is created based on
 188.243 +the id-param value (stored in /sql/sequences.sql). This sequence is then 
 188.244 +accessed to generate a unique identifier whenever an insert occurs. This
 188.245 +implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.
 188.246 +
 188.247 +The convert-null value specifies whether or not the column value is
 188.248 +automatically converted to a non null value if it is null. This only applies if
 188.249 +the type value is String. This is particularly useful if your entity is
 188.250 +referencing a read only table or a database view so that Hibernate does not try
 188.251 +to issue unnecessary updates. The default value is true.
 188.252 +-->
 188.253 +<!ATTLIST column
 188.254 +	name CDATA #REQUIRED
 188.255 +	db-name CDATA #IMPLIED
 188.256 +	type CDATA #REQUIRED
 188.257 +	primary CDATA #IMPLIED
 188.258 +	entity CDATA #IMPLIED
 188.259 +	mapping-key CDATA #IMPLIED
 188.260 +	mapping-table CDATA #IMPLIED
 188.261 +	id-type CDATA #IMPLIED
 188.262 +	id-param CDATA #IMPLIED
 188.263 +	convert-null CDATA #IMPLIED
 188.264 +>
 188.265 +
 188.266 +<!--
 188.267 +The order element specifies a default ordering and sorting of the entities when
 188.268 +they are retrieved from the database.
 188.269 +-->
 188.270 +<!ELEMENT order (order-column+)>
 188.271 +
 188.272 +<!--
 188.273 +Set the by attribute to "asc" or "desc" to order by ascending or descending.
 188.274 +-->
 188.275 +<!ATTLIST order
 188.276 +	by CDATA #IMPLIED
 188.277 +>
 188.278 +
 188.279 +<!--
 188.280 +The order-column element allows you to order the entities by specific columns.
 188.281 +-->
 188.282 +<!ELEMENT order-column (#PCDATA)>
 188.283 +
 188.284 +<!--
 188.285 +The attributes of the order-column element allows you to fine tune the ordering
 188.286 +of the entity.
 188.287 +
 188.288 +For example:
 188.289 +
 188.290 +<order by="asc">
 188.291 +	<order-column name="parentLayoutId" />
 188.292 +	<order-column name="priority" />
 188.293 +</order>
 188.294 +
 188.295 +The above settings will order by parentLayoutId and then by priority in an
 188.296 +ascending manner.
 188.297 +
 188.298 +For example:
 188.299 +
 188.300 +<order by="asc">
 188.301 +	<order-column name="name" case-sensitive="false" />
 188.302 +</order>
 188.303 +
 188.304 +The above settings will order by name and will not be case sensitive.
 188.305 +
 188.306 +For example:
 188.307 +
 188.308 +<order>
 188.309 +	<order-column name="articleId" order-by="asc" />
 188.310 +	<order-column name="version" order-by="desc" />
 188.311 +</order>
 188.312 +
 188.313 +The above settings will order by articleId in an ascending manner and then by
 188.314 +version in a descending manner.
 188.315 +-->
 188.316 +<!ATTLIST order-column
 188.317 +	name CDATA #REQUIRED
 188.318 +	case-sensitive CDATA #IMPLIED
 188.319 +	order-by CDATA #IMPLIED
 188.320 +>
 188.321 +
 188.322 +<!--
 188.323 +The finder element represents a generated finder method.
 188.324 +-->
 188.325 +<!ELEMENT finder (finder-column+)>
 188.326 +
 188.327 +<!--
 188.328 +-->
 188.329 +<!ATTLIST finder
 188.330 +	name CDATA #REQUIRED
 188.331 +	return-type CDATA #REQUIRED
 188.332 +	where CDATA #IMPLIED
 188.333 +	db-index CDATA #IMPLIED
 188.334 +>
 188.335 +
 188.336 +<!--
 188.337 +The finder-column element specifies the columns to find by.
 188.338 +-->
 188.339 +<!ELEMENT finder-column (#PCDATA)>
 188.340 +
 188.341 +<!--
 188.342 +The name value specifies the name of the finder method.
 188.343 +
 188.344 +For example:
 188.345 +
 188.346 +<finder name="CompanyId" return-type="Collection">
 188.347 +	<finder-column name="companyId" />
 188.348 +</finder>
 188.349 +
 188.350 +The above settings will create a finder with the name findByCompanyId that will
 188.351 +return a Collection and require a given companyId. It will also generate
 188.352 +several more findByCompanyId methods that take in pagination fields (int begin,
 188.353 +int end) and more sorting options. The easiest way to understand this is to
 188.354 +look at a generated PersistenceImpl class. The Service Builder will also
 188.355 +generate removeByCompanyId and countByCompanyId.
 188.356 +
 188.357 +See com.liferay.portal.service.persistence.LayoutPersistenceImpl for a good
 188.358 +example.
 188.359 +
 188.360 +The attribute comparator takes in the values =, !=, <, <=, >, >=, or LIKE and is
 188.361 +used to compare this column.
 188.362 +
 188.363 +The attribute case-sensitive is a boolean value and is only used if the column
 188.364 +is a String value.
 188.365 +-->
 188.366 +<!ATTLIST finder-column
 188.367 +	name CDATA #REQUIRED
 188.368 +	case-sensitive CDATA #IMPLIED
 188.369 +	comparator CDATA #IMPLIED
 188.370 +>
 188.371 +
 188.372 +<!--
 188.373 +The reference element allows you to inject services from another service.xml
 188.374 +within the same class loader. For example, if you inject the Resource entity,
 188.375 +then you'll be able to reference the Resource services from your service
 188.376 +implementation via the methods getResourceLocalService and getResourceService.
 188.377 +You'll also be able to reference the Resource services via the variables
 188.378 +resourceLocalService and resourceService.
 188.379 +-->
 188.380 +<!ELEMENT reference (#PCDATA)>
 188.381 +
 188.382 +<!--
 188.383 +See the comments in reference element.
 188.384 +-->
 188.385 +<!ATTLIST reference
 188.386 +	package-path CDATA #IMPLIED
 188.387 +	entity CDATA #IMPLIED
 188.388 +>
 188.389 +
 188.390 +<!--
 188.391 +The tx-required element has a text value that will be used to match method names
 188.392 +that require transactions. By default, the methods: add*, check*, clear*,
 188.393 +delete*, set*, and update* require propagation of transactions. All other
 188.394 +methods support transactions but are assumed to be read only. If you want
 188.395 +additional methods to fall under transactions, add the method name to this
 188.396 +element.
 188.397 +-->
 188.398 +<!ELEMENT tx-required (#PCDATA)>
 188.399 +
 188.400 +<!--
 188.401 +The exceptions element contain a list of generated exceptions. This doesn't save
 188.402 +a lot of typing, but can still be helpful.
 188.403 +-->
 188.404 +<!ELEMENT exceptions (exception*)>
 188.405 +
 188.406 +<!--
 188.407 +See the comments in exceptions element.
 188.408 +-->
 188.409 +<!ELEMENT exception (#PCDATA)>
 188.410 \ No newline at end of file
   189.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   189.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-service-builder_6_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   189.3 @@ -0,0 +1,434 @@
   189.4 +<!--
   189.5 +This is the DTD for the Service Builder parameters for Liferay Portal.
   189.6 +
   189.7 +<!DOCTYPE service-builder PUBLIC
   189.8 +	"-//Liferay//DTD Service Builder 6.0.0//EN"
   189.9 +	"http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd">
  189.10 +-->
  189.11 +
  189.12 +<!--
  189.13 +The service-builder element is the root of the deployment descriptor for
  189.14 +a Service Builder descriptor that is used to generate services available to
  189.15 +portlets. The Service Builder saves the developer time by generating Spring
  189.16 +utilities, SOAP utilities, and Hibernate persistence classes to ease the
  189.17 +development of services.
  189.18 +-->
  189.19 +<!ELEMENT service-builder (author?, namespace, entity+, exceptions?)>
  189.20 +
  189.21 +<!--
  189.22 +The package-path value specifies the package of the generated code.
  189.23 +-->
  189.24 +<!ATTLIST service-builder
  189.25 +	package-path CDATA #REQUIRED
  189.26 +>
  189.27 +
  189.28 +<!--
  189.29 +The author element is the name of the user associated with the generated code.
  189.30 +-->
  189.31 +<!ELEMENT author (#PCDATA)>
  189.32 +
  189.33 +<!--
  189.34 +The namespace element must be a unique namespace for this component. Table names
  189.35 +will be prepended with this namespace. Generated JSON JavaScript will be scoped
  189.36 +to this namespace as well (i.e., Liferay.Service.Test.* if the namespace is
  189.37 +Test).
  189.38 +-->
  189.39 +<!ELEMENT namespace (#PCDATA)>
  189.40 +
  189.41 +<!--
  189.42 +An entity usually represents a business facade and a table in the database. If
  189.43 +an entity does not have any columns, then it only represents a business facade.
  189.44 +The Service Builder will always generate an empty business facade POJO if it
  189.45 +does not exist. Upon subsequent generations, the Service Builder will check to
  189.46 +see if the business facade already exists. If it exists and has additional
  189.47 +methods, then the Service Builder will also update the SOAP wrappers.
  189.48 +
  189.49 +If an entity does have columns, then the value object, the POJO class that
  189.50 +is mapped to the database, and other persistence utilities are also generated
  189.51 +based on the order and finder elements.
  189.52 +-->
  189.53 +<!ELEMENT entity (column*, order?, finder*, reference*, tx-required*)>
  189.54 +
  189.55 +<!--
  189.56 +The name value specifies the name of the entity.
  189.57 +
  189.58 +The table value specifies the name of the table that this entity maps to in the
  189.59 +database. If this value is not set, then the name of the table is the same as
  189.60 +the name of the entity.
  189.61 +
  189.62 +If the uuid value is true, then the service will generate a UUID column for the
  189.63 +service. This column will automatically be populated with a UUID. Developers
  189.64 +will also be able to find and remove based on that UUID. The default value is
  189.65 +false.
  189.66 +
  189.67 +If the local-service value is true, then the service will generate the local
  189.68 +interfaces for the service. The default value is false.
  189.69 +
  189.70 +If the remote-service value is true, then the service will generate remote
  189.71 +interfaces for the service. The default value is true.
  189.72 +
  189.73 +The persistence-class value specifies the name of your custom persistence class.
  189.74 +This class must implmeent the generated persistence interface or extend the
  189.75 +generated persistence class. This allows you to override default behavior
  189.76 +without modifying the generated persistence class.
  189.77 +
  189.78 +You can generate classes to use a custom data source and session factory.
  189.79 +Point "spring.configs" in portal.properties to load your custom Spring XML with
  189.80 +the defintions of your custom data source and session factory. Then set the
  189.81 +data-source and session-factory values to your custom values.
  189.82 +
  189.83 +The data-source value specifies the data source target that is set to the
  189.84 +persistence class. The default value is the Liferay data source. This is used in
  189.85 +conjunction with session-factory. See data-source-spring.xml.
  189.86 +
  189.87 +The session-factory value specifies the session factory that is set to the
  189.88 +persistence class. The default value is the Liferay session factory. This is
  189.89 +used in conjunction with data-source. See data-source-spring.xml.
  189.90 +
  189.91 +The tx-manager value specifies the transaction manager that Spring uses. The
  189.92 +default value is the Spring Hibernate transaction manager that wraps the Liferay
  189.93 +data source and session factory. See data-source-spring.xml. Set this attribute
  189.94 +to "none" to disable transaction management.
  189.95 +
  189.96 +The cache-enabled value specifies whether or not to cache this queries for this
  189.97 +entity. Set this to false if data in the table will be updated by other
  189.98 +programs. The default value is true.
  189.99 +-->
 189.100 +<!ATTLIST entity
 189.101 +	name CDATA #REQUIRED
 189.102 +	table CDATA #IMPLIED
 189.103 +	uuid CDATA #IMPLIED
 189.104 +	local-service CDATA #IMPLIED
 189.105 +	remote-service CDATA #IMPLIED
 189.106 +	persistence-class CDATA #IMPLIED
 189.107 +	data-source CDATA #IMPLIED
 189.108 +	session-factory CDATA #IMPLIED
 189.109 +	tx-manager CDATA #IMPLIED
 189.110 +	cache-enabled CDATA #IMPLIED
 189.111 +>
 189.112 +
 189.113 +<!--
 189.114 +The column element represents a column in the database.
 189.115 +-->
 189.116 +<!ELEMENT column (#PCDATA)>
 189.117 +
 189.118 +<!--
 189.119 +The name value specifies the getter and setter name in the entity.
 189.120 +
 189.121 +The type value specifies whether the column is a String, Boolean, or int, etc.
 189.122 +
 189.123 +For example:
 189.124 +
 189.125 +<column name="companyId" db-name="companyId" type="String" />
 189.126 +
 189.127 +The above column specifies that there will be a getter called
 189.128 +pojo.getCompanyId() that will return a String.
 189.129 +
 189.130 +Set db-name to map the field to a physical database column that is different
 189.131 +from the column name.
 189.132 +
 189.133 +If the primary value is set to true, then this column is part of the primary key
 189.134 +of the entity. If multiple columns have the primary value set to true, then a
 189.135 +compound key will be created.
 189.136 +
 189.137 +See com.liferay.portal.service.persistence.LayoutPK for an example of a compound
 189.138 +primary key.
 189.139 +
 189.140 +If the entity and mapping-key attributes are specified and mapping-table is not,
 189.141 +then the Service Builder will assume you are specifying a one to many
 189.142 +relationship.
 189.143 +
 189.144 +For example:
 189.145 +
 189.146 +<column
 189.147 +	name="shoppingItemPrices"
 189.148 +	type="Collection"
 189.149 +	entity="ShoppingItemPrice"
 189.150 +	mapping-key="itemId"
 189.151 +/>
 189.152 +
 189.153 +The above column specifies that there will be a getter called
 189.154 +pojo.getShoppingItemPrices() that will return a collection. It will map to a
 189.155 +column called itemId in the table that maps to the entity ShoppingItemPrice.
 189.156 +
 189.157 +If the entity and mapping-table attributes are specified and mapping-key is not,
 189.158 +then the Service Builder will assume you are specifying a many to many
 189.159 +relationship.
 189.160 +
 189.161 +For example:
 189.162 +
 189.163 +<column
 189.164 +	name="roles"
 189.165 +	type="Collection"
 189.166 +	entity="Role"
 189.167 +	mapping-table="Groups_Roles"
 189.168 +/>
 189.169 +
 189.170 +The above column specifies that there will be a getter called
 189.171 +pojo.getRoles() that will return a collection. It will use a mapping table
 189.172 +called Groups_Roles to give a many to many relationship between groups and
 189.173 +roles.
 189.174 +
 189.175 +If you are creating a mapping table for an entity defined in another
 189.176 +service.xml, you need to specify the full package path.
 189.177 +
 189.178 +For example:
 189.179 +
 189.180 +<column
 189.181 +	name="organizations"
 189.182 +	type="Collection"
 189.183 +	entity="com.liferay.portal.Organization"
 189.184 +	mapping-table="Foo_Organizations"
 189.185 +/>
 189.186 +
 189.187 +The id-type and id-param values are used in order to create an auto-generated, 
 189.188 +auto-incrementing primary key when inserting records into a table. This can be 
 189.189 +implemented in 4 different ways, depending on the type of database being used. 
 189.190 +In all cases, the primary key of the model object should be assigned a value of 
 189.191 +null, and hibernate will know to replace the null value with an auto-generated, 
 189.192 +auto-incremented value. If no id-type value is used, it is assumed that the 
 189.193 +primary key will be assigned and not auto-generated.
 189.194 +
 189.195 +The first implementation uses a class to generate a primary key. 
 189.196 +
 189.197 +For example:
 189.198 +
 189.199 +<column 
 189.200 +	name="id" 
 189.201 +	type="Integer" 
 189.202 +	primary="true" 
 189.203 +	id-type="class" 
 189.204 +	id-param="com.liferay.counter.service.persistence.IDGenerator" 
 189.205 +/>
 189.206 +
 189.207 +In this implementation, the class specified in the id-param value will be called
 189.208 +to retrieve a unique identifier (in the example above, an Integer) that will be 
 189.209 +used as the primary key for the new record. This implementation works for all 
 189.210 +supported databases.
 189.211 +
 189.212 +The second implementation generates identifiers that are unique only when no 
 189.213 +other process is inserting data into the same table. This implementation should
 189.214 +NOT be used in a clustered environment, but it does work for all supported 
 189.215 +databases.
 189.216 +
 189.217 +For example:
 189.218 +
 189.219 +<column 
 189.220 +	name="id" 
 189.221 +	type="Integer" 
 189.222 +	primary="true" 
 189.223 +	id-type="increment" 
 189.224 +/>
 189.225 +
 189.226 +The third implementation uses an identity column to generate a primary key.
 189.227 +
 189.228 +For example:
 189.229 +
 189.230 +<column 
 189.231 +	name="id" 
 189.232 +	type="Integer" 
 189.233 +	primary="true" 
 189.234 +	id-type="identity" 
 189.235 +/>
 189.236 +
 189.237 +In this implementation, the create table SQL generated for this entity will 
 189.238 +create an identity column that natively auto-generates a primary key whenever
 189.239 +an insert occurs. This implementation is only supported by DB2, MySQL, and
 189.240 +MS SQL Server.
 189.241 +
 189.242 +The fourth implementation uses a sequence to generate a primary key.
 189.243 +
 189.244 +For example:
 189.245 +
 189.246 +<column 
 189.247 +	name="id" 
 189.248 +	type="Integer" 
 189.249 +	primary="true" 
 189.250 +	id-type="sequence" 
 189.251 +	id-param="id_sequence" 
 189.252 +/>
 189.253 +
 189.254 +In this implementation, a create sequence SQL statement is created based on
 189.255 +the id-param value (stored in /sql/sequences.sql). This sequence is then 
 189.256 +accessed to generate a unique identifier whenever an insert occurs. This
 189.257 +implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.
 189.258 +
 189.259 +The convert-null value specifies whether or not the column value is
 189.260 +automatically converted to a non null value if it is null. This only applies if
 189.261 +the type value is String. This is particularly useful if your entity is
 189.262 +referencing a read only table or a database view so that Hibernate does not try
 189.263 +to issue unnecessary updates. The default value is true.
 189.264 +
 189.265 +The localized value specifies whether or not the column of the value can have
 189.266 +different values for different locales. The default value is false.
 189.267 +-->
 189.268 +<!ATTLIST column
 189.269 +	name CDATA #REQUIRED
 189.270 +	db-name CDATA #IMPLIED
 189.271 +	type CDATA #REQUIRED
 189.272 +	primary CDATA #IMPLIED
 189.273 +	entity CDATA #IMPLIED
 189.274 +	mapping-key CDATA #IMPLIED
 189.275 +	mapping-table CDATA #IMPLIED
 189.276 +	id-type CDATA #IMPLIED
 189.277 +	id-param CDATA #IMPLIED
 189.278 +	convert-null CDATA #IMPLIED
 189.279 +	localized CDATA #IMPLIED
 189.280 +>
 189.281 +
 189.282 +<!--
 189.283 +The order element specifies a default ordering and sorting of the entities when
 189.284 +they are retrieved from the database.
 189.285 +-->
 189.286 +<!ELEMENT order (order-column+)>
 189.287 +
 189.288 +<!--
 189.289 +Set the by attribute to "asc" or "desc" to order by ascending or descending.
 189.290 +-->
 189.291 +<!ATTLIST order
 189.292 +	by CDATA #IMPLIED
 189.293 +>
 189.294 +
 189.295 +<!--
 189.296 +The order-column element allows you to order the entities by specific columns.
 189.297 +-->
 189.298 +<!ELEMENT order-column (#PCDATA)>
 189.299 +
 189.300 +<!--
 189.301 +The attributes of the order-column element allows you to fine tune the ordering
 189.302 +of the entity.
 189.303 +
 189.304 +For example:
 189.305 +
 189.306 +<order by="asc">
 189.307 +	<order-column name="parentLayoutId" />
 189.308 +	<order-column name="priority" />
 189.309 +</order>
 189.310 +
 189.311 +The above settings will order by parentLayoutId and then by priority in an
 189.312 +ascending manner.
 189.313 +
 189.314 +For example:
 189.315 +
 189.316 +<order by="asc">
 189.317 +	<order-column name="name" case-sensitive="false" />
 189.318 +</order>
 189.319 +
 189.320 +The above settings will order by name and will not be case sensitive.
 189.321 +
 189.322 +For example:
 189.323 +
 189.324 +<order>
 189.325 +	<order-column name="articleId" order-by="asc" />
 189.326 +	<order-column name="version" order-by="desc" />
 189.327 +</order>
 189.328 +
 189.329 +The above settings will order by articleId in an ascending manner and then by
 189.330 +version in a descending manner.
 189.331 +-->
 189.332 +<!ATTLIST order-column
 189.333 +	name CDATA #REQUIRED
 189.334 +	case-sensitive CDATA #IMPLIED
 189.335 +	order-by CDATA #IMPLIED
 189.336 +>
 189.337 +
 189.338 +<!--
 189.339 +The finder element represents a generated finder method.
 189.340 +-->
 189.341 +<!ELEMENT finder (finder-column+)>
 189.342 +
 189.343 +<!--
 189.344 +The name value specifies the name of the finder method.
 189.345 +
 189.346 +The return-type value specifies the return type of the finder. Valid values are
 189.347 +"Collection" or the name of the entity. If the value is "Collection", then this
 189.348 +finder returns a list of entities. If the value is the name of the entity, then
 189.349 +this finder returns at most one entity.
 189.350 +
 189.351 +If the unique value is true, then the finder must return a unique entity.
 189.352 +
 189.353 +If the db-index value is true, then the service will automatically generate a
 189.354 +SQL index for this finder. The default value is true.
 189.355 +-->
 189.356 +<!ATTLIST finder
 189.357 +	name CDATA #REQUIRED
 189.358 +	return-type CDATA #REQUIRED
 189.359 +	unique CDATA #IMPLIED
 189.360 +	where CDATA #IMPLIED
 189.361 +	db-index CDATA #IMPLIED
 189.362 +>
 189.363 +
 189.364 +<!--
 189.365 +The finder-column element specifies the columns to find by.
 189.366 +-->
 189.367 +<!ELEMENT finder-column (#PCDATA)>
 189.368 +
 189.369 +<!--
 189.370 +The name value specifies the name of the finder method.
 189.371 +
 189.372 +For example:
 189.373 +
 189.374 +<finder name="CompanyId" return-type="Collection">
 189.375 +	<finder-column name="companyId" />
 189.376 +</finder>
 189.377 +
 189.378 +The above settings will create a finder with the name findByCompanyId that will
 189.379 +return a Collection and require a given companyId. It will also generate
 189.380 +several more findByCompanyId methods that take in pagination fields (int begin,
 189.381 +int end) and more sorting options. The easiest way to understand this is to
 189.382 +look at a generated PersistenceImpl class. The Service Builder will also
 189.383 +generate removeByCompanyId and countByCompanyId.
 189.384 +
 189.385 +See com.liferay.portal.service.persistence.LayoutPersistenceImpl for a good
 189.386 +example.
 189.387 +
 189.388 +The attribute comparator takes in the values =, !=, <, <=, >, >=, or LIKE and is
 189.389 +used to compare this column.
 189.390 +
 189.391 +The attribute case-sensitive is a boolean value and is only used if the column
 189.392 +is a String value.
 189.393 +-->
 189.394 +<!ATTLIST finder-column
 189.395 +	name CDATA #REQUIRED
 189.396 +	case-sensitive CDATA #IMPLIED
 189.397 +	comparator CDATA #IMPLIED
 189.398 +>
 189.399 +
 189.400 +<!--
 189.401 +The reference element allows you to inject services from another service.xml
 189.402 +within the same class loader. For example, if you inject the Resource entity,
 189.403 +then you'll be able to reference the Resource services from your service
 189.404 +implementation via the methods getResourceLocalService and getResourceService.
 189.405 +You'll also be able to reference the Resource services via the variables
 189.406 +resourceLocalService and resourceService.
 189.407 +-->
 189.408 +<!ELEMENT reference (#PCDATA)>
 189.409 +
 189.410 +<!--
 189.411 +See the comments in reference element.
 189.412 +-->
 189.413 +<!ATTLIST reference
 189.414 +	package-path CDATA #IMPLIED
 189.415 +	entity CDATA #IMPLIED
 189.416 +>
 189.417 +
 189.418 +<!--
 189.419 +The tx-required element has a text value that will be used to match method names
 189.420 +that require transactions. By default, the methods: add*, check*, clear*,
 189.421 +delete*, set*, and update* require propagation of transactions. All other
 189.422 +methods support transactions but are assumed to be read only. If you want
 189.423 +additional methods to fall under transactions, add the method name to this
 189.424 +element.
 189.425 +-->
 189.426 +<!ELEMENT tx-required (#PCDATA)>
 189.427 +
 189.428 +<!--
 189.429 +The exceptions element contain a list of generated exceptions. This doesn't save
 189.430 +a lot of typing, but can still be helpful.
 189.431 +-->
 189.432 +<!ELEMENT exceptions (exception*)>
 189.433 +
 189.434 +<!--
 189.435 +See the comments in exceptions element.
 189.436 +-->
 189.437 +<!ELEMENT exception (#PCDATA)>
 189.438 \ No newline at end of file
   190.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   190.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/dtd/liferay-theme-loader_6_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   190.3 @@ -0,0 +1,30 @@
   190.4 +<!--
   190.5 +This is the DTD for the Theme Loader parameters for Liferay Portal.
   190.6 +
   190.7 +<!DOCTYPE theme-loader PUBLIC
   190.8 +	"-//Liferay//DTD Theme Loader 6.0.0//EN"
   190.9 +	"http://www.liferay.com/dtd/liferay-theme-loader_6_0_0.dtd">
  190.10 +-->
  190.11 +
  190.12 +<!--
  190.13 +The theme-loader element is the root of the deployment descriptor for a Liferay
  190.14 +theme loader. A theme loader is required to allow the LAR export and import
  190.15 +mechanism to hot deploy themes at runtime even if the underlying application
  190.16 +server does not support hot deploy.
  190.17 +-->
  190.18 +<!ELEMENT theme-loader (themes-path?, file-storage?)>
  190.19 +
  190.20 +<!--
  190.21 +The themes-path element tells the theme loader where to store the themes inside
  190.22 +the exploded WAR. This is also the path used to prefix the root-path of all
  190.23 +themes loaded by this theme loader. The default is "/themes".
  190.24 +-->
  190.25 +<!ELEMENT themes-path (#PCDATA)>
  190.26 +
  190.27 +<!--
  190.28 +The file-storage element tells the theme loader where to store the files. If
  190.29 +this element is not set, then it will store the files inside the exploded WAR's
  190.30 +"themes" directory or inside the directory set by the element themes-path. If
  190.31 +this element is set, it expects a full path to an external directory.
  190.32 +-->
  190.33 +<!ELEMENT file-storage (#PCDATA)>
  190.34 \ No newline at end of file
   191.1 Binary file portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/hook.png has changed
   192.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/layer.xml	Fri Jun 10 09:46:37 2011 +0200
   192.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/layer.xml	Sun Jun 26 10:25:14 2011 +0800
   192.3 @@ -55,6 +55,7 @@
   192.4                          <file name="WEB-INF\liferay-display.xml"/>
   192.5                          <file name="WEB-INF\liferay-plugin-package.xml"/>
   192.6                          <file name="WEB-INF\liferay-plugin-package.properties"/>
   192.7 +                        <file name="WEB-INF\liferay-hook.xml"/>
   192.8                      </folder>
   192.9                  </folder> 
  192.10              </folder>
  192.11 @@ -92,6 +93,7 @@
  192.12                          <file name="WEB-INF\liferay-display.xml"/>
  192.13                          <file name="WEB-INF\liferay-plugin-package.xml"/>
  192.14                          <file name="WEB-INF\liferay-plugin-package.properties"/>
  192.15 +                        <file name="WEB-INF\liferay-hook.xml"/>
  192.16                      </folder>
  192.17                  </folder>
  192.18              </folder>
  192.19 @@ -113,15 +115,33 @@
  192.20        
  192.21       <folder name="liferay"> 
  192.22          <folder name="templates">
  192.23 -            <file name="liferay-display-400.template" url="nbresloc:/templates/liferay-display-400.template">
  192.24 +            <file name="liferay-display.xml" url="nbresloc:templates/liferay-display.template">
  192.25                  <attr name="position" intvalue="0"/>
  192.26 +                <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  192.27              </file>
  192.28 -            <file name="liferay-plugin-package-430.template" url="nbresloc:/templates/liferay-plugin-package-430.template">
  192.29 +            <file name="liferay-plugin-package.xml" url="nbresloc:templates/liferay-plugin-package.template">
  192.30                  <attr name="position" intvalue="0"/>
  192.31 +                <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  192.32              </file>    
  192.33 -            <file name="liferay-portlet-440.template" url="nbresloc:/templates/liferay-portlet-440.template">
  192.34 +            <file name="liferay-portlet.xml" url="nbresloc:templates/liferay-portlet.template">
  192.35                  <attr name="position" intvalue="0"/>
  192.36 +                <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  192.37 +            </file>
  192.38 +			<file name="portal-developer.properties" url="nbresloc:templates/portal-developer.properties">
  192.39 +                <attr name="position" intvalue="50"/>
  192.40              </file>
  192.41          </folder>
  192.42 -    </folder> 
  192.43 +    </folder>
  192.44 +
  192.45 +     <folder name="Plugins">
  192.46 +        <!-- Register XML module catalog plugin -->
  192.47 +        <folder name="XML">
  192.48 +            <folder name="UserCatalogs">
  192.49 +                <file name="org-netbeans-modules-portalpack-servers-websynergy-catalog-LiferayDTDCatalog.instance">
  192.50 +                    <attr name="instanceCreate" newvalue="org.netbeans.modules.portalpack.servers.websynergy.catalog.LiferayDTDCatalog"/>
  192.51 +                    <attr name="instanceOf" stringvalue="org.netbeans.modules.xml.catalog.spi.CatalogReader"/>
  192.52 +                </file>
  192.53 +            </folder>
  192.54 +        </folder>
  192.55 +    </folder>
  192.56  </filesystem>
   193.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/liferay-display_4_0_0.dtd	Fri Jun 10 09:46:37 2011 +0200
   193.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   193.3 @@ -1,45 +0,0 @@
   193.4 -<!--
   193.5 -This is the DTD for the Display parameters for Liferay Portal.
   193.6 -
   193.7 -<!DOCTYPE display PUBLIC
   193.8 -	"-//Liferay//DTD Display 4.0.0//EN"
   193.9 -	"http://www.liferay.com/dtd/liferay-display_4_0_0.dtd">
  193.10 --->
  193.11 -
  193.12 -<!--
  193.13 -The display element is the root of the deployment descriptor that describes how
  193.14 -portlets are categorized and displayed for users to choose when personalizing a
  193.15 -page in Liferay Portal.
  193.16 --->
  193.17 -<!ELEMENT display (category*)>
  193.18 -
  193.19 -<!--
  193.20 -The category element organizes a set of portlets. A portlet can exist in more
  193.21 -than one category.
  193.22 --->
  193.23 -<!ELEMENT category (category*, portlet*)>
  193.24 -
  193.25 -<!--
  193.26 -The name of a category is mapped to the portal's Language properties. If the
  193.27 -category name is "test", then the key in the portal's resource bundle will be
  193.28 -"category.test".
  193.29 -
  193.30 -See:
  193.31 -
  193.32 -http://www.liferay.com/page/guest/documentation/development/languages
  193.33 --->
  193.34 -<!ATTLIST category
  193.35 -	name CDATA #REQUIRED
  193.36 ->
  193.37 -
  193.38 -<!--
  193.39 -The portlet element represents a portlet.
  193.40 --->
  193.41 -<!ELEMENT portlet (#PCDATA)>
  193.42 -
  193.43 -<!--
  193.44 -The id must match the unique portlet-name specified in portlet.xml.
  193.45 --->
  193.46 -<!ATTLIST portlet
  193.47 -	id CDATA #REQUIRED
  193.48 ->
  193.49 \ No newline at end of file
   194.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/liferay-display_5_0_0.dtd	Fri Jun 10 09:46:37 2011 +0200
   194.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   194.3 @@ -1,45 +0,0 @@
   194.4 -<!--
   194.5 -This is the DTD for the Display parameters for Liferay Portal.
   194.6 -
   194.7 -<!DOCTYPE display PUBLIC
   194.8 -	"-//Liferay//DTD Display 5.0.0//EN"
   194.9 -	"http://www.liferay.com/dtd/liferay-display_5_0_0.dtd">
  194.10 --->
  194.11 -
  194.12 -<!--
  194.13 -The display element is the root of the deployment descriptor that describes how
  194.14 -portlets are categorized and displayed for users to choose when personalizing a
  194.15 -page in Liferay Portal.
  194.16 --->
  194.17 -<!ELEMENT display (category*)>
  194.18 -
  194.19 -<!--
  194.20 -The category element organizes a set of portlets. A portlet can exist in more
  194.21 -than one category.
  194.22 --->
  194.23 -<!ELEMENT category (category*, portlet*)>
  194.24 -
  194.25 -<!--
  194.26 -The name of a category is mapped to the portal's Language properties. If the
  194.27 -category name is "test", then the key in the portal's resource bundle will be
  194.28 -"category.test".
  194.29 -
  194.30 -See:
  194.31 -
  194.32 -http://www.liferay.com/page/guest/documentation/development/languages
  194.33 --->
  194.34 -<!ATTLIST category
  194.35 -	name CDATA #REQUIRED
  194.36 ->
  194.37 -
  194.38 -<!--
  194.39 -The portlet element represents a portlet.
  194.40 --->
  194.41 -<!ELEMENT portlet (#PCDATA)>
  194.42 -
  194.43 -<!--
  194.44 -The id must match the unique portlet-name specified in portlet.xml.
  194.45 --->
  194.46 -<!ATTLIST portlet
  194.47 -	id CDATA #REQUIRED
  194.48 ->
  194.49 \ No newline at end of file
   195.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/liferay-plugin-package_4_3_0.dtd	Fri Jun 10 09:46:37 2011 +0200
   195.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   195.3 @@ -1,188 +0,0 @@
   195.4 -<!--
   195.5 -This is the DTD for the Liferay Plugins XML file that lists the plugins
   195.6 -available in a plugin repository
   195.7 -
   195.8 -<!DOCTYPE plugin-package PUBLIC
   195.9 -	"-//Liferay//DTD Plugin Package 4.3.0//EN"
  195.10 -	"http://www.liferay.com/dtd/liferay-plugin-package_4_3_0.dtd">
  195.11 --->
  195.12 -
  195.13 -<!--
  195.14 -A boolean type is the string representation of a boolean (true or false)
  195.15 -variable.
  195.16 --->
  195.17 -<!ENTITY % boolean "(true|false|yes|no)">
  195.18 -
  195.19 -<!--
  195.20 -The plugin-package element contains the declarative data of a plugin.
  195.21 --->
  195.22 -<!ELEMENT plugin-package (name, module-id, recommended-deployment-context?,
  195.23 -types, tags?, short-description, long-description?, change-log, page-url?,
  195.24 -screenshots?, author, licenses, liferay-versions, deployment-settings?)>
  195.25 -
  195.26 -<!--
  195.27 -The name element contains the name of the plugin package that will be shown to
  195.28 -users.
  195.29 --->
  195.30 -<!ELEMENT name (#PCDATA)>
  195.31 -
  195.32 -<!--
  195.33 -The module-id element contains the full identifier of the plugin using the
  195.34 -Maven based syntax: groupId/artifactId/version/file-type.
  195.35 -
  195.36 -Example: liferay-samples/sample-struts-portlet/4.3.0/war
  195.37 --->
  195.38 -<!ELEMENT module-id (#PCDATA)>
  195.39 -
  195.40 -<!--
  195.41 -The recommended-deployment-context element determines the context to which this
  195.42 -plugin should be deployed. Some portlet packages require this because their own
  195.43 -code references itself through URLs that include the context.
  195.44 --->
  195.45 -<!ELEMENT recommended-deployment-context (#PCDATA)>
  195.46 -
  195.47 -<!--
  195.48 -The types element contains a list of plugin types included in the package.
  195.49 --->
  195.50 -<!ELEMENT types (type)+>
  195.51 -
  195.52 -<!--
  195.53 -The type element contains the type of the plugin. Valid values are: portlets,
  195.54 -layout-templates, and themes.
  195.55 --->
  195.56 -<!ELEMENT type (#PCDATA)>
  195.57 -
  195.58 -<!--
  195.59 -The tags element contains a list of tags to categorize the plugin.
  195.60 --->
  195.61 -<!ELEMENT tags (tag)*>
  195.62 -
  195.63 -<!--
  195.64 -The tag element contains a tag that categorizes the plugin.
  195.65 --->
  195.66 -<!ELEMENT tag (#PCDATA)>
  195.67 -
  195.68 -<!--
  195.69 -The short-description element contains a short description of the plugin.
  195.70 --->
  195.71 -<!ELEMENT short-description (#PCDATA)>
  195.72 -
  195.73 -<!--
  195.74 -The long-description element contains a detailed description of the plugin. It
  195.75 -is recommended that installation or update instructions are provided if the
  195.76 -portal administrator has to perform extra steps to be able to use the plugin
  195.77 -after it is deployed.
  195.78 -
  195.79 -Note: the text of this element might contain simple HTML formatting if encoded
  195.80 -within a CDATA section.
  195.81 --->
  195.82 -<!ELEMENT long-description (#PCDATA)>
  195.83 -
  195.84 -<!--
  195.85 -The change-log element contains an explanation of the changes made in the latest
  195.86 -release. It is recommended to try to offer all the information that a user
  195.87 -might need to decide whether to update a previous version.
  195.88 -
  195.89 -Note: the text of this element might contain simple HTML formatting if encoded
  195.90 -within a CDATA section.
  195.91 --->
  195.92 -<!ELEMENT change-log (#PCDATA)>
  195.93 -
  195.94 -<!--
  195.95 -The page-url element contains the URL of the home page of the plugin.
  195.96 --->
  195.97 -<!ELEMENT page-url (#PCDATA)>
  195.98 -
  195.99 -<!--
 195.100 -The screenshots element contains a list of screenshots for the plugin.
 195.101 --->
 195.102 -<!ELEMENT screenshots (screenshot)+>
 195.103 -
 195.104 -<!--
 195.105 -The screenshot element contains two URLs for the thumbnail and large images
 195.106 -versions of the screenshot
 195.107 --->
 195.108 -<!ELEMENT screenshot (thumbnail-url, large-image-url)>
 195.109 -
 195.110 -<!--
 195.111 -The thumbnail-url element contains the URL of a thumbnail screenshot of the
 195.112 -plugin. It is recommended that the width of the images is 120 pixels and that
 195.113 -the height is in the same size range.
 195.114 --->
 195.115 -<!ELEMENT thumbnail-url (#PCDATA)>
 195.116 -
 195.117 -<!--
 195.118 -The large-image-url element contains the URL of a large image screenshot of the
 195.119 -plugin.
 195.120 --->
 195.121 -<!ELEMENT large-image-url (#PCDATA)>
 195.122 -
 195.123 -<!--
 195.124 -The author element contains the name of the author of the plugin.
 195.125 --->
 195.126 -<!ELEMENT author (#PCDATA)>
 195.127 -
 195.128 -<!--
 195.129 -The licenses element contains a list of licences under which the plugin is
 195.130 -provided.
 195.131 --->
 195.132 -<!ELEMENT licenses (license)+>
 195.133 -
 195.134 -<!--
 195.135 -The license element contains the name of a licence under which the plugin is
 195.136 -provided.
 195.137 --->
 195.138 -<!ELEMENT license (#PCDATA)>
 195.139 -
 195.140 -<!--
 195.141 -The osi-approved attribute specifies if the license is open source, approved by
 195.142 -the Open Source Initiative (OSI). In that case it's value is true.
 195.143 --->
 195.144 -<!ATTLIST license
 195.145 -	osi-approved %boolean; #REQUIRED
 195.146 ->
 195.147 -
 195.148 -<!--
 195.149 -The url attribute specifies a URL of a page that describes the license.
 195.150 --->
 195.151 -<!ATTLIST license
 195.152 -	url CDATA #IMPLIED
 195.153 ->
 195.154 -
 195.155 -<!--
 195.156 -The liferay-versions element contains a list of Liferay Portal versions that
 195.157 -are supported by the plugin.
 195.158 --->
 195.159 -<!ELEMENT liferay-versions (liferay-version)+>
 195.160 -
 195.161 -<!--
 195.162 -The liferay-version element contains a version of Liferay Portal that is
 195.163 -supported by the plugin.
 195.164 --->
 195.165 -<!ELEMENT liferay-version (#PCDATA)>
 195.166 -
 195.167 -<!--
 195.168 -The deployment-settings element contains a list of parameters that specify how
 195.169 -the package should be deployed.
 195.170 --->
 195.171 -<!ELEMENT deployment-settings (setting)+>
 195.172 -
 195.173 -<!--
 195.174 -The setting element specifies a name value pair that provides information of how
 195.175 -the package should be deployed.
 195.176 --->
 195.177 -<!ELEMENT setting (#PCDATA)>
 195.178 -
 195.179 -<!--
 195.180 -The name attribute specifies the name of the setting.
 195.181 --->
 195.182 -<!ATTLIST setting
 195.183 -	name CDATA #IMPLIED
 195.184 ->
 195.185 -
 195.186 -<!--
 195.187 -The value attribute specifies the value of the setting.
 195.188 --->
 195.189 -<!ATTLIST setting
 195.190 -	value CDATA #IMPLIED
 195.191 ->
 195.192 \ No newline at end of file
   196.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/liferay-portlet-app_4_4_0.dtd	Fri Jun 10 09:46:37 2011 +0200
   196.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   196.3 @@ -1,537 +0,0 @@
   196.4 -<!--
   196.5 -This is the DTD for the Portlet Application parameters that are specific to
   196.6 -Liferay Portal.
   196.7 -
   196.8 -<!DOCTYPE liferay-portlet-app PUBLIC
   196.9 -	"-//Liferay//DTD Portlet Application 4.4.0//EN"
  196.10 -	"http://www.liferay.com/dtd/liferay-portlet-app_4_4_0.dtd">
  196.11 --->
  196.12 -
  196.13 -<!--
  196.14 -The liferay-portlet-app element is the root of the deployment descriptor for
  196.15 -a Liferay portlet application.
  196.16 --->
  196.17 -<!ELEMENT liferay-portlet-app (portlet*, role-mapper*, custom-user-attribute*)>
  196.18 -
  196.19 -<!--
  196.20 -The portlet element contains the declarative data of a portlet.
  196.21 --->
  196.22 -<!ELEMENT portlet (portlet-name, icon?, virtual-path?, struts-path?,
  196.23 -configuration-path?, configuration-action-class?, indexer-class?,
  196.24 -open-search-class?, scheduler-class?, portlet-url-class?,
  196.25 -friendly-url-mapper-class?, url-encoder-class?, portlet-data-handler-class?,
  196.26 -portlet-layout-listener-class?, activity-tracker-interpreter-class?,
  196.27 -smtp-message-listener-class?, preferences-company-wide?,
  196.28 -preferences-unique-per-layout?, preferences-owned-by-group?,
  196.29 -use-default-template?, show-portlet-access-denied?, show-portlet-inactive?,
  196.30 -action-url-redirect?, restore-current-view?, maximize-edit?, maximize-help?,
  196.31 -pop-up-print?, layout-cacheable?, instanceable?, private-request-attributes?,
  196.32 -private-session-attributes?, render-weight?, ajaxable?, header-portal-css*,
  196.33 -header-portlet-css*, header-portal-javascript*, header-portlet-javascript*,
  196.34 -footer-portal-css*, footer-portlet-css*, footer-portal-javascript*,
  196.35 -footer-portlet-javascript*, css-class-wrapper?, add-default-resource?, system?,
  196.36 -active?, include?)>
  196.37 -
  196.38 -<!--
  196.39 -The portlet-name element contains the unique name of the portlet. This name must
  196.40 -match the portlet-name specified in portlet.xml.
  196.41 --->
  196.42 -<!ELEMENT portlet-name (#PCDATA)>
  196.43 -
  196.44 -<!--
  196.45 -The icon element specifies an image that represents the portlet.
  196.46 --->
  196.47 -<!ELEMENT icon (#PCDATA)>
  196.48 -
  196.49 -<!--
  196.50 -The virtual-path value sets the virtual path used to override the default
  196.51 -servlet context path.
  196.52 -
  196.53 -For example, suppose your portlet is deployed to the servlet path
  196.54 -"/test-portlet". By default, the portal will return "/test-portlet" for the
  196.55 -servlet context path. You can override it by setting virtual-path to "/virtual"
  196.56 -and have the portal return "/virtual" for the servlet context path.
  196.57 -
  196.58 -The default value is "" which means this is not used.
  196.59 --->
  196.60 -<!ELEMENT virtual-path (#PCDATA)>
  196.61 -
  196.62 -<!--
  196.63 -Supppose the struts-path value is "mail". This tells the portal that all
  196.64 -requests with the path mail/* are considered part of this portlet's scope. Users
  196.65 -who request paths that match mail/* will only be granted access if they also
  196.66 -have access to this portlet. This is true for both portlet requests and regular
  196.67 -servlet requests.
  196.68 --->
  196.69 -<!ELEMENT struts-path (#PCDATA)>
  196.70 -
  196.71 -<!--
  196.72 -The configuration-path value is no longer available. Use
  196.73 -configuration-action-class instead.
  196.74 --->
  196.75 -<!ELEMENT configuration-path (#PCDATA)>
  196.76 -
  196.77 -<!--
  196.78 -The configuration-action-class value must be a class that implements
  196.79 -com.liferay.portal.kernel.portlet.ConfigurationAction and is called to allow
  196.80 -users to configure the portlet at runtime.
  196.81 -
  196.82 -See:
  196.83 -
  196.84 -http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/messageboards/action/ConfigurationActionImpl.html
  196.85 --->
  196.86 -<!ELEMENT configuration-action-class (#PCDATA)>
  196.87 -
  196.88 -<!--
  196.89 -The indexer-class value must be a class that implements
  196.90 -com.liferay.portal.kernel.search.Indexer and is called to create or update a
  196.91 -search index for the portlet.
  196.92 -
  196.93 -See:
  196.94 -
  196.95 -http://docs.liferay.com/4.4/javadocs/portal-kernel/com/liferay/portal/kernel/search/Indexer.html
  196.96 -http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/messageboards/util/Indexer.html
  196.97 -http://lucene.apache.org
  196.98 --->
  196.99 -<!ELEMENT indexer-class (#PCDATA)>
 196.100 -
 196.101 -<!--
 196.102 -The open-search-class value must be a class that implements
 196.103 -com.liferay.portal.kernel.search.OpenSearch and is called to get search results
 196.104 -in the OpenSearch 1.1 standard.
 196.105 -
 196.106 -See:
 196.107 -
 196.108 -http://docs.liferay.com/4.4/javadocs/portal-kernel/com/liferay/portal/kernel/search/OpenSearch.html
 196.109 -http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/alfrescocontent/util/OpenSearch.html
 196.110 -http://www.opensearch.org
 196.111 --->
 196.112 -<!ELEMENT open-search-class (#PCDATA)>
 196.113 -
 196.114 -<!--
 196.115 -The scheduler-class value must be a class that implements
 196.116 -com.liferay.portal.job.Scheduler and is called to schedule Quartz jobs for this
 196.117 -portlet.
 196.118 -
 196.119 -See:
 196.120 -
 196.121 -http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portal/job/Scheduler.html
 196.122 -http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/calendar/job/Scheduler.html
 196.123 -http://www.opensymphony.com/quartz
 196.124 --->
 196.125 -<!ELEMENT scheduler-class (#PCDATA)>
 196.126 -
 196.127 -<!--
 196.128 -The portlet-url-class value must be a class that extends
 196.129 -com.liferay.portlet.PortletURLImplWrapper. Set this class to override the
 196.130 -default portlet URL implementation.
 196.131 -
 196.132 -See:
 196.133 -
 196.134 -http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portal/struts/StrutsActionPortletURL.html
 196.135 --->
 196.136 -<!ELEMENT portlet-url-class (#PCDATA)>
 196.137 -
 196.138 -<!--
 196.139 -The friendly-url-mapper-class value must be a class that implements
 196.140 -com.liferay.portal.kernel.portlet.FriendlyURLMapper. Use this if content inside
 196.141 -a portlet needs to have a friendly URL. See the Message Boards portlet for an
 196.142 -example of its uses.
 196.143 -
 196.144 -See:
 196.145 -
 196.146 -http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/messageboards/MBFriendlyURLMapper.html
 196.147 --->
 196.148 -<!ELEMENT friendly-url-mapper-class (#PCDATA)>
 196.149 -
 196.150 -<!--
 196.151 -The url-encoder-class value must be a class that implements
 196.152 -com.liferay.portal.kernel.servlet.URLEncoder. Use this to set a custom
 196.153 -URLEncoder that is used by the RenderResponse class to implement the encodeURL
 196.154 -method. This is useful if you need to add custom logic to rewrite URLs.
 196.155 --->
 196.156 -<!ELEMENT url-encoder-class (#PCDATA)>
 196.157 -
 196.158 -<!--
 196.159 -The portlet-data-handler-class value must be a class that implements
 196.160 -com.liferay.portal.kernel.lar.PortletDataHandler and is called when archiving
 196.161 -tasks are run.
 196.162 -
 196.163 -See:
 196.164 -
 196.165 -http://docs.liferay.com/4.4/javadocs/portal-kernel/com/liferay/portal/kernel/lar/PortletDataHandler.html
 196.166 -http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/journal/lar/PortletDataHandlerImpl.html
 196.167 --->
 196.168 -<!ELEMENT portlet-data-handler-class (#PCDATA)>
 196.169 -
 196.170 -<!--
 196.171 -The portlet-layout-listener-class value must be a class that implements
 196.172 -com.liferay.portal.kernel.portlet.PortletLayoutListener and is called when a portlet
 196.173 -is added, moved, or removed from a layout.
 196.174 -
 196.175 -See:
 196.176 -
 196.177 -http://docs.liferay.com/4.4/javadocs/portal-kernel/com/liferay/portal/kernel/portlet/PortletLayoutListener.html
 196.178 -http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/journalcontent/JournalContentPortletLayoutListener.html
 196.179 --->
 196.180 -<!ELEMENT portlet-layout-listener-class (#PCDATA)>
 196.181 -
 196.182 -<!--
 196.183 -The activity-tracker-interpreter-class value must be a class that implements
 196.184 -com.liferay.portal.model.ActivityTrackerInterpreter and is called to interpret
 196.185 -activities into friendly messages that are easily understandable by a human
 196.186 -being.
 196.187 -
 196.188 -See:
 196.189 -
 196.190 -http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portal/model/ActivityTrackerInterpreter.html
 196.191 -http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/messageboards/MBActivityTrackerInterpreter.html
 196.192 --->
 196.193 -<!ELEMENT activity-tracker-interpreter-class (#PCDATA)>
 196.194 -
 196.195 -<!--
 196.196 -The smtp-message-listener-class value must be a class that implements
 196.197 -com.liferay.portal.kernel.smtp.MessageListener and is called when processing
 196.198 -emails.
 196.199 -
 196.200 -See:
 196.201 -
 196.202 -http://docs.liferay.com/4.4/javadocs/portal-kernel/com/liferay/portal/kernel/smtp/MessageListener.html
 196.203 -http://docs.liferay.com/4.4/javadocs/portal-impl/com/liferay/portlet/messageboards/smtp/MessageListenerImpl.html
 196.204 --->
 196.205 -<!ELEMENT smtp-message-listener-class (#PCDATA)>
 196.206 -
 196.207 -<!--
 196.208 -Set the preferences-company-wide value to true if the preferences for the
 196.209 -portlet are across the entire company. Setting this value to true means
 196.210 -the value for preferences-unique-per-layout and preferences-owned-by-group are
 196.211 -not used. The default value is false.
 196.212 -
 196.213 -For example, an administrator could set the preferences to an Announcements
 196.214 -portlet that would save a message in the portlet's preferences. This message
 196.215 -would then be used across all pages for that company. The portlet must not be
 196.216 -instanceable because instanceable portlets have uniquely generated portlet ids.
 196.217 -
 196.218 -The default behavior of the bundled Announcements portlet sets the instanceable
 196.219 -value to true so that normal users cannot create company wide messages. A future
 196.220 -release would include permissions for the edit mode versus the view mode which
 196.221 -would allow an administrator to set the message while users would just view the
 196.222 -message.
 196.223 --->
 196.224 -<!ELEMENT preferences-company-wide (#PCDATA)>
 196.225 -
 196.226 -<!--
 196.227 -Set the preferences-unique-per-layout value to true if the preferences for the
 196.228 -portlet are unique across all pages. If set to false, the preferences for the
 196.229 -portlet are shared across all pages. The default value is true.
 196.230 -
 196.231 -The preferences-unique-per-layout element is used in combination with the
 196.232 -preferences-owned-by-group element. See the comments for the
 196.233 -preferences-owned-by-group element for more information.
 196.234 --->
 196.235 -<!ELEMENT preferences-unique-per-layout (#PCDATA)>
 196.236 -
 196.237 -<!--
 196.238 -Set the preferences-owned-by-group value to true if the preferences for the
 196.239 -portlet are owned by the group when the portlet is shown in a group page. If
 196.240 -set to false, the preferences are owned by the user at all times. The default
 196.241 -value is true.
 196.242 -
 196.243 -Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 196.244 -preferences-owned-by-group set to false. Users can set a different list of
 196.245 -stocks for every personal page. Users can set a different list of stocks for
 196.246 -every community page.
 196.247 -
 196.248 -Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 196.249 -preferences-owned-by-group set to false. Users can set one list of stocks to be
 196.250 -shared across all personal pages. Users can set one list of stocks to be shared
 196.251 -across a community's set of pages.
 196.252 -
 196.253 -Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 196.254 -preferences-owned-by-group set to true. Users can set a different list of stocks
 196.255 -for every personal page. Administrators set the portlet preferences for users in
 196.256 -a community page. Administrators can set a different list of stocks for every
 196.257 -community page that are then shared by all users within a community.
 196.258 -
 196.259 -Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 196.260 -preferences-owned-by-group set to true. Users can set one list of stocks to be
 196.261 -shared across all personal pages. Administrators set the portlet preferences for
 196.262 -users in a community page. Administrators can set one list of stocks to be
 196.263 -shared by all users across a community's set of pages.
 196.264 --->
 196.265 -<!ELEMENT preferences-owned-by-group (#PCDATA)>
 196.266 -
 196.267 -<!--
 196.268 -Set the use-default-template value to true if the portlet uses the default
 196.269 -template to decorate and wrap content. Setting this to false allows the
 196.270 -developer to own and maintain the portlet's entire outputted content. The
 196.271 -default value is true.
 196.272 -
 196.273 -The most common use of this is if you want the portlet to look different from
 196.274 -the other portlets or if you want the portlet to not have borders around the
 196.275 -outputted content.
 196.276 --->
 196.277 -<!ELEMENT use-default-template (#PCDATA)>
 196.278 -
 196.279 -<!--
 196.280 -Set the show-portlet-access-denied value to true if users are shown the portlet
 196.281 -with an access denied message if they do not have access to the portlet. If set
 196.282 -to false, users are never shown the portlet if they do not have access to the
 196.283 -portlet. The default value is set in portal.properties.
 196.284 -
 196.285 -See:
 196.286 -
 196.287 -http://www.liferay.com/page/guest/documentation/development/properties
 196.288 --->
 196.289 -<!ELEMENT show-portlet-access-denied (#PCDATA)>
 196.290 -
 196.291 -<!--
 196.292 -Set the show-portlet-inactive value to true if users are shown the portlet
 196.293 -with an inactive message if the portlet is inactive. If set to false, users are
 196.294 -never shown the portlet if the portlet is inactive. The default value is set in
 196.295 -portal.properties.
 196.296 -
 196.297 -http://www.liferay.com/page/guest/documentation/development/properties
 196.298 --->
 196.299 -<!ELEMENT show-portlet-inactive (#PCDATA)>
 196.300 -
 196.301 -<!--
 196.302 -Set the action-url-redirect value to true if an action URL for this portlet
 196.303 -should cause an auto redirect. This helps prevent double submits. The default
 196.304 -value is false.
 196.305 --->
 196.306 -<!ELEMENT action-url-redirect (#PCDATA)>
 196.307 -
 196.308 -<!--
 196.309 -Set the restore-current-view value to true if the portlet restores to the
 196.310 -current view when toggling between maximized and normal states. If set to false,
 196.311 -the portlet will reset the current view when toggling between maximized and
 196.312 -normal states. The default value is true.
 196.313 --->
 196.314 -<!ELEMENT restore-current-view (#PCDATA)>
 196.315 -
 196.316 -<!--
 196.317 -Set the maximize-edit value to true if the portlet goes into the maximized state
 196.318 -when the user goes into the edit mode. This only affects the default portal
 196.319 -icons and not what may be programmatically set by the portlet developer.
 196.320 -The default value is false.
 196.321 --->
 196.322 -<!ELEMENT maximize-edit (#PCDATA)>
 196.323 -
 196.324 -<!--
 196.325 -Set the maximize-help value to true if the portlet goes into the maximized state
 196.326 -when the user goes into the help mode. This only affects the default portal
 196.327 -icons and not what may be programmatically set by the portlet developer.
 196.328 -The default value is false.
 196.329 --->
 196.330 -<!ELEMENT maximize-help (#PCDATA)>
 196.331 -
 196.332 -<!--
 196.333 -Set the pop-up-print value to true if the portlet goes into the pop up state
 196.334 -when the user goes into the print mode. This only affects the default portal
 196.335 -icons and not what may be programmatically set by the portlet developer.
 196.336 -The default value is true.
 196.337 --->
 196.338 -<!ELEMENT pop-up-print (#PCDATA)>
 196.339 -
 196.340 -<!--
 196.341 -Set the layout-cacheable flag to true if the data contained in this portlet can
 196.342 -will never change unless the layout or Journal portlet entry is changed.
 196.343 --->
 196.344 -<!ELEMENT layout-cacheable (#PCDATA)>
 196.345 -
 196.346 -<!--
 196.347 -Set the instanceable value to true if the portlet can appear multiple times on a
 196.348 -page. If set to false, the portlet can only appear once on a page. The default
 196.349 -value is false.
 196.350 --->
 196.351 -<!ELEMENT instanceable (#PCDATA)>
 196.352 -
 196.353 -<!--
 196.354 -Set the private-request-attributes value to true if the portlet does not share
 196.355 -request attributes with the portal or any other portlet. The default value is
 196.356 -true. The property "request.shared.attributes" in portal.properties specifies
 196.357 -which request attributes are shared even when the private-request-attributes
 196.358 -value is true.
 196.359 --->
 196.360 -<!ELEMENT private-request-attributes (#PCDATA)>
 196.361 -
 196.362 -<!--
 196.363 -Set the private-session-attributes value to true if the portlet does not share
 196.364 -session attributes with the portal. The default value is true. The property
 196.365 -"session.shared.attributes" in portal.properties specifies which session
 196.366 -attributes are shared even when the private-session-attributes value is true.
 196.367 --->
 196.368 -<!ELEMENT private-session-attributes (#PCDATA)>
 196.369 -
 196.370 -<!--
 196.371 -The default value of render-weight is 1. If set to a value less than 1, the
 196.372 -portlet is rendered in parallel. If set to a value of 1 or greater, then the
 196.373 -portlet is rendered serially. Portlets with a greater render weight have greater
 196.374 -priority and will be rendered before portlets with a lower render weight.
 196.375 -
 196.376 -If the ajaxable value is set to false, then render-weight is always set to 1
 196.377 -if it is set to a value less than 1. This means ajaxable can override
 196.378 -render-weight if ajaxable is set to false.
 196.379 --->
 196.380 -<!ELEMENT render-weight (#PCDATA)>
 196.381 -
 196.382 -<!--
 196.383 -The default value of ajaxable is true. If set to false, then this portlet can
 196.384 -never be displayed via Ajax.
 196.385 --->
 196.386 -<!ELEMENT ajaxable (#PCDATA)>
 196.387 -
 196.388 -<!--
 196.389 -Set the path of CSS that will be referenced in the page's header relative to the
 196.390 -portal's context path.
 196.391 --->
 196.392 -<!ELEMENT header-portal-css (#PCDATA)>
 196.393 -
 196.394 -<!--
 196.395 -Set the path of CSS that will be referenced in the page's header relative to the
 196.396 -portlet's context path.
 196.397 --->
 196.398 -<!ELEMENT header-portlet-css (#PCDATA)>
 196.399 -
 196.400 -<!--
 196.401 -Set the path of JavaScript that will be referenced in the page's header relative
 196.402 -to the portal's context path.
 196.403 --->
 196.404 -<!ELEMENT header-portal-javascript (#PCDATA)>
 196.405 -
 196.406 -<!--
 196.407 -Set the path of JavaScript that will be referenced in the page's header relative
 196.408 -to the portlet's context path.
 196.409 --->
 196.410 -<!ELEMENT header-portlet-javascript (#PCDATA)>
 196.411 -
 196.412 -<!--
 196.413 -Set the path of CSS that will be referenced in the page's footer relative to the
 196.414 -portal's context path.
 196.415 --->
 196.416 -<!ELEMENT footer-portal-css (#PCDATA)>
 196.417 -
 196.418 -<!--
 196.419 -Set the path of CSS that will be referenced in the page's footer relative to the
 196.420 -portlet's context path.
 196.421 --->
 196.422 -<!ELEMENT footer-portlet-css (#PCDATA)>
 196.423 -
 196.424 -<!--
 196.425 -Set the path of JavaScript that will be referenced in the page's footer relative
 196.426 -to the portal's context path.
 196.427 --->
 196.428 -<!ELEMENT footer-portal-javascript (#PCDATA)>
 196.429 -
 196.430 -<!--
 196.431 -Set the path of JavaScript that will be referenced in the page's footer relative
 196.432 -to the portlet's context path.
 196.433 --->
 196.434 -<!ELEMENT footer-portlet-javascript (#PCDATA)>
 196.435 -
 196.436 -<!--
 196.437 -Set name of the CSS class that will be injected in the DIV that wraps this
 196.438 -portlet.
 196.439 --->
 196.440 -<!ELEMENT css-class-wrapper (#PCDATA)>
 196.441 -
 196.442 -<!--
 196.443 -If the add-default-resource value is set to false, and the portlet does not
 196.444 -belong to the page but has been dynamically added, then the user will see that
 196.445 -he does not have permissions to view the portlet. If the add-default-resource
 196.446 -value is set to true, the default portlet resources and permissions are added to
 196.447 -the page. The user can then view the portlet. Most portlets are harmless and can
 196.448 -benefit from this flexibility. However, to prevent security loop holes, the
 196.449 -default value is false.
 196.450 --->
 196.451 -<!ELEMENT add-default-resource (#PCDATA)>
 196.452 -
 196.453 -<!--
 196.454 -Set the system value to true if the portlet is a system portlet that a user
 196.455 -cannot manually add to their page. The default value is false.
 196.456 --->
 196.457 -<!ELEMENT system (#PCDATA)>
 196.458 -
 196.459 -<!--
 196.460 -Set the active value to true if the portlet is active and available to users.
 196.461 -If set to false, the portlet will not be active or available to users. The
 196.462 -default value is true.
 196.463 -
 196.464 -This value can be changed at runtime via the Admin portlet.
 196.465 --->
 196.466 -<!ELEMENT active (#PCDATA)>
 196.467 -
 196.468 -<!--
 196.469 -Set the include value to true to if the portlet is available to the portal. If
 196.470 -set to false, the portlet is not available to the portal. The default value is
 196.471 -true.
 196.472 -
 196.473 -Portlets that are not included as part of the portal are never available to the
 196.474 -user to be made active or inactive. As far the user knows, the portlets do not
 196.475 -even exist in the system. This allows the Liferay developers to bundle a lot of
 196.476 -portlets in one core package, and yet allow custom deployments to turn on or off
 196.477 -individual portlets or sets of portlets. This follows the Siebel and Microsoft
 196.478 -model of bundling everything in one core package, but using XML configuration or
 196.479 -registry settings to turn on and off features or sets of features.
 196.480 -
 196.481 -We do not recommend that custom deployers modify the core source by removing
 196.482 -specific portlets because this prevents an easy upgrade process in the future.
 196.483 -The best way to turn on and off portlets is to set the include element. The
 196.484 -advantage of this way of doing things is that it becomes very easy to deploy
 196.485 -Liferay. All features are available in one package. The disadvantage is that by
 196.486 -not utilizing all of the portlets, you are wasting disk space and may even take
 196.487 -a small but static memory footprint. However, we feel that the extra disk space
 196.488 -and memory usage is a cheap price to pay in order to provide an easy
 196.489 -installation and upgrade path.
 196.490 --->
 196.491 -<!ELEMENT include (#PCDATA)>
 196.492 -
 196.493 -<!--
 196.494 -The role-mapper contains two names specified by role-name and role-link. The
 196.495 -role-name value must be a role specified in portlet.xml. The role-link value
 196.496 -must be the name of a Liferay role that exists in the database. The role-mapper
 196.497 -element pairs up these two values to map roles from portlet.xml to roles in
 196.498 -the Liferay database.
 196.499 -
 196.500 -This is needed because Liferay roles may contain spaces whereas roles in
 196.501 -portlet.xml cannot contain spaces. This also adds extra flexibility where the
 196.502 -portlet vendor does not need to have any knowledge about Liferay's roles.
 196.503 --->
 196.504 -<!ELEMENT role-mapper (role-name, role-link)>
 196.505 -
 196.506 -<!--
 196.507 -See the comments in role-mapper element.
 196.508 --->
 196.509 -<!ELEMENT role-name (#PCDATA)>
 196.510 -
 196.511 -<!--
 196.512 -See the comments in role-mapper element.
 196.513 --->
 196.514 -<!ELEMENT role-link (#PCDATA)>
 196.515 -
 196.516 -<!--
 196.517 -The custom-user-attribute contains a list of names that are retrieved using a
 196.518 -custom class that extends com.liferay.portlet.CustomUserAttributes.
 196.519 -
 196.520 -Download the sample hot deployable portlet WAR named test.war. Look for the
 196.521 -class com.liferay.portlet.teststruts.TestStrutsUserAttributes to see how it
 196.522 -associates the custom user attribute "user.name.test" with the value
 196.523 -"Test Name". This class could be modified to read custom user attributes from
 196.524 -another datasource that may be a database, a LDAP server, or a web service.
 196.525 -
 196.526 -See:
 196.527 -
 196.528 -http://www.liferay.com/page/guest/documentation/development/hot_deploy
 196.529 --->
 196.530 -<!ELEMENT custom-user-attribute (name+, custom-class)>
 196.531 -
 196.532 -<!--
 196.533 -See the comments in custom-user-attribute element.
 196.534 --->
 196.535 -<!ELEMENT name (#PCDATA)>
 196.536 -
 196.537 -<!--
 196.538 -See the comments in custom-user-attribute element.
 196.539 --->
 196.540 -<!ELEMENT custom-class (#PCDATA)>
 196.541 \ No newline at end of file
   197.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/liferay-portlet-app_5_0_0.dtd	Fri Jun 10 09:46:37 2011 +0200
   197.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   197.3 @@ -1,567 +0,0 @@
   197.4 -<!--
   197.5 -This is the DTD for the Portlet Application parameters that are specific to
   197.6 -Liferay Portal.
   197.7 -
   197.8 -<!DOCTYPE liferay-portlet-app PUBLIC
   197.9 -	"-//Liferay//DTD Portlet Application 5.0.0//EN"
  197.10 -	"http://www.liferay.com/dtd/liferay-portlet-app_5_0_0.dtd">
  197.11 --->
  197.12 -
  197.13 -<!--
  197.14 -The liferay-portlet-app element is the root of the deployment descriptor for
  197.15 -a Liferay portlet application.
  197.16 --->
  197.17 -<!ELEMENT liferay-portlet-app (portlet*, role-mapper*, custom-user-attribute*)>
  197.18 -
  197.19 -<!--
  197.20 -The portlet element contains the declarative data of a portlet.
  197.21 --->
  197.22 -<!ELEMENT portlet (portlet-name, icon?, virtual-path?, struts-path?,
  197.23 -configuration-path?, configuration-action-class?, indexer-class?,
  197.24 -open-search-class?, scheduler-class?, portlet-url-class?,
  197.25 -friendly-url-mapper-class?, url-encoder-class?, portlet-data-handler-class?,
  197.26 -portlet-layout-listener-class?, pop-message-listener-class?,
  197.27 -social-activity-interpreter-class?, social-request-interpreter-class?,
  197.28 -preferences-company-wide?, preferences-unique-per-layout?,
  197.29 -preferences-owned-by-group?, use-default-template?, show-portlet-access-denied?,
  197.30 -show-portlet-inactive?, action-url-redirect?, restore-current-view?,
  197.31 -maximize-edit?, maximize-help?, pop-up-print?, layout-cacheable?, instanceable?,
  197.32 -user-principal-strategy?, private-request-attributes?,
  197.33 -private-session-attributes?, render-weight?, ajaxable?, header-portal-css*,
  197.34 -header-portlet-css*, header-portal-javascript*, header-portlet-javascript*,
  197.35 -footer-portal-css*, footer-portlet-css*, footer-portal-javascript*,
  197.36 -footer-portlet-javascript*, css-class-wrapper?, facebook-integration?,
  197.37 -add-default-resource?, system?, active?, include?)>
  197.38 -
  197.39 -<!--
  197.40 -The portlet-name element contains the unique name of the portlet. This name must
  197.41 -match the portlet-name specified in portlet.xml.
  197.42 --->
  197.43 -<!ELEMENT portlet-name (#PCDATA)>
  197.44 -
  197.45 -<!--
  197.46 -The icon element specifies an image that represents the portlet.
  197.47 --->
  197.48 -<!ELEMENT icon (#PCDATA)>
  197.49 -
  197.50 -<!--
  197.51 -The virtual-path value sets the virtual path used to override the default
  197.52 -servlet context path.
  197.53 -
  197.54 -For example, suppose your portlet is deployed to the servlet path
  197.55 -"/test-portlet". By default, the portal will return "/test-portlet" for the
  197.56 -servlet context path. You can override it by setting virtual-path to "/virtual"
  197.57 -and have the portal return "/virtual" for the servlet context path.
  197.58 -
  197.59 -The default value is "" which means this is not used.
  197.60 --->
  197.61 -<!ELEMENT virtual-path (#PCDATA)>
  197.62 -
  197.63 -<!--
  197.64 -Supppose the struts-path value is "mail". This tells the portal that all
  197.65 -requests with the path mail/* are considered part of this portlet's scope. Users
  197.66 -who request paths that match mail/* will only be granted access if they also
  197.67 -have access to this portlet. This is true for both portlet requests and regular
  197.68 -servlet requests.
  197.69 --->
  197.70 -<!ELEMENT struts-path (#PCDATA)>
  197.71 -
  197.72 -<!--
  197.73 -The configuration-path value is no longer available. Use
  197.74 -configuration-action-class instead.
  197.75 --->
  197.76 -<!ELEMENT configuration-path (#PCDATA)>
  197.77 -
  197.78 -<!--
  197.79 -The configuration-action-class value must be a class that implements
  197.80 -com.liferay.portal.kernel.portlet.ConfigurationAction and is called to allow
  197.81 -users to configure the portlet at runtime.
  197.82 -
  197.83 -See:
  197.84 -
  197.85 -http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/messageboards/action/ConfigurationActionImpl.html
  197.86 --->
  197.87 -<!ELEMENT configuration-action-class (#PCDATA)>
  197.88 -
  197.89 -<!--
  197.90 -The indexer-class value must be a class that implements
  197.91 -com.liferay.portal.kernel.search.Indexer and is called to create or update a
  197.92 -search index for the portlet.
  197.93 -
  197.94 -See:
  197.95 -
  197.96 -http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/messageboards/util/Indexer.html
  197.97 -http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/search/Indexer.html
  197.98 -http://lucene.apache.org
  197.99 --->
 197.100 -<!ELEMENT indexer-class (#PCDATA)>
 197.101 -
 197.102 -<!--
 197.103 -The open-search-class value must be a class that implements
 197.104 -com.liferay.portal.kernel.search.OpenSearch and is called to get search results
 197.105 -in the OpenSearch 1.1 standard.
 197.106 -
 197.107 -See:
 197.108 -
 197.109 -http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/alfrescocontent/util/OpenSearch.html
 197.110 -http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/search/OpenSearch.html
 197.111 -http://www.opensearch.org
 197.112 --->
 197.113 -<!ELEMENT open-search-class (#PCDATA)>
 197.114 -
 197.115 -<!--
 197.116 -The scheduler-class value must be a class that implements
 197.117 -com.liferay.portal.kernel.job.Scheduler and is called to schedule jobs for this
 197.118 -portlet.
 197.119 -
 197.120 -See:
 197.121 -
 197.122 -http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/calendar/job/CalendarScheduler.html
 197.123 -http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/job/Scheduler.html
 197.124 -http://www.opensymphony.com/quartz
 197.125 --->
 197.126 -<!ELEMENT scheduler-class (#PCDATA)>
 197.127 -
 197.128 -<!--
 197.129 -The portlet-url-class value must be a class that extends
 197.130 -com.liferay.portlet.PortletURLImplWrapper. Set this class to override the
 197.131 -default portlet URL implementation.
 197.132 -
 197.133 -See:
 197.134 -
 197.135 -http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portal/struts/StrutsActionPortletURL.html
 197.136 --->
 197.137 -<!ELEMENT portlet-url-class (#PCDATA)>
 197.138 -
 197.139 -<!--
 197.140 -The friendly-url-mapper-class value must be a class that implements
 197.141 -com.liferay.portal.kernel.portlet.FriendlyURLMapper. Use this if content inside
 197.142 -a portlet needs to have a friendly URL. See the Message Boards portlet for an
 197.143 -example of its uses.
 197.144 -
 197.145 -See:
 197.146 -
 197.147 -http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/messageboards/MBFriendlyURLMapper.html
 197.148 -http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/portlet/FriendlyURLMapper.html
 197.149 --->
 197.150 -<!ELEMENT friendly-url-mapper-class (#PCDATA)>
 197.151 -
 197.152 -<!--
 197.153 -The url-encoder-class value must be a class that implements
 197.154 -com.liferay.portal.kernel.servlet.URLEncoder. Use this to set a custom
 197.155 -URLEncoder that is used by the RenderResponse class to implement the encodeURL
 197.156 -method. This is useful if you need to add custom logic to rewrite URLs.
 197.157 --->
 197.158 -<!ELEMENT url-encoder-class (#PCDATA)>
 197.159 -
 197.160 -<!--
 197.161 -The portlet-data-handler-class value must be a class that implements
 197.162 -com.liferay.portal.kernel.lar.PortletDataHandler and is called when archiving
 197.163 -tasks are run.
 197.164 -
 197.165 -See:
 197.166 -
 197.167 -http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/journal/lar/PortletDataHandlerImpl.html
 197.168 -http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/lar/PortletDataHandler.html
 197.169 --->
 197.170 -<!ELEMENT portlet-data-handler-class (#PCDATA)>
 197.171 -
 197.172 -<!--
 197.173 -The portlet-layout-listener-class value must be a class that implements
 197.174 -com.liferay.portal.kernel.portlet.PortletLayoutListener and is called when a portlet
 197.175 -is added, moved, or removed from a layout.
 197.176 -
 197.177 -See:
 197.178 -
 197.179 -http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/journalcontent/JournalContentPortletLayoutListener.html
 197.180 -http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/portlet/PortletLayoutListener.html
 197.181 --->
 197.182 -<!ELEMENT portlet-layout-listener-class (#PCDATA)>
 197.183 -
 197.184 -<!--
 197.185 -The pop-message-listener-class value must be a class that implements
 197.186 -com.liferay.portal.kernel.pop.MessageListener and is called when processing
 197.187 -emails.
 197.188 -
 197.189 -See:
 197.190 -
 197.191 -http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/messageboards/pop/MessageListenerImpl.html
 197.192 -http://docs.liferay.com/5.0/javadocs/portal-kernel/com/liferay/portal/kernel/pop/MessageListener.html
 197.193 --->
 197.194 -<!ELEMENT pop-message-listener-class (#PCDATA)>
 197.195 -
 197.196 -<!--
 197.197 -The social-activity-interpreter-class value must be a class that implements
 197.198 -com.liferay.portlet.social.model.SocialActivityInterpreter and is called to
 197.199 -interpret activities into friendly messages that are easily understandable by a
 197.200 -human being.
 197.201 -
 197.202 -See:
 197.203 -
 197.204 -http://docs.liferay.com/5.0/javadocs/portal-impl/com/liferay/portlet/messageboards/social/MBActivityInterpreter.html
 197.205 -http://docs.liferay.com/5.0/javadocs/portal-service/com/liferay/portlet/social/model/SocialActivityInterpreter.html
 197.206 --->
 197.207 -<!ELEMENT social-activity-interpreter-class (#PCDATA)>
 197.208 -
 197.209 -<!--
 197.210 -The social-request-interpreter-class value must be a class that implements
 197.211 -com.liferay.portlet.social.model.SocialRequestInterpreter and is called to
 197.212 -interpret requests into friendly messages that are easily understandable by a
 197.213 -human being.
 197.214 -
 197.215 -See:
 197.216 -
 197.217 -http://docs.liferay.com/5.0/javadocs/portal-service/com/liferay/portlet/social/model/SocialRequestInterpreter.html
 197.218 --->
 197.219 -<!ELEMENT social-request-interpreter-class (#PCDATA)>
 197.220 -
 197.221 -<!--
 197.222 -Set the preferences-company-wide value to true if the preferences for the
 197.223 -portlet are across the entire company. Setting this value to true means
 197.224 -the value for preferences-unique-per-layout and preferences-owned-by-group are
 197.225 -not used. The default value is false.
 197.226 -
 197.227 -For example, an administrator could set the preferences to an Announcements
 197.228 -portlet that would save a message in the portlet's preferences. This message
 197.229 -would then be used across all pages for that company. The portlet must not be
 197.230 -instanceable because instanceable portlets have uniquely generated portlet ids.
 197.231 -
 197.232 -The default behavior of the bundled Announcements portlet sets the instanceable
 197.233 -value to true so that normal users cannot create company wide messages. A future
 197.234 -release would include permissions for the edit mode versus the view mode which
 197.235 -would allow an administrator to set the message while users would just view the
 197.236 -message.
 197.237 --->
 197.238 -<!ELEMENT preferences-company-wide (#PCDATA)>
 197.239 -
 197.240 -<!--
 197.241 -Set the preferences-unique-per-layout value to true if the preferences for the
 197.242 -portlet are unique across all pages. If set to false, the preferences for the
 197.243 -portlet are shared across all pages. The default value is true.
 197.244 -
 197.245 -The preferences-unique-per-layout element is used in combination with the
 197.246 -preferences-owned-by-group element. See the comments for the
 197.247 -preferences-owned-by-group element for more information.
 197.248 --->
 197.249 -<!ELEMENT preferences-unique-per-layout (#PCDATA)>
 197.250 -
 197.251 -<!--
 197.252 -Set the preferences-owned-by-group value to true if the preferences for the
 197.253 -portlet are owned by the group when the portlet is shown in a group page. If
 197.254 -set to false, the preferences are owned by the user at all times. The default
 197.255 -value is true.
 197.256 -
 197.257 -Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 197.258 -preferences-owned-by-group set to false. Users can set a different list of
 197.259 -stocks for every personal page. Users can set a different list of stocks for
 197.260 -every community page.
 197.261 -
 197.262 -Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 197.263 -preferences-owned-by-group set to false. Users can set one list of stocks to be
 197.264 -shared across all personal pages. Users can set one list of stocks to be shared
 197.265 -across a community's set of pages.
 197.266 -
 197.267 -Suppose the Stocks portlet has preferences-unique-per-layout set to true and
 197.268 -preferences-owned-by-group set to true. Users can set a different list of stocks
 197.269 -for every personal page. Administrators set the portlet preferences for users in
 197.270 -a community page. Administrators can set a different list of stocks for every
 197.271 -community page that are then shared by all users within a community.
 197.272 -
 197.273 -Suppose the Stocks portlet has preferences-unique-per-layout set to false and
 197.274 -preferences-owned-by-group set to true. Users can set one list of stocks to be
 197.275 -shared across all personal pages. Administrators set the portlet preferences for
 197.276 -users in a community page. Administrators can set one list of stocks to be
 197.277 -shared by all users across a community's set of pages.
 197.278 --->
 197.279 -<!ELEMENT preferences-owned-by-group (#PCDATA)>
 197.280 -
 197.281 -<!--
 197.282 -Set the use-default-template value to true if the portlet uses the default
 197.283 -template to decorate and wrap content. Setting this to false allows the
 197.284 -developer to own and maintain the portlet's entire outputted content. The
 197.285 -default value is true.
 197.286 -
 197.287 -The most common use of this is if you want the portlet to look different from
 197.288 -the other portlets or if you want the portlet to not have borders around the
 197.289 -outputted content.
 197.290 --->
 197.291 -<!ELEMENT use-default-template (#PCDATA)>
 197.292 -
 197.293 -<!--
 197.294 -Set the show-portlet-access-denied value to true if users are shown the portlet
 197.295 -with an access denied message if they do not have access to the portlet. If set
 197.296 -to false, users are never shown the portlet if they do not have access to the
 197.297 -portlet. The default value is set in portal.properties.
 197.298 -
 197.299 -See:
 197.300 -
 197.301 -http://www.liferay.com/page/guest/documentation/development/properties
 197.302 --->
 197.303 -<!ELEMENT show-portlet-access-denied (#PCDATA)>
 197.304 -
 197.305 -<!--
 197.306 -Set the show-portlet-inactive value to true if users are shown the portlet
 197.307 -with an inactive message if the portlet is inactive. If set to false, users are
 197.308 -never shown the portlet if the portlet is inactive. The default value is set in
 197.309 -portal.properties.
 197.310 -
 197.311 -http://www.liferay.com/page/guest/documentation/development/properties
 197.312 --->
 197.313 -<!ELEMENT show-portlet-inactive (#PCDATA)>
 197.314 -
 197.315 -<!--
 197.316 -Set the action-url-redirect value to true if an action URL for this portlet
 197.317 -should cause an auto redirect. This helps prevent double submits. The default
 197.318 -value is false.
 197.319 --->
 197.320 -<!ELEMENT action-url-redirect (#PCDATA)>
 197.321 -
 197.322 -<!--
 197.323 -Set the restore-current-view value to true if the portlet restores to the
 197.324 -current view when toggling between maximized and normal states. If set to false,
 197.325 -the portlet will reset the current view when toggling between maximized and
 197.326 -normal states. The default value is true.
 197.327 --->
 197.328 -<!ELEMENT restore-current-view (#PCDATA)>
 197.329 -
 197.330 -<!--
 197.331 -Set the maximize-edit value to true if the portlet goes into the maximized state
 197.332 -when the user goes into the edit mode. This only affects the default portal
 197.333 -icons and not what may be programmatically set by the portlet developer.
 197.334 -The default value is false.
 197.335 --->
 197.336 -<!ELEMENT maximize-edit (#PCDATA)>
 197.337 -
 197.338 -<!--
 197.339 -Set the maximize-help value to true if the portlet goes into the maximized state
 197.340 -when the user goes into the help mode. This only affects the default portal
 197.341 -icons and not what may be programmatically set by the portlet developer.
 197.342 -The default value is false.
 197.343 --->
 197.344 -<!ELEMENT maximize-help (#PCDATA)>
 197.345 -
 197.346 -<!--
 197.347 -Set the pop-up-print value to true if the portlet goes into the pop up state
 197.348 -when the user goes into the print mode. This only affects the default portal
 197.349 -icons and not what may be programmatically set by the portlet developer.
 197.350 -The default value is true.
 197.351 --->
 197.352 -<!ELEMENT pop-up-print (#PCDATA)>
 197.353 -
 197.354 -<!--
 197.355 -Set the layout-cacheable flag to true if the data contained in this portlet can
 197.356 -will never change unless the layout or Journal portlet entry is changed.
 197.357 --->
 197.358 -<!ELEMENT layout-cacheable (#PCDATA)>
 197.359 -
 197.360 -<!--
 197.361 -Set the instanceable value to true if the portlet can appear multiple times on a
 197.362 -page. If set to false, the portlet can only appear once on a page. The default
 197.363 -value is false.
 197.364 --->
 197.365 -<!ELEMENT instanceable (#PCDATA)>
 197.366 -
 197.367 -<!--
 197.368 -Set the user-principal-strategy value to either "userId" or "screenName".
 197.369 -Calling request.getRemoteUser() will normally return the user id. However, some
 197.370 -portlets may need the user principal returned to be screen name instead.
 197.371 --->
 197.372 -<!ELEMENT user-principal-strategy (#PCDATA)>
 197.373 -
 197.374 -<!--
 197.375 -Set the private-request-attributes value to true if the portlet does not share
 197.376 -request attributes with the portal or any other portlet. The default value is
 197.377 -true. The property "request.shared.attributes" in portal.properties specifies
 197.378 -which request attributes are shared even when the private-request-attributes
 197.379 -value is true.
 197.380 --->
 197.381 -<!ELEMENT private-request-attributes (#PCDATA)>
 197.382 -
 197.383 -<!--
 197.384 -Set the private-session-attributes value to true if the portlet does not share
 197.385 -session attributes with the portal. The default value is true. The property
 197.386 -"session.shared.attributes" in portal.properties specifies which session
 197.387 -attributes are shared even when the private-session-attributes value is true.
 197.388 --->
 197.389 -<!ELEMENT private-session-attributes (#PCDATA)>
 197.390 -
 197.391 -<!--
 197.392 -The default value of render-weight is 1. If set to a value less than 1, the
 197.393 -portlet is rendered in parallel. If set to a value of 1 or greater, then the
 197.394 -portlet is rendered serially. Portlets with a greater render weight have greater
 197.395 -priority and will be rendered before portlets with a lower render weight.
 197.396 -
 197.397 -If the ajaxable value is set to false, then render-weight is always set to 1
 197.398 -if it is set to a value less than 1. This means ajaxable can override
 197.399 -render-weight if ajaxable is set to false.
 197.400 --->
 197.401 -<!ELEMENT render-weight (#PCDATA)>
 197.402 -
 197.403 -<!--
 197.404 -The default value of ajaxable is true. If set to false, then this portlet can
 197.405 -never be displayed via Ajax.
 197.406 --->
 197.407 -<!ELEMENT ajaxable (#PCDATA)>
 197.408 -
 197.409 -<!--
 197.410 -Set the path of CSS that will be referenced in the page's header relative to the
 197.411 -portal's context path.
 197.412 --->
 197.413 -<!ELEMENT header-portal-css (#PCDATA)>
 197.414 -
 197.415 -<!--
 197.416 -Set the path of CSS that will be referenced in the page's header relative to the
 197.417 -portlet's context path.
 197.418 --->
 197.419 -<!ELEMENT header-portlet-css (#PCDATA)>
 197.420 -
 197.421 -<!--
 197.422 -Set the path of JavaScript that will be referenced in the page's header relative
 197.423 -to the portal's context path.
 197.424 --->
 197.425 -<!ELEMENT header-portal-javascript (#PCDATA)>
 197.426 -
 197.427 -<!--
 197.428 -Set the path of JavaScript that will be referenced in the page's header relative
 197.429 -to the portlet's context path.
 197.430 --->
 197.431 -<!ELEMENT header-portlet-javascript (#PCDATA)>
 197.432 -
 197.433 -<!--
 197.434 -Set the path of CSS that will be referenced in the page's footer relative to the
 197.435 -portal's context path.
 197.436 --->
 197.437 -<!ELEMENT footer-portal-css (#PCDATA)>
 197.438 -
 197.439 -<!--
 197.440 -Set the path of CSS that will be referenced in the page's footer relative to the
 197.441 -portlet's context path.
 197.442 --->
 197.443 -<!ELEMENT footer-portlet-css (#PCDATA)>
 197.444 -
 197.445 -<!--
 197.446 -Set the path of JavaScript that will be referenced in the page's footer relative
 197.447 -to the portal's context path.
 197.448 --->
 197.449 -<!ELEMENT footer-portal-javascript (#PCDATA)>
 197.450 -
 197.451 -<!--
 197.452 -Set the path of JavaScript that will be referenced in the page's footer relative
 197.453 -to the portlet's context path.
 197.454 --->
 197.455 -<!ELEMENT footer-portlet-javascript (#PCDATA)>
 197.456 -
 197.457 -<!--
 197.458 -Set name of the CSS class that will be injected in the DIV that wraps this
 197.459 -portlet.
 197.460 --->
 197.461 -<!ELEMENT css-class-wrapper (#PCDATA)>
 197.462 -
 197.463 -<!--
 197.464 -Set the facebook-integration value to either "fbml" or "iframe". The default
 197.465 -value is "iframe" because IFrame integration will work without requiring any
 197.466 -changes to your code. See the Message Boards portlet for minor changes that were
 197.467 -made to make it FBML compliant. Note that the Liferay tag libraries already
 197.468 -output FBML automatically if a request is made by Facebook.
 197.469 --->
 197.470 -<!ELEMENT facebook-integration (#PCDATA)>
 197.471 -
 197.472 -<!--
 197.473 -If the add-default-resource value is set to false, and the portlet does not
 197.474 -belong to the page but has been dynamically added, then the user will see that
 197.475 -he does not have permissions to view the portlet. If the add-default-resource
 197.476 -value is set to true, the default portlet resources and permissions are added to
 197.477 -the page. The user can then view the portlet. Most portlets are harmless and can
 197.478 -benefit from this flexibility. However, to prevent security loop holes, the
 197.479 -default value is false.
 197.480 --->
 197.481 -<!ELEMENT add-default-resource (#PCDATA)>
 197.482 -
 197.483 -<!--
 197.484 -Set the system value to true if the portlet is a system portlet that a user
 197.485 -cannot manually add to their page. The default value is false.
 197.486 --->
 197.487 -<!ELEMENT system (#PCDATA)>
 197.488 -
 197.489 -<!--
 197.490 -Set the active value to true if the portlet is active and available to users.
 197.491 -If set to false, the portlet will not be active or available to users. The
 197.492 -default value is true.
 197.493 -
 197.494 -This value can be changed at runtime via the Admin portlet.
 197.495 --->
 197.496 -<!ELEMENT active (#PCDATA)>
 197.497 -
 197.498 -<!--
 197.499 -Set the include value to true to if the portlet is available to the portal. If
 197.500 -set to false, the portlet is not available to the portal. The default value is
 197.501 -true.
 197.502 -
 197.503 -Portlets that are not included as part of the portal are never available to the
 197.504 -user to be made active or inactive. As far the user knows, the portlets do not
 197.505 -even exist in the system. This allows the Liferay developers to bundle a lot of
 197.506 -portlets in one core package, and yet allow custom deployments to turn on or off
 197.507 -individual portlets or sets of portlets. This follows the Siebel and Microsoft
 197.508 -model of bundling everything in one core package, but using XML configuration or
 197.509 -registry settings to turn on and off features or sets of features.
 197.510 -
 197.511 -We do not recommend that custom deployers modify the core source by removing
 197.512 -specific portlets because this prevents an easy upgrade process in the future.
 197.513 -The best way to turn on and off portlets is to set the include element. The
 197.514 -advantage of this way of doing things is that it becomes very easy to deploy
 197.515 -Liferay. All features are available in one package. The disadvantage is that by
 197.516 -not utilizing all of the portlets, you are wasting disk space and may even take
 197.517 -a small but static memory footprint. However, we feel that the extra disk space
 197.518 -and memory usage is a cheap price to pay in order to provide an easy
 197.519 -installation and upgrade path.
 197.520 --->
 197.521 -<!ELEMENT include (#PCDATA)>
 197.522 -
 197.523 -<!--
 197.524 -The role-mapper contains two names specified by role-name and role-link. The
 197.525 -role-name value must be a role specified in portlet.xml. The role-link value
 197.526 -must be the name of a Liferay role that exists in the database. The role-mapper
 197.527 -element pairs up these two values to map roles from portlet.xml to roles in
 197.528 -the Liferay database.
 197.529 -
 197.530 -This is needed because Liferay roles may contain spaces whereas roles in
 197.531 -portlet.xml cannot contain spaces. This also adds extra flexibility where the
 197.532 -portlet vendor does not need to have any knowledge about Liferay's roles.
 197.533 --->
 197.534 -<!ELEMENT role-mapper (role-name, role-link)>
 197.535 -
 197.536 -<!--
 197.537 -See the comments in role-mapper element.
 197.538 --->
 197.539 -<!ELEMENT role-name (#PCDATA)>
 197.540 -
 197.541 -<!--
 197.542 -See the comments in role-mapper element.
 197.543 --->
 197.544 -<!ELEMENT role-link (#PCDATA)>
 197.545 -
 197.546 -<!--
 197.547 -The custom-user-attribute contains a list of names that are retrieved using a
 197.548 -custom class that extends com.liferay.portlet.CustomUserAttributes.
 197.549 -
 197.550 -Download the sample hot deployable portlet WAR named test.war. Look for the
 197.551 -class com.sample.strutsliferay.portlet.SampleUserAttributes to see how it
 197.552 -associates the custom user attribute "user.name.test" with the value
 197.553 -"Test Name". This class could be modified to read custom user attributes from
 197.554 -another datasource that may be a database, a LDAP server, or a web service.
 197.555 -
 197.556 -See:
 197.557 -
 197.558 -http://www.liferay.com/page/guest/documentation/development/hot_deploy
 197.559 --->
 197.560 -<!ELEMENT custom-user-attribute (name+, custom-class)>
 197.561 -
 197.562 -<!--
 197.563 -See the comments in custom-user-attribute element.
 197.564 --->
 197.565 -<!ELEMENT name (#PCDATA)>
 197.566 -
 197.567 -<!--
 197.568 -See the comments in custom-user-attribute element.
 197.569 --->
 197.570 -<!ELEMENT custom-class (#PCDATA)>
 197.571 \ No newline at end of file
   198.1 Binary file portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/mfolder.gif has changed
   199.1 Binary file portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/theme.png has changed
   200.1 Binary file portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/resources/wait.gif has changed
   201.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   201.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   201.3 @@ -1,7 +1,7 @@
   201.4  LBL_PC_HOME=PC Home\:
   201.5  
   201.6  LBL_HOST=Host\:
   201.7 -LBL_PORTAL_URI=Portal Uri:
   201.8 +LBL_PORTAL_URI=Portal Context :
   201.9  
  201.10  LBL_ADMIN_URI=Admin Uri\:
  201.11  
  201.12 @@ -24,16 +24,22 @@
  201.13  
  201.14  DESC_LIFE_RAY=Liferay
  201.15  LBL_Auto_Deploy_Dir=Auto Deploy Dir:
  201.16 -LBL_BrowseButton=Browse
  201.17 +LBL_BrowseButton=...
  201.18  LBL_ChooserName=Browse
  201.19  MSG_NO_LIFERAY_INSTALLATION_FOUND=No Liferay Installation Found on this GlassFish domain.
  201.20  MSG_NO_LIFERAY_INSTALLATION_FOUND_ON_TOMCAT=No Liferay Installation Found on this Tomcat Server.
  201.21 +MSG_NO_LIFERAY_INSTALLATION=No Liferay Installation Found.
  201.22  ACD_BROWSE=Browse
  201.23  LBL_Portal_Deploy_Dir=Portal Deploy Dir:
  201.24  
  201.25  
  201.26  #Websynergy messages
  201.27 -LBL_WS_PORTAL_SERVER=Project WebSynergy Server
  201.28 -MSG_NO_WEBSYNERGY_INSTALLATION_FOUND=No WebSynergy Installation Found on this Glassfish domain.
  201.29 -DESC_WS=WebSynergy
  201.30 +LBL_WS_PORTAL_SERVER=WebSpace 10.x (Project WebSynergy)
  201.31 +MSG_NO_WEBSYNERGY_INSTALLATION_FOUND=<html><body>No WebSpace Installation Found on this Glassfish domain.\
  201.32 +(OR) WebSpace Server is not configured yet.<br> \
  201.33 +Please start the server for the first time to run WebSpace Configurator. </body></html>
  201.34 +DESC_WS=WebSpace
  201.35  LBL_DIRECTORY_DEPLOYMENT=Directory Deployment Enabled
  201.36 +LBL_AUTO_DEPLOY_DIR_SERVER_NOT_RUNNING=<html><body>Web Space/Liferay Server is not running. Please Start \
  201.37 + <br>the server to set the autodeply location.</body></html>
  201.38 +LBL_RUN_IN_DEVELOPER_MODE=Run In Developer Mode
   202.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   202.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/CustomProperties.java	Sun Jun 26 10:25:14 2011 +0800
   202.3 @@ -0,0 +1,91 @@
   202.4 +/*
   202.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   202.6 + *
   202.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   202.8 + *
   202.9 + * The contents of this file are subject to the terms of either the GNU
  202.10 + * General Public License Version 2 only ("GPL") or the Common
  202.11 + * Development and Distribution License("CDDL") (collectively, the
  202.12 + * "License"). You may not use this file except in compliance with the
  202.13 + * License. You can obtain a copy of the License at
  202.14 + * http://www.netbeans.org/cddl-gplv2.html
  202.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  202.16 + * specific language governing permissions and limitations under the
  202.17 + * License.  When distributing the software, include this License Header
  202.18 + * Notice in each file and include the License file at
  202.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  202.20 + * particular file as subject to the "Classpath" exception as provided
  202.21 + * by Sun in the GPL Version 2 section of the License file that
  202.22 + * accompanied this code. If applicable, add the following below the
  202.23 + * License Header, with the fields enclosed by brackets [] replaced by
  202.24 + * your own identifying information:
  202.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  202.26 + *
  202.27 + * If you wish your version of this file to be governed by only the CDDL
  202.28 + * or only the GPL Version 2, indicate your decision by adding
  202.29 + * "[Contributor] elects to include this software in this distribution
  202.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  202.31 + * single choice of license, a recipient has the option to distribute
  202.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  202.33 + * to extend the choice of license to its licensees as provided above.
  202.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  202.35 + * Version 2 license, then the option applies only if the new code is
  202.36 + * made subject to such option by the copyright holder.
  202.37 + *
  202.38 + * Contributor(s):
  202.39 + *
  202.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  202.41 + */
  202.42 +
  202.43 +package org.netbeans.modules.portalpack.servers.websynergy.ui;
  202.44 +
  202.45 +import java.io.BufferedInputStream;
  202.46 +import java.io.IOException;
  202.47 +import java.io.InputStream;
  202.48 +import java.util.Properties;
  202.49 +import org.openide.util.Exceptions;
  202.50 +
  202.51 +/**
  202.52 + *
  202.53 + * @author satyaranjan
  202.54 + */
  202.55 +public class CustomProperties extends Properties{
  202.56 +
  202.57 +    public void loadProperties(InputStream in) throws IOException {
  202.58 +
  202.59 +
  202.60 +        if(in == null)
  202.61 +            return;
  202.62 +        BufferedInputStream bin = new BufferedInputStream(in);
  202.63 +
  202.64 +        int c;
  202.65 +        try {
  202.66 +
  202.67 +            bin.mark(4);
  202.68 +            c = bin.read();
  202.69 +            if(c != '<') {
  202.70 +                bin.reset();
  202.71 +            }else {
  202.72 +
  202.73 +                c = bin.read();
  202.74 +                while(c != -1 && c != '>') {
  202.75 +                    c = bin.read();
  202.76 +                }
  202.77 +               
  202.78 +                if(c == -1) {
  202.79 +                    bin.reset();
  202.80 +                }
  202.81 +            }
  202.82 +
  202.83 +        } catch (IOException ex) {
  202.84 +            //ex.printStackTrace();
  202.85 +            try {
  202.86 +                bin.reset();
  202.87 +            } catch (IOException ex1) {
  202.88 +                ex1.printStackTrace();
  202.89 +            }
  202.90 +        }
  202.91 +
  202.92 +        load(bin);
  202.93 +    }
  202.94 +}
   203.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/LiferayConfigPanel.form	Fri Jun 10 09:46:37 2011 +0200
   203.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/LiferayConfigPanel.form	Sun Jun 26 10:25:14 2011 +0800
   203.3 @@ -9,6 +9,7 @@
   203.4    <AuxValues>
   203.5      <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
   203.6      <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
   203.7 +    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
   203.8      <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
   203.9      <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
  203.10      <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
  203.11 @@ -20,60 +21,59 @@
  203.12    <Layout>
  203.13      <DimensionLayout dim="0">
  203.14        <Group type="103" groupAlignment="0" attributes="0">
  203.15 -          <Component id="jSeparator1" alignment="0" pref="510" max="32767" attributes="0"/>
  203.16 -          <Group type="102" alignment="0" attributes="0">
  203.17 -              <EmptySpace min="-2" pref="169" max="-2" attributes="0"/>
  203.18 -              <Component id="jLabel1" pref="172" max="32767" attributes="0"/>
  203.19 -              <EmptySpace min="-2" pref="169" max="-2" attributes="1"/>
  203.20 -          </Group>
  203.21 -          <Group type="102" alignment="1" attributes="0">
  203.22 +          <Group type="102" attributes="0">
  203.23                <EmptySpace min="-2" max="-2" attributes="0"/>
  203.24                <Group type="103" groupAlignment="0" attributes="0">
  203.25 -                  <Group type="102" alignment="0" attributes="0">
  203.26 -                      <Component id="jLabel2" pref="118" max="32767" attributes="0"/>
  203.27 -                      <EmptySpace min="-2" max="-2" attributes="1"/>
  203.28 +                  <Group type="102" attributes="0">
  203.29 +                      <Component id="jLabel4" pref="110" max="32767" attributes="0"/>
  203.30 +                      <EmptySpace min="-2" pref="4" max="-2" attributes="1"/>
  203.31                    </Group>
  203.32                    <Group type="102" alignment="0" attributes="0">
  203.33 -                      <Component id="jLabel4" pref="118" max="32767" attributes="0"/>
  203.34 -                      <EmptySpace min="-2" max="-2" attributes="1"/>
  203.35 +                      <Component id="jLabel2" pref="104" max="32767" attributes="0"/>
  203.36 +                      <EmptySpace max="-2" attributes="0"/>
  203.37                    </Group>
  203.38 -                  <Group type="102" alignment="0" attributes="0">
  203.39 -                      <Component id="jLabel6" pref="118" max="32767" attributes="0"/>
  203.40 -                      <EmptySpace min="-2" max="-2" attributes="1"/>
  203.41 -                  </Group>
  203.42 -                  <Group type="102" alignment="0" attributes="0">
  203.43 -                      <Component id="jLabel5" max="32767" attributes="0"/>
  203.44 -                      <EmptySpace min="-2" pref="38" max="-2" attributes="1"/>
  203.45 -                  </Group>
  203.46 -                  <Group type="102" alignment="0" attributes="0">
  203.47 -                      <Component id="jLabel3" pref="118" max="32767" attributes="0"/>
  203.48 -                      <EmptySpace min="-2" max="-2" attributes="1"/>
  203.49 +                  <Group type="102" attributes="0">
  203.50 +                      <Group type="103" groupAlignment="1" attributes="0">
  203.51 +                          <Component id="jLabel5" max="32767" attributes="0"/>
  203.52 +                          <Component id="jLabel3" pref="111" max="32767" attributes="0"/>
  203.53 +                      </Group>
  203.54 +                      <EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
  203.55                    </Group>
  203.56                </Group>
  203.57                <Group type="103" groupAlignment="0" attributes="0">
  203.58 -                  <Component id="hostTf" pref="295" max="32767" attributes="2"/>
  203.59 -                  <Component id="portalDepDirTf" alignment="0" pref="295" max="32767" attributes="0"/>
  203.60 -                  <Component id="autoDeployTf" alignment="0" pref="295" max="32767" attributes="0"/>
  203.61 +                  <Component id="hostTf" alignment="0" pref="313" max="32767" attributes="2"/>
  203.62                    <Group type="102" alignment="0" attributes="0">
  203.63 -                      <Group type="103" groupAlignment="1" attributes="0">
  203.64 -                          <Component id="portletUriTf" alignment="0" pref="208" max="32767" attributes="2"/>
  203.65 -                          <Component id="portalUri" alignment="0" pref="208" max="32767" attributes="2"/>
  203.66 -                      </Group>
  203.67 -                      <EmptySpace min="-2" pref="87" max="-2" attributes="0"/>
  203.68 +                      <Component id="portalUri" min="-2" pref="165" max="-2" attributes="2"/>
  203.69 +                      <EmptySpace min="148" pref="148" max="148" attributes="0"/>
  203.70                    </Group>
  203.71 +                  <Component id="autoDeployTf" alignment="0" pref="313" max="32767" attributes="0"/>
  203.72 +                  <Component id="portalDepDirTf" alignment="0" pref="313" max="32767" attributes="0"/>
  203.73                </Group>
  203.74                <EmptySpace min="-2" max="-2" attributes="0"/>
  203.75 -              <Group type="103" groupAlignment="0" attributes="0">
  203.76 -                  <Component id="browseButton" max="32767" attributes="2"/>
  203.77 -                  <Component id="jButton1" alignment="0" max="32767" attributes="2"/>
  203.78 +              <Group type="103" groupAlignment="0" max="-2" attributes="0">
  203.79 +                  <Component id="portalDeployBrowseButton" linkSize="1" min="0" pref="21" max="32767" attributes="1"/>
  203.80 +                  <Component id="browseButton" linkSize="1" alignment="0" min="-2" pref="21" max="-2" attributes="2"/>
  203.81                </Group>
  203.82 +              <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
  203.83 +              <Component id="getButton" linkSize="1" min="-2" pref="49" max="-2" attributes="0"/>
  203.84 +              <EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
  203.85 +          </Group>
  203.86 +          <Group type="102" alignment="0" attributes="0">
  203.87                <EmptySpace min="-2" max="-2" attributes="0"/>
  203.88 +              <Component id="isDeveloperMode" pref="186" max="32767" attributes="0"/>
  203.89 +              <EmptySpace min="-2" pref="365" max="-2" attributes="0"/>
  203.90            </Group>
  203.91            <Group type="102" alignment="0" attributes="0">
  203.92                <EmptySpace max="-2" attributes="0"/>
  203.93 -              <Component id="directoryDeployment" max="32767" attributes="0"/>
  203.94 -              <EmptySpace min="-2" pref="333" max="-2" attributes="0"/>
  203.95 +              <Component id="directoryDeployment" pref="541" max="32767" attributes="0"/>
  203.96 +              <EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
  203.97            </Group>
  203.98 +          <Group type="102" alignment="0" attributes="0">
  203.99 +              <EmptySpace min="-2" pref="169" max="-2" attributes="0"/>
 203.100 +              <Component id="jLabel1" pref="154" max="32767" attributes="0"/>
 203.101 +              <EmptySpace min="-2" pref="235" max="-2" attributes="0"/>
 203.102 +          </Group>
 203.103 +          <Component id="jSeparator1" alignment="0" pref="558" max="32767" attributes="0"/>
 203.104        </Group>
 203.105      </DimensionLayout>
 203.106      <DimensionLayout dim="1">
 203.107 @@ -83,42 +83,38 @@
 203.108                <Component id="jLabel1" min="-2" pref="14" max="-2" attributes="0"/>
 203.109                <EmptySpace max="-2" attributes="0"/>
 203.110                <Component id="jSeparator1" min="-2" pref="10" max="-2" attributes="0"/>
 203.111 -              <EmptySpace max="-2" attributes="0"/>
 203.112 -              <Group type="103" groupAlignment="1" attributes="0">
 203.113 -                  <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
 203.114 -                  <Component id="hostTf" min="-2" max="-2" attributes="0"/>
 203.115 +              <EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
 203.116 +              <Group type="103" groupAlignment="3" attributes="0">
 203.117 +                  <Component id="hostTf" alignment="3" min="-2" max="-2" attributes="0"/>
 203.118 +                  <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
 203.119                </Group>
 203.120 -              <EmptySpace max="-2" attributes="0"/>
 203.121 -              <Group type="103" groupAlignment="1" attributes="0">
 203.122 -                  <Component id="jLabel4" min="-2" max="-2" attributes="1"/>
 203.123 -                  <Component id="portalUri" min="-2" max="-2" attributes="1"/>
 203.124 -              </Group>
 203.125 -              <EmptySpace max="-2" attributes="0"/>
 203.126 -              <Group type="103" groupAlignment="1" attributes="0">
 203.127 -                  <Component id="jLabel6" min="-2" max="-2" attributes="0"/>
 203.128 -                  <Component id="portletUriTf" min="-2" max="-2" attributes="0"/>
 203.129 +              <EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
 203.130 +              <Group type="103" groupAlignment="3" attributes="0">
 203.131 +                  <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="1"/>
 203.132 +                  <Component id="portalUri" alignment="3" min="-2" max="-2" attributes="1"/>
 203.133                </Group>
 203.134                <EmptySpace max="-2" attributes="0"/>
 203.135                <Group type="103" groupAlignment="0" attributes="0">
 203.136 -                  <Component id="jLabel5" alignment="1" min="-2" max="-2" attributes="0"/>
 203.137 -                  <Group type="102" alignment="0" attributes="0">
 203.138 -                      <Group type="103" groupAlignment="1" attributes="0">
 203.139 -                          <Group type="103" groupAlignment="3" attributes="0">
 203.140 -                              <Component id="autoDeployTf" alignment="3" min="-2" max="-2" attributes="0"/>
 203.141 -                              <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
 203.142 -                          </Group>
 203.143 -                          <Component id="browseButton" min="-2" max="-2" attributes="0"/>
 203.144 -                      </Group>
 203.145 -                      <EmptySpace max="-2" attributes="0"/>
 203.146 -                      <Group type="103" groupAlignment="3" attributes="0">
 203.147 -                          <Component id="portalDepDirTf" alignment="3" min="-2" max="-2" attributes="0"/>
 203.148 -                          <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
 203.149 -                      </Group>
 203.150 +                  <Group type="103" alignment="0" groupAlignment="3" attributes="0">
 203.151 +                      <Component id="browseButton" alignment="3" min="-2" max="-2" attributes="0"/>
 203.152 +                      <Component id="getButton" alignment="3" min="-2" max="-2" attributes="0"/>
 203.153                    </Group>
 203.154 +                  <Group type="103" alignment="0" groupAlignment="3" attributes="0">
 203.155 +                      <Component id="autoDeployTf" alignment="3" min="-2" max="-2" attributes="0"/>
 203.156 +                      <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
 203.157 +                  </Group>
 203.158 +              </Group>
 203.159 +              <EmptySpace max="-2" attributes="0"/>
 203.160 +              <Group type="103" groupAlignment="3" attributes="0">
 203.161 +                  <Component id="portalDeployBrowseButton" alignment="3" min="-2" max="-2" attributes="0"/>
 203.162 +                  <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
 203.163 +                  <Component id="portalDepDirTf" alignment="3" min="-2" max="-2" attributes="0"/>
 203.164                </Group>
 203.165                <EmptySpace type="unrelated" max="-2" attributes="0"/>
 203.166                <Component id="directoryDeployment" min="-2" max="-2" attributes="0"/>
 203.167 -              <EmptySpace pref="14" max="32767" attributes="0"/>
 203.168 +              <EmptySpace max="-2" attributes="0"/>
 203.169 +              <Component id="isDeveloperMode" min="-2" max="-2" attributes="0"/>
 203.170 +              <EmptySpace max="32767" attributes="0"/>
 203.171            </Group>
 203.172        </Group>
 203.173      </DimensionLayout>
 203.174 @@ -157,18 +153,6 @@
 203.175          <EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="hostTfFocusLost"/>
 203.176        </Events>
 203.177      </Component>
 203.178 -    <Component class="javax.swing.JLabel" name="jLabel6">
 203.179 -      <Properties>
 203.180 -        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
 203.181 -          <ComponentRef name="portletUriTf"/>
 203.182 -        </Property>
 203.183 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 203.184 -          <ResourceString bundle="org/netbeans/modules/portalpack/servers/websynergy/ui/Bundle.properties" key="LBL_PORTLET_URI" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
 203.185 -        </Property>
 203.186 -      </Properties>
 203.187 -    </Component>
 203.188 -    <Component class="javax.swing.JTextField" name="portletUriTf">
 203.189 -    </Component>
 203.190      <Component class="javax.swing.JLabel" name="jLabel3">
 203.191        <Properties>
 203.192          <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
 203.193 @@ -205,12 +189,15 @@
 203.194      </Component>
 203.195      <Component class="javax.swing.JTextField" name="portalDepDirTf">
 203.196      </Component>
 203.197 -    <Component class="javax.swing.JButton" name="jButton1">
 203.198 +    <Component class="javax.swing.JButton" name="portalDeployBrowseButton">
 203.199        <Properties>
 203.200          <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 203.201            <ResourceString bundle="org/netbeans/modules/portalpack/servers/websynergy/ui/Bundle.properties" key="LBL_BrowseButton" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 203.202          </Property>
 203.203        </Properties>
 203.204 +      <Events>
 203.205 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="portalDeployBrowseButtonActionPerformed"/>
 203.206 +      </Events>
 203.207      </Component>
 203.208      <Component class="javax.swing.JCheckBox" name="directoryDeployment">
 203.209        <Properties>
 203.210 @@ -219,5 +206,21 @@
 203.211          </Property>
 203.212        </Properties>
 203.213      </Component>
 203.214 +    <Component class="javax.swing.JCheckBox" name="isDeveloperMode">
 203.215 +      <Properties>
 203.216 +        <Property name="selected" type="boolean" value="true"/>
 203.217 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 203.218 +          <ResourceString bundle="org/netbeans/modules/portalpack/servers/websynergy/ui/Bundle.properties" key="LBL_RUN_IN_DEVELOPER_MODE" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 203.219 +        </Property>
 203.220 +      </Properties>
 203.221 +    </Component>
 203.222 +    <Component class="javax.swing.JButton" name="getButton">
 203.223 +      <Properties>
 203.224 +        <Property name="text" type="java.lang.String" value="Get"/>
 203.225 +      </Properties>
 203.226 +      <Events>
 203.227 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="getButtonActionPerformed"/>
 203.228 +      </Events>
 203.229 +    </Component>
 203.230    </SubComponents>
 203.231  </Form>
   204.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/LiferayConfigPanel.java	Fri Jun 10 09:46:37 2011 +0200
   204.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/LiferayConfigPanel.java	Sun Jun 26 10:25:14 2011 +0800
   204.3 @@ -19,6 +19,9 @@
   204.4  package org.netbeans.modules.portalpack.servers.websynergy.ui;
   204.5  
   204.6  import java.io.File;
   204.7 +import java.lang.reflect.Method;
   204.8 +import java.net.URL;
   204.9 +import java.net.URLClassLoader;
  204.10  import javax.swing.JFileChooser;
  204.11  import javax.swing.SwingUtilities;
  204.12  import javax.swing.event.DocumentEvent;
  204.13 @@ -30,6 +33,11 @@
  204.14  import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.tomcat.TomcatConstant;
  204.15  import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  204.16  import org.netbeans.modules.portalpack.servers.websynergy.common.LiferayConstants;
  204.17 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibrariesFactory;
  204.18 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver.SunAppServerJEELibraries;
  204.19 +import org.netbeans.modules.portalpack.servers.websynergy.impl.LiferayHelper;
  204.20 +import org.openide.DialogDisplayer;
  204.21 +import org.openide.NotifyDescriptor;
  204.22  import org.openide.WizardDescriptor;
  204.23  import org.openide.util.NbBundle;
  204.24  
  204.25 @@ -40,7 +48,9 @@
  204.26  public class LiferayConfigPanel extends ConfigPanel implements DocumentListener {
  204.27  
  204.28      private String psVersion;
  204.29 -
  204.30 +    private int lrVersion = 1;
  204.31 +    private PSConfigObject psObject;
  204.32 +    
  204.33      /** Creates new form LifeRayConfigPanel */
  204.34      public LiferayConfigPanel(String psVersion) {
  204.35          this.psVersion = psVersion;
  204.36 @@ -48,7 +58,6 @@
  204.37          initData();
  204.38  
  204.39          portalUri.getDocument().addDocumentListener(this);
  204.40 -        portletUriTf.getDocument().addDocumentListener(this);
  204.41          autoDeployTf.getDocument().addDocumentListener(this);
  204.42          portalDepDirTf.getDocument().addDocumentListener(this);
  204.43      //adminConsoleUriTf.getDocument().addDocumentListener(this);
  204.44 @@ -69,15 +78,15 @@
  204.45          jSeparator1 = new javax.swing.JSeparator();
  204.46          jLabel2 = new javax.swing.JLabel();
  204.47          hostTf = new javax.swing.JTextField();
  204.48 -        jLabel6 = new javax.swing.JLabel();
  204.49 -        portletUriTf = new javax.swing.JTextField();
  204.50          jLabel3 = new javax.swing.JLabel();
  204.51          autoDeployTf = new javax.swing.JTextField();
  204.52          browseButton = new javax.swing.JButton();
  204.53          jLabel5 = new javax.swing.JLabel();
  204.54          portalDepDirTf = new javax.swing.JTextField();
  204.55 -        jButton1 = new javax.swing.JButton();
  204.56 +        portalDeployBrowseButton = new javax.swing.JButton();
  204.57          directoryDeployment = new javax.swing.JCheckBox();
  204.58 +        isDeveloperMode = new javax.swing.JCheckBox();
  204.59 +        getButton = new javax.swing.JButton();
  204.60  
  204.61          setFont(new java.awt.Font("Tahoma", 1, 11));
  204.62  
  204.63 @@ -94,9 +103,6 @@
  204.64              }
  204.65          });
  204.66  
  204.67 -        jLabel6.setLabelFor(portletUriTf);
  204.68 -        jLabel6.setText(org.openide.util.NbBundle.getBundle(LiferayConfigPanel.class).getString("LBL_PORTLET_URI")); // NOI18N
  204.69 -
  204.70          jLabel3.setLabelFor(autoDeployTf);
  204.71          jLabel3.setText(org.openide.util.NbBundle.getMessage(LiferayConfigPanel.class, "LBL_Auto_Deploy_Dir")); // NOI18N
  204.72  
  204.73 @@ -109,56 +115,74 @@
  204.74  
  204.75          jLabel5.setText(org.openide.util.NbBundle.getMessage(LiferayConfigPanel.class, "LBL_Portal_Deploy_Dir")); // NOI18N
  204.76  
  204.77 -        jButton1.setText(org.openide.util.NbBundle.getMessage(LiferayConfigPanel.class, "LBL_BrowseButton")); // NOI18N
  204.78 +        portalDeployBrowseButton.setText(org.openide.util.NbBundle.getMessage(LiferayConfigPanel.class, "LBL_BrowseButton")); // NOI18N
  204.79 +        portalDeployBrowseButton.addActionListener(new java.awt.event.ActionListener() {
  204.80 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  204.81 +                portalDeployBrowseButtonActionPerformed(evt);
  204.82 +            }
  204.83 +        });
  204.84  
  204.85          directoryDeployment.setText(org.openide.util.NbBundle.getMessage(LiferayConfigPanel.class, "LBL_DIRECTORY_DEPLOYMENT")); // NOI18N
  204.86  
  204.87 +        isDeveloperMode.setSelected(true);
  204.88 +        isDeveloperMode.setText(org.openide.util.NbBundle.getMessage(LiferayConfigPanel.class, "LBL_RUN_IN_DEVELOPER_MODE")); // NOI18N
  204.89 +
  204.90 +        getButton.setText("Get");
  204.91 +        getButton.addActionListener(new java.awt.event.ActionListener() {
  204.92 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  204.93 +                getButtonActionPerformed(evt);
  204.94 +            }
  204.95 +        });
  204.96 +
  204.97          org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
  204.98          this.setLayout(layout);
  204.99          layout.setHorizontalGroup(
 204.100              layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 204.101 -            .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 510, Short.MAX_VALUE)
 204.102              .add(layout.createSequentialGroup()
 204.103 -                .add(169, 169, 169)
 204.104 -                .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
 204.105 -                .add(169, 169, 169))
 204.106 -            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
 204.107                  .addContainerGap()
 204.108                  .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 204.109                      .add(layout.createSequentialGroup()
 204.110 -                        .add(jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
 204.111 +                        .add(jLabel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)
 204.112 +                        .add(4, 4, 4))
 204.113 +                    .add(layout.createSequentialGroup()
 204.114 +                        .add(jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)
 204.115                          .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
 204.116                      .add(layout.createSequentialGroup()
 204.117 -                        .add(jLabel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
 204.118 -                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
 204.119 +                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 204.120 +                            .add(jLabel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 204.121 +                            .add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE))
 204.122 +                        .add(3, 3, 3)))
 204.123 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 204.124 +                    .add(hostTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 313, Short.MAX_VALUE)
 204.125                      .add(layout.createSequentialGroup()
 204.126 -                        .add(jLabel6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
 204.127 -                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
 204.128 -                    .add(layout.createSequentialGroup()
 204.129 -                        .add(jLabel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 204.130 -                        .add(38, 38, 38))
 204.131 -                    .add(layout.createSequentialGroup()
 204.132 -                        .add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
 204.133 -                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)))
 204.134 -                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 204.135 -                    .add(hostTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
 204.136 -                    .add(portalDepDirTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
 204.137 -                    .add(autoDeployTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
 204.138 -                    .add(layout.createSequentialGroup()
 204.139 -                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 204.140 -                            .add(org.jdesktop.layout.GroupLayout.LEADING, portletUriTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE)
 204.141 -                            .add(org.jdesktop.layout.GroupLayout.LEADING, portalUri, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE))
 204.142 -                        .add(87, 87, 87)))
 204.143 +                        .add(portalUri, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 165, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 204.144 +                        .add(148, 148, 148))
 204.145 +                    .add(autoDeployTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 313, Short.MAX_VALUE)
 204.146 +                    .add(portalDepDirTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 313, Short.MAX_VALUE))
 204.147                  .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 204.148 -                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 204.149 -                    .add(browseButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 204.150 -                    .add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 204.151 -                .addContainerGap())
 204.152 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
 204.153 +                    .add(portalDeployBrowseButton, 0, 21, Short.MAX_VALUE)
 204.154 +                    .add(browseButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 204.155 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
 204.156 +                .add(getButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 49, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 204.157 +                .add(14, 14, 14))
 204.158              .add(layout.createSequentialGroup()
 204.159                  .addContainerGap()
 204.160 -                .add(directoryDeployment, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 204.161 -                .add(333, 333, 333))
 204.162 +                .add(isDeveloperMode, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE)
 204.163 +                .add(365, 365, 365))
 204.164 +            .add(layout.createSequentialGroup()
 204.165 +                .addContainerGap()
 204.166 +                .add(directoryDeployment, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 522, Short.MAX_VALUE)
 204.167 +                .add(10, 10, 10))
 204.168 +            .add(layout.createSequentialGroup()
 204.169 +                .add(169, 169, 169)
 204.170 +                .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE)
 204.171 +                .add(235, 235, 235))
 204.172 +            .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 538, Short.MAX_VALUE)
 204.173          );
 204.174 +
 204.175 +        layout.linkSize(new java.awt.Component[] {browseButton, getButton, portalDeployBrowseButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
 204.176 +
 204.177          layout.setVerticalGroup(
 204.178              layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 204.179              .add(layout.createSequentialGroup()
 204.180 @@ -166,34 +190,32 @@
 204.181                  .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 204.182                  .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 204.183                  .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 204.184 -                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 204.185 -                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 204.186 -                    .add(jLabel2)
 204.187 -                    .add(hostTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 204.188 -                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 204.189 -                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 204.190 +                .add(12, 12, 12)
 204.191 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 204.192 +                    .add(hostTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 204.193 +                    .add(jLabel2))
 204.194 +                .add(12, 12, 12)
 204.195 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 204.196                      .add(jLabel4)
 204.197                      .add(portalUri, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 204.198                  .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 204.199 -                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 204.200 -                    .add(jLabel6)
 204.201 -                    .add(portletUriTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 204.202 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 204.203 +                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 204.204 +                        .add(browseButton)
 204.205 +                        .add(getButton))
 204.206 +                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 204.207 +                        .add(autoDeployTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 204.208 +                        .add(jLabel3)))
 204.209                  .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 204.210 -                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 204.211 -                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel5)
 204.212 -                    .add(layout.createSequentialGroup()
 204.213 -                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 204.214 -                            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 204.215 -                                .add(autoDeployTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 204.216 -                                .add(jLabel3))
 204.217 -                            .add(browseButton))
 204.218 -                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 204.219 -                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 204.220 -                            .add(portalDepDirTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 204.221 -                            .add(jButton1))))
 204.222 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 204.223 +                    .add(portalDeployBrowseButton)
 204.224 +                    .add(jLabel5)
 204.225 +                    .add(portalDepDirTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 204.226                  .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
 204.227                  .add(directoryDeployment)
 204.228 -                .addContainerGap(14, Short.MAX_VALUE))
 204.229 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 204.230 +                .add(isDeveloperMode)
 204.231 +                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 204.232          );
 204.233  
 204.234          browseButton.getAccessibleContext().setAccessibleDescription("null");
 204.235 @@ -212,53 +234,102 @@
 204.236      }
 204.237  }//GEN-LAST:event_browseButtonActionPerformed
 204.238  
 204.239 +private void portalDeployBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_portalDeployBrowseButtonActionPerformed
 204.240 +// TODO add your handling code here:
 204.241 +    String portalDeployDirLoc = browseAutoDeployLocation();
 204.242 +    if (portalDeployDirLoc != null) {
 204.243 +        portalDepDirTf.setText(portalDeployDirLoc);
 204.244 +    }
 204.245 +}//GEN-LAST:event_portalDeployBrowseButtonActionPerformed
 204.246 +
 204.247 +private void getButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_getButtonActionPerformed
 204.248 +    String autoDeployLoc = LiferayHelper.getAutoDeployDirectory(psObject, Boolean.TRUE);
 204.249 +    if (autoDeployLoc == null) {
 204.250 +        DialogDisplayer.getDefault().notify(
 204.251 +                   new NotifyDescriptor.Message(NbBundle.getMessage(
 204.252 +                   LiferayConfigPanel.class, "LBL_AUTO_DEPLOY_DIR_SERVER_NOT_RUNNING")));
 204.253 +        return;
 204.254 +    } else {
 204.255 +        autoDeployTf.setText(autoDeployLoc);
 204.256 +    }
 204.257 +}//GEN-LAST:event_getButtonActionPerformed
 204.258 +
 204.259      // Variables declaration - do not modify//GEN-BEGIN:variables
 204.260      private javax.swing.JTextField autoDeployTf;
 204.261      private javax.swing.JButton browseButton;
 204.262      private javax.swing.JCheckBox directoryDeployment;
 204.263 +    private javax.swing.JButton getButton;
 204.264      private javax.swing.JTextField hostTf;
 204.265 -    private javax.swing.JButton jButton1;
 204.266 +    private javax.swing.JCheckBox isDeveloperMode;
 204.267      private javax.swing.JLabel jLabel1;
 204.268      private javax.swing.JLabel jLabel2;
 204.269      private javax.swing.JLabel jLabel3;
 204.270      private javax.swing.JLabel jLabel4;
 204.271      private javax.swing.JLabel jLabel5;
 204.272 -    private javax.swing.JLabel jLabel6;
 204.273      private javax.swing.JSeparator jSeparator1;
 204.274      private javax.swing.JTextField portalDepDirTf;
 204.275 +    private javax.swing.JButton portalDeployBrowseButton;
 204.276      private javax.swing.JTextField portalUri;
 204.277 -    private javax.swing.JTextField portletUriTf;
 204.278      // End of variables declaration//GEN-END:variables
 204.279  
 204.280      public void initData() {
 204.281 -        portalUri.setText("/portal");
 204.282 -        portletUriTf.setText("/portal");
 204.283 +        portalUri.setText("/");
 204.284          hostTf.setText("localhost");
 204.285  
 204.286      }
 204.287  
 204.288      public void populateDataForCustomizer(PSConfigObject object) {
 204.289 -
 204.290 +        psObject = object;
 204.291          //hostTf.setText(object.getHost());
 204.292          //portTf.setText(object.getPort());
 204.293          portalUri.setText(object.getPortalUri());
 204.294  
 204.295          hostTf.setText(object.getHost());
 204.296          // adminConsoleUriTf.setText(object.getProperty(LifeRayConstants.ADMIN_CONSOLE_URI));
 204.297 -        portletUriTf.setText(object.getProperty(LiferayConstants.PORTLET_URI));
 204.298          autoDeployTf.setText(object.getProperty(LiferayConstants.AUTO_DEPLOY_DIR));
 204.299          portalDepDirTf.setText(object.getProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR));
 204.300  
 204.301          hostTf.setEnabled(false);
 204.302 -        directoryDeployment.setSelected(object.isDirectoryDeployment());
 204.303  
 204.304 +		//added for JBOSS
 204.305 +		if(ServerConstants.JBOSS_5_X.equals(object.getServerType())) {
 204.306 +            directoryDeployment.setEnabled(false);
 204.307 +            directoryDeployment.setSelected(false);
 204.308 +        } else {
 204.309 +			directoryDeployment.setEnabled(true);
 204.310 +			directoryDeployment.setSelected(object.isDirectoryDeployment());
 204.311 +		}
 204.312 +        
 204.313 +        String lv = object.getProperty(LiferayConstants.LR_VERSION);
 204.314 +        
 204.315 +        try{
 204.316 +            if(lv != null) {
 204.317 +                lrVersion = Integer.parseInt(lv);
 204.318 +            }
 204.319 +        }catch(Exception e) {
 204.320 +            
 204.321 +        }
 204.322 +        String serverType = object.getServerType();
 204.323 +        if ( serverType != null && serverType.equals(ServerConstants.SUN_APP_SERVER_9)) {
 204.324 +            isDeveloperMode.setVisible(false);
 204.325 +        }
 204.326 +        if(lrVersion < 5200) {
 204.327 +           //isDeveloperMode.setVisible(false);
 204.328 +        } else {
 204.329 +
 204.330 +            if(Boolean.valueOf(object.getProperty(LiferayConstants.LR_DEVELOPER_MODE))) {
 204.331 +                isDeveloperMode.setSelected(true);
 204.332 +            } else {
 204.333 +                isDeveloperMode.setSelected(false);
 204.334 +            }
 204.335 +        }
 204.336 +   
 204.337      }
 204.338  
 204.339      public void read(org.openide.WizardDescriptor wizardDescriptor) {
 204.340  
 204.341          WizardPropertyReader reader = new WizardPropertyReader(wizardDescriptor);
 204.342  
 204.343 -        // if (autoDeployDir == null || autoDeployDir.trim().length() == 0) {
 204.344          autoDeployTf.setText(System.getProperty("user.home") + File.separator + "liferay" +
 204.345                  File.separator + "deploy");
 204.346  
 204.347 @@ -267,64 +338,138 @@
 204.348  
 204.349          if (serverType.equals(ServerConstants.SUN_APP_SERVER_9)) {
 204.350  
 204.351 -            String domainDir = reader.getDomainDir();
 204.352 -            String version = getGlassFishVersion(reader.getServerHome());
 204.353 +            String deployDir = JEEServerLibrariesFactory.getJEEServerLibraries(serverType).getWebAppInstallDirectory(reader)
 204.354 +                        + File.separator + "liferay-portal";
 204.355 +            portalDepDirTf.setText(deployDir);
 204.356 +            
 204.357 +            String portalKernel = JEEServerLibrariesFactory.getJEEServerLibraries(serverType).getPortalServerLibraryLocation(reader) +
 204.358 +                    File.separator + "portal-kernel.jar";
 204.359  
 204.360 -            if (version.equals(SunAppServerConstants.GLASSFISH_V2)) {
 204.361 -                String deployDir = domainDir + File.separator +
 204.362 -                        "applications" + File.separator +
 204.363 -                        "j2ee-modules" + File.separator + "liferay-portal";
 204.364 -                portalDepDirTf.setText(deployDir);
 204.365 -            } else {
 204.366 -                String deployDir = domainDir + File.separator +
 204.367 -                        "applications" + File.separator +
 204.368 -                        "liferay-portal";
 204.369 -                portalDepDirTf.setText(deployDir);
 204.370 +            String portalService = JEEServerLibrariesFactory.getJEEServerLibraries(serverType).getPortalServerLibraryLocation(reader) +
 204.371 +                    File.separator + "portal-service.jar";
 204.372 +            
 204.373 +            lrVersion = getLiferayVersion(new String[]{portalKernel,portalService});
 204.374 +           // if(lrVersion != 1)
 204.375 +           //     lrVersionLabel.setText("(Build: " + lrVersion + ")");
 204.376 +            
 204.377 +            if(lrVersion == 5200) {
 204.378 +                String autoDepDir = get5200AutoDeployDirectory(reader, portalDepDirTf.getText(), portalKernel);
 204.379 +                if(autoDepDir != null)
 204.380 +                    autoDeployTf.setText(autoDepDir);
 204.381              }
 204.382 +            
 204.383 +            if(lrVersion > 5200) {
 204.384 +                autoDeployTf.setText("");
 204.385 +                autoDeployTf.setEnabled(false);
 204.386 +                browseButton.setEnabled(false);
 204.387 +            }
 204.388 +            
 204.389 +            isDeveloperMode.setVisible(false);
 204.390  
 204.391          } else if (serverType.equals(ServerConstants.TOMCAT_5_X)
 204.392                          || serverType.equals(ServerConstants.TOMCAT_6_X)) {
 204.393  
 204.394 -            String tomcatHome = reader.getProperty(TomcatConstant.CATALINA_HOME);
 204.395 +            String deployDir = JEEServerLibrariesFactory.getJEEServerLibraries(serverType).getWebAppInstallDirectory(reader)
 204.396 +                                    + File.separator + "ROOT";
 204.397 +            portalDepDirTf.setText(deployDir);
 204.398 +            
 204.399 +            String portalKernel = JEEServerLibrariesFactory.getJEEServerLibraries(serverType).getPortalServerLibraryLocation(reader) 
 204.400 +                    + File.separator + "portal-kernel.jar";
 204.401 +            String portalService = JEEServerLibrariesFactory.getJEEServerLibraries(serverType).getPortalServerLibraryLocation(reader) +
 204.402 +                    File.separator + "portal-service.jar";
 204.403 +            
 204.404 +            lrVersion = getLiferayVersion(new String[]{portalKernel,portalService});
 204.405 +            //if(lrVersion != 1)
 204.406 +            //    lrVersionLabel.setText("(Build: " + lrVersion + ")");
 204.407 +            
 204.408 +            if(lrVersion == 5200) {
 204.409 +                String autoDepDir = get5200AutoDeployDirectory(reader, portalDepDirTf.getText(), portalKernel);
 204.410 +                if(autoDepDir != null)
 204.411 +                    autoDeployTf.setText(autoDepDir);
 204.412 +            }
 204.413 +            
 204.414 +            if(lrVersion > 5200) {
 204.415 +                autoDeployTf.setText("");
 204.416 +                autoDeployTf.setEnabled(false);
 204.417 +                browseButton.setEnabled(false);
 204.418 +                getButton.setEnabled(false);
 204.419 +            }
 204.420 +            if(lrVersion < 5200) {
 204.421  
 204.422 -            String deployDir = tomcatHome + File.separator + "webapps" + File.separator + "ROOT";
 204.423 +               // isDeveloperMode.setVisible(false);
 204.424 +            }
 204.425 +        } else if(serverType.equals(ServerConstants.JBOSS_5_X)) {
 204.426 +            String deployDir = JEEServerLibrariesFactory.getJEEServerLibraries(serverType).getWebAppInstallDirectory(reader)
 204.427 +                                    + File.separator + "ROOT.war";
 204.428              portalDepDirTf.setText(deployDir);
 204.429 +
 204.430 +            String portalKernel = JEEServerLibrariesFactory.getJEEServerLibraries(serverType).getPortalServerLibraryLocation(reader)
 204.431 +                    + File.separator + "portal-kernel.jar";;
 204.432 +
 204.433 +            String portalService = JEEServerLibrariesFactory.getJEEServerLibraries(serverType).getPortalServerLibraryLocation(reader) +
 204.434 +                    File.separator + "portal-service.jar";
 204.435 +
 204.436 +            lrVersion = getLiferayVersion(new String[]{portalKernel, portalService});
 204.437 +
 204.438 +            if(lrVersion > 5200) {
 204.439 +                autoDeployTf.setText("");
 204.440 +                autoDeployTf.setEnabled(false);
 204.441 +                browseButton.setEnabled(false);
 204.442 +                getButton.setEnabled(false);
 204.443 +            }
 204.444 +            if(lrVersion < 5200) {
 204.445 +              //  isDeveloperMode.setVisible(false);
 204.446 +            }
 204.447          }
 204.448  
 204.449 -    }
 204.450 -
 204.451 -    private String getGlassFishVersion(String glassfishHome) {
 204.452 -
 204.453 -        File javaeeFile = new File(glassfishHome + File.separator + "lib" + File.separator + "javaee.jar");
 204.454 -        File module = new File(glassfishHome + File.separator + "modules");
 204.455 -
 204.456 -        if (!javaeeFile.exists() && module.exists()) {
 204.457 -            return SunAppServerConstants.GLASSFISH_V3;
 204.458 +		if(serverType.equals(ServerConstants.JBOSS_5_X)) {
 204.459 +            directoryDeployment.setSelected(false);
 204.460 +            directoryDeployment.setEnabled(false);
 204.461 +        } else {
 204.462 +            directoryDeployment.setEnabled(true);
 204.463          }
 204.464  
 204.465 -        return SunAppServerConstants.GLASSFISH_V2;
 204.466 -
 204.467      }
 204.468  
 204.469      public void store(org.openide.WizardDescriptor d) {
 204.470  
 204.471          WizardPropertyReader wr = new WizardPropertyReader(d);
 204.472 -        wr.setAdminUser("admin");
 204.473 -        wr.setAdminPassWord("adminadmin");
 204.474 -        //wr.setPort(portTf.getText());
 204.475 -        //wr.setAdminPort(portTf.getText());
 204.476 +        ///wr.setAdminUser("admin");
 204.477 +        ///wr.setAdminPassWord("adminadmin");
 204.478          wr.setRemote(false);
 204.479          wr.setPortalUri(portalUri.getText());
 204.480          wr.setHost(hostTf.getText());
 204.481 -//        wr.setProperty(LifeRayConstants.ADMIN_CONSOLE_URI,adminConsoleUriTf.getText());
 204.482 -        wr.setProperty(LiferayConstants.PORTLET_URI, portletUriTf.getText());
 204.483          wr.setProperty(LiferayConstants.AUTO_DEPLOY_DIR, autoDeployTf.getText());
 204.484          wr.setProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR, portalDepDirTf.getText());
 204.485          wr.setDirectoryDeployment(directoryDeployment.isSelected());
 204.486      //  wr.setPortalUri("/pcdriver");
 204.487          
 204.488 -        String gf_version = getGlassFishVersion(wr.getServerHome());
 204.489 -        wr.setProperty(SunAppServerConstants.GLASSFISH_VERSON, gf_version);
 204.490 +        if(wr.getServerType() != null && 
 204.491 +                wr.getServerType().equals(ServerConstants.SUN_APP_SERVER_9)) {
 204.492 +            String gf_version = SunAppServerJEELibraries.getGlassFishVersion(wr.getServerHome());
 204.493 +            wr.setProperty(SunAppServerConstants.GLASSFISH_VERSON, gf_version);
 204.494 +        }
 204.495 +        
 204.496 +        //if(wr.getServerType() != null) //don't do anything when in customize mode
 204.497 +        wr.setProperty(LiferayConstants.LR_VERSION, String.valueOf(lrVersion));
 204.498 + 
 204.499 +		PortalEXTModifier.createDeveloperProperties(wr.getProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR));
 204.500 +            if(isDeveloperMode.isSelected()) {
 204.501 +                //For Glassfish
 204.502 +                if(wr.getServerType() != null &&
 204.503 +                    wr.getServerType().equals(ServerConstants.SUN_APP_SERVER_9)) {
 204.504 +                    PortalEXTModifier.setDeveloperMode(
 204.505 +                            wr.getProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR));
 204.506 +                    wr.setProperty(LiferayConstants.LR_DEVELOPER_MODE, "true");
 204.507 +                } else {
 204.508 +                   // wr.setEnvProperties("JAVA_OPTS=\"-Dexternal-properties=portal-developer.properties\"");
 204.509 +                    wr.setEnvProperties("JAVA_OPTS=-Dexternal-properties=portal-developer.properties");
 204.510 +                    wr.setProperty(LiferayConstants.LR_DEVELOPER_MODE, "true");
 204.511 +                }
 204.512 +            } else {
 204.513 +                wr.setEnvProperties(null);
 204.514 +                wr.setProperty(LiferayConstants.LR_DEVELOPER_MODE, "false");
 204.515 +            }
 204.516      }
 204.517  
 204.518      public boolean validate(Object wizardDescriptor) {
 204.519 @@ -333,45 +478,25 @@
 204.520          }
 204.521          WizardPropertyReader wr = new WizardPropertyReader(((WizardDescriptor) wizardDescriptor));
 204.522          
 204.523 -        String domainDir = wr.getDomainDir();
 204.524 -        String serverType = wr.getServerType();
 204.525 -        
 204.526 -        if (serverType.equals(ServerConstants.SUN_APP_SERVER_9)) {
 204.527 +        File file = new File(JEEServerLibrariesFactory.getJEEServerLibraries(wr.getServerType()).getPortalServerLibraryLocation(wr)+ File.separator + "portal-service.jar");
 204.528 +        if (!file.exists()) {
 204.529 +            String msg = NbBundle.getMessage(LiferayConfigPanel.class, "MSG_NO_LIFERAY_INSTALLATION");
 204.530 +            
 204.531 +            if (wr.getServerType().equals(ServerConstants.SUN_APP_SERVER_9)) {
 204.532 +                msg = NbBundle.getMessage(LiferayConfigPanel.class, "MSG_NO_LIFERAY_INSTALLATION_FOUND");
 204.533 +            } else if(wr.getServerType().equals(ServerConstants.TOMCAT_5_X) ||
 204.534 +                       wr.getServerType().equals(ServerConstants.TOMCAT_6_X)){
 204.535 +                 msg = NbBundle.getMessage(LiferayConfigPanel.class, "MSG_NO_LIFERAY_INSTALLATION_FOUND_ON_TOMCAT");
 204.536 +            }
 204.537 +            
 204.538 +            setErrorMessage(msg);
 204.539 +            autoDeployTf.setText("");
 204.540 +            return false;
 204.541  
 204.542 -            File file = new File(domainDir + File.separator + "lib" + File.separator + "portal-service.jar");
 204.543 -            if (!file.exists()) {
 204.544 -                setErrorMessage(NbBundle.getMessage(LiferayConfigPanel.class, "MSG_NO_LIFERAY_INSTALLATION_FOUND"));
 204.545 -                autoDeployTf.setText("");
 204.546 -                return false;
 204.547 -
 204.548 -            }
 204.549 -        } else if (serverType.equals(ServerConstants.TOMCAT_5_X)) {
 204.550 -
 204.551 -            File file = new File(wr.getProperty(TomcatConstant.CATALINA_HOME) + File.separator +
 204.552 -                    "common" + File.separator +
 204.553 -                    "lib" + File.separator +
 204.554 -                    "ext" + File.separator +
 204.555 -                    "portal-service.jar");
 204.556 -            if (!file.exists()) {
 204.557 -                setErrorMessage(NbBundle.getMessage(LiferayConfigPanel.class, "MSG_NO_LIFERAY_INSTALLATION_FOUND_ON_TOMCAT"));
 204.558 -                autoDeployTf.setText("");
 204.559 -                return false;
 204.560 -            }
 204.561 -        } else if (serverType.equals(ServerConstants.TOMCAT_6_X)) {
 204.562 -            
 204.563 -            File file = new File(wr.getProperty(TomcatConstant.CATALINA_HOME) + File.separator +
 204.564 -                    "lib" + File.separator +
 204.565 -                    "ext" + File.separator +
 204.566 -                    "portal-service.jar");
 204.567 -            if (!file.exists()) {
 204.568 -                setErrorMessage(NbBundle.getMessage(LiferayConfigPanel.class, "MSG_NO_LIFERAY_INSTALLATION_FOUND_ON_TOMCAT"));
 204.569 -                autoDeployTf.setText("");
 204.570 -                return false;
 204.571 -            }
 204.572          }
 204.573  
 204.574          String autoDeployDir = autoDeployTf.getText();
 204.575 -        if (autoDeployDir == null || autoDeployDir.trim().length() == 0) {
 204.576 +        if ((autoDeployDir == null || autoDeployDir.trim().length() == 0) && lrVersion <= 5200) {
 204.577              setErrorMessage(NbBundle.getMessage(LiferayConfigPanel.class, "MSG_INVALID_AUTODEPLOY_DIR"));
 204.578              return false;
 204.579          }
 204.580 @@ -388,12 +513,6 @@
 204.581              return false;
 204.582          }
 204.583  
 204.584 -        String portletUriString = portletUriTf.getText();
 204.585 -        if (portletUriString == null || portletUriString.trim().length() == 0) {
 204.586 -            setErrorMessage(NbBundle.getMessage(LiferayConfigPanel.class, "MSG_NOT_A_VALID_PORTLET_URI"));
 204.587 -            return false;
 204.588 -        }
 204.589 -
 204.590          String host = hostTf.getText();
 204.591          if (host == null || host.trim().length() == 0) {
 204.592              setErrorMessage(NbBundle.getMessage(LiferayConfigPanel.class, "MSG_NOT_A_VALID_HOST"));
 204.593 @@ -408,7 +527,7 @@
 204.594          String autoDeployLocation = null;
 204.595          JFileChooser chooser = getJFileChooser();
 204.596          int returnValue = chooser.showDialog(SwingUtilities.getWindowAncestor(this),
 204.597 -                NbBundle.getMessage(LiferayConfigPanel.class, "LBL_BrowseButton")); //NOI18N
 204.598 +                NbBundle.getMessage(LiferayConfigPanel.class, "LBL_ChooserName")); //NOI18N
 204.599  
 204.600          if (returnValue == JFileChooser.APPROVE_OPTION) {
 204.601              autoDeployLocation = chooser.getSelectedFile().getAbsolutePath();
 204.602 @@ -444,6 +563,43 @@
 204.603      public String getDescription() {
 204.604          return NbBundle.getMessage(LiferayConfigPanel.class, "DESC_LIFE_RAY");
 204.605      }
 204.606 +    
 204.607 +    private int getLiferayVersion(String[] portalJars) {
 204.608 +        
 204.609 +        try{
 204.610 +
 204.611 +            URL[] urls = new URL[portalJars.length];
 204.612 +
 204.613 +            for(int i=0;i<portalJars.length;i++) {
 204.614 +                urls[i] = new File(portalJars[i]).toURI().toURL();
 204.615 +            }
 204.616 +
 204.617 +            URLClassLoader loader = new URLClassLoader(
 204.618 +                    urls);
 204.619 +
 204.620 +            Class releaseClass = loader.loadClass("com.liferay.portal.kernel.util.ReleaseInfo");
 204.621 +            Method gV = releaseClass.getMethod("getBuildNumber");
 204.622 +            Integer version = (Integer)gV.invoke(null,null);
 204.623 +            return version.intValue();
 204.624 +        }catch(Exception e) {
 204.625 +            return 1;
 204.626 +        }           	
 204.627 +    }
 204.628 +    
 204.629 +    private static synchronized String get5200AutoDeployDirectory(WizardPropertyReader reader,
 204.630 +                            String portalInstallDir, String portalKernelJar) {
 204.631 +        
 204.632 +        String defaultAutoDeployDir = "";
 204.633 +        if(reader.getServerType().equals(ServerConstants.SUN_APP_SERVER_9)) {
 204.634 +            defaultAutoDeployDir = new File(reader.getServerHome()).
 204.635 +                    getParentFile().getAbsolutePath() + File.separator + "deploy";
 204.636 +        } else {
 204.637 +            defaultAutoDeployDir = new File(reader.getProperty(TomcatConstant.CATALINA_BASE)).
 204.638 +                    getParentFile().getAbsolutePath() + File.separator + "deploy";
 204.639 +        }
 204.640 +        
 204.641 +        return defaultAutoDeployDir;
 204.642 +    }
 204.643  
 204.644      public void insertUpdate(DocumentEvent e) {
 204.645          updateText();
   205.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   205.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/PortalEXTModifier.java	Sun Jun 26 10:25:14 2011 +0800
   205.3 @@ -0,0 +1,146 @@
   205.4 +/*
   205.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   205.6 + *
   205.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   205.8 + *
   205.9 + * The contents of this file are subject to the terms of either the GNU
  205.10 + * General Public License Version 2 only ("GPL") or the Common
  205.11 + * Development and Distribution License("CDDL") (collectively, the
  205.12 + * "License"). You may not use this file except in compliance with the
  205.13 + * License. You can obtain a copy of the License at
  205.14 + * http://www.netbeans.org/cddl-gplv2.html
  205.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  205.16 + * specific language governing permissions and limitations under the
  205.17 + * License.  When distributing the software, include this License Header
  205.18 + * Notice in each file and include the License file at
  205.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  205.20 + * particular file as subject to the "Classpath" exception as provided
  205.21 + * by Sun in the GPL Version 2 section of the License file that
  205.22 + * accompanied this code. If applicable, add the following below the
  205.23 + * License Header, with the fields enclosed by brackets [] replaced by
  205.24 + * your own identifying information:
  205.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  205.26 + *
  205.27 + * If you wish your version of this file to be governed by only the CDDL
  205.28 + * or only the GPL Version 2, indicate your decision by adding
  205.29 + * "[Contributor] elects to include this software in this distribution
  205.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  205.31 + * single choice of license, a recipient has the option to distribute
  205.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  205.33 + * to extend the choice of license to its licensees as provided above.
  205.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  205.35 + * Version 2 license, then the option applies only if the new code is
  205.36 + * made subject to such option by the copyright holder.
  205.37 + *
  205.38 + * Contributor(s):
  205.39 + *
  205.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  205.41 + */
  205.42 +package org.netbeans.modules.portalpack.servers.websynergy.ui;
  205.43 +
  205.44 +import java.io.File;
  205.45 +import java.io.FileInputStream;
  205.46 +import java.io.FileOutputStream;
  205.47 +import java.io.IOException;
  205.48 +import org.netbeans.modules.portalpack.servers.websynergy.util.TemplateUtil;
  205.49 +import org.openide.filesystems.FileObject;
  205.50 +import org.openide.filesystems.FileUtil;
  205.51 +
  205.52 +/**
  205.53 + *
  205.54 + * @author satyaranjan
  205.55 + */
  205.56 +public class PortalEXTModifier {
  205.57 +
  205.58 +   public static void setDeveloperMode(String portalDepDir) {
  205.59 +        CustomProperties props = new CustomProperties();
  205.60 +        FileOutputStream fout = null;
  205.61 +        FileInputStream fin = null;
  205.62 +        //try retrieve data from file
  205.63 +        try {
  205.64 +            File portalDepClassesDir = new File(portalDepDir + File.separator
  205.65 +                                            + "WEB-INF" + File.separator
  205.66 +                                            + "classes");
  205.67 +            File portalExt = new File(portalDepClassesDir + File.separator
  205.68 +                                        + "portal-ext.properties");
  205.69 +
  205.70 +            if(portalExt.exists()) {
  205.71 +                fin = new FileInputStream(portalExt);
  205.72 +                props.loadProperties(fin);
  205.73 +                if(fin != null) {
  205.74 +                    try {
  205.75 +                        fin.close();
  205.76 +                    }catch(Exception e){}
  205.77 +                }
  205.78 +            }
  205.79 +
  205.80 +            String overrideProperties = props.getProperty("include-and-override");
  205.81 +            if(overrideProperties == null || overrideProperties.trim().length() == 0) {
  205.82 +
  205.83 +                //createNewExtFileWithoutComments(portalDepClassesDir, portalExt);
  205.84 +                props.setProperty("include-and-override", "portal-developer.properties");
  205.85 +                if(portalExt.exists()) {
  205.86 +                    FileUtil.copyFile(FileUtil.toFileObject(portalExt),
  205.87 +                            FileUtil.toFileObject(portalDepClassesDir),
  205.88 +                            getAvailableFileName(portalDepClassesDir, "portal-ext-original",".properties"));
  205.89 +                }
  205.90 +                fout = new FileOutputStream(portalExt);
  205.91 +                props.store(fout, "");
  205.92 +            }
  205.93 +
  205.94 +           
  205.95 +
  205.96 +        } catch (Exception e) {
  205.97 +            e.printStackTrace();
  205.98 +        }finally {
  205.99 +            if(fout != null) {
 205.100 +                try {
 205.101 +                    fout.close();
 205.102 +                } catch (IOException ex) {
 205.103 +                    //Exceptions.printStackTrace(ex);
 205.104 +                }
 205.105 +
 205.106 +            }
 205.107 +        }
 205.108 +    }
 205.109 +
 205.110 +   public static boolean createDeveloperProperties(String portalDepDir) {
 205.111 +
 205.112 +        try {
 205.113 +            File portalDepClassesDir = new File(portalDepDir + File.separator
 205.114 +                                            + "WEB-INF" + File.separator
 205.115 +                                            + "classes");
 205.116 +            File portalDevProperties = new File(portalDepClassesDir + File.separator
 205.117 +                                        + "portal-developer.properties");
 205.118 +			if(portalDevProperties.exists())
 205.119 +				return true;
 205.120 +
 205.121 +			FileObject portalClassesDirFO = FileUtil.toFileObject(portalDepClassesDir);
 205.122 +			TemplateUtil templateUtil = new TemplateUtil("liferay/templates");
 205.123 +			FileObject pdFO = templateUtil.createFileFromTemplate("portal-developer.properties",
 205.124 +					portalClassesDirFO, "portal-developer", "properties");
 205.125 +		    
 205.126 +			if(pdFO != null)
 205.127 +				return true;
 205.128 +			else
 205.129 +				return false;
 205.130 +		}catch(Exception e) {
 205.131 +			return false;
 205.132 +		}
 205.133 +
 205.134 +   }
 205.135 +   
 205.136 +    private static String getAvailableFileName(File folder,String name, String ext) {
 205.137 +
 205.138 +        int counter = 0;
 205.139 +        File file = new File(folder,name+ext);
 205.140 +        String newName = name;
 205.141 +        while(file.exists()) {
 205.142 +            counter++;
 205.143 +            newName = name + "_" + counter;
 205.144 +            file = new File(folder,newName + ext);
 205.145 +        }
 205.146 +
 205.147 +        return newName;
 205.148 +    }
 205.149 +}
   206.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/WSConfigPanel.form	Fri Jun 10 09:46:37 2011 +0200
   206.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/WSConfigPanel.form	Sun Jun 26 10:25:14 2011 +0800
   206.3 @@ -9,6 +9,7 @@
   206.4    <AuxValues>
   206.5      <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
   206.6      <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
   206.7 +    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
   206.8      <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
   206.9      <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
  206.10      <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
  206.11 @@ -20,66 +21,62 @@
  206.12    <Layout>
  206.13      <DimensionLayout dim="0">
  206.14        <Group type="103" groupAlignment="0" attributes="0">
  206.15 -          <Component id="jSeparator1" alignment="0" pref="510" max="32767" attributes="0"/>
  206.16 -          <Group type="102" alignment="0" attributes="0">
  206.17 -              <EmptySpace min="-2" pref="169" max="-2" attributes="0"/>
  206.18 -              <Component id="jLabel1" pref="172" max="32767" attributes="0"/>
  206.19 -              <EmptySpace min="-2" pref="169" max="-2" attributes="1"/>
  206.20 -          </Group>
  206.21 -          <Group type="102" alignment="1" attributes="0">
  206.22 -              <EmptySpace min="-2" max="-2" attributes="0"/>
  206.23 +          <Group type="102" attributes="0">
  206.24 +              <EmptySpace max="-2" attributes="0"/>
  206.25                <Group type="103" groupAlignment="0" attributes="0">
  206.26 +                  <Group type="102" attributes="0">
  206.27 +                      <Component id="jLabel2" pref="104" max="32767" attributes="0"/>
  206.28 +                      <EmptySpace max="-2" attributes="0"/>
  206.29 +                  </Group>
  206.30                    <Group type="102" alignment="0" attributes="0">
  206.31 -                      <Component id="jLabel2" pref="118" max="32767" attributes="0"/>
  206.32 +                      <Component id="jLabel3" pref="104" max="32767" attributes="0"/>
  206.33                        <EmptySpace min="-2" max="-2" attributes="1"/>
  206.34                    </Group>
  206.35                    <Group type="102" alignment="0" attributes="0">
  206.36 -                      <Component id="jLabel4" pref="118" max="32767" attributes="0"/>
  206.37 -                      <EmptySpace min="-2" max="-2" attributes="1"/>
  206.38 +                      <Component id="jLabel4" pref="104" max="32767" attributes="0"/>
  206.39 +                      <EmptySpace max="-2" attributes="0"/>
  206.40                    </Group>
  206.41                    <Group type="102" alignment="0" attributes="0">
  206.42 -                      <Component id="jLabel6" pref="118" max="32767" attributes="0"/>
  206.43 -                      <EmptySpace min="-2" max="-2" attributes="1"/>
  206.44 -                  </Group>
  206.45 -                  <Group type="102" alignment="0" attributes="0">
  206.46 -                      <Component id="jLabel5" max="32767" attributes="0"/>
  206.47 -                      <EmptySpace min="-2" pref="38" max="-2" attributes="1"/>
  206.48 -                  </Group>
  206.49 -                  <Group type="102" alignment="0" attributes="0">
  206.50 -                      <Component id="jLabel3" pref="118" max="32767" attributes="0"/>
  206.51 -                      <EmptySpace min="-2" max="-2" attributes="1"/>
  206.52 +                      <Component id="jLabel5" pref="104" max="32767" attributes="0"/>
  206.53 +                      <EmptySpace max="-2" attributes="0"/>
  206.54                    </Group>
  206.55                </Group>
  206.56                <Group type="103" groupAlignment="0" attributes="0">
  206.57 -                  <Component id="hostTf" pref="295" max="32767" attributes="2"/>
  206.58 -                  <Component id="portalDepDirTf" alignment="0" pref="295" max="32767" attributes="0"/>
  206.59 -                  <Component id="autoDeployTf" alignment="0" pref="295" max="32767" attributes="0"/>
  206.60 -                  <Group type="102" alignment="0" attributes="0">
  206.61 -                      <Group type="103" groupAlignment="1" attributes="0">
  206.62 -                          <Component id="portletUriTf" alignment="0" pref="208" max="32767" attributes="2"/>
  206.63 -                          <Component id="portalUri" alignment="0" pref="208" max="32767" attributes="2"/>
  206.64 +                  <Group type="102" attributes="0">
  206.65 +                      <Group type="103" groupAlignment="0" attributes="0">
  206.66 +                          <Component id="hostTf" alignment="0" pref="268" max="32767" attributes="2"/>
  206.67 +                          <Component id="autoDeployTf" alignment="0" pref="268" max="32767" attributes="0"/>
  206.68 +                          <Component id="portalDepDirTf" alignment="0" pref="268" max="32767" attributes="0"/>
  206.69                        </Group>
  206.70 -                      <EmptySpace min="-2" pref="87" max="-2" attributes="0"/>
  206.71 +                      <EmptySpace min="-2" max="-2" attributes="0"/>
  206.72 +                      <Group type="103" groupAlignment="0" max="-2" attributes="0">
  206.73 +                          <Component id="portalDeployBrowseButton" linkSize="1" min="0" pref="0" max="32767" attributes="3"/>
  206.74 +                          <Component id="browseButton" linkSize="1" alignment="0" min="-2" pref="21" max="-2" attributes="3"/>
  206.75 +                      </Group>
  206.76 +                      <EmptySpace type="unrelated" max="-2" attributes="0"/>
  206.77 +                      <Component id="getButton" linkSize="1" min="-2" max="-2" attributes="0"/>
  206.78                    </Group>
  206.79 +                  <Component id="portalUri" min="-2" pref="170" max="-2" attributes="2"/>
  206.80                </Group>
  206.81 -              <EmptySpace min="-2" max="-2" attributes="0"/>
  206.82 -              <Group type="103" groupAlignment="0" attributes="0">
  206.83 -                  <Component id="browseButton" max="32767" attributes="2"/>
  206.84 -                  <Component id="jButton1" alignment="0" max="32767" attributes="2"/>
  206.85 -              </Group>
  206.86 -              <EmptySpace min="-2" max="-2" attributes="0"/>
  206.87 +              <EmptySpace max="-2" attributes="0"/>
  206.88            </Group>
  206.89            <Group type="102" alignment="0" attributes="0">
  206.90 -              <EmptySpace max="-2" attributes="0"/>
  206.91 -              <Component id="directoryDeploymentCB" max="32767" attributes="0"/>
  206.92 -              <EmptySpace min="-2" pref="333" max="-2" attributes="0"/>
  206.93 +              <EmptySpace min="6" pref="6" max="6" attributes="0"/>
  206.94 +              <Component id="directoryDeploymentCB" pref="179" max="32767" attributes="0"/>
  206.95 +              <EmptySpace pref="325" max="32767" attributes="0"/>
  206.96            </Group>
  206.97 +          <Group type="102" alignment="1" attributes="0">
  206.98 +              <EmptySpace pref="169" max="32767" attributes="0"/>
  206.99 +              <Component id="jLabel1" min="-2" pref="281" max="-2" attributes="0"/>
 206.100 +              <EmptySpace min="-2" pref="60" max="-2" attributes="0"/>
 206.101 +          </Group>
 206.102 +          <Component id="jSeparator1" alignment="0" pref="510" max="32767" attributes="0"/>
 206.103        </Group>
 206.104      </DimensionLayout>
 206.105      <DimensionLayout dim="1">
 206.106        <Group type="103" groupAlignment="0" attributes="0">
 206.107            <Group type="102" alignment="0" attributes="0">
 206.108 -              <EmptySpace min="-2" max="-2" attributes="0"/>
 206.109 +              <EmptySpace max="-2" attributes="0"/>
 206.110                <Component id="jLabel1" min="-2" pref="14" max="-2" attributes="0"/>
 206.111                <EmptySpace max="-2" attributes="0"/>
 206.112                <Component id="jSeparator1" min="-2" pref="10" max="-2" attributes="0"/>
 206.113 @@ -89,36 +86,30 @@
 206.114                    <Component id="hostTf" min="-2" max="-2" attributes="0"/>
 206.115                </Group>
 206.116                <EmptySpace max="-2" attributes="0"/>
 206.117 -              <Group type="103" groupAlignment="1" attributes="0">
 206.118 -                  <Component id="jLabel4" min="-2" max="-2" attributes="1"/>
 206.119 -                  <Component id="portalUri" min="-2" max="-2" attributes="1"/>
 206.120 +              <Group type="103" groupAlignment="3" attributes="0">
 206.121 +                  <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="1"/>
 206.122 +                  <Component id="portalUri" alignment="3" min="-2" max="-2" attributes="1"/>
 206.123                </Group>
 206.124                <EmptySpace max="-2" attributes="0"/>
 206.125                <Group type="103" groupAlignment="1" attributes="0">
 206.126 -                  <Component id="jLabel6" min="-2" max="-2" attributes="0"/>
 206.127 -                  <Component id="portletUriTf" min="-2" max="-2" attributes="0"/>
 206.128 +                  <Group type="103" alignment="1" groupAlignment="3" attributes="0">
 206.129 +                      <Component id="autoDeployTf" alignment="3" min="-2" max="-2" attributes="0"/>
 206.130 +                      <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
 206.131 +                  </Group>
 206.132 +                  <Group type="103" alignment="1" groupAlignment="3" attributes="0">
 206.133 +                      <Component id="browseButton" alignment="3" min="-2" max="-2" attributes="0"/>
 206.134 +                      <Component id="getButton" alignment="3" min="-2" max="-2" attributes="0"/>
 206.135 +                  </Group>
 206.136                </Group>
 206.137                <EmptySpace max="-2" attributes="0"/>
 206.138 -              <Group type="103" groupAlignment="0" attributes="0">
 206.139 -                  <Component id="jLabel5" alignment="1" min="-2" max="-2" attributes="0"/>
 206.140 -                  <Group type="102" alignment="0" attributes="0">
 206.141 -                      <Group type="103" groupAlignment="1" attributes="0">
 206.142 -                          <Group type="103" groupAlignment="3" attributes="0">
 206.143 -                              <Component id="autoDeployTf" alignment="3" min="-2" max="-2" attributes="0"/>
 206.144 -                              <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
 206.145 -                          </Group>
 206.146 -                          <Component id="browseButton" min="-2" max="-2" attributes="0"/>
 206.147 -                      </Group>
 206.148 -                      <EmptySpace max="-2" attributes="0"/>
 206.149 -                      <Group type="103" groupAlignment="3" attributes="0">
 206.150 -                          <Component id="portalDepDirTf" alignment="3" min="-2" max="-2" attributes="0"/>
 206.151 -                          <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
 206.152 -                      </Group>
 206.153 -                  </Group>
 206.154 +              <Group type="103" groupAlignment="3" attributes="0">
 206.155 +                  <Component id="portalDepDirTf" alignment="3" min="-2" max="-2" attributes="0"/>
 206.156 +                  <Component id="portalDeployBrowseButton" alignment="3" min="-2" max="-2" attributes="0"/>
 206.157 +                  <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
 206.158                </Group>
 206.159                <EmptySpace type="unrelated" max="-2" attributes="0"/>
 206.160                <Component id="directoryDeploymentCB" min="-2" max="-2" attributes="0"/>
 206.161 -              <EmptySpace pref="13" max="32767" attributes="0"/>
 206.162 +              <EmptySpace max="32767" attributes="0"/>
 206.163            </Group>
 206.164        </Group>
 206.165      </DimensionLayout>
 206.166 @@ -157,18 +148,6 @@
 206.167          <EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="hostTfFocusLost"/>
 206.168        </Events>
 206.169      </Component>
 206.170 -    <Component class="javax.swing.JLabel" name="jLabel6">
 206.171 -      <Properties>
 206.172 -        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
 206.173 -          <ComponentRef name="portletUriTf"/>
 206.174 -        </Property>
 206.175 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 206.176 -          <ResourceString bundle="org/netbeans/modules/portalpack/servers/websynergy/ui/Bundle.properties" key="LBL_PORTLET_URI" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
 206.177 -        </Property>
 206.178 -      </Properties>
 206.179 -    </Component>
 206.180 -    <Component class="javax.swing.JTextField" name="portletUriTf">
 206.181 -    </Component>
 206.182      <Component class="javax.swing.JLabel" name="jLabel3">
 206.183        <Properties>
 206.184          <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
 206.185 @@ -205,12 +184,15 @@
 206.186      </Component>
 206.187      <Component class="javax.swing.JTextField" name="portalDepDirTf">
 206.188      </Component>
 206.189 -    <Component class="javax.swing.JButton" name="jButton1">
 206.190 +    <Component class="javax.swing.JButton" name="portalDeployBrowseButton">
 206.191        <Properties>
 206.192          <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 206.193            <ResourceString bundle="org/netbeans/modules/portalpack/servers/websynergy/ui/Bundle.properties" key="LBL_BrowseButton" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 206.194          </Property>
 206.195        </Properties>
 206.196 +      <Events>
 206.197 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="portalDeployBrowseButtonActionPerformed"/>
 206.198 +      </Events>
 206.199      </Component>
 206.200      <Component class="javax.swing.JCheckBox" name="directoryDeploymentCB">
 206.201        <Properties>
 206.202 @@ -219,5 +201,13 @@
 206.203          </Property>
 206.204        </Properties>
 206.205      </Component>
 206.206 +    <Component class="javax.swing.JButton" name="getButton">
 206.207 +      <Properties>
 206.208 +        <Property name="text" type="java.lang.String" value="Get"/>
 206.209 +      </Properties>
 206.210 +      <Events>
 206.211 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="getButtonActionPerformed"/>
 206.212 +      </Events>
 206.213 +    </Component>
 206.214    </SubComponents>
 206.215  </Form>
   207.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/WSConfigPanel.java	Fri Jun 10 09:46:37 2011 +0200
   207.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ui/WSConfigPanel.java	Sun Jun 26 10:25:14 2011 +0800
   207.3 @@ -20,16 +20,27 @@
   207.4  
   207.5  import org.netbeans.modules.portalpack.servers.websynergy.ui.*;
   207.6  import java.io.File;
   207.7 +import java.lang.reflect.Method;
   207.8 +import java.net.URL;
   207.9 +import java.net.URLClassLoader;
  207.10 +import java.util.Properties;
  207.11  import javax.swing.JFileChooser;
  207.12  import javax.swing.SwingUtilities;
  207.13  import javax.swing.event.DocumentEvent;
  207.14  import javax.swing.event.DocumentListener;
  207.15  import org.netbeans.modules.portalpack.servers.core.WizardPropertyReader;
  207.16  import org.netbeans.modules.portalpack.servers.core.api.ConfigPanel;
  207.17 +import org.netbeans.modules.portalpack.servers.core.api.PSStartServerInf;
  207.18  import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
  207.19  import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver.SunAppServerConstants;
  207.20  import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  207.21  import org.netbeans.modules.portalpack.servers.websynergy.common.LiferayConstants;
  207.22 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibrariesFactory;
  207.23 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.sunappserver.SunAppServerJEELibraries;
  207.24 +import org.netbeans.modules.portalpack.servers.websynergy.common.WSConstants;
  207.25 +import org.netbeans.modules.portalpack.servers.websynergy.impl.LiferayHelper;
  207.26 +import org.openide.DialogDisplayer;
  207.27 +import org.openide.NotifyDescriptor;
  207.28  import org.openide.WizardDescriptor;
  207.29  import org.openide.util.NbBundle;
  207.30  
  207.31 @@ -40,6 +51,8 @@
  207.32  public class WSConfigPanel extends ConfigPanel implements DocumentListener {
  207.33  
  207.34      private String psVersion;
  207.35 +    private int lrVersion = 1;
  207.36 +    private PSConfigObject psObject;
  207.37     
  207.38      /** Creates new form LifeRayConfigPanel */
  207.39      public WSConfigPanel(String psVersion) {
  207.40 @@ -48,7 +61,6 @@
  207.41          initData();
  207.42  
  207.43          portalUri.getDocument().addDocumentListener(this);
  207.44 -        portletUriTf.getDocument().addDocumentListener(this);
  207.45          autoDeployTf.getDocument().addDocumentListener(this);
  207.46          portalDepDirTf.getDocument().addDocumentListener(this);
  207.47      //adminConsoleUriTf.getDocument().addDocumentListener(this);
  207.48 @@ -69,15 +81,14 @@
  207.49          jSeparator1 = new javax.swing.JSeparator();
  207.50          jLabel2 = new javax.swing.JLabel();
  207.51          hostTf = new javax.swing.JTextField();
  207.52 -        jLabel6 = new javax.swing.JLabel();
  207.53 -        portletUriTf = new javax.swing.JTextField();
  207.54          jLabel3 = new javax.swing.JLabel();
  207.55          autoDeployTf = new javax.swing.JTextField();
  207.56          browseButton = new javax.swing.JButton();
  207.57          jLabel5 = new javax.swing.JLabel();
  207.58          portalDepDirTf = new javax.swing.JTextField();
  207.59 -        jButton1 = new javax.swing.JButton();
  207.60 +        portalDeployBrowseButton = new javax.swing.JButton();
  207.61          directoryDeploymentCB = new javax.swing.JCheckBox();
  207.62 +        getButton = new javax.swing.JButton();
  207.63  
  207.64          setFont(new java.awt.Font("Tahoma", 1, 11));
  207.65  
  207.66 @@ -94,9 +105,6 @@
  207.67              }
  207.68          });
  207.69  
  207.70 -        jLabel6.setLabelFor(portletUriTf);
  207.71 -        jLabel6.setText(org.openide.util.NbBundle.getBundle(WSConfigPanel.class).getString("LBL_PORTLET_URI")); // NOI18N
  207.72 -
  207.73          jLabel3.setLabelFor(autoDeployTf);
  207.74          jLabel3.setText(org.openide.util.NbBundle.getMessage(WSConfigPanel.class, "LBL_Auto_Deploy_Dir")); // NOI18N
  207.75  
  207.76 @@ -109,56 +117,68 @@
  207.77  
  207.78          jLabel5.setText(org.openide.util.NbBundle.getMessage(WSConfigPanel.class, "LBL_Portal_Deploy_Dir")); // NOI18N
  207.79  
  207.80 -        jButton1.setText(org.openide.util.NbBundle.getMessage(WSConfigPanel.class, "LBL_BrowseButton")); // NOI18N
  207.81 +        portalDeployBrowseButton.setText(org.openide.util.NbBundle.getMessage(WSConfigPanel.class, "LBL_BrowseButton")); // NOI18N
  207.82 +        portalDeployBrowseButton.addActionListener(new java.awt.event.ActionListener() {
  207.83 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  207.84 +                portalDeployBrowseButtonActionPerformed(evt);
  207.85 +            }
  207.86 +        });
  207.87  
  207.88          directoryDeploymentCB.setText(org.openide.util.NbBundle.getMessage(WSConfigPanel.class, "LBL_DIRECTORY_DEPLOYMENT")); // NOI18N
  207.89  
  207.90 +        getButton.setText("Get");
  207.91 +        getButton.addActionListener(new java.awt.event.ActionListener() {
  207.92 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  207.93 +                getButtonActionPerformed(evt);
  207.94 +            }
  207.95 +        });
  207.96 +
  207.97          org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
  207.98          this.setLayout(layout);
  207.99          layout.setHorizontalGroup(
 207.100              layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 207.101 -            .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 510, Short.MAX_VALUE)
 207.102              .add(layout.createSequentialGroup()
 207.103 -                .add(169, 169, 169)
 207.104 -                .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
 207.105 -                .add(169, 169, 169))
 207.106 -            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
 207.107                  .addContainerGap()
 207.108                  .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 207.109                      .add(layout.createSequentialGroup()
 207.110 -                        .add(jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
 207.111 +                        .add(jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE)
 207.112                          .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
 207.113                      .add(layout.createSequentialGroup()
 207.114 -                        .add(jLabel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
 207.115 +                        .add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE)
 207.116                          .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
 207.117                      .add(layout.createSequentialGroup()
 207.118 -                        .add(jLabel6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
 207.119 +                        .add(jLabel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE)
 207.120                          .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
 207.121                      .add(layout.createSequentialGroup()
 207.122 -                        .add(jLabel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 207.123 -                        .add(38, 38, 38))
 207.124 -                    .add(layout.createSequentialGroup()
 207.125 -                        .add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
 207.126 +                        .add(jLabel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE)
 207.127                          .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)))
 207.128                  .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 207.129 -                    .add(hostTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
 207.130 -                    .add(portalDepDirTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
 207.131 -                    .add(autoDeployTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
 207.132                      .add(layout.createSequentialGroup()
 207.133 -                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 207.134 -                            .add(org.jdesktop.layout.GroupLayout.LEADING, portletUriTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE)
 207.135 -                            .add(org.jdesktop.layout.GroupLayout.LEADING, portalUri, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE))
 207.136 -                        .add(87, 87, 87)))
 207.137 -                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 207.138 -                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 207.139 -                    .add(browseButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 207.140 -                    .add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 207.141 +                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 207.142 +                            .add(hostTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
 207.143 +                            .add(autoDeployTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
 207.144 +                            .add(portalDepDirTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE))
 207.145 +                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 207.146 +                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
 207.147 +                            .add(portalDeployBrowseButton, 0, 0, Short.MAX_VALUE)
 207.148 +                            .add(browseButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 207.149 +                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
 207.150 +                        .add(getButton))
 207.151 +                    .add(portalUri, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 170, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 207.152                  .addContainerGap())
 207.153              .add(layout.createSequentialGroup()
 207.154 -                .addContainerGap()
 207.155 -                .add(directoryDeploymentCB, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 207.156 -                .add(333, 333, 333))
 207.157 +                .add(6, 6, 6)
 207.158 +                .add(directoryDeploymentCB, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
 207.159 +                .addContainerGap(325, Short.MAX_VALUE))
 207.160 +            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
 207.161 +                .addContainerGap(169, Short.MAX_VALUE)
 207.162 +                .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 281, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 207.163 +                .add(60, 60, 60))
 207.164 +            .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 510, Short.MAX_VALUE)
 207.165          );
 207.166 +
 207.167 +        layout.linkSize(new java.awt.Component[] {browseButton, getButton, portalDeployBrowseButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
 207.168 +
 207.169          layout.setVerticalGroup(
 207.170              layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 207.171              .add(layout.createSequentialGroup()
 207.172 @@ -171,29 +191,25 @@
 207.173                      .add(jLabel2)
 207.174                      .add(hostTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 207.175                  .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 207.176 -                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 207.177 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 207.178                      .add(jLabel4)
 207.179                      .add(portalUri, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 207.180                  .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 207.181                  .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 207.182 -                    .add(jLabel6)
 207.183 -                    .add(portletUriTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 207.184 +                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 207.185 +                        .add(autoDeployTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 207.186 +                        .add(jLabel3))
 207.187 +                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 207.188 +                        .add(browseButton)
 207.189 +                        .add(getButton)))
 207.190                  .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 207.191 -                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 207.192 -                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel5)
 207.193 -                    .add(layout.createSequentialGroup()
 207.194 -                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 207.195 -                            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 207.196 -                                .add(autoDeployTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 207.197 -                                .add(jLabel3))
 207.198 -                            .add(browseButton))
 207.199 -                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 207.200 -                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 207.201 -                            .add(portalDepDirTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 207.202 -                            .add(jButton1))))
 207.203 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 207.204 +                    .add(portalDepDirTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 207.205 +                    .add(portalDeployBrowseButton)
 207.206 +                    .add(jLabel5))
 207.207                  .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
 207.208                  .add(directoryDeploymentCB)
 207.209 -                .addContainerGap(13, Short.MAX_VALUE))
 207.210 +                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 207.211          );
 207.212  
 207.213          browseButton.getAccessibleContext().setAccessibleDescription("null");
 207.214 @@ -212,57 +228,83 @@
 207.215      }
 207.216  }//GEN-LAST:event_browseButtonActionPerformed
 207.217  
 207.218 +private void portalDeployBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_portalDeployBrowseButtonActionPerformed
 207.219 +// TODO add your handling code here:
 207.220 +    String portalDeployDirLoc = browseAutoDeployLocation();
 207.221 +    if (portalDeployDirLoc != null) {
 207.222 +        portalDepDirTf.setText(portalDeployDirLoc);
 207.223 +    }
 207.224 +}//GEN-LAST:event_portalDeployBrowseButtonActionPerformed
 207.225 +
 207.226 +private void getButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_getButtonActionPerformed
 207.227 +
 207.228 +    String autoDeployLoc = LiferayHelper.getAutoDeployDirectory(psObject, Boolean.TRUE);
 207.229 +    if (autoDeployLoc == null) {
 207.230 +        DialogDisplayer.getDefault().notify(
 207.231 +                   new NotifyDescriptor.Message(NbBundle.getMessage(
 207.232 +                   WSConfigPanel.class, "LBL_AUTO_DEPLOY_DIR_SERVER_NOT_RUNNING")));
 207.233 +        return;
 207.234 +    } else {
 207.235 +        autoDeployTf.setText(autoDeployLoc);
 207.236 +    }
 207.237 +}//GEN-LAST:event_getButtonActionPerformed
 207.238 +
 207.239      // Variables declaration - do not modify//GEN-BEGIN:variables
 207.240      private javax.swing.JTextField autoDeployTf;
 207.241      private javax.swing.JButton browseButton;
 207.242      private javax.swing.JCheckBox directoryDeploymentCB;
 207.243 +    private javax.swing.JButton getButton;
 207.244      private javax.swing.JTextField hostTf;
 207.245 -    private javax.swing.JButton jButton1;
 207.246      private javax.swing.JLabel jLabel1;
 207.247      private javax.swing.JLabel jLabel2;
 207.248      private javax.swing.JLabel jLabel3;
 207.249      private javax.swing.JLabel jLabel4;
 207.250      private javax.swing.JLabel jLabel5;
 207.251 -    private javax.swing.JLabel jLabel6;
 207.252      private javax.swing.JSeparator jSeparator1;
 207.253      private javax.swing.JTextField portalDepDirTf;
 207.254 +    private javax.swing.JButton portalDeployBrowseButton;
 207.255      private javax.swing.JTextField portalUri;
 207.256 -    private javax.swing.JTextField portletUriTf;
 207.257      // End of variables declaration//GEN-END:variables
 207.258  
 207.259      public void initData() {
 207.260 -        portalUri.setText("/portal");
 207.261 -        portletUriTf.setText("/portal");
 207.262 +        portalUri.setText("/");
 207.263          hostTf.setText("localhost");
 207.264  
 207.265      }
 207.266  
 207.267      public void populateDataForCustomizer(PSConfigObject object) {
 207.268 -
 207.269 +        psObject = object;
 207.270          //hostTf.setText(object.getHost());
 207.271          //portTf.setText(object.getPort());
 207.272          portalUri.setText(object.getPortalUri());
 207.273  
 207.274          hostTf.setText(object.getHost());
 207.275 -        // adminConsoleUriTf.setText(object.getProperty(LifeRayConstants.ADMIN_CONSOLE_URI));
 207.276 -        portletUriTf.setText(object.getProperty(LiferayConstants.PORTLET_URI));
 207.277          autoDeployTf.setText(object.getProperty(LiferayConstants.AUTO_DEPLOY_DIR));
 207.278          portalDepDirTf.setText(object.getProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR));
 207.279  
 207.280          hostTf.setEnabled(false);
 207.281          directoryDeploymentCB.setSelected(object.isDirectoryDeployment());
 207.282          //browseButton.setEnabled(false);
 207.283 +        
 207.284 +        String lv = object.getProperty(LiferayConstants.LR_VERSION);
 207.285 +        
 207.286 +        try{
 207.287 +            if(lv != null) {
 207.288 +                lrVersion = Integer.parseInt(lv);
 207.289 +            }
 207.290 +        }catch(Exception e) {
 207.291 +            
 207.292 +        }
 207.293  
 207.294      }
 207.295  
 207.296      public void read(org.openide.WizardDescriptor wizardDescriptor) {
 207.297  
 207.298          WizardPropertyReader reader = new WizardPropertyReader(wizardDescriptor);
 207.299 -        String autoDeployDir = autoDeployTf.getText();
 207.300 -
 207.301 -        // if (autoDeployDir == null || autoDeployDir.trim().length() == 0) {
 207.302         
 207.303          String domainDir = reader.getDomainDir();
 207.304 +        
 207.305 +        //for older websynergy (Before webspace 10 RR release)
 207.306          File webSynergyHomeFile = new File(domainDir, "websynergy");
 207.307          autoDeployTf.setText(webSynergyHomeFile.getAbsolutePath() +
 207.308                    File.separator + "deploy");      
 207.309 @@ -273,23 +315,25 @@
 207.310          if (serverType.equals(ServerConstants.SUN_APP_SERVER_9)) {
 207.311  
 207.312              if (isWebSynergy(reader)) {
 207.313 -                //check for glassfish V2
 207.314 -
 207.315 -                String version = getGlassFishVersion(reader.getServerHome());
 207.316 -
 207.317 -                if (version.equals(SunAppServerConstants.GLASSFISH_V2)) {
 207.318 -                    String deployDir = domainDir + File.separator +
 207.319 -                            "applications" + File.separator +
 207.320 -                            "j2ee-modules" + File.separator + "websynergy";
 207.321 -                    portalDepDirTf.setText(deployDir);
 207.322 -                } else {
 207.323 -                    String deployDir = domainDir + File.separator +
 207.324 -                            "applications" + File.separator +
 207.325 -                            "websynergy";
 207.326 -                    portalDepDirTf.setText(deployDir);
 207.327 +                
 207.328 +               String deployDir = JEEServerLibrariesFactory.getJEEServerLibraries(serverType).getWebAppInstallDirectory(reader)
 207.329 +                        + File.separator + WSConstants.WS_APPLICATION_NAME;
 207.330 +               portalDepDirTf.setText(deployDir);
 207.331 +               
 207.332 +               String portalKernel = JEEServerLibrariesFactory.getJEEServerLibraries(serverType).getPortalServerLibraryLocation(reader) +
 207.333 +                    File.separator + "portal-kernel.jar";
 207.334 +               lrVersion = getLiferayVersion(portalKernel);
 207.335 +               
 207.336 +               if(lrVersion > 5200) {
 207.337 +                    autoDeployTf.setText("");
 207.338 +                    autoDeployTf.setEnabled(false);
 207.339 +                    browseButton.setEnabled(false);
 207.340 +                    getButton.setEnabled(false);
 207.341                  }
 207.342 +                
 207.343              }
 207.344          }
 207.345 +        
 207.346      }
 207.347  
 207.348      private boolean isWebSynergy(WizardPropertyReader reader) {
 207.349 @@ -298,13 +342,12 @@
 207.350  
 207.351          if (serverType.equals(ServerConstants.SUN_APP_SERVER_9)) {
 207.352  
 207.353 -            String domainDir = reader.getDomainDir();
 207.354 -
 207.355 -            File webSynergyHomeFile = new File(domainDir, "websynergy");
 207.356 -            File webSynergyConfigurator = new File(reader.getServerHome() + File.separator + "lib" + File.separator + "addons" + File.separator + "websynergy_configurator.jar");
 207.357 -
 207.358 -            if (webSynergyHomeFile.exists() ||
 207.359 -                    webSynergyConfigurator.exists()) {
 207.360 +            String deployDir = JEEServerLibrariesFactory.getJEEServerLibraries(serverType).getWebAppInstallDirectory(reader)
 207.361 +                        + File.separator + WSConstants.WS_APPLICATION_NAME;
 207.362 +            
 207.363 +            File webSynergyDepDir = new File(deployDir);          
 207.364 +            
 207.365 +            if (webSynergyDepDir.exists()) {
 207.366  
 207.367                  return true;
 207.368              }
 207.369 @@ -313,38 +356,28 @@
 207.370          return false;
 207.371      }
 207.372  
 207.373 -    private String getGlassFishVersion(String glassfishHome) {
 207.374 -
 207.375 -        File javaeeFile = new File(glassfishHome + File.separator + "lib" + File.separator + "javaee.jar");
 207.376 -        File module = new File(glassfishHome + File.separator + "modules");
 207.377 -
 207.378 -        if (!javaeeFile.exists() && module.exists()) {
 207.379 -            return SunAppServerConstants.GLASSFISH_V3;
 207.380 -        }
 207.381 -
 207.382 -        return SunAppServerConstants.GLASSFISH_V2;
 207.383 -
 207.384 -    }
 207.385 -
 207.386      public void store(org.openide.WizardDescriptor d) {
 207.387  
 207.388          WizardPropertyReader wr = new WizardPropertyReader(d);
 207.389 -        wr.setAdminUser("admin");
 207.390 -        wr.setAdminPassWord("adminadmin");
 207.391 +       /// wr.setAdminUser("admin");
 207.392 +       /// wr.setAdminPassWord("adminadmin");
 207.393 +
 207.394          //wr.setPort(portTf.getText());
 207.395          //wr.setAdminPort(portTf.getText());
 207.396 +
 207.397          wr.setRemote(false);
 207.398          wr.setPortalUri(portalUri.getText());
 207.399          wr.setHost(hostTf.getText());
 207.400 -//        wr.setProperty(LifeRayConstants.ADMIN_CONSOLE_URI,adminConsoleUriTf.getText());
 207.401 -        wr.setProperty(LiferayConstants.PORTLET_URI, portletUriTf.getText());
 207.402          wr.setProperty(LiferayConstants.AUTO_DEPLOY_DIR, autoDeployTf.getText());
 207.403          wr.setProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR, portalDepDirTf.getText());
 207.404          wr.setDirectoryDeployment(directoryDeploymentCB.isSelected());
 207.405          
 207.406 -        String gf_version = getGlassFishVersion(wr.getServerHome());
 207.407 -        wr.setProperty(SunAppServerConstants.GLASSFISH_VERSON, gf_version);
 207.408 -    //  wr.setPortalUri("/pcdriver");
 207.409 +        //String gf_version = SunAppServerJEELibraries.getGlassFishVersion(wr.getServerHome());
 207.410 +        //wr.setProperty(SunAppServerConstants.GLASSFISH_VERSON, gf_version);
 207.411 +        
 207.412 +        wr.setProperty(LiferayConstants.LR_VERSION, String.valueOf(lrVersion));
 207.413 +        
 207.414 +        PortalEXTModifier.setDeveloperMode(wr.getProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR));
 207.415      }
 207.416  
 207.417      public boolean validate(Object wizardDescriptor) {
 207.418 @@ -352,13 +385,10 @@
 207.419              return true;
 207.420          }
 207.421          WizardPropertyReader wr = new WizardPropertyReader(((WizardDescriptor) wizardDescriptor));
 207.422 -        //String serverHome = wr.getServerHome();
 207.423 -        String domainDir = wr.getDomainDir();
 207.424 -        String serverType = wr.getServerType();
 207.425 -        if (serverType.equals(ServerConstants.SUN_APP_SERVER_9)) {
 207.426 -
 207.427 -            File file = new File(domainDir + File.separator + "lib" + File.separator + "portal-service.jar");
 207.428 -            if (!file.exists()) {
 207.429 +        
 207.430 +         File file = new File(JEEServerLibrariesFactory.getJEEServerLibraries(wr.getServerType()).getPortalServerLibraryLocation(wr)
 207.431 +                 + File.separator + "portal-service.jar");
 207.432 +         if (!file.exists()) {
 207.433  
 207.434                  if (!isWebSynergy(wr)) {
 207.435                      setErrorMessage(NbBundle.getMessage(WSConfigPanel.class, "MSG_NO_WEBSYNERGY_INSTALLATION_FOUND"));
 207.436 @@ -366,11 +396,10 @@
 207.437                      return false;
 207.438                  } else {
 207.439                  }
 207.440 -            }
 207.441 -        } 
 207.442 +         } 
 207.443  
 207.444          String autoDeployDir = autoDeployTf.getText();
 207.445 -        if (autoDeployDir == null || autoDeployDir.trim().length() == 0) {
 207.446 +        if (autoDeployDir == null || autoDeployDir.trim().length() == 0 && lrVersion <= 5200) {
 207.447              setErrorMessage(NbBundle.getMessage(WSConfigPanel.class, "MSG_INVALID_AUTODEPLOY_DIR"));
 207.448              return false;
 207.449          }
 207.450 @@ -387,12 +416,6 @@
 207.451              return false;
 207.452          }
 207.453  
 207.454 -        String portletUriString = portletUriTf.getText();
 207.455 -        if (portletUriString == null || portletUriString.trim().length() == 0) {
 207.456 -            setErrorMessage(NbBundle.getMessage(WSConfigPanel.class, "MSG_NOT_A_VALID_PORTLET_URI"));
 207.457 -            return false;
 207.458 -        }
 207.459 -
 207.460          String host = hostTf.getText();
 207.461          if (host == null || host.trim().length() == 0) {
 207.462              setErrorMessage(NbBundle.getMessage(WSConfigPanel.class, "MSG_NOT_A_VALID_HOST"));
 207.463 @@ -407,14 +430,14 @@
 207.464          String autoDeployLocation = null;
 207.465          JFileChooser chooser = getJFileChooser();
 207.466          int returnValue = chooser.showDialog(SwingUtilities.getWindowAncestor(this),
 207.467 -                NbBundle.getMessage(WSConfigPanel.class, "LBL_BrowseButton")); //NOI18N
 207.468 +                NbBundle.getMessage(WSConfigPanel.class, "LBL_ChooserName")); //NOI18N
 207.469  
 207.470          if (returnValue == JFileChooser.APPROVE_OPTION) {
 207.471              autoDeployLocation = chooser.getSelectedFile().getAbsolutePath();
 207.472          }
 207.473          return autoDeployLocation;
 207.474      }
 207.475 -
 207.476 +    
 207.477      private JFileChooser getJFileChooser() {
 207.478  
 207.479          JFileChooser chooser = new JFileChooser();
 207.480 @@ -443,6 +466,21 @@
 207.481      public String getDescription() {
 207.482          return NbBundle.getMessage(WSConfigPanel.class, "DESC_WS");
 207.483      }
 207.484 +    
 207.485 +     private int getLiferayVersion(String portalKernelJar) {
 207.486 +        
 207.487 +        try{
 207.488 +            URLClassLoader loader = new URLClassLoader(
 207.489 +                    new URL[]{new File(portalKernelJar).toURI().toURL()});
 207.490 +
 207.491 +            Class releaseClass = loader.loadClass("com.liferay.portal.kernel.util.ReleaseInfo");
 207.492 +            Method gV = releaseClass.getMethod("getBuildNumber");
 207.493 +            Integer version = (Integer)gV.invoke(null,null);
 207.494 +            return version.intValue();
 207.495 +        }catch(Exception e) {
 207.496 +            return 1;
 207.497 +        }           	
 207.498 +    }
 207.499  
 207.500      public void insertUpdate(DocumentEvent e) {
 207.501          updateText();
   208.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   208.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/util/TemplateNotFoundException.java	Sun Jun 26 10:25:14 2011 +0800
   208.3 @@ -0,0 +1,29 @@
   208.4 +/*
   208.5 + * The contents of this file are subject to the terms of the Common Development
   208.6 + * and Distribution License (the License). You may not use this file except in
   208.7 + * compliance with the License.
   208.8 + * 
   208.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  208.10 + * or http://www.netbeans.org/cddl.txt.
  208.11 + * 
  208.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
  208.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
  208.14 + * If applicable, add the following below the CDDL Header, with the fields
  208.15 + * enclosed by brackets [] replaced by your own identifying information:
  208.16 + * "Portions Copyrighted [year] [name of copyright owner]"
  208.17 + * 
  208.18 + * Portions Copyrighted 2007 Sun Microsystems, Inc.
  208.19 + */
  208.20 +package org.netbeans.modules.portalpack.servers.websynergy.util;
  208.21 +
  208.22 +/**
  208.23 + * This exception is thrown incase the template is not found for processing.
  208.24 + * @author Satyaranjan
  208.25 + */
  208.26 +public class TemplateNotFoundException extends Exception {
  208.27 +
  208.28 +    public TemplateNotFoundException(String msg) {
  208.29 +        super(msg);
  208.30 +    }
  208.31 +
  208.32 +}
   209.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   209.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/util/TemplateUtil.java	Sun Jun 26 10:25:14 2011 +0800
   209.3 @@ -0,0 +1,214 @@
   209.4 +/*
   209.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   209.6 + * 
   209.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   209.8 + * 
   209.9 + * The contents of this file are subject to the terms of either the GNU
  209.10 + * General Public License Version 2 only ("GPL") or the Common
  209.11 + * Development and Distribution License("CDDL") (collectively, the
  209.12 + * "License"). You may not use this file except in compliance with the
  209.13 + * License. You can obtain a copy of the License at
  209.14 + * http://www.netbeans.org/cddl-gplv2.html
  209.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  209.16 + * specific language governing permissions and limitations under the
  209.17 + * License.  When distributing the software, include this License Header
  209.18 + * Notice in each file and include the License file at
  209.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  209.20 + * particular file as subject to the "Classpath" exception as provided
  209.21 + * by Sun in the GPL Version 2 section of the License file that
  209.22 + * accompanied this code. If applicable, add the following below the
  209.23 + * License Header, with the fields enclosed by brackets [] replaced by
  209.24 + * your own identifying information:
  209.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  209.26 + * 
  209.27 + * If you wish your version of this file to be governed by only the CDDL
  209.28 + * or only the GPL Version 2, indicate your decision by adding
  209.29 + * "[Contributor] elects to include this software in this distribution
  209.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  209.31 + * single choice of license, a recipient has the option to distribute
  209.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  209.33 + * to extend the choice of license to its licensees as provided above.
  209.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  209.35 + * Version 2 license, then the option applies only if the new code is
  209.36 + * made subject to such option by the copyright holder.
  209.37 + * 
  209.38 + * Contributor(s):
  209.39 + * 
  209.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  209.41 + */
  209.42 +package org.netbeans.modules.portalpack.servers.websynergy.util;
  209.43 +
  209.44 +import java.io.IOException;
  209.45 +import java.io.InputStream;
  209.46 +import java.io.InputStreamReader;
  209.47 +import java.io.Reader;
  209.48 +import java.io.Writer;
  209.49 +import java.nio.charset.Charset;
  209.50 +import java.util.Map;
  209.51 +import java.util.logging.Level;
  209.52 +import java.util.logging.Logger;
  209.53 +import javax.script.Bindings;
  209.54 +import javax.script.ScriptContext;
  209.55 +import javax.script.ScriptEngine;
  209.56 +import javax.script.ScriptEngineManager;
  209.57 +import javax.script.ScriptException;
  209.58 +import org.netbeans.api.queries.FileEncodingQuery;
  209.59 +import org.openide.filesystems.FileObject;
  209.60 +import org.openide.filesystems.FileUtil;
  209.61 +import org.openide.filesystems.Repository;
  209.62 +import org.openide.loaders.DataFolder;
  209.63 +import org.openide.loaders.DataObject;
  209.64 +import org.openide.loaders.DataObjectNotFoundException;
  209.65 +
  209.66 +/**
  209.67 + *
  209.68 + * @author satyaranjan
  209.69 + */
  209.70 +public class TemplateUtil {
  209.71 +
  209.72 +    private String templateFolder;
  209.73 +    private FileObject folder;
  209.74 +    private ScriptEngineManager manager;
  209.75 +    private Logger logger = Logger.getLogger(TemplateUtil.class.getName());
  209.76 +
  209.77 +    public TemplateUtil(String templateFolder) {
  209.78 +        this.templateFolder = templateFolder;
  209.79 +    }
  209.80 +
  209.81 +    public FileObject createFileFromTemplate(String templateName, FileObject destObj,
  209.82 +        String fileName, String extentionName) throws TemplateNotFoundException {
  209.83 +        FileObject templateFile = getTemplateFile(templateName);
  209.84 +        if (templateFile == null) {
  209.85 +            throw new TemplateNotFoundException("Template File " + templateName + " not found !!!");
  209.86 +        }
  209.87 +
  209.88 +        if (destObj == null) {
  209.89 +            logger.severe("Destination Object is null !!!");
  209.90 +            return null;
  209.91 +        }
  209.92 +        try {
  209.93 +            return FileUtil.copyFile(templateFile, destObj, fileName, extentionName);
  209.94 +        } catch (IOException ex) {
  209.95 +            logger.log(Level.SEVERE, "Error creating file : " + fileName, ex);
  209.96 +            return null;
  209.97 +        }
  209.98 +
  209.99 +    }
 209.100 +
 209.101 +    public FileObject mergeTemplateToFile(FileObject templateFileObj, FileObject folder, String fileName, Map values)
 209.102 +        throws DataObjectNotFoundException, IOException {
 209.103 +        DataObject dbObj = DataObject.find(templateFileObj);
 209.104 +
 209.105 +        DataFolder folderObj = DataFolder.findFolder(folder);
 209.106 +        DataObject newdobj = dbObj.createFromTemplate(folderObj, fileName, values);
 209.107 +        if (newdobj == null) {
 209.108 +            return null;
 209.109 +        }
 209.110 +        return newdobj.getPrimaryFile();
 209.111 +
 209.112 +    }
 209.113 +
 209.114 +    /**
 209.115 +     * Merge a template into the passed Writer such as <CODE>StringWriter</CODE> .
 209.116 +     * @param template   Template FileObject which is returned from <CODE>TemplateHelper.getTemplateFile(String fileName)</CODE>
 209.117 +     * @param writer Writer to hold the result
 209.118 +     * @param values Map of values
 209.119 +     * 
 209.120 +     * @return void
 209.121 +     **/
 209.122 +    public void mergeTemplateToWriter(FileObject template, Writer writer,
 209.123 +        Map<String, Object> values) throws IOException {
 209.124 +
 209.125 +        ScriptEngine eng = engine(template);
 209.126 +        Bindings bind = eng.getContext().getBindings(ScriptContext.ENGINE_SCOPE);
 209.127 +        bind.putAll(values);
 209.128 +        for (Map.Entry<String, Object> entry : values.entrySet()) {
 209.129 +            eng.getContext().setAttribute(entry.getKey(), entry.getValue(), ScriptContext.ENGINE_SCOPE);
 209.130 +        }
 209.131 +
 209.132 +        Charset sourceEnc = FileEncodingQuery.getEncoding(template);
 209.133 +
 209.134 +        Reader is = null;
 209.135 +        try {
 209.136 +
 209.137 +            eng.getContext().setWriter(writer);
 209.138 +            eng.getContext().setAttribute(FileObject.class.getName(), template, ScriptContext.ENGINE_SCOPE);
 209.139 +            eng.getContext().setAttribute(ScriptEngine.FILENAME, template.getNameExt(), ScriptContext.ENGINE_SCOPE);
 209.140 +            is = new InputStreamReader(template.getInputStream(), sourceEnc);
 209.141 +            eng.eval(is);
 209.142 +        } catch (ScriptException ex) {
 209.143 +            IOException io = new IOException(ex.getMessage());
 209.144 +            io.initCause(ex);
 209.145 +            throw io;
 209.146 +        } finally {
 209.147 +            if (writer != null) {
 209.148 +                writer.close();
 209.149 +            }
 209.150 +            if (is != null) {
 209.151 +                is.close();
 209.152 +            }
 209.153 +        }
 209.154 +
 209.155 +    }
 209.156 +
 209.157 +    private ScriptEngine engine(FileObject fo) {
 209.158 +        Object obj = fo.getAttribute("javax.script.ScriptEngine"); // NOI18N
 209.159 +
 209.160 +        if (obj instanceof ScriptEngine) {
 209.161 +            return (ScriptEngine) obj;
 209.162 +        }
 209.163 +        if (obj instanceof String) {
 209.164 +            synchronized (TemplateUtil.class) {
 209.165 +                if (manager == null) {
 209.166 +                    manager = new ScriptEngineManager();
 209.167 +                }
 209.168 +            }
 209.169 +            return manager.getEngineByName((String) obj);
 209.170 +        }
 209.171 +        return null;
 209.172 +    }
 209.173 +
 209.174 +    public InputStream getResourceStream(String str) throws TemplateNotFoundException {
 209.175 +
 209.176 +        FileObject fo = getTemplateFile(str);
 209.177 +        InputStream is = null;
 209.178 +        try {
 209.179 +            if (fo == null) {
 209.180 +                is = getClass().getResourceAsStream((new StringBuilder()).append("templates/").append(str).toString());
 209.181 +                if (is == null) {
 209.182 +                    throw new TemplateNotFoundException(str);
 209.183 +                }
 209.184 +            } else {
 209.185 +                is = fo.getInputStream();
 209.186 +            }
 209.187 +        } catch (IOException e) {
 209.188 +            throw new TemplateNotFoundException((new StringBuilder()).append(e.getMessage()).append("(").append(str).append(")").toString());
 209.189 +        }
 209.190 +        return is;
 209.191 +    }
 209.192 +
 209.193 +    /**
 209.194 +     * It returns the template FileObject
 209.195 +     * 
 209.196 +     * @param name Template name. Template name is usually specified in the layer.xml 
 209.197 +     * @return Template FileObject
 209.198 +     **/
 209.199 +    public FileObject getTemplateFile(String name) throws TemplateNotFoundException {
 209.200 +        FileObject fo = getFolder() != null ? getFolder().getFileObject(name) : null;
 209.201 +        return fo;
 209.202 +    }
 209.203 +
 209.204 +    public FileObject getFolder() throws TemplateNotFoundException {
 209.205 +        if (templateFolder == null || templateFolder.trim().length() == 0) {
 209.206 +            throw new TemplateNotFoundException("Template Folder is not set.");
 209.207 +        }
 209.208 +        if (folder == null) {
 209.209 +            folder = Repository.getDefault().getDefaultFileSystem().findResource(templateFolder);
 209.210 +        }
 209.211 +        return folder;
 209.212 +    }
 209.213 +
 209.214 +    public void setFolder(FileObject folder) {
 209.215 +        folder = folder;
 209.216 +    }
 209.217 +}
   210.1 --- a/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ws/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   210.2 +++ b/portalpack.servers.websynergy/src/org/netbeans/modules/portalpack/servers/websynergy/ws/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   210.3 @@ -1,2 +1,2 @@
   210.4 -LBL_WebSynergy=Project WebSynergy Server
   210.5 +LBL_WebSynergy=WebSpace 10.x (Project WebSynergy)
   210.6  Sun_Java_System_AppServer_9=GlassFish / Sun Java System AppServer 9.x
   210.7 \ No newline at end of file
   211.1 --- a/portalpack.servers.websynergy/src/templates/liferay-display-400.template	Fri Jun 10 09:46:37 2011 +0200
   211.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   211.3 @@ -1,4 +0,0 @@
   211.4 -<?xml version="1.0" encoding="UTF-8"?>
   211.5 -<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 4.0.0//EN" "http://www.liferay.com/dtd/liferay-display_4_0_0.dtd">
   211.6 -<display>
   211.7 -</display>
   211.8 \ No newline at end of file
   212.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   212.2 +++ b/portalpack.servers.websynergy/src/templates/liferay-display.template	Sun Jun 26 10:25:14 2011 +0800
   212.3 @@ -0,0 +1,4 @@
   212.4 +<?xml version="1.0" encoding="UTF-8"?>
   212.5 +<!DOCTYPE display PUBLIC "-//Liferay//DTD Display <#if VERSION != "">${DTD_VERSION}</#if>//EN" "http://www.liferay.com/dtd/liferay-display_<#if VERSION != "">${VERSION}</#if>.dtd">
   212.6 +<display>
   212.7 +</display>
   212.8 \ No newline at end of file
   213.1 --- a/portalpack.servers.websynergy/src/templates/liferay-plugin-package-430.template	Fri Jun 10 09:46:37 2011 +0200
   213.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   213.3 @@ -1,4 +0,0 @@
   213.4 -<?xml version="1.0" encoding="UTF-8"?>
   213.5 -<!DOCTYPE plugin-package PUBLIC "-//Liferay//DTD Plugin Package 4.3.0//EN" "http://www.liferay.com/dtd/liferay-plugin-package_4_3_0.dtd"> 
   213.6 -<plugin-package>
   213.7 -</plugin-package>
   213.8 \ No newline at end of file
   214.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   214.2 +++ b/portalpack.servers.websynergy/src/templates/liferay-plugin-package.template	Sun Jun 26 10:25:14 2011 +0800
   214.3 @@ -0,0 +1,4 @@
   214.4 +<?xml version="1.0" encoding="UTF-8"?>
   214.5 +<!DOCTYPE plugin-package PUBLIC "-//Liferay//DTD Plugin Package <#if VERSION != "">${DTD_VERSION}</#if>//EN" "http://www.liferay.com/dtd/liferay-plugin-package_<#if VERSION != "">${VERSION}</#if>.dtd">
   214.6 +<plugin-package>
   214.7 +</plugin-package>
   214.8 \ No newline at end of file
   215.1 --- a/portalpack.servers.websynergy/src/templates/liferay-portlet-440.template	Fri Jun 10 09:46:37 2011 +0200
   215.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   215.3 @@ -1,4 +0,0 @@
   215.4 -<?xml version="1.0" encoding="UTF-8"?>
   215.5 -<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 4.4.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_4_4_0.dtd">
   215.6 -<liferay-portlet-app>
   215.7 -</liferay-portlet-app>
   215.8 \ No newline at end of file
   216.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   216.2 +++ b/portalpack.servers.websynergy/src/templates/liferay-portlet.template	Sun Jun 26 10:25:14 2011 +0800
   216.3 @@ -0,0 +1,4 @@
   216.4 +<?xml version="1.0" encoding="UTF-8"?>
   216.5 +<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application <#if VERSION != "">${DTD_VERSION}</#if>//EN" "http://www.liferay.com/dtd/liferay-portlet-app_<#if VERSION != "">${VERSION}</#if>.dtd">
   216.6 +<liferay-portlet-app>
   216.7 +</liferay-portlet-app>
   216.8 \ No newline at end of file
   217.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   217.2 +++ b/portalpack.servers.websynergy/src/templates/portal-developer.properties	Sun Jun 26 10:25:14 2011 +0800
   217.3 @@ -0,0 +1,15 @@
   217.4 +theme.css.fast.load=false
   217.5 +theme.images.fast.load=false
   217.6 +
   217.7 +javascript.fast.load=false
   217.8 +javascript.log.enabled=true
   217.9 +
  217.10 +layout.template.cache.enabled=false
  217.11 +
  217.12 +browser.launcher.url=
  217.13 +
  217.14 +last.modified.check=false
  217.15 +
  217.16 +velocity.engine.resource.manager.cache.enabled=false
  217.17 +
  217.18 +com.liferay.portal.servlet.filters.cache.CacheFilter=false
  217.19 \ No newline at end of file
   218.1 --- a/portalpack.visualweb/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
   218.2 +++ b/portalpack.visualweb/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
   218.3 @@ -2,6 +2,6 @@
   218.4  OpenIDE-Module: org.netbeans.modules.portalpack.visualweb
   218.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/visualweb/layer.xml
   218.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/visualweb/Bundle.properties
   218.7 -OpenIDE-Module-Specification-Version: 1.99
   218.8 +OpenIDE-Module-Specification-Version: 2.0.4
   218.9  OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker
  218.10  
   219.1 --- a/portalpack.visualweb/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
   219.2 +++ b/portalpack.visualweb/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
   219.3 @@ -109,7 +109,7 @@
   219.4                      <build-prerequisite/>
   219.5                      <compile-dependency/>
   219.6                      <run-dependency>
   219.7 -                        <specification-version>2.0.3</specification-version>
   219.8 +                        <specification-version>3.0</specification-version>
   219.9                      </run-dependency>
  219.10                  </dependency>
  219.11                  <dependency>
  219.12 @@ -164,6 +164,15 @@
  219.13                      </run-dependency>
  219.14                  </dependency>
  219.15                  <dependency>
  219.16 +                    <code-name-base>org.netbeans.modules.visualweb.project.jsf</code-name-base>
  219.17 +                    <build-prerequisite/>
  219.18 +                    <compile-dependency/>
  219.19 +                    <run-dependency>
  219.20 +                        <release-version>1</release-version>
  219.21 +                        <specification-version>2.2</specification-version>
  219.22 +                    </run-dependency>
  219.23 +                </dependency>
  219.24 +                <dependency>
  219.25                      <code-name-base>org.openide.actions</code-name-base>
  219.26                      <build-prerequisite/>
  219.27                      <compile-dependency/>
   220.1 --- a/portalpack.visualweb/src/org/netbeans/modules/portalpack/visualweb/layer.xml	Fri Jun 10 09:46:37 2011 +0200
   220.2 +++ b/portalpack.visualweb/src/org/netbeans/modules/portalpack/visualweb/layer.xml	Sun Jun 26 10:25:14 2011 +0800
   220.3 @@ -42,11 +42,6 @@
   220.4  -->
   220.5  <!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
   220.6  <filesystem>
   220.7 -    <folder name="Actions">
   220.8 -        <folder name="Tools">
   220.9 -            <file name="SetPortletModeAction.instance"/>
  220.10 -        </folder>
  220.11 -    </folder>
  220.12      <folder name="Templates">
  220.13          <folder name="JSF">
  220.14              <file name="PortletPage.jsp" url="/org/netbeans/modules/portalpack/visualweb/templates/PortletPage.jsp.template">
  220.15 @@ -84,11 +79,11 @@
  220.16                <folder name="visual">
  220.17                  <folder name="Actions">
  220.18                    <!-- Add Set As Initial Page action -->
  220.19 -                  <file name="SetPortletModeAction.shadow">
  220.20 -                            <attr name="originalFile" stringvalue="Actions/Tools/SetPortletModeAction.instance"/>
  220.21 -                            <attr name="position" intvalue="150"/>
  220.22 -                        </file>
  220.23 -                    </folder>
  220.24 +                  <file name="SetPortletModeAction.instance">
  220.25 +                     <attr name="instanceClass" stringvalue="org.netbeans.modules.portalpack.visualweb.actions.JsfSetAsInitialAction"/>
  220.26 +                     <attr name="position" intvalue="150"/>
  220.27 +                   </file>
  220.28 +                </folder>
  220.29                 </folder>
  220.30                </folder>
  220.31            </folder>
   221.1 --- a/portalpack.visualweb/src/org/netbeans/modules/portalpack/visualweb/templates/PortletPage.jsp.template	Fri Jun 10 09:46:37 2011 +0200
   221.2 +++ b/portalpack.visualweb/src/org/netbeans/modules/portalpack/visualweb/templates/PortletPage.jsp.template	Sun Jun 26 10:25:14 2011 +0800
   221.3 @@ -12,7 +12,7 @@
   221.4      <f:view>
   221.5          <p:portletPage>
   221.6              <div style="-rave-layout: grid; position: relative; height: 400px; width: 400px;">
   221.7 -                <webuijsf:themeLinks binding="${pound}{${folder}${name}.themeLinks1}" id="themeLinks1" webuiAll="true" parseOnLoad="false"/>
   221.8 +                <webuijsf:themeLinks binding="${pound}{${folder}${name}.themeLinks1}" id="themeLinks1" webuiAll="false" parseOnLoad="false"/>
   221.9                  <webuijsf:form binding="${pound}{${folder}${name}.form1}" id="form1">
  221.10                  </webuijsf:form>
  221.11              </div>
   222.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   222.2 +++ b/portalpack.webflow/l10n/build.xml	Sun Jun 26 10:25:14 2011 +0800
   222.3 @@ -0,0 +1,60 @@
   222.4 +<?xml version="1.0" encoding="UTF-8"?>
   222.5 +
   222.6 +<!--
   222.7 +The contents of this file are subject to the terms of the Common Development
   222.8 +and Distribution License (the License). You may not use this file except in
   222.9 +compliance with the License.
  222.10 +
  222.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  222.12 +or http://www.netbeans.org/cddl.txt.
  222.13 +
  222.14 +When distributing Covered Code, include this CDDL Header Notice in each file
  222.15 +and include the License file at http://www.netbeans.org/cddl.txt.
  222.16 +If applicable, add the following below the CDDL Header, with the fields
  222.17 +enclosed by brackets [] replaced by your own identifying information:
  222.18 +"Portions Copyrighted [year] [name of copyright owner]"
  222.19 +
  222.20 + The Original Software is NetBeans. The Initial Developer of the Original
  222.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  222.22 + Microsystems, Inc. All Rights Reserved.
  222.23 +-->
  222.24 +
  222.25 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
  222.26 +<!-- for some information on what you could do (e.g. targets to override). -->
  222.27 +<!-- If you delete this file and reopen the project it will be recreated. -->
  222.28 +<project name="ml-build" default="netbeans" basedir="../">
  222.29 +    
  222.30 +    <description>Portal Pack ML build</description>
  222.31 +    <import file="../build.xml"/>
  222.32 +    <target name="create-l10n-kit">
  222.33 +         <property name="l10nkit-dir" value="build/l10n"/>
  222.34 +         <property name="l10nkit-zip" value="build/portalpack-webflow-l10nkit.zip"/>
  222.35 +         <delete dir="${l10nkit-dir}"/>
  222.36 +         <delete file="${l10nkit-zip}"/>
  222.37 +         
  222.38 +         <mkdir dir="${l10nkit-dir}"/>
  222.39 +         
  222.40 +         <copydir src="src" includes="**/Bundle.properties,**/*.html,**/*.htm" dest="${l10nkit-dir}/src"/>
  222.41 +
  222.42 +         <zip destfile="${l10nkit-zip}"
  222.43 +           basedir="${l10nkit-dir}"
  222.44 +         />
  222.45 +    </target>
  222.46 +    
  222.47 +    <target name="compile" depends="contrib/portalpack.webflow.compile">
  222.48 +        <copy todir="build/classes">
  222.49 +             <fileset dir="l10n/ja"/>
  222.50 +             <fileset dir="l10n/pt_BR"/>
  222.51 +             <fileset dir="l10n/zh_CN"/>  
  222.52 +         </copy>
  222.53 +     </target>
  222.54 +	 
  222.55 +	 <target name="copyL10n">
  222.56 +		 <echo message="${l10n.src.dir}"/>
  222.57 +		 <copy todir=".">
  222.58 +			<fileset dir="${l10n.src.dir}"/>			
  222.59 +			<mapper type="glob" from="src" to="l10n/${locale}"/>
  222.60 +		 </copy>
  222.61 +	 </target>
  222.62 +      
  222.63 +</project>
   223.1 --- a/portalpack.webflow/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
   223.2 +++ b/portalpack.webflow/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
   223.3 @@ -1,2 +1,2 @@
   223.4 -javac.source=1.5
   223.5 +javac.source=1.6
   223.6  javac.compilerargs=-Xlint -Xlint:-serial
   224.1 --- a/portalpack.webflow/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
   224.2 +++ b/portalpack.webflow/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
   224.3 @@ -123,6 +123,14 @@
   224.4                      </run-dependency>
   224.5                  </dependency>
   224.6                  <dependency>
   224.7 +                    <code-name-base>org.openide.util.lookup</code-name-base>
   224.8 +                    <build-prerequisite/>
   224.9 +                    <compile-dependency/>
  224.10 +                    <run-dependency>
  224.11 +                        <specification-version>8.6.1</specification-version>
  224.12 +                    </run-dependency>
  224.13 +                </dependency>
  224.14 +                <dependency>
  224.15                      <code-name-base>org.openide.windows</code-name-base>
  224.16                      <build-prerequisite/>
  224.17                      <compile-dependency/>
   225.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   225.2 +++ b/portalpack.webflow/src/META-INF/services/org.netbeans.modules.portalpack.webflow.api.WebFlowEditorViewFactory	Sun Jun 26 10:25:14 2011 +0800
   225.3 @@ -0,0 +1,2 @@
   225.4 +org.netbeans.modules.portalpack.webflow.WebFlowEditorViewFactoryImpl
   225.5 +org.netbeans.modules.portalpack.webflow.WebFlowEditorViewFactoryStoryBoardImpl
   225.6 \ No newline at end of file
   226.1 --- a/portalpack.webflow/src/org/netbeans/modules/portalpack/webflow/WebFlowEditorViewFactoryImpl.java	Fri Jun 10 09:46:37 2011 +0200
   226.2 +++ b/portalpack.webflow/src/org/netbeans/modules/portalpack/webflow/WebFlowEditorViewFactoryImpl.java	Sun Jun 26 10:25:14 2011 +0800
   226.3 @@ -56,7 +56,6 @@
   226.4   *
   226.5   * @author Joelle Lam
   226.6   */
   226.7 -@org.openide.util.lookup.ServiceProvider(service=org.netbeans.modules.portalpack.webflow.api.WebFlowEditorViewFactory.class)
   226.8  public class WebFlowEditorViewFactoryImpl implements  WebFlowEditorViewFactory {
   226.9      
  226.10      /**
   227.1 --- a/portalpack.webflow/src/org/netbeans/modules/portalpack/webflow/WebFlowEditorViewFactoryStoryBoardImpl.java	Fri Jun 10 09:46:37 2011 +0200
   227.2 +++ b/portalpack.webflow/src/org/netbeans/modules/portalpack/webflow/WebFlowEditorViewFactoryStoryBoardImpl.java	Sun Jun 26 10:25:14 2011 +0800
   227.3 @@ -46,7 +46,6 @@
   227.4   *
   227.5   * @author satyaranjan
   227.6   */
   227.7 -@org.openide.util.lookup.ServiceProvider(service=org.netbeans.modules.portalpack.webflow.api.WebFlowEditorViewFactory.class)
   227.8  public class WebFlowEditorViewFactoryStoryBoardImpl implements  WebFlowEditorViewFactory {
   227.9  
  227.10      public MultiViewDescription createMultiViewDescriptor(WebFlowEditorContext editorContext) {
   228.1 --- a/portalpack.webflow/src/org/netbeans/modules/portalpack/webflow/resources/layer.xml	Fri Jun 10 09:46:37 2011 +0200
   228.2 +++ b/portalpack.webflow/src/org/netbeans/modules/portalpack/webflow/resources/layer.xml	Sun Jun 26 10:25:14 2011 +0800
   228.3 @@ -5,40 +5,31 @@
   228.4          <folder name="text">
   228.5              <folder name="webflow2.0+xml">
   228.6                  <folder name="Actions">
   228.7 -                    <file name="org-openide-actions-CopyAction.shadow">
   228.8 -                        <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-CopyAction.instance"/>
   228.9 +                    <file name="org-openide-actions-CopyAction.instance">
  228.10                          <attr name="position" intvalue="500"/>
  228.11                      </file>
  228.12 -                    <file name="org-openide-actions-CutAction.shadow">
  228.13 -                        <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-CutAction.instance"/>
  228.14 +                    <file name="org-openide-actions-CutAction.instance">
  228.15                          <attr name="position" intvalue="400"/>
  228.16                      </file>
  228.17 -                    <file name="org-openide-actions-DeleteAction.shadow">
  228.18 -                        <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-DeleteAction.instance"/>
  228.19 +                    <file name="org-openide-actions-DeleteAction.instance">
  228.20                          <attr name="position" intvalue="700"/>
  228.21                      </file>
  228.22 -                    <file name="org-openide-actions-FileSystemAction.shadow">
  228.23 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-FileSystemAction.instance"/>
  228.24 +                    <file name="org-openide-actions-FileSystemAction.instance">
  228.25                          <attr name="position" intvalue="200"/>
  228.26                      </file>
  228.27 -                    <file name="org-openide-actions-OpenAction.shadow">
  228.28 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-OpenAction.instance"/>
  228.29 +                    <file name="org-openide-actions-OpenAction.instance">
  228.30                          <attr name="position" intvalue="100"/>
  228.31                      </file>
  228.32 -                    <file name="org-openide-actions-PropertiesAction.shadow">
  228.33 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-PropertiesAction.instance"/>
  228.34 +                    <file name="org-openide-actions-PropertiesAction.instance">
  228.35                          <attr name="position" intvalue="1300"/>
  228.36                      </file>
  228.37 -                    <file name="org-openide-actions-RenameAction.shadow">
  228.38 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-RenameAction.instance"/>
  228.39 +                    <file name="org-openide-actions-RenameAction.instance">
  228.40                          <attr name="position" intvalue="800"/>
  228.41                      </file>
  228.42 -                    <file name="org-openide-actions-SaveAsTemplateAction.shadow">
  228.43 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-SaveAsTemplateAction.instance"/>
  228.44 +                    <file name="org-openide-actions-SaveAsTemplateAction.instance">
  228.45                          <attr name="position" intvalue="1000"/>
  228.46                      </file>
  228.47 -                    <file name="org-openide-actions-ToolsAction.shadow">
  228.48 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-ToolsAction.instance"/>
  228.49 +                    <file name="org-openide-actions-ToolsAction.instance">
  228.50                          <attr name="position" intvalue="1200"/>
  228.51                      </file>
  228.52                      <file name="sep-1.instance">
   229.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   229.2 +++ b/portalpack.websynergy.palette/l10n/build.xml	Sun Jun 26 10:25:14 2011 +0800
   229.3 @@ -0,0 +1,60 @@
   229.4 +<?xml version="1.0" encoding="UTF-8"?>
   229.5 +
   229.6 +<!--
   229.7 +The contents of this file are subject to the terms of the Common Development
   229.8 +and Distribution License (the License). You may not use this file except in
   229.9 +compliance with the License.
  229.10 +
  229.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  229.12 +or http://www.netbeans.org/cddl.txt.
  229.13 +
  229.14 +When distributing Covered Code, include this CDDL Header Notice in each file
  229.15 +and include the License file at http://www.netbeans.org/cddl.txt.
  229.16 +If applicable, add the following below the CDDL Header, with the fields
  229.17 +enclosed by brackets [] replaced by your own identifying information:
  229.18 +"Portions Copyrighted [year] [name of copyright owner]"
  229.19 +
  229.20 + The Original Software is NetBeans. The Initial Developer of the Original
  229.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  229.22 + Microsystems, Inc. All Rights Reserved.
  229.23 +-->
  229.24 +
  229.25 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
  229.26 +<!-- for some information on what you could do (e.g. targets to override). -->
  229.27 +<!-- If you delete this file and reopen the project it will be recreated. -->
  229.28 +<project name="ml-build" default="netbeans" basedir="../">
  229.29 +    
  229.30 +    <description>Portal Pack ML build</description>
  229.31 +    <import file="../build.xml"/>
  229.32 +    <target name="create-l10n-kit">
  229.33 +         <property name="l10nkit-dir" value="build/l10n"/>
  229.34 +         <property name="l10nkit-zip" value="build/portalpack-websynergy-palette-l10nkit.zip"/>
  229.35 +         <delete dir="${l10nkit-dir}"/>
  229.36 +         <delete file="${l10nkit-zip}"/>
  229.37 +         
  229.38 +         <mkdir dir="${l10nkit-dir}"/>
  229.39 +         
  229.40 +         <copydir src="src" includes="**/Bundle.properties,**/*.html,**/*.htm" dest="${l10nkit-dir}/src"/>
  229.41 +
  229.42 +         <zip destfile="${l10nkit-zip}"
  229.43 +           basedir="${l10nkit-dir}"
  229.44 +         />
  229.45 +    </target>
  229.46 +    
  229.47 +    <target name="compile" depends="contrib/portalpack.websynergy.palette.compile">
  229.48 +        <copy todir="build/classes">
  229.49 +             <fileset dir="l10n/ja"/>
  229.50 +             <fileset dir="l10n/pt_BR"/>
  229.51 +             <fileset dir="l10n/zh_CN"/>  
  229.52 +         </copy>
  229.53 +     </target>
  229.54 +	 
  229.55 +	 <target name="copyL10n">
  229.56 +		 <echo message="${l10n.src.dir}"/>
  229.57 +		 <copy todir=".">
  229.58 +			<fileset dir="${l10n.src.dir}"/>			
  229.59 +			<mapper type="glob" from="src" to="l10n/${locale}"/>
  229.60 +		 </copy>
  229.61 +	 </target>
  229.62 +      
  229.63 +</project>
   230.1 --- a/portalpack.websynergy.palette/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
   230.2 +++ b/portalpack.websynergy.palette/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
   230.3 @@ -2,5 +2,5 @@
   230.4  OpenIDE-Module: org.netbeans.modules.portalpack.websynergy.palette
   230.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/websynergy/palette/resources/layer.xml
   230.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/websynergy/palette/resources/Bundle.properties
   230.7 -OpenIDE-Module-Specification-Version: 0.99
   230.8 +OpenIDE-Module-Specification-Version: 1.0.5
   230.9  
   231.1 --- a/portalpack.websynergy.palette/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
   231.2 +++ b/portalpack.websynergy.palette/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
   231.3 @@ -1,2 +1,3 @@
   231.4 -javac.source=1.5
   231.5 +javac.source=1.6
   231.6  javac.compilerargs=-Xlint -Xlint:-serial
   231.7 +nbm.homepage=http://portalpack.netbeans.org
   232.1 --- a/portalpack.websynergy.palette/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
   232.2 +++ b/portalpack.websynergy.palette/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
   232.3 @@ -4,7 +4,7 @@
   232.4      <configuration>
   232.5          <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
   232.6              <code-name-base>org.netbeans.modules.portalpack.websynergy.palette</code-name-base>
   232.7 -             <module-dependencies>
   232.8 +            <module-dependencies>
   232.9                  <dependency>
  232.10                      <code-name-base>org.jdesktop.layout</code-name-base>
  232.11                      <build-prerequisite/>
  232.12 @@ -49,24 +49,6 @@
  232.13                      </run-dependency>
  232.14                  </dependency>
  232.15                  <dependency>
  232.16 -                    <code-name-base>org.netbeans.modules.editor</code-name-base>
  232.17 -                    <build-prerequisite/>
  232.18 -                    <compile-dependency/>
  232.19 -                    <run-dependency>
  232.20 -                        <release-version>3</release-version>
  232.21 -                        <specification-version>1.53</specification-version>
  232.22 -                    </run-dependency>
  232.23 -                </dependency>
  232.24 -                <dependency>
  232.25 -                    <code-name-base>org.netbeans.modules.editor.lib</code-name-base>
  232.26 -                    <build-prerequisite/>
  232.27 -                    <compile-dependency/>
  232.28 -                    <run-dependency>
  232.29 -                        <release-version>3</release-version>
  232.30 -                        <specification-version>3.1</specification-version>
  232.31 -                    </run-dependency>
  232.32 -                </dependency>
  232.33 -                <dependency>
  232.34                      <code-name-base>org.netbeans.modules.java.editor.lib</code-name-base>
  232.35                      <build-prerequisite/>
  232.36                      <compile-dependency/>
   233.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleResourceByPK.xml	Fri Jun 10 09:46:37 2011 +0200
   233.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleResourceByPK.xml	Sun Jun 26 10:25:14 2011 +0800
   233.3 @@ -24,8 +24,8 @@
   233.4  <editor_palette_item version="1.0">
   233.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.ArticleResourceByPK" />
   233.6  
   233.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   233.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   233.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  233.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  233.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  233.12                 display-name-key="NAME_ArticleResourceByPK"
  233.13                 tooltip-key="HINT_ArticleResourceByPK" />
   234.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearch.xml	Fri Jun 10 09:46:37 2011 +0200
   234.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearch.xml	Sun Jun 26 10:25:14 2011 +0800
   234.3 @@ -24,8 +24,8 @@
   234.4  <editor_palette_item version="1.0">
   234.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.ArticleSearch" />
   234.6  
   234.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   234.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   234.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  234.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  234.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  234.12                 display-name-key="NAME_ArticleSearch"
  234.13                 tooltip-key="HINT_ArticleSearch" />
   235.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchByKeywords.xml	Fri Jun 10 09:46:37 2011 +0200
   235.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchByKeywords.xml	Sun Jun 26 10:25:14 2011 +0800
   235.3 @@ -24,8 +24,8 @@
   235.4  <editor_palette_item version="1.0">
   235.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.ArticleSearchByKeywords" />
   235.6  
   235.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   235.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   235.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  235.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  235.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  235.12                 display-name-key="NAME_ArticleSearchByKeywords"
  235.13                 tooltip-key="HINT_ArticleSearchByKeywords" />
   236.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchCount.xml	Fri Jun 10 09:46:37 2011 +0200
   236.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchCount.xml	Sun Jun 26 10:25:14 2011 +0800
   236.3 @@ -24,8 +24,8 @@
   236.4  <editor_palette_item version="1.0">
   236.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.ArticleSearchCount" />
   236.6  
   236.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   236.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   236.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  236.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  236.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  236.12                 display-name-key="NAME_ArticleSearchCount"
  236.13                 tooltip-key="HINT_ArticleSearchCount" />
   237.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchCountByKeywords.xml	Fri Jun 10 09:46:37 2011 +0200
   237.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchCountByKeywords.xml	Sun Jun 26 10:25:14 2011 +0800
   237.3 @@ -24,8 +24,8 @@
   237.4  <editor_palette_item version="1.0">
   237.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.ArticleSearchCountByKeywords" />
   237.6  
   237.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   237.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   237.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  237.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  237.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  237.12                 display-name-key="NAME_ArticleSearchCountByKeywords"
  237.13                 tooltip-key="HINT_ArticleSearchCountByKeywords" />
   238.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articlesById.xml	Fri Jun 10 09:46:37 2011 +0200
   238.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articlesById.xml	Sun Jun 26 10:25:14 2011 +0800
   238.3 @@ -24,8 +24,8 @@
   238.4  <editor_palette_item version="1.0">
   238.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.ArticlesById" />
   238.6  
   238.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   238.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   238.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  238.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  238.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  238.12                 display-name-key="NAME_ArticlesById"
  238.13                 tooltip-key="HINT_ArticlesById" />
   239.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/authContext.xml	Fri Jun 10 09:46:37 2011 +0200
   239.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/authContext.xml	Sun Jun 26 10:25:14 2011 +0800
   239.3 @@ -24,8 +24,8 @@
   239.4  <editor_palette_item version="1.0">
   239.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.AuthContext" />
   239.6  
   239.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   239.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   239.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  239.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  239.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  239.12                 display-name-key="NAME_AuthContext"
  239.13                 tooltip-key="HINT_AuthContext" />
   240.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearch.xml	Fri Jun 10 09:46:37 2011 +0200
   240.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearch.xml	Sun Jun 26 10:25:14 2011 +0800
   240.3 @@ -24,8 +24,8 @@
   240.4  <editor_palette_item version="1.0">
   240.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.FeedSearch" />
   240.6  
   240.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   240.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   240.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  240.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  240.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  240.12                 display-name-key="NAME_FeedSearch"
  240.13                 tooltip-key="HINT_FeedSearch" />
   241.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchByKeywords.xml	Fri Jun 10 09:46:37 2011 +0200
   241.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchByKeywords.xml	Sun Jun 26 10:25:14 2011 +0800
   241.3 @@ -24,8 +24,8 @@
   241.4  <editor_palette_item version="1.0">
   241.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.FeedSearchByKeywords" />
   241.6  
   241.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   241.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   241.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  241.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  241.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  241.12                 display-name-key="NAME_FeedSearchByKeywords"
  241.13                 tooltip-key="HINT_FeedSearchByKeywords" />
   242.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchCount.xml	Fri Jun 10 09:46:37 2011 +0200
   242.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchCount.xml	Sun Jun 26 10:25:14 2011 +0800
   242.3 @@ -24,8 +24,8 @@
   242.4  <editor_palette_item version="1.0">
   242.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.FeedSearchCount" />
   242.6  
   242.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   242.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   242.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  242.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  242.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  242.12                 display-name-key="NAME_FeedSearchCount"
  242.13                 tooltip-key="HINT_FeedSearchCount" />
   243.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchCountByKeywords.xml	Fri Jun 10 09:46:37 2011 +0200
   243.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchCountByKeywords.xml	Sun Jun 26 10:25:14 2011 +0800
   243.3 @@ -24,8 +24,8 @@
   243.4  <editor_palette_item version="1.0">
   243.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.FeedSearchCountByKeywords" />
   243.6  
   243.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   243.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   243.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  243.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  243.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  243.12                 display-name-key="NAME_FeedSearchCountByKeywords"
  243.13                 tooltip-key="HINT_FeedSearchCountByKeywords" />
   244.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/latestArticleById.xml	Fri Jun 10 09:46:37 2011 +0200
   244.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/latestArticleById.xml	Sun Jun 26 10:25:14 2011 +0800
   244.3 @@ -24,8 +24,8 @@
   244.4  <editor_palette_item version="1.0">
   244.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.LatestArticleById" />
   244.6  
   244.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   244.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   244.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  244.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  244.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  244.12                 display-name-key="NAME_LatestArticleById"
  244.13                 tooltip-key="HINT_LatestArticleById" />
   245.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/layoutIdsByArticleId.xml	Fri Jun 10 09:46:37 2011 +0200
   245.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/layoutIdsByArticleId.xml	Sun Jun 26 10:25:14 2011 +0800
   245.3 @@ -24,8 +24,8 @@
   245.4  <editor_palette_item version="1.0">
   245.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.LayoutIdsByArticleId" />
   245.6  
   245.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   245.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   245.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  245.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  245.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  245.12                 display-name-key="NAME_LayoutIdsByArticleId"
  245.13                 tooltip-key="HINT_LayoutIdsByArticleId" />
   246.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureById.xml	Fri Jun 10 09:46:37 2011 +0200
   246.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureById.xml	Sun Jun 26 10:25:14 2011 +0800
   246.3 @@ -24,8 +24,8 @@
   246.4  <editor_palette_item version="1.0">
   246.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.StructureById" />
   246.6  
   246.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   246.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   246.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  246.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  246.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  246.12                 display-name-key="NAME_StructureById"
  246.13                 tooltip-key="HINT_StructureById" />
   247.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearch.xml	Fri Jun 10 09:46:37 2011 +0200
   247.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearch.xml	Sun Jun 26 10:25:14 2011 +0800
   247.3 @@ -24,8 +24,8 @@
   247.4  <editor_palette_item version="1.0">
   247.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.StructureSearch" />
   247.6  
   247.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   247.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   247.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  247.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  247.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  247.12                 display-name-key="NAME_StructureSearch"
  247.13                 tooltip-key="HINT_StructureSearch" />
   248.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchByKeywords.xml	Fri Jun 10 09:46:37 2011 +0200
   248.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchByKeywords.xml	Sun Jun 26 10:25:14 2011 +0800
   248.3 @@ -24,8 +24,8 @@
   248.4  <editor_palette_item version="1.0">
   248.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.StructureSearchByKeywords" />
   248.6  
   248.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   248.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   248.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  248.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  248.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  248.12                 display-name-key="NAME_StructureSearchByKeywords"
  248.13                 tooltip-key="HINT_StructureSearchByKeywords" />
   249.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchCount.xml	Fri Jun 10 09:46:37 2011 +0200
   249.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchCount.xml	Sun Jun 26 10:25:14 2011 +0800
   249.3 @@ -24,8 +24,8 @@
   249.4  <editor_palette_item version="1.0">
   249.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.StructureSearchCount" />
   249.6  
   249.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   249.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   249.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  249.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  249.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  249.12                 display-name-key="NAME_StructureSearchCount"
  249.13                 tooltip-key="HINT_StructureSearchCount" />
   250.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchCountByKeywords.xml	Fri Jun 10 09:46:37 2011 +0200
   250.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchCountByKeywords.xml	Sun Jun 26 10:25:14 2011 +0800
   250.3 @@ -24,8 +24,8 @@
   250.4  <editor_palette_item version="1.0">
   250.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.StructureSearchCountByKeywords" />
   250.6  
   250.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   250.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   250.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  250.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  250.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  250.12                 display-name-key="NAME_StructureSearchCountByKeywords"
  250.13                 tooltip-key="HINT_StructureSearchCountByKeywords" />
   251.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureTemplatesById.xml	Fri Jun 10 09:46:37 2011 +0200
   251.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureTemplatesById.xml	Sun Jun 26 10:25:14 2011 +0800
   251.3 @@ -24,8 +24,8 @@
   251.4  <editor_palette_item version="1.0">
   251.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.StructureTemplatesById" />
   251.6  
   251.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   251.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   251.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  251.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  251.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  251.12                 display-name-key="NAME_StructureTemplatesById"
  251.13                 tooltip-key="HINT_StructureTemplatesById" />
   252.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateById.xml	Fri Jun 10 09:46:37 2011 +0200
   252.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateById.xml	Sun Jun 26 10:25:14 2011 +0800
   252.3 @@ -24,8 +24,8 @@
   252.4  <editor_palette_item version="1.0">
   252.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.TemplateById" />
   252.6  
   252.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   252.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   252.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  252.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  252.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  252.12                 display-name-key="NAME_TemplateById"
  252.13                 tooltip-key="HINT_TemplateById" />
   253.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearch.xml	Fri Jun 10 09:46:37 2011 +0200
   253.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearch.xml	Sun Jun 26 10:25:14 2011 +0800
   253.3 @@ -24,8 +24,8 @@
   253.4  <editor_palette_item version="1.0">
   253.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.TemplateSearch" />
   253.6  
   253.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   253.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   253.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  253.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  253.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  253.12                 display-name-key="NAME_TemplateSearch"
  253.13                 tooltip-key="HINT_TemplateSearch" />
   254.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchByKeywords.xml	Fri Jun 10 09:46:37 2011 +0200
   254.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchByKeywords.xml	Sun Jun 26 10:25:14 2011 +0800
   254.3 @@ -24,8 +24,8 @@
   254.4  <editor_palette_item version="1.0">
   254.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.TemplateSearchByKeywords" />
   254.6  
   254.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   254.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   254.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  254.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  254.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  254.12                 display-name-key="NAME_TemplateSearchByKeywords"
  254.13                 tooltip-key="HINT_TemplateSearchByKeywords" />
   255.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchCount.xml	Fri Jun 10 09:46:37 2011 +0200
   255.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchCount.xml	Sun Jun 26 10:25:14 2011 +0800
   255.3 @@ -24,8 +24,8 @@
   255.4  <editor_palette_item version="1.0">
   255.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.TemplateSearchCount" />
   255.6  
   255.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   255.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   255.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  255.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  255.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  255.12                 display-name-key="NAME_TemplateSearchCount"
  255.13                 tooltip-key="HINT_TemplateSearchCount" />
   256.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchCountByKeywords.xml	Fri Jun 10 09:46:37 2011 +0200
   256.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchCountByKeywords.xml	Sun Jun 26 10:25:14 2011 +0800
   256.3 @@ -24,8 +24,8 @@
   256.4  <editor_palette_item version="1.0">
   256.5      <class name="org.netbeans.modules.portalpack.websynergy.palette.journal.items.TemplateSearchCountByKeywords" />
   256.6  
   256.7 -    <icon16 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
   256.8 -    <icon32 urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
   256.9 +    <icon16 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag16.PNG" />
  256.10 +    <icon32 urlvalue="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/images/journal-tag32.PNG" />
  256.11      <description localizing-bundle="org.netbeans.modules.portalpack.websynergy.palette.journal.items.resources.Bundle"
  256.12                 display-name-key="NAME_TemplateSearchCountByKeywords"
  256.13                 tooltip-key="HINT_TemplateSearchCountByKeywords" />
   257.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/resources/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   257.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/resources/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   257.3 @@ -1,7 +1,7 @@
   257.4  OpenIDE-Module-Display-Category=PortalPack
   257.5  OpenIDE-Module-Long-Description=\
   257.6 -    Common Library Module for WebSynergy specific palette items.
   257.7 -OpenIDE-Module-Name=WebSynergy/Liferay Palette
   257.8 +    Common Library Module for WebSpace specific palette items.
   257.9 +OpenIDE-Module-Name=WebSpace/Liferay Palette
  257.10  
  257.11 -JSPPalette/WebSynergy_Journal=WebSynergy Journal Tags
  257.12 -OpenIDE-Module-Short-Description=WebSynergy Palette
  257.13 +JSPPalette/WebSynergy_Journal=WebSpace Journal Tags
  257.14 +OpenIDE-Module-Short-Description=WebSpace Palette
   258.1 --- a/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/resources/layer.xml	Fri Jun 10 09:46:37 2011 +0200
   258.2 +++ b/portalpack.websynergy.palette/src/org/netbeans/modules/portalpack/websynergy/palette/resources/layer.xml	Sun Jun 26 10:25:14 2011 +0800
   258.3 @@ -5,57 +5,57 @@
   258.4          <folder name="WebSynergy_Journal">
   258.5              <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.portalpack.websynergy.palette.resources.Bundle"/>
   258.6              <attr name="position" intvalue="642"/>
   258.7 -            <file name="articleResourceByPK.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleResourceByPK.xml"/>
   258.8 -			<file name="articlesById.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articlesById.xml"/>
   258.9 -			<file name="articleSearch.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearch.xml"/>
  258.10 -			<file name="articleSearchByKeywords.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchByKeywords.xml"/>
  258.11 -			<file name="articleSearchCount.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchCount.xml"/>
  258.12 -			<file name="articleSearchCountByKeywords.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchCountByKeywords.xml"/>
  258.13 -			<file name="feedSearch.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearch.xml"/>
  258.14 -			<file name="feedSearchByKeywords.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchByKeywords.xml"/>
  258.15 -			<file name="feedSearchCount.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchCount.xml"/>
  258.16 -			<file name="feedSearchCountByKeywords.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchCountByKeywords.xml"/>
  258.17 -			<file name="latestArticleById.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/latestArticleById.xml"/>
  258.18 -			<file name="layoutIdsByArticleId.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/layoutIdsByArticleId.xml"/>
  258.19 -			<file name="structureById.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureById.xml"/>
  258.20 -			<file name="structureSearch.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearch.xml"/>
  258.21 -			<file name="structureSearchByKeywords.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchByKeywords.xml"/>
  258.22 -			<file name="structureSearchCount.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchCount.xml"/>
  258.23 -			<file name="structureSearchCountByKeywords.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchCountByKeywords.xml"/>
  258.24 -			<file name="structureTemplatesById.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureTemplatesById.xml"/>
  258.25 -			<file name="templateById.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateById.xml"/>
  258.26 -			<file name="templateSearch.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearch.xml"/>
  258.27 -			<file name="templateSearchByKeywords.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchByKeywords.xml"/>
  258.28 -			<file name="templateSearchCount.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchCount.xml"/>
  258.29 -			<file name="templateSearchCountByKeywords.xml" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchCountByKeywords.xml"/>			
  258.30 +            <file name="articleResourceByPK.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleResourceByPK.xml"/>
  258.31 +			<file name="articlesById.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articlesById.xml"/>
  258.32 +			<file name="articleSearch.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearch.xml"/>
  258.33 +			<file name="articleSearchByKeywords.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchByKeywords.xml"/>
  258.34 +			<file name="articleSearchCount.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchCount.xml"/>
  258.35 +			<file name="articleSearchCountByKeywords.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/articleSearchCountByKeywords.xml"/>
  258.36 +			<file name="feedSearch.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearch.xml"/>
  258.37 +			<file name="feedSearchByKeywords.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchByKeywords.xml"/>
  258.38 +			<file name="feedSearchCount.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchCount.xml"/>
  258.39 +			<file name="feedSearchCountByKeywords.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/feedSearchCountByKeywords.xml"/>
  258.40 +			<file name="latestArticleById.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/latestArticleById.xml"/>
  258.41 +			<file name="layoutIdsByArticleId.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/layoutIdsByArticleId.xml"/>
  258.42 +			<file name="structureById.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureById.xml"/>
  258.43 +			<file name="structureSearch.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearch.xml"/>
  258.44 +			<file name="structureSearchByKeywords.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchByKeywords.xml"/>
  258.45 +			<file name="structureSearchCount.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchCount.xml"/>
  258.46 +			<file name="structureSearchCountByKeywords.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureSearchCountByKeywords.xml"/>
  258.47 +			<file name="structureTemplatesById.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/structureTemplatesById.xml"/>
  258.48 +			<file name="templateById.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateById.xml"/>
  258.49 +			<file name="templateSearch.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearch.xml"/>
  258.50 +			<file name="templateSearchByKeywords.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchByKeywords.xml"/>
  258.51 +			<file name="templateSearchCount.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchCount.xml"/>
  258.52 +			<file name="templateSearchCountByKeywords.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/items/resources/templateSearchCountByKeywords.xml"/>			
  258.53          </folder>
  258.54      </folder>
  258.55      <folder name="portalpack">
  258.56          <folder name="palette">
  258.57              <folder name="journal">
  258.58 -                <file name="articleResourceByPK.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/articleResourceByPK.template"/>
  258.59 -				<file name="articlesById.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/articlesById.template"/>
  258.60 -				<file name="articleSearch.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/articleSearch.template"/>
  258.61 -				<file name="articleSearchByKeywords.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/articleSearchByKeywords.template"/>
  258.62 -				<file name="articleSearchCount.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/articleSearchCount.template"/>
  258.63 -				<file name="articleSearchCountByKeywords.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/articleSearchCountByKeywords.template"/>
  258.64 -				<file name="feedSearch.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/feedSearch.template"/>
  258.65 -				<file name="feedSearchByKeywords.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/feedSearchByKeywords.template"/>
  258.66 -				<file name="feedSearchCount.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/feedSearchCount.template"/>
  258.67 -				<file name="feedSearchCountByKeywords.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/feedSearchCountByKeywords.template"/>
  258.68 -				<file name="latestArticleById.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/latestArticleById.template"/>
  258.69 -				<file name="layoutIdsByArticleId.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/layoutIdsByArticleId.template"/>
  258.70 -				<file name="structureById.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/structureById.template"/>
  258.71 -				<file name="structureSearch.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/structureSearch.template"/>
  258.72 -				<file name="structureSearchByKeywords.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/structureSearchByKeywords.template"/>
  258.73 -				<file name="structureSearchCount.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/structureSearchCount.template"/>
  258.74 -				<file name="structureSearchCountByKeywords.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/structureSearchCountByKeywords.template"/>
  258.75 -				<file name="structureTemplatesById.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/structureTemplatesById.template"/>
  258.76 -				<file name="templateById.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/templateById.template"/>
  258.77 -				<file name="templateSearch.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/templateSearch.template"/>
  258.78 -				<file name="templateSearchByKeywords.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/templateSearchByKeywords.template"/>
  258.79 -				<file name="templateSearchCount.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/templateSearchCount.template"/>
  258.80 -				<file name="templateSearchCountByKeywords.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/palette/journal/templates/templateSearchCountByKeywords.template"/>				
  258.81 +                <file name="articleResourceByPK.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/articleResourceByPK.template"/>
  258.82 +				<file name="articlesById.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/articlesById.template"/>
  258.83 +				<file name="articleSearch.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/articleSearch.template"/>
  258.84 +				<file name="articleSearchByKeywords.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/articleSearchByKeywords.template"/>
  258.85 +				<file name="articleSearchCount.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/articleSearchCount.template"/>
  258.86 +				<file name="articleSearchCountByKeywords.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/articleSearchCountByKeywords.template"/>
  258.87 +				<file name="feedSearch.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/feedSearch.template"/>
  258.88 +				<file name="feedSearchByKeywords.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/feedSearchByKeywords.template"/>
  258.89 +				<file name="feedSearchCount.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/feedSearchCount.template"/>
  258.90 +				<file name="feedSearchCountByKeywords.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/feedSearchCountByKeywords.template"/>
  258.91 +				<file name="latestArticleById.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/latestArticleById.template"/>
  258.92 +				<file name="layoutIdsByArticleId.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/layoutIdsByArticleId.template"/>
  258.93 +				<file name="structureById.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/structureById.template"/>
  258.94 +				<file name="structureSearch.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/structureSearch.template"/>
  258.95 +				<file name="structureSearchByKeywords.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/structureSearchByKeywords.template"/>
  258.96 +				<file name="structureSearchCount.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/structureSearchCount.template"/>
  258.97 +				<file name="structureSearchCountByKeywords.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/structureSearchCountByKeywords.template"/>
  258.98 +				<file name="structureTemplatesById.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/structureTemplatesById.template"/>
  258.99 +				<file name="templateById.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/templateById.template"/>
 258.100 +				<file name="templateSearch.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/templateSearch.template"/>
 258.101 +				<file name="templateSearchByKeywords.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/templateSearchByKeywords.template"/>
 258.102 +				<file name="templateSearchCount.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/templateSearchCount.template"/>
 258.103 +				<file name="templateSearchCountByKeywords.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/palette/journal/templates/templateSearchCountByKeywords.template"/>				
 258.104              </folder>
 258.105          </folder>
 258.106      </folder>
   259.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   259.2 +++ b/portalpack.websynergy.portlets/l10n/build.xml	Sun Jun 26 10:25:14 2011 +0800
   259.3 @@ -0,0 +1,60 @@
   259.4 +<?xml version="1.0" encoding="UTF-8"?>
   259.5 +
   259.6 +<!--
   259.7 +The contents of this file are subject to the terms of the Common Development
   259.8 +and Distribution License (the License). You may not use this file except in
   259.9 +compliance with the License.
  259.10 +
  259.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  259.12 +or http://www.netbeans.org/cddl.txt.
  259.13 +
  259.14 +When distributing Covered Code, include this CDDL Header Notice in each file
  259.15 +and include the License file at http://www.netbeans.org/cddl.txt.
  259.16 +If applicable, add the following below the CDDL Header, with the fields
  259.17 +enclosed by brackets [] replaced by your own identifying information:
  259.18 +"Portions Copyrighted [year] [name of copyright owner]"
  259.19 +
  259.20 + The Original Software is NetBeans. The Initial Developer of the Original
  259.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  259.22 + Microsystems, Inc. All Rights Reserved.
  259.23 +-->
  259.24 +
  259.25 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
  259.26 +<!-- for some information on what you could do (e.g. targets to override). -->
  259.27 +<!-- If you delete this file and reopen the project it will be recreated. -->
  259.28 +<project name="ml-build" default="netbeans" basedir="../">
  259.29 +    
  259.30 +    <description>Portal Pack ML build</description>
  259.31 +    <import file="../build.xml"/>
  259.32 +    <target name="create-l10n-kit">
  259.33 +         <property name="l10nkit-dir" value="build/l10n"/>
  259.34 +         <property name="l10nkit-zip" value="build/portalpack-websynergy-portlets-l10nkit.zip"/>
  259.35 +         <delete dir="${l10nkit-dir}"/>
  259.36 +         <delete file="${l10nkit-zip}"/>
  259.37 +         
  259.38 +         <mkdir dir="${l10nkit-dir}"/>
  259.39 +         
  259.40 +         <copydir src="src" includes="**/Bundle.properties,**/*.html,**/*.htm" dest="${l10nkit-dir}/src"/>
  259.41 +
  259.42 +         <zip destfile="${l10nkit-zip}"
  259.43 +           basedir="${l10nkit-dir}"
  259.44 +         />
  259.45 +    </target>
  259.46 +    
  259.47 +    <target name="compile" depends="contrib/portalpack.websynergy.portlets.compile">
  259.48 +        <copy todir="build/classes">
  259.49 +             <fileset dir="l10n/ja"/>
  259.50 +             <fileset dir="l10n/pt_BR"/>
  259.51 +             <fileset dir="l10n/zh_CN"/>  
  259.52 +         </copy>
  259.53 +     </target>
  259.54 +	 
  259.55 +	 <target name="copyL10n">
  259.56 +		 <echo message="${l10n.src.dir}"/>
  259.57 +		 <copy todir=".">
  259.58 +			<fileset dir="${l10n.src.dir}"/>			
  259.59 +			<mapper type="glob" from="src" to="l10n/${locale}"/>
  259.60 +		 </copy>
  259.61 +	 </target>
  259.62 +      
  259.63 +</project>
   260.1 --- a/portalpack.websynergy.portlets/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
   260.2 +++ b/portalpack.websynergy.portlets/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
   260.3 @@ -3,5 +3,5 @@
   260.4  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/websynergy/portlets/resources/layer.xml
   260.5  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/websynergy/portlets/resources/Bundle.properties
   260.6  OpenIDE-Module-Install: org/netbeans/modules/portalpack/websynergy/portlets/ruby/PluginInstall.class
   260.7 -OpenIDE-Module-Specification-Version: 0.99
   260.8 +OpenIDE-Module-Specification-Version: 1.0.5
   260.9  
   261.1 --- a/portalpack.websynergy.portlets/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
   261.2 +++ b/portalpack.websynergy.portlets/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
   261.3 @@ -1,2 +1,3 @@
   261.4  javac.compilerargs=-Xlint -Xlint:-serial
   261.5 -javac.source=1.5
   261.6 +javac.source=1.6
   261.7 +nbm.homepage=http://portalpack.netbeans.org
   262.1 --- a/portalpack.websynergy.portlets/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
   262.2 +++ b/portalpack.websynergy.portlets/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
   262.3 @@ -33,6 +33,15 @@
   262.4                      </run-dependency>
   262.5                  </dependency>
   262.6                  <dependency>
   262.7 +                    <code-name-base>org.netbeans.api.progress</code-name-base>
   262.8 +                    <build-prerequisite/>
   262.9 +                    <compile-dependency/>
  262.10 +                    <run-dependency>
  262.11 +                        <release-version>1</release-version>
  262.12 +                        <specification-version>1.12.1</specification-version>
  262.13 +                    </run-dependency>
  262.14 +                </dependency>
  262.15 +                <dependency>
  262.16                      <code-name-base>org.netbeans.api.web.webmodule</code-name-base>
  262.17                      <build-prerequisite/>
  262.18                      <compile-dependency/>
  262.19 @@ -41,6 +50,32 @@
  262.20                      </run-dependency>
  262.21                  </dependency>
  262.22                  <dependency>
  262.23 +                    <code-name-base>org.netbeans.libs.javacapi</code-name-base>
  262.24 +                    <build-prerequisite/>
  262.25 +                    <compile-dependency/>
  262.26 +                    <run-dependency>
  262.27 +                        <specification-version>0.7.1</specification-version>
  262.28 +                    </run-dependency>
  262.29 +                </dependency>
  262.30 +                <dependency>
  262.31 +                    <code-name-base>org.netbeans.modules.editor</code-name-base>
  262.32 +                    <build-prerequisite/>
  262.33 +                    <compile-dependency/>
  262.34 +                    <run-dependency>
  262.35 +                        <release-version>3</release-version>
  262.36 +                        <specification-version>1.41.1</specification-version>
  262.37 +                    </run-dependency>
  262.38 +                </dependency>
  262.39 +                <dependency>
  262.40 +                    <code-name-base>org.netbeans.modules.editor.completion</code-name-base>
  262.41 +                    <build-prerequisite/>
  262.42 +                    <compile-dependency/>
  262.43 +                    <run-dependency>
  262.44 +                        <release-version>1</release-version>
  262.45 +                        <specification-version>1.13.1</specification-version>
  262.46 +                    </run-dependency>
  262.47 +                </dependency>
  262.48 +                <dependency>
  262.49                      <code-name-base>org.netbeans.modules.j2eeserver</code-name-base>
  262.50                      <build-prerequisite/>
  262.51                      <compile-dependency/>
  262.52 @@ -58,6 +93,23 @@
  262.53                      </run-dependency>
  262.54                  </dependency>
  262.55                  <dependency>
  262.56 +                    <code-name-base>org.netbeans.modules.java.source</code-name-base>
  262.57 +                    <build-prerequisite/>
  262.58 +                    <compile-dependency/>
  262.59 +                    <run-dependency>
  262.60 +                        <specification-version>0.40.1</specification-version>
  262.61 +                    </run-dependency>
  262.62 +                </dependency>
  262.63 +                <dependency>
  262.64 +                    <code-name-base>org.netbeans.modules.java.sourceui</code-name-base>
  262.65 +                    <build-prerequisite/>
  262.66 +                    <compile-dependency/>
  262.67 +                    <run-dependency>
  262.68 +                        <release-version>1</release-version>
  262.69 +                        <specification-version>1.6.1</specification-version>
  262.70 +                    </run-dependency>
  262.71 +                </dependency>
  262.72 +                <dependency>
  262.73                      <code-name-base>org.netbeans.modules.portalpack.commons</code-name-base>
  262.74                      <build-prerequisite/>
  262.75                      <compile-dependency/>
  262.76 @@ -70,7 +122,23 @@
  262.77                      <build-prerequisite/>
  262.78                      <compile-dependency/>
  262.79                      <run-dependency>
  262.80 -                        <specification-version>2.92</specification-version>
  262.81 +                        <specification-version>3.0</specification-version>
  262.82 +                    </run-dependency>
  262.83 +                </dependency>
  262.84 +                <dependency>
  262.85 +                    <code-name-base>org.netbeans.modules.portalpack.servers.base_psframework</code-name-base>
  262.86 +                    <build-prerequisite/>
  262.87 +                    <compile-dependency/>
  262.88 +                    <run-dependency>
  262.89 +                        <specification-version>3.0</specification-version>
  262.90 +                    </run-dependency>
  262.91 +                </dependency>
  262.92 +                <dependency>
  262.93 +                    <code-name-base>org.netbeans.modules.portalpack.servers.websynergy</code-name-base>
  262.94 +                    <build-prerequisite/>
  262.95 +                    <compile-dependency/>
  262.96 +                    <run-dependency>
  262.97 +                        <specification-version>1.0</specification-version>
  262.98                      </run-dependency>
  262.99                  </dependency>
 262.100                  <dependency>
 262.101 @@ -161,7 +229,6 @@
 262.102                      <compile-dependency/>
 262.103                      <run-dependency>
 262.104                          <specification-version>7.0</specification-version>
 262.105 -                        <!-- For NB 7.0 specification-version>7.19</specification-version -->
 262.106                      </run-dependency>
 262.107                  </dependency>
 262.108                  <dependency>
 262.109 @@ -194,6 +261,14 @@
 262.110                          <specification-version>6.2</specification-version>
 262.111                      </run-dependency>
 262.112                  </dependency>
 262.113 +                <dependency>
 262.114 +                    <code-name-base>org.openide.util.lookup</code-name-base>
 262.115 +                    <build-prerequisite/>
 262.116 +                    <compile-dependency/>
 262.117 +                    <run-dependency>
 262.118 +                        <specification-version>8.6.1</specification-version>
 262.119 +                    </run-dependency>
 262.120 +                </dependency>
 262.121              </module-dependencies>
 262.122              <public-packages/>
 262.123          </data>
   263.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   263.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/WebSpacePrivilegedTemplates.java	Sun Jun 26 10:25:14 2011 +0800
   263.3 @@ -0,0 +1,55 @@
   263.4 +/*
   263.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   263.6 + * 
   263.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   263.8 + * 
   263.9 + * The contents of this file are subject to the terms of either the GNU
  263.10 + * General Public License Version 2 only ("GPL") or the Common
  263.11 + * Development and Distribution License("CDDL") (collectively, the
  263.12 + * "License"). You may not use this file except in compliance with the
  263.13 + * License. You can obtain a copy of the License at
  263.14 + * http://www.netbeans.org/cddl-gplv2.html
  263.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  263.16 + * specific language governing permissions and limitations under the
  263.17 + * License.  When distributing the software, include this License Header
  263.18 + * Notice in each file and include the License file at
  263.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  263.20 + * particular file as subject to the "Classpath" exception as provided
  263.21 + * by Sun in the GPL Version 2 section of the License file that
  263.22 + * accompanied this code. If applicable, add the following below the
  263.23 + * License Header, with the fields enclosed by brackets [] replaced by
  263.24 + * your own identifying information:
  263.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  263.26 + * 
  263.27 + * If you wish your version of this file to be governed by only the CDDL
  263.28 + * or only the GPL Version 2, indicate your decision by adding
  263.29 + * "[Contributor] elects to include this software in this distribution
  263.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  263.31 + * single choice of license, a recipient has the option to distribute
  263.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  263.33 + * to extend the choice of license to its licensees as provided above.
  263.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  263.35 + * Version 2 license, then the option applies only if the new code is
  263.36 + * made subject to such option by the copyright holder.
  263.37 + * 
  263.38 + * Contributor(s):
  263.39 + * 
  263.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  263.41 + */
  263.42 +
  263.43 +package org.netbeans.modules.portalpack.websynergy.portlets;
  263.44 +
  263.45 +import org.netbeans.modules.web.api.webmodule.WebModule;
  263.46 +import org.netbeans.modules.web.spi.webmodule.WebPrivilegedTemplates;
  263.47 +
  263.48 +/**
  263.49 + *
  263.50 + * @author Santh Chetan Chadalavada
  263.51 + */
  263.52 +public class WebSpacePrivilegedTemplates implements WebPrivilegedTemplates {
  263.53 +    public String[] getPrivilegedTemplates(WebModule webModule) {
  263.54 +         return new String[] {
  263.55 +             "hook/WebSynergyPortlets/HookAction.java", // NOI18N
  263.56 +         };
  263.57 +    }
  263.58 +}
   264.1 --- a/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/groovy/resources/Groovy.html	Fri Jun 10 09:46:37 2011 +0200
   264.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/groovy/resources/Groovy.html	Sun Jun 26 10:25:14 2011 +0800
   264.3 @@ -6,6 +6,6 @@
   264.4  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
   264.5  <html>
   264.6    <body>
   264.7 -         Creates a Groovy Portlet - This portlet can be deployed on Project WebSynergy, Liferay Portal Server.
   264.8 +         Creates a Groovy Portlet - This portlet can be deployed on Sun Glassfish Web Space Server, Liferay Portal Server.
   264.9    </body>
  264.10  </html> 
   265.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   265.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   265.3 @@ -0,0 +1,41 @@
   265.4 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   265.5 +# 
   265.6 +# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   265.7 +# 
   265.8 +# The contents of this file are subject to the terms of either the GNU
   265.9 +# General Public License Version 2 only ("GPL") or the Common
  265.10 +# Development and Distribution License("CDDL") (collectively, the
  265.11 +# "License"). You may not use this file except in compliance with the
  265.12 +# License. You can obtain a copy of the License at
  265.13 +# http://www.netbeans.org/cddl-gplv2.html
  265.14 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  265.15 +# specific language governing permissions and limitations under the
  265.16 +# License.  When distributing the software, include this License Header
  265.17 +# Notice in each file and include the License file at
  265.18 +# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  265.19 +# particular file as subject to the "Classpath" exception as provided
  265.20 +# by Sun in the GPL Version 2 section of the License file that
  265.21 +# accompanied this code. If applicable, add the following below the
  265.22 +# License Header, with the fields enclosed by brackets [] replaced by
  265.23 +# your own identifying information:
  265.24 +# "Portions Copyrighted [year] [name of copyright owner]"
  265.25 +# 
  265.26 +# If you wish your version of this file to be governed by only the CDDL
  265.27 +# or only the GPL Version 2, indicate your decision by adding
  265.28 +# "[Contributor] elects to include this software in this distribution
  265.29 +# under the [CDDL or GPL Version 2] license." If you do not indicate a
  265.30 +# single choice of license, a recipient has the option to distribute
  265.31 +# your version of this file under either the CDDL, the GPL Version 2 or
  265.32 +# to extend the choice of license to its licensees as provided above.
  265.33 +# However, if you add GPL Version 2 code and therefore, elected the GPL
  265.34 +# Version 2 license, then the option applies only if the new code is
  265.35 +# made subject to such option by the copyright holder.
  265.36 +# 
  265.37 +# Contributor(s):
  265.38 +# 
  265.39 +# Portions Copyrighted 2008 Sun Microsystems, Inc.
  265.40 +
  265.41 +Templates/WebSynergyPortlets/HookAction.java=Hook Plugin
  265.42 +MSG_JsfPortletSupportImpl_PORTLETDDNOTFOUND=portlet.xml is not found
  265.43 +HOOK_PORTLET_TYPE=Hook Plugin
  265.44 +HOOK_PORTLET_TYPE_DESC=Create a Hook Plugin
  265.45 \ No newline at end of file
   266.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   266.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/api/ConfigPanel.java	Sun Jun 26 10:25:14 2011 +0800
   266.3 @@ -0,0 +1,145 @@
   266.4 +/*
   266.5 +  * The contents of this file are subject to the terms of the Common Development
   266.6 +  * and Distribution License (the License). You may not use this file except in
   266.7 +  * compliance with the License.
   266.8 +  *
   266.9 +  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  266.10 +  * or http://www.netbeans.org/cddl.txt.
  266.11 +  *
  266.12 +  * When distributing Covered Code, include this CDDL Header Notice in each file
  266.13 +  * and include the License file at http://www.netbeans.org/cddl.txt.
  266.14 +  * If applicable, add the following below the CDDL Header, with the fields
  266.15 +  * enclosed by brackets [] replaced by your own identifying information:
  266.16 +  * "Portions Copyrighted [year] [name of copyright owner]"
  266.17 +  *
  266.18 +  * The Original Software is NetBeans. The Initial Developer of the Original
  266.19 +  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  266.20 +  * Microsystems, Inc. All Rights Reserved.
  266.21 +  */
  266.22 +
  266.23 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.api;
  266.24 +
  266.25 +import java.util.ArrayList;
  266.26 +import java.util.HashSet;
  266.27 +import java.util.Iterator;
  266.28 +import javax.swing.SwingUtilities;
  266.29 +import javax.swing.JPanel;
  266.30 +import javax.swing.event.ChangeEvent;
  266.31 +import javax.swing.event.ChangeListener;
  266.32 +import org.openide.WizardDescriptor;
  266.33 +import org.openide.util.HelpCtx;
  266.34 +import org.openide.util.RequestProcessor;
  266.35 +import java.awt.Component;
  266.36 +
  266.37 +/**
  266.38 + * This class can be extended to implement your own Server Config Panel.
  266.39 + * 
  266.40 + * @author Satya
  266.41 + */
  266.42 +public abstract class ConfigPanel extends JPanel {
  266.43 +    
  266.44 +    public ConfigPanel()
  266.45 +    {
  266.46 +        
  266.47 +    }
  266.48 +
  266.49 +    public Component getComponent() {
  266.50 +        return this;
  266.51 +    }
  266.52 +
  266.53 +    public HelpCtx getHelp() {
  266.54 +        return null;
  266.55 +    }
  266.56 +
  266.57 +    public void stateChanged(ChangeEvent e) {
  266.58 +        fireChangeEvent();
  266.59 +    }
  266.60 +    
  266.61 +    public final void readSettings(WizardDescriptor wizardDescriptor) {
  266.62 +        read(wizardDescriptor);
  266.63 +    }
  266.64 +
  266.65 +    public final void writeSettings(WizardDescriptor wizardDescriptor) {
  266.66 +        store(wizardDescriptor);
  266.67 +    }
  266.68 +    protected abstract void read(WizardDescriptor wizardDescriptor);
  266.69 +
  266.70 +    /**
  266.71 +     * This method is called to store configuration properties.
  266.72 +     * @param wizardDescriptor Instance properties are set in wizardDescriptor
  266.73 +     *
  266.74 +     * Sample implementation for this method looks like below
  266.75 +     * <code>
  266.76 +     *  WizardPropertyReader wr = new WizardPropertyReader(d);
  266.77 +     *  wr.setAdminUser("admin");
  266.78 +     *  //set other configured property for the server instance
  266.79 +     * </code>
  266.80 +     */
  266.81 +    protected abstract void store(WizardDescriptor wizardDescriptor);
  266.82 +
  266.83 +    /**
  266.84 +     * Validate input value in the config panel
  266.85 +     * @return true if the input values are valid
  266.86 +     *         false if the input values are not valid
  266.87 +     */
  266.88 +    public abstract boolean validate(WizardDescriptor wizardDescriptor);
  266.89 +    
  266.90 +    /**
  266.91 +     * @return description shown for the server config panel.
  266.92 +     */
  266.93 +    protected abstract String getDescription();
  266.94 +        
  266.95 +  
  266.96 +    private ArrayList/*<ChangeListener.*/ listenrs = new ArrayList/*<Changelisteners.*/();
  266.97 +    
  266.98 +    public final void addChangeListener(ChangeListener l) {
  266.99 +        synchronized (listenrs) {
 266.100 +            listenrs.add(l);
 266.101 +        }
 266.102 +    }
 266.103 +    
 266.104 +    public final void removeChangeListener(ChangeListener l ) {
 266.105 +       // System.out.println("Removing....."+l+" to configpanel listener list.........");
 266.106 +        synchronized (listenrs) {
 266.107 +            listenrs.remove(l);
 266.108 +        }
 266.109 +    }
 266.110 +    
 266.111 +    RequestProcessor.Task changeEvent = null;
 266.112 +    
 266.113 +    /**
 266.114 +     * This method can be called whenever the input values are changed
 266.115 +     * or framework needs to know about the new changed value or 
 266.116 +     * validation result.
 266.117 +     */
 266.118 +    public final void fireChangeEvent() {
 266.119 +        // don't go so fast here, since this can get called a lot from the
 266.120 +        // document listener
 266.121 +                
 266.122 +        if (changeEvent == null) {
 266.123 +            changeEvent = RequestProcessor.getDefault().post(new Runnable() {
 266.124 +                public void run() {
 266.125 +                    SwingUtilities.invokeLater(new Runnable() {
 266.126 +                        public void run() {
 266.127 +                            Iterator it;
 266.128 +                            synchronized (listenrs) {
 266.129 +                                it = new HashSet(listenrs).iterator();
 266.130 +                            }
 266.131 +                            ChangeEvent ev = new ChangeEvent(this);
 266.132 +                            while (it.hasNext()) {
 266.133 +                                ((ChangeListener)it.next()).stateChanged(ev);
 266.134 +                            }
 266.135 +                        }
 266.136 +                    });
 266.137 +                    
 266.138 +                }
 266.139 +            }, 100);
 266.140 +        } else {
 266.141 +            changeEvent.schedule(100);
 266.142 +        }
 266.143 +    }
 266.144 +    
 266.145 +    public void setErrorMessage(WizardDescriptor wizardDescriptor,String msg) {
 266.146 +        wizardDescriptor.putProperty("WizardPanel_errorMessage",msg);
 266.147 +    }
 266.148 +}
   267.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   267.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/api/DefaultConfigPanel.java	Sun Jun 26 10:25:14 2011 +0800
   267.3 @@ -0,0 +1,89 @@
   267.4 +/*
   267.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   267.6 + * 
   267.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   267.8 + * 
   267.9 + * The contents of this file are subject to the terms of either the GNU
  267.10 + * General Public License Version 2 only ("GPL") or the Common
  267.11 + * Development and Distribution License("CDDL") (collectively, the
  267.12 + * "License"). You may not use this file except in compliance with the
  267.13 + * License. You can obtain a copy of the License at
  267.14 + * http://www.netbeans.org/cddl-gplv2.html
  267.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  267.16 + * specific language governing permissions and limitations under the
  267.17 + * License.  When distributing the software, include this License Header
  267.18 + * Notice in each file and include the License file at
  267.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  267.20 + * particular file as subject to the "Classpath" exception as provided
  267.21 + * by Sun in the GPL Version 2 section of the License file that
  267.22 + * accompanied this code. If applicable, add the following below the
  267.23 + * License Header, with the fields enclosed by brackets [] replaced by
  267.24 + * your own identifying information:
  267.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  267.26 + * 
  267.27 + * If you wish your version of this file to be governed by only the CDDL
  267.28 + * or only the GPL Version 2, indicate your decision by adding
  267.29 + * "[Contributor] elects to include this software in this distribution
  267.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  267.31 + * single choice of license, a recipient has the option to distribute
  267.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  267.33 + * to extend the choice of license to its licensees as provided above.
  267.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  267.35 + * Version 2 license, then the option applies only if the new code is
  267.36 + * made subject to such option by the copyright holder.
  267.37 + * 
  267.38 + * Contributor(s):
  267.39 + * 
  267.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  267.41 + */
  267.42 +
  267.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.api;
  267.44 +
  267.45 +import java.awt.Component;
  267.46 +import javax.swing.event.ChangeEvent;
  267.47 +import org.openide.WizardDescriptor;
  267.48 +import org.openide.util.HelpCtx;
  267.49 +
  267.50 +/**
  267.51 + *
  267.52 + * @author satyaranjan
  267.53 + */
  267.54 +public class DefaultConfigPanel extends ConfigPanel{
  267.55 +
  267.56 +    @Override
  267.57 +    public void read(WizardDescriptor wizardDescriptor) {
  267.58 +       //do nothing
  267.59 +    }
  267.60 +
  267.61 +    @Override
  267.62 +    public void store(WizardDescriptor wizardDescriptor) {
  267.63 +        
  267.64 +    }
  267.65 +
  267.66 +    @Override
  267.67 +    public boolean validate(WizardDescriptor wizardDescriptor) {
  267.68 +        setErrorMessage(wizardDescriptor, "");
  267.69 +        return true;
  267.70 +    }
  267.71 +
  267.72 +    @Override
  267.73 +    public String getDescription() {
  267.74 +        return "";
  267.75 +    }
  267.76 +
  267.77 +    @Override
  267.78 +    public Component getComponent() {
  267.79 +        return this;
  267.80 +    }
  267.81 +
  267.82 +    @Override
  267.83 +    public HelpCtx getHelp() {
  267.84 +        return null;
  267.85 +    }
  267.86 +
  267.87 +    @Override
  267.88 +    public void stateChanged(ChangeEvent e) {
  267.89 +        
  267.90 +    }
  267.91 +
  267.92 +}
   268.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   268.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/api/HookType.java	Sun Jun 26 10:25:14 2011 +0800
   268.3 @@ -0,0 +1,76 @@
   268.4 +/*
   268.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   268.6 + * 
   268.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   268.8 + * 
   268.9 + * The contents of this file are subject to the terms of either the GNU
  268.10 + * General Public License Version 2 only ("GPL") or the Common
  268.11 + * Development and Distribution License("CDDL") (collectively, the
  268.12 + * "License"). You may not use this file except in compliance with the
  268.13 + * License. You can obtain a copy of the License at
  268.14 + * http://www.netbeans.org/cddl-gplv2.html
  268.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  268.16 + * specific language governing permissions and limitations under the
  268.17 + * License.  When distributing the software, include this License Header
  268.18 + * Notice in each file and include the License file at
  268.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  268.20 + * particular file as subject to the "Classpath" exception as provided
  268.21 + * by Sun in the GPL Version 2 section of the License file that
  268.22 + * accompanied this code. If applicable, add the following below the
  268.23 + * License Header, with the fields enclosed by brackets [] replaced by
  268.24 + * your own identifying information:
  268.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  268.26 + * 
  268.27 + * If you wish your version of this file to be governed by only the CDDL
  268.28 + * or only the GPL Version 2, indicate your decision by adding
  268.29 + * "[Contributor] elects to include this software in this distribution
  268.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  268.31 + * single choice of license, a recipient has the option to distribute
  268.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  268.33 + * to extend the choice of license to its licensees as provided above.
  268.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  268.35 + * Version 2 license, then the option applies only if the new code is
  268.36 + * made subject to such option by the copyright holder.
  268.37 + * 
  268.38 + * Contributor(s):
  268.39 + * 
  268.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  268.41 + */
  268.42 +
  268.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.api;
  268.44 +
  268.45 +/**
  268.46 + *
  268.47 + * @author satyaranjan
  268.48 + */
  268.49 +public class HookType {
  268.50 +    
  268.51 +    public static String EVENT_HANDLER_HOOK = "Event Handler Hook";
  268.52 +    public static String MODEL_LISTENERS_HOOK = "Model Listeners Hook";
  268.53 +    public static String PORTAL_PROPERTIES_HOOK = "Portal Properties Hook";
  268.54 +    public static String JSP_HOOK = "Jsp Hook";
  268.55 +    
  268.56 +    public String hookType;
  268.57 +    public HookType(String hookType) {
  268.58 +        this.hookType = hookType;
  268.59 +    }
  268.60 +
  268.61 +    @Override
  268.62 +    public String toString() {
  268.63 +        return hookType;
  268.64 +    }
  268.65 +    
  268.66 +    public String getType() {
  268.67 +        return hookType;
  268.68 +    }
  268.69 +
  268.70 +    @Override
  268.71 +    public boolean equals(Object obj) {
  268.72 +        if(!(obj instanceof HookType))
  268.73 +            return false;
  268.74 +        if(((HookType)obj).getType().equals(getType()))
  268.75 +                return true;
  268.76 +        return false;
  268.77 +    }
  268.78 +
  268.79 +}
   269.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   269.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/api/HookTypeFactory.java	Sun Jun 26 10:25:14 2011 +0800
   269.3 @@ -0,0 +1,82 @@
   269.4 +/*
   269.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   269.6 + * 
   269.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   269.8 + * 
   269.9 + * The contents of this file are subject to the terms of either the GNU
  269.10 + * General Public License Version 2 only ("GPL") or the Common
  269.11 + * Development and Distribution License("CDDL") (collectively, the
  269.12 + * "License"). You may not use this file except in compliance with the
  269.13 + * License. You can obtain a copy of the License at
  269.14 + * http://www.netbeans.org/cddl-gplv2.html
  269.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  269.16 + * specific language governing permissions and limitations under the
  269.17 + * License.  When distributing the software, include this License Header
  269.18 + * Notice in each file and include the License file at
  269.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  269.20 + * particular file as subject to the "Classpath" exception as provided
  269.21 + * by Sun in the GPL Version 2 section of the License file that
  269.22 + * accompanied this code. If applicable, add the following below the
  269.23 + * License Header, with the fields enclosed by brackets [] replaced by
  269.24 + * your own identifying information:
  269.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  269.26 + * 
  269.27 + * If you wish your version of this file to be governed by only the CDDL
  269.28 + * or only the GPL Version 2, indicate your decision by adding
  269.29 + * "[Contributor] elects to include this software in this distribution
  269.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  269.31 + * single choice of license, a recipient has the option to distribute
  269.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  269.33 + * to extend the choice of license to its licensees as provided above.
  269.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  269.35 + * Version 2 license, then the option applies only if the new code is
  269.36 + * made subject to such option by the copyright holder.
  269.37 + * 
  269.38 + * Contributor(s):
  269.39 + * 
  269.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  269.41 + */
  269.42 +
  269.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.api;
  269.44 +
  269.45 +import java.util.Set;
  269.46 +import org.netbeans.api.project.Project;
  269.47 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.handlers.events.EventHandlerTypeHandler;
  269.48 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.handlers.model.ModelListenerTypeHandler;
  269.49 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.handlers.portalproperties.PortalPropertiesTypeHandler;
  269.50 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.jsp.JSPHookTypeHandler;
  269.51 +import org.openide.WizardDescriptor;
  269.52 +import org.openide.filesystems.FileObject;
  269.53 +
  269.54 +/**
  269.55 + *
  269.56 + * @author Santh Chetan Chadalavada
  269.57 + */
  269.58 +public class HookTypeFactory {
  269.59 +    
  269.60 +    public static HookTypeHandler getHookTypeHandler(Project project,HookType hookType) {
  269.61 +        
  269.62 +        if(hookType.getType().equals(HookType.EVENT_HANDLER_HOOK)) {
  269.63 +            return new EventHandlerTypeHandler(project);
  269.64 +        } else if(hookType.getType().equals(HookType.MODEL_LISTENERS_HOOK)) {
  269.65 +            return new ModelListenerTypeHandler(project);
  269.66 +        } else if(hookType.getType().equals(HookType.PORTAL_PROPERTIES_HOOK)) {
  269.67 +            return new PortalPropertiesTypeHandler(project);
  269.68 +        } else if(hookType.getType().equals(HookType.JSP_HOOK)) {
  269.69 +            return new JSPHookTypeHandler(project);
  269.70 +        } else
  269.71 +            return new HookTypeHandler() {
  269.72 +
  269.73 +            @Override
  269.74 +            public void addHookDefinition(FileObject hookXML, WizardDescriptor desc) {
  269.75 +                
  269.76 +            }
  269.77 +
  269.78 +            @Override
  269.79 +            public void createAdditionalFiles(Project project, WizardDescriptor desc, Set result) {
  269.80 +                
  269.81 +            }
  269.82 +        };
  269.83 +    }
  269.84 +
  269.85 +}
   270.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   270.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/api/HookTypeHandler.java	Sun Jun 26 10:25:14 2011 +0800
   270.3 @@ -0,0 +1,87 @@
   270.4 +/*
   270.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   270.6 + * 
   270.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   270.8 + * 
   270.9 + * The contents of this file are subject to the terms of either the GNU
  270.10 + * General Public License Version 2 only ("GPL") or the Common
  270.11 + * Development and Distribution License("CDDL") (collectively, the
  270.12 + * "License"). You may not use this file except in compliance with the
  270.13 + * License. You can obtain a copy of the License at
  270.14 + * http://www.netbeans.org/cddl-gplv2.html
  270.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  270.16 + * specific language governing permissions and limitations under the
  270.17 + * License.  When distributing the software, include this License Header
  270.18 + * Notice in each file and include the License file at
  270.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  270.20 + * particular file as subject to the "Classpath" exception as provided
  270.21 + * by Sun in the GPL Version 2 section of the License file that
  270.22 + * accompanied this code. If applicable, add the following below the
  270.23 + * License Header, with the fields enclosed by brackets [] replaced by
  270.24 + * your own identifying information:
  270.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  270.26 + * 
  270.27 + * If you wish your version of this file to be governed by only the CDDL
  270.28 + * or only the GPL Version 2, indicate your decision by adding
  270.29 + * "[Contributor] elects to include this software in this distribution
  270.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  270.31 + * single choice of license, a recipient has the option to distribute
  270.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  270.33 + * to extend the choice of license to its licensees as provided above.
  270.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  270.35 + * Version 2 license, then the option applies only if the new code is
  270.36 + * made subject to such option by the copyright holder.
  270.37 + * 
  270.38 + * Contributor(s):
  270.39 + * 
  270.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  270.41 + */
  270.42 +
  270.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.api;
  270.44 +
  270.45 +import java.util.Set;
  270.46 +import org.netbeans.api.project.Project;
  270.47 +import org.netbeans.modules.portalpack.websynergy.portlets.util.TemplateNotFoundException;
  270.48 +import org.netbeans.modules.portalpack.websynergy.portlets.util.TemplateUtil;
  270.49 +import org.netbeans.modules.web.api.webmodule.WebModule;
  270.50 +import org.netbeans.spi.project.ui.templates.support.Templates;
  270.51 +import org.openide.WizardDescriptor;
  270.52 +import org.openide.filesystems.FileObject;
  270.53 +import org.openide.util.Exceptions;
  270.54 +
  270.55 +/**
  270.56 + *
  270.57 + * @author satyaranjan
  270.58 + * @author Santh Chetan Chadalavada
  270.59 + */
  270.60 +public abstract class HookTypeHandler {
  270.61 +    
  270.62 +    
  270.63 +    public WizardDescriptor.Panel getConfigPanel() {
  270.64 +        return new WizardDescriptorPanelWrapper(new DefaultConfigPanel());
  270.65 +    }
  270.66 +    
  270.67 +    public void addHook(WebModule wm, WizardDescriptor desc, Set result) {
  270.68 +        if(wm == null)
  270.69 +            return;
  270.70 +        
  270.71 +        String LIFERAY_HOOK_XML = "liferay-hook";
  270.72 +        FileObject webInf = wm.getWebInf();
  270.73 +        FileObject hookXml = webInf.getFileObject(LIFERAY_HOOK_XML, "xml");
  270.74 +        if(hookXml == null) {
  270.75 +            try {
  270.76 +                //create HookXML
  270.77 +                TemplateUtil templateUtil = new TemplateUtil("hook/templates");
  270.78 +                hookXml = templateUtil.createFileFromTemplate("liferayhook.template", webInf, LIFERAY_HOOK_XML, "xml");
  270.79 +            } catch (TemplateNotFoundException ex) {
  270.80 +                Exceptions.printStackTrace(ex);
  270.81 +            }
  270.82 +        }
  270.83 +        addHookDefinition(hookXml, desc);
  270.84 +        createAdditionalFiles(Templates.getProject(desc), desc, result);
  270.85 +    }
  270.86 +    //add entry to hook xml
  270.87 +    public abstract void addHookDefinition(FileObject hookXml, WizardDescriptor desc);
  270.88 +    public abstract void createAdditionalFiles(Project project, WizardDescriptor desc, Set result);
  270.89 +    
  270.90 +}
   271.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   271.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/api/WizardDescriptorPanelWrapper.java	Sun Jun 26 10:25:14 2011 +0800
   271.3 @@ -0,0 +1,142 @@
   271.4 +/*
   271.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   271.6 + * 
   271.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   271.8 + * 
   271.9 + * The contents of this file are subject to the terms of either the GNU
  271.10 + * General Public License Version 2 only ("GPL") or the Common
  271.11 + * Development and Distribution License("CDDL") (collectively, the
  271.12 + * "License"). You may not use this file except in compliance with the
  271.13 + * License. You can obtain a copy of the License at
  271.14 + * http://www.netbeans.org/cddl-gplv2.html
  271.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  271.16 + * specific language governing permissions and limitations under the
  271.17 + * License.  When distributing the software, include this License Header
  271.18 + * Notice in each file and include the License file at
  271.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  271.20 + * particular file as subject to the "Classpath" exception as provided
  271.21 + * by Sun in the GPL Version 2 section of the License file that
  271.22 + * accompanied this code. If applicable, add the following below the
  271.23 + * License Header, with the fields enclosed by brackets [] replaced by
  271.24 + * your own identifying information:
  271.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  271.26 + * 
  271.27 + * If you wish your version of this file to be governed by only the CDDL
  271.28 + * or only the GPL Version 2, indicate your decision by adding
  271.29 + * "[Contributor] elects to include this software in this distribution
  271.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  271.31 + * single choice of license, a recipient has the option to distribute
  271.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  271.33 + * to extend the choice of license to its licensees as provided above.
  271.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  271.35 + * Version 2 license, then the option applies only if the new code is
  271.36 + * made subject to such option by the copyright holder.
  271.37 + * 
  271.38 + * Contributor(s):
  271.39 + * 
  271.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  271.41 + */
  271.42 +
  271.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.api;
  271.44 +
  271.45 +import java.awt.Component;
  271.46 +import java.util.ArrayList;
  271.47 +import java.util.HashSet;
  271.48 +import java.util.Iterator;
  271.49 +import javax.swing.SwingUtilities;
  271.50 +import javax.swing.event.ChangeEvent;
  271.51 +import javax.swing.event.ChangeListener;
  271.52 +import org.openide.WizardDescriptor;
  271.53 +import org.openide.WizardValidationException;
  271.54 +import org.openide.util.HelpCtx;
  271.55 +import org.openide.util.RequestProcessor;
  271.56 +
  271.57 +/**
  271.58 + *
  271.59 + * @author admin
  271.60 + */
  271.61 +public class WizardDescriptorPanelWrapper implements WizardDescriptor.Panel, ChangeListener{
  271.62 +    
  271.63 +    private ConfigPanel configPanel;
  271.64 +    private WizardDescriptor wd;
  271.65 +    public WizardDescriptorPanelWrapper(ConfigPanel configPanel) {
  271.66 +        this.configPanel = configPanel;
  271.67 +        this.configPanel.addChangeListener(this);
  271.68 +    }
  271.69 +
  271.70 +    public Component getComponent() {
  271.71 +        return configPanel;
  271.72 +    }
  271.73 +
  271.74 +    public HelpCtx getHelp() {
  271.75 +        return null;
  271.76 +    }
  271.77 +
  271.78 +    public void readSettings(Object settings) {
  271.79 +        this.wd = (WizardDescriptor)settings;
  271.80 +        configPanel.read(wd);
  271.81 +    }
  271.82 +
  271.83 +    public void storeSettings(Object settings) {
  271.84 +        configPanel.store(wd);
  271.85 +    }
  271.86 +     
  271.87 +    public boolean isValid() {
  271.88 +        getComponent();
  271.89 +        return configPanel.validate(wd); 
  271.90 +    }
  271.91 +
  271.92 +     private ArrayList/*<ChangeListener.*/ listenrs = new ArrayList/*<Changelisteners.*/();
  271.93 +    
  271.94 +    public final void addChangeListener(ChangeListener l) {
  271.95 +        synchronized (listenrs) {
  271.96 +            listenrs.add(l);
  271.97 +        }
  271.98 +    }
  271.99 +    
 271.100 +    public final void removeChangeListener(ChangeListener l ) {
 271.101 +       // System.out.println("Removing....."+l+" to configpanel listener list.........");
 271.102 +        synchronized (listenrs) {
 271.103 +            listenrs.remove(l);
 271.104 +        }
 271.105 +    }
 271.106 +    
 271.107 +    RequestProcessor.Task changeEvent = null;
 271.108 +    
 271.109 +    /**
 271.110 +     * This method can be called whenever the input values are changed
 271.111 +     * or framework needs to know about the new changed value or 
 271.112 +     * validation result.
 271.113 +     */
 271.114 +    public final void fireChangeEvent() {
 271.115 +        // don't go so fast here, since this can get called a lot from the
 271.116 +        // document listener
 271.117 +                
 271.118 +        if (changeEvent == null) {
 271.119 +            changeEvent = RequestProcessor.getDefault().post(new Runnable() {
 271.120 +                public void run() {
 271.121 +                    SwingUtilities.invokeLater(new Runnable() {
 271.122 +                        public void run() {
 271.123 +                            Iterator it;
 271.124 +                            synchronized (listenrs) {
 271.125 +                                it = new HashSet(listenrs).iterator();
 271.126 +                            }
 271.127 +                            ChangeEvent ev = new ChangeEvent(this);
 271.128 +                            while (it.hasNext()) {
 271.129 +                                ((ChangeListener)it.next()).stateChanged(ev);
 271.130 +                            }
 271.131 +                        }
 271.132 +                    });
 271.133 +                    
 271.134 +                }
 271.135 +            }, 100);
 271.136 +        } else {
 271.137 +            changeEvent.schedule(100);
 271.138 +        }
 271.139 +    }
 271.140 +
 271.141 +    public void stateChanged(ChangeEvent e) {
 271.142 +        fireChangeEvent();
 271.143 +    }
 271.144 +
 271.145 +}
   272.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   272.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/events/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   272.3 @@ -0,0 +1,1 @@
   272.4 +EventHandlerConfigPanel.jLabel2.text=Event Type:
   273.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   273.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/events/EventHandlerConfigPanel.form	Sun Jun 26 10:25:14 2011 +0800
   273.3 @@ -0,0 +1,57 @@
   273.4 +<?xml version="1.0" encoding="UTF-8" ?>
   273.5 +
   273.6 +<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
   273.7 +  <AuxValues>
   273.8 +    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
   273.9 +    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
  273.10 +    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
  273.11 +    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
  273.12 +    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
  273.13 +    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
  273.14 +    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
  273.15 +    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
  273.16 +    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
  273.17 +  </AuxValues>
  273.18 +
  273.19 +  <Layout>
  273.20 +    <DimensionLayout dim="0">
  273.21 +      <Group type="103" groupAlignment="0" attributes="0">
  273.22 +          <Group type="102" alignment="0" attributes="0">
  273.23 +              <EmptySpace max="-2" attributes="0"/>
  273.24 +              <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
  273.25 +              <EmptySpace type="unrelated" max="-2" attributes="0"/>
  273.26 +              <Component id="eventTypeCB" min="-2" pref="226" max="-2" attributes="0"/>
  273.27 +              <EmptySpace max="32767" attributes="0"/>
  273.28 +          </Group>
  273.29 +      </Group>
  273.30 +    </DimensionLayout>
  273.31 +    <DimensionLayout dim="1">
  273.32 +      <Group type="103" groupAlignment="0" attributes="0">
  273.33 +          <Group type="102" attributes="0">
  273.34 +              <EmptySpace max="-2" attributes="0"/>
  273.35 +              <Group type="103" groupAlignment="3" attributes="0">
  273.36 +                  <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
  273.37 +                  <Component id="eventTypeCB" alignment="3" min="-2" max="-2" attributes="0"/>
  273.38 +              </Group>
  273.39 +              <EmptySpace max="32767" attributes="0"/>
  273.40 +          </Group>
  273.41 +      </Group>
  273.42 +    </DimensionLayout>
  273.43 +  </Layout>
  273.44 +  <SubComponents>
  273.45 +    <Component class="javax.swing.JLabel" name="jLabel2">
  273.46 +      <Properties>
  273.47 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  273.48 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/events/Bundle.properties" key="EventHandlerConfigPanel.jLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  273.49 +        </Property>
  273.50 +      </Properties>
  273.51 +    </Component>
  273.52 +    <Component class="javax.swing.JComboBox" name="eventTypeCB">
  273.53 +      <Properties>
  273.54 +        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
  273.55 +          <StringArray count="0"/>
  273.56 +        </Property>
  273.57 +      </Properties>
  273.58 +    </Component>
  273.59 +  </SubComponents>
  273.60 +</Form>
   274.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   274.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/events/EventHandlerConfigPanel.java	Sun Jun 26 10:25:14 2011 +0800
   274.3 @@ -0,0 +1,140 @@
   274.4 +/*
   274.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   274.6 + * 
   274.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   274.8 + * 
   274.9 + * The contents of this file are subject to the terms of either the GNU
  274.10 + * General Public License Version 2 only ("GPL") or the Common
  274.11 + * Development and Distribution License("CDDL") (collectively, the
  274.12 + * "License"). You may not use this file except in compliance with the
  274.13 + * License. You can obtain a copy of the License at
  274.14 + * http://www.netbeans.org/cddl-gplv2.html
  274.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  274.16 + * specific language governing permissions and limitations under the
  274.17 + * License.  When distributing the software, include this License Header
  274.18 + * Notice in each file and include the License file at
  274.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  274.20 + * particular file as subject to the "Classpath" exception as provided
  274.21 + * by Sun in the GPL Version 2 section of the License file that
  274.22 + * accompanied this code. If applicable, add the following below the
  274.23 + * License Header, with the fields enclosed by brackets [] replaced by
  274.24 + * your own identifying information:
  274.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  274.26 + * 
  274.27 + * If you wish your version of this file to be governed by only the CDDL
  274.28 + * or only the GPL Version 2, indicate your decision by adding
  274.29 + * "[Contributor] elects to include this software in this distribution
  274.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  274.31 + * single choice of license, a recipient has the option to distribute
  274.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  274.33 + * to extend the choice of license to its licensees as provided above.
  274.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  274.35 + * Version 2 license, then the option applies only if the new code is
  274.36 + * made subject to such option by the copyright holder.
  274.37 + * 
  274.38 + * Contributor(s):
  274.39 + * 
  274.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  274.41 + */
  274.42 +
  274.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.handlers.events;
  274.44 +
  274.45 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.ConfigPanel;
  274.46 +import org.openide.WizardDescriptor;
  274.47 +
  274.48 +/**
  274.49 + *
  274.50 + * @author satyaranjan
  274.51 + * @author Santh Chetan Chadalavada
  274.52 + */
  274.53 +public class EventHandlerConfigPanel extends ConfigPanel {
  274.54 +
  274.55 +    public static String APPLICATION_STARTUP_EVENTS = "application.startup.events";
  274.56 +    public static String LOGIN_EVENTS_PRE = "login.events.pre";
  274.57 +    public static String LOGIN_EVENTS_POST = "login.events.post";
  274.58 +    public static String SERVLET_SERVICE_EVENTS_PRE = "servlet.service.events.pre";
  274.59 +    public static String SERVLET_SERVICE_EVENTS_POST = "servlet.service.events.post";
  274.60 +    public static String LOGOUT_EVENTS_PRE = "logout.events.post";
  274.61 +    public static String LOGOUT_EVENTS_POST = "logout.events.pre";
  274.62 +    
  274.63 +    /** Creates new form EventHandlerConfigPanel */
  274.64 +    public EventHandlerConfigPanel() {
  274.65 +        initComponents();
  274.66 +        initData();
  274.67 +    }
  274.68 +    
  274.69 +    private void initData() {
  274.70 +        eventTypeCB.addItem(APPLICATION_STARTUP_EVENTS);
  274.71 +        eventTypeCB.addItem(LOGIN_EVENTS_PRE);
  274.72 +        eventTypeCB.addItem(LOGIN_EVENTS_POST);
  274.73 +        eventTypeCB.addItem(LOGOUT_EVENTS_PRE);
  274.74 +        eventTypeCB.addItem(LOGOUT_EVENTS_POST);
  274.75 +        eventTypeCB.addItem(SERVLET_SERVICE_EVENTS_PRE);
  274.76 +        eventTypeCB.addItem(SERVLET_SERVICE_EVENTS_POST);
  274.77 +    }
  274.78 +
  274.79 +    /** This method is called from within the constructor to
  274.80 +     * initialize the form.
  274.81 +     * WARNING: Do NOT modify this code. The content of this method is
  274.82 +     * always regenerated by the Form Editor.
  274.83 +     */
  274.84 +    @SuppressWarnings("unchecked")
  274.85 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  274.86 +    private void initComponents() {
  274.87 +
  274.88 +        jLabel2 = new javax.swing.JLabel();
  274.89 +        eventTypeCB = new javax.swing.JComboBox();
  274.90 +
  274.91 +        jLabel2.setText(org.openide.util.NbBundle.getMessage(EventHandlerConfigPanel.class, "EventHandlerConfigPanel.jLabel2.text")); // NOI18N
  274.92 +
  274.93 +        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
  274.94 +        this.setLayout(layout);
  274.95 +        layout.setHorizontalGroup(
  274.96 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  274.97 +            .add(layout.createSequentialGroup()
  274.98 +                .addContainerGap()
  274.99 +                .add(jLabel2)
 274.100 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
 274.101 +                .add(eventTypeCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 226, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 274.102 +                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 274.103 +        );
 274.104 +        layout.setVerticalGroup(
 274.105 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 274.106 +            .add(layout.createSequentialGroup()
 274.107 +                .addContainerGap()
 274.108 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 274.109 +                    .add(jLabel2)
 274.110 +                    .add(eventTypeCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 274.111 +                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 274.112 +        );
 274.113 +    }// </editor-fold>//GEN-END:initComponents
 274.114 +
 274.115 +
 274.116 +    // Variables declaration - do not modify//GEN-BEGIN:variables
 274.117 +    private javax.swing.JComboBox eventTypeCB;
 274.118 +    private javax.swing.JLabel jLabel2;
 274.119 +    // End of variables declaration//GEN-END:variables
 274.120 +
 274.121 +    @Override
 274.122 +    public void read(WizardDescriptor wizardDescriptor) {
 274.123 +        
 274.124 +    }
 274.125 +
 274.126 +    @Override
 274.127 +    public void store(WizardDescriptor wizardDescriptor) {
 274.128 +        wizardDescriptor.putProperty("event_type", eventTypeCB.getSelectedItem());
 274.129 +    }
 274.130 +
 274.131 +    @Override
 274.132 +    public boolean validate(WizardDescriptor wizardDescriptor) {
 274.133 +        return true;
 274.134 +    }
 274.135 +
 274.136 +    @Override
 274.137 +    public String getDescription() {
 274.138 +        return "test panel";
 274.139 +    }
 274.140 +
 274.141 +   
 274.142 +
 274.143 +}
   275.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   275.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/events/EventHandlerTypeHandler.java	Sun Jun 26 10:25:14 2011 +0800
   275.3 @@ -0,0 +1,163 @@
   275.4 +/*
   275.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   275.6 + * 
   275.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   275.8 + * 
   275.9 + * The contents of this file are subject to the terms of either the GNU
  275.10 + * General Public License Version 2 only ("GPL") or the Common
  275.11 + * Development and Distribution License("CDDL") (collectively, the
  275.12 + * "License"). You may not use this file except in compliance with the
  275.13 + * License. You can obtain a copy of the License at
  275.14 + * http://www.netbeans.org/cddl-gplv2.html
  275.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  275.16 + * specific language governing permissions and limitations under the
  275.17 + * License.  When distributing the software, include this License Header
  275.18 + * Notice in each file and include the License file at
  275.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  275.20 + * particular file as subject to the "Classpath" exception as provided
  275.21 + * by Sun in the GPL Version 2 section of the License file that
  275.22 + * accompanied this code. If applicable, add the following below the
  275.23 + * License Header, with the fields enclosed by brackets [] replaced by
  275.24 + * your own identifying information:
  275.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  275.26 + * 
  275.27 + * If you wish your version of this file to be governed by only the CDDL
  275.28 + * or only the GPL Version 2, indicate your decision by adding
  275.29 + * "[Contributor] elects to include this software in this distribution
  275.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  275.31 + * single choice of license, a recipient has the option to distribute
  275.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  275.33 + * to extend the choice of license to its licensees as provided above.
  275.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  275.35 + * Version 2 license, then the option applies only if the new code is
  275.36 + * made subject to such option by the copyright holder.
  275.37 + * 
  275.38 + * Contributor(s):
  275.39 + * 
  275.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  275.41 + */
  275.42 +
  275.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.handlers.events;
  275.44 +
  275.45 +import java.io.IOException;
  275.46 +import java.util.HashMap;
  275.47 +import java.util.Map;
  275.48 +import java.util.Set;
  275.49 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.handlers.*;
  275.50 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.HookTypeHandler;
  275.51 +import org.netbeans.api.java.project.JavaProjectConstants;
  275.52 +import org.netbeans.api.project.Project;
  275.53 +import org.netbeans.api.project.ProjectUtils;
  275.54 +import org.netbeans.api.project.SourceGroup;
  275.55 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.actions.util.PortletProjectUtils;
  275.56 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.WizardDescriptorPanelWrapper;
  275.57 +import org.netbeans.modules.portalpack.websynergy.portlets.util.PluginXMLUtil;
  275.58 +import org.netbeans.modules.portalpack.websynergy.portlets.util.PortalPropertyUtil;
  275.59 +import org.netbeans.modules.portalpack.websynergy.portlets.util.TemplateUtil;
  275.60 +import org.netbeans.spi.java.project.support.ui.templates.JavaTemplates;
  275.61 +import org.netbeans.spi.project.ui.templates.support.Templates;
  275.62 +import org.openide.WizardDescriptor;
  275.63 +import org.openide.WizardDescriptor.Panel;
  275.64 +import org.openide.filesystems.FileObject;
  275.65 +import org.openide.filesystems.FileUtil;
  275.66 +import org.openide.loaders.DataObjectNotFoundException;
  275.67 +import org.openide.util.Exceptions;
  275.68 +
  275.69 +/**
  275.70 + *
  275.71 + * @author satyaranjan
  275.72 + * @author Santh Chetan Chadalavada
  275.73 + */
  275.74 +public class EventHandlerTypeHandler extends HookTypeHandler{
  275.75 +
  275.76 +    private Project project;
  275.77 +    
  275.78 +    public EventHandlerTypeHandler(Project project) {
  275.79 +        this.project = project;
  275.80 +    }
  275.81 +
  275.82 +    @Override
  275.83 +    public Panel getConfigPanel() {
  275.84 +        SourceGroup[] sourceGroups = ProjectUtils.getSources(project).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
  275.85 +        return JavaTemplates.
  275.86 +                createPackageChooser(project, sourceGroups, new WizardDescriptorPanelWrapper( new EventHandlerConfigPanel()));
  275.87 +    }
  275.88 +
  275.89 +    @Override
  275.90 +    public void createAdditionalFiles(Project project, WizardDescriptor desc, Set result) {
  275.91 +        Map values = new HashMap();
  275.92 +        String className = Templates.getTargetName(desc);
  275.93 +        FileObject packageName = Templates.getTargetFolder(desc);
  275.94 +        String pkgName = PortletProjectUtils.getPackage(packageName);
  275.95 +        values.put("PACKAGE", pkgName);
  275.96 +        values.put("CLASS_NAME", className);
  275.97 +        
  275.98 +        
  275.99 +        TemplateUtil templateUtil = new TemplateUtil("hook/templates");
 275.100 +        String evntHookType = (String)desc.getProperty("event_type");
 275.101 +        try {
 275.102 +            FileObject evntFO;
 275.103 +            if ("application.startup.events".equals(evntHookType)) {
 275.104 +                FileObject startupEvntHookPluginTemplate = templateUtil.getTemplateFile("startupEvntHookPlugin.java");
 275.105 +
 275.106 +                evntFO = templateUtil.mergeTemplateToFile(startupEvntHookPluginTemplate, packageName, className, values);
 275.107 +            } else {
 275.108 +                FileObject evntHookPluginTemplate = templateUtil.getTemplateFile("evntHookPlugin.java");
 275.109 +
 275.110 +                evntFO = templateUtil.mergeTemplateToFile(evntHookPluginTemplate, packageName, className, values);
 275.111 +            }
 275.112 +            result.add(evntFO);
 275.113 +            
 275.114 +        } catch (org.netbeans.modules.portalpack.websynergy.portlets.util.TemplateNotFoundException ex) {
 275.115 +            Exceptions.printStackTrace(ex);
 275.116 +        } catch (DataObjectNotFoundException ex) {
 275.117 +            Exceptions.printStackTrace(ex);
 275.118 +        } catch (IOException ex) {
 275.119 +            Exceptions.printStackTrace(ex);
 275.120 +        } 
 275.121 +        
 275.122 +    }
 275.123 +
 275.124 +    @Override
 275.125 +    public void addHookDefinition(FileObject hookXml, WizardDescriptor desc) {
 275.126 +        if (hookXml == null)
 275.127 +            return;
 275.128 +        
 275.129 +        //PluginXMLUtil util = new PluginXMLUtil(hookXml);
 275.130 +        String className = Templates.getTargetName(desc);
 275.131 +        
 275.132 +        FileObject packageName = Templates.getTargetFolder(desc);
 275.133 +        String pkgName = PortletProjectUtils.getPackage(packageName);
 275.134 +        if (pkgName != null && pkgName.trim().length() != 0)
 275.135 +        {
 275.136 +            className = pkgName + "." + className;
 275.137 +        }
 275.138 +        //util.addEventHandlerHook(className, (String)desc.getProperty("event_type"));
 275.139 +        //util.store();
 275.140 +        
 275.141 +        //Adding property to portal.properties for 5.2
 275.142 +        
 275.143 +        String PORTAL_PROPERTIES = "portal";
 275.144 +        FileObject srcRoot = PortletProjectUtils.getSourceRoot(project);//getWebModule(project).getWebInf();
 275.145 +        FileObject ppFO = srcRoot.getFileObject(PORTAL_PROPERTIES, "properties");
 275.146 +        if (ppFO == null) {
 275.147 +            try {
 275.148 +                TemplateUtil templateUtil = new TemplateUtil("hook/templates");
 275.149 +                ppFO = templateUtil.createFileFromTemplate("portalproperties.template", srcRoot, PORTAL_PROPERTIES, "properties");
 275.150 +                //result.add(ppFO);
 275.151 +            } catch (org.netbeans.modules.portalpack.websynergy.portlets.util.TemplateNotFoundException ex) {
 275.152 +                Exceptions.printStackTrace(ex);
 275.153 +            } 
 275.154 +        }
 275.155 +        try{
 275.156 +            PluginXMLUtil util = new PluginXMLUtil(hookXml);
 275.157 +            if(util.addPortalPropsHandlerHook()) {
 275.158 +                util.store();
 275.159 +            }
 275.160 +        }catch(Exception e) {
 275.161 +            Exceptions.printStackTrace(e);
 275.162 +        }
 275.163 +        PortalPropertyUtil.addProperty(FileUtil.toFile(ppFO), (String)desc.getProperty("event_type"), className);
 275.164 +    }
 275.165 +
 275.166 +}
   276.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   276.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/model/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   276.3 @@ -0,0 +1,41 @@
   276.4 +
   276.5 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   276.6 + 
   276.7 +# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   276.8 + 
   276.9 +# The contents of this file are subject to the terms of either the GNU
  276.10 +# General Public License Version 2 only ("GPL") or the Common
  276.11 +# Development and Distribution License("CDDL") (collectively, the
  276.12 +# "License"). You may not use this file except in compliance with the
  276.13 +# License. You can obtain a copy of the License at
  276.14 +# http://www.netbeans.org/cddl-gplv2.html
  276.15 +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  276.16 +# specific language governing permissions and limitations under the
  276.17 +# License.  When distributing the software, include this License Header
  276.18 +# Notice in each file and include the License file at
  276.19 +# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  276.20 +# particular file as subject to the "Classpath" exception as provided
  276.21 +# by Sun in the GPL Version 2 section of the License file that
  276.22 +# accompanied this code. If applicable, add the following below the
  276.23 +# License Header, with the fields enclosed by brackets [] replaced by
  276.24 +# your own identifying information:
  276.25 +# "Portions Copyrighted [year] [name of copyright owner]"
  276.26 + 
  276.27 +# If you wish your version of this file to be governed by only the CDDL
  276.28 +# or only the GPL Version 2, indicate your decision by adding
  276.29 +# "[Contributor] elects to include this software in this distribution
  276.30 +# under the [CDDL or GPL Version 2] license." If you do not indicate a
  276.31 +# single choice of license, a recipient has the option to distribute
  276.32 +# your version of this file under either the CDDL, the GPL Version 2 or
  276.33 +# to extend the choice of license to its licensees as provided above.
  276.34 +# However, if you add GPL Version 2 code and therefore, elected the GPL
  276.35 +# Version 2 license, then the option applies only if the new code is
  276.36 +# made subject to such option by the copyright holder.
  276.37 + 
  276.38 +# Contributor(s):
  276.39 + 
  276.40 +# Portions Copyrighted 2009 Sun Microsystems, Inc.
  276.41 +ModelListenerConfigPanel.jLabel2.text=Model Name:
  276.42 +ModelListenerConfigPanel.SearchButton.text=Search
  276.43 +ModelListenerConfigPanel.mdlLsnrTB.text=
  276.44 +INVALID_MODEL_CLASS=Invalid Model Class
   277.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   277.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/model/ModelListenerConfigPanel.form	Sun Jun 26 10:25:14 2011 +0800
   277.3 @@ -0,0 +1,72 @@
   277.4 +<?xml version="1.0" encoding="UTF-8" ?>
   277.5 +
   277.6 +<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
   277.7 +  <AuxValues>
   277.8 +    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
   277.9 +    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
  277.10 +    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
  277.11 +    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
  277.12 +    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
  277.13 +    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
  277.14 +    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
  277.15 +    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
  277.16 +  </AuxValues>
  277.17 +
  277.18 +  <Layout>
  277.19 +    <DimensionLayout dim="0">
  277.20 +      <Group type="103" groupAlignment="0" attributes="0">
  277.21 +          <Group type="102" attributes="0">
  277.22 +              <EmptySpace min="-2" max="-2" attributes="0"/>
  277.23 +              <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
  277.24 +              <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
  277.25 +              <Component id="mdlLsnrTB" min="-2" pref="269" max="-2" attributes="0"/>
  277.26 +              <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
  277.27 +              <Component id="SearchButton" pref="94" max="32767" attributes="0"/>
  277.28 +              <EmptySpace min="-2" pref="60" max="-2" attributes="0"/>
  277.29 +          </Group>
  277.30 +      </Group>
  277.31 +    </DimensionLayout>
  277.32 +    <DimensionLayout dim="1">
  277.33 +      <Group type="103" groupAlignment="0" attributes="0">
  277.34 +          <Group type="102" alignment="0" attributes="0">
  277.35 +              <EmptySpace max="-2" attributes="0"/>
  277.36 +              <Group type="103" groupAlignment="3" attributes="0">
  277.37 +                  <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
  277.38 +                  <Component id="mdlLsnrTB" alignment="3" min="-2" max="-2" attributes="0"/>
  277.39 +                  <Component id="SearchButton" alignment="3" min="-2" max="-2" attributes="0"/>
  277.40 +              </Group>
  277.41 +              <EmptySpace max="32767" attributes="0"/>
  277.42 +          </Group>
  277.43 +      </Group>
  277.44 +    </DimensionLayout>
  277.45 +  </Layout>
  277.46 +  <SubComponents>
  277.47 +    <Component class="javax.swing.JLabel" name="jLabel2">
  277.48 +      <Properties>
  277.49 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  277.50 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/model/Bundle.properties" key="ModelListenerConfigPanel.jLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  277.51 +        </Property>
  277.52 +      </Properties>
  277.53 +    </Component>
  277.54 +    <Component class="javax.swing.JButton" name="SearchButton">
  277.55 +      <Properties>
  277.56 +        <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
  277.57 +          <Image iconType="3" name="/org/netbeans/modules/portalpack/websynergy/portlets/hook/resources/search.png"/>
  277.58 +        </Property>
  277.59 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  277.60 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/model/Bundle.properties" key="ModelListenerConfigPanel.SearchButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  277.61 +        </Property>
  277.62 +      </Properties>
  277.63 +      <Events>
  277.64 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="SearchButtonActionPerformed"/>
  277.65 +      </Events>
  277.66 +    </Component>
  277.67 +    <Component class="javax.swing.JTextField" name="mdlLsnrTB">
  277.68 +      <Properties>
  277.69 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  277.70 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/model/Bundle.properties" key="ModelListenerConfigPanel.mdlLsnrTB.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  277.71 +        </Property>
  277.72 +      </Properties>
  277.73 +    </Component>
  277.74 +  </SubComponents>
  277.75 +</Form>
   278.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   278.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/model/ModelListenerConfigPanel.java	Sun Jun 26 10:25:14 2011 +0800
   278.3 @@ -0,0 +1,227 @@
   278.4 +/*
   278.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   278.6 + * 
   278.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   278.8 + * 
   278.9 + * The contents of this file are subject to the terms of either the GNU
  278.10 + * General Public License Version 2 only ("GPL") or the Common
  278.11 + * Development and Distribution License("CDDL") (collectively, the
  278.12 + * "License"). You may not use this file except in compliance with the
  278.13 + * License. You can obtain a copy of the License at
  278.14 + * http://www.netbeans.org/cddl-gplv2.html
  278.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  278.16 + * specific language governing permissions and limitations under the
  278.17 + * License.  When distributing the software, include this License Header
  278.18 + * Notice in each file and include the License file at
  278.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  278.20 + * particular file as subject to the "Classpath" exception as provided
  278.21 + * by Sun in the GPL Version 2 section of the License file that
  278.22 + * accompanied this code. If applicable, add the following below the
  278.23 + * License Header, with the fields enclosed by brackets [] replaced by
  278.24 + * your own identifying information:
  278.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  278.26 + * 
  278.27 + * If you wish your version of this file to be governed by only the CDDL
  278.28 + * or only the GPL Version 2, indicate your decision by adding
  278.29 + * "[Contributor] elects to include this software in this distribution
  278.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  278.31 + * single choice of license, a recipient has the option to distribute
  278.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  278.33 + * to extend the choice of license to its licensees as provided above.
  278.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  278.35 + * Version 2 license, then the option applies only if the new code is
  278.36 + * made subject to such option by the copyright holder.
  278.37 + * 
  278.38 + * Contributor(s):
  278.39 + * 
  278.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  278.41 + */
  278.42 +
  278.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.handlers.model;
  278.44 +
  278.45 +import java.util.Set;
  278.46 +import javax.lang.model.element.TypeElement;
  278.47 +import javax.swing.event.DocumentEvent;
  278.48 +import javax.swing.event.DocumentListener;
  278.49 +import org.netbeans.api.java.source.ClassIndex.NameKind;
  278.50 +import org.netbeans.api.java.source.ClassIndex.SearchScope;
  278.51 +import org.netbeans.api.java.source.ClasspathInfo;
  278.52 +import org.netbeans.api.java.source.ElementHandle;
  278.53 +import org.netbeans.api.java.source.ui.TypeElementFinder;
  278.54 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.ConfigPanel;
  278.55 +import org.openide.WizardDescriptor;
  278.56 +import org.openide.filesystems.FileObject;
  278.57 +import org.netbeans.api.java.classpath.ClassPath;
  278.58 +import org.netbeans.api.project.Project;
  278.59 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.actions.util.PortletProjectUtils;
  278.60 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.util.CoreUtil;
  278.61 +import org.netbeans.modules.web.api.webmodule.WebModule;
  278.62 +import org.openide.util.NbBundle;
  278.63 +
  278.64 +/**
  278.65 + *
  278.66 + * @author Santh Chetan Chadalavada
  278.67 + */
  278.68 +public class ModelListenerConfigPanel extends ConfigPanel implements DocumentListener {
  278.69 +
  278.70 +    private Project project; 
  278.71 +    public ModelListenerConfigPanel(Project project) {
  278.72 +        this.project = project;
  278.73 +        
  278.74 +        initComponents();
  278.75 +        mdlLsnrTB.getDocument().addDocumentListener(this);
  278.76 + 
  278.77 +    }
  278.78 +
  278.79 +    private void initData() {
  278.80 +        mdlLsnrTB.setText("");
  278.81 +    }
  278.82 +    
  278.83 +    /** This method is called from within the constructor to
  278.84 +     * initialize the form.
  278.85 +     * WARNING: Do NOT modify this code. The content of this method is
  278.86 +     * always regenerated by the Form Editor.
  278.87 +     */
  278.88 +    @SuppressWarnings("unchecked")
  278.89 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  278.90 +    private void initComponents() {
  278.91 +
  278.92 +        jLabel2 = new javax.swing.JLabel();
  278.93 +        SearchButton = new javax.swing.JButton();
  278.94 +        mdlLsnrTB = new javax.swing.JTextField();
  278.95 +
  278.96 +        jLabel2.setText(org.openide.util.NbBundle.getMessage(ModelListenerConfigPanel.class, "ModelListenerConfigPanel.jLabel2.text")); // NOI18N
  278.97 +
  278.98 +        SearchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/netbeans/modules/portalpack/websynergy/portlets/hook/resources/search.png"))); // NOI18N
  278.99 +        SearchButton.setText(org.openide.util.NbBundle.getMessage(ModelListenerConfigPanel.class, "ModelListenerConfigPanel.SearchButton.text")); // NOI18N
 278.100 +        SearchButton.addActionListener(new java.awt.event.ActionListener() {
 278.101 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
 278.102 +                SearchButtonActionPerformed(evt);
 278.103 +            }
 278.104 +        });
 278.105 +
 278.106 +        mdlLsnrTB.setText(org.openide.util.NbBundle.getMessage(ModelListenerConfigPanel.class, "ModelListenerConfigPanel.mdlLsnrTB.text")); // NOI18N
 278.107 +
 278.108 +        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
 278.109 +        this.setLayout(layout);
 278.110 +        layout.setHorizontalGroup(
 278.111 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 278.112 +            .add(layout.createSequentialGroup()
 278.113 +                .addContainerGap()
 278.114 +                .add(jLabel2)
 278.115 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
 278.116 +                .add(mdlLsnrTB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 269, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 278.117 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
 278.118 +                .add(SearchButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE)
 278.119 +                .add(60, 60, 60))
 278.120 +        );
 278.121 +        layout.setVerticalGroup(
 278.122 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 278.123 +            .add(layout.createSequentialGroup()
 278.124 +                .addContainerGap()
 278.125 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 278.126 +                    .add(jLabel2)
 278.127 +                    .add(mdlLsnrTB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 278.128 +                    .add(SearchButton))
 278.129 +                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 278.130 +        );
 278.131 +    }// </editor-fold>//GEN-END:initComponents
 278.132 +
 278.133 +private void SearchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SearchButtonActionPerformed
 278.134 +// TODO add your handling code here:
 278.135 +    final WebModule wm = PortletProjectUtils.getWebModule(project);
 278.136 +    
 278.137 +    FileObject fileObject = PortletProjectUtils.getWebInf(project);
 278.138 +
 278.139 +        TypeElementFinder.Customizer customizer = new TypeElementFinder.Customizer() {
 278.140 +
 278.141 +           public Set<ElementHandle<TypeElement>> query(ClasspathInfo classpathInfo, String textForQuery, NameKind nameKind, Set<SearchScope> searchScopes) {
 278.142 +               return classpathInfo.getClassIndex().getDeclaredTypes(textForQuery, nameKind, searchScopes);
 278.143 +               //return Collections.EMPTY_SET;
 278.144 +           }
 278.145 +           
 278.146 +           public boolean accept(ElementHandle<TypeElement> typeHandle) {
 278.147 +               try {
 278.148 +                   
 278.149 +                   ClassPath cp = ClassPath.getClassPath(wm.getDocumentBase(), ClassPath.COMPILE);
 278.150 +                   String clazzName = typeHandle.getQualifiedName();
 278.151 +                   ClassLoader loader = cp.getClassLoader(true);
 278.152 +                   Class clazz = loader.loadClass(clazzName);
 278.153 +                   Class baseClazz = loader.loadClass("com.liferay.portal.model.BaseModel");
 278.154 +                   //if (clazz.isAssignableFrom(loader.loadClass("com.liferay.portal.model.BaseModel"))) {
 278.155 +                   if (baseClazz.isAssignableFrom(clazz)) {
 278.156 +                       String newClazz = clazzName + "Model";
 278.157 +                       if(baseClazz.isAssignableFrom(loader.loadClass(newClazz)))
 278.158 +                          return true;
 278.159 +                       return false;
 278.160 +                   }
 278.161 +                   return false;
 278.162 +               } catch (Exception ex) {
 278.163 +                   //Exceptions.printStackTrace(ex);
 278.164 +               } catch(Error e){
 278.165 +                                  }
 278.166 +               return false;
 278.167 +                          }
 278.168 +       };
 278.169 +        ElementHandle<TypeElement> type = TypeElementFinder.find(ClasspathInfo.create(fileObject), customizer);
 278.170 +
 278.171 +       if (type != null) {
 278.172 +          mdlLsnrTB.setText(type.getQualifiedName());
 278.173 +       } 
 278.174 +}//GEN-LAST:event_SearchButtonActionPerformed
 278.175 +
 278.176 +
 278.177 +    // Variables declaration - do not modify//GEN-BEGIN:variables
 278.178 +    private javax.swing.JButton SearchButton;
 278.179 +    private javax.swing.JLabel jLabel2;
 278.180 +    private javax.swing.JTextField mdlLsnrTB;
 278.181 +    // End of variables declaration//GEN-END:variables
 278.182 +
 278.183 +    @Override
 278.184 +    public void read(WizardDescriptor wizardDescriptor) {
 278.185 +        
 278.186 +    }
 278.187 +
 278.188 +    @Override
 278.189 +    public void store(WizardDescriptor wizardDescriptor) {
 278.190 +        wizardDescriptor.putProperty("mdl_Name", mdlLsnrTB.getText());
 278.191 +    }
 278.192 +
 278.193 +    @Override
 278.194 +    public boolean validate(WizardDescriptor wizardDescriptor) {
 278.195 +        String modelLstnName = mdlLsnrTB.getText();
 278.196 +        if(modelLstnName == null || modelLstnName.trim().length() == 0 || 
 278.197 +                !CoreUtil.validatePackageName(modelLstnName)) {
 278.198 +            setErrorMessage(wizardDescriptor,NbBundle.getMessage(
 278.199 +                    ModelListenerConfigPanel.class, "INVALID_MODEL_CLASS"));
 278.200 +            return false;
 278.201 +        }
 278.202 +              
 278.203 +        setErrorMessage(wizardDescriptor, "");
 278.204 +        return true;
 278.205 +    }
 278.206 +
 278.207 +    @Override
 278.208 +    public String getDescription() {
 278.209 +        return "demo";
 278.210 +    }
 278.211 +
 278.212 +    public void insertUpdate(DocumentEvent e) {
 278.213 +         updateTexts(e);
 278.214 +    }
 278.215 +
 278.216 +    public void removeUpdate(DocumentEvent e) {
 278.217 +         updateTexts(e);
 278.218 +    }
 278.219 +
 278.220 +    public void changedUpdate(DocumentEvent e) {
 278.221 +         updateTexts(e);
 278.222 +    }
 278.223 +    
 278.224 +    /** Handles changes in the Project name and project directory, */
 278.225 +    private void updateTexts(DocumentEvent e) {
 278.226 +
 278.227 +        fireChangeEvent();
 278.228 +
 278.229 +    }
 278.230 +}
   279.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   279.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/model/ModelListenerTypeHandler.java	Sun Jun 26 10:25:14 2011 +0800
   279.3 @@ -0,0 +1,164 @@
   279.4 +/*
   279.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   279.6 + * 
   279.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   279.8 + * 
   279.9 + * The contents of this file are subject to the terms of either the GNU
  279.10 + * General Public License Version 2 only ("GPL") or the Common
  279.11 + * Development and Distribution License("CDDL") (collectively, the
  279.12 + * "License"). You may not use this file except in compliance with the
  279.13 + * License. You can obtain a copy of the License at
  279.14 + * http://www.netbeans.org/cddl-gplv2.html
  279.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  279.16 + * specific language governing permissions and limitations under the
  279.17 + * License.  When distributing the software, include this License Header
  279.18 + * Notice in each file and include the License file at
  279.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  279.20 + * particular file as subject to the "Classpath" exception as provided
  279.21 + * by Sun in the GPL Version 2 section of the License file that
  279.22 + * accompanied this code. If applicable, add the following below the
  279.23 + * License Header, with the fields enclosed by brackets [] replaced by
  279.24 + * your own identifying information:
  279.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  279.26 + * 
  279.27 + * If you wish your version of this file to be governed by only the CDDL
  279.28 + * or only the GPL Version 2, indicate your decision by adding
  279.29 + * "[Contributor] elects to include this software in this distribution
  279.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  279.31 + * single choice of license, a recipient has the option to distribute
  279.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  279.33 + * to extend the choice of license to its licensees as provided above.
  279.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  279.35 + * Version 2 license, then the option applies only if the new code is
  279.36 + * made subject to such option by the copyright holder.
  279.37 + * 
  279.38 + * Contributor(s):
  279.39 + * 
  279.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  279.41 + */
  279.42 +
  279.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.handlers.model;
  279.44 +
  279.45 +import java.io.IOException;
  279.46 +import java.util.HashMap;
  279.47 +import java.util.Map;
  279.48 +import java.util.Set;
  279.49 +import org.netbeans.api.java.project.JavaProjectConstants;
  279.50 +import org.netbeans.api.project.Project;
  279.51 +import org.netbeans.api.project.ProjectUtils;
  279.52 +import org.netbeans.api.project.SourceGroup;
  279.53 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.actions.util.PortletProjectUtils;
  279.54 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  279.55 +import org.netbeans.modules.portalpack.servers.websynergy.common.WebSpacePropertiesUtil;
  279.56 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.HookTypeHandler;
  279.57 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.WizardDescriptorPanelWrapper;
  279.58 +import org.netbeans.modules.portalpack.websynergy.portlets.util.PluginXMLUtil;
  279.59 +import org.netbeans.modules.portalpack.websynergy.portlets.util.PortalPropertyUtil;
  279.60 +import org.netbeans.modules.portalpack.websynergy.portlets.util.TemplateUtil;
  279.61 +import org.netbeans.spi.java.project.support.ui.templates.JavaTemplates;
  279.62 +import org.netbeans.spi.project.ui.templates.support.Templates;
  279.63 +import org.openide.WizardDescriptor;
  279.64 +import org.openide.WizardDescriptor.Panel;
  279.65 +import org.openide.filesystems.FileObject;
  279.66 +import org.openide.filesystems.FileUtil;
  279.67 +import org.openide.loaders.DataObjectNotFoundException;
  279.68 +import org.openide.util.Exceptions;
  279.69 +
  279.70 +/**
  279.71 + *
  279.72 + * @author Santh Chetan Chadalavada
  279.73 + */
  279.74 +public class ModelListenerTypeHandler extends HookTypeHandler{
  279.75 +
  279.76 +    private Project project;
  279.77 +    
  279.78 +    public ModelListenerTypeHandler(Project project) {
  279.79 +        this.project = project;
  279.80 +    }
  279.81 +    
  279.82 +    @Override
  279.83 +    public Panel getConfigPanel() {
  279.84 +        SourceGroup[] sourceGroups = ProjectUtils.getSources(project).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
  279.85 +        return JavaTemplates.
  279.86 +                createPackageChooser(project, sourceGroups, new WizardDescriptorPanelWrapper(new ModelListenerConfigPanel(project)));
  279.87 +    }
  279.88 +
  279.89 +    @Override
  279.90 +    public void addHookDefinition(FileObject hookXml, WizardDescriptor desc) {
  279.91 +        if (hookXml == null)
  279.92 +            return;
  279.93 +        
  279.94 +        String className = Templates.getTargetName(desc);
  279.95 +       
  279.96 +        FileObject packageFileObj = Templates.getTargetFolder(desc);
  279.97 +        String pkgName = PortletProjectUtils.getPackage(packageFileObj);
  279.98 +        if (pkgName != null && pkgName.trim().length() != 0)
  279.99 +        {
 279.100 +            className = pkgName + "." + className;
 279.101 +        }
 279.102 +        
 279.103 +         //Adding property to portal.properties for 5.2
 279.104 +        String PORTAL_PROPERTIES = "portal";
 279.105 +        FileObject srcRoot = PortletProjectUtils.getSourceRoot(project);//getWebModule(project).getWebInf();
 279.106 +        FileObject ppFO = srcRoot.getFileObject(PORTAL_PROPERTIES, "properties");
 279.107 +        if (ppFO == null) {
 279.108 +            try {
 279.109 +                TemplateUtil templateUtil = new TemplateUtil("hook/templates");
 279.110 +                ppFO = templateUtil.createFileFromTemplate("portalproperties.template", srcRoot, PORTAL_PROPERTIES, "properties");
 279.111 +                //result.add(ppFO);
 279.112 +             
 279.113 +            } catch (org.netbeans.modules.portalpack.websynergy.portlets.util.TemplateNotFoundException ex) {
 279.114 +                Exceptions.printStackTrace(ex);
 279.115 +            } 
 279.116 +        }
 279.117 +
 279.118 +         try{
 279.119 +            PluginXMLUtil util = new PluginXMLUtil(hookXml);
 279.120 +            if(util.addPortalPropsHandlerHook()) {
 279.121 +                util.store();
 279.122 +            }
 279.123 +        }catch(Exception e) {
 279.124 +            Exceptions.printStackTrace(e);
 279.125 +        }
 279.126 +        PortalPropertyUtil.addProperty(FileUtil.toFile(ppFO), "value.object.listener."+(String)desc.getProperty("mdl_Name"), className);
 279.127 +    }
 279.128 +
 279.129 +    @Override
 279.130 +    public void createAdditionalFiles(Project project, WizardDescriptor desc, Set result) {
 279.131 +        Map values = new HashMap();
 279.132 +        String className = Templates.getTargetName(desc);
 279.133 +        FileObject packageName = Templates.getTargetFolder(desc);
 279.134 +        String pkgName = PortletProjectUtils.getPackage(packageName);
 279.135 +        String mdlLsnrName = (String)desc.getProperty("mdl_Name");
 279.136 +        values.put("PACKAGE", pkgName);
 279.137 +        values.put("CLASS_NAME", className);
 279.138 +        values.put("MDL_LISTENER", mdlLsnrName);
 279.139 +        
 279.140 +        TemplateUtil templateUtil = new TemplateUtil("hook/templates");
 279.141 +
 279.142 +        PSConfigObject psConfig = WebSpacePropertiesUtil.getSelectedServerProperties(project);
 279.143 +        int liferayVersion = 0;
 279.144 +        String mdlLsnrTmpl = "mdlLsnrHookPlugin.java";
 279.145 +        if (psConfig != null) {
 279.146 +            liferayVersion = WebSpacePropertiesUtil.getLiferayVersion(psConfig);
 279.147 +            if (liferayVersion >= 5203) {
 279.148 +                mdlLsnrTmpl = "mdlLsnrHookPlugin523.java";
 279.149 +            }
 279.150 +        }
 279.151 +
 279.152 +        try {
 279.153 +            
 279.154 +            FileObject startupEvntHookPluginTemplate = templateUtil.getTemplateFile(mdlLsnrTmpl);
 279.155 +            FileObject mdlFO = templateUtil.mergeTemplateToFile(startupEvntHookPluginTemplate, packageName, className, values);
 279.156 +            result.add(mdlFO);
 279.157 +
 279.158 +        } catch (org.netbeans.modules.portalpack.websynergy.portlets.util.TemplateNotFoundException ex) {
 279.159 +            Exceptions.printStackTrace(ex);
 279.160 +        } catch (DataObjectNotFoundException ex) {
 279.161 +            Exceptions.printStackTrace(ex);
 279.162 +        } catch (IOException ex) {
 279.163 +            Exceptions.printStackTrace(ex);
 279.164 +        } 
 279.165 +    }
 279.166 +
 279.167 +}
   280.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   280.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/portalproperties/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   280.3 @@ -0,0 +1,2 @@
   280.4 +PortalPropertiesConfigPanel.jLabel1.text=Portal Properties File Location:
   280.5 +PortalPropertiesConfigPanel.jTextField1.text=
   281.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   281.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/portalproperties/PortalPropertiesConfigPanel.form	Sun Jun 26 10:25:14 2011 +0800
   281.3 @@ -0,0 +1,56 @@
   281.4 +<?xml version="1.0" encoding="UTF-8" ?>
   281.5 +
   281.6 +<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
   281.7 +  <AuxValues>
   281.8 +    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
   281.9 +    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
  281.10 +    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
  281.11 +    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
  281.12 +    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
  281.13 +    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
  281.14 +    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
  281.15 +    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
  281.16 +  </AuxValues>
  281.17 +
  281.18 +  <Layout>
  281.19 +    <DimensionLayout dim="0">
  281.20 +      <Group type="103" groupAlignment="0" attributes="0">
  281.21 +          <Group type="102" alignment="0" attributes="0">
  281.22 +              <EmptySpace max="-2" attributes="0"/>
  281.23 +              <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
  281.24 +              <EmptySpace type="separate" max="-2" attributes="0"/>
  281.25 +              <Component id="jTextField1" min="-2" pref="199" max="-2" attributes="0"/>
  281.26 +              <EmptySpace pref="121" max="32767" attributes="0"/>
  281.27 +          </Group>
  281.28 +      </Group>
  281.29 +    </DimensionLayout>
  281.30 +    <DimensionLayout dim="1">
  281.31 +      <Group type="103" groupAlignment="0" attributes="0">
  281.32 +          <Group type="102" alignment="0" attributes="0">
  281.33 +              <EmptySpace max="-2" attributes="0"/>
  281.34 +              <Group type="103" groupAlignment="3" attributes="0">
  281.35 +                  <Component id="jLabel1" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
  281.36 +                  <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/>
  281.37 +              </Group>
  281.38 +              <EmptySpace pref="19" max="32767" attributes="0"/>
  281.39 +          </Group>
  281.40 +      </Group>
  281.41 +    </DimensionLayout>
  281.42 +  </Layout>
  281.43 +  <SubComponents>
  281.44 +    <Component class="javax.swing.JLabel" name="jLabel1">
  281.45 +      <Properties>
  281.46 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  281.47 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/portalproperties/Bundle.properties" key="PortalPropertiesConfigPanel.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  281.48 +        </Property>
  281.49 +      </Properties>
  281.50 +    </Component>
  281.51 +    <Component class="javax.swing.JTextField" name="jTextField1">
  281.52 +      <Properties>
  281.53 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  281.54 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/portalproperties/Bundle.properties" key="PortalPropertiesConfigPanel.jTextField1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  281.55 +        </Property>
  281.56 +      </Properties>
  281.57 +    </Component>
  281.58 +  </SubComponents>
  281.59 +</Form>
   282.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   282.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/portalproperties/PortalPropertiesConfigPanel.java	Sun Jun 26 10:25:14 2011 +0800
   282.3 @@ -0,0 +1,89 @@
   282.4 +/*
   282.5 + * ModelListernerConfigPanel.java
   282.6 + *
   282.7 + * Created on February 17, 2009, 12:14 AM
   282.8 + */
   282.9 +
  282.10 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.handlers.portalproperties;
  282.11 +
  282.12 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.handlers.model.*;
  282.13 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.ConfigPanel;
  282.14 +import org.openide.WizardDescriptor;
  282.15 +
  282.16 +/**
  282.17 + *
  282.18 + * @author  admin
  282.19 + */
  282.20 +public class PortalPropertiesConfigPanel extends ConfigPanel {
  282.21 +
  282.22 +    /** Creates new form ModelListernerConfigPanel */
  282.23 +    public PortalPropertiesConfigPanel() {
  282.24 +        initComponents();
  282.25 +    }
  282.26 +
  282.27 +    /** This method is called from within the constructor to
  282.28 +     * initialize the form.
  282.29 +     * WARNING: Do NOT modify this code. The content of this method is
  282.30 +     * always regenerated by the Form Editor.
  282.31 +     */
  282.32 +    @SuppressWarnings("unchecked")
  282.33 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  282.34 +    private void initComponents() {
  282.35 +
  282.36 +        jLabel1 = new javax.swing.JLabel();
  282.37 +        jTextField1 = new javax.swing.JTextField();
  282.38 +
  282.39 +        jLabel1.setText(org.openide.util.NbBundle.getMessage(PortalPropertiesConfigPanel.class, "PortalPropertiesConfigPanel.jLabel1.text")); // NOI18N
  282.40 +
  282.41 +        jTextField1.setText(org.openide.util.NbBundle.getMessage(PortalPropertiesConfigPanel.class, "PortalPropertiesConfigPanel.jTextField1.text")); // NOI18N
  282.42 +
  282.43 +        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
  282.44 +        this.setLayout(layout);
  282.45 +        layout.setHorizontalGroup(
  282.46 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  282.47 +            .add(layout.createSequentialGroup()
  282.48 +                .addContainerGap()
  282.49 +                .add(jLabel1)
  282.50 +                .add(18, 18, 18)
  282.51 +                .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 199, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  282.52 +                .addContainerGap(121, Short.MAX_VALUE))
  282.53 +        );
  282.54 +        layout.setVerticalGroup(
  282.55 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  282.56 +            .add(layout.createSequentialGroup()
  282.57 +                .addContainerGap()
  282.58 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
  282.59 +                    .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  282.60 +                    .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
  282.61 +                .addContainerGap(19, Short.MAX_VALUE))
  282.62 +        );
  282.63 +    }// </editor-fold>//GEN-END:initComponents
  282.64 +
  282.65 +
  282.66 +    // Variables declaration - do not modify//GEN-BEGIN:variables
  282.67 +    private javax.swing.JLabel jLabel1;
  282.68 +    private javax.swing.JTextField jTextField1;
  282.69 +    // End of variables declaration//GEN-END:variables
  282.70 +
  282.71 +    @Override
  282.72 +    public void read(WizardDescriptor wizardDescriptor) {
  282.73 +        
  282.74 +    }
  282.75 +
  282.76 +    @Override
  282.77 +    public void store(WizardDescriptor wizardDescriptor) {
  282.78 +        
  282.79 +    }
  282.80 +
  282.81 +    @Override
  282.82 +    public boolean validate(WizardDescriptor wizardDescriptor) {
  282.83 +        return true;
  282.84 +    }
  282.85 +
  282.86 +    @Override
  282.87 +    public String getDescription() {
  282.88 +        return "demo";
  282.89 +    }
  282.90 +
  282.91 +
  282.92 +}
   283.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   283.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/handlers/portalproperties/PortalPropertiesTypeHandler.java	Sun Jun 26 10:25:14 2011 +0800
   283.3 @@ -0,0 +1,91 @@
   283.4 +/*
   283.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   283.6 + * 
   283.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   283.8 + * 
   283.9 + * The contents of this file are subject to the terms of either the GNU
  283.10 + * General Public License Version 2 only ("GPL") or the Common
  283.11 + * Development and Distribution License("CDDL") (collectively, the
  283.12 + * "License"). You may not use this file except in compliance with the
  283.13 + * License. You can obtain a copy of the License at
  283.14 + * http://www.netbeans.org/cddl-gplv2.html
  283.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  283.16 + * specific language governing permissions and limitations under the
  283.17 + * License.  When distributing the software, include this License Header
  283.18 + * Notice in each file and include the License file at
  283.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  283.20 + * particular file as subject to the "Classpath" exception as provided
  283.21 + * by Sun in the GPL Version 2 section of the License file that
  283.22 + * accompanied this code. If applicable, add the following below the
  283.23 + * License Header, with the fields enclosed by brackets [] replaced by
  283.24 + * your own identifying information:
  283.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  283.26 + * 
  283.27 + * If you wish your version of this file to be governed by only the CDDL
  283.28 + * or only the GPL Version 2, indicate your decision by adding
  283.29 + * "[Contributor] elects to include this software in this distribution
  283.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  283.31 + * single choice of license, a recipient has the option to distribute
  283.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  283.33 + * to extend the choice of license to its licensees as provided above.
  283.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  283.35 + * Version 2 license, then the option applies only if the new code is
  283.36 + * made subject to such option by the copyright holder.
  283.37 + * 
  283.38 + * Contributor(s):
  283.39 + * 
  283.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  283.41 + */
  283.42 +
  283.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.handlers.portalproperties;
  283.44 +
  283.45 +import java.util.Set;
  283.46 +import org.netbeans.api.project.Project;
  283.47 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.actions.util.PortletProjectUtils;
  283.48 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.HookTypeHandler;
  283.49 +import org.netbeans.modules.portalpack.websynergy.portlets.util.PluginXMLUtil;
  283.50 +import org.netbeans.modules.portalpack.websynergy.portlets.util.TemplateNotFoundException;
  283.51 +import org.netbeans.modules.portalpack.websynergy.portlets.util.TemplateUtil;
  283.52 +import org.openide.WizardDescriptor;
  283.53 +import org.openide.filesystems.FileObject;
  283.54 +import org.openide.util.Exceptions;
  283.55 +
  283.56 +/**
  283.57 + *
  283.58 + * @author Santh Chetan Chadalavada
  283.59 + */
  283.60 +public class PortalPropertiesTypeHandler extends HookTypeHandler{
  283.61 +
  283.62 +    private Project project;
  283.63 +    
  283.64 +    public PortalPropertiesTypeHandler(Project project) {
  283.65 +        this.project = project;
  283.66 +    }
  283.67 +    
  283.68 +    @Override
  283.69 +    public void addHookDefinition(FileObject hookXml, WizardDescriptor desc) {
  283.70 +        if (hookXml == null)
  283.71 +            return;
  283.72 +        PluginXMLUtil util = new PluginXMLUtil(hookXml);
  283.73 +        if(util.addPortalPropsHandlerHook()) {
  283.74 +            util.store();
  283.75 +        }
  283.76 +    }
  283.77 +
  283.78 +    @Override
  283.79 +    public void createAdditionalFiles(Project project, WizardDescriptor desc, Set result) {
  283.80 +        String PORTAL_PROPERTIES = "portal";
  283.81 +        FileObject srcRoot = PortletProjectUtils.getSourceRoot(project);//getWebModule(project).getWebInf();
  283.82 +        FileObject ppFO = srcRoot.getFileObject(PORTAL_PROPERTIES, "properties");
  283.83 +        if (ppFO == null) {
  283.84 +            try {
  283.85 +                TemplateUtil templateUtil = new TemplateUtil("hook/templates");
  283.86 +                ppFO = templateUtil.createFileFromTemplate("portalproperties.template", srcRoot, PORTAL_PROPERTIES, "properties");
  283.87 +                result.add(ppFO);
  283.88 +            } catch (TemplateNotFoundException ex) {
  283.89 +                Exceptions.printStackTrace(ex);
  283.90 +            }
  283.91 +        }
  283.92 +    }
  283.93 +
  283.94 +}
   284.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   284.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/jsp/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   284.3 @@ -0,0 +1,3 @@
   284.4 +JSPHookConfigPanel.addButton.text=>> Add
   284.5 +JSPHookConfigPanel.removeButton.text=<< Remove
   284.6 +JSP_FILES_FOLDERS_CREATE_PROGRESS_MESSAGE=Copying JSP Files and Folders...
   285.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   285.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/jsp/JSPHookConfigPanel.form	Sun Jun 26 10:25:14 2011 +0800
   285.3 @@ -0,0 +1,102 @@
   285.4 +<?xml version="1.0" encoding="UTF-8" ?>
   285.5 +
   285.6 +<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
   285.7 +  <AuxValues>
   285.8 +    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
   285.9 +    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
  285.10 +    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
  285.11 +    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
  285.12 +    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
  285.13 +    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
  285.14 +    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
  285.15 +    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
  285.16 +  </AuxValues>
  285.17 +
  285.18 +  <Layout>
  285.19 +    <DimensionLayout dim="0">
  285.20 +      <Group type="103" groupAlignment="0" attributes="0">
  285.21 +          <Group type="102" alignment="0" attributes="0">
  285.22 +              <Component id="scrollPane" min="-2" pref="203" max="-2" attributes="0"/>
  285.23 +              <EmptySpace type="unrelated" max="-2" attributes="0"/>
  285.24 +              <Group type="103" groupAlignment="0" max="-2" attributes="0">
  285.25 +                  <Component id="removeButton" linkSize="3" min="-2" max="-2" attributes="1"/>
  285.26 +                  <Component id="addButton" linkSize="3" min="-2" max="-2" attributes="1"/>
  285.27 +              </Group>
  285.28 +              <EmptySpace max="-2" attributes="0"/>
  285.29 +              <Component id="jScrollPane2" pref="213" max="32767" attributes="0"/>
  285.30 +          </Group>
  285.31 +      </Group>
  285.32 +    </DimensionLayout>
  285.33 +    <DimensionLayout dim="1">
  285.34 +      <Group type="103" groupAlignment="0" attributes="0">
  285.35 +          <Component id="jScrollPane2" alignment="1" pref="216" max="32767" attributes="0"/>
  285.36 +          <Component id="scrollPane" alignment="0" pref="216" max="32767" attributes="0"/>
  285.37 +          <Group type="102" alignment="0" attributes="0">
  285.38 +              <EmptySpace min="-2" pref="74" max="-2" attributes="0"/>
  285.39 +              <Component id="addButton" min="-2" max="-2" attributes="0"/>
  285.40 +              <EmptySpace max="-2" attributes="0"/>
  285.41 +              <Component id="removeButton" min="-2" max="-2" attributes="0"/>
  285.42 +              <EmptySpace pref="90" max="32767" attributes="0"/>
  285.43 +          </Group>
  285.44 +      </Group>
  285.45 +    </DimensionLayout>
  285.46 +  </Layout>
  285.47 +  <SubComponents>
  285.48 +    <Container class="javax.swing.JScrollPane" name="scrollPane">
  285.49 +
  285.50 +      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
  285.51 +      <SubComponents>
  285.52 +        <Component class="javax.swing.JTree" name="dirTree">
  285.53 +          <AuxValues>
  285.54 +            <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="dirTree = new DirectoryTree(new File(jspDir))"/>
  285.55 +            <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/>
  285.56 +          </AuxValues>
  285.57 +        </Component>
  285.58 +      </SubComponents>
  285.59 +    </Container>
  285.60 +    <Container class="javax.swing.JScrollPane" name="jScrollPane2">
  285.61 +      <AuxValues>
  285.62 +        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
  285.63 +      </AuxValues>
  285.64 +
  285.65 +      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
  285.66 +      <SubComponents>
  285.67 +        <Component class="javax.swing.JList" name="selectedList">
  285.68 +          <Properties>
  285.69 +            <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
  285.70 +              <StringArray count="0"/>
  285.71 +            </Property>
  285.72 +            <Property name="selectionMode" type="int" value="1"/>
  285.73 +          </Properties>
  285.74 +          <Events>
  285.75 +            <EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="selectedListValueChanged"/>
  285.76 +          </Events>
  285.77 +          <AuxValues>
  285.78 +            <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JList(selectedDirModel)"/>
  285.79 +          </AuxValues>
  285.80 +        </Component>
  285.81 +      </SubComponents>
  285.82 +    </Container>
  285.83 +    <Component class="javax.swing.JButton" name="addButton">
  285.84 +      <Properties>
  285.85 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  285.86 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/hook/jsp/Bundle.properties" key="JSPHookConfigPanel.addButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  285.87 +        </Property>
  285.88 +      </Properties>
  285.89 +      <Events>
  285.90 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addButtonActionPerformed"/>
  285.91 +      </Events>
  285.92 +    </Component>
  285.93 +    <Component class="javax.swing.JButton" name="removeButton">
  285.94 +      <Properties>
  285.95 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  285.96 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/hook/jsp/Bundle.properties" key="JSPHookConfigPanel.removeButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  285.97 +        </Property>
  285.98 +        <Property name="enabled" type="boolean" value="false"/>
  285.99 +      </Properties>
 285.100 +      <Events>
 285.101 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="removeButtonActionPerformed"/>
 285.102 +      </Events>
 285.103 +    </Component>
 285.104 +  </SubComponents>
 285.105 +</Form>
   286.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   286.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/jsp/JSPHookConfigPanel.java	Sun Jun 26 10:25:14 2011 +0800
   286.3 @@ -0,0 +1,190 @@
   286.4 +/*
   286.5 + * JSPHookConfigPanel.java
   286.6 + *
   286.7 + * Created on March 2, 2009, 12:36 PM
   286.8 + */
   286.9 +
  286.10 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.jsp;
  286.11 +
  286.12 +import java.io.File;
  286.13 +import java.util.Enumeration;
  286.14 +import java.util.HashMap;
  286.15 +import javax.swing.DefaultListModel;
  286.16 +import org.netbeans.api.project.Project;
  286.17 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  286.18 +import org.netbeans.modules.portalpack.servers.websynergy.common.LiferayConstants;
  286.19 +import org.netbeans.modules.portalpack.servers.websynergy.common.WebSpacePropertiesUtil;
  286.20 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.ConfigPanel;
  286.21 +import org.netbeans.modules.portalpack.websynergy.portlets.util.ui.DirectoryTree;
  286.22 +import org.openide.WizardDescriptor;
  286.23 +import org.openide.filesystems.FileObject;
  286.24 +import org.openide.filesystems.FileUtil;
  286.25 +
  286.26 +/**
  286.27 + *
  286.28 + * @author  satyaranjan
  286.29 + */
  286.30 +public class JSPHookConfigPanel extends ConfigPanel {
  286.31 +
  286.32 +    private String jspDir;
  286.33 +    private FileObject jspDirFO;
  286.34 +    private DefaultListModel selectedDirModel;
  286.35 +    /** Creates new form JSPHookConfigPanel */
  286.36 +    public JSPHookConfigPanel(Project project) {
  286.37 +        PSConfigObject psConfig = WebSpacePropertiesUtil.getSelectedServerProperties(project);
  286.38 +        if(psConfig != null) {
  286.39 +            jspDir = psConfig.getProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR) +
  286.40 +                        File.separatorChar + "html";
  286.41 +        } else {
  286.42 +            jspDir = System.getProperty("user.home");
  286.43 +        }
  286.44 +        
  286.45 +        jspDirFO = FileUtil.toFileObject(new File(jspDir));
  286.46 +        
  286.47 +        selectedDirModel = new DefaultListModel();
  286.48 +            
  286.49 +        initComponents();
  286.50 +    }
  286.51 +    
  286.52 +
  286.53 +    /** This method is called from within the constructor to
  286.54 +     * initialize the form.
  286.55 +     * WARNING: Do NOT modify this code. The content of this method is
  286.56 +     * always regenerated by the Form Editor.
  286.57 +     */
  286.58 +    @SuppressWarnings("unchecked")
  286.59 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  286.60 +    private void initComponents() {
  286.61 +
  286.62 +        scrollPane = new javax.swing.JScrollPane();
  286.63 +        dirTree = dirTree = new DirectoryTree(new File(jspDir));
  286.64 +        jScrollPane2 = new javax.swing.JScrollPane();
  286.65 +        selectedList = new javax.swing.JList(selectedDirModel);
  286.66 +        addButton = new javax.swing.JButton();
  286.67 +        removeButton = new javax.swing.JButton();
  286.68 +
  286.69 +        scrollPane.setViewportView(dirTree);
  286.70 +
  286.71 +        selectedList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
  286.72 +        selectedList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
  286.73 +            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
  286.74 +                selectedListValueChanged(evt);
  286.75 +            }
  286.76 +        });
  286.77 +        jScrollPane2.setViewportView(selectedList);
  286.78 +
  286.79 +        addButton.setText(org.openide.util.NbBundle.getMessage(JSPHookConfigPanel.class, "JSPHookConfigPanel.addButton.text")); // NOI18N
  286.80 +        addButton.addActionListener(new java.awt.event.ActionListener() {
  286.81 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  286.82 +                addButtonActionPerformed(evt);
  286.83 +            }
  286.84 +        });
  286.85 +
  286.86 +        removeButton.setText(org.openide.util.NbBundle.getMessage(JSPHookConfigPanel.class, "JSPHookConfigPanel.removeButton.text")); // NOI18N
  286.87 +        removeButton.setEnabled(false);
  286.88 +        removeButton.addActionListener(new java.awt.event.ActionListener() {
  286.89 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  286.90 +                removeButtonActionPerformed(evt);
  286.91 +            }
  286.92 +        });
  286.93 +
  286.94 +        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
  286.95 +        this.setLayout(layout);
  286.96 +        layout.setHorizontalGroup(
  286.97 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  286.98 +            .add(layout.createSequentialGroup()
  286.99 +                .add(scrollPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 203, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 286.100 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
 286.101 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
 286.102 +                    .add(removeButton)
 286.103 +                    .add(addButton))
 286.104 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 286.105 +                .add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE))
 286.106 +        );
 286.107 +
 286.108 +        layout.linkSize(new java.awt.Component[] {addButton, removeButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
 286.109 +
 286.110 +        layout.setVerticalGroup(
 286.111 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 286.112 +            .add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE)
 286.113 +            .add(scrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE)
 286.114 +            .add(layout.createSequentialGroup()
 286.115 +                .add(74, 74, 74)
 286.116 +                .add(addButton)
 286.117 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 286.118 +                .add(removeButton)
 286.119 +                .addContainerGap(90, Short.MAX_VALUE))
 286.120 +        );
 286.121 +    }// </editor-fold>//GEN-END:initComponents
 286.122 +
 286.123 +private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed
 286.124 +// TODO add your handling code here:
 286.125 +    File selectedDir = ((DirectoryTree)dirTree).getSelectedDirectory();
 286.126 +    String relativePath = FileUtil.getRelativePath(jspDirFO, FileUtil.toFileObject(selectedDir));
 286.127 +    selectedDirModel.addElement(relativePath);
 286.128 +    
 286.129 +}//GEN-LAST:event_addButtonActionPerformed
 286.130 +
 286.131 +private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed
 286.132 +// TODO add your handling code here:
 286.133 +    int selectedIndex = selectedList.getSelectedIndex();
 286.134 +    
 286.135 +    if(selectedIndex != -1)
 286.136 +        selectedDirModel.remove(selectedIndex);
 286.137 +}//GEN-LAST:event_removeButtonActionPerformed
 286.138 +
 286.139 +private void selectedListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_selectedListValueChanged
 286.140 +// TODO add your handling code here:
 286.141 +    int selectedIndex = selectedList.getSelectedIndex();
 286.142 +    if(selectedIndex == -1)
 286.143 +        removeButton.setEnabled(false);
 286.144 +    else
 286.145 +        removeButton.setEnabled(true);
 286.146 +}//GEN-LAST:event_selectedListValueChanged
 286.147 +
 286.148 +    @Override
 286.149 +    protected void read(WizardDescriptor wizardDescriptor) {
 286.150 +       // throw new UnsupportedOperationException("Not supported yet.");
 286.151 +    }
 286.152 +
 286.153 +    @Override
 286.154 +    protected void store(WizardDescriptor wizardDescriptor) {
 286.155 +       
 286.156 +        wizardDescriptor.putProperty("dir_list", getSelectedDirectories());
 286.157 +    }
 286.158 +
 286.159 +    @Override
 286.160 +    public boolean validate(WizardDescriptor wizardDescriptor) {
 286.161 +        setErrorMessage(wizardDescriptor, "");
 286.162 +        return true;
 286.163 +    }
 286.164 +    
 286.165 +  public HashMap getSelectedDirectories() {
 286.166 +      HashMap selectedDirectoriesMap = new HashMap();
 286.167 +      Enumeration values = selectedDirModel.elements();
 286.168 +      FileObject fo = null;
 286.169 +      while(values.hasMoreElements()) {
 286.170 +          String path = (String)values.nextElement();
 286.171 +          fo = jspDirFO.getFileObject(path);
 286.172 +          selectedDirectoriesMap.put(path,fo);
 286.173 +      }
 286.174 +      return selectedDirectoriesMap;
 286.175 +  }
 286.176 +  
 286.177 +  
 286.178 +    @Override
 286.179 +    protected String getDescription() {
 286.180 +       return "JSP Hook Config Panel";
 286.181 +    }
 286.182 +
 286.183 +
 286.184 +    // Variables declaration - do not modify//GEN-BEGIN:variables
 286.185 +    private javax.swing.JButton addButton;
 286.186 +    private javax.swing.JTree dirTree;
 286.187 +    private javax.swing.JScrollPane jScrollPane2;
 286.188 +    private javax.swing.JButton removeButton;
 286.189 +    private javax.swing.JScrollPane scrollPane;
 286.190 +    private javax.swing.JList selectedList;
 286.191 +    // End of variables declaration//GEN-END:variables
 286.192 +
 286.193 +}
   287.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   287.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/jsp/JSPHookTypeHandler.java	Sun Jun 26 10:25:14 2011 +0800
   287.3 @@ -0,0 +1,188 @@
   287.4 +/*
   287.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   287.6 + * 
   287.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   287.8 + * 
   287.9 + * The contents of this file are subject to the terms of either the GNU
  287.10 + * General Public License Version 2 only ("GPL") or the Common
  287.11 + * Development and Distribution License("CDDL") (collectively, the
  287.12 + * "License"). You may not use this file except in compliance with the
  287.13 + * License. You can obtain a copy of the License at
  287.14 + * http://www.netbeans.org/cddl-gplv2.html
  287.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  287.16 + * specific language governing permissions and limitations under the
  287.17 + * License.  When distributing the software, include this License Header
  287.18 + * Notice in each file and include the License file at
  287.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  287.20 + * particular file as subject to the "Classpath" exception as provided
  287.21 + * by Sun in the GPL Version 2 section of the License file that
  287.22 + * accompanied this code. If applicable, add the following below the
  287.23 + * License Header, with the fields enclosed by brackets [] replaced by
  287.24 + * your own identifying information:
  287.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  287.26 + * 
  287.27 + * If you wish your version of this file to be governed by only the CDDL
  287.28 + * or only the GPL Version 2, indicate your decision by adding
  287.29 + * "[Contributor] elects to include this software in this distribution
  287.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  287.31 + * single choice of license, a recipient has the option to distribute
  287.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  287.33 + * to extend the choice of license to its licensees as provided above.
  287.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  287.35 + * Version 2 license, then the option applies only if the new code is
  287.36 + * made subject to such option by the copyright holder.
  287.37 + * 
  287.38 + * Contributor(s):
  287.39 + * 
  287.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  287.41 + */
  287.42 +
  287.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.jsp;
  287.44 +
  287.45 +import java.io.File;
  287.46 +import java.io.IOException;
  287.47 +import java.util.HashMap;
  287.48 +import java.util.Set;
  287.49 +import org.netbeans.api.progress.ProgressHandle;
  287.50 +import org.netbeans.api.progress.ProgressHandleFactory;
  287.51 +import org.netbeans.api.project.Project;
  287.52 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.actions.util.PortletProjectUtils;
  287.53 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.HookTypeHandler;
  287.54 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.WizardDescriptorPanelWrapper;
  287.55 +import org.netbeans.modules.portalpack.websynergy.portlets.util.PluginXMLUtil;
  287.56 +import org.netbeans.modules.web.api.webmodule.WebModule;
  287.57 +import org.openide.WizardDescriptor;
  287.58 +import org.openide.WizardDescriptor.Panel;
  287.59 +import org.openide.filesystems.FileObject;
  287.60 +import org.openide.filesystems.FileSystem;
  287.61 +import org.openide.filesystems.FileUtil;
  287.62 +import org.openide.util.Exceptions;
  287.63 +import org.openide.util.NbBundle;
  287.64 +import org.openide.util.RequestProcessor;
  287.65 +
  287.66 +/**
  287.67 + *
  287.68 + * @author satyaranjan
  287.69 + */
  287.70 +public class JSPHookTypeHandler extends HookTypeHandler {
  287.71 +    
  287.72 +    private Project project;
  287.73 +    private String jspsDir;
  287.74 +    CreateFilesAndFolders createFilesAndFolders;
  287.75 +    FileSystem fs;
  287.76 +    public JSPHookTypeHandler(Project project) {
  287.77 +        this.project = project;
  287.78 +    }
  287.79 +
  287.80 +    @Override
  287.81 +    public void addHookDefinition(FileObject hookXml, WizardDescriptor desc) {
  287.82 +        jspsDir = "/WEB-INF/jsp";
  287.83 +        if (hookXml == null)
  287.84 +            return;
  287.85 +        
  287.86 +        PluginXMLUtil util = new PluginXMLUtil(hookXml);
  287.87 +        util.addJSPHandlerHook(jspsDir);
  287.88 +        util.store();
  287.89 +    }
  287.90 +
  287.91 +    @Override
  287.92 +    public void createAdditionalFiles(Project project, WizardDescriptor desc, Set result) {
  287.93 +        final ProgressHandle handle =
  287.94 +                ProgressHandleFactory.createHandle(NbBundle.getMessage(JSPHookTypeHandler.class, "JSP_FILES_FOLDERS_CREATE_PROGRESS_MESSAGE"));
  287.95 +        handle.start();
  287.96 +        try {
  287.97 +            FileObject webInf = PortletProjectUtils.getWebInf(project);
  287.98 +            FileObject destFolder = webInf.getFileObject("jsp", null);
  287.99 +            if (destFolder == null) {
 287.100 +                destFolder = webInf.createFolder("jsp");
 287.101 +            }
 287.102 +            FileObject htmlFO = destFolder.getFileObject("html");
 287.103 +            if(htmlFO == null)
 287.104 +                htmlFO = destFolder.createFolder("html");
 287.105 +            HashMap selectedDirsMap = (HashMap) desc.getProperty("dir_list");
 287.106 +            
 287.107 +            createFilesAndFolders = new CreateFilesAndFolders(
 287.108 +                    PortletProjectUtils.getWebModule(project), selectedDirsMap,
 287.109 +                    htmlFO);
 287.110 +            if (webInf != null) {
 287.111 +                fs = webInf.getFileSystem();
 287.112 +                RequestProcessor.getDefault().post(new Runnable(){
 287.113 +                    
 287.114 +                    public void run() {
 287.115 +                        try {
 287.116 +                            fs.runAtomicAction(createFilesAndFolders);
 287.117 +                        } catch (IOException ex) {
 287.118 +                            Exceptions.printStackTrace(ex);
 287.119 +                        } finally {
 287.120 +                            handle.finish();
 287.121 +                        }
 287.122 +                    }
 287.123 +                });
 287.124 +            }
 287.125 +            
 287.126 +        } catch (Exception ex) {
 287.127 +            ex.printStackTrace();
 287.128 +        }
 287.129 +    }
 287.130 +   
 287.131 +    @Override
 287.132 +    public Panel getConfigPanel() {
 287.133 +        return new WizardDescriptorPanelWrapper(new JSPHookConfigPanel(project));
 287.134 +    }
 287.135 +
 287.136 +    
 287.137 +    private class CreateFilesAndFolders implements FileSystem.AtomicAction {
 287.138 +        private WebModule webModule;
 287.139 +        private HashMap selectedDirsMap;
 287.140 +        private FileObject htmlFO;
 287.141 +        
 287.142 +        public CreateFilesAndFolders(WebModule webModule,
 287.143 +                HashMap selectedDirsMap, FileObject htmlFO) {
 287.144 +
 287.145 +            this.webModule = webModule;
 287.146 +            this.selectedDirsMap = selectedDirsMap;
 287.147 +            this.htmlFO = htmlFO;
 287.148 +        }
 287.149 +
 287.150 +        public void run(){
 287.151 +            FileObject fo = null;
 287.152 +            String path = null;
 287.153 +            for (Object key : selectedDirsMap.keySet()) {
 287.154 +                path = (String) key;
 287.155 +                fo = (FileObject) selectedDirsMap.get(path);
 287.156 +                File jspFolderFile = new File(FileUtil.toFile(htmlFO),path);
 287.157 +                jspFolderFile.mkdirs();
 287.158 +                try {
 287.159 +                    copyDirectory(fo, FileUtil.toFileObject(jspFolderFile).getParent());
 287.160 +                } catch (IOException ex) {
 287.161 +                }
 287.162 +            }
 287.163 +        }
 287.164 +        
 287.165 +        public void copyDirectory(FileObject sourceLocation , FileObject destParent/*, String file*/)
 287.166 +        throws IOException {
 287.167 +
 287.168 +            if (sourceLocation.isFolder()) {
 287.169 +
 287.170 +                FileObject destFO = destParent.getFileObject(sourceLocation.getName());
 287.171 +                if (destFO == null) {
 287.172 +                    try{
 287.173 +                        destFO = destParent.createFolder(sourceLocation.getName());
 287.174 +                    }catch(Exception e) {
 287.175 +                        e.printStackTrace();
 287.176 +                    }
 287.177 +                }
 287.178 +
 287.179 +                FileObject[] children = sourceLocation.getChildren();
 287.180 +                for (int i=0; i<children.length; i++) {
 287.181 +                    copyDirectory(children[i],destFO);
 287.182 +                }
 287.183 +            } else {
 287.184 +                try {
 287.185 +                    FileUtil.copyFile(sourceLocation, destParent,sourceLocation.getName());
 287.186 +                }catch(Exception e) {
 287.187 +                }
 287.188 +            }
 287.189 +        }
 287.190 +    }
 287.191 +}
   288.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   288.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/resources/Hook.html	Sun Jun 26 10:25:14 2011 +0800
   288.3 @@ -0,0 +1,11 @@
   288.4 +<!-- 
   288.5 +    Document   : Hook
   288.6 +    Created on : Nov 13, 2008, 8:44:51 PM
   288.7 +    Author     : Chetan 
   288.8 +-->
   288.9 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  288.10 +<html>
  288.11 +  <body>
  288.12 +         Creates a Hook Plugin - This plugin can be deployed on Sun Glassfish Web Space Server, Liferay Portal Server.
  288.13 +  </body>
  288.14 +</html> 
   289.1 Binary file portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/resources/hook.png has changed
   290.1 Binary file portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/resources/search.png has changed
   291.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   291.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/eventhook.template	Sun Jun 26 10:25:14 2011 +0800
   291.3 @@ -0,0 +1,16 @@
   291.4 +<#if PACKAGE != "">package ${PACKAGE};
   291.5 +</#if>
   291.6 +
   291.7 +import com.liferay.portal.kernel.events.Action;
   291.8 +import com.liferay.portal.kernel.events.ActionException;
   291.9 +import javax.servlet.http.HttpServletRequest;
  291.10 +import javax.servlet.http.HttpServletResponse;
  291.11 +
  291.12 +public class ${CLASS_NAME} extends Action {
  291.13 +
  291.14 +    @Override
  291.15 +    public void run(HttpServletRequest request, HttpServletResponse response) throws ActionException {
  291.16 +        //Add your implementation here
  291.17 +    }
  291.18 +    
  291.19 +} 
  291.20 \ No newline at end of file
   292.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   292.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/liferay-hook-template.xml	Sun Jun 26 10:25:14 2011 +0800
   292.3 @@ -0,0 +1,5 @@
   292.4 +<?xml version="1.0" encoding="UTF-8"?>
   292.5 +<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 5.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_5_2_0.dtd">
   292.6 +
   292.7 +<hook>
   292.8 +</hook>
   292.9 \ No newline at end of file
   293.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   293.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/mdllsnrhook.template	Sun Jun 26 10:25:14 2011 +0800
   293.3 @@ -0,0 +1,53 @@
   293.4 +<#if PACKAGE != "">package ${PACKAGE};
   293.5 +</#if>
   293.6 +
   293.7 +import com.liferay.portal.ModelListenerException;
   293.8 +import com.liferay.portal.model.BaseModel;
   293.9 +import com.liferay.portal.model.ModelListener;
  293.10 +//import ${MDL_LISTENER};
  293.11 +
  293.12 +public class ${CLASS_NAME} implements ModelListener {
  293.13 +
  293.14 +    public void onAfterCreate(BaseModel model) throws ModelListenerException {
  293.15 +        //Add your implementation here
  293.16 +        ${MDL_LISTENER} mdlObj 
  293.17 +                = (${MDL_LISTENER}) model;
  293.18 +    }
  293.19 +
  293.20 +    public void onAfterAddAssociation(Object arg0, String arg1, Object arg2) throws ModelListenerException {
  293.21 +        //Add your implementation here
  293.22 +    }
  293.23 +
  293.24 +    public void onAfterRemove(BaseModel model) throws ModelListenerException {
  293.25 +        //Add your implementation here
  293.26 +    }
  293.27 +
  293.28 +    public void onAfterRemoveAssociation(Object arg0, String arg1, Object arg2) throws ModelListenerException {
  293.29 +        //Add your implementation here
  293.30 +    }
  293.31 +
  293.32 +    public void onAfterUpdate(BaseModel model) throws ModelListenerException {
  293.33 +        //Add your implementation here
  293.34 +    }
  293.35 +
  293.36 +    public void onBeforeAddAssociation(Object arg0, String arg1, Object arg2) throws ModelListenerException {
  293.37 +        //Add your implementation here
  293.38 +    }
  293.39 +
  293.40 +    public void onBeforeCreate(BaseModel model) throws ModelListenerException {
  293.41 +        //Add your implementation here
  293.42 +    }
  293.43 +
  293.44 +    public void onBeforeRemove(BaseModel model) throws ModelListenerException {
  293.45 +        //Add your implementation here
  293.46 +    }
  293.47 +
  293.48 +    public void onBeforeRemoveAssociation(Object arg0, String arg1, Object arg2) throws ModelListenerException {
  293.49 +        //Add your implementation here
  293.50 +    }
  293.51 +
  293.52 +    public void onBeforeUpdate(BaseModel model) throws ModelListenerException {
  293.53 +        //Add your implementation here
  293.54 +    }
  293.55 +
  293.56 +}
  293.57 \ No newline at end of file
   294.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   294.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/mdllsnrhook_5_2_3.template	Sun Jun 26 10:25:14 2011 +0800
   294.3 @@ -0,0 +1,52 @@
   294.4 +<#if PACKAGE != "">package ${PACKAGE};
   294.5 +</#if>
   294.6 +
   294.7 +import com.liferay.portal.ModelListenerException;
   294.8 +import com.liferay.portal.model.ModelListener;
   294.9 +//import ${MDL_LISTENER};
  294.10 +
  294.11 +public class ${CLASS_NAME} implements ModelListener {
  294.12 +
  294.13 +    public void onAfterCreate(Object model) throws ModelListenerException {
  294.14 +        //Add your implementation here
  294.15 +        ${MDL_LISTENER} mdlObj 
  294.16 +                = (${MDL_LISTENER}) model;
  294.17 +    }
  294.18 +
  294.19 +    public void onAfterAddAssociation(Object arg0, String arg1, Object arg2) throws ModelListenerException {
  294.20 +        //Add your implementation here
  294.21 +    }
  294.22 +
  294.23 +    public void onAfterRemove(Object model) throws ModelListenerException {
  294.24 +        //Add your implementation here
  294.25 +    }
  294.26 +
  294.27 +    public void onAfterRemoveAssociation(Object arg0, String arg1, Object arg2) throws ModelListenerException {
  294.28 +        //Add your implementation here
  294.29 +    }
  294.30 +
  294.31 +    public void onAfterUpdate(Object model) throws ModelListenerException {
  294.32 +        //Add your implementation here
  294.33 +    }
  294.34 +
  294.35 +    public void onBeforeAddAssociation(Object arg0, String arg1, Object arg2) throws ModelListenerException {
  294.36 +        //Add your implementation here
  294.37 +    }
  294.38 +
  294.39 +    public void onBeforeCreate(Object model) throws ModelListenerException {
  294.40 +        //Add your implementation here
  294.41 +    }
  294.42 +
  294.43 +    public void onBeforeRemove(Object model) throws ModelListenerException {
  294.44 +        //Add your implementation here
  294.45 +    }
  294.46 +
  294.47 +    public void onBeforeRemoveAssociation(Object arg0, String arg1, Object arg2) throws ModelListenerException {
  294.48 +        //Add your implementation here
  294.49 +    }
  294.50 +
  294.51 +    public void onBeforeUpdate(Object model) throws ModelListenerException {
  294.52 +        //Add your implementation here
  294.53 +    }
  294.54 +
  294.55 +}
  294.56 \ No newline at end of file
   295.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   295.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/portal-props-template.properties	Sun Jun 26 10:25:14 2011 +0800
   295.3 @@ -0,0 +1,36 @@
   295.4 +#Not all portal properties can be overridden via a hook. The supported properties are:
   295.5 +
   295.6 +#auth.forward.by.last.path=true
   295.7 +#javascript.fast.load=true
   295.8 +#layout.template.cache.enabled=true
   295.9 +#layout.user.private.layouts.auto.create=true
  295.10 +#layout.user.private.layouts.enabled=true
  295.11 +#layout.user.private.layouts.modifiable=true
  295.12 +#layout.user.public.layouts.auto.create=true
  295.13 +#layout.user.public.layouts.enabled=true
  295.14 +#layout.user.public.layouts.modifiable=true
  295.15 +#my.places.show.community.private.sites.with.no.layouts=true
  295.16 +#my.places.show.community.public.sites.with.no.layouts=true
  295.17 +#my.places.show.organization.private.sites.with.no.layouts=true
  295.18 +#my.places.show.organization.public.sites.with.no.layouts=true
  295.19 +#my.places.show.user.private.sites.with.no.layouts=true
  295.20 +#my.places.show.user.public.sites.with.no.layouts=true
  295.21 +#terms.of.use.required=true
  295.22 +#theme.css.fast.load=true
  295.23 +#theme.images.fast.load=true
  295.24 +
  295.25 +#passwords.passwordpolicytoolkit.generator=static
  295.26 +#passwords.passwordpolicytoolkit.static=iheartliferay
  295.27 +
  295.28 +#layout.static.portlets.all=1_WAR_chatportlet
  295.29 +
  295.30 +#auto.login.hooks=com.liferay.portal.security.auth.CASAutoLogin,com.liferay.portal.security.auth.NtlmAutoLogin,com.liferay.portal.security.auth.OpenIdAutoLogin,com.liferay.portal.security.auth.OpenSSOAutoLogin,com.liferay.portal.security.auth.RememberMeAutoLogin,com.liferay.portal.security.auth.SiteMinderAutoLogin
  295.31 +
  295.32 +#application.startup.events=application.startup.events
  295.33 +
  295.34 +#login.events.post=com.liferay.portal.events.LoginPostAction,com.liferay.portal.events.DefaultLandingPageAction
  295.35 +#login.events.pre=com.liferay.portal.events.LoginPreAction
  295.36 +#logout.events.post=com.liferay.portal.events.LogoutPostAction,com.liferay.portal.events.DefaultLogoutPageAction,com.liferay.portal.events.SiteMinderLogoutAction
  295.37 +#logout.events.pre=com.liferay.portal.events.LogoutPreAction
  295.38 +#servlet.service.events.post=com.liferay.portal.events.ServicePostAction
  295.39 +#servlet.service.events.pre=com.liferay.portal.events.ServicePreAction
   296.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   296.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/startupeventhook.template	Sun Jun 26 10:25:14 2011 +0800
   296.3 @@ -0,0 +1,22 @@
   296.4 +<#if PACKAGE != "">package ${PACKAGE};
   296.5 +</#if>
   296.6 +
   296.7 +import com.liferay.portal.kernel.events.ActionException;
   296.8 +import com.liferay.portal.kernel.events.SimpleAction;
   296.9 +import com.liferay.portal.kernel.util.GetterUtil;
  296.10 +
  296.11 +public class ${CLASS_NAME} extends SimpleAction {
  296.12 +
  296.13 +    @Override
  296.14 +    public void run(String[] ids) throws ActionException {
  296.15 +        try {
  296.16 +            doRun(GetterUtil.getLong(ids[0]));
  296.17 +        } catch (Exception e) {
  296.18 +            throw new ActionException(e);
  296.19 +        }
  296.20 +    }
  296.21 +
  296.22 +    private void doRun(long companyId) {
  296.23 +        System.out.println("Company Id: " + companyId);
  296.24 +    }   
  296.25 +}
  296.26 \ No newline at end of file
   297.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   297.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/ui/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   297.3 @@ -0,0 +1,9 @@
   297.4 +HookDetailsPanelGUI.jScrollPane1.AccessibleContext.accessibleName=Additional Configurations:
   297.5 +HookDetailsPanelGUI.jScrollPane1.AccessibleContext.accessibleDescription=null
   297.6 +HookDetailsPanelGUI.jLayeredPane1.AccessibleContext.accessibleName=Additonal Configuration
   297.7 +TTL_HOOK_CONFIGURATION=Hook Configuration
   297.8 +HookDetailsPanelGUI.HOOKTYPE.LABEL=Hook Type:
   297.9 +NOT_ALLOWED_FOR_NON_WEBSYNERGY_RUNTIME=New Hook plug-in is only allowed when runtime is Web Space/Liferay Portal Server
  297.10 +HOOK_NOT_ALLOWED_WHEN_APP_NAME_NOT_ENDS_WITH_HOOK=<html><body>Hook Plug-in is only allowed when the project name ends with "-hook".\
  297.11 +                     <br>Rename the current project or Create a new project which ends with "-hook" \
  297.12 +                     <br>as per Web Space/Liferay naming convention.</body></html>
   298.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   298.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/ui/HookDetailsPanel.java	Sun Jun 26 10:25:14 2011 +0800
   298.3 @@ -0,0 +1,196 @@
   298.4 +/*
   298.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   298.6 + * 
   298.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   298.8 + * 
   298.9 + * The contents of this file are subject to the terms of either the GNU
  298.10 + * General Public License Version 2 only ("GPL") or the Common
  298.11 + * Development and Distribution License("CDDL") (collectively, the
  298.12 + * "License"). You may not use this file except in compliance with the
  298.13 + * License. You can obtain a copy of the License at
  298.14 + * http://www.netbeans.org/cddl-gplv2.html
  298.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  298.16 + * specific language governing permissions and limitations under the
  298.17 + * License.  When distributing the software, include this License Header
  298.18 + * Notice in each file and include the License file at
  298.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  298.20 + * particular file as subject to the "Classpath" exception as provided
  298.21 + * by Sun in the GPL Version 2 section of the License file that
  298.22 + * accompanied this code. If applicable, add the following below the
  298.23 + * License Header, with the fields enclosed by brackets [] replaced by
  298.24 + * your own identifying information:
  298.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  298.26 + * 
  298.27 + * If you wish your version of this file to be governed by only the CDDL
  298.28 + * or only the GPL Version 2, indicate your decision by adding
  298.29 + * "[Contributor] elects to include this software in this distribution
  298.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  298.31 + * single choice of license, a recipient has the option to distribute
  298.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  298.33 + * to extend the choice of license to its licensees as provided above.
  298.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  298.35 + * Version 2 license, then the option applies only if the new code is
  298.36 + * made subject to such option by the copyright holder.
  298.37 + * 
  298.38 + * Contributor(s):
  298.39 + * 
  298.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  298.41 + */
  298.42 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.ui;
  298.43 +
  298.44 +import java.awt.Component;
  298.45 +import java.util.HashSet;
  298.46 +import java.util.Iterator;
  298.47 +import java.util.Set;
  298.48 +import javax.swing.event.ChangeEvent;
  298.49 +import javax.swing.event.ChangeListener;
  298.50 +import org.netbeans.api.project.Project;
  298.51 +import org.netbeans.api.project.ProjectUtils;
  298.52 +import org.netbeans.modules.portalpack.servers.websynergy.common.WebSpacePropertiesUtil;
  298.53 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.HookType;
  298.54 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.HookTypeFactory;
  298.55 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.HookTypeHandler;
  298.56 +import org.openide.WizardDescriptor;
  298.57 +import org.openide.filesystems.FileObject;
  298.58 +import org.openide.util.HelpCtx;
  298.59 +import org.openide.util.NbBundle;
  298.60 +
  298.61 +/**
  298.62 + *
  298.63 + * @author Santh Chetan Chadalavada
  298.64 + */
  298.65 +
  298.66 +public class HookDetailsPanel implements WizardDescriptor.Panel, ChangeListener {
  298.67 +
  298.68 +    private HookDetailsPanelGUI component;
  298.69 +    private WizardDescriptor wizard;
  298.70 +    private Project project;
  298.71 +    
  298.72 +    public HookDetailsPanel() {
  298.73 +        
  298.74 +    }
  298.75 +    public HookDetailsPanel(Project project) {
  298.76 +        this.project = project;
  298.77 +    }
  298.78 +    /**
  298.79 +     * The visual component that displays this panel. If you need to access the
  298.80 +     * component from this class, just use getComponent().
  298.81 +     */
  298.82 +    //private Component component;
  298.83 +
  298.84 +    // Get the visual component for the panel. In this template, the component
  298.85 +    // is kept separate. This can be more efficient: if the wizard is created
  298.86 +    // but never displayed, or not all panels are displayed, it is better to
  298.87 +    // create only those which really need to be visible.
  298.88 +    public Component getComponent() {
  298.89 +        if (component == null) {
  298.90 +            component = new HookDetailsPanelGUI();
  298.91 +            registerHandlers();
  298.92 +            component.addChangeListener(this);
  298.93 +        }
  298.94 +        return component;
  298.95 +    }
  298.96 +    
  298.97 +    private void registerHandlers() {
  298.98 +      
  298.99 +        HookType eventType = new HookType(HookType.EVENT_HANDLER_HOOK);
 298.100 +        HookTypeHandler eventHandler =
 298.101 +                HookTypeFactory.getHookTypeHandler(project, eventType);
 298.102 +        component.registerHandlers(eventType, eventHandler);
 298.103 +        
 298.104 +        HookType modelType = new HookType(HookType.MODEL_LISTENERS_HOOK);
 298.105 +        HookTypeHandler modelHandler =
 298.106 +                HookTypeFactory.getHookTypeHandler(project, modelType);
 298.107 +        component.registerHandlers(modelType, modelHandler);
 298.108 +        
 298.109 +        HookType ppType = new HookType(HookType.PORTAL_PROPERTIES_HOOK);
 298.110 +        HookTypeHandler ppHandler =
 298.111 +                HookTypeFactory.getHookTypeHandler(project, ppType);
 298.112 +        component.registerHandlers(ppType, ppHandler);
 298.113 +        
 298.114 +        HookType jspType = new HookType(HookType.JSP_HOOK);
 298.115 +        HookTypeHandler jspHandler =
 298.116 +                HookTypeFactory.getHookTypeHandler(project, jspType);
 298.117 +        component.registerHandlers(jspType, jspHandler);
 298.118 +    }
 298.119 +
 298.120 +    public HelpCtx getHelp() {
 298.121 +        // Show no Help button for this panel:
 298.122 +        return HelpCtx.DEFAULT_HELP;
 298.123 +    // If you have context help:
 298.124 +    // return new HelpCtx(SampleWizardPanel1.class);
 298.125 +    }
 298.126 +
 298.127 +    public boolean isValid() {
 298.128 +        if(!WebSpacePropertiesUtil.isWebSynergyServer(project)) {
 298.129 +            if(wizard != null) {
 298.130 +                wizard.putProperty("WizardPanel_errorMessage",
 298.131 +                            NbBundle.getMessage(
 298.132 +                            HookDetailsPanel.class, "NOT_ALLOWED_FOR_NON_WEBSYNERGY_RUNTIME")); // NOI18N
 298.133 +                return false;
 298.134 +            }
 298.135 +        } else {
 298.136 +            String prjName = ProjectUtils.getInformation(project).getName();
 298.137 +            if(prjName != null && !prjName.endsWith("-hook")) {
 298.138 +                   if(wizard != null) {
 298.139 +                        wizard.putProperty("WizardPanel_errorMessage",
 298.140 +                                NbBundle.getMessage(
 298.141 +                                HookDetailsPanel.class, "HOOK_NOT_ALLOWED_WHEN_APP_NAME_NOT_ENDS_WITH_HOOK")); // NOI18N
 298.142 +                        return false;
 298.143 +                   }
 298.144 +            }
 298.145 +            
 298.146 +        }
 298.147 +        // If it is always OK to press Next or Finish, then:
 298.148 +        return component.valid(wizard);
 298.149 +    // If it depends on some condition (form filled out...), then:
 298.150 +    // return someCondition();
 298.151 +    // and when this condition changes (last form field filled in...) then:
 298.152 +    // fireChangeEvent();
 298.153 +    // and uncomment the complicated stuff below.
 298.154 +    }
 298.155 +
 298.156 +    private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1); // or can use ChangeSupport in NB 6.0
 298.157 +
 298.158 +    public final void addChangeListener(ChangeListener l) {
 298.159 +        synchronized (listeners) {
 298.160 +            listeners.add(l);
 298.161 +        }
 298.162 +    }
 298.163 +
 298.164 +    public final void removeChangeListener(ChangeListener l) {
 298.165 +        synchronized (listeners) {
 298.166 +            listeners.remove(l);
 298.167 +        }
 298.168 +    }
 298.169 +
 298.170 +    protected final void fireChangeEvent() {
 298.171 +        Iterator<ChangeListener> it;
 298.172 +        synchronized (listeners) {
 298.173 +            it = new HashSet<ChangeListener>(listeners).iterator();
 298.174 +        }
 298.175 +        ChangeEvent ev = new ChangeEvent(this);
 298.176 +        while (it.hasNext()) {
 298.177 +            it.next().stateChanged(ev);
 298.178 +        }
 298.179 +    }
 298.180 +     
 298.181 +
 298.182 +    // You can use a settings object to keep track of state. Normally the
 298.183 +    // settings object will be the WizardDescriptor, so you can use
 298.184 +    // WizardDescriptor.getProperty & putProperty to store information entered
 298.185 +    // by the user.
 298.186 +    public void readSettings(Object settings) {
 298.187 +        wizard = (WizardDescriptor) settings;
 298.188 +        component.readSettings(wizard);
 298.189 +    }
 298.190 +
 298.191 +    public void storeSettings(Object settings) {
 298.192 +         component.storeSettings((WizardDescriptor)settings);
 298.193 +    }
 298.194 +
 298.195 +    public void stateChanged(ChangeEvent e) {
 298.196 +        fireChangeEvent();
 298.197 +    }
 298.198 +}
 298.199 +
   299.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   299.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/ui/HookDetailsPanelGUI.form	Sun Jun 26 10:25:14 2011 +0800
   299.3 @@ -0,0 +1,91 @@
   299.4 +<?xml version="1.0" encoding="UTF-8" ?>
   299.5 +
   299.6 +<Form version="1.4" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
   299.7 +  <AuxValues>
   299.8 +    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
   299.9 +    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
  299.10 +    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
  299.11 +    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
  299.12 +    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
  299.13 +    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
  299.14 +    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
  299.15 +    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
  299.16 +  </AuxValues>
  299.17 +
  299.18 +  <Layout>
  299.19 +    <DimensionLayout dim="0">
  299.20 +      <Group type="103" groupAlignment="0" attributes="0">
  299.21 +          <Group type="102" alignment="0" attributes="0">
  299.22 +              <EmptySpace max="-2" attributes="0"/>
  299.23 +              <Group type="103" groupAlignment="0" attributes="0">
  299.24 +                  <Component id="jScrollPane1" alignment="0" pref="542" max="32767" attributes="0"/>
  299.25 +                  <Group type="102" alignment="0" attributes="0">
  299.26 +                      <Component id="hookTypeLabel" min="-2" max="-2" attributes="0"/>
  299.27 +                      <EmptySpace min="-2" pref="82" max="-2" attributes="0"/>
  299.28 +                      <Component id="hookTypeCB" min="-2" pref="150" max="-2" attributes="0"/>
  299.29 +                  </Group>
  299.30 +              </Group>
  299.31 +              <EmptySpace max="-2" attributes="0"/>
  299.32 +          </Group>
  299.33 +      </Group>
  299.34 +    </DimensionLayout>
  299.35 +    <DimensionLayout dim="1">
  299.36 +      <Group type="103" groupAlignment="0" attributes="0">
  299.37 +          <Group type="102" alignment="0" attributes="0">
  299.38 +              <EmptySpace min="-2" max="-2" attributes="0"/>
  299.39 +              <Group type="103" groupAlignment="3" attributes="0">
  299.40 +                  <Component id="hookTypeCB" alignment="3" min="-2" max="-2" attributes="0"/>
  299.41 +                  <Component id="hookTypeLabel" alignment="3" min="-2" max="-2" attributes="0"/>
  299.42 +              </Group>
  299.43 +              <EmptySpace min="-2" max="-2" attributes="0"/>
  299.44 +              <Component id="jScrollPane1" pref="374" max="32767" attributes="0"/>
  299.45 +              <EmptySpace min="-2" max="-2" attributes="0"/>
  299.46 +          </Group>
  299.47 +      </Group>
  299.48 +    </DimensionLayout>
  299.49 +  </Layout>
  299.50 +  <SubComponents>
  299.51 +    <Component class="javax.swing.JLabel" name="hookTypeLabel">
  299.52 +      <Properties>
  299.53 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  299.54 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/hook/ui/Bundle.properties" key="HookDetailsPanelGUI.HOOKTYPE.LABEL" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  299.55 +        </Property>
  299.56 +      </Properties>
  299.57 +    </Component>
  299.58 +    <Component class="javax.swing.JComboBox" name="hookTypeCB">
  299.59 +      <Properties>
  299.60 +        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
  299.61 +          <StringArray count="0"/>
  299.62 +        </Property>
  299.63 +      </Properties>
  299.64 +      <Events>
  299.65 +        <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="hookTypeCBItemStateChanged"/>
  299.66 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="hookTypeCBActionPerformed"/>
  299.67 +      </Events>
  299.68 +    </Component>
  299.69 +    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
  299.70 +      <Properties>
  299.71 +        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
  299.72 +          <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
  299.73 +            <TitledBorder title="Hook Configuration">
  299.74 +              <ResourceString PropertyName="titleX" bundle="org/netbeans/modules/portalpack/websynergy/portlets/hook/ui/Bundle.properties" key="TTL_HOOK_CONFIGURATION" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  299.75 +            </TitledBorder>
  299.76 +          </Border>
  299.77 +        </Property>
  299.78 +      </Properties>
  299.79 +
  299.80 +      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
  299.81 +      <SubComponents>
  299.82 +        <Container class="javax.swing.JPanel" name="cardPanel">
  299.83 +          <Properties>
  299.84 +            <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
  299.85 +              <Dimension value="[2147483647, 2147483647]"/>
  299.86 +            </Property>
  299.87 +          </Properties>
  299.88 +
  299.89 +          <Layout class="org.netbeans.modules.form.compat2.layouts.DesignCardLayout"/>
  299.90 +        </Container>
  299.91 +      </SubComponents>
  299.92 +    </Container>
  299.93 +  </SubComponents>
  299.94 +</Form>
   300.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   300.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/ui/HookDetailsPanelGUI.java	Sun Jun 26 10:25:14 2011 +0800
   300.3 @@ -0,0 +1,251 @@
   300.4 +/*
   300.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   300.6 + * 
   300.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   300.8 + * 
   300.9 + * The contents of this file are subject to the terms of either the GNU
  300.10 + * General Public License Version 2 only ("GPL") or the Common
  300.11 + * Development and Distribution License("CDDL") (collectively, the
  300.12 + * "License"). You may not use this file except in compliance with the
  300.13 + * License. You can obtain a copy of the License at
  300.14 + * http://www.netbeans.org/cddl-gplv2.html
  300.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  300.16 + * specific language governing permissions and limitations under the
  300.17 + * License.  When distributing the software, include this License Header
  300.18 + * Notice in each file and include the License file at
  300.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  300.20 + * particular file as subject to the "Classpath" exception as provided
  300.21 + * by Sun in the GPL Version 2 section of the License file that
  300.22 + * accompanied this code. If applicable, add the following below the
  300.23 + * License Header, with the fields enclosed by brackets [] replaced by
  300.24 + * your own identifying information:
  300.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  300.26 + * 
  300.27 + * If you wish your version of this file to be governed by only the CDDL
  300.28 + * or only the GPL Version 2, indicate your decision by adding
  300.29 + * "[Contributor] elects to include this software in this distribution
  300.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  300.31 + * single choice of license, a recipient has the option to distribute
  300.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  300.33 + * to extend the choice of license to its licensees as provided above.
  300.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  300.35 + * Version 2 license, then the option applies only if the new code is
  300.36 + * made subject to such option by the copyright holder.
  300.37 + * 
  300.38 + * Contributor(s):
  300.39 + * 
  300.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  300.41 + */
  300.42 +
  300.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.ui;
  300.44 +
  300.45 +import java.awt.CardLayout;
  300.46 +import java.util.ArrayList;
  300.47 +import java.util.HashMap;
  300.48 +import java.util.Iterator;
  300.49 +import java.util.List;
  300.50 +import java.util.Map;
  300.51 +import javax.swing.JPanel;
  300.52 +import javax.swing.event.ChangeEvent;
  300.53 +import javax.swing.event.ChangeListener;
  300.54 +import javax.swing.event.DocumentEvent;
  300.55 +import javax.swing.text.Document;
  300.56 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.ConfigPanel;
  300.57 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.HookType;
  300.58 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.HookTypeHandler;
  300.59 +import org.openide.WizardDescriptor;
  300.60 +/**
  300.61 + *
  300.62 + * @author Santh Chetan Chadalavada
  300.63 + */
  300.64 +public final class HookDetailsPanelGUI extends JPanel implements ChangeListener{
  300.65 +
  300.66 +    private final List/*<ChangeListener>*/ listeners = new ArrayList();
  300.67 +    private Map<String,WizardDescriptor.Panel> bottomPanels;
  300.68 +    
  300.69 +    /** Creates new form HookDetailsPanelGUI */
  300.70 +    public HookDetailsPanelGUI() {
  300.71 +        initComponents();
  300.72 +        bottomPanels = new HashMap();
  300.73 +       
  300.74 +    }
  300.75 +
  300.76 +     public void registerHandlers(HookType hookType, HookTypeHandler hookHandler) {
  300.77 +
  300.78 +        hookTypeCB.addItem(hookType);
  300.79 +  
  300.80 +
  300.81 +        CardLayout cardLayout = (CardLayout) cardPanel.getLayout();
  300.82 +        
  300.83 +        WizardDescriptor.Panel configPanel = hookHandler.getConfigPanel();
  300.84 +        configPanel.addChangeListener(this);
  300.85 +
  300.86 +        cardPanel.add(configPanel.getComponent(),hookType.getType());
  300.87 +        
  300.88 +        bottomPanels.put(hookType.getType(), configPanel);
  300.89 +
  300.90 +        cardLayout.show(cardPanel,((HookType)hookTypeCB.getSelectedItem()).getType());
  300.91 +        
  300.92 +    }
  300.93 +     
  300.94 +    /** This method is called from within the constructor to
  300.95 +     * initialize the form.
  300.96 +     * WARNING: Do NOT modify this code. The content of this method is
  300.97 +     * always regenerated by the Form Editor.
  300.98 +     */
  300.99 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
 300.100 +    private void initComponents() {
 300.101 +
 300.102 +        hookTypeLabel = new javax.swing.JLabel();
 300.103 +        hookTypeCB = new javax.swing.JComboBox();
 300.104 +        jScrollPane1 = new javax.swing.JScrollPane();
 300.105 +        cardPanel = new javax.swing.JPanel();
 300.106 +
 300.107 +        org.openide.awt.Mnemonics.setLocalizedText(hookTypeLabel, org.openide.util.NbBundle.getMessage(HookDetailsPanelGUI.class, "HookDetailsPanelGUI.HOOKTYPE.LABEL")); // NOI18N
 300.108 +
 300.109 +        hookTypeCB.addItemListener(new java.awt.event.ItemListener() {
 300.110 +            public void itemStateChanged(java.awt.event.ItemEvent evt) {
 300.111 +                hookTypeCBItemStateChanged(evt);
 300.112 +            }
 300.113 +        });
 300.114 +        hookTypeCB.addActionListener(new java.awt.event.ActionListener() {
 300.115 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
 300.116 +                hookTypeCBActionPerformed(evt);
 300.117 +            }
 300.118 +        });
 300.119 +
 300.120 +        jScrollPane1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(HookDetailsPanelGUI.class, "TTL_HOOK_CONFIGURATION"))); // NOI18N
 300.121 +
 300.122 +        cardPanel.setMaximumSize(new java.awt.Dimension(2147483647, 2147483647));
 300.123 +        cardPanel.setLayout(new java.awt.CardLayout());
 300.124 +        jScrollPane1.setViewportView(cardPanel);
 300.125 +
 300.126 +        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
 300.127 +        this.setLayout(layout);
 300.128 +        layout.setHorizontalGroup(
 300.129 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 300.130 +            .add(layout.createSequentialGroup()
 300.131 +                .addContainerGap()
 300.132 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 300.133 +                    .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 542, Short.MAX_VALUE)
 300.134 +                    .add(layout.createSequentialGroup()
 300.135 +                        .add(hookTypeLabel)
 300.136 +                        .add(82, 82, 82)
 300.137 +                        .add(hookTypeCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 150, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
 300.138 +                .addContainerGap())
 300.139 +        );
 300.140 +        layout.setVerticalGroup(
 300.141 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 300.142 +            .add(layout.createSequentialGroup()
 300.143 +                .addContainerGap()
 300.144 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 300.145 +                    .add(hookTypeCB, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 300.146 +                    .add(hookTypeLabel))
 300.147 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 300.148 +                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 374, Short.MAX_VALUE)
 300.149 +                .addContainerGap())
 300.150 +        );
 300.151 +    }// </editor-fold>//GEN-END:initComponents
 300.152 +
 300.153 +private void hookTypeCBItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_hookTypeCBItemStateChanged
 300.154 +// TODO add your handling code here:
 300.155 +    HookType hookType = (HookType) hookTypeCB.getSelectedItem();
 300.156 +    CardLayout cardLayout = (CardLayout) cardPanel.getLayout();
 300.157 +    cardLayout.show(cardPanel, hookType.getType());
 300.158 +
 300.159 +    fireChange();
 300.160 +}//GEN-LAST:event_hookTypeCBItemStateChanged
 300.161 +
 300.162 +private void hookTypeCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hookTypeCBActionPerformed
 300.163 +// TODO add your handling code here:
 300.164 +}//GEN-LAST:event_hookTypeCBActionPerformed
 300.165 +
 300.166 +    // Variables declaration - do not modify//GEN-BEGIN:variables
 300.167 +    private javax.swing.JPanel cardPanel;
 300.168 +    private javax.swing.JComboBox hookTypeCB;
 300.169 +    private javax.swing.JLabel hookTypeLabel;
 300.170 +    private javax.swing.JScrollPane jScrollPane1;
 300.171 +    // End of variables declaration//GEN-END:variables
 300.172 +
 300.173 +    
 300.174 +    public boolean valid(WizardDescriptor wizardDescriptor) {
 300.175 +        HookType hookType = (HookType) hookTypeCB.getSelectedItem();
 300.176 +        WizardDescriptor.Panel panel = bottomPanels.get(hookType.getType());
 300.177 +        return panel.isValid();
 300.178 +        
 300.179 +    }
 300.180 +
 300.181 +    public void readSettings(WizardDescriptor wizardDescriptor) {
 300.182 +
 300.183 +        for (int i = 0; i < hookTypeCB.getItemCount(); i++) {
 300.184 +
 300.185 +            HookType selectedHook =
 300.186 +                    (HookType) hookTypeCB.getItemAt(i);
 300.187 +
 300.188 +           WizardDescriptor.Panel configPanel = (WizardDescriptor.Panel) bottomPanels.get(selectedHook.getType());
 300.189 +
 300.190 +            if (configPanel != null) {
 300.191 +                configPanel.readSettings(wizardDescriptor);
 300.192 +            }
 300.193 +        }
 300.194 +    }
 300.195 +
 300.196 +    public void storeSettings(WizardDescriptor wizardDescriptor) {
 300.197 +
 300.198 +        wizardDescriptor.putProperty("hook-type", hookTypeCB.getSelectedItem());
 300.199 +        
 300.200 +        HookType selectedHook =
 300.201 +                (HookType) hookTypeCB.getSelectedItem();
 300.202 +
 300.203 +        WizardDescriptor.Panel configPanel = (WizardDescriptor.Panel) bottomPanels.get(selectedHook.getType());
 300.204 +
 300.205 +        if (configPanel != null) {
 300.206 +            configPanel.storeSettings(wizardDescriptor);
 300.207 +        }
 300.208 +    }
 300.209 +    
 300.210 +    public void insertUpdate(DocumentEvent e) {
 300.211 +        updateTexts(e);
 300.212 +    }
 300.213 +
 300.214 +    public void removeUpdate(DocumentEvent e) {
 300.215 +        updateTexts(e);
 300.216 +    }
 300.217 +
 300.218 +    public void changedUpdate(DocumentEvent e) {
 300.219 +        updateTexts(e);
 300.220 +    }
 300.221 +
 300.222 +    /** Handles changes in the Project name and project directory, */
 300.223 +    private void updateTexts(DocumentEvent e) {
 300.224 +
 300.225 +        Document doc = e.getDocument();
 300.226 +        fireChange();
 300.227 +
 300.228 +    }
 300.229 +    
 300.230 +    public void stateChanged(ChangeEvent e) {
 300.231 +        fireChange();
 300.232 +    }
 300.233 +    
 300.234 +    private void fireChange() {
 300.235 +        ChangeEvent e = new ChangeEvent(this);
 300.236 +        List templist;
 300.237 +        synchronized (this) {
 300.238 +            templist = new ArrayList(listeners);
 300.239 +        }
 300.240 +        Iterator it = templist.iterator();
 300.241 +        while (it.hasNext()) {
 300.242 +            ((ChangeListener) it.next()).stateChanged(e);
 300.243 +        }
 300.244 +    }
 300.245 +    
 300.246 +    public synchronized void addChangeListener(ChangeListener l) {
 300.247 +        listeners.add(l);
 300.248 +    }
 300.249 +
 300.250 +    public synchronized void removeChangeListener(ChangeListener l) {
 300.251 +        listeners.remove(l);
 300.252 +    }
 300.253 +}
 300.254 +
   301.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   301.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/hook/ui/HookPluginWizardIterator.java	Sun Jun 26 10:25:14 2011 +0800
   301.3 @@ -0,0 +1,177 @@
   301.4 +/*
   301.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   301.6 + * 
   301.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   301.8 + * 
   301.9 + * The contents of this file are subject to the terms of either the GNU
  301.10 + * General Public License Version 2 only ("GPL") or the Common
  301.11 + * Development and Distribution License("CDDL") (collectively, the
  301.12 + * "License"). You may not use this file except in compliance with the
  301.13 + * License. You can obtain a copy of the License at
  301.14 + * http://www.netbeans.org/cddl-gplv2.html
  301.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  301.16 + * specific language governing permissions and limitations under the
  301.17 + * License.  When distributing the software, include this License Header
  301.18 + * Notice in each file and include the License file at
  301.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  301.20 + * particular file as subject to the "Classpath" exception as provided
  301.21 + * by Sun in the GPL Version 2 section of the License file that
  301.22 + * accompanied this code. If applicable, add the following below the
  301.23 + * License Header, with the fields enclosed by brackets [] replaced by
  301.24 + * your own identifying information:
  301.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  301.26 + * 
  301.27 + * If you wish your version of this file to be governed by only the CDDL
  301.28 + * or only the GPL Version 2, indicate your decision by adding
  301.29 + * "[Contributor] elects to include this software in this distribution
  301.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  301.31 + * single choice of license, a recipient has the option to distribute
  301.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  301.33 + * to extend the choice of license to its licensees as provided above.
  301.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  301.35 + * Version 2 license, then the option applies only if the new code is
  301.36 + * made subject to such option by the copyright holder.
  301.37 + * 
  301.38 + * Contributor(s):
  301.39 + * 
  301.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  301.41 + */
  301.42 +
  301.43 +package org.netbeans.modules.portalpack.websynergy.portlets.hook.ui;
  301.44 +
  301.45 +import java.io.IOException;
  301.46 +import java.util.HashSet;
  301.47 +import java.util.NoSuchElementException;
  301.48 +import java.util.Set;
  301.49 +import java.util.logging.Logger;
  301.50 +import javax.swing.JComponent;
  301.51 +import javax.swing.event.ChangeListener;
  301.52 +import org.netbeans.api.project.Project;
  301.53 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.actions.util.PortletProjectUtils;
  301.54 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.util.CoreUtil;
  301.55 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.util.NetbeanConstants;
  301.56 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.HookType;
  301.57 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.HookTypeFactory;
  301.58 +import org.netbeans.modules.portalpack.websynergy.portlets.hook.api.HookTypeHandler;
  301.59 +import org.netbeans.spi.project.ui.templates.support.Templates;
  301.60 +import org.openide.WizardDescriptor;
  301.61 +
  301.62 +/**
  301.63 + *
  301.64 + * @author satyaranjan
  301.65 + * @author Santh Chetan Chadalavada
  301.66 + */
  301.67 + 
  301.68 +public class HookPluginWizardIterator implements WizardDescriptor.InstantiatingIterator{
  301.69 +    private static final long serialVersionUID = 1L;
  301.70 +    private int index;
  301.71 +    private transient WizardDescriptor.Panel[] panels;
  301.72 +    
  301.73 +    private static Logger logger = Logger.getLogger(CoreUtil.CORE_LOGGER);
  301.74 +    private WizardDescriptor wizard;
  301.75 +    
  301.76 +    public Set instantiate() throws IOException {
  301.77 +        Project project = Templates.getProject(wizard);
  301.78 +        HookType hookType = (HookType) wizard.getProperty("hook-type");
  301.79 +        Set result = new HashSet();
  301.80 +        HookTypeHandler eventHandler =
  301.81 +                HookTypeFactory.getHookTypeHandler(project, hookType);
  301.82 +
  301.83 +        PortletProjectUtils.addPortletLibraryToProject(project, NetbeanConstants.PORTLET_2_0);
  301.84 +        eventHandler.addHook(PortletProjectUtils.getWebModule(project), wizard, result);
  301.85 +        
  301.86 +        return result;
  301.87 +    }
  301.88 +    
  301.89 +    public void initialize(WizardDescriptor wizard) {
  301.90 +        this.wizard = wizard;
  301.91 +        Project project = Templates.getProject(wizard);
  301.92 +        WizardDescriptor.Panel hookDtlPanel = new HookDetailsPanel(project);
  301.93 +
  301.94 +        panels = new WizardDescriptor.Panel[]{hookDtlPanel};
  301.95 +
  301.96 +        // Creating steps.
  301.97 +        Object prop = wizard.getProperty("WizardPanel_contentData"); // NOI18N
  301.98 +
  301.99 +        // Creating steps.
 301.100 +        
 301.101 +        String[] beforeSteps = null;
 301.102 +        if (prop != null && prop instanceof String[]) {
 301.103 +            beforeSteps = (String[]) prop;
 301.104 +        }
 301.105 +        String[] steps = createSteps(beforeSteps, panels);
 301.106 +
 301.107 +        for (int i = 0; i < panels.length; i++) {
 301.108 +            JComponent jc = (JComponent) panels[i].getComponent();
 301.109 +            if (steps[i] == null) {
 301.110 +                steps[i] = jc.getName();
 301.111 +            }
 301.112 +            jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i)); // NOI18N
 301.113 +
 301.114 +            jc.putClientProperty("WizardPanel_contentData", steps); // NOI18N
 301.115 +
 301.116 +        }
 301.117 +    }
 301.118 +
 301.119 +    public void uninitialize(WizardDescriptor wizard) {
 301.120 +        panels = null;
 301.121 +    }
 301.122 +
 301.123 +    public WizardDescriptor.Panel current() {
 301.124 +         return panels[index];
 301.125 +    }
 301.126 +
 301.127 +    public String name() {
 301.128 +        return "Hook Config";
 301.129 +        //return NbBundle.getMessage(HookPluginWizardIterator.class, "TITLE_x_of_y", new Integer(index + 1), new Integer(panels.length));
 301.130 +    }
 301.131 +
 301.132 +    public boolean hasNext() {
 301.133 +        return index < panels.length - 1;
 301.134 +    }
 301.135 +
 301.136 +    public boolean hasPrevious() {
 301.137 +        return index > 0;
 301.138 +    }
 301.139 +
 301.140 +    public void nextPanel() {
 301.141 +        if (!hasNext()) {
 301.142 +            throw new NoSuchElementException();
 301.143 +        }
 301.144 +        index++;
 301.145 +    }
 301.146 +
 301.147 +    public void previousPanel() {
 301.148 +        if (!hasPrevious()) {
 301.149 +            throw new NoSuchElementException();
 301.150 +        }
 301.151 +        index--;
 301.152 +    }
 301.153 +
 301.154 +    public void addChangeListener(ChangeListener l) {
 301.155 +        //throw new UnsupportedOperationException("Not supported yet.");
 301.156 +    }
 301.157 +
 301.158 +    public void removeChangeListener(ChangeListener l) {
 301.159 +        //throw new UnsupportedOperationException("Not supported yet.");
 301.160 +    }
 301.161 +    
 301.162 +    private String[] createSteps(String[] before, WizardDescriptor.Panel[] panels) {
 301.163 +        int diff = 0;
 301.164 +        if (before == null) {
 301.165 +            before = new String[0];
 301.166 +        } else if (before.length > 0) {
 301.167 +            diff = ("...".equals(before[before.length - 1])) ? 1 : 0; // NOI18N
 301.168 +
 301.169 +        }
 301.170 +        String[] res = new String[(before.length - diff) + panels.length];
 301.171 +        for (int i = 0; i < res.length; i++) {
 301.172 +            if (i < (before.length - diff)) {
 301.173 +                res[i] = before[i];
 301.174 +            } else {
 301.175 +                res[i] = panels[i - before.length + diff].getComponent().getName();
 301.176 +            }
 301.177 +        }
 301.178 +        return res;
 301.179 +    }
 301.180 +}
   302.1 --- a/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/nonjava/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   302.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/nonjava/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   302.3 @@ -422,5 +422,5 @@
   302.4  LBL_Configuration=Configuration
   302.5  NO_PORTLET_TYPE_SELECTED=Please select a portlet type.
   302.6  
   302.7 -NOT_ALLOWED_FOR_NON_WEBSYNERGY_RUNTIME=This type of portlet is only allowed when runtime is WebSynergy Server.
   302.8 +NOT_ALLOWED_FOR_NON_WEBSYNERGY_RUNTIME=This type of portlet is only allowed when runtime is Web Space/Liferay Portal Server.
   302.9  NOT_ALLOWED_ADD_PORTLET_FRAMEWORK=Please add "Portlet Support" framework and then try again.
  302.10 \ No newline at end of file
   303.1 --- a/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/php/resources/PHP.html	Fri Jun 10 09:46:37 2011 +0200
   303.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/php/resources/PHP.html	Sun Jun 26 10:25:14 2011 +0800
   303.3 @@ -6,6 +6,6 @@
   303.4  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
   303.5  <html>
   303.6    <body>
   303.7 -         Creates a PHP Portlet - This portlet can be deployed on Project WebSynergy, Liferay Portal Server.
   303.8 +         Creates a PHP Portlet - This portlet can be deployed on Sun Glassfish Web Space Server , Liferay Portal Server.
   303.9    </body>
  303.10  </html> 
   304.1 --- a/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/resources/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   304.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/resources/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   304.3 @@ -1,7 +1,8 @@
   304.4  OpenIDE-Module-Display-Category=PortalPack
   304.5  OpenIDE-Module-Long-Description=\
   304.6 -    Using this module, user can develop WebSynergy specific non java portlets like Ruby, PHP, Groovy portlets.
   304.7 -OpenIDE-Module-Name=WebSynergy Portlets
   304.8 -OpenIDE-Module-Short-Description=WebSynergy Portlets
   304.9 +    Using this module, user can develop WebSpace specific non java portlets like Ruby, PHP, Groovy portlets.
  304.10 +OpenIDE-Module-Name=WebSpace/Liferay Plugins
  304.11 +OpenIDE-Module-Short-Description=WebSpace/Liferay Plugins
  304.12  
  304.13 -Templates/WebSynergyPortlets=WebSynergy Portlets
  304.14 +Templates/WebSynergyPortlets=WebSpace/Liferay Plugins
  304.15 +Templates/WebSynergyPortlets/themeWizard=Import/Create New Theme
   305.1 --- a/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/resources/layer.xml	Fri Jun 10 09:46:37 2011 +0200
   305.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/resources/layer.xml	Sun Jun 26 10:25:14 2011 +0800
   305.3 @@ -19,15 +19,10 @@
   305.4  -->
   305.5  <!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
   305.6  <filesystem>
   305.7 -    <folder name="Actions">
   305.8 -        <folder name="Tools">
   305.9 -            <file name="SetPortletModeAction.instance"/>
  305.10 -        </folder>
  305.11 -    </folder>
  305.12      <folder name="portalpack">
  305.13          <folder name="listeners">
  305.14              <folder name="initial-page">
  305.15 -                <file name="org-netbeans-modules-portalpack-websynergy-portlets-ruby-RubyInitialPageListener.instance"/>
  305.16 +<!--                <file name="org-netbeans-modules-portalpack-websynergy-portlets-ruby-RubyInitialPageListener.instance"/>-->
  305.17                  <file name="org-netbeans-modules-portalpack-websynergy-portlets-php-PhpInitialPageListener.instance"/>
  305.18                  <file name="org-netbeans-modules-portalpack-websynergy-portlets-groovy-GroovyInitialPageListener.instance"/>
  305.19              </folder>
  305.20 @@ -37,11 +32,26 @@
  305.21          <folder name="WebSynergyPortlets">
  305.22              <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.portalpack.websynergy.portlets.resources.Bundle"/>
  305.23              <attr name="position" intvalue="311"/>
  305.24 +            <file name="themeWizard">
  305.25 +                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.portalpack.websynergy.portlets.resources.Bundle"/>
  305.26 +                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/theme/resources/theme2.png"/>
  305.27 +                <attr name="instantiatingIterator" newvalue="org.netbeans.modules.portalpack.websynergy.portlets.theme.ui.ThemeWizardWizardIterator"/>
  305.28 +                <attr name="template" boolvalue="true"/>
  305.29 +                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/themeWizard.html"/>
  305.30 +            </file>
  305.31          </folder>
  305.32      </folder>
  305.33 -    
  305.34 +
  305.35 +     <folder name="theme">
  305.36 +        <folder name="templates">
  305.37 +            <file name="liferay-look-and-feel.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/theme/templates/liferay-look-and-feel.template">
  305.38 +                <attr name="position" intvalue="0"/>
  305.39 +                <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  305.40 +            </file>
  305.41 +        </folder>
  305.42 +     </folder>
  305.43      <!-- Ruby Portlet declarations START-->
  305.44 -    <folder name="Templates">
  305.45 +<!--    <folder name="Templates">
  305.46          <folder name="WebSynergyPortlets">
  305.47              <file name="RubyPortlet.rb">
  305.48                  <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.portalpack.websynergy.portlets.ruby.Bundle"/>
  305.49 @@ -59,9 +69,9 @@
  305.50          <folder name="text">
  305.51              <folder name="x-ruby">
  305.52                  <folder name="Actions">
  305.53 -                  <!-- Add Set As Initial Page action -->
  305.54 -                    <file name="SetPortletModeAction.shadow">
  305.55 -                        <attr name="originalFile" stringvalue="Actions/Tools/SetPortletModeAction.instance"/>
  305.56 +                   Add Set As Initial Page action 
  305.57 +                    <file name="SetPortletModeAction.instance">
  305.58 +                        <attr name="instanceClass" stringvalue="org.netbeans.modules.portalpack.websynergy.portlets.ruby.actions.RubySetAsInitialAction"/>
  305.59                          <attr name="position" intvalue="154"/>
  305.60                      </file>
  305.61                  </folder>
  305.62 @@ -70,36 +80,36 @@
  305.63      </folder>
  305.64      <folder name="ruby">
  305.65          <folder name="templates">
  305.66 -            <file name="Action.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/Action.template">
  305.67 +            <file name="Action.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/Action.template">
  305.68                  <attr name="position" intvalue="0"/>
  305.69              </file>
  305.70 -            <file name="Custom.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/Custom.template">
  305.71 +            <file name="Custom.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/Custom.template">
  305.72                  <attr name="position" intvalue="0"/>
  305.73              </file>
  305.74 -            <file name="Info.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/Info.template">
  305.75 +            <file name="Info.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/Info.template">
  305.76                  <attr name="position" intvalue="0"/>
  305.77              </file>
  305.78 -            <file name="Java.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/Java.template">
  305.79 +            <file name="Java.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/Java.template">
  305.80                  <attr name="position" intvalue="0"/>
  305.81              </file>
  305.82 -            <file name="RubyPortlet.java" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/RubyPortlet.template">
  305.83 +            <file name="RubyPortlet.java" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/RubyPortlet.template">
  305.84                  <attr name="position" intvalue="0"/>
  305.85                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  305.86              </file>
  305.87 -            <file name="View.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/View.template">
  305.88 +            <file name="View.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/View.template">
  305.89                  <attr name="position" intvalue="0"/>
  305.90              </file>
  305.91 -            <file name="liferay-portlet.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/liferay-portlet.template">
  305.92 +            <file name="liferay-portlet.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/ruby/templates/liferay-portlet.template">
  305.93                  <attr name="position" intvalue="0"/>
  305.94              </file>
  305.95          </folder>
  305.96      </folder>
  305.97 -    <!-- Ruby Portlet declarations END-->
  305.98 +     Ruby Portlet declarations END-->
  305.99      
 305.100      <!-- PHP Portlet declaration START -->
 305.101      <folder name="Templates">
 305.102          <folder name="WebSynergyPortlets">
 305.103 -            <file name="PhpPortlet.php" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/php/templates/phpportlet.template">
 305.104 +            <file name="PhpPortlet.php" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/php/templates/phpportlet.template">
 305.105                  <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.portalpack.websynergy.portlets.php.Bundle"/>
 305.106                  <attr name="position" intvalue="500"/>
 305.107                  <attr name="template" boolvalue="true"/>
 305.108 @@ -113,19 +123,19 @@
 305.109      </folder>
 305.110      <folder name="groovy">
 305.111          <folder name="templates">
 305.112 -            <file name="Action.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/groovy/templates/Action.template">
 305.113 +            <file name="Action.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/groovy/templates/Action.template">
 305.114                  <attr name="position" intvalue="0"/>
 305.115              </file>
 305.116 -            <file name="Custom.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/groovy/templates/Custom.template">
 305.117 +            <file name="Custom.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/groovy/templates/Custom.template">
 305.118                  <attr name="position" intvalue="0"/>
 305.119              </file>
 305.120 -            <file name="Info.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/groovy/templates/Info.template">
 305.121 +            <file name="Info.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/groovy/templates/Info.template">
 305.122                  <attr name="position" intvalue="0"/>
 305.123              </file>
 305.124 -            <file name="View.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/groovy/templates/View.template">
 305.125 +            <file name="View.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/groovy/templates/View.template">
 305.126                  <attr name="position" intvalue="0"/>
 305.127              </file>
 305.128 -            <file name="liferay-portlet.template" url="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/groovy/templates/liferay-portlet.template">
 305.129 +            <file name="liferay-portlet.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/groovy/templates/liferay-portlet.template">
 305.130                  <attr name="position" intvalue="0"/>
 305.131              </file>
 305.132          </folder>
 305.133 @@ -175,4 +185,78 @@
 305.134          </folder>
 305.135      </folder>
 305.136      <!-- Groovy Portlet declaration END -->
 305.137 +    
 305.138 +    <!-- Hook Plugin declaration START -->
 305.139 +    <folder name="Templates">
 305.140 +        <folder name="WebSynergyPortlets">
 305.141 +            <file name="HookAction.java">
 305.142 +                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.portalpack.websynergy.portlets.hook.Bundle"/>
 305.143 +                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/hook/resources/hook.png"/>
 305.144 +                <attr name="position" intvalue="510"/>
 305.145 +                <attr name="template" boolvalue="true"/>
 305.146 +                <attr name="templateCategory" stringvalue="web-types"/>
 305.147 +                <attr name="templateWizardIterator" newvalue="org.netbeans.modules.portalpack.websynergy.portlets.hook.ui.HookPluginWizardIterator"/>
 305.148 +                <attr name="template" boolvalue="true"/>
 305.149 +                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/portlets/hook/resources/Hook.html"/>
 305.150 +                <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
 305.151 +            </file>
 305.152 +        </folder>
 305.153 +    </folder>
 305.154 +    
 305.155 +    <folder name="hook">
 305.156 +        <folder name="templates">
 305.157 +            <file name="liferayhook.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/liferay-hook-template.xml">
 305.158 +                <attr name="position" intvalue="0"/>
 305.159 +            </file>
 305.160 +            <file name="portalproperties.template" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/portal-props-template.properties">
 305.161 +                <attr name="position" intvalue="0"/>
 305.162 +            </file>
 305.163 +            <file name="startupEvntHookPlugin.java" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/startupeventhook.template">
 305.164 +                <attr name="position" intvalue="0"/>
 305.165 +                <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
 305.166 +            </file>
 305.167 +            <file name="evntHookPlugin.java" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/eventhook.template">
 305.168 +                <attr name="position" intvalue="0"/>
 305.169 +                <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
 305.170 +            </file>
 305.171 +            <file name="mdlLsnrHookPlugin.java" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/mdllsnrhook.template">
 305.172 +                <attr name="position" intvalue="0"/>
 305.173 +                <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
 305.174 +            </file>
 305.175 +            <file name="mdlLsnrHookPlugin523.java" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/hook/templates/mdllsnrhook_5_2_3.template">
 305.176 +                <attr name="position" intvalue="0"/>
 305.177 +                <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
 305.178 +            </file>
 305.179 +        </folder>
 305.180 +     </folder>   
 305.181 +            
 305.182 +     <folder name="j2ee">
 305.183 +        <folder name="webtier">
 305.184 +            <folder name="templates">
 305.185 +                <file name="org-netbeans-modules-portalpack-websynergy-portlets-WebSpacePrivilegedTemplates.instance"> 
 305.186 +                    <attr name="position" intvalue="101"/>
 305.187 +                </file>
 305.188 +            </folder>
 305.189 +        </folder>
 305.190 +    </folder>            
 305.191 +    
 305.192 +    <!-- Hook Plugin declaration END -->
 305.193 +    <folder name="Editors">
 305.194 +        <folder name="text">
 305.195 +            <folder name="html">
 305.196 +                <folder name="CompletionProviders">
 305.197 +                    <file name="org-netbeans-modules-portalpack-websynergy-portlets-vm-codecompletion.VelocityCompletionProvider.instance"/>
 305.198 +
 305.199 +                </folder>
 305.200 +            </folder>
 305.201 +        </folder>
 305.202 +    </folder>
 305.203 +     <folder name="Services">
 305.204 +        <folder name="MIMEResolver">
 305.205 +            <file name="Velocity.xml" url="nbresloc:org/netbeans/modules/portalpack/websynergy/portlets/vm/resources/Velocity.xml">
 305.206 +                <!--attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.languages.velocity.Bundle"/-->
 305.207 +                <attr name="position" intvalue="275"/>
 305.208 +            </file>
 305.209 +        </folder>
 305.210 +    </folder>
 305.211  </filesystem>
   306.1 --- a/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/ruby/RubyPortletBuilder.java	Fri Jun 10 09:46:37 2011 +0200
   306.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/ruby/RubyPortletBuilder.java	Sun Jun 26 10:25:14 2011 +0800
   306.3 @@ -280,6 +280,7 @@
   306.4  
   306.5              if (webModule.getWebInf() != null) {
   306.6                  String webInfPath = FileUtil.toFile(webModule.getWebInf()).getAbsolutePath();
   306.7 +                pc.setPortletClass(RubyPortletConstants.RUBY_PORTLET_CLASS);
   306.8                  PortletXMLChangeEventNotificationHelper.firePortletAddEvent(pc, new AppContext(), webInfPath);
   306.9              }
  306.10          //}
   307.1 --- a/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/ruby/RubyPortletProjectUtil.java	Fri Jun 10 09:46:37 2011 +0200
   307.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/ruby/RubyPortletProjectUtil.java	Sun Jun 26 10:25:14 2011 +0800
   307.3 @@ -50,12 +50,19 @@
   307.4                      if(bpLibrary == null) {
   307.5                          
   307.6                          String jrubyLibDir = RubyPlatformUtil.getRubyLibDir();
   307.7 -                        URL bsfJar = FileUtil.toFileObject(new File(jrubyLibDir + File.separator + "bsf.jar")).getURL();
   307.8 -                        URL jrubyJar = FileUtil.toFileObject(new File(jrubyLibDir + File.separator + "jruby.jar")).getURL();
   307.9 -                       
  307.10 +
  307.11 +                        URL bsfJar = null;
  307.12 +                        FileObject bsfJarFO = FileUtil.toFileObject(new File(jrubyLibDir + File.separator + "bsf.jar"));
  307.13 +                        if(bsfJarFO != null)
  307.14 +                                bsfJar = bsfJarFO.getURL();
  307.15 +
  307.16 +                        URL jrubyJar = FileUtil.toFileObject(new File(jrubyLibDir + File.separator + "jruby.jar")).getURL();       
  307.17                          
  307.18                          List urls = new ArrayList();
  307.19 -                        urls.add(bsfJar);
  307.20 +
  307.21 +                        if(bsfJar != null)
  307.22 +                            urls.add(bsfJar);
  307.23 +
  307.24                          urls.add(jrubyJar);
  307.25                          
  307.26                          Map content = new HashMap();
   308.1 --- a/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/ruby/resources/Ruby.html	Fri Jun 10 09:46:37 2011 +0200
   308.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/ruby/resources/Ruby.html	Sun Jun 26 10:25:14 2011 +0800
   308.3 @@ -6,6 +6,6 @@
   308.4  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
   308.5  <html>
   308.6    <body>
   308.7 -         Creates a Ruby Portlet - This portlet can be deployed on Project WebSynergy, Liferay Portal Server.
   308.8 +         Creates a Ruby Portlet - This portlet can be deployed on Sun Glassfish Web Space Server, Liferay Portal Server.
   308.9    </body>
  308.10  </html> 
   309.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   309.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/helper/LookAndFeelXMLHelper.java	Sun Jun 26 10:25:14 2011 +0800
   309.3 @@ -0,0 +1,162 @@
   309.4 +/*
   309.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   309.6 + *
   309.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   309.8 + *
   309.9 + * The contents of this file are subject to the terms of either the GNU
  309.10 + * General Public License Version 2 only ("GPL") or the Common
  309.11 + * Development and Distribution License("CDDL") (collectively, the
  309.12 + * "License"). You may not use this file except in compliance with the
  309.13 + * License. You can obtain a copy of the License at
  309.14 + * http://www.netbeans.org/cddl-gplv2.html
  309.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  309.16 + * specific language governing permissions and limitations under the
  309.17 + * License.  When distributing the software, include this License Header
  309.18 + * Notice in each file and include the License file at
  309.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  309.20 + * particular file as subject to the "Classpath" exception as provided
  309.21 + * by Sun in the GPL Version 2 section of the License file that
  309.22 + * accompanied this code. If applicable, add the following below the
  309.23 + * License Header, with the fields enclosed by brackets [] replaced by
  309.24 + * your own identifying information:
  309.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  309.26 + *
  309.27 + * If you wish your version of this file to be governed by only the CDDL
  309.28 + * or only the GPL Version 2, indicate your decision by adding
  309.29 + * "[Contributor] elects to include this software in this distribution
  309.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  309.31 + * single choice of license, a recipient has the option to distribute
  309.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  309.33 + * to extend the choice of license to its licensees as provided above.
  309.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  309.35 + * Version 2 license, then the option applies only if the new code is
  309.36 + * made subject to such option by the copyright holder.
  309.37 + *
  309.38 + * Contributor(s):
  309.39 + *
  309.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  309.41 + */
  309.42 +
  309.43 +package org.netbeans.modules.portalpack.websynergy.portlets.theme.helper;
  309.44 +
  309.45 +import java.io.ByteArrayInputStream;
  309.46 +import java.io.File;
  309.47 +import java.io.IOException;
  309.48 +import java.io.OutputStream;
  309.49 +import javax.xml.parsers.DocumentBuilder;
  309.50 +import javax.xml.parsers.DocumentBuilderFactory;
  309.51 +import javax.xml.parsers.ParserConfigurationException;
  309.52 +import org.openide.filesystems.FileLock;
  309.53 +import org.openide.filesystems.FileObject;
  309.54 +import org.openide.filesystems.FileUtil;
  309.55 +import org.openide.util.Exceptions;
  309.56 +import org.openide.xml.XMLUtil;
  309.57 +import org.w3c.dom.Document;
  309.58 +import org.w3c.dom.Element;
  309.59 +import org.xml.sax.EntityResolver;
  309.60 +import org.xml.sax.InputSource;
  309.61 +import org.xml.sax.SAXException;
  309.62 +
  309.63 +/**
  309.64 + *
  309.65 + * @author Santh Chetan Chadalavada
  309.66 + */
  309.67 +public class LookAndFeelXMLHelper {
  309.68 +    private Document doc;
  309.69 +    FileObject fileObject;
  309.70 +
  309.71 +
  309.72 +    public LookAndFeelXMLHelper(FileObject fileObject) {
  309.73 +
  309.74 +        this.fileObject = fileObject;
  309.75 +        File docFile = FileUtil.toFile(fileObject);
  309.76 +        doc = createDocument(docFile);
  309.77 +
  309.78 +    }
  309.79 +
  309.80 +    private Document createDocument(File file) {
  309.81 +
  309.82 +        try {
  309.83 +
  309.84 +            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  309.85 +            factory.setValidating(false);
  309.86 +            DocumentBuilder docBuilder = factory.newDocumentBuilder();
  309.87 +
  309.88 +            docBuilder.setEntityResolver(new EntityResolver() {
  309.89 +
  309.90 +                public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
  309.91 +                     return new InputSource(new ByteArrayInputStream(new byte[0]));
  309.92 +
  309.93 +                }
  309.94 +            });
  309.95 +
  309.96 +            return docBuilder.parse(file);
  309.97 +        } catch (SAXException ex) {
  309.98 +            Exceptions.printStackTrace(ex);
  309.99 +        } catch (IOException ex) {
 309.100 +            Exceptions.printStackTrace(ex);
 309.101 +        } catch (ParserConfigurationException ex) {
 309.102 +            Exceptions.printStackTrace(ex);
 309.103 +        }
 309.104 +
 309.105 +        return null;
 309.106 +    }
 309.107 +
 309.108 +    public Element addThemeId(String themeId, String themeName) {
 309.109 +        if(doc == null) return null;
 309.110 +
 309.111 +        Element themeIdElm = doc.createElement("theme");
 309.112 +        themeIdElm.setAttribute("id", themeId);
 309.113 +        themeIdElm.setAttribute("name", themeName);
 309.114 +        doc.getDocumentElement().appendChild(themeIdElm);
 309.115 +        return themeIdElm;
 309.116 +    }
 309.117 +
 309.118 +    public boolean addThemeFolderDetails(String themeFolder, Element themeIdNode) {
 309.119 +        if(doc == null) return false;
 309.120 +
 309.121 +        themeFolder = themeFolder.replace(File.separatorChar, '/');
 309.122 +        if (themeIdNode != null) {
 309.123 +            Element themeRootPathElm = doc.createElement("root-path");
 309.124 +            themeIdNode.appendChild(themeRootPathElm).setTextContent(
 309.125 +                    "/"+themeFolder);
 309.126 +            Element themeTemplatesPathElm = doc.createElement("templates-path");
 309.127 +            themeIdNode.appendChild(themeTemplatesPathElm).setTextContent(
 309.128 +                    "${root-path}"+"/"+"templates");
 309.129 +            Element themeImagesPathElm = doc.createElement("images-path");
 309.130 +            themeIdNode.appendChild(themeImagesPathElm).setTextContent(
 309.131 +                    "${root-path}"+"/"+"images");
 309.132 +        }
 309.133 +        return true;
 309.134 +    }
 309.135 +
 309.136 +    public void store() {
 309.137 +
 309.138 +        if(fileObject == null)
 309.139 +            return;
 309.140 +
 309.141 +        FileLock lock = null;
 309.142 +        OutputStream out = null;
 309.143 +        try {
 309.144 +
 309.145 +            lock = fileObject.lock();
 309.146 +            out = fileObject.getOutputStream(lock);
 309.147 +
 309.148 +            XMLUtil.write(doc, out,"UTF-8");
 309.149 +
 309.150 +        } catch (IOException ex) {
 309.151 +            Exceptions.printStackTrace(ex);
 309.152 +        }finally {
 309.153 +
 309.154 +            if(lock != null)
 309.155 +                lock.releaseLock();
 309.156 +            if(out != null)
 309.157 +                try {
 309.158 +                out.close();
 309.159 +            } catch (IOException ex) {
 309.160 +                //do nothing.
 309.161 +            }
 309.162 +        }
 309.163 +    }
 309.164 +
 309.165 +}
   310.1 Binary file portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/resources/theme.png has changed
   311.1 Binary file portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/resources/theme2.png has changed
   312.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   312.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/templates/liferay-look-and-feel.template	Sun Jun 26 10:25:14 2011 +0800
   312.3 @@ -0,0 +1,8 @@
   312.4 +<?xml version="1.0"?>
   312.5 +<!DOCTYPE look-and-feel PUBLIC "-//Liferay//DTD Look and Feel <#if VERSION != "">${DTD_VERSION}</#if>//EN" "http://www.liferay.com/dtd/liferay-look-and-feel_<#if VERSION != "">${VERSION}</#if>.dtd">
   312.6 +
   312.7 +<look-and-feel>
   312.8 +    <compatibility>
   312.9 +		<version><#if VERSION != "">${DTD_VERSION}</#if>+</version>
  312.10 +	</compatibility>
  312.11 +</look-and-feel>
  312.12 \ No newline at end of file
   313.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   313.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   313.3 @@ -0,0 +1,19 @@
   313.4 +ThemeWizardVisualPanel.jLabel1.text=Theme ID:
   313.5 +ThemeWizardVisualPanel.jLabel2.text=Theme Name:
   313.6 +ThemeWizardVisualPanel.themeIDTextField.text=
   313.7 +ThemeWizardVisualPanel.themeNameTextField.text=
   313.8 +ThemeWizardVisualPanel.border.title=Theme Details
   313.9 +THEME_PROGRESS_MESSAGE=Creating Theme Files and Folders...
  313.10 +ThemeWizardVisualPanel.jLabel3.text=Theme Folder:
  313.11 +ThemeWizardVisualPanel.folderTextField.text=
  313.12 +ThemeWizardVisualPanel.jLabel4.text=Theme Location:
  313.13 +ThemeWizardVisualPanel.locationTextField.text=
  313.14 +ThemeWizardVisualPanel.themeIDTextField.toolTipText=Provide unique theme-id for the theme
  313.15 +ThemeWizardVisualPanel.themeNameTextField.toolTipText=Provide a Theme name
  313.16 +ThemeWizardVisualPanel.folderTextField.toolTipText=Provide a theme Folder name if one more than one theme will be created in this theme application.
  313.17 +
  313.18 +
  313.19 +INVALID_THEME_ID=Invalid Theme ID.
  313.20 +INVALID_THEME_NAME=Invalid Theme Name.
  313.21 +THEME_FOLDER_ALREADY_EXISTS=Theme Folder Already Exists.
  313.22 +INVALID_THEME_FOLDER_NAME=Invalid Theme Folder Name.
   314.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   314.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/ThemeDetailsHandler.java	Sun Jun 26 10:25:14 2011 +0800
   314.3 @@ -0,0 +1,136 @@
   314.4 +/*
   314.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   314.6 + *
   314.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   314.8 + *
   314.9 + * The contents of this file are subject to the terms of either the GNU
  314.10 + * General Public License Version 2 only ("GPL") or the Common
  314.11 + * Development and Distribution License("CDDL") (collectively, the
  314.12 + * "License"). You may not use this file except in compliance with the
  314.13 + * License. You can obtain a copy of the License at
  314.14 + * http://www.netbeans.org/cddl-gplv2.html
  314.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  314.16 + * specific language governing permissions and limitations under the
  314.17 + * License.  When distributing the software, include this License Header
  314.18 + * Notice in each file and include the License file at
  314.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  314.20 + * particular file as subject to the "Classpath" exception as provided
  314.21 + * by Sun in the GPL Version 2 section of the License file that
  314.22 + * accompanied this code. If applicable, add the following below the
  314.23 + * License Header, with the fields enclosed by brackets [] replaced by
  314.24 + * your own identifying information:
  314.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  314.26 + *
  314.27 + * If you wish your version of this file to be governed by only the CDDL
  314.28 + * or only the GPL Version 2, indicate your decision by adding
  314.29 + * "[Contributor] elects to include this software in this distribution
  314.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  314.31 + * single choice of license, a recipient has the option to distribute
  314.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  314.33 + * to extend the choice of license to its licensees as provided above.
  314.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  314.35 + * Version 2 license, then the option applies only if the new code is
  314.36 + * made subject to such option by the copyright holder.
  314.37 + *
  314.38 + * Contributor(s):
  314.39 + *
  314.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  314.41 + */
  314.42 +
  314.43 +package org.netbeans.modules.portalpack.websynergy.portlets.theme.ui;
  314.44 +
  314.45 +import java.io.IOException;
  314.46 +import java.util.HashMap;
  314.47 +import java.util.Map;
  314.48 +import java.util.Set;
  314.49 +import org.netbeans.api.project.Project;
  314.50 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.actions.util.PortletProjectUtils;
  314.51 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  314.52 +import org.netbeans.modules.portalpack.servers.websynergy.common.WebSpacePropertiesUtil;
  314.53 +import org.netbeans.modules.portalpack.websynergy.portlets.theme.helper.LookAndFeelXMLHelper;
  314.54 +import org.netbeans.modules.portalpack.websynergy.portlets.util.PluginXMLUtil;
  314.55 +import org.netbeans.modules.portalpack.websynergy.portlets.util.TemplateNotFoundException;
  314.56 +import org.netbeans.modules.portalpack.websynergy.portlets.util.TemplateUtil;
  314.57 +import org.openide.WizardDescriptor;
  314.58 +import org.openide.filesystems.FileObject;
  314.59 +import org.openide.loaders.DataObjectNotFoundException;
  314.60 +import org.openide.util.Exceptions;
  314.61 +import org.w3c.dom.Element;
  314.62 +
  314.63 +/**
  314.64 + *
  314.65 + * @author Santh Chetan Chadalavada
  314.66 + */
  314.67 +public class ThemeDetailsHandler {
  314.68 +
  314.69 +    Project project;
  314.70 +    WizardDescriptor wd;
  314.71 +    public ThemeDetailsHandler(Project project, WizardDescriptor wd) {
  314.72 +        this.project = project;
  314.73 +        this.wd = wd;
  314.74 +    }
  314.75 +
  314.76 +    public String createThemeConfigurationFiles(Set result) {
  314.77 +        String themeId = null;
  314.78 +        String themeName = null;
  314.79 +        String themeFolder = null;
  314.80 +
  314.81 +        PSConfigObject psconfig = WebSpacePropertiesUtil.getSelectedServerProperties(project);
  314.82 +        int liferayVersion = 0;
  314.83 +        String version = "5_1_0";
  314.84 +        String dtdVersion = "5.1.0";
  314.85 +        if (psconfig != null) {
  314.86 +            liferayVersion = WebSpacePropertiesUtil.getLiferayVersion(psconfig);
  314.87 +            if(liferayVersion >= 6000) {
  314.88 +                version = "5_2_0";
  314.89 +                dtdVersion = "6.0";
  314.90 +            } else if (liferayVersion >= 5200) {
  314.91 +                version = "5_2_0";
  314.92 +                dtdVersion = "5.2.0";
  314.93 +            } else {
  314.94 +                version = "5_1_0";
  314.95 +                dtdVersion = "5.1.0";
  314.96 +            }
  314.97 +        }
  314.98 +        Map values = new HashMap();
  314.99 +
 314.100 +        values.put("DTD_VERSION", dtdVersion);
 314.101 +        values.put("VERSION", version);
 314.102 +
 314.103 +        FileObject webInf = PortletProjectUtils.getWebModule(project).getWebInf();
 314.104 +        FileObject lookAndFeelXml = webInf.getFileObject("liferay-look-and-feel", "xml");
 314.105 +
 314.106 +        TemplateUtil templateUtil = new TemplateUtil("theme/templates");
 314.107 +        FileObject templateFile = null;
 314.108 +        try {
 314.109 +            templateFile = templateUtil.getTemplateFile("liferay-look-and-feel.xml");
 314.110 +        } catch (TemplateNotFoundException ex) {
 314.111 +            Exceptions.printStackTrace(ex);
 314.112 +        }
 314.113 +        if (templateFile != null) {
 314.114 +                try {
 314.115 +                    if (lookAndFeelXml == null) {
 314.116 +                        lookAndFeelXml = templateUtil.mergeTemplateToFile(
 314.117 +                                templateFile, webInf, "liferay-look-and-feel", values);
 314.118 +                    }
 314.119 +                } catch (DataObjectNotFoundException ex) {
 314.120 +                    Exceptions.printStackTrace(ex);
 314.121 +                } catch (IOException ex) {
 314.122 +                    Exceptions.printStackTrace(ex);
 314.123 +                }
 314.124 +                themeId = (String) wd.getProperty("themeId");
 314.125 +                themeName = (String) wd.getProperty("themeName");
 314.126 +                themeFolder = (String) wd.getProperty("themeFolder");
 314.127 +            //PluginXMLUtil util = new PluginXMLUtil(lookAndFeelXml);
 314.128 +            LookAndFeelXMLHelper util = new LookAndFeelXMLHelper(lookAndFeelXml);
 314.129 +            Element themeIdElem = util.addThemeId(themeId, themeName);
 314.130 +            if (themeFolder != null && themeFolder.trim().length() > 0) {
 314.131 +                util.addThemeFolderDetails(themeFolder, themeIdElem);
 314.132 +            }
 314.133 +            util.store();
 314.134 +        }
 314.135 +        result.add(lookAndFeelXml);
 314.136 +
 314.137 +        return themeFolder;
 314.138 +    }
 314.139 +}
   315.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   315.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/ThemeWizardVisualPanel.form	Sun Jun 26 10:25:14 2011 +0800
   315.3 @@ -0,0 +1,160 @@
   315.4 +<?xml version="1.0" encoding="UTF-8" ?>
   315.5 +
   315.6 +<Form version="1.4" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
   315.7 +  <Properties>
   315.8 +    <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
   315.9 +      <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
  315.10 +        <TitledBorder title="Theme Details">
  315.11 +          <ResourceString PropertyName="titleX" bundle="org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties" key="ThemeWizardVisualPanel.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  315.12 +        </TitledBorder>
  315.13 +      </Border>
  315.14 +    </Property>
  315.15 +  </Properties>
  315.16 +  <AuxValues>
  315.17 +    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
  315.18 +    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
  315.19 +    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
  315.20 +    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
  315.21 +    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
  315.22 +    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
  315.23 +    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
  315.24 +    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
  315.25 +    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
  315.26 +  </AuxValues>
  315.27 +
  315.28 +  <Layout>
  315.29 +    <DimensionLayout dim="0">
  315.30 +      <Group type="103" groupAlignment="0" attributes="0">
  315.31 +          <Group type="102" alignment="0" attributes="0">
  315.32 +              <EmptySpace min="-2" max="-2" attributes="0"/>
  315.33 +              <Group type="103" groupAlignment="0" attributes="0">
  315.34 +                  <Group type="102" alignment="0" attributes="0">
  315.35 +                      <Group type="103" groupAlignment="0" attributes="0">
  315.36 +                          <Component id="jLabel1" pref="66" max="32767" attributes="2"/>
  315.37 +                          <Component id="jLabel2" alignment="0" max="32767" attributes="2"/>
  315.38 +                      </Group>
  315.39 +                      <EmptySpace min="-2" pref="405" max="-2" attributes="0"/>
  315.40 +                  </Group>
  315.41 +                  <Group type="102" alignment="0" attributes="0">
  315.42 +                      <Group type="103" groupAlignment="0" attributes="0">
  315.43 +                          <Group type="102" alignment="0" attributes="0">
  315.44 +                              <Component id="jLabel3" pref="74" max="32767" attributes="0"/>
  315.45 +                              <EmptySpace min="5" pref="5" max="5" attributes="0"/>
  315.46 +                          </Group>
  315.47 +                          <Component id="jLabel4" alignment="0" max="32767" attributes="0"/>
  315.48 +                      </Group>
  315.49 +                      <EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
  315.50 +                      <Group type="103" groupAlignment="0" attributes="0">
  315.51 +                          <Component id="locationTextField" pref="382" max="32767" attributes="0"/>
  315.52 +                          <Group type="102" alignment="0" attributes="0">
  315.53 +                              <Group type="103" groupAlignment="1" attributes="0">
  315.54 +                                  <Component id="folderTextField" alignment="0" pref="170" max="32767" attributes="2"/>
  315.55 +                                  <Component id="themeNameTextField" alignment="0" pref="170" max="32767" attributes="2"/>
  315.56 +                                  <Component id="themeIDTextField" alignment="0" min="-2" pref="170" max="-2" attributes="2"/>
  315.57 +                              </Group>
  315.58 +                              <EmptySpace min="-2" pref="212" max="-2" attributes="0"/>
  315.59 +                          </Group>
  315.60 +                      </Group>
  315.61 +                  </Group>
  315.62 +              </Group>
  315.63 +              <EmptySpace min="-2" max="-2" attributes="0"/>
  315.64 +          </Group>
  315.65 +      </Group>
  315.66 +    </DimensionLayout>
  315.67 +    <DimensionLayout dim="1">
  315.68 +      <Group type="103" groupAlignment="0" attributes="0">
  315.69 +          <Group type="102" alignment="0" attributes="0">
  315.70 +              <EmptySpace max="-2" attributes="0"/>
  315.71 +              <Group type="103" groupAlignment="3" attributes="0">
  315.72 +                  <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
  315.73 +                  <Component id="themeIDTextField" alignment="3" min="-2" max="-2" attributes="0"/>
  315.74 +              </Group>
  315.75 +              <EmptySpace max="-2" attributes="0"/>
  315.76 +              <Group type="103" groupAlignment="3" attributes="0">
  315.77 +                  <Component id="jLabel2" alignment="3" min="-2" pref="17" max="-2" attributes="0"/>
  315.78 +                  <Component id="themeNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
  315.79 +              </Group>
  315.80 +              <EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
  315.81 +              <Group type="103" groupAlignment="3" attributes="0">
  315.82 +                  <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
  315.83 +                  <Component id="folderTextField" alignment="3" min="-2" max="-2" attributes="0"/>
  315.84 +              </Group>
  315.85 +              <EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
  315.86 +              <Group type="103" groupAlignment="3" attributes="0">
  315.87 +                  <Component id="locationTextField" alignment="3" min="-2" max="-2" attributes="0"/>
  315.88 +                  <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
  315.89 +              </Group>
  315.90 +              <EmptySpace pref="19" max="32767" attributes="0"/>
  315.91 +          </Group>
  315.92 +      </Group>
  315.93 +    </DimensionLayout>
  315.94 +  </Layout>
  315.95 +  <SubComponents>
  315.96 +    <Component class="javax.swing.JLabel" name="jLabel1">
  315.97 +      <Properties>
  315.98 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  315.99 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties" key="ThemeWizardVisualPanel.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 315.100 +        </Property>
 315.101 +      </Properties>
 315.102 +    </Component>
 315.103 +    <Component class="javax.swing.JLabel" name="jLabel2">
 315.104 +      <Properties>
 315.105 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 315.106 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties" key="ThemeWizardVisualPanel.jLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 315.107 +        </Property>
 315.108 +      </Properties>
 315.109 +    </Component>
 315.110 +    <Component class="javax.swing.JTextField" name="themeIDTextField">
 315.111 +      <Properties>
 315.112 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 315.113 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties" key="ThemeWizardVisualPanel.themeIDTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 315.114 +        </Property>
 315.115 +        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 315.116 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties" key="ThemeWizardVisualPanel.themeIDTextField.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 315.117 +        </Property>
 315.118 +      </Properties>
 315.119 +    </Component>
 315.120 +    <Component class="javax.swing.JTextField" name="themeNameTextField">
 315.121 +      <Properties>
 315.122 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 315.123 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties" key="ThemeWizardVisualPanel.themeNameTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 315.124 +        </Property>
 315.125 +        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 315.126 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties" key="ThemeWizardVisualPanel.themeNameTextField.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 315.127 +        </Property>
 315.128 +      </Properties>
 315.129 +    </Component>
 315.130 +    <Component class="javax.swing.JLabel" name="jLabel3">
 315.131 +      <Properties>
 315.132 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 315.133 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties" key="ThemeWizardVisualPanel.jLabel3.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 315.134 +        </Property>
 315.135 +      </Properties>
 315.136 +    </Component>
 315.137 +    <Component class="javax.swing.JTextField" name="folderTextField">
 315.138 +      <Properties>
 315.139 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 315.140 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties" key="ThemeWizardVisualPanel.folderTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 315.141 +        </Property>
 315.142 +        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 315.143 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties" key="ThemeWizardVisualPanel.folderTextField.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 315.144 +        </Property>
 315.145 +      </Properties>
 315.146 +    </Component>
 315.147 +    <Component class="javax.swing.JTextField" name="locationTextField">
 315.148 +      <Properties>
 315.149 +        <Property name="editable" type="boolean" value="false"/>
 315.150 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 315.151 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties" key="ThemeWizardVisualPanel.locationTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 315.152 +        </Property>
 315.153 +      </Properties>
 315.154 +    </Component>
 315.155 +    <Component class="javax.swing.JLabel" name="jLabel4">
 315.156 +      <Properties>
 315.157 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 315.158 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/Bundle.properties" key="ThemeWizardVisualPanel.jLabel4.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 315.159 +        </Property>
 315.160 +      </Properties>
 315.161 +    </Component>
 315.162 +  </SubComponents>
 315.163 +</Form>
   316.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   316.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/ThemeWizardVisualPanel.java	Sun Jun 26 10:25:14 2011 +0800
   316.3 @@ -0,0 +1,276 @@
   316.4 +/*
   316.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   316.6 + *
   316.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   316.8 + *
   316.9 + * The contents of this file are subject to the terms of either the GNU
  316.10 + * General Public License Version 2 only ("GPL") or the Common
  316.11 + * Development and Distribution License("CDDL") (collectively, the
  316.12 + * "License"). You may not use this file except in compliance with the
  316.13 + * License. You can obtain a copy of the License at
  316.14 + * http://www.netbeans.org/cddl-gplv2.html
  316.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  316.16 + * specific language governing permissions and limitations under the
  316.17 + * License.  When distributing the software, include this License Header
  316.18 + * Notice in each file and include the License file at
  316.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  316.20 + * particular file as subject to the "Classpath" exception as provided
  316.21 + * by Sun in the GPL Version 2 section of the License file that
  316.22 + * accompanied this code. If applicable, add the following below the
  316.23 + * License Header, with the fields enclosed by brackets [] replaced by
  316.24 + * your own identifying information:
  316.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  316.26 + *
  316.27 + * If you wish your version of this file to be governed by only the CDDL
  316.28 + * or only the GPL Version 2, indicate your decision by adding
  316.29 + * "[Contributor] elects to include this software in this distribution
  316.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  316.31 + * single choice of license, a recipient has the option to distribute
  316.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  316.33 + * to extend the choice of license to its licensees as provided above.
  316.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  316.35 + * Version 2 license, then the option applies only if the new code is
  316.36 + * made subject to such option by the copyright holder.
  316.37 + *
  316.38 + * Contributor(s):
  316.39 + *
  316.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  316.41 + */
  316.42 +
  316.43 +package org.netbeans.modules.portalpack.websynergy.portlets.theme.ui;
  316.44 +
  316.45 +import java.io.File;
  316.46 +import javax.swing.JPanel;
  316.47 +import javax.swing.event.DocumentEvent;
  316.48 +import javax.swing.event.DocumentListener;
  316.49 +import javax.swing.text.Document;
  316.50 +import org.netbeans.api.project.Project;
  316.51 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.actions.util.PortletProjectUtils;
  316.52 +import org.netbeans.modules.web.api.webmodule.WebModule;
  316.53 +import org.openide.WizardDescriptor;
  316.54 +import org.openide.filesystems.FileObject;
  316.55 +import org.openide.filesystems.FileUtil;
  316.56 +import org.openide.util.NbBundle;
  316.57 +
  316.58 +public final class ThemeWizardVisualPanel extends JPanel implements DocumentListener {
  316.59 +
  316.60 +    private ThemeWizardWizardPanel wizardPanel;
  316.61 +    private Project project;
  316.62 +    
  316.63 +    /** Creates new form ThemeWizardVisualPanel1 */
  316.64 +    public ThemeWizardVisualPanel(ThemeWizardWizardPanel wizardPanel,Project project) {
  316.65 +        initComponents();
  316.66 +        this.wizardPanel = wizardPanel;
  316.67 +        this.project = project;
  316.68 +        initData();
  316.69 +        themeIDTextField.getDocument().addDocumentListener(this);
  316.70 +        themeNameTextField.getDocument().addDocumentListener(this);
  316.71 +        folderTextField.getDocument().addDocumentListener(this);
  316.72 +        locationTextField.getDocument().addDocumentListener(this);
  316.73 +    }
  316.74 +
  316.75 +    @Override
  316.76 +    public String getName() {
  316.77 +        return "Provide Theme Details";
  316.78 +    }
  316.79 +
  316.80 +    public void readSettings(WizardDescriptor wizardDescriptor) {
  316.81 +    }
  316.82 +
  316.83 +    public void writeSettings(WizardDescriptor wizardDescriptor) {
  316.84 +        wizardDescriptor.putProperty("themeId", themeIDTextField.getText());
  316.85 +        wizardDescriptor.putProperty("themeName", themeNameTextField.getText());
  316.86 +        wizardDescriptor.putProperty("themeFolder", folderTextField.getText());
  316.87 +        wizardDescriptor.putProperty("themeDir", locationTextField.getText());
  316.88 +
  316.89 +    }
  316.90 +
  316.91 +    public boolean isValid(WizardDescriptor wizard) {
  316.92 +        FileObject themeFolderFO = null;
  316.93 +        String themeId = themeIDTextField.getText();
  316.94 +        String themeName = themeNameTextField.getText();
  316.95 +        String themeFolder = folderTextField.getText();
  316.96 +        WebModule wm = PortletProjectUtils.getWebModule(project);
  316.97 +        FileObject docBase = wm.getDocumentBase();
  316.98 +        if (themeFolder != null && themeFolder.trim().length() > 0) {
  316.99 +            themeFolderFO = docBase.getFileObject(themeFolder, null);
 316.100 +        }
 316.101 +        if (themeId != null && themeId.trim().length() > 0
 316.102 +                && !validateString(themeId, Boolean.FALSE)) {
 316.103 +            wizard.putProperty("WizardPanel_errorMessage", NbBundle.getMessage(ThemeWizardVisualPanel.class, "INVALID_THEME_ID"));
 316.104 +            return false;
 316.105 +        } else if (themeName != null && themeName.trim().length() > 0
 316.106 +                && !validateString(themeName, Boolean.TRUE)) {
 316.107 +            wizard.putProperty("WizardPanel_errorMessage", NbBundle.getMessage(ThemeWizardVisualPanel.class, "INVALID_THEME_NAME"));
 316.108 +            return false;
 316.109 +        } else if (themeFolderFO != null) {
 316.110 +            wizard.putProperty("WizardPanel_errorMessage", NbBundle.getMessage(ThemeWizardVisualPanel.class, "THEME_FOLDER_ALREADY_EXISTS"));
 316.111 +            return false;
 316.112 +        } else if (themeFolder != null && themeFolder.trim().length() > 0
 316.113 +                && !validateString(themeFolder, Boolean.FALSE)) {
 316.114 +            wizard.putProperty("WizardPanel_errorMessage", NbBundle.getMessage(ThemeWizardVisualPanel.class, "INVALID_THEME_FOLDER_NAME"));
 316.115 +            return false;
 316.116 +        }
 316.117 +
 316.118 +        wizard.putProperty("WizardPanel_errorMessage", "");
 316.119 +        return true;
 316.120 +    }
 316.121 +
 316.122 +    /**
 316.123 +     *
 316.124 +     * @param name
 316.125 +     * @param allowSpaces
 316.126 +     * @return
 316.127 +     */
 316.128 +    public static boolean validateString(String name, boolean allowSpaces) {
 316.129 +        if(name == null || name.trim().length() == 0){
 316.130 +            return false;
 316.131 +        }
 316.132 +        String value = name.trim();
 316.133 +        for(int i=0; i<value.length(); i++) {
 316.134 +            char c = value.charAt(i);
 316.135 +            if(!Character.isLetterOrDigit(c) && !((c == '_') || (c == '-') || (allowSpaces && c == ' '))){
 316.136 +                return false;
 316.137 +            }
 316.138 +        }
 316.139 +        return true;
 316.140 +    }
 316.141 +
 316.142 +    /** This method is called from within the constructor to
 316.143 +     * initialize the form.
 316.144 +     * WARNING: Do NOT modify this code. The content of this method is
 316.145 +     * always regenerated by the Form Editor.
 316.146 +     */
 316.147 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
 316.148 +    private void initComponents() {
 316.149 +
 316.150 +        jLabel1 = new javax.swing.JLabel();
 316.151 +        jLabel2 = new javax.swing.JLabel();
 316.152 +        themeIDTextField = new javax.swing.JTextField();
 316.153 +        themeNameTextField = new javax.swing.JTextField();
 316.154 +        jLabel3 = new javax.swing.JLabel();
 316.155 +        folderTextField = new javax.swing.JTextField();
 316.156 +        locationTextField = new javax.swing.JTextField();
 316.157 +        jLabel4 = new javax.swing.JLabel();
 316.158 +
 316.159 +        setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ThemeWizardVisualPanel.class, "ThemeWizardVisualPanel.border.title"))); // NOI18N
 316.160 +
 316.161 +        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(ThemeWizardVisualPanel.class, "ThemeWizardVisualPanel.jLabel1.text")); // NOI18N
 316.162 +
 316.163 +        org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(ThemeWizardVisualPanel.class, "ThemeWizardVisualPanel.jLabel2.text")); // NOI18N
 316.164 +
 316.165 +        themeIDTextField.setText(org.openide.util.NbBundle.getMessage(ThemeWizardVisualPanel.class, "ThemeWizardVisualPanel.themeIDTextField.text")); // NOI18N
 316.166 +        themeIDTextField.setToolTipText(org.openide.util.NbBundle.getMessage(ThemeWizardVisualPanel.class, "ThemeWizardVisualPanel.themeIDTextField.toolTipText")); // NOI18N
 316.167 +
 316.168 +        themeNameTextField.setText(org.openide.util.NbBundle.getMessage(ThemeWizardVisualPanel.class, "ThemeWizardVisualPanel.themeNameTextField.text")); // NOI18N
 316.169 +        themeNameTextField.setToolTipText(org.openide.util.NbBundle.getMessage(ThemeWizardVisualPanel.class, "ThemeWizardVisualPanel.themeNameTextField.toolTipText")); // NOI18N
 316.170 +
 316.171 +        org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(ThemeWizardVisualPanel.class, "ThemeWizardVisualPanel.jLabel3.text")); // NOI18N
 316.172 +
 316.173 +        folderTextField.setText(org.openide.util.NbBundle.getMessage(ThemeWizardVisualPanel.class, "ThemeWizardVisualPanel.folderTextField.text")); // NOI18N
 316.174 +        folderTextField.setToolTipText(org.openide.util.NbBundle.getMessage(ThemeWizardVisualPanel.class, "ThemeWizardVisualPanel.folderTextField.toolTipText")); // NOI18N
 316.175 +
 316.176 +        locationTextField.setEditable(false);
 316.177 +        locationTextField.setText(org.openide.util.NbBundle.getMessage(ThemeWizardVisualPanel.class, "ThemeWizardVisualPanel.locationTextField.text")); // NOI18N
 316.178 +
 316.179 +        org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(ThemeWizardVisualPanel.class, "ThemeWizardVisualPanel.jLabel4.text")); // NOI18N
 316.180 +
 316.181 +        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
 316.182 +        this.setLayout(layout);
 316.183 +        layout.setHorizontalGroup(
 316.184 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 316.185 +            .add(layout.createSequentialGroup()
 316.186 +                .addContainerGap()
 316.187 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 316.188 +                    .add(layout.createSequentialGroup()
 316.189 +                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 316.190 +                            .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)
 316.191 +                            .add(jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 316.192 +                        .add(405, 405, 405))
 316.193 +                    .add(layout.createSequentialGroup()
 316.194 +                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 316.195 +                            .add(layout.createSequentialGroup()
 316.196 +                                .add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE)
 316.197 +                                .add(5, 5, 5))
 316.198 +                            .add(jLabel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 316.199 +                        .add(10, 10, 10)
 316.200 +                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 316.201 +                            .add(locationTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 382, Short.MAX_VALUE)
 316.202 +                            .add(layout.createSequentialGroup()
 316.203 +                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 316.204 +                                    .add(org.jdesktop.layout.GroupLayout.LEADING, folderTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
 316.205 +                                    .add(org.jdesktop.layout.GroupLayout.LEADING, themeNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
 316.206 +                                    .add(org.jdesktop.layout.GroupLayout.LEADING, themeIDTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 170, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 316.207 +                                .add(212, 212, 212)))))
 316.208 +                .addContainerGap())
 316.209 +        );
 316.210 +        layout.setVerticalGroup(
 316.211 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 316.212 +            .add(layout.createSequentialGroup()
 316.213 +                .addContainerGap()
 316.214 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 316.215 +                    .add(jLabel1)
 316.216 +                    .add(themeIDTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 316.217 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 316.218 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 316.219 +                    .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 316.220 +                    .add(themeNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 316.221 +                .add(8, 8, 8)
 316.222 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 316.223 +                    .add(jLabel3)
 316.224 +                    .add(folderTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
 316.225 +                .add(8, 8, 8)
 316.226 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 316.227 +                    .add(locationTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 316.228 +                    .add(jLabel4))
 316.229 +                .addContainerGap(19, Short.MAX_VALUE))
 316.230 +        );
 316.231 +    }// </editor-fold>//GEN-END:initComponents
 316.232 +    // Variables declaration - do not modify//GEN-BEGIN:variables
 316.233 +    private javax.swing.JTextField folderTextField;
 316.234 +    private javax.swing.JLabel jLabel1;
 316.235 +    private javax.swing.JLabel jLabel2;
 316.236 +    private javax.swing.JLabel jLabel3;
 316.237 +    private javax.swing.JLabel jLabel4;
 316.238 +    private javax.swing.JTextField locationTextField;
 316.239 +    private javax.swing.JTextField themeIDTextField;
 316.240 +    private javax.swing.JTextField themeNameTextField;
 316.241 +    // End of variables declaration//GEN-END:variables
 316.242 +
 316.243 +    private void initData() {
 316.244 +        WebModule wm = PortletProjectUtils.getWebModule(project);
 316.245 +
 316.246 +        locationTextField.setText(FileUtil.toFile(wm.getDocumentBase()).getAbsolutePath() + File.separatorChar);
 316.247 +    }
 316.248 +
 316.249 +    public void insertUpdate(DocumentEvent e) {
 316.250 +        updateTexts(e);
 316.251 +    }
 316.252 +
 316.253 +    public void removeUpdate(DocumentEvent e) {
 316.254 +        updateTexts(e);
 316.255 +    }
 316.256 +
 316.257 +    public void changedUpdate(DocumentEvent e) {
 316.258 +        updateTexts(e);
 316.259 +    }
 316.260 +
 316.261 +   
 316.262 +    /** Handles changes in the Project name and project directory, */
 316.263 +    private void updateTexts(DocumentEvent e) {
 316.264 +        WebModule wm = PortletProjectUtils.getWebModule(project);
 316.265 +        Document doc = e.getDocument();
 316.266 +        if (doc == folderTextField.getDocument()) {
 316.267 +            String  folderName = folderTextField.getText();
 316.268 +            locationTextField.setText(wm.getDocumentBase().getPath()
 316.269 +                    + File.separatorChar + folderName);
 316.270 +        }
 316.271 +        fireChange();
 316.272 +
 316.273 +    }
 316.274 +
 316.275 +    private void fireChange() {
 316.276 +        wizardPanel.fireChangeEvent();
 316.277 +    }
 316.278 +}
 316.279 +
   317.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   317.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/ThemeWizardWizardIterator.java	Sun Jun 26 10:25:14 2011 +0800
   317.3 @@ -0,0 +1,359 @@
   317.4 +/*
   317.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   317.6 + *
   317.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   317.8 + *
   317.9 + * The contents of this file are subject to the terms of either the GNU
  317.10 + * General Public License Version 2 only ("GPL") or the Common
  317.11 + * Development and Distribution License("CDDL") (collectively, the
  317.12 + * "License"). You may not use this file except in compliance with the
  317.13 + * License. You can obtain a copy of the License at
  317.14 + * http://www.netbeans.org/cddl-gplv2.html
  317.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  317.16 + * specific language governing permissions and limitations under the
  317.17 + * License.  When distributing the software, include this License Header
  317.18 + * Notice in each file and include the License file at
  317.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  317.20 + * particular file as subject to the "Classpath" exception as provided
  317.21 + * by Sun in the GPL Version 2 section of the License file that
  317.22 + * accompanied this code. If applicable, add the following below the
  317.23 + * License Header, with the fields enclosed by brackets [] replaced by
  317.24 + * your own identifying information:
  317.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  317.26 + *
  317.27 + * If you wish your version of this file to be governed by only the CDDL
  317.28 + * or only the GPL Version 2, indicate your decision by adding
  317.29 + * "[Contributor] elects to include this software in this distribution
  317.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  317.31 + * single choice of license, a recipient has the option to distribute
  317.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  317.33 + * to extend the choice of license to its licensees as provided above.
  317.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  317.35 + * Version 2 license, then the option applies only if the new code is
  317.36 + * made subject to such option by the copyright holder.
  317.37 + *
  317.38 + * Contributor(s):
  317.39 + *
  317.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  317.41 + */
  317.42 +package org.netbeans.modules.portalpack.websynergy.portlets.theme.ui;
  317.43 +
  317.44 +import java.awt.Component;
  317.45 +import java.io.File;
  317.46 +import java.io.IOException;
  317.47 +import java.util.HashMap;
  317.48 +import java.util.HashSet;
  317.49 +import java.util.NoSuchElementException;
  317.50 +import java.util.Set;
  317.51 +import javax.swing.JComponent;
  317.52 +import javax.swing.event.ChangeListener;
  317.53 +import org.netbeans.api.project.Project;
  317.54 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.actions.util.PortletProjectUtils;
  317.55 +import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  317.56 +import org.netbeans.modules.portalpack.servers.websynergy.common.LiferayConstants;
  317.57 +import org.netbeans.modules.portalpack.servers.websynergy.common.WebSpacePropertiesUtil;
  317.58 +import org.netbeans.modules.web.api.webmodule.WebModule;
  317.59 +import org.netbeans.spi.project.ui.templates.support.Templates;
  317.60 +import org.openide.WizardDescriptor;
  317.61 +import org.openide.filesystems.FileObject;
  317.62 +import org.openide.filesystems.FileSystem;
  317.63 +import org.openide.filesystems.FileUtil;
  317.64 +import org.openide.util.Exceptions;
  317.65 +import org.openide.util.RequestProcessor;
  317.66 +import org.netbeans.api.progress.ProgressHandle;
  317.67 +import org.netbeans.api.progress.ProgressHandleFactory;
  317.68 +import org.openide.util.NbBundle;
  317.69 +
  317.70 +public final class ThemeWizardWizardIterator implements WizardDescriptor.InstantiatingIterator {
  317.71 +
  317.72 +    private int index;
  317.73 +    private WizardDescriptor wizard;
  317.74 +    private WizardDescriptor.Panel[] panels;
  317.75 +
  317.76 +    /**
  317.77 +     * Initialize panels representing individual wizard's steps and sets
  317.78 +     * various properties for them influencing wizard appearance.
  317.79 +     */
  317.80 +    private WizardDescriptor.Panel[] getPanels() {
  317.81 +        if (panels == null) {
  317.82 +            Project project = null;
  317.83 +            if(wizard != null) {
  317.84 +                project = Templates.getProject(wizard);
  317.85 +            }
  317.86 +            panels = new WizardDescriptor.Panel[]{
  317.87 +                        new ThemeWizardWizardPanel(project)
  317.88 +                    };
  317.89 +            String[] steps = createSteps();
  317.90 +            for (int i = 0; i < panels.length; i++) {
  317.91 +                Component c = panels[i].getComponent();
  317.92 +                if (steps[i] == null) {
  317.93 +                    // Default step name to component name of panel. Mainly
  317.94 +                    // useful for getting the name of the target chooser to
  317.95 +                    // appear in the list of steps.
  317.96 +                    steps[i] = c.getName();
  317.97 +                }
  317.98 +                if (c instanceof JComponent) { // assume Swing components
  317.99 +                    JComponent jc = (JComponent) c;
 317.100 +                    // Sets step number of a component
 317.101 +                    // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
 317.102 +                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
 317.103 +                    // Sets steps names for a panel
 317.104 +                    jc.putClientProperty("WizardPanel_contentData", steps);
 317.105 +                    // Turn on subtitle creation on each step
 317.106 +                    jc.putClientProperty("WizardPanel_autoWizardStyle", Boolean.TRUE);
 317.107 +                    // Show steps on the left side with the image on the background
 317.108 +                    jc.putClientProperty("WizardPanel_contentDisplayed", Boolean.TRUE);
 317.109 +                    // Turn on numbering of all steps
 317.110 +                    jc.putClientProperty("WizardPanel_contentNumbered", Boolean.TRUE);
 317.111 +                }
 317.112 +            }
 317.113 +        }
 317.114 +        return panels;
 317.115 +    }
 317.116 +
 317.117 +    public Set instantiate() throws IOException {
 317.118 +        Project project = Templates.getProject(wizard);
 317.119 +        Set result = new HashSet();
 317.120 +
 317.121 +        ThemeDetailsHandler tdHandler = new ThemeDetailsHandler(project, wizard);
 317.122 +        String themeFolder = tdHandler.createThemeConfigurationFiles(result);
 317.123 +        
 317.124 +        createFiles(project, wizard, result, themeFolder);
 317.125 +
 317.126 +        return result;
 317.127 +    }
 317.128 +
 317.129 +
 317.130 +    public void createFiles(Project project, WizardDescriptor desc, Set result, String themeFolder) {
 317.131 +        final ProgressHandle handle =
 317.132 +                ProgressHandleFactory.createHandle(NbBundle.getMessage(ThemeWizardWizardIterator.class, "THEME_PROGRESS_MESSAGE")); // NOI18N
 317.133 +        handle.start();
 317.134 +
 317.135 +        try {
 317.136 +
 317.137 +            FileObject webInf = PortletProjectUtils.getWebInf(project);
 317.138 +
 317.139 +            PSConfigObject psConfig =
 317.140 +                    WebSpacePropertiesUtil.getSelectedServerProperties(project);
 317.141 +
 317.142 +            String classicThemePath = null;
 317.143 +            if(psConfig != null) {
 317.144 +                classicThemePath = psConfig.getProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR) +
 317.145 +                        File.separatorChar + "html" +
 317.146 +                        File.separatorChar + "themes" +
 317.147 +                        File.separatorChar + "classic";
 317.148 +            }
 317.149 +
 317.150 +            HashMap selectedDirectoriesMap = new HashMap();
 317.151 +            FileObject classicTheme = FileUtil.toFileObject(new File(classicThemePath));
 317.152 +            FileObject[] children = classicTheme.getChildren();
 317.153 +
 317.154 +            for(FileObject child:children) {
 317.155 +                  if(child != null &&
 317.156 +                          child.getName().equals("_diffs")) {
 317.157 +                      continue;
 317.158 +                  }
 317.159 +                  String path = FileUtil.getRelativePath(classicTheme, child);
 317.160 +                  selectedDirectoriesMap.put(path,child);
 317.161 +            }
 317.162 +
 317.163 +
 317.164 +            WebModule wm = PortletProjectUtils.getWebModule(project);
 317.165 +
 317.166 +            FileObject themeFolderFO = null;
 317.167 +            if(themeFolder == null || themeFolder.trim().length() == 0) {
 317.168 +                themeFolderFO = wm.getDocumentBase();
 317.169 +            } else {
 317.170 +
 317.171 +                FileObject docBaseFO = wm.getDocumentBase();
 317.172 +                themeFolderFO = docBaseFO.getFileObject(themeFolder);
 317.173 +                if(themeFolderFO == null) {
 317.174 +                    docBaseFO.createFolder(themeFolder);
 317.175 +                    themeFolderFO = docBaseFO.getFileObject(themeFolder);
 317.176 +                }
 317.177 +            }
 317.178 +            final CreateFilesAndFolders createFilesAndFolders = new CreateFilesAndFolders(
 317.179 +                    wm, selectedDirectoriesMap,
 317.180 +                    themeFolderFO);
 317.181 +            if (webInf != null) {
 317.182 +                final FileSystem fs = webInf.getFileSystem();
 317.183 +                RequestProcessor.getDefault().post(new Runnable(){
 317.184 +
 317.185 +                    public void run() {
 317.186 +
 317.187 +                        try {
 317.188 +                            fs.runAtomicAction(createFilesAndFolders);
 317.189 +                        } catch (IOException ex) {
 317.190 +                            Exceptions.printStackTrace(ex);
 317.191 +                        } finally {
 317.192 +                            handle.finish();
 317.193 +                        }
 317.194 +                    }
 317.195 +                });
 317.196 +            }
 317.197 +
 317.198 +        } catch (Exception ex) {
 317.199 +            ex.printStackTrace();
 317.200 +        } 
 317.201 +    }
 317.202 +
 317.203 +    public void initialize(WizardDescriptor wizard) {
 317.204 +        this.wizard = wizard;
 317.205 +    }
 317.206 +
 317.207 +    public void uninitialize(WizardDescriptor wizard) {
 317.208 +        panels = null;
 317.209 +    }
 317.210 +
 317.211 +    public WizardDescriptor.Panel current() {
 317.212 +        return getPanels()[index];
 317.213 +    }
 317.214 +
 317.215 +    public String name() {
 317.216 +        return index + 1 + ". from " + getPanels().length;
 317.217 +    }
 317.218 +
 317.219 +    public boolean hasNext() {
 317.220 +        return index < getPanels().length - 1;
 317.221 +    }
 317.222 +
 317.223 +    public boolean hasPrevious() {
 317.224 +        return index > 0;
 317.225 +    }
 317.226 +
 317.227 +    public void nextPanel() {
 317.228 +        if (!hasNext()) {
 317.229 +            throw new NoSuchElementException();
 317.230 +        }
 317.231 +        index++;
 317.232 +    }
 317.233 +
 317.234 +    public void previousPanel() {
 317.235 +        if (!hasPrevious()) {
 317.236 +            throw new NoSuchElementException();
 317.237 +        }
 317.238 +        index--;
 317.239 +    }
 317.240 +
 317.241 +    // If nothing unusual changes in the middle of the wizard, simply:
 317.242 +    public void addChangeListener(ChangeListener l) {
 317.243 +    }
 317.244 +
 317.245 +    public void removeChangeListener(ChangeListener l) {
 317.246 +    }
 317.247 +
 317.248 +    // If something changes dynamically (besides moving between panels), e.g.
 317.249 +    // the number of panels changes in response to user input, then uncomment
 317.250 +    // the following and call when needed: fireChangeEvent();
 317.251 +    /*
 317.252 +    private Set<ChangeListener> listeners = new HashSet<ChangeListener>(1); // or can use ChangeSupport in NB 6.0
 317.253 +    public final void addChangeListener(ChangeListener l) {
 317.254 +    synchronized (listeners) {
 317.255 +    listeners.add(l);
 317.256 +    }
 317.257 +    }
 317.258 +    public final void removeChangeListener(ChangeListener l) {
 317.259 +    synchronized (listeners) {
 317.260 +    listeners.remove(l);
 317.261 +    }
 317.262 +    }
 317.263 +    protected final void fireChangeEvent() {
 317.264 +    Iterator<ChangeListener> it;
 317.265 +    synchronized (listeners) {
 317.266 +    it = new HashSet<ChangeListener>(listeners).iterator();
 317.267 +    }
 317.268 +    ChangeEvent ev = new ChangeEvent(this);
 317.269 +    while (it.hasNext()) {
 317.270 +    it.next().stateChanged(ev);
 317.271 +    }
 317.272 +    }
 317.273 +     */
 317.274 +
 317.275 +    // You could safely ignore this method. Is is here to keep steps which were
 317.276 +    // there before this wizard was instantiated. It should be better handled
 317.277 +    // by NetBeans Wizard API itself rather than needed to be implemented by a
 317.278 +    // client code.
 317.279 +    private String[] createSteps() {
 317.280 +        String[] beforeSteps = null;
 317.281 +        Object prop = wizard.getProperty("WizardPanel_contentData");
 317.282 +        if (prop != null && prop instanceof String[]) {
 317.283 +            beforeSteps = (String[]) prop;
 317.284 +        }
 317.285 +
 317.286 +        if (beforeSteps == null) {
 317.287 +            beforeSteps = new String[0];
 317.288 +        }
 317.289 +
 317.290 +        String[] res = new String[(beforeSteps.length - 1) + panels.length];
 317.291 +        for (int i = 0; i < res.length; i++) {
 317.292 +            if (i < (beforeSteps.length - 1)) {
 317.293 +                res[i] = beforeSteps[i];
 317.294 +            } else {
 317.295 +                res[i] = panels[i - beforeSteps.length + 1].getComponent().getName();
 317.296 +            }
 317.297 +        }
 317.298 +        return res;
 317.299 +    }
 317.300 +
 317.301 +    private class CreateFilesAndFolders implements FileSystem.AtomicAction {
 317.302 +        private WebModule webModule;
 317.303 +        private HashMap selectedDirsMap;
 317.304 +        private FileObject themeFolder;
 317.305 +        
 317.306 +        public CreateFilesAndFolders(WebModule webModule,
 317.307 +                HashMap selectedDirsMap, FileObject themeFolder) {
 317.308 +
 317.309 +            this.webModule = webModule;
 317.310 +            this.selectedDirsMap = selectedDirsMap;
 317.311 +            this.themeFolder = themeFolder;
 317.312 +        }
 317.313 +
 317.314 +        public void run(){
 317.315 +            FileObject fo = null;
 317.316 +            String path = null;
 317.317 +            for (Object key : selectedDirsMap.keySet()) {
 317.318 +                path = (String) key;
 317.319 +                fo = (FileObject) selectedDirsMap.get(path);
 317.320 +                File jspFolderFile = new File(FileUtil.toFile(themeFolder),path);
 317.321 +                jspFolderFile.mkdirs();
 317.322 +                
 317.323 +                try {
 317.324 +                    copyDirectory(fo, themeFolder);
 317.325 +                } catch (IOException ex) {
 317.326 +                }
 317.327 +            }
 317.328 +
 317.329 +			try{
 317.330 +				FileUtil.refreshFor(FileUtil.toFile(themeFolder));
 317.331 +			}catch(Exception e) {
 317.332 +
 317.333 +			}
 317.334 +        }
 317.335 +
 317.336 +        public void copyDirectory(FileObject sourceLocation , FileObject destParent/*, String file*/)
 317.337 +        throws IOException {
 317.338 +
 317.339 +            if (sourceLocation.isFolder()) {
 317.340 +
 317.341 +                FileObject destFO = destParent.getFileObject(sourceLocation.getName());
 317.342 +                if (destFO == null) {
 317.343 +                    try{
 317.344 +                        destFO = destParent.createFolder(sourceLocation.getName());
 317.345 +                    }catch(Exception e) {
 317.346 +                        e.printStackTrace();
 317.347 +                    }
 317.348 +                }
 317.349 +
 317.350 +                FileObject[] children = sourceLocation.getChildren();
 317.351 +                for (int i=0; i<children.length; i++) {
 317.352 +                    copyDirectory(children[i],destFO);
 317.353 +                }
 317.354 +            } else {
 317.355 +                try {
 317.356 +                    FileUtil.copyFile(sourceLocation, destParent,sourceLocation.getName());
 317.357 +                }catch(Exception e) {
 317.358 +                }
 317.359 +            }
 317.360 +        }
 317.361 +    }
 317.362 +}
   318.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   318.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/ThemeWizardWizardPanel.java	Sun Jun 26 10:25:14 2011 +0800
   318.3 @@ -0,0 +1,131 @@
   318.4 +/*
   318.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   318.6 + *
   318.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   318.8 + *
   318.9 + * The contents of this file are subject to the terms of either the GNU
  318.10 + * General Public License Version 2 only ("GPL") or the Common
  318.11 + * Development and Distribution License("CDDL") (collectively, the
  318.12 + * "License"). You may not use this file except in compliance with the
  318.13 + * License. You can obtain a copy of the License at
  318.14 + * http://www.netbeans.org/cddl-gplv2.html
  318.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  318.16 + * specific language governing permissions and limitations under the
  318.17 + * License.  When distributing the software, include this License Header
  318.18 + * Notice in each file and include the License file at
  318.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  318.20 + * particular file as subject to the "Classpath" exception as provided
  318.21 + * by Sun in the GPL Version 2 section of the License file that
  318.22 + * accompanied this code. If applicable, add the following below the
  318.23 + * License Header, with the fields enclosed by brackets [] replaced by
  318.24 + * your own identifying information:
  318.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  318.26 + *
  318.27 + * If you wish your version of this file to be governed by only the CDDL
  318.28 + * or only the GPL Version 2, indicate your decision by adding
  318.29 + * "[Contributor] elects to include this software in this distribution
  318.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  318.31 + * single choice of license, a recipient has the option to distribute
  318.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  318.33 + * to extend the choice of license to its licensees as provided above.
  318.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  318.35 + * Version 2 license, then the option applies only if the new code is
  318.36 + * made subject to such option by the copyright holder.
  318.37 + *
  318.38 + * Contributor(s):
  318.39 + *
  318.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  318.41 + */
  318.42 +package org.netbeans.modules.portalpack.websynergy.portlets.theme.ui;
  318.43 +
  318.44 +import java.awt.Component;
  318.45 +import java.util.HashSet;
  318.46 +import java.util.Iterator;
  318.47 +import java.util.Set;
  318.48 +import javax.swing.event.ChangeEvent;
  318.49 +import javax.swing.event.ChangeListener;
  318.50 +import org.netbeans.api.project.Project;
  318.51 +import org.openide.WizardDescriptor;
  318.52 +import org.openide.util.HelpCtx;
  318.53 +
  318.54 +public class ThemeWizardWizardPanel implements WizardDescriptor.Panel {
  318.55 +
  318.56 +    /**
  318.57 +     * The visual component that displays this panel. If you need to access the
  318.58 +     * component from this class, just use getComponent().
  318.59 +     */
  318.60 +    private ThemeWizardVisualPanel component;
  318.61 +    private WizardDescriptor wizard;
  318.62 +    private Project project;
  318.63 +
  318.64 +    public ThemeWizardWizardPanel(Project project) {
  318.65 +        this.project = project;
  318.66 +    }
  318.67 +    // Get the visual component for the panel. In this template, the component
  318.68 +    // is kept separate. This can be more efficient: if the wizard is created
  318.69 +    // but never displayed, or not all panels are displayed, it is better to
  318.70 +    // create only those which really need to be visible.
  318.71 +    public Component getComponent() {
  318.72 +        if (component == null) {
  318.73 +            component = new ThemeWizardVisualPanel(this,project);
  318.74 +        }
  318.75 +        return component;
  318.76 +    }
  318.77 +
  318.78 +    public HelpCtx getHelp() {
  318.79 +        // Show no Help button for this panel:
  318.80 +        return HelpCtx.DEFAULT_HELP;
  318.81 +    // If you have context help:
  318.82 +    // return new HelpCtx(SampleWizardPanel1.class);
  318.83 +    }
  318.84 +
  318.85 +    public boolean isValid() {
  318.86 +        getComponent();
  318.87 +        return component.isValid(wizard);
  318.88 +        // If it is always OK to press Next or Finish, then:
  318.89 +       
  318.90 +    // If it depends on some condition (form filled out...), then:
  318.91 +    // return someCondition();
  318.92 +    // and when this condition changes (last form field filled in...) then:
  318.93 +    // fireChangeEvent();
  318.94 +    // and uncomment the complicated stuff below.
  318.95 +    }
  318.96 +  private final Set/*<ChangeListener>*/ listeners = new HashSet(1);
  318.97 +
  318.98 +    public final void addChangeListener(ChangeListener l) {
  318.99 +        synchronized (listeners) {
 318.100 +            listeners.add(l);
 318.101 +        }
 318.102 +    }
 318.103 +
 318.104 +    public final void removeChangeListener(ChangeListener l) {
 318.105 +        synchronized (listeners) {
 318.106 +            listeners.remove(l);
 318.107 +        }
 318.108 +    }
 318.109 +
 318.110 +    protected final void fireChangeEvent() {
 318.111 +        Iterator it;
 318.112 +        synchronized (listeners) {
 318.113 +            it = new HashSet(listeners).iterator();
 318.114 +        }
 318.115 +        ChangeEvent ev = new ChangeEvent(this);
 318.116 +        while (it.hasNext()) {
 318.117 +            ((ChangeListener) it.next()).stateChanged(ev);
 318.118 +        }
 318.119 +    }
 318.120 +
 318.121 +    // You can use a settings object to keep track of state. Normally the
 318.122 +    // settings object will be the WizardDescriptor, so you can use
 318.123 +    // WizardDescriptor.getProperty & putProperty to store information entered
 318.124 +    // by the user.
 318.125 +    public void readSettings(Object settings) {
 318.126 +        wizard = (WizardDescriptor)settings;
 318.127 +        component.readSettings((WizardDescriptor) settings);
 318.128 +    }
 318.129 +
 318.130 +    public void storeSettings(Object settings) {
 318.131 +        component.writeSettings((WizardDescriptor) settings);
 318.132 +    }
 318.133 +}
 318.134 +
   319.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   319.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/theme/ui/themeWizard.html	Sun Jun 26 10:25:14 2011 +0800
   319.3 @@ -0,0 +1,46 @@
   319.4 +<!--
   319.5 +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   319.6 +
   319.7 +Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   319.8 +
   319.9 +The contents of this file are subject to the terms of either the GNU
  319.10 +General Public License Version 2 only ("GPL") or the Common
  319.11 +Development and Distribution License("CDDL") (collectively, the
  319.12 +"License"). You may not use this file except in compliance with the
  319.13 +License. You can obtain a copy of the License at
  319.14 +http://www.netbeans.org/cddl-gplv2.html
  319.15 +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  319.16 +specific language governing permissions and limitations under the
  319.17 +License.  When distributing the software, include this License Header
  319.18 +Notice in each file and include the License file at
  319.19 +nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  319.20 +particular file as subject to the "Classpath" exception as provided
  319.21 +by Sun in the GPL Version 2 section of the License file that
  319.22 +accompanied this code. If applicable, add the following below the
  319.23 +License Header, with the fields enclosed by brackets [] replaced by
  319.24 +your own identifying information:
  319.25 +"Portions Copyrighted [year] [name of copyright owner]"
  319.26 +
  319.27 +If you wish your version of this file to be governed by only the CDDL
  319.28 +or only the GPL Version 2, indicate your decision by adding
  319.29 +"[Contributor] elects to include this software in this distribution
  319.30 +under the [CDDL or GPL Version 2] license." If you do not indicate a
  319.31 +single choice of license, a recipient has the option to distribute
  319.32 +your version of this file under either the CDDL, the GPL Version 2 or
  319.33 +to extend the choice of license to its licensees as provided above.
  319.34 +However, if you add GPL Version 2 code and therefore, elected the GPL
  319.35 +Version 2 license, then the option applies only if the new code is
  319.36 +made subject to such option by the copyright holder.
  319.37 +
  319.38 +Contributor(s):
  319.39 +
  319.40 +Portions Copyrighted 2009 Sun Microsystems, Inc.
  319.41 +-->
  319.42 +<html>
  319.43 +    <head>
  319.44 +        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  319.45 +    </head>
  319.46 +    <body>
  319.47 +        Create or import a theme from WebSpace/Liferay.
  319.48 +    </body>
  319.49 +</html>
   320.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   320.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/util/PluginXMLUtil.java	Sun Jun 26 10:25:14 2011 +0800
   320.3 @@ -0,0 +1,252 @@
   320.4 +/*
   320.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   320.6 + * 
   320.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   320.8 + * 
   320.9 + * The contents of this file are subject to the terms of either the GNU
  320.10 + * General Public License Version 2 only ("GPL") or the Common
  320.11 + * Development and Distribution License("CDDL") (collectively, the
  320.12 + * "License"). You may not use this file except in compliance with the
  320.13 + * License. You can obtain a copy of the License at
  320.14 + * http://www.netbeans.org/cddl-gplv2.html
  320.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  320.16 + * specific language governing permissions and limitations under the
  320.17 + * License.  When distributing the software, include this License Header
  320.18 + * Notice in each file and include the License file at
  320.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  320.20 + * particular file as subject to the "Classpath" exception as provided
  320.21 + * by Sun in the GPL Version 2 section of the License file that
  320.22 + * accompanied this code. If applicable, add the following below the
  320.23 + * License Header, with the fields enclosed by brackets [] replaced by
  320.24 + * your own identifying information:
  320.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  320.26 + * 
  320.27 + * If you wish your version of this file to be governed by only the CDDL
  320.28 + * or only the GPL Version 2, indicate your decision by adding
  320.29 + * "[Contributor] elects to include this software in this distribution
  320.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  320.31 + * single choice of license, a recipient has the option to distribute
  320.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  320.33 + * to extend the choice of license to its licensees as provided above.
  320.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  320.35 + * Version 2 license, then the option applies only if the new code is
  320.36 + * made subject to such option by the copyright holder.
  320.37 + * 
  320.38 + * Contributor(s):
  320.39 + * 
  320.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  320.41 + */
  320.42 +
  320.43 +package org.netbeans.modules.portalpack.websynergy.portlets.util;
  320.44 +
  320.45 +import java.io.ByteArrayInputStream;
  320.46 +import java.io.File;
  320.47 +import java.io.IOException;
  320.48 +import java.io.OutputStream;
  320.49 +import java.util.Iterator;
  320.50 +import java.util.Properties;
  320.51 +import java.util.Set;
  320.52 +import javax.xml.parsers.DocumentBuilder;
  320.53 +import javax.xml.parsers.DocumentBuilderFactory;
  320.54 +import javax.xml.parsers.ParserConfigurationException;
  320.55 +import org.openide.filesystems.FileLock;
  320.56 +import org.openide.filesystems.FileObject;
  320.57 +import org.openide.filesystems.FileUtil;
  320.58 +import org.openide.util.Exceptions;
  320.59 +import org.openide.xml.XMLUtil;
  320.60 +import org.w3c.dom.Document;
  320.61 +import org.w3c.dom.Element;
  320.62 +import org.w3c.dom.NodeList;
  320.63 +import org.xml.sax.EntityResolver;
  320.64 +import org.xml.sax.InputSource;
  320.65 +import org.xml.sax.SAXException;
  320.66 +
  320.67 +/**
  320.68 + *
  320.69 + * @author satyaranjan
  320.70 + * @author Santh Chetan Chadalavada
  320.71 + */
  320.72 +public class PluginXMLUtil {
  320.73 +
  320.74 +    private Document doc;
  320.75 +    FileObject fileObject;
  320.76 +    
  320.77 +
  320.78 +    public PluginXMLUtil(FileObject fileObject) {
  320.79 +        
  320.80 +        this.fileObject = fileObject;
  320.81 +        File docFile = FileUtil.toFile(fileObject);
  320.82 +        doc = createDocument(docFile);
  320.83 +        
  320.84 +    }
  320.85 +    
  320.86 +    private Document createDocument(File file) {
  320.87 +        
  320.88 +        try {
  320.89 +
  320.90 +            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  320.91 +            factory.setValidating(false);
  320.92 +            DocumentBuilder docBuilder = factory.newDocumentBuilder();
  320.93 +            
  320.94 +            docBuilder.setEntityResolver(new EntityResolver() {
  320.95 +
  320.96 +                public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
  320.97 +                     return new InputSource(new ByteArrayInputStream(new byte[0]));
  320.98 +                
  320.99 +                }
 320.100 +            });
 320.101 +           
 320.102 +            return docBuilder.parse(file);
 320.103 +        } catch (SAXException ex) {
 320.104 +            Exceptions.printStackTrace(ex);
 320.105 +        } catch (IOException ex) {
 320.106 +            Exceptions.printStackTrace(ex);
 320.107 +        } catch (ParserConfigurationException ex) {
 320.108 +            Exceptions.printStackTrace(ex);
 320.109 +        }
 320.110 +        
 320.111 +        return null;
 320.112 +    }
 320.113 +    
 320.114 +    public void addEventHandlerHook(String eventClass, String eventType) {
 320.115 +        
 320.116 +        if(doc == null) return;
 320.117 +        
 320.118 +        Element eventElm = doc.createElement("event");
 320.119 +        Element eventClassElm = doc.createElement("event-class");
 320.120 +        Element eventTypeElm = doc.createElement("event-type");
 320.121 +        
 320.122 +        doc.getDocumentElement().appendChild(eventElm).appendChild(eventClassElm).setTextContent(eventClass);
 320.123 +        doc.getDocumentElement().appendChild(eventElm).appendChild(eventTypeElm).setTextContent(eventType);
 320.124 +    }
 320.125 +    
 320.126 +    public void addModelListenerHandlerHook(String mdlListenerClass, String modelName) {
 320.127 +        
 320.128 +        if(doc == null) return;
 320.129 +        
 320.130 +        Element mdlLsnrElm = doc.createElement("model-listener");
 320.131 +        Element mdlLsnrClassElm = doc.createElement("model-listener-class");
 320.132 +        Element mdlNameElm = doc.createElement("model-name");
 320.133 +        
 320.134 +        doc.getDocumentElement().appendChild(mdlLsnrElm).appendChild(mdlLsnrClassElm).setTextContent(mdlListenerClass);
 320.135 +        doc.getDocumentElement().appendChild(mdlLsnrElm).appendChild(mdlNameElm).setTextContent(modelName);
 320.136 +    }
 320.137 +    
 320.138 +    public boolean addPortalPropsHandlerHook() {
 320.139 +        
 320.140 +        String PORTAL_PROPERTIES= "portal.properties";
 320.141 +        if(doc == null) return false;
 320.142 +        
 320.143 +        if (doc.getElementsByTagName("portal-properties") != null &&
 320.144 +                doc.getElementsByTagName("portal-properties").getLength() > 0) {
 320.145 +                return false;
 320.146 +        }
 320.147 +        Element portalPropsElm = doc.createElement("portal-properties");
 320.148 +        portalPropsElm.setTextContent(PORTAL_PROPERTIES);
 320.149 +
 320.150 +        NodeList langPropsNL = doc.getElementsByTagName("language-properties");
 320.151 +        NodeList customJspNL = doc.getElementsByTagName("custom-jsp-dir");
 320.152 +
 320.153 +        Element customJspNode = null;
 320.154 +        Element langPropsNode = null;
 320.155 +        if(langPropsNL != null && langPropsNL.getLength() > 0) {
 320.156 +            langPropsNode = (Element)langPropsNL.item(0);
 320.157 +        }
 320.158 +        if(customJspNL != null && customJspNL.getLength() > 0) {
 320.159 +            customJspNode = (Element)customJspNL.item(0);
 320.160 +        }
 320.161 +
 320.162 +        if(langPropsNode != null) {
 320.163 +             doc.getDocumentElement().insertBefore(portalPropsElm,langPropsNode);
 320.164 +        } else if(customJspNode != null) {
 320.165 +            doc.getDocumentElement().insertBefore(portalPropsElm, customJspNode);
 320.166 +        } else {
 320.167 +            doc.getDocumentElement().appendChild(portalPropsElm);
 320.168 +        }
 320.169 +
 320.170 +        return true;
 320.171 +    }
 320.172 +    
 320.173 +    public void addJSPHandlerHook(String jspDir) {
 320.174 +        
 320.175 +        if(doc == null) return;
 320.176 +        
 320.177 +        if (doc.getElementsByTagName("custom-jsp-dir") != null &&
 320.178 +                doc.getElementsByTagName("custom-jsp-dir").getLength() > 0) {
 320.179 +                return;
 320.180 +        }
 320.181 +        Element jspElm = doc.createElement("custom-jsp-dir");
 320.182 +        
 320.183 +        doc.getDocumentElement().appendChild(jspElm).setTextContent(jspDir);
 320.184 +    }
 320.185 +
 320.186 +    public boolean addProperty(String beanID,Properties properties) {
 320.187 +        
 320.188 +        if(doc == null) return false;
 320.189 +        
 320.190 +        NodeList beanNL = doc.getElementsByTagName("bean");
 320.191 +        
 320.192 +        Element bean = null;
 320.193 +        for(int i=0;i<beanNL.getLength();i++) {
 320.194 +            
 320.195 +            Element beanElm = (Element)beanNL.item(i);
 320.196 +            String id = beanElm.getAttribute("id");
 320.197 +            String className = beanElm.getAttribute("class");
 320.198 +            
 320.199 +            if(id == null || className == null)
 320.200 +                continue;
 320.201 +            if(id.equals(beanID)) {
 320.202 +                bean = beanElm;
 320.203 +                break;
 320.204 +            }
 320.205 +        }
 320.206 +        
 320.207 +        if(bean == null) 
 320.208 +            return false;
 320.209 +        
 320.210 +        Set set = properties.keySet();
 320.211 +        Iterator it = set.iterator();
 320.212 +        
 320.213 +        while(it.hasNext()) {
 320.214 +            
 320.215 +            String propName = (String) it.next();
 320.216 +            String value = (String) properties.get(propName);
 320.217 +            
 320.218 +            Element p = doc.createElement("property");
 320.219 +            p.setAttribute("name",propName);
 320.220 +            p.setAttribute("value", value);
 320.221 +            bean.appendChild(p);
 320.222 +        }
 320.223 +        return true;
 320.224 +    }
 320.225 +    
 320.226 +    public void store() {
 320.227 +        
 320.228 +        if(fileObject == null)
 320.229 +            return;
 320.230 +        
 320.231 +        FileLock lock = null;
 320.232 +        OutputStream out = null;
 320.233 +        try {
 320.234 +            
 320.235 +            lock = fileObject.lock();
 320.236 +            out = fileObject.getOutputStream(lock);
 320.237 +
 320.238 +            XMLUtil.write(doc, out,"UTF-8");
 320.239 +            
 320.240 +        } catch (IOException ex) {
 320.241 +            Exceptions.printStackTrace(ex);
 320.242 +        }finally {
 320.243 +            
 320.244 +            if(lock != null)
 320.245 +                lock.releaseLock();
 320.246 +            if(out != null)
 320.247 +                try {
 320.248 +                out.close();
 320.249 +            } catch (IOException ex) {
 320.250 +                //do nothing.
 320.251 +            }
 320.252 +        }
 320.253 +    }
 320.254 +    
 320.255 +}
   321.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   321.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/util/PortalPropertyUtil.java	Sun Jun 26 10:25:14 2011 +0800
   321.3 @@ -0,0 +1,85 @@
   321.4 +/*
   321.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   321.6 + * 
   321.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   321.8 + * 
   321.9 + * The contents of this file are subject to the terms of either the GNU
  321.10 + * General Public License Version 2 only ("GPL") or the Common
  321.11 + * Development and Distribution License("CDDL") (collectively, the
  321.12 + * "License"). You may not use this file except fin compliance with the
  321.13 + * License. You can obtain a copy of the License at
  321.14 + * http://www.netbeans.org/cddl-gplv2.html
  321.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  321.16 + * specific language governing permissions and limitations under the
  321.17 + * License.  When distributing the software, include this License Header
  321.18 + * Notice fin each file and include the License file at
  321.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  321.20 + * particular file as subject to the "Classpath" exception as provided
  321.21 + * by Sun fin the GPL Version 2 section of the License file that
  321.22 + * accompanied this code. If applicable, add the following below the
  321.23 + * License Header, with the fields enclosed by brackets [] replaced by
  321.24 + * your own identifying information:
  321.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  321.26 + * 
  321.27 + * If you wish your version of this file to be governed by only the CDDL
  321.28 + * or only the GPL Version 2, indicate your decision by adding
  321.29 + * "[Contributor] elects to include this software fin this distribution
  321.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  321.31 + * single choice of license, a recipient has the option to distribute
  321.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  321.33 + * to extend the choice of license to its licensees as provided above.
  321.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  321.35 + * Version 2 license, then the option applies only if the new code is
  321.36 + * made subject to such option by the copyright holder.
  321.37 + * 
  321.38 + * Contributor(s):
  321.39 + * 
  321.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  321.41 + */
  321.42 +package org.netbeans.modules.portalpack.websynergy.portlets.util;
  321.43 +
  321.44 +/**
  321.45 + *
  321.46 + * @author Santh Chetan Chadalavada
  321.47 + */
  321.48 +import java.io.*;
  321.49 +import java.util.*;
  321.50 +
  321.51 +public class PortalPropertyUtil {
  321.52 +
  321.53 +    public static void addProperty(File str, String key, String value) {
  321.54 +        FileInputStream fin = null;
  321.55 +        FileOutputStream fout = null;
  321.56 +        try {
  321.57 +            Properties pro = new Properties();
  321.58 +            if (!str.exists()) {
  321.59 +                return;
  321.60 +            } else {
  321.61 +                fin = new FileInputStream(str);
  321.62 +                pro.load(fin);
  321.63 +                String keyString = pro.getProperty(key);
  321.64 +                if (keyString != null && !keyString.equals("")) {
  321.65 +                    value = keyString + "," + value;
  321.66 +                }
  321.67 +                fout = new FileOutputStream(str);
  321.68 +                pro.setProperty(key, value);
  321.69 +                pro.store(fout, null);
  321.70 +            }
  321.71 +        } catch (IOException e) {
  321.72 +            e.printStackTrace();
  321.73 +        } finally {
  321.74 +            try {
  321.75 +                if (fin != null)
  321.76 +                    fin.close();
  321.77 +            } catch (IOException ex) {
  321.78 +                
  321.79 +            }
  321.80 +            try {
  321.81 +                if (fout != null)
  321.82 +                    fout.close();
  321.83 +            } catch (IOException ex) {
  321.84 +                
  321.85 +            }
  321.86 +        }
  321.87 +    }
  321.88 +}
   322.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   322.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/util/ui/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   322.3 @@ -0,0 +1,2 @@
   322.4 +LBL_OK=Ok
   322.5 +LBL_Cancel=Cancel
   322.6 \ No newline at end of file
   323.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   323.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/util/ui/DirectoryTree.java	Sun Jun 26 10:25:14 2011 +0800
   323.3 @@ -0,0 +1,285 @@
   323.4 +/*
   323.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   323.6 + * 
   323.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   323.8 + * 
   323.9 + * The contents of this file are subject to the terms of either the GNU
  323.10 + * General Public License Version 2 only ("GPL") or the Common
  323.11 + * Development and Distribution License("CDDL") (collectively, the
  323.12 + * "License"). You may not use this file except in compliance with the
  323.13 + * License. You can obtain a copy of the License at
  323.14 + * http://www.netbeans.org/cddl-gplv2.html
  323.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  323.16 + * specific language governing permissions and limitations under the
  323.17 + * License.  When distributing the software, include this License Header
  323.18 + * Notice in each file and include the License file at
  323.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  323.20 + * particular file as subject to the "Classpath" exception as provided
  323.21 + * by Sun in the GPL Version 2 section of the License file that
  323.22 + * accompanied this code. If applicable, add the following below the
  323.23 + * License Header, with the fields enclosed by brackets [] replaced by
  323.24 + * your own identifying information:
  323.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  323.26 + * 
  323.27 + * If you wish your version of this file to be governed by only the CDDL
  323.28 + * or only the GPL Version 2, indicate your decision by adding
  323.29 + * "[Contributor] elects to include this software in this distribution
  323.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  323.31 + * single choice of license, a recipient has the option to distribute
  323.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  323.33 + * to extend the choice of license to its licensees as provided above.
  323.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  323.35 + * Version 2 license, then the option applies only if the new code is
  323.36 + * made subject to such option by the copyright holder.
  323.37 + * 
  323.38 + * Contributor(s):
  323.39 + * 
  323.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  323.41 + */
  323.42 +
  323.43 +package org.netbeans.modules.portalpack.websynergy.portlets.util.ui;
  323.44 +
  323.45 +import java.awt.*;
  323.46 +import java.awt.event.*;
  323.47 +import java.beans.*;
  323.48 +import java.io.File;
  323.49 +import java.util.*;
  323.50 +import javax.swing.*;
  323.51 +import javax.swing.event.*;
  323.52 +import javax.swing.filechooser.FileSystemView;
  323.53 +import javax.swing.tree.*;
  323.54 +
  323.55 +public class DirectoryTree extends JTree
  323.56 +			      implements TreeSelectionListener, MouseListener{
  323.57 +
  323.58 +      private static FileSystemView fsv = FileSystemView.getFileSystemView();
  323.59 +
  323.60 +    public String selectedDir = "";
  323.61 +
  323.62 +    /*--- Begin Public API -----*/
  323.63 +
  323.64 +    public DirectoryTree() {
  323.65 +	this(null);
  323.66 +    }
  323.67 +
  323.68 +    public DirectoryTree(File dir) {
  323.69 +	super(new DirNode(dir));
  323.70 +	getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  323.71 +	setSelectedDirectory(dir);
  323.72 +	addTreeSelectionListener(this);
  323.73 +	addMouseListener(this);
  323.74 +    }
  323.75 +
  323.76 +    public void setSelectedDirectory(File dir) {
  323.77 +	if (dir == null) {
  323.78 +	    dir = fsv.getDefaultDirectory();
  323.79 +	}
  323.80 +	setSelectionPath(mkPath(dir));
  323.81 +    }
  323.82 +
  323.83 +    public File getSelectedDirectory() {
  323.84 +	DirNode node = (DirNode)getLastSelectedPathComponent();
  323.85 +	if (node != null) {
  323.86 +	    File dir = node.getDir();
  323.87 +	    if (fsv.isFileSystem(dir)) {
  323.88 +		return dir;
  323.89 +	    }
  323.90 +	}
  323.91 +	return null;
  323.92 +    }
  323.93 +
  323.94 +    public void addActionListener(ActionListener l) {
  323.95 +        listenerList.add(ActionListener.class, l);
  323.96 +    }
  323.97 +
  323.98 +    public void removeActionListener(ActionListener l) {
  323.99 +        listenerList.remove(ActionListener.class, l);
 323.100 +    }
 323.101 +
 323.102 +    public ActionListener[] getActionListeners() {
 323.103 +        return (ActionListener[])listenerList.getListeners(ActionListener.class);
 323.104 +    }
 323.105 +
 323.106 +    /*--- End Public API -----*/
 323.107 +
 323.108 +
 323.109 +
 323.110 +
 323.111 +    /*--- TreeSelectionListener Interface -----*/
 323.112 +
 323.113 +    public void valueChanged(TreeSelectionEvent ev) {
 323.114 +	File oldDir = null;
 323.115 +	TreePath oldPath = ev.getOldLeadSelectionPath();
 323.116 +	if (oldPath != null) {
 323.117 +	    oldDir = ((DirNode)oldPath.getLastPathComponent()).getDir();
 323.118 +	    if (!fsv.isFileSystem(oldDir)) {
 323.119 +		oldDir = null;
 323.120 +	    }
 323.121 +	}
 323.122 +	File newDir = getSelectedDirectory();
 323.123 +	firePropertyChange("selectedDirectory", oldDir, newDir);
 323.124 +    }
 323.125 +
 323.126 +    /*--- MouseListener Interface -----*/
 323.127 +
 323.128 +    public void mousePressed(MouseEvent e) {
 323.129 +	if (e.getClickCount() == 2) {
 323.130 +	    TreePath path = getPathForLocation(e.getX(), e.getY());
 323.131 +	    if (path != null && path.equals(getSelectionPath()) &&
 323.132 +		getSelectedDirectory() != null) {
 323.133 +
 323.134 +		fireActionPerformed("dirSelected", e);
 323.135 +	    }
 323.136 +	}
 323.137 +    }
 323.138 +
 323.139 +    public void mouseReleased(MouseEvent e) {}
 323.140 +    public void mouseClicked(MouseEvent e) {}
 323.141 +    public void mouseEntered(MouseEvent e) {}
 323.142 +    public void mouseExited(MouseEvent e) {}
 323.143 +
 323.144 +
 323.145 +    /*--- Private Section ------*/
 323.146 +
 323.147 +    private TreePath mkPath(File dir) {
 323.148 +	DirNode root = (DirNode)getModel().getRoot();
 323.149 +	if (root.getDir().equals(dir)) {
 323.150 +	    return new TreePath(root);
 323.151 +	}
 323.152 +
 323.153 +	TreePath parentPath = mkPath(fsv.getParentDirectory(dir));
 323.154 +	DirNode parentNode = (DirNode)parentPath.getLastPathComponent();
 323.155 +	Enumeration enumeration = parentNode.children();
 323.156 +	while (enumeration.hasMoreElements()) {
 323.157 +	    DirNode child = (DirNode)enumeration.nextElement();
 323.158 +	    if (child.getDir().equals(dir)) {
 323.159 +		return parentPath.pathByAddingChild(child);
 323.160 +	    }
 323.161 +	}
 323.162 +	return null;
 323.163 +    }
 323.164 +
 323.165 +
 323.166 +    private void fireActionPerformed(String command, InputEvent evt) {
 323.167 +        ActionEvent e =
 323.168 +	    new ActionEvent(this, ActionEvent.ACTION_PERFORMED,
 323.169 +			    command, evt.getWhen(), evt.getModifiers());
 323.170 +	ActionListener[] listeners = getActionListeners();
 323.171 +        for (int i = listeners.length - 1; i >= 0; i--) {
 323.172 +	    listeners[i].actionPerformed(e);
 323.173 +        }
 323.174 +    }
 323.175 +
 323.176 +
 323.177 +    private static class DirNode extends DefaultMutableTreeNode {
 323.178 +	DirNode(File dir) {
 323.179 +	    super(dir);
 323.180 +	}
 323.181 +
 323.182 +	public File getDir() {
 323.183 +	    return (File)userObject;
 323.184 +	}
 323.185 +
 323.186 +	public int getChildCount() {
 323.187 +	    populateChildren();
 323.188 +	    return super.getChildCount();
 323.189 +	}
 323.190 +
 323.191 +	public Enumeration children() {
 323.192 +	    populateChildren();
 323.193 +	    return super.children();
 323.194 +	}
 323.195 +
 323.196 +	public boolean isLeaf() {
 323.197 +	    return false;
 323.198 +	}
 323.199 +
 323.200 +	private void populateChildren() {
 323.201 +	    if (children == null) {
 323.202 +		File[] files = fsv.getFiles(getDir(), true);
 323.203 +		Arrays.sort(files);
 323.204 +		for (int i = 0; i < files.length; i++) {
 323.205 +		    File f = files[i];
 323.206 +		    if (fsv.isTraversable(f).booleanValue()) {
 323.207 +			insert(new DirNode(f),
 323.208 +			       (children == null) ? 0 : children.size());
 323.209 +		    }
 323.210 +		}
 323.211 +	    }
 323.212 +	}
 323.213 +
 323.214 +	public String toString() {
 323.215 +	    return fsv.getSystemDisplayName(getDir());
 323.216 +	}
 323.217 +
 323.218 +	public boolean equals(Object o) {
 323.219 +	    return (o instanceof DirNode &&
 323.220 +		    userObject.equals(((DirNode)o).userObject));
 323.221 +	}
 323.222 +    }
 323.223 +
 323.224 +
 323.225 +    /*--- Main for testing  ---*/
 323.226 +
 323.227 +    public void open(String rootDir) {
 323.228 +//	try {
 323.229 +//	    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
 323.230 +//	} catch (Exception ex) {
 323.231 +//	}
 323.232 +
 323.233 +	final JDialog dialog = new JDialog((JFrame)null, true);
 323.234 +	final DirectoryTree dc  = new DirectoryTree(new File(rootDir));
 323.235 +	final JButton okButton     = new JButton(org.openide.util.NbBundle.getMessage(DirectoryTree.class, "LBL_OK"));
 323.236 +	final JButton cancelButton = new JButton(org.openide.util.NbBundle.getMessage(DirectoryTree.class, "LBL_Cancel"));
 323.237 +
 323.238 +	dialog.getContentPane().add(new JScrollPane(dc), BorderLayout.CENTER);
 323.239 +
 323.240 +	JPanel buttonPanel = new JPanel();
 323.241 +	buttonPanel.add(okButton);
 323.242 +	buttonPanel.add(cancelButton);
 323.243 +	dialog.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
 323.244 +
 323.245 +	ActionListener actionListener = new ActionListener() {
 323.246 +	    public void actionPerformed(ActionEvent e) {
 323.247 +		Object c = e.getSource();
 323.248 +		if (c == okButton){// || c == dc) {
 323.249 +            selectedDir = dc.getSelectedDirectory().getAbsolutePath();
 323.250 +    //	    System.out.println("You selected: "+dc.getSelectedDirectory());
 323.251 +		}if(c == cancelButton)
 323.252 +            selectedDir = "";
 323.253 +        dialog.dispose();
 323.254 +	    }
 323.255 +	};
 323.256 +
 323.257 +//	dc.addActionListener(actionListener);
 323.258 +	okButton.addActionListener(actionListener);
 323.259 +	cancelButton.addActionListener(actionListener);
 323.260 +
 323.261 +	dc.addPropertyChangeListener(new PropertyChangeListener() {
 323.262 +	    public void propertyChange(PropertyChangeEvent ev) {
 323.263 +		if (ev.getPropertyName().equals("selectedDirectory")) {
 323.264 +		    okButton.setEnabled(dc.getSelectedDirectory() != null);
 323.265 +		}
 323.266 +	    }
 323.267 +	});
 323.268 +
 323.269 +	dialog.setBounds(200, 200, 300, 350);
 323.270 +	dc.scrollRowToVisible(Math.max(0, dc.getMinSelectionRow()-4));
 323.271 +	dialog.setVisible(true);
 323.272 +	//System.exit(0);
 323.273 +    }
 323.274 +
 323.275 +    public String getSelectedDir()
 323.276 +    {
 323.277 +        return selectedDir;
 323.278 +    }
 323.279 +
 323.280 +
 323.281 +    public static void main(String[] args)
 323.282 +    {
 323.283 +        DirectoryTree dir = new DirectoryTree(new File("/space/docs"));
 323.284 +
 323.285 +//        dir.open();
 323.286 +        System.out.println("hahahah ............... "+dir.getSelectedDirectory());
 323.287 +    }
 323.288 +}
   324.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   324.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/vm/codecompletion/MethodInfo.java	Sun Jun 26 10:25:14 2011 +0800
   324.3 @@ -0,0 +1,198 @@
   324.4 +/*
   324.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   324.6 + * 
   324.7 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   324.8 + * 
   324.9 + * The contents of this file are subject to the terms of either the GNU
  324.10 + * General Public License Version 2 only ("GPL") or the Common
  324.11 + * Development and Distribution License("CDDL") (collectively, the
  324.12 + * "License"). You may not use this file except in compliance with the
  324.13 + * License. You can obtain a copy of the License at
  324.14 + * http://www.netbeans.org/cddl-gplv2.html
  324.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  324.16 + * specific language governing permissions and limitations under the
  324.17 + * License.  When distributing the software, include this License Header
  324.18 + * Notice in each file and include the License file at
  324.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  324.20 + * particular file as subject to the "Classpath" exception as provided
  324.21 + * by Sun in the GPL Version 2 section of the License file that
  324.22 + * accompanied this code. If applicable, add the following below the
  324.23 + * License Header, with the fields enclosed by brackets [] replaced by
  324.24 + * your own identifying information:
  324.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  324.26 + * 
  324.27 + * If you wish your version of this file to be governed by only the CDDL
  324.28 + * or only the GPL Version 2, indicate your decision by adding
  324.29 + * "[Contributor] elects to include this software in this distribution
  324.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  324.31 + * single choice of license, a recipient has the option to distribute
  324.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  324.33 + * to extend the choice of license to its licensees as provided above.
  324.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  324.35 + * Version 2 license, then the option applies only if the new code is
  324.36 + * made subject to such option by the copyright holder.
  324.37 + * 
  324.38 + * Contributor(s):
  324.39 + * 
  324.40 + * Portions Copyrighted 2008 Sun Microsystems, Inc.
  324.41 + */
  324.42 +
  324.43 +package org.netbeans.modules.portalpack.websynergy.portlets.vm.codecompletion;
  324.44 +
  324.45 +/**
  324.46 + *
  324.47 + * @author Satyaranjan
  324.48 + */
  324.49 +public class MethodInfo {
  324.50 +    
  324.51 +    private String methodName;
  324.52 +    private ParameterInfo[] paramTable;
  324.53 +    private String returnType;
  324.54 +   
  324.55 +    
  324.56 +    /**
  324.57 +     * Creates a new instance of change parameters refactoring.
  324.58 +     *
  324.59 +     * @param method   i.e. method or constructor
  324.60 +     */
  324.61 +    public MethodInfo(String methodName) {
  324.62 +        this.methodName = methodName;
  324.63 +    }
  324.64 +    
  324.65 +    public String getMethodName()
  324.66 +    {
  324.67 +        return methodName;
  324.68 +    }
  324.69 +
  324.70 +    public void setReturnType(String returnType) {
  324.71 +        this.returnType = returnType;
  324.72 +    }
  324.73 +
  324.74 +    public String getReturnType() {
  324.75 +        return returnType;
  324.76 +    }
  324.77 +    /**
  324.78 +     * Getter for  parameters
  324.79 +     * @return array of  parameters
  324.80 +     */
  324.81 +    public ParameterInfo[] getParameterInfo() {
  324.82 +        if(paramTable == null) return new ParameterInfo[0];
  324.83 +        return paramTable;
  324.84 +    }
  324.85 +    
  324.86 +    
  324.87 +    /**
  324.88 +     * Sets  parameters for a method
  324.89 +     * @param paramTable parameters
  324.90 +     */
  324.91 +    public void setParameterInfo(ParameterInfo[] paramTable) {
  324.92 +        this.paramTable = paramTable;
  324.93 +    }
  324.94 +
  324.95 +    @Override
  324.96 +    public String toString() {
  324.97 +        StringBuffer signature = new StringBuffer(methodName);
  324.98 +        signature.append("(");
  324.99 +        if(paramTable == null)
 324.100 +            return "methodName()";
 324.101 +        for(int i=0; i < paramTable.length; i++)
 324.102 +        {
 324.103 +            String type = paramTable[i].getType();
 324.104 +            //assert type == null;
 324.105 +            signature.append(paramTable[i].getType());
 324.106 +            signature.append(" ");
 324.107 +            signature.append(paramTable[i].getName());
 324.108 +            if(i != (paramTable.length - 1) )
 324.109 +                signature.append(",");
 324.110 +        }
 324.111 +        signature.append(")");
 324.112 +//        if(returnType != null) {
 324.113 +//            signature.append(" ");
 324.114 +//            signature.append(returnType);
 324.115 +//        }
 324.116 +        return signature.toString();
 324.117 +    }
 324.118 +
 324.119 +
 324.120 +    public String getSignature() {
 324.121 +        StringBuffer signature = new StringBuffer(methodName);
 324.122 +        signature.append("(");
 324.123 +        if(paramTable == null)
 324.124 +            return "methodName()";
 324.125 +        for(int i=0; i < paramTable.length; i++)
 324.126 +        {
 324.127 +//            String type = paramTable[i].getType();
 324.128 +//            //assert type == null;
 324.129 +//            signature.append(paramTable[i].getType());
 324.130 +//            signature.append(" ");
 324.131 +            signature.append(paramTable[i].getName());
 324.132 +            if(i != (paramTable.length - 1) )
 324.133 +                signature.append(",");
 324.134 +        }
 324.135 +        signature.append(")");
 324.136 +//        if(returnType != null) {
 324.137 +//            signature.append(" ");
 324.138 +//            signature.append(returnType);
 324.139 +//        }
 324.140 +        return signature.toString();
 324.141 +    }
 324.142 +
 324.143 +    
 324.144 +    public static final class ParameterInfo {
 324.145 +        
 324.146 +        String name;
 324.147 +        String type;
 324.148 +        String defaultVal;
 324.149 +
 324.150 +        /**
 324.151 +         * Creates a new instanceof of ParameterInfo. This constructor can be
 324.152 +         * used for newly added parameters or changed original parameters.
 324.153 +         * When you call method with -1 origIndex, you have to provide not
 324.154 +         * null values in all other pamarameters, otherwise it throws an
 324.155 +         * IllegalArgumentException.
 324.156 +         *
 324.157 +         * @param  origIndex  for newly added parameters, use -1, otherwise
 324.158 +         *                    use index in original parameters list
 324.159 +         * @param  name       parameter name 
 324.160 +         * @param  type       parameter type
 324.161 +         * @param  defaultVal should be provided for the all new parameters.
 324.162 +         *                    For changed parameters, it is ignored.
 324.163 +         */
 324.164 +        public ParameterInfo(String name, String type, String defaultVal) {
 324.165 +            // new parameter
 324.166 +            // if (origIndex == -1 && (name == null || defaultVal == null || type == null || name.length() == 0 || defaultVal.length() == 0)) {
 324.167 +            //    throw new IllegalArgumentException(NbBundle.getMessage(ChangeParameters.class, "ERR_NoValues"));
 324.168 +            // }
 324.169 +        
 324.170 +            this.name = name;
 324.171 +            this.type = type;
 324.172 +            
 324.173 +        }
 324.174 +        
 324.175 +        
 324.176 +        /**
 324.177 +         * Returns value of the name of parameter. If the name was not
 324.178 +         * changed, returns null.
 324.179 +         *
 324.180 +         * @return  new name for parameter or null in case that it was not changed.
 324.181 +         */
 324.182 +        public String getName() { return name; }
 324.183 +
 324.184 +        /**
 324.185 +         * Returns value of the type of parameter. If the name was not
 324.186 +         * changed, returns null.
 324.187 +         *
 324.188 +         * @return new type for parameter or null if it was not changed.
 324.189 +         */
 324.190 +        public String getType() { return type; }
 324.191 +
 324.192 +        /**
 324.193 +         * Returns value of the default value in case of the new parameter.
 324.194 +         * Otherwise, it returns null.
 324.195 +         *
 324.196 +         * @return default value for new parameter, otherwise null.
 324.197 +         */
 324.198 +        public String getDefaultValue() { return defaultVal; }
 324.199 +    }  
 324.200 +    
 324.201 +}
   325.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   325.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/vm/codecompletion/VelocityCompletionItem.java	Sun Jun 26 10:25:14 2011 +0800
   325.3 @@ -0,0 +1,147 @@
   325.4 +/*
   325.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   325.6 + *
   325.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   325.8 + *
   325.9 + * The contents of this file are subject to the terms of either the GNU
  325.10 + * General Public License Version 2 only ("GPL") or the Common
  325.11 + * Development and Distribution License("CDDL") (collectively, the
  325.12 + * "License"). You may not use this file except in compliance with the
  325.13 + * License. You can obtain a copy of the License at
  325.14 + * http://www.netbeans.org/cddl-gplv2.html
  325.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  325.16 + * specific language governing permissions and limitations under the
  325.17 + * License.  When distributing the software, include this License Header
  325.18 + * Notice in each file and include the License file at
  325.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  325.20 + * particular file as subject to the "Classpath" exception as provided
  325.21 + * by Sun in the GPL Version 2 section of the License file that
  325.22 + * accompanied this code. If applicable, add the following below the
  325.23 + * License Header, with the fields enclosed by brackets [] replaced by
  325.24 + * your own identifying information:
  325.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  325.26 + *
  325.27 + * If you wish your version of this file to be governed by only the CDDL
  325.28 + * or only the GPL Version 2, indicate your decision by adding
  325.29 + * "[Contributor] elects to include this software in this distribution
  325.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  325.31 + * single choice of license, a recipient has the option to distribute
  325.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  325.33 + * to extend the choice of license to its licensees as provided above.
  325.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  325.35 + * Version 2 license, then the option applies only if the new code is
  325.36 + * made subject to such option by the copyright holder.
  325.37 + *
  325.38 + * Contributor(s):
  325.39 + *
  325.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  325.41 + */
  325.42 +package org.netbeans.modules.portalpack.websynergy.portlets.vm.codecompletion;
  325.43 +
  325.44 +import java.awt.Color;
  325.45 +import java.awt.Font;
  325.46 +import java.awt.Graphics;
  325.47 +import java.awt.event.KeyEvent;
  325.48 +import javax.swing.JToolTip;
  325.49 +import javax.swing.text.BadLocationException;
  325.50 +import javax.swing.text.Document;
  325.51 +import javax.swing.text.JTextComponent;
  325.52 +import javax.swing.text.StyledDocument;
  325.53 +import org.netbeans.api.editor.completion.Completion;
  325.54 +import org.netbeans.spi.editor.completion.CompletionItem;
  325.55 +import org.netbeans.spi.editor.completion.CompletionResultSet;
  325.56 +import org.netbeans.spi.editor.completion.CompletionTask;
  325.57 +import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery;
  325.58 +import org.netbeans.spi.editor.completion.support.AsyncCompletionTask;
  325.59 +import org.netbeans.spi.editor.completion.support.CompletionUtilities;
  325.60 +
  325.61 +/**
  325.62 + *
  325.63 + * @author satyaranjan
  325.64 + */
  325.65 +public class VelocityCompletionItem implements CompletionItem {
  325.66 +
  325.67 +    private String text;
  325.68 +//    private static ImageIcon fieldIcon =
  325.69 +//            new ImageIcon(Utilities.loadImage("org/netbeans/modules/countries/icon.png"));
  325.70 +    private static Color fieldColor = Color.decode("0x0000B2");
  325.71 +    private int caretOffset;
  325.72 +    private int dotOffset;
  325.73 +    private String rightText;
  325.74 +    private String displayText;
  325.75 +
  325.76 +    public VelocityCompletionItem(String displayText, String text, String rightText, int dotOffset, int caretOffset) {
  325.77 +        this.text = text;
  325.78 +        this.rightText = rightText;
  325.79 +        this.displayText = displayText;
  325.80 +        this.dotOffset = dotOffset;
  325.81 +        this.caretOffset = caretOffset;
  325.82 +    }
  325.83 +
  325.84 +    public void defaultAction(JTextComponent component) {
  325.85 +        StyledDocument doc = (StyledDocument) component.getDocument();
  325.86 +        //Here we remove the characters starting at the start offset
  325.87 +        //and ending at the point where the caret is currently found:
  325.88 +
  325.89 +        try {
  325.90 +            /// doc.remove(dotOffset, caretOffset - dotOffset);
  325.91 +            /// doc.insertString(dotOffset, text, null);
  325.92 +            doc.insertString(caretOffset, text, null);
  325.93 +        } catch (BadLocationException ex) {
  325.94 +            ex.printStackTrace();
  325.95 +        }
  325.96 +        //This statement will close the code completion box:
  325.97 +        Completion.get().hideAll();
  325.98 +
  325.99 +    }
 325.100 +
 325.101 +    public void processKeyEvent(KeyEvent evt) {
 325.102 +        //throw new UnsupportedOperationException("Not supported yet.");
 325.103 +    }
 325.104 +
 325.105 +    public int getPreferredWidth(Graphics g, Font defaultFont) {
 325.106 +        return CompletionUtilities.getPreferredWidth(displayText, null, g, defaultFont);
 325.107 +
 325.108 +    }
 325.109 +
 325.110 +    public void render(Graphics g, Font defaultFont, Color defaultColor, Color backgroundColor, int width, int height, boolean selected) {
 325.111 +        CompletionUtilities.renderHtml(null, displayText, rightText, g, defaultFont,
 325.112 +                (selected ? Color.white : fieldColor), width, height, selected);
 325.113 +
 325.114 +    }
 325.115 +
 325.116 +    public CompletionTask createDocumentationTask() {
 325.117 +        return null;
 325.118 +    }
 325.119 +
 325.120 +    public CompletionTask createToolTipTask() {
 325.121 +        
 325.122 +        return new AsyncCompletionTask(new AsyncCompletionQuery() {
 325.123 +
 325.124 +            protected void query(CompletionResultSet completionResultSet, Document document, int i) {
 325.125 +                JToolTip toolTip = new JToolTip();
 325.126 +                toolTip.setTipText(displayText);
 325.127 +                completionResultSet.setToolTip(toolTip);
 325.128 +                completionResultSet.finish();
 325.129 +            }
 325.130 +        });
 325.131 +
 325.132 +    }
 325.133 +
 325.134 +    public boolean instantSubstitution(JTextComponent component) {
 325.135 +        return false;
 325.136 +    }
 325.137 +
 325.138 +    public int getSortPriority() {
 325.139 +        return 0;
 325.140 +    }
 325.141 +
 325.142 +    public CharSequence getSortText() {
 325.143 +        return displayText;
 325.144 +    }
 325.145 +
 325.146 +    public CharSequence getInsertPrefix() {
 325.147 +        return displayText;
 325.148 +
 325.149 +    }
 325.150 +}
   326.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   326.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/vm/codecompletion/VelocityCompletionProvider.java	Sun Jun 26 10:25:14 2011 +0800
   326.3 @@ -0,0 +1,446 @@
   326.4 +/*
   326.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   326.6 + *
   326.7 + * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
   326.8 + *
   326.9 + * The contents of this file are subject to the terms of either the GNU
  326.10 + * General Public License Version 2 only ("GPL") or the Common
  326.11 + * Development and Distribution License("CDDL") (collectively, the
  326.12 + * "License"). You may not use this file except in compliance with the
  326.13 + * License. You can obtain a copy of the License at
  326.14 + * http://www.netbeans.org/cddl-gplv2.html
  326.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  326.16 + * specific language governing permissions and limitations under the
  326.17 + * License.  When distributing the software, include this License Header
  326.18 + * Notice in each file and include the License file at
  326.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  326.20 + * particular file as subject to the "Classpath" exception as provided
  326.21 + * by Sun in the GPL Version 2 section of the License file that
  326.22 + * accompanied this code. If applicable, add the following below the
  326.23 + * License Header, with the fields enclosed by brackets [] replaced by
  326.24 + * your own identifying information:
  326.25 + * "Portions Copyrighted [year] [name of copyright owner]"
  326.26 + *
  326.27 + * If you wish your version of this file to be governed by only the CDDL
  326.28 + * or only the GPL Version 2, indicate your decision by adding
  326.29 + * "[Contributor] elects to include this software in this distribution
  326.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  326.31 + * single choice of license, a recipient has the option to distribute
  326.32 + * your version of this file under either the CDDL, the GPL Version 2 or
  326.33 + * to extend the choice of license to its licensees as provided above.
  326.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  326.35 + * Version 2 license, then the option applies only if the new code is
  326.36 + * made subject to such option by the copyright holder.
  326.37 + *
  326.38 + * Contributor(s):
  326.39 + *
  326.40 + * Portions Copyrighted 2009 Sun Microsystems, Inc.
  326.41 + */
  326.42 +package org.netbeans.modules.portalpack.websynergy.portlets.vm.codecompletion;
  326.43 +
  326.44 +import com.sun.source.tree.ClassTree;
  326.45 +import com.sun.source.util.TreePathScanner;
  326.46 +import java.io.IOException;
  326.47 +import java.util.ArrayList;
  326.48 +import java.util.HashMap;
  326.49 +import java.util.List;
  326.50 +
  326.51 +import java.util.Set;
  326.52 +import javax.lang.model.element.ElementKind;
  326.53 +import javax.lang.model.element.ExecutableElement;
  326.54 +import javax.lang.model.element.Modifier;
  326.55 +import javax.lang.model.element.TypeElement;
  326.56 +import javax.lang.model.element.TypeParameterElement;
  326.57 +import javax.lang.model.element.VariableElement;
  326.58 +import javax.lang.model.type.TypeKind;
  326.59 +import javax.lang.model.type.TypeMirror;
  326.60 +import javax.lang.model.type.TypeVisitor;
  326.61 +import javax.lang.model.util.Elements;
  326.62 +import javax.swing.JToolTip;
  326.63 +import javax.swing.text.BadLocationException;
  326.64 +import javax.swing.text.Document;
  326.65 +import javax.swing.text.Element;
  326.66 +import javax.swing.text.JTextComponent;
  326.67 +import javax.swing.text.StyledDocument;
  326.68 +import org.netbeans.api.java.classpath.ClassPath;
  326.69 +import org.netbeans.api.java.source.ClasspathInfo;
  326.70 +import org.netbeans.api.java.source.CompilationController;
  326.71 +import org.netbeans.api.java.source.CompilationInfo;
  326.72 +import org.netbeans.api.java.source.ElementUtilities.ElementAcceptor;
  326.73 +import org.netbeans.api.java.source.JavaSource;
  326.74 +import org.netbeans.api.java.source.Task;
  326.75 +import org.netbeans.api.java.source.TypeUtilities;
  326.76 +import org.netbeans.api.project.FileOwnerQuery;
  326.77 +import org.netbeans.api.project.Project;
  326.78 +import org.netbeans.modules.editor.NbEditorUtilities;
  326.79 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.actions.util.PortletProjectUtils;
  326.80 +import org.netbeans.modules.portalpack.servers.websynergy.common.WebSpacePropertiesUtil;
  326.81 +import org.netbeans.modules.web.api.webmodule.WebModule;
  326.82 +import org.netbeans.spi.editor.completion.CompletionProvider;
  326.83 +import org.netbeans.spi.editor.completion.CompletionResultSet;
  326.84 +import org.netbeans.spi.editor.completion.CompletionTask;
  326.85 +import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery;
  326.86 +import org.netbeans.spi.editor.completion.support.AsyncCompletionTask;
  326.87 +import org.openide.filesystems.FileObject;
  326.88 +import org.openide.util.Exceptions;
  326.89 +
  326.90 +/**
  326.91 + *
  326.92 + * @author satyaranjan
  326.93 + */
  326.94 +public class VelocityCompletionProvider implements CompletionProvider {
  326.95 +
  326.96 +    private static HashMap map;
  326.97 +
  326.98 +
  326.99 +    static {
 326.100 +        map = new HashMap();
 326.101 +        
 326.102 +        map.put("$request","javax.servlet.HttpServletRequest");
 326.103 +        map.put("$portletConfig","javax.portlet.PortletConfig");
 326.104 +        map.put("$renderRequest","javax.portlet.RenderRequest");
 326.105 +        map.put("$renderResponse","javax.portlet.RenderResponse");
 326.106 +        map.put("$xmlRequest","");
 326.107 +        map.put("$themeDisplay","com.liferay.portal.theme.ThemeDisplay");
 326.108 +        map.put("$company","com.liferay.portal.model.Company");
 326.109 +        map.put("$permissionChecker","com.liferay.portal.security.permission.PermissionChecker");
 326.110 +        map.put("$user","com.liferay.portal.model.User");
 326.111 +        map.put("$realUser","com.liferay.portal.model.User");
 326.112 +        map.put("$colorScheme","com.liferay.portal.model.ColorScheme");
 326.113 +        map.put("$portletDisplay","com.liferay.portal.theme.PortletDisplay");
 326.114 +        map.put("$navItems","java.util.List");
 326.115 +        map.put("$fullCssPath","");
 326.116 +        map.put("$fullTemplatesPath","");
 326.117 +        map.put("$portletGroupId","");
 326.118 +        map.put("$pageTitle","");
 326.119 +        map.put("$pageSubtitle","");
 326.120 +        map.put("$layout","com.liferay.portal.model.Layout");
 326.121 +        map.put("$layouts","java.util.List");
 326.122 +        map.put("$plid","");
 326.123 +        map.put("$layoutTypePortlet","com.liferay.portal.model.LayoutTypePortlet");
 326.124 +        map.put("$scopeGroupId","");
 326.125 +        map.put("$locale","java.util.Locale");
 326.126 +        map.put("$timeZone","java.util.TimeZone");
 326.127 +        map.put("$theme","com.liferay.portal.model.Theme");
 326.128 +
 326.129 +    }
 326.130 +
 326.131 +    public CompletionTask createTask(int queryType, JTextComponent component) {
 326.132 +        if (queryType != CompletionProvider.COMPLETION_QUERY_TYPE) {
 326.133 +            return null;
 326.134 +        }
 326.135 +
 326.136 +        return new AsyncCompletionTask(new AsyncCompletionQuery() {
 326.137 +
 326.138 +            protected void query(CompletionResultSet completionResultSet, Document document, int caretOffset) {
 326.139 +
 326.140 +                String varName = null;
 326.141 +                int startOffset = caretOffset - 1;
 326.142 +                try{
 326.143 +                    FileObject fob = NbEditorUtilities.getFileObject(document);
 326.144 +                    if(!fob.getExt().equalsIgnoreCase("vm")) {
 326.145 +                        completionResultSet.finish();
 326.146 +                        return;
 326.147 +                    }
 326.148 +                    Project project = FileOwnerQuery.getOwner(fob);
 326.149 +
 326.150 +                    if(!WebSpacePropertiesUtil.isWebSynergyServer(project)) {
 326.151 +                        completionResultSet.finish();
 326.152 +                        return;
 326.153 +                    }
 326.154 +                }catch(Throwable t) {
 326.155 +                    completionResultSet.finish();
 326.156 +                    return;
 326.157 +                }
 326.158 +                try {
 326.159 +                    final StyledDocument bDoc = (StyledDocument) document;
 326.160 +                    final int lineStartOffset = getRowFirstNonWhite(bDoc, caretOffset);
 326.161 +                    final char[] line = bDoc.getText(lineStartOffset, caretOffset - lineStartOffset).toCharArray();
 326.162 +                    final int whiteOffset = indexOfWhite(line);
 326.163 +                    varName = new String(line, whiteOffset + 1, line.length - whiteOffset - 1);
 326.164 +                    if (whiteOffset > 0) {
 326.165 +                        startOffset = lineStartOffset + whiteOffset + 1;
 326.166 +                    } else {
 326.167 +                        startOffset = lineStartOffset;
 326.168 +                    }
 326.169 +                } catch (BadLocationException ex) {
 326.170 +                    ex.printStackTrace();
 326.171 +                }
 326.172 +
 326.173 +
 326.174 +                //Iterate through the available locales
 326.175 +                //and assign each country display name
 326.176 +                //to a CompletionResultSet:
 326.177 +//                Locale[] locales = Locale.getAvailableLocales();
 326.178 +//                for (int i = 0; i < locales.length; i++) {
 326.179 +//                    final Locale locale = locales[i];
 326.180 +//                    final String country = locale.getDisplayCountry();
 326.181 +//                    if (!country.equals("") && filter.startsWith("$request.")) {
 326.182 +//                        completionResultSet.addItem(new VelocityCompletionItem(country, startOffset,caretOffset));
 326.183 +//                    }
 326.184 +//                }
 326.185 +
 326.186 +                int i = varName.lastIndexOf("$");
 326.187 +                if(i != -1) {
 326.188 +                    varName = varName.substring(i);
 326.189 +                }
 326.190 +                int bi = varName.indexOf('(');
 326.191 +                int doti = varName.lastIndexOf(".");
 326.192 +                if (i != -1 && bi == -1 && doti != -1) {
 326.193 +
 326.194 +                    String filter = "";
 326.195 +                    if(varName.endsWith(".")) {
 326.196 +                        varName = varName.substring(0, varName.length() - 1);
 326.197 +                    } else {
 326.198 +                        if(varName.length() > doti + 1)
 326.199 +                            filter = varName.substring(doti + 1);
 326.200 +                        //if(varName.length() > i + 1) {
 326.201 +                            varName = varName.substring(0,doti);
 326.202 +                        //}
 326.203 +
 326.204 +                    }
 326.205 +
 326.206 +                    System.out.println("Filter::: "+filter);
 326.207 +                    System.out.println("VarName::: "+varName);
 326.208 +
 326.209 +                    // System.out.println("filteris ::::::::::::::::::: " + filter);
 326.210 +                    final String implClass = (String) map.get(varName);
 326.211 +                    //if(filter.startsWith("$eventResponse")) {
 326.212 +                    if (implClass != null && implClass.trim().length() != 0) {
 326.213 +                        FileObject fObject = NbEditorUtilities.getFileObject(document);
 326.214 +                        Project project = FileOwnerQuery.getOwner(fObject);
 326.215 +                        WebModule wm = PortletProjectUtils.getWebModule(project);
 326.216 +                        if (wm != null) {
 326.217 +
 326.218 +                            ClassPath cp = ClassPath.getClassPath(wm.getDocumentBase(), ClassPath.COMPILE);
 326.219 +
 326.220 +                            ClasspathInfo info = ClasspathInfo.create(wm.getDocumentBase());
 326.221 +                            JavaSource source = JavaSource.create(info);
 326.222 +                            final List<MethodInfo> methods = new ArrayList();
 326.223 +                            final List fields = new ArrayList();
 326.224 +                            try {
 326.225 +                                source.runUserActionTask(new Task<CompilationController>() {
 326.226 +
 326.227 +                                    public void run(CompilationController info) throws Exception {
 326.228 +                                        Elements elements = info.getElements();
 326.229 +                                        TypeElement te = elements.getTypeElement(implClass);
 326.230 +                                        if(te == null)
 326.231 +                                            return;
 326.232 +                                        getMethodsAndFields(info, te, methods,fields);
 326.233 +
 326.234 +                                        if (te.getKind() == javax.lang.model.element.ElementKind.INTERFACE) {
 326.235 +                                            List<? extends TypeMirror> intTypeMirror = te.getInterfaces();
 326.236 +
 326.237 +                                            for (TypeMirror intf : intTypeMirror) {
 326.238 +
 326.239 +                                                TypeElement intfElm = elements.getTypeElement(intf.toString());
 326.240 +                                                if(intfElm == null)
 326.241 +                                                    continue;
 326.242 +                                                if(intfElm.getKind() == javax.lang.model.element.ElementKind.INTERFACE)
 326.243 +                                                    getMethodsAndFields(info, intfElm, methods,fields);
 326.244 +
 326.245 +                                            }
 326.246 +                                        }
 326.247 +                                        //methods from super classes
 326.248 +                                        TypeMirror mirror = te.getSuperclass();
 326.249 +
 326.250 +                                        if(mirror.getKind() != TypeKind.NONE) {
 326.251 +                                            TypeElement superElm = elements.getTypeElement(mirror.toString());
 326.252 +                                            if(superElm != null) {
 326.253 +                                                getMethodsAndFields(info, superElm, methods,fields);
 326.254 +                                            }
 326.255 +                                        }
 326.256 +                                    }
 326.257 +                                }, true);
 326.258 +                            } catch (IOException ex) {
 326.259 +                               ex.printStackTrace();
 326.260 +                            }
 326.261 +
 326.262 +
 326.263 +                            for (Object f : fields) {
 326.264 +                                completionResultSet.addItem(new VelocityCompletionItem((String)f,(String)f, null, startOffset, caretOffset));
 326.265 +                            }
 326.266 +
 326.267 +                            for (MethodInfo method : methods) {
 326.268 +                                if(method.getMethodName().startsWith(filter)) {
 326.269 +                                    completionResultSet.addItem(new VelocityCompletionItem(method.toString(),method.getSignature(), method.getReturnType(), startOffset, caretOffset));
 326.270 +
 326.271 +
 326.272 +                                }
 326.273 +                            }
 326.274 +                        }
 326.275 +                    }
 326.276 +                } else {
 326.277 +
 326.278 +                    Set keys = map.keySet();
 326.279 +                    for (Object key : keys) {
 326.280 +                        completionResultSet.addItem(new VelocityCompletionItem((String) key,(String) key, null,startOffset, caretOffset));
 326.281 +                    }
 326.282 +                }
 326.283 +
 326.284 +                completionResultSet.finish();
 326.285 +
 326.286 +            }
 326.287 +        }, component);
 326.288 +
 326.289 +    }
 326.290 +
 326.291 +    private static void getMethods(CompilationInfo info, javax.lang.model.element.Element te, List<MethodInfo> methods) {
 326.292 +        getMethodsAndFields(info, te, methods, null);
 326.293 +    }
 326.294 +
 326.295 +    private static void getMethodsAndFields(CompilationInfo info, javax.lang.model.element.Element te, List<MethodInfo> methods, List fields) {
 326.296 +        //Element el = info.getTrees().getElement(getCurrentPath());
 326.297 +
 326.298 +        if (te == null) {
 326.299 +            //       StatusDisplayer.getDefault().setStatusText("Cannot resolve class!");
 326.300 +        } else {
 326.301 +            //    TypeElement te = (TypeElement) el;
 326.302 +            List enclosedElements = te.getEnclosedElements();
 326.303 +            //InputOutput io = IOProvider.getDefault().getIO("Analysis of " + info.getFileObject().getName(), true);
 326.304 +            for (int i = 0; i < enclosedElements.size(); i++) {
 326.305 +                javax.lang.model.element.Element enclosedElement = (javax.lang.model.element.Element) enclosedElements.get(i);
 326.306 +
 326.307 +                if (enclosedElement.getKind() == ElementKind.CONSTRUCTOR) {
 326.308 +                    //    io.getOut().println("Constructor: " + enclosedElement.getSimpleName());
 326.309 +                } else if (enclosedElement.getKind() == ElementKind.METHOD) {
 326.310 +                    //  io.getOut().println("Method: " + enclosedElement.getSimpleName());
 326.311 +                    //String methodName = enclosedElement.getSimpleName().toString();
 326.312 +                    ///methods.add((ExecutableElement) enclosedElement);
 326.313 +                    try{
 326.314 +                    ExecutableElement methodElm = (ExecutableElement) enclosedElement;
 326.315 +                    MethodInfo methodInfo = new MethodInfo(methodElm.getSimpleName().toString());
 326.316 +
 326.317 +                    methodInfo.setReturnType(methodElm.getReturnType().toString());
 326.318 +                    List<VariableElement> paramsType = (List<VariableElement>) methodElm.getParameters();
 326.319 +                    MethodInfo.ParameterInfo[] paramTable = new MethodInfo.ParameterInfo[paramsType.size()];
 326.320 +                    for (int z = 0; z < paramTable.length; z++) {
 326.321 +                        VariableElement varElm = (VariableElement) paramsType.get(z);
 326.322 +                        
 326.323 +                        paramTable[z] = new MethodInfo.ParameterInfo(varElm.getSimpleName().toString(), varElm.asType().toString(), null);
 326.324 +                    }
 326.325 +
 326.326 +                    methodInfo.setParameterInfo(paramTable);
 326.327 +                    methods.add(methodInfo);
 326.328 +                    }catch(java.lang.AssertionError e) {
 326.329 +                        e.printStackTrace();
 326.330 +                    }
 326.331 +
 326.332 +                } else if (enclosedElement.getKind() == ElementKind.FIELD) {
 326.333 +                    try{
 326.334 +                        if(fields != null) {
 326.335 +                            Set<Modifier> modifiers = enclosedElement.getModifiers();
 326.336 +                            
 326.337 +                            for(Modifier modifier:modifiers) {
 326.338 +                                if(modifier == Modifier.PUBLIC) {
 326.339 +                                    fields.add(enclosedElement.getSimpleName().toString());
 326.340 +                                    break;
 326.341 +                                }
 326.342 +                            }
 326.343 +                            
 326.344 +                        }
 326.345 +                    }catch(java.lang.AssertionError e) {
 326.346 +                        e.printStackTrace();
 326.347 +                    }
 326.348 +                    //io.getOut().println("Field: " + enclosedElement.getSimpleName());
 326.349 +                } else {
 326.350 +                    //io.getOut().println("Other: " + enclosedElement.getSimpleName());
 326.351 +                }
 326.352 +            }
 326.353 +
 326.354 +
 326.355 +
 326.356 +        }
 326.357 +    }
 326.358 +
 326.359 +
 326.360 +    public int getAutoQueryTypes(JTextComponent component, String typedText) {
 326.361 +        return 0;
 326.362 +    }
 326.363 +
 326.364 +    static int getRowFirstNonWhite(StyledDocument doc, int offset)
 326.365 +            throws BadLocationException {
 326.366 +        if (doc == null) {
 326.367 +            return 0;
 326.368 +        }
 326.369 +        Element lineElement = doc.getParagraphElement(offset);
 326.370 +        int start = lineElement.getStartOffset();
 326.371 +        while (start + 1 < lineElement.getEndOffset()) {
 326.372 +            try {
 326.373 +                if (doc.getText(start, 1).charAt(0) != ' ') {
 326.374 +                    break;
 326.375 +                }
 326.376 +            } catch (BadLocationException ex) {
 326.377 +                throw (BadLocationException) new BadLocationException(
 326.378 +                        "calling getText(" + start + ", " + (start + 1) +
 326.379 +                        ") on doc of length: " + doc.getLength(), start).initCause(ex);
 326.380 +            }
 326.381 +            start++;
 326.382 +        }
 326.383 +        return start;
 326.384 +    }
 326.385 +
 326.386 +    static int indexOfWhite(char[] line) {
 326.387 +        int i = line.length;
 326.388 +        while (--i > -1) {
 326.389 +            final char c = line[i];
 326.390 +            if (Character.isWhitespace(c)) {
 326.391 +                return i;
 326.392 +            }
 326.393 +        }
 326.394 +        return -1;
 326.395 +    }
 326.396 +
 326.397 +    static int indexOf$(char[] line) {
 326.398 +        int i = line.length;
 326.399 +        while (--i > -1) {
 326.400 +            final char c = line[i];
 326.401 +            if (c == '$') {
 326.402 +                return i;
 326.403 +            }
 326.404 +        }
 326.405 +        return -1;
 326.406 +    }
 326.407 +
 326.408 +    private static class MemberVisitor extends TreePathScanner<Void, Void> {
 326.409 +
 326.410 +        private CompilationInfo info;
 326.411 +        private List methods;
 326.412 +
 326.413 +        public MemberVisitor(CompilationInfo info, List methods) {
 326.414 +            this.info = info;
 326.415 +            this.methods = methods;
 326.416 +        }
 326.417 +
 326.418 +        //  @Override
 326.419 +        public Void visitClass(ClassTree t, Void v) {
 326.420 +            javax.lang.model.element.Element el = info.getTrees().getElement(getCurrentPath());
 326.421 +
 326.422 +            if (el == null) {
 326.423 +                //  StatusDisplayer.getDefault().setStatusText("Cannot resolve class!");
 326.424 +            } else {
 326.425 +                TypeElement te = (TypeElement) el;
 326.426 +                List enclosedElements = te.getEnclosedElements();
 326.427 +                //InputOutput io = IOProvider.getDefault().getIO("Analysis of " + info.getFileObject().getName(), true);
 326.428 +                for (int i = 0; i < enclosedElements.size(); i++) {
 326.429 +                    javax.lang.model.element.Element enclosedElement = (javax.lang.model.element.Element) enclosedElements.get(i);
 326.430 +                    if (enclosedElement.getKind() == javax.lang.model.element.ElementKind.CONSTRUCTOR) {
 326.431 +                        //    io.getOut().println("Constructor: " + enclosedElement.getSimpleName());
 326.432 +                    } else if (enclosedElement.getKind() == javax.lang.model.element.ElementKind.METHOD) {
 326.433 +                        //  io.getOut().println("Method: " + enclosedElement.getSimpleName());
 326.434 +                        methods.add(enclosedElement.getSimpleName());
 326.435 +                    } else if (enclosedElement.getKind() == javax.lang.model.element.ElementKind.FIELD) {
 326.436 +                        //io.getOut().println("Field: " + enclosedElement.getSimpleName());
 326.437 +                    } else {
 326.438 +                        //io.getOut().println("Other: " + enclosedElement.getSimpleName());
 326.439 +                    }
 326.440 +                }
 326.441 +            }
 326.442 +            return null;
 326.443 +        }
 326.444 +
 326.445 +        public List getMethods() {
 326.446 +            return methods;
 326.447 +        }
 326.448 +    }
 326.449 +}
   327.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   327.2 +++ b/portalpack.websynergy.portlets/src/org/netbeans/modules/portalpack/websynergy/portlets/vm/resources/Velocity.xml	Sun Jun 26 10:25:14 2011 +0800
   327.3 @@ -0,0 +1,49 @@
   327.4 +<?xml version="1.0" encoding="UTF-8"?>
   327.5 +<!--
   327.6 +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   327.7 +
   327.8 +Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
   327.9 +
  327.10 +
  327.11 +The contents of this file are subject to the terms of either the GNU
  327.12 +General Public License Version 2 only ("GPL") or the Common
  327.13 +Development and Distribution License("CDDL") (collectively, the
  327.14 +"License"). You may not use this file except in compliance with the
  327.15 +License. You can obtain a copy of the License at
  327.16 +http://www.netbeans.org/cddl-gplv2.html
  327.17 +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  327.18 +specific language governing permissions and limitations under the
  327.19 +License.  When distributing the software, include this License Header
  327.20 +Notice in each file and include the License file at
  327.21 +nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  327.22 +particular file as subject to the "Classpath" exception as provided
  327.23 +by Sun in the GPL Version 2 section of the License file that
  327.24 +accompanied this code. If applicable, add the following below the
  327.25 +License Header, with the fields enclosed by brackets [] replaced by
  327.26 +your own identifying information:
  327.27 +"Portions Copyrighted [year] [name of copyright owner]"
  327.28 +
  327.29 +Contributor(s):
  327.30 +
  327.31 +The Original Software is NetBeans. The Initial Developer of the Original
  327.32 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  327.33 +Microsystems, Inc. All Rights Reserved.
  327.34 +
  327.35 +If you wish your version of this file to be governed by only the CDDL
  327.36 +or only the GPL Version 2, indicate your decision by adding
  327.37 +"[Contributor] elects to include this software in this distribution
  327.38 +under the [CDDL or GPL Version 2] license." If you do not indicate a
  327.39 +single choice of license, a recipient has the option to distribute
  327.40 +your version of this file under either the CDDL, the GPL Version 2 or
  327.41 +to extend the choice of license to its licensees as provided above.
  327.42 +However, if you add GPL Version 2 code and therefore, elected the GPL
  327.43 +Version 2 license, then the option applies only if the new code is
  327.44 +made subject to such option by the copyright holder.
  327.45 +-->
  327.46 +<!DOCTYPE MIME-resolver PUBLIC "-//NetBeans//DTD MIME Resolver 1.0//EN" "http://www.netbeans.org/dtds/mime-resolver-1_0.dtd">
  327.47 +<MIME-resolver>
  327.48 +    <file>
  327.49 +        <ext name="vm"/>
  327.50 +        <resolver mime="text/html"/>
  327.51 +    </file>
  327.52 +</MIME-resolver>
   328.1 --- a/portalpack.websynergy.servicebuilder/external/binaries-list	Fri Jun 10 09:46:37 2011 +0200
   328.2 +++ b/portalpack.websynergy.servicebuilder/external/binaries-list	Sun Jun 26 10:25:14 2011 +0800
   328.3 @@ -1,3 +1,3 @@
   328.4  68A6195969245A595402C89D0E156FC6AF8E749E jalopy.jar
   328.5 -564466BDCBC2C6DD478C759553D3EAC296954CC7 qdox.jar
   328.6 +CED05C1CA06094684A4BB971BA36F3E678071ADF qdox.jar
   328.7  C451D58874F7030F84B2DB22BD5EA12A1C35517C mail.jar
   329.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   329.2 +++ b/portalpack.websynergy.servicebuilder/l10n/build.xml	Sun Jun 26 10:25:14 2011 +0800
   329.3 @@ -0,0 +1,60 @@
   329.4 +<?xml version="1.0" encoding="UTF-8"?>
   329.5 +
   329.6 +<!--
   329.7 +The contents of this file are subject to the terms of the Common Development
   329.8 +and Distribution License (the License). You may not use this file except in
   329.9 +compliance with the License.
  329.10 +
  329.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  329.12 +or http://www.netbeans.org/cddl.txt.
  329.13 +
  329.14 +When distributing Covered Code, include this CDDL Header Notice in each file
  329.15 +and include the License file at http://www.netbeans.org/cddl.txt.
  329.16 +If applicable, add the following below the CDDL Header, with the fields
  329.17 +enclosed by brackets [] replaced by your own identifying information:
  329.18 +"Portions Copyrighted [year] [name of copyright owner]"
  329.19 +
  329.20 + The Original Software is NetBeans. The Initial Developer of the Original
  329.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  329.22 + Microsystems, Inc. All Rights Reserved.
  329.23 +-->
  329.24 +
  329.25 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
  329.26 +<!-- for some information on what you could do (e.g. targets to override). -->
  329.27 +<!-- If you delete this file and reopen the project it will be recreated. -->
  329.28 +<project name="ml-build" default="netbeans" basedir="../">
  329.29 +    
  329.30 +    <description>Portal Pack ML build</description>
  329.31 +    <import file="../build.xml"/>
  329.32 +    <target name="create-l10n-kit">
  329.33 +         <property name="l10nkit-dir" value="build/l10n"/>
  329.34 +         <property name="l10nkit-zip" value="build/portalpack-websynergy-servicebuilder-l10nkit.zip"/>
  329.35 +         <delete dir="${l10nkit-dir}"/>
  329.36 +         <delete file="${l10nkit-zip}"/>
  329.37 +         
  329.38 +         <mkdir dir="${l10nkit-dir}"/>
  329.39 +         
  329.40 +         <copydir src="src" includes="**/Bundle.properties,**/*.html,**/*.htm" dest="${l10nkit-dir}/src"/>
  329.41 +
  329.42 +         <zip destfile="${l10nkit-zip}"
  329.43 +           basedir="${l10nkit-dir}"
  329.44 +         />
  329.45 +    </target>
  329.46 +    
  329.47 +    <target name="compile" depends="contrib/portalpack.websynergy.servicebuilder.compile">
  329.48 +        <copy todir="build/classes">
  329.49 +             <fileset dir="l10n/ja"/>
  329.50 +             <fileset dir="l10n/pt_BR"/>
  329.51 +             <fileset dir="l10n/zh_CN"/>  
  329.52 +         </copy>
  329.53 +     </target>
  329.54 +	 
  329.55 +	 <target name="copyL10n">
  329.56 +		 <echo message="${l10n.src.dir}"/>
  329.57 +		 <copy todir=".">
  329.58 +			<fileset dir="${l10n.src.dir}"/>			
  329.59 +			<mapper type="glob" from="src" to="l10n/${locale}"/>
  329.60 +		 </copy>
  329.61 +	 </target>
  329.62 +      
  329.63 +</project>
   330.1 --- a/portalpack.websynergy.servicebuilder/manifest.mf	Fri Jun 10 09:46:37 2011 +0200
   330.2 +++ b/portalpack.websynergy.servicebuilder/manifest.mf	Sun Jun 26 10:25:14 2011 +0800
   330.3 @@ -2,7 +2,7 @@
   330.4  OpenIDE-Module: org.netbeans.modules.portalpack.websynergy.servicebuilder
   330.5  OpenIDE-Module-Layer: org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/layer.xml
   330.6  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/Bundle.properties
   330.7 -OpenIDE-Module-Specification-Version: 0.4
   330.8 +OpenIDE-Module-Specification-Version: 0.9.15
   330.9  
  330.10  Name: org/netbeans/modules/portalpack/websynergy/servicebuilder/loader/ServiceBuilderFlowDataLoader.class
  330.11  Install-Before: org.openide.loaders.XMLDataObject, org.netbeans.modules.xml.XMLDataObject
   331.1 --- a/portalpack.websynergy.servicebuilder/nbproject/project.properties	Fri Jun 10 09:46:37 2011 +0200
   331.2 +++ b/portalpack.websynergy.servicebuilder/nbproject/project.properties	Sun Jun 26 10:25:14 2011 +0800
   331.3 @@ -1,2 +1,9 @@
   331.4 -javac.source=1.5
   331.5 +javac.source=1.6
   331.6  javac.compilerargs=-Xlint -Xlint:-serial
   331.7 +
   331.8 +extra.license.files=external/mail-license.txt,\
   331.9 +                    external/jalopy-license.txt,\
  331.10 +                    external/qdox-license.txt
  331.11 +
  331.12 +nbm.homepage=http://portalpack.netbeans.org
  331.13 +    
   332.1 --- a/portalpack.websynergy.servicebuilder/nbproject/project.xml	Fri Jun 10 09:46:37 2011 +0200
   332.2 +++ b/portalpack.websynergy.servicebuilder/nbproject/project.xml	Sun Jun 26 10:25:14 2011 +0800
   332.3 @@ -122,7 +122,7 @@
   332.4                      <build-prerequisite/>
   332.5                      <compile-dependency/>
   332.6                      <run-dependency>
   332.7 -                        <specification-version>2.92</specification-version>
   332.8 +                        <specification-version>3.0</specification-version>
   332.9                      </run-dependency>
  332.10                  </dependency>
  332.11                  <dependency>
  332.12 @@ -135,8 +135,10 @@
  332.13                  </dependency>
  332.14                  <dependency>
  332.15                      <code-name-base>org.netbeans.modules.portalpack.servers.websynergy</code-name-base>
  332.16 +                    <build-prerequisite/>
  332.17 +                    <compile-dependency/>
  332.18                      <run-dependency>
  332.19 -                        <specification-version>0.96</specification-version>
  332.20 +                        <specification-version>1.0</specification-version>
  332.21                      </run-dependency>
  332.22                  </dependency>
  332.23                  <dependency>
  332.24 @@ -249,6 +251,14 @@
  332.25                      </run-dependency>
  332.26                  </dependency>
  332.27                  <dependency>
  332.28 +                    <code-name-base>org.openide.util.lookup</code-name-base>
  332.29 +                    <build-prerequisite/>
  332.30 +                    <compile-dependency/>
  332.31 +                    <run-dependency>
  332.32 +                        <specification-version>8.6.1</specification-version>
  332.33 +                    </run-dependency>
  332.34 +                </dependency>
  332.35 +                <dependency>
  332.36                      <code-name-base>org.openide.windows</code-name-base>
  332.37                      <build-prerequisite/>
  332.38                      <compile-dependency/>
   333.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/catalog/RegisterDTDCatalog.java	Fri Jun 10 09:46:37 2011 +0200
   333.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   333.3 @@ -1,137 +0,0 @@
   333.4 -/*
   333.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   333.6 - * 
   333.7 - * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
   333.8 - * 
   333.9 - * The contents of this file are subject to the terms of either the GNU
  333.10 - * General Public License Version 2 only ("GPL") or the Common
  333.11 - * Development and Distribution License("CDDL") (collectively, the
  333.12 - * "License"). You may not use this file except in compliance with the
  333.13 - * License. You can obtain a copy of the License at
  333.14 - * http://www.netbeans.org/cddl-gplv2.html
  333.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  333.16 - * specific language governing permissions and limitations under the
  333.17 - * License.  When distributing the software, include this License Header
  333.18 - * Notice in each file and include the License file at
  333.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  333.20 - * particular file as subject to the "Classpath" exception as provided
  333.21 - * by Sun in the GPL Version 2 section of the License file that
  333.22 - * accompanied this code. If applicable, add the following below the
  333.23 - * License Header, with the fields enclosed by brackets [] replaced by
  333.24 - * your own identifying information:
  333.25 - * "Portions Copyrighted [year] [name of copyright owner]"
  333.26 - * 
  333.27 - * If you wish your version of this file to be governed by only the CDDL
  333.28 - * or only the GPL Version 2, indicate your decision by adding
  333.29 - * "[Contributor] elects to include this software in this distribution
  333.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  333.31 - * single choice of license, a recipient has the option to distribute
  333.32 - * your version of this file under either the CDDL, the GPL Version 2 or
  333.33 - * to extend the choice of license to its licensees as provided above.
  333.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  333.35 - * Version 2 license, then the option applies only if the new code is
  333.36 - * made subject to such option by the copyright holder.
  333.37 - * 
  333.38 - * Contributor(s):
  333.39 - * 
  333.40 - * Portions Copyrighted 2008 Sun Microsystems, Inc.
  333.41 - */
  333.42 -
  333.43 -package org.netbeans.modules.portalpack.websynergy.servicebuilder.catalog;
  333.44 -
  333.45 -import java.awt.Image;
  333.46 -import java.beans.PropertyChangeListener;
  333.47 -import java.io.IOException;
  333.48 -import java.util.ArrayList;
  333.49 -import java.util.Iterator;
  333.50 -import java.util.List;
  333.51 -import org.netbeans.modules.xml.catalog.spi.CatalogDescriptor;
  333.52 -import org.netbeans.modules.xml.catalog.spi.CatalogListener;
  333.53 -import org.netbeans.modules.xml.catalog.spi.CatalogReader;
  333.54 -import org.xml.sax.EntityResolver;
  333.55 -import org.xml.sax.InputSource;
  333.56 -import org.xml.sax.SAXException;
  333.57 -
  333.58 -/**
  333.59 - *
  333.60 - * @author Satyaranjan
  333.61 - */
  333.62 -public class RegisterDTDCatalog implements CatalogReader, CatalogDescriptor, EntityResolver {
  333.63 -
  333.64 -    private static final String LR_SERVICE_BUILDER_5_1_0_DTD = "liferay-service-builder_5_1_0.dtd";
  333.65 -    private static final String LR_SERVICE_BUILDER_510 = "http://www.liferay.com/dtd/liferay-service-builder_5_1_0.dtd";
  333.66 -    private static final String LR_SERVICE_BUILDER_510_URL = "nbres:/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/liferay-service-builder_5_1_0.dtd";
  333.67 -    private static final String LR_SERVICE_BUILDER_510_ID = "SCHEMA:" + LR_SERVICE_BUILDER_510;
  333.68 -    
  333.69 -    
  333.70 -    public RegisterDTDCatalog()
  333.71 -    {
  333.72 -        
  333.73 -    }
  333.74 -    public Iterator getPublicIDs() {
  333.75 -        List<String> list = new ArrayList<String>();
  333.76 -        list.add(LR_SERVICE_BUILDER_510_ID);
  333.77 -       
  333.78 -        return list.listIterator();
  333.79 -    }
  333.80 -
  333.81 -    public void refresh() {
  333.82 -        
  333.83 -    }
  333.84 -
  333.85 -    public String getSystemID(String publicId) {
  333.86 -        if(publicId.equals(LR_SERVICE_BUILDER_510_ID)) {
  333.87 -            return LR_SERVICE_BUILDER_510_URL;
  333.88 -        }else
  333.89 -            return null;
  333.90 -        }
  333.91 -
  333.92 -    public String resolveURI(String name) {
  333.93 -        return null;
  333.94 -    }
  333.95 -
  333.96 -    public String resolvePublic(String publicId) {
  333.97 -        return null;
  333.98 -    }
  333.99 -
 333.100 -    public void addCatalogListener(CatalogListener l) {
 333.101 -         
 333.102 -    }
 333.103 -
 333.104 -    public void removeCatalogListener(CatalogListener l) {
 333.105 -         
 333.106 -    }
 333.107 -
 333.108 -    public Image getIcon(int type) {
 333.109 -        return null;
 333.110 -    }
 333.111 -
 333.112 -    public String getDisplayName() {
 333.113 -        return "Liferay Service Builder Catalog";
 333.114 -    }
 333.115 -
 333.116 -    public String getShortDescription() {
 333.117 -        return "XML Catalog for Liferay Service Builder";
 333.118 -    }
 333.119 -
 333.120 -    public void addPropertyChangeListener(PropertyChangeListener l) {
 333.121 -       
 333.122 -    }
 333.123 -
 333.124 -    public void removePropertyChangeListener(PropertyChangeListener l) {
 333.125 -        
 333.126 -    }
 333.127 -
 333.128 -    public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
 333.129 -        
 333.130 -        if (LR_SERVICE_BUILDER_510.equals(systemId)){
 333.131 -            return new org.xml.sax.InputSource(LR_SERVICE_BUILDER_510_URL);
 333.132 -        }
 333.133 -        if (systemId != null && systemId.endsWith(LR_SERVICE_BUILDER_5_1_0_DTD)){
 333.134 -            return new org.xml.sax.InputSource(LR_SERVICE_BUILDER_510_URL);
 333.135 -        }
 333.136 -
 333.137 -        return null;
 333.138 -    }
 333.139 -
 333.140 -}
   334.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   334.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   334.3 @@ -65,5 +65,7 @@
   334.4  LBL_ADD=Add
   334.5  LBL_UPDATE=Update
   334.6  LBL_REMOVE=Remove
   334.7 +LBL_CLEAN=Clean Services
   334.8 +LBL_PREFERENCES=Preferences
   334.9  
  334.10  
   335.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ColumnWidget.java	Fri Jun 10 09:46:37 2011 +0200
   335.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ColumnWidget.java	Sun Jun 26 10:25:14 2011 +0800
   335.3 @@ -239,7 +239,7 @@
   335.4              Column newCol = en.newColumn();
   335.5              newCol.setName(name);
   335.6              if(dbName != null && dbName.trim().length() != 0)
   335.7 -                newCol.setDbName(name);
   335.8 +                newCol.setDbName(dbName);
   335.9              newCol.setType(type);
  335.10              
  335.11              if(primaryKey)
   336.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/DesignView.java	Fri Jun 10 09:46:37 2011 +0200
   336.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/DesignView.java	Sun Jun 26 10:25:14 2011 +0800
   336.3 @@ -73,6 +73,7 @@
   336.4  import org.netbeans.modules.portalpack.websynergy.servicebuilder.design.view.widgets.*;
   336.5  import org.netbeans.modules.portalpack.websynergy.servicebuilder.design.javamodel.*;
   336.6  import org.netbeans.modules.portalpack.websynergy.servicebuilder.design.view.ui.AddServiceUI;
   336.7 +import org.netbeans.modules.portalpack.websynergy.servicebuilder.design.view.ui.PreferencesUI;
   336.8  import org.netbeans.modules.portalpack.websynergy.servicebuilder.helper.GenerateServiceHelper;
   336.9  import org.netbeans.modules.portalpack.websynergy.servicebuilder.helper.ServiceBuilderHelper;
  336.10  import org.openide.DialogDisplayer;
  336.11 @@ -425,6 +426,19 @@
  336.12  
  336.13          generateServiceButton.setAction(new GenerateAction(context.getServiceBuilderFile()));
  336.14          headerPanelWidget.addChild(reloadButton);
  336.15 +        
  336.16 +        ButtonWidget cleanButton = new ButtonWidget(scene, NbBundle.getMessage(DesignView.class, "LBL_CLEAN"));
  336.17 +        cleanButton.setOpaque(true);
  336.18 +        cleanButton.setRoundedBorder(3, 4, 0, null);
  336.19 +        cleanButton.setAction(new CleanAction(context.getServiceBuilderFile()));
  336.20 +        headerPanelWidget.addChild(cleanButton);
  336.21 +        
  336.22 +        ButtonWidget preferencesButton = new ButtonWidget(scene, NbBundle.getMessage(DesignView.class, "LBL_PREFERENCES"));
  336.23 +        preferencesButton.setOpaque(true);
  336.24 +        preferencesButton.setRoundedBorder(3, 4, 0, null);
  336.25 +        preferencesButton.setAction(new PreferencesAction(context.getServiceBuilderFile()));
  336.26 +        headerPanelWidget.addChild(preferencesButton);
  336.27 +        
  336.28          return headerPanelWidget;
  336.29      }
  336.30  
  336.31 @@ -548,8 +562,8 @@
  336.32                  selectedEntity.setLocalService(Boolean.toString(addSrvUI.isLocalService()));
  336.33  
  336.34                  String table = addSrvUI.getTableName();
  336.35 -                if(table != null && table.trim().length() != 0)
  336.36 -                    selectedEntity.setTable(table);
  336.37 +                //if(table != null && table.trim().length() != 0)
  336.38 +                selectedEntity.setTable(table);
  336.39                  
  336.40                  if(!helper.save()) {
  336.41                      helper.forceReload();
  336.42 @@ -673,6 +687,32 @@
  336.43          }
  336.44      }
  336.45      
  336.46 +    private class CleanAction extends AbstractAction {
  336.47 +        
  336.48 +        private FileObject serviceXmlFileObject;
  336.49 +
  336.50 +        public CleanAction(FileObject serviceXmlFileObject) {
  336.51 +            this.serviceXmlFileObject = serviceXmlFileObject;
  336.52 +        }
  336.53 +
  336.54 +        public void actionPerformed(ActionEvent e) {
  336.55 +            GenerateServiceHelper.getInstance().cleanService(serviceXmlFileObject);
  336.56 +            //reload();
  336.57 +        }
  336.58 +    }
  336.59 +    
  336.60 +     private class PreferencesAction extends AbstractAction {
  336.61 +        
  336.62 +        private FileObject serviceXmlFileObject;
  336.63 +
  336.64 +        public PreferencesAction(FileObject serviceXmlFileObject) {
  336.65 +            this.serviceXmlFileObject = serviceXmlFileObject;
  336.66 +        }
  336.67 +
  336.68 +        public void actionPerformed(ActionEvent e) {
  336.69 +            PreferencesUI prefUI= new PreferencesUI(serviceXmlFileObject);
  336.70 +        }
  336.71 +    }
  336.72      private class EntityChangeListSelectionListener implements ListSelectionListener {
  336.73  
  336.74          public void valueChanged(ListSelectionEvent e) {
   337.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/AddColumnUI.form	Fri Jun 10 09:46:37 2011 +0200
   337.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/AddColumnUI.form	Sun Jun 26 10:25:14 2011 +0800
   337.3 @@ -22,18 +22,19 @@
   337.4      <DimensionLayout dim="0">
   337.5        <Group type="103" groupAlignment="0" attributes="0">
   337.6            <Group type="102" alignment="1" attributes="0">
   337.7 -              <EmptySpace max="-2" attributes="0"/>
   337.8 +              <EmptySpace min="-2" max="-2" attributes="0"/>
   337.9                <Group type="103" groupAlignment="1" attributes="0">
  337.10                    <Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
  337.11                    <Group type="102" alignment="1" attributes="0">
  337.12 -                      <Component id="addButton" linkSize="1" min="-2" pref="55" max="-2" attributes="0"/>
  337.13 +                      <EmptySpace min="-2" pref="200" max="-2" attributes="0"/>
  337.14 +                      <Component id="addButton" pref="69" max="32767" attributes="0"/>
  337.15                        <EmptySpace min="-2" max="-2" attributes="0"/>
  337.16 -                      <Component id="changeButton" linkSize="1" min="-2" pref="69" max="-2" attributes="0"/>
  337.17 +                      <Component id="changeButton" pref="69" max="32767" attributes="0"/>
  337.18                        <EmptySpace min="-2" max="-2" attributes="0"/>
  337.19 -                      <Component id="cancelButton" linkSize="1" min="-2" pref="69" max="-2" attributes="0"/>
  337.20 +                      <Component id="cancelButton" pref="69" max="32767" attributes="0"/>
  337.21                    </Group>
  337.22                </Group>
  337.23 -              <EmptySpace max="-2" attributes="0"/>
  337.24 +              <EmptySpace min="-2" max="-2" attributes="0"/>
  337.25            </Group>
  337.26        </Group>
  337.27      </DimensionLayout>
   338.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/AddColumnUI.java	Fri Jun 10 09:46:37 2011 +0200
   338.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/AddColumnUI.java	Sun Jun 26 10:25:14 2011 +0800
   338.3 @@ -239,16 +239,14 @@
   338.4                  .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
   338.5                      .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
   338.6                      .add(layout.createSequentialGroup()
   338.7 -                        .add(addButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 55, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
   338.8 +                        .add(200, 200, 200)
   338.9 +                        .add(addButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
  338.10                          .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  338.11 -                        .add(changeButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 69, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  338.12 +                        .add(changeButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
  338.13                          .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  338.14 -                        .add(cancelButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 69, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
  338.15 +                        .add(cancelButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)))
  338.16                  .addContainerGap())
  338.17          );
  338.18 -
  338.19 -        layout.linkSize(new java.awt.Component[] {addButton, cancelButton, changeButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
  338.20 -
  338.21          layout.setVerticalGroup(
  338.22              layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  338.23              .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
   339.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/AddServiceUI.form	Fri Jun 10 09:46:37 2011 +0200
   339.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/AddServiceUI.form	Sun Jun 26 10:25:14 2011 +0800
   339.3 @@ -212,6 +212,9 @@
   339.4                <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/Bundle.properties" key="AddServiceUI.remoteServiceCB.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
   339.5              </Property>
   339.6            </Properties>
   339.7 +          <Events>
   339.8 +            <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="remoteServiceCBItemStateChanged"/>
   339.9 +          </Events>
  339.10          </Component>
  339.11          <Component class="javax.swing.JCheckBox" name="localServiceCB">
  339.12            <Properties>
   340.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/AddServiceUI.java	Fri Jun 10 09:46:37 2011 +0200
   340.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/AddServiceUI.java	Sun Jun 26 10:25:14 2011 +0800
   340.3 @@ -58,7 +58,7 @@
   340.4      private boolean localService;
   340.5      private String tableName;
   340.6      private boolean addMode;
   340.7 -
   340.8 + 
   340.9      /** Creates new form AddServiceUI */
  340.10      public AddServiceUI(java.awt.Frame parent) {
  340.11          super(parent, true);
  340.12 @@ -151,6 +151,11 @@
  340.13          remoteServiceLabel.setText(org.openide.util.NbBundle.getMessage(AddServiceUI.class, "AddServiceUI.remoteServiceLabel.text")); // NOI18N
  340.14  
  340.15          remoteServiceCB.setText(org.openide.util.NbBundle.getMessage(AddServiceUI.class, "AddServiceUI.remoteServiceCB.text")); // NOI18N
  340.16 +        remoteServiceCB.addItemListener(new java.awt.event.ItemListener() {
  340.17 +            public void itemStateChanged(java.awt.event.ItemEvent evt) {
  340.18 +                remoteServiceCBItemStateChanged(evt);
  340.19 +            }
  340.20 +        });
  340.21  
  340.22          localServiceCB.setSelected(true);
  340.23          localServiceCB.setText(org.openide.util.NbBundle.getMessage(AddServiceUI.class, "AddServiceUI.localServiceCB.text")); // NOI18N
  340.24 @@ -308,6 +313,14 @@
  340.25      dispose();
  340.26  }//GEN-LAST:event_updateButtonActionPerformed
  340.27  
  340.28 +private void remoteServiceCBItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_remoteServiceCBItemStateChanged
  340.29 +// TODO add your handling code here:
  340.30 +    if (!addMode){
  340.31 +        setErrorMessage("");
  340.32 +        updateButton.setEnabled(true);
  340.33 +    }
  340.34 +}//GEN-LAST:event_remoteServiceCBItemStateChanged
  340.35 +
  340.36      /**
  340.37      * @param args the command line arguments
  340.38      */
  340.39 @@ -389,7 +402,7 @@
  340.40              // Add mode and Valid
  340.41              setErrorMessage("");
  340.42              addButton.setEnabled(true);
  340.43 -        }
  340.44 +        } 
  340.45      }
  340.46      public void stateChanged(ChangeEvent e) {
  340.47          throw new UnsupportedOperationException("Not supported yet.");
   341.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   341.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   341.3 @@ -52,3 +52,11 @@
   341.4  AddColumnUI.errorLabel.text=
   341.5  AddColumnUI.errorLabel.columnname=Invalid Column Name
   341.6  AddColumnUI.errorLabel.dbcolumnname=Invalid DB Column Name
   341.7 +LBL_TTL_PREFERENCES=Preferences
   341.8 +PreferencesUI.saveButton.text=Save
   341.9 +PreferencesUI.cancelButton.text=Cancel
  341.10 +PreferencesUI.serviceJarLabel.text=Service Jar Name :
  341.11 +LBL_Preferences=Set Preferences
  341.12 +PreferencesUI.copyJarCB.text=Copy Service Jar To Server Classpath
  341.13 +MSG_FILENAME_NOT_END_WITH_JAR=Service Jar file name should have an extension .jar!!!
  341.14 +MSG_NOT_A_VALID_FILE_NAME=Not a valid file name
   342.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   342.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/PreferencesUI.form	Sun Jun 26 10:25:14 2011 +0800
   342.3 @@ -0,0 +1,144 @@
   342.4 +<?xml version="1.0" encoding="UTF-8" ?>
   342.5 +
   342.6 +<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
   342.7 +  <Properties>
   342.8 +    <Property name="defaultCloseOperation" type="int" value="2"/>
   342.9 +    <Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  342.10 +      <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/Bundle.properties" key="LBL_Preferences" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  342.11 +    </Property>
  342.12 +  </Properties>
  342.13 +  <SyntheticProperties>
  342.14 +    <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
  342.15 +  </SyntheticProperties>
  342.16 +  <AuxValues>
  342.17 +    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
  342.18 +    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
  342.19 +    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
  342.20 +    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
  342.21 +    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
  342.22 +    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
  342.23 +    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
  342.24 +    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
  342.25 +  </AuxValues>
  342.26 +
  342.27 +  <Layout>
  342.28 +    <DimensionLayout dim="0">
  342.29 +      <Group type="103" groupAlignment="0" attributes="0">
  342.30 +          <Group type="102" alignment="1" attributes="0">
  342.31 +              <EmptySpace min="-2" max="-2" attributes="0"/>
  342.32 +              <Group type="103" groupAlignment="1" attributes="0">
  342.33 +                  <Component id="jPanel1" alignment="1" max="32767" attributes="0"/>
  342.34 +                  <Group type="102" alignment="1" attributes="0">
  342.35 +                      <EmptySpace min="-2" pref="233" max="-2" attributes="0"/>
  342.36 +                      <Component id="saveButton" pref="65" max="32767" attributes="0"/>
  342.37 +                      <EmptySpace min="-2" max="-2" attributes="0"/>
  342.38 +                      <Component id="cancelButton" max="32767" attributes="0"/>
  342.39 +                  </Group>
  342.40 +              </Group>
  342.41 +              <EmptySpace min="-2" max="-2" attributes="0"/>
  342.42 +          </Group>
  342.43 +      </Group>
  342.44 +    </DimensionLayout>
  342.45 +    <DimensionLayout dim="1">
  342.46 +      <Group type="103" groupAlignment="0" attributes="0">
  342.47 +          <Group type="102" alignment="1" attributes="0">
  342.48 +              <EmptySpace max="-2" attributes="0"/>
  342.49 +              <Component id="jPanel1" max="32767" attributes="0"/>
  342.50 +              <EmptySpace type="unrelated" max="-2" attributes="0"/>
  342.51 +              <Group type="103" groupAlignment="3" attributes="0">
  342.52 +                  <Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
  342.53 +                  <Component id="saveButton" alignment="3" min="-2" max="-2" attributes="0"/>
  342.54 +              </Group>
  342.55 +              <EmptySpace max="-2" attributes="0"/>
  342.56 +          </Group>
  342.57 +      </Group>
  342.58 +    </DimensionLayout>
  342.59 +  </Layout>
  342.60 +  <SubComponents>
  342.61 +    <Container class="javax.swing.JPanel" name="jPanel1">
  342.62 +      <Properties>
  342.63 +        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
  342.64 +          <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
  342.65 +            <TitledBorder title="Preferences">
  342.66 +              <ResourceString PropertyName="titleX" bundle="org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/Bundle.properties" key="LBL_TTL_PREFERENCES" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
  342.67 +            </TitledBorder>
  342.68 +          </Border>
  342.69 +        </Property>
  342.70 +      </Properties>
  342.71 +
  342.72 +      <Layout>
  342.73 +        <DimensionLayout dim="0">
  342.74 +          <Group type="103" groupAlignment="0" attributes="0">
  342.75 +              <Group type="102" attributes="0">
  342.76 +                  <Group type="103" groupAlignment="0" attributes="0">
  342.77 +                      <Group type="102" alignment="0" attributes="0">
  342.78 +                          <EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
  342.79 +                          <Component id="serviceJarLabel" max="32767" attributes="0"/>
  342.80 +                          <EmptySpace min="-2" max="-2" attributes="0"/>
  342.81 +                          <Component id="serviceJarTf" pref="243" max="32767" attributes="0"/>
  342.82 +                      </Group>
  342.83 +                      <Group type="102" alignment="0" attributes="0">
  342.84 +                          <Component id="copyJarCB" max="32767" attributes="0"/>
  342.85 +                          <EmptySpace min="136" pref="136" max="136" attributes="0"/>
  342.86 +                      </Group>
  342.87 +                  </Group>
  342.88 +                  <EmptySpace min="-2" max="-2" attributes="0"/>
  342.89 +              </Group>
  342.90 +          </Group>
  342.91 +        </DimensionLayout>
  342.92 +        <DimensionLayout dim="1">
  342.93 +          <Group type="103" groupAlignment="0" attributes="0">
  342.94 +              <Group type="102" alignment="0" attributes="0">
  342.95 +                  <EmptySpace max="-2" attributes="0"/>
  342.96 +                  <Group type="103" groupAlignment="3" attributes="0">
  342.97 +                      <Component id="serviceJarTf" alignment="3" min="-2" max="-2" attributes="0"/>
  342.98 +                      <Component id="serviceJarLabel" alignment="3" min="-2" max="-2" attributes="0"/>
  342.99 +                  </Group>
 342.100 +                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
 342.101 +                  <Component id="copyJarCB" min="-2" max="-2" attributes="0"/>
 342.102 +                  <EmptySpace pref="32" max="32767" attributes="0"/>
 342.103 +              </Group>
 342.104 +          </Group>
 342.105 +        </DimensionLayout>
 342.106 +      </Layout>
 342.107 +      <SubComponents>
 342.108 +        <Component class="javax.swing.JLabel" name="serviceJarLabel">
 342.109 +          <Properties>
 342.110 +            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 342.111 +              <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/Bundle.properties" key="PreferencesUI.serviceJarLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 342.112 +            </Property>
 342.113 +          </Properties>
 342.114 +        </Component>
 342.115 +        <Component class="javax.swing.JTextField" name="serviceJarTf">
 342.116 +        </Component>
 342.117 +        <Component class="javax.swing.JCheckBox" name="copyJarCB">
 342.118 +          <Properties>
 342.119 +            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 342.120 +              <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/Bundle.properties" key="PreferencesUI.copyJarCB.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 342.121 +            </Property>
 342.122 +          </Properties>
 342.123 +        </Component>
 342.124 +      </SubComponents>
 342.125 +    </Container>
 342.126 +    <Component class="javax.swing.JButton" name="saveButton">
 342.127 +      <Properties>
 342.128 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 342.129 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/Bundle.properties" key="PreferencesUI.saveButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 342.130 +        </Property>
 342.131 +      </Properties>
 342.132 +      <Events>
 342.133 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveButtonActionPerformed"/>
 342.134 +      </Events>
 342.135 +    </Component>
 342.136 +    <Component class="javax.swing.JButton" name="cancelButton">
 342.137 +      <Properties>
 342.138 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
 342.139 +          <ResourceString bundle="org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/Bundle.properties" key="PreferencesUI.cancelButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
 342.140 +        </Property>
 342.141 +      </Properties>
 342.142 +      <Events>
 342.143 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
 342.144 +      </Events>
 342.145 +    </Component>
 342.146 +  </SubComponents>
 342.147 +</Form>
   343.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   343.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/ui/PreferencesUI.java	Sun Jun 26 10:25:14 2011 +0800
   343.3 @@ -0,0 +1,313 @@
   343.4 +/*
   343.5 + * PreferencesUI.java
   343.6 + *
   343.7 + * Created on February 1, 2009, 1:25 PM
   343.8 + */
   343.9 +
  343.10 +package org.netbeans.modules.portalpack.websynergy.servicebuilder.design.view.ui;
  343.11 +
  343.12 +import java.awt.Frame;
  343.13 +import java.io.File;
  343.14 +import java.io.FileInputStream;
  343.15 +import java.io.FileNotFoundException;
  343.16 +import java.io.FileOutputStream;
  343.17 +import java.io.IOException;
  343.18 +import java.util.Properties;
  343.19 +import org.netbeans.api.project.FileOwnerQuery;
  343.20 +import org.netbeans.api.project.Project;
  343.21 +import org.netbeans.modules.portalpack.portlets.genericportlets.core.util.CoreUtil;
  343.22 +import org.openide.DialogDisplayer;
  343.23 +import org.openide.NotifyDescriptor;
  343.24 +import org.openide.filesystems.FileObject;
  343.25 +import org.openide.filesystems.FileUtil;
  343.26 +import org.openide.util.Exceptions;
  343.27 +import org.openide.util.NbBundle;
  343.28 +import org.openide.windows.WindowManager;
  343.29 +
  343.30 +/**
  343.31 + *
  343.32 + * @author  satyaranjan
  343.33 + */
  343.34 +public class PreferencesUI extends javax.swing.JDialog {
  343.35 +
  343.36 +    private static String SERVICE_JAR_NAME = "service.jar.name";
  343.37 +    private static String COPY_JAR_TO_SERVERCLASSPATH = "copy.jar.to.serverclasspath";
  343.38 +    private Properties props;
  343.39 +    private File serviceProps;
  343.40 +    
  343.41 +    /** Creates new form PreferencesUI */
  343.42 +    public PreferencesUI(FileObject serviceXml) {
  343.43 +        super(WindowManager.getDefault().getMainWindow(), true);
  343.44 +        Frame parent = WindowManager.getDefault().getMainWindow();
  343.45 +        initComponents();
  343.46 +        setLocation(parent.getX() +
  343.47 +                (parent.getWidth() - getWidth()) / 2, parent.getY() + 
  343.48 +                (parent.getHeight() - getHeight()) / 2);
  343.49 +        
  343.50 +        getRootPane().setDefaultButton(cancelButton);
  343.51 +        initData(serviceXml);
  343.52 +        
  343.53 +        setVisible(true);
  343.54 +    }
  343.55 +
  343.56 +    /** This method is called from within the constructor to
  343.57 +     * initialize the form.
  343.58 +     * WARNING: Do NOT modify this code. The content of this method is
  343.59 +     * always regenerated by the Form Editor.
  343.60 +     */
  343.61 +    @SuppressWarnings("unchecked")
  343.62 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  343.63 +    private void initComponents() {
  343.64 +
  343.65 +        jPanel1 = new javax.swing.JPanel();
  343.66 +        serviceJarLabel = new javax.swing.JLabel();
  343.67 +        serviceJarTf = new javax.swing.JTextField();
  343.68 +        copyJarCB = new javax.swing.JCheckBox();
  343.69 +        saveButton = new javax.swing.JButton();
  343.70 +        cancelButton = new javax.swing.JButton();
  343.71 +
  343.72 +        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  343.73 +        setTitle(org.openide.util.NbBundle.getMessage(PreferencesUI.class, "LBL_Preferences")); // NOI18N
  343.74 +
  343.75 +        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(PreferencesUI.class, "LBL_TTL_PREFERENCES"))); // NOI18N
  343.76 +
  343.77 +        serviceJarLabel.setText(org.openide.util.NbBundle.getMessage(PreferencesUI.class, "PreferencesUI.serviceJarLabel.text")); // NOI18N
  343.78 +
  343.79 +        copyJarCB.setText(org.openide.util.NbBundle.getMessage(PreferencesUI.class, "PreferencesUI.copyJarCB.text")); // NOI18N
  343.80 +
  343.81 +        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
  343.82 +        jPanel1.setLayout(jPanel1Layout);
  343.83 +        jPanel1Layout.setHorizontalGroup(
  343.84 +            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  343.85 +            .add(jPanel1Layout.createSequentialGroup()
  343.86 +                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  343.87 +                    .add(jPanel1Layout.createSequentialGroup()
  343.88 +                        .add(6, 6, 6)
  343.89 +                        .add(serviceJarLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  343.90 +                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  343.91 +                        .add(serviceJarTf, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE))
  343.92 +                    .add(jPanel1Layout.createSequentialGroup()
  343.93 +                        .add(copyJarCB, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  343.94 +                        .add(136, 136, 136)))
  343.95 +                .addContainerGap())
  343.96 +        );
  343.97 +        jPanel1Layout.setVerticalGroup(
  343.98 +            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  343.99 +            .add(jPanel1Layout.createSequentialGroup()
 343.100 +                .addContainerGap()
 343.101 +                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 343.102 +                    .add(serviceJarTf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
 343.103 +                    .add(serviceJarLabel))
 343.104 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
 343.105 +                .add(copyJarCB)
 343.106 +                .addContainerGap(32, Short.MAX_VALUE))
 343.107 +        );
 343.108 +
 343.109 +        saveButton.setText(org.openide.util.NbBundle.getMessage(PreferencesUI.class, "PreferencesUI.saveButton.text")); // NOI18N
 343.110 +        saveButton.addActionListener(new java.awt.event.ActionListener() {
 343.111 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
 343.112 +                saveButtonActionPerformed(evt);
 343.113 +            }
 343.114 +        });
 343.115 +
 343.116 +        cancelButton.setText(org.openide.util.NbBundle.getMessage(PreferencesUI.class, "PreferencesUI.cancelButton.text")); // NOI18N
 343.117 +        cancelButton.addActionListener(new java.awt.event.ActionListener() {
 343.118 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
 343.119 +                cancelButtonActionPerformed(evt);
 343.120 +            }
 343.121 +        });
 343.122 +
 343.123 +        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
 343.124 +        getContentPane().setLayout(layout);
 343.125 +        layout.setHorizontalGroup(
 343.126 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 343.127 +            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
 343.128 +                .addContainerGap()
 343.129 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
 343.130 +                    .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 343.131 +                    .add(layout.createSequentialGroup()
 343.132 +                        .add(233, 233, 233)
 343.133 +                        .add(saveButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE)
 343.134 +                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 343.135 +                        .add(cancelButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
 343.136 +                .addContainerGap())
 343.137 +        );
 343.138 +        layout.setVerticalGroup(
 343.139 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 343.140 +            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
 343.141 +                .addContainerGap()
 343.142 +                .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 343.143 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
 343.144 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 343.145 +                    .add(cancelButton)
 343.146 +                    .add(saveButton))
 343.147 +                .addContainerGap())
 343.148 +        );
 343.149 +
 343.150 +        pack();
 343.151 +    }// </editor-fold>//GEN-END:initComponents
 343.152 +
 343.153 +    private void initData(FileObject serviceXml) {
 343.154 +
 343.155 +        Project proj = FileOwnerQuery.getOwner(serviceXml);
 343.156 +        serviceProps = new File(FileUtil.toFile(serviceXml).getParent(),
 343.157 +                "." + serviceXml.getName() + ".properties");
 343.158 +
 343.159 +        if (serviceProps.exists()) {
 343.160 +            FileInputStream fin = null;
 343.161 +            try {
 343.162 +                fin = new FileInputStream(serviceProps);
 343.163 +
 343.164 +                props = new Properties();
 343.165 +                props.load(fin);
 343.166 +
 343.167 +                String sjn = props.getProperty(SERVICE_JAR_NAME);
 343.168 +                if (sjn == null || sjn.trim().length() == 0) {
 343.169 +                    serviceJarTf.setText(proj.getProjectDirectory().getName() + "-service.jar");
 343.170 +                } else {
 343.171 +                    serviceJarTf.setText(sjn);
 343.172 +                }
 343.173 +                
 343.174 +                boolean copyJarToServerCp = 
 343.175 +                        Boolean.parseBoolean(props.getProperty(COPY_JAR_TO_SERVERCLASSPATH));
 343.176 +                
 343.177 +                copyJarCB.setSelected(copyJarToServerCp);
 343.178 +                
 343.179 +            } catch (Exception ex) {
 343.180 +                ex.printStackTrace();
 343.181 +            } finally {
 343.182 +                try {
 343.183 +                    fin.close();
 343.184 +                } catch (Exception ex) {
 343.185 +                    ex.printStackTrace();
 343.186 +                }
 343.187 +            }
 343.188 +        } else {
 343.189 +            serviceJarTf.setText(proj.getProjectDirectory().getName() + "-service.jar");
 343.190 +        }
 343.191 +    }
 343.192 +    
 343.193 +private boolean validateFileName() {
 343.194 +    String sjn = serviceJarTf.getText();
 343.195 +    
 343.196 +    if(sjn == null || sjn.trim().length() == 0) {
 343.197 +        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(
 343.198 +                NbBundle.getMessage(PreferencesUI.class, "MSG_NOT_A_VALID_FILE_NAME"),
 343.199 +                    NotifyDescriptor.ERROR_MESSAGE));
 343.200 +        return false;
 343.201 +    }
 343.202 +    
 343.203 +    if(!sjn.endsWith(".jar") && !sjn.endsWith(".JAR")) {
 343.204 +        
 343.205 +        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(
 343.206 +                NbBundle.getMessage(PreferencesUI.class, "MSG_FILENAME_NOT_END_WITH_JAR"),
 343.207 +                    NotifyDescriptor.ERROR_MESSAGE));
 343.208 +        return false;
 343.209 +    }
 343.210 +    
 343.211 +    sjn = sjn.substring(0, sjn.lastIndexOf("."));
 343.212 +    if(!validateString(sjn,false)) {
 343.213 +        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(
 343.214 +                NbBundle.getMessage(PreferencesUI.class, "MSG_NOT_A_VALID_FILE_NAME") + ": " + sjn + ".jar",
 343.215 +                    NotifyDescriptor.ERROR_MESSAGE));
 343.216 +        return false;
 343.217 +    }
 343.218 +    
 343.219 +    return true;
 343.220 +}
 343.221 +
 343.222 +private boolean validateString(String value,boolean allowSpace) {
 343.223 +        if(value == null || value.trim().length() == 0){
 343.224 +            return false;
 343.225 +        }
 343.226 +        
 343.227 +        for(int i=0; i<value.length(); i++) {
 343.228 +            char c = value.charAt(i);
 343.229 +            
 343.230 +            if(!allowSpace && c == ' ')
 343.231 +                return false;
 343.232 +            if(!Character.isLetterOrDigit(c) && !(c == '_') && !(c == '-')){
 343.233 +                return false;
 343.234 +            }
 343.235 +        }
 343.236 +        return true;
 343.237 +    }
 343.238 +
 343.239 +private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
 343.240 +// TODO add your handling code here
 343.241 +   
 343.242 +    if(!validateFileName())
 343.243 +        return;
 343.244 +    if(props != null) {
 343.245 +
 343.246 +            FileOutputStream fout = null;
 343.247 +            try {
 343.248 +                String sjn = serviceJarTf.getText();
 343.249 +                props.setProperty(SERVICE_JAR_NAME, sjn);
 343.250 +                
 343.251 +                boolean isCopyToServerCp = copyJarCB.isSelected();
 343.252 +                if(isCopyToServerCp)
 343.253 +                    props.setProperty(COPY_JAR_TO_SERVERCLASSPATH,Boolean.toString(isCopyToServerCp));
 343.254 +                else
 343.255 +                    props.remove(COPY_JAR_TO_SERVERCLASSPATH);
 343.256 +                
 343.257 +                fout = new FileOutputStream(serviceProps);
 343.258 +                props.store(fout, sjn);
 343.259 +                fout.flush();
 343.260 +                
 343.261 +            } catch (Exception ex) {
 343.262 +                Exceptions.printStackTrace(ex);
 343.263 +            } finally {
 343.264 +                try {
 343.265 +                    fout.close();
 343.266 +                } catch (Exception ex) {
 343.267 +                    Exceptions.printStackTrace(ex);
 343.268 +                }
 343.269 +            }
 343.270 +    } else {
 343.271 +
 343.272 +            FileOutputStream fout = null;
 343.273 +            try {
 343.274 +                String sjn = serviceJarTf.getText();
 343.275 +                props = new Properties();
 343.276 +                props.setProperty(SERVICE_JAR_NAME, sjn);
 343.277 +                fout = new FileOutputStream(serviceProps);
 343.278 +                props.store(fout, sjn);
 343.279 +                fout.flush();
 343.280 +                
 343.281 +            } catch (Exception ex) {
 343.282 +                Exceptions.printStackTrace(ex);
 343.283 +            } finally {
 343.284 +                try {
 343.285 +                    fout.close();
 343.286 +                } catch (IOException ex) {
 343.287 +                    Exceptions.printStackTrace(ex);
 343.288 +                }
 343.289 +            }
 343.290 +    }
 343.291 +    
 343.292 +    dispose();
 343.293 +}//GEN-LAST:event_saveButtonActionPerformed
 343.294 +
 343.295 +private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
 343.296 +// TODO add your handling code here:
 343.297 +    dispose();
 343.298 +}//GEN-LAST:event_cancelButtonActionPerformed
 343.299 +
 343.300 +    /**
 343.301 +    * @param args the command line arguments
 343.302 +    */
 343.303 +    public static void main(String args[]) {
 343.304 +      
 343.305 +    }
 343.306 +
 343.307 +    // Variables declaration - do not modify//GEN-BEGIN:variables
 343.308 +    private javax.swing.JButton cancelButton;
 343.309 +    private javax.swing.JCheckBox copyJarCB;
 343.310 +    private javax.swing.JPanel jPanel1;
 343.311 +    private javax.swing.JButton saveButton;
 343.312 +    private javax.swing.JLabel serviceJarLabel;
 343.313 +    private javax.swing.JTextField serviceJarTf;
 343.314 +    // End of variables declaration//GEN-END:variables
 343.315 +
 343.316 +}
   344.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/widgets/TableWidget.java	Fri Jun 10 09:46:37 2011 +0200
   344.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/design/view/widgets/TableWidget.java	Sun Jun 26 10:25:14 2011 +0800
   344.3 @@ -307,7 +307,6 @@
   344.4              super.notifyRemoved();
   344.5              if(userObject instanceof Entity) {
   344.6                  Entity e = (Entity)userObject;
   344.7 -                System.out.println("Removed Entity --------------------------- "+e+"  "+e.getName());
   344.8              }
   344.9              if(getScene() instanceof ObjectScene && userObject!=null) {
  344.10                  ObjectScene scene =(ObjectScene) getScene();
   345.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/helper/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   345.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/helper/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   345.3 @@ -40,5 +40,5 @@
   345.4  #
   345.5  
   345.6  MSG_MODIFIED_OUTSIDE=Save failed !!!\nThe file has been modified outside of the design editor.\nPlease save the last change and try again.
   345.7 -MSG_NO_RUNTIME=Please select target runtime as WebSynergy/Liferay Portal Server
   345.8 +MSG_NO_RUNTIME=Please select target runtime as Sun Glassfish Web Space (Project WebSynergy)/Liferay Portal Server
   345.9  MSG_NOT_A_WEB_PROJECT=Generate Service option works only for a Web Project.
  345.10 \ No newline at end of file
   346.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/helper/GenerateServiceHelper.java	Fri Jun 10 09:46:37 2011 +0200
   346.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/helper/GenerateServiceHelper.java	Sun Jun 26 10:25:14 2011 +0800
   346.3 @@ -40,14 +40,13 @@
   346.4  
   346.5  import java.awt.event.ActionEvent;
   346.6  import java.io.File;
   346.7 +import java.io.FileInputStream;
   346.8  import java.io.FileNotFoundException;
   346.9  import java.io.FileOutputStream;
  346.10 -import java.io.FilenameFilter;
  346.11  import java.io.IOException;
  346.12  import java.io.InputStream;
  346.13  import java.io.OutputStream;
  346.14  import java.net.URL;
  346.15 -import java.util.ArrayList;
  346.16  import java.util.List;
  346.17  import java.util.Properties;
  346.18  import java.util.logging.Level;
  346.19 @@ -64,8 +63,11 @@
  346.20  import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
  346.21  import org.netbeans.modules.portalpack.commons.LibraryHelper;
  346.22  import org.netbeans.modules.portalpack.servers.core.common.ServerConstants;
  346.23 -import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.tomcat.TomcatConstant;
  346.24 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibraries;
  346.25 +import org.netbeans.modules.portalpack.servers.core.impl.j2eeservers.api.JEEServerLibrariesFactory;
  346.26  import org.netbeans.modules.portalpack.servers.core.util.PSConfigObject;
  346.27 +import org.netbeans.modules.portalpack.servers.websynergy.common.LiferayConstants;
  346.28 +import org.netbeans.modules.portalpack.servers.websynergy.common.WSConstants;
  346.29  import org.netbeans.modules.portalpack.websynergy.servicebuilder.LibrariesHelper;
  346.30  import org.netbeans.modules.portalpack.websynergy.servicebuilder.ServiceBuilderConstant;
  346.31  import org.netbeans.modules.web.api.webmodule.WebModule;
  346.32 @@ -73,7 +75,6 @@
  346.33  import org.openide.NotifyDescriptor;
  346.34  import org.openide.execution.ExecutorTask;
  346.35  import org.openide.filesystems.FileObject;
  346.36 -import org.openide.filesystems.FileStateInvalidException;
  346.37  import org.openide.filesystems.FileUtil;
  346.38  import org.openide.util.Exceptions;
  346.39  import org.openide.util.NbBundle;
  346.40 @@ -88,8 +89,6 @@
  346.41  
  346.42      private static Logger logger = Logger.getLogger(ServiceBuilderConstant.LOGGER_NAME);
  346.43      private static String BUILD_FILE_NAME = "build-service.xml";
  346.44 -    private static String LR_PREFIX = "liferay";
  346.45 -    private static String WS_PREFIX = "websynergy";
  346.46     // private static String SB_DIR = System.getProperty("netbeans.user") + File.separator + "servicebuilder";
  346.47      private static GenerateServiceHelper instance;
  346.48  
  346.49 @@ -182,7 +181,7 @@
  346.50          }
  346.51  
  346.52          final Properties props = getServerAntProperties(psconfig);
  346.53 -        setAdditionalProperties(project, props);
  346.54 +        setAdditionalProperties(project, serviceXml, props);
  346.55          props.setProperty("input.file", FileUtil.toFile(serviceXml).getAbsolutePath());
  346.56          String srcDir = getSourceDir(project);
  346.57          if (srcDir != null) {
  346.58 @@ -209,20 +208,34 @@
  346.59                               
  346.60                               FileObject fileObj = project.getProjectDirectory();
  346.61                               FileObject lib = fileObj.getFileObject("service/classes");
  346.62 -                             /*if(lib != null) {
  346.63 -                                 FileObject[] children = lib.getChildren();
  346.64 -                                 List list = new ArrayList();
  346.65 -                                 for(FileObject c:children) {
  346.66 -                                    try {
  346.67 -                                        list.add(c.getURL());
  346.68 -                                    } catch (FileStateInvalidException ex) {
  346.69 -                                        ex.printStackTrace();
  346.70 -                                    }
  346.71 -                                 }*/
  346.72                                   
  346.73                              try {
  346.74 +                                //for classpath resolution
  346.75                                  URL url = lib.getURL();
  346.76                                  LibraryHelper.addCompileRoot(project,new URL[]{url});
  346.77 +                                
  346.78 +                                //copy jars to project's web-inf/lib
  346.79 +                                FileObject libDir = fileObj.getFileObject("service/lib/");
  346.80 +                                
  346.81 +                                boolean isCopyToServerClasspath =
  346.82 +                                        Boolean.parseBoolean(props.getProperty("copy.jar.to.global.cp"));
  346.83 +                                if(isCopyToServerClasspath) {
  346.84 +                                    LibraryHelper.removePackageRoot(project,new URL[]{libDir.getURL()}, "WEB-INF/lib");
  346.85 +                                } else {
  346.86 +                                    LibraryHelper.addPackageRoot(project,new URL[]{libDir.getURL()}, "WEB-INF/lib");
  346.87 +                                }
  346.88 +                                
  346.89 +								try{
  346.90 +                                                                        FileObject srcFO = getSourceRoot(project);
  346.91 +									//refresh project folder
  346.92 +									FileUtil.refreshFor(FileUtil.toFile(fileObj));
  346.93 +                                                                        //fileObj.getFileSystem().refresh(true);
  346.94 +                                                                        if(srcFO != null) {
  346.95 +                                                                           srcFO.getFileSystem().refresh(true);                            
  346.96 +                                                                        }
  346.97 +
  346.98 +								}catch(Exception e){}
  346.99 +                                
 346.100                              } catch (Exception ex) {
 346.101                                  ex.printStackTrace();
 346.102                                  NotifyDescriptor nd = new NotifyDescriptor.Message("Classpath could not be modified.\n" +
 346.103 @@ -250,70 +263,92 @@
 346.104          return true;
 346.105  
 346.106      }
 346.107 +    
 346.108 +    public static boolean cleanService(FileObject serviceXml) {
 346.109 +        
 346.110 +        final Project project = getProject(serviceXml);
 346.111 +        final WebModule wm = getWebModule(project);
 346.112 +        
 346.113 +        if(wm == null) {
 346.114 +            NotifyDescriptor nd = new NotifyDescriptor.Message(NbBundle.getMessage(GenerateServiceHelper.class,"MSG_NOT_A_WEB_PROJECT"),NotifyDescriptor.ERROR_MESSAGE);
 346.115 +            DialogDisplayer.getDefault().notify(nd);
 346.116 +            return false;
 346.117 +        }
 346.118 +
 346.119 +        final Properties props = new Properties();
 346.120 +        setAdditionalProperties(project, serviceXml, props);
 346.121 +        props.setProperty("input.file", FileUtil.toFile(serviceXml).getAbsolutePath());
 346.122 +        String srcDir = getSourceDir(project);
 346.123 +        if (srcDir != null) {
 346.124 +            props.setProperty("src.dir", srcDir);
 346.125 +        } else {
 346.126 +            props.setProperty("src.dir", props.getProperty("docroot"));
 346.127 +        }
 346.128 +
 346.129 +        File serviceFile = new File(System.getProperty("netbeans.user") + File.separator + "servicebuilder" + File.separator + BUILD_FILE_NAME);
 346.130 +        final FileObject serviceFileObj = FileUtil.toFileObject(serviceFile);
 346.131 +
 346.132 +        SwingUtilities.invokeLater(new Runnable() {
 346.133 +
 346.134 +            public void run() {
 346.135 +                try {
 346.136 +                    
 346.137 +                    ExecutorTask task = ActionUtils.runTarget(serviceFileObj, new String[]{"clean-service"}, props);
 346.138 +                    task.addTaskListener(new TaskListener() {
 346.139 +
 346.140 +                        public void taskFinished(Task task) {
 346.141 +                            
 346.142 +                        }
 346.143 +                    });
 346.144 +
 346.145 +                } catch (IOException ex) {
 346.146 +                    Exceptions.printStackTrace(ex);
 346.147 +                } catch (IllegalArgumentException ex) {
 346.148 +                    Exceptions.printStackTrace(ex);
 346.149 +                }
 346.150 +            }
 346.151 +        });
 346.152 +
 346.153 +        return true;
 346.154 +    }
 346.155  
 346.156      private static Properties getServerAntProperties(PSConfigObject psConfig) {
 346.157  
 346.158          Properties props = new Properties();
 346.159          String deployDir = null;
 346.160 -        if (psConfig.getServerType().equals(ServerConstants.SUN_APP_SERVER_9)) {
 346.161 -            String domainDir = psConfig.getDomainDir();
 346.162 -
 346.163 -            props.setProperty("app.server.dir", domainDir);
 346.164 -            props.setProperty("app.server.lib.global.dir", domainDir + File.separator + "lib");
 346.165 -            //check for glassfish V2
 346.166 -            File wsDeployLoc = new File(domainDir + File.separator +
 346.167 -                    "applications" + File.separator +
 346.168 -                    "j2ee-modules" + File.separator +
 346.169 -                    "websynergy");
 346.170 -            File lrDeployLoc = new File(domainDir + File.separator +
 346.171 -                    "applications" + File.separator +
 346.172 -                    "j2ee-modules" + File.separator +
 346.173 -                    "liferay-portal");
 346.174 -
 346.175 -            if (wsDeployLoc.exists()) {
 346.176 -                deployDir = wsDeployLoc.getAbsolutePath();
 346.177 -
 346.178 -            } else if (lrDeployLoc.exists()) {
 346.179 -                deployDir = lrDeployLoc.getAbsolutePath();
 346.180 -
 346.181 -            } else {
 346.182 -
 346.183 -                //check for glassfish V3
 346.184 -                wsDeployLoc = new File(domainDir + File.separator + "applications" + File.separator + "websynergy");
 346.185 -                lrDeployLoc = new File(domainDir + File.separator + "applications" + File.separator + "liferay-portal");
 346.186 -                if (wsDeployLoc.exists()) {
 346.187 -                    deployDir = wsDeployLoc.getAbsolutePath();
 346.188 -
 346.189 -                } else if (lrDeployLoc.exists()) {
 346.190 -                    deployDir = lrDeployLoc.getAbsolutePath();
 346.191 -                }
 346.192 -            }
 346.193 -
 346.194 -        } else if (psConfig.getServerType().equals(ServerConstants.TOMCAT_5_X)) {
 346.195 -
 346.196 -            String tomcatHome = psConfig.getProperty(TomcatConstant.CATALINA_HOME);
 346.197 -
 346.198 -            props.setProperty("app.server.dir", tomcatHome);
 346.199 -
 346.200 -            File deployLoc = new File(tomcatHome + File.separator + "webapps" + File.separator + "ROOT");
 346.201 -            if (deployLoc.exists()) {
 346.202 -                deployDir = deployLoc.getAbsolutePath();
 346.203 -
 346.204 -                props.setProperty("app.server.lib.global.dir", tomcatHome + File.separator + "common" + File.separator + "lib" + File.separator + "ext");
 346.205 -            }
 346.206 -        } else if (psConfig.getServerType().equals(ServerConstants.TOMCAT_6_X)) {
 346.207 -
 346.208 -            String tomcatHome = psConfig.getProperty(TomcatConstant.CATALINA_HOME);
 346.209 -
 346.210 -            props.setProperty("app.server.dir", tomcatHome);
 346.211 -
 346.212 -            File deployLoc = new File(tomcatHome + File.separator + "webapps" + File.separator + "ROOT");
 346.213 -            if (deployLoc.exists()) {
 346.214 -                deployDir = deployLoc.getAbsolutePath();
 346.215 -
 346.216 -                props.setProperty("app.server.lib.global.dir", tomcatHome + File.separator + "lib" + File.separator + "ext");
 346.217 -            }
 346.218 -        }
 346.219 +        
 346.220 +        JEEServerLibraries jeeServerLibraries = JEEServerLibrariesFactory.
 346.221 +                                                    getJEEServerLibraries(psConfig.getServerType());
 346.222 +        
 346.223 +        props.setProperty("app.server.lib.global.dir", jeeServerLibraries.getPortalServerLibraryLocation(psConfig));
 346.224 +        deployDir = psConfig.getProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR);
 346.225 +//
 346.226 +//        if (psConfig.getServerType().equals(ServerConstants.SUN_APP_SERVER_9)) {
 346.227 +//            String domainDir = psConfig.getDomainDir();
 346.228 +//
 346.229 +//            props.setProperty("app.server.dir", domainDir);
 346.230 +//
 346.231 +//            deployDir = psConfig.getProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR);
 346.232 +//
 346.233 +//        } else if (psConfig.getServerType().equals(ServerConstants.TOMCAT_5_X)
 346.234 +//                        || psConfig.getServerType().equals(ServerConstants.TOMCAT_6_X)) {
 346.235 +//
 346.236 +//            String tomcatHome = psConfig.getProperty(TomcatConstant.CATALINA_HOME);
 346.237 +//
 346.238 +//            props.setProperty("app.server.dir", tomcatHome);
 346.239 +//
 346.240 +//            File deployLoc = new File(jeeServerLibraries.getWebAppInstallDirectory(psConfig) + File.separator + "ROOT");
 346.241 +//            if (deployLoc.exists()) {
 346.242 +//                deployDir = deployLoc.getAbsolutePath();
 346.243 +//
 346.244 +//            }
 346.245 +//        } else if(psConfig.getServerType().equals(ServerConstants.JBOSS_5_X)) {
 346.246 +//			String serverInstanceDir = psConfig.getProperty(JBConstant.SERVER_DIR);
 346.247 +//
 346.248 +//            props.setProperty("app.server.dir", serverInstanceDir);
 346.249 +//			deployDir = psConfig.getProperty(LiferayConstants.LR_PORTAL_DEPLOY_DIR);
 346.250 +//
 346.251 +//		}
 346.252  
 346.253          if (deployDir != null || deployDir.trim().length() != 0) {
 346.254  
 346.255 @@ -327,88 +362,42 @@
 346.256  
 346.257      private static void getJavaEEJar(PSConfigObject psConfig, Properties props) {
 346.258          StringBuffer sb = new StringBuffer();
 346.259 -        if (psConfig.getServerType().equals(ServerConstants.SUN_APP_SERVER_9)) {
 346.260 -            String glassFishHome = psConfig.getServerHome();
 346.261 -            File servletAPI = new File(glassFishHome + File.separator + "lib" + File.separator + "javaee.jar");
 346.262 -            if (servletAPI.exists()) {
 346.263 -                //Glassfish V2
 346.264 -                sb.append(servletAPI.getAbsoluteFile());
 346.265 -                sb.append(":");
 346.266 -                
 346.267 -                String activationJar = glassFishHome + File.separator + "lib" + File.separator + "activation.jar";
 346.268 -                sb.append(activationJar);
 346.269 -                sb.append(":");
 346.270 -                
 346.271 -                //props.setProperty("servlet.jar.path", servletAPI.getAbsolutePath());
 346.272 -            } else {
 346.273 -                //check for V3
 346.274 -                File modulesFolder = new File(glassFishHome + File.separator + "modules");
 346.275 -                File[] files = modulesFolder.listFiles(new FilenameFilter() {
 346.276 -
 346.277 -                    public boolean accept(File dir, String name) {
 346.278 -
 346.279 -                        if (name.startsWith("javax.")) {
 346.280 -                            return true;
 346.281 -                        }
 346.282 -                        return false;
 346.283 -                    }
 346.284 -                });
 346.285 -
 346.286 -                if (files != null && files.length != 0) {
 346.287 -                    for(File f:files) {
 346.288 -                        sb.append(f.getAbsolutePath());
 346.289 -                        sb.append(":");
 346.290 -                    }
 346.291 -                   // props.setProperty("servlet.jar.path", files[0].getAbsolutePath());
 346.292 -                }
 346.293 -            }
 346.294 +        
 346.295 +        JEEServerLibraries jeeServerLibraries =
 346.296 +                JEEServerLibrariesFactory.getJEEServerLibraries(psConfig.getServerType());
 346.297 +        
 346.298 +        if(jeeServerLibraries == null)
 346.299 +            return;
 346.300 +        
 346.301 +        List<File> jeeJars = jeeServerLibraries.getJEEServerLibraries(psConfig);
 346.302 +            
 346.303 +        for(File f:jeeJars) {
 346.304 +            sb.append(f.getAbsolutePath());
 346.305 +            sb.append(":");
 346.306 +        }
 346.307 +        
 346.308 +        if (psConfig.getServerType().equals(ServerConstants.SUN_APP_SERVER_9)) {     
 346.309 +            
 346.310 +            String appserverLibLocation = jeeServerLibraries.getAppServerLibraryLocation(psConfig);
 346.311 +            sb.append(appserverLibLocation + File.separator + "activation.jar");
 346.312 +            sb.append(":");
 346.313 +            
 346.314          } else if(psConfig.getServerType().equals(ServerConstants.TOMCAT_5_X)
 346.315                       || psConfig.getServerType().equals(ServerConstants.TOMCAT_6_X)) {
 346.316              
 346.317 -            String tomcatHome = psConfig.getProperty(TomcatConstant.CATALINA_HOME);
 346.318 -            
 346.319 -            File libDir =  null;
 346.320 -            
 346.321 -            if(psConfig.getServerType().equals(ServerConstants.TOMCAT_5_X)) {
 346.322 -                    
 346.323 -                libDir = new File(tomcatHome + File.separator + "common" 
 346.324 -                                                  + File.separator + "lib");
 346.325 -            } else if(psConfig.getServerType().equals(ServerConstants.TOMCAT_6_X)){
 346.326 -                
 346.327 -                libDir = new File(tomcatHome + File.separator + "lib"); 
 346.328 +            File mailJar = new File(jeeServerLibraries.getPortalServerLibraryLocation(psConfig) +
 346.329 +                            File.separator + "mail.jar");
 346.330 +            if(mailJar.exists()) {
 346.331 +                sb.append(mailJar.getAbsolutePath());
 346.332 +                sb.append(":");
 346.333              }
 346.334 -            
 346.335 -            if(!libDir.exists()) {
 346.336 -                libDir = new File(tomcatHome + File.separator + "lib"); 
 346.337 -            }
 346.338 -            
 346.339 -            if(libDir.exists()) {
 346.340 -                //tomcat 5.x
 346.341 -                File servletApi = new File(libDir,"servlet-api.jar");
 346.342 -                if(servletApi.exists()) {
 346.343 -                    sb.append(servletApi.getAbsolutePath());
 346.344 -                    sb.append(":");
 346.345 -                }
 346.346 -                
 346.347 -                File jspApi = new File(libDir,"jsp-api.jar");
 346.348 -                if(jspApi.exists()) {
 346.349 -                    sb.append(jspApi.getAbsolutePath());
 346.350 -                    sb.append(":");
 346.351 -                }
 346.352 -                
 346.353 -                File mailJar = new File(libDir,"ext" + File.separator + "mail.jar");
 346.354 -                if(mailJar.exists()) {
 346.355 -                    sb.append(mailJar.getAbsolutePath());
 346.356 -                    sb.append(":");
 346.357 -                }
 346.358 -            }
 346.359 -            
 346.360          }
 346.361          
 346.362          props.setProperty("javaee.jars.classpath", sb.toString());
 346.363      }
 346.364  
 346.365 -    private static void setAdditionalProperties(Project project, Properties props) {
 346.366 +    private static void setAdditionalProperties(Project project,
 346.367 +                                FileObject serviceXml, Properties props) {
 346.368  
 346.369          props.setProperty("lib.dir", LibrariesHelper.SERVICE_BUILDER_LIB_DIR);
 346.370          props.setProperty("project.dir", FileUtil.toFile(project.getProjectDirectory()).getAbsolutePath());
 346.371 @@ -418,9 +407,39 @@
 346.372          if (wm == null) {
 346.373              return;
 346.374          }
 346.375 -        props.setProperty("docroot", FileUtil.toFile(wm.getDocumentBase()).getAbsolutePath());
 346.376 +        props.setProperty("docroot",
 346.377 +                FileUtil.toFile(wm.getDocumentBase()).getAbsolutePath());
 346.378 +        props.setProperty("web.inf.dir",
 346.379 +                FileUtil.toFile(wm.getWebInf()).getAbsolutePath());
 346.380 +        
 346.381 +        File serviceProps = new File(FileUtil.toFile(serviceXml).getParent(),
 346.382 +                "."+serviceXml.getName()+".properties");
 346.383 +        if(serviceProps.exists()) {
 346.384 +            props.setProperty("service.property.file", serviceProps.getAbsolutePath());
 346.385 +            
 346.386 +            boolean isCopy = getIsCopyToServerClasspathProperty(serviceProps);
 346.387 +            if(isCopy)
 346.388 +                props.setProperty("copy.jar.to.global.cp", Boolean.toString(isCopy));
 346.389 +       
 346.390 +        } else {
 346.391 +            props.setProperty("service.jar.name", props.getProperty("project.name")+"-service.jar");
 346.392 +        }
 346.393  
 346.394      }
 346.395 +    
 346.396 +    private static boolean getIsCopyToServerClasspathProperty(File serviceProps) {
 346.397 +         FileInputStream fin = null;
 346.398 +         
 346.399 +            try {
 346.400 +                fin = new FileInputStream(serviceProps);
 346.401 +
 346.402 +                Properties props = new Properties();
 346.403 +                props.load(fin);
 346.404 +                return Boolean.parseBoolean(props.getProperty("copy.jar.to.serverclasspath"));
 346.405 +            } catch (Exception e) {
 346.406 +                return false;
 346.407 +            }
 346.408 +    }
 346.409  
 346.410      private static PSConfigObject getSelectedServerProperties(Project prj) {
 346.411  
 346.412 @@ -432,8 +451,8 @@
 346.413  
 346.414          String serverID = jmp.getServerInstanceID();
 346.415  
 346.416 -        if (serverID == null || (!serverID.startsWith(LR_PREFIX)
 346.417 -                             && !serverID.startsWith(WS_PREFIX))) {
 346.418 +        if (serverID == null || (!serverID.startsWith(LiferayConstants.LR_PREFIX)
 346.419 +                             && !serverID.startsWith(WSConstants.WS_PREFIX))) {
 346.420              return null;
 346.421          }
 346.422          PSConfigObject pc = PSConfigObject.getPSConfigObject(serverID);
 346.423 @@ -465,17 +484,34 @@
 346.424      }
 346.425  
 346.426      private static String getSourceDir(Project project) {
 346.427 -        Sources sources = ProjectUtils.getSources(project);
 346.428 -        SourceGroup[] groups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
 346.429 +        FileObject rootFolder = getSourceRoot(project);
 346.430 +        if(rootFolder == null) 
 346.431 +            return null;
 346.432 +        
 346.433 +        File file = FileUtil.toFile(rootFolder);
 346.434 +        return file.getAbsolutePath();
 346.435 +    }
 346.436 +    
 346.437 +    /**
 346.438 +     * Convenience method to obtain the source root folder.
 346.439 +     * @param project the Project object
 346.440 +     * @return the FileObject of the source root folder
 346.441 +     */
 346.442 +    private static FileObject getSourceRoot(Project project) {
 346.443 +        if (project == null) {
 346.444 +            return null;
 346.445 +        }
 346.446 +        Sources src = (Sources)project.getLookup().lookup(Sources.class);
 346.447 +        
 346.448 +        SourceGroup[] grp = src.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
 346.449 +        for (int i = 0; i < grp.length; i++) {
 346.450 +            if ("${src.dir}".equals(grp[i].getName())) { // NOI18N
 346.451  
 346.452 -        if (groups != null && groups.length != 0) {
 346.453 -
 346.454 -            FileObject rootFolder = groups[0].getRootFolder();
 346.455 -            if (rootFolder == null) {
 346.456 -                return null;
 346.457 +                return grp[i].getRootFolder();
 346.458              }
 346.459 -            File file = FileUtil.toFile(rootFolder);
 346.460 -            return file.getAbsolutePath();
 346.461 +        }
 346.462 +        if (grp.length != 0) {
 346.463 +            return grp[0].getRootFolder();
 346.464          }
 346.465  
 346.466          return null;
   347.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/Bundle.properties	Fri Jun 10 09:46:37 2011 +0200
   347.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/Bundle.properties	Sun Jun 26 10:25:14 2011 +0800
   347.3 @@ -1,8 +1,8 @@
   347.4  OpenIDE-Module-Display-Category=PortalPack
   347.5  OpenIDE-Module-Long-Description=\
   347.6 -    This module provides tooling for Liferay/WebSynergy Service Builder.
   347.7 -OpenIDE-Module-Name=WebSynergy Service Builder
   347.8 -OpenIDE-Module-Short-Description=WebSynergy Service Builder
   347.9 +    This module provides tooling for Liferay/WebSpace Service Builder.
  347.10 +OpenIDE-Module-Name=WebSpace Service Builder
  347.11 +OpenIDE-Module-Short-Description=WebSpace Service Builder
  347.12  
  347.13  Services/MIMEResolver/ServiceBuilderResolver.xml=ServiceBuilder File
  347.14  Templates/WebSynergyPortlets/service.xml=Service Builder XML
   348.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/ServiceBuilderTemplate.xml	Fri Jun 10 09:46:37 2011 +0200
   348.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/ServiceBuilderTemplate.xml	Sun Jun 26 10:25:14 2011 +0800
   348.3 @@ -1,5 +1,5 @@
   348.4  <?xml version="1.0"?>
   348.5 -<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 5.1.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_5_1_0.dtd">
   348.6 -<service-builder package-path="com.liferay.service">
   348.7 +<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.0.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd">
   348.8 +<service-builder package-path="com.example.service">
   348.9      <namespace>sample</namespace>
  348.10  </service-builder>
  348.11 \ No newline at end of file
   349.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   349.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/ServiceDescription.html	Sun Jun 26 10:25:14 2011 +0800
   349.3 @@ -0,0 +1,14 @@
   349.4 +<!-- 
   349.5 +    Document   : Service XML
   349.6 +    Created on : Nov 13, 2008, 8:44:51 PM
   349.7 +    Author     : Chetan
   349.8 +-->
   349.9 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  349.10 +<html>
  349.11 +  <body>
  349.12 +         Creates a WebSpace/Liferay Service XML - User can define services in 
  349.13 +         this XML and can generate source code required to run those services 
  349.14 +         which can be deployed on Sun Glassfish Web Space Server, 
  349.15 +         Liferay Portal Server.
  349.16 +  </body>
  349.17 +</html> 
   350.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/build-service.xml	Fri Jun 10 09:46:37 2011 +0200
   350.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/build-service.xml	Sun Jun 26 10:25:14 2011 +0800
   350.3 @@ -1,6 +1,8 @@
   350.4  <?xml version="1.0"?>
   350.5  
   350.6  <project name="build-service">
   350.7 +        <property file="${service.property.file}"/>
   350.8 +        <echo message="${service.property.file}"/>
   350.9  	<property environment="env" />
  350.10  		<!-- property name="project.dir" value="../"/-->
  350.11  		<!-- property name="plugin.name" value="custom"/ -->
  350.12 @@ -33,23 +35,26 @@
  350.13  		</path>
  350.14  
  350.15          <target name="build-service">
  350.16 -		<mkdir dir="${docroot}/WEB-INF/classes" />
  350.17 +		<!--mkdir dir="${docroot}/WEB-INF/classes" / -->
  350.18 +                <!--mkdir dir="${web.inf.dir}/classes"/-->
  350.19  		<mkdir dir="${project.dir}/service" />
  350.20                  <mkdir dir="${project.dir}/service/src" />
  350.21                  <mkdir dir="${project.dir}/service/lib" />
  350.22 -		<mkdir dir="${docroot}/WEB-INF/sql" />
  350.23 -		<!--mkdir dir="${src.dir}/WEB-INF/src" /-->
  350.24 -
  350.25 -		<copy todir="${docroot}/WEB-INF/classes">
  350.26 +                <mkdir dir="${web.inf.dir}/sql"/>
  350.27 +		<!--mkdir dir="${docroot}/WEB-INF/sql" /-->
  350.28 +		
  350.29 +		<!--copy todir="${docroot}/WEB-INF/classes"-->
  350.30 +                <!--commented copy todir="${web.inf.dir}/classes">    
  350.31  			<fileset dir="${src.dir}" excludes="**/*.java" />
  350.32 -		</copy>
  350.33 +		</copy-->
  350.34  
  350.35  		<path id="service.classpath">
  350.36  			<path refid="lib.classpath" />
  350.37  			<path refid="portal.classpath" />
  350.38  			<!--fileset dir="${docroot}/WEB-INF/lib" includes="*.jar" /-->
  350.39                          <fileset dir="${project.dir}/service/lib" includes="*.jar" />
  350.40 -			<pathelement location="${docroot}/WEB-INF/classes" />
  350.41 +                        <!--pathelement location="${docroot}/WEB-INF/classes" /-->
  350.42 +			<pathelement location="${web.inf.dir}/classes" />
  350.43  			
  350.44  			<pathelement location="${app.server.classes.portal.dir}" />
  350.45  			<fileset dir="${app.server.lib.global.dir}" includes="*.jar" />
  350.46 @@ -58,7 +63,7 @@
  350.47                          <pathelement path="${javaee.jars.classpath}"/>
  350.48  		</path>
  350.49  		
  350.50 -		<echo message="${app.server.lib.portal.dir}-------------------------------"/>
  350.51 +		<echo message="${app.server.lib.portal.dir}"/>
  350.52  
  350.53  		<java
  350.54  			classname="com.liferay.portal.tools.servicebuilder.ServiceBuilder"
  350.55 @@ -71,17 +76,21 @@
  350.56  			<jvmarg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger" />
  350.57  			<jvmarg value="-Dservice.input.file=${input.file}" />
  350.58  			<jvmarg value="-Dservice.hbm.file=${src.dir}/META-INF/portlet-hbm.xml" />
  350.59 +			<jvmarg value="-Dservice.orm.file=${src.dir}/META-INF/portlet-orm.xml" />
  350.60  			<jvmarg value="-Dservice.model.hints.file=${src.dir}/META-INF/portlet-model-hints.xml" />
  350.61  			<jvmarg value="-Dservice.spring.file=${src.dir}/META-INF/portlet-spring.xml" />
  350.62                          <jvmarg value="-Dservice.spring.data.source.file=${src.dir}/META-INF/data-source-spring.xml" />
  350.63 +                        <jvmarg value="-Dservice.spring.dynamic.data.source.file=${src.dir}/META-INF/dynamic-data-source-spring.xml" />
  350.64                          <jvmarg value="-Dservice.spring.misc.file=${src.dir}/META-INF/misc-spring.xml" />
  350.65  			<jvmarg value="-Dservice.spring.base.file=${src.dir}/META-INF/base-spring.xml" />
  350.66  			<jvmarg value="-Dservice.spring.hibernate.file=${src.dir}/META-INF/hibernate-spring.xml" />
  350.67  			<jvmarg value="-Dservice.spring.infrastructure.file=${src.dir}/META-INF/infrastructure-spring.xml" />
  350.68  			<jvmarg value="-Dservice.api.dir=${project.dir}/service/src" />
  350.69  			<jvmarg value="-Dservice.impl.dir=${src.dir}" />
  350.70 +			<jvmarg value="-Dservice.json.file=${src.dir}/META-INF/service.js" />
  350.71  			<!--<jvmarg value="-Dservice.json.file=${docroot}/js/service_unpacked.js" />-->
  350.72 -			<jvmarg value="-Dservice.sql.dir=${docroot}/WEB-INF/sql" />
  350.73 +			<!--jvmarg value="-Dservice.sql.dir=${docroot}/WEB-INF/sql" /-->
  350.74 +                        <jvmarg value="-Dservice.sql.dir=${web.inf.dir}/sql" />
  350.75  			<jvmarg value="-Dservice.sql.file=tables.sql" />
  350.76  			<jvmarg value="-Dservice.sql.indexes.file=indexes.sql" />
  350.77  			<jvmarg value="-Dservice.sql.indexes.properties.file=indexes.properties" />
  350.78 @@ -102,12 +111,12 @@
  350.79  		<mkdir dir="${project.dir}/service/classes" />
  350.80                  <delete file="${project.dir}/service/classes/*.*"/>
  350.81  
  350.82 -		<delete file="${project.dir}/service/lib/${project.name}-service.jar" />
  350.83 +		<delete file="${project.dir}/service/lib/${service.jar.name}" />
  350.84  
  350.85  		<path id="service.classpath">
  350.86  			<fileset dir="${app.server.lib.global.dir}" includes="*.jar" />
  350.87  			<fileset dir="${app.server.lib.portal.dir}" includes="*.jar" />
  350.88 -			<fileset dir="${project.dir}/service/lib" excludes="${project.name}-service.jar" includes="*.jar" />
  350.89 +			<fileset dir="${project.dir}/service/lib" excludes="${service.jar.name}" includes="*.jar" />
  350.90  		</path>
  350.91  		
  350.92  		<javac
  350.93 @@ -117,108 +126,35 @@
  350.94  			destdir="${project.dir}/service/classes"
  350.95  			nowarn="${javac.nowarn}"
  350.96  			srcdir="${project.dir}/service/src"
  350.97 +                        source="1.5"
  350.98 +                        target="1.5"
  350.99  		/>
 350.100  
 350.101  		<zip
 350.102  			basedir="${project.dir}/service/classes"
 350.103 -			destfile="${project.dir}/service/lib/${project.name}-service.jar"
 350.104 +			destfile="${project.dir}/service/lib/${service.jar.name}"
 350.105  		/>
 350.106 -                
 350.107 -                <copy todir="${app.server.lib.global.dir}" file="${project.dir}/service/lib/${project.name}-service.jar"/>
 350.108 -                <echo message="Service api jar copied to server classpath. Please restart the server."/>
 350.109 +             
 350.110 +                <antcall target="copy-jar"/>
 350.111 +                <echo message="Incase the generated source files are not visible under 'Source Packages' node, then reopen the project again to see the generated files under 'Source Packages'."/>
 350.112 +                <!-- copy todir="${app.server.lib.global.dir}" file="${project.dir}/service/lib/${project.name}-service.jar"/ -->
 350.113 +                <!--echo message="Service api jar copied to server classpath. Please restart the server."/-->
 350.114  
 350.115  		<!-- delete dir="${project.dir}/service-classes" / -->
 350.116  	</target>
 350.117 -
 350.118 -
 350.119 -	<target name="build-my-service">
 350.120 -		<mkdir dir="${docroot}/WEB-INF/classes" />
 350.121 -		<mkdir dir="${docroot}/WEB-INF/lib" />
 350.122 -		<mkdir dir="${docroot}/WEB-INF/service" />
 350.123 -		<mkdir dir="${docroot}/WEB-INF/sql" />
 350.124 -		<mkdir dir="${docroot}/WEB-INF/src" />
 350.125 -
 350.126 -		<copy todir="${docroot}/WEB-INF/classes">
 350.127 -			<fileset dir="${docroot}/WEB-INF/src" excludes="**/*.java" />
 350.128 -		</copy>
 350.129 -
 350.130 -		<path id="service.classpath">
 350.131 -			<path refid="lib.classpath" />
 350.132 -			<path refid="portal.classpath" />
 350.133 -			<fileset dir="${docroot}/WEB-INF/lib" includes="*.jar" />
 350.134 -			<pathelement location="${docroot}/WEB-INF/classes" />
 350.135 -			
 350.136 -			<pathelement location="${app.server.classes.portal.dir}" />
 350.137 -					<fileset dir="${app.server.lib.global.dir}" includes="*.jar" />
 350.138 -					<fileset dir="${app.server.lib.portal.dir}" includes="*.jar" />
 350.139 -				<fileset dir="${lib.dir}" includes="servlet.jar" />
 350.140 -		</path>
 350.141 -		
 350.142 -		<echo message="${app.server.lib.portal.dir}-------------------------------"/>
 350.143 -
 350.144 -		<java
 350.145 -			classname="com.liferay.portal.tools.servicebuilder.ServiceBuilder"
 350.146 -			classpathref="service.classpath"
 350.147 -			fork="true"
 350.148 -			maxmemory="256m"
 350.149 -			newenvironment="true"
 350.150 -		>
 350.151 -			<jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
 350.152 -			<jvmarg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger" />
 350.153 -			<jvmarg value="-Dservice.input.file=${input.file}" />
 350.154 -			<jvmarg value="-Dservice.hbm.file=${docroot}/WEB-INF/src/META-INF/portlet-hbm.xml" />
 350.155 -			<jvmarg value="-Dservice.model.hints.file=${docroot}/WEB-INF/src/META-INF/portlet-model-hints.xml" />
 350.156 -			<jvmarg value="-Dservice.spring.file=${docroot}/WEB-INF/src/META-INF/portlet-spring.xml" />
 350.157 -			<jvmarg value="-Dservice.spring.base.file=${docroot}/WEB-INF/src/META-INF/base-spring.xml" />
 350.158 -			<jvmarg value="-Dservice.spring.hibernate.file=${docroot}/WEB-INF/src/META-INF/hibernate-spring.xml" />
 350.159 -			<jvmarg value="-Dservice.spring.infrastructure.file=${docroot}/WEB-INF/src/META-INF/infrastructure-spring.xml" />
 350.160 -			<jvmarg value="-Dservice.api.dir=${docroot}/WEB-INF/service" />
 350.161 -			<jvmarg value="-Dservice.impl.dir=${docroot}/WEB-INF/src" />
 350.162 -			<!--<jvmarg value="-Dservice.json.file=${docroot}/js/service_unpacked.js" />-->
 350.163 -			<jvmarg value="-Dservice.sql.dir=${docroot}/WEB-INF/sql" />
 350.164 -			<jvmarg value="-Dservice.sql.file=tables.sql" />
 350.165 -			<jvmarg value="-Dservice.sql.indexes.file=indexes.sql" />
 350.166 -			<jvmarg value="-Dservice.sql.indexes.properties.file=indexes.properties" />
 350.167 -			<jvmarg value="-Dservice.sql.sequences.file=sequences.sql" />
 350.168 -			<jvmarg value="-Dservice.auto.namespace.tables=true" />
 350.169 -			<jvmarg value="-Dservice.bean.locator.util=com.liferay.util.bean.PortletBeanLocatorUtil" />
 350.170 -			<jvmarg value="-Dservice.props.util=com.liferay.util.service.ServiceProps" />
 350.171 -			<jvmarg value="-Dservice.plugin.name=${project.name}" />
 350.172 -		</java>
 350.173 -
 350.174 -		<delete file="ServiceBuilder.temp" />
 350.175 -
 350.176 -		<!--<antcall target="build-javascript-cmd">
 350.177 -			<param name="js.from.file" value="docroot/js/service_unpacked.js" />
 350.178 -			<param name="js.to.file" value="docroot/js/service_packed.js" />
 350.179 -		</antcall>-->
 350.180 -
 350.181 -		<mkdir dir="${docroot}/WEB-INF/service-classes" />
 350.182 -
 350.183 -		<delete file="${docroot}/WEB-INF/lib/${project.name}-service.jar" />
 350.184 -
 350.185 -		<path id="service.classpath">
 350.186 -			<fileset dir="${app.server.lib.global.dir}" includes="*.jar" />
 350.187 -			<fileset dir="${app.server.lib.portal.dir}" includes="*.jar" />
 350.188 -			<fileset dir="${docroot}/WEB-INF/lib" excludes="${project.name}-service.jar" includes="*.jar" />
 350.189 -		</path>
 350.190 -		
 350.191 -		<javac
 350.192 -			classpathref="service.classpath"
 350.193 -			debug="${javac.debug}"
 350.194 -			deprecation="${javac.deprecation}"
 350.195 -			destdir="${docroot}/WEB-INF/service-classes"
 350.196 -			nowarn="${javac.nowarn}"
 350.197 -			srcdir="${docroot}/WEB-INF/service"
 350.198 -		/>
 350.199 -
 350.200 -		<zip
 350.201 -			basedir="${docroot}/WEB-INF/service-classes"
 350.202 -			destfile="${docroot}/WEB-INF/lib/${project.name}-service.jar"
 350.203 -		/>
 350.204 -                
 350.205 -		<delete dir="${docroot}/WEB-INF/service-classes" />
 350.206 -	</target>
 350.207 +        
 350.208 +        <target name="copy-jar" if="copy.jar.to.global.cp">
 350.209 +             <copy todir="${app.server.lib.global.dir}" file="${project.dir}/service/lib/${service.jar.name}"/>
 350.210 +             <echo message="Don't package the ${service.jar.name} inside the war."/>
 350.211 +             <echo message="Go to the Project Properties > Build > Packaging dialog and remove server/lib from packaging if present."/>
 350.212 +             <echo message="The ${service.jar.name} was copied to the server classpath. Please restart the server."/>
 350.213 +        </target>
 350.214 +        
 350.215 +        <target name="clean-service">
 350.216 +		<property name="service.dir" value="${project.dir}/service"/>
 350.217 +                <delete dir="${service.dir}"/>
 350.218 +                    
 350.219 +        </target>
 350.220          
 350.221          <target name="download-jars">
 350.222              <!--
 350.223 @@ -236,4 +172,4 @@
 350.224              <get src="${jsp.url}" dest="${lib.dir}/jsp.jar" usetimestamp="true" ignoreerrors="true"/> -->
 350.225          </target>    
 350.226  
 350.227 -</project>
 350.228 \ No newline at end of file
 350.229 +</project>
   351.1 --- a/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/layer.xml	Fri Jun 10 09:46:37 2011 +0200
   351.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/layer.xml	Sun Jun 26 10:25:14 2011 +0800
   351.3 @@ -5,40 +5,31 @@
   351.4          <folder name="text">
   351.5              <folder name="service-builder+xml">
   351.6                  <folder name="Actions">
   351.7 -                    <file name="org-openide-actions-CopyAction.shadow">
   351.8 -                        <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-CopyAction.instance"/>
   351.9 +                    <file name="org-openide-actions-CopyAction.instance">
  351.10                          <attr name="position" intvalue="500"/>
  351.11                      </file>
  351.12 -                    <file name="org-openide-actions-CutAction.shadow">
  351.13 -                        <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-CutAction.instance"/>
  351.14 +                    <file name="org-openide-actions-CutAction.instance">
  351.15                          <attr name="position" intvalue="400"/>
  351.16                      </file>
  351.17 -                    <file name="org-openide-actions-DeleteAction.shadow">
  351.18 -                        <attr name="originalFile" stringvalue="Actions/Edit/org-openide-actions-DeleteAction.instance"/>
  351.19 +                    <file name="org-openide-actions-DeleteAction.instance">
  351.20                          <attr name="position" intvalue="700"/>
  351.21                      </file>
  351.22 -                    <file name="org-openide-actions-FileSystemAction.shadow">
  351.23 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-FileSystemAction.instance"/>
  351.24 +                    <file name="org-openide-actions-FileSystemAction.instance">
  351.25                          <attr name="position" intvalue="200"/>
  351.26                      </file>
  351.27 -                    <file name="org-openide-actions-OpenAction.shadow">
  351.28 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-OpenAction.instance"/>
  351.29 +                    <file name="org-openide-actions-OpenAction.instance">
  351.30                          <attr name="position" intvalue="100"/>
  351.31                      </file>
  351.32 -                    <file name="org-openide-actions-PropertiesAction.shadow">
  351.33 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-PropertiesAction.instance"/>
  351.34 +                    <file name="org-openide-actions-PropertiesAction.instance">
  351.35                          <attr name="position" intvalue="1300"/>
  351.36                      </file>
  351.37 -                    <file name="org-openide-actions-RenameAction.shadow">
  351.38 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-RenameAction.instance"/>
  351.39 +                    <file name="org-openide-actions-RenameAction.instance">
  351.40                          <attr name="position" intvalue="800"/>
  351.41                      </file>
  351.42 -                    <file name="org-openide-actions-SaveAsTemplateAction.shadow">
  351.43 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-SaveAsTemplateAction.instance"/>
  351.44 +                    <file name="org-openide-actions-SaveAsTemplateAction.instance">
  351.45                          <attr name="position" intvalue="1000"/>
  351.46                      </file>
  351.47 -                    <file name="org-openide-actions-ToolsAction.shadow">
  351.48 -                        <attr name="originalFile" stringvalue="Actions/System/org-openide-actions-ToolsAction.instance"/>
  351.49 +                    <file name="org-openide-actions-ToolsAction.instance">
  351.50                          <attr name="position" intvalue="1200"/>
  351.51                      </file>
  351.52                      <file name="sep-1.instance">
  351.53 @@ -73,20 +64,11 @@
  351.54              <file name="service.xml" url="ServiceBuilderTemplate.xml">
  351.55                  <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.portalpack.websynergy.servicebuilder.resources.Bundle"/>
  351.56                  <attr name="template" boolvalue="true"/>
  351.57 +                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/ServiceDescription.html"/>
  351.58                  <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
  351.59 -                 <attr name="position" intvalue="700"/>
  351.60 +                <attr name="position" intvalue="700"/>
  351.61              </file>
  351.62          </folder>
  351.63      </folder>
  351.64 -     <folder name="Plugins">
  351.65 -        <!-- Register XML module catalog plugin -->
  351.66 -        <folder name="XML">
  351.67 -            <folder name="UserCatalogs">
  351.68 -                <file name="org-netbeans-modules-portalpack-websynergy-servicebuilder-catalog-RegisterDTDCatalog.instance">
  351.69 -                    <attr name="instanceCreate" newvalue="org.netbeans.modules.portalpack.websynergy.servicebuilder.catalog.RegisterDTDCatalog"/>
  351.70 -                    <attr name="instanceOf" stringvalue="org.netbeans.modules.xml.catalog.spi.CatalogReader"/>
  351.71 -                </file>
  351.72 -            </folder>
  351.73 -        </folder>
  351.74 -    </folder>
  351.75 +    
  351.76  </filesystem>
   352.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   352.2 +++ b/portalpack.websynergy.servicebuilder/src/org/netbeans/modules/portalpack/websynergy/servicebuilder/resources/liferay-service-builder_6_0_0.dtd	Sun Jun 26 10:25:14 2011 +0800
   352.3 @@ -0,0 +1,434 @@
   352.4 +<!--
   352.5 +This is the DTD for the Service Builder parameters for Liferay Portal.
   352.6 +
   352.7 +<!DOCTYPE service-builder PUBLIC
   352.8 +	"-//Liferay//DTD Service Builder 6.0.0//EN"
   352.9 +	"http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd">
  352.10 +-->
  352.11 +
  352.12 +<!--
  352.13 +The service-builder element is the root of the deployment descriptor for
  352.14 +a Service Builder descriptor that is used to generate services available to
  352.15 +portlets. The Service Builder saves the developer time by generating Spring
  352.16 +utilities, SOAP utilities, and Hibernate persistence classes to ease the
  352.17 +development of services.
  352.18 +-->
  352.19 +<!ELEMENT service-builder (author?, namespace, entity+, exceptions?)>
  352.20 +
  352.21 +<!--
  352.22 +The package-path value specifies the package of the generated code.
  352.23 +-->
  352.24 +<!ATTLIST service-builder
  352.25 +	package-path CDATA #REQUIRED
  352.26 +>
  352.27 +
  352.28 +<!--
  352.29 +The author element is the name of the user associated with the generated code.
  352.30 +-->
  352.31 +<!ELEMENT author (#PCDATA)>
  352.32 +
  352.33 +<!--
  352.34 +The namespace element must be a unique namespace for this component. Table names
  352.35 +will be prepended with this namespace. Generated JSON JavaScript will be scoped
  352.36 +to this namespace as well (i.e., Liferay.Service.Test.* if the namespace is
  352.37 +Test).
  352.38 +-->
  352.39 +<!ELEMENT namespace (#PCDATA)>
  352.40 +
  352.41 +<!--
  352.42 +An entity usually represents a business facade and a table in the database. If
  352.43 +an entity does not have any columns, then it only represents a business facade.
  352.44 +The Service Builder will always generate an empty business facade POJO if it
  352.45 +does not exist. Upon subsequent generations, the Service Builder will check to
  352.46 +see if the business facade already exists. If it exists and has additional
  352.47 +methods, then the Service Builder will also update the SOAP wrappers.
  352.48 +
  352.49 +If an entity does have columns, then the value object, the POJO class that
  352.50 +is mapped to the database, and other persistence utilities are also generated
  352.51 +based on the order and finder elements.
  352.52 +-->
  352.53 +<!ELEMENT entity (column*, order?, finder*, reference*, tx-required*)>
  352.54 +
  352.55 +<!--
  352.56 +The name value specifies the name of the entity.
  352.57 +
  352.58 +The table value specifies the name of the table that this entity maps to in the
  352.59 +database. If this value is not set, then the name of the table is the same as
  352.60 +the name of the entity.
  352.61 +
  352.62 +If the uuid value is true, then the service will generate a UUID column for the
  352.63 +service. This column will automatically be populated with a UUID. Developers
  352.64 +will also be able to find and remove based on that UUID. The default value is
  352.65 +false.
  352.66 +
  352.67 +If the local-service value is true, then the service will generate the local
  352.68 +interfaces for the service. The default value is false.
  352.69 +
  352.70 +If the remote-service value is true, then the service will generate remote
  352.71 +interfaces for the service. The default value is true.
  352.72 +
  352.73 +The persistence-class value specifies the name of your custom persistence class.
  352.74 +This class must implmeent the generated persistence interface or extend the
  352.75 +generated persistence class. This allows you to override default behavior
  352.76 +without modifying the generated persistence class.
  352.77 +
  352.78 +You can generate classes to use a custom data source and session factory.
  352.79 +Point "spring.configs" in portal.properties to load your custom Spring XML with
  352.80 +the defintions of your custom data source and session factory. Then set the
  352.81 +data-source and session-factory values to your custom values.
  352.82 +
  352.83 +The data-source value specifies the data source target that is set to the
  352.84 +persistence class. The default value is the Liferay data source. This is used in
  352.85 +conjunction with session-factory. See data-source-spring.xml.
  352.86 +
  352.87 +The session-factory value specifies the session factory that is set to the
  352.88 +persistence class. The default value is the Liferay session factory. This is
  352.89 +used in conjunction with data-source. See data-source-spring.xml.
  352.90 +
  352.91 +The tx-manager value specifies the transaction manager that Spring uses. The
  352.92 +default value is the Spring Hibernate transaction manager that wraps the Liferay
  352.93 +data source and session factory. See data-source-spring.xml. Set this attribute
  352.94 +to "none" to disable transaction management.
  352.95 +
  352.96 +The cache-enabled value specifies whether or not to cache this queries for this
  352.97 +entity. Set this to false if data in the table will be updated by other
  352.98 +programs. The default value is true.
  352.99 +-->
 352.100 +<!ATTLIST entity
 352.101 +	name CDATA #REQUIRED
 352.102 +	table CDATA #IMPLIED
 352.103 +	uuid CDATA #IMPLIED
 352.104 +	local-service CDATA #IMPLIED
 352.105 +	remote-service CDATA #IMPLIED
 352.106 +	persistence-class CDATA #IMPLIED
 352.107 +	data-source CDATA #IMPLIED
 352.108 +	session-factory CDATA #IMPLIED
 352.109 +	tx-manager CDATA #IMPLIED
 352.110 +	cache-enabled CDATA #IMPLIED
 352.111 +>
 352.112 +
 352.113 +<!--
 352.114 +The column element represents a column in the database.
 352.115 +-->
 352.116 +<!ELEMENT column (#PCDATA)>
 352.117 +
 352.118 +<!--
 352.119 +The name value specifies the getter and setter name in the entity.
 352.120 +
 352.121 +The type value specifies whether the column is a String, Boolean, or int, etc.
 352.122 +
 352.123 +For example:
 352.124 +
 352.125 +<column name="companyId" db-name="companyId" type="String" />
 352.126 +
 352.127 +The above column specifies that there will be a getter called
 352.128 +pojo.getCompanyId() that will return a String.
 352.129 +
 352.130 +Set db-name to map the field to a physical database column that is different
 352.131 +from the column name.
 352.132 +
 352.133 +If the primary value is set to true, then this column is part of the primary key
 352.134 +of the entity. If multiple columns have the primary value set to true, then a
 352.135 +compound key will be created.
 352.136 +
 352.137 +See com.liferay.portal.service.persistence.LayoutPK for an example of a compound
 352.138 +primary key.
 352.139 +
 352.140 +If the entity and mapping-key attributes are specified and mapping-table is not,
 352.141 +then the Service Builder will assume you are specifying a one to many
 352.142 +relationship.
 352.143 +
 352.144 +For example:
 352.145 +
 352.146 +<column
 352.147 +	name="shoppingItemPrices"
 352.148 +	type="Collection"
 352.149 +	entity="ShoppingItemPrice"
 352.150 +	mapping-key="itemId"
 352.151 +/>
 352.152 +
 352.153 +The above column specifies that there will be a getter called
 352.154 +pojo.getShoppingItemPrices() that will return a collection. It will map to a
 352.155 +column called itemId in the table that maps to the entity ShoppingItemPrice.
 352.156 +
 352.157 +If the entity and mapping-table attributes are specified and mapping-key is not,
 352.158 +then the Service Builder will assume you are specifying a many to many
 352.159 +relationship.
 352.160 +
 352.161 +For example:
 352.162 +
 352.163 +<column
 352.164 +	name="roles"
 352.165 +	type="Collection"
 352.166 +	entity="Role"
 352.167 +	mapping-table="Groups_Roles"
 352.168 +/>
 352.169 +
 352.170 +The above column specifies that there will be a getter called
 352.171 +pojo.getRoles() that will return a collection. It will use a mapping table
 352.172 +called Groups_Roles to give a many to many relationship between groups and
 352.173 +roles.
 352.174 +
 352.175 +If you are creating a mapping table for an entity defined in another
 352.176 +service.xml, you need to specify the full package path.
 352.177 +
 352.178 +For example:
 352.179 +
 352.180 +<column
 352.181 +	name="organizations"
 352.182 +	type="Collection"
 352.183 +	entity="com.liferay.portal.Organization"
 352.184 +	mapping-table="Foo_Organizations"
 352.185 +/>
 352.186 +
 352.187 +The id-type and id-param values are used in order to create an auto-generated, 
 352.188 +auto-incrementing primary key when inserting records into a table. This can be 
 352.189 +implemented in 4 different ways, depending on the type of database being used. 
 352.190 +In all cases, the primary key of the model object should be assigned a value of 
 352.191 +null, and hibernate will know to replace the null value with an auto-generated, 
 352.192 +auto-incremented value. If no id-type value is used, it is assumed that the 
 352.193 +primary key will be assigned and not auto-generated.
 352.194 +
 352.195 +The first implementation uses a class to generate a primary key. 
 352.196 +
 352.197 +For example:
 352.198 +
 352.199 +<column 
 352.200 +	name="id" 
 352.201 +	type="Integer" 
 352.202 +	primary="true" 
 352.203 +	id-type="class" 
 352.204 +	id-param="com.liferay.counter.service.persistence.IDGenerator" 
 352.205 +/>
 352.206 +
 352.207 +In this implementation, the class specified in the id-param value will be called
 352.208 +to retrieve a unique identifier (in the example above, an Integer) that will be 
 352.209 +used as the primary key for the new record. This implementation works for all 
 352.210 +supported databases.
 352.211 +
 352.212 +The second implementation generates identifiers that are unique only when no 
 352.213 +other process is inserting data into the same table. This implementation should
 352.214 +NOT be used in a clustered environment, but it does work for all supported 
 352.215 +databases.
 352.216 +
 352.217 +For example:
 352.218 +
 352.219 +<column 
 352.220 +	name="id" 
 352.221 +	type="Integer" 
 352.222 +	primary="true" 
 352.223 +	id-type="increment" 
 352.224 +/>
 352.225 +
 352.226 +The third implementation uses an identity column to generate a primary key.
 352.227 +
 352.228 +For example:
 352.229 +
 352.230 +<column 
 352.231 +	name="id" 
 352.232 +	type="Integer" 
 352.233 +	primary="true" 
 352.234 +	id-type="identity" 
 352.235 +/>
 352.236 +
 352.237 +In this implementation, the create table SQL generated for this entity will 
 352.238 +create an identity column that natively auto-generates a primary key whenever
 352.239 +an insert occurs. This implementation is only supported by DB2, MySQL, and
 352.240 +MS SQL Server.
 352.241 +
 352.242 +The fourth implementation uses a sequence to generate a primary key.
 352.243 +
 352.244 +For example:
 352.245 +
 352.246 +<column 
 352.247 +	name="id" 
 352.248 +	type="Integer" 
 352.249 +	primary="true" 
 352.250 +	id-type="sequence" 
 352.251 +	id-param="id_sequence" 
 352.252 +/>
 352.253 +
 352.254 +In this implementation, a create sequence SQL statement is created based on
 352.255 +the id-param value (stored in /sql/sequences.sql). This sequence is then 
 352.256 +accessed to generate a unique identifier whenever an insert occurs. This
 352.257 +implementation is only supported by DB2, Oracle, PostgreSQL, and SAP DB.
 352.258 +
 352.259 +The convert-null value specifies whether or not the column value is
 352.260 +automatically converted to a non null value if it is null. This only applies if
 352.261 +the type value is String. This is particularly useful if your entity is
 352.262 +referencing a read only table or a database view so that Hibernate does not try
 352.263 +to issue unnecessary updates. The default value is true.
 352.264 +
 352.265 +The localized value specifies whether or not the column of the value can have
 352.266 +different values for different locales. The default value is false.
 352.267 +-->
 352.268 +<!ATTLIST column
 352.269 +	name CDATA #REQUIRED
 352.270 +	db-name CDATA #IMPLIED
 352.271 +	type CDATA #REQUIRED
 352.272 +	primary CDATA #IMPLIED
 352.273 +	entity CDATA #IMPLIED
 352.274 +	mapping-key CDATA #IMPLIED
 352.275 +	mapping-table CDATA #IMPLIED
 352.276 +	id-type CDATA #IMPLIED
 352.277 +	id-param CDATA #IMPLIED
 352.278 +	convert-null CDATA #IMPLIED
 352.279 +	localized CDATA #IMPLIED
 352.280 +>
 352.281 +
 352.282 +<!--
 352.283 +The order element specifies a default ordering and sorting of the entities when
 352.284 +they are retrieved from the database.
 352.285 +-->
 352.286 +<!ELEMENT order (order-column+)>
 352.287 +
 352.288 +<!--
 352.289 +Set the by attribute to "asc" or "desc" to order by ascending or descending.
 352.290 +-->
 352.291 +<!ATTLIST order
 352.292 +	by CDATA #IMPLIED
 352.293 +>
 352.294 +
 352.295 +<!--
 352.296 +The order-column element allows you to order the entities by specific columns.
 352.297 +-->
 352.298 +<!ELEMENT order-column (#PCDATA)>
 352.299 +
 352.300 +<!--
 352.301 +The attributes of the order-column element allows you to fine tune the ordering
 352.302 +of the entity.
 352.303 +
 352.304 +For example:
 352.305 +
 352.306 +<order by="asc">
 352.307 +	<order-column name="parentLayoutId" />
 352.308 +	<order-column name="priority" />
 352.309 +</order>
 352.310 +
 352.311 +The above settings will order by parentLayoutId and then by priority in an
 352.312 +ascending manner.
 352.313 +
 352.314 +For example:
 352.315 +
 352.316 +<order by="asc">
 352.317 +	<order-column name="name" case-sensitive="false" />
 352.318 +</order>
 352.319 +
 352.320 +The above settings will order by name and will not be case sensitive.
 352.321 +
 352.322 +For example:
 352.323 +
 352.324 +<order>
 352.325 +	<order-column name="articleId" order-by="asc" />
 352.326 +	<order-column name="version" order-by="desc" />
 352.327 +</order>
 352.328 +
 352.329 +The above settings will order by articleId in an ascending manner and then by
 352.330 +version in a descending manner.
 352.331 +-->
 352.332 +<!ATTLIST order-column
 352.333 +	name CDATA #REQUIRED
 352.334 +	case-sensitive CDATA #IMPLIED
 352.335 +	order-by CDATA #IMPLIED
 352.336 +>
 352.337 +
 352.338 +<!--
 352.339 +The finder element represents a generated finder method.
 352.340 +-->
 352.341 +<!ELEMENT finder (finder-column+)>
 352.342 +
 352.343 +<!--
 352.344 +The name value specifies the name of the finder method.
 352.345 +
 352.346 +The return-type value specifies the return type of the finder. Valid values are
 352.347 +"Collection" or the name of the entity. If the value is "Collection", then this
 352.348 +finder returns a list of entities. If the value is the name of the entity, then
 352.349 +this finder returns at most one entity.
 352.350 +
 352.351 +If the unique value is true, then the finder must return a unique entity.
 352.352 +
 352.353 +If the db-index value is true, then the service will automatically generate a
 352.354 +SQL index for this finder. The default value is true.
 352.355 +-->
 352.356 +<!ATTLIST finder
 352.357 +	name CDATA #REQUIRED
 352.358 +	return-type CDATA #REQUIRED
 352.359 +	unique CDATA #IMPLIED
 352.360 +	where CDATA #IMPLIED
 352.361 +	db-index CDATA #IMPLIED
 352.362 +>
 352.363 +
 352.364 +<!--
 352.365 +The finder-column element specifies the columns to find by.
 352.366 +-->
 352.367 +<!ELEMENT finder-column (#PCDATA)>
 352.368 +
 352.369 +<!--
 352.370 +The name value specifies the name of the finder method.
 352.371 +
 352.372 +For example:
 352.373 +
 352.374 +<finder name="CompanyId" return-type="Collection">
 352.375 +	<finder-column name="companyId" />
 352.376 +</finder>
 352.377 +
 352.378 +The above settings will create a finder with the name findByCompanyId that will
 352.379 +return a Collection and require a given companyId. It will also generate
 352.380 +several more findByCompanyId methods that take in pagination fields (int begin,
 352.381 +int end) and more sorting options. The easiest way to understand this is to
 352.382 +look at a generated PersistenceImpl class. The Service Builder will also
 352.383 +generate removeByCompanyId and countByCompanyId.
 352.384 +
 352.385 +See com.liferay.portal.service.persistence.LayoutPersistenceImpl for a good
 352.386 +example.
 352.387 +
 352.388 +The attribute comparator takes in the values =, !=, <, <=, >, >=, or LIKE and is
 352.389 +used to compare this column.
 352.390 +
 352.391 +The attribute case-sensitive is a boolean value and is only used if the column
 352.392 +is a String value.
 352.393 +-->
 352.394 +<!ATTLIST finder-column
 352.395 +	name CDATA #REQUIRED
 352.396 +	case-sensitive CDATA #IMPLIED
 352.397 +	comparator CDATA #IMPLIED
 352.398 +>
 352.399 +
 352.400 +<!--
 352.401 +The reference element allows you to inject services from another service.xml
 352.402 +within the same class loader. For example, if you inject the Resource entity,
 352.403 +then you'll be able to reference the Resource services from your service
 352.404 +implementation via the methods getResourceLocalService and getResourceService.
 352.405 +You'll also be able to reference the Resource services via the variables
 352.406 +resourceLocalService and resourceService.
 352.407 +-->
 352.408 +<!ELEMENT reference (#PCDATA)>
 352.409 +
 352.410 +<!--
 352.411 +See the comments in reference element.
 352.412 +-->
 352.413 +<!ATTLIST reference
 352.414 +	package-path CDATA #IMPLIED
 352.415 +	entity CDATA #IMPLIED
 352.416 +>
 352.417 +
 352.418 +<!--
 352.419 +The tx-required element has a text value that will be used to match method names
 352.420 +that require transactions. By default, the methods: add*, check*, clear*,
 352.421 +delete*, set*, and update* require propagation of transactions. All other
 352.422 +methods support transactions but are assumed to be read only. If you want
 352.423 +additional methods to fall under transactions, add the method name to this
 352.424 +element.
 352.425 +-->
 352.426 +<!ELEMENT tx-required (#PCDATA)>
 352.427 +
 352.428 +<!--
 352.429 +The exceptions element contain a list of generated exceptions. This doesn't save
 352.430 +a lot of typing, but can still be helpful.
 352.431 +-->
 352.432 +<!ELEMENT exceptions (exception*)>
 352.433 +
 352.434 +<!--
 352.435 +See the comments in exceptions element.
 352.436 +-->
 352.437 +<!ELEMENT exception (#PCDATA)>
 352.438 \ No newline at end of file