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 rw...@apache.org on 2009/10/22 03:23:07 UTC
svn commit: r828270 [3/4] - in
/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4: ./
components/file-cache/src/java/org/apache/jetspeed/cache/file/
components/page-manager/ components/page-manager/src/java/JETSPEED-INF/ojb/
components/page-manager/src...
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManagerUtils.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManagerUtils.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManagerUtils.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManagerUtils.java Thu Oct 22 01:23:05 2009
@@ -1,57 +1,68 @@
-/*
+/*
* 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.page.impl;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ojb.broker.util.collections.RemovalAwareCollection;
-import org.apache.ojb.broker.util.collections.RemovalAwareList;
-
-
-/**
- * DatabasePageManagerUtils
- *
- * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: $
- */
-public class DatabasePageManagerUtils
-{
- protected static Log log = LogFactory.getLog(DatabasePageManagerUtils.class);
-
- /**
- * OJB 1.0.3 requires collections to be removal aware.
- * Thus we can't seem to get away with just creating ArrayLists
- * This issue on occurs when persisting newly create object collections
- * When persisting objects retrieved with OJB, this issue does not occur
- *
- * @see JS2-590
- * @return
- */
- public static final Collection createCollection()
- {
- return java.util.Collections.synchronizedCollection(new RemovalAwareCollection());
- }
-
- public static final List createList()
- {
- return java.util.Collections.synchronizedList(new RemovalAwareList());
- }
-
-}
+ * 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.page.impl;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.util.ojb.CollectionUtils;
+
+
+/**
+ * DatabasePageManagerUtils
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class DatabasePageManagerUtils
+{
+ protected static Log log = LogFactory.getLog(DatabasePageManagerUtils.class);
+
+ /**
+ * OJB 1.0.3 requires collections to be removal aware.
+ * Thus we can't seem to get away with just creating ArrayLists
+ * This issue on occurs when persisting newly create object collections
+ * When persisting objects retrieved with OJB, this issue does not occur
+ *
+ * @see JS2-590
+ * @return
+ */
+
+ public static final Collection createCollection()
+ {
+ // return synchronized manageable/removal aware collection;
+ // requires setting collection-class attributes for collection-
+ // descriptor OJB mappings:
+ //
+ // <collection-descriptor ... collection-class="org.apache.jetspeed.util.ojb.CollectionUtils$SynchronizedRemovalAwareCollection">
+ //
+ return CollectionUtils.createSynchronizedCollection();
+ }
+
+ public static final List createList()
+ {
+ // return synchronized manageable/removal aware list;
+ // requires setting collection-class attributes for collection-
+ // descriptor OJB mappings:
+ //
+ // <collection-descriptor ... collection-class="org.apache.jetspeed.util.ojb.CollectionUtils$SynchronizedRemovalAwareList">
+ //
+ return CollectionUtils.createSynchronizedList();
+ }
+}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java Thu Oct 22 01:23:05 2009
@@ -908,6 +908,20 @@
fileCache.evictAll();
}
+ /* (non-Javadoc)
+ * @see org.apache.jetspeed.page.PageManager#shutdown()
+ */
+ public void shutdown()
+ {
+ // propagate to super
+ super.shutdown();
+ // disconnect cache listener
+ fileCache.removeListener(this);
+ // propagate to handlers
+ handlerFactory.shutdown();
+ folderHandler.shutdown();
+ }
+
/**
* <p>
* getNodeFolder - get folder implementation associated with specifed path
Added: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/castor.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/castor.properties?rev=828270&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/castor.properties (added)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/page-manager/src/test/castor.properties Thu Oct 22 01:23:05 2009
@@ -0,0 +1,19 @@
+# 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.
+
+# Defines the XML parser to be used by Castor.
+# The parser must implement org.xml.sax.Parser.
+org.exolab.castor.parser=org.xml.sax.helpers.XMLReaderAdapter
+
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java Thu Oct 22 01:23:05 2009
@@ -17,6 +17,7 @@
package org.apache.jetspeed.om.folder.proxy;
import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
@@ -294,8 +295,15 @@
throw new RuntimeException("Folder instance is immutable from proxy.");
}
- // attempt to invoke method on delegate Folder instance
- return m.invoke(defaultFolder, args);
+ try
+ {
+ // attempt to invoke method on delegate Folder instance
+ return m.invoke(defaultFolder, args);
+ }
+ catch (InvocationTargetException ite)
+ {
+ throw ite.getTargetException();
+ }
}
/**
@@ -554,6 +562,104 @@
}
/**
+ * checkAccessToFolderNotFound - checks security access to child folder
+ * nodes not found in aggregated children
+ * site view when accessed directly; folders
+ * part of the view are by definition
+ * accessible
+ *
+ * @throws SecurityException if view access to folder not granted
+ */
+ public void checkAccessToFolderNotFound(String folderName)
+ {
+ try
+ {
+ // check access on concrete child in all search folders
+ Iterator foldersIter = getSearchFolders().iterator();
+ while (foldersIter.hasNext())
+ {
+ // test access against child in search folder
+ SearchFolder searchFolder = (SearchFolder)foldersIter.next();
+ Folder folder = searchFolder.folder;
+ // ignore all folder access exceptions, (throws SecurityException on failed check access)
+ try
+ {
+ folder.getFolder(folderName);
+ }
+ catch (DocumentException de)
+ {
+ }
+ catch (FolderNotFoundException fnfe)
+ {
+ }
+ }
+ }
+ catch (FolderNotFoundException fnfe)
+ {
+ }
+ }
+
+ /**
+ * checkAccessToNodeNotFound - checks security access to child node
+ * nodes not found in aggregated children
+ * site view when accessed directly; pages,
+ * folders, and links part of the view are
+ * by definition accessible
+ *
+ * @throws SecurityException if view access to node not granted
+ */
+ public void checkAccessToNodeNotFound(String nodeName)
+ {
+ try
+ {
+ // check access on concrete child in all search folders
+ Iterator foldersIter = getSearchFolders().iterator();
+ while (foldersIter.hasNext())
+ {
+ // test access against child in search folder
+ SearchFolder searchFolder = (SearchFolder)foldersIter.next();
+ Folder folder = searchFolder.folder;
+ // ignore all folder access exceptions, (throws SecurityException on failed check access)
+ try
+ {
+ folder.getFolder(nodeName);
+ }
+ catch (DocumentException de)
+ {
+ }
+ catch (FolderNotFoundException fnfe)
+ {
+ }
+ // ignore all page access exceptions, (throws SecurityException on failed check access)
+ try
+ {
+ folder.getPage(nodeName);
+ }
+ catch (NodeException ne)
+ {
+ }
+ catch (PageNotFoundException ne)
+ {
+ }
+ // ignore all link access exceptions, (throws SecurityException on failed check access)
+ try
+ {
+ folder.getLink(nodeName);
+ }
+ catch (NodeException ne)
+ {
+ }
+ catch (DocumentNotFoundException ne)
+ {
+ }
+ }
+ }
+ catch (FolderNotFoundException fnfe)
+ {
+ }
+ }
+
+ /**
* aggregateMenuDefinitionLocators - aggregate all menu definition locators
* in site view for this folder or page
*/
@@ -995,4 +1101,24 @@
}
throw new FolderNotFoundException("Inheritance folders at " + getPath() + " not found or accessible");
}
+
+ /**
+ * getFolderProxy - utility method to access FolderProxy handler
+ * from Folder proxy instance
+ *
+ * @param folder folder proxy instance
+ * @return folder proxy invocation handler instance
+ */
+ public static FolderProxy getFolderProxy(Object folder)
+ {
+ if ((folder != null) && Proxy.isProxyClass(folder.getClass()))
+ {
+ Object folderProxyHandler = Proxy.getInvocationHandler(folder);
+ if (folderProxyHandler instanceof FolderProxy)
+ {
+ return (FolderProxy)folderProxyHandler;
+ }
+ }
+ return null;
+ }
}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/om/page/proxy/LinkProxy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/om/page/proxy/LinkProxy.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/om/page/proxy/LinkProxy.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/om/page/proxy/LinkProxy.java Thu Oct 22 01:23:05 2009
@@ -17,6 +17,7 @@
package org.apache.jetspeed.om.page.proxy;
import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
@@ -112,8 +113,15 @@
throw new RuntimeException("Link instance is immutable from proxy.");
}
- // attempt to invoke method on delegate Link instance
- return m.invoke(link, args);
+ try
+ {
+ // attempt to invoke method on delegate Link instance
+ return m.invoke(link, args);
+ }
+ catch (InvocationTargetException ite)
+ {
+ throw ite.getTargetException();
+ }
}
/**
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/om/page/proxy/PageProxy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/om/page/proxy/PageProxy.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/om/page/proxy/PageProxy.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/om/page/proxy/PageProxy.java Thu Oct 22 01:23:05 2009
@@ -17,6 +17,7 @@
package org.apache.jetspeed.om.page.proxy;
import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
@@ -126,8 +127,15 @@
throw new RuntimeException("Page instance is immutable from proxy.");
}
- // attempt to invoke method on delegate Page instance
- return m.invoke(page, args);
+ try
+ {
+ // attempt to invoke method on delegate Page instance
+ return m.invoke(page, args);
+ }
+ catch (InvocationTargetException ite)
+ {
+ throw ite.getTargetException();
+ }
}
/**
@@ -152,7 +160,7 @@
// folder menu definitions include standard menu definition
// locator defaults
mergeMenuDefinitionLocators(page.getMenuDefinitions(), page);
- FolderProxy parentFolderProxy = (FolderProxy)Proxy.getInvocationHandler(getParent());
+ FolderProxy parentFolderProxy = FolderProxy.getFolderProxy(getParent());
mergeMenuDefinitionLocators(parentFolderProxy.getMenuDefinitionLocators());
}
}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/page/document/proxy/NodeProxy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/page/document/proxy/NodeProxy.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/page/document/proxy/NodeProxy.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/page/document/proxy/NodeProxy.java Thu Oct 22 01:23:05 2009
@@ -16,12 +16,14 @@
*/
package org.apache.jetspeed.page.document.proxy;
+import java.io.UnsupportedEncodingException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
+import java.net.URLEncoder;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import java.util.Collections;
import org.apache.jetspeed.om.folder.Folder;
import org.apache.jetspeed.om.folder.MenuDefinition;
@@ -40,6 +42,11 @@
public abstract class NodeProxy extends SiteViewProxy
{
/**
+ * URL_ENCODING - the name of a character encoding to be used in encoding path component name.
+ */
+ private static final String URL_ENCODING = "ISO-8859-1";
+
+ /**
* *_METHOD - Node method constants
*/
protected static final Method EQUALS_METHOD = reflectMethod(Object.class, "equals", new Class[]{Object.class});
@@ -61,6 +68,11 @@
private String path;
/**
+ * url - view url
+ */
+ private String url;
+
+ /**
* hidden - hidden status of this or parent node
*/
private boolean hidden;
@@ -103,23 +115,40 @@
{
super(view, locatorName);
this.parent = parent;
+
if ((parent != null) && (name != null))
{
NodeProxy parentProxy = getNodeProxy(parent);
String parentPath = parentProxy.getPath();
+ String parentUrl = parentProxy.getUrl();
+ String urlEncodedName = name;
+
+ try
+ {
+ urlEncodedName = URLEncoder.encode(name, URL_ENCODING);
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ // do nothing. just use the plain name instead.
+ }
+
if (parentPath.endsWith(Folder.PATH_SEPARATOR))
{
this.path = parentPath + name;
+ this.url = parentUrl + urlEncodedName;
}
else
{
this.path = parentPath + Folder.PATH_SEPARATOR + name;
+ this.url = parentUrl + Folder.PATH_SEPARATOR + urlEncodedName;
}
+
this.hidden = (hidden || parentProxy.isHidden());
}
else
{
this.path = Folder.PATH_SEPARATOR;
+ this.url = Folder.PATH_SEPARATOR;
this.hidden = hidden;
}
}
@@ -161,7 +190,7 @@
*/
public String getUrl()
{
- return path;
+ return url;
}
/**
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java Thu Oct 22 01:23:05 2009
@@ -803,7 +803,7 @@
debug.append("null");
}
debug.append(")");
- log.debug(debug);
+ log.debug(debug.toString());
}
// return valid
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java Thu Oct 22 01:23:05 2009
@@ -738,6 +738,9 @@
}
catch (NodeNotFoundException nnfe)
{
+ // check security access to folder not found in site view
+ FolderProxy.getFolderProxy(currentFolder).checkAccessToFolderNotFound(subfolder);
+ // folder not found in site view
NodeNotFoundException nnfeWrapper = new NodeNotFoundException("Specified path " + path + " not found.");
nnfeWrapper.initCause(nnfe);
throw nnfeWrapper;
@@ -768,6 +771,9 @@
nnfe.initCause(ne);
throw nnfe;
}
+ // check security access to folder node not found in site view
+ FolderProxy.getFolderProxy(currentFolder).checkAccessToNodeNotFound(currentPath);
+ // folder node not found in site view
throw new NodeNotFoundException("Specified path " + path + " not found or viewable/visible.");
}
}
Added: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/test/castor.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/test/castor.properties?rev=828270&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/test/castor.properties (added)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal-site/src/test/castor.properties Thu Oct 22 01:23:05 2009
@@ -0,0 +1,19 @@
+# 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.
+
+# Defines the XML parser to be used by Castor.
+# The parser must implement org.xml.sax.Parser.
+org.exolab.castor.parser=org.xml.sax.helpers.XMLReaderAdapter
+
Added: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/test/castor.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/test/castor.properties?rev=828270&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/test/castor.properties (added)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/portal/src/test/castor.properties Thu Oct 22 01:23:05 2009
@@ -0,0 +1,19 @@
+# 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.
+
+# Defines the XML parser to be used by Castor.
+# The parser must implement org.xml.sax.Parser.
+org.exolab.castor.parser=org.xml.sax.helpers.XMLReaderAdapter
+
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/JETSPEED-INF/ojb/profiler_repository.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/JETSPEED-INF/ojb/profiler_repository.xml?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/JETSPEED-INF/ojb/profiler_repository.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/JETSPEED-INF/ojb/profiler_repository.xml Thu Oct 22 01:23:05 2009
@@ -88,6 +88,7 @@
auto-delete="object"
>
<inverse-foreignkey field-ref="ruleId"/>
+ <orderby name="fallbackOrder" sort="ASC"/>
</collection-descriptor>
</class-descriptor>
@@ -178,4 +179,3 @@
</class-descriptor>
</descriptor-repository>
-
\ No newline at end of file
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/GroupCriterionResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/GroupCriterionResolver.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/GroupCriterionResolver.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/GroupCriterionResolver.java Thu Oct 22 01:23:05 2009
@@ -16,14 +16,7 @@
*/
package org.apache.jetspeed.profiler.rules.impl;
-import javax.security.auth.Subject;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jetspeed.profiler.rules.RuleCriterion;
-import org.apache.jetspeed.profiler.rules.RuleCriterionResolver;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.security.GroupPrincipal;
+import org.apache.jetspeed.profiler.rules.FallbackCriterionResolver;
/**
* Standard Jetspeed-1 Group resolver.
@@ -36,39 +29,8 @@
* @version $Id$
*/
public class GroupCriterionResolver
- extends StandardResolver
- implements RuleCriterionResolver
+ extends PrincipalCriterionResolver
+ implements FallbackCriterionResolver
{
- protected final static Log log = LogFactory.getLog(UserCriterionResolver.class);
-
- /* (non-Javadoc)
- * @see org.apache.jetspeed.profiler.rules.RuleCriterionResolver#resolve(org.apache.jetspeed.request.RequestContext, org.apache.jetspeed.profiler.rules.RuleCriterion)
- */
- public String resolve(RequestContext context, RuleCriterion criterion)
- {
- String value = super.resolve(context, criterion);
- if (value != null)
- {
- return value;
- }
-
- Subject subject = context.getSubject();
- if (subject == null)
- {
- String msg = "Invalid (null) Subject in request pipeline";
- log.error(msg);
- return null;
- }
-
- return resolvePrincipals(context, criterion, subject, GroupPrincipal.class);
- }
-
- /* (non-Javadoc)
- * @see org.apache.jetspeed.profiler.rules.RuleCriterionResolver#isControl()
- */
- public boolean isControl(RuleCriterion criterion)
- {
- return true;
- }
-
+ private static final long serialVersionUID = 1L;
}
Added: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/PrincipalCriterionResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/PrincipalCriterionResolver.java?rev=828270&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/PrincipalCriterionResolver.java (added)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/PrincipalCriterionResolver.java Thu Oct 22 01:23:05 2009
@@ -0,0 +1,121 @@
+/*
+ * 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.profiler.rules.impl;
+
+import java.security.Principal;
+import java.util.Iterator;
+
+import javax.security.auth.Subject;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.profiler.rules.FallbackCriterionResolver;
+import org.apache.jetspeed.profiler.rules.RuleCriterion;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.jetspeed.security.SecurityHelper;
+
+/**
+ * Fallback by Principal control resolver. Can be used with any principal type including role and group
+ * It first looks at the value in the criterion record.
+ * If it is null, it then falls back to a request parameter.
+ * If it is null it gives up and returns null allowing subclasses
+ * to continue processing.
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: PrincipalCriterionResolver.java 767444 2009-04-22 10:08:53Z ate $
+ */
+public class PrincipalCriterionResolver extends StandardResolver implements
+ FallbackCriterionResolver
+{
+ private static final long serialVersionUID = 1L;
+ protected final static Log log = LogFactory.getLog(PrincipalCriterionResolver.class);
+
+ /* (non-Javadoc)
+ * @see org.apache.jetspeed.profiler.rules.RuleCriterionResolver#resolve(org.apache.jetspeed.request.RequestContext, org.apache.jetspeed.profiler.rules.RuleCriterion)
+ */
+ public String resolve(RequestContext context, RuleCriterion criterion)
+ {
+ String value = super.resolve(context, criterion);
+ if (value != null)
+ {
+ return value;
+ }
+
+ Subject subject = context.getSubject();
+ if (subject == null)
+ {
+ String msg = "Invalid (null) Subject in request pipeline";
+ log.error(msg);
+ return null;
+ }
+ return resolvePrincipals(context, criterion, subject, criterion.getName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.jetspeed.profiler.rules.RuleCriterionResolver#isControl()
+ */
+ public boolean isControl(RuleCriterion criterion)
+ {
+ return true;
+ }
+
+ protected String resolvePrincipals(RequestContext context, RuleCriterion criterion, Subject subject, String jptName)
+ {
+ StringBuffer result = new StringBuffer();
+ Iterator principals = SecurityHelper.getPrincipals(subject, jptName).iterator();
+ int count = 0;
+ while (principals.hasNext())
+ {
+ Principal principal = (Principal)principals.next();
+ if (count > 0)
+ {
+ result.append(VALUE_DELIMITER);
+ }
+ result.append(principal.getName());
+ count++;
+ }
+ if (count == 0)
+ {
+ return null;
+ }
+ return result.toString();
+ }
+
+
+ protected String combinePrincipals(RequestContext context, RuleCriterion criterion, Subject subject, String jptName)
+ {
+ StringBuffer result = new StringBuffer();
+ Iterator principals = SecurityHelper.getPrincipals(subject, jptName).iterator();
+ int count = 0;
+ while (principals.hasNext())
+ {
+ Principal principal = (Principal)principals.next();
+ if (count > 0)
+ {
+ result.append(COMBO_DELIMITER);
+ }
+ result.append(principal.getName());
+ count++;
+ }
+ if (count == 0)
+ {
+ return null;
+ }
+ return result.toString();
+ }
+
+}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RoleComboCriterionResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RoleComboCriterionResolver.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RoleComboCriterionResolver.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RoleComboCriterionResolver.java Thu Oct 22 01:23:05 2009
@@ -1,74 +1,60 @@
-/*
+/*
* 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.profiler.rules.impl;
-
-import javax.security.auth.Subject;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jetspeed.profiler.rules.RuleCriterion;
-import org.apache.jetspeed.profiler.rules.RuleCriterionResolver;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.security.RolePrincipal;
-
-/**
- * Role combo resolver
- * Combines all roles into one string
- * Example: roles = a,b,c
- * RoleCombo = a-b-c
- *
- * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: RoleCriterionResolver.java 187756 2004-10-15 22:58:43Z ate $
- */
-public class RoleComboCriterionResolver
- extends StandardResolver
- implements RuleCriterionResolver
-{
- protected final static Log log = LogFactory.getLog(UserCriterionResolver.class);
-
- /* (non-Javadoc)
- * @see org.apache.jetspeed.profiler.rules.RuleCriterionResolver#resolve(org.apache.jetspeed.request.RequestContext, org.apache.jetspeed.profiler.rules.RuleCriterion)
- */
- public String resolve(RequestContext context, RuleCriterion criterion)
- {
- String value = super.resolve(context, criterion);
- if (value != null)
- {
- return value;
- }
-
- Subject subject = context.getSubject();
- if (subject == null)
- {
- String msg = "Invalid (null) Subject in request pipeline";
- log.error(msg);
- return null;
- }
-
- return combinePrincipals(context, criterion, subject, RolePrincipal.class);
- }
-
- /* (non-Javadoc)
- * @see org.apache.jetspeed.profiler.rules.RuleCriterionResolver#isControl()
- */
- public boolean isControl(RuleCriterion criterion)
- {
- return true;
- }
-
-
-}
+ * 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.profiler.rules.impl;
+
+import javax.security.auth.Subject;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.profiler.rules.FallbackCriterionResolver;
+import org.apache.jetspeed.profiler.rules.RuleCriterion;
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * Role combo resolver
+ * Combines all roles into one string
+ * Example: roles = a,b,c
+ * RoleCombo = a-b-c
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: RoleCriterionResolver.java 187756 2004-10-15 22:58:43Z ate $
+ */
+public class RoleComboCriterionResolver
+ extends PrincipalCriterionResolver
+ implements FallbackCriterionResolver
+{
+ private static final long serialVersionUID = 1L;
+ protected final static Log log = LogFactory.getLog(RoleComboCriterionResolver.class);
+
+ public String resolve(RequestContext context, RuleCriterion criterion)
+ {
+ Subject subject = context.getSubject();
+ if (subject == null)
+ {
+ String msg = "Invalid (null) Subject in request pipeline";
+ log.error(msg);
+ return null;
+ }
+
+ return combinePrincipals(context, criterion, subject, criterion.getName());
+ }
+
+ public boolean isControl(RuleCriterion criterion)
+ {
+ return true;
+ }
+}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RoleCriterionResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RoleCriterionResolver.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RoleCriterionResolver.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RoleCriterionResolver.java Thu Oct 22 01:23:05 2009
@@ -16,14 +16,7 @@
*/
package org.apache.jetspeed.profiler.rules.impl;
-import javax.security.auth.Subject;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jetspeed.profiler.rules.RuleCriterion;
-import org.apache.jetspeed.profiler.rules.RuleCriterionResolver;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.security.RolePrincipal;
+import org.apache.jetspeed.profiler.rules.FallbackCriterionResolver;
/**
* Standard Jetspeed-1 Role resolver (not role-based fallback).
@@ -36,40 +29,8 @@
* @version $Id$
*/
public class RoleCriterionResolver
- extends StandardResolver
- implements RuleCriterionResolver
+ extends PrincipalCriterionResolver
+ implements FallbackCriterionResolver
{
- protected final static Log log = LogFactory.getLog(UserCriterionResolver.class);
-
- /* (non-Javadoc)
- * @see org.apache.jetspeed.profiler.rules.RuleCriterionResolver#resolve(org.apache.jetspeed.request.RequestContext, org.apache.jetspeed.profiler.rules.RuleCriterion)
- */
- public String resolve(RequestContext context, RuleCriterion criterion)
- {
- String value = super.resolve(context, criterion);
- if (value != null)
- {
- return value;
- }
-
- Subject subject = context.getSubject();
- if (subject == null)
- {
- String msg = "Invalid (null) Subject in request pipeline";
- log.error(msg);
- return null;
- }
-
- return resolvePrincipals(context, criterion, subject, RolePrincipal.class);
- }
-
- /* (non-Javadoc)
- * @see org.apache.jetspeed.profiler.rules.RuleCriterionResolver#isControl()
- */
- public boolean isControl(RuleCriterion criterion)
- {
- return true;
- }
-
-
+ private static final long serialVersionUID = 1L;
}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RoleFallbackProfilingRule.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RoleFallbackProfilingRule.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RoleFallbackProfilingRule.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RoleFallbackProfilingRule.java Thu Oct 22 01:23:05 2009
@@ -23,6 +23,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.jetspeed.profiler.ProfileLocator;
import org.apache.jetspeed.profiler.Profiler;
+import org.apache.jetspeed.profiler.rules.FallbackCriterionResolver;
import org.apache.jetspeed.profiler.rules.ProfileResolvers;
import org.apache.jetspeed.profiler.rules.ProfilingRule;
import org.apache.jetspeed.profiler.rules.RuleCriterion;
@@ -78,8 +79,7 @@
resolver = getDefaultResolver();
}
String value = resolver.resolve(context, criterion);
- if (value != null && (resolver instanceof RoleCriterionResolver ||
- resolver instanceof GroupCriterionResolver))
+ if (value != null && (resolver instanceof FallbackCriterionResolver))
{
StringTokenizer tokenizer = new StringTokenizer(value, StandardResolver.VALUE_DELIMITER);
while (tokenizer.hasMoreTokens())
@@ -132,20 +132,19 @@
String value = resolver.resolve(context, criterion);
boolean isControl = resolver.isControl(criterion);
boolean isNavigation = resolver.isNavigation(criterion);
- if (value != null && (resolver instanceof RoleCriterionResolver ||
- resolver instanceof GroupCriterionResolver))
- {
- StringTokenizer tokenizer = new StringTokenizer(value, StandardResolver.VALUE_DELIMITER);
- while (tokenizer.hasMoreTokens())
- {
- String token = tokenizer.nextToken();
- locator.add(criterion, isControl, isNavigation, token);
- }
- }
- else
+ if (value != null && (resolver instanceof FallbackCriterionResolver))
+ {
+ StringTokenizer tokenizer = new StringTokenizer(value, StandardResolver.VALUE_DELIMITER);
+ while (tokenizer.hasMoreTokens())
{
- locator.add(criterion, isControl, isNavigation, value);
+ String token = tokenizer.nextToken();
+ locator.add(criterion, isControl, isNavigation, token);
}
+ }
+ else
+ {
+ locator.add(criterion, isControl, isNavigation, value);
+ }
}
}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RuleCriterionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RuleCriterionImpl.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RuleCriterionImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/RuleCriterionImpl.java Thu Oct 22 01:23:05 2009
@@ -67,7 +67,7 @@
return false;
if (this.type != null)
{
- if (!(this.type.equals(r.getName())))
+ if (!(this.type.equals(r.getType())))
return false;
}
else
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/StandardResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/StandardResolver.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/StandardResolver.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/StandardResolver.java Thu Oct 22 01:23:05 2009
@@ -16,15 +16,9 @@
*/
package org.apache.jetspeed.profiler.rules.impl;
-import java.security.Principal;
-import java.util.Iterator;
-
-import javax.security.auth.Subject;
-
import org.apache.jetspeed.profiler.rules.RuleCriterion;
import org.apache.jetspeed.profiler.rules.RuleCriterionResolver;
import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.security.SecurityHelper;
/**
* Standard Jetspeed-1 style resolver for criterion.
@@ -38,6 +32,7 @@
*/
public class StandardResolver implements RuleCriterionResolver
{
+ private static final long serialVersionUID = 1L;
public static final String VALUE_DELIMITER = ",";
public static final String COMBO_DELIMITER = "-";
@@ -70,50 +65,5 @@
public boolean isNavigation(RuleCriterion criterion)
{
return false;
- }
-
- protected String resolvePrincipals(RequestContext context, RuleCriterion criterion, Subject subject, Class classe)
- {
- StringBuffer result = new StringBuffer();
- Iterator principals = SecurityHelper.getPrincipals(subject, classe).iterator();
- int count = 0;
- while (principals.hasNext())
- {
- Principal principal = (Principal)principals.next();
- if (count > 0)
- {
- result.append(VALUE_DELIMITER);
- }
- result.append(principal.getName());
- count++;
- }
- if (count == 0)
- {
- return null;
- }
- return result.toString();
- }
-
- protected String combinePrincipals(RequestContext context, RuleCriterion criterion, Subject subject, Class classe)
- {
- StringBuffer result = new StringBuffer();
- Iterator principals = SecurityHelper.getPrincipals(subject, classe).iterator();
- int count = 0;
- while (principals.hasNext())
- {
- Principal principal = (Principal)principals.next();
- if (count > 0)
- {
- result.append(COMBO_DELIMITER);
- }
- result.append(principal.getName());
- count++;
- }
- if (count == 0)
- {
- return null;
- }
- return result.toString();
- }
-
+ }
}
Added: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/registry/src/java/org/apache/jetspeed/util/ojb/CollectionUtils.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/registry/src/java/org/apache/jetspeed/util/ojb/CollectionUtils.java?rev=828270&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/registry/src/java/org/apache/jetspeed/util/ojb/CollectionUtils.java (added)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/registry/src/java/org/apache/jetspeed/util/ojb/CollectionUtils.java Thu Oct 22 01:23:05 2009
@@ -0,0 +1,340 @@
+/*
+ * 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.util.ojb;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+import org.apache.ojb.broker.ManageableCollection;
+import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.PersistenceBrokerException;
+import org.apache.ojb.broker.util.collections.IRemovalAwareCollection;
+import org.apache.ojb.broker.util.collections.RemovalAwareCollection;
+import org.apache.ojb.broker.util.collections.RemovalAwareList;
+
+/**
+ * CollectionUtils
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class CollectionUtils
+{
+ /**
+ * OJB 1.0.3 requires collections to be removal aware.
+ * Thus we can't seem to get away with just creating ArrayLists
+ * This issue on occurs when persisting newly create object collections
+ * When persisting objects retrieved with OJB, this issue does not occur
+ *
+ * @see JS2-590
+ * @return
+ */
+
+ public static final Collection createCollection()
+ {
+ // highly concurrent applications will require using
+ // createSynchronizedCollection() here instead of this OJB
+ // native type which is not synchronized.
+ return new RemovalAwareCollection();
+ }
+
+ /**
+ * Synchronized OJB removal aware collection.
+ */
+ public static class SynchronizedRemovalAwareCollection implements Collection, ManageableCollection, IRemovalAwareCollection
+ {
+ private static final long serialVersionUID = 1L;
+
+ private RemovalAwareCollection collection = new RemovalAwareCollection();
+
+ public synchronized boolean add(Object e)
+ {
+ return collection.add(e);
+ }
+
+ public synchronized boolean addAll(Collection c)
+ {
+ return collection.addAll(c);
+ }
+
+ public synchronized void clear()
+ {
+ collection.clear();
+ }
+
+ public synchronized boolean contains(Object o)
+ {
+ return collection.contains(o);
+ }
+
+ public synchronized boolean containsAll(Collection c)
+ {
+ return collection.containsAll(c);
+ }
+
+ public synchronized boolean isEmpty()
+ {
+ return collection.isEmpty();
+ }
+
+ public synchronized Iterator iterator()
+ {
+ return collection.iterator();
+ }
+
+ public synchronized boolean remove(Object o)
+ {
+ return collection.remove(o);
+ }
+
+ public synchronized boolean removeAll(Collection c)
+ {
+ return collection.removeAll(c);
+ }
+
+ public synchronized boolean retainAll(Collection c)
+ {
+ return collection.retainAll(c);
+ }
+
+ public synchronized int size()
+ {
+ return collection.size();
+ }
+
+ public synchronized Object[] toArray()
+ {
+ return collection.toArray();
+ }
+
+ public synchronized Object[] toArray(Object[] a)
+ {
+ return collection.toArray(a);
+ }
+
+ public synchronized void afterStore(PersistenceBroker broker) throws PersistenceBrokerException
+ {
+ collection.afterStore(broker);
+ }
+
+ public synchronized void ojbAdd(Object anObject)
+ {
+ collection.ojbAdd(anObject);
+ }
+
+ public synchronized void ojbAddAll(ManageableCollection otherCollection)
+ {
+ collection.ojbAddAll(otherCollection);
+ }
+
+ public synchronized Iterator ojbIterator()
+ {
+ return collection.ojbIterator();
+ }
+ }
+
+ public static final Collection createSynchronizedCollection()
+ {
+ // if OJB collections are to be synchronized, collection-class
+ // attributes for collection-descriptor need to be set in the
+ // OJB mappings to ensure that collections are synchronized
+ // when read from the database, (unsynchronized removal aware
+ // collections are the default):
+ //
+ // <collection-descriptor ... collection-class="org.apache.jetspeed.util.ojb.CollectionUtils$SynchronizedRemovalAwareCollection">
+ //
+ // here, return synchronized manageable/removal aware
+ // collection; note that simply wrapping a RemovalAwareCollection
+ // using Collections.synchronizedCollection() will not work since
+ // OJB collections that are removal aware must implement the
+ // ManageableCollection, IRemovalAwareCollection interfaces.
+ return new SynchronizedRemovalAwareCollection();
+ }
+
+ public static final List createList()
+ {
+ // highly concurrent applications will require using
+ // createSynchronizedList() here instead of this OJB
+ // native type which is not synchronized.
+ return new RemovalAwareList();
+ }
+
+ /**
+ * Synchronized OJB removal aware list.
+ */
+ public static class SynchronizedRemovalAwareList implements List, ManageableCollection, IRemovalAwareCollection
+ {
+ private static final long serialVersionUID = 1L;
+
+ private RemovalAwareList list = new RemovalAwareList();
+
+ public synchronized void add(int index, Object element)
+ {
+ list.add(index, element);
+ }
+
+ public synchronized boolean add(Object e)
+ {
+ return list.add(e);
+ }
+
+ public synchronized boolean addAll(Collection c)
+ {
+ return list.addAll(c);
+ }
+
+ public synchronized boolean addAll(int index, Collection c)
+ {
+ return list.addAll(index, c);
+ }
+
+ public synchronized void clear()
+ {
+ list.clear();
+ }
+
+ public synchronized boolean contains(Object o)
+ {
+ return list.contains(o);
+ }
+
+ public synchronized boolean containsAll(Collection c)
+ {
+ return list.containsAll(c);
+ }
+
+ public synchronized Object get(int index)
+ {
+ return list.get(index);
+ }
+
+ public synchronized int indexOf(Object o)
+ {
+ return list.indexOf(o);
+ }
+
+ public synchronized boolean isEmpty()
+ {
+ return list.isEmpty();
+ }
+
+ public synchronized Iterator iterator()
+ {
+ return list.iterator();
+ }
+
+ public synchronized int lastIndexOf(Object o)
+ {
+ return list.lastIndexOf(o);
+ }
+
+ public synchronized ListIterator listIterator()
+ {
+ return list.listIterator();
+ }
+
+ public synchronized ListIterator listIterator(int index)
+ {
+ return list.listIterator(index);
+ }
+
+ public synchronized Object remove(int index)
+ {
+ return list.remove(index);
+ }
+
+ public synchronized boolean remove(Object o)
+ {
+ return list.remove(o);
+ }
+
+ public synchronized boolean removeAll(Collection c)
+ {
+ return list.removeAll(c);
+ }
+
+ public synchronized boolean retainAll(Collection c)
+ {
+ return list.retainAll(c);
+ }
+
+ public synchronized Object set(int index, Object element)
+ {
+ return list.set(index, element);
+ }
+
+ public synchronized int size()
+ {
+ return list.size();
+ }
+
+ public synchronized List subList(int fromIndex, int toIndex)
+ {
+ return list.subList(fromIndex, toIndex);
+ }
+
+ public synchronized Object[] toArray()
+ {
+ return list.toArray();
+ }
+
+ public synchronized Object[] toArray(Object[] a)
+ {
+ return list.toArray(a);
+ }
+
+ public synchronized void afterStore(PersistenceBroker broker) throws PersistenceBrokerException
+ {
+ list.afterStore(broker);
+ }
+
+ public synchronized void ojbAdd(Object anObject)
+ {
+ list.ojbAdd(anObject);
+ }
+
+ public synchronized void ojbAddAll(ManageableCollection otherCollection)
+ {
+ list.ojbAddAll(otherCollection);
+ }
+
+ public synchronized Iterator ojbIterator()
+ {
+ return list.ojbIterator();
+ }
+ }
+
+ public static final List createSynchronizedList()
+ {
+ // if OJB lists are to be synchronized, collection-class
+ // attributes for collection-descriptor need to be set in the
+ // OJB mappings to ensure that lists are synchronized when
+ // read from the database, (unsynchronized removal aware
+ // lists are the default):
+ //
+ // <collection-descriptor ... collection-class="org.apache.jetspeed.util.ojb.CollectionUtils$SynchronizedRemovalAwareList">
+ //
+ // here, return synchronized manageable/removal aware list;
+ // note that simply wrapping a RemovalAwareList using
+ // Collections.synchronizedList() will not work since
+ // OJB lists that are removal aware must implement the
+ // ManageableCollection, IRemovalAwareCollection interfaces.
+ return new SynchronizedRemovalAwareList();
+ }
+}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/security/src/java/org/apache/jetspeed/security/SecurityHelper.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/security/src/java/org/apache/jetspeed/security/SecurityHelper.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/security/src/java/org/apache/jetspeed/security/SecurityHelper.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/components/security/src/java/org/apache/jetspeed/security/SecurityHelper.java Thu Oct 22 01:23:05 2009
@@ -31,6 +31,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jetspeed.security.impl.PrincipalsSet;
+import org.apache.jetspeed.security.impl.BasePrincipalImpl;
import org.apache.jetspeed.security.impl.GroupPrincipalImpl;
import org.apache.jetspeed.security.impl.RolePrincipalImpl;
import org.apache.jetspeed.security.impl.UserPrincipalImpl;
@@ -217,6 +218,36 @@
/**
* <p>
+ * Given a subject, finds all principals of the given JetspeedPrincipalType(JPT) for that subject. If no principals
+ * of the given class is not found, null is returned.
+ * </p>
+ *
+ * @param subject The subject supplying the principals.
+ * @param jptName the name of the Jetspeed Principal Type
+ * @return A List of all principals of type JetspeedPrincipal matching a JPT name parameter.
+ */
+ public static List getPrincipals(Subject subject, String jptName)
+ {
+ List result = new LinkedList();
+ Iterator principals = subject.getPrincipals().iterator();
+ while (principals.hasNext())
+ {
+ Principal p = (Principal) principals.next();
+ if (p instanceof BasePrincipalImpl)
+ {
+ if (("group".equals(jptName) && (p instanceof GroupPrincipalImpl)) ||
+ ("role".equals(jptName) && (p instanceof RolePrincipalImpl)) ||
+ ("user".equals(jptName) && (p instanceof UserPrincipalImpl)))
+ {
+ result.add(p);
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * <p>
* Given a subject, find the (first) PasswordCredential from the private credentials
* </p>
*
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/core-build.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/core-build.xml?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/core-build.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/core-build.xml Thu Oct 22 01:23:05 2009
@@ -431,5 +431,13 @@
</properties>
</dependency>
- </dependencies>
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <version>1.6.1</version>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ </dependencies>
</project>
Added: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/etc/castor/castor.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/etc/castor/castor.properties?rev=828270&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/etc/castor/castor.properties (added)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/etc/castor/castor.properties Thu Oct 22 01:23:05 2009
@@ -0,0 +1,19 @@
+# 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.
+
+# Defines the XML parser to be used by Castor.
+# The parser must implement org.xml.sax.Parser.
+org.exolab.castor.parser=org.xml.sax.helpers.XMLReaderAdapter
+
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/etc/import/build.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/etc/import/build.xml?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/etc/import/build.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/etc/import/build.xml Thu Oct 22 01:23:05 2009
@@ -86,6 +86,7 @@
<copy todir="${basedir}/target/classes" flatten="on">
<fileset dir="${basedir}/../.." >
<include name="etc/log4j/log4j.properties"/>
+ <include name="etc/castor/castor.properties"/>
<include name="etc/db-ojb/*"/>
<include name="etc/import/assembly/import-page-manager.xml"/>
<include name="etc/import/assembly/repository-datasource-spring.xml"/>
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/installer/etc/database/build.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/installer/etc/database/build.xml?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/installer/etc/database/build.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/installer/etc/database/build.xml Thu Oct 22 01:23:05 2009
@@ -486,6 +486,7 @@
<fileset dir="${importDir}" >
<include name="db-ojb/*"/>
<include name="log4j.properties"/>
+ <include name="castor.properties"/>
<include name="assembly/import-page-manager.xml"/>
<include name="assembly/repository-datasource-spring.xml"/>
</fileset>
Added: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/installer/etc/database/import/castor.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/installer/etc/database/import/castor.properties?rev=828270&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/installer/etc/database/import/castor.properties (added)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/installer/etc/database/import/castor.properties Thu Oct 22 01:23:05 2009
@@ -0,0 +1,19 @@
+# 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.
+
+# Defines the XML parser to be used by Castor.
+# The parser must implement org.xml.sax.Parser.
+org.exolab.castor.parser=org.xml.sax.helpers.XMLReaderAdapter
+
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java Thu Oct 22 01:23:05 2009
@@ -537,6 +537,12 @@
*/
public void reset();
+ /**
+ * shutdown - gracefully shutdown page manager and disconnect
+ * from other singleton components, (e.g. shared caches)
+ */
+ public void shutdown();
+
/**
* Copy the source page creating and returning a new copy of the page
* with the same portlet and fragment collection as the source
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandler.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandler.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandler.java Thu Oct 22 01:23:05 2009
@@ -44,4 +44,10 @@
DocumentHandlerFactory getHandlerFactory();
void setHandlerFactory(DocumentHandlerFactory factory);
+
+ /**
+ * shutdown - gracefully shutdown handler and disconnect
+ * from other singleton components, (e.g. shared caches)
+ */
+ public void shutdown();
}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java Thu Oct 22 01:23:05 2009
@@ -99,4 +99,10 @@
* @param enabled indicator
*/
void setPermissionsEnabled(boolean enabled);
+
+ /**
+ * shutdown - gracefully shutdown handlers and disconnect
+ * from other singleton components, (e.g. shared caches)
+ */
+ public void shutdown();
}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java Thu Oct 22 01:23:05 2009
@@ -163,4 +163,10 @@
*/
boolean isFolder(String path);
+
+ /**
+ * shutdown - gracefully shutdown handler and disconnect
+ * from other singleton components, (e.g. shared caches)
+ */
+ public void shutdown();
}
Added: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/profiler/rules/FallbackCriterionResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/profiler/rules/FallbackCriterionResolver.java?rev=828270&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/profiler/rules/FallbackCriterionResolver.java (added)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/jetspeed-api/src/java/org/apache/jetspeed/profiler/rules/FallbackCriterionResolver.java Thu Oct 22 01:23:05 2009
@@ -0,0 +1,28 @@
+/*
+ * 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.profiler.rules;
+
+/**
+ * Represents any criterion that always falls back
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: FallbackCriterionResolver.java 726976 2008-12-16 07:15:50Z taylor $
+ */
+public interface FallbackCriterionResolver extends RuleCriterionResolver
+{
+
+}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-archetypes/portal/build.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-archetypes/portal/build.xml?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-archetypes/portal/build.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-archetypes/portal/build.xml Thu Oct 22 01:23:05 2009
@@ -80,6 +80,7 @@
<mkdir dir="${basedir}/target/classes/archetype-resources/portal/src/webapp/WEB-INF/classes"/>
<copy todir="${basedir}/target/classes/archetype-resources/portal/src/webapp/WEB-INF/classes">
<fileset dir="${basedir}/../../etc/db-ojb"/>
+ <fileset dir="${basedir}/../../etc/castor"/>
</copy>
-->
@@ -139,6 +140,12 @@
<include name="log4j.properties"/>
</fileset>
</copy>
+ <mkdir dir="${basedir}/target/classes/archetype-resources/etc/serializer/castor"/>
+ <copy todir="${basedir}/target/classes/archetype-resources/etc/serializer/castor">
+ <fileset dir="${basedir}/../../etc/castor" >
+ <include name="castor.properties"/>
+ </fileset>
+ </copy>
<mkdir dir="${basedir}/target/classes/archetype-resources/etc/serializer/db-ojb"/>
<copy todir="${basedir}/target/classes/archetype-resources/etc/serializer/db-ojb">
<fileset dir="${basedir}/../../etc/db-ojb" >
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-archetypes/portal/src/archetype/archetype-resources/etc/dbpsml/build.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-archetypes/portal/src/archetype/archetype-resources/etc/dbpsml/build.xml?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-archetypes/portal/src/archetype/archetype-resources/etc/dbpsml/build.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-archetypes/portal/src/archetype/archetype-resources/etc/dbpsml/build.xml Thu Oct 22 01:23:05 2009
@@ -85,7 +85,8 @@
<mkdir dir="\${basedir}/target/classes"/>
<copy todir="\${basedir}/target/classes" flatten="on">
<fileset dir="\${basedir}/../.." >
- <include name="etc/serilaizer/log4j/log4j.properties"/>
+ <include name="etc/serializer/log4j/log4j.properties"/>
+ <include name="etc/serializer/castor/castor.properties"/>
<include name="etc/serializer/db-ojb/*"/>
<include name="etc/dbpsml/assembly/import-page-manager.xml"/>
<include name="etc/dbpsml/assembly/repository-datasource-spring.xml"/>
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-plugin/maven.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-plugin/maven.xml?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-plugin/maven.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-plugin/maven.xml Thu Oct 22 01:23:05 2009
@@ -26,6 +26,9 @@
<exclude name="**/*test*"/>
</fileset>
</copy>
+ <copy todir="${basedir}/target/classes/plugin-resources/castor" overwrite="true" failonerror="true">
+ <fileset dir="${basedir}/../etc/castor"/>
+ </copy>
<copy todir="${basedir}/target/classes/plugin-resources/conf" overwrite="true" failonerror="true">
<fileset dir="${basedir}/../etc/conf"/>
</copy>
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-plugin/plugin.jelly
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-plugin/plugin.jelly?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-plugin/plugin.jelly (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven-plugin/plugin.jelly Thu Oct 22 01:23:05 2009
@@ -35,6 +35,7 @@
<attainGoal name="j2:portal.conf.sql"/>
<attainGoal name="j2:portal.conf.ldap"/>
<attainGoal name="j2:portal.conf.ojb"/>
+ <attainGoal name="j2:portal.conf.castor"/>
<attainGoal name="j2:portal.conf.jetspeed"/>
<attainGoal name="j2:portal.conf.tomcat"/>
</goal>
@@ -46,6 +47,7 @@
<attainGoal name="j2:portal.conf.sql"/>
<attainGoal name="j2:portal.conf.ldap"/>
<attainGoal name="j2:portal.conf.ojb"/>
+ <attainGoal name="j2:portal.conf.castor"/>
<attainGoal name="j2:portal.conf.jetspeed"/>
<attainGoal name="j2:portal.conf.tomcat"/>
</goal>
@@ -243,6 +245,14 @@
</copy>
</goal>
+ <goal name="j2:portal.conf.castor" prereqs="j2:_check.required.properties">
+ <j:set var="portal.target.dir" value="${org.apache.jetspeed.portal.home}/${org.apache.jetspeed.portal.target.dir}"/>
+ <mkdir dir="${portal.target.dir}/WEB-INF/classes"/>
+ <copy todir="${portal.target.dir}/WEB-INF/classes" overwrite="true">
+ <fileset dir="${org.apache.jetspeed.plugin.root}/plugin-resources/castor"/>
+ </copy>
+ </goal>
+
<goal name="j2:portal.conf.jetspeed" prereqs="j2:_check.required.properties">
<j:set var="portal.target.dir" value="${org.apache.jetspeed.portal.home}/${org.apache.jetspeed.portal.target.dir}"/>
<copy file="${org.apache.jetspeed.plugin.root}/plugin-resources/webapp/WEB-INF/conf/jetspeed.properties"
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven.xml?rev=828270&r1=828269&r2=828270&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven.xml (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.4/maven.xml Thu Oct 22 01:23:05 2009
@@ -217,6 +217,7 @@
<attainGoal name="j2:portal.conf.sql"/>
<attainGoal name="j2:portal.conf.ldap"/>
<attainGoal name="j2:portal.conf.ojb"/>
+ <attainGoal name="j2:portal.conf.castor"/>
<attainGoal name="j2:portal.conf.jetspeed"/>
<attainGoal name="j2:portal.conf.tomcat"/>
@@ -339,6 +340,8 @@
</copy>
<copy todir='${maven.build.dir}/classes'
file="./etc/log4j/log4j.properties"/>
+ <copy todir='${maven.build.dir}/classes'
+ file="./etc/castor/castor.properties"/>
<copy todir='${maven.build.dir}/classes'>
<fileset dir="./etc/db-ojb/"/>
</copy>
@@ -378,6 +381,8 @@
</copy>
<copy todir='${maven.build.dir}/classes'
file="./etc/log4j/log4j.properties"/>
+ <copy todir='${maven.build.dir}/classes'
+ file="./etc/castor/castor.properties"/>
<copy todir='${maven.build.dir}/classes'>
<fileset dir="./etc/db-ojb/"/>
</copy>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org