You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by at...@apache.org on 2008/10/30 04:58:29 UTC
svn commit: r709083 [1/2] - in
/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade:
components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/
components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/
...
Author: ate
Date: Wed Oct 29 20:58:27 2008
New Revision: 709083
URL: http://svn.apache.org/viewvc?rev=709083&view=rev
Log:
JS2-871 - Upgrade Pluto container to version 2.0
See: http://issues.apache.org/jira/browse/JS2-871
- big cleanup of now obsolete classes
- *drop* WebApplicationDefinition by merging its features with PortletApplication
- restored SecurityRole interface back, now as child of PortletApplication
- first round of adjusting and cleaning up registry OJB mapping and schema-definition
Added:
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/SecurityRoleImpl.java (with props)
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/SecurityRole.java (with props)
Removed:
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/ExtendedPortletMetadata.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/MetaDataException.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/PortletApplicationDescriptor.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/PortletApplicationRule.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/PortletApplicationRuleSet.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/PortletPreferenceRule.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/PortletPreferenceRuleSet.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/PortletRule.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/WebApplicationDescriptor.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/web-app_2_2.dtd
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/servlet/impl/
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/servlet/
Modified:
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/manager/ManagerServlet.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/PortletApplicationWar.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/JETSPEED-INF/ojb/registry_repository.xml
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/descriptor/ExtendedDescriptorServiceImpl.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/FilterImpl.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/InitParamImpl.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-search/src/main/java/org/apache/jetspeed/search/handlers/pam/PortletApplicationHandler.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/descriptor/ExtendedDescriptorService.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/PortletApplication.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletObjectProxy.java
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java Wed Oct 29 20:58:27 2008
@@ -1115,7 +1115,7 @@
PortletDefinition pd = portletWindow.getPortletEntity().getPortletDefinition();
if ( pd != null && getPortletFactory().isPortletApplicationRegistered((PortletApplication)pd.getApplication() ) )
{
- String portletApplicationContextPath = pd.getApplication().getWebApplicationDefinition().getContextRoot();
+ String portletApplicationContextPath = pd.getApplication().getContextRoot();
Portlet portlet = getPortletFactory().getPortletInstance( context.getConfig().getServletContext().getContext( portletApplicationContextPath ), pd ).getRealPortlet();
if ( portlet != null && portlet instanceof SupportsHeaderPhase )
{
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java Wed Oct 29 20:58:27 2008
@@ -37,7 +37,6 @@
import org.apache.jetspeed.factory.PortletFactory;
import org.apache.jetspeed.factory.PortletInstance;
import org.apache.jetspeed.om.portlet.PortletApplication;
-import org.apache.jetspeed.om.servlet.WebApplicationDefinition;
import org.apache.jetspeed.request.RequestContext;
import org.apache.jetspeed.om.portlet.PortletDefinition;
import org.apache.pluto.spi.FilterManager;
@@ -146,12 +145,7 @@
PortletApplication app = (PortletApplication)portletDefinition.getApplication();
- WebApplicationDefinition webApplicationDefinition = app.getWebApplicationDefinition();
- if(webApplicationDefinition == null)
- {
- throw new IllegalStateException("Portlet application "+app.getName()+ " has no associated web application.");
- }
- String portletApplicationName = webApplicationDefinition.getContextRoot();
+ String portletApplicationName = app.getContextRoot();
ServletContext appContext = jetspeedContext.getContext(portletApplicationName);
if (null == appContext)
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/manager/ManagerServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/manager/ManagerServlet.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/manager/ManagerServlet.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/manager/ManagerServlet.java Wed Oct 29 20:58:27 2008
@@ -166,7 +166,7 @@
while (iter.hasNext())
{
pa = (PortletApplication) iter.next();
- writer.println(pa.getName() + ":" + pa.getWebApplicationDefinition().getContextRoot()
+ writer.println(pa.getName() + ":" + pa.getContextRoot()
+ ":" + (portletFactory.isPortletApplicationRegistered(pa) ? "ACTIVE" : "INACTIVE"));
}
return OK;
@@ -203,7 +203,7 @@
{
try
{
- ApplicationServerManagerResult result = asm.start(pa.getWebApplicationDefinition().getContextRoot());
+ ApplicationServerManagerResult result = asm.start(pa.getContextRoot());
if (result.isOk())
{
writer.println("Portlet Application " + paName + " started");
@@ -257,7 +257,7 @@
{
try
{
- ApplicationServerManagerResult result = asm.stop(pa.getWebApplicationDefinition().getContextRoot());
+ ApplicationServerManagerResult result = asm.stop(pa.getContextRoot());
if (result.isOk())
{
writer.println("Portlet Application " + paName + " stopped");
@@ -296,7 +296,7 @@
PortletApplication pa = registry.getPortletApplication(paName);
try
{
- ApplicationServerManagerResult result = asm.undeploy(pa.getWebApplicationDefinition().getContextRoot());
+ ApplicationServerManagerResult result = asm.undeploy(pa.getContextRoot());
if (result.isOk())
{
writer.println("Portlet Application " + paName + " undeployed");
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java Wed Oct 29 20:58:27 2008
@@ -36,7 +36,7 @@
import org.apache.jetspeed.factory.PortletFactory;
import org.apache.jetspeed.om.portlet.PortletApplication;
import org.apache.jetspeed.om.portlet.PortletDefinition;
-import org.apache.jetspeed.om.servlet.WebApplicationDefinition;
+import org.apache.jetspeed.om.portlet.SecurityRole;
import org.apache.jetspeed.search.SearchEngine;
import org.apache.jetspeed.security.JetspeedPermission;
import org.apache.jetspeed.security.PermissionManager;
@@ -302,7 +302,6 @@
// load the web.xml
log.info("Loading portlet.xml and web.xml...." + paName);
pa = paWar.createPortletApp(paClassLoader);
- WebApplicationDefinition wa = paWar.getWebApp();
if (revision > 0)
{
pa.setRevision(revision);
@@ -310,7 +309,7 @@
if (paType == PortletApplication.LOCAL)
{
- wa.setContextRoot("<portal>");
+ pa.setContextRoot("<portal>");
}
// Make sure existing entities are refreshed with the most
@@ -355,15 +354,15 @@
// grant default permissions to portlet application
grantDefaultPermissions(paName);
- if ( autoCreateRoles && roleManager != null && pa.getWebApplicationDefinition().getRoles() != null )
+ if ( autoCreateRoles && roleManager != null && pa.getSecurityRoles() != null )
{
try
{
- for (String sr : pa.getWebApplicationDefinition().getRoles())
- if ( !roleManager.roleExists(sr) )
+ for (SecurityRole sr : pa.getSecurityRoles())
+ if ( !roleManager.roleExists(sr.getName()) )
{
- roleManager.addRole(sr);
- log.info("AutoCreated role: "+sr+" from portlet application "+paName+" its web definition");
+ roleManager.addRole(sr.getName());
+ log.info("AutoCreated role: "+sr.getName()+" from portlet application "+paName+" its web definition");
}
}
catch (SecurityException sex)
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/PortletApplicationWar.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/PortletApplicationWar.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/PortletApplicationWar.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/descriptor/PortletApplicationWar.java Wed Oct 29 20:58:27 2008
@@ -36,7 +36,7 @@
import org.apache.jetspeed.descriptor.ExtendedDescriptorService;
import org.apache.jetspeed.om.portlet.PortletApplication;
import org.apache.jetspeed.om.portlet.PortletDefinition;
-import org.apache.jetspeed.om.servlet.WebApplicationDefinition;
+import org.apache.jetspeed.om.portlet.SecurityRole;
import org.apache.jetspeed.tools.pamanager.PortletApplicationException;
import org.apache.jetspeed.util.DirectoryHelper;
import org.apache.jetspeed.util.FileSystemHelper;
@@ -83,7 +83,6 @@
protected String webAppContextRoot;
protected FileSystemHelper warStruct;
- private WebApplicationDefinition webApp;
private PortletApplication portletApp;
private long paChecksum;
protected ExtendedDescriptorService descriptorService;
@@ -156,54 +155,6 @@
/**
*
* <p>
- * createWebApp
- * </p>
- * Creates a web applicaiton object based on the values in this WAR's
- * WEB-INF/web.xml
- *
- * @return @throws
- * PortletApplicationException
- * @throws IOException
- * @see org.apache.jetspeed.util.descriptor.WebApplicationDescriptor
- */
- public WebApplicationDefinition createWebApp() throws PortletApplicationException, IOException
- {
- InputStream stream = getInputStream(WEB_XML_PATH);
- try
- {
-// WebApplicationDescriptor webAppDescriptor = new WebApplica dtionDescriptor(webXmlReader, webAppContextRoot);
-// webApp = webAppDescriptor.createWebApplication();
-// return webApp;
-// JetspeedWebApplicationRewriterFactory rewriterFactory = new JetspeedWebApplicationRewriterFactory();
-// JetspeedWebApplicationRewriter rewriter = rewriterFactory.getInstance(doc);
-// rewriter.getSecurityRoles();
- return descriptorService.readServletDescriptor(stream);
- }
- catch (Exception e)
- {
- throw new PortletApplicationException("Failed to read web.xml descriptor: " + e);
- }
- finally
- {
- try
- {
- if (stream != null)
- {
- stream.close();
- }
- }
- catch (IOException e1)
- {
- e1.printStackTrace();
- }
- }
-
-
- }
-
- /**
- *
- * <p>
* createPortletApp
* </p>
* Creates a portlet application object based of the WAR file's
@@ -233,7 +184,8 @@
{
descriptorService.readExtended(extStream, portletApp);
}
- webApp = createWebApp();
+ // TODO 2.2: load/parse web.xml and merge descriptions/display-names/roles/locale-encoding-mapping-list elements
+ // within the pa, see Portlet Spec 2.0, PLT.25.1
validate();
portletApp.setChecksum(paChecksum);
return portletApp;
@@ -396,13 +348,12 @@
*/
public void validate() throws PortletApplicationException
{
- if (portletApp == null || webApp == null)
+ if (portletApp == null)
{
throw new IllegalStateException(
- "createWebApp() and createPortletApp() must be called before invoking validate()");
+ "createPortletApp() must be called before invoking validate()");
}
- List<String> roles = webApp.getRoles();
List<PortletDefinition> portlets = portletApp.getPortlets();
for (PortletDefinition portlet : portlets)
{
@@ -413,7 +364,16 @@
{
roleName = roleRef.getRoleName();
}
- if (roles.contains(roleName) == false)
+ boolean found = false;
+ for (SecurityRole role : portletApp.getSecurityRoles())
+ {
+ if (role.getName().equals(roleName))
+ {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
{
String errorMsg = "Undefined security role " + roleName + " referenced from portlet "
+ portlet.getPortletName();
@@ -504,12 +464,6 @@
return warStruct;
}
- public WebApplicationDefinition getWebApp()
- {
- return webApp;
- }
-
-
public PortletApplication getPortletApp()
{
return portletApp;
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/JETSPEED-INF/ojb/registry_repository.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/JETSPEED-INF/ojb/registry_repository.xml?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/JETSPEED-INF/ojb/registry_repository.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/JETSPEED-INF/ojb/registry_repository.xml Wed Oct 29 20:58:27 2008
@@ -102,15 +102,6 @@
- P O R T L E T A P P L I C A T I O N
-->
- <class-descriptor
- class="org.apache.jetspeed.om.common.portlet.PortletApplication"
-
- >
- <object-cache class="org.apache.jetspeed.components.portletregistry.RegistryApplicationCache"/>
- <extent-class class-ref="org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl" />
- </class-descriptor>
-
-
<class-descriptor
class="org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl"
table="PORTLET_APPLICATION"
@@ -123,6 +114,7 @@
jdbc-type="BIGINT"
primarykey="true"
autoincrement="true"
+ access="anonymous"
/>
<field-descriptor
@@ -133,13 +125,15 @@
/>
<field-descriptor
- name="name"
- column="APP_NAME"
- jdbc-type="VARCHAR"
+ name="revision"
+ column="REVISION"
+ jdbc-type="BIGINT"
+
/>
+
<field-descriptor
- name="applicationIdentifier"
- column="APP_IDENTIFIER"
+ name="name"
+ column="APP_NAME"
jdbc-type="VARCHAR"
/>
@@ -149,18 +143,12 @@
jdbc-type="VARCHAR"
/>
<field-descriptor
- name="description"
- column="DESCRIPTION"
+ name="contextRoot"
+ column="CONTEXT_ROOT"
jdbc-type="VARCHAR"
/>
<field-descriptor
- name="webApplicationId"
- column="WEB_APP_ID"
- jdbc-type="BIGINT"
- />
-
- <field-descriptor
name="applicationType"
column="APP_TYPE"
jdbc-type="INTEGER"
@@ -181,16 +169,6 @@
<inverse-foreignkey field-ref="parentId"/>
</collection-descriptor>
- <reference-descriptor
- name="webApplication"
- class-ref="org.apache.jetspeed.om.servlet.impl.WebApplicationDefinitionImpl"
- auto-delete="true"
- auto-update = "true"
- auto-retrieve = "true"
- >
- <foreignkey field-ref="webApplicationId"/>
- </reference-descriptor>
-
<collection-descriptor
name="portlets"
element-class-ref="org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl"
@@ -204,7 +182,7 @@
<collection-descriptor
name="userAttributes"
- element-class-ref="org.apache.jetspeed.om.impl.UserAttributeImpl"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.UserAttributeImpl"
auto-delete="object"
auto-update = "object"
auto-retrieve = "true"
@@ -214,7 +192,7 @@
<collection-descriptor
name="userAttributeRefs"
- element-class-ref="org.apache.jetspeed.om.impl.UserAttributeRefImpl"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.UserAttributeRefImpl"
auto-delete="object"
auto-update = "object"
auto-retrieve = "true"
@@ -224,7 +202,7 @@
<collection-descriptor
name="services"
- element-class-ref="org.apache.jetspeed.om.impl.JetspeedServiceReferenceImpl"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.JetspeedServiceReferenceImpl"
auto-delete="true"
auto-update = "true"
auto-retrieve = "true"
@@ -252,65 +230,34 @@
<inverse-foreignkey field-ref="appId"/>
</collection-descriptor>
- </class-descriptor>
-
-
-
-<!--
- - W E B A P P L I C A T I O N
--->
-
- <class-descriptor
- class="org.apache.jetspeed.om.servlet.impl.WebApplicationDefinitionImpl"
- table="WEB_APPLICATION"
- >
-
- <field-descriptor
- name="id"
- column="ID"
- jdbc-type="BIGINT"
- primarykey="true"
- autoincrement="true"
- />
-
-
- <field-descriptor
- name="contextRoot"
- column="CONTEXT_ROOT"
- jdbc-type="VARCHAR"
- />
-
<collection-descriptor
name="descriptions"
- element-class-ref="org.apache.jetspeed.om.impl.WebAppDescriptionImpl"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.DescriptionImpl"
auto-delete="true"
auto-update = "true"
auto-retrieve = "true"
-
>
-
- <inverse-foreignkey field-ref="parentId"/>
-
+ <inverse-foreignkey field-ref="ownerId"/>
</collection-descriptor>
<collection-descriptor
name="displayNames"
- element-class-ref="org.apache.jetspeed.om.impl.WebAppDisplayNameImpl"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.DisplayNameImpl"
auto-delete="true"
auto-update = "true"
auto-retrieve = "true"
>
- <inverse-foreignkey field-ref="parentId"/>
+ <inverse-foreignkey field-ref="ownerId"/>
</collection-descriptor>
<collection-descriptor
name="securityRoles"
- element-class-ref="org.apache.jetspeed.om.servlet.impl.SecurityRoleImpl"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.SecurityRoleImpl"
auto-delete="false"
auto-update = "true"
auto-retrieve = "true"
>
- <inverse-foreignkey field-ref="webAppId"/>
+ <inverse-foreignkey field-ref="appId"/>
</collection-descriptor>
</class-descriptor>
@@ -336,13 +283,6 @@
/>
<field-descriptor
- name="portletIdentifier"
- column="PORTLET_IDENTIFIER"
- jdbc-type="VARCHAR"
- />
-
-
- <field-descriptor
name="name"
column="NAME"
jdbc-type="VARCHAR"
@@ -357,7 +297,7 @@
name="appId"
column="APPLICATION_ID"
jdbc-type="BIGINT"
-
+ access="anonymous"
/>
<field-descriptor
@@ -406,7 +346,7 @@
<collection-descriptor
name="displayNames"
- element-class-ref="org.apache.jetspeed.om.impl.PortletDisplayNameImpl"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.DisplayNameImpl"
auto-delete="true"
auto-update = "true"
auto-retrieve = "true"
@@ -417,8 +357,8 @@
<collection-descriptor
- name="languageSet"
- element-class-ref="org.apache.jetspeed.om.impl.LanguageImpl"
+ name="languages"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.LanguageImpl"
auto-delete="true"
auto-update = "true"
auto-retrieve = "true"
@@ -441,9 +381,9 @@
<collection-descriptor
- name="parameterSet"
+ name="initParams"
proxy="false"
- element-class-ref="org.apache.jetspeed.om.impl.PortletInitParameterImpl"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.InitParamImpl"
auto-delete="true"
auto-update = "true"
auto-retrieve = "true"
@@ -455,8 +395,8 @@
<collection-descriptor
- name="securityRoleRefSet"
- element-class-ref="org.apache.jetspeed.om.impl.SecurityRoleRefImpl"
+ name="securityRoleRefs"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.SecurityRoleRefImpl"
auto-delete="true"
auto-update = "true"
auto-retrieve = "true"
@@ -468,7 +408,7 @@
<collection-descriptor
name="descriptions"
- element-class-ref="org.apache.jetspeed.om.impl.PortletDescriptionImpl"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.DescriptionImpl"
auto-delete="true"
auto-update = "true"
auto-retrieve = "true"
@@ -501,23 +441,22 @@
class="org.apache.jetspeed.om.impl.LanguageImpl"
table="LANGUAGE"
>
-
<field-descriptor
name="id"
column="ID"
jdbc-type="BIGINT"
primarykey="true"
autoincrement="true"
+ access="anonymous"
/>
<field-descriptor
name="portletId"
column="PORTLET_ID"
jdbc-type="BIGINT"
-
+ access="anonymous"
/>
-
<field-descriptor
name="title"
column="TITLE"
@@ -587,85 +526,33 @@
<!--
- P A R A M E T E R
-->
- <!--
- <class-descriptor
- class="org.apache.jetspeed.om.common.ParameterImpl"
- table="PARAMETER"
- >
- <extent-class class-ref="org.apache.jetspeed.om.common.extended.PortletInitParameterImpl" />
- <extent-class class-ref="org.apache.jetspeed.om.common.extended.ServletInitParameterImpl" />
-
-
-
- </class-descriptor>
- -->
-
<class-descriptor
- class="org.apache.jetspeed.om.impl.ServletInitParameterImpl"
+ class="org.apache.jetspeed.om.portlet.impl.InitParamImpl"
table="PARAMETER"
>
-
<field-descriptor
name="parameterId"
column="PARAMETER_ID"
jdbc-type="BIGINT"
primarykey="true"
autoincrement="true"
+ access="anonymous"
/>
<field-descriptor
- name="parentId"
- column="PARENT_ID"
+ name="ownerId"
+ column="OWNER_ID"
jdbc-type="BIGINT"
-
+ access="anonymous"
/>
<field-descriptor
- name="name"
- column="NAME"
+ name="owner"
+ column="OWNER_CLASS_NAME"
jdbc-type="VARCHAR"
/>
<field-descriptor
- name="value"
- column="PARAMETER_VALUE"
- jdbc-type="VARCHAR"
- />
-
-
-
- <field-descriptor
- name="ojbConcreteClass"
- column="CLASS_NAME"
- jdbc-type="VARCHAR"
- />
-
-
-
-
- </class-descriptor>
-
- <class-descriptor
- class="org.apache.jetspeed.om.impl.PortletInitParameterImpl"
- table="PARAMETER"
- >
-
- <field-descriptor
- name="parameterId"
- column="PARAMETER_ID"
- jdbc-type="BIGINT"
- primarykey="true"
- autoincrement="true"
- />
-
- <field-descriptor
- name="parentId"
- column="PARENT_ID"
- jdbc-type="BIGINT"
-
- />
-
- <field-descriptor
name="name"
column="NAME"
jdbc-type="VARCHAR"
@@ -678,305 +565,25 @@
/>
- <field-descriptor
- name="ojbConcreteClass"
- column="CLASS_NAME"
- jdbc-type="VARCHAR"
- />
-
<collection-descriptor
name="descriptions"
- element-class-ref="org.apache.jetspeed.om.impl.ParameterDescriptionImpl"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.DescriptionImpl"
auto-delete="true"
auto-update = "true"
auto-retrieve = "true"
>
- <inverse-foreignkey field-ref="parentId"/>
+ <inverse-foreignkey field-ref="ownerId"/>
</collection-descriptor>
</class-descriptor>
-
-
-
-
<!--
- L O C A L I Z E D D E S C R I P I T I O N
-->
- <class-descriptor
- class="org.apache.jetspeed.om.impl.PortletDescriptionImpl"
- table="LOCALIZED_DESCRIPTION"
- >
-
- <field-descriptor
- name="id"
- column="ID"
- jdbc-type="BIGINT"
- primarykey="true"
- autoincrement="true"
-
-
- />
-
- <field-descriptor
- name="parentId"
- column="OBJECT_ID"
- jdbc-type="BIGINT"
-
- />
-
-
- <field-descriptor
- name="ojbConcreteClass"
- column="CLASS_NAME"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="description"
- column="DESCRIPTION"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="locale"
- column="LOCALE_STRING"
- jdbc-type="VARCHAR"
- conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
- />
-
-
- </class-descriptor>
-
- <class-descriptor
- class="org.apache.jetspeed.om.impl.PortletAppDescriptionImpl"
- table="LOCALIZED_DESCRIPTION"
- >
-
- <field-descriptor
- name="id"
- column="ID"
- jdbc-type="BIGINT"
- primarykey="true"
- autoincrement="true"
-
-
- />
-
- <field-descriptor
- name="parentId"
- column="OBJECT_ID"
- jdbc-type="BIGINT"
-
- />
-
-
- <field-descriptor
- name="ojbConcreteClass"
- column="CLASS_NAME"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="description"
- column="DESCRIPTION"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="locale"
- column="LOCALE_STRING"
- jdbc-type="VARCHAR"
- conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
- />
-
-
- </class-descriptor>
-
- <class-descriptor
- class="org.apache.jetspeed.om.impl.WebAppDescriptionImpl"
- table="LOCALIZED_DESCRIPTION"
- >
-
- <field-descriptor
- name="id"
- column="ID"
- jdbc-type="BIGINT"
- primarykey="true"
- autoincrement="true"
-
-
- />
-
- <field-descriptor
- name="parentId"
- column="OBJECT_ID"
- jdbc-type="BIGINT"
-
- />
-
-
- <field-descriptor
- name="ojbConcreteClass"
- column="CLASS_NAME"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="description"
- column="DESCRIPTION"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="locale"
- column="LOCALE_STRING"
- jdbc-type="VARCHAR"
- conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
- />
-
-
- </class-descriptor>
-
- <class-descriptor
- class="org.apache.jetspeed.om.impl.PortletEntityDescriptionImpl"
- table="LOCALIZED_DESCRIPTION"
- >
-
- <field-descriptor
- name="id"
- column="ID"
- jdbc-type="BIGINT"
- primarykey="true"
- autoincrement="true"
-
-
- />
-
- <field-descriptor
- name="parentId"
- column="OBJECT_ID"
- jdbc-type="BIGINT"
-
- />
-
-
- <field-descriptor
- name="ojbConcreteClass"
- column="CLASS_NAME"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="description"
- column="DESCRIPTION"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="locale"
- column="LOCALE_STRING"
- jdbc-type="VARCHAR"
- conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
- />
-
-
- </class-descriptor>
-
- <class-descriptor
- class="org.apache.jetspeed.om.impl.ParameterDescriptionImpl"
- table="LOCALIZED_DESCRIPTION"
- >
-
- <field-descriptor
- name="id"
- column="ID"
- jdbc-type="BIGINT"
- primarykey="true"
- autoincrement="true"
-
-
- />
-
- <field-descriptor
- name="parentId"
- column="OBJECT_ID"
- jdbc-type="BIGINT"
-
- />
-
-
- <field-descriptor
- name="ojbConcreteClass"
- column="CLASS_NAME"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="description"
- column="DESCRIPTION"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="locale"
- column="LOCALE_STRING"
- jdbc-type="VARCHAR"
- conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
- />
-
-
- </class-descriptor>
-
- <class-descriptor
- class="org.apache.jetspeed.om.impl.PreferenceDescriptionImpl"
- table="LOCALIZED_DESCRIPTION"
- >
-
- <field-descriptor
- name="id"
- column="ID"
- jdbc-type="BIGINT"
- primarykey="true"
- autoincrement="true"
-
-
- />
-
- <field-descriptor
- name="parentId"
- column="OBJECT_ID"
- jdbc-type="BIGINT"
-
- />
-
-
- <field-descriptor
- name="ojbConcreteClass"
- column="CLASS_NAME"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="description"
- column="DESCRIPTION"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="locale"
- column="LOCALE_STRING"
- jdbc-type="VARCHAR"
- conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
- />
-
-
- </class-descriptor>
-
- <class-descriptor
- class="org.apache.jetspeed.om.impl.SecurityRoleRefDescriptionImpl"
+ <class-descriptor
+ class="org.apache.jetspeed.om.portlet.impl.DescriptionImpl"
table="LOCALIZED_DESCRIPTION"
>
@@ -986,21 +593,20 @@
jdbc-type="BIGINT"
primarykey="true"
autoincrement="true"
-
-
+ access="anonymous"
/>
<field-descriptor
- name="parentId"
- column="OBJECT_ID"
+ name="ownerId"
+ column="OWNER_ID"
jdbc-type="BIGINT"
-
+ access="anonymous"
/>
<field-descriptor
- name="ojbConcreteClass"
- column="CLASS_NAME"
+ name="owner"
+ column="OWNER_CLASS_NAME"
jdbc-type="VARCHAR"
/>
@@ -1017,13 +623,10 @@
conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
/>
-
</class-descriptor>
-
-
<class-descriptor
- class="org.apache.jetspeed.om.impl.PortletDisplayNameImpl"
+ class="org.apache.jetspeed.om.portlet.impl.DisplayNameImpl"
table="LOCALIZED_DISPLAY_NAME"
>
@@ -1033,62 +636,19 @@
jdbc-type="BIGINT"
primarykey="true"
autoincrement="true"
+ access="anonymous"
/>
<field-descriptor
- name="parentId"
- column="OBJECT_ID"
- jdbc-type="BIGINT"
-
- />
-
- <field-descriptor
- name="ojbConcreteClass"
- column="CLASS_NAME"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="displayName"
- column="DISPLAY_NAME"
- jdbc-type="VARCHAR"
- />
-
- <field-descriptor
- name="locale"
- column="LOCALE_STRING"
- jdbc-type="VARCHAR"
- conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
- />
-
- </class-descriptor>
-
-
- <class-descriptor
- class="org.apache.jetspeed.om.impl.WebAppDisplayNameImpl"
- table="LOCALIZED_DISPLAY_NAME"
- >
-
- <field-descriptor
- name="id"
- column="ID"
- jdbc-type="BIGINT"
- primarykey="true"
- autoincrement="true"
-
- />
-
- <field-descriptor
- name="parentId"
- column="OBJECT_ID"
+ name="ownerId"
+ column="OWNER_ID"
jdbc-type="BIGINT"
-
+ access="anonymous"
/>
-
<field-descriptor
- name="ojbConcreteClass"
- column="CLASS_NAME"
+ name="owner"
+ column="OWNER_CLASS_NAME"
jdbc-type="VARCHAR"
/>
@@ -1105,10 +665,8 @@
conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
/>
-
</class-descriptor>
-
<!--
- P O R T L E T E N T I T Y
-->
@@ -1299,7 +857,7 @@
- S E C U R T I T Y R O L E R E F
-->
<class-descriptor
- class="org.apache.jetspeed.om.impl.SecurityRoleRefImpl"
+ class="org.apache.jetspeed.om.portlet.impl.SecurityRoleRefImpl"
table="SECURITY_ROLE_REFERENCE"
>
@@ -1310,7 +868,6 @@
primarykey="true"
autoincrement="true"
access="anonymous"
-
/>
<field-descriptor
@@ -1318,7 +875,6 @@
column="PORTLET_DEFINITION_ID"
jdbc-type="BIGINT"
access="anonymous"
-
/>
<field-descriptor
@@ -1335,13 +891,13 @@
<collection-descriptor
name="descriptions"
- element-class-ref="org.apache.jetspeed.om.impl.SecurityRoleRefDescriptionImpl"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.DescriptionImpl"
auto-delete="true"
auto-update = "true"
auto-retrieve = "true"
>
- <inverse-foreignkey field-ref="parentId"/>
+ <inverse-foreignkey field-ref="ownerId"/>
</collection-descriptor>
@@ -1351,7 +907,7 @@
- S E C U R I T Y R O L E
-->
<class-descriptor
- class="org.apache.jetspeed.om.servlet.impl.SecurityRoleImpl"
+ class="org.apache.jetspeed.om.portlet.impl.SecurityRoleImpl"
table="SECURITY_ROLE"
>
<field-descriptor
@@ -1364,31 +920,36 @@
/>
<field-descriptor
- name="webAppId"
- column="WEB_APPLICATION_ID"
+ name="appId"
+ column="APPLICATION_ID"
jdbc-type="BIGINT"
access="anonymous"
/>
<field-descriptor
- name="roleName"
+ name="name"
column="ROLE_NAME"
jdbc-type="VARCHAR"
/>
- <field-descriptor
- name="description"
- column="DESCRIPTION"
- jdbc-type="VARCHAR"
- />
+ <collection-descriptor
+ name="descriptions"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.DescriptionImpl"
+ auto-delete="true"
+ auto-update = "true"
+ auto-retrieve = "true"
+ >
+ <inverse-foreignkey field-ref="ownerId"/>
+ </collection-descriptor>
+
</class-descriptor>
<!--
- U S E R A T T R I B U T E R E F
-->
<class-descriptor
- class="org.apache.jetspeed.om.impl.UserAttributeRefImpl"
+ class="org.apache.jetspeed.om.portlet.impl.UserAttributeRefImpl"
table="USER_ATTRIBUTE_REF"
>
@@ -1405,6 +966,7 @@
name="appId"
column="APPLICATION_ID"
jdbc-type="BIGINT"
+ access="anonymous"
/>
<field-descriptor
@@ -1419,13 +981,24 @@
jdbc-type="VARCHAR"
/>
+ <collection-descriptor
+ name="descriptions"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.DescriptionImpl"
+ auto-delete="true"
+ auto-update = "true"
+ auto-retrieve = "true"
+
+ >
+ <inverse-foreignkey field-ref="ownerId"/>
+ </collection-descriptor>
+
</class-descriptor>
<!--
- U S E R A T T R I B U T E
-->
<class-descriptor
- class="org.apache.jetspeed.om.impl.UserAttributeImpl"
+ class="org.apache.jetspeed.om.portlet.impl.UserAttributeImpl"
table="USER_ATTRIBUTE"
>
@@ -1436,12 +1009,14 @@
primarykey="true"
autoincrement="true"
indexed="true"
+ access="anonymous"
/>
<field-descriptor
name="appId"
column="APPLICATION_ID"
jdbc-type="BIGINT"
+ access="anonymous"
/>
<field-descriptor
@@ -1450,12 +1025,17 @@
jdbc-type="VARCHAR"
/>
- <field-descriptor
- name="description"
- column="DESCRIPTION"
- jdbc-type="VARCHAR"
- />
+ <collection-descriptor
+ name="descriptions"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.DescriptionImpl"
+ auto-delete="true"
+ auto-update = "true"
+ auto-retrieve = "true"
+ >
+ <inverse-foreignkey field-ref="ownerId"/>
+ </collection-descriptor>
+
</class-descriptor>
@@ -1474,12 +1054,14 @@
primarykey="true"
autoincrement="true"
indexed="true"
+ access="anonymous"
/>
<field-descriptor
name="appId"
column="APPLICATION_ID"
jdbc-type="BIGINT"
+ access="anonymous"
/>
<field-descriptor
@@ -1494,12 +1076,17 @@
jdbc-type="VARCHAR"
/>
- <field-descriptor
- name="description"
- column="DESCRIPTION"
- jdbc-type="VARCHAR"
- />
+ <collection-descriptor
+ name="descriptions"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.DescriptionImpl"
+ auto-delete="true"
+ auto-update = "true"
+ auto-retrieve = "true"
+ >
+ <inverse-foreignkey field-ref="ownerId"/>
+ </collection-descriptor>
+
</class-descriptor>
@@ -1518,12 +1105,14 @@
primarykey="true"
autoincrement="true"
indexed="true"
+ access="anonymous"
/>
<field-descriptor
name="appId"
column="APPLICATION_ID"
jdbc-type="BIGINT"
+ access="anonymous"
/>
<field-descriptor
@@ -1538,12 +1127,17 @@
jdbc-type="VARCHAR"
/>
- <field-descriptor
- name="description"
- column="DESCRIPTION"
- jdbc-type="VARCHAR"
- />
+ <collection-descriptor
+ name="descriptions"
+ element-class-ref="org.apache.jetspeed.om.portlet.impl.DescriptionImpl"
+ auto-delete="true"
+ auto-update = "true"
+ auto-retrieve = "true"
+ >
+ <inverse-foreignkey field-ref="ownerId"/>
+ </collection-descriptor>
+
</class-descriptor>
@@ -1551,7 +1145,7 @@
- S E R V I C E S
-->
<class-descriptor
- class="org.apache.jetspeed.om.impl.JetspeedServiceReferenceImpl"
+ class="org.apache.jetspeed.om.portlet.impl.JetspeedServiceReferenceImpl"
table="JETSPEED_SERVICE"
>
@@ -1568,6 +1162,7 @@
name="appId"
column="APPLICATION_ID"
jdbc-type="BIGINT"
+ access="anonymous"
/>
<field-descriptor
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/descriptor/ExtendedDescriptorServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/descriptor/ExtendedDescriptorServiceImpl.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/descriptor/ExtendedDescriptorServiceImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/descriptor/ExtendedDescriptorServiceImpl.java Wed Oct 29 20:58:27 2008
@@ -26,8 +26,6 @@
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.jetspeed.om.portlet.ContainerRuntimeOption;
import org.apache.jetspeed.om.portlet.DisplayName;
@@ -52,20 +50,12 @@
import org.apache.jetspeed.om.portlet.jetspeed.jaxb.Portlet;
import org.apache.jetspeed.om.portlet.jetspeed.jaxb.PortletApp;
import org.apache.jetspeed.om.portlet.jetspeed.jaxb.Service;
-import org.apache.jetspeed.om.servlet.WebApplicationDefinition;
-import org.apache.jetspeed.om.servlet.impl.WebApplicationDefinitionImpl;
-import org.apache.jetspeed.tools.deploy.JetspeedWebApplicationRewriter;
-import org.apache.jetspeed.tools.deploy.JetspeedWebApplicationRewriterFactory;
import org.apache.jetspeed.util.JetspeedLocale;
import org.apache.pluto.descriptors.services.jaxb.PortletAppDescriptorServiceImpl;
import org.apache.pluto.om.portlet.CustomPortletMode;
import org.apache.pluto.om.portlet.CustomWindowState;
import org.apache.pluto.om.portlet.Description;
import org.apache.pluto.om.portlet.PortletApplicationDefinition;
-import org.w3c.dom.Document;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
/**
* Extends Pluto Descriptor service for loading portlet applications in a Jetspeed format.
@@ -449,59 +439,4 @@
throw new IOException(je.getMessage());
}
}
-
- public WebApplicationDefinition readServletDescriptor(InputStream is) throws IOException
- {
- Document doc = this.parseXml(is);
- JetspeedWebApplicationRewriterFactory rewriterFactory = new JetspeedWebApplicationRewriterFactory();
- try
- {
- JetspeedWebApplicationRewriter rewriter = rewriterFactory.getInstance(doc);
- // TODO: 2.2 implement this, get the security roles
-// digester.addCallMethod("web-app/security-role", "addRole", 0);
-// digester.addBeanPropertySetter("web-app/security-role/description", "description");
-// digester.addBeanPropertySetter("web-app/security-role/role-name", "roleName");
- WebApplicationDefinition webapp = new WebApplicationDefinitionImpl();
-// webapp.setContextRoot(contextRoot);
-// webapp.setDescription(contextRoot);
- return webapp;
- }
- catch (Exception e)
- {
- throw new IOException(e.getMessage());
- }
- }
-
- protected Document parseXml(InputStream source) throws IOException
- {
- try
- {
- DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
- domFactory.setNamespaceAware(true);
- DocumentBuilder builder = domFactory.newDocumentBuilder();
- builder.setEntityResolver(new EntityResolver()
- {
- public InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws SAXException,
- java.io.IOException
- {
- if (systemId.equals("http://java.sun.com/dtd/web-app_2_3.dtd"))
- {
- return new InputSource(getClass().getResourceAsStream("web-app_2_3.dtd"));
- }
- if (systemId.equals("http://java.sun.com/dtd/web-app_2_4.dtd"))
- {
- return new InputSource(getClass().getResourceAsStream("web-app_2_4.dtd"));
- }
- return null;
- }
- });
- Document document = builder.parse(source);
- return document;
- }
- catch (Exception e)
- {
- throw new IOException(e.toString());
- }
- }
-
}
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/FilterImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/FilterImpl.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/FilterImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/FilterImpl.java Wed Oct 29 20:58:27 2008
@@ -168,8 +168,7 @@
{
throw new IllegalArgumentException("Init parameter: "+paramName+" already defined");
}
- InitParamImpl param = new InitParamImpl();
- param.setParamName(paramName);
+ InitParamImpl param = new InitParamImpl(this, paramName);
getInitParams();
initParams.add(param);
return param;
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/InitParamImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/InitParamImpl.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/InitParamImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/InitParamImpl.java Wed Oct 29 20:58:27 2008
@@ -32,11 +32,21 @@
*/
public class InitParamImpl implements InitParam, Serializable
{
-
+ protected String owner;
private String name;
private String value;
protected List<Description> descriptions;
+ public InitParamImpl()
+ {
+ }
+
+ public InitParamImpl(Object owner, String name)
+ {
+ this.owner = owner.getClass().getName();
+ this.name = name;
+ }
+
public String getParamName()
{
return name;
@@ -62,7 +72,7 @@
if (obj != null && obj.getClass().equals(getClass()))
{
InitParamImpl p = (InitParamImpl) obj;
- return (name != null && p.getParamName() != null && name.equals(p.getParamName()));
+ return (name != null && p.getParamName() != null && name.equals(p.getParamName()) && owner != null && p.owner != null && owner.equals(p.owner));
}
return false;
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java Wed Oct 29 20:58:27 2008
@@ -23,6 +23,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import javax.portlet.PortletMode;
@@ -34,6 +35,8 @@
import org.apache.jetspeed.om.portlet.ContainerRuntimeOption;
import org.apache.jetspeed.om.portlet.CustomPortletMode;
import org.apache.jetspeed.om.portlet.CustomWindowState;
+import org.apache.jetspeed.om.portlet.Description;
+import org.apache.jetspeed.om.portlet.DisplayName;
import org.apache.jetspeed.om.portlet.EventDefinition;
import org.apache.jetspeed.om.portlet.Filter;
import org.apache.jetspeed.om.portlet.FilterMapping;
@@ -45,9 +48,9 @@
import org.apache.jetspeed.om.portlet.PortletDefinition;
import org.apache.jetspeed.om.portlet.PublicRenderParameter;
import org.apache.jetspeed.om.portlet.SecurityConstraint;
+import org.apache.jetspeed.om.portlet.SecurityRole;
import org.apache.jetspeed.om.portlet.UserAttribute;
import org.apache.jetspeed.om.portlet.UserAttributeRef;
-import org.apache.jetspeed.om.servlet.WebApplicationDefinition;
import org.apache.ojb.broker.PersistenceBroker;
import org.apache.ojb.broker.PersistenceBrokerAware;
import org.apache.ojb.broker.PersistenceBrokerException;
@@ -72,10 +75,9 @@
/** Holds value of property name. */
private String name;
-
- /** WebApplication property */
- private transient WebApplicationDefinition webApplication;
+ private String contextRoot;
+
/** Metadata property */
private Collection<LocalizedField> metadataFields = null;
@@ -87,6 +89,9 @@
private String jetspeedSecurityConstraint;
+ private List<Description> descriptions;
+ private List<DisplayName> displayNames;
+ private List<SecurityRole> roles;
private List<PortletDefinition> portlets;
private List<EventDefinition> eventDefinitions;
private List<PublicRenderParameter> publicRenderParameters;
@@ -187,6 +192,16 @@
this.revision = revision;
}
+ public void setContextRoot(String contextRoot)
+ {
+ this.contextRoot = contextRoot;
+ }
+
+ public String getContextRoot()
+ {
+ return contextRoot;
+ }
+
public String getDefaultNamespace()
{
return defaultNamespace;
@@ -243,15 +258,94 @@
return metadata;
}
- public WebApplicationDefinition getWebApplicationDefinition()
+ public Description getDescription(Locale locale)
{
- return webApplication;
+ for (Description d : getDescriptions())
+ {
+ if (d.getLocale().equals(locale))
+ {
+ return d;
+ }
+ }
+ return null;
+ }
+
+ public List<Description> getDescriptions()
+ {
+ if (descriptions == null)
+ {
+ descriptions = new ArrayList<Description>();
+ }
+ return descriptions;
+ }
+
+ public Description addDescription(String lang)
+ {
+ DescriptionImpl d = new DescriptionImpl(this, lang);
+ if (getDescription(d.getLocale()) != null)
+ {
+ throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
+ }
+ getDescriptions();
+ descriptions.add(d);
+ return d;
}
- public void setWebApplicationDefinition(WebApplicationDefinition wad)
+ public DisplayName getDisplayName(Locale locale)
{
- this.webApplication = wad;
+ for (DisplayName d : getDisplayNames())
+ {
+ if (d.getLocale().equals(locale))
+ {
+ return d;
+ }
+ }
+ return null;
+ }
+
+ public List<DisplayName> getDisplayNames()
+ {
+ if (displayNames == null)
+ {
+ displayNames = new ArrayList<DisplayName>();
+ }
+ return displayNames;
+ }
+
+ public DisplayName addDisplayName(String lang)
+ {
+ DisplayNameImpl d = new DisplayNameImpl(this, lang);
+ if (getDisplayName(d.getLocale()) != null)
+ {
+ throw new IllegalArgumentException("DisplayName for language: "+d.getLocale()+" already defined");
+ }
+ getDisplayNames();
+ displayNames.add(d);
+ return d;
+ }
+ public List<SecurityRole> getSecurityRoles()
+ {
+ if (roles == null)
+ {
+ roles = new ArrayList<SecurityRole>();
+ }
+ return roles;
+ }
+
+ public SecurityRole addSecurityRole(String name)
+ {
+ for (SecurityRole role : getSecurityRoles())
+ {
+ if (role.getName().equals(name))
+ {
+ throw new IllegalArgumentException("Security Role "+name+" already defined");
+ }
+ }
+ SecurityRoleImpl role = new SecurityRoleImpl();
+ role.setName(name);
+ roles.add(role);
+ return role;
}
public PortletDefinition getPortlet(String portletName)
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java Wed Oct 29 20:58:27 2008
@@ -764,8 +764,7 @@
{
throw new IllegalArgumentException("Init parameter: "+paramName+" already defined");
}
- InitParamImpl param = new InitParamImpl();
- param.setParamName(paramName);
+ InitParamImpl param = new InitParamImpl(this, paramName);
getInitParams();
initParams.add(param);
return param;
Added: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/SecurityRoleImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/SecurityRoleImpl.java?rev=709083&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/SecurityRoleImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/SecurityRoleImpl.java Wed Oct 29 20:58:27 2008
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.portlet.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.jetspeed.om.portlet.Description;
+import org.apache.jetspeed.om.portlet.SecurityRole;
+
+/**
+ *
+ * @version: $Id$
+ */
+public class SecurityRoleImpl implements SecurityRole
+{
+ private String name;
+ protected List<Description> descriptions;
+
+ public SecurityRoleImpl()
+ {
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public Description getDescription(Locale locale)
+ {
+ for (Description d : getDescriptions())
+ {
+ if (d.getLocale().equals(locale))
+ {
+ return d;
+ }
+ }
+ return null;
+ }
+
+ public List<Description> getDescriptions()
+ {
+ if (descriptions == null)
+ {
+ descriptions = new ArrayList<Description>();
+ }
+ return descriptions;
+ }
+
+ public Description addDescription(String lang)
+ {
+ DescriptionImpl d = new DescriptionImpl(this, lang);
+ if (getDescription(d.getLocale()) != null)
+ {
+ throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
+ }
+ getDescriptions();
+ descriptions.add(d);
+ return d;
+ }
+}
Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/SecurityRoleImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/SecurityRoleImpl.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/SecurityRoleImpl.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java Wed Oct 29 20:58:27 2008
@@ -29,7 +29,6 @@
import org.apache.jetspeed.om.portlet.PortletDefinition;
import org.apache.jetspeed.om.portlet.impl.DublinCoreImpl;
import org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl;
-import org.apache.jetspeed.om.servlet.impl.WebApplicationDefinitionImpl;
/**
* @author scott
@@ -126,7 +125,6 @@
app = registry.getPortletApplication("App_1");
- webApp = (WebApplicationDefinitionImpl) app.getWebApplicationDefinition();
portlet = (PortletDefinitionImpl) app.getPortletDefinitionByName("Portlet 1");
assertNotNull("Failed to reteive portlet application", app);
@@ -138,7 +136,6 @@
System.out.println("services is " + services);
assertNotNull("Failed to reteive portlet application via registry", registry.getPortletApplication("App_1"));
- assertNotNull("Web app was not saved along with the portlet app.", webApp);
assertNotNull("Portlet was not saved along with the portlet app.", app.getPortletDefinitionByName("Portlet 1"));
if (!afterUpdates)
{
@@ -159,8 +156,8 @@
assertNotNull("Portlet Application was not set in the portlet defintion.", portlet
.getApplication());
- assertNotNull("French description was not materialized for the web app.", webApp.getDescription(Locale.FRENCH));
- assertNotNull("French display name was not materialized for the web app.", webApp.getDisplayName(Locale.FRENCH));
+ assertNotNull("French description was not materialized for the app.", app.getDescription(Locale.FRENCH));
+ assertNotNull("French display name was not materialized for the app.", app.getDisplayName(Locale.FRENCH));
assertNotNull("description was not materialized for the portlet.", portlet.getDescription(Locale.getDefault()));
assertNotNull("display name was not materialized for the portlet.", portlet.getDisplayName(Locale.getDefault()));
assertNotNull("\"testparam\" portlet parameter was not saved", portlet.getInitParameterSet().get("testparam"));
@@ -184,17 +181,11 @@
app = registry.getPortletApplication("App_1");
- webApp = (WebApplicationDefinitionImpl) app.getWebApplicationDefinition();
- assertNotNull("Web app was not located by query.", webApp);
- webApp.addDescription(Locale.getDefault(), "Web app description");
-
- webApp = null;
+ app.addDescription(Locale.getDefault().toString()).setDescription("Web app description");
app = registry.getPortletApplication("App_1");
- webApp = (WebApplicationDefinitionImpl) app.getWebApplicationDefinition();
- assertNotNull("Web app was not located by query.", webApp);
- assertNotNull("Web app did NOT persist its description", webApp.getDescription(Locale.FRENCH));
+ assertNotNull("App did NOT persist its description", app.getDescription(Locale.FRENCH));
}
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java Wed Oct 29 20:58:27 2008
@@ -42,7 +42,6 @@
import org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl;
import org.apache.jetspeed.om.portlet.impl.UserAttributeImpl;
import org.apache.jetspeed.om.portlet.impl.UserAttributeRefImpl;
-import org.apache.jetspeed.om.servlet.impl.WebApplicationDefinitionImpl;
import org.apache.jetspeed.util.JetspeedLocale;
import org.apache.pluto.om.portlet.PreferenceSetCtrl;
import org.apache.pluto.om.portlet.PortletApplicationDefinition;
@@ -232,7 +231,6 @@
assertNotNull(app);
- webApp = (WebApplicationDefinitionImpl) app.getWebApplicationDefinition();
portlet = (PortletDefinitionImpl) app.getPortletDefinitionByName("Portlet 1");
assertNotNull("Failed to reteive portlet application", app);
@@ -245,7 +243,6 @@
assertNotNull("Failed to reteive portlet application via registry", portletRegistry
.getPortletApplication("App_1"));
- assertNotNull("Web app was not saved along with the portlet app.", webApp);
assertNotNull("Portlet was not saved along with the portlet app.", app.getPortletDefinitionByName("Portlet 1"));
if (!afterUpdates)
{
@@ -266,8 +263,8 @@
assertNotNull("Portlet Application was not set in the portlet defintion.", portlet
.getApplication());
- assertNotNull("French description was not materialized for the web app.", webApp.getDescription(Locale.FRENCH));
- assertNotNull("French display name was not materialized for the web app.", webApp.getDisplayName(Locale.FRENCH));
+ assertNotNull("French description was not materialized for the app.", app.getDescription(Locale.FRENCH));
+ assertNotNull("French display name was not materialized for the app.", app.getDisplayName(Locale.FRENCH));
assertNotNull("description was not materialized for the portlet.", portlet.getDescription(Locale.getDefault()));
assertNotNull("display name was not materialized for the portlet.", portlet.getDisplayName(Locale.getDefault()));
assertNotNull("\"testparam\" portlet parameter was not saved", portlet.getInitParameterSet().get("testparam"));
@@ -285,22 +282,14 @@
}
assertEquals("\"preference 1\" did not have 2 values.", 2, valueCount);
- // Pull out our Web app and add a Description to it
- webApp = null;
-
app = portletRegistry.getPortletApplication("App_1");
- webApp = (WebApplicationDefinitionImpl) app.getWebApplicationDefinition();
assertNotNull("Web app was not located by query.", webApp);
- webApp.addDescription(Locale.getDefault(), "Web app description");
-
- webApp = null;
+ app.addDescription(Locale.getDefault().toString()).setDescription("Web app description");
app = portletRegistry.getPortletApplication("App_1");
- webApp = (WebApplicationDefinitionImpl) app.getWebApplicationDefinition();
- assertNotNull("Web app was not located by query.", webApp);
- assertNotNull("Web app did NOT persist its description", webApp.getDescription(Locale.FRENCH));
+ assertNotNull("App did NOT persist its description", app.getDescription(Locale.FRENCH));
}
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-search/src/main/java/org/apache/jetspeed/search/handlers/pam/PortletApplicationHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-search/src/main/java/org/apache/jetspeed/search/handlers/pam/PortletApplicationHandler.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-search/src/main/java/org/apache/jetspeed/search/handlers/pam/PortletApplicationHandler.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-search/src/main/java/org/apache/jetspeed/search/handlers/pam/PortletApplicationHandler.java Wed Oct 29 20:58:27 2008
@@ -22,9 +22,11 @@
import org.apache.commons.collections.MultiHashMap;
import org.apache.jetspeed.om.portlet.LocalizedField;
import org.apache.jetspeed.om.portlet.PortletApplication;
+import org.apache.jetspeed.om.portlet.Description;
import org.apache.jetspeed.search.AbstractObjectHandler;
import org.apache.jetspeed.search.BaseParsedObject;
import org.apache.jetspeed.search.ParsedObject;
+import org.apache.jetspeed.util.JetspeedLocale;
/**
*
@@ -51,7 +53,11 @@
result = new BaseParsedObject();
PortletApplication pa = (PortletApplication) o;
- result.setDescription(pa.getDescription());
+ Description defaultDescription = pa.getDescription(JetspeedLocale.getDefaultLocale());
+ if (defaultDescription != null)
+ {
+ result.setDescription(defaultDescription.getDescription());
+ }
result.setTitle(pa.getName());
result.setKey(KEY_PREFIX + pa.getName());
result.setType(ParsedObject.OBJECT_TYPE_PORTLET_APPLICATION);
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/descriptor/ExtendedDescriptorService.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/descriptor/ExtendedDescriptorService.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/descriptor/ExtendedDescriptorService.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/descriptor/ExtendedDescriptorService.java Wed Oct 29 20:58:27 2008
@@ -21,7 +21,6 @@
import java.io.OutputStream;
import org.apache.jetspeed.om.portlet.PortletApplication;
-import org.apache.jetspeed.om.servlet.WebApplicationDefinition;
import org.apache.pluto.spi.optional.PortletAppDescriptorService;
@@ -57,7 +56,4 @@
void write(PortletApplication portletDescriptor, OutputStream out) throws IOException;
void readExtended(InputStream in, PortletApplication app) throws IOException;
-
- public WebApplicationDefinition readServletDescriptor(InputStream is) throws IOException;
-
}
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/PortletApplication.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/PortletApplication.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/PortletApplication.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/PortletApplication.java Wed Oct 29 20:58:27 2008
@@ -18,12 +18,12 @@
import java.io.Serializable;
import java.util.List;
+import java.util.Locale;
import javax.portlet.PortletMode;
import javax.portlet.WindowState;
import javax.xml.namespace.QName;
-import org.apache.jetspeed.om.servlet.WebApplicationDefinition;
import org.apache.pluto.om.portlet.PortletApplicationDefinition;
@@ -39,6 +39,9 @@
*/
public interface PortletApplication extends PortletApplicationDefinition, Serializable
{
+ String getContextRoot();
+ void setContextRoot(String contextRoot);
+
/**
* Marks this application as a standard web application,
* stored in the web application server's web application space.
@@ -118,17 +121,17 @@
*/
void setJetspeedSecurityConstraint(String constraint);
- String getDescription();
- void setDescription(String description);
-
- /**
- * Returns the corresponding web application to this portlet application.
- * The return value cannot be NULL.
- *
- * @return a web application
- */
- public WebApplicationDefinition getWebApplicationDefinition();
-
+ Description getDescription(Locale locale);
+ List<Description> getDescriptions();
+ Description addDescription(String lang);
+
+ DisplayName getDisplayName(Locale locale);
+ List<DisplayName> getDisplayNames();
+ DisplayName addDisplayName(String lang);
+
+ List<SecurityRole> getSecurityRoles();
+ SecurityRole addSecurityRole(String name);
+
/**
* Returns the metadata from the extended jetspeed-portlet.xml
* The return value cannot be NULL
Added: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/SecurityRole.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/SecurityRole.java?rev=709083&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/SecurityRole.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/SecurityRole.java Wed Oct 29 20:58:27 2008
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jetspeed.om.portlet;
+
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * @version $Id$
+ *
+ */
+public interface SecurityRole
+{
+ String getName();
+
+ Description getDescription(Locale locale);
+ List<? extends Description> getDescriptions();
+ Description addDescription(String lang);
+}
Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/SecurityRole.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/SecurityRole.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/SecurityRole.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletObjectProxy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletObjectProxy.java?rev=709083&r1=709082&r2=709083&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletObjectProxy.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletObjectProxy.java Wed Oct 29 20:58:27 2008
@@ -47,7 +47,6 @@
import org.apache.jetspeed.om.portlet.PortletApplication;
import org.apache.jetspeed.om.portlet.PortletDefinition;
import org.apache.jetspeed.om.portlet.Supports;
-import org.apache.jetspeed.om.servlet.WebApplicationDefinition;
import org.apache.jetspeed.factory.PortletFactory;
import org.apache.jetspeed.factory.PortletInstance;
@@ -315,8 +314,7 @@
PortletDefinition portletDef = (PortletDefinition) registry.getPortletDefinitionByUniqueName(this.customConfigModePortletUniqueName);
PortletApplication portletApp = (PortletApplication) portletDef.getApplication();
- WebApplicationDefinition webAppDef = portletApp.getWebApplicationDefinition();
- String portletAppName = webAppDef.getContextRoot();
+ String portletAppName = portletApp.getContextRoot();
ServletContext portletAppContext = portalAppContext.getContext(portletAppName);
setPortletObjectProxied(true);
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org