You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jo...@apache.org on 2008/03/18 05:40:18 UTC

svn commit: r638210 - in /ofbiz/trunk/framework: webapp/src/org/ofbiz/webapp/control/ webtools/src/org/ofbiz/webtools/artifactinfo/

Author: jonesde
Date: Mon Mar 17 21:40:06 2008
New Revision: 638210

URL: http://svn.apache.org/viewvc?rev=638210&view=rev
Log:
Changed artifact info classes to extend a common base class; added classes (incomplete still) for controller request and view

Added:
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java   (with props)
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java   (with props)
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerViewArtifactInfo.java   (with props)
Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/EntityArtifactInfo.java
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/FormWidgetArtifactInfo.java
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ScreenWidgetArtifactInfo.java
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceEcaArtifactInfo.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java?rev=638210&r1=638209&r2=638210&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java Mon Mar 17 21:40:06 2008
@@ -65,8 +65,8 @@
         
         public Map configMap = FastMap.newInstance();
         public Map handlerMap = FastMap.newInstance();
-        public Map requestMap = FastMap.newInstance();
-        public Map viewMap = FastMap.newInstance();
+        public Map<String, Map<String, String>> requestMap = FastMap.newInstance();
+        public Map<String, Map<String, String>> viewMap = FastMap.newInstance();
         public String defaultRequest = null;
 
         public ControllerConfig(URL url) {
@@ -162,17 +162,17 @@
     }
 
     /** Gets a FastMap of request mappings. */
-    public static Map loadRequestMap(Element root, URL xml) {
+    public static Map<String, Map<String, String>> loadRequestMap(Element root, URL xml) {
         long startTime = System.currentTimeMillis();
-        FastMap map = FastMap.newInstance();
+        Map<String, Map<String, String>> map = FastMap.newInstance();
         if (root == null) {
             root = loadDocument(xml);
         }
 
         if (root == null) return map;
 
-        List includeElementList = UtilXml.childElementList(root, INCLUDE);
-        Iterator includeElementIter = includeElementList.iterator();
+        List<? extends Element> includeElementList = UtilXml.childElementList(root, INCLUDE);
+        Iterator<? extends Element> includeElementIter = includeElementList.iterator();
         while (includeElementIter.hasNext()) {
             Element includeElement = (Element) includeElementIter.next();
             String includeLocation = includeElement.getAttribute(INCLUDE_LOCATION);
@@ -186,13 +186,13 @@
             }
         }
 
-        List requestMapElementList = UtilXml.childElementList(root, REQUEST_MAPPING);
-        Iterator requestMapElementIter = requestMapElementList.iterator();
+        List<? extends Element> requestMapElementList = UtilXml.childElementList(root, REQUEST_MAPPING);
+        Iterator<? extends Element> requestMapElementIter = requestMapElementList.iterator();
         while (requestMapElementIter.hasNext()) {
             Element requestMapElement = (Element) requestMapElementIter.next();
             
             // Create a URI-MAP for each element found.
-            FastMap uriMap = FastMap.newInstance();
+            Map<String, String> uriMap = FastMap.newInstance();
 
             // Get the URI info.
             String uri = requestMapElement.getAttribute(REQUEST_URI);
@@ -250,8 +250,8 @@
             uriMap.put(REQUEST_DESCRIPTION, UtilValidate.isNotEmpty(description) ? description : "");
 
             // Get the response(s).
-            List responseElementList = UtilXml.childElementList(requestMapElement, RESPONSE);
-            Iterator responseElementIter = responseElementList.iterator();
+            List<? extends Element> responseElementList = UtilXml.childElementList(requestMapElement, RESPONSE);
+            Iterator<? extends Element> responseElementIter = responseElementList.iterator();
             while (responseElementIter.hasNext()) {
                 Element responseElement = (Element) responseElementIter.next();
                 String name = responseElement.getAttribute(RESPONSE_NAME);
@@ -269,17 +269,16 @@
         if (Debug.verboseOn()) {
             Debug.logVerbose("-------- Request Mappings --------", module);
             //FastMap debugMap = map;
-            Set debugSet = map.keySet();
-            Iterator i = debugSet.iterator();
-
+            Set<String> debugSet = map.keySet();
+            Iterator<String> i = debugSet.iterator();
             while (i.hasNext()) {
                 Object o = i.next();
                 String request = (String) o;
-                Map thisURI = (Map) map.get(o);
+                Map<String, String> thisURI = map.get(o);
 
                 StringBuilder verboseMessageBuffer = new StringBuilder();
 
-                Iterator debugIter = thisURI.keySet().iterator();
+                Iterator<String> debugIter = thisURI.keySet().iterator();
                 while (debugIter.hasNext()) {
                     Object lo = debugIter.next();
                     String name = (String) lo;

Added: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java?rev=638210&view=auto
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java (added)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java Mon Mar 17 21:40:06 2008
@@ -0,0 +1,47 @@
+/*
+ * 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.webtools.artifactinfo;
+
+import java.util.List;
+
+import javolution.util.FastList;
+
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.model.ModelEntity;
+import org.ofbiz.entityext.eca.EntityEcaRule;
+import org.ofbiz.webtools.artifactinfo.ArtifactInfoFactory;
+
+/**
+ *
+ */
+public class ArtifactInfoBase {
+    protected ArtifactInfoFactory aif;
+    
+    public ArtifactInfoBase(ArtifactInfoFactory aif) {
+        this.aif = aif;
+    }
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof ArtifactInfoBase) {
+            return this.equals(obj);
+        } else {
+            return false;
+        }
+    }
+}

Propchange: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoBase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=638210&r1=638209&r2=638210&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 Mar 17 21:40:06 2008
@@ -19,6 +19,7 @@
 package org.ofbiz.webtools.artifactinfo;
 
 import java.io.IOException;
+import java.net.URL;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -26,6 +27,7 @@
 import javax.xml.parsers.ParserConfigurationException;
 
 import javolution.util.FastMap;
+import javolution.util.FastSet;
 
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.UtilValidate;
@@ -40,6 +42,8 @@
 import org.ofbiz.service.ModelService;
 import org.ofbiz.service.eca.ServiceEcaRule;
 import org.ofbiz.service.eca.ServiceEcaUtil;
+import org.ofbiz.webapp.control.ConfigXMLReader;
+import org.ofbiz.webapp.control.ConfigXMLReader.ControllerConfig;
 import org.ofbiz.widget.form.FormFactory;
 import org.ofbiz.widget.form.ModelForm;
 import org.ofbiz.widget.screen.ModelScreen;
@@ -64,6 +68,8 @@
     public Map<ServiceEcaRule, ServiceEcaArtifactInfo> allServiceEcaInfos = FastMap.newInstance();
     public Map<String, FormWidgetArtifactInfo> allFormInfos = FastMap.newInstance();
     public Map<String, ScreenWidgetArtifactInfo> allScreenInfos = FastMap.newInstance();
+    public Map<String, ControllerRequestArtifactInfo> allControllerRequestInfos = FastMap.newInstance();
+    public Map<String, ControllerViewArtifactInfo> allControllerViewInfos = FastMap.newInstance();
 
     // reverse-associative caches for walking backward in the diagram
     public Map<String, Set<ServiceEcaArtifactInfo>> allServiceEcaInfosReferringToServiceName = FastMap.newInstance();
@@ -77,6 +83,9 @@
 
     public Map<ServiceEcaRule, Set<ServiceArtifactInfo>> allServiceInfosReferringToServiceEcaRule = FastMap.newInstance();
     
+    public Map<String, Set<ControllerRequestArtifactInfo>> allRequestInfosReferringToView = FastMap.newInstance(); 
+    public Map<String, Set<ControllerRequestArtifactInfo>> allRequestInfosReferringToRequest = FastMap.newInstance(); 
+    
     public static ArtifactInfoFactory getArtifactInfoFactory(String delegatorName) throws GeneralException {
         if (UtilValidate.isEmpty(delegatorName)) {
             delegatorName = "default";
@@ -116,6 +125,18 @@
         // TODO: how to get all forms to prepare?
         
         // TODO: how to get all screens to prepare?
+        
+        // TODO: get all controller requests and views to prepare
+        Set<URL> controllerUrlSet = FastSet.newInstance();
+        for (URL controllerUrl: controllerUrlSet) {
+            ControllerConfig cc = ConfigXMLReader.getControllerConfig(controllerUrl);
+            for (String requestUri: cc.requestMap.keySet()) {
+                this.getControllerRequestArtifactInfo(controllerUrl, requestUri);
+            }
+            for (String viewUri: cc.viewMap.keySet()) {
+                this.getControllerViewArtifactInfo(controllerUrl, viewUri);
+            }
+        }
     }
     
     public ModelReader getEntityModelReader() {
@@ -141,6 +162,14 @@
     public ModelScreen getModelScreen(String screenName, String screenLocation) throws ParserConfigurationException, SAXException, IOException {
         return ScreenFactory.getScreenFromLocation(screenLocation, screenName);
     }
+    
+    public Map<String, String> getControllerRequestInfoMap(URL controllerXmlUrl, String requestUri) {
+        return ConfigXMLReader.getControllerConfig(controllerXmlUrl).requestMap.get(requestUri);
+    }
+
+    public Map<String, String> getControllerViewInfoMap(URL controllerXmlUrl, String viewUri) {
+        return ConfigXMLReader.getControllerConfig(controllerXmlUrl).viewMap.get(viewUri);
+    }
 
     public EntityArtifactInfo getEntityArtifactInfo(String entityName) throws GeneralException {
         EntityArtifactInfo curInfo = this.allEntityInfos.get(entityName);
@@ -172,20 +201,77 @@
     }
     
     public FormWidgetArtifactInfo getFormWidgetArtifactInfo(String formName, String formLocation) throws GeneralException, IOException, SAXException, ParserConfigurationException {
-        FormWidgetArtifactInfo curInfo = this.allFormInfos.get(formName + formLocation);
+        FormWidgetArtifactInfo curInfo = this.allFormInfos.get(formLocation + "#" + formName);
         if (curInfo == null) {
             curInfo = new FormWidgetArtifactInfo(formName, formLocation, this);
-            this.allFormInfos.put(formName + formLocation, curInfo);
+            this.allFormInfos.put(curInfo.getUniqueId(), curInfo);
         }
         return curInfo;
     }
     
     public ScreenWidgetArtifactInfo getScreenWidgetArtifactInfo(String screenName, String screenLocation) throws GeneralException, IOException, SAXException, ParserConfigurationException {
-        ScreenWidgetArtifactInfo curInfo = this.allScreenInfos.get(screenName + screenLocation);
+        ScreenWidgetArtifactInfo curInfo = this.allScreenInfos.get(screenLocation + "#" + screenName);
         if (curInfo == null) {
             curInfo = new ScreenWidgetArtifactInfo(screenName, screenLocation, this);
-            this.allScreenInfos.put(screenName + screenLocation, curInfo);
+            this.allScreenInfos.put(curInfo.getUniqueId(), curInfo);
         }
         return curInfo;
+    }
+    
+    public ControllerRequestArtifactInfo getControllerRequestArtifactInfo(URL controllerXmlUrl, String requestUri) {
+        ControllerRequestArtifactInfo curInfo = this.allControllerRequestInfos.get(controllerXmlUrl.toExternalForm() + "#" + requestUri);
+        if (curInfo == null) {
+            curInfo = new ControllerRequestArtifactInfo(controllerXmlUrl, requestUri, this);
+            this.allControllerRequestInfos.put(curInfo.getUniqueId(), curInfo);
+        }
+        return curInfo;
+    }
+    
+    public ControllerViewArtifactInfo getControllerViewArtifactInfo(URL controllerXmlUrl, String viewUri) {
+        ControllerViewArtifactInfo curInfo = this.allControllerViewInfos.get(controllerXmlUrl.toExternalForm() + "#" + viewUri);
+        if (curInfo == null) {
+            curInfo = new ControllerViewArtifactInfo(controllerXmlUrl, viewUri, this);
+            this.allControllerViewInfos.put(curInfo.getUniqueId(), curInfo);
+        }
+        return curInfo;
+    }
+    
+    public Set<ArtifactInfoBase> getAllArtifactInfosByNamePartial(String artifactNamePartial) {
+        Set<ArtifactInfoBase> aiBaseSet = FastSet.newInstance();
+        
+        for (Map.Entry<String, EntityArtifactInfo> curEntry: allEntityInfos.entrySet()) {
+            if (curEntry.getKey().contains(artifactNamePartial)) {
+                aiBaseSet.add(curEntry.getValue());
+            }
+        }
+        for (Map.Entry<String, ServiceArtifactInfo> curEntry: allServiceInfos.entrySet()) {
+            if (curEntry.getKey().contains(artifactNamePartial)) {
+                aiBaseSet.add(curEntry.getValue());
+            }
+        }
+        
+        for (Map.Entry<String, FormWidgetArtifactInfo> curEntry: allFormInfos.entrySet()) {
+            if (curEntry.getKey().contains(artifactNamePartial)) {
+                aiBaseSet.add(curEntry.getValue());
+            }
+        }
+        for (Map.Entry<String, ScreenWidgetArtifactInfo> curEntry: allScreenInfos.entrySet()) {
+            if (curEntry.getKey().contains(artifactNamePartial)) {
+                aiBaseSet.add(curEntry.getValue());
+            }
+        }
+        
+        for (Map.Entry<String, ControllerRequestArtifactInfo> curEntry: allControllerRequestInfos.entrySet()) {
+            if (curEntry.getKey().contains(artifactNamePartial)) {
+                aiBaseSet.add(curEntry.getValue());
+            }
+        }
+        for (Map.Entry<String, ControllerViewArtifactInfo> curEntry: allControllerViewInfos.entrySet()) {
+            if (curEntry.getKey().contains(artifactNamePartial)) {
+                aiBaseSet.add(curEntry.getValue());
+            }
+        }
+        
+        return aiBaseSet;
     }
 }

Added: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java?rev=638210&view=auto
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java (added)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java Mon Mar 17 21:40:06 2008
@@ -0,0 +1,93 @@
+/*
+ * 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.webtools.artifactinfo;
+
+import java.net.URL;
+import java.util.Map;
+import java.util.Set;
+
+import javolution.util.FastSet;
+
+import org.ofbiz.base.util.UtilObject;
+
+/**
+ *
+ */
+public class ControllerRequestArtifactInfo extends ArtifactInfoBase {
+    
+    protected URL controllerXmlUrl;
+    protected String requestUri;
+    
+    protected Map<String, String> requestInfoMap;
+    
+    protected Set<ServiceArtifactInfo> servicesCalledByRequest = FastSet.newInstance();
+    protected Set<ControllerRequestArtifactInfo> requestsThatAreResponsesToThisRequest = FastSet.newInstance();
+    protected Set<ControllerViewArtifactInfo> viewsThatAreResponsesToThisRequest = FastSet.newInstance();
+    
+    public ControllerRequestArtifactInfo(URL controllerXmlUrl, String requestUri, ArtifactInfoFactory aif) {
+        super(aif);
+        this.controllerXmlUrl = controllerXmlUrl;
+        this.requestUri = requestUri;
+        
+        this.requestInfoMap = aif.getControllerRequestInfoMap(controllerXmlUrl, requestUri);
+        
+        // TODO populate servicesCalledByRequest, requestsThatAreResponsesToThisRequest, viewsThatAreResponsesToThisRequest
+        
+        // TODO populate reverse Set for getRequestsThatThisRequestIsResponsTo, View.getRequestsThatThisViewIsResponseTo
+    }
+    
+    public URL getControllerXmlUrl() {
+        return this.controllerXmlUrl;
+    }
+    
+    public String getRequestUri() {
+        return this.requestUri;
+    }
+    
+    public String getUniqueId() {
+        return this.controllerXmlUrl.toExternalForm() + "#" + this.requestUri;
+    }
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof ControllerRequestArtifactInfo) {
+            ControllerRequestArtifactInfo that = (ControllerRequestArtifactInfo) obj;
+            return UtilObject.equalsHelper(this.controllerXmlUrl, that.controllerXmlUrl) &&
+                UtilObject.equalsHelper(this.requestUri, that.requestUri);
+        } else {
+            return false;
+        }
+    }
+    
+    /** Get the Services that are called by this Request */
+    public Set<ServiceArtifactInfo> getServicesCalledByRequest() {
+        return servicesCalledByRequest;
+    }
+    
+    public Set<ControllerRequestArtifactInfo> getRequestsThatAreResponsesToThisRequest() {
+        return this.requestsThatAreResponsesToThisRequest;
+    }
+    
+    public Set<ControllerRequestArtifactInfo> getRequestsThatThisRequestIsResponsTo() {
+        return this.aif.allRequestInfosReferringToRequest.get(this.getUniqueId());
+    }
+    
+    public Set<ControllerViewArtifactInfo> getViewsThatAreResponsesToThisRequest() {
+        return this.viewsThatAreResponsesToThisRequest;
+    }
+}

Propchange: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerRequestArtifactInfo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerViewArtifactInfo.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerViewArtifactInfo.java?rev=638210&view=auto
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerViewArtifactInfo.java (added)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerViewArtifactInfo.java Mon Mar 17 21:40:06 2008
@@ -0,0 +1,80 @@
+/*
+ * 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.webtools.artifactinfo;
+
+import java.net.URL;
+import java.util.Map;
+import java.util.Set;
+
+import javolution.util.FastSet;
+
+import org.ofbiz.base.util.UtilObject;
+
+/**
+ *
+ */
+public class ControllerViewArtifactInfo extends ArtifactInfoBase {
+    
+    protected URL controllerXmlUrl;
+    protected String viewUri;
+    
+    protected Map<String, String> viewInfoMap;
+    
+    protected Set<ScreenWidgetArtifactInfo> screensCalledByThisView = FastSet.newInstance();
+    
+    public ControllerViewArtifactInfo(URL controllerXmlUrl, String viewUri, ArtifactInfoFactory aif) {
+        super(aif);
+        this.controllerXmlUrl = controllerXmlUrl;
+        this.viewUri = viewUri;
+        
+        this.viewInfoMap = aif.getControllerViewInfoMap(controllerXmlUrl, viewUri);
+        
+        // TODO populate screensCalledByThisView
+    }
+    
+    public URL getControllerXmlUrl() {
+        return this.controllerXmlUrl;
+    }
+    
+    public String getViewUri() {
+        return this.viewUri;
+    }
+    
+    public String getUniqueId() {
+        return this.controllerXmlUrl.toExternalForm() + "#" + this.viewUri;
+    }
+    
+    public boolean equals(Object obj) {
+        if (obj instanceof ControllerViewArtifactInfo) {
+            ControllerViewArtifactInfo that = (ControllerViewArtifactInfo) obj;
+            return UtilObject.equalsHelper(this.controllerXmlUrl, that.controllerXmlUrl) &&
+                UtilObject.equalsHelper(this.viewUri, that.viewUri);
+        } else {
+            return false;
+        }
+    }
+    
+    public Set<ControllerRequestArtifactInfo> getRequestsThatThisViewIsResponseTo() {
+        return this.aif.allRequestInfosReferringToView.get(this.getUniqueId());
+    }
+    
+    public Set<ScreenWidgetArtifactInfo> getScreensCalledByThisView() {
+        return screensCalledByThisView;
+    }
+}

Propchange: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerViewArtifactInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerViewArtifactInfo.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ControllerViewArtifactInfo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/EntityArtifactInfo.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/EntityArtifactInfo.java?rev=638210&r1=638209&r2=638210&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/EntityArtifactInfo.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/EntityArtifactInfo.java Mon Mar 17 21:40:06 2008
@@ -30,12 +30,11 @@
 /**
  *
  */
-public class EntityArtifactInfo {
-    protected ArtifactInfoFactory aif;
+public class EntityArtifactInfo extends ArtifactInfoBase {
     protected ModelEntity modelEntity;
     
     public EntityArtifactInfo(String entityName, ArtifactInfoFactory aif) throws GenericEntityException {
-        this.aif = aif;
+        super(aif);
         this.modelEntity = this.aif.getModelEntity(entityName);
     }
     

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/FormWidgetArtifactInfo.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/FormWidgetArtifactInfo.java?rev=638210&r1=638209&r2=638210&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/FormWidgetArtifactInfo.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/FormWidgetArtifactInfo.java Mon Mar 17 21:40:06 2008
@@ -29,13 +29,22 @@
 /**
  *
  */
-public class FormWidgetArtifactInfo {
-    protected ArtifactInfoFactory aif;
+public class FormWidgetArtifactInfo extends ArtifactInfoBase {
+    
     protected ModelForm modelForm;
     
+    protected String formName;
+    protected String formLocation;
+    
     public FormWidgetArtifactInfo(String formName, String formLocation, ArtifactInfoFactory aif) throws ParserConfigurationException, SAXException, IOException {
-        this.aif = aif;
+        super(aif);
+        this.formName = formName;
+        this.formLocation = formLocation;
         this.modelForm = aif.getModelForm(formName, formLocation);
+    }
+    
+    public String getUniqueId() {
+        return this.formLocation + "#" + this.formName;
     }
     
     public boolean equals(Object obj) {

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ScreenWidgetArtifactInfo.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ScreenWidgetArtifactInfo.java?rev=638210&r1=638209&r2=638210&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ScreenWidgetArtifactInfo.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ScreenWidgetArtifactInfo.java Mon Mar 17 21:40:06 2008
@@ -29,13 +29,22 @@
 /**
  *
  */
-public class ScreenWidgetArtifactInfo {
-    protected ArtifactInfoFactory aif;
+public class ScreenWidgetArtifactInfo extends ArtifactInfoBase {
+
     protected ModelScreen modelScreen;
     
+    protected String screenName;
+    protected String screenLocation;
+    
     public ScreenWidgetArtifactInfo(String screenName, String screenLocation, ArtifactInfoFactory aif) throws ParserConfigurationException, SAXException, IOException {
-        this.aif = aif;
+        super(aif);
+        this.screenName = screenName;
+        this.screenLocation = screenLocation;
         this.modelScreen = aif.getModelScreen(screenName, screenLocation);
+    }
+    
+    public String getUniqueId() {
+        return this.screenLocation + "#" + this.screenName;
     }
     
     public boolean equals(Object obj) {

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java?rev=638210&r1=638209&r2=638210&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java Mon Mar 17 21:40:06 2008
@@ -48,10 +48,9 @@
 /**
  *
  */
-public class ServiceArtifactInfo {
+public class ServiceArtifactInfo extends ArtifactInfoBase {
     public static final String module = ServiceArtifactInfo.class.getName();
     
-    protected ArtifactInfoFactory aif;
     protected ModelService modelService;
     protected String displayPrefix = null;
     
@@ -60,7 +59,7 @@
     Set<ServiceEcaArtifactInfo> serviceEcasTriggeredByThisService = FastSet.newInstance();
     
     public ServiceArtifactInfo(String serviceName, ArtifactInfoFactory aif) throws GeneralException {
-        this.aif = aif;
+        super(aif);
         this.modelService = this.aif.getModelService(serviceName);
     }
     

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceEcaArtifactInfo.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceEcaArtifactInfo.java?rev=638210&r1=638209&r2=638210&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceEcaArtifactInfo.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceEcaArtifactInfo.java Mon Mar 17 21:40:06 2008
@@ -35,8 +35,7 @@
 /**
  *
  */
-public class ServiceEcaArtifactInfo {
-    protected ArtifactInfoFactory aif;
+public class ServiceEcaArtifactInfo extends ArtifactInfoBase {
     protected ServiceEcaRule serviceEcaRule;
     protected String displayPrefix = null;
     protected int displaySuffixNum = 0;
@@ -44,7 +43,7 @@
     protected Set<ServiceArtifactInfo> servicesCalledByThisServiceEca = FastSet.newInstance();
     
     public ServiceEcaArtifactInfo(ServiceEcaRule serviceEcaRule, ArtifactInfoFactory aif) throws GeneralException {
-        this.aif = aif;
+        super(aif);
         this.serviceEcaRule = serviceEcaRule;
     }