You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by wo...@apache.org on 2008/09/03 10:18:08 UTC
svn commit: r691537 - in
/portals/jetspeed-2/portal/branches/security-refactoring/components:
jetspeed-page-manager/src/main/java/org/apache/jetspeed/serializer/
jetspeed-portal/src/main/java/org/apache/jetspeed/administration/
jetspeed-portal/src/test...
Author: woonsan
Date: Wed Sep 3 01:18:06 2008
New Revision: 691537
URL: http://svn.apache.org/viewvc?rev=691537&view=rev
Log:
Flattening the Principal API.
Modified the existing classes to implement new interfaces.
Build is still broken. Manager components and some serialization tools need to be refined more.
Modified:
portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/serializer/JetspeedUserTemplateSerializer.java
portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/main/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java
portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserImpl.java
portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSUser.java
Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/serializer/JetspeedUserTemplateSerializer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/serializer/JetspeedUserTemplateSerializer.java?rev=691537&r1=691536&r2=691537&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/serializer/JetspeedUserTemplateSerializer.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/serializer/JetspeedUserTemplateSerializer.java Wed Sep 3 01:18:06 2008
@@ -153,11 +153,8 @@
if (innerSubsite != null)
{
User innerUser = userManager.getUser(innerUserName);
- SecurityAttributes userAttrs = innerUser.getSecurityAttributes();
- Map<String, SecurityAttribute> attributes = userAttrs.getInfoAttributeMap();
- SecurityAttribute userAttr = userAttrs.addAttribute(User.USER_INFO_SUBSITE);
+ SecurityAttribute userAttr = innerUser.getSecurityAttributes().addAttribute(User.USER_INFO_SUBSITE);
userAttr.setStringValue(innerSubsite);
- attributes.put(User.USER_INFO_SUBSITE, userAttr);
userManager.updateUser(innerUser);
}
Folder source = innerPageManager.getFolder(innerFolderTemplate);
Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/main/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/main/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java?rev=691537&r1=691536&r2=691537&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/main/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/main/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java Wed Sep 3 01:18:06 2008
@@ -281,16 +281,16 @@
{
try
{
- if (innerSubsite != null)
- {
- SecurityAttributes userAttrs = innerUser.getSecurityAttributes();
- SecurityAttribute userAttr = userAttrs.addAttribute(User.USER_INFO_SUBSITE);
- userAttr.setStringValue(innerSubsite);
- userManager.updateUser(innerUser);
- }
- // create user's home folder
- // deep copy from the default folder template tree, creating a deep-copy of the template
- // in the new user's folder tree
+ if (innerSubsite != null)
+ {
+ SecurityAttributes userAttrs = innerUser.getSecurityAttributes();
+ SecurityAttribute userAttr = userAttrs.addAttribute(User.USER_INFO_SUBSITE);
+ userAttr.setStringValue(innerSubsite);
+ userManager.updateUser(innerUser);
+ }
+ // create user's home folder
+ // deep copy from the default folder template tree, creating a deep-copy of the template
+ // in the new user's folder tree
Folder source = innerPageManager.getFolder(innerFolderTemplate);
Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java?rev=691537&r1=691536&r2=691537&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java Wed Sep 3 01:18:06 2008
@@ -179,12 +179,8 @@
assertTrue("user exists. should not have thrown an exception.", false);
}
SecurityAttributes attributes = user.getSecurityAttributes();
- SecurityAttribute userAttr = attributes.addAttribute("user.name.given");
- userAttr.setStringValue("Test Dude");
- attributes.getInfoAttributeMap().put("user.name.given", userAttr);
- userAttr = attributes.addAttribute("user.name.family");
- userAttr.setStringValue("Dudley");
- attributes.getInfoAttributeMap().put("user.name.family", userAttr);
+ attributes.addAttribute("user.name.given").setStringValue("Test Dude");
+ attributes.addAttribute("user.name.family").setStringValue("Dudley");
ums.updateUser(user);
}
Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserImpl.java?rev=691537&r1=691536&r2=691537&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserImpl.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserImpl.java Wed Sep 3 01:18:06 2008
@@ -56,7 +56,7 @@
public Map<String, String> getUserInfo()
{
Map<String, String> userInfo = new HashMap<String, String>();
- Map<String, SecurityAttribute> infoAttrMap = super.getSecurityAttributes().getInfoAttributeMap();
+ Map<String, SecurityAttribute> infoAttrMap = getSecurityAttributes().getInfoAttributeMap();
for (Map.Entry entry : infoAttrMap.entrySet())
{
Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSUser.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSUser.java?rev=691537&r1=691536&r2=691537&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSUser.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSUser.java Wed Sep 3 01:18:06 2008
@@ -28,8 +28,8 @@
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.jetspeed.security.Credential;
-import org.apache.jetspeed.security.attributes.SecurityAttribute;
-import org.apache.jetspeed.security.attributes.SecurityAttributes;
+import org.apache.jetspeed.security.SecurityAttribute;
+import org.apache.jetspeed.security.SecurityAttributes;
/**
* Jetspeed Serialized (JS) User
@@ -237,7 +237,7 @@
for (Map.Entry<String, SecurityAttribute> e : sa.entrySet())
{
SecurityAttribute attrib = e.getValue();
- JSNVPElement element = new JSNVPElement(attrib.getName(), attrib.getValue());
+ JSNVPElement element = new JSNVPElement(attrib.getName(), attrib.getStringValue());
this.attributes.add(element);
}
}
@@ -253,7 +253,7 @@
for (Map.Entry<String, SecurityAttribute> e : sa.entrySet())
{
SecurityAttribute attrib = e.getValue();
- JSNVPElement element = new JSNVPElement(attrib.getName(), attrib.getValue());
+ JSNVPElement element = new JSNVPElement(attrib.getName(), attrib.getStringValue());
this.userInfo.add(element);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org