svn commit: r634598 - in /ofbiz/trunk/framework/common: config/ data/ src/org/ofbiz/common/preferences/ src/org/ofbiz/common/uom/ webcommon/includes/fo/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r634598 - in /ofbiz/trunk/framework/common: config/ data/ src/org/ofbiz/common/preferences/ src/org/ofbiz/common/uom/ webcommon/includes/fo/

ChrisG-2
Author: chrisg
Date: Fri Mar  7 02:12:14 2008
New Revision: 634598

URL: http://svn.apache.org/viewvc?rev=634598&view=rev
Log:
Setting svn properties (svn:eol-style,svn:mime-type,svn:keywords)

Modified:
    ofbiz/trunk/framework/common/config/CommonEntityLabels.xml   (contents, props changed)
    ofbiz/trunk/framework/common/config/CommonUiLabels.xml   (props changed)
    ofbiz/trunk/framework/common/data/GeoData_ES.xml   (props changed)
    ofbiz/trunk/framework/common/data/GeoData_NL.xml   (props changed)
    ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java   (contents, props changed)
    ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java   (contents, props changed)
    ofbiz/trunk/framework/common/src/org/ofbiz/common/uom/UomWorker.java   (props changed)
    ofbiz/trunk/framework/common/webcommon/includes/fo/basic-footer.fo.ftl   (contents, props changed)
    ofbiz/trunk/framework/common/webcommon/includes/fo/basic-header.fo.ftl   (contents, props changed)
    ofbiz/trunk/framework/common/webcommon/includes/fo/end.fo.ftl   (contents, props changed)
    ofbiz/trunk/framework/common/webcommon/includes/fo/pm-11x17.fo.ftl   (contents, props changed)
    ofbiz/trunk/framework/common/webcommon/includes/fo/pm-legal.fo.ftl   (contents, props changed)
    ofbiz/trunk/framework/common/webcommon/includes/fo/pm-letter.fo.ftl   (contents, props changed)
    ofbiz/trunk/framework/common/webcommon/includes/fo/start.fo.ftl   (contents, props changed)

Modified: ofbiz/trunk/framework/common/config/CommonEntityLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonEntityLabels.xml?rev=634598&r1=634597&r2=634598&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/config/CommonEntityLabels.xml (original)
+++ ofbiz/trunk/framework/common/config/CommonEntityLabels.xml Fri Mar  7 02:12:14 2008
@@ -1723,7 +1723,7 @@
     </property>
     <property key="Enumeration.description.UNKNWN_SALES_CHANNEL">
         <value xml:lang="en">Unknown Channel</value>
-        <value xml:lang="fr">Canal de vente : inconnu
+        <value xml:lang="fr">Canal de vente : inconnu
 </value>
         <value xml:lang="it">Canale Sconosciuto</value>
         <value xml:lang="pt">Unknown Channel</value>

Propchange: ofbiz/trunk/framework/common/config/CommonEntityLabels.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/common/config/CommonUiLabels.xml
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Fri Mar  7 02:12:14 2008
@@ -1 +1 @@
-Date Rev Author URL Id
+"Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/data/GeoData_ES.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/common/data/GeoData_ES.xml
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Fri Mar  7 02:12:14 2008
@@ -1 +1 @@
-Date Rev Author URL Id
+"Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/data/GeoData_NL.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/data/GeoData_NL.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java?rev=634598&r1=634597&r2=634598&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java Fri Mar  7 02:12:14 2008
@@ -1,245 +1,245 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *******************************************************************************/
-package org.ofbiz.common.preferences;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.util.GeneralException;
-import org.ofbiz.base.util.ObjectType;
-import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.UtilProperties;
-import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.entity.GenericDelegator;
-import org.ofbiz.entity.GenericEntityException;
-import org.ofbiz.entity.GenericValue;
-import org.ofbiz.entity.util.EntityUtil;
-import org.ofbiz.service.DispatchContext;
-import org.ofbiz.service.ServiceUtil;
-
-/**
- * User preference services.<p>User preferences are stored as key-value pairs.
- * <p>User preferences can be grouped - so that multiple preference pairs can be
- * handled at once. Preference groups also allow a single userPrefTypeId to be
- * used more than once - with each occurence having a unique userPrefGroupId.</p>
- * <p>User preference values are stored as Strings, so the easiest and most
- * efficient way to handle user preference values is to keep them as strings.
- * This class handles any data conversion needed.</p>
- */
-public class PreferenceServices {
-    public static final String module = PreferenceServices.class.getName();
-
-    public static final String resource = "PrefErrorUiLabels";
-
-    /**
-     * Retrieves a single user preference from persistent storage. Call with
-     * userPrefTypeId and optional userLoginId. If userLoginId isn't
-     * specified, then the currently logged-in user's userLoginId will be
-     * used. The retrieved preference is contained in the <b>userPrefMap</b> element.
-     * @param ctx The DispatchContext that this service is operating in.
-     * @param context Map containing the input arguments.
-     * @return Map with the result of the service, the output parameters.
-     */
-    public static Map getUserPreference(DispatchContext ctx, Map context) {
-        GenericDelegator delegator = ctx.getDelegator();
-        Locale locale = (Locale) context.get("locale");
-
-        String userPrefTypeId = (String) context.get("userPrefTypeId");
-        if (UtilValidate.isEmpty(userPrefTypeId)) {
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.invalidArgument", locale));
-        }
-        String userLoginId = PreferenceWorker.getUserLoginId(context, true);
-        Map fieldMap = UtilMisc.toMap("userLoginId", userLoginId, "userPrefTypeId", userPrefTypeId);
-        String userPrefGroupId = (String) context.get("userPrefGroupId");
-        if (UtilValidate.isNotEmpty(userPrefGroupId)) {
-            fieldMap.put("userPrefGroupId", userPrefGroupId);
-        }
-
-        Map userPrefMap = null;
-        try {
-            GenericValue preference = EntityUtil.getFirst(delegator.findByAnd("UserPreference", fieldMap));
-            if (preference != null) {
-                userPrefMap = PreferenceWorker.createUserPrefMap(preference);
-            }
-        } catch (GenericEntityException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
-        } catch (GeneralException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
-        }
-
-        Map<String, Object> result = ServiceUtil.returnSuccess();
-        result.put("userPrefMap", userPrefMap);
-        return result;
-    }
-
-    /**
-     * Retrieves a group of user preferences from persistent storage. Call with
-     * userPrefGroupId  and optional userLoginId. If userLoginId isn't
-     * specified, then the currently logged-in user's userLoginId will be
-     * used. The retrieved preferences group is contained in the <b>userPrefMap</b> element.
-     * @param ctx The DispatchContext that this service is operating in.
-     * @param context Map containing the input arguments.
-     * @return Map with the result of the service, the output parameters.
-     */
-    public static Map getUserPreferenceGroup(DispatchContext ctx, Map context) {
-        GenericDelegator delegator = ctx.getDelegator();
-        Locale locale = (Locale) context.get("locale");
-
-        String userPrefGroupId = (String) context.get("userPrefGroupId");
-        if (UtilValidate.isEmpty(userPrefGroupId)) {
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.invalidArgument", locale));
-        }
-        String userLoginId = PreferenceWorker.getUserLoginId(context, true);
-
-        Map userPrefMap = null;
-        try {
-            Map fieldMap = UtilMisc.toMap("userLoginId", userLoginId, "userPrefGroupId", userPrefGroupId);
-            userPrefMap = PreferenceWorker.createUserPrefMap(delegator.findByAnd("UserPreference", fieldMap));
-        } catch (GenericEntityException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
-        } catch (GeneralException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
-        }
-
-        Map<String, Object> result = ServiceUtil.returnSuccess();
-        result.put("userPrefMap", userPrefMap);
-        return result;
-    }
-
-    /**
-     * Stores a single user preference in persistent storage. Call with
-     * userPrefTypeId, userPrefGroupId, userPrefValue and optional userLoginId.
-     * If userLoginId isn't specified, then the currently logged-in user's
-     * userLoginId will be used.
-     * @param ctx The DispatchContext that this service is operating in.
-     * @param context Map containing the input arguments.
-     * @return Map with the result of the service, the output parameters.
-     */
-    public static Map setUserPreference(DispatchContext ctx, Map context) {
-        GenericDelegator delegator = ctx.getDelegator();
-        Locale locale = (Locale) context.get("locale");
-
-        String userLoginId = PreferenceWorker.getUserLoginId(context, false);
-        String userPrefTypeId = (String) context.get("userPrefTypeId");
-        Object userPrefValue = (String) context.get("userPrefValue");
-        if (UtilValidate.isEmpty(userLoginId) || UtilValidate.isEmpty(userPrefTypeId) || userPrefValue == null) {
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.invalidArgument", locale));
-        }
-        String userPrefGroupId = (String) context.get("userPrefGroupId");
-        String userPrefDataType = (String) context.get("userPrefDataType");
-
-        try {
-            if (UtilValidate.isNotEmpty(userPrefDataType)) {
-                userPrefValue = ObjectType.simpleTypeConvert(userPrefValue, userPrefDataType, null, null, false);
-            }
-            GenericValue rec = delegator.makeValidValue("UserPreference", PreferenceWorker.toFieldMap(userLoginId, userPrefTypeId, userPrefGroupId, userPrefValue));
-            delegator.createOrStore(rec);
-        } catch (GenericEntityException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
-        } catch (GeneralException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
-        }
-
-        return ServiceUtil.returnSuccess();
-    }
-
-    /**
-     * Stores a user preference group in persistent storage. Call with
-     * userPrefMap, userPrefGroupId and optional userLoginId. If userLoginId
-     * isn't specified, then the currently logged-in user's userLoginId will be
-     * used.
-     * @param ctx The DispatchContext that this service is operating in.
-     * @param context Map containing the input arguments.
-     * @return Map with the result of the service, the output parameters.
-     */
-    public static Map setUserPreferenceGroup(DispatchContext ctx, Map context) {
-        GenericDelegator delegator = ctx.getDelegator();
-        Locale locale = (Locale) context.get("locale");
-
-        String userLoginId = PreferenceWorker.getUserLoginId(context, false);
-        Map userPrefMap = (Map) context.get("userPrefMap");
-        String userPrefGroupId = (String) context.get("userPrefGroupId");
-        if (UtilValidate.isEmpty(userLoginId) || UtilValidate.isEmpty(userPrefGroupId) || userPrefMap == null) {
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.invalidArgument", locale));
-        }
-
-        try {
-            for (Iterator i = userPrefMap.entrySet().iterator(); i.hasNext();) {
-                Map.Entry mapEntry = (Map.Entry) i.next();
-                GenericValue rec = delegator.makeValidValue("UserPreference", PreferenceWorker.toFieldMap(userLoginId, (String) mapEntry.getKey(), userPrefGroupId, (String) mapEntry.getValue()));
-                delegator.createOrStore(rec);
-            }
-        } catch (GenericEntityException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
-        } catch (GeneralException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
-        }
-
-        return ServiceUtil.returnSuccess();
-    }
-
-    /**
-     * Copies a user preference group. Call with
-     * fromUserLoginId, userPrefGroupId and optional userLoginId. If userLoginId
-     * isn't specified, then the currently logged-in user's userLoginId will be
-     * used.
-     * @param ctx The DispatchContext that this service is operating in.
-     * @param context Map containing the input arguments.
-     * @return Map with the result of the service, the output parameters.
-     */
-    public static Map copyUserPreferenceGroup(DispatchContext ctx, Map context) {
-        GenericDelegator delegator = ctx.getDelegator();
-        Locale locale = (Locale) context.get("locale");
-
-        String userLoginId = PreferenceWorker.getUserLoginId(context, false);
-        String fromUserLoginId = (String) context.get("fromUserLoginId");
-        String userPrefGroupId = (String) context.get("userPrefGroupId");
-        if (UtilValidate.isEmpty(userLoginId) || UtilValidate.isEmpty(userPrefGroupId) || UtilValidate.isEmpty(fromUserLoginId)) {
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "copyPreference.invalidArgument", locale));
-        }
-
-        try {
-            Map fieldMap = UtilMisc.toMap("userLoginId", fromUserLoginId, "userPrefGroupId", userPrefGroupId);
-            List<GenericValue> resultList = delegator.findByAnd("UserPreference", fieldMap);
-            if (resultList != null) {
-                for (Iterator i = resultList.iterator(); i.hasNext();) {
-                    GenericValue preference = (GenericValue) i.next();
-                    preference.set("userLoginId", userLoginId);
-                }
-                delegator.storeAll(resultList);
-            }
-        } catch (GenericEntityException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "copyPreference.writeFailure", new Object[] { e.getMessage() }, locale));
-        }
-
-        return ServiceUtil.returnSuccess();
-    }
-}
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.common.preferences;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.ObjectType;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.GenericDelegator;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.ServiceUtil;
+
+/**
+ * User preference services.<p>User preferences are stored as key-value pairs.
+ * <p>User preferences can be grouped - so that multiple preference pairs can be
+ * handled at once. Preference groups also allow a single userPrefTypeId to be
+ * used more than once - with each occurence having a unique userPrefGroupId.</p>
+ * <p>User preference values are stored as Strings, so the easiest and most
+ * efficient way to handle user preference values is to keep them as strings.
+ * This class handles any data conversion needed.</p>
+ */
+public class PreferenceServices {
+    public static final String module = PreferenceServices.class.getName();
+
+    public static final String resource = "PrefErrorUiLabels";
+
+    /**
+     * Retrieves a single user preference from persistent storage. Call with
+     * userPrefTypeId and optional userLoginId. If userLoginId isn't
+     * specified, then the currently logged-in user's userLoginId will be
+     * used. The retrieved preference is contained in the <b>userPrefMap</b> element.
+     * @param ctx The DispatchContext that this service is operating in.
+     * @param context Map containing the input arguments.
+     * @return Map with the result of the service, the output parameters.
+     */
+    public static Map getUserPreference(DispatchContext ctx, Map context) {
+        GenericDelegator delegator = ctx.getDelegator();
+        Locale locale = (Locale) context.get("locale");
+
+        String userPrefTypeId = (String) context.get("userPrefTypeId");
+        if (UtilValidate.isEmpty(userPrefTypeId)) {
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.invalidArgument", locale));
+        }
+        String userLoginId = PreferenceWorker.getUserLoginId(context, true);
+        Map fieldMap = UtilMisc.toMap("userLoginId", userLoginId, "userPrefTypeId", userPrefTypeId);
+        String userPrefGroupId = (String) context.get("userPrefGroupId");
+        if (UtilValidate.isNotEmpty(userPrefGroupId)) {
+            fieldMap.put("userPrefGroupId", userPrefGroupId);
+        }
+
+        Map userPrefMap = null;
+        try {
+            GenericValue preference = EntityUtil.getFirst(delegator.findByAnd("UserPreference", fieldMap));
+            if (preference != null) {
+                userPrefMap = PreferenceWorker.createUserPrefMap(preference);
+            }
+        } catch (GenericEntityException e) {
+            Debug.logWarning(e.getMessage(), module);
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
+        } catch (GeneralException e) {
+            Debug.logWarning(e.getMessage(), module);
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
+        }
+
+        Map<String, Object> result = ServiceUtil.returnSuccess();
+        result.put("userPrefMap", userPrefMap);
+        return result;
+    }
+
+    /**
+     * Retrieves a group of user preferences from persistent storage. Call with
+     * userPrefGroupId  and optional userLoginId. If userLoginId isn't
+     * specified, then the currently logged-in user's userLoginId will be
+     * used. The retrieved preferences group is contained in the <b>userPrefMap</b> element.
+     * @param ctx The DispatchContext that this service is operating in.
+     * @param context Map containing the input arguments.
+     * @return Map with the result of the service, the output parameters.
+     */
+    public static Map getUserPreferenceGroup(DispatchContext ctx, Map context) {
+        GenericDelegator delegator = ctx.getDelegator();
+        Locale locale = (Locale) context.get("locale");
+
+        String userPrefGroupId = (String) context.get("userPrefGroupId");
+        if (UtilValidate.isEmpty(userPrefGroupId)) {
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.invalidArgument", locale));
+        }
+        String userLoginId = PreferenceWorker.getUserLoginId(context, true);
+
+        Map userPrefMap = null;
+        try {
+            Map fieldMap = UtilMisc.toMap("userLoginId", userLoginId, "userPrefGroupId", userPrefGroupId);
+            userPrefMap = PreferenceWorker.createUserPrefMap(delegator.findByAnd("UserPreference", fieldMap));
+        } catch (GenericEntityException e) {
+            Debug.logWarning(e.getMessage(), module);
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
+        } catch (GeneralException e) {
+            Debug.logWarning(e.getMessage(), module);
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
+        }
+
+        Map<String, Object> result = ServiceUtil.returnSuccess();
+        result.put("userPrefMap", userPrefMap);
+        return result;
+    }
+
+    /**
+     * Stores a single user preference in persistent storage. Call with
+     * userPrefTypeId, userPrefGroupId, userPrefValue and optional userLoginId.
+     * If userLoginId isn't specified, then the currently logged-in user's
+     * userLoginId will be used.
+     * @param ctx The DispatchContext that this service is operating in.
+     * @param context Map containing the input arguments.
+     * @return Map with the result of the service, the output parameters.
+     */
+    public static Map setUserPreference(DispatchContext ctx, Map context) {
+        GenericDelegator delegator = ctx.getDelegator();
+        Locale locale = (Locale) context.get("locale");
+
+        String userLoginId = PreferenceWorker.getUserLoginId(context, false);
+        String userPrefTypeId = (String) context.get("userPrefTypeId");
+        Object userPrefValue = (String) context.get("userPrefValue");
+        if (UtilValidate.isEmpty(userLoginId) || UtilValidate.isEmpty(userPrefTypeId) || userPrefValue == null) {
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.invalidArgument", locale));
+        }
+        String userPrefGroupId = (String) context.get("userPrefGroupId");
+        String userPrefDataType = (String) context.get("userPrefDataType");
+
+        try {
+            if (UtilValidate.isNotEmpty(userPrefDataType)) {
+                userPrefValue = ObjectType.simpleTypeConvert(userPrefValue, userPrefDataType, null, null, false);
+            }
+            GenericValue rec = delegator.makeValidValue("UserPreference", PreferenceWorker.toFieldMap(userLoginId, userPrefTypeId, userPrefGroupId, userPrefValue));
+            delegator.createOrStore(rec);
+        } catch (GenericEntityException e) {
+            Debug.logWarning(e.getMessage(), module);
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
+        } catch (GeneralException e) {
+            Debug.logWarning(e.getMessage(), module);
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
+        }
+
+        return ServiceUtil.returnSuccess();
+    }
+
+    /**
+     * Stores a user preference group in persistent storage. Call with
+     * userPrefMap, userPrefGroupId and optional userLoginId. If userLoginId
+     * isn't specified, then the currently logged-in user's userLoginId will be
+     * used.
+     * @param ctx The DispatchContext that this service is operating in.
+     * @param context Map containing the input arguments.
+     * @return Map with the result of the service, the output parameters.
+     */
+    public static Map setUserPreferenceGroup(DispatchContext ctx, Map context) {
+        GenericDelegator delegator = ctx.getDelegator();
+        Locale locale = (Locale) context.get("locale");
+
+        String userLoginId = PreferenceWorker.getUserLoginId(context, false);
+        Map userPrefMap = (Map) context.get("userPrefMap");
+        String userPrefGroupId = (String) context.get("userPrefGroupId");
+        if (UtilValidate.isEmpty(userLoginId) || UtilValidate.isEmpty(userPrefGroupId) || userPrefMap == null) {
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.invalidArgument", locale));
+        }
+
+        try {
+            for (Iterator i = userPrefMap.entrySet().iterator(); i.hasNext();) {
+                Map.Entry mapEntry = (Map.Entry) i.next();
+                GenericValue rec = delegator.makeValidValue("UserPreference", PreferenceWorker.toFieldMap(userLoginId, (String) mapEntry.getKey(), userPrefGroupId, (String) mapEntry.getValue()));
+                delegator.createOrStore(rec);
+            }
+        } catch (GenericEntityException e) {
+            Debug.logWarning(e.getMessage(), module);
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
+        } catch (GeneralException e) {
+            Debug.logWarning(e.getMessage(), module);
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
+        }
+
+        return ServiceUtil.returnSuccess();
+    }
+
+    /**
+     * Copies a user preference group. Call with
+     * fromUserLoginId, userPrefGroupId and optional userLoginId. If userLoginId
+     * isn't specified, then the currently logged-in user's userLoginId will be
+     * used.
+     * @param ctx The DispatchContext that this service is operating in.
+     * @param context Map containing the input arguments.
+     * @return Map with the result of the service, the output parameters.
+     */
+    public static Map copyUserPreferenceGroup(DispatchContext ctx, Map context) {
+        GenericDelegator delegator = ctx.getDelegator();
+        Locale locale = (Locale) context.get("locale");
+
+        String userLoginId = PreferenceWorker.getUserLoginId(context, false);
+        String fromUserLoginId = (String) context.get("fromUserLoginId");
+        String userPrefGroupId = (String) context.get("userPrefGroupId");
+        if (UtilValidate.isEmpty(userLoginId) || UtilValidate.isEmpty(userPrefGroupId) || UtilValidate.isEmpty(fromUserLoginId)) {
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "copyPreference.invalidArgument", locale));
+        }
+
+        try {
+            Map fieldMap = UtilMisc.toMap("userLoginId", fromUserLoginId, "userPrefGroupId", userPrefGroupId);
+            List<GenericValue> resultList = delegator.findByAnd("UserPreference", fieldMap);
+            if (resultList != null) {
+                for (Iterator i = resultList.iterator(); i.hasNext();) {
+                    GenericValue preference = (GenericValue) i.next();
+                    preference.set("userLoginId", userLoginId);
+                }
+                delegator.storeAll(resultList);
+            }
+        } catch (GenericEntityException e) {
+            Debug.logWarning(e.getMessage(), module);
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "copyPreference.writeFailure", new Object[] { e.getMessage() }, locale));
+        }
+
+        return ServiceUtil.returnSuccess();
+    }
+}

Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java?rev=634598&r1=634597&r2=634598&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java Fri Mar  7 02:12:14 2008
@@ -1,263 +1,263 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *******************************************************************************/
-package org.ofbiz.common.preferences;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javolution.util.FastMap;
-
-import org.ofbiz.base.util.GeneralException;
-import org.ofbiz.base.util.ObjectType;
-import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.entity.GenericValue;
-import org.ofbiz.security.Security;
-import org.ofbiz.service.DispatchContext;
-import org.ofbiz.service.ServiceUtil;
-
-/**
- * User preference worker methods.
- */
-public class PreferenceWorker {
-    public static final String module = PreferenceWorker.class.getName();
-    /**
-     * User preference administrator permission. Currently set to "USERPREF_ADMIN".
-     */
-    public static final String ADMIN_PERMISSION = "USERPREF_ADMIN";
-
-    /**
-     * Default userLoginId. Currently set to "DEFAULT_USER_PREFS". This userLoginId is used to
-     * retrieve preferences when the user is not logged in.
-     */
-    public static final String DEFAULT_UID = "DEFAULT_USER_PREFS";
-
-    /**
-     * Add a UserPreference GenericValue to a Map.
-     * @param rec GenericValue to convert
-     * @param userPrefMap user preference Map
-     * @throws GeneralException
-     * @return user preference map
-     */
-    public static Map<Object, Object> addPrefToMap(GenericValue rec, Map<Object, Object> userPrefMap) throws GeneralException {
-        String prefDataType = rec.getString("userPrefDataType");
-        if (UtilValidate.isEmpty(prefDataType)) {
-            // default to String
-            userPrefMap.put(rec.getString("userPrefTypeId"), rec.getString("userPrefValue"));
-        } else {
-            userPrefMap.put(rec.getString("userPrefTypeId"), ObjectType.simpleTypeConvert(rec.get("userPrefValue"), prefDataType, null, null, false));
-        }
-        return userPrefMap;
-    }
-
-    /**
-     * Checks preference copy permissions. Returns hasPermission=true if permission
-     * is granted.
-     * <p>Users can copy from any set of preferences to their own preferences.
-     * Copying to another user's preferences requires <a href="#ADMIN_PERMISSION">ADMIN_PERMISSION</a>
-     * permission.</p>
-     * @param ctx The DispatchContext that this service is operating in.
-     * @param context Map containing the input arguments.
-     * @return Map with the result of the service, the output parameters.
-     */
-    public static Map checkCopyPermission(DispatchContext ctx, Map context) {
-        boolean hasPermission = false;
-        GenericValue userLogin = (GenericValue) context.get("userLogin");
-        if (userLogin != null) {
-            String userLoginId = userLogin.getString("userLoginId");
-            String userLoginIdArg = (String) context.get("userLoginId");
-            if (userLoginId.equals(userLoginIdArg)) {
-                // users can copy to their own preferences
-                hasPermission = true;
-            } else {
-                Security security = ctx.getSecurity();
-                hasPermission = security.hasPermission(ADMIN_PERMISSION, userLogin);
-            }
-        }
-        Map<String, Object> result = ServiceUtil.returnSuccess();
-        result.put("hasPermission", new Boolean(hasPermission));
-        return result;
-    }
-
-    /**
-     * Checks preference get/set permissions. Returns hasPermission=true if
-     * permission is granted.
-     * <p>This method is a simple wrapper around the isValidxxxId methods.</p>
-     * @param ctx The DispatchContext that this service is operating in.
-     * @param context Map containing the input arguments.
-     * @return Map with the result of the service, the output parameters.
-     */
-    public static Map checkPermission(DispatchContext ctx, Map context) {
-        boolean hasPermission = false;
-        String mainAction = (String) context.get("mainAction");
-        if ("VIEW".equals(mainAction)) {
-            if (DEFAULT_UID.equals(context.get("userLoginId"))) {
-                hasPermission = true;
-            } else {
-                hasPermission = isValidGetId(ctx, context);
-            }
-        } else if ("CREATE~UPDATE~DELETE".contains(mainAction)) {
-            hasPermission = isValidSetId(ctx, context);
-        } else {
-            hasPermission = false;
-        }
-        Map<String, Object> result = ServiceUtil.returnSuccess();
-        result.put("hasPermission", new Boolean(hasPermission));
-        return result;
-    }
-
-    /**
-     * Convert a UserPreference GenericValue to a userPrefMap.
-     * @param rec GenericValue to convert
-     * @throws GeneralException
-     * @return user preference map
-     */
-    public static Map createUserPrefMap(GenericValue rec) throws GeneralException {
-        return addPrefToMap(rec, FastMap.newInstance());
-    }
-
-    /**
-     * Convert a List of UserPreference GenericValues to a userPrefMap.
-     * @param recList List of GenericValues to convert
-     * @throws GeneralException
-     * @return user preference map
-     */
-    public static Map<Object, Object> createUserPrefMap(List recList) throws GeneralException {
-        Map<Object, Object> userPrefMap = FastMap.newInstance();
-        if (recList != null) {
-            for (Iterator i = recList.iterator(); i.hasNext();) {
-                addPrefToMap((GenericValue) i.next(), userPrefMap);
-            }
-        }
-        return userPrefMap;
-    }
-
-    /**
-     * Gets a valid userLoginId parameter from the context Map.
-     * <p>This method searches the context Map for a userLoginId key. If none is
-     * found, the method attempts to get the current user's userLoginId. If the user
-     * isn't logged in, then the method returns <a href="#DEFAULT_UID">DEFAULT_UID</a>
-     * if returnDefault is set to true, otherwise the method returns a null or empty string.</p>
-     *
-     * @param context Map containing the input arguments.
-     * @param returnDefault return <a href="#DEFAULT_UID">DEFAULT_UID</a> if no userLoginId is found.
-     * @return userLoginId String
-     */
-    public static String getUserLoginId(Map context, boolean returnDefault) {
-        String userLoginId = (String) context.get("userLoginId");
-        if (UtilValidate.isEmpty(userLoginId)) {
-            GenericValue userLogin = (GenericValue) context.get("userLogin");
-            if (userLogin != null) {
-                userLoginId = userLogin.getString("userLoginId");
-            }
-        }
-        if (UtilValidate.isEmpty(userLoginId) && returnDefault) {
-            userLoginId = DEFAULT_UID;
-        }
-        return userLoginId;
-    }
-
-    /**
-     * Checks for valid userLoginId to get preferences. Returns true if valid.
-     * <p>This method applies a small rule set to determine if user preferences
-     * can be retrieved by the current user:
-     * <ul>
-     * <li>If the user isn't logged in, then the method returns true</li>
-     * <li>If the user is logged in and the userLoginId specified in the context Map
-     * matches the user's userLoginId, then the method returns true.</li>
-     * <li>If the user is logged in and the userLoginId specified in the context Map
-     * is different than the user's userLoginId, then a security permission check is performed.
-     * If the user has the <a href="#ADMIN_PERMISSION">ADMIN_PERMISSION</a> permission then the
-     *  method returns true.</li>
-     * </ul></p>
-     *
-     * @param ctx The DispatchContext that this service is operating in.
-     * @param context Map containing the input arguments.
-     * @return true if the userLoginId arguments are valid
-     */
-    public static boolean isValidGetId(DispatchContext ctx, Map context) {
-        String currentUserLoginId = null;
-        GenericValue userLogin = (GenericValue) context.get("userLogin");
-        if (userLogin == null) {
-            currentUserLoginId = DEFAULT_UID;
-        } else {
-            currentUserLoginId = userLogin.getString("userLoginId");
-        }
-        String userLoginIdArg = (String) context.get("userLoginId");
-        if (!currentUserLoginId.equals(DEFAULT_UID) && !currentUserLoginId.equals(userLoginIdArg)
-                && userLoginIdArg != null) {
-            Security security = ctx.getSecurity();
-            return security.hasPermission(ADMIN_PERMISSION, userLogin);
-        }
-        return true;
-    }
-
-    /**
-     * Checks for valid userLoginId to set preferences. Returns true if valid.
-     * <p>This method applies a small rule set to determine if user preferences
-     * can be set by the current user:
-     * <ul>
-     * <li>If the user isn't logged in, then the method returns false</li>
-     * <li>If the user is logged in and the userLoginId specified in the context Map
-     * matches the user's userLoginId, then the method returns true.</li>
-     * <li>If the user is logged in and the userLoginId specified in the context Map
-     * is different than the user's userLoginId, then a security permission check is performed.
-     * If the user has the <a href="#ADMIN_PERMISSION">ADMIN_PERMISSION</a>
-     * permission then the method returns true.</li>
-     * </ul></p>
-     * @param ctx The DispatchContext that this service is operating in.
-     * @param context Map containing the input arguments.
-     * @return true if arguments are valid
-     */
-    public static boolean isValidSetId(DispatchContext ctx, Map context) {
-        GenericValue userLogin = (GenericValue) context.get("userLogin");
-        if (userLogin == null) {
-            return false;
-        }
-        String currentUserLoginId = userLogin.getString("userLoginId");
-        String userLoginIdArg = (String) context.get("userLoginId");
-        if (!currentUserLoginId.equals(userLoginIdArg) && userLoginIdArg != null) {
-            Security security = ctx.getSecurity();
-            return security.hasPermission(ADMIN_PERMISSION, userLogin);
-        }
-        return true;
-    }
-
-    /**
-     * Creates a field Map to be used in GenericValue create or store methods.
-     * @param userLoginId The user's login ID
-     * @param userPrefTypeId The preference ID
-     * @param userPrefGroupId The preference group ID (may be null or empty)
-     * @param userPrefValue The preference value (will be converted to java.lang.String data type)
-     * @throws GeneralException
-     * @return field map
-     */
-    public static Map<String, Object> toFieldMap(String userLoginId, String userPrefTypeId, String userPrefGroupId, Object userPrefValue) throws GeneralException {
-        Map<String, Object> fieldMap = UtilMisc.toMap("userLoginId", userLoginId, "userPrefTypeId", userPrefTypeId, "userPrefValue", ObjectType.simpleTypeConvert(userPrefValue, "String", null, null, false));
-        if (UtilValidate.isNotEmpty(userPrefGroupId)) {
-            fieldMap.put("userPrefGroupId", userPrefGroupId);
-        }
-        String valueDataType = userPrefValue.getClass().getName();
-        if (!"java.lang.String".equals(valueDataType)) {
-            fieldMap.put("userPrefDataType", valueDataType);
-        }
-        return fieldMap;
-    }
-}
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.common.preferences;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javolution.util.FastMap;
+
+import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.ObjectType;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.security.Security;
+import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.ServiceUtil;
+
+/**
+ * User preference worker methods.
+ */
+public class PreferenceWorker {
+    public static final String module = PreferenceWorker.class.getName();
+    /**
+     * User preference administrator permission. Currently set to "USERPREF_ADMIN".
+     */
+    public static final String ADMIN_PERMISSION = "USERPREF_ADMIN";
+
+    /**
+     * Default userLoginId. Currently set to "DEFAULT_USER_PREFS". This userLoginId is used to
+     * retrieve preferences when the user is not logged in.
+     */
+    public static final String DEFAULT_UID = "DEFAULT_USER_PREFS";
+
+    /**
+     * Add a UserPreference GenericValue to a Map.
+     * @param rec GenericValue to convert
+     * @param userPrefMap user preference Map
+     * @throws GeneralException
+     * @return user preference map
+     */
+    public static Map<Object, Object> addPrefToMap(GenericValue rec, Map<Object, Object> userPrefMap) throws GeneralException {
+        String prefDataType = rec.getString("userPrefDataType");
+        if (UtilValidate.isEmpty(prefDataType)) {
+            // default to String
+            userPrefMap.put(rec.getString("userPrefTypeId"), rec.getString("userPrefValue"));
+        } else {
+            userPrefMap.put(rec.getString("userPrefTypeId"), ObjectType.simpleTypeConvert(rec.get("userPrefValue"), prefDataType, null, null, false));
+        }
+        return userPrefMap;
+    }
+
+    /**
+     * Checks preference copy permissions. Returns hasPermission=true if permission
+     * is granted.
+     * <p>Users can copy from any set of preferences to their own preferences.
+     * Copying to another user's preferences requires <a href="#ADMIN_PERMISSION">ADMIN_PERMISSION</a>
+     * permission.</p>
+     * @param ctx The DispatchContext that this service is operating in.
+     * @param context Map containing the input arguments.
+     * @return Map with the result of the service, the output parameters.
+     */
+    public static Map checkCopyPermission(DispatchContext ctx, Map context) {
+        boolean hasPermission = false;
+        GenericValue userLogin = (GenericValue) context.get("userLogin");
+        if (userLogin != null) {
+            String userLoginId = userLogin.getString("userLoginId");
+            String userLoginIdArg = (String) context.get("userLoginId");
+            if (userLoginId.equals(userLoginIdArg)) {
+                // users can copy to their own preferences
+                hasPermission = true;
+            } else {
+                Security security = ctx.getSecurity();
+                hasPermission = security.hasPermission(ADMIN_PERMISSION, userLogin);
+            }
+        }
+        Map<String, Object> result = ServiceUtil.returnSuccess();
+        result.put("hasPermission", new Boolean(hasPermission));
+        return result;
+    }
+
+    /**
+     * Checks preference get/set permissions. Returns hasPermission=true if
+     * permission is granted.
+     * <p>This method is a simple wrapper around the isValidxxxId methods.</p>
+     * @param ctx The DispatchContext that this service is operating in.
+     * @param context Map containing the input arguments.
+     * @return Map with the result of the service, the output parameters.
+     */
+    public static Map checkPermission(DispatchContext ctx, Map context) {
+        boolean hasPermission = false;
+        String mainAction = (String) context.get("mainAction");
+        if ("VIEW".equals(mainAction)) {
+            if (DEFAULT_UID.equals(context.get("userLoginId"))) {
+                hasPermission = true;
+            } else {
+                hasPermission = isValidGetId(ctx, context);
+            }
+        } else if ("CREATE~UPDATE~DELETE".contains(mainAction)) {
+            hasPermission = isValidSetId(ctx, context);
+        } else {
+            hasPermission = false;
+        }
+        Map<String, Object> result = ServiceUtil.returnSuccess();
+        result.put("hasPermission", new Boolean(hasPermission));
+        return result;
+    }
+
+    /**
+     * Convert a UserPreference GenericValue to a userPrefMap.
+     * @param rec GenericValue to convert
+     * @throws GeneralException
+     * @return user preference map
+     */
+    public static Map createUserPrefMap(GenericValue rec) throws GeneralException {
+        return addPrefToMap(rec, FastMap.newInstance());
+    }
+
+    /**
+     * Convert a List of UserPreference GenericValues to a userPrefMap.
+     * @param recList List of GenericValues to convert
+     * @throws GeneralException
+     * @return user preference map
+     */
+    public static Map<Object, Object> createUserPrefMap(List recList) throws GeneralException {
+        Map<Object, Object> userPrefMap = FastMap.newInstance();
+        if (recList != null) {
+            for (Iterator i = recList.iterator(); i.hasNext();) {
+                addPrefToMap((GenericValue) i.next(), userPrefMap);
+            }
+        }
+        return userPrefMap;
+    }
+
+    /**
+     * Gets a valid userLoginId parameter from the context Map.
+     * <p>This method searches the context Map for a userLoginId key. If none is
+     * found, the method attempts to get the current user's userLoginId. If the user
+     * isn't logged in, then the method returns <a href="#DEFAULT_UID">DEFAULT_UID</a>
+     * if returnDefault is set to true, otherwise the method returns a null or empty string.</p>
+     *
+     * @param context Map containing the input arguments.
+     * @param returnDefault return <a href="#DEFAULT_UID">DEFAULT_UID</a> if no userLoginId is found.
+     * @return userLoginId String
+     */
+    public static String getUserLoginId(Map context, boolean returnDefault) {
+        String userLoginId = (String) context.get("userLoginId");
+        if (UtilValidate.isEmpty(userLoginId)) {
+            GenericValue userLogin = (GenericValue) context.get("userLogin");
+            if (userLogin != null) {
+                userLoginId = userLogin.getString("userLoginId");
+            }
+        }
+        if (UtilValidate.isEmpty(userLoginId) && returnDefault) {
+            userLoginId = DEFAULT_UID;
+        }
+        return userLoginId;
+    }
+
+    /**
+     * Checks for valid userLoginId to get preferences. Returns true if valid.
+     * <p>This method applies a small rule set to determine if user preferences
+     * can be retrieved by the current user:
+     * <ul>
+     * <li>If the user isn't logged in, then the method returns true</li>
+     * <li>If the user is logged in and the userLoginId specified in the context Map
+     * matches the user's userLoginId, then the method returns true.</li>
+     * <li>If the user is logged in and the userLoginId specified in the context Map
+     * is different than the user's userLoginId, then a security permission check is performed.
+     * If the user has the <a href="#ADMIN_PERMISSION">ADMIN_PERMISSION</a> permission then the
+     *  method returns true.</li>
+     * </ul></p>
+     *
+     * @param ctx The DispatchContext that this service is operating in.
+     * @param context Map containing the input arguments.
+     * @return true if the userLoginId arguments are valid
+     */
+    public static boolean isValidGetId(DispatchContext ctx, Map context) {
+        String currentUserLoginId = null;
+        GenericValue userLogin = (GenericValue) context.get("userLogin");
+        if (userLogin == null) {
+            currentUserLoginId = DEFAULT_UID;
+        } else {
+            currentUserLoginId = userLogin.getString("userLoginId");
+        }
+        String userLoginIdArg = (String) context.get("userLoginId");
+        if (!currentUserLoginId.equals(DEFAULT_UID) && !currentUserLoginId.equals(userLoginIdArg)
+                && userLoginIdArg != null) {
+            Security security = ctx.getSecurity();
+            return security.hasPermission(ADMIN_PERMISSION, userLogin);
+        }
+        return true;
+    }
+
+    /**
+     * Checks for valid userLoginId to set preferences. Returns true if valid.
+     * <p>This method applies a small rule set to determine if user preferences
+     * can be set by the current user:
+     * <ul>
+     * <li>If the user isn't logged in, then the method returns false</li>
+     * <li>If the user is logged in and the userLoginId specified in the context Map
+     * matches the user's userLoginId, then the method returns true.</li>
+     * <li>If the user is logged in and the userLoginId specified in the context Map
+     * is different than the user's userLoginId, then a security permission check is performed.
+     * If the user has the <a href="#ADMIN_PERMISSION">ADMIN_PERMISSION</a>
+     * permission then the method returns true.</li>
+     * </ul></p>
+     * @param ctx The DispatchContext that this service is operating in.
+     * @param context Map containing the input arguments.
+     * @return true if arguments are valid
+     */
+    public static boolean isValidSetId(DispatchContext ctx, Map context) {
+        GenericValue userLogin = (GenericValue) context.get("userLogin");
+        if (userLogin == null) {
+            return false;
+        }
+        String currentUserLoginId = userLogin.getString("userLoginId");
+        String userLoginIdArg = (String) context.get("userLoginId");
+        if (!currentUserLoginId.equals(userLoginIdArg) && userLoginIdArg != null) {
+            Security security = ctx.getSecurity();
+            return security.hasPermission(ADMIN_PERMISSION, userLogin);
+        }
+        return true;
+    }
+
+    /**
+     * Creates a field Map to be used in GenericValue create or store methods.
+     * @param userLoginId The user's login ID
+     * @param userPrefTypeId The preference ID
+     * @param userPrefGroupId The preference group ID (may be null or empty)
+     * @param userPrefValue The preference value (will be converted to java.lang.String data type)
+     * @throws GeneralException
+     * @return field map
+     */
+    public static Map<String, Object> toFieldMap(String userLoginId, String userPrefTypeId, String userPrefGroupId, Object userPrefValue) throws GeneralException {
+        Map<String, Object> fieldMap = UtilMisc.toMap("userLoginId", userLoginId, "userPrefTypeId", userPrefTypeId, "userPrefValue", ObjectType.simpleTypeConvert(userPrefValue, "String", null, null, false));
+        if (UtilValidate.isNotEmpty(userPrefGroupId)) {
+            fieldMap.put("userPrefGroupId", userPrefGroupId);
+        }
+        String valueDataType = userPrefValue.getClass().getName();
+        if (!"java.lang.String".equals(valueDataType)) {
+            fieldMap.put("userPrefDataType", valueDataType);
+        }
+        return fieldMap;
+    }
+}

Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/uom/UomWorker.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Fri Mar  7 02:12:14 2008
@@ -1 +1 @@
-Date Rev Author URL Id
+"Date Rev Author URL Id"

Modified: ofbiz/trunk/framework/common/webcommon/includes/fo/basic-footer.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/fo/basic-footer.fo.ftl?rev=634598&r1=634597&r2=634598&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/fo/basic-footer.fo.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/fo/basic-footer.fo.ftl Fri Mar  7 02:12:14 2008
@@ -1,24 +1,24 @@
-<#--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<#escape x as x?xml>
-        <fo:static-content flow-name="xsl-region-after" font-size="${(layoutSettings.footerFontSize)?default("8pt")}">
-            <fo:block text-align="center" border-top="thin solid black">Copyright (c) 2001-${nowTimestamp?string("yyyy")} The Apache Software Foundation</fo:block>
-            <fo:block text-align="center">${uiLabelMap.CommonPage} <fo:page-number/></fo:block>
-        </fo:static-content>
-</#escape>
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<#escape x as x?xml>
+        <fo:static-content flow-name="xsl-region-after" font-size="${(layoutSettings.footerFontSize)?default("8pt")}">
+            <fo:block text-align="center" border-top="thin solid black">Copyright (c) 2001-${nowTimestamp?string("yyyy")} The Apache Software Foundation</fo:block>
+            <fo:block text-align="center">${uiLabelMap.CommonPage} <fo:page-number/></fo:block>
+        </fo:static-content>
+</#escape>

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/basic-footer.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/basic-footer.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/basic-footer.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/common/webcommon/includes/fo/basic-header.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/fo/basic-header.fo.ftl?rev=634598&r1=634597&r2=634598&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/fo/basic-header.fo.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/fo/basic-header.fo.ftl Fri Mar  7 02:12:14 2008
@@ -1,25 +1,25 @@
-<#--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<#escape x as x?xml>
-        <fo:static-content flow-name="xsl-region-before">
-          <fo:block font-size="${(layoutSettings.headerFontSize)?default("14pt")}" text-align="center" margin-bottom="14pt">
-            ${(layoutSettings.documentTitle)?if_exists}
-          </fo:block>
-        </fo:static-content>
-</#escape>
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<#escape x as x?xml>
+        <fo:static-content flow-name="xsl-region-before">
+          <fo:block font-size="${(layoutSettings.headerFontSize)?default("14pt")}" text-align="center" margin-bottom="14pt">
+            ${(layoutSettings.documentTitle)?if_exists}
+          </fo:block>
+        </fo:static-content>
+</#escape>

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/basic-header.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/basic-header.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/basic-header.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/common/webcommon/includes/fo/end.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/fo/end.fo.ftl?rev=634598&r1=634597&r2=634598&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/fo/end.fo.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/fo/end.fo.ftl Fri Mar  7 02:12:14 2008
@@ -1,20 +1,20 @@
-<#--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-  </fo:page-sequence>
-</fo:root>
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+  </fo:page-sequence>
+</fo:root>

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/end.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/end.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/end.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/common/webcommon/includes/fo/pm-11x17.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/fo/pm-11x17.fo.ftl?rev=634598&r1=634597&r2=634598&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/fo/pm-11x17.fo.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/fo/pm-11x17.fo.ftl Fri Mar  7 02:12:14 2008
@@ -1,35 +1,35 @@
-<#--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-    <fo:simple-page-master master-name="11x17-portrait"
-        page-width="11in" page-height="17in"
-        margin-top="0.5in" margin-bottom="0.5in"
-        margin-left="0.5in" margin-right="0.5in">
-      <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
-      <fo:region-before extent="1in"/>
-      <fo:region-after extent="0.5in" />
-    </fo:simple-page-master>
-
-    <fo:simple-page-master master-name="11x17-landscape"
-        page-width="17in" page-height="11in"
-        margin-top="0.5in" margin-bottom="0.5in"
-        margin-left="0.5in" margin-right="0.5in">
-      <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
-      <fo:region-before extent="1in"/>
-      <fo:region-after extent="0.5in" />
-    </fo:simple-page-master>
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+    <fo:simple-page-master master-name="11x17-portrait"
+        page-width="11in" page-height="17in"
+        margin-top="0.5in" margin-bottom="0.5in"
+        margin-left="0.5in" margin-right="0.5in">
+      <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
+      <fo:region-before extent="1in"/>
+      <fo:region-after extent="0.5in" />
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="11x17-landscape"
+        page-width="17in" page-height="11in"
+        margin-top="0.5in" margin-bottom="0.5in"
+        margin-left="0.5in" margin-right="0.5in">
+      <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
+      <fo:region-before extent="1in"/>
+      <fo:region-after extent="0.5in" />
+    </fo:simple-page-master>

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/pm-11x17.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/pm-11x17.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/pm-11x17.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/common/webcommon/includes/fo/pm-legal.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/fo/pm-legal.fo.ftl?rev=634598&r1=634597&r2=634598&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/fo/pm-legal.fo.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/fo/pm-legal.fo.ftl Fri Mar  7 02:12:14 2008
@@ -1,35 +1,35 @@
-<#--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-    <fo:simple-page-master master-name="legal-portrait"
-        page-width="8.5in" page-height="14in"
-        margin-top="0.5in" margin-bottom="0.5in"
-        margin-left="0.5in" margin-right="0.5in">
-      <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
-      <fo:region-before extent="1in"/>
-      <fo:region-after extent="0.5in" />
-    </fo:simple-page-master>
-
-    <fo:simple-page-master master-name="legal-landscape"
-        page-width="14in" page-height="8.5in"
-        margin-top="0.5in" margin-bottom="0.5in"
-        margin-left="0.5in" margin-right="0.5in">
-      <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
-      <fo:region-before extent="1in"/>
-      <fo:region-after extent="0.5in" />
-    </fo:simple-page-master>
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+    <fo:simple-page-master master-name="legal-portrait"
+        page-width="8.5in" page-height="14in"
+        margin-top="0.5in" margin-bottom="0.5in"
+        margin-left="0.5in" margin-right="0.5in">
+      <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
+      <fo:region-before extent="1in"/>
+      <fo:region-after extent="0.5in" />
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="legal-landscape"
+        page-width="14in" page-height="8.5in"
+        margin-top="0.5in" margin-bottom="0.5in"
+        margin-left="0.5in" margin-right="0.5in">
+      <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
+      <fo:region-before extent="1in"/>
+      <fo:region-after extent="0.5in" />
+    </fo:simple-page-master>

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/pm-legal.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/pm-legal.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/pm-legal.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/common/webcommon/includes/fo/pm-letter.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/fo/pm-letter.fo.ftl?rev=634598&r1=634597&r2=634598&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/fo/pm-letter.fo.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/fo/pm-letter.fo.ftl Fri Mar  7 02:12:14 2008
@@ -1,35 +1,35 @@
-<#--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-    <fo:simple-page-master master-name="letter-portrait"
-        page-width="8.5in" page-height="11in"
-        margin-top="0.5in" margin-bottom="0.5in"
-        margin-left="0.5in" margin-right="0.5in">
-      <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
-      <fo:region-before extent="1in"/>
-      <fo:region-after extent="0.5in" />
-    </fo:simple-page-master>
-
-    <fo:simple-page-master master-name="letter-landscape"
-        page-width="11in" page-height="8.5in"
-        margin-top="0.5in" margin-bottom="0.5in"
-        margin-left="0.5in" margin-right="0.5in">
-      <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
-      <fo:region-before extent="1in"/>
-      <fo:region-after extent="0.5in" />
-    </fo:simple-page-master>
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+    <fo:simple-page-master master-name="letter-portrait"
+        page-width="8.5in" page-height="11in"
+        margin-top="0.5in" margin-bottom="0.5in"
+        margin-left="0.5in" margin-right="0.5in">
+      <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
+      <fo:region-before extent="1in"/>
+      <fo:region-after extent="0.5in" />
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="letter-landscape"
+        page-width="11in" page-height="8.5in"
+        margin-top="0.5in" margin-bottom="0.5in"
+        margin-left="0.5in" margin-right="0.5in">
+      <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
+      <fo:region-before extent="1in"/>
+      <fo:region-after extent="0.5in" />
+    </fo:simple-page-master>

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/pm-letter.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/pm-letter.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/pm-letter.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/common/webcommon/includes/fo/start.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/fo/start.fo.ftl?rev=634598&r1=634597&r2=634598&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/fo/start.fo.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/fo/start.fo.ftl Fri Mar  7 02:12:14 2008
@@ -1,42 +1,42 @@
-<#--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<#escape x as x?xml>
-<?xml version="1.0" encoding="UTF-8"?>
-<#if layoutSettings.styleSheets?has_content>
-  <#--layoutSettings.styleSheets is a list of style sheets -->
-  <#list layoutSettings.styleSheets as styleSheet>
-    <?xml-stylesheet type="text/xsl" href="<@ofbizContentUrl>${styleSheet}</@ofbizContentUrl>"?>
-  </#list>
-</#if>
-<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
-    font-family="${(layoutSettings.defaultFontFamily)?default("Helvetica, sans-serif")}"
-    font-size="${(layoutSettings.defaultFontSize)?default("12pt")}">
-  <fo:layout-master-set>
-<#if layoutSettings.pageMasters?has_content>
-  <#--layoutSettings.pageMasters is a list of fo page master element ftl templates -->
-  <#list layoutSettings.pageMasters as pageMaster>
-    <#include pageMaster/>
-  </#list>
-<#else>
-  <#include "component://common/webcommon/includes/fo/pm-letter.fo.ftl"/>
-</#if>
-  </fo:layout-master-set>
-  <#assign masterReference = (layoutSettings.masterReference)?default("letter-portrait")/>
-  <fo:page-sequence master-reference="${masterReference}">
-</#escape>
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<#escape x as x?xml>
+<?xml version="1.0" encoding="UTF-8"?>
+<#if layoutSettings.styleSheets?has_content>
+  <#--layoutSettings.styleSheets is a list of style sheets -->
+  <#list layoutSettings.styleSheets as styleSheet>
+    <?xml-stylesheet type="text/xsl" href="<@ofbizContentUrl>${styleSheet}</@ofbizContentUrl>"?>
+  </#list>
+</#if>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
+    font-family="${(layoutSettings.defaultFontFamily)?default("Helvetica, sans-serif")}"
+    font-size="${(layoutSettings.defaultFontSize)?default("12pt")}">
+  <fo:layout-master-set>
+<#if layoutSettings.pageMasters?has_content>
+  <#--layoutSettings.pageMasters is a list of fo page master element ftl templates -->
+  <#list layoutSettings.pageMasters as pageMaster>
+    <#include pageMaster/>
+  </#list>
+<#else>
+  <#include "component://common/webcommon/includes/fo/pm-letter.fo.ftl"/>
+</#if>
+  </fo:layout-master-set>
+  <#assign masterReference = (layoutSettings.masterReference)?default("letter-portrait")/>
+  <fo:page-sequence master-reference="${masterReference}">
+</#escape>

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/start.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/start.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/webcommon/includes/fo/start.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain