JBoss Portal SVN: r12153 - in modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms: impl/jcr and 4 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2008-10-23 12:23:22 -0400 (Thu, 23 Oct 2008)
New Revision: 12153
Added:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/DownloadArchiveCommand.java
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/CMSException.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/CommandFactory.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/GetArchiveCommand.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/ItemExistsCommand.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/StoreArchiveCommand.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/ha/HAJCRCMS.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/workflow/ApprovePublishImpl.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/workflow/CMSWorkflowUtil.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/workflow/FinalizePublish.java
Log:
porting 2.6.7 code. (postgresql issue still happening even after rollback)
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/CMSException.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/CMSException.java 2008-10-23 14:59:55 UTC (rev 12152)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/CMSException.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -49,4 +49,16 @@
{
super(cause);
}
+
+ public boolean hasPathFormatFailure()
+ {
+ boolean pathFormatFailure = false;
+
+ if(this.getMessage().indexOf("is not a legal path element")!=-1 || this.getMessage().indexOf("is not a valid path")!=-1)
+ {
+ pathFormatFailure = true;
+ }
+
+ return pathFormatFailure;
+ }
}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/CommandFactory.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/CommandFactory.java 2008-10-23 14:59:55 UTC (rev 12152)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/CommandFactory.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -86,9 +86,11 @@
Command createFileGetListCommand(String sFilePath);
- Command createGetArchiveCommand(String sRootPath, String sLanguage);
+ Command createGetArchiveCommand(String sRootPath, String sLanguage);
Command createSearchCommand(JCRQuery query);
Command createMakeLiveVersionCommand(String filePath, String language, String version);
+
+ Command createDownloadArchiveCommand(String filePath);
}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2008-10-23 14:59:55 UTC (rev 12152)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -68,6 +68,7 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Locale;
+import java.util.Set;
/**
@@ -114,15 +115,13 @@
/** Used for storing the logged in user information */
protected static ThreadLocal userInfo = new ThreadLocal();
-
public static ThreadLocal getUserInfo()
{
return JCRCMS.userInfo;
- }
+ }
/** This is used to turnoff workflow triggering only for this particular request through the CMS commands */
protected static ThreadLocal turnOffWorkflow = new ThreadLocal();
-
public static void turnOffWorkflow()
{
turnOffWorkflow.set(new Boolean(true));
@@ -156,6 +155,21 @@
return isUISecurityFilterActive;
}
+
+ /**
+ * Used for propagating user's role information from different nodes of a cluster to the
+ * HASingleton Master Node currently processing CMS requests
+ */
+ protected static ThreadLocal userRoles = new ThreadLocal();
+ public static Set<String> getRoles()
+ {
+ return (Set<String>)userRoles.get();
+ }
+ public static void setRoles(Set<String> roles)
+ {
+ userRoles.set(roles);
+ }
+
public JCRCMS()
{
@@ -582,6 +596,11 @@
{
JCRCMS.enableUISecurityFilter();
}
+ Set<String> roles = (Set<String>)propagatedContext.getClusterContextInfo("roles");
+ if(roles != null)
+ {
+ JCRCMS.setRoles(roles);
+ }
}
// .... add new nodes & properties and save them
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java 2008-10-23 14:59:55 UTC (rev 12152)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -45,6 +45,7 @@
import org.jboss.portal.cms.impl.jcr.command.RenameCommand;
import org.jboss.portal.cms.impl.jcr.command.SearchCommand;
import org.jboss.portal.cms.impl.jcr.command.StoreArchiveCommand;
+import org.jboss.portal.cms.impl.jcr.command.DownloadArchiveCommand;
import org.jboss.portal.cms.impl.jcr.composite.NewFileCommand;
import org.jboss.portal.cms.impl.jcr.composite.UpdateFileCommand;
import org.jboss.portal.cms.model.Content;
@@ -197,5 +198,10 @@
public Command createMakeLiveVersionCommand(String filePath, String language, String version)
{
return new MakeLiveVersionCommand(filePath, language, version);
- }
+ }
+
+ public Command createDownloadArchiveCommand(String filePath)
+ {
+ return new DownloadArchiveCommand(filePath);
+ }
}
Added: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/DownloadArchiveCommand.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/DownloadArchiveCommand.java (rev 0)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/DownloadArchiveCommand.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.impl.jcr.command;
+
+import java.util.Locale;
+import java.io.FileInputStream;
+
+import org.apache.log4j.Logger;
+
+import org.jboss.portal.cms.CMSException;
+import org.jboss.portal.cms.model.File;
+import org.jboss.portal.cms.model.Content;
+import org.jboss.portal.cms.impl.FileImpl;
+import org.jboss.portal.cms.impl.ContentImpl;
+import org.jboss.portal.cms.impl.jcr.JCRCommand;
+import org.jboss.portal.cms.impl.jcr.JCRCommandContext;
+
+/**
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class DownloadArchiveCommand extends JCRCommand
+{
+ private static final long serialVersionUID = 1L;
+ private static Logger log = Logger.getLogger(DownloadArchiveCommand.class);
+
+ String filePath = null;
+
+ JCRCommandContext mContext;
+
+ public DownloadArchiveCommand(String filePath)
+ {
+ this.filePath = filePath;
+ }
+
+ public Object execute()
+ {
+ java.io.File file = null;
+ try
+ {
+ file = new java.io.File(this.filePath);
+
+ //Create the Content
+ File downloadFile = new FileImpl();
+ downloadFile.setName(file.getName());
+
+ Content downloadFileContent = new ContentImpl();
+ downloadFileContent.setSize(file.length());
+ downloadFileContent.setStream(new FileInputStream(file));
+
+ //Locale does not matter. Just honoring the contract exposed by the File Object
+ downloadFile.setContent(Locale.getDefault(), downloadFileContent);
+
+
+ return downloadFile;
+ }
+ catch(Exception e)
+ {
+ log.error(this, e);
+ throw new CMSException(e);
+ }
+ finally
+ {
+ //File cleanup
+ if(file != null)
+ {
+ if (!file.delete())
+ {
+ file.deleteOnExit();
+ }
+ }
+ }
+ }
+}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/GetArchiveCommand.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/GetArchiveCommand.java 2008-10-23 14:59:55 UTC (rev 12152)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/GetArchiveCommand.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -26,6 +26,7 @@
import org.jboss.portal.cms.impl.jcr.JCRCommandContext;
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
+import org.jboss.portal.cms.util.NodeUtil;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
@@ -51,9 +52,6 @@
private static final int BUFFER_SIZE = 1024;
- /** Root folder in finished zip file that contains all nodes. */
- private String rootFolderName = "contents";
-
public GetArchiveCommand(String sRootPath, String sLanguage)
{
this.msRootPath = sRootPath;
@@ -99,17 +97,23 @@
while (ni.hasNext())
{
Node node = ni.nextNode();
- NodeType nt = node.getPrimaryNodeType();
+ NodeType nt = node.getPrimaryNodeType();
if (nt.getName().equals("portalcms:folder"))
{
this.zipFiles(node.getPath(), zos);
}
else if (nt.getName().equals("portalcms:file"))
{
+ String diff = node.getPath();
+ if(!this.msRootPath.equals("/"))
+ {
+ diff = node.getPath().substring(NodeUtil.getParentPath(this.msRootPath).length());
+ }
+
JCRCommand fileList = (JCRCommand)this.mContext.getCommandFactory().createFileGetCommand(node.getPath(), new Locale(this.msLanguage));
File childFile = (File)this.mContext.execute(fileList);
- ZipEntry entry = new ZipEntry(this.rootFolderName + node.getPath());
+ ZipEntry entry = new ZipEntry(diff);
zos.putNextEntry(entry);
Content content = childFile.getContent();
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/ItemExistsCommand.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/ItemExistsCommand.java 2008-10-23 14:59:55 UTC (rev 12152)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/ItemExistsCommand.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -24,6 +24,7 @@
import org.jboss.portal.cms.impl.jcr.JCRCommand;
import org.jboss.portal.cms.util.FileUtil;
+import org.jboss.portal.cms.CMSException;
import javax.jcr.Session;
@@ -58,7 +59,7 @@
catch (Exception e)
{
e.printStackTrace();
+ throw new CMSException(e);
}
- return null;
}
}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/StoreArchiveCommand.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/StoreArchiveCommand.java 2008-10-23 14:59:55 UTC (rev 12152)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/command/StoreArchiveCommand.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -38,6 +38,7 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
+import java.io.IOException;
import java.util.Date;
import java.util.Enumeration;
import java.util.Locale;
@@ -90,84 +91,14 @@
String itemName = zipEntry.getName();
if (!zipEntry.isDirectory())
{
- long fileSize = zipEntry.getSize();
- byte[] zipBytes = new byte[(int)fileSize];
- InputStream zipDataStream = zipFile.getInputStream(zipEntry);
- long bytesRead = 0;
-
- while (bytesRead < fileSize)
- {
- bytesRead += zipDataStream.read(zipBytes, (int)bytesRead, (int)(fileSize - bytesRead));
- }
-
- org.jboss.portal.cms.model.File file = new FileImpl();
-
- String sBasePath = FileUtil.cleanDoubleSlashes("/" + this.msRootPath + "/" + itemName);
- sBasePath = FileUtil.cleanDoubleSlashes(sBasePath); // hackish, but necessary for root path uploads.
- file.setBasePath(sBasePath);
-
- Content content = new ContentImpl();
- content.setEncoding("UTF-8");
- content.setTitle(itemName);
- content.setDescription(itemName);
- content.setBasePath(sBasePath + "/" + this.msLanguage);
- content.setBytes(zipBytes);
- file.setContent(new Locale(this.msLanguage), content);
-
- //Store the file
- JCRCommand nodeExists = (JCRCommand)context.getCommandFactory().createItemExistsCommand(file.getBasePath());
- Boolean bExists = (Boolean)context.execute(nodeExists);
- if (!bExists.booleanValue())
- {
- //Create new file
- JCRCommand newFile = (JCRCommand)context.getCommandFactory().createNewFileCommand(file, content);
- context.execute(newFile);
- }
- else
- {
- //Update the existing one, and make the new version created
- //in return as live
- JCRCommand updateFile = (JCRCommand)context.getCommandFactory().createUpdateFileCommand(file, content, true);
- context.execute(updateFile);
- }
+ this.addFile(zipFile, zipEntry);
}
else // isDirectory
{
- // trim trailing slash.
- if (itemName.endsWith("/"))
- {
- itemName = itemName.substring(0, itemName.length() - 1);
- }
-
- if (!"".equals(itemName))
- {
- String sBasePath = FileUtil.cleanDoubleSlashes("/" + this.msRootPath + "/" + itemName);
- sBasePath = FileUtil.cleanDoubleSlashes(sBasePath); // hackish, but necessary for root path uploads.
- String sParentPath = NodeUtil.getParentPath(sBasePath);
- JCRCommand nodeExists = (JCRCommand)context.getCommandFactory().createItemExistsCommand(sParentPath);
- Boolean bExists = (Boolean)context.execute(nodeExists);
- if (!bExists.booleanValue())
- {
- this.createParentHierarchy(sParentPath);
- }
-
- JCRCommand nodeExists2 = (JCRCommand)context.getCommandFactory().createItemExistsCommand(sBasePath);
- Boolean bExists2 = (Boolean)context.execute(nodeExists2);
- if (!bExists2.booleanValue())
- {
- Folder folder = new FolderImpl();
- folder.setName(itemName);
- folder.setDescription(itemName);
- folder.setTitle(itemName);
- folder.setLastModified(new Date());
- folder.setBasePath(sBasePath);
-
- JCRCommand folderSave = (JCRCommand)context.getCommandFactory().createFolderSaveCommand(folder);
- context.execute(folderSave);
- }
- }
+ this.addFolder(zipEntry);
}
}
+
return null;
}
catch (Exception e)
@@ -182,6 +113,112 @@
}
}
}
+
+ /**
+ *
+ * @param zipFile
+ * @param zipEntry
+ * @throws IOException
+ */
+ private void addFile(ZipFile zipFile, ZipEntry zipEntry) throws IOException
+ {
+ try
+ {
+ String itemName = zipEntry.getName();
+ long fileSize = zipEntry.getSize();
+ byte[] zipBytes = new byte[(int)fileSize];
+ InputStream zipDataStream = zipFile.getInputStream(zipEntry);
+ long bytesRead = 0;
+
+ while (bytesRead < fileSize)
+ {
+ bytesRead += zipDataStream.read(zipBytes, (int)bytesRead, (int)(fileSize - bytesRead));
+ }
+
+ org.jboss.portal.cms.model.File file = new FileImpl();
+
+ String sBasePath = FileUtil.cleanDoubleSlashes("/" + this.msRootPath + "/" + itemName);
+ sBasePath = FileUtil.cleanDoubleSlashes(sBasePath); // hackish, but necessary for root path uploads.
+ file.setBasePath(sBasePath);
+
+ Content content = new ContentImpl();
+ content.setEncoding("UTF-8");
+ content.setTitle(itemName);
+ content.setDescription(itemName);
+ content.setBasePath(sBasePath + "/" + this.msLanguage);
+ content.setBytes(zipBytes);
+ file.setContent(new Locale(this.msLanguage), content);
+
+ //Store the file
+ JCRCommand nodeExists = (JCRCommand)context.getCommandFactory().createItemExistsCommand(file.getBasePath());
+ Boolean bExists = (Boolean)context.execute(nodeExists);
+ if (!bExists.booleanValue())
+ {
+ //Create new file
+ JCRCommand newFile = (JCRCommand)context.getCommandFactory().createNewFileCommand(file, content);
+ context.execute(newFile);
+ }
+ else
+ {
+ //Update the existing one, and make the new version created
+ //in return as live
+ JCRCommand updateFile = (JCRCommand)context.getCommandFactory().createUpdateFileCommand(file, content, true);
+ context.execute(updateFile);
+ }
+ }
+ catch(CMSException e)
+ {
+ //Log the error, but don't fail creation of other resources in the archive
+ log.error(this, e);
+ }
+ }
+
+ private void addFolder(ZipEntry zipEntry)
+ {
+ try
+ {
+ String itemName = zipEntry.getName();
+
+ //trim trailing slash.
+ if (itemName.endsWith("/"))
+ {
+ itemName = itemName.substring(0, itemName.length() - 1);
+ }
+
+ if (!"".equals(itemName))
+ {
+ String sBasePath = FileUtil.cleanDoubleSlashes("/" + this.msRootPath + "/" + itemName);
+ sBasePath = FileUtil.cleanDoubleSlashes(sBasePath); // hackish, but necessary for root path uploads.
+ String sParentPath = NodeUtil.getParentPath(sBasePath);
+ JCRCommand nodeExists = (JCRCommand)context.getCommandFactory().createItemExistsCommand(sParentPath);
+ Boolean bExists = (Boolean)context.execute(nodeExists);
+ if (!bExists.booleanValue())
+ {
+ this.createParentHierarchy(sParentPath);
+ }
+
+ JCRCommand nodeExists2 = (JCRCommand)context.getCommandFactory().createItemExistsCommand(sBasePath);
+ Boolean bExists2 = (Boolean)context.execute(nodeExists2);
+ if (!bExists2.booleanValue())
+ {
+ Folder folder = new FolderImpl();
+ folder.setName(itemName);
+ folder.setDescription(itemName);
+ folder.setTitle(itemName);
+ folder.setLastModified(new Date());
+ folder.setBasePath(sBasePath);
+
+ JCRCommand folderSave = (JCRCommand)context.getCommandFactory().createFolderSaveCommand(folder);
+ context.execute(folderSave);
+ }
+ }
+ }
+ catch(Exception e)
+ {
+ //Log the error, but don't fail creation of other resources in the archive
+ log.error(this, e);
+ }
+ }
/** @param parentPath */
private void createParentHierarchy(String parentPath) throws CMSException
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/ha/HAJCRCMS.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/ha/HAJCRCMS.java 2008-10-23 14:59:55 UTC (rev 12152)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/ha/HAJCRCMS.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -22,6 +22,15 @@
******************************************************************************/
package org.jboss.portal.cms.impl.jcr.ha;
+import java.security.Principal;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.security.auth.Subject;
+import javax.security.jacc.PolicyContext;
+import javax.security.jacc.PolicyContextException;
+
import org.apache.log4j.Logger;
import org.jboss.portal.cms.CMSException;
import org.jboss.portal.cms.Command;
@@ -31,6 +40,7 @@
import org.jboss.portal.cms.model.CMSUser;
import org.jboss.portal.identity.User;
import org.jboss.portal.jems.ha.HASingletonInvoker;
+import org.jboss.portal.security.impl.jacc.JACCPortalPrincipal;
/**
* Extend the JCR CMS and make it run as an ha singleton.
@@ -62,6 +72,17 @@
User user = (User)this.getUserInfo().get();
JCRCommandContext context = this.getCommandContext((JCRCommand)cmd);
context.setClusterContextInfo("user", new CMSUser(user.getUserName()));
+
+ try
+ {
+ //Propagate the currently authenticated Subject's roles to the Master Node
+ Set<String> roles = this.getCurrentRoles();
+ context.setClusterContextInfo("roles", roles);
+ }
+ catch(PolicyContextException e)
+ {
+ throw new CMSException(e);
+ }
}
//Add the Workflow ThreadLocal variable to the Command Context for propagation to the Master Node
@@ -77,7 +98,7 @@
{
JCRCommandContext context = this.getCommandContext((JCRCommand)cmd);
context.setClusterContextInfo("enableUISecurityFilter", Boolean.TRUE);
- }
+ }
// Use the proxy to invoke on the singleton
Object returnValue = null;
@@ -86,10 +107,12 @@
returnValue = invoker.invoke("execute", new Class[]{Command.class}, new Object[]{cmd});
if(returnValue instanceof CMSException)
{
- if(returnValue.toString().indexOf("Access to this resource is denied") != -1)
+ CMSException cmsException = (CMSException)returnValue;
+ if(cmsException.toString().indexOf("Access to this resource is denied") != -1 ||
+ cmsException.hasPathFormatFailure())
{
- throw (CMSException)returnValue;
- }
+ throw cmsException;
+ }
else
{
returnValue = null;
@@ -149,7 +172,7 @@
}
catch(CMSException ce)
{
- if (ce.toString().indexOf("Access to this resource is denied") != -1)
+ if (ce.toString().indexOf("Access to this resource is denied") != -1 || ce.hasPathFormatFailure())
{
result = ce;
}
@@ -206,4 +229,40 @@
return context;
}
+
+ private Set getCurrentRoles() throws PolicyContextException
+ {
+ Set<String> roles = new HashSet<String>();
+
+ // Get the current authenticated subject through the JACC contract
+ Subject subject = (Subject)PolicyContext.getContext("javax.security.auth.Subject.container");
+
+ if (subject != null)
+ {
+ Set tmp = subject.getPrincipals(JACCPortalPrincipal.class);
+ JACCPortalPrincipal pp = null;
+ for (Iterator i = tmp.iterator(); i.hasNext();)
+ {
+ pp = (JACCPortalPrincipal)i.next();
+ if (pp != null)
+ {
+ break;
+ }
+ }
+ if (pp == null)
+ {
+ pp = new JACCPortalPrincipal(subject);
+ tmp.add(pp);
+
+ // Lazy create all the permission containers for the given role names
+ for (Iterator i = pp.getRoles().iterator(); i.hasNext();)
+ {
+ Principal role = (Principal)i.next();
+ roles.add(role.getName());
+ }
+ }
+ }
+
+ return roles;
+ }
}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2008-10-23 14:59:55 UTC (rev 12152)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -1,598 +1,606 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.cms.security;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
-import org.jboss.portal.cms.hibernate.state.Tools;
-import org.jboss.portal.identity.AnonymousRole;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.identity.IdentityServiceController;
-import org.jboss.portal.identity.IdentityConfiguration;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.db.HibernateUserModuleImpl;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.security.spi.provider.DomainConfigurator;
-import org.jboss.portal.security.spi.provider.PermissionFactory;
-import org.jboss.portal.security.spi.provider.PermissionRepository;
-import org.jboss.portal.security.spi.provider.SecurityConfigurationException;
-import org.jboss.portal.security.impl.jacc.JACCPortalPrincipal;
-
-import javax.security.auth.Subject;
-import javax.security.jacc.PolicyContext;
-import javax.security.jacc.PolicyContextException;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.security.Principal;
-
-/**
- * Created on : Jan 23, 2007
- *
- * @author Sohil Shah - sohil.shah(a)jboss.com
- */
-public class AuthorizationProviderImpl extends AbstractJBossService implements
- AuthorizationProvider
-{
- private IdentityServiceController identityServiceController = null;
-
- private MembershipModule membershipModule = null;
-
- private UserModule userModule = null;
-
- private String cmsRootUserName = null;
-
- private User adminUser = null;
-
- /**
- *
- */
- public void startService() throws Exception
- {
- super.startService();
- this.membershipModule = (MembershipModule)identityServiceController
- .getIdentityContext().getObject(
- IdentityContext.TYPE_MEMBERSHIP_MODULE);
- this.userModule = (UserModule)identityServiceController
- .getIdentityContext().getObject(IdentityContext.TYPE_USER_MODULE);
- }
-
- // ------AuthorizationDomain
- // impl-----------------------------------------------------------------
- /**
- *
- */
- public DomainConfigurator getConfigurator()
- {
- return this;
- }
-
- /**
- *
- */
- public PermissionFactory getPermissionFactory()
- {
- return null;
- }
-
- /**
- *
- */
- public PermissionRepository getPermissionRepository()
- {
- return null;
- }
-
- /**
- *
- */
- public String getType()
- {
- return this.getClass().getName();
- }
-
- /**
- *
- * @return
- */
- public String getCmsRootUserName()
- {
- return cmsRootUserName;
- }
-
- /**
- *
- * @param cmsRootUserName
- */
- public void setCmsRootUserName(String cmsRootUserName)
- {
- this.cmsRootUserName = cmsRootUserName;
- }
-
- // ------DomainConfigurator
- // impl------------------------------------------------------------------
- /**
- *
- */
- public void setSecurityBindings(String uri, Set securityBindings)
- throws SecurityConfigurationException
- {
- if (securityBindings != null)
- {
- for (Iterator itr = securityBindings.iterator(); itr.hasNext();)
- {
- Permission securityBinding = (Permission)itr.next();
- if (securityBinding.getRoles() != null
- || securityBinding.getUsers() != null)
- {
- this.store(securityBinding, securityBinding.getRoles(),
- securityBinding.getUsers());
- }
- else
- {
- this.store(securityBinding);
- }
- }
- }
- }
-
- /**
- *
- */
- public void removeSecurityBindings(String uri)
- throws SecurityConfigurationException
- {
- Set permissions = this.getSecurityBindings(uri);
- this.remove(permissions);
- }
-
- /**
- *
- */
- public Set getSecurityBindings(String uri)
- {
- Set permissions = new HashSet();
-
- if (uri.startsWith("user://"))
- {
- String userId = uri.substring("user://".length());
- Collection cour = this.findPermissionsByUser(userId);
- if (cour != null)
- {
- permissions.addAll(cour);
- }
- }
- else if (uri.startsWith("role://"))
- {
- String roleId = uri.substring("role://".length());
- Collection cour = this.findPermissionsByRole(roleId);
- if (cour != null)
- {
- permissions.addAll(cour);
- }
- }
- else if (uri.startsWith("criteria://"))
- {
- String criteria = uri.substring("criteria://".length());
- int index = criteria.indexOf('/');
- String name = criteria.substring(0, index);
- String value = criteria.substring(index + 1);
- Criteria input = new Criteria(name, value);
- Collection cour = this.findPermissionsByCriteria(input);
- if (cour != null)
- {
- permissions.addAll(cour);
- }
- }
-
- return permissions;
- }
-
- /**
- *
- */
- public User getRoot()
- {
-
- if (adminUser == null)
- {
- Session session = Tools.getOpenSession();
- Transaction tx = session.beginTransaction();
- try
- {
- adminUser = this.userModule.findUserByUserName(this.cmsRootUserName);
- tx.commit();
- }
- catch(Exception e)
- {
- tx.rollback();
- throw new RuntimeException(e);
- }
- finally
- {
- Tools.closeSession(session);
- }
- }
-
- return adminUser;
-
-
- }
-
- /**
- *
- * @return
- */
- public String getDefaultAdminRole()
- {
- try
- {
- String defaultAdminRole = null;
-
- IdentityConfiguration configuration = (IdentityConfiguration)this.identityServiceController.getIdentityContext().
- getObject(IdentityContext.TYPE_IDENTITY_CONFIGURATION);
- defaultAdminRole = configuration.getValue(IdentityConfiguration.ROLE_DEFAULT_ADMIN_ROLE);
-
- return defaultAdminRole;
- }
- catch(IdentityException ie)
- {
- throw new RuntimeException(ie);
- }
- }
- // ---------URIFactory
- // impl-----------------------------------------------------------------------------------------
- /**
- *
- */
- public String getUserURI(String userId)
- {
- return "user://" + userId;
- }
-
- /**
- * @param roleId
- * @return
- */
- public String getRoleURI(String roleId)
- {
- return "role://" + roleId;
- }
-
- /**
- * @param name
- * @param value
- * @return
- */
- public String getCriteriaURI(String name, String value)
- {
- return "criteria://" + name + "/" + value;
- }
-
- /**
- *
- */
- public MembershipModule getMembershipModule()
- {
- return this.membershipModule;
- }
-
- // --------------------------------------------------------------------------------------------------------------
- /**
- *
- */
- public IdentityServiceController getIdentityServiceController()
- {
- return identityServiceController;
- }
-
- /** @param identityServiceController */
- public void setIdentityServiceController(
- IdentityServiceController identityServiceController)
- {
- this.identityServiceController = identityServiceController;
- }
-
- // --------------------------------------------------------------------------------------------------------------
- /**
- * Stores a permission and its associations into peristent storage
- *
- * @param permission - Permission to be persisted
- * @param roles - Roles associated with this permission
- * @param users - Individual users associated with this permission
- */
- private void store(Permission permission, Collection roles, Collection users)
- {
- // setup the role association
- if (roles != null)
- {
- Set roleAssoc = new HashSet();
- for (Iterator itr = roles.iterator(); itr.hasNext();)
- {
- Role role = (Role)itr.next();
- PermRoleAssoc cour = new PermRoleAssoc();
- if (!(role instanceof AnonymousRole))
- {
- cour.setRoleId(role.getName());
- }
- else
- {
- cour.setRoleId(AuthorizationManager.Anonymous);
- }
- roleAssoc.add(cour);
- }
- permission.setRoleAssoc(roleAssoc);
- }
- else
- {
- permission.setRoleAssoc(null);
- }
-
- // setup the user association
- if (users != null)
- {
- Set userAssoc = new HashSet();
- for (Iterator itr = users.iterator(); itr.hasNext();)
- {
- User user = (User)itr.next();
- PermUserAssoc cour = new PermUserAssoc();
- cour.setUserId(user.getUserName());
- userAssoc.add(cour);
- }
- permission.setUserAssoc(userAssoc);
- }
- else
- {
- permission.setUserAssoc(null);
- }
-
- // persist this into the database
- this.store(permission);
- }
-
- /**
- * Stores a permission and its associations into peristent storage
- *
- * @param permission - Permission to be persisted
- */
- private void store(Permission permission)
- {
- // persist this into the database
- Session session = Tools.getCurrentSession();
- session.saveOrUpdate(permission);
- }
-
- /**
- * Deletes the specified permissions from the database
- *
- * @param permissions
- */
- private void remove(Collection permissions)
- {
- Session session = Tools.getCurrentSession();
- if (permissions != null)
- {
- for (Iterator itr = permissions.iterator(); itr.hasNext();)
- {
- Permission permission = (Permission)itr.next();
- session.delete(permission);
- }
- }
- }
-
- /**
- * Returns all permissions associated with the specified user
- *
- * @param user
- * @return
- */
- private Collection findPermissionsByUser(String userId)
- {
- Session session = Tools.getOpenSession();
- Transaction tx = session.beginTransaction();
- try
- {
- Collection permissions = new HashSet();
-
- // this is for db based identity management
- String lookupByUser = "SELECT permission from Permission permission JOIN permission.userAssoc user WHERE user.userId=?";
-
- // perform lookup by explicitly specified users
- Query userQuery = session.createQuery(lookupByUser);
- userQuery.setString(0, userId);
- userQuery.setCacheable(true);
- permissions.addAll(userQuery.list());
-
- if (this.userModule instanceof HibernateUserModuleImpl)
- {
- // in case of a database version, use the cache optmized way to
- // lookup the permissions
- String lookupByRole = "SELECT p.* from jbp_cms_perm p,jbp_cms_perm_role r,jbp_role_membership m,jbp_roles roles,jbp_users users WHERE "
- + "p.id=r.cms_perm_id AND "
- + "r.role_id=roles.jbp_name AND "
- + "m.jbp_rid=roles.jbp_rid AND "
- + "m.jbp_uid=users.jbp_uid AND " + "users.jbp_uname=?";
-
- // perform lookup based on role membership
- Query roleQuery = session.createSQLQuery(lookupByRole).addEntity(
- Permission.class);
- roleQuery.setString(0, userId);
- roleQuery.setCacheable(true);
- permissions.addAll(roleQuery.list());
- }
- else
- {
-
-
- // in the case of LDAP use the IdentityModule
- // now find permissions for all the roles that this user belongs to
- //Set belongedRoles = this.membershipModule.getRoles(this.userModule
- // .findUserByUserName(userId));
-
- Set belongedRoles = getCurrentRoles();
-
- if (belongedRoles != null)
- {
- for (Iterator itr = belongedRoles.iterator(); itr.hasNext();)
- {
- String role = (String)itr.next();
- Collection rolePermissions = this.findPermissionsByRole(role);
- if (rolePermissions != null && !rolePermissions.isEmpty())
- {
- permissions.addAll(rolePermissions);
- }
- }
- }
- }
-
- tx.commit();
-
- return permissions;
- }
- catch (Exception e)
- {
- tx.rollback();
- throw new RuntimeException(e);
- }
- finally
- {
- Tools.closeSession(session);
- }
- }
-
- /**
- * Returns all permissions associated with the specified role
- *
- * @param role
- * @return
- */
- private Collection findPermissionsByRole(String roleId)
- {
- Collection permissions = new HashSet();
-
- String lookupByRole = "SELECT permission from Permission permission JOIN permission.roleAssoc role WHERE role.roleId=?";
-
- Session session = Tools.getOpenSession();
- Transaction tx = session.beginTransaction();
- try
- {
- // perform lookup by explicitly specified users
- Query roleQuery = session.createQuery(lookupByRole);
- roleQuery.setString(0, roleId);
- roleQuery.setCacheable(true);
- permissions.addAll(roleQuery.list());
-
- tx.commit();
- }
- catch (Exception e)
- {
- tx.rollback();
- throw new RuntimeException(e);
- }
- finally
- {
- Tools.closeSession(session);
- }
-
- return permissions;
- }
-
- /**
- * Return all permissions that match the specified criteria
- *
- * @param criteria
- * @return
- */
- private Collection findPermissionsByCriteria(Criteria criteria)
- {
- Collection permissions = new HashSet();
-
- String lookupByCriteria = "SELECT permission from Permission permission JOIN permission.criteria criteria WHERE criteria.name=? AND criteria.value=?";
-
- Session session = Tools.getOpenSession();
- Transaction tx = session.beginTransaction();
- try
- {
- // perform lookup by explicitly specified users
- Query criteriaQuery = session.createQuery(lookupByCriteria);
- criteriaQuery.setString(0, criteria.getName());
- criteriaQuery.setString(1, criteria.getValue());
- criteriaQuery.setCacheable(true);
- permissions.addAll(criteriaQuery.list());
-
- tx.commit();
- }
- catch (Exception e)
- {
- tx.rollback();
- throw new RuntimeException(e);
- }
- finally
- {
- Tools.closeSession(session);
- }
-
- return permissions;
- }
-
- private Set getCurrentRoles() throws PolicyContextException
- {
- Set<String> roles = new HashSet<String>();
-
- // Get the current authenticated subject through the JACC contract
- Subject subject = (Subject)PolicyContext.getContext("javax.security.auth.Subject.container");
-
- if (subject != null)
- {
- Set tmp = subject.getPrincipals(JACCPortalPrincipal.class);
- JACCPortalPrincipal pp = null;
- for (Iterator i = tmp.iterator(); i.hasNext();)
- {
- pp = (JACCPortalPrincipal)i.next();
- if (pp != null)
- {
- break;
- }
- }
- if (pp == null)
- {
- pp = new JACCPortalPrincipal(subject);
- tmp.add(pp);
-
- // Lazy create all the permission containers for the given role names
- for (Iterator i = pp.getRoles().iterator(); i.hasNext();)
- {
- Principal role = (Principal)i.next();
- roles.add(role.getName());
- }
- }
- }
- return roles;
- }
-}
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.security;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.jboss.portal.cms.hibernate.state.Tools;
+import org.jboss.portal.cms.impl.jcr.JCRCMS;
+import org.jboss.portal.identity.AnonymousRole;
+import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.IdentityServiceController;
+import org.jboss.portal.identity.IdentityConfiguration;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.MembershipModule;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.identity.db.HibernateUserModuleImpl;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+import org.jboss.portal.security.spi.provider.PermissionFactory;
+import org.jboss.portal.security.spi.provider.PermissionRepository;
+import org.jboss.portal.security.spi.provider.SecurityConfigurationException;
+import org.jboss.portal.security.impl.jacc.JACCPortalPrincipal;
+
+import javax.security.auth.Subject;
+import javax.security.jacc.PolicyContext;
+import javax.security.jacc.PolicyContextException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.security.Principal;
+
+/**
+ * Created on : Jan 23, 2007
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ */
+public class AuthorizationProviderImpl extends AbstractJBossService implements
+ AuthorizationProvider
+{
+ private IdentityServiceController identityServiceController = null;
+
+ private MembershipModule membershipModule = null;
+
+ private UserModule userModule = null;
+
+ private String cmsRootUserName = null;
+
+ private User adminUser = null;
+
+ /**
+ *
+ */
+ public void startService() throws Exception
+ {
+ super.startService();
+ this.membershipModule = (MembershipModule)identityServiceController
+ .getIdentityContext().getObject(
+ IdentityContext.TYPE_MEMBERSHIP_MODULE);
+ this.userModule = (UserModule)identityServiceController
+ .getIdentityContext().getObject(IdentityContext.TYPE_USER_MODULE);
+ }
+
+ // ------AuthorizationDomain
+ // impl-----------------------------------------------------------------
+ /**
+ *
+ */
+ public DomainConfigurator getConfigurator()
+ {
+ return this;
+ }
+
+ /**
+ *
+ */
+ public PermissionFactory getPermissionFactory()
+ {
+ return null;
+ }
+
+ /**
+ *
+ */
+ public PermissionRepository getPermissionRepository()
+ {
+ return null;
+ }
+
+ /**
+ *
+ */
+ public String getType()
+ {
+ return this.getClass().getName();
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getCmsRootUserName()
+ {
+ return cmsRootUserName;
+ }
+
+ /**
+ *
+ * @param cmsRootUserName
+ */
+ public void setCmsRootUserName(String cmsRootUserName)
+ {
+ this.cmsRootUserName = cmsRootUserName;
+ }
+
+ // ------DomainConfigurator
+ // impl------------------------------------------------------------------
+ /**
+ *
+ */
+ public void setSecurityBindings(String uri, Set securityBindings)
+ throws SecurityConfigurationException
+ {
+ if (securityBindings != null)
+ {
+ for (Iterator itr = securityBindings.iterator(); itr.hasNext();)
+ {
+ Permission securityBinding = (Permission)itr.next();
+ if (securityBinding.getRoles() != null
+ || securityBinding.getUsers() != null)
+ {
+ this.store(securityBinding, securityBinding.getRoles(),
+ securityBinding.getUsers());
+ }
+ else
+ {
+ this.store(securityBinding);
+ }
+ }
+ }
+ }
+
+ /**
+ *
+ */
+ public void removeSecurityBindings(String uri)
+ throws SecurityConfigurationException
+ {
+ Set permissions = this.getSecurityBindings(uri);
+ this.remove(permissions);
+ }
+
+ /**
+ *
+ */
+ public Set getSecurityBindings(String uri)
+ {
+ Set permissions = new HashSet();
+
+ if (uri.startsWith("user://"))
+ {
+ String userId = uri.substring("user://".length());
+ Collection cour = this.findPermissionsByUser(userId);
+ if (cour != null)
+ {
+ permissions.addAll(cour);
+ }
+ }
+ else if (uri.startsWith("role://"))
+ {
+ String roleId = uri.substring("role://".length());
+ Collection cour = this.findPermissionsByRole(roleId);
+ if (cour != null)
+ {
+ permissions.addAll(cour);
+ }
+ }
+ else if (uri.startsWith("criteria://"))
+ {
+ String criteria = uri.substring("criteria://".length());
+ int index = criteria.indexOf('/');
+ String name = criteria.substring(0, index);
+ String value = criteria.substring(index + 1);
+ Criteria input = new Criteria(name, value);
+ Collection cour = this.findPermissionsByCriteria(input);
+ if (cour != null)
+ {
+ permissions.addAll(cour);
+ }
+ }
+
+ return permissions;
+ }
+
+ /**
+ *
+ */
+ public User getRoot()
+ {
+
+ if (adminUser == null)
+ {
+ Session session = Tools.getOpenSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ adminUser = this.userModule.findUserByUserName(this.cmsRootUserName);
+ tx.commit();
+ }
+ catch(Exception e)
+ {
+ tx.rollback();
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ Tools.closeSession(session);
+ }
+ }
+
+ return adminUser;
+
+
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getDefaultAdminRole()
+ {
+ try
+ {
+ String defaultAdminRole = null;
+
+ IdentityConfiguration configuration = (IdentityConfiguration)this.identityServiceController.getIdentityContext().
+ getObject(IdentityContext.TYPE_IDENTITY_CONFIGURATION);
+ defaultAdminRole = configuration.getValue(IdentityConfiguration.ROLE_DEFAULT_ADMIN_ROLE);
+
+ return defaultAdminRole;
+ }
+ catch(IdentityException ie)
+ {
+ throw new RuntimeException(ie);
+ }
+ }
+ // ---------URIFactory
+ // impl-----------------------------------------------------------------------------------------
+ /**
+ *
+ */
+ public String getUserURI(String userId)
+ {
+ return "user://" + userId;
+ }
+
+ /**
+ * @param roleId
+ * @return
+ */
+ public String getRoleURI(String roleId)
+ {
+ return "role://" + roleId;
+ }
+
+ /**
+ * @param name
+ * @param value
+ * @return
+ */
+ public String getCriteriaURI(String name, String value)
+ {
+ return "criteria://" + name + "/" + value;
+ }
+
+ /**
+ *
+ */
+ public MembershipModule getMembershipModule()
+ {
+ return this.membershipModule;
+ }
+
+ // --------------------------------------------------------------------------------------------------------------
+ /**
+ *
+ */
+ public IdentityServiceController getIdentityServiceController()
+ {
+ return identityServiceController;
+ }
+
+ /** @param identityServiceController */
+ public void setIdentityServiceController(
+ IdentityServiceController identityServiceController)
+ {
+ this.identityServiceController = identityServiceController;
+ }
+
+ // --------------------------------------------------------------------------------------------------------------
+ /**
+ * Stores a permission and its associations into peristent storage
+ *
+ * @param permission - Permission to be persisted
+ * @param roles - Roles associated with this permission
+ * @param users - Individual users associated with this permission
+ */
+ private void store(Permission permission, Collection roles, Collection users)
+ {
+ // setup the role association
+ if (roles != null)
+ {
+ Set roleAssoc = new HashSet();
+ for (Iterator itr = roles.iterator(); itr.hasNext();)
+ {
+ Role role = (Role)itr.next();
+ PermRoleAssoc cour = new PermRoleAssoc();
+ if (!(role instanceof AnonymousRole))
+ {
+ cour.setRoleId(role.getName());
+ }
+ else
+ {
+ cour.setRoleId(AuthorizationManager.Anonymous);
+ }
+ roleAssoc.add(cour);
+ }
+ permission.setRoleAssoc(roleAssoc);
+ }
+ else
+ {
+ permission.setRoleAssoc(null);
+ }
+
+ // setup the user association
+ if (users != null)
+ {
+ Set userAssoc = new HashSet();
+ for (Iterator itr = users.iterator(); itr.hasNext();)
+ {
+ User user = (User)itr.next();
+ PermUserAssoc cour = new PermUserAssoc();
+ cour.setUserId(user.getUserName());
+ userAssoc.add(cour);
+ }
+ permission.setUserAssoc(userAssoc);
+ }
+ else
+ {
+ permission.setUserAssoc(null);
+ }
+
+ // persist this into the database
+ this.store(permission);
+ }
+
+ /**
+ * Stores a permission and its associations into peristent storage
+ *
+ * @param permission - Permission to be persisted
+ */
+ private void store(Permission permission)
+ {
+ // persist this into the database
+ Session session = Tools.getCurrentSession();
+ session.saveOrUpdate(permission);
+ }
+
+ /**
+ * Deletes the specified permissions from the database
+ *
+ * @param permissions
+ */
+ private void remove(Collection permissions)
+ {
+ Session session = Tools.getCurrentSession();
+ if (permissions != null)
+ {
+ for (Iterator itr = permissions.iterator(); itr.hasNext();)
+ {
+ Permission permission = (Permission)itr.next();
+ session.delete(permission);
+ }
+ }
+ }
+
+ /**
+ * Returns all permissions associated with the specified user
+ *
+ * @param user
+ * @return
+ */
+ private Collection findPermissionsByUser(String userId)
+ {
+ Session session = Tools.getOpenSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ Collection permissions = new HashSet();
+
+ // this is for db based identity management
+ String lookupByUser = "SELECT permission from Permission permission JOIN permission.userAssoc user WHERE user.userId=?";
+
+ // perform lookup by explicitly specified users
+ Query userQuery = session.createQuery(lookupByUser);
+ userQuery.setString(0, userId);
+ userQuery.setCacheable(true);
+ permissions.addAll(userQuery.list());
+
+ if (this.userModule instanceof HibernateUserModuleImpl)
+ {
+ // in case of a database version, use the cache optmized way to
+ // lookup the permissions
+ String lookupByRole = "SELECT p.* from jbp_cms_perm p,jbp_cms_perm_role r,jbp_role_membership m,jbp_roles roles,jbp_users users WHERE "
+ + "p.id=r.cms_perm_id AND "
+ + "r.role_id=roles.jbp_name AND "
+ + "m.jbp_rid=roles.jbp_rid AND "
+ + "m.jbp_uid=users.jbp_uid AND " + "users.jbp_uname=?";
+
+ // perform lookup based on role membership
+ Query roleQuery = session.createSQLQuery(lookupByRole).addEntity(
+ Permission.class);
+ roleQuery.setString(0, userId);
+ roleQuery.setCacheable(true);
+ permissions.addAll(roleQuery.list());
+ }
+ else
+ {
+
+
+ // in the case of LDAP use the IdentityModule
+ // now find permissions for all the roles that this user belongs to
+ //Set belongedRoles = this.membershipModule.getRoles(this.userModule
+ // .findUserByUserName(userId));
+
+ Set belongedRoles = getCurrentRoles();
+
+ if (belongedRoles != null)
+ {
+ for (Iterator itr = belongedRoles.iterator(); itr.hasNext();)
+ {
+ String role = (String)itr.next();
+ Collection rolePermissions = this.findPermissionsByRole(role);
+ if (rolePermissions != null && !rolePermissions.isEmpty())
+ {
+ permissions.addAll(rolePermissions);
+ }
+ }
+ }
+ }
+
+ tx.commit();
+
+ return permissions;
+ }
+ catch (Exception e)
+ {
+ tx.rollback();
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ Tools.closeSession(session);
+ }
+ }
+
+ /**
+ * Returns all permissions associated with the specified role
+ *
+ * @param role
+ * @return
+ */
+ private Collection findPermissionsByRole(String roleId)
+ {
+ Collection permissions = new HashSet();
+
+ String lookupByRole = "SELECT permission from Permission permission JOIN permission.roleAssoc role WHERE role.roleId=?";
+
+ Session session = Tools.getOpenSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ // perform lookup by explicitly specified users
+ Query roleQuery = session.createQuery(lookupByRole);
+ roleQuery.setString(0, roleId);
+ roleQuery.setCacheable(true);
+ permissions.addAll(roleQuery.list());
+
+ tx.commit();
+ }
+ catch (Exception e)
+ {
+ tx.rollback();
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ Tools.closeSession(session);
+ }
+
+ return permissions;
+ }
+
+ /**
+ * Return all permissions that match the specified criteria
+ *
+ * @param criteria
+ * @return
+ */
+ private Collection findPermissionsByCriteria(Criteria criteria)
+ {
+ Collection permissions = new HashSet();
+
+ String lookupByCriteria = "SELECT permission from Permission permission JOIN permission.criteria criteria WHERE criteria.name=? AND criteria.value=?";
+
+ Session session = Tools.getOpenSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ // perform lookup by explicitly specified users
+ Query criteriaQuery = session.createQuery(lookupByCriteria);
+ criteriaQuery.setString(0, criteria.getName());
+ criteriaQuery.setString(1, criteria.getValue());
+ criteriaQuery.setCacheable(true);
+ permissions.addAll(criteriaQuery.list());
+
+ tx.commit();
+ }
+ catch (Exception e)
+ {
+ tx.rollback();
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ Tools.closeSession(session);
+ }
+
+ return permissions;
+ }
+
+ private Set getCurrentRoles() throws PolicyContextException
+ {
+ Set<String> roles = new HashSet<String>();
+
+ // Get the current authenticated subject through the JACC contract
+ Subject subject = (Subject)PolicyContext.getContext("javax.security.auth.Subject.container");
+
+ if (subject != null)
+ {
+ Set tmp = subject.getPrincipals(JACCPortalPrincipal.class);
+ JACCPortalPrincipal pp = null;
+ for (Iterator i = tmp.iterator(); i.hasNext();)
+ {
+ pp = (JACCPortalPrincipal)i.next();
+ if (pp != null)
+ {
+ break;
+ }
+ }
+ if (pp == null)
+ {
+ pp = new JACCPortalPrincipal(subject);
+ tmp.add(pp);
+
+ // Lazy create all the permission containers for the given role names
+ for (Iterator i = pp.getRoles().iterator(); i.hasNext();)
+ {
+ Principal role = (Principal)i.next();
+ roles.add(role.getName());
+ }
+ }
+ }
+
+ if(roles.isEmpty())
+ {
+ //Check and see if roles are found propagated via the cluster context
+ roles = JCRCMS.getRoles();
+ }
+
+ return roles;
+ }
+}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/workflow/ApprovePublishImpl.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/workflow/ApprovePublishImpl.java 2008-10-23 14:59:55 UTC (rev 12152)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/workflow/ApprovePublishImpl.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -159,7 +159,7 @@
this.managerSet = new HashSet<String>();
for (int i = 0; i < managers.length; i++)
{
- this.managers[i] = st.nextToken();
+ this.managers[i] = st.nextToken().trim();
this.managerSet.add(this.managers[i]);
}
@@ -448,8 +448,8 @@
return;
}
- processInstance.getContextInstance().setVariable("approved", true);
- processInstance.getContextInstance().setVariable("modifiedContent", modifiedContent);
+ processInstance.getContextInstance().setVariable("approved", new Boolean(true));
+ processInstance.getContextInstance().setVariable("modifiedContent", modifiedContent.getBytes());
@SuppressWarnings("unchecked")
Collection<TaskInstance> allTasks = processInstance.getTaskMgmtInstance().getTaskInstances();
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/workflow/CMSWorkflowUtil.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/workflow/CMSWorkflowUtil.java 2008-10-23 14:59:55 UTC (rev 12152)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/workflow/CMSWorkflowUtil.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -25,8 +25,12 @@
import java.util.List;
import java.util.Locale;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
import javax.naming.InitialContext;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.portal.cms.CMS;
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.model.Content;
@@ -101,19 +105,28 @@
return content;
}
- /**
- *
- * @return
- */
- private static CMS getCMSService()
+ /** @return */
+ public static CMS getCMSService()
{
+ CMS cms = null;
try
{
- return (CMS)new InitialContext().lookup("java:/portal/CMS");
+ MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
+ cms = (CMS)MBeanProxy.get(CMS.class, new ObjectName("portal:service=CMS"), mbeanServer);
}
catch (Exception e)
- {
- throw new RuntimeException(e);
+ {
+ try
+ {
+ //Give it a last try and look up in the JNDI tree (this happens in the test suite, where there is no mbean server)
+ cms = (CMS)new InitialContext().lookup("java:/portal/CMS");
+ }
+ catch(Exception ex)
+ {
+ //This failed too....This is a real failure and throw an exception
+ throw new RuntimeException(ex);
+ }
}
+ return cms;
}
}
Modified: modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/workflow/FinalizePublish.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/workflow/FinalizePublish.java 2008-10-23 14:59:55 UTC (rev 12152)
+++ modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/workflow/FinalizePublish.java 2008-10-23 16:23:22 UTC (rev 12153)
@@ -1,191 +1,190 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.cms.workflow;
-
-import org.apache.log4j.Logger;
-import org.jboss.portal.cms.CMS;
-import org.jboss.portal.cms.Command;
-import org.jboss.portal.cms.impl.interceptors.ACLInterceptor;
-import org.jboss.portal.cms.impl.jcr.JCRCMS;
-import org.jboss.portal.cms.model.File;
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.exe.ExecutionContext;
-
-import javax.naming.InitialContext;
-import java.util.List;
-import java.util.Locale;
-import java.util.ArrayList;
-
-/**
- * Created on : Dec 20, 2006
- *
- * @author Sohil Shah - sohil.shah(a)jboss.com
- */
-public class FinalizePublish implements ActionHandler
-{
- /**
- *
- */
- private static Logger log = Logger.getLogger(FinalizePublish.class);
-
- /**
- *
- */
- public void execute(ExecutionContext executionContext)
- {
- Content content = (Content)executionContext.getContextInstance().getVariable("content");
- boolean approved = ((Boolean)executionContext.getContextInstance().getVariable("approved")).booleanValue();
- String modifiedContent = (String)executionContext.getContextInstance().getVariable("modifiedContent");
- long processId = executionContext.getProcessInstance().getId();
- CMS cms = this.getCMSService();
-
- int lastIndex = content.getPath().lastIndexOf('/');
- String path = content.getPath().substring(0, lastIndex);
- String language = content.getPath().substring(lastIndex + 1);
- if (approved)
- {
- ACLInterceptor.turnOff();
- JCRCMS.turnOffWorkflow();
-
- //create this content in the CMS and make it live
- Command command = cms.getCommandFactory().createContentGetVersionsCommand(content.getPath());
- List versions = (List)cms.execute(command);
- org.jboss.portal.cms.model.Content processContent = this.findProcessContent(processId, versions);
-
- /**
- * if processContent is null, a pending version of the content was not found
- * this could be due to an outdated link. let the process finish, but nothing
- * new will be published
- */
- if (processContent != null)
- {
- //get the file to be updated and published live
- command = cms.getCommandFactory().createFileGetCommand(path, processContent.getVersionNumber(),
- new Locale(language));
- File file = (File)cms.execute(command);
-
- if(modifiedContent != null && modifiedContent.trim().length()>0)
- {
- file.getContent().setBytes(modifiedContent.getBytes());
- }
-
- //now publish this
- file.getContent().setApprovalProcessId(null);
- file.getContent().setWaitingForPublishApproval(false);
- command = cms.getCommandFactory().createUpdateFileCommand(file, file.getContent(), true);
- cms.execute(command);
- }
-
-
- JCRCMS.turnOnWorkflow();
- ACLInterceptor.turnOn();
- }
- else
- {
- ACLInterceptor.turnOff();
- JCRCMS.turnOffWorkflow();
-
- //Check if there are any published versions of this file. If not, this is a new file that was denied publishing
- //hence delete the file itself
- Command command = cms.getCommandFactory().createContentGetVersionsCommand(content.getPath());
- List versions = (List)cms.execute(command);
- List filtered = this.filterPending(versions);
- if(filtered == null || filtered.isEmpty())
- {
- //Delete this file
- Command deleteCommand = cms.getCommandFactory().createDeleteCommand(path);
- cms.execute(deleteCommand);
- }
-
-
- JCRCMS.turnOnWorkflow();
- ACLInterceptor.turnOn();
- }
- }
-
- /**
- * @param processId
- * @param versions
- * @return
- */
- private org.jboss.portal.cms.model.Content findProcessContent(long processId, List versions)
- {
- org.jboss.portal.cms.model.Content content = null;
-
- if (versions != null)
- {
- for (int i = 0; i < versions.size(); i++)
- {
- org.jboss.portal.cms.model.Content cour = (org.jboss.portal.cms.model.Content)versions.get(i);
- if (cour.isWaitingForPublishApproval())
- {
- if (cour.getApprovalProcessId() != null &&
- cour.getApprovalProcessId().trim().equals(String.valueOf(processId)))
- {
- //not if found...the content of this version should be published to go live
- return cour;
- }
- }
- }
- }
-
- return content;
- }
-
- /**
- *
- * @param versions
- * @return
- */
- private List filterPending(List versions)
- {
- List filtered = new ArrayList();
-
- if(versions != null)
- {
- for(int i=0; i<versions.size(); i++)
- {
- org.jboss.portal.cms.model.Content content = (org.jboss.portal.cms.model.Content)versions.get(i);
- if(!content.isWaitingForPublishApproval())
- {
- filtered.add(content);
- }
- }
- }
-
- return filtered;
- }
-
- /** @return */
- private CMS getCMSService()
- {
- try
- {
- return (CMS)new InitialContext().lookup("java:/portal/CMS");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-}
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.workflow;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.cms.CMS;
+import org.jboss.portal.cms.Command;
+import org.jboss.portal.cms.impl.interceptors.ACLInterceptor;
+import org.jboss.portal.cms.impl.jcr.JCRCMS;
+import org.jboss.portal.cms.model.File;
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.exe.ExecutionContext;
+
+import java.util.List;
+import java.util.Locale;
+import java.util.ArrayList;
+
+/**
+ * Created on : Dec 20, 2006
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ */
+public class FinalizePublish implements ActionHandler
+{
+ /**
+ *
+ */
+ private static Logger log = Logger.getLogger(FinalizePublish.class);
+
+ /**
+ *
+ */
+ public void execute(ExecutionContext executionContext)
+ {
+ Content content = (Content)executionContext.getContextInstance().getVariable("content");
+ boolean approved = ((Boolean)executionContext.getContextInstance().getVariable("approved")).booleanValue();
+ byte[] modifiedContent = (byte[])executionContext.getContextInstance().getVariable("modifiedContent");
+ long processId = executionContext.getProcessInstance().getId();
+ CMS cms = this.getCMSService();
+
+ int lastIndex = content.getPath().lastIndexOf('/');
+ String path = content.getPath().substring(0, lastIndex);
+ String language = content.getPath().substring(lastIndex + 1);
+ if (approved)
+ {
+ ACLInterceptor.turnOff();
+ JCRCMS.turnOffWorkflow();
+
+ //create this content in the CMS and make it live
+ Command command = cms.getCommandFactory().createContentGetVersionsCommand(content.getPath());
+ List versions = (List)cms.execute(command);
+ org.jboss.portal.cms.model.Content processContent = this.findProcessContent(processId, versions);
+
+ /**
+ * if processContent is null, a pending version of the content was not found
+ * this could be due to an outdated link. let the process finish, but nothing
+ * new will be published
+ */
+ if (processContent != null)
+ {
+ //get the file to be updated and published live
+ command = cms.getCommandFactory().createFileGetCommand(path, processContent.getVersionNumber(),
+ new Locale(language));
+ File file = (File)cms.execute(command);
+
+ if(modifiedContent != null)
+ {
+ file.getContent().setBytes(modifiedContent);
+ }
+
+ //now publish this
+ file.getContent().setApprovalProcessId(null);
+ file.getContent().setWaitingForPublishApproval(false);
+ command = cms.getCommandFactory().createUpdateFileCommand(file, file.getContent(), true);
+ cms.execute(command);
+ }
+
+
+ JCRCMS.turnOnWorkflow();
+ ACLInterceptor.turnOn();
+ }
+ else
+ {
+ ACLInterceptor.turnOff();
+ JCRCMS.turnOffWorkflow();
+
+ //Check if there are any published versions of this file. If not, this is a new file that was denied publishing
+ //hence delete the file itself
+ Command command = cms.getCommandFactory().createContentGetVersionsCommand(content.getPath());
+ List versions = (List)cms.execute(command);
+ List filtered = this.filterPending(versions);
+ if(filtered == null || filtered.isEmpty())
+ {
+ //Delete this file
+ Command deleteCommand = cms.getCommandFactory().createDeleteCommand(path);
+ cms.execute(deleteCommand);
+ }
+
+
+ JCRCMS.turnOnWorkflow();
+ ACLInterceptor.turnOn();
+ }
+ }
+
+ /**
+ * @param processId
+ * @param versions
+ * @return
+ */
+ private org.jboss.portal.cms.model.Content findProcessContent(long processId, List versions)
+ {
+ org.jboss.portal.cms.model.Content content = null;
+
+ if (versions != null)
+ {
+ for (int i = 0; i < versions.size(); i++)
+ {
+ org.jboss.portal.cms.model.Content cour = (org.jboss.portal.cms.model.Content)versions.get(i);
+ if (cour.isWaitingForPublishApproval())
+ {
+ if (cour.getApprovalProcessId() != null &&
+ cour.getApprovalProcessId().trim().equals(String.valueOf(processId)))
+ {
+ //not if found...the content of this version should be published to go live
+ return cour;
+ }
+ }
+ }
+ }
+
+ return content;
+ }
+
+ /**
+ *
+ * @param versions
+ * @return
+ */
+ private List filterPending(List versions)
+ {
+ List filtered = new ArrayList();
+
+ if(versions != null)
+ {
+ for(int i=0; i<versions.size(); i++)
+ {
+ org.jboss.portal.cms.model.Content content = (org.jboss.portal.cms.model.Content)versions.get(i);
+ if(!content.isWaitingForPublishApproval())
+ {
+ filtered.add(content);
+ }
+ }
+ }
+
+ return filtered;
+ }
+
+ /** @return */
+ private CMS getCMSService()
+ {
+ try
+ {
+ return CMSWorkflowUtil.getCMSService();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
17 years, 6 months
JBoss Portal SVN: r12152 - tags/JBoss_Portal_2_6_7/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-10-23 10:59:55 -0400 (Thu, 23 Oct 2008)
New Revision: 12152
Modified:
tags/JBoss_Portal_2_6_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
Log:
JBPORTAL-2208: quick fix, real issue here is that we should have a concept of "WSRP transaction" so
that multiple WSRP calls can share information and avoid going to the producer even without cache.
Modified: tags/JBoss_Portal_2_6_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- tags/JBoss_Portal_2_6_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-10-23 14:21:47 UTC (rev 12151)
+++ tags/JBoss_Portal_2_6_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-10-23 14:59:55 UTC (rev 12152)
@@ -652,9 +652,8 @@
return portlet;
}
- public Map<String, Set<Portlet>> getPortletGroupMap() throws PortletInvokerException
+ Map<String, Set<Portlet>> getPortletGroupMap() throws PortletInvokerException
{
- refresh(false);
return portletGroups;
}
17 years, 6 months
JBoss Portal SVN: r12151 - branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-10-23 10:21:47 -0400 (Thu, 23 Oct 2008)
New Revision: 12151
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
Log:
- JBPORTAL-2208: quick fix, real issue here is that we should have a concept of "WSRP transaction" so
that multiple WSRP calls can share information and avoid going to the producer even without cache.
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-10-23 13:47:18 UTC (rev 12150)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-10-23 14:21:47 UTC (rev 12151)
@@ -652,9 +652,8 @@
return portlet;
}
- public Map<String, Set<Portlet>> getPortletGroupMap() throws PortletInvokerException
+ Map<String, Set<Portlet>> getPortletGroupMap() throws PortletInvokerException
{
- refresh(false);
return portletGroups;
}
17 years, 6 months
JBoss Portal SVN: r12150 - branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-10-23 09:47:18 -0400 (Thu, 23 Oct 2008)
New Revision: 12150
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
Log:
- JBPORTAL-2208: quick fix, real issue here is that we should have a concept of "WSRP transaction" so
that multiple WSRP calls can share information and avoid going to the producer even without cache.
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-10-23 12:22:03 UTC (rev 12149)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-10-23 13:47:18 UTC (rev 12150)
@@ -652,9 +652,8 @@
return portlet;
}
- public Map<String, Set<Portlet>> getPortletGroupMap() throws PortletInvokerException
+ Map<String, Set<Portlet>> getPortletGroupMap() throws PortletInvokerException
{
- refresh(false);
return portletGroups;
}
17 years, 6 months
JBoss Portal SVN: r12149 - tags/JBoss_Portal_2_6_7/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-10-23 08:22:03 -0400 (Thu, 23 Oct 2008)
New Revision: 12149
Modified:
tags/JBoss_Portal_2_6_7/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
Log:
Fixed duplicated IDs
Modified: tags/JBoss_Portal_2_6_7/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
===================================================================
--- tags/JBoss_Portal_2_6_7/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml 2008-10-23 10:33:56 UTC (rev 12148)
+++ tags/JBoss_Portal_2_6_7/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml 2008-10-23 12:22:03 UTC (rev 12149)
@@ -26,7 +26,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[0]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step0"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="0"/>
<div class="wizardStepBox">
@@ -58,7 +58,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[1]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step1"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="1"/>
<div class="wizardStepBox">
@@ -90,7 +90,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[2]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step2"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="2"/>
<div class="wizardStepBox">
@@ -122,7 +122,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[3]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step3"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="3"/>
<div class="wizardStepBox">
@@ -154,7 +154,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[4]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step4"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="4"/>
<div class="wizardStepBox">
17 years, 6 months
JBoss Portal SVN: r12148 - in branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts: 3columns and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-10-23 06:33:56 -0400 (Thu, 23 Oct 2008)
New Revision: 12148
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/1column/index.jsp
branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/3columns/index.jsp
branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/generic/index.jsp
branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/generic/maximized.jsp
Log:
- Default theme is now Renewal, not Renaissance...
Modified: branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/1column/index.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/1column/index.jsp 2008-10-23 10:33:03 UTC (rev 12147)
+++ branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/1column/index.jsp 2008-10-23 10:33:56 UTC (rev 12148)
@@ -10,7 +10,7 @@
<meta http-equiv="Content-Type" content="text/html;"/>
<!-- to correct the unsightly Flash of Unstyled Content. -->
<script type="text/javascript"></script>
- <!-- inject the theme, default to the Renaissance theme if nothing is selected for the portal or the page -->
+ <!-- inject the theme, default to the Renewal theme if nothing is selected for the portal or the page -->
<p:theme themeName="renewal"/>
<!-- insert header content that was possibly set by portlets on the page -->
<p:headerContent/>
Modified: branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/3columns/index.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/3columns/index.jsp 2008-10-23 10:33:03 UTC (rev 12147)
+++ branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/3columns/index.jsp 2008-10-23 10:33:56 UTC (rev 12148)
@@ -10,7 +10,7 @@
<meta http-equiv="Content-Type" content="text/html;"/>
<!-- to correct the unsightly Flash of Unstyled Content. -->
<script type="text/javascript"></script>
- <!-- inject the theme, default to the Renaissance theme if nothing is selected for the portal or the page -->
+ <!-- inject the theme, default to the Renewal theme if nothing is selected for the portal or the page -->
<p:theme themeName="renewal"/>
<!-- insert header content that was possibly set by portlets on the page -->
<p:headerContent/>
Modified: branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/generic/index.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/generic/index.jsp 2008-10-23 10:33:03 UTC (rev 12147)
+++ branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/generic/index.jsp 2008-10-23 10:33:56 UTC (rev 12148)
@@ -10,7 +10,7 @@
<meta http-equiv="Content-Type" content="text/html;"/>
<!-- to correct the unsightly Flash of Unstyled Content. -->
<script type="text/javascript"></script>
- <!-- inject the theme, default to the Renaissance theme if nothing is selected for the portal or the page -->
+ <!-- inject the theme, default to the Renewal theme if nothing is selected for the portal or the page -->
<p:theme themeName="renewal"/>
<!-- insert header content that was possibly set by portlets on the page -->
<p:headerContent/>
Modified: branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/generic/maximized.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/generic/maximized.jsp 2008-10-23 10:33:03 UTC (rev 12147)
+++ branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/layouts/generic/maximized.jsp 2008-10-23 10:33:56 UTC (rev 12148)
@@ -10,7 +10,7 @@
<meta http-equiv="Content-Type" content="text/html;"/>
<!-- to correct the unsightly Flash of Unstyled Content. -->
<script type="text/javascript"></script>
- <!-- use the renaissance theme if nothing else was defined for the portal or the page -->
+ <!-- use the renewal theme if nothing else was defined for the portal or the page -->
<p:theme themeName="renewal"/>
<!-- inject header content that was generated by the portlets on the requested page -->
<p:headerContent/>
17 years, 6 months
JBoss Portal SVN: r12147 - branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/wizard.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-10-23 06:33:03 -0400 (Thu, 23 Oct 2008)
New Revision: 12147
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/wizard/newWindowTpl.xhtml
Log:
- Fixed duplicated IDs: please add meaningful IDs or don't add them at all, especially not duplicated ones!
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/wizard/newWindowTpl.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/wizard/newWindowTpl.xhtml 2008-10-23 10:32:33 UTC (rev 12146)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/wizard/newWindowTpl.xhtml 2008-10-23 10:33:03 UTC (rev 12147)
@@ -26,7 +26,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[0]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step0"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="0"/>
<div class="wizardStepBox">
@@ -58,7 +58,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[1]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step1"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="1"/>
<div class="wizardStepBox">
@@ -90,7 +90,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[2]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step2"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="2"/>
<div class="wizardStepBox">
@@ -122,7 +122,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[3]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step3"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="3"/>
<div class="wizardStepBox">
@@ -154,7 +154,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[4]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step4"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="4"/>
<div class="wizardStepBox">
17 years, 6 months
JBoss Portal SVN: r12146 - branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-10-23 06:32:33 -0400 (Thu, 23 Oct 2008)
New Revision: 12146
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
Log:
- Fixed duplicated IDs: please add meaningful IDs or don't add them at all, especially not duplicated ones!
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml 2008-10-23 09:04:13 UTC (rev 12145)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml 2008-10-23 10:32:33 UTC (rev 12146)
@@ -26,7 +26,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[0]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step0"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="0"/>
<div class="wizardStepBox">
@@ -58,7 +58,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[1]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step1"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="1"/>
<div class="wizardStepBox">
@@ -90,7 +90,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[2]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step2"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="2"/>
<div class="wizardStepBox">
@@ -122,7 +122,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[3]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step3"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="3"/>
<div class="wizardStepBox">
@@ -154,7 +154,7 @@
<c:otherwise>
<c:choose>
<c:when test="#{newWindowWizard.enabled[4]}">
- <h:form id="new-window-wiz-form"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
+ <h:form id="step4"><h:commandLink id="goto-link" action="#{newWindowWizard.goTo}">
<f:param name="step" value="4"/>
<div class="wizardStepBox">
17 years, 6 months
JBoss Portal SVN: r12145 - in tags/JBoss_Portal_2_6_7: core-cms/src/main/org/jboss/portal/core/cms/ui/admin and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-10-23 05:04:13 -0400 (Thu, 23 Oct 2008)
New Revision: 12145
Modified:
tags/JBoss_Portal_2_6_7/cms/src/main/org/jboss/portal/cms/CMSException.java
tags/JBoss_Portal_2_6_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
Log:
minor bug fix.
Modified: tags/JBoss_Portal_2_6_7/cms/src/main/org/jboss/portal/cms/CMSException.java
===================================================================
--- tags/JBoss_Portal_2_6_7/cms/src/main/org/jboss/portal/cms/CMSException.java 2008-10-23 06:19:00 UTC (rev 12144)
+++ tags/JBoss_Portal_2_6_7/cms/src/main/org/jboss/portal/cms/CMSException.java 2008-10-23 09:04:13 UTC (rev 12145)
@@ -54,7 +54,7 @@
{
boolean pathFormatFailure = false;
- if(this.getMessage().indexOf("is not a legal path element")!=-1)
+ if(this.getMessage().indexOf("is not a legal path element")!=-1 || this.getMessage().indexOf("is not a valid path")!=-1)
{
pathFormatFailure = true;
}
Modified: tags/JBoss_Portal_2_6_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- tags/JBoss_Portal_2_6_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-10-23 06:19:00 UTC (rev 12144)
+++ tags/JBoss_Portal_2_6_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-10-23 09:04:13 UTC (rev 12145)
@@ -157,14 +157,9 @@
throws PortletException, IOException, UnavailableException
{
//SetUp the properly localized Date Formatter to be used by the View JSPs
- Format dateFormat = (Format)rReq.getPortletSession().getAttribute(CMSAdminConstants.DATE_FORMAT);
- if(dateFormat == null)
- {
- ResourceBundle bundle = this.getPortletConfig().getResourceBundle(rReq.getLocale());
- String datePattern = bundle.getString(CMSAdminConstants.CMS_DATE_PATTERN);
- dateFormat = new SimpleDateFormat(datePattern, rReq.getLocale());
- rReq.getPortletSession().setAttribute(CMSAdminConstants.DATE_FORMAT, dateFormat);
- }
+ ResourceBundle bundle = this.getPortletConfig().getResourceBundle(rReq.getLocale());
+ String datePattern = bundle.getString(CMSAdminConstants.CMS_DATE_PATTERN);
+ Format dateFormat = new SimpleDateFormat(datePattern, rReq.getLocale());
rReq.setAttribute(CMSAdminConstants.DATE_FORMAT, dateFormat);
17 years, 6 months
JBoss Portal SVN: r12144 - tags/JBoss_Portal_2_6_7/core-cms/src/resources/portal-cms-sar/conf/hibernate/cms.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-10-23 02:19:00 -0400 (Thu, 23 Oct 2008)
New Revision: 12144
Modified:
tags/JBoss_Portal_2_6_7/core-cms/src/resources/portal-cms-sar/conf/hibernate/cms/hibernate.cfg.xml
Log:
fixing the Hibernate Cache Provider for the CMS service
Modified: tags/JBoss_Portal_2_6_7/core-cms/src/resources/portal-cms-sar/conf/hibernate/cms/hibernate.cfg.xml
===================================================================
--- tags/JBoss_Portal_2_6_7/core-cms/src/resources/portal-cms-sar/conf/hibernate/cms/hibernate.cfg.xml 2008-10-23 05:30:32 UTC (rev 12143)
+++ tags/JBoss_Portal_2_6_7/core-cms/src/resources/portal-cms-sar/conf/hibernate/cms/hibernate.cfg.xml 2008-10-23 06:19:00 UTC (rev 12144)
@@ -37,8 +37,8 @@
<!--
| Uncomment in clustered mode : use transactional replicated cache
@portal.single.xml.close@
- <property name="cache.provider_class">org.jboss.portal.jems.hibernate.JMXTreeCacheProvider</property>
- <property name="cache.object_name">portal:service=TreeCacheProvider,type=hibernate</property>
+ <property name="cache.provider_class">org.jboss.hibernate.jbc.cacheprovider.JmxBoundTreeCacheProvider</property>
+ <property name="treecache.mbean.object_name">portal:service=TreeCache,type=hibernate</property>
@portal.single.xml.open@
-->
17 years, 6 months