svn commit: r628703 - in /ofbiz/trunk/framework: entity/src/org/ofbiz/entity/model/ entityext/src/org/ofbiz/entityext/eca/ webtools/src/org/ofbiz/webtools/artifactinfo/ widget/src/org/ofbiz/widget/form/

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

svn commit: r628703 - in /ofbiz/trunk/framework: entity/src/org/ofbiz/entity/model/ entityext/src/org/ofbiz/entityext/eca/ webtools/src/org/ofbiz/webtools/artifactinfo/ widget/src/org/ofbiz/widget/form/

jonesde
Author: jonesde
Date: Mon Feb 18 04:34:08 2008
New Revision: 628703

URL: http://svn.apache.org/viewvc?rev=628703&view=rev
Log:
Fixed tabs to spaces; it is evil that eclipse comes with this sort of default...

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java
    ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java?rev=628703&r1=628702&r2=628703&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java Mon Feb 18 04:34:08 2008
@@ -649,16 +649,16 @@
     }
 
     public List<ModelRelation> getRelationsList(boolean includeOne, boolean includeOneNoFk, boolean includeMany) {
-     List<ModelRelation> relationsList = FastList.newInstance();
-     Iterator<ModelRelation> allIter = this.getRelationsIterator();
+        List<ModelRelation> relationsList = FastList.newInstance();
+        Iterator<ModelRelation> allIter = this.getRelationsIterator();
         while (allIter.hasNext()) {
             ModelRelation modelRelation = allIter.next();
             if (includeOne && "one".equals(modelRelation.getType())) {
-             relationsList.add(modelRelation);
+                relationsList.add(modelRelation);
             } else if (includeOneNoFk && "one-nofk".equals(modelRelation.getType())) {
-             relationsList.add(modelRelation);
+                relationsList.add(modelRelation);
             } else if (includeMany && "many".equals(modelRelation.getType())) {
-             relationsList.add(modelRelation);
+                relationsList.add(modelRelation);
             }
         }
         return relationsList;

Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java?rev=628703&r1=628702&r2=628703&view=diff
==============================================================================
--- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java (original)
+++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java Mon Feb 18 04:34:08 2008
@@ -51,7 +51,7 @@
     public static UtilCache entityEcaReaders = new UtilCache("entity.EcaReaders", 0, 0, false);
 
     public static Map<String, Map<String, List<EntityEcaRule>>> getEntityEcaCache(String entityEcaReaderName) {
-     Map<String, Map<String, List<EntityEcaRule>>> ecaCache = (Map) entityEcaReaders.get(entityEcaReaderName);
+        Map<String, Map<String, List<EntityEcaRule>>> ecaCache = (Map) entityEcaReaders.get(entityEcaReaderName);
         if (ecaCache == null) {
             synchronized (EntityEcaUtil.class) {
                 ecaCache = (Map) entityEcaReaders.get(entityEcaReaderName);

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java?rev=628703&r1=628702&r2=628703&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java Mon Feb 18 04:34:08 2008
@@ -47,193 +47,193 @@
  */
 public class ArtifactInfoFactory {
 
- static public class ArtifactInfoContext {
- protected String delegatorName;
- protected ModelReader entityModelReader;
+    static public class ArtifactInfoContext {
+        protected String delegatorName;
+        protected ModelReader entityModelReader;
         protected DispatchContext dispatchContext;
         protected Map<String, Map<String, List<EntityEcaRule>>> entityEcaCache;
         protected Map<String, Map<String, List<ServiceEcaRule>>> serviceEcaCache;
         
         public ArtifactInfoContext(String delegatorName) throws GenericEntityException {
-         this.delegatorName = delegatorName;
- this.entityModelReader = ModelReader.getModelReader(delegatorName);
- this.dispatchContext = new DispatchContext("ArtifactInfoDispCtx", null, this.getClass().getClassLoader(), null);
- this.entityEcaCache = EntityEcaUtil.getEntityEcaCache(EntityEcaUtil.getEntityEcaReaderName(delegatorName));
- this.serviceEcaCache = ServiceEcaUtil.ecaCache;
+            this.delegatorName = delegatorName;
+            this.entityModelReader = ModelReader.getModelReader(delegatorName);
+            this.dispatchContext = new DispatchContext("ArtifactInfoDispCtx", null, this.getClass().getClassLoader(), null);
+            this.entityEcaCache = EntityEcaUtil.getEntityEcaCache(EntityEcaUtil.getEntityEcaReaderName(delegatorName));
+            this.serviceEcaCache = ServiceEcaUtil.ecaCache;
         }
         
         public ModelReader getEntityModelReader() {
-         return this.entityModelReader;
+            return this.entityModelReader;
         }
         
         public DispatchContext getDispatchContext() {
-         return this.dispatchContext;
+            return this.dispatchContext;
         }
         
         public ModelEntity getModelEntity(String entityName) throws GenericEntityException {
-         return this.getEntityModelReader().getModelEntity(entityName);
+            return this.getEntityModelReader().getModelEntity(entityName);
         }
         
         public ModelService getModelService(String serviceName) throws GenericServiceException {
-         return this.getDispatchContext().getModelService(serviceName);
+            return this.getDispatchContext().getModelService(serviceName);
         }
         
         public ModelForm getModelForm(String formName, String formLocation) throws ParserConfigurationException, SAXException, IOException {
-         return FormFactory.getFormFromLocation(formLocation, formName, this.entityModelReader, this.dispatchContext);
+            return FormFactory.getFormFromLocation(formLocation, formName, this.entityModelReader, this.dispatchContext);
         }
         
         public ModelScreen getModelScreen(String screenName, String screenLocation) throws ParserConfigurationException, SAXException, IOException {
-         return ScreenFactory.getScreenFromLocation(screenLocation, screenName);
+            return ScreenFactory.getScreenFromLocation(screenLocation, screenName);
+        }
+    }
+    
+    static public class EntityInfo {
+        protected ArtifactInfoContext aic;
+        protected ModelEntity modelEntity;
+        
+        public EntityInfo(String entityName, ArtifactInfoContext aic) throws GenericEntityException {
+            this.aic = aic;
+            this.modelEntity = this.aic.getModelEntity(entityName);
+        }
+        
+        public List<ModelEntity> getEntitiesRelatedOne() {
+            List<ModelEntity> entityList = FastList.newInstance();
+            // TODO: implement this
+            return entityList;
         }
- }
-
- static public class EntityInfo {
- protected ArtifactInfoContext aic;
- protected ModelEntity modelEntity;
-
- public EntityInfo(String entityName, ArtifactInfoContext aic) throws GenericEntityException {
- this.aic = aic;
- this.modelEntity = this.aic.getModelEntity(entityName);
- }
-
- public List<ModelEntity> getEntitiesRelatedOne() {
- List<ModelEntity> entityList = FastList.newInstance();
- // TODO: implement this
- return entityList;
- }
 
- public List<ModelEntity> getEntitiesRelatedMany() {
- List<ModelEntity> entityList = FastList.newInstance();
- // TODO: implement this
- return entityList;
- }
-
- /** Get the Services that use this Entity */
- public List<ModelService> getServicesUsingEntity() {
- List<ModelService> serviceList = FastList.newInstance();
- // TODO: implement this
- return serviceList;
- }
-
- /** Get the Services called by Entity ECA */
- public List<ModelService> getServicesCalledByEntityEca() {
- List<ModelService> serviceList = FastList.newInstance();
- // TODO: implement this
- return serviceList;
- }
-
- public List<EntityEcaRule> getEntityEcaRules() {
- List<EntityEcaRule> eecaList = FastList.newInstance();
- // TODO: implement this
- return eecaList;
- }
-
- public List<ModelForm> getFormsUsingEntity() {
- List<ModelForm> formList = FastList.newInstance();
- // TODO: implement this
- return formList;
- }
-
- public List<ModelScreen> getScreensUsingEntity() {
- List<ModelScreen> screenList = FastList.newInstance();
- // TODO: implement this
- return screenList;
- }
- }
+        public List<ModelEntity> getEntitiesRelatedMany() {
+            List<ModelEntity> entityList = FastList.newInstance();
+            // TODO: implement this
+            return entityList;
+        }
+        
+        /** Get the Services that use this Entity */
+        public List<ModelService> getServicesUsingEntity() {
+            List<ModelService> serviceList = FastList.newInstance();
+            // TODO: implement this
+            return serviceList;
+        }
+        
+        /** Get the Services called by Entity ECA */
+        public List<ModelService> getServicesCalledByEntityEca() {
+            List<ModelService> serviceList = FastList.newInstance();
+            // TODO: implement this
+            return serviceList;
+        }
+        
+        public List<EntityEcaRule> getEntityEcaRules() {
+            List<EntityEcaRule> eecaList = FastList.newInstance();
+            // TODO: implement this
+            return eecaList;
+        }
+        
+        public List<ModelForm> getFormsUsingEntity() {
+            List<ModelForm> formList = FastList.newInstance();
+            // TODO: implement this
+            return formList;
+        }
+        
+        public List<ModelScreen> getScreensUsingEntity() {
+            List<ModelScreen> screenList = FastList.newInstance();
+            // TODO: implement this
+            return screenList;
+        }
+    }
 
- static public class ServiceInfo {
- protected ArtifactInfoContext aic;
- protected ModelService modelService;
-
- public ServiceInfo(String serviceName, ArtifactInfoContext aic) throws GenericServiceException {
- this.aic = aic;
- this.modelService = this.aic.getModelService(serviceName);
- }
-
- public List<ModelEntity> getEntitiesUsedByService() {
- List<ModelEntity> entityList = FastList.newInstance();
- // TODO: implement this
- return entityList;
- }
-
- public List<ModelService> getServicesCallingService() {
- List<ModelService> serviceList = FastList.newInstance();
- // TODO: implement this
- return serviceList;
- }
-
- public List<ModelService> getServicesCalledByService() {
- List<ModelService> serviceList = FastList.newInstance();
- // TODO: implement this
- return serviceList;
- }
-
- public List<ModelService> getServicesCalledByServiceEca() {
- List<ModelService> serviceList = FastList.newInstance();
- // TODO: implement this
- return serviceList;
- }
-
- public List<ServiceEcaRule> getServiceEcaRulesTriggeredByService() {
- List<ServiceEcaRule> secaList = FastList.newInstance();
- // TODO: implement this
- return secaList;
- }
-
- public List<ModelService> getServicesCallingServiceByEca() {
- List<ModelService> serviceList = FastList.newInstance();
- // TODO: implement this
- return serviceList;
- }
-
- public List<ServiceEcaRule> getServiceEcaRulesCallingService() {
- List<ServiceEcaRule> secaList = FastList.newInstance();
- // TODO: implement this
- return secaList;
- }
-
- public List<ModelForm> getFormsCallingService() {
- List<ModelForm> formList = FastList.newInstance();
- // TODO: implement this
- return formList;
- }
-
- public List<ModelForm> getFormsBasedOnService() {
- List<ModelForm> formList = FastList.newInstance();
- // TODO: implement this
- return formList;
- }
-
- public List<ModelScreen> getScreensCallingService() {
- List<ModelScreen> screenList = FastList.newInstance();
- // TODO: implement this
- return screenList;
- }
-
- public List<ModelScreen> getRequestsWithEventCallingService() {
- List<ModelScreen> screenList = FastList.newInstance();
- // TODO: implement this
- return screenList;
- }
- }
+    static public class ServiceInfo {
+        protected ArtifactInfoContext aic;
+        protected ModelService modelService;
+        
+        public ServiceInfo(String serviceName, ArtifactInfoContext aic) throws GenericServiceException {
+            this.aic = aic;
+            this.modelService = this.aic.getModelService(serviceName);
+        }
+        
+        public List<ModelEntity> getEntitiesUsedByService() {
+            List<ModelEntity> entityList = FastList.newInstance();
+            // TODO: implement this
+            return entityList;
+        }
+        
+        public List<ModelService> getServicesCallingService() {
+            List<ModelService> serviceList = FastList.newInstance();
+            // TODO: implement this
+            return serviceList;
+        }
+        
+        public List<ModelService> getServicesCalledByService() {
+            List<ModelService> serviceList = FastList.newInstance();
+            // TODO: implement this
+            return serviceList;
+        }
+        
+        public List<ModelService> getServicesCalledByServiceEca() {
+            List<ModelService> serviceList = FastList.newInstance();
+            // TODO: implement this
+            return serviceList;
+        }
+        
+        public List<ServiceEcaRule> getServiceEcaRulesTriggeredByService() {
+            List<ServiceEcaRule> secaList = FastList.newInstance();
+            // TODO: implement this
+            return secaList;
+        }
+        
+        public List<ModelService> getServicesCallingServiceByEca() {
+            List<ModelService> serviceList = FastList.newInstance();
+            // TODO: implement this
+            return serviceList;
+        }
+        
+        public List<ServiceEcaRule> getServiceEcaRulesCallingService() {
+            List<ServiceEcaRule> secaList = FastList.newInstance();
+            // TODO: implement this
+            return secaList;
+        }
+        
+        public List<ModelForm> getFormsCallingService() {
+            List<ModelForm> formList = FastList.newInstance();
+            // TODO: implement this
+            return formList;
+        }
+        
+        public List<ModelForm> getFormsBasedOnService() {
+            List<ModelForm> formList = FastList.newInstance();
+            // TODO: implement this
+            return formList;
+        }
+        
+        public List<ModelScreen> getScreensCallingService() {
+            List<ModelScreen> screenList = FastList.newInstance();
+            // TODO: implement this
+            return screenList;
+        }
+        
+        public List<ModelScreen> getRequestsWithEventCallingService() {
+            List<ModelScreen> screenList = FastList.newInstance();
+            // TODO: implement this
+            return screenList;
+        }
+    }
 
- static public class FormInfo {
- protected ArtifactInfoContext aic;
- protected ModelForm modelForm;
-
- public FormInfo(String formName, String formLocation, ArtifactInfoContext aic) throws ParserConfigurationException, SAXException, IOException {
- this.aic = aic;
+    static public class FormInfo {
+        protected ArtifactInfoContext aic;
+        protected ModelForm modelForm;
+        
+        public FormInfo(String formName, String formLocation, ArtifactInfoContext aic) throws ParserConfigurationException, SAXException, IOException {
+            this.aic = aic;
             this.modelForm = aic.getModelForm(formName, formLocation);
- }
- }
+        }
+    }        
 
- static public class ScreenInfo {
- protected ArtifactInfoContext aic;
- protected ModelScreen modelScreen;
-
- public ScreenInfo(String screenName, String screenLocation, ArtifactInfoContext aic) throws ParserConfigurationException, SAXException, IOException {
- this.aic = aic;
+    static public class ScreenInfo {
+        protected ArtifactInfoContext aic;
+        protected ModelScreen modelScreen;
+        
+        public ScreenInfo(String screenName, String screenLocation, ArtifactInfoContext aic) throws ParserConfigurationException, SAXException, IOException {
+            this.aic = aic;
             this.modelScreen = aic.getModelScreen(screenName, screenLocation);
- }
- }
+        }
+    }
 }

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?rev=628703&r1=628702&r2=628703&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Mon Feb 18 04:34:08 2008
@@ -69,7 +69,7 @@
     public static final String module = ModelForm.class.getName();
     public static final String DEFAULT_FORM_RESULT_LIST_NAME = "defaultFormResultList";
 
- protected ModelReader entityModelReader;
+    protected ModelReader entityModelReader;
     protected DispatchContext dispatchContext;
 
     protected String formLocation;
@@ -609,24 +609,24 @@
             if (modelParam.formDisplay) {
                 if (UtilValidate.isNotEmpty(modelParam.entityName) && UtilValidate.isNotEmpty(modelParam.fieldName)) {
                     ModelEntity modelEntity;
- try {
- modelEntity = this.entityModelReader.getModelEntity(modelParam.entityName);
-                    if (modelEntity != null) {
-                        ModelField modelField = modelEntity.getField(modelParam.fieldName);
-                        if (modelField != null) {
-                            // okay, populate using the entity field info...
-                            ModelFormField modelFormField = this.addFieldFromEntityField(modelEntity, modelField, autoFieldsService.defaultFieldType, autoFieldsService.defaultPosition);
-                            if (UtilValidate.isNotEmpty(autoFieldsService.mapName)) {
-                                modelFormField.setMapName(autoFieldsService.mapName);
-                            }
-                            modelFormField.setRequiredField(!modelParam.optional);
-                            // continue to skip creating based on service param
-                            continue;
-                        }
-                    }
- } catch (GenericEntityException e) {
- Debug.logError(e, module);
- }
+                    try {
+                        modelEntity = this.entityModelReader.getModelEntity(modelParam.entityName);
+                        if (modelEntity != null) {
+                            ModelField modelField = modelEntity.getField(modelParam.fieldName);
+                            if (modelField != null) {
+                                // okay, populate using the entity field info...
+                                ModelFormField modelFormField = this.addFieldFromEntityField(modelEntity, modelField, autoFieldsService.defaultFieldType, autoFieldsService.defaultPosition);
+                                if (UtilValidate.isNotEmpty(autoFieldsService.mapName)) {
+                                    modelFormField.setMapName(autoFieldsService.mapName);
+                                }
+                                modelFormField.setRequiredField(!modelParam.optional);
+                                // continue to skip creating based on service param
+                                continue;
+                            }
+                        }
+                    } catch (GenericEntityException e) {
+                        Debug.logError(e, module);
+                    }
                 }
 
                 ModelFormField modelFormField = this.addFieldFromServiceParam(modelService, modelParam, autoFieldsService.defaultFieldType, autoFieldsService.defaultPosition);
@@ -654,11 +654,11 @@
         autoFieldsEntities.add(autoFieldsEntity);
         // read entity def and auto-create fields
         ModelEntity modelEntity = null;
- try {
- modelEntity = this.entityModelReader.getModelEntity(autoFieldsEntity.entityName);
- } catch (GenericEntityException e) {
- Debug.logError(e, module);
- }
+        try {
+            modelEntity = this.entityModelReader.getModelEntity(autoFieldsEntity.entityName);
+        } catch (GenericEntityException e) {
+            Debug.logError(e, module);
+        }
         if (modelEntity == null) {
             throw new IllegalArgumentException("Error finding Entity with name " + autoFieldsEntity.entityName + " for auto-fields-entity in a form widget");
         }