Author: jonesde
Date: Tue Mar 24 06:27:03 2009 New Revision: 757671 URL: http://svn.apache.org/viewvc?rev=757671&view=rev Log: Removed some more references to applications stuff from framework, including small cleanup of service engine to get rid of WebAppDispatcher and use new factory method in GenericDispatcher, and changed AvailableServices.groovy to get the real dispatcher list instead of a hard-coded one; also updated eclipse classpath file for new webslinger stuff Removed: ofbiz/trunk/framework/service/src/org/ofbiz/service/WebAppDispatcher.java Modified: ofbiz/trunk/.classpath ofbiz/trunk/framework/common/servicedef/services_email.xml ofbiz/trunk/framework/example/testdef/assertdata/TestUserLoginData.xml ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/AbstractJmsListener.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy Modified: ofbiz/trunk/.classpath URL: http://svn.apache.org/viewvc/ofbiz/trunk/.classpath?rev=757671&r1=757670&r2=757671&view=diff ============================================================================== --- ofbiz/trunk/.classpath (original) +++ ofbiz/trunk/.classpath Tue Mar 24 06:27:03 2009 @@ -2,6 +2,7 @@ <classpath> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="src" path="framework/testtools/src"/> + <classpathentry kind="src" path="framework/webslinger/src"/> <classpathentry kind="src" path="specialpurpose/oagis/src"/> <classpathentry kind="src" path="specialpurpose/hhfacility/src"/> <classpathentry kind="src" path="specialpurpose/assetmaint/src"/> @@ -111,7 +112,7 @@ <classpathentry kind="lib" path="framework/base/lib/xercesImpl-2.8.1.jar"/> <classpathentry kind="lib" path="framework/base/lib/resolver-2.8.1.jar"/> <classpathentry kind="lib" path="framework/base/lib/javolution-5.2.3.jar"/> - <classpathentry kind="lib" path="framework/base/lib/commons/commons-vfs-20070730.jar"/> + <classpathentry kind="lib" path="framework/base/lib/commons/commons-vfs-20070730.jar"/> <classpathentry kind="lib" path="framework/base/lib/commons/commons-validator-1.3.1.jar"/> <classpathentry kind="lib" path="framework/base/lib/commons/commons-primitives-1.0.jar"/> <classpathentry kind="lib" path="framework/base/lib/commons/commons-pool-1.3.jar"/> @@ -133,8 +134,8 @@ <classpathentry kind="lib" path="framework/base/lib/scripting/asm-tree-2.2.jar"/> <classpathentry kind="lib" path="framework/base/lib/scripting/asm-util-2.2.jar"/> <classpathentry kind="lib" path="framework/base/lib/scripting/groovy-1.5.6.jar"/> - <classpathentry kind="lib" path="framework/base/lib/jdom-1.1.jar"/> - <classpathentry kind="lib" path="framework/base/lib/jpim-0.1.jar"/> + <classpathentry kind="lib" path="framework/base/lib/jdom-1.1.jar"/> + <classpathentry kind="lib" path="framework/base/lib/jpim-0.1.jar"/> <classpathentry kind="lib" path="framework/base/lib/freemarker-2.3.15.jar"/> <classpathentry kind="lib" path="framework/base/lib/owasp-esapi-full-java-1.4.jar"/> <classpathentry kind="lib" path="framework/webapp/lib/json-lib-2.2.3-jdk15.jar"/> @@ -155,5 +156,16 @@ <classpathentry kind="lib" path="framework/base/lib/antisamy-bin.1.2.jar"/> <classpathentry kind="lib" path="framework/base/lib/fop-0.94.jar"/> <classpathentry kind="lib" path="framework/base/lib/nekohtml.jar"/> + <classpathentry kind="lib" path="framework/webslinger/lib/webslinger-20090320-c73d2e782311.jar"/> + <classpathentry kind="lib" path="framework/webslinger/lib/webslinger-catalina-20090320-c73d2e782311.jar"/> + <classpathentry kind="lib" path="framework/webslinger/lib/webslinger-extension-bsf-20090320-c73d2e782311.jar"/> + <classpathentry kind="lib" path="framework/webslinger/lib/webslinger-extension-code-20090320-c73d2e782311.jar"/> + <classpathentry kind="lib" path="framework/webslinger/lib/webslinger-extension-groovy-20090320-c73d2e782311.jar"/> + <classpathentry kind="lib" path="framework/webslinger/lib/webslinger-extension-janino-20090320-c73d2e782311.jar"/> + <classpathentry kind="lib" path="framework/webslinger/lib/webslinger-extension-servlet-20090320-c73d2e782311.jar"/> + <classpathentry kind="lib" path="framework/webslinger/lib/webslinger-extension-template-20090320-c73d2e782311.jar"/> + <classpathentry kind="lib" path="framework/webslinger/lib/webslinger-extension-velocity-20090320-c73d2e782311.jar"/> + <classpathentry kind="lib" path="framework/webslinger/lib/webslinger-extension-wiki-20090320-c73d2e782311.jar"/> + <classpathentry kind="lib" path="framework/webslinger/lib/webslinger-launcher-20090320-c73d2e782311.jar"/> <classpathentry kind="output" path="bin"/> </classpath> Modified: ofbiz/trunk/framework/common/servicedef/services_email.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services_email.xml?rev=757671&r1=757670&r2=757671&view=diff ============================================================================== --- ofbiz/trunk/framework/common/servicedef/services_email.xml (original) +++ ofbiz/trunk/framework/common/servicedef/services_email.xml Tue Mar 24 06:27:03 2009 @@ -58,7 +58,6 @@ <implements service="sendMailInterface"/> <attribute name="bodyParts" type="java.util.List" mode="INOUT" optional="false"/> <attribute name="subject" type="String" mode="INOUT" optional="false"/> - <attribute name="partyId" type="String" mode="INOUT" optional="true"/> <override name="contentType" mode="INOUT"/> </service> <service name="sendMailFromUrl" engine="java" Modified: ofbiz/trunk/framework/example/testdef/assertdata/TestUserLoginData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/testdef/assertdata/TestUserLoginData.xml?rev=757671&r1=757670&r2=757671&view=diff ============================================================================== --- ofbiz/trunk/framework/example/testdef/assertdata/TestUserLoginData.xml (original) +++ ofbiz/trunk/framework/example/testdef/assertdata/TestUserLoginData.xml Tue Mar 24 06:27:03 2009 @@ -20,7 +20,7 @@ <entity-engine-xml> <UserLogin userLoginId="system" enabled="N" isSystem="Y"/> - <UserLogin userLoginId="anonymous" currentPassword="anonymous" /> - <UserLogin userLoginId="admin" currentPassword="{SHA}47ca69ebb4bdc9ae0adec130880165d2cc05db1a" partyId="admin" /> + <UserLogin userLoginId="anonymous" currentPassword="anonymous"/> + <UserLogin userLoginId="admin" currentPassword="{SHA}47ca69ebb4bdc9ae0adec130880165d2cc05db1a"/> </entity-engine-xml> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java?rev=757671&r1=757670&r2=757671&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java Tue Mar 24 06:27:03 2009 @@ -18,7 +18,10 @@ *******************************************************************************/ package org.ofbiz.service; +import java.net.URL; +import java.util.Collection; import java.util.Map; +import java.util.Set; import javolution.util.FastMap; @@ -36,14 +39,14 @@ protected static Map<String, LocalDispatcher> dispatcherCache = FastMap.newInstance(); public static LocalDispatcher getLocalDispatcher(String dispatcherName, GenericDelegator delegator) { - return getLocalDispatcher(dispatcherName, delegator, null, null); + return getLocalDispatcher(dispatcherName, delegator, null, null, null); } - public static LocalDispatcher getLocalDispatcher(String dispatcherName, GenericDelegator delegator, ClassLoader loader) { - return getLocalDispatcher(dispatcherName, delegator, loader, null); + public static LocalDispatcher getLocalDispatcher(String dispatcherName, GenericDelegator delegator, Collection<URL> readerURLs, ClassLoader loader) { + return getLocalDispatcher(dispatcherName, delegator, readerURLs, loader, null); } - public static LocalDispatcher getLocalDispatcher(String dispatcherName, GenericDelegator delegator, ClassLoader loader, ServiceDispatcher serviceDispatcher) { + public static LocalDispatcher getLocalDispatcher(String dispatcherName, GenericDelegator delegator, Collection<URL> readerURLs, ClassLoader loader, ServiceDispatcher serviceDispatcher) { if (dispatcherName == null) { dispatcherName = "default"; Debug.logWarning("Got a getGenericDelegator call with a null dispatcherName, assuming default for the name.", module); @@ -72,7 +75,7 @@ dispatcher = sd.getLocalDispatcher(dispatcherName); } if (thisDispatcher == null) { - dispatcher = new GenericDispatcher(dispatcherName, delegator, loader, sd); + dispatcher = new GenericDispatcher(dispatcherName, delegator, readerURLs, loader, sd); } if (dispatcher != null) { @@ -95,12 +98,16 @@ } catch (SecurityException e) { loader = GenericDispatcher.class.getClassLoader(); } - return new GenericDispatcher(name, delegator, loader, sd); + return new GenericDispatcher(name, delegator, null, loader, sd); + } + + public static Set<String> getAllDispatcherNames() { + return dispatcherCache.keySet(); } protected GenericDispatcher() {} - protected GenericDispatcher(String name, GenericDelegator delegator, ClassLoader loader, ServiceDispatcher serviceDispatcher) { + protected GenericDispatcher(String name, GenericDelegator delegator, Collection<URL> readerURLs, ClassLoader loader, ServiceDispatcher serviceDispatcher) { if (serviceDispatcher != null) { this.dispatcher = serviceDispatcher; } @@ -111,7 +118,7 @@ loader = this.getClass().getClassLoader(); } } - DispatchContext dc = new DispatchContext(name, null, loader, null); + DispatchContext dc = new DispatchContext(name, readerURLs, loader, null); init(name, delegator, dc); } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java?rev=757671&r1=757670&r2=757671&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java Tue Mar 24 06:27:03 2009 @@ -21,6 +21,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Set; import javax.transaction.Transaction; @@ -79,7 +80,7 @@ protected JobManager jm = null; protected JmsListenerFactory jlf = null; - public ServiceDispatcher(GenericDelegator delegator, boolean enableJM, boolean enableJMS, boolean enableSvcs) { + protected ServiceDispatcher(GenericDelegator delegator, boolean enableJM, boolean enableJMS, boolean enableSvcs) { Debug.logInfo("[ServiceDispatcher] : Creating new instance.", module); factory = new GenericEngineFactory(this); ServiceGroupReader.readConfig(); @@ -114,7 +115,7 @@ } } - public ServiceDispatcher(GenericDelegator delegator) { + protected ServiceDispatcher(GenericDelegator delegator) { this(delegator, enableJM, enableJMS, enableSvcs); } @@ -159,7 +160,7 @@ } return sd; } - + /** * Registers the loader with this ServiceDispatcher * @param name the local dispatcher Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/AbstractJmsListener.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/AbstractJmsListener.java?rev=757671&r1=757670&r2=757671&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/AbstractJmsListener.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/AbstractJmsListener.java Tue Mar 24 06:27:03 2009 @@ -46,7 +46,7 @@ * @param dispatcher */ protected AbstractJmsListener(ServiceDispatcher serviceDispatcher) { - this.dispatcher = GenericDispatcher.getLocalDispatcher("JMSDispatcher", null, this.getClass().getClassLoader(), serviceDispatcher); + this.dispatcher = GenericDispatcher.getLocalDispatcher("JMSDispatcher", null, null, this.getClass().getClassLoader(), serviceDispatcher); } /** Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java?rev=757671&r1=757670&r2=757671&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java Tue Mar 24 06:27:03 2009 @@ -54,8 +54,8 @@ import org.ofbiz.security.Security; import org.ofbiz.security.SecurityConfigurationException; import org.ofbiz.security.SecurityFactory; +import org.ofbiz.service.GenericDispatcher; import org.ofbiz.service.LocalDispatcher; -import org.ofbiz.service.WebAppDispatcher; /** * ContextFilter - Restricts access to raw files and configures servlet objects. @@ -289,9 +289,7 @@ for (String name: StringUtil.split(readerFiles, ";")) { try { URL readerURL = config.getServletContext().getResource(name); - - if (readerURL != null) - readers.add(readerURL); + if (readerURL != null) readers.add(readerURL); } catch (NullPointerException npe) { Debug.logInfo(npe, "[ContextFilter.init] ERROR: Null pointer exception thrown.", module); } catch (MalformedURLException e) { @@ -302,12 +300,14 @@ // get the unique name of this dispatcher String dispatcherName = config.getServletContext().getInitParameter("localDispatcherName"); - if (dispatcherName == null) + if (dispatcherName == null) { Debug.logError("No localDispatcherName specified in the web.xml file", module); - dispatcher = new WebAppDispatcher(dispatcherName, delegator, readers); + } + dispatcher = GenericDispatcher.getLocalDispatcher(dispatcherName, delegator, readers, null); config.getServletContext().setAttribute("dispatcher", dispatcher); - if (dispatcher == null) + if (dispatcher == null) { Debug.logError("[ContextFilter.init] ERROR: dispatcher could not be initialized.", module); + } } return dispatcher; } 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=757671&r1=757670&r2=757671&view=diff ============================================================================== --- ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java (original) +++ ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java Tue Mar 24 06:27:03 2009 @@ -18,56 +18,33 @@ *******************************************************************************/ package org.ofbiz.webslinger; -import java.io.File; import java.io.IOException; -import java.lang.ref.SoftReference; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Set; -import javax.management.JMException; -import javax.naming.NamingException; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.parsers.ParserConfigurationException; -import org.xml.sax.SAXException; - -import org.apache.commons.vfs.FileObject; -import org.apache.commons.vfs.FileSystemException; -import org.apache.commons.vfs.FileSystemManager; -import org.apache.commons.vfs.NameScope; - -import org.ofbiz.base.util.UtilFormatOut; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; -import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.entity.GenericEntity; -import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; -import org.ofbiz.entity.transaction.TransactionFactory; import org.ofbiz.entity.cache.Cache; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.security.SecurityFactory; +import org.ofbiz.service.GenericDispatcher; import org.ofbiz.service.LocalDispatcher; -import org.ofbiz.service.WebAppDispatcher; - import org.webslinger.AbstractMappingWebslingerServletContextFactory; import org.webslinger.WebslingerServletContext; -import org.webslinger.container.WebslingerContainer; -import org.webslinger.lang.ObjectUtil; -import org.webslinger.servlet.WebslingerServlet; -import org.webslinger.util.TTLObject; import org.webslinger.collections.CollectionUtil; +import org.webslinger.lang.ObjectUtil; public class WebslingerContextMapper extends AbstractMappingWebslingerServletContextFactory { protected ServletContext servletContext; @@ -132,7 +109,7 @@ } } System.err.println(readerURLs); - return new WebAppDispatcher(name, delegator, readerURLs); + return GenericDispatcher.getLocalDispatcher(name, delegator, readerURLs, null); } protected Set<String> getSuffixes() throws Exception { Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy?rev=757671&r1=757670&r2=757671&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy (original) +++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy Tue Mar 24 06:27:03 2009 @@ -25,6 +25,7 @@ import org.ofbiz.service.eca.ServiceEcaUtil; import org.ofbiz.service.ModelPermGroup; import org.ofbiz.service.ModelPermission; +import org.ofbiz.service.GenericDispatcher; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilProperties; @@ -283,34 +284,15 @@ } -/*Local Dispatchers -accounting, content, ecommerce, manufacturing, marketing, ordermgr, partymgr, catalog, facility, workeffort, example, WFDispatcher, webtools, order, wholesale, salesrep, hotelbackend, community -*/ -//Ashish: Don't know how to get list of available dispatchers, so hardcoded. Add to this list if I missed some. -dispArrList = ["accounting", - "content", - "ecommerce", - "manufacturing", - "marketing", - "order", - "partymgr", - "catalog", - "facility", - "workeffort", - "example", - "WFDispatcher", - "webtools", - "wholesale", - "salesrep", - "hotelbackend", - "community"]; -Collections.sort(dispArrList); +//Local Dispatchers +dispArrList = new TreeSet(); +dispArrList.addAll(GenericDispatcher.getAllDispatcherNames()); context.dispArrList = dispArrList; uiLabelMap = UtilProperties.getResourceBundleMap("WebtoolsUiLabels", locale); uiLabelMap.addBottomResourceBundle("CommonUiLabels"); -selDisp = parameters.selDisp ?: "partymgr"; +selDisp = parameters.selDisp ?: "webtools"; curLocalDispatcher = dispatcher.getLocalDispatcher(selDisp, delegator); curDispatchContext = curLocalDispatcher.getDispatchContext(); |
Free forum by Nabble | Edit this page |