mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
checkpoint of templating as used in the virgin money demo.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3475 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -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.
|
create_xml_content_type_step2_desc=This is the generated XForm based on the schema provided.
|
||||||
edit_xml_schema=Edit XML Schema
|
edit_xml_schema=Edit XML Schema
|
||||||
template_type=Template Type
|
template_type=Template Type
|
||||||
|
configure_presentation_templates=Configure Presentation Templates
|
||||||
|
|
||||||
# Rule and Action Wizard messages
|
# Rule and Action Wizard messages
|
||||||
run_action_title=Run Action Wizard
|
run_action_title=Run Action Wizard
|
||||||
|
@@ -182,7 +182,7 @@
|
|||||||
<step name="configure_presentation_templates"
|
<step name="configure_presentation_templates"
|
||||||
title-id="configure_presentation_templates"
|
title-id="configure_presentation_templates"
|
||||||
description-id="create_xml_content_type_step2_desc">
|
description-id="create_xml_content_type_step2_desc">
|
||||||
<page path="/jsp/content/create-xml-content-type-wizard/configure_presentation_templates.jsp"
|
<page path="/jsp/content/create-xml-content-type-wizard/configure-presentation-templates.jsp"
|
||||||
title-id="create_xml_content_type_step2_title"
|
title-id="create_xml_content_type_step2_title"
|
||||||
description-id="create_xml_content_type_step2_desc"
|
description-id="create_xml_content_type_step2_desc"
|
||||||
instruction-id="default_instruction" />
|
instruction-id="default_instruction" />
|
||||||
|
@@ -53,6 +53,7 @@ public class UploadFileServlet extends BaseServlet
|
|||||||
protected void service(HttpServletRequest request, HttpServletResponse response)
|
protected void service(HttpServletRequest request, HttpServletResponse response)
|
||||||
throws ServletException, IOException
|
throws ServletException, IOException
|
||||||
{
|
{
|
||||||
|
String uploadId = null;
|
||||||
String returnPage = null;
|
String returnPage = null;
|
||||||
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
|
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
|
||||||
|
|
||||||
@@ -92,6 +93,10 @@ public class UploadFileServlet extends BaseServlet
|
|||||||
{
|
{
|
||||||
returnPage = item.getString();
|
returnPage = item.getString();
|
||||||
}
|
}
|
||||||
|
else if (item.getFieldName().equalsIgnoreCase("upload-id"))
|
||||||
|
{
|
||||||
|
uploadId = item.getString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -121,9 +126,10 @@ public class UploadFileServlet extends BaseServlet
|
|||||||
bean.setFile(tempFile);
|
bean.setFile(tempFile);
|
||||||
bean.setFileName(filename);
|
bean.setFileName(filename);
|
||||||
bean.setFilePath(tempFile.getAbsolutePath());
|
bean.setFilePath(tempFile.getAbsolutePath());
|
||||||
session.setAttribute(FileUploadBean.FILE_UPLOAD_BEAN_NAME, bean);
|
session.setAttribute(FileUploadBean.getKey(uploadId), bean);
|
||||||
if (logger.isDebugEnabled())
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -565,7 +565,9 @@ public class CheckinCheckoutBean
|
|||||||
MimetypeMap.MIMETYPE_JAVASCRIPT.equals(mimetype))
|
MimetypeMap.MIMETYPE_JAVASCRIPT.equals(mimetype))
|
||||||
{
|
{
|
||||||
// make content available to the editing screen
|
// make content available to the editing screen
|
||||||
setEditorOutput(reader.getContentString());
|
String contentString = reader.getContentString();
|
||||||
|
setDocumentContent(contentString);
|
||||||
|
setEditorOutput(contentString);
|
||||||
|
|
||||||
// navigate to appropriate screen
|
// navigate to appropriate screen
|
||||||
FacesContext fc = FacesContext.getCurrentInstance();
|
FacesContext fc = FacesContext.getCurrentInstance();
|
||||||
|
@@ -25,8 +25,16 @@ import java.io.File;
|
|||||||
*/
|
*/
|
||||||
public final class FileUploadBean
|
public final class FileUploadBean
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final String FILE_UPLOAD_BEAN_NAME = "alfresco.UploadBean";
|
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 File file;
|
||||||
private String fileName;
|
private String fileName;
|
||||||
private String filePath;
|
private String filePath;
|
||||||
|
@@ -77,16 +77,9 @@ public abstract class BaseContentWizard extends BaseWizardBean
|
|||||||
@Override
|
@Override
|
||||||
public boolean getFinishButtonDisabled()
|
public boolean getFinishButtonDisabled()
|
||||||
{
|
{
|
||||||
if (this.fileName == null ||
|
return (this.fileName == null ||
|
||||||
this.fileName.length() == 0 ||
|
this.fileName.length() == 0 ||
|
||||||
this.mimeType == null)
|
this.mimeType == null);
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
@@ -341,19 +334,10 @@ public abstract class BaseContentWizard extends BaseWizardBean
|
|||||||
protected void saveContent(File fileContent, String strContent) throws Exception
|
protected void saveContent(File fileContent, String strContent) throws Exception
|
||||||
{
|
{
|
||||||
// get the node ref of the node that will contain the content
|
// get the node ref of the node that will contain the content
|
||||||
NodeRef containerNodeRef;
|
NodeRef containerNodeRef = this.getContainerNodeRef();
|
||||||
String nodeId = this.navigator.getCurrentNodeId();
|
|
||||||
if (nodeId == null)
|
|
||||||
{
|
|
||||||
containerNodeRef = this.nodeService.getRootNode(Repository.getStoreRef());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
containerNodeRef = new NodeRef(Repository.getStoreRef(), nodeId);
|
|
||||||
}
|
|
||||||
|
|
||||||
FileInfo fileInfo = this.fileFolderService.create(
|
FileInfo fileInfo =
|
||||||
containerNodeRef,
|
this.fileFolderService.create(containerNodeRef,
|
||||||
this.fileName,
|
this.fileName,
|
||||||
Repository.resolveToQName(this.objectType));
|
Repository.resolveToQName(this.objectType));
|
||||||
NodeRef fileNodeRef = fileInfo.getNodeRef();
|
NodeRef fileNodeRef = fileInfo.getNodeRef();
|
||||||
@@ -395,13 +379,9 @@ public abstract class BaseContentWizard extends BaseWizardBean
|
|||||||
{
|
{
|
||||||
writer.putContent(fileContent);
|
writer.putContent(fileContent);
|
||||||
}
|
}
|
||||||
else if (strContent != null)
|
|
||||||
{
|
|
||||||
writer.putContent(strContent);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
writer.putContent("");
|
writer.putContent(strContent == null ? "" : strContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// remember the created node now
|
// remember the created node now
|
||||||
|
@@ -39,6 +39,12 @@ import org.alfresco.web.templating.*;
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
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
|
* Bean implementation for the "Create Content Wizard" dialog
|
||||||
*
|
*
|
||||||
@@ -50,7 +56,9 @@ public class CreateContentWizard extends BaseContentWizard
|
|||||||
protected String templateType;
|
protected String templateType;
|
||||||
protected List<SelectItem> createMimeTypes;
|
protected List<SelectItem> createMimeTypes;
|
||||||
|
|
||||||
private static Log logger = LogFactory.getLog(CreateContentWizard.class);
|
private static final Log LOGGER =
|
||||||
|
LogFactory.getLog(CreateContentWizard.class);
|
||||||
|
|
||||||
public static final org.alfresco.service.namespace.QName TT_QNAME =
|
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");
|
org.alfresco.service.namespace.QName.createQName(org.alfresco.service.namespace.NamespaceService.CONTENT_MODEL_1_0_URI, "tt");
|
||||||
|
|
||||||
@@ -61,9 +69,52 @@ public class CreateContentWizard extends BaseContentWizard
|
|||||||
protected String finishImpl(FacesContext context, String outcome)
|
protected String finishImpl(FacesContext context, String outcome)
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
|
LOGGER.debug("saving file content to " + this.fileName);
|
||||||
saveContent(null, this.content);
|
saveContent(null, this.content);
|
||||||
if (templateType != null)
|
if (this.templateType != null)
|
||||||
this.nodeService.setProperty(createdNode, TT_QNAME, templateType);
|
{
|
||||||
|
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);
|
||||||
|
|
||||||
|
LOGGER.debug("generated " + fileName + " using " + tom);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// return the default outcome
|
// return the default outcome
|
||||||
return outcome;
|
return outcome;
|
||||||
@@ -189,12 +240,12 @@ public class CreateContentWizard extends BaseContentWizard
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.warn("Could not find 'create-mime-types' configuration element");
|
LOGGER.warn("Could not find 'create-mime-types' configuration element");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.warn("Could not find 'Content Wizards' configuration section");
|
LOGGER.warn("Could not find 'Content Wizards' configuration section");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -17,44 +17,51 @@
|
|||||||
package org.alfresco.web.bean.content;
|
package org.alfresco.web.bean.content;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.ResourceBundle;
|
|
||||||
|
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
import javax.faces.event.ValueChangeEvent;
|
import javax.faces.event.ValueChangeEvent;
|
||||||
import javax.faces.model.SelectItem;
|
import javax.faces.model.SelectItem;
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
import org.alfresco.config.Config;
|
import org.alfresco.config.Config;
|
||||||
import org.alfresco.config.ConfigElement;
|
import org.alfresco.config.ConfigElement;
|
||||||
import org.alfresco.config.ConfigService;
|
import org.alfresco.config.ConfigService;
|
||||||
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.content.MimetypeMap;
|
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.AlfrescoNavigationHandler;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.bean.FileUploadBean;
|
import org.alfresco.web.bean.FileUploadBean;
|
||||||
import org.alfresco.web.bean.repository.Node;
|
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.IDataContainer;
|
||||||
import org.alfresco.web.data.QuickSort;
|
import org.alfresco.web.data.QuickSort;
|
||||||
import org.alfresco.web.ui.common.Utils;
|
|
||||||
import org.alfresco.web.templating.*;
|
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.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bean implementation for the "Create Content Wizard" dialog
|
* Bean implementation for the "Create Content Wizard" dialog
|
||||||
*
|
*
|
||||||
* @author arielb
|
* @author arielb
|
||||||
*/
|
*/
|
||||||
public class CreateXmlContentTypeWizard extends BaseContentWizard
|
public class CreateXmlContentTypeWizard extends BaseWizardBean
|
||||||
{
|
{
|
||||||
|
|
||||||
private final static Log logger = LogFactory.getLog(CreateXmlContentTypeWizard.class);
|
private final static Log LOGGER =
|
||||||
private TemplateType tt;
|
LogFactory.getLog(CreateXmlContentTypeWizard.class);
|
||||||
|
|
||||||
|
private String presentationTemplateType;
|
||||||
|
protected ContentService contentService;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Wizard implementation
|
// Wizard implementation
|
||||||
@@ -63,10 +70,47 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard
|
|||||||
protected String finishImpl(FacesContext context, String outcome)
|
protected String finishImpl(FacesContext context, String outcome)
|
||||||
throws Exception
|
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());
|
||||||
|
|
||||||
|
// 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());
|
||||||
|
|
||||||
saveContent(this.getSchemaFile(), null);
|
|
||||||
final TemplatingService ts = TemplatingService.getInstance();
|
final TemplatingService ts = TemplatingService.getInstance();
|
||||||
ts.registerTemplateType(tt);
|
ts.registerTemplateType(this.getTemplateType());
|
||||||
|
|
||||||
// return the default outcome
|
// return the default outcome
|
||||||
return outcome;
|
return outcome;
|
||||||
}
|
}
|
||||||
@@ -76,14 +120,15 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard
|
|||||||
{
|
{
|
||||||
super.init(parameters);
|
super.init(parameters);
|
||||||
|
|
||||||
this.mimeType = "text/xml";
|
this.removeUploadedSchemaFile();
|
||||||
this.clearUpload();
|
this.removeUploadedPresentationTemplateFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String cancel()
|
public String cancel()
|
||||||
{
|
{
|
||||||
this.clearUpload();
|
this.removeUploadedSchemaFile();
|
||||||
|
this.removeUploadedPresentationTemplateFile();
|
||||||
return super.cancel();
|
return super.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +145,8 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard
|
|||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
disabled = (this.fileName == null || this.fileName.length() == 0);
|
disabled = (this.getSchemaFileName() == null ||
|
||||||
|
this.getSchemaFileName().length() == 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,32 +154,43 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard
|
|||||||
return disabled;
|
return disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
protected String doPostCommitProcessing(FacesContext context, String outcome)
|
// protected String doPostCommitProcessing(FacesContext context, String outcome)
|
||||||
{
|
// {
|
||||||
// as we were successful, go to the set properties dialog if asked
|
// // as we were successful, go to the set properties dialog if asked
|
||||||
// to otherwise just return
|
// // to otherwise just return
|
||||||
if (this.showOtherProperties)
|
// if (this.showOtherProperties)
|
||||||
{
|
// {
|
||||||
// we are going to immediately edit the properties so we need
|
// // we are going to immediately edit the properties so we need
|
||||||
// to setup the BrowseBean context appropriately
|
// // to setup the BrowseBean context appropriately
|
||||||
this.browseBean.setDocument(new Node(this.createdNode));
|
// this.browseBean.setDocument(new Node(this.createdNode));
|
||||||
|
//
|
||||||
|
// return getDefaultFinishOutcome() + AlfrescoNavigationHandler.OUTCOME_SEPARATOR +
|
||||||
|
// "dialog:setContentProperties";
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// return outcome;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
return getDefaultFinishOutcome() + AlfrescoNavigationHandler.OUTCOME_SEPARATOR +
|
/**
|
||||||
"dialog:setContentProperties";
|
* Action handler called when the user wishes to remove an uploaded file
|
||||||
}
|
*/
|
||||||
else
|
public String removeUploadedSchemaFile()
|
||||||
{
|
{
|
||||||
return outcome;
|
clearUpload("schema");
|
||||||
}
|
|
||||||
|
// refresh the current page
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action handler called when the user wishes to remove an uploaded file
|
* 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
|
// refresh the current page
|
||||||
return null;
|
return null;
|
||||||
@@ -142,37 +199,49 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard
|
|||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Bean Getters and Setters
|
// Bean Getters and Setters
|
||||||
|
|
||||||
private FileUploadBean getFileUploadBean()
|
/**
|
||||||
|
* @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(final String id)
|
||||||
{
|
{
|
||||||
final FacesContext ctx = FacesContext.getCurrentInstance();
|
final FacesContext ctx = FacesContext.getCurrentInstance();
|
||||||
final Map sessionMap = ctx.getExternalContext().getSessionMap();
|
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
|
* @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
|
// try and retrieve the file and filename from the file upload bean
|
||||||
// representing the file we previously uploaded.
|
// representing the file we previously uploaded.
|
||||||
final FileUploadBean fileBean = this.getFileUploadBean();
|
final FileUploadBean fileBean = this.getFileUploadBean(id);
|
||||||
if (fileBean != null)
|
return fileBean == null ? null : fileBean.getFileName();
|
||||||
this.fileName = fileBean.getFileName();
|
|
||||||
return this.fileName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param fileName The name of the file
|
* @return Returns the schema file or <tt>null</tt>
|
||||||
*/
|
*/
|
||||||
public void setFileName(String fileName)
|
private File getFile(final String id)
|
||||||
{
|
{
|
||||||
this.fileName = fileName;
|
// try and retrieve the file and filename from the file upload bean
|
||||||
|
// representing the file we previously uploaded.
|
||||||
// we also need to keep the file upload bean in sync
|
final FileUploadBean fileBean = this.getFileUploadBean(id);
|
||||||
final FileUploadBean fileBean = this.getFileUploadBean();
|
return fileBean != null ? fileBean.getFile() : null;
|
||||||
if (fileBean != null)
|
|
||||||
fileBean.setFileName(this.fileName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -180,19 +249,9 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard
|
|||||||
*/
|
*/
|
||||||
public File getSchemaFile()
|
public File getSchemaFile()
|
||||||
{
|
{
|
||||||
// try and retrieve the file and filename from the file upload bean
|
return this.getFile("schema");
|
||||||
// representing the file we previously uploaded.
|
|
||||||
final FileUploadBean fileBean = this.getFileUploadBean();
|
|
||||||
return fileBean != null ? fileBean.getFile() : null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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 <tt>null</tt>
|
* @return Returns the schema file or <tt>null</tt>
|
||||||
*/
|
*/
|
||||||
@@ -200,25 +259,51 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard
|
|||||||
{
|
{
|
||||||
// try and retrieve the file and filename from the file upload bean
|
// try and retrieve the file and filename from the file upload bean
|
||||||
// representing the file we previously uploaded.
|
// representing the file we previously uploaded.
|
||||||
return getFileName();
|
return this.getFileName("schema");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSchemaFileName(String s)
|
/**
|
||||||
|
* @return Returns the schema file or <tt>null</tt>
|
||||||
|
*/
|
||||||
|
public String getPresentationTemplateFileName()
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException();
|
return this.getFileName("pt");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Returns the presentationTemplate file or <tt>null</tt>
|
||||||
|
*/
|
||||||
|
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()
|
public String getFormURL()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final TemplatingService ts = TemplatingService.getInstance();
|
final TemplateType tt = this.getTemplateType();
|
||||||
final String rootTagName =
|
final TemplateInputMethod tim = tt.getInputMethods().get(0);
|
||||||
this.getSchemaFileName().replaceAll("([^\\.])\\..+", "$1");
|
return tim.getInputURL(tt.getSampleXml(tt.getName()), tt);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
catch (Throwable t)
|
catch (Throwable t)
|
||||||
{
|
{
|
||||||
@@ -227,23 +312,34 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSchemaFormURL()
|
// 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<SelectItem> getCreatePresentationTemplateTypes()
|
||||||
{
|
{
|
||||||
try
|
return (List<SelectItem>)Arrays.asList(new SelectItem[] {
|
||||||
{
|
new SelectItem("freemarker", "FreeMarker"),
|
||||||
final TemplatingService ts = TemplatingService.getInstance();
|
new SelectItem("xslt", "XSLT")
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -254,12 +350,16 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard
|
|||||||
ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
|
ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
|
||||||
|
|
||||||
// TODO: show first few lines of content here?
|
// TODO: show first few lines of content here?
|
||||||
return buildSummary(
|
return buildSummary(new String[] {
|
||||||
new String[] {bundle.getString("file_name"),
|
"Schema File",
|
||||||
bundle.getString("type"),
|
"Presentation Template Type",
|
||||||
bundle.getString("content_type")},
|
"Presentation Template"
|
||||||
new String[] {this.fileName, getSummaryObjectType(),
|
},
|
||||||
getSummaryMimeType(this.mimeType)});
|
new String[] {
|
||||||
|
this.getSchemaFileName(),
|
||||||
|
this.getPresentationTemplateType(),
|
||||||
|
this.getPresentationTemplateFileName()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
@@ -268,20 +368,28 @@ public class CreateXmlContentTypeWizard extends BaseContentWizard
|
|||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Service Injection
|
// Service Injection
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param contentService The contentService to set.
|
||||||
|
*/
|
||||||
|
public void setContentService(ContentService contentService)
|
||||||
|
{
|
||||||
|
this.contentService = contentService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Helper Methods
|
// Helper Methods
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
protected void clearUpload()
|
protected void clearUpload(final String id)
|
||||||
{
|
{
|
||||||
// remove the file upload bean from the session
|
// remove the file upload bean from the session
|
||||||
FacesContext ctx = FacesContext.getCurrentInstance();
|
FacesContext ctx = FacesContext.getCurrentInstance();
|
||||||
FileUploadBean fileBean = (FileUploadBean)ctx.getExternalContext().getSessionMap().
|
FileUploadBean fileBean = (FileUploadBean)
|
||||||
get(FileUploadBean.FILE_UPLOAD_BEAN_NAME);
|
ctx.getExternalContext().getSessionMap().
|
||||||
|
get(FileUploadBean.getKey(id));
|
||||||
if (fileBean != null)
|
if (fileBean != null)
|
||||||
fileBean.setFile(null);
|
fileBean.setFile(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,7 @@ import javax.transaction.UserTransaction;
|
|||||||
|
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
import org.alfresco.service.cmr.model.FileFolderService;
|
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.repository.NodeService;
|
||||||
import org.alfresco.service.cmr.search.SearchService;
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
@@ -255,4 +256,13 @@ public abstract class BaseDialogBean implements IDialogBean
|
|||||||
FacesContext.getCurrentInstance(), getErrorMessageId()),
|
FacesContext.getCurrentInstance(), getErrorMessageId()),
|
||||||
exception.getMessage());
|
exception.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected NodeRef getContainerNodeRef()
|
||||||
|
{
|
||||||
|
String nodeId = this.navigator.getCurrentNodeId();
|
||||||
|
return (nodeId == null
|
||||||
|
? this.nodeService.getRootNode(Repository.getStoreRef())
|
||||||
|
: new NodeRef(Repository.getStoreRef(), nodeId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -25,5 +25,6 @@ public interface TemplateOutputMethod
|
|||||||
|
|
||||||
public void generate(final Document xmlContent,
|
public void generate(final Document xmlContent,
|
||||||
final TemplateType tt,
|
final TemplateType tt,
|
||||||
final Writer out);
|
final Writer out)
|
||||||
|
throws Exception;
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
package org.alfresco.web.templating;
|
package org.alfresco.web.templating;
|
||||||
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface TemplateType
|
public interface TemplateType
|
||||||
{
|
{
|
||||||
@@ -27,7 +28,9 @@ public interface TemplateType
|
|||||||
|
|
||||||
public Document getSampleXml(final String rootTagName);
|
public Document getSampleXml(final String rootTagName);
|
||||||
|
|
||||||
public TemplateInputMethod[] getInputMethods();
|
public List<TemplateInputMethod> getInputMethods();
|
||||||
|
|
||||||
public TemplateOutputMethod[] getOutputMethods();
|
public void addOutputMethod(TemplateOutputMethod output);
|
||||||
|
|
||||||
|
public List<TemplateOutputMethod> getOutputMethods();
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
package org.alfresco.web.templating.xforms;
|
package org.alfresco.web.templating.xforms;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
|
||||||
import org.alfresco.util.TempFileProvider;
|
import org.alfresco.util.TempFileProvider;
|
||||||
@@ -36,6 +37,7 @@ public class TemplateTypeImpl
|
|||||||
|
|
||||||
private final Document schema;
|
private final Document schema;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
private final LinkedList outputMethods = new LinkedList();
|
||||||
|
|
||||||
public TemplateTypeImpl(final String name,
|
public TemplateTypeImpl(final String name,
|
||||||
final Document schema)
|
final Document schema)
|
||||||
@@ -131,15 +133,20 @@ public class TemplateTypeImpl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public TemplateInputMethod[] getInputMethods()
|
public List<TemplateInputMethod> getInputMethods()
|
||||||
{
|
{
|
||||||
return new TemplateInputMethod[] {
|
return (List<TemplateInputMethod>)Arrays.asList(new TemplateInputMethod[] {
|
||||||
new XFormsInputMethod()
|
new XFormsInputMethod()
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public TemplateOutputMethod[] getOutputMethods()
|
public void addOutputMethod(TemplateOutputMethod output)
|
||||||
{
|
{
|
||||||
return new TemplateOutputMethod[0];
|
this.outputMethods.add(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TemplateOutputMethod> getOutputMethods()
|
||||||
|
{
|
||||||
|
return this.outputMethods;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -18,9 +18,6 @@ package org.alfresco.web.templating.xforms.schemabuilder;
|
|||||||
|
|
||||||
import org.apache.commons.jxpath.JXPathContext;
|
import org.apache.commons.jxpath.JXPathContext;
|
||||||
import org.apache.commons.jxpath.Pointer;
|
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.apache.xerces.xs.*;
|
||||||
import org.chiba.xml.util.DOMUtil;
|
import org.chiba.xml.util.DOMUtil;
|
||||||
import org.chiba.xml.xforms.NamespaceCtx;
|
import org.chiba.xml.xforms.NamespaceCtx;
|
||||||
@@ -32,8 +29,6 @@ import javax.xml.parsers.DocumentBuilder;
|
|||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
import javax.xml.transform.*;
|
import javax.xml.transform.*;
|
||||||
import javax.xml.transform.dom.DOMSource;
|
|
||||||
import javax.xml.transform.stream.StreamResult;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
@@ -581,10 +576,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
else if (o != null)
|
else if (o != null)
|
||||||
{
|
{
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
{
|
|
||||||
LOGGER.debug("DOMImplementation is not a XSImplementation: "
|
LOGGER.debug("DOMImplementation is not a XSImplementation: "
|
||||||
+ o.getClass().getName());
|
+ o.getClass().getName());
|
||||||
}
|
|
||||||
throw new RuntimeException(o.getClass().getName() + " is not a XSImplementation");
|
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,
|
public void endFormControl(Element controlElement,
|
||||||
XSTypeDefinition controlType,
|
XSTypeDefinition controlType,
|
||||||
int minOccurs,
|
int minOccurs,
|
||||||
int maxOccurs) {
|
int maxOccurs)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __UNDOCUMENTED__
|
* __UNDOCUMENTED__
|
||||||
*/
|
*/
|
||||||
public void reset() {
|
public void reset()
|
||||||
|
{
|
||||||
//refCounter = 0;
|
//refCounter = 0;
|
||||||
counter = new HashMap();
|
counter = new HashMap();
|
||||||
setProperty(CSS_STYLE_PROP, DEFAULT_CSS_STYLE_PROP);
|
setProperty(CSS_STYLE_PROP, DEFAULT_CSS_STYLE_PROP);
|
||||||
@@ -1039,26 +1034,18 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
return chibaNSPrefix;
|
return chibaNSPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Increments the xforms:ref attribute counter.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/*protected long incRefCounter() {
|
|
||||||
return refCounter++;
|
|
||||||
}*/
|
|
||||||
protected String setXFormsId(Element el) {
|
protected String setXFormsId(Element el) {
|
||||||
//remove the eventuel "id" attribute
|
//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");
|
el.removeAttributeNS(SchemaFormBuilder.XFORMS_NS, "id");
|
||||||
}
|
|
||||||
|
|
||||||
//long count=this.incIdCounter();
|
//long count=this.incIdCounter();
|
||||||
long count = 0;
|
long count = 0;
|
||||||
String name = el.getLocalName();
|
String name = el.getLocalName();
|
||||||
Long l = (Long) counter.get(name);
|
Long l = (Long) counter.get(name);
|
||||||
|
|
||||||
if (l != null) {
|
if (l != null)
|
||||||
count = l.longValue();
|
count = l.longValue();
|
||||||
}
|
|
||||||
|
|
||||||
String id = name + "_" + count;
|
String id = name + "_" + count;
|
||||||
|
|
||||||
@@ -1067,7 +1054,6 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
el.setAttributeNS(SchemaFormBuilder.XFORMS_NS,
|
el.setAttributeNS(SchemaFormBuilder.XFORMS_NS,
|
||||||
this.getXFormsNSPrefix() + "id",
|
this.getXFormsNSPrefix() + "id",
|
||||||
id);
|
id);
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1122,7 +1108,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
|
|
||||||
Iterator iterator = sortedList.iterator();
|
Iterator iterator = sortedList.iterator();
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
String textValue = (String) iterator.next();
|
String textValue = (String) iterator.next();
|
||||||
Element item =
|
Element item =
|
||||||
xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "item");
|
xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "item");
|
||||||
@@ -1147,8 +1134,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
protected void addChoicesForSelectSwitchControl(Document xForm,
|
protected void addChoicesForSelectSwitchControl(Document xForm,
|
||||||
Element choicesElement,
|
Element choicesElement,
|
||||||
Vector choiceValues,
|
Vector choiceValues,
|
||||||
HashMap case_types) {
|
HashMap case_types)
|
||||||
|
{
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug("addChoicesForSelectSwitchControl, values=");
|
LOGGER.debug("addChoicesForSelectSwitchControl, values=");
|
||||||
Iterator it = choiceValues.iterator();
|
Iterator it = choiceValues.iterator();
|
||||||
@@ -1205,8 +1192,7 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
|
|
||||||
action.setAttributeNS(XMLEVENTS_NS, xmleventsNSPrefix + "event", "xforms-select");
|
action.setAttributeNS(XMLEVENTS_NS, xmleventsNSPrefix + "event", "xforms-select");
|
||||||
|
|
||||||
Element toggle =
|
Element toggle = xForm.createElementNS(XFORMS_NS,
|
||||||
xForm.createElementNS(XFORMS_NS,
|
|
||||||
getXFormsNSPrefix() + "toggle");
|
getXFormsNSPrefix() + "toggle");
|
||||||
this.setXFormsId(toggle);
|
this.setXFormsId(toggle);
|
||||||
|
|
||||||
@@ -1277,10 +1263,6 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private XSModel getSchema() {
|
|
||||||
return schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XSParticle findCorrespondingParticleInComplexType(XSElementDeclaration elDecl) {
|
public XSParticle findCorrespondingParticleInComplexType(XSElementDeclaration elDecl) {
|
||||||
XSParticle thisParticle = null;
|
XSParticle thisParticle = null;
|
||||||
|
|
||||||
@@ -2122,7 +2104,7 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
//
|
//
|
||||||
//controlType = getSchema().getComplexType((String)enumValues.get(0));
|
//controlType = getSchema().getComplexType((String)enumValues.get(0));
|
||||||
controlType =
|
controlType =
|
||||||
getSchema().getTypeDefinition((String) enumValues.get(0),
|
this.schema.getTypeDefinition((String) enumValues.get(0),
|
||||||
targetNamespace);
|
targetNamespace);
|
||||||
}
|
}
|
||||||
} else if (LOGGER.isDebugEnabled())
|
} else if (LOGGER.isDebugEnabled())
|
||||||
@@ -2544,8 +2526,7 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
+ ", maxOccurs=" + maxOccurs);
|
+ ", maxOccurs=" + maxOccurs);
|
||||||
|
|
||||||
//repeatSection = (Element) formSection.appendChild(xForm.createElementNS(XFORMS_NS,getXFormsNSPrefix() + "repeat"));
|
//repeatSection = (Element) formSection.appendChild(xForm.createElementNS(XFORMS_NS,getXFormsNSPrefix() + "repeat"));
|
||||||
repeatSection =
|
repeatSection = xForm.createElementNS(XFORMS_NS,
|
||||||
xForm.createElementNS(XFORMS_NS,
|
|
||||||
getXFormsNSPrefix() + "repeat");
|
getXFormsNSPrefix() + "repeat");
|
||||||
|
|
||||||
//bind instead of repeat
|
//bind instead of repeat
|
||||||
@@ -2569,11 +2550,10 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
bind =
|
bind =
|
||||||
DOMUtil.getLastChildElement(modelSection.getParentNode());
|
DOMUtil.getLastChildElement(modelSection.getParentNode());
|
||||||
|
|
||||||
if ((bind != null)
|
if ((bind != null) &&
|
||||||
&& (bind.getLocalName() != null)
|
(bind.getLocalName() != null) &&
|
||||||
&& bind.getLocalName().equals("bind")) {
|
bind.getLocalName().equals("bind")) {
|
||||||
bindId =
|
bindId = bind.getAttributeNS(SchemaFormBuilder.XFORMS_NS, "id");
|
||||||
bind.getAttributeNS(SchemaFormBuilder.XFORMS_NS, "id");
|
|
||||||
} else {
|
} else {
|
||||||
LOGGER.warn("addRepeatIfNecessary: bind really not found");
|
LOGGER.warn("addRepeatIfNecessary: bind really not found");
|
||||||
}
|
}
|
||||||
@@ -2602,8 +2582,7 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
formSection.appendChild(controlWrapper);
|
formSection.appendChild(controlWrapper);
|
||||||
|
|
||||||
//add a group inside the repeat?
|
//add a group inside the repeat?
|
||||||
Element group =
|
Element group = xForm.createElementNS(XFORMS_NS,
|
||||||
xForm.createElementNS(XFORMS_NS,
|
|
||||||
this.getXFormsNSPrefix() + "group");
|
this.getXFormsNSPrefix() + "group");
|
||||||
this.setXFormsId(group);
|
this.setXFormsId(group);
|
||||||
repeatSection.appendChild(group);
|
repeatSection.appendChild(group);
|
||||||
@@ -2627,11 +2606,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
int maxOccurs) {
|
int maxOccurs) {
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug("addSimpleType for "
|
LOGGER.debug("addSimpleType for " + controlType.getName() +
|
||||||
+ controlType.getName()
|
" (owningElementName=" + owningElementName + ")");
|
||||||
+ " (owningElementName="
|
|
||||||
+ owningElementName
|
|
||||||
+ ")");
|
|
||||||
|
|
||||||
// create the <xforms:bind> element and add it to the model.
|
// create the <xforms:bind> element and add it to the model.
|
||||||
Element bindElement = xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "bind");
|
Element bindElement = xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "bind");
|
||||||
@@ -2656,8 +2632,7 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//eventual repeat
|
//eventual repeat
|
||||||
Element repeatSection =
|
Element repeatSection = addRepeatIfNecessary(xForm,
|
||||||
addRepeatIfNecessary(xForm,
|
|
||||||
modelSection,
|
modelSection,
|
||||||
formSection,
|
formSection,
|
||||||
controlType,
|
controlType,
|
||||||
@@ -2701,8 +2676,7 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
String caption = createCaption(owningElementName);
|
String caption = createCaption(owningElementName);
|
||||||
|
|
||||||
//Element formControl = (Element) contentWrapper.appendChild(createFormControl(xForm,caption,controlType,bindId,bindElement,minOccurs,maxOccurs));
|
//Element formControl = (Element) contentWrapper.appendChild(createFormControl(xForm,caption,controlType,bindId,bindElement,minOccurs,maxOccurs));
|
||||||
Element formControl =
|
Element formControl = createFormControl(xForm,
|
||||||
createFormControl(xForm,
|
|
||||||
caption,
|
caption,
|
||||||
controlType,
|
controlType,
|
||||||
bindId,
|
bindId,
|
||||||
@@ -3075,19 +3049,13 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
formControl = createControlForAnyType(xForm, caption, controlType);
|
formControl = createControlForAnyType(xForm, caption, controlType);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (formControl == null) {
|
if (formControl == null)
|
||||||
// default situation - use an input control
|
formControl = createControlForAtomicType(xForm,
|
||||||
//
|
|
||||||
formControl =
|
|
||||||
createControlForAtomicType(xForm,
|
|
||||||
caption,
|
caption,
|
||||||
(XSSimpleTypeDefinition) controlType);
|
(XSSimpleTypeDefinition)controlType);
|
||||||
}
|
|
||||||
|
|
||||||
startFormControl(formControl, controlType);
|
startFormControl(formControl, controlType);
|
||||||
formControl.setAttributeNS(XFORMS_NS,
|
formControl.setAttributeNS(XFORMS_NS, getXFormsNSPrefix() + "bind", bindId);
|
||||||
getXFormsNSPrefix() + "bind",
|
|
||||||
bindId);
|
|
||||||
|
|
||||||
//put the label before
|
//put the label before
|
||||||
// no -> put in the "createControlFor..." methods
|
// no -> put in the "createControlFor..." methods
|
||||||
@@ -3153,10 +3121,12 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
|
|
||||||
//if we use XMLSchema types:
|
//if we use XMLSchema types:
|
||||||
//first check if it is a simple type named in the XMLSchema
|
//first check if it is a simple type named in the XMLSchema
|
||||||
if (_useSchemaTypes
|
if (_useSchemaTypes &&
|
||||||
&& controlType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE
|
controlType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE &&
|
||||||
&& typeName != null && !typeName.equals("")
|
typeName != null && typeName.length() != 0 &&
|
||||||
&& schema.getTypeDefinition(typeName, typeNS) != null) { //type is globally defined
|
schema.getTypeDefinition(typeName, typeNS) != null)
|
||||||
|
{
|
||||||
|
//type is globally defined
|
||||||
//use schema type
|
//use schema type
|
||||||
|
|
||||||
//local type name
|
//local type name
|
||||||
@@ -3170,12 +3140,15 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
|
|
||||||
//completeTypeName = new prefix + local name
|
//completeTypeName = new prefix + local name
|
||||||
result = localTypeName;
|
result = localTypeName;
|
||||||
if (prefix != null && !prefix.equals(""))
|
if (prefix != null && prefix.length() != 0)
|
||||||
result = prefix + ":" + localTypeName;
|
result = prefix + ":" + localTypeName;
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug("getXFormsTypeName: typeName=" + typeName + ", typeNS=" + typeNS + ", result=" + result);
|
LOGGER.debug("getXFormsTypeName: typeName=" + typeName + ", typeNS=" + typeNS + ", result=" + result);
|
||||||
} else { //use built in type
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//use built in type
|
||||||
result = this.getDataTypeName(getBuiltInType(controlType));
|
result = this.getDataTypeName(getBuiltInType(controlType));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -3254,7 +3227,10 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "group");
|
xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "group");
|
||||||
groupElement = startFormGroup(groupElement, owner);
|
groupElement = startFormGroup(groupElement, owner);
|
||||||
|
|
||||||
if (groupElement != null) {
|
if (groupElement == null)
|
||||||
|
groupElement = modelSection;
|
||||||
|
else
|
||||||
|
{
|
||||||
this.setXFormsId(groupElement);
|
this.setXFormsId(groupElement);
|
||||||
|
|
||||||
Element controlsWrapper =
|
Element controlsWrapper =
|
||||||
@@ -3268,17 +3244,7 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
getXFormsNSPrefix() + "label"));
|
getXFormsNSPrefix() + "label"));
|
||||||
this.setXFormsId(captionElement);
|
this.setXFormsId(captionElement);
|
||||||
captionElement.appendChild(xForm.createTextNode(createCaption(owner)));
|
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;
|
return groupElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3293,7 +3259,8 @@ public abstract class AbstractSchemaFormBuilder implements SchemaFormBuilder {
|
|||||||
private String getElementName(XSElementDeclaration element, Document xForm) {
|
private String getElementName(XSElementDeclaration element, Document xForm) {
|
||||||
String elementName = element.getName();
|
String elementName = element.getName();
|
||||||
String namespace = element.getNamespace();
|
String namespace = element.getNamespace();
|
||||||
if (namespace != null && !namespace.equals("")) {
|
if (namespace != null && namespace.length() != 0)
|
||||||
|
{
|
||||||
String prefix;
|
String prefix;
|
||||||
if ((prefix = (String) namespacePrefixes.get(namespace)) == null) {
|
if ((prefix = (String) namespacePrefixes.get(namespace)) == null) {
|
||||||
String basePrefix = (namespace.substring(namespace.lastIndexOf('/', namespace.length()-2)+1));
|
String basePrefix = (namespace.substring(namespace.lastIndexOf('/', namespace.length()-2)+1));
|
||||||
|
@@ -241,10 +241,9 @@ public class BaseSchemaFormBuilder
|
|||||||
Element control;
|
Element control;
|
||||||
|
|
||||||
//remove while select1 do not work correctly in repeats
|
//remove while select1 do not work correctly in repeats
|
||||||
if ((controlType.getName() != null)
|
if ("boolean".equals(controlType.getName()))
|
||||||
&& controlType.getName().equals("boolean")) {
|
{
|
||||||
control =
|
control = xForm.createElementNS(XFORMS_NS,
|
||||||
xForm.createElementNS(XFORMS_NS,
|
|
||||||
getXFormsNSPrefix() + "select1");
|
getXFormsNSPrefix() + "select1");
|
||||||
control.setAttributeNS(XFORMS_NS,
|
control.setAttributeNS(XFORMS_NS,
|
||||||
getXFormsNSPrefix() + "appearance",
|
getXFormsNSPrefix() + "appearance",
|
||||||
@@ -286,15 +285,16 @@ public class BaseSchemaFormBuilder
|
|||||||
value_false.appendChild(value_false_text);
|
value_false.appendChild(value_false_text);
|
||||||
item_false.appendChild(value_false);
|
item_false.appendChild(value_false);
|
||||||
control.appendChild(item_false);
|
control.appendChild(item_false);
|
||||||
} else {
|
}
|
||||||
control =
|
else
|
||||||
xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "input");
|
{
|
||||||
|
control = xForm.createElementNS(XFORMS_NS, getXFormsNSPrefix() + "input");
|
||||||
this.setXFormsId(control);
|
this.setXFormsId(control);
|
||||||
}
|
}
|
||||||
|
|
||||||
//label
|
//label
|
||||||
Element captionElement =
|
Element captionElement = (Element)
|
||||||
(Element) control.appendChild(xForm.createElementNS(XFORMS_NS,
|
control.appendChild(xForm.createElementNS(XFORMS_NS,
|
||||||
getXFormsNSPrefix() + "label"));
|
getXFormsNSPrefix() + "label"));
|
||||||
this.setXFormsId(captionElement);
|
this.setXFormsId(captionElement);
|
||||||
captionElement.appendChild(xForm.createTextNode(caption));
|
captionElement.appendChild(xForm.createTextNode(caption));
|
||||||
|
@@ -298,16 +298,17 @@ public class ChibaServlet extends HttpServlet {
|
|||||||
//set parameters
|
//set parameters
|
||||||
uiGenerator.setParameter("contextroot",request.getContextPath());
|
uiGenerator.setParameter("contextroot",request.getContextPath());
|
||||||
uiGenerator.setParameter("action-url",actionURL);
|
uiGenerator.setParameter("action-url",actionURL);
|
||||||
uiGenerator.setParameter("debug-enabled", true /*String.valueOf(logger.isDebugEnabled()) */);
|
uiGenerator.setParameter("debug-enabled", String.valueOf(logger.isDebugEnabled()));
|
||||||
String selectorPrefix = Config.getInstance().getProperty(HttpRequestHandler.SELECTOR_PREFIX_PROPERTY,
|
String selectorPrefix =
|
||||||
|
Config.getInstance().getProperty(HttpRequestHandler.SELECTOR_PREFIX_PROPERTY,
|
||||||
HttpRequestHandler.SELECTOR_PREFIX_DEFAULT);
|
HttpRequestHandler.SELECTOR_PREFIX_DEFAULT);
|
||||||
uiGenerator.setParameter("selector-prefix", selectorPrefix);
|
uiGenerator.setParameter("selector-prefix", selectorPrefix);
|
||||||
String removeUploadPrefix = Config.getInstance().getProperty(HttpRequestHandler.REMOVE_UPLOAD_PREFIX_PROPERTY,
|
String removeUploadPrefix =
|
||||||
|
Config.getInstance().getProperty(HttpRequestHandler.REMOVE_UPLOAD_PREFIX_PROPERTY,
|
||||||
HttpRequestHandler.REMOVE_UPLOAD_PREFIX_DEFAULT);
|
HttpRequestHandler.REMOVE_UPLOAD_PREFIX_DEFAULT);
|
||||||
uiGenerator.setParameter("remove-upload-prefix", removeUploadPrefix);
|
uiGenerator.setParameter("remove-upload-prefix", removeUploadPrefix);
|
||||||
if (css != null) {
|
if (css != null)
|
||||||
uiGenerator.setParameter("css-file", css);
|
uiGenerator.setParameter("css-file", css);
|
||||||
}
|
|
||||||
String dataPrefix = Config.getInstance().getProperty("chiba.web.dataPrefix");
|
String dataPrefix = Config.getInstance().getProperty("chiba.web.dataPrefix");
|
||||||
uiGenerator.setParameter("data-prefix", dataPrefix);
|
uiGenerator.setParameter("data-prefix", dataPrefix);
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ CreateContentWizard ccw = (CreateContentWizard)
|
|||||||
FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "CreateContentWizard");
|
FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "CreateContentWizard");
|
||||||
|
|
||||||
TemplateType tt = ts.getTemplateType(ccw.getTemplateType());
|
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);
|
String url = tim.getInputURL(tt.getSampleXml(tt.getName()), tt);
|
||||||
%>
|
%>
|
||||||
<f:verbatim>
|
<f:verbatim>
|
||||||
|
@@ -84,16 +84,6 @@
|
|||||||
|
|
||||||
<h:panelGrid id="panel_grid_2"
|
<h:panelGrid id="panel_grid_2"
|
||||||
columns="3" cellpadding="3" cellspacing="3" border="0">
|
columns="3" cellpadding="3" cellspacing="3" border="0">
|
||||||
<%--
|
|
||||||
<h:graphicImage id="required_image_name"
|
|
||||||
value="/images/icons/required_field.gif" alt="Required Field" />
|
|
||||||
<h:outputText id="output_text_name"
|
|
||||||
value="#{msg.name}:"/>
|
|
||||||
<h:inputText id="file-name" value="#{WizardManager.bean.fileName}"
|
|
||||||
maxlength="1024" size="35"
|
|
||||||
onkeyup="checkButtonState();"
|
|
||||||
onchange="checkButtonState();" />
|
|
||||||
--%>
|
|
||||||
<h:graphicImage id="required_image_schema"
|
<h:graphicImage id="required_image_schema"
|
||||||
value="/images/icons/required_field.gif" alt="Required Field" />
|
value="/images/icons/required_field.gif" alt="Required Field" />
|
||||||
<h:outputText id="output_text_schema"
|
<h:outputText id="output_text_schema"
|
||||||
@@ -101,11 +91,12 @@
|
|||||||
<h:column id="column_schema">
|
<h:column id="column_schema">
|
||||||
<%
|
<%
|
||||||
FileUploadBean upload = (FileUploadBean)
|
FileUploadBean upload = (FileUploadBean)
|
||||||
session.getAttribute(FileUploadBean.FILE_UPLOAD_BEAN_NAME);
|
session.getAttribute(FileUploadBean.getKey("schema"));
|
||||||
if (upload == null || upload.getFile() == null)
|
if (upload == null || upload.getFile() == null)
|
||||||
{
|
{
|
||||||
%>
|
%>
|
||||||
<f:verbatim>
|
<f:verbatim>
|
||||||
|
<input type="hidden" name="upload-id" value="schema"/>
|
||||||
<input type="hidden" name="return-page" value="<%= request.getContextPath() %>/faces<%= request.getServletPath() %>"/>
|
<input type="hidden" name="return-page" value="<%= request.getContextPath() %>/faces<%= request.getServletPath() %>"/>
|
||||||
<input id="wizard:wizard-body:file-input" type="file" size="35" name="alfFileInput" onchange="javascript:upload_file(this)"/>
|
<input id="wizard:wizard-body:file-input" type="file" size="35" name="alfFileInput" onchange="javascript:upload_file(this)"/>
|
||||||
</f:verbatim>
|
</f:verbatim>
|
||||||
@@ -128,23 +119,3 @@ if (upload == null || upload.getFile() == null)
|
|||||||
%>
|
%>
|
||||||
</h:column>
|
</h:column>
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
|
|
||||||
<h:panelGrid id="panel_grid_3"
|
|
||||||
columns="1" cellpadding="3" cellspacing="3" border="0" style="padding-top: 4px;"
|
|
||||||
width="100%" rowClasses="wizardSectionHeading, paddingRow"
|
|
||||||
rendered="#{WizardManager.bean.otherPropertiesChoiceVisible}">
|
|
||||||
<h:outputText id="panel_grid_3_output_text_1"
|
|
||||||
value=" #{msg.other_properties}" escape="false" />
|
|
||||||
<h:outputText id="panel_grid_3_output_text_2"
|
|
||||||
value="#{msg.modify_props_help_text}" />
|
|
||||||
</h:panelGrid>
|
|
||||||
|
|
||||||
<h:panelGrid id="panel_grid_4"
|
|
||||||
style="padding-top: 2px;" columns="2"
|
|
||||||
rendered="#{WizardManager.bean.otherPropertiesChoiceVisible}">
|
|
||||||
<h:selectBooleanCheckbox id="panel_grid_3_select_boolean_checkbox"
|
|
||||||
value="#{WizardManager.bean.showOtherProperties}" />
|
|
||||||
<h:outputText id="panel_grid_4_output_text_1"
|
|
||||||
value="#{msg.modify_props_when_wizard_closes}" />
|
|
||||||
</h:panelGrid>
|
|
||||||
|
@@ -25,7 +25,7 @@ function set_edit_mode(on)
|
|||||||
{
|
{
|
||||||
var iframe = document.getElementById("editor");
|
var iframe = document.getElementById("editor");
|
||||||
editor.setAttribute("src",
|
editor.setAttribute("src",
|
||||||
on ? "</f:verbatim><h:outputText value="#{WizardManager.bean.schemaFormURL}" escape="false"/><f:verbatim>"
|
on ? "</f:verbatim><h:outputText value="not_implemented" escape="false"/><f:verbatim>"
|
||||||
: "</f:verbatim><h:outputText value="#{WizardManager.bean.formURL}" escape="false"/><f:verbatim>");
|
: "</f:verbatim><h:outputText value="#{WizardManager.bean.formURL}" escape="false"/><f:verbatim>");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@@ -32,15 +32,14 @@ xml = xml.replaceAll("<", "<");
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Instance Data submitted</title>
|
<title>Instance Data submitted</title>
|
||||||
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/forms/styles/chiba-styles.css"/>
|
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/main.css"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div class="mainSubTitle">
|
||||||
<center>
|
XML submitted successfully! you rock! Click next!
|
||||||
<font face="sans-serif">XML submitted successfully! you rock! Click next!</font>
|
</div>
|
||||||
</center>
|
<tt>
|
||||||
<center><tt>
|
|
||||||
<%= xml %>
|
<%= xml %>
|
||||||
<tt></center>
|
<tt>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -33,7 +33,6 @@ form{
|
|||||||
.inactive{
|
.inactive{
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
#legend{padding:3px;}
|
|
||||||
|
|
||||||
a.link{color:#444444;}
|
a.link{color:#444444;}
|
||||||
a.visited{color:#444444;}
|
a.visited{color:#444444;}
|
||||||
@@ -53,49 +52,26 @@ appearance class 'minimal-group|compact-group|full-group'. */
|
|||||||
background: white;
|
background: white;
|
||||||
margin-bottom:5px;
|
margin-bottom:5px;
|
||||||
}
|
}
|
||||||
/* IE */
|
|
||||||
fieldset{
|
|
||||||
margin-bottom:5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********** used to render group labels ***********/
|
/*********** used to render group labels ***********/
|
||||||
fieldset > legend {
|
fieldset > legend {
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
|
width: 100%;
|
||||||
border: thin solid rgb(55, 71, 90);
|
border: thin solid rgb(55, 71, 90);
|
||||||
background: white; /*#F0F4EA;*/
|
background-color: #cddbe8;
|
||||||
color: rgb( 85, 96, 63 );
|
|
||||||
margin-top:5px;
|
margin-top:5px;
|
||||||
margin-bottom: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 ***********/
|
/*********** nested group ***********/
|
||||||
fieldset > fieldset {
|
fieldset > fieldset {
|
||||||
margin:5px;
|
/* margin:5px; */
|
||||||
background-color: white; /*rgb(82, 90, 99); */
|
background-color: white; /*rgb(82, 90, 99); */
|
||||||
padding-top:0px;
|
padding-top:0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IE */
|
|
||||||
fieldset fieldset{
|
|
||||||
margin:5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********** nested nested group ***********/
|
/*********** nested nested group ***********/
|
||||||
fieldset > fieldset > fieldset {
|
fieldset > fieldset > fieldset {
|
||||||
margin:5px;
|
margin:5px;
|
||||||
@@ -192,8 +168,8 @@ fieldset > fieldset > fieldset {
|
|||||||
|
|
||||||
|
|
||||||
.label{
|
.label{
|
||||||
color:rgb(85, 96, 63);
|
color: #003366;
|
||||||
padding-right: 5px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
.help-symbol{
|
.help-symbol{
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
<!-- build input control -->
|
<!-- build input control -->
|
||||||
<xsl:template name="input">
|
<xsl:template name="input">
|
||||||
|
<td>
|
||||||
<xsl:variable name="repeat-id" select="ancestor::*[name(.)='xforms:repeat'][1]/@id" />
|
<xsl:variable name="repeat-id" select="ancestor::*[name(.)='xforms:repeat'][1]/@id" />
|
||||||
<xsl:variable name="pos" select="position()" />
|
<xsl:variable name="pos" select="position()" />
|
||||||
<xsl:variable name="id" select="@id" />
|
<xsl:variable name="id" select="@id" />
|
||||||
@@ -117,38 +117,7 @@
|
|||||||
</xsl:element>
|
</xsl:element>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
</td>
|
||||||
|
|
||||||
<!-- build image trigger / submit -->
|
|
||||||
<xsl:template name="image-trigger">
|
|
||||||
<xsl:element name="input">
|
|
||||||
<xsl:variable name="id" select="@id"/>
|
|
||||||
<xsl:variable name="repeat-id" select="ancestor::*[name(.)='xforms:repeat'][1]/@id"/>
|
|
||||||
<xsl:attribute name="id">
|
|
||||||
<xsl:value-of select="concat($id,'-value')"/>
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:attribute name="name">
|
|
||||||
<xsl:value-of select="concat($trigger-prefix,$id)"/>
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:attribute name="type">image</xsl:attribute>
|
|
||||||
<xsl:attribute name="value">
|
|
||||||
<xsl:value-of select="xforms:label"/>
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:attribute name="title">
|
|
||||||
<xsl:value-of select="normalize-space(xforms:hint)"/>
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:attribute name="src">
|
|
||||||
<xsl:value-of select="xforms:label/@xlink:href"/>
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:attribute name="class">value</xsl:attribute>
|
|
||||||
<xsl:if test="chiba:data/@chiba:readonly='true'">
|
|
||||||
<xsl:attribute name="disabled">disabled</xsl:attribute>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:if test="$scripted='true'">
|
|
||||||
<xsl:attribute name="onclick">javascript:activate(this);</xsl:attribute>
|
|
||||||
</xsl:if>
|
|
||||||
</xsl:element>
|
|
||||||
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- build output -->
|
<!-- build output -->
|
||||||
@@ -734,16 +703,11 @@
|
|||||||
<xsl:attribute name="name">
|
<xsl:attribute name="name">
|
||||||
<xsl:value-of select="concat($trigger-prefix,$id)"/>
|
<xsl:value-of select="concat($trigger-prefix,$id)"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$scripted='true'">
|
|
||||||
<xsl:attribute name="type">button</xsl:attribute>
|
<xsl:attribute name="type">button</xsl:attribute>
|
||||||
|
<xsl:attribute name="src">
|
||||||
|
<xsl:value-of select="concat($contextroot, xforms:label/@xlink:href)"/>
|
||||||
|
</xsl:attribute>
|
||||||
<xsl:attribute name="onclick">javascript:activate(this);</xsl:attribute>
|
<xsl:attribute name="onclick">javascript:activate(this);</xsl:attribute>
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:attribute name="type">submit</xsl:attribute>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:attribute name="value">
|
<xsl:attribute name="value">
|
||||||
<xsl:value-of select="xforms:label"/>
|
<xsl:value-of select="xforms:label"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
|
@@ -78,9 +78,8 @@
|
|||||||
<title>
|
<title>
|
||||||
<xsl:value-of select="$form-name"/>
|
<xsl:value-of select="$form-name"/>
|
||||||
</title>
|
</title>
|
||||||
<link rel="shortcut icon" href="forms/images/favicon.ico.gif"/>
|
|
||||||
<xsl:call-template name="getCSS"/>
|
<xsl:call-template name="getCSS"/>
|
||||||
|
<link type="text/css" rel="stylesheet" href="{concat($contextroot,'/css/main.css')}"></link>
|
||||||
<xsl:if test="$scripted='true'">
|
<xsl:if test="$scripted='true'">
|
||||||
<!-- PLEASE DON'T CHANGE THE FORMATTING OF THE XSL:TEXT ELEMENTS - THEY PROVIDE CLEAN LINE BREAKS IN THE OUTPUT -->
|
<!-- PLEASE DON'T CHANGE THE FORMATTING OF THE XSL:TEXT ELEMENTS - THEY PROVIDE CLEAN LINE BREAKS IN THE OUTPUT -->
|
||||||
<!-- for DateControl - only included if dates are used in the form -->
|
<!-- for DateControl - only included if dates are used in the form -->
|
||||||
@@ -200,18 +199,6 @@
|
|||||||
<!--<xsl:copy-of select="@*"/>-->
|
<!--<xsl:copy-of select="@*"/>-->
|
||||||
<body>
|
<body>
|
||||||
<xsl:copy-of select="@*"/>
|
<xsl:copy-of select="@*"/>
|
||||||
<!--
|
|
||||||
<div>
|
|
||||||
<a href="jsp/forms.jsp">
|
|
||||||
<img src="forms/images/chiba50t.gif" style="border:none;" alt="Chiba Logo" width="113" height="39" id="chiba-logo"/>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<table border="0">
|
|
||||||
<tr>
|
|
||||||
<td></td>
|
|
||||||
<td>
|
|
||||||
-->
|
|
||||||
<div id="loading">
|
<div id="loading">
|
||||||
<img src="{concat($contextroot,'/jsp/content/xforms/forms/images/chiba-logo_klein2.gif')}" class="disabled" id="indicator" alt="loading" />
|
<img src="{concat($contextroot,'/jsp/content/xforms/forms/images/chiba-logo_klein2.gif')}" class="disabled" id="indicator" alt="loading" />
|
||||||
</div>
|
</div>
|
||||||
@@ -239,17 +226,6 @@
|
|||||||
<input type="submit" value="refresh page" class="refresh-button"/>
|
<input type="submit" value="refresh page" class="refresh-button"/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:element>
|
</xsl:element>
|
||||||
<!--
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td/>
|
|
||||||
<td>
|
|
||||||
<table width="100%" border="0">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
-->
|
|
||||||
<span id="legend">
|
<span id="legend">
|
||||||
<span style="color:#A42322;">*</span> - required |
|
<span style="color:#A42322;">*</span> - required |
|
||||||
<b>?</b> - help
|
<b>?</b> - help
|
||||||
@@ -262,18 +238,6 @@
|
|||||||
<div id="copyright">
|
<div id="copyright">
|
||||||
<xsl:text disable-output-escaping="yes">&copy; 2001-2005 Chiba Project</xsl:text>
|
<xsl:text disable-output-escaping="yes">&copy; 2001-2005 Chiba Project</xsl:text>
|
||||||
</div>
|
</div>
|
||||||
<!--
|
|
||||||
</td>
|
|
||||||
<td align="right">
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
-->
|
|
||||||
<xsl:if test="$debug-enabled='true' and $scripted='true'">
|
<xsl:if test="$debug-enabled='true' and $scripted='true'">
|
||||||
<form id="debugform" name="debugform" action="" onsubmit="return false;">
|
<form id="debugform" name="debugform" action="" onsubmit="return false;">
|
||||||
<textarea id="debugarea" name="debugarea" rows="5" cols="15"></textarea>
|
<textarea id="debugarea" name="debugarea" rows="5" cols="15"></textarea>
|
||||||
@@ -359,6 +323,15 @@
|
|||||||
<xsl:template match="xforms:label">
|
<xsl:template match="xforms:label">
|
||||||
<xsl:variable name="group-id" select="ancestor::xforms:group[1]/@id"/>
|
<xsl:variable name="group-id" select="ancestor::xforms:group[1]/@id"/>
|
||||||
<xsl:variable name="img" select="@xforms:src"/>
|
<xsl:variable name="img" select="@xforms:src"/>
|
||||||
|
<xsl:if test="../chiba:data/@chiba:required='true'">
|
||||||
|
<xsl:element name="img">
|
||||||
|
<xsl:attribute name="class">required-symbol</xsl:attribute>
|
||||||
|
<xsl:attribute name="style">margin-right: 10px;</xsl:attribute>
|
||||||
|
<xsl:attribute name="src">
|
||||||
|
<xsl:value-of select="concat($contextroot, '/images/icons/required_field.gif')"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:if>
|
||||||
|
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<!--
|
<!--
|
||||||
@@ -386,7 +359,6 @@
|
|||||||
<xsl:apply-templates/>
|
<xsl:apply-templates/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
<xsl:if test="../chiba:data/@chiba:required='true'"><span class="required-symbol">*</span></xsl:if>
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- ### handle hint ### -->
|
<!-- ### handle hint ### -->
|
||||||
|
@@ -33,9 +33,9 @@ NodeRef nr = ccb.getDocument().getNodeRef();
|
|||||||
String ttName = (String)ccb.getNodeService().getProperty(nr, CreateContentWizard.TT_QNAME);
|
String ttName = (String)ccb.getNodeService().getProperty(nr, CreateContentWizard.TT_QNAME);
|
||||||
TemplatingService ts = TemplatingService.getInstance();
|
TemplatingService ts = TemplatingService.getInstance();
|
||||||
TemplateType tt = ts.getTemplateType(ttName);
|
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);
|
String url = tim.getInputURL(ts.parseXML(ccb.getDocumentContent()), tt);
|
||||||
System.out.println("TTTTTT " + tt);
|
|
||||||
System.out.println("inputurl " + url);
|
System.out.println("inputurl " + url);
|
||||||
%>
|
%>
|
||||||
<r:page titleId="title_edit_text_inline">
|
<r:page titleId="title_edit_text_inline">
|
||||||
|
Reference in New Issue
Block a user