Author: julien(a)jboss.com
Date: 2007-05-09 05:58:43 -0400 (Wed, 09 May 2007)
New Revision: 7227
Added:
trunk/demo/src/resources/portal-demo-sar/
trunk/demo/src/resources/portal-demo-sar/META-INF/
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
- minor code reorg in portal object container
- no need to inject CustomizationManager in portal object container anymore as it is used
by the internal portlet content provider instead
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java 2007-05-09
09:27:25 UTC (rev 7226)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java 2007-05-09
09:58:43 UTC (rev 7227)
@@ -29,7 +29,6 @@
import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.content.spi.ContentProviderRegistry;
import org.jboss.portal.core.model.content.spi.ContentProvider;
-import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.core.model.content.spi.handler.ContentHandler;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.security.PortalPermission;
@@ -58,25 +57,12 @@
private PortalObjectIdImpl rootId = new PortalObjectIdImpl();
/** . */
- private InstanceContainer instanceContainer;
-
- /** . */
private ContentProviderRegistry contentProviderRegistry;
protected AbstractPortalObjectContainer()
{
}
- public InstanceContainer getInstanceContainer()
- {
- return instanceContainer;
- }
-
- public void setInstanceContainer(InstanceContainer instanceContainer)
- {
- this.instanceContainer = instanceContainer;
- }
-
public ContentProviderRegistry getContentProviderRegistry()
{
return contentProviderRegistry;
@@ -87,11 +73,39 @@
this.contentProviderRegistry = contentProviderRegistry;
}
+ // PortalObjectContainer
implementation******************************************************************************
+
public PortalObject getRootObject()
{
return getObject(rootId);
}
+ public PortalObject getObject(PortalObjectId id) throws IllegalArgumentException
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException("No null id accepted " + id);
+ }
+ ObjectNode node;
+ if (id instanceof PortalObjectIdImpl)
+ {
+ node = getObjectNode((PortalObjectIdImpl)id);
+ }
+ else
+ {
+ PortalObjectIdImpl poid = new PortalObjectIdImpl(id);
+ node = getObjectNode(poid);
+ }
+ return node == null ? null : node.getObject();
+ }
+
+ public AuthorizationDomain getAuthorizationDomain()
+ {
+ return this;
+ }
+
+ // AuthorizationDomain implementation
*******************************************************************************
+
public String getType()
{
return PortalObjectPermission.PERMISSION_TYPE;
@@ -112,6 +126,8 @@
return this;
}
+ // PermissionFactory implementation
*********************************************************************************
+
public PortalPermission createPermissionContainer(PortalPermissionCollection
collection) throws PortalSecurityException
{
return new PortalObjectPermission(collection);
@@ -129,27 +145,8 @@
return new PortalObjectPermission(id, actions);
}
- public PortalObject getObject(PortalObjectId id) throws IllegalArgumentException
- {
- if (id == null)
- {
- throw new IllegalArgumentException("No null id accepted " + id);
- }
- ObjectNode node;
- if (id instanceof PortalObjectIdImpl)
- {
- node = getObjectNode((PortalObjectIdImpl)id);
- }
- else
- {
- PortalObjectIdImpl poid = new PortalObjectIdImpl(id);
- node = getObjectNode(poid);
- }
- return node == null ? null : node.getObject();
- }
+ // PermissionRepository implementation
******************************************************************************
- protected abstract ObjectNode getObjectNode(PortalObjectIdImpl id);
-
public PortalPermission getPermission(String roleName, String uri) throws
PortalSecurityException
{
PortalObjectIdImpl id = new PortalObjectIdImpl(PortalObjectId.parse(uri,
PortalObjectId.CANONICAL_FORMAT));
@@ -165,6 +162,8 @@
return null;
}
+ // DomainConfigurator implementation
********************************************************************************
+
public void removeSecurityBindings(String uri) throws SecurityConfigurationException
{
PortalObjectIdImpl id = new PortalObjectIdImpl(PortalObjectId.parse(uri,
PortalObjectId.CANONICAL_FORMAT));
@@ -201,6 +200,16 @@
}
}
+ //
******************************************************************************************************************
+
+ /**
+ * Must be subclasses to provide the access to a node.
+ *
+ * @param id the portal object id
+ * @return a node or null if not found
+ */
+ protected abstract ObjectNode getObjectNode(PortalObjectIdImpl id);
+
public class Context
{
/**
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java 2007-05-09
09:27:25 UTC (rev 7226)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java 2007-05-09
09:58:43 UTC (rev 7227)
@@ -204,11 +204,6 @@
sessionFactory = null;
}
- public AuthorizationDomain getAuthorizationDomain()
- {
- return this;
- }
-
public boolean createRootIfNotExist() throws Exception
{
log.debug("Detecting the existence of the portal object root context");
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java 2007-05-09
09:27:25 UTC (rev 7226)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java 2007-05-09
09:58:43 UTC (rev 7227)
@@ -54,12 +54,6 @@
ctx.setObjectNode(root);
}
- /** @see PortalObjectContainer#getAuthorizationDomain() */
- public AuthorizationDomain getAuthorizationDomain()
- {
- throw new IllegalStateException("Unimplemented");
- }
-
protected ObjectNode getObjectNode(PortalObjectIdImpl id)
{
ObjectNode node = root;
Modified:
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-05-09
09:27:25 UTC (rev 7226)
+++
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-05-09
09:58:43 UTC (rev 7227)
@@ -242,6 +242,11 @@
TransactionAssert.commitTransaction();
}
+ public void testPortalNode() throws Exception
+ {
+
+ }
+
public void testRecreate() throws Exception
{
PortalObjectId defaultId = new PortalObjectId(new String[]{"default"});
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-05-09
09:27:25 UTC (rev 7226)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-05-09
09:58:43 UTC (rev 7227)
@@ -596,9 +596,6 @@
optional-attribute-name="AuthorizationDomainRegistry"
proxy-type="attribute">portal:service=AuthorizationDomainRegistry</depends>
<depends
- optional-attribute-name="InstanceContainer"
- proxy-type="attribute">portal:container=Instance</depends>
- <depends
optional-attribute-name="ContentProviderRegistry"
proxy-type="attribute">portal:service=ContentProviderRegistry</depends>
<attribute
name="SessionFactoryJNDIName">java:/portal/PortalObjectSessionFactory</attribute>
Show replies by date