diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 4776aa1a2c..9fccc43fe4 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -651,6 +651,7 @@ selected_templateoutputmethods=Selected Template Output Methods configure_output_methods_step1_desc=Upload template output method and specify the extension to use for its generated assets. template_output_method_file=Template Output Method File extension_for_generated_assets=Extension For Generated Assets +file_extension=Extension schema=Schema schema_root_tag_name=Root Tag edit_xml_schema=Edit XML Schema @@ -1284,4 +1285,4 @@ validation_string_length={0} must be between {1} and {2} characters in length. validation_regex={0} is invalid. validation_regex_not_match={0} is invalid. validation_numeric_range={0} must be between {1} and {2}. -validation_invalid_character=is an invalid character. \ No newline at end of file +validation_invalid_character=is an invalid character. diff --git a/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java index b178a0e525..ca91fd864e 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java @@ -43,7 +43,7 @@ import org.alfresco.service.namespace.QName; import org.alfresco.web.app.Application; import org.alfresco.web.bean.FileUploadBean; import org.alfresco.web.bean.wizard.BaseWizardBean; -import org.alfresco.web.templating.xforms.SchemaFormBuilder; +import org.alfresco.web.templating.xforms.*; import org.alfresco.web.templating.TemplatingService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -59,28 +59,26 @@ public class CreateFormWizard extends BaseWizardBean { ///////////////////////////////////////////////////////////////////////////// - - private static final String FILE_TEMPLATEOUTPUT = "template-output-method"; - - private static final String FILE_SCHEMA = "schema"; - /** * Simple wrapper class to represent a template output method */ - public static class TemplateOutputMethodData + public class TemplateOutputMethodData { private final String fileName; private final File file; private final String fileExtension; + private final Class templateOutputMethodType; public TemplateOutputMethodData(final String fileName, final File file, - final String fileExtension) + final String fileExtension, + final Class templateOutputMethodType) { this.fileName = fileName; this.file = file; this.fileExtension = fileExtension; + this.templateOutputMethodType = templateOutputMethodType; } public String getFileExtension() @@ -97,21 +95,30 @@ public class CreateFormWizard extends BaseWizardBean { return this.file; } - - public String getLabel() + + public Class getTemplateOutputMethodType() { - return this.getFileExtension().toUpperCase() + " (" + this.getFileName() + ")"; + return this.templateOutputMethodType; + } + + public String getTemplateOutputMethodTypeName() + { + return CreateFormWizard.this.getTemplateOutputMethodTypeName(this.getTemplateOutputMethodType()); } } ///////////////////////////////////////////////////////////////////////////// + + private static final String FILE_TEMPLATEOUTPUT = "template-output-method"; + + private static final String FILE_SCHEMA = "schema"; private final static Log LOGGER = LogFactory.getLog(CreateFormWizard.class); private String schemaRootTagName; private String templateName; - private String presentationTemplateType; + private Class templateOutputMethodType = null; protected ContentService contentService; private DataModel templateOutputMethodsDataModel; private List templateOutputMethods = null; @@ -136,14 +143,14 @@ public class CreateFormWizard extends BaseWizardBean this.fileFolderService.create(folderInfo.getNodeRef(), this.getSchemaFileName(), ContentModel.TYPE_CONTENT); - final NodeRef schemaFileNodeRef = fileInfo.getNodeRef(); + final NodeRef schemaNodeRef = fileInfo.getNodeRef(); if (LOGGER.isDebugEnabled()) LOGGER.debug("Created file node for file: " + this.getSchemaFileName()); // get a writer for the content and put the file - ContentWriter writer = this.contentService.getWriter(schemaFileNodeRef, + ContentWriter writer = this.contentService.getWriter(schemaNodeRef, ContentModel.PROP_CONTENT, true); // set the mimetype and encoding @@ -155,24 +162,24 @@ public class CreateFormWizard extends BaseWizardBean Map props = new HashMap(2, 1.0f); props.put(ContentModel.PROP_TITLE, this.getTemplateName()); props.put(ContentModel.PROP_DESCRIPTION, ""); - this.nodeService.addAspect(schemaFileNodeRef, ContentModel.ASPECT_TITLED, props); + this.nodeService.addAspect(schemaNodeRef, ContentModel.ASPECT_TITLED, props); props = new HashMap(1, 1.0f); props.put(WCMModel.PROP_SCHEMA_ROOT_TAG_NAME, this.getSchemaRootTagName()); - this.nodeService.addAspect(schemaFileNodeRef, WCMModel.ASPECT_TEMPLATE, props); + this.nodeService.addAspect(schemaNodeRef, WCMModel.ASPECT_TEMPLATE, props); for (TemplateOutputMethodData tomd : this.templateOutputMethods) { fileInfo = this.fileFolderService.create(folderInfo.getNodeRef(), tomd.getFileName(), ContentModel.TYPE_CONTENT); - final NodeRef presentationTemplateFileNodeRef = fileInfo.getNodeRef(); + final NodeRef templateOutputMethodNodeRef = fileInfo.getNodeRef(); if (LOGGER.isDebugEnabled()) LOGGER.debug("Created file node for file: " + tomd.getFileName()); // get a writer for the content and put the file - writer = this.contentService.getWriter(presentationTemplateFileNodeRef, + writer = this.contentService.getWriter(templateOutputMethodNodeRef, ContentModel.PROP_CONTENT, true); // set the mimetype and encoding @@ -180,15 +187,15 @@ public class CreateFormWizard extends BaseWizardBean writer.setEncoding("UTF-8"); writer.putContent(tomd.getFile()); - this.nodeService.createAssociation(schemaFileNodeRef, - presentationTemplateFileNodeRef, + this.nodeService.createAssociation(schemaNodeRef, + templateOutputMethodNodeRef, WCMModel.ASSOC_TEMPLATE_OUTPUT_METHODS); props = new HashMap(3, 1.0f); - props.put(WCMModel.PROP_TEMPLATE_OUTPUT_METHOD_TYPE, this.getTemplateOutputMethodType()); - props.put(WCMModel.PROP_TEMPLATE_SOURCE, schemaFileNodeRef); + props.put(WCMModel.PROP_TEMPLATE_OUTPUT_METHOD_TYPE, tomd.getTemplateOutputMethodType().getName()); + props.put(WCMModel.PROP_TEMPLATE_SOURCE, schemaNodeRef); props.put(WCMModel.PROP_TEMPLATE_OUTPUT_METHOD_DERIVED_FILE_EXTENSION, tomd.getFileExtension()); - this.nodeService.addAspect(presentationTemplateFileNodeRef, WCMModel.ASPECT_TEMPLATE_OUTPUT_METHOD, props); + this.nodeService.addAspect(templateOutputMethodNodeRef, WCMModel.ASPECT_TEMPLATE_OUTPUT_METHOD, props); } // return the default outcome return outcome; @@ -203,8 +210,9 @@ public class CreateFormWizard extends BaseWizardBean this.removeUploadedTemplateOutputMethodFile(); this.schemaRootTagName = null; this.templateName = null; + this.templateOutputMethodType = null; this.templateOutputMethods = new ArrayList(); - this.fileExtension = "shtml"; + this.fileExtension = null; } @Override @@ -242,7 +250,9 @@ public class CreateFormWizard extends BaseWizardBean */ public boolean getAddToListDisabled() { - return (getTemplateOutputMethodFileName() == null || fileExtension == null || fileExtension.length() == 0); + return (getTemplateOutputMethodFileName() == null || + fileExtension == null || + fileExtension.length() == 0); } /** @@ -276,11 +286,14 @@ public class CreateFormWizard extends BaseWizardBean } final TemplateOutputMethodData data = - new TemplateOutputMethodData(this.getTemplateOutputMethodFileName(), - this.getTemplateOutputMethodFile(), - this.fileExtension); + this.new TemplateOutputMethodData(this.getTemplateOutputMethodFileName(), + this.getTemplateOutputMethodFile(), + this.fileExtension, + this.templateOutputMethodType); this.templateOutputMethods.add(data); this.removeUploadedTemplateOutputMethodFile(); + this.templateOutputMethodType = null; + this.fileExtension = null; } /** @@ -345,21 +358,53 @@ public class CreateFormWizard extends BaseWizardBean */ public String getTemplateOutputMethodType() { - if (this.getTemplateOutputMethodFileName() != null) + if (this.templateOutputMethodType == null && + this.getTemplateOutputMethodFileName() != null) { - // String s = this.getTemplateOutputMethodFileName(); - // String extension = - this.presentationTemplateType = "XSL"; + this.templateOutputMethodType = + (this.getTemplateOutputMethodFileName().endsWith(".xsl") + ? XSLTOutputMethod.class + : (this.getTemplateOutputMethodFileName().endsWith(".ftl") + ? FreeMarkerOutputMethod.class + : null)); } - return this.presentationTemplateType; + return (this.templateOutputMethodType == null + ? null + : this.templateOutputMethodType.getName()); } /** - * @param presentationTemplateType Sets the currently selected mime type + * @param templateOutputMethodType Sets the currently selected mime type */ - public void setTemplateOutputMethodType(String presentationTemplateType) + public void setTemplateOutputMethodType(final String templateOutputMethodType) + throws ClassNotFoundException { - this.presentationTemplateType = presentationTemplateType; + this.templateOutputMethodType = (templateOutputMethodType == null + ? null + : Class.forName(templateOutputMethodType)); + } + + /** + * @return Returns a list of mime types to allow the user to select from + */ + public List getTemplateOutputMethodTypeChoices() + { + return (List)Arrays.asList(new SelectItem[] + { + new SelectItem(FreeMarkerOutputMethod.class.getName(), + getTemplateOutputMethodTypeName(FreeMarkerOutputMethod.class)), + new SelectItem(XSLTOutputMethod.class.getName(), + getTemplateOutputMethodTypeName(XSLTOutputMethod.class)) + }); + } + + private String getTemplateOutputMethodTypeName(Class type) + { + return (FreeMarkerOutputMethod.class.equals(type) + ? "FreeMarker" + : (XSLTOutputMethod.class.equals(type) + ? "XSLT" + : null)); } private FileUploadBean getFileUploadBean(final String id) @@ -489,17 +534,6 @@ public class CreateFormWizard extends BaseWizardBean ? this.getSchemaFileName().replaceAll("(.+)\\..*", "$1") : this.templateName); } - - /** - * @return Returns a list of mime types to allow the user to select from - */ - public List getCreateTemplateOutputMethodTypes() - { - return (List)Arrays.asList(new SelectItem[] { - new SelectItem("freemarker", "FreeMarker"), - new SelectItem("xslt", "XSLT") - }); - } /** * @return Returns the summary data for the wizard. diff --git a/source/java/org/alfresco/web/templating/TemplatingService.java b/source/java/org/alfresco/web/templating/TemplatingService.java index 1812a96de4..8baf9cbf7d 100644 --- a/source/java/org/alfresco/web/templating/TemplatingService.java +++ b/source/java/org/alfresco/web/templating/TemplatingService.java @@ -17,6 +17,7 @@ package org.alfresco.web.templating; import java.io.*; +import java.lang.reflect.Constructor; import java.util.*; import javax.xml.parsers.*; @@ -37,7 +38,6 @@ import org.alfresco.service.cmr.repository.ContentService; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.model.ContentModel; import org.alfresco.model.WCMModel; -import org.alfresco.util.TempFileProvider; import org.alfresco.service.ServiceRegistry; import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.repository.AssociationRef; @@ -213,10 +213,24 @@ public final class TemplatingService implements Serializable for (AssociationRef assoc : this.nodeService.getTargetAssocs(schemaNodeRef, WCMModel.ASSOC_TEMPLATE_OUTPUT_METHODS)) { - final NodeRef xslNodeRef = assoc.getTargetRef(); - final TemplateOutputMethod tom = new XSLTOutputMethod(xslNodeRef, this.nodeService); - LOGGER.debug("loaded template output method " + tom.getFileExtension() + ", " + xslNodeRef); - tt.addOutputMethod(tom); + final NodeRef tomNodeRef = assoc.getTargetRef(); + try + { + final Class templateOutputMethodType = + Class.forName((String)this.nodeService.getProperty(tomNodeRef, + WCMModel.PROP_TEMPLATE_OUTPUT_METHOD_TYPE)); + + final Constructor c = templateOutputMethodType.getConstructor(NodeRef.class, NodeService.class, ContentService.class); + final TemplateOutputMethod tom = (TemplateOutputMethod) + c.newInstance(tomNodeRef, this.nodeService, this.contentService); + LOGGER.debug("loaded template output method type " + tom.getClass().getName() + + " for extension " + tom.getFileExtension() + ", " + tomNodeRef); + tt.addOutputMethod(tom); + } + catch (Exception e) + { + LOGGER.error(e); + } } return tt; } diff --git a/source/java/org/alfresco/web/templating/xforms/FreeMarkerOutputMethod.java b/source/java/org/alfresco/web/templating/xforms/FreeMarkerOutputMethod.java index 1ef78f806d..4c8ad2c24c 100644 --- a/source/java/org/alfresco/web/templating/xforms/FreeMarkerOutputMethod.java +++ b/source/java/org/alfresco/web/templating/xforms/FreeMarkerOutputMethod.java @@ -16,11 +16,22 @@ */ package org.alfresco.web.templating.xforms; +import freemarker.ext.dom.NodeModel; +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateException; +import freemarker.template.TemplateExceptionHandler; import java.io.*; +import java.util.HashMap; import java.util.Map; +import org.alfresco.model.ContentModel; +import org.alfresco.model.WCMModel; +import org.alfresco.service.cmr.repository.ContentReader; +import org.alfresco.service.cmr.repository.ContentService; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.web.templating.*; import org.chiba.xml.util.DOMUtil; - import org.w3c.dom.Document; import org.w3c.dom.Node; @@ -28,19 +39,43 @@ public class FreeMarkerOutputMethod implements TemplateOutputMethod { - public FreeMarkerOutputMethod() + private final NodeRef nodeRef; + private final NodeService nodeService; + private final ContentService contentService; + + public FreeMarkerOutputMethod(final NodeRef nodeRef, + final NodeService nodeService, + final ContentService contentService) { + this.nodeRef = nodeRef; + this.nodeService = nodeService; + this.contentService = contentService; } public void generate(final Document xmlContent, final TemplateType tt, final Map parameters, final Writer out) + throws IOException, + TemplateException { + final ContentReader contentReader = + this.contentService.getReader(nodeRef, ContentModel.TYPE_CONTENT); + final Reader reader = new InputStreamReader(contentReader.getContentInputStream()); + final Configuration cfg = new Configuration(); + cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); + + final Template t = new Template("freemarker_template", reader, cfg); + final Map root = new HashMap(); + root.put("doc", NodeModel.wrap(xmlContent)); + t.process(root, out); + out.flush(); } public String getFileExtension() { - return "unimpleemnted"; + return (String) + this.nodeService.getProperty(this.nodeRef, + WCMModel.PROP_TEMPLATE_OUTPUT_METHOD_DERIVED_FILE_EXTENSION); } } diff --git a/source/java/org/alfresco/web/templating/xforms/XSLTOutputMethod.java b/source/java/org/alfresco/web/templating/xforms/XSLTOutputMethod.java index fba24b598b..74dc93e96d 100644 --- a/source/java/org/alfresco/web/templating/xforms/XSLTOutputMethod.java +++ b/source/java/org/alfresco/web/templating/xforms/XSLTOutputMethod.java @@ -19,8 +19,7 @@ package org.alfresco.web.templating.xforms; import java.io.*; import java.net.URI; import java.net.URISyntaxException; -import org.alfresco.web.templating.*; -import org.chiba.xml.util.DOMUtil; +import java.util.Map; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Source; import javax.xml.transform.Templates; @@ -32,18 +31,19 @@ import javax.xml.transform.URIResolver; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.sax.SAXTransformerFactory; import javax.xml.transform.sax.TransformerHandler; -import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import org.alfresco.model.WCMModel; +import org.alfresco.service.cmr.repository.ContentService; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.web.templating.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.alfresco.model.WCMModel; -import org.alfresco.service.cmr.repository.NodeService; - +import org.chiba.xml.util.DOMUtil; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.xml.sax.SAXException; -import org.alfresco.service.cmr.repository.NodeRef; -import java.util.Map; public class XSLTOutputMethod implements TemplateOutputMethod @@ -55,7 +55,8 @@ public class XSLTOutputMethod private final NodeService nodeService; public XSLTOutputMethod(final NodeRef nodeRef, - final NodeService nodeService) + final NodeService nodeService, + final ContentService contentService) { this.nodeRef = nodeRef; this.nodeService = nodeService; diff --git a/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/CompanyFooterBean.java b/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/CompanyFooterBean.java index e12e102d11..f39062eff4 100644 --- a/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/CompanyFooterBean.java +++ b/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/CompanyFooterBean.java @@ -16,8 +16,32 @@ */ package org.alfresco.web.pr; +import java.util.*; +import javax.servlet.jsp.PageContext; +import org.w3c.dom.*; + public class CompanyFooterBean { + + public static List getCompanyFooters(final PageContext pageContext) + throws Exception + { + final Map entries = Util.loadXMLDocuments(pageContext, + "/media/releases/content/company_footers", + "alfresco:company-footer"); + final List result = new ArrayList(entries.size()); + for (Map.Entry entry : entries.entrySet()) + { + String fileName = entry.getKey(); + Document d = entry.getValue(); + Element n = (Element)d.getElementsByTagName("alfresco:name").item(0); + String href = "/media/releases/content/company_footers/" + fileName; + result.add(new CompanyFooterBean(n.getFirstChild().getNodeValue(), + href)); + } + return result; + } + private final String name; private final String href; diff --git a/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/PressReleaseBean.java b/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/PressReleaseBean.java index 150b51839c..6655fa3adf 100644 --- a/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/PressReleaseBean.java +++ b/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/PressReleaseBean.java @@ -16,10 +16,38 @@ */ package org.alfresco.web.pr; -import java.util.Date; +import java.util.*; +import java.text.*; +import javax.servlet.jsp.PageContext; +import org.w3c.dom.*; public class PressReleaseBean { + public static List getPressReleases(final PageContext pageContext) + throws Exception + { + final Map entries = Util.loadXMLDocuments(pageContext, + "/media/releases/content", + "alfresco:press-release"); + final List result = new ArrayList(entries.size()); + for (Map.Entry entry : entries.entrySet() ) + { + String fileName = entry.getKey(); + Document d = entry.getValue(); + Element t = (Element)d.getElementsByTagName("alfresco:title").item(0); + Element a = (Element)d.getElementsByTagName("alfresco:abstract").item(0); + Element dateEl = (Element)d.getElementsByTagName("alfresco:launch_date").item(0); + Date date = new SimpleDateFormat("yyyy-MM-dd").parse(dateEl.getFirstChild().getNodeValue()); + String href = "/media/releases/content/" + fileName; + href = href.replaceAll(".xml$", ".shtml"); + result.add(new PressReleaseBean(t.getFirstChild().getNodeValue(), + a.getFirstChild().getNodeValue(), + date, + href)); + } + return result; + } + private final String title; private final String theAbstract; private final Date launchDate; diff --git a/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/Util.java b/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/Util.java index c61a0bedb1..0024bd9aed 100644 --- a/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/Util.java +++ b/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/Util.java @@ -26,57 +26,13 @@ import org.alfresco.repo.avm.AVMRemote; import org.alfresco.service.cmr.avm.AVMNodeDescriptor; import org.w3c.dom.*; import javax.xml.parsers.*; -import java.text.*; public class Util { - public static List getPressReleases(final PageContext pageContext) - throws Exception - { - final Map entries = Util.loadXMLDocuments(pageContext, - "/media/releases/content", - "alfresco:press-release"); - final List result = new ArrayList(entries.size()); - for (Map.Entry entry : entries.entrySet() ) - { - String fileName = entry.getKey(); - Document d = entry.getValue(); - Element t = (Element)d.getElementsByTagName("alfresco:title").item(0); - Element a = (Element)d.getElementsByTagName("alfresco:abstract").item(0); - Element dateEl = (Element)d.getElementsByTagName("alfresco:launch_date").item(0); - Date date = new SimpleDateFormat("yyyy-MM-dd").parse(dateEl.getFirstChild().getNodeValue()); - String href = "/media/releases/content/" + fileName; - href = href.replaceAll(".xml$", ".shtml"); - result.add(new PressReleaseBean(t.getFirstChild().getNodeValue(), - a.getFirstChild().getNodeValue(), - date, - href)); - } - return result; - } - public static List getCompanyFooters(final PageContext pageContext) - throws Exception - { - final Map entries = Util.loadXMLDocuments(pageContext, - "/media/releases/content/company_footers", - "alfresco:company-footer"); - final List result = new ArrayList(entries.size()); - for (Map.Entry entry : entries.entrySet()) - { - String fileName = entry.getKey(); - Document d = entry.getValue(); - Element n = (Element)d.getElementsByTagName("alfresco:name").item(0); - String href = "/media/releases/content/company_footers/" + fileName; - result.add(new CompanyFooterBean(n.getFirstChild().getNodeValue(), - href)); - } - return result; - } - - private static Map loadXMLDocuments(final PageContext pageContext, - final String path, - final String documentElementNodeName) + public static Map loadXMLDocuments(final PageContext pageContext, + final String path, + final String documentElementNodeName) throws Exception { final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); diff --git a/source/test-resources/websites/alfresco/ROOT/WEB-INF/pr.tld b/source/test-resources/websites/alfresco/ROOT/WEB-INF/pr.tld index 2b26a7e27e..a39468dda3 100644 --- a/source/test-resources/websites/alfresco/ROOT/WEB-INF/pr.tld +++ b/source/test-resources/websites/alfresco/ROOT/WEB-INF/pr.tld @@ -10,12 +10,12 @@ http://www.alfresco.org/pr getPressReleases - org.alfresco.web.pr.Util + org.alfresco.web.pr.PressReleaseBean java.util.List getPressReleases(javax.servlet.jsp.PageContext) getCompanyFooters - org.alfresco.web.pr.Util + org.alfresco.web.pr.CompanyFooterBean java.util.List getCompanyFooters(javax.servlet.jsp.PageContext) diff --git a/source/test-resources/xforms/demos/press-release/company-footer.xsd b/source/test-resources/xforms/demos/press-release/company-footer.xsd index 0be0ab4d9b..7601d0b4a8 100644 --- a/source/test-resources/xforms/demos/press-release/company-footer.xsd +++ b/source/test-resources/xforms/demos/press-release/company-footer.xsd @@ -1,10 +1,8 @@ - diff --git a/source/test-resources/xforms/unit-tests/simple-test/simple-test.ftl b/source/test-resources/xforms/unit-tests/simple-test/simple-test.ftl new file mode 100644 index 0000000000..75e06f2e6d --- /dev/null +++ b/source/test-resources/xforms/unit-tests/simple-test/simple-test.ftl @@ -0,0 +1,27 @@ + + + + Simple Test + + +
Generated by simple-test.ftl
+
+ Captured string value: + ${doc.simple.string} +
+ + diff --git a/source/test-resources/xforms/unit-tests/simple-test/simple-test.xsd b/source/test-resources/xforms/unit-tests/simple-test/simple-test.xsd index b8a4f8263c..bb2ca1c8dd 100644 --- a/source/test-resources/xforms/unit-tests/simple-test/simple-test.xsd +++ b/source/test-resources/xforms/unit-tests/simple-test/simple-test.xsd @@ -1,7 +1,7 @@ - + diff --git a/source/test-resources/xforms/unit-tests/simple-test/simple-test.xsl b/source/test-resources/xforms/unit-tests/simple-test/simple-test.xsl index da5fbaafa9..0d3fcc1d1d 100644 --- a/source/test-resources/xforms/unit-tests/simple-test/simple-test.xsl +++ b/source/test-resources/xforms/unit-tests/simple-test/simple-test.xsl @@ -30,11 +30,16 @@ body Simple Test +
Generated by simple-test.xsl
+ - -
Captured string value:
+ +
+ Captured string value: + +
diff --git a/source/web/jsp/wcm/create-form-wizard/configure-template-output-methods.jsp b/source/web/jsp/wcm/create-form-wizard/configure-template-output-methods.jsp index c2256abf92..10ba74c04b 100644 --- a/source/web/jsp/wcm/create-form-wizard/configure-template-output-methods.jsp +++ b/source/web/jsp/wcm/create-form-wizard/configure-template-output-methods.jsp @@ -46,22 +46,13 @@ - <%-- - - - - - - --%> - <% -FileUploadBean upload = (FileUploadBean) -session.getAttribute(FileUploadBean.getKey("template-output-method")); +final FileUploadBean upload = (FileUploadBean) + session.getAttribute(FileUploadBean.getKey("template-output-method")); if (upload == null || upload.getFile() == null) { %> @@ -80,12 +71,22 @@ if (upload == null || upload.getFile() == null) <% } %> + + + + + + + value="/images/icons/required_field.gif" alt="Required Field" /> + maxlength="10" size="10"/> @@ -95,21 +96,37 @@ if (upload == null || upload.getFile() == null) styleClass="wizardButton" disabled="#{WizardManager.bean.addToListDisabled}" /> + styleClass="mainSubText" + value="#{msg.selected_templateoutputmethods}" /> - + - + + + + + + + + + + + + + - + diff --git a/source/web/jsp/wcm/edit-xml-inline.jsp b/source/web/jsp/wcm/edit-xml-inline.jsp index e6e2403f12..259fe8f287 100644 --- a/source/web/jsp/wcm/edit-xml-inline.jsp +++ b/source/web/jsp/wcm/edit-xml-inline.jsp @@ -29,7 +29,6 @@ org.alfresco.web.templating.*" %> <%@ page import="java.io.*" %> <%@ page import="org.alfresco.web.app.Application" %> -<%@ page import="org.alfresco.web.bean.content.CreateXmlContentTypeWizard" %> <%@ page import="org.alfresco.web.templating.*" %> <%@ page import="org.w3c.dom.Document" %> <% @@ -192,4 +191,4 @@ function _xforms_getSubmitButtons() - \ No newline at end of file +