Author: doogie
Date: Fri Mar 13 05:41:16 2009 New Revision: 753127 URL: http://svn.apache.org/viewvc?rev=753127&view=rev Log: Major new feature, showing advanced webslinger integration. Files with an '.ofbiz-screen' extension can now contain a screen definition snippet. This is a one-way integration; the screen widget can't call back into webslinger controlled space(yet). Added: ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/DefaultMimeAttributes/application/x-ofbiz-screen ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/DefaultMimeAttributes/application/x-ofbiz-screen@/ ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/DefaultMimeAttributes/application/x-ofbiz-screen@/type ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy@/ ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy@/has-init ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy@/type-supports-creator ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/ ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/DemoScreen.ofbiz-screen ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/DemoScreen.ofbiz-screen@/ ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/DemoScreen.ofbiz-screen@/wrapper ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/index.vm ofbiz/trunk/framework/webslinger/websites/webslinger/www/WEB-INF/ ofbiz/trunk/framework/webslinger/websites/webslinger/www/WEB-INF/web.xml Modified: ofbiz/trunk/framework/webslinger/modules/ofbiz/Classes/org/webslinger/mime.types ofbiz/trunk/framework/webslinger/websites/webslinger/Config/ModuleState.xml ofbiz/trunk/framework/webslinger/websites/webslinger/www/index.whtml Modified: ofbiz/trunk/framework/webslinger/modules/ofbiz/Classes/org/webslinger/mime.types URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/modules/ofbiz/Classes/org/webslinger/mime.types?rev=753127&r1=753126&r2=753127&view=diff ============================================================================== --- ofbiz/trunk/framework/webslinger/modules/ofbiz/Classes/org/webslinger/mime.types (original) +++ ofbiz/trunk/framework/webslinger/modules/ofbiz/Classes/org/webslinger/mime.types Fri Mar 13 05:41:16 2009 @@ -15,3 +15,4 @@ # specific language governing permissions and limitations # under the License. application/x-ofbiz-condition ofbiz-condition +application/x-ofbiz-screen ofbiz-screen Added: ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/DefaultMimeAttributes/application/x-ofbiz-screen URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/DefaultMimeAttributes/application/x-ofbiz-screen?rev=753127&view=auto ============================================================================== (empty) Added: ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/DefaultMimeAttributes/application/x-ofbiz-screen@/type URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/DefaultMimeAttributes/application/x-ofbiz-screen%40/type?rev=753127&view=auto ============================================================================== --- ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/DefaultMimeAttributes/application/x-ofbiz-screen@/type (added) +++ ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/DefaultMimeAttributes/application/x-ofbiz-screen@/type Fri Mar 13 05:41:16 2009 @@ -0,0 +1 @@ +java.lang.String:ofbiz-screen Added: ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy?rev=753127&view=auto ============================================================================== --- ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy (added) +++ ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy Fri Mar 13 05:41:16 2009 @@ -0,0 +1,41 @@ +import org.ofbiz.base.util.StringUtil +import org.ofbiz.base.util.UtilXml +import org.ofbiz.base.util.collections.MapStack +import org.ofbiz.base.util.template.FreeMarkerWorker +import org.ofbiz.widget.screen.ScreenFactory +import org.ofbiz.widget.screen.ScreenRenderer +import org.ofbiz.widget.html.HtmlFormRenderer +import org.ofbiz.widget.html.HtmlScreenRenderer + +import org.webslinger.commons.vfs.VFSUtil +import org.webslinger.container.FileInfo + +System.err.println("webslinger.command=[$webslinger.command]") +switch (webslinger.command) { + case 'init': + return new HtmlScreenRenderer() + case 'get-creator': + return [ + createValue: { fi, name -> + def file = fi.file + def singleScreenText = VFSUtil.getString(file) + def fullDocumentText = '<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">' + singleScreenText + '</screens>' + def doc = UtilXml.readXmlDocument(fullDocumentText) + def screens = ScreenFactory.readScreenDocument(doc, file.toString()) + if (screens.size() != 1) throw new IllegalArgumentException('wrong size') + return screens.values().iterator().next() + } + ] as FileInfo.Creator +} +def target = webslinger.payload +def modelScreen = target.pathContext.info.getCachedItem(null) +def screenRenderer = webslinger.initObject +//response.contentType = 'text/html' +def targetContext = MapStack.create(target.context) +def screens = new ScreenRenderer(response.writer, targetContext, screenRenderer); +screens.populateContextForRequest(request, response, webslinger.webslingerServletContext) +FreeMarkerWorker.getSiteParameters(request, targetContext) +targetContext.formStringRenderer = new HtmlFormRenderer(request, response) +targetContext.simpleEncoder = StringUtil.htmlEncoder +modelScreen.renderScreenString(response.writer, targetContext, screenRenderer) +return null Added: ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy@/has-init URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy%40/has-init?rev=753127&view=auto ============================================================================== --- ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy@/has-init (added) +++ ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy@/has-init Fri Mar 13 05:41:16 2009 @@ -0,0 +1 @@ +java.lang.String:true Added: ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy@/type-supports-creator URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy%40/type-supports-creator?rev=753127&view=auto ============================================================================== --- ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy@/type-supports-creator (added) +++ ofbiz/trunk/framework/webslinger/modules/ofbiz/www/WEB-INF/TypeHandlers/ofbiz-screen.groovy@/type-supports-creator Fri Mar 13 05:41:16 2009 @@ -0,0 +1 @@ +java.lang.String:true Modified: ofbiz/trunk/framework/webslinger/websites/webslinger/Config/ModuleState.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/websites/webslinger/Config/ModuleState.xml?rev=753127&r1=753126&r2=753127&view=diff ============================================================================== --- ofbiz/trunk/framework/webslinger/websites/webslinger/Config/ModuleState.xml (original) +++ ofbiz/trunk/framework/webslinger/websites/webslinger/Config/ModuleState.xml Fri Mar 13 05:41:16 2009 @@ -18,5 +18,6 @@ under the License. --> <module-state> - <module name="defaults" url="ofbiz-component://webslinger/modules/defaults.zip" enabled="true"/> + <module name="defaults" url="wsmodule://defaults.zip" enabled="true"/> + <module name="ofbiz" url="wsmodule://ofbiz" enabled="true"/> </module-state> Added: ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/DemoScreen.ofbiz-screen URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/DemoScreen.ofbiz-screen?rev=753127&view=auto ============================================================================== --- ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/DemoScreen.ofbiz-screen (added) +++ ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/DemoScreen.ofbiz-screen Fri Mar 13 05:41:16 2009 @@ -0,0 +1,18 @@ + <screen name="browsercerts"> + <section> + <actions> + <set field="headerItem" value="main"/> + <set field="titleProperty" value="WebtoolsCertsX509"/> + </actions> + <widgets> + <decorator-screen name="component://webtools/widget/CommonScreens.xml#main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <platform-specific> + <html><html-template location="component://webtools/webapp/webtools/cert/viewbrowsercerts.ftl"/></html> + </platform-specific> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + Added: ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/DemoScreen.ofbiz-screen@/wrapper URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/DemoScreen.ofbiz-screen%40/wrapper?rev=753127&view=auto ============================================================================== --- ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/DemoScreen.ofbiz-screen@/wrapper (added) +++ ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/DemoScreen.ofbiz-screen@/wrapper Fri Mar 13 05:41:16 2009 @@ -0,0 +1 @@ +java.lang.String:None Added: ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/index.vm URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/index.vm?rev=753127&view=auto ============================================================================== --- ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/index.vm (added) +++ ofbiz/trunk/framework/webslinger/websites/webslinger/www/OfBiz/index.vm Fri Mar 13 05:41:16 2009 @@ -0,0 +1 @@ +#Merge("DemoScreen.ofbiz-screen") Added: ofbiz/trunk/framework/webslinger/websites/webslinger/www/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/websites/webslinger/www/WEB-INF/web.xml?rev=753127&view=auto ============================================================================== --- ofbiz/trunk/framework/webslinger/websites/webslinger/www/WEB-INF/web.xml (added) +++ ofbiz/trunk/framework/webslinger/websites/webslinger/www/WEB-INF/web.xml Fri Mar 13 05:41:16 2009 @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" + version="2.4"> + <context-param> + <param-name>webSiteId</param-name> + <param-value>WEBTOOLS</param-value> + <description>A unique ID used to look up the WebSite entity</description> + </context-param> + <listener><listener-class>org.ofbiz.webapp.control.ControlEventListener</listener-class></listener> + <listener><listener-class>org.ofbiz.webapp.control.LoginEventListener</listener-class></listener> + <!-- NOTE: not all app servers support mounting implementations of the HttpSessionActivationListener interface --> + <!-- <listener><listener-class>org.ofbiz.webapp.control.ControlActivationEventListener</listener-class></listener> --> + <servlet> + <servlet-name>jsp</servlet-name> + <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> + <init-param><param-name>fork</param-name><param-value>false</param-value></init-param> + <init-param><param-name>xpoweredBy</param-name><param-value>false</param-value></init-param> + <init-param><param-name>mappedFile</param-name><param-value>false</param-value></init-param> + <init-param><param-name>genStrAsCharArray</param-name><param-value>true</param-value></init-param> + <load-on-startup>3</load-on-startup> + </servlet> + <servlet> + <servlet-name>ControlServlet</servlet-name> + <display-name>ControlServlet</display-name> + <description>Main Control Servlet</description> + <servlet-class>org.ofbiz.webapp.control.ControlServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet-mapping><servlet-name>jsp</servlet-name><url-pattern>*.jsp</url-pattern></servlet-mapping> + <servlet-mapping> + <servlet-name>ControlServlet</servlet-name> + <url-pattern>/control/*</url-pattern> + </servlet-mapping> + +</web-app> Modified: ofbiz/trunk/framework/webslinger/websites/webslinger/www/index.whtml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/websites/webslinger/www/index.whtml?rev=753127&r1=753126&r2=753127&view=diff ============================================================================== --- ofbiz/trunk/framework/webslinger/websites/webslinger/www/index.whtml (original) +++ ofbiz/trunk/framework/webslinger/websites/webslinger/www/index.whtml Fri Mar 13 05:41:16 2009 @@ -6,3 +6,6 @@ Look at the <a href="#viewurl("/Showcase/")">showcase</a>, and at a <a href="#viewurl("/Showcase/StandAlonePage")">standalone</a> page. </p> +<p> +Also try looking at some deep <a href="#viewurl("/OfBiz/")">OfBiz</a> integration. +</p> |
Free forum by Nabble | Edit this page |