Author: jacopoc
Date: Sun Aug 19 23:48:53 2007 New Revision: 567558 URL: http://svn.apache.org/viewvc?rev=567558&view=rev Log: No functional changes, just a lot of cleanups for rev. 566781 by Al Byers: 1) added missing license headers 2) removed tabs 3) fixed some weird/random formatting I'm still not sure that it is correct to keep the two *.ftl files in the script folder... but I don't have time to further review this revision. Modified: ofbiz/trunk/framework/webapp/config/wfs.properties ofbiz/trunk/framework/webapp/script/org/ofbiz/webapp/event/formatWfs.ftl ofbiz/trunk/framework/webapp/script/org/ofbiz/webapp/event/processWfs.ftl ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/WfsViewHandler.java Modified: ofbiz/trunk/framework/webapp/config/wfs.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/config/wfs.properties?rev=567558&r1=567557&r2=567558&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/config/wfs.properties (original) +++ ofbiz/trunk/framework/webapp/config/wfs.properties Sun Aug 19 23:48:53 2007 @@ -1,2 +1,21 @@ +############################################################################### +# 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. +############################################################################### + input.template.path=component://webapp/script/org/ofbiz/webapp/event/processWfs.ftl -format.template.path=component://webapp/script/org/ofbiz/webapp/event/formatWfs.ftl \ No newline at end of file +format.template.path=component://webapp/script/org/ofbiz/webapp/event/formatWfs.ftl Modified: ofbiz/trunk/framework/webapp/script/org/ofbiz/webapp/event/formatWfs.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/script/org/ofbiz/webapp/event/formatWfs.ftl?rev=567558&r1=567557&r2=567558&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/script/org/ofbiz/webapp/event/formatWfs.ftl (original) +++ ofbiz/trunk/framework/webapp/script/org/ofbiz/webapp/event/formatWfs.ftl Sun Aug 19 23:48:53 2007 @@ -1,3 +1,22 @@ +<#-- +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. +--> + <?xml version="1.0" ?> <wfs:FeatureCollection xmlns="http://www.hotwaxmedia.com/granite" @@ -20,11 +39,11 @@ <#if key == "latitude"><#assign thisLatitude=val/></#if> <#if key=="longitude" || key == "latitude"> <#if thisLongitude?has_content && thisLatitude?has_content> - <geoTemp> - <gml:Point srsName="4326"> - <gml:pos>${thisLongitude} ${thisLatitude}</gml:pos> - </gml:Point> - </geoTemp> + <geoTemp> + <gml:Point srsName="4326"> + <gml:pos>${thisLongitude} ${thisLatitude}</gml:pos> + </gml:Point> + </geoTemp> </#if> <#else> <${key}>${val}</${key}> @@ -33,4 +52,4 @@ </${entityName}> </gml:featureMember> </#list> - </wfs:FeatureCollection> \ No newline at end of file +</wfs:FeatureCollection> Modified: ofbiz/trunk/framework/webapp/script/org/ofbiz/webapp/event/processWfs.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/script/org/ofbiz/webapp/event/processWfs.ftl?rev=567558&r1=567557&r2=567558&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/script/org/ofbiz/webapp/event/processWfs.ftl (original) +++ ofbiz/trunk/framework/webapp/script/org/ofbiz/webapp/event/processWfs.ftl Sun Aug 19 23:48:53 2007 @@ -1,3 +1,22 @@ +<#-- +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. +--> + <#ftl ns_prefixes={"ogc":"http://ogc.org"}> <simple-method method-name="processWfs" short-description="Process a WFS request and return a simple method" login-required="false"> @@ -14,7 +33,7 @@ <#macro "ogc:Filter"> - <entity-condition list-name="entityList" entity-name="${entityName}" filter-by-date="false" use-cache="false"> + <entity-condition list-name="entityList" entity-name="${entityName}" filter-by-date="false" use-cache="false"> <#recurse .node> </entity-condition> <field-to-request field-name="entityList"/> Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java?rev=567558&r1=567557&r2=567558&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/WfsEventHandler.java Sun Aug 19 23:48:53 2007 @@ -199,39 +199,28 @@ } public static String processWfsEntity(String entityName, Node domNode, String templatePath) throws TemplateException, FileNotFoundException, IOException, URISyntaxException { - String result = null; - - NodeModel nodeModel = NodeModel.wrap(domNode); - - Map ctx = new HashMap(); - ctx.put("doc", nodeModel); - ctx.put("entityName", entityName); - StringWriter outWriter = new StringWriter(); - Template template = getDocTemplate(templatePath); - template.process(ctx, outWriter); - outWriter.close(); - result = outWriter.toString(); - + NodeModel nodeModel = NodeModel.wrap(domNode); + Map ctx = new HashMap(); + ctx.put("doc", nodeModel); + ctx.put("entityName", entityName); + StringWriter outWriter = new StringWriter(); + Template template = getDocTemplate(templatePath); + template.process(ctx, outWriter); + outWriter.close(); + result = outWriter.toString(); return result; } - - - public static Template getDocTemplate(String fileUrl) throws FileNotFoundException, IOException, TemplateException, URISyntaxException { + public static Template getDocTemplate(String fileUrl) throws FileNotFoundException, IOException, TemplateException, URISyntaxException { Template template = null; - - URL screenFileUrl = FlexibleLocation.resolveLocation(fileUrl, null); - String urlStr = screenFileUrl.toString(); - URI uri = new URI(urlStr); - File f = new File(uri); - - FileReader templateReader = new FileReader(f); - - Configuration conf = makeDefaultOfbizConfig(); - - template = new Template("FMImportFilter", templateReader, conf); - + URL screenFileUrl = FlexibleLocation.resolveLocation(fileUrl, null); + String urlStr = screenFileUrl.toString(); + URI uri = new URI(urlStr); + File f = new File(uri); + FileReader templateReader = new FileReader(f); + Configuration conf = makeDefaultOfbizConfig(); + template = new Template("FMImportFilter", templateReader, conf); return template; } Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/WfsViewHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/WfsViewHandler.java?rev=567558&r1=567557&r2=567558&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/WfsViewHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/WfsViewHandler.java Sun Aug 19 23:48:53 2007 @@ -72,18 +72,18 @@ if (Debug.infoOn()) Debug.logInfo("Retreiving HTTP resource at: " + page, module); try { - String result = null; + String result = null; - List entityList = (List)request.getAttribute("entityList"); - SimpleSequence simpleList = new SimpleSequence(entityList); - Map ctx = new HashMap(); - ctx.put("entityList", simpleList); - StringWriter outWriter = new StringWriter(); - Template template = getDocTemplate(page); - template.process(ctx, outWriter); - outWriter.close(); - result = outWriter.toString(); - Debug.logInfo(result, result); + List entityList = (List)request.getAttribute("entityList"); + SimpleSequence simpleList = new SimpleSequence(entityList); + Map ctx = new HashMap(); + ctx.put("entityList", simpleList); + StringWriter outWriter = new StringWriter(); + Template template = getDocTemplate(page); + template.process(ctx, outWriter); + outWriter.close(); + result = outWriter.toString(); + Debug.logInfo(result, result); response.getWriter().print(result); } catch (FileNotFoundException e) { throw new ViewHandlerException(e.getMessage(), e); @@ -97,20 +97,14 @@ } public static Template getDocTemplate(String fileUrl) throws FileNotFoundException, IOException, TemplateException, URISyntaxException { - Template template = null; - URL screenFileUrl = FlexibleLocation.resolveLocation(fileUrl, null); String urlStr = screenFileUrl.toString(); URI uri = new URI(urlStr); File f = new File(uri); - FileReader templateReader = new FileReader(f); - Configuration conf = makeDefaultOfbizConfig(); - template = new Template("FMImportFilter", templateReader, conf); - return template; } |
Free forum by Nabble | Edit this page |