You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ts...@apache.org on 2005/03/20 09:14:15 UTC

svn commit: r158321 - in lenya/trunk/src/java/org/apache/lenya: ac/file/FileUser.java cms/ac/usecases/UserProfile.java

Author: tschlabach
Date: Sun Mar 20 00:14:14 2005
New Revision: 158321

URL: http://svn.apache.org/viewcvs?view=rev&rev=158321
Log:
Added a default CMS menu locale and a default document locale to the user profile

Modified:
    lenya/trunk/src/java/org/apache/lenya/ac/file/FileUser.java
    lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/UserProfile.java

Modified: lenya/trunk/src/java/org/apache/lenya/ac/file/FileUser.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/ac/file/FileUser.java?view=diff&r1=158320&r2=158321
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/ac/file/FileUser.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/ac/file/FileUser.java Sun Mar 20 00:14:14 2005
@@ -37,6 +37,8 @@
 
     protected static final String ID = "identity";
     protected static final String EMAIL = "email";
+    protected static final String MENU_LOCALE = "default-menu-locale";
+    protected static final String DOCUMENT_LOCALE = "default-document-locale";
     protected static final String PASSWORD = "password";
     protected static final String GROUPS = "groups";
     protected static final String GROUP = "group";
@@ -71,6 +73,8 @@
     public void configure(Configuration config) throws ConfigurationException {
         new ItemConfiguration().configure(this, config);
         setEmail(config.getChild(EMAIL).getValue(""));
+        setDefaultMenuLocale(config.getChild(MENU_LOCALE).getValue(""));
+        setDefaultDocumentLocale(config.getChild(DOCUMENT_LOCALE).getValue(""));
         setEncryptedPassword(config.getChild(PASSWORD).getValue(null));
 
         removeFromAllGroups();
@@ -124,6 +128,16 @@
         child.setValue(getEmail());
         config.addChild(child);
 
+        // add defaultMenuLocale node
+        child = new DefaultConfiguration(MENU_LOCALE);
+        child.setValue(getDefaultMenuLocale());
+        config.addChild(child);
+
+        // add defaultDocumentLocale node
+        child = new DefaultConfiguration(DOCUMENT_LOCALE);
+        child.setValue(getDefaultDocumentLocale());
+        config.addChild(child);
+        
         // add password node
         child = new DefaultConfiguration(PASSWORD);
         child.setValue(getEncryptedPassword());

Modified: lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/UserProfile.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/UserProfile.java?view=diff&r1=158320&r2=158321
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/UserProfile.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/UserProfile.java Sun Mar 20 00:14:14 2005
@@ -27,6 +27,8 @@
     protected static final String FULL_NAME = "fullName";
     protected static final String EMAIL = "email";
     protected static final String DESCRIPTION = "description";
+    protected static final String MENU_LOCALE = "defaultMenuLocale";
+    protected static final String DOCUMENT_LOCALE = "defaultDocumentLocale";
     
     /**
      * Ctor.
@@ -55,10 +57,14 @@
         String fullName = getParameterAsString(UserProfile.FULL_NAME);
         String description = getParameterAsString(UserProfile.DESCRIPTION);
         String email = getParameterAsString(UserProfile.EMAIL);
+        String defaultMenuLocale = getParameterAsString(UserProfile.MENU_LOCALE);
+        String defaultDocumentLocale = getParameterAsString(UserProfile.DOCUMENT_LOCALE);
         
         getUser().setEmail(email);
         getUser().setName(fullName);
         getUser().setDescription(description);
+        getUser().setDefaultMenuLocale(defaultMenuLocale);
+        getUser().setDefaultDocumentLocale(defaultDocumentLocale);
         getUser().save();
         
     }
@@ -88,6 +94,8 @@
             
             setParameter(EMAIL, this.user.getEmail());
             setParameter(DESCRIPTION, this.user.getDescription());
+            setParameter(MENU_LOCALE, this.user.getDefaultMenuLocale());
+            setParameter(DOCUMENT_LOCALE, this.user.getDefaultDocumentLocale());
             setParameter(FULL_NAME, this.user.getName());
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org