portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r215969 - /portals/jetspeed-2/branches/MENUS_BRANCH/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
Date Tue, 12 Jul 2005 15:50:20 GMT
Author: taylor
Date: Tue Jul 12 08:50:19 2005
New Revision: 215969

URL: http://svn.apache.org/viewcvs?rev=215969&view=rev
Log:
added api for reserved folder types

Modified:
    portals/jetspeed-2/branches/MENUS_BRANCH/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java

Modified: portals/jetspeed-2/branches/MENUS_BRANCH/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/branches/MENUS_BRANCH/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java?rev=215969&r1=215968&r2=215969&view=diff
==============================================================================
--- portals/jetspeed-2/branches/MENUS_BRANCH/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
(original)
+++ portals/jetspeed-2/branches/MENUS_BRANCH/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
Tue Jul 12 08:50:19 2005
@@ -33,6 +33,7 @@
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageSecurity;
+import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.page.PageNotFoundException;
 import org.apache.jetspeed.page.document.AbstractNode;
 import org.apache.jetspeed.page.document.DocumentException;
@@ -64,6 +65,7 @@
     private File directory;
     private FolderMetaData metadata;
     private FolderHandler folderHandler;
+    private int reservedType = RESERVED_FOLDER_NONE;
     
     private static final Log log = LogFactory.getLog(FolderImpl.class);
 
@@ -75,6 +77,7 @@
         this.folderHandler = folderHandler;
         setId(path);
         setPath(path);
+        setReservedType();
         setHandlerFactory(handlerFactory);
         setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
         setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
@@ -87,6 +90,7 @@
         this.folderHandler = folderHandler;
         setId(path);
         setPath(path);
+        setReservedType();
         setHandlerFactory(handlerFactory);
         setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
         setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
@@ -782,4 +786,48 @@
             setTitle(getTitleName());
         }
     }
+    
+    public boolean isReserved()
+    {
+        return (reservedType > RESERVED_FOLDER_NONE);
+    }
+    
+    public int getReservedType()
+    {
+        return reservedType;
+    }
+    
+    private static final String RESERVED_FOLDER_PREFIX = "_";
+    private static final String RESERVED_USER_FOLDER_NAME = "_user";
+    private static final String RESERVED_ROLE_FOLDER_NAME = "_role";
+    private static final String RESERVED_GROUP_FOLDER_NAME = "_group";
+    private static final String RESERVED_SUBSITES_FOLDER_NAME = "__subsite-root";
+    private static final String RESERVED_MEDIATYPE_FOLDER_NAME = "_mediatype";
+    private static final String RESERVED_LANGUAGE_FOLDER_NAME = "_language";
+    private static final String RESERVED_COUNTRY_FOLDER_NAME = "_country";
+    
+    private void setReservedType()
+    {
+        String name = getName();
+        if (name != null && name.startsWith(RESERVED_FOLDER_PREFIX))            
+        {
+            if (name.equals(RESERVED_USER_FOLDER_NAME))
+                reservedType = RESERVED_FOLDER_USERS;
+            else if (name.equals(RESERVED_ROLE_FOLDER_NAME))
+                reservedType = RESERVED_FOLDER_ROLES;
+            else if (name.equals(RESERVED_GROUP_FOLDER_NAME))
+                reservedType = RESERVED_FOLDER_GROUPS;
+            else if (name.equals(RESERVED_SUBSITES_FOLDER_NAME))
+                reservedType = RESERVED_FOLDER_SUBSITES;
+            else if (name.equals(RESERVED_MEDIATYPE_FOLDER_NAME))
+                reservedType = RESERVED_FOLDER_MEDIATYPE;
+            else if (name.equals(RESERVED_LANGUAGE_FOLDER_NAME))
+                reservedType = RESERVED_FOLDER_LANGUAGE;
+            else if (name.equals(RESERVED_COUNTRY_FOLDER_NAME))
+                reservedType = RESERVED_FOLDER_COUNTRY;
+            else
+                reservedType = RESERVED_FOLDER_OTHER;            
+        }
+    }
+    
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message