svn commit: r1044202 [2/5] - in /ofbiz/trunk: applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/ applications/accounting/src/org/ofbiz/accounting/thirdparty/securepay/ applications/content/src/org/ofbiz/content/webapp/ftl/ app...

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

svn commit: r1044202 [2/5] - in /ofbiz/trunk: applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/ applications/accounting/src/org/ofbiz/accounting/thirdparty/securepay/ applications/content/src/org/ofbiz/content/webapp/ftl/ app...

doogie-3
Modified: ofbiz/trunk/framework/webslinger/src/org/ofbiz/commons/vfs/ofbiz/OfbizComponentProvider.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/src/org/ofbiz/commons/vfs/ofbiz/OfbizComponentProvider.java?rev=1044202&r1=1044201&r2=1044202&view=diff
==============================================================================
--- ofbiz/trunk/framework/webslinger/src/org/ofbiz/commons/vfs/ofbiz/OfbizComponentProvider.java (original)
+++ ofbiz/trunk/framework/webslinger/src/org/ofbiz/commons/vfs/ofbiz/OfbizComponentProvider.java Fri Dec 10 02:40:02 2010
@@ -1,58 +1,58 @@
-/*******************************************************************************
- * 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.commons.vfs.ofbiz;
-
-import java.net.URL;
-import java.util.Collection;
-import org.apache.commons.vfs.FileObject;
-import org.apache.commons.vfs.FileSystemException;
-import org.apache.commons.vfs.FileSystemOptions;
-import org.apache.commons.vfs.provider.AbstractFileProvider;
-import org.apache.commons.vfs.provider.local.DefaultLocalFileProvider;
-import org.ofbiz.base.location.FlexibleLocation;
-import org.ofbiz.base.util.UtilMisc;
-import org.webslinger.commons.vfs.VFSUtil;
-
-public class OfbizComponentProvider extends AbstractFileProvider {
-    public Collection<?> getCapabilities() {
-        return DefaultLocalFileProvider.capabilities;
-    }
-
-    public FileObject findFile(FileObject base, String name, FileSystemOptions properties) throws FileSystemException {
-        try {
-            //name = name.replaceAll("^ofbiz-component://", "");
-            int nameLength = name.length();
-            int componentNameStart = 16;
-            while (componentNameStart < nameLength && name.charAt(componentNameStart) == '/') componentNameStart++;
-            if (componentNameStart == nameLength) throw new IllegalArgumentException("Invalid name(" + name + ")");
-            int componentNameEnd = componentNameStart;
-            while (componentNameEnd < nameLength && name.charAt(componentNameEnd) != '/') componentNameEnd++;
-            if (componentNameEnd == nameLength) throw new IllegalArgumentException("Invalid name(" + name + ")");
-            int restStart = componentNameEnd;
-            while (restStart < nameLength && name.charAt(restStart) == '/') restStart++;
-            if (restStart == nameLength) throw new IllegalArgumentException("Invalid name(" + name + ")");
-            String componentName = name.substring(componentNameStart, componentNameEnd);
-            URL location = FlexibleLocation.resolveLocation("component://" + componentName + "/.");
-            FileObject ofbizBase = getContext().resolveFile(location.toString(), properties);
-            return VFSUtil.toFileObject(ofbizBase.getFileSystem().getFileSystemManager(), ofbizBase.resolveFile(name.substring(restStart)).getURL().toString(), properties);
-        } catch (Exception e) {
-            throw UtilMisc.initCause(new FileSystemException(e.getMessage(), null, e), e);
-        }
-    }
-}
+/*******************************************************************************
+ * 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.commons.vfs.ofbiz;
+
+import java.net.URL;
+import java.util.Collection;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.FileSystemOptions;
+import org.apache.commons.vfs.provider.AbstractFileProvider;
+import org.apache.commons.vfs.provider.local.DefaultLocalFileProvider;
+import org.ofbiz.base.location.FlexibleLocation;
+import org.ofbiz.base.util.UtilMisc;
+import org.webslinger.commons.vfs.VFSUtil;
+
+public class OfbizComponentProvider extends AbstractFileProvider {
+    public Collection<?> getCapabilities() {
+        return DefaultLocalFileProvider.capabilities;
+    }
+
+    public FileObject findFile(FileObject base, String name, FileSystemOptions properties) throws FileSystemException {
+        try {
+            //name = name.replaceAll("^ofbiz-component://", "");
+            int nameLength = name.length();
+            int componentNameStart = 16;
+            while (componentNameStart < nameLength && name.charAt(componentNameStart) == '/') componentNameStart++;
+            if (componentNameStart == nameLength) throw new IllegalArgumentException("Invalid name(" + name + ")");
+            int componentNameEnd = componentNameStart;
+            while (componentNameEnd < nameLength && name.charAt(componentNameEnd) != '/') componentNameEnd++;
+            if (componentNameEnd == nameLength) throw new IllegalArgumentException("Invalid name(" + name + ")");
+            int restStart = componentNameEnd;
+            while (restStart < nameLength && name.charAt(restStart) == '/') restStart++;
+            if (restStart == nameLength) throw new IllegalArgumentException("Invalid name(" + name + ")");
+            String componentName = name.substring(componentNameStart, componentNameEnd);
+            URL location = FlexibleLocation.resolveLocation("component://" + componentName + "/.");
+            FileObject ofbizBase = getContext().resolveFile(location.toString(), properties);
+            return VFSUtil.toFileObject(ofbizBase.getFileSystem().getFileSystemManager(), ofbizBase.resolveFile(name.substring(restStart)).getURL().toString(), properties);
+        } catch (Exception e) {
+            throw UtilMisc.initCause(new FileSystemException(e.getMessage(), null, e), e);
+        }
+    }
+}

Propchange: ofbiz/trunk/framework/webslinger/src/org/ofbiz/commons/vfs/ofbiz/OfbizComponentProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/webslinger/src/org/ofbiz/commons/vfs/ofbiz/OfbizHomeProvider.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/src/org/ofbiz/commons/vfs/ofbiz/OfbizHomeProvider.java?rev=1044202&r1=1044201&r2=1044202&view=diff
==============================================================================
--- ofbiz/trunk/framework/webslinger/src/org/ofbiz/commons/vfs/ofbiz/OfbizHomeProvider.java (original)
+++ ofbiz/trunk/framework/webslinger/src/org/ofbiz/commons/vfs/ofbiz/OfbizHomeProvider.java Fri Dec 10 02:40:02 2010
@@ -1,50 +1,50 @@
-/*******************************************************************************
- * 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.commons.vfs.ofbiz;
-
-import java.net.URL;
-import java.util.Collection;
-
-import org.apache.commons.vfs.FileObject;
-import org.apache.commons.vfs.FileSystemException;
-import org.apache.commons.vfs.FileSystemOptions;
-import org.apache.commons.vfs.provider.AbstractFileProvider;
-import org.apache.commons.vfs.provider.local.DefaultLocalFileProvider;
-
-import org.ofbiz.base.location.FlexibleLocation;
-import org.ofbiz.base.util.UtilMisc;
-
-import org.webslinger.commons.vfs.VFSUtil;
-
-public class OfbizHomeProvider extends AbstractFileProvider {
-    public Collection<?> getCapabilities() {
-        return DefaultLocalFileProvider.capabilities;
-    }
-
-    public FileObject findFile(FileObject base, String name, FileSystemOptions properties) throws FileSystemException {
-        //new Exception("findFile(" + base + ", " + name + ")").printStackTrace();
-        try {
-            URL location = FlexibleLocation.resolveLocation("ofbizhome://.");
-            FileObject ofbizBase = getContext().resolveFile(location.toString(), properties);
-            return VFSUtil.toFileObject(ofbizBase.getFileSystem().getFileSystemManager(), ofbizBase.resolveFile(name.substring(13)).getURL().toString(), properties);
-        } catch (Exception e) {
-            throw UtilMisc.initCause(new FileSystemException(e.getMessage(), null, e), e);
-        }
-    }
-}
+/*******************************************************************************
+ * 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.commons.vfs.ofbiz;
+
+import java.net.URL;
+import java.util.Collection;
+
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.FileSystemOptions;
+import org.apache.commons.vfs.provider.AbstractFileProvider;
+import org.apache.commons.vfs.provider.local.DefaultLocalFileProvider;
+
+import org.ofbiz.base.location.FlexibleLocation;
+import org.ofbiz.base.util.UtilMisc;
+
+import org.webslinger.commons.vfs.VFSUtil;
+
+public class OfbizHomeProvider extends AbstractFileProvider {
+    public Collection<?> getCapabilities() {
+        return DefaultLocalFileProvider.capabilities;
+    }
+
+    public FileObject findFile(FileObject base, String name, FileSystemOptions properties) throws FileSystemException {
+        //new Exception("findFile(" + base + ", " + name + ")").printStackTrace();
+        try {
+            URL location = FlexibleLocation.resolveLocation("ofbizhome://.");
+            FileObject ofbizBase = getContext().resolveFile(location.toString(), properties);
+            return VFSUtil.toFileObject(ofbizBase.getFileSystem().getFileSystemManager(), ofbizBase.resolveFile(name.substring(13)).getURL().toString(), properties);
+        } catch (Exception e) {
+            throw UtilMisc.initCause(new FileSystemException(e.getMessage(), null, e), e);
+        }
+    }
+}

Propchange: ofbiz/trunk/framework/webslinger/src/org/ofbiz/commons/vfs/ofbiz/OfbizHomeProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/EntityHttpUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/EntityHttpUtil.java?rev=1044202&r1=1044201&r2=1044202&view=diff
==============================================================================
--- ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/EntityHttpUtil.java (original)
+++ ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/EntityHttpUtil.java Fri Dec 10 02:40:02 2010
@@ -1,73 +1,73 @@
-/*******************************************************************************
- * 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.webslinger;
-
-import java.util.Iterator;
-import java.util.Locale;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.http.HttpServletRequest;
-
-import org.ofbiz.base.util.GeneralException;
-import org.ofbiz.base.util.ObjectType;
-import org.ofbiz.base.util.UtilHttp;
-import org.ofbiz.entity.Delegator;
-import org.ofbiz.entity.GenericValue;
-import org.ofbiz.entity.model.ModelEntity;
-import org.ofbiz.entity.model.ModelField;
-import org.ofbiz.entity.model.ModelFieldType;
-
-public class EntityHttpUtil {
-    public static GenericValue makeValidValue(String entityName, ServletRequest request) throws GeneralException {
-        return makeValidValue(entityName, false, request);
-    }
-
-    public static GenericValue makeValidValue(String entityName, boolean includePks, ServletRequest request) throws GeneralException {
-        if (request instanceof HttpServletRequest) return makeValidValue(entityName, includePks, (HttpServletRequest) request);
-        throw new IllegalArgumentException("Not an HttpServletRequest");
-    }
-
-    public static GenericValue makeValidValue(String entityName, HttpServletRequest request) throws GeneralException {
-        return makeValidValue(entityName, false, request);
-    }
-
-    public static GenericValue makeValidValue(String entityName, boolean includePks, HttpServletRequest request) throws GeneralException {
-        Delegator delegator = (Delegator) request.getAttribute("delegator");
-        GenericValue value = delegator.makeValue(entityName);
-        ModelEntity model = value.getModelEntity();
-        Iterator<ModelField> it = includePks ? model.getFieldsIterator() : model.getNopksIterator();
-        Locale locale = UtilHttp.getLocale(request);
-        while (it.hasNext()) {
-            ModelField field = it.next();
-            String fieldName = field.getName();
-            String parameterValue = request.getParameter(fieldName);
-            Object fieldValue;
-            if (parameterValue == null) {
-                fieldValue = null;
-            } else {
-                ModelFieldType fieldType = delegator.getEntityFieldType(model, field.getType());
-                String wantedType = fieldType.getJavaType();
-                fieldValue = ObjectType.simpleTypeConvert(parameterValue, wantedType, null, locale, true);
-            }
-            value.put(fieldName, fieldValue);
-        }
-        return value;
-    }
-}
-
+/*******************************************************************************
+ * 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.webslinger;
+
+import java.util.Iterator;
+import java.util.Locale;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+
+import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.ObjectType;
+import org.ofbiz.base.util.UtilHttp;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.model.ModelEntity;
+import org.ofbiz.entity.model.ModelField;
+import org.ofbiz.entity.model.ModelFieldType;
+
+public class EntityHttpUtil {
+    public static GenericValue makeValidValue(String entityName, ServletRequest request) throws GeneralException {
+        return makeValidValue(entityName, false, request);
+    }
+
+    public static GenericValue makeValidValue(String entityName, boolean includePks, ServletRequest request) throws GeneralException {
+        if (request instanceof HttpServletRequest) return makeValidValue(entityName, includePks, (HttpServletRequest) request);
+        throw new IllegalArgumentException("Not an HttpServletRequest");
+    }
+
+    public static GenericValue makeValidValue(String entityName, HttpServletRequest request) throws GeneralException {
+        return makeValidValue(entityName, false, request);
+    }
+
+    public static GenericValue makeValidValue(String entityName, boolean includePks, HttpServletRequest request) throws GeneralException {
+        Delegator delegator = (Delegator) request.getAttribute("delegator");
+        GenericValue value = delegator.makeValue(entityName);
+        ModelEntity model = value.getModelEntity();
+        Iterator<ModelField> it = includePks ? model.getFieldsIterator() : model.getNopksIterator();
+        Locale locale = UtilHttp.getLocale(request);
+        while (it.hasNext()) {
+            ModelField field = it.next();
+            String fieldName = field.getName();
+            String parameterValue = request.getParameter(fieldName);
+            Object fieldValue;
+            if (parameterValue == null) {
+                fieldValue = null;
+            } else {
+                ModelFieldType fieldType = delegator.getEntityFieldType(model, field.getType());
+                String wantedType = fieldType.getJavaType();
+                fieldValue = ObjectType.simpleTypeConvert(parameterValue, wantedType, null, locale, true);
+            }
+            value.put(fieldName, fieldValue);
+        }
+        return value;
+    }
+}
+

Propchange: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/EntityHttpUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/EntityTransactionUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/StatsUpdater.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/StatsUpdater.java?rev=1044202&r1=1044201&r2=1044202&view=diff
==============================================================================
--- ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/StatsUpdater.java (original)
+++ ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/StatsUpdater.java Fri Dec 10 02:40:02 2010
@@ -1,118 +1,118 @@
-/*******************************************************************************
- * 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.webslinger;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.entity.Delegator;
-import org.ofbiz.entity.GenericEntityException;
-import org.ofbiz.entity.GenericPK;
-import org.ofbiz.entity.GenericValue;
-import org.webslinger.cache.ConcurrentCache;
-import org.webslinger.concurrent.ExecutionPool;
-
-public class StatsUpdater {
-    private static final Updater UPDATER = new Updater();
-
-    public static void updateStats(Delegator delegator, String entityName, Map<String, ? extends Object> keyFields, Map<String, ? extends Long> updateCountFields) throws GenericEntityException {
-        GenericPK pk = delegator.makePK(entityName, keyFields);
-        Map<String, Long> value = UPDATER.getValue(pk);
-        synchronized (value) {
-            for (Map.Entry<String, ? extends Long> entry: updateCountFields.entrySet()) {
-                Long oldValue = value.get(entry.getKey());
-                if (oldValue != null) {
-                    value.put(entry.getKey(), Long.valueOf(oldValue.longValue() + entry.getValue()));
-                } else {
-                    value.put(entry.getKey(), entry.getValue());
-                }
-            }
-        }
-    }
-
-    private static final class Updater implements Callable<Void> {
-        protected AtomicReference<EntityHolder> entities = new AtomicReference<EntityHolder>(new EntityHolder(Updater.class, "entities", null));
-        protected ScheduledFuture<Void> future;
-
-        protected Map<String, Long> getValue(GenericPK pk) throws GenericEntityException {
-            synchronized (this) {
-                if (future == null || future.isDone()) {
-                    future = ExecutionPool.schedule(this, 1, TimeUnit.SECONDS);
-                }
-            }
-            try {
-                return entities.get().get(pk);
-            } catch (RuntimeException e) {
-                throw e;
-            } catch (GenericEntityException e) {
-                throw e;
-            } catch (Exception e) {
-                throw UtilMisc.initCause(new GenericEntityException(e.getMessage()), e);
-            }
-        }
-
-        public Void call() {
-            EntityHolder oldEntities;
-            EntityHolder newEntities = new EntityHolder(Updater.class, "entities", null);
-            do {
-                oldEntities = entities.get();
-            } while (!entities.compareAndSet(oldEntities, newEntities));
-            synchronized (Updater.class) {
-                for (GenericPK pk: oldEntities.keys()) {
-                    try {
-                        Map<String, Long> add = oldEntities.get(pk);
-                        GenericValue existing = pk.getDelegator().findOne(pk.getEntityName(), pk, false);
-                        if (existing == null) {
-                            existing = pk.getDelegator().create(pk.getEntityName(), pk);
-                        }
-                        for (Map.Entry<String, Long> entry: add.entrySet()) {
-                            Long value = entry.getValue();
-                            Long oldValue = existing.getLong(entry.getKey());
-                            if (oldValue != null) {
-                                existing.put(entry.getKey(), Long.valueOf(value.longValue() + oldValue.longValue()));
-                            } else {
-                                existing.put(entry.getKey(), value);
-                            }
-                        }
-                        existing.store();
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                }
-            }
-            return null;
-        }
-    }
-
-    private static final class EntityHolder extends ConcurrentCache<GenericPK, Map<String, Long>> {
-        protected EntityHolder(Class<?> owner, String field, String label) {
-            super(owner, field, label, HARD);
-        }
-
-        @Override
-        protected Map<String, Long> createValue(GenericPK pk) throws Exception {
-            return new HashMap<String, Long>();
-        }
-    }
-}
+/*******************************************************************************
+ * 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.webslinger;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericPK;
+import org.ofbiz.entity.GenericValue;
+import org.webslinger.cache.ConcurrentCache;
+import org.webslinger.concurrent.ExecutionPool;
+
+public class StatsUpdater {
+    private static final Updater UPDATER = new Updater();
+
+    public static void updateStats(Delegator delegator, String entityName, Map<String, ? extends Object> keyFields, Map<String, ? extends Long> updateCountFields) throws GenericEntityException {
+        GenericPK pk = delegator.makePK(entityName, keyFields);
+        Map<String, Long> value = UPDATER.getValue(pk);
+        synchronized (value) {
+            for (Map.Entry<String, ? extends Long> entry: updateCountFields.entrySet()) {
+                Long oldValue = value.get(entry.getKey());
+                if (oldValue != null) {
+                    value.put(entry.getKey(), Long.valueOf(oldValue.longValue() + entry.getValue()));
+                } else {
+                    value.put(entry.getKey(), entry.getValue());
+                }
+            }
+        }
+    }
+
+    private static final class Updater implements Callable<Void> {
+        protected AtomicReference<EntityHolder> entities = new AtomicReference<EntityHolder>(new EntityHolder(Updater.class, "entities", null));
+        protected ScheduledFuture<Void> future;
+
+        protected Map<String, Long> getValue(GenericPK pk) throws GenericEntityException {
+            synchronized (this) {
+                if (future == null || future.isDone()) {
+                    future = ExecutionPool.schedule(this, 1, TimeUnit.SECONDS);
+                }
+            }
+            try {
+                return entities.get().get(pk);
+            } catch (RuntimeException e) {
+                throw e;
+            } catch (GenericEntityException e) {
+                throw e;
+            } catch (Exception e) {
+                throw UtilMisc.initCause(new GenericEntityException(e.getMessage()), e);
+            }
+        }
+
+        public Void call() {
+            EntityHolder oldEntities;
+            EntityHolder newEntities = new EntityHolder(Updater.class, "entities", null);
+            do {
+                oldEntities = entities.get();
+            } while (!entities.compareAndSet(oldEntities, newEntities));
+            synchronized (Updater.class) {
+                for (GenericPK pk: oldEntities.keys()) {
+                    try {
+                        Map<String, Long> add = oldEntities.get(pk);
+                        GenericValue existing = pk.getDelegator().findOne(pk.getEntityName(), pk, false);
+                        if (existing == null) {
+                            existing = pk.getDelegator().create(pk.getEntityName(), pk);
+                        }
+                        for (Map.Entry<String, Long> entry: add.entrySet()) {
+                            Long value = entry.getValue();
+                            Long oldValue = existing.getLong(entry.getKey());
+                            if (oldValue != null) {
+                                existing.put(entry.getKey(), Long.valueOf(value.longValue() + oldValue.longValue()));
+                            } else {
+                                existing.put(entry.getKey(), value);
+                            }
+                        }
+                        existing.store();
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+            return null;
+        }
+    }
+
+    private static final class EntityHolder extends ConcurrentCache<GenericPK, Map<String, Long>> {
+        protected EntityHolder(Class<?> owner, String field, String label) {
+            super(owner, field, label, HARD);
+        }
+
+        @Override
+        protected Map<String, Long> createValue(GenericPK pk) throws Exception {
+            return new HashMap<String, Long>();
+        }
+    }
+}

Propchange: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/StatsUpdater.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerBSFServiceEngine.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerCatalinaContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java?rev=1044202&r1=1044201&r2=1044202&view=diff
==============================================================================
--- ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java (original)
+++ ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java Fri Dec 10 02:40:02 2010
@@ -1,216 +1,216 @@
-/*******************************************************************************
- * 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.webslinger;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-
-import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.UtilProperties;
-import org.ofbiz.entity.Delegator;
-import org.ofbiz.entity.DelegatorFactory;
-import org.ofbiz.entity.GenericEntityException;
-import org.ofbiz.entity.GenericValue;
-import org.ofbiz.entity.cache.Cache;
-import org.ofbiz.entity.util.EntityUtil;
-import org.ofbiz.security.SecurityFactory;
-import org.ofbiz.security.authz.AuthorizationFactory;
-import org.ofbiz.service.DispatchContext;
-import org.ofbiz.service.GenericDispatcher;
-import org.ofbiz.service.ServiceDispatcher;
-import org.webslinger.AbstractMappingWebslingerServletContextFactory;
-import org.webslinger.WebslingerServletContext;
-import org.webslinger.collections.CollectionUtil;
-import org.webslinger.lang.ObjectUtil;
-
-public class WebslingerContextMapper extends AbstractMappingWebslingerServletContextFactory {
-    protected ServletContext servletContext;
-    protected Delegator delegator;
-    protected final ArrayList<URL> globalReaderURLs = new ArrayList<URL>();
-
-    public void init(ServletConfig config) throws ServletException, IOException {
-        System.err.println(org.webslinger.commons.vfs.flat.FlatFileProvider.class);
-        servletContext = config.getServletContext();
-        String delegatorName = servletContext.getInitParameter("entityDelegatorName");
-        delegator = DelegatorFactory.getDelegator(delegatorName);
-        String readerFiles = servletContext.getInitParameter("serviceReaderUrls");
-        if (readerFiles != null) {
-            for (String reader: CollectionUtil.split(readerFiles, ";")) {
-                URL url =  config.getServletContext().getResource(reader);
-                if (url != null) globalReaderURLs.add(url);
-            }
-        }
-        super.init(config, UtilProperties.getPropertyValue("webslinger.properties", "moduleBase"));
-    }
-
-    @Override
-    protected Layout[] getStartLayouts() throws Exception {
-        ArrayList<Layout> layouts = new ArrayList<Layout>();
-        try {
-            for (GenericValue value: delegator.findByAnd("WebslingerServer", UtilMisc.toMap("loadAtStart", "Y"))) {
-                layouts.add(new OfbizLayout(value));
-            }
-        } catch (GenericEntityException e) {
-        }
-        return layouts.toArray(new Layout[layouts.size()]);
-    }
-
-    @Override
-    public void initializeRequest(WebslingerServletContext context, HttpServletRequest request) {
-        request.setAttribute("servletContext", context);
-        Object delegator = context.getAttribute("delegator");
-        Object dispatcher = context.getAttribute("dispatcher");
-        Object authz = context.getAttribute("authz");
-        Object security = context.getAttribute("security");
-        request.setAttribute("delegator", delegator);
-        request.setAttribute("dispatcher", dispatcher);
-        request.setAttribute("authz", authz);
-        request.setAttribute("security", security);
-        // FIXME!!! These next two are a hack until proper fake/wrapped session support is done in webslinger
-        servletContext.setAttribute("delegator", delegator);
-        servletContext.setAttribute("dispatcher", dispatcher);
-        servletContext.setAttribute("authz", authz);
-        servletContext.setAttribute("security", security);
-    }
-
-    @Override
-    protected void initializeContext(WebslingerServletContext context, Layout layout) throws Exception {
-        OfbizLayout ofbizLayout = (OfbizLayout) layout;
-        Delegator delegator = null;
-        delegator = DelegatorFactory.getDelegator(ofbizLayout.delegatorName);
-        context.setAttribute("delegator", delegator);
-        context.setAttribute("dispatcher", new WebslingerGenericDispatcher(context, layout.getTarget(), delegator, globalReaderURLs));
-        context.setAttribute("authz", AuthorizationFactory.getInstance(delegator));
-        context.setAttribute("security", SecurityFactory.getInstance(delegator));
-    }
-
-    protected static final class WebslingerGenericDispatcher extends GenericDispatcher {
-        protected WebslingerGenericDispatcher(WebslingerServletContext context, String name, Delegator delegator, List<URL> globalReaderURLs) throws IOException {
-            ArrayList<URL> readerURLs = new ArrayList<URL>(globalReaderURLs);
-            String readerFiles = context.getInitParameter("serviceReaderUrls");
-            if (readerFiles != null) {
-                for (String reader: CollectionUtil.split(readerFiles, ";")) {
-                    URL url =  context.getResource(reader);
-                    if (url != null) readerURLs.add(url);
-                }
-            }
-            System.err.println(readerURLs);
-            this.dispatcher = new ServiceDispatcher(delegator, true, true, true) {
-            };
-            ClassLoader loader = null;
-            try {
-                loader = Thread.currentThread().getContextClassLoader();
-            } catch (SecurityException e) {
-                loader = WebslingerContextMapper.class.getClassLoader();
-            }
-            DispatchContext dc = new DispatchContext(name, readerURLs, loader, null);
-            init(name, delegator, dc);
-        }
-    }
-
-    @Override
-    protected Set<String> getSuffixes() throws Exception {
-        Cache cache = delegator.getCache();
-        Set<String> suffixes;
-        synchronized (WebslingerContextMapper.class) {
-            suffixes = cache.get("WebslingerHostSuffix", null, "WebslingerContextMapper.Suffixes");
-            if (suffixes == null) {
-                suffixes = new HashSet<String>();
-                for (GenericValue value: delegator.findList("WebslingerHostSuffix", null, null, null, null, false)) {
-                    suffixes.add(value.getString("hostSuffix"));
-                }
-                cache.put("WebslingerHostSuffix", null, "WebslingerContextMapper.Suffixes", suffixes);
-            }
-        }
-        return suffixes;
-    }
-
-    @Override
-    protected Layout lookupLayout(String hostName, String contextPath) throws Exception {
-        GenericValue layout = EntityUtil.getOnly(delegator.findByAndCache("WebslingerLayout", UtilMisc.toMap("hostName", hostName, "contextPath", contextPath)));
-        if (layout == null) return null;
-        return new OfbizLayout(layout);
-    }
-
-    protected class OfbizLayout implements Layout {
-        private final String contextPath;
-        private final String id;
-        private final String target;
-        private final String[] bases;
-        private final int hashCode;
-        protected final String delegatorName;
-        protected final String dispatcherName;
-
-        protected OfbizLayout(GenericValue server) throws GenericEntityException {
-            contextPath = server.getString("contextPath");
-            id = server.getString("webslingerServerId");
-            target = server.getString("target");
-            List<GenericValue> baseValues = server.getRelatedCache("WebslingerServerBase", UtilMisc.toList("seqNum"));
-            bases = new String[baseValues.size()];
-            for (int i = 0; i < bases.length; i++) {
-                GenericValue baseValue = baseValues.get(i);
-                bases[i] = baseValue.getString("baseName");
-            }
-            delegatorName = server.getString("delegatorName");
-            dispatcherName = server.getString("dispatcherName");
-            hashCode = target.hashCode() ^ ObjectUtil.hashCodeHelper(delegatorName) ^ Arrays.hashCode(bases);
-        }
-
-        public String getContextPath() {
-            return contextPath;
-        }
-
-        public String getId() {
-            return id;
-        }
-
-        public String getTarget() {
-            return target;
-        }
-
-        public String[] getBases() {
-            return bases;
-        }
-
-        @Override
-        public int hashCode() {
-            return hashCode;
-        }
-
-        @Override
-        public boolean equals(Object o) {
-            if (!(o instanceof OfbizLayout)) return false;
-            OfbizLayout other = (OfbizLayout) o;
-            if (!contextPath.equals(other.contextPath)) return false;
-            if (!target.equals(other.target)) return false;
-            if (!ObjectUtil.equalsHelper(delegatorName, other.delegatorName)) return false;
-            return Arrays.equals(bases, other.bases);
-        }
-    }
-}
+/*******************************************************************************
+ * 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.webslinger;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.DelegatorFactory;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.cache.Cache;
+import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.security.SecurityFactory;
+import org.ofbiz.security.authz.AuthorizationFactory;
+import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.GenericDispatcher;
+import org.ofbiz.service.ServiceDispatcher;
+import org.webslinger.AbstractMappingWebslingerServletContextFactory;
+import org.webslinger.WebslingerServletContext;
+import org.webslinger.collections.CollectionUtil;
+import org.webslinger.lang.ObjectUtil;
+
+public class WebslingerContextMapper extends AbstractMappingWebslingerServletContextFactory {
+    protected ServletContext servletContext;
+    protected Delegator delegator;
+    protected final ArrayList<URL> globalReaderURLs = new ArrayList<URL>();
+
+    public void init(ServletConfig config) throws ServletException, IOException {
+        System.err.println(org.webslinger.commons.vfs.flat.FlatFileProvider.class);
+        servletContext = config.getServletContext();
+        String delegatorName = servletContext.getInitParameter("entityDelegatorName");
+        delegator = DelegatorFactory.getDelegator(delegatorName);
+        String readerFiles = servletContext.getInitParameter("serviceReaderUrls");
+        if (readerFiles != null) {
+            for (String reader: CollectionUtil.split(readerFiles, ";")) {
+                URL url =  config.getServletContext().getResource(reader);
+                if (url != null) globalReaderURLs.add(url);
+            }
+        }
+        super.init(config, UtilProperties.getPropertyValue("webslinger.properties", "moduleBase"));
+    }
+
+    @Override
+    protected Layout[] getStartLayouts() throws Exception {
+        ArrayList<Layout> layouts = new ArrayList<Layout>();
+        try {
+            for (GenericValue value: delegator.findByAnd("WebslingerServer", UtilMisc.toMap("loadAtStart", "Y"))) {
+                layouts.add(new OfbizLayout(value));
+            }
+        } catch (GenericEntityException e) {
+        }
+        return layouts.toArray(new Layout[layouts.size()]);
+    }
+
+    @Override
+    public void initializeRequest(WebslingerServletContext context, HttpServletRequest request) {
+        request.setAttribute("servletContext", context);
+        Object delegator = context.getAttribute("delegator");
+        Object dispatcher = context.getAttribute("dispatcher");
+        Object authz = context.getAttribute("authz");
+        Object security = context.getAttribute("security");
+        request.setAttribute("delegator", delegator);
+        request.setAttribute("dispatcher", dispatcher);
+        request.setAttribute("authz", authz);
+        request.setAttribute("security", security);
+        // FIXME!!! These next two are a hack until proper fake/wrapped session support is done in webslinger
+        servletContext.setAttribute("delegator", delegator);
+        servletContext.setAttribute("dispatcher", dispatcher);
+        servletContext.setAttribute("authz", authz);
+        servletContext.setAttribute("security", security);
+    }
+
+    @Override
+    protected void initializeContext(WebslingerServletContext context, Layout layout) throws Exception {
+        OfbizLayout ofbizLayout = (OfbizLayout) layout;
+        Delegator delegator = null;
+        delegator = DelegatorFactory.getDelegator(ofbizLayout.delegatorName);
+        context.setAttribute("delegator", delegator);
+        context.setAttribute("dispatcher", new WebslingerGenericDispatcher(context, layout.getTarget(), delegator, globalReaderURLs));
+        context.setAttribute("authz", AuthorizationFactory.getInstance(delegator));
+        context.setAttribute("security", SecurityFactory.getInstance(delegator));
+    }
+
+    protected static final class WebslingerGenericDispatcher extends GenericDispatcher {
+        protected WebslingerGenericDispatcher(WebslingerServletContext context, String name, Delegator delegator, List<URL> globalReaderURLs) throws IOException {
+            ArrayList<URL> readerURLs = new ArrayList<URL>(globalReaderURLs);
+            String readerFiles = context.getInitParameter("serviceReaderUrls");
+            if (readerFiles != null) {
+                for (String reader: CollectionUtil.split(readerFiles, ";")) {
+                    URL url =  context.getResource(reader);
+                    if (url != null) readerURLs.add(url);
+                }
+            }
+            System.err.println(readerURLs);
+            this.dispatcher = new ServiceDispatcher(delegator, true, true, true) {
+            };
+            ClassLoader loader = null;
+            try {
+                loader = Thread.currentThread().getContextClassLoader();
+            } catch (SecurityException e) {
+                loader = WebslingerContextMapper.class.getClassLoader();
+            }
+            DispatchContext dc = new DispatchContext(name, readerURLs, loader, null);
+            init(name, delegator, dc);
+        }
+    }
+
+    @Override
+    protected Set<String> getSuffixes() throws Exception {
+        Cache cache = delegator.getCache();
+        Set<String> suffixes;
+        synchronized (WebslingerContextMapper.class) {
+            suffixes = cache.get("WebslingerHostSuffix", null, "WebslingerContextMapper.Suffixes");
+            if (suffixes == null) {
+                suffixes = new HashSet<String>();
+                for (GenericValue value: delegator.findList("WebslingerHostSuffix", null, null, null, null, false)) {
+                    suffixes.add(value.getString("hostSuffix"));
+                }
+                cache.put("WebslingerHostSuffix", null, "WebslingerContextMapper.Suffixes", suffixes);
+            }
+        }
+        return suffixes;
+    }
+
+    @Override
+    protected Layout lookupLayout(String hostName, String contextPath) throws Exception {
+        GenericValue layout = EntityUtil.getOnly(delegator.findByAndCache("WebslingerLayout", UtilMisc.toMap("hostName", hostName, "contextPath", contextPath)));
+        if (layout == null) return null;
+        return new OfbizLayout(layout);
+    }
+
+    protected class OfbizLayout implements Layout {
+        private final String contextPath;
+        private final String id;
+        private final String target;
+        private final String[] bases;
+        private final int hashCode;
+        protected final String delegatorName;
+        protected final String dispatcherName;
+
+        protected OfbizLayout(GenericValue server) throws GenericEntityException {
+            contextPath = server.getString("contextPath");
+            id = server.getString("webslingerServerId");
+            target = server.getString("target");
+            List<GenericValue> baseValues = server.getRelatedCache("WebslingerServerBase", UtilMisc.toList("seqNum"));
+            bases = new String[baseValues.size()];
+            for (int i = 0; i < bases.length; i++) {
+                GenericValue baseValue = baseValues.get(i);
+                bases[i] = baseValue.getString("baseName");
+            }
+            delegatorName = server.getString("delegatorName");
+            dispatcherName = server.getString("dispatcherName");
+            hashCode = target.hashCode() ^ ObjectUtil.hashCodeHelper(delegatorName) ^ Arrays.hashCode(bases);
+        }
+
+        public String getContextPath() {
+            return contextPath;
+        }
+
+        public String getId() {
+            return id;
+        }
+
+        public String getTarget() {
+            return target;
+        }
+
+        public String[] getBases() {
+            return bases;
+        }
+
+        @Override
+        public int hashCode() {
+            return hashCode;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (!(o instanceof OfbizLayout)) return false;
+            OfbizLayout other = (OfbizLayout) o;
+            if (!contextPath.equals(other.contextPath)) return false;
+            if (!target.equals(other.target)) return false;
+            if (!ObjectUtil.equalsHelper(delegatorName, other.delegatorName)) return false;
+            return Arrays.equals(bases, other.bases);
+        }
+    }
+}

Propchange: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerServerEngine.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerServerEngine.java?rev=1044202&r1=1044201&r2=1044202&view=diff
==============================================================================
--- ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerServerEngine.java (original)
+++ ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerServerEngine.java Fri Dec 10 02:40:02 2010
@@ -1,59 +1,59 @@
-/*******************************************************************************
- * 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.webslinger;
-
-import java.util.Map;
-
-import org.ofbiz.base.util.UtilGenerics;
-import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.entity.Delegator;
-import org.ofbiz.entity.GenericValue;
-import org.ofbiz.entity.util.EntityUtil;
-import org.ofbiz.service.GenericServiceException;
-import org.ofbiz.service.ModelService;
-import org.ofbiz.service.ServiceDispatcher;
-import org.ofbiz.service.engine.GenericAsyncEngine;
-import org.webslinger.WebslingerServletContext;
-
-public class WebslingerServerEngine extends GenericAsyncEngine {
-    public WebslingerServerEngine(ServiceDispatcher dispatcher) {
-        super(dispatcher);
-    }
-
-    @Override
-    public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException {
-        runSync(localName, modelService, context);
-    }
-
-    @Override
-    public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException {
-        Delegator delegator = dispatcher.getDelegator();
-        try {
-            GenericValue found = EntityUtil.getFirst(delegator.findByAndCache("WebslingerLayout", UtilMisc.toMap("webslingerServerId", modelService.location)));
-            if (found == null) throw new GenericServiceException("Couldn't find server mapping for(" + modelService.location + ")");
-            return UtilGenerics.checkMap(WebslingerServletContext.invokeInVM(found.getString("hostName"), 8080, modelService.invoke, context));
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (GenericServiceException e) {
-            throw e;
-        } catch (Exception e) {
-            throw UtilMisc.initCause(new GenericServiceException(e.getMessage()), e);
-        }
-    }
-}
+/*******************************************************************************
+ * 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.webslinger;
+
+import java.util.Map;
+
+import org.ofbiz.base.util.UtilGenerics;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.service.GenericServiceException;
+import org.ofbiz.service.ModelService;
+import org.ofbiz.service.ServiceDispatcher;
+import org.ofbiz.service.engine.GenericAsyncEngine;
+import org.webslinger.WebslingerServletContext;
+
+public class WebslingerServerEngine extends GenericAsyncEngine {
+    public WebslingerServerEngine(ServiceDispatcher dispatcher) {
+        super(dispatcher);
+    }
+
+    @Override
+    public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException {
+        runSync(localName, modelService, context);
+    }
+
+    @Override
+    public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException {
+        Delegator delegator = dispatcher.getDelegator();
+        try {
+            GenericValue found = EntityUtil.getFirst(delegator.findByAndCache("WebslingerLayout", UtilMisc.toMap("webslingerServerId", modelService.location)));
+            if (found == null) throw new GenericServiceException("Couldn't find server mapping for(" + modelService.location + ")");
+            return UtilGenerics.checkMap(WebslingerServletContext.invokeInVM(found.getString("hostName"), 8080, modelService.invoke, context));
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (GenericServiceException e) {
+            throw e;
+        } catch (Exception e) {
+            throw UtilMisc.initCause(new GenericServiceException(e.getMessage()), e);
+        }
+    }
+}

Propchange: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerServerEngine.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/PortalPageWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/PortalPageWorker.java?rev=1044202&r1=1044201&r2=1044202&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/PortalPageWorker.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/PortalPageWorker.java Fri Dec 10 02:40:02 2010
@@ -1,177 +1,177 @@
-/*******************************************************************************
- * 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.widget;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.util.GeneralException;
-import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.entity.Delegator;
-import org.ofbiz.entity.GenericValue;
-import org.ofbiz.entity.GenericEntityException;
-import org.ofbiz.entity.condition.EntityCondition;
-import org.ofbiz.entity.condition.EntityOperator;
-import org.ofbiz.entity.util.EntityUtil;
-import org.ofbiz.service.DispatchContext;
-import org.ofbiz.service.ServiceUtil;
-import org.ofbiz.security.authz.Authorization;
-
-/**
- * PortalPageWorker Class
- */
-public class PortalPageWorker {
-
-    public static final String module = PortalPageWorker.class.getName();
-
-    public PortalPageWorker() { }
-
-    public String renderPortalPageAsTextExt(Delegator delegator, String portalPageId, Map<String, Object> templateContext,
-            boolean cache) throws GeneralException, IOException {
-        return "success";
-    }
-
-    /**
-    * Returns a list of PortalPages that have the specified parentPortalPageId as parent.
-    * If a specific PortalPage exists for the current userLogin it is returned instead of the original one.
-    */
-    public static List<GenericValue> getPortalPages(String parentPortalPageId, Map<String, Object> context) {
-        List<GenericValue> portalPages = null;
-        if (UtilValidate.isNotEmpty(parentPortalPageId)) {
-            Delegator delegator = WidgetWorker.getDelegator(context);
-            try {
-                // first get public pages
-                EntityCondition cond =
-                    EntityCondition.makeCondition(UtilMisc.toList(
-                        EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, "_NA_"),
-                        EntityCondition.makeCondition(UtilMisc.toList(
-                                EntityCondition.makeCondition("portalPageId", EntityOperator.EQUALS, parentPortalPageId),
-                                EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, parentPortalPageId)),
-                                EntityOperator.OR)),
-                        EntityOperator.AND);
-                portalPages = delegator.findList("PortalPage", cond, null, null, null, false);
-                if (UtilValidate.isNotEmpty(context.get("userLogin"))) { // check if a user is logged in
-                    String userLoginId = ((GenericValue)context.get("userLogin")).getString("userLoginId");
-                    // replace with private pages
-                    for (GenericValue portalPage : portalPages) {
-                        cond = EntityCondition.makeCondition(UtilMisc.toList(
-                                EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId),
-                                EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, portalPage.getString("portalPageId"))),
-                                EntityOperator.AND);
-                        List <GenericValue> privatePortalPages = delegator.findList("PortalPage", cond, null, null, null, false);
-                        if (UtilValidate.isNotEmpty(privatePortalPages)) {
-                            portalPages.remove(portalPage);
-                            portalPages.add(privatePortalPages.get(0));
-                        }
-                    }
-                    // add any other created private pages
-                    cond = EntityCondition.makeCondition(UtilMisc.toList(
-                            EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId),
-                            EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, null),
-                            EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, parentPortalPageId)),
-                            EntityOperator.AND);
-                    portalPages.addAll(delegator.findList("PortalPage", cond, null, null, null, false));
-                }
-                portalPages = EntityUtil.orderBy(portalPages, UtilMisc.toList("sequenceNum"));
-            } catch (GenericEntityException e) {
-                Debug.logError("Could not retrieve portalpages:" + e.getMessage(), module);
-            }
-        }
-        return portalPages;
-    }
-
-    /**
-    * Returns the PortalPage with the specified portalPageId.
-    * If a specific PortalPage exists for the current userLogin it is returned instead of the original one.
-    */
-    public static GenericValue getPortalPage(String portalPageId, Map<String, Object> context) {
-        GenericValue portalPage = null;
-        if (UtilValidate.isNotEmpty(portalPageId)) {
-            Delegator delegator = WidgetWorker.getDelegator(context);
-            try {
-                // Get the current userLoginId
-                String userLoginId = "_NA_";
-                if (UtilValidate.isNotEmpty(context.get("userLogin"))) { // check if a user is logged in
-                    userLoginId = ((GenericValue)context.get("userLogin")).getString("userLoginId");
-                }
-                
-                // Get the PortalPage ensuring that it is either owned by the user or a system page
-                EntityCondition cond = EntityCondition.makeCondition(UtilMisc.toList(
-                    EntityCondition.makeCondition("portalPageId", EntityOperator.EQUALS, portalPageId),
-                    EntityCondition.makeCondition(UtilMisc.toList(
-                        EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, "_NA_"),
-                        EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId)),
-                        EntityOperator.OR)),
-                    EntityOperator.AND);
-                List <GenericValue> portalPages = delegator.findList("PortalPage", cond, null, null, null, false);
-                if (UtilValidate.isNotEmpty(portalPages)) {
-                    portalPage = EntityUtil.getFirst(portalPages);
-                }
-                
-                // If a derived PortalPage private to the user exists, returns this instead of the system one
-                cond = EntityCondition.makeCondition(UtilMisc.toList(
-                        EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, portalPageId),
-                        EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId)),
-                        EntityOperator.AND);
-                List <GenericValue> privateDerivedPortalPages = delegator.findList("PortalPage", cond, null, null, null, false);
-                if (UtilValidate.isNotEmpty(privateDerivedPortalPages)) {
-                    portalPage = EntityUtil.getFirst(privateDerivedPortalPages);
-                }
-            } catch (GenericEntityException e) {
-                Debug.logError("Could not retrieve portalpage:" + e.getMessage(), module);
-            }
-        }
-        return portalPage;
-    }
-
-    /**
-    * Checks if the user is allowed to configure the PortalPage.
-    * PortalPage configuration is allowed if he is the PortalPage owner or he has got the PORTALPAGE_ADMIN permission
-    */  
-    public static Boolean userIsAllowedToConfigure(String portalPageId, Map<String, Object> context) {
-        Boolean userIsAllowed = false;
-
-        if (UtilValidate.isNotEmpty(portalPageId)) {
-            GenericValue userLogin = (GenericValue) context.get("userLogin");
-            if (UtilValidate.isNotEmpty(userLogin)) {
-                String userLoginId = (String) userLogin.get("userLoginId");
-                Authorization authz = (Authorization) context.get("authz");
-
-                Boolean hasPortalAdminPermission = authz.hasPermission(userLoginId, "PORTALPAGE_ADMIN", context);
-                try {
-                    Delegator delegator = WidgetWorker.getDelegator(context);
-                    GenericValue portalPage = delegator.findOne("PortalPage", UtilMisc.toMap("portalPageId", portalPageId),false);
-
-                    if (UtilValidate.isNotEmpty(portalPage)) {
-                        String ownerUserLoginId = (String) portalPage.get("ownerUserLoginId");
-                        // Users with PORTALPAGE_ADMIN permission can configure every Portal Page
-                        userIsAllowed = (ownerUserLoginId.equals(userLoginId) || hasPortalAdminPermission);
-                    }
-                } catch (GenericEntityException e) {
-                    return false;
-                }
-            }
-        }
-
-        return userIsAllowed;      
-    }
-    
-}
+/*******************************************************************************
+ * 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.widget;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.condition.EntityCondition;
+import org.ofbiz.entity.condition.EntityOperator;
+import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.ServiceUtil;
+import org.ofbiz.security.authz.Authorization;
+
+/**
+ * PortalPageWorker Class
+ */
+public class PortalPageWorker {
+
+    public static final String module = PortalPageWorker.class.getName();
+
+    public PortalPageWorker() { }
+
+    public String renderPortalPageAsTextExt(Delegator delegator, String portalPageId, Map<String, Object> templateContext,
+            boolean cache) throws GeneralException, IOException {
+        return "success";
+    }
+
+    /**
+    * Returns a list of PortalPages that have the specified parentPortalPageId as parent.
+    * If a specific PortalPage exists for the current userLogin it is returned instead of the original one.
+    */
+    public static List<GenericValue> getPortalPages(String parentPortalPageId, Map<String, Object> context) {
+        List<GenericValue> portalPages = null;
+        if (UtilValidate.isNotEmpty(parentPortalPageId)) {
+            Delegator delegator = WidgetWorker.getDelegator(context);
+            try {
+                // first get public pages
+                EntityCondition cond =
+                    EntityCondition.makeCondition(UtilMisc.toList(
+                        EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, "_NA_"),
+                        EntityCondition.makeCondition(UtilMisc.toList(
+                                EntityCondition.makeCondition("portalPageId", EntityOperator.EQUALS, parentPortalPageId),
+                                EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, parentPortalPageId)),
+                                EntityOperator.OR)),
+                        EntityOperator.AND);
+                portalPages = delegator.findList("PortalPage", cond, null, null, null, false);
+                if (UtilValidate.isNotEmpty(context.get("userLogin"))) { // check if a user is logged in
+                    String userLoginId = ((GenericValue)context.get("userLogin")).getString("userLoginId");
+                    // replace with private pages
+                    for (GenericValue portalPage : portalPages) {
+                        cond = EntityCondition.makeCondition(UtilMisc.toList(
+                                EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId),
+                                EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, portalPage.getString("portalPageId"))),
+                                EntityOperator.AND);
+                        List <GenericValue> privatePortalPages = delegator.findList("PortalPage", cond, null, null, null, false);
+                        if (UtilValidate.isNotEmpty(privatePortalPages)) {
+                            portalPages.remove(portalPage);
+                            portalPages.add(privatePortalPages.get(0));
+                        }
+                    }
+                    // add any other created private pages
+                    cond = EntityCondition.makeCondition(UtilMisc.toList(
+                            EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId),
+                            EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, null),
+                            EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, parentPortalPageId)),
+                            EntityOperator.AND);
+                    portalPages.addAll(delegator.findList("PortalPage", cond, null, null, null, false));
+                }
+                portalPages = EntityUtil.orderBy(portalPages, UtilMisc.toList("sequenceNum"));
+            } catch (GenericEntityException e) {
+                Debug.logError("Could not retrieve portalpages:" + e.getMessage(), module);
+            }
+        }
+        return portalPages;
+    }
+
+    /**
+    * Returns the PortalPage with the specified portalPageId.
+    * If a specific PortalPage exists for the current userLogin it is returned instead of the original one.
+    */
+    public static GenericValue getPortalPage(String portalPageId, Map<String, Object> context) {
+        GenericValue portalPage = null;
+        if (UtilValidate.isNotEmpty(portalPageId)) {
+            Delegator delegator = WidgetWorker.getDelegator(context);
+            try {
+                // Get the current userLoginId
+                String userLoginId = "_NA_";
+                if (UtilValidate.isNotEmpty(context.get("userLogin"))) { // check if a user is logged in
+                    userLoginId = ((GenericValue)context.get("userLogin")).getString("userLoginId");
+                }
+                
+                // Get the PortalPage ensuring that it is either owned by the user or a system page
+                EntityCondition cond = EntityCondition.makeCondition(UtilMisc.toList(
+                    EntityCondition.makeCondition("portalPageId", EntityOperator.EQUALS, portalPageId),
+                    EntityCondition.makeCondition(UtilMisc.toList(
+                        EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, "_NA_"),
+                        EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId)),
+                        EntityOperator.OR)),
+                    EntityOperator.AND);
+                List <GenericValue> portalPages = delegator.findList("PortalPage", cond, null, null, null, false);
+                if (UtilValidate.isNotEmpty(portalPages)) {
+                    portalPage = EntityUtil.getFirst(portalPages);
+                }
+                
+                // If a derived PortalPage private to the user exists, returns this instead of the system one
+                cond = EntityCondition.makeCondition(UtilMisc.toList(
+                        EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, portalPageId),
+                        EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId)),
+                        EntityOperator.AND);
+                List <GenericValue> privateDerivedPortalPages = delegator.findList("PortalPage", cond, null, null, null, false);
+                if (UtilValidate.isNotEmpty(privateDerivedPortalPages)) {
+                    portalPage = EntityUtil.getFirst(privateDerivedPortalPages);
+                }
+            } catch (GenericEntityException e) {
+                Debug.logError("Could not retrieve portalpage:" + e.getMessage(), module);
+            }
+        }
+        return portalPage;
+    }
+
+    /**
+    * Checks if the user is allowed to configure the PortalPage.
+    * PortalPage configuration is allowed if he is the PortalPage owner or he has got the PORTALPAGE_ADMIN permission
+    */  
+    public static Boolean userIsAllowedToConfigure(String portalPageId, Map<String, Object> context) {
+        Boolean userIsAllowed = false;
+
+        if (UtilValidate.isNotEmpty(portalPageId)) {
+            GenericValue userLogin = (GenericValue) context.get("userLogin");
+            if (UtilValidate.isNotEmpty(userLogin)) {
+                String userLoginId = (String) userLogin.get("userLoginId");
+                Authorization authz = (Authorization) context.get("authz");
+
+                Boolean hasPortalAdminPermission = authz.hasPermission(userLoginId, "PORTALPAGE_ADMIN", context);
+                try {
+                    Delegator delegator = WidgetWorker.getDelegator(context);
+                    GenericValue portalPage = delegator.findOne("PortalPage", UtilMisc.toMap("portalPageId", portalPageId),false);
+
+                    if (UtilValidate.isNotEmpty(portalPage)) {
+                        String ownerUserLoginId = (String) portalPage.get("ownerUserLoginId");
+                        // Users with PORTALPAGE_ADMIN permission can configure every Portal Page
+                        userIsAllowed = (ownerUserLoginId.equals(userLoginId) || hasPortalAdminPermission);
+                    }
+                } catch (GenericEntityException e) {
+                    return false;
+                }
+            }
+        }
+
+        return userIsAllowed;      
+    }
+    
+}

Propchange: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/PortalPageWorker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/PortalPageWorkerInterface.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/PortalPageWorkerInterface.java?rev=1044202&r1=1044201&r2=1044202&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/PortalPageWorkerInterface.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/PortalPageWorkerInterface.java Fri Dec 10 02:40:02 2010
@@ -1,33 +1,33 @@
-/*******************************************************************************
- * 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.widget;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.ofbiz.base.util.GeneralException;
-import org.ofbiz.entity.Delegator;
-
-/**
- * PortalPageWorkerInterface
- */
-public interface PortalPageWorkerInterface {
-    public String renderPortalPageAsTextExt(Delegator delegator, String portalPageId, Map<String, Object> templateContext,
-            boolean cache) throws GeneralException, IOException;
-}
+/*******************************************************************************
+ * 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.widget;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.entity.Delegator;
+
+/**
+ * PortalPageWorkerInterface
+ */
+public interface PortalPageWorkerInterface {
+    public String renderPortalPageAsTextExt(Delegator delegator, String portalPageId, Map<String, Object> templateContext,
+            boolean cache) throws GeneralException, IOException;
+}

Propchange: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/PortalPageWorkerInterface.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetPortalPageWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetPortalPageWorker.java?rev=1044202&r1=1044201&r2=1044202&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetPortalPageWorker.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetPortalPageWorker.java Fri Dec 10 02:40:02 2010
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * 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.widget;
-import org.ofbiz.base.util.Debug;
-
-/**
- * PortalPageWorker Class
- */
-public class WidgetPortalPageWorker {
-    public static final String module = WidgetPortalPageWorker.class.getName();
-    public static PortalPageWorkerInterface portalPageWorker = null;
-    static {
-        try {
-            ClassLoader loader = Thread.currentThread().getContextClassLoader();
-            // note: loadClass is necessary for these since this class doesn't know anything about them at compile time
-            portalPageWorker = (PortalPageWorkerInterface) loader.loadClass("org.ofbiz.widget.PortalPageWorker").newInstance();
-        } catch (ClassNotFoundException e) {
-            Debug.logError(e, "Could not pre-initialize dynamically loaded class: ", module);
-        } catch (IllegalAccessException e) {
-            Debug.logError(e, "Could not pre-initialize dynamically loaded class: ", module);
-        } catch (InstantiationException e) {
-            Debug.logError(e, "Could not pre-initialize dynamically loaded class: ", module);
-        }
-    }
-}
+/*******************************************************************************
+ * 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.widget;
+import org.ofbiz.base.util.Debug;
+
+/**
+ * PortalPageWorker Class
+ */
+public class WidgetPortalPageWorker {
+    public static final String module = WidgetPortalPageWorker.class.getName();
+    public static PortalPageWorkerInterface portalPageWorker = null;
+    static {
+        try {
+            ClassLoader loader = Thread.currentThread().getContextClassLoader();
+            // note: loadClass is necessary for these since this class doesn't know anything about them at compile time
+            portalPageWorker = (PortalPageWorkerInterface) loader.loadClass("org.ofbiz.widget.PortalPageWorker").newInstance();
+        } catch (ClassNotFoundException e) {
+            Debug.logError(e, "Could not pre-initialize dynamically loaded class: ", module);
+        } catch (IllegalAccessException e) {
+            Debug.logError(e, "Could not pre-initialize dynamically loaded class: ", module);
+        } catch (InstantiationException e) {
+            Debug.logError(e, "Could not pre-initialize dynamically loaded class: ", module);
+        }
+    }
+}

Propchange: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetPortalPageWorker.java
------------------------------------------------------------------------------
    svn:eol-style = native