diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 2fbe07f08d..5125b5f0c3 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -636,6 +636,7 @@ create_xml_content_type_step2_title=Edit the XML Schema create_xml_content_type_step2_desc=This is the generated XForm based on the schema provided. edit_xml_schema=Edit XML Schema template_type=Template Type +configure_presentation_templates=Configure Presentation Templates # Rule and Action Wizard messages run_action_title=Run Action Wizard diff --git a/config/alfresco/web-client-config-wizards.xml b/config/alfresco/web-client-config-wizards.xml index d648b35119..8809ed8785 100644 --- a/config/alfresco/web-client-config-wizards.xml +++ b/config/alfresco/web-client-config-wizards.xml @@ -182,7 +182,7 @@ - diff --git a/source/java/org/alfresco/web/app/servlet/UploadFileServlet.java b/source/java/org/alfresco/web/app/servlet/UploadFileServlet.java index a27a73bdcb..d891e7762f 100644 --- a/source/java/org/alfresco/web/app/servlet/UploadFileServlet.java +++ b/source/java/org/alfresco/web/app/servlet/UploadFileServlet.java @@ -53,6 +53,7 @@ public class UploadFileServlet extends BaseServlet protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String uploadId = null; String returnPage = null; boolean isMultipart = ServletFileUpload.isMultipartContent(request); @@ -92,6 +93,10 @@ public class UploadFileServlet extends BaseServlet { returnPage = item.getString(); } + else if (item.getFieldName().equalsIgnoreCase("upload-id")) + { + uploadId = item.getString(); + } } else { @@ -121,9 +126,10 @@ public class UploadFileServlet extends BaseServlet bean.setFile(tempFile); bean.setFileName(filename); bean.setFilePath(tempFile.getAbsolutePath()); - session.setAttribute(FileUploadBean.FILE_UPLOAD_BEAN_NAME, bean); + session.setAttribute(FileUploadBean.getKey(uploadId), bean); if (logger.isDebugEnabled()) - logger.debug("Temp file: " + tempFile.getAbsolutePath() + " created from upload filename: " + filename); + logger.debug("Temp file: " + tempFile.getAbsolutePath() + + " created from upload filename: " + filename); } } } diff --git a/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java b/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java index fd9bef3624..c517224af3 100644 --- a/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java +++ b/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java @@ -565,7 +565,9 @@ public class CheckinCheckoutBean MimetypeMap.MIMETYPE_JAVASCRIPT.equals(mimetype)) { // make content available to the editing screen - setEditorOutput(reader.getContentString()); + String contentString = reader.getContentString(); + setDocumentContent(contentString); + setEditorOutput(contentString); // navigate to appropriate screen FacesContext fc = FacesContext.getCurrentInstance(); diff --git a/source/java/org/alfresco/web/bean/FileUploadBean.java b/source/java/org/alfresco/web/bean/FileUploadBean.java index fc0a5cff7d..3fe5ab0c46 100644 --- a/source/java/org/alfresco/web/bean/FileUploadBean.java +++ b/source/java/org/alfresco/web/bean/FileUploadBean.java @@ -25,7 +25,15 @@ import java.io.File; */ public final class FileUploadBean { + public static final String FILE_UPLOAD_BEAN_NAME = "alfresco.UploadBean"; + + public static String getKey(final String id) + { + return (id == null + ? FILE_UPLOAD_BEAN_NAME + : FILE_UPLOAD_BEAN_NAME + "-" + id); + } private File file; private String fileName; diff --git a/source/java/org/alfresco/web/bean/content/BaseContentWizard.java b/source/java/org/alfresco/web/bean/content/BaseContentWizard.java index 85282dd709..1c1ff1d8e8 100644 --- a/source/java/org/alfresco/web/bean/content/BaseContentWizard.java +++ b/source/java/org/alfresco/web/bean/content/BaseContentWizard.java @@ -77,16 +77,9 @@ public abstract class BaseContentWizard extends BaseWizardBean @Override public boolean getFinishButtonDisabled() { - if (this.fileName == null || - this.fileName.length() == 0 || - this.mimeType == null) - { - return true; - } - else - { - return false; - } + return (this.fileName == null || + this.fileName.length() == 0 || + this.mimeType == null); } // ------------------------------------------------------------------------------ @@ -331,7 +324,7 @@ public abstract class BaseContentWizard extends BaseWizardBean // ------------------------------------------------------------------------------ // Helper methods - + /** * Save the specified content using the currently set wizard attributes * @@ -341,21 +334,12 @@ public abstract class BaseContentWizard extends BaseWizardBean protected void saveContent(File fileContent, String strContent) throws Exception { // get the node ref of the node that will contain the content - NodeRef containerNodeRef; - String nodeId = this.navigator.getCurrentNodeId(); - if (nodeId == null) - { - containerNodeRef = this.nodeService.getRootNode(Repository.getStoreRef()); - } - else - { - containerNodeRef = new NodeRef(Repository.getStoreRef(), nodeId); - } + NodeRef containerNodeRef = this.getContainerNodeRef(); - FileInfo fileInfo = this.fileFolderService.create( - containerNodeRef, - this.fileName, - Repository.resolveToQName(this.objectType)); + FileInfo fileInfo = + this.fileFolderService.create(containerNodeRef, + this.fileName, + Repository.resolveToQName(this.objectType)); NodeRef fileNodeRef = fileInfo.getNodeRef(); // set the author aspect @@ -395,13 +379,9 @@ public abstract class BaseContentWizard extends BaseWizardBean { writer.putContent(fileContent); } - else if (strContent != null) + else { - writer.putContent(strContent); - } - else - { - writer.putContent(""); + writer.putContent(strContent == null ? "" : strContent); } // remember the created node now diff --git a/source/java/org/alfresco/web/bean/content/CreateContentWizard.java b/source/java/org/alfresco/web/bean/content/CreateContentWizard.java index dc31edfa70..bd135a81e4 100644 --- a/source/java/org/alfresco/web/bean/content/CreateContentWizard.java +++ b/source/java/org/alfresco/web/bean/content/CreateContentWizard.java @@ -39,6 +39,12 @@ import org.alfresco.web.templating.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.alfresco.model.ContentModel; +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.ContentWriter; +import java.io.OutputStreamWriter; + /** * Bean implementation for the "Create Content Wizard" dialog * @@ -46,11 +52,13 @@ import org.apache.commons.logging.LogFactory; */ public class CreateContentWizard extends BaseContentWizard { - protected String content = null; + protected String content = null; protected String templateType; - protected List createMimeTypes; - - private static Log logger = LogFactory.getLog(CreateContentWizard.class); + protected List createMimeTypes; + + private static final Log LOGGER = + LogFactory.getLog(CreateContentWizard.class); + public static final org.alfresco.service.namespace.QName TT_QNAME = org.alfresco.service.namespace.QName.createQName(org.alfresco.service.namespace.NamespaceService.CONTENT_MODEL_1_0_URI, "tt"); @@ -61,12 +69,55 @@ public class CreateContentWizard extends BaseContentWizard protected String finishImpl(FacesContext context, String outcome) throws Exception { + LOGGER.debug("saving file content to " + this.fileName); saveContent(null, this.content); - if (templateType != null) - this.nodeService.setProperty(createdNode, TT_QNAME, templateType); + if (this.templateType != null) + { + LOGGER.debug("generating template output for " + this.templateType); + this.nodeService.setProperty(this.createdNode, TT_QNAME, this.templateType); + TemplatingService ts = TemplatingService.getInstance(); + TemplateType tt = ts.getTemplateType(this.templateType); + if (tt.getOutputMethods().size() != 0) + { + try { + // get the node ref of the node that will contain the content + NodeRef containerNodeRef = this.getContainerNodeRef(); + final String fileName = this.fileName + "-generated.html"; + FileInfo fileInfo = + this.fileFolderService.create(containerNodeRef, + fileName, + ContentModel.TYPE_CONTENT); + NodeRef fileNodeRef = fileInfo.getNodeRef(); + + if (LOGGER.isDebugEnabled()) + LOGGER.debug("Created file node for file: " + + fileName); + + // get a writer for the content and put the file + ContentWriter writer = contentService.getWriter(fileNodeRef, + ContentModel.PROP_CONTENT, true); + // set the mimetype and encoding + writer.setMimetype("text/html"); + writer.setEncoding("UTF-8"); + TemplateOutputMethod tom = tt.getOutputMethods().get(0); + OutputStreamWriter out = + new OutputStreamWriter(writer.getContentOutputStream()); + tom.generate(ts.parseXML(this.content), tt, out); + out.close(); + this.nodeService.setProperty(fileNodeRef, TT_QNAME, this.templateType); - // return the default outcome - return outcome; + LOGGER.debug("generated " + fileName + " using " + tom); + } + catch (Exception e) + { + e.printStackTrace(); + throw e; + } + } + } + + // return the default outcome + return outcome; } @Override @@ -189,12 +240,12 @@ public class CreateContentWizard extends BaseContentWizard } else { - logger.warn("Could not find 'create-mime-types' configuration element"); + LOGGER.warn("Could not find 'create-mime-types' configuration element"); } } else { - logger.warn("Could not find 'Content Wizards' configuration section"); + LOGGER.warn("Could not find 'Content Wizards' configuration section"); } } diff --git a/source/java/org/alfresco/web/bean/content/CreateXmlContentTypeWizard.java b/source/java/org/alfresco/web/bean/content/CreateXmlContentTypeWizard.java index 52ce7f6712..c429da6c10 100644 --- a/source/java/org/alfresco/web/bean/content/CreateXmlContentTypeWizard.java +++ b/source/java/org/alfresco/web/bean/content/CreateXmlContentTypeWizard.java @@ -17,44 +17,51 @@ package org.alfresco.web.bean.content; import java.io.*; - -import java.util.Map; -import java.util.ResourceBundle; - +import java.util.*; import javax.faces.context.FacesContext; import javax.faces.event.ValueChangeEvent; import javax.faces.model.SelectItem; import javax.servlet.ServletContext; - +import javax.xml.parsers.ParserConfigurationException; import org.alfresco.config.Config; import org.alfresco.config.ConfigElement; import org.alfresco.config.ConfigService; +import org.alfresco.model.ContentModel; import org.alfresco.repo.content.MimetypeMap; +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.repository.ContentService; +import org.alfresco.service.cmr.repository.ContentWriter; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.namespace.QName; import org.alfresco.web.app.AlfrescoNavigationHandler; import org.alfresco.web.app.Application; import org.alfresco.web.bean.FileUploadBean; import org.alfresco.web.bean.repository.Node; +import org.alfresco.web.bean.repository.Repository; +import org.alfresco.web.bean.wizard.BaseWizardBean; import org.alfresco.web.data.IDataContainer; import org.alfresco.web.data.QuickSort; -import org.alfresco.web.ui.common.Utils; import org.alfresco.web.templating.*; - +import org.alfresco.web.templating.xforms.*; +import org.alfresco.web.ui.common.Utils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.w3c.dom.Document; - +import org.xml.sax.SAXException; /** * Bean implementation for the "Create Content Wizard" dialog * * @author arielb */ -public class CreateXmlContentTypeWizard extends BaseContentWizard +public class CreateXmlContentTypeWizard extends BaseWizardBean { - private final static Log logger = LogFactory.getLog(CreateXmlContentTypeWizard.class); - private TemplateType tt; + private final static Log LOGGER = + LogFactory.getLog(CreateXmlContentTypeWizard.class); + + private String presentationTemplateType; + protected ContentService contentService; // ------------------------------------------------------------------------------ // Wizard implementation @@ -63,10 +70,47 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard protected String finishImpl(FacesContext context, String outcome) throws Exception { + // get the node ref of the node that will contain the content + NodeRef containerNodeRef = this.getContainerNodeRef(); + + FileInfo fileInfo = + this.fileFolderService.create(containerNodeRef, + this.getSchemaFileName(), + ContentModel.TYPE_CONTENT); + NodeRef fileNodeRef = fileInfo.getNodeRef(); + + if (LOGGER.isDebugEnabled()) + LOGGER.debug("Created file node for file: " + + this.getSchemaFileName()); - saveContent(this.getSchemaFile(), null); + // get a writer for the content and put the file + ContentWriter writer = contentService.getWriter(fileNodeRef, + ContentModel.PROP_CONTENT, true); + // set the mimetype and encoding + writer.setMimetype("text/xml"); + writer.setEncoding("UTF-8"); + writer.putContent(this.getSchemaFile()); + + fileInfo = this.fileFolderService.create(containerNodeRef, + this.getPresentationTemplateFileName(), + ContentModel.TYPE_CONTENT); + fileNodeRef = fileInfo.getNodeRef(); + + if (LOGGER.isDebugEnabled()) + LOGGER.debug("Created file node for file: " + + this.getPresentationTemplateFileName()); + + // get a writer for the content and put the file + writer = contentService.getWriter(fileNodeRef, + ContentModel.PROP_CONTENT, true); + // set the mimetype and encoding + writer.setMimetype("text/xml"); + writer.setEncoding("UTF-8"); + writer.putContent(this.getPresentationTemplateFile()); + final TemplatingService ts = TemplatingService.getInstance(); - ts.registerTemplateType(tt); + ts.registerTemplateType(this.getTemplateType()); + // return the default outcome return outcome; } @@ -76,14 +120,15 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard { super.init(parameters); - this.mimeType = "text/xml"; - this.clearUpload(); + this.removeUploadedSchemaFile(); + this.removeUploadedPresentationTemplateFile(); } @Override public String cancel() { - this.clearUpload(); + this.removeUploadedSchemaFile(); + this.removeUploadedPresentationTemplateFile(); return super.cancel(); } @@ -100,7 +145,8 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard { case 1: { - disabled = (this.fileName == null || this.fileName.length() == 0); + disabled = (this.getSchemaFileName() == null || + this.getSchemaFileName().length() == 0); break; } } @@ -108,32 +154,43 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard return disabled; } - @Override - protected String doPostCommitProcessing(FacesContext context, String outcome) +// @Override +// protected String doPostCommitProcessing(FacesContext context, String outcome) +// { +// // as we were successful, go to the set properties dialog if asked +// // to otherwise just return +// if (this.showOtherProperties) +// { +// // we are going to immediately edit the properties so we need +// // to setup the BrowseBean context appropriately +// this.browseBean.setDocument(new Node(this.createdNode)); +// +// return getDefaultFinishOutcome() + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + +// "dialog:setContentProperties"; +// } +// else +// { +// return outcome; +// } +// } + + /** + * Action handler called when the user wishes to remove an uploaded file + */ + public String removeUploadedSchemaFile() { - // as we were successful, go to the set properties dialog if asked - // to otherwise just return - if (this.showOtherProperties) - { - // we are going to immediately edit the properties so we need - // to setup the BrowseBean context appropriately - this.browseBean.setDocument(new Node(this.createdNode)); + clearUpload("schema"); - return getDefaultFinishOutcome() + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + - "dialog:setContentProperties"; - } - else - { - return outcome; - } + // refresh the current page + return null; } /** * Action handler called when the user wishes to remove an uploaded file */ - public String removeUploadedFile() + public String removeUploadedPresentationTemplateFile() { - clearUpload(); + clearUpload("pt"); // refresh the current page return null; @@ -141,38 +198,50 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard // ------------------------------------------------------------------------------ // Bean Getters and Setters + + /** + * @return Returns the mime type currenty selected + */ + public String getPresentationTemplateType() + { + return this.presentationTemplateType; + } + + /** + * @param presentationTemplateType Sets the currently selected mime type + */ + public void setPresentationTemplateType(String presentationTemplateType) + { + this.presentationTemplateType = presentationTemplateType; + } - private FileUploadBean getFileUploadBean() + private FileUploadBean getFileUploadBean(final String id) { final FacesContext ctx = FacesContext.getCurrentInstance(); final Map sessionMap = ctx.getExternalContext().getSessionMap(); - return (FileUploadBean)sessionMap.get(FileUploadBean.FILE_UPLOAD_BEAN_NAME); + return (FileUploadBean)sessionMap.get(FileUploadBean.getKey(id)); } /** * @return Returns the name of the file */ - public String getFileName() + private String getFileName(final String id) { // try and retrieve the file and filename from the file upload bean // representing the file we previously uploaded. - final FileUploadBean fileBean = this.getFileUploadBean(); - if (fileBean != null) - this.fileName = fileBean.getFileName(); - return this.fileName; + final FileUploadBean fileBean = this.getFileUploadBean(id); + return fileBean == null ? null : fileBean.getFileName(); } /** - * @param fileName The name of the file + * @return Returns the schema file or null */ - public void setFileName(String fileName) + private File getFile(final String id) { - this.fileName = fileName; - - // we also need to keep the file upload bean in sync - final FileUploadBean fileBean = this.getFileUploadBean(); - if (fileBean != null) - fileBean.setFileName(this.fileName); + // try and retrieve the file and filename from the file upload bean + // representing the file we previously uploaded. + final FileUploadBean fileBean = this.getFileUploadBean(id); + return fileBean != null ? fileBean.getFile() : null; } /** @@ -180,19 +249,9 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard */ public File getSchemaFile() { - // try and retrieve the file and filename from the file upload bean - // representing the file we previously uploaded. - final FileUploadBean fileBean = this.getFileUploadBean(); - return fileBean != null ? fileBean.getFile() : null; + return this.getFile("schema"); } - public void setSchemaFile(File f) - { - // we also need to keep the file upload bean in sync - final FileUploadBean fileBean = this.getFileUploadBean(); - if (fileBean != null) - fileBean.setFile(f); - } /** * @return Returns the schema file or null */ @@ -200,25 +259,51 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard { // try and retrieve the file and filename from the file upload bean // representing the file we previously uploaded. - return getFileName(); + return this.getFileName("schema"); } - public void setSchemaFileName(String s) + /** + * @return Returns the schema file or null + */ + public String getPresentationTemplateFileName() { - throw new UnsupportedOperationException(); + return this.getFileName("pt"); + } + + /** + * @return Returns the presentationTemplate file or null + */ + public File getPresentationTemplateFile() + { + return this.getFile("pt"); + } + + public TemplateType getTemplateType() + throws ParserConfigurationException, + SAXException, + IOException + { + if (this.getSchemaFile() == null) + return null; + final TemplatingService ts = TemplatingService.getInstance(); + final String rootTagName = + this.getSchemaFileName().replaceAll("([^\\.])\\..+", "$1"); + final Document d = ts.parseXML(this.getSchemaFile()); + final TemplateType result = ts.newTemplateType(rootTagName, d); + if (this.getPresentationTemplateFile() != null) + { + result .addOutputMethod(new XSLTOutputMethod(this.getPresentationTemplateFile())); + } + return result; } public String getFormURL() { try { - final TemplatingService ts = TemplatingService.getInstance(); - final String rootTagName = - this.getSchemaFileName().replaceAll("([^\\.])\\..+", "$1"); - final Document d = ts.parseXML(this.getSchemaFile()); - this.tt = ts.newTemplateType(rootTagName, d); - final TemplateInputMethod tim = tt.getInputMethods()[0]; - return tim.getInputURL(tt.getSampleXml(rootTagName), tt); + final TemplateType tt = this.getTemplateType(); + final TemplateInputMethod tim = tt.getInputMethods().get(0); + return tim.getInputURL(tt.getSampleXml(tt.getName()), tt); } catch (Throwable t) { @@ -227,24 +312,35 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard } } - public String getSchemaFormURL() - { - try - { - final TemplatingService ts = TemplatingService.getInstance(); - final String rootTagName = - this.getSchemaFileName().replaceAll("([^\\.])\\..+", "$1"); - final Document d = ts.parseXML(this.getSchemaFile()); - this.tt = ts.newTemplateType(rootTagName, d); - final TemplateInputMethod tim = tt.getInputMethods()[0]; - return tim.getSchemaInputURL(tt); - } - catch (Throwable t) - { - t.printStackTrace(); - return null; - } - } +// public String getSchemaFormURL() +// { +// try +// { +// final TemplatingService ts = TemplatingService.getInstance(); +// final String rootTagName = +// this.getSchemaFileName().replaceAll("([^\\.])\\..+", "$1"); +// final Document d = ts.parseXML(this.getSchemaFile()); +// this.tt = ts.newTemplateType(rootTagName, d); +// final TemplateInputMethod tim = tt.getInputMethods()[0]; +// return tim.getSchemaInputURL(tt); +// } +// catch (Throwable t) +// { +// t.printStackTrace(); +// return null; +// } +// } + + /** + * @return Returns a list of mime types to allow the user to select from + */ + public List getCreatePresentationTemplateTypes() + { + return (List)Arrays.asList(new SelectItem[] { + new SelectItem("freemarker", "FreeMarker"), + new SelectItem("xslt", "XSLT") + }); + } /** * @return Returns the summary data for the wizard. @@ -254,12 +350,16 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance()); // TODO: show first few lines of content here? - return buildSummary( - new String[] {bundle.getString("file_name"), - bundle.getString("type"), - bundle.getString("content_type")}, - new String[] {this.fileName, getSummaryObjectType(), - getSummaryMimeType(this.mimeType)}); + return buildSummary(new String[] { + "Schema File", + "Presentation Template Type", + "Presentation Template" + }, + new String[] { + this.getSchemaFileName(), + this.getPresentationTemplateType(), + this.getPresentationTemplateFileName() + }); } // ------------------------------------------------------------------------------ @@ -268,20 +368,28 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard // ------------------------------------------------------------------------------ // Service Injection + /** + * @param contentService The contentService to set. + */ + public void setContentService(ContentService contentService) + { + this.contentService = contentService; + } + // ------------------------------------------------------------------------------ // Helper Methods /** */ - protected void clearUpload() + protected void clearUpload(final String id) { // remove the file upload bean from the session FacesContext ctx = FacesContext.getCurrentInstance(); - FileUploadBean fileBean = (FileUploadBean)ctx.getExternalContext().getSessionMap(). - get(FileUploadBean.FILE_UPLOAD_BEAN_NAME); + FileUploadBean fileBean = (FileUploadBean) + ctx.getExternalContext().getSessionMap(). + get(FileUploadBean.getKey(id)); if (fileBean != null) fileBean.setFile(null); } - } diff --git a/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java b/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java index f2a906d448..b0c4918589 100644 --- a/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java +++ b/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java @@ -9,6 +9,7 @@ import javax.transaction.UserTransaction; import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.model.FileFolderService; +import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.search.SearchService; import org.alfresco.service.namespace.NamespaceService; @@ -255,4 +256,13 @@ public abstract class BaseDialogBean implements IDialogBean FacesContext.getCurrentInstance(), getErrorMessageId()), exception.getMessage()); } + + protected NodeRef getContainerNodeRef() + { + String nodeId = this.navigator.getCurrentNodeId(); + return (nodeId == null + ? this.nodeService.getRootNode(Repository.getStoreRef()) + : new NodeRef(Repository.getStoreRef(), nodeId)); + } + } diff --git a/source/java/org/alfresco/web/templating/TemplateOutputMethod.java b/source/java/org/alfresco/web/templating/TemplateOutputMethod.java index 525f5f93ba..b7827dc836 100644 --- a/source/java/org/alfresco/web/templating/TemplateOutputMethod.java +++ b/source/java/org/alfresco/web/templating/TemplateOutputMethod.java @@ -25,5 +25,6 @@ public interface TemplateOutputMethod public void generate(final Document xmlContent, final TemplateType tt, - final Writer out); + final Writer out) + throws Exception; } diff --git a/source/java/org/alfresco/web/templating/TemplateType.java b/source/java/org/alfresco/web/templating/TemplateType.java index 3c20397253..c03c8f5e94 100644 --- a/source/java/org/alfresco/web/templating/TemplateType.java +++ b/source/java/org/alfresco/web/templating/TemplateType.java @@ -17,6 +17,7 @@ package org.alfresco.web.templating; import org.w3c.dom.Document; +import java.util.List; public interface TemplateType { @@ -27,7 +28,9 @@ public interface TemplateType public Document getSampleXml(final String rootTagName); - public TemplateInputMethod[] getInputMethods(); + public List getInputMethods(); - public TemplateOutputMethod[] getOutputMethods(); + public void addOutputMethod(TemplateOutputMethod output); + + public List getOutputMethods(); } diff --git a/source/java/org/alfresco/web/templating/xforms/TemplateTypeImpl.java b/source/java/org/alfresco/web/templating/xforms/TemplateTypeImpl.java index 5577b94088..3661ddedaf 100644 --- a/source/java/org/alfresco/web/templating/xforms/TemplateTypeImpl.java +++ b/source/java/org/alfresco/web/templating/xforms/TemplateTypeImpl.java @@ -17,6 +17,7 @@ package org.alfresco.web.templating.xforms; import java.io.*; +import java.util.*; import javax.xml.parsers.ParserConfigurationException; import org.alfresco.util.TempFileProvider; @@ -36,6 +37,7 @@ public class TemplateTypeImpl private final Document schema; private final String name; + private final LinkedList outputMethods = new LinkedList(); public TemplateTypeImpl(final String name, final Document schema) @@ -131,15 +133,20 @@ public class TemplateTypeImpl } } - public TemplateInputMethod[] getInputMethods() + public List getInputMethods() { - return new TemplateInputMethod[] { - new XFormsInputMethod() - }; + return (List)Arrays.asList(new TemplateInputMethod[] { + new XFormsInputMethod() + }); } - public TemplateOutputMethod[] getOutputMethods() + public void addOutputMethod(TemplateOutputMethod output) { - return new TemplateOutputMethod[0]; + this.outputMethods.add(output); + } + + public List getOutputMethods() + { + return this.outputMethods; } } \ No newline at end of file diff --git a/source/java/org/alfresco/web/templating/xforms/schemabuilder/AbstractSchemaFormBuilder.java b/source/java/org/alfresco/web/templating/xforms/schemabuilder/AbstractSchemaFormBuilder.java index 823e5ac5f7..7a8b34f999 100644 --- a/source/java/org/alfresco/web/templating/xforms/schemabuilder/AbstractSchemaFormBuilder.java +++ b/source/java/org/alfresco/web/templating/xforms/schemabuilder/AbstractSchemaFormBuilder.java @@ -18,9 +18,6 @@ package org.alfresco.web.templating.xforms.schemabuilder; import org.apache.commons.jxpath.JXPathContext; import org.apache.commons.jxpath.Pointer; -import org.apache.log4j.ConsoleAppender; -import org.apache.log4j.Layout; -import org.apache.log4j.SimpleLayout; import org.apache.xerces.xs.*; import org.chiba.xml.util.DOMUtil; import org.chiba.xml.xforms.NamespaceCtx; @@ -32,8 +29,6 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.*; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; import java.io.File; import java.io.IOException; import java.io.StringWriter; @@ -581,10 +576,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { else if (o != null) { if (LOGGER.isDebugEnabled()) - { LOGGER.debug("DOMImplementation is not a XSImplementation: " + o.getClass().getName()); - } throw new RuntimeException(o.getClass().getName() + " is not a XSImplementation"); } } @@ -834,13 +827,15 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { public void endFormControl(Element controlElement, XSTypeDefinition controlType, int minOccurs, - int maxOccurs) { + int maxOccurs) + { } /** * __UNDOCUMENTED__ */ - public void reset() { + public void reset() + { //refCounter = 0; counter = new HashMap(); setProperty(CSS_STYLE_PROP, DEFAULT_CSS_STYLE_PROP); @@ -1039,35 +1034,26 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { return chibaNSPrefix; } - /* Increments the xforms:ref attribute counter. - * - */ - /*protected long incRefCounter() { - return refCounter++; - }*/ protected String setXFormsId(Element el) { //remove the eventuel "id" attribute - if (el.hasAttributeNS(SchemaFormBuilder.XFORMS_NS, "id")) { + if (el.hasAttributeNS(SchemaFormBuilder.XFORMS_NS, "id")) el.removeAttributeNS(SchemaFormBuilder.XFORMS_NS, "id"); - } //long count=this.incIdCounter(); long count = 0; String name = el.getLocalName(); Long l = (Long) counter.get(name); - if (l != null) { + if (l != null) count = l.longValue(); - } String id = name + "_" + count; //increment the counter counter.put(name, new Long(count + 1)); el.setAttributeNS(SchemaFormBuilder.XFORMS_NS, - this.getXFormsNSPrefix() + "id", - id); - + this.getXFormsNSPrefix() + "id", + id); return id; } @@ -1122,7 +1108,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { Iterator iterator = sortedList.iterator(); - while (iterator.hasNext()) { + while (iterator.hasNext()) + { String textValue = (String) iterator.next(); Element item = xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "item"); @@ -1147,8 +1134,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { protected void addChoicesForSelectSwitchControl(Document xForm, Element choicesElement, Vector choiceValues, - HashMap case_types) { - + HashMap case_types) + { if (LOGGER.isDebugEnabled()) { LOGGER.debug("addChoicesForSelectSwitchControl, values="); Iterator it = choiceValues.iterator(); @@ -1205,9 +1192,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { action.setAttributeNS(XMLEVENTS_NS, xmleventsNSPrefix + "event", "xforms-select"); - Element toggle = - xForm.createElementNS(XFORMS_NS, - getXFormsNSPrefix() + "toggle"); + Element toggle = xForm.createElementNS(XFORMS_NS, + getXFormsNSPrefix() + "toggle"); this.setXFormsId(toggle); //build the case element @@ -1277,10 +1263,6 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { return null; } - private XSModel getSchema() { - return schema; - } - public XSParticle findCorrespondingParticleInComplexType(XSElementDeclaration elDecl) { XSParticle thisParticle = null; @@ -2122,7 +2104,7 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { // //controlType = getSchema().getComplexType((String)enumValues.get(0)); controlType = - getSchema().getTypeDefinition((String) enumValues.get(0), + this.schema.getTypeDefinition((String) enumValues.get(0), targetNamespace); } } else if (LOGGER.isDebugEnabled()) @@ -2544,9 +2526,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { + ", maxOccurs=" + maxOccurs); //repeatSection = (Element) formSection.appendChild(xForm.createElementNS(XFORMS_NS,getXFormsNSPrefix() + "repeat")); - repeatSection = - xForm.createElementNS(XFORMS_NS, - getXFormsNSPrefix() + "repeat"); + repeatSection = xForm.createElementNS(XFORMS_NS, + getXFormsNSPrefix() + "repeat"); //bind instead of repeat //repeatSection.setAttributeNS(XFORMS_NS,getXFormsNSPrefix() + "nodeset",pathToRoot); @@ -2569,19 +2550,18 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { bind = DOMUtil.getLastChildElement(modelSection.getParentNode()); - if ((bind != null) - && (bind.getLocalName() != null) - && bind.getLocalName().equals("bind")) { - bindId = - bind.getAttributeNS(SchemaFormBuilder.XFORMS_NS, "id"); + if ((bind != null) && + (bind.getLocalName() != null) && + bind.getLocalName().equals("bind")) { + bindId = bind.getAttributeNS(SchemaFormBuilder.XFORMS_NS, "id"); } else { LOGGER.warn("addRepeatIfNecessary: bind really not found"); } } repeatSection.setAttributeNS(XFORMS_NS, - getXFormsNSPrefix() + "bind", - bindId); + getXFormsNSPrefix() + "bind", + bindId); this.setXFormsId(repeatSection); //appearance=full is more user friendly @@ -2591,20 +2571,19 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { //triggers this.addTriggersForRepeat(xForm, - formSection, - repeatSection, - minOccurs, - maxOccurs, - bindId); - + formSection, + repeatSection, + minOccurs, + maxOccurs, + bindId); + Element controlWrapper = _wrapper.createControlsWrapper(repeatSection); formSection.appendChild(controlWrapper); //add a group inside the repeat? - Element group = - xForm.createElementNS(XFORMS_NS, - this.getXFormsNSPrefix() + "group"); + Element group = xForm.createElementNS(XFORMS_NS, + this.getXFormsNSPrefix() + "group"); this.setXFormsId(group); repeatSection.appendChild(group); repeatSection = group; @@ -2627,11 +2606,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { int maxOccurs) { if (LOGGER.isDebugEnabled()) - LOGGER.debug("addSimpleType for " - + controlType.getName() - + " (owningElementName=" - + owningElementName - + ")"); + LOGGER.debug("addSimpleType for " + controlType.getName() + + " (owningElementName=" + owningElementName + ")"); // create the element and add it to the model. Element bindElement = xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "bind"); @@ -2656,14 +2632,13 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { } //eventual repeat - Element repeatSection = - addRepeatIfNecessary(xForm, - modelSection, - formSection, - controlType, - minOccurs, - maxOccurs, - pathToRoot); + Element repeatSection = addRepeatIfNecessary(xForm, + modelSection, + formSection, + controlType, + minOccurs, + maxOccurs, + pathToRoot); // create the form control element //put a wrapper for the repeat content, but only if it is really a repeat @@ -2701,14 +2676,13 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { String caption = createCaption(owningElementName); //Element formControl = (Element) contentWrapper.appendChild(createFormControl(xForm,caption,controlType,bindId,bindElement,minOccurs,maxOccurs)); - Element formControl = - createFormControl(xForm, - caption, - controlType, - bindId, - bindElement, - minOccurs, - maxOccurs); + Element formControl = createFormControl(xForm, + caption, + controlType, + bindId, + bindElement, + minOccurs, + maxOccurs); Element controlWrapper = _wrapper.createControlsWrapper(formControl); contentWrapper.appendChild(controlWrapper); @@ -2717,8 +2691,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { // if (!repeatSection.equals(formSection)) { formControl.setAttributeNS(XFORMS_NS, - getXFormsNSPrefix() + "ref", - "."); + getXFormsNSPrefix() + "ref", + "."); } Element hint = createHint(xForm, owner); @@ -2745,14 +2719,14 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { int[] occurance = this.getOccurance(owner); addSimpleType(xForm, - modelSection, - formSection, - controlType, - owner.getName(), - owner, - pathToRoot, - occurance[0], - occurance[1]); + modelSection, + formSection, + controlType, + owner.getName(), + owner, + pathToRoot, + occurance[0], + occurance[1]); } private void addSimpleType(Document xForm, @@ -2763,14 +2737,14 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { String pathToRoot) { addSimpleType(xForm, - modelSection, - formSection, - controlType, - owningAttribute.getAttrDeclaration().getName(), - owningAttribute, - pathToRoot, - owningAttribute.getRequired() ? 1 : 0, - 1); + modelSection, + formSection, + controlType, + owningAttribute.getAttrDeclaration().getName(), + owningAttribute, + pathToRoot, + owningAttribute.getRequired() ? 1 : 0, + 1); } /** @@ -3075,19 +3049,13 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { formControl = createControlForAnyType(xForm, caption, controlType); } - if (formControl == null) { - // default situation - use an input control - // - formControl = - createControlForAtomicType(xForm, - caption, - (XSSimpleTypeDefinition) controlType); - } + if (formControl == null) + formControl = createControlForAtomicType(xForm, + caption, + (XSSimpleTypeDefinition)controlType); startFormControl(formControl, controlType); - formControl.setAttributeNS(XFORMS_NS, - getXFormsNSPrefix() + "bind", - bindId); + formControl.setAttributeNS(XFORMS_NS, getXFormsNSPrefix() + "bind", bindId); //put the label before // no -> put in the "createControlFor..." methods @@ -3153,11 +3121,13 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { //if we use XMLSchema types: //first check if it is a simple type named in the XMLSchema - if (_useSchemaTypes - && controlType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE - && typeName != null && !typeName.equals("") - && schema.getTypeDefinition(typeName, typeNS) != null) { //type is globally defined - //use schema type + if (_useSchemaTypes && + controlType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE && + typeName != null && typeName.length() != 0 && + schema.getTypeDefinition(typeName, typeNS) != null) + { + //type is globally defined + //use schema type //local type name String localTypeName = typeName; @@ -3170,12 +3140,15 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { //completeTypeName = new prefix + local name result = localTypeName; - if (prefix != null && !prefix.equals("")) + if (prefix != null && prefix.length() != 0) result = prefix + ":" + localTypeName; if (LOGGER.isDebugEnabled()) LOGGER.debug("getXFormsTypeName: typeName=" + typeName + ", typeNS=" + typeNS + ", result=" + result); - } else { //use built in type + } + else + { + //use built in type result = this.getDataTypeName(getBuiltInType(controlType)); } return result; @@ -3184,8 +3157,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { private Document createFormTemplate(String formId) throws IOException, ParserConfigurationException { return createFormTemplate(formId, - "Form " + formId, - getProperty(CSS_STYLE_PROP, DEFAULT_CSS_STYLE_PROP)); + "Form " + formId, + getProperty(CSS_STYLE_PROP, DEFAULT_CSS_STYLE_PROP)); } private Document createFormTemplate(String formId, @@ -3254,7 +3227,10 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "group"); groupElement = startFormGroup(groupElement, owner); - if (groupElement != null) { + if (groupElement == null) + groupElement = modelSection; + else + { this.setXFormsId(groupElement); Element controlsWrapper = @@ -3268,17 +3244,7 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { getXFormsNSPrefix() + "label")); this.setXFormsId(captionElement); captionElement.appendChild(xForm.createTextNode(createCaption(owner))); - - //no hint in groups - - /*Element hint = createHint(xForm,owner); - if (hint != null) { - groupElement.appendChild(hint); - }*/ - } else { - groupElement = modelSection; } - return groupElement; } @@ -3293,7 +3259,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder { private String getElementName(XSElementDeclaration element, Document xForm) { String elementName = element.getName(); String namespace = element.getNamespace(); - if (namespace != null && !namespace.equals("")) { + if (namespace != null && namespace.length() != 0) + { String prefix; if ((prefix = (String) namespacePrefixes.get(namespace)) == null) { String basePrefix = (namespace.substring(namespace.lastIndexOf('/', namespace.length()-2)+1)); diff --git a/source/java/org/alfresco/web/templating/xforms/schemabuilder/BaseSchemaFormBuilder.java b/source/java/org/alfresco/web/templating/xforms/schemabuilder/BaseSchemaFormBuilder.java index f257e5b9a9..ac4cb5036f 100644 --- a/source/java/org/alfresco/web/templating/xforms/schemabuilder/BaseSchemaFormBuilder.java +++ b/source/java/org/alfresco/web/templating/xforms/schemabuilder/BaseSchemaFormBuilder.java @@ -241,14 +241,13 @@ public class BaseSchemaFormBuilder Element control; //remove while select1 do not work correctly in repeats - if ((controlType.getName() != null) - && controlType.getName().equals("boolean")) { - control = - xForm.createElementNS(XFORMS_NS, - getXFormsNSPrefix() + "select1"); + if ("boolean".equals(controlType.getName())) + { + control = xForm.createElementNS(XFORMS_NS, + getXFormsNSPrefix() + "select1"); control.setAttributeNS(XFORMS_NS, - getXFormsNSPrefix() + "appearance", - "full"); + getXFormsNSPrefix() + "appearance", + "full"); this.setXFormsId(control); Element item_true = @@ -286,16 +285,17 @@ public class BaseSchemaFormBuilder value_false.appendChild(value_false_text); item_false.appendChild(value_false); control.appendChild(item_false); - } else { - control = - xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "input"); + } + else + { + control = xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "input"); this.setXFormsId(control); } //label - Element captionElement = - (Element) control.appendChild(xForm.createElementNS(XFORMS_NS, - getXFormsNSPrefix() + "label")); + Element captionElement = (Element) + control.appendChild(xForm.createElementNS(XFORMS_NS, + getXFormsNSPrefix() + "label")); this.setXFormsId(captionElement); captionElement.appendChild(xForm.createTextNode(caption)); diff --git a/source/java/org/alfresco/web/templating/xforms/servlet/ChibaServlet.java b/source/java/org/alfresco/web/templating/xforms/servlet/ChibaServlet.java index f4d24265fb..b4fab79e6b 100644 --- a/source/java/org/alfresco/web/templating/xforms/servlet/ChibaServlet.java +++ b/source/java/org/alfresco/web/templating/xforms/servlet/ChibaServlet.java @@ -298,16 +298,17 @@ public class ChibaServlet extends HttpServlet { //set parameters uiGenerator.setParameter("contextroot",request.getContextPath()); uiGenerator.setParameter("action-url",actionURL); - uiGenerator.setParameter("debug-enabled", true /*String.valueOf(logger.isDebugEnabled()) */); - String selectorPrefix = Config.getInstance().getProperty(HttpRequestHandler.SELECTOR_PREFIX_PROPERTY, - HttpRequestHandler.SELECTOR_PREFIX_DEFAULT); + uiGenerator.setParameter("debug-enabled", String.valueOf(logger.isDebugEnabled())); + String selectorPrefix = + Config.getInstance().getProperty(HttpRequestHandler.SELECTOR_PREFIX_PROPERTY, + HttpRequestHandler.SELECTOR_PREFIX_DEFAULT); uiGenerator.setParameter("selector-prefix", selectorPrefix); - String removeUploadPrefix = Config.getInstance().getProperty(HttpRequestHandler.REMOVE_UPLOAD_PREFIX_PROPERTY, - HttpRequestHandler.REMOVE_UPLOAD_PREFIX_DEFAULT); + String removeUploadPrefix = + Config.getInstance().getProperty(HttpRequestHandler.REMOVE_UPLOAD_PREFIX_PROPERTY, + HttpRequestHandler.REMOVE_UPLOAD_PREFIX_DEFAULT); uiGenerator.setParameter("remove-upload-prefix", removeUploadPrefix); - if (css != null) { + if (css != null) uiGenerator.setParameter("css-file", css); - } String dataPrefix = Config.getInstance().getProperty("chiba.web.dataPrefix"); uiGenerator.setParameter("data-prefix", dataPrefix); diff --git a/source/web/jsp/content/create-content-wizard/create-xml.jsp b/source/web/jsp/content/create-content-wizard/create-xml.jsp index db9d933b40..0e98cec237 100644 --- a/source/web/jsp/content/create-content-wizard/create-xml.jsp +++ b/source/web/jsp/content/create-content-wizard/create-xml.jsp @@ -29,7 +29,7 @@ CreateContentWizard ccw = (CreateContentWizard) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "CreateContentWizard"); TemplateType tt = ts.getTemplateType(ccw.getTemplateType()); -final TemplateInputMethod tim = tt.getInputMethods()[0]; +final TemplateInputMethod tim = tt.getInputMethods().get(0); String url = tim.getInputURL(tt.getSampleXml(tt.getName()), tt); %> diff --git a/source/web/jsp/content/create-xml-content-type-wizard/details.jsp b/source/web/jsp/content/create-xml-content-type-wizard/details.jsp index dcbd30b264..ffe1414ddf 100644 --- a/source/web/jsp/content/create-xml-content-type-wizard/details.jsp +++ b/source/web/jsp/content/create-xml-content-type-wizard/details.jsp @@ -84,16 +84,6 @@ -<%-- - - - ---%> <% FileUploadBean upload = (FileUploadBean) - session.getAttribute(FileUploadBean.FILE_UPLOAD_BEAN_NAME); + session.getAttribute(FileUploadBean.getKey("schema")); if (upload == null || upload.getFile() == null) { %> + @@ -128,23 +119,3 @@ if (upload == null || upload.getFile() == null) %> - - - - - - - - - - - diff --git a/source/web/jsp/content/create-xml-content-type-wizard/edit.jsp b/source/web/jsp/content/create-xml-content-type-wizard/edit.jsp index 61fa96b74e..f41e9c9002 100644 --- a/source/web/jsp/content/create-xml-content-type-wizard/edit.jsp +++ b/source/web/jsp/content/create-xml-content-type-wizard/edit.jsp @@ -25,7 +25,7 @@ function set_edit_mode(on) { var iframe = document.getElementById("editor"); editor.setAttribute("src", - on ? "" + on ? "" : ""); } diff --git a/source/web/jsp/content/xforms/debug-instance.jsp b/source/web/jsp/content/xforms/debug-instance.jsp index d7cc9483e1..eba83dee75 100644 --- a/source/web/jsp/content/xforms/debug-instance.jsp +++ b/source/web/jsp/content/xforms/debug-instance.jsp @@ -32,15 +32,14 @@ xml = xml.replaceAll("<", "<"); Instance Data submitted - + - -
- XML submitted successfully! you rock! Click next! -
-
+
+ XML submitted successfully! you rock! Click next! +
+ <%= xml %> -
+ diff --git a/source/web/jsp/content/xforms/forms/styles/xforms.css b/source/web/jsp/content/xforms/forms/styles/xforms.css index b8a916c5fa..8694989188 100644 --- a/source/web/jsp/content/xforms/forms/styles/xforms.css +++ b/source/web/jsp/content/xforms/forms/styles/xforms.css @@ -33,7 +33,6 @@ form{ .inactive{ display:none; } -#legend{padding:3px;} a.link{color:#444444;} a.visited{color:#444444;} @@ -53,49 +52,26 @@ appearance class 'minimal-group|compact-group|full-group'. */ background: white; margin-bottom:5px; } -/* IE */ -fieldset{ - margin-bottom:5px; -} /*********** used to render group labels ***********/ fieldset > legend { padding: 3px; + width: 100%; border: thin solid rgb(55, 71, 90); - background: white; /*#F0F4EA;*/ - color: rgb( 85, 96, 63 ); + background-color: #cddbe8; margin-top:5px; margin-bottom:5px; + color: #003366; + font-weight: bold; } -/* IE */ -fieldset legend{ - padding: 3px; - border: thin solid rgb(55, 71, 90); - color: rgb( 85, 96, 63 ); - margin-top:5px; - margin-bottom:5px; -} - -/*********** use to render group labels ***********/ -.legend{ - border:thin groove; - color:#888888; - text-align:center; - } - /*********** nested group ***********/ fieldset > fieldset { - margin:5px; +/* margin:5px; */ background-color: white; /*rgb(82, 90, 99); */ padding-top:0px; } -/* IE */ -fieldset fieldset{ - margin:5px; -} - /*********** nested nested group ***********/ fieldset > fieldset > fieldset { margin:5px; @@ -192,8 +168,8 @@ fieldset > fieldset > fieldset { .label{ - color:rgb(85, 96, 63); - padding-right: 5px; + color: #003366; + padding-right: 10px; } /* .help-symbol{ diff --git a/source/web/jsp/content/xforms/forms/xslt/html-form-controls.xsl b/source/web/jsp/content/xforms/forms/xslt/html-form-controls.xsl index a43e5abf3e..f21afb5343 100644 --- a/source/web/jsp/content/xforms/forms/xslt/html-form-controls.xsl +++ b/source/web/jsp/content/xforms/forms/xslt/html-form-controls.xsl @@ -26,7 +26,7 @@ - + @@ -117,38 +117,7 @@ - - - - - - - - - - - - - - image - - - - - - - - - - value - - disabled - - - javascript:activate(this); - - - + @@ -734,16 +703,11 @@ - - - - button - javascript:activate(this); - - - submit - - + button + + + + javascript:activate(this); diff --git a/source/web/jsp/content/xforms/forms/xslt/html4.xsl b/source/web/jsp/content/xforms/forms/xslt/html4.xsl index c984226c41..ec5f32ed0c 100644 --- a/source/web/jsp/content/xforms/forms/xslt/html4.xsl +++ b/source/web/jsp/content/xforms/forms/xslt/html4.xsl @@ -78,9 +78,8 @@ <xsl:value-of select="$form-name"/> - - + @@ -200,80 +199,45 @@ -
loading
- - - - - - - - POST - application/x-www-form-urlencoded - - multipart/form-data - - - - - - - + + + + + + + + POST + application/x-www-form-urlencoded + + multipart/form-data + + + + + + + - - - - - - - - * - required | - ? - help - - - - - + + + + + + + * - required | + ? - help + + +
@@ -359,6 +323,15 @@ + + + required-symbol + margin-right: 10px; + + + + + diff --git a/source/web/jsp/dialog/edit-xml-inline.jsp b/source/web/jsp/dialog/edit-xml-inline.jsp index 512f77d825..7728e8c463 100644 --- a/source/web/jsp/dialog/edit-xml-inline.jsp +++ b/source/web/jsp/dialog/edit-xml-inline.jsp @@ -33,9 +33,9 @@ NodeRef nr = ccb.getDocument().getNodeRef(); String ttName = (String)ccb.getNodeService().getProperty(nr, CreateContentWizard.TT_QNAME); TemplatingService ts = TemplatingService.getInstance(); TemplateType tt = ts.getTemplateType(ttName); -TemplateInputMethod tim = tt.getInputMethods()[0]; +System.out.println("tt " + tt); +TemplateInputMethod tim = tt.getInputMethods().get(0); String url = tim.getInputURL(ts.parseXML(ccb.getDocumentContent()), tt); -System.out.println("TTTTTT " + tt); System.out.println("inputurl " + url); %>