Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsImpl.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsImpl.java Sat Mar 15 15:59:17 2014
@@ -16,6 +16,7 @@
*/
package org.apache.jetspeed.om.page.impl;
+import org.apache.jetspeed.om.common.SecurityConstraint;
import org.apache.jetspeed.om.common.SecurityConstraints;
import org.apache.jetspeed.om.page.PageSecurity;
import org.apache.jetspeed.om.page.SecurityConstraintImpl;
@@ -40,13 +41,13 @@ public class SecurityConstraintsImpl imp
private final static Logger log = LoggerFactory.getLogger(SecurityConstraintsImpl.class);
private String owner;
- private List constraints;
- private List constraintsRefs;
+ private List<SecurityConstraintImpl> constraints;
+ private List<BaseSecurityConstraintsRef> constraintsRefs;
private SecurityConstraintList securityConstraints;
private SecurityConstraintsRefList securityConstraintsRefs;
- private List allConstraints;
+ private List<Object> allConstraints;
/**
* accessConstraintsRefs
@@ -55,7 +56,7 @@ public class SecurityConstraintsImpl imp
*
* @return persistent collection
*/
- List accessConstraintsRefs()
+ List<BaseSecurityConstraintsRef> accessConstraintsRefs()
{
// create initial collection if necessary
if (constraintsRefs == null)
@@ -72,7 +73,7 @@ public class SecurityConstraintsImpl imp
*
* @return persistent collection
*/
- List accessConstraints()
+ List<SecurityConstraintImpl> accessConstraints()
{
// create initial collection if necessary
if (constraints == null)
@@ -118,7 +119,7 @@ public class SecurityConstraintsImpl imp
* @param pageSecurity page security definitions
* @throws SecurityException
*/
- public void checkConstraints(List actions, List userPrincipals, List rolePrincipals, List groupPrincipals, PageSecurity pageSecurity) throws SecurityException
+ public void checkConstraints(List<String> actions, List<String> userPrincipals, List<String> rolePrincipals, List<String> groupPrincipals, PageSecurity pageSecurity) throws SecurityException
{
// if owner defined, override all constraints and allow all access
if ((owner != null) && (userPrincipals != null) && userPrincipals.contains(owner))
@@ -239,7 +240,7 @@ public class SecurityConstraintsImpl imp
* @return all security constraints and constraints ref expressions
* @throws RuntimeException if expression parsing error occurs
*/
- private synchronized List getAllSecurityConstraints(PageSecurity pageSecurity)
+ private synchronized List<Object> getAllSecurityConstraints(PageSecurity pageSecurity)
{
// return previously cached security constraints
if (allConstraints != null)
@@ -248,7 +249,7 @@ public class SecurityConstraintsImpl imp
}
// construct new ordered security constraints list
- List newAllConstraints = new ArrayList();
+ List<Object> newAllConstraints = new ArrayList<Object>();
// add any defined security constraints
if ((getSecurityConstraints() != null) && !getSecurityConstraints().isEmpty())
@@ -259,7 +260,7 @@ public class SecurityConstraintsImpl imp
// add any security constraints references
if ((getSecurityConstraintsRefs() != null) && !getSecurityConstraintsRefs().isEmpty())
{
- List referencedConstraints = dereferenceSecurityConstraintsRefs(getSecurityConstraintsRefs(), pageSecurity);
+ List<Object> referencedConstraints = dereferenceSecurityConstraintsRefs(getSecurityConstraintsRefs(), pageSecurity);
if (referencedConstraints != null)
{
newAllConstraints.addAll(referencedConstraints);
@@ -269,10 +270,10 @@ public class SecurityConstraintsImpl imp
// add any global security constraints references
if (pageSecurity != null)
{
- List globalConstraintsRefs = pageSecurity.getGlobalSecurityConstraintsRefs();
+ List<String> globalConstraintsRefs = pageSecurity.getGlobalSecurityConstraintsRefs();
if ((globalConstraintsRefs != null) && !globalConstraintsRefs.isEmpty())
{
- List referencedConstraints = dereferenceSecurityConstraintsRefs(globalConstraintsRefs, pageSecurity);
+ List<Object> referencedConstraints = dereferenceSecurityConstraintsRefs(globalConstraintsRefs, pageSecurity);
if (referencedConstraints != null)
{
newAllConstraints.addAll(referencedConstraints);
@@ -300,9 +301,9 @@ public class SecurityConstraintsImpl imp
* @return security constraints and constraints ref expressions
* @throws RuntimeException if expression parsing error occurs
*/
- private List dereferenceSecurityConstraintsRefs(List constraintsRefs, PageSecurity pageSecurity)
+ private List<Object> dereferenceSecurityConstraintsRefs(List<String> constraintsRefs, PageSecurity pageSecurity)
{
- List constraints = null;
+ List<Object> constraints = null;
if (pageSecurity != null)
{
// dereference each security constraints definition
@@ -311,24 +312,27 @@ public class SecurityConstraintsImpl imp
{
String constraintsRef = (String)constraintsRefsIter.next();
// parse constraints ref and return constraints/constraints ref expressions
- Object constraintsOrExpression = SecurityConstraintsRefParser.parse(constraintsRef, pageSecurity);
- if (constraintsOrExpression instanceof List)
+ Object parsedConstraintsOrExpression = SecurityConstraintsRefParser.parse(constraintsRef, pageSecurity);
+ if (parsedConstraintsOrExpression instanceof List)
{
+ @SuppressWarnings("unchecked")
+ List<Object> parsedConstraints = (List)parsedConstraintsOrExpression;
if (constraints == null)
{
- constraints = new ArrayList();
+ constraints = new ArrayList<Object>();
}
- constraints.addAll((List)constraintsOrExpression);
+ constraints.addAll(parsedConstraints);
}
- else if (constraintsOrExpression instanceof SecurityConstraintsRefExpression)
+ else if (parsedConstraintsOrExpression instanceof SecurityConstraintsRefExpression)
{
+ Object parsedExpression = parsedConstraintsOrExpression;
if (constraints == null)
{
- constraints = new ArrayList();
+ constraints = new ArrayList<Object>();
}
- constraints.add(constraintsOrExpression);
+ constraints.add(parsedExpression);
}
- else if (constraintsOrExpression != null)
+ else if (parsedConstraintsOrExpression != null)
{
throw new RuntimeException("Unexpected security constraints ref parser result");
}
@@ -362,7 +366,7 @@ public class SecurityConstraintsImpl imp
/* (non-Javadoc)
* @see org.apache.jetspeed.om.common.SecurityConstraints#getSecurityConstraints()
*/
- public List getSecurityConstraints()
+ public List<SecurityConstraint> getSecurityConstraints()
{
// return mutable inline constraint list
// by using list wrapper to manage apply order
@@ -376,12 +380,12 @@ public class SecurityConstraintsImpl imp
/* (non-Javadoc)
* @see org.apache.jetspeed.om.common.SecurityConstraints#setSecurityConstraints(java.util.List)
*/
- public void setSecurityConstraints(List constraints)
+ public void setSecurityConstraints(List<SecurityConstraint> constraints)
{
// set inline constraints by replacing existing
// entries with new elements if new collection
// is specified
- List securityConstraints = getSecurityConstraints();
+ List<SecurityConstraint> securityConstraints = getSecurityConstraints();
if (constraints != securityConstraints)
{
// replace all constraints
@@ -398,7 +402,7 @@ public class SecurityConstraintsImpl imp
/* (non-Javadoc)
* @see org.apache.jetspeed.om.common.SecurityConstraints#getSecurityConstraintsRefs()
*/
- public List getSecurityConstraintsRefs()
+ public List<String> getSecurityConstraintsRefs()
{
// return mutable constraints refs list
// by using list wrapper to manage apply
@@ -413,12 +417,12 @@ public class SecurityConstraintsImpl imp
/* (non-Javadoc)
* @see org.apache.jetspeed.om.common.SecurityConstraints#setSecurityConstraintsRefs(java.util.List)
*/
- public void setSecurityConstraintsRefs(List constraintsRefs)
+ public void setSecurityConstraintsRefs(List<String> constraintsRefs)
{
// set constraints refs using ordered ref
// names by replacing existing entries with
// new elements if new collection is specified
- List securityConstraintsRefs = getSecurityConstraintsRefs();
+ List<String> securityConstraintsRefs = getSecurityConstraintsRefs();
if (constraintsRefs != securityConstraintsRefs)
{
// replace all constraints ref names
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsRefList.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsRefList.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsRefList.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsRefList.java Sat Mar 15 15:59:17 2014
@@ -17,21 +17,21 @@
package org.apache.jetspeed.om.page.impl;
import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
-import org.apache.jetspeed.page.impl.DatabasePageManagerUtils;
-
/**
* SecurityConstraintsRefList
*
* @author <a href="mailto:[email protected]">Randy Watler</a>
* @version $Id$
*/
-class SecurityConstraintsRefList extends AbstractList
+class SecurityConstraintsRefList extends AbstractList<String>
{
private SecurityConstraintsImpl constraints;
- private List removedConstraintsRefs;
+ private List<BaseSecurityConstraintsRef> removedConstraintsRefs;
SecurityConstraintsRefList(SecurityConstraintsImpl constraints)
{
@@ -90,7 +90,7 @@ class SecurityConstraintsRefList extends
int removedIndex = removedConstraintsRefs.indexOf(constraintsRef);
if (removedIndex >= 0)
{
- constraintsRef = (BaseSecurityConstraintsRef)removedConstraintsRefs.remove(removedIndex);
+ constraintsRef = removedConstraintsRefs.remove(removedIndex);
}
}
return constraintsRef;
@@ -101,11 +101,11 @@ class SecurityConstraintsRefList extends
*
* @return removed constraints refs tracking collection
*/
- private List getRemovedConstraintsRefs()
+ private List<BaseSecurityConstraintsRef> getRemovedConstraintsRefs()
{
if (removedConstraintsRefs == null)
{
- removedConstraintsRefs = DatabasePageManagerUtils.createList();
+ removedConstraintsRefs = Collections.synchronizedList(new ArrayList<BaseSecurityConstraintsRef>());
}
return removedConstraintsRefs;
}
@@ -113,7 +113,7 @@ class SecurityConstraintsRefList extends
/* (non-Javadoc)
* @see java.util.List#add(int,java.lang.Object)
*/
- public void add(int index, Object element)
+ public void add(int index, String element)
{
// implement for modifiable AbstractList:
// validate index
@@ -122,13 +122,13 @@ class SecurityConstraintsRefList extends
throw new IndexOutOfBoundsException("Unable to add to list at index: " + index);
}
// wrap and verify constraints ref name string
- BaseSecurityConstraintsRef constraintsRef = wrapNameStringForAdd((String)element);
+ BaseSecurityConstraintsRef constraintsRef = wrapNameStringForAdd(element);
// add to underlying ordered list
constraints.accessConstraintsRefs().add(index, constraintsRef);
// set apply order in added element
if (index > 0)
{
- constraintsRef.setApplyOrder(((BaseSecurityConstraintsRef)constraints.accessConstraintsRefs().get(index-1)).getApplyOrder() + 1);
+ constraintsRef.setApplyOrder(constraints.accessConstraintsRefs().get(index-1).getApplyOrder() + 1);
}
else
{
@@ -137,7 +137,7 @@ class SecurityConstraintsRefList extends
// maintain apply order in subsequent elements
for (int i = index, limit = constraints.accessConstraintsRefs().size() - 1; (i < limit); i++)
{
- BaseSecurityConstraintsRef nextConstraintsRef = (BaseSecurityConstraintsRef)constraints.accessConstraintsRefs().get(i + 1);
+ BaseSecurityConstraintsRef nextConstraintsRef = constraints.accessConstraintsRefs().get(i + 1);
if (nextConstraintsRef.getApplyOrder() <= constraintsRef.getApplyOrder())
{
// adjust apply order for next element
@@ -157,20 +157,20 @@ class SecurityConstraintsRefList extends
/* (non-Javadoc)
* @see java.util.List#get(int)
*/
- public Object get(int index)
+ public String get(int index)
{
// implement for modifiable AbstractList:
// unwrap constraints ref name string
- return ((BaseSecurityConstraintsRef)constraints.accessConstraintsRefs().get(index)).getName();
+ return constraints.accessConstraintsRefs().get(index).getName();
}
/* (non-Javadoc)
* @see java.util.List#remove(int)
*/
- public Object remove(int index)
+ public String remove(int index)
{
// implement for modifiable AbstractList
- BaseSecurityConstraintsRef removed = (BaseSecurityConstraintsRef)constraints.accessConstraintsRefs().remove(index);
+ BaseSecurityConstraintsRef removed = constraints.accessConstraintsRefs().remove(index);
if (removed != null)
{
// save removed element
@@ -178,19 +178,19 @@ class SecurityConstraintsRefList extends
// clear all cached security constraints
constraints.clearAllSecurityConstraints();
}
- return removed;
+ return removed.getName();
}
/* (non-Javadoc)
* @see java.util.List#set(int,java.lang.Object)
*/
- public Object set(int index, Object element)
+ public String set(int index, String element)
{
// implement for modifiable AbstractList:
// wrap and verify constraints ref name string
- BaseSecurityConstraintsRef newConstraintsRef = wrapNameStringForAdd((String)element);
+ BaseSecurityConstraintsRef newConstraintsRef = wrapNameStringForAdd(element);
// set in underlying ordered list
- BaseSecurityConstraintsRef constraintsRef = (BaseSecurityConstraintsRef)constraints.accessConstraintsRefs().set(index, newConstraintsRef);
+ BaseSecurityConstraintsRef constraintsRef = constraints.accessConstraintsRefs().set(index, newConstraintsRef);
// set apply order in new element
newConstraintsRef.setApplyOrder(constraintsRef.getApplyOrder());
// save replaced element
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.java Sat Mar 15 15:59:17 2014
@@ -161,7 +161,7 @@ public abstract class AbstractBaseElemen
* getConstraintsEnabled
* </p>
*
- * @see org.apache.jetspeed.om.common.SecureResource#getConstraintsEnabled()
+ * @see org.apache.jetspeed.om.common.SecuredResource#getConstraintsEnabled()
* @return whether security relies on PSML constraints
*/
public boolean getConstraintsEnabled()
@@ -186,7 +186,7 @@ public abstract class AbstractBaseElemen
* getSecurityConstraints
* </p>
*
- * @see org.apache.jetspeed.om.common.SecureResource#getSecurityConstraints()
+ * @see org.apache.jetspeed.om.common.SecuredResource#getSecurityConstraints()
* @return the PSML security constraints
*/
public SecurityConstraints getSecurityConstraints()
@@ -199,7 +199,7 @@ public abstract class AbstractBaseElemen
* newSecurityConstraints
* </p>
*
- * @see org.apache.jetspeed.om.common.SecureResource#newSecurityConstraints()
+ * @see org.apache.jetspeed.om.common.SecuredResource#newSecurityConstraints()
* @return a new security constraints object
*/
public SecurityConstraints newSecurityConstraints()
@@ -212,7 +212,7 @@ public abstract class AbstractBaseElemen
* newSecurityConstraint
* </p>
*
- * @see org.apache.jetspeed.om.common.SecureResource#newSecurityConstraint()
+ * @see org.apache.jetspeed.om.common.SecuredResource#newSecurityConstraint()
* @return security constraint
*/
public SecurityConstraint newSecurityConstraint()
@@ -225,7 +225,7 @@ public abstract class AbstractBaseElemen
* setSecurityConstraints
* </p>
*
- * @see org.apache.jetspeed.om.common.SecureResource#setSecurityConstraints(org.apache.jetspeed.om.common.SecurityConstraints)
+ * @see org.apache.jetspeed.om.common.SecuredResource#setSecurityConstraints(org.apache.jetspeed.om.common.SecurityConstraints)
* @param constraints
*/
public void setSecurityConstraints(SecurityConstraints constraints)
@@ -238,7 +238,7 @@ public abstract class AbstractBaseElemen
* checkConstraints
* </p>
*
- * @see org.apache.jetspeed.om.common.SecureResource#checkConstraints(java.lang.String)
+ * @see org.apache.jetspeed.om.common.SecuredResource#checkConstraints(java.lang.String)
* @param actions
* @throws SecurityException
*/
@@ -258,8 +258,8 @@ public abstract class AbstractBaseElemen
// get action names lists; separate view and other
// actions to mimic file system permissions logic
- List viewActionList = SecurityConstraintImpl.parseCSVList(actions);
- List otherActionsList = null;
+ List<String> viewActionList = SecurityConstraintImpl.parseCSVList(actions);
+ List<String> otherActionsList = null;
if (viewActionList.size() == 1)
{
if (!viewActionList.contains(JetspeedActions.VIEW))
@@ -274,7 +274,7 @@ public abstract class AbstractBaseElemen
viewActionList = null;
if (otherActionsList.remove(JetspeedActions.VIEW))
{
- viewActionList = new ArrayList(1);
+ viewActionList = new ArrayList<String>(1);
viewActionList.add(JetspeedActions.VIEW);
}
}
@@ -287,9 +287,9 @@ public abstract class AbstractBaseElemen
}
// get user/group/role principal names
- List userPrincipals = null;
- List rolePrincipals = null;
- List groupPrincipals = null;
+ List<String> userPrincipals = null;
+ List<String> rolePrincipals = null;
+ List<String> groupPrincipals = null;
Iterator principals = subject.getPrincipals().iterator();
while (principals.hasNext())
{
@@ -298,7 +298,7 @@ public abstract class AbstractBaseElemen
{
if (userPrincipals == null)
{
- userPrincipals = new LinkedList();
+ userPrincipals = new LinkedList<String>();
}
userPrincipals.add(principal.getName());
}
@@ -306,7 +306,7 @@ public abstract class AbstractBaseElemen
{
if (rolePrincipals == null)
{
- rolePrincipals = new LinkedList();
+ rolePrincipals = new LinkedList<String>();
}
rolePrincipals.add(principal.getName());
}
@@ -314,7 +314,7 @@ public abstract class AbstractBaseElemen
{
if (groupPrincipals == null)
{
- groupPrincipals = new LinkedList();
+ groupPrincipals = new LinkedList<String>();
}
groupPrincipals.add(principal.getName());
}
@@ -344,7 +344,7 @@ public abstract class AbstractBaseElemen
* @param checkParentsOnly
* @throws SecurityException
*/
- public void checkConstraints(List actions, List userPrincipals, List rolePrincipals, List groupPrincipals, boolean checkNodeOnly, boolean checkParentsOnly) throws SecurityException
+ public void checkConstraints(List<String> actions, List<String> userPrincipals, List<String> rolePrincipals, List<String> groupPrincipals, boolean checkNodeOnly, boolean checkParentsOnly) throws SecurityException
{
// check node constraints if available
if ((constraints != null) && !constraints.isEmpty())
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBaseFragmentElement.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBaseFragmentElement.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBaseFragmentElement.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBaseFragmentElement.java Sat Mar 15 15:59:17 2014
@@ -46,9 +46,9 @@ public abstract class AbstractBaseFragme
private String skin = null;
- private List propertyImpls = new ArrayList();
+ private List<FragmentProperty> propertyImpls = new ArrayList<FragmentProperty>();
- private List preferences = new ArrayList();
+ private List<FragmentPreference> preferences = new ArrayList<FragmentPreference>();
private String name;
@@ -650,7 +650,7 @@ public abstract class AbstractBaseFragme
{
if (preferences == null)
{
- preferences = new ArrayList();
+ preferences = new ArrayList<FragmentPreference>();
}
this.preferences = preferences;
}
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBaseFragmentsElement.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBaseFragmentsElement.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBaseFragmentsElement.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBaseFragmentsElement.java Sat Mar 15 15:59:17 2014
@@ -129,15 +129,15 @@ public abstract class AbstractBaseFragme
/* (non-Javadoc)
* @see org.apache.jetspeed.om.page.BaseFragmentsElement#getFragmentById(java.lang.String)
*/
- public BaseFragmentElement getFragmentById( String id )
+ public BaseFragmentElement getFragmentById(String id)
{
- Stack stack = new Stack();
+ Stack<BaseFragmentElement> stack = new Stack<BaseFragmentElement>();
if (getRootFragment() != null)
{
stack.push(getRootFragment());
}
- BaseFragmentElement f = (BaseFragmentElement) stack.pop();
+ BaseFragmentElement f = stack.pop();
while ((f != null) && (!(f.getId().equals(id))))
{
@@ -147,13 +147,13 @@ public abstract class AbstractBaseFragme
while (i.hasNext())
{
- stack.push(i.next());
+ stack.push((BaseFragmentElement)i.next());
}
}
if (stack.size() > 0)
{
- f = (BaseFragmentElement) stack.pop();
+ f = stack.pop();
}
else
{
@@ -167,16 +167,16 @@ public abstract class AbstractBaseFragme
/* (non-Javadoc)
* @see org.apache.jetspeed.om.page.BaseFragmentsElement#removeFragmentById(java.lang.String)
*/
- public BaseFragmentElement removeFragmentById( String id )
+ public BaseFragmentElement removeFragmentById(String id)
{
// find fragment by id, tracking fragment parent
- Map parents = new HashMap();
- Stack stack = new Stack();
+ Map<BaseFragmentElement,BaseFragmentElement> parents = new HashMap<BaseFragmentElement,BaseFragmentElement>();
+ Stack<BaseFragmentElement> stack = new Stack<BaseFragmentElement>();
if (getRootFragment() != null)
{
stack.push(getRootFragment());
}
- BaseFragmentElement f = (BaseFragmentElement) stack.pop();
+ BaseFragmentElement f = stack.pop();
while ((f != null) && (!(f.getId().equals(id))))
{
if (f instanceof Fragment)
@@ -193,7 +193,7 @@ public abstract class AbstractBaseFragme
if (stack.size() > 0)
{
- f = (BaseFragmentElement) stack.pop();
+ f = stack.pop();
}
else
{
@@ -204,7 +204,7 @@ public abstract class AbstractBaseFragme
// remove fragment from parent/page root
if (f != null)
{
- BaseFragmentElement parent = (BaseFragmentElement)parents.get(f);
+ BaseFragmentElement parent = parents.get(f);
if (parent != null)
{
if (parent instanceof Fragment)
@@ -232,17 +232,17 @@ public abstract class AbstractBaseFragme
/* (non-Javadoc)
* @see org.apache.jetspeed.om.page.BaseFragmentsElement#getFragmentsByName(java.lang.String)
*/
- public List<BaseFragmentElement> getFragmentsByName( String name )
+ public List<BaseFragmentElement> getFragmentsByName(String name)
{
List<BaseFragmentElement> fragments = new ArrayList<BaseFragmentElement>();
- Stack stack = new Stack();
+ Stack<BaseFragmentElement> stack = new Stack<BaseFragmentElement>();
if (getRootFragment() != null)
{
stack.push(getRootFragment());
}
- BaseFragmentElement f = (BaseFragmentElement) stack.pop();
+ BaseFragmentElement f = stack.pop();
while (f != null)
{
@@ -258,13 +258,13 @@ public abstract class AbstractBaseFragme
while (i.hasNext())
{
- stack.push(i.next());
+ stack.push((BaseFragmentElement)i.next());
}
}
if (stack.size() > 0)
{
- f = (BaseFragmentElement) stack.pop();
+ f = stack.pop();
}
else
{
@@ -278,17 +278,17 @@ public abstract class AbstractBaseFragme
/* (non-Javadoc)
* @see org.apache.jetspeed.om.page.BaseFragmentsElement#getFragmentsByInterface(java.lang.Class)
*/
- public List<BaseFragmentElement> getFragmentsByInterface( Class interfaceFilter )
+ public List<BaseFragmentElement> getFragmentsByInterface(Class interfaceFilter)
{
List<BaseFragmentElement> fragments = new ArrayList<BaseFragmentElement>();
- Stack stack = new Stack();
+ Stack<BaseFragmentElement> stack = new Stack<BaseFragmentElement>();
if (getRootFragment() != null)
{
stack.push(getRootFragment());
}
- BaseFragmentElement f = (stack.isEmpty() ? null : (BaseFragmentElement) stack.pop());
+ BaseFragmentElement f = (stack.isEmpty() ? null : stack.pop());
while (f != null)
{
@@ -304,11 +304,11 @@ public abstract class AbstractBaseFragme
while (i.hasNext())
{
- stack.push(i.next());
+ stack.push((BaseFragmentElement)i.next());
}
}
- f = (stack.isEmpty() ? null : (BaseFragmentElement) stack.pop());
+ f = (stack.isEmpty() ? null : stack.pop());
}
return fragments;
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBasePageElement.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBasePageElement.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBasePageElement.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/AbstractBasePageElement.java Sat Mar 15 15:59:17 2014
@@ -47,7 +47,7 @@ public abstract class AbstractBasePageEl
/**
* menuDefinitions - menu definitions for page
*/
- private List menuDefinitions;
+ private List<MenuDefinition> menuDefinitions;
public String getSkin()
{
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/DefaultsImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/DefaultsImpl.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/DefaultsImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/DefaultsImpl.java Sat Mar 15 15:59:17 2014
@@ -17,11 +17,11 @@
package org.apache.jetspeed.om.page.psml;
-import java.util.Map;
-import java.util.HashMap;
-
import org.apache.jetspeed.om.page.Fragment;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @version $Id$
*/
@@ -29,7 +29,7 @@ public class DefaultsImpl
{
private String skin = null;
- private Map decoratorMap = new HashMap();
+ private Map<String,String> decoratorMap = new HashMap<String,String>();
/**
* getSkin
@@ -59,7 +59,7 @@ public class DefaultsImpl
*/
public String getDecorator(String type)
{
- return (String)decoratorMap.get(type);
+ return decoratorMap.get(type);
}
/**
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FilteredFragmentList.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FilteredFragmentList.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FilteredFragmentList.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FilteredFragmentList.java Sat Mar 15 15:59:17 2014
@@ -16,6 +16,8 @@
*/
package org.apache.jetspeed.om.page.psml;
+import org.apache.jetspeed.om.page.BaseFragmentElement;
+
import java.util.AbstractList;
import java.util.List;
import java.util.ListIterator;
@@ -26,12 +28,12 @@ import java.util.ListIterator;
* @author <a href="mailto:[email protected]">Randy Watler</a>
* @version $Id$
*/
-class FilteredFragmentList extends AbstractList
+class FilteredFragmentList extends AbstractList<BaseFragmentElement>
{
private FragmentImpl fragment;
- private List filteredList;
+ private List<BaseFragmentElement> filteredList;
- FilteredFragmentList(FragmentImpl fragment, List filteredList)
+ FilteredFragmentList(FragmentImpl fragment, List<BaseFragmentElement> filteredList)
{
super();
this.fragment = fragment;
@@ -41,23 +43,23 @@ class FilteredFragmentList extends Abstr
/* (non-Javadoc)
* @see java.util.List#add(int,java.lang.Object)
*/
- public void add(int index, Object element)
+ public void add(int index, BaseFragmentElement element)
{
// implement for modifiable AbstractList
filteredList.add(index, element);
// add object to persistent list
- fragment.accessFragments().add(element);
+ fragment.accessFragments().add((AbstractBaseFragmentElement)element);
// maintain base fragments implementation reference
- if ((fragment.getBaseFragmentsElement() != null) && (element instanceof FragmentImpl))
+ if (fragment.getBaseFragmentsElement() != null)
{
- ((FragmentImpl)element).setBaseFragmentsElement(fragment.getBaseFragmentsElement());
+ ((AbstractBaseFragmentElement)element).setBaseFragmentsElement(fragment.getBaseFragmentsElement());
}
}
/* (non-Javadoc)
* @see java.util.List#get(int)
*/
- public Object get(int index)
+ public BaseFragmentElement get(int index)
{
// implement for modifiable AbstractList
return filteredList.get(index);
@@ -66,10 +68,10 @@ class FilteredFragmentList extends Abstr
/* (non-Javadoc)
* @see java.util.List#remove(int)
*/
- public Object remove(int index)
+ public BaseFragmentElement remove(int index)
{
// implement for modifiable AbstractList
- Object o = filteredList.remove(index);
+ BaseFragmentElement o = filteredList.remove(index);
// remove removed object from persistent list
if (o != null)
{
@@ -89,27 +91,27 @@ class FilteredFragmentList extends Abstr
/* (non-Javadoc)
* @see java.util.List#set(int,java.lang.Object)
*/
- public Object set(int index, Object element)
+ public BaseFragmentElement set(int index, BaseFragmentElement element)
{
// implement for modifiable AbstractList
- Object o = filteredList.set(index, element);
+ BaseFragmentElement o = filteredList.set(index, element);
// replace replaced object in persistent list
if (o != null)
{
- ListIterator iter = fragment.accessFragments().listIterator();
+ ListIterator<AbstractBaseFragmentElement> iter = fragment.accessFragments().listIterator();
while (iter.hasNext())
{
if (iter.next() == o)
{
- iter.set(element);
+ iter.set((AbstractBaseFragmentElement)element);
break;
}
}
}
// maintain base fragments implementation reference
- if ((fragment.getBaseFragmentsElement() != null) && (element instanceof FragmentImpl))
+ if (fragment.getBaseFragmentsElement() != null)
{
- ((FragmentImpl)element).setBaseFragmentsElement(fragment.getBaseFragmentsElement());
+ ((AbstractBaseFragmentElement)element).setBaseFragmentsElement(fragment.getBaseFragmentsElement());
}
return o;
}
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java Sat Mar 15 15:59:17 2014
@@ -38,9 +38,9 @@ public class FragmentImpl extends Abstra
{
private String type = null;
- private List fragments = new ArrayList();
+ private List<AbstractBaseFragmentElement> fragments = new ArrayList<AbstractBaseFragmentElement>();
- private List fragmentElementImpls = new ArrayList();
+ private List<FragmentElementImpl> fragmentElementImpls = new ArrayList<FragmentElementImpl>();
private String name;
@@ -65,7 +65,7 @@ public class FragmentImpl extends Abstra
this.type = type;
}
- List accessFragments()
+ List<AbstractBaseFragmentElement> accessFragments()
{
return fragments;
}
@@ -86,7 +86,7 @@ public class FragmentImpl extends Abstra
*
* @return wrapped element list
*/
- public List getFragmentElementImpls()
+ public List<FragmentElementImpl> getFragmentElementImpls()
{
return fragmentElementImpls;
}
@@ -96,7 +96,7 @@ public class FragmentImpl extends Abstra
*
* @param elements wrapped element list
*/
- public void setFragmentElementImpls(List elements)
+ public void setFragmentElementImpls(List<FragmentElementImpl> elements)
{
fragmentElementImpls = elements;
}
@@ -146,16 +146,16 @@ public class FragmentImpl extends Abstra
/* (non-Javadoc)
* @see org.apache.jetspeed.om.page.Fragment#getFragmentById(java.lang.String)
*/
- public BaseFragmentElement getFragmentById( String id )
+ public BaseFragmentElement getFragmentById(String id)
{
- Stack stack = new Stack();
+ Stack<BaseFragmentElement> stack = new Stack<BaseFragmentElement>();
Iterator i = getFragments().iterator();
while (i.hasNext())
{
- stack.push(i.next());
+ stack.push((BaseFragmentElement)i.next());
}
- BaseFragmentElement f = (BaseFragmentElement) stack.pop();
+ BaseFragmentElement f = stack.pop();
while ((f != null) && (!(f.getId().equals(id))))
{
@@ -165,13 +165,13 @@ public class FragmentImpl extends Abstra
while (i.hasNext())
{
- stack.push(i.next());
+ stack.push((BaseFragmentElement)i.next());
}
}
if (stack.size() > 0)
{
- f = (BaseFragmentElement) stack.pop();
+ f = stack.pop();
}
else
{
@@ -185,18 +185,18 @@ public class FragmentImpl extends Abstra
/* (non-Javadoc)
* @see org.apache.jetspeed.om.page.Fragment#removeFragmentById(java.lang.String)
*/
- public BaseFragmentElement removeFragmentById( String id )
+ public BaseFragmentElement removeFragmentById(String id)
{
// find fragment by id, tracking fragment parent
- Map parents = new HashMap();
- Stack stack = new Stack();
+ Map<BaseFragmentElement,BaseFragmentElement> parents = new HashMap<BaseFragmentElement,BaseFragmentElement>();
+ Stack<BaseFragmentElement> stack = new Stack<BaseFragmentElement>();
Iterator i = getFragments().iterator();
while (i.hasNext())
{
- stack.push(i.next());
+ stack.push((BaseFragmentElement)i.next());
}
- BaseFragmentElement f = (BaseFragmentElement) stack.pop();
+ BaseFragmentElement f = stack.pop();
while ((f != null) && (!(f.getId().equals(id))))
{
if (f instanceof Fragment)
@@ -213,7 +213,7 @@ public class FragmentImpl extends Abstra
if (stack.size() > 0)
{
- f = (BaseFragmentElement) stack.pop();
+ f = stack.pop();
}
else
{
@@ -224,7 +224,7 @@ public class FragmentImpl extends Abstra
// remove fragment from parent/fragments
if (f != null)
{
- BaseFragmentElement parent = (BaseFragmentElement)parents.get(f);
+ BaseFragmentElement parent = parents.get(f);
if (parent != null)
{
if (parent instanceof Fragment)
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FragmentList.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FragmentList.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FragmentList.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FragmentList.java Sat Mar 15 15:59:17 2014
@@ -16,6 +16,8 @@
*/
package org.apache.jetspeed.om.page.psml;
+import org.apache.jetspeed.om.page.BaseFragmentElement;
+
import java.util.AbstractList;
/**
@@ -24,7 +26,7 @@ import java.util.AbstractList;
* @author <a href="mailto:[email protected]">Randy Watler</a>
* @version $Id$
*/
-class FragmentList extends AbstractList
+class FragmentList extends AbstractList<BaseFragmentElement>
{
private FragmentImpl fragment;
@@ -37,12 +39,12 @@ class FragmentList extends AbstractList
/* (non-Javadoc)
* @see java.util.List#add(int,java.lang.Object)
*/
- public void add(int index, Object element)
+ public void add(int index, BaseFragmentElement element)
{
// implement for modifiable AbstractList:
// add and maintain base fragments implementation reference
- fragment.accessFragments().add(index, element);
- if ((fragment.getBaseFragmentsElement() != null) && (element instanceof AbstractBaseFragmentElement))
+ fragment.accessFragments().add(index, (AbstractBaseFragmentElement)element);
+ if (fragment.getBaseFragmentsElement() != null)
{
((AbstractBaseFragmentElement)element).setBaseFragmentsElement(fragment.getBaseFragmentsElement());
}
@@ -51,7 +53,7 @@ class FragmentList extends AbstractList
/* (non-Javadoc)
* @see java.util.List#get(int)
*/
- public Object get(int index)
+ public BaseFragmentElement get(int index)
{
// implement for modifiable AbstractList
return fragment.accessFragments().get(index);
@@ -60,7 +62,7 @@ class FragmentList extends AbstractList
/* (non-Javadoc)
* @see java.util.List#remove(int)
*/
- public Object remove(int index)
+ public BaseFragmentElement remove(int index)
{
// implement for modifiable AbstractList
return fragment.accessFragments().remove(index);
@@ -69,12 +71,12 @@ class FragmentList extends AbstractList
/* (non-Javadoc)
* @see java.util.List#set(int,java.lang.Object)
*/
- public Object set(int index, Object element)
+ public BaseFragmentElement set(int index, BaseFragmentElement element)
{
// implement for modifiable AbstractList:
// set and maintain base fragments implementation reference
- Object o = fragment.accessFragments().set(index, element);
- if ((fragment.getBaseFragmentsElement() != null) && (element instanceof AbstractBaseFragmentElement))
+ AbstractBaseFragmentElement o = fragment.accessFragments().set(index, (AbstractBaseFragmentElement)element);
+ if (fragment.getBaseFragmentsElement() != null)
{
((AbstractBaseFragmentElement)element).setBaseFragmentsElement(fragment.getBaseFragmentsElement());
}
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FragmentPreferenceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FragmentPreferenceImpl.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FragmentPreferenceImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/FragmentPreferenceImpl.java Sat Mar 15 15:59:17 2014
@@ -32,7 +32,7 @@ import java.util.List;
public class FragmentPreferenceImpl implements FragmentPreference
{
private String name;
- private List values;
+ private List<String> values;
private boolean readOnly;
public String getName()
@@ -59,7 +59,7 @@ public class FragmentPreferenceImpl impl
{
if (this.values == null)
{
- this.values = new ArrayList();
+ this.values = new ArrayList<String>();
}
return this.values;
}
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/PageSecurityImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/PageSecurityImpl.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/PageSecurityImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/PageSecurityImpl.java Sat Mar 15 15:59:17 2014
@@ -37,11 +37,11 @@ import java.util.Map;
*/
public class PageSecurityImpl extends DocumentImpl implements PageSecurity
{
- private List constraintsDefsList;
+ private List<SecurityConstraintsDef> constraintsDefsList;
- private Map constraintsDefsMap;
+ private Map<String,SecurityConstraintsDef> constraintsDefsMap;
- private List globalConstraintsRefs;
+ private List<String> globalConstraintsRefs;
/**
* <p>
@@ -109,7 +109,7 @@ public class PageSecurityImpl extends Do
{
if ((constraintsDefsList != null) && (constraintsDefsMap == null))
{
- constraintsDefsMap = new HashMap((constraintsDefsList.size() * 2) + 1);
+ constraintsDefsMap = new HashMap<String,SecurityConstraintsDef>((constraintsDefsList.size() * 2) + 1);
Iterator definitionsIter = constraintsDefsList.iterator();
while (definitionsIter.hasNext())
{
@@ -119,7 +119,7 @@ public class PageSecurityImpl extends Do
}
if (constraintsDefsMap != null)
{
- return (SecurityConstraintsDef) constraintsDefsMap.get(name);
+ return constraintsDefsMap.get(name);
}
return null;
}
@@ -132,7 +132,7 @@ public class PageSecurityImpl extends Do
* @see org.apache.jetspeed.om.page.PageSecurity#getGlobalSecurityConstraintsRefs()
* @return
*/
- public List getGlobalSecurityConstraintsRefs()
+ public List<String> getGlobalSecurityConstraintsRefs()
{
return globalConstraintsRefs;
}
@@ -145,7 +145,7 @@ public class PageSecurityImpl extends Do
* @see org.apache.jetspeed.om.page.PageSecurity#setGlobalSecurityConstraintsRefs(java.util.List)
* @param constraintsRefs
*/
- public void setGlobalSecurityConstraintsRefs(List constraintsRefs)
+ public void setGlobalSecurityConstraintsRefs(List<String> constraintsRefs)
{
globalConstraintsRefs = constraintsRefs;
}
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/PropertiesList.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/PropertiesList.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/PropertiesList.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/PropertiesList.java Sat Mar 15 15:59:17 2014
@@ -16,6 +16,8 @@
*/
package org.apache.jetspeed.om.page.psml;
+import org.apache.jetspeed.om.page.FragmentProperty;
+
import java.util.AbstractList;
import java.util.List;
@@ -25,12 +27,12 @@ import java.util.List;
* @author <a href="mailto:[email protected]">Randy Watler</a>
* @version $Id$
*/
-public class PropertiesList extends AbstractList
+public class PropertiesList extends AbstractList<FragmentProperty>
{
- private List filteredProperties;
- private List properties;
+ private List<FragmentProperty> filteredProperties;
+ private List<FragmentProperty> properties;
- PropertiesList(List filteredProperties, List properties)
+ PropertiesList(List<FragmentProperty> filteredProperties, List<FragmentProperty> properties)
{
this.filteredProperties = filteredProperties;
this.properties = properties;
@@ -39,18 +41,17 @@ public class PropertiesList extends Abst
/* (non-Javadoc)
* @see java.util.List#add(int,java.lang.Object)
*/
- public void add(int index, Object element)
+ public void add(int index, FragmentProperty element)
{
// implement for modifiable AbstractList
- PropertyImpl addFragmentProperty = (PropertyImpl)element;
- filteredProperties.add(addFragmentProperty);
- properties.add(addFragmentProperty);
+ filteredProperties.add(element);
+ properties.add(element);
}
/* (non-Javadoc)
* @see java.util.List#get(int)
*/
- public Object get(int index)
+ public FragmentProperty get(int index)
{
// implement for modifiable AbstractList
return filteredProperties.get(index);
@@ -59,10 +60,10 @@ public class PropertiesList extends Abst
/* (non-Javadoc)
* @see java.util.List#remove(int)
*/
- public Object remove(int index)
+ public FragmentProperty remove(int index)
{
// implement for modifiable AbstractList
- PropertyImpl removedFragmentProperty = (PropertyImpl)filteredProperties.remove(index);
+ FragmentProperty removedFragmentProperty = filteredProperties.remove(index);
if (removedFragmentProperty != null)
{
properties.remove(removedFragmentProperty);
@@ -73,12 +74,11 @@ public class PropertiesList extends Abst
/* (non-Javadoc)
* @see java.util.List#set(int,java.lang.Object)
*/
- public Object set(int index, Object element)
+ public FragmentProperty set(int index, FragmentProperty element)
{
// implement for modifiable AbstractList
- PropertyImpl addFragmentProperty = (PropertyImpl)element;
- PropertyImpl removedFragmentProperty = (PropertyImpl)filteredProperties.set(index, element);
- properties.add(addFragmentProperty);
+ FragmentProperty removedFragmentProperty = filteredProperties.set(index, element);
+ properties.add(element);
if (removedFragmentProperty != null)
{
properties.remove(removedFragmentProperty);
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsDefImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsDefImpl.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsDefImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsDefImpl.java Sat Mar 15 15:59:17 2014
@@ -16,12 +16,12 @@
*/
package org.apache.jetspeed.om.page.psml;
-import java.util.ArrayList;
-import java.util.List;
-
import org.apache.jetspeed.om.common.SecurityConstraint;
import org.apache.jetspeed.om.page.SecurityConstraintsDef;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* <p>
* SecurityConstraintsImpl
@@ -37,7 +37,7 @@ public class SecurityConstraintsDefImpl
{
private String name;
- private List constraints = new ArrayList(4);
+ private List<SecurityConstraint> constraints = new ArrayList<SecurityConstraint>(4);
/**
* <p>
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java Sat Mar 15 15:59:17 2014
@@ -16,6 +16,7 @@
*/
package org.apache.jetspeed.om.page.psml;
+import org.apache.jetspeed.om.common.SecurityConstraint;
import org.apache.jetspeed.om.common.SecurityConstraints;
import org.apache.jetspeed.om.page.PageSecurity;
import org.apache.jetspeed.om.page.SecurityConstraintImpl;
@@ -46,11 +47,11 @@ public class SecurityConstraintsImpl imp
private String owner;
- private List constraints;
+ private List<SecurityConstraint> constraints;
- private List constraintsRefs;
+ private List<String> constraintsRefs;
- private List allConstraints;
+ private List<Object> allConstraints;
/**
* <p>
@@ -86,11 +87,11 @@ public class SecurityConstraintsImpl imp
* @see org.apache.jetspeed.om.common.SecurityConstraints#getSecurityConstraints()
* @return
*/
- public List getSecurityConstraints()
+ public List<SecurityConstraint> getSecurityConstraints()
{
if (this.constraints == null)
{
- this.constraints = Collections.synchronizedList(new ArrayList());
+ this.constraints = Collections.synchronizedList(new ArrayList<SecurityConstraint>());
}
return constraints;
}
@@ -103,7 +104,7 @@ public class SecurityConstraintsImpl imp
* @see org.apache.jetspeed.om.common.SecurityConstraints#setSecurityConstraints(java.util.List)
* @param constraints
*/
- public void setSecurityConstraints(List constraints)
+ public void setSecurityConstraints(List<SecurityConstraint> constraints)
{
this.constraints = constraints;
}
@@ -116,11 +117,11 @@ public class SecurityConstraintsImpl imp
* @see org.apache.jetspeed.om.common.SecurityConstraints#getSecurityConstraintsRefs()
* @return
*/
- public List getSecurityConstraintsRefs()
+ public List<String> getSecurityConstraintsRefs()
{
if (this.constraintsRefs == null)
{
- this.constraintsRefs = Collections.synchronizedList(new ArrayList());
+ this.constraintsRefs = Collections.synchronizedList(new ArrayList<String>());
}
return constraintsRefs;
}
@@ -133,7 +134,7 @@ public class SecurityConstraintsImpl imp
* @see org.apache.jetspeed.om.common.SecurityConstraints#setSecurityConstraintsRefs(java.util.List)
* @param constraintsRefs
*/
- public void setSecurityConstraintsRefs(List constraintsRefs)
+ public void setSecurityConstraintsRefs(List<String> constraintsRefs)
{
this.constraintsRefs = constraintsRefs;
}
@@ -163,8 +164,8 @@ public class SecurityConstraintsImpl imp
* @param pageSecurity page security definitions
* @throws SecurityException
*/
- public void checkConstraints(List actions, List userPrincipals, List rolePrincipals,
- List groupPrincipals, PageSecurity pageSecurity) throws SecurityException
+ public void checkConstraints(List<String> actions, List<String> userPrincipals, List<String> rolePrincipals,
+ List<String> groupPrincipals, PageSecurity pageSecurity) throws SecurityException
{
// if owner defined, override all constraints and allow all access
if ((owner != null) && (userPrincipals != null) && userPrincipals.contains(owner))
@@ -257,7 +258,7 @@ public class SecurityConstraintsImpl imp
// since no other constraints were found
if ((getOwner() != null) && !actions.isEmpty())
{
- String action = (String)actions.get(0);
+ String action = actions.get(0);
throw new SecurityException("SecurityConstraintsImpl.checkConstraints(): Access for " + action + " not permitted, (not owner).");
}
}
@@ -278,7 +279,7 @@ public class SecurityConstraintsImpl imp
* @return all security constraints and constraints ref expressions
* @throws RuntimeException if expression parsing error occurs
*/
- private synchronized List getAllSecurityConstraints(PageSecurity pageSecurity)
+ private synchronized List<Object> getAllSecurityConstraints(PageSecurity pageSecurity)
{
// return previously cached security constraints; note that
// cache is assumed valid until owning document is evicted
@@ -288,7 +289,7 @@ public class SecurityConstraintsImpl imp
}
// construct new ordered security constraints list
- List newAllConstraints = new ArrayList();
+ List<Object> newAllConstraints = new ArrayList<Object>();
// add any defined security constraints
if (constraints != null)
@@ -299,7 +300,7 @@ public class SecurityConstraintsImpl imp
// add any security constraints references
if ((constraintsRefs != null) && !constraintsRefs.isEmpty())
{
- List referencedConstraints = dereferenceSecurityConstraintsRefs(constraintsRefs, pageSecurity);
+ List<Object> referencedConstraints = dereferenceSecurityConstraintsRefs(constraintsRefs, pageSecurity);
if (referencedConstraints != null)
{
newAllConstraints.addAll(referencedConstraints);
@@ -312,7 +313,7 @@ public class SecurityConstraintsImpl imp
List globalConstraintsRefs = pageSecurity.getGlobalSecurityConstraintsRefs();
if ((globalConstraintsRefs != null) && !globalConstraintsRefs.isEmpty())
{
- List referencedConstraints = dereferenceSecurityConstraintsRefs(globalConstraintsRefs, pageSecurity);
+ List<Object> referencedConstraints = dereferenceSecurityConstraintsRefs(globalConstraintsRefs, pageSecurity);
if (referencedConstraints != null)
{
newAllConstraints.addAll(referencedConstraints);
@@ -333,11 +334,11 @@ public class SecurityConstraintsImpl imp
* @return security constraints and constraints ref expressions
* @throws RuntimeException if expression parsing error occurs
*/
- private List dereferenceSecurityConstraintsRefs(List constraintsRefs, PageSecurity pageSecurity)
+ private List<Object> dereferenceSecurityConstraintsRefs(List constraintsRefs, PageSecurity pageSecurity)
{
// access security document to dereference security
// constraints definitions
- List constraints = null;
+ List<Object> constraints = null;
if (pageSecurity != null)
{
// dereference each security constraints definition
@@ -346,24 +347,27 @@ public class SecurityConstraintsImpl imp
{
String constraintsRef = (String)constraintsRefsIter.next();
// parse constraints ref and return constraints/constraints ref expressions
- Object constraintsOrExpression = SecurityConstraintsRefParser.parse(constraintsRef, pageSecurity);
- if (constraintsOrExpression instanceof List)
+ Object parsedConstraintsOrExpression = SecurityConstraintsRefParser.parse(constraintsRef, pageSecurity);
+ if (parsedConstraintsOrExpression instanceof List)
{
+ @SuppressWarnings("unchecked")
+ List<Object> parsedConstraints = (List)parsedConstraintsOrExpression;
if (constraints == null)
{
- constraints = new ArrayList();
+ constraints = new ArrayList<Object>();
}
- constraints.addAll((List)constraintsOrExpression);
+ constraints.addAll(parsedConstraints);
}
- else if (constraintsOrExpression instanceof SecurityConstraintsRefExpression)
+ else if (parsedConstraintsOrExpression instanceof SecurityConstraintsRefExpression)
{
+ Object parsedExpression = parsedConstraintsOrExpression;
if (constraints == null)
{
- constraints = new ArrayList();
+ constraints = new ArrayList<Object>();
}
- constraints.add(constraintsOrExpression);
+ constraints.add(parsedExpression);
}
- else if (constraintsOrExpression != null)
+ else if (parsedConstraintsOrExpression != null)
{
throw new RuntimeException("Unexpected security constraints ref parser result");
}
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java Sat Mar 15 15:59:17 2014
@@ -16,14 +16,6 @@
*/
package org.apache.jetspeed.page;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import javax.security.auth.Subject;
-
import org.apache.jetspeed.idgenerator.IdGenerator;
import org.apache.jetspeed.om.common.SecurityConstraint;
import org.apache.jetspeed.om.common.SecurityConstraints;
@@ -31,6 +23,7 @@ import org.apache.jetspeed.om.folder.Fol
import org.apache.jetspeed.om.folder.FolderNotFoundException;
import org.apache.jetspeed.om.folder.InvalidFolderException;
import org.apache.jetspeed.om.folder.MenuDefinition;
+import org.apache.jetspeed.om.folder.MenuDefinitionElement;
import org.apache.jetspeed.om.folder.MenuExcludeDefinition;
import org.apache.jetspeed.om.folder.MenuIncludeDefinition;
import org.apache.jetspeed.om.folder.MenuOptionsDefinition;
@@ -52,11 +45,16 @@ import org.apache.jetspeed.om.page.Secur
import org.apache.jetspeed.om.preference.FragmentPreference;
import org.apache.jetspeed.page.document.Node;
import org.apache.jetspeed.page.document.NodeException;
-import org.apache.jetspeed.page.impl.DatabasePageManagerUtils;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.security.auth.Subject;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
/**
* AbstractPageManagerService
*
@@ -112,7 +110,7 @@ public abstract class AbstractPageManage
private boolean constraintsEnabled;
- private List listeners = new LinkedList();
+ private List<PageManagerEventListener> listeners = new LinkedList<PageManagerEventListener>();
private long nodeReapingInterval = DEFAULT_NODE_REAPING_INTERVAL;
@@ -970,10 +968,10 @@ public abstract class AbstractPageManage
public void notifyNewNode(Node node)
{
// copy listeners list to reduce synchronization deadlock
- List listenersList = null;
+ List<PageManagerEventListener> listenersList = null;
synchronized (listeners)
{
- listenersList = new ArrayList(listeners);
+ listenersList = new ArrayList<PageManagerEventListener>(listeners);
}
// notify listeners
Iterator listenersIter = listenersList.iterator();
@@ -1000,10 +998,10 @@ public abstract class AbstractPageManage
public void notifyUpdatedNode(Node node)
{
// copy listeners list to reduce synchronization deadlock
- List listenersList = null;
+ List<PageManagerEventListener> listenersList = null;
synchronized (listeners)
{
- listenersList = new ArrayList(listeners);
+ listenersList = new ArrayList<PageManagerEventListener>(listeners);
}
// notify listeners
Iterator listenersIter = listenersList.iterator();
@@ -1030,10 +1028,10 @@ public abstract class AbstractPageManage
public void notifyRemovedNode(Node node)
{
// copy listeners list to reduce synchronization deadlock
- List listenersList = null;
+ List<PageManagerEventListener> listenersList = null;
synchronized (listeners)
{
- listenersList = new ArrayList(listeners);
+ listenersList = new ArrayList<PageManagerEventListener>(listeners);
}
// notify listeners
Iterator listenersIter = listenersList.iterator();
@@ -1058,10 +1056,10 @@ public abstract class AbstractPageManage
public void notifyReapNodes()
{
// copy listeners list to reduce synchronization deadlock
- List listenersList = null;
+ List<PageManagerEventListener> listenersList = null;
synchronized (listeners)
{
- listenersList = new ArrayList(listeners);
+ listenersList = new ArrayList<PageManagerEventListener>(listeners);
}
// notify listeners
Iterator listenersIter = listenersList.iterator();
@@ -1107,7 +1105,7 @@ public abstract class AbstractPageManage
}
// copy document orders
- folder.setDocumentOrder(DatabasePageManagerUtils.createList());
+ folder.setDocumentOrder(this.<String>createList());
Iterator documentOrders = source.getDocumentOrder().iterator();
while (documentOrders.hasNext())
{
@@ -1116,10 +1114,10 @@ public abstract class AbstractPageManage
}
// copy menu definitions
- List menus = source.getMenuDefinitions();
+ List<MenuDefinition> menus = source.getMenuDefinitions();
if (menus != null)
{
- List copiedMenus = copyMenuDefinitions(FOLDER_NODE_TYPE, menus);
+ List<MenuDefinition> copiedMenus = copyMenuDefinitions(FOLDER_NODE_TYPE, menus);
folder.setMenuDefinitions(copiedMenus);
}
@@ -1261,10 +1259,10 @@ public abstract class AbstractPageManage
dest.setSkin(source.getSkin());
// copy menu definitions
- List menus = source.getMenuDefinitions();
+ List<MenuDefinition> menus = source.getMenuDefinitions();
if (menus != null)
{
- List copiedMenus = copyMenuDefinitions(PAGE_NODE_TYPE, menus);
+ List<MenuDefinition> copiedMenus = copyMenuDefinitions(PAGE_NODE_TYPE, menus);
dest.setMenuDefinitions(copiedMenus);
}
}
@@ -1358,7 +1356,7 @@ public abstract class AbstractPageManage
FragmentPreference newPref = this.newFragmentPreference();
newPref.setName(pref.getName());
newPref.setReadOnly(pref.isReadOnly());
- newPref.setValueList(DatabasePageManagerUtils.createList());
+ newPref.setValueList(this.<String>createList());
Iterator values = pref.getValueList().iterator();
while (values.hasNext())
{
@@ -1440,14 +1438,14 @@ public abstract class AbstractPageManage
copy.setVersion(source.getVersion());
// copy security constraint defintions
- copy.setSecurityConstraintsDefs(DatabasePageManagerUtils.createList());
+ copy.setSecurityConstraintsDefs(this.<SecurityConstraintsDef>createList());
Iterator defs = source.getSecurityConstraintsDefs().iterator();
while (defs.hasNext())
{
SecurityConstraintsDef def = (SecurityConstraintsDef)defs.next();
SecurityConstraintsDef defCopy = this.newSecurityConstraintsDef();
defCopy.setName(def.getName());
- List copiedConstraints = DatabasePageManagerUtils.createList();
+ List<SecurityConstraint> copiedConstraints = createList();
Iterator constraints = def.getSecurityConstraints().iterator();
while (constraints.hasNext())
{
@@ -1461,7 +1459,7 @@ public abstract class AbstractPageManage
}
// copy global security constraint references
- copy.setGlobalSecurityConstraintsRefs(DatabasePageManagerUtils.createList());
+ copy.setGlobalSecurityConstraintsRefs(this.<String>createList());
Iterator globals = source.getGlobalSecurityConstraintsRefs().iterator();
while (globals.hasNext())
{
@@ -1472,9 +1470,9 @@ public abstract class AbstractPageManage
return copy;
}
- protected List copyMenuDefinitions(String type, List srcMenus)
+ protected List<MenuDefinition> copyMenuDefinitions(String type, List<MenuDefinition> srcMenus)
{
- List copiedMenus = DatabasePageManagerUtils.createList();
+ List<MenuDefinition> copiedMenus = createList();
Iterator menus = srcMenus.iterator();
while (menus.hasNext())
{
@@ -1488,7 +1486,7 @@ public abstract class AbstractPageManage
return copiedMenus;
}
- protected Object copyMenuElement(String type, Object srcElement)
+ protected MenuDefinitionElement copyMenuElement(String type, MenuDefinitionElement srcElement)
{
if (srcElement instanceof MenuDefinition)
{
@@ -1518,15 +1516,15 @@ public abstract class AbstractPageManage
menu.getMetadata().copyFields(source.getMetadata().getFields());
// recursively copy menu elements
- List elements = source.getMenuElements();
+ List<MenuDefinitionElement> elements = source.getMenuElements();
if (elements != null)
{
- List copiedElements = DatabasePageManagerUtils.createList();
+ List<MenuDefinitionElement> copiedElements = createList();
Iterator elementsIter = elements.iterator();
while (elementsIter.hasNext())
{
- Object element = elementsIter.next();
- Object copiedElement = copyMenuElement(type, element);
+ MenuDefinitionElement element = (MenuDefinitionElement)elementsIter.next();
+ MenuDefinitionElement copiedElement = copyMenuElement(type, element);
if (copiedElement != null)
{
copiedElements.add(copiedElement);
@@ -1634,7 +1632,7 @@ public abstract class AbstractPageManage
}
if (source.getSecurityConstraints() != null)
{
- List copiedConstraints = DatabasePageManagerUtils.createList();
+ List<SecurityConstraint> copiedConstraints = createList();
Iterator constraints = source.getSecurityConstraints().iterator();
while (constraints.hasNext())
{
@@ -1663,7 +1661,7 @@ public abstract class AbstractPageManage
}
if (source.getSecurityConstraintsRefs() != null)
{
- List copiedRefs = DatabasePageManagerUtils.createList();
+ List<String> copiedRefs = createList();
Iterator refs = source.getSecurityConstraintsRefs().iterator();
while (refs.hasNext())
{
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/DelegatingPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/DelegatingPageManager.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/DelegatingPageManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/DelegatingPageManager.java Sat Mar 15 15:59:17 2014
@@ -16,15 +16,13 @@
*/
package org.apache.jetspeed.page;
-import java.util.Map;
-
import org.apache.jetspeed.idgenerator.IdGenerator;
import org.apache.jetspeed.om.folder.Folder;
import org.apache.jetspeed.om.folder.FolderNotFoundException;
import org.apache.jetspeed.om.folder.InvalidFolderException;
import org.apache.jetspeed.om.page.BaseFragmentElement;
-import org.apache.jetspeed.om.page.FragmentDefinition;
import org.apache.jetspeed.om.page.DynamicPage;
+import org.apache.jetspeed.om.page.FragmentDefinition;
import org.apache.jetspeed.om.page.Link;
import org.apache.jetspeed.om.page.Page;
import org.apache.jetspeed.om.page.PageSecurity;
@@ -37,6 +35,9 @@ import org.apache.jetspeed.page.document
import org.apache.jetspeed.page.document.NodeSet;
import org.apache.jetspeed.page.document.UnsupportedDocumentTypeException;
+import java.util.List;
+import java.util.Map;
+
/**
* DelegatingPageManager
@@ -47,13 +48,17 @@ import org.apache.jetspeed.page.document
public class DelegatingPageManager extends AbstractPageManager
{
+ private PageManager delegate;
+
public DelegatingPageManager(
+ PageManager delegate,
IdGenerator generator,
boolean isPermissionsSecurity,
boolean isConstraintsSecurity,
Map modelClasses)
{
super(generator, isPermissionsSecurity, isConstraintsSecurity, modelClasses);
+ this.delegate = delegate;
}
/* (non-Javadoc)
@@ -402,4 +407,15 @@ public class DelegatingPageManager exten
{
throw new NodeException("not impl");
}
+
+ /**
+ * Create list suitable for list model members.
+ *
+ * @param <T> list element type
+ * @return list
+ */
+ public <T> List<T> createList()
+ {
+ return delegate.createList();
+ }
}
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageManagerSecurityUtils.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageManagerSecurityUtils.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageManagerSecurityUtils.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageManagerSecurityUtils.java Sat Mar 15 15:59:17 2014
@@ -16,15 +16,6 @@
*/
package org.apache.jetspeed.page;
-import java.security.AccessController;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.security.auth.Subject;
-
import org.apache.jetspeed.JetspeedActions;
import org.apache.jetspeed.om.page.SecurityConstraintImpl;
import org.apache.jetspeed.om.page.SecurityConstraintsDef;
@@ -34,6 +25,14 @@ import org.apache.jetspeed.security.JSSu
import org.apache.jetspeed.security.Role;
import org.apache.jetspeed.security.User;
+import javax.security.auth.Subject;
+import java.security.AccessController;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
/**
* PageManagerUtils
@@ -46,8 +45,8 @@ public class PageManagerSecurityUtils
public static boolean checkConstraint(SecurityConstraintsDef def, String actions)
throws DocumentException
{
- List viewActionList = SecurityConstraintImpl.parseCSVList(actions);
- List otherActionsList = null;
+ List<String> viewActionList = SecurityConstraintImpl.parseCSVList(actions);
+ List<String> otherActionsList = null;
if (viewActionList.size() == 1)
{
if (!viewActionList.contains(JetspeedActions.VIEW))
@@ -62,7 +61,7 @@ public class PageManagerSecurityUtils
viewActionList = null;
if (otherActionsList.remove(JetspeedActions.VIEW))
{
- viewActionList = new ArrayList(1);
+ viewActionList = new ArrayList<String>(1);
viewActionList.add(JetspeedActions.VIEW);
}
}
@@ -75,9 +74,9 @@ public class PageManagerSecurityUtils
}
// get user/group/role principal names
- List userPrincipals = null;
- List rolePrincipals = null;
- List groupPrincipals = null;
+ List<String> userPrincipals = null;
+ List<String> rolePrincipals = null;
+ List<String> groupPrincipals = null;
Iterator principals = subject.getPrincipals().iterator();
while (principals.hasNext())
{
@@ -86,7 +85,7 @@ public class PageManagerSecurityUtils
{
if (userPrincipals == null)
{
- userPrincipals = new LinkedList();
+ userPrincipals = new LinkedList<String>();
}
userPrincipals.add(principal.getName());
}
@@ -94,7 +93,7 @@ public class PageManagerSecurityUtils
{
if (rolePrincipals == null)
{
- rolePrincipals = new LinkedList();
+ rolePrincipals = new LinkedList<String>();
}
rolePrincipals.add(principal.getName());
}
@@ -102,7 +101,7 @@ public class PageManagerSecurityUtils
{
if (groupPrincipals == null)
{
- groupPrincipals = new LinkedList();
+ groupPrincipals = new LinkedList<String>();
}
groupPrincipals.add(principal.getName());
}
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/impl/NodeImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/impl/NodeImpl.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/impl/NodeImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/impl/NodeImpl.java Sat Mar 15 15:59:17 2014
@@ -16,21 +16,22 @@
*/
package org.apache.jetspeed.page.document.impl;
-import java.util.Collection;
-import java.util.List;
-import java.util.Locale;
-import java.util.StringTokenizer;
-
import org.apache.jetspeed.om.folder.Folder;
import org.apache.jetspeed.om.page.PageMetadataImpl;
import org.apache.jetspeed.om.page.PageSecurity;
import org.apache.jetspeed.om.page.impl.BaseElementImpl;
import org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl;
import org.apache.jetspeed.om.portlet.GenericMetadata;
+import org.apache.jetspeed.om.portlet.LocalizedField;
import org.apache.jetspeed.page.document.Node;
import org.apache.jetspeed.page.impl.DatabasePageManagerUtils;
import org.apache.ojb.broker.core.proxy.ProxyHelper;
+import java.util.Collection;
+import java.util.List;
+import java.util.Locale;
+import java.util.StringTokenizer;
+
/**
* NodeImpl
*
@@ -42,7 +43,7 @@ public abstract class NodeImpl extends B
private Integer parentId;
private Node parent;
private boolean hidden;
- private Collection metadataFields;
+ private Collection<LocalizedField> metadataFields;
private String path = Folder.PATH_SEPARATOR;
private String subsite;
private String user;
@@ -95,7 +96,7 @@ public abstract class NodeImpl extends B
* @param fields mutable fields collection
* @return page metadata
*/
- public PageMetadataImpl newPageMetadata(Collection fields)
+ public PageMetadataImpl newPageMetadata(Collection<LocalizedField> fields)
{
// no metadata available by default
return null;
@@ -235,7 +236,7 @@ public abstract class NodeImpl extends B
/* (non-Javadoc)
* @see org.apache.jetspeed.om.page.impl.BaseElementImpl#checkConstraints(java.util.List, java.util.List, java.util.List, java.util.List, boolean, boolean)
*/
- public void checkConstraints(List actions, List userPrincipals, List rolePrincipals, List groupPrincipals, boolean checkNodeOnly, boolean checkParentsOnly) throws SecurityException
+ public void checkConstraints(List<String> actions, List<String> userPrincipals, List<String> rolePrincipals, List<String> groupPrincipals, boolean checkNodeOnly, boolean checkParentsOnly) throws SecurityException
{
// check constraints in node hierarchy
if (checkNodeOnly)
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.