mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
DM Forms - fix web forms with inline URIs (eg. company press release sample)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7527 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -26,7 +26,7 @@ import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.w3c.dom.Document;
|
||||
@@ -113,4 +113,9 @@ public interface Form
|
||||
* @return the rendering engine template or <tt>null</tt> if not found.
|
||||
*/
|
||||
public RenderingEngineTemplate getRenderingEngineTemplate(final String name);
|
||||
|
||||
/**
|
||||
* @return true if WCM Form, false if ECM form
|
||||
*/
|
||||
public boolean isWebForm();
|
||||
}
|
||||
|
@@ -23,17 +23,18 @@
|
||||
*/
|
||||
package org.alfresco.web.forms;
|
||||
|
||||
import freemarker.ext.dom.NodeModel;
|
||||
import freemarker.template.SimpleDate;
|
||||
import freemarker.template.SimpleHash;
|
||||
import freemarker.template.SimpleScalar;
|
||||
import freemarker.template.TemplateHashModel;
|
||||
import freemarker.template.TemplateModel;
|
||||
import freemarker.template.TemplateModelException;
|
||||
import java.io.*;
|
||||
import java.net.URI;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.WCMAppModel;
|
||||
@@ -41,7 +42,6 @@ import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.AssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.TemplateException;
|
||||
@@ -56,9 +56,13 @@ import org.alfresco.web.bean.wcm.AVMWorkflowUtil;
|
||||
import org.alfresco.web.forms.xforms.XFormsProcessor;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.w3c.dom.*;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import freemarker.ext.dom.NodeModel;
|
||||
import freemarker.template.SimpleDate;
|
||||
import freemarker.template.SimpleHash;
|
||||
|
||||
public class FormImpl
|
||||
implements Form
|
||||
{
|
||||
@@ -278,6 +282,18 @@ public class FormImpl
|
||||
{
|
||||
return this.folderNodeRef;
|
||||
}
|
||||
|
||||
public boolean isWebForm()
|
||||
{
|
||||
boolean isWebForm = true;
|
||||
NodeService nodeService = this.getServiceRegistry().getNodeService();
|
||||
if (nodeService.getPrimaryParent(this.folderNodeRef).getParentRef().equals(this.formsService.getContentFormsNodeRef()))
|
||||
{
|
||||
// ECM form
|
||||
isWebForm = false;
|
||||
}
|
||||
return isWebForm;
|
||||
}
|
||||
|
||||
public int hashCode()
|
||||
{
|
||||
|
@@ -657,14 +657,16 @@ public class XFormsBean
|
||||
private Document getXFormsDocument()
|
||||
throws FormBuilderException
|
||||
{
|
||||
// TODO - need better way to to determine if WCM or ECM context, or earlier ...
|
||||
final String path = this.getCurrentPath();
|
||||
|
||||
if (path == null)
|
||||
String path = null;
|
||||
if (this.xformsSession.form.isWebForm())
|
||||
{
|
||||
this.getCurrentAVMPath();
|
||||
path = this.getCurrentAVMPath();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
path = this.getCurrentPath();
|
||||
}
|
||||
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
LOGGER.debug("building xform for schema " + this.xformsSession.form.getName() +
|
||||
|
Reference in New Issue
Block a user