mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- adding aspect to webapp nodes to differentiate them from ordinary folders in the avm_webapps directory
- refactoring of generate and regenerate calls to take a FormInstanceData object - adding in support for overriding step title and description properties in wizards so as to be able to format them with parameters - making the step descriptions in create form wizard reiterate the form name so as to give the user better context - displaying avm task resources in the manage task screen. still need to get actions working and clean this up a bit. - making output path patterns sandbox relative - refactored utility method for combining avm paths sensitive to webapp vs sandbox relative paths. - adding a default description for generated renditions todo: - cleanup some usage of AVMNode from ManageTaskBean - get actions to appear in manage task screen - add a multi value property to the web project for all its webapps - properly use overridden values for forms from the web project settings git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4687 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -661,17 +661,18 @@ create_form_form_details_desc=Enter information about the web form you want to c
|
|||||||
create_form_form_details_step1_desc=Select XML schema to use
|
create_form_form_details_step1_desc=Select XML schema to use
|
||||||
create_form_form_details_step2_desc=Specify details for new form.
|
create_form_form_details_step2_desc=Specify details for new form.
|
||||||
create_form_form_details_no_schema_selected=<no schema selected>
|
create_form_form_details_no_schema_selected=<no schema selected>
|
||||||
create_form_configure_rendering_engine_templates_title=Step Two - Configure Rendering Engine Templates
|
create_form_configure_rendering_engine_templates_title=Step Two - Configure rendering engine templates
|
||||||
create_form_configure_rendering_engine_templates_desc=Enter information about the rendering engine templates you want to use for this form.
|
create_form_configure_rendering_engine_templates_desc=Enter information about the rendering engine templates you want to use for form {0}.
|
||||||
create_form_configure_rendering_engine_templates_step1_desc=Select the rendering engine template to use
|
create_form_configure_rendering_engine_templates_step1_desc=Select the rendering engine template to use
|
||||||
create_form_configure_rendering_engine_templates_step2_desc=Specify details for the new rendering engine template
|
create_form_configure_rendering_engine_templates_step2_desc=Specify details for the new rendering engine template
|
||||||
create_form_select_default_workflow_title=Stop Three - Select default workflow
|
create_form_select_default_workflow_title=Stop Three - Select default workflow
|
||||||
create_form_select_default_workflow_desc=Select the workflow you want to be used by default for this form.
|
create_form_select_default_workflow_desc=Select the workflow you want to be used by default for form {0}.
|
||||||
create_web_content_summary_desc=The wizard has successfully created the content and all renditions.
|
create_web_content_summary_desc=The wizard has successfully created the content and all renditions.
|
||||||
create_web_content_summary_content_details=Content Details
|
create_web_content_summary_content_details=Content Details
|
||||||
create_web_content_summary_rendition_details=Rendition Details
|
create_web_content_summary_rendition_details=Rendition Details
|
||||||
create_web_content_summary_uploaded_files_details=Uploaded File Details
|
create_web_content_summary_uploaded_files_details=Uploaded File Details
|
||||||
create_web_content_summary_submit_message=Submit {0} when wizard finishes.
|
create_web_content_summary_submit_message=Submit {0,choice,0#__SHOULD NOT BE ZERO__|1#{1}|1<these {0,number} files} when wizard finishes.
|
||||||
|
default_rendition_description=Rendered by {0} into {1}
|
||||||
rendering_engine_type=Rendering Engine
|
rendering_engine_type=Rendering Engine
|
||||||
apply_default_workflow=Apply default workflow
|
apply_default_workflow=Apply default workflow
|
||||||
rendering_engine_templates=Rendering Engine Templates
|
rendering_engine_templates=Rendering Engine Templates
|
||||||
@@ -838,7 +839,7 @@ website_filename_pattern=Filename pattern
|
|||||||
website_filename_match=Filename pattern match
|
website_filename_match=Filename pattern match
|
||||||
website_workflow=Workflow
|
website_workflow=Workflow
|
||||||
website_workflow_info=Use the following workflow
|
website_workflow_info=Use the following workflow
|
||||||
website_form_summary=Using workflow ''{0}'', with filename pattern ''{1}'', {2} rendering engine(s) selected.
|
website_form_summary=Using workflow ''{0}'', with filename pattern ''{1}'', {2,choice,0#no rendering engines|1#one rendering engine|1<{2,number} rendering engines} selected.
|
||||||
website_forms=Define Forms
|
website_forms=Define Forms
|
||||||
form_template_details=Form Details
|
form_template_details=Form Details
|
||||||
form_template_details_desc=Edit the details of this Form Template
|
form_template_details_desc=Edit the details of this Form Template
|
||||||
@@ -919,7 +920,7 @@ modified_items=Modified Items
|
|||||||
content_forms=Available Content Forms
|
content_forms=Available Content Forms
|
||||||
store_created_on=Created On
|
store_created_on=Created On
|
||||||
store_created_by=Created By
|
store_created_by=Created By
|
||||||
store_working_users=There are {0} user(s) working on this web project.
|
store_working_users=There {0,choice,0#are no users|1#is one user|1<are {0,number} users} working on this web project.
|
||||||
avm_node_deleted=Deleted
|
avm_node_deleted=Deleted
|
||||||
revert=Revert
|
revert=Revert
|
||||||
revert_success=Successfully reverted item: {0}
|
revert_success=Successfully reverted item: {0}
|
||||||
|
@@ -38,6 +38,32 @@ import org.springframework.web.jsf.FacesContextUtils;
|
|||||||
*/
|
*/
|
||||||
public final class AVMConstants
|
public final class AVMConstants
|
||||||
{
|
{
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
public static enum PathRelation
|
||||||
|
{
|
||||||
|
SANDBOX_RELATIVE
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
protected Pattern pattern()
|
||||||
|
{
|
||||||
|
return AVMConstants.SANDBOX_RELATIVE_PATH_PATTERN;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
WEBAPP_RELATIVE
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
protected Pattern pattern()
|
||||||
|
{
|
||||||
|
return AVMConstants.WEBAPP_RELATIVE_PATH_PATTERN;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
protected abstract Pattern pattern();
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private constructor
|
* Private constructor
|
||||||
*/
|
*/
|
||||||
@@ -208,7 +234,7 @@ public final class AVMConstants
|
|||||||
Map<QName, PropertyValue> props = avmService.queryStorePropertyKey(store, QName.createQName(null, PROP_DNS + '%'));
|
Map<QName, PropertyValue> props = avmService.queryStorePropertyKey(store, QName.createQName(null, PROP_DNS + '%'));
|
||||||
if (props.size() == 1)
|
if (props.size() == 1)
|
||||||
{
|
{
|
||||||
dns = props.entrySet().iterator().next().getKey().getLocalName().substring(PROP_DNS.length());
|
dns = props.keySet().iterator().next().getLocalName().substring(PROP_DNS.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
return dns;
|
return dns;
|
||||||
@@ -221,11 +247,13 @@ public final class AVMConstants
|
|||||||
* is relative, otherwise used to extract the parent path portion up until
|
* is relative, otherwise used to extract the parent path portion up until
|
||||||
* the webapp directory.
|
* the webapp directory.
|
||||||
* @param path a path relative to the parentAVMPath path, or if it is
|
* @param path a path relative to the parentAVMPath path, or if it is
|
||||||
* absolute, it is relative to the webapp used in the parentAVMPath.
|
* absolute, it is relative to the sandbox used in the parentAVMPath.
|
||||||
*
|
*
|
||||||
* @return an absolute path within the avm using the paths provided.
|
* @return an absolute path within the avm using the paths provided.
|
||||||
*/
|
*/
|
||||||
public static String buildAbsoluteAVMPath(final String parentAVMPath, final String path)
|
public static String buildAVMPath(final String parentAVMPath,
|
||||||
|
final String path,
|
||||||
|
final PathRelation relation)
|
||||||
{
|
{
|
||||||
String parent = parentAVMPath;
|
String parent = parentAVMPath;
|
||||||
if (path == null || path.length() == 0 ||
|
if (path == null || path.length() == 0 ||
|
||||||
@@ -236,7 +264,7 @@ public final class AVMConstants
|
|||||||
|
|
||||||
if (path.charAt(0) == '/')
|
if (path.charAt(0) == '/')
|
||||||
{
|
{
|
||||||
final Matcher m = absoluteAVMPath.matcher(parent);
|
final Matcher m = relation.pattern().matcher(parent);
|
||||||
if (m.matches())
|
if (m.matches())
|
||||||
{
|
{
|
||||||
parent = m.group(1);
|
parent = m.group(1);
|
||||||
@@ -258,8 +286,61 @@ public final class AVMConstants
|
|||||||
*/
|
*/
|
||||||
public static String getWebappRelativePath(final String absoluteAVMPath)
|
public static String getWebappRelativePath(final String absoluteAVMPath)
|
||||||
{
|
{
|
||||||
final Matcher m = webappRelativePath.matcher(absoluteAVMPath);
|
final Matcher m = WEBAPP_RELATIVE_PATH_PATTERN.matcher(absoluteAVMPath);
|
||||||
return m.matches() && m.group(1).length() != 0 ? m.group(1) : "/";
|
return m.matches() && m.group(3).length() != 0 ? m.group(3) : "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the webapp within the path
|
||||||
|
*
|
||||||
|
* @param absoluteAVMPath the path from which to extract the webapp name
|
||||||
|
*
|
||||||
|
* @return an the webapp name contained within the path or <tt>null</tt>.
|
||||||
|
*/
|
||||||
|
public static String getWebapp(final String absoluteAVMPath)
|
||||||
|
{
|
||||||
|
final Matcher m = WEBAPP_RELATIVE_PATH_PATTERN.matcher(absoluteAVMPath);
|
||||||
|
return m.matches() && m.group(2).length() != 0 ? m.group(2) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the path portion up the webap
|
||||||
|
*
|
||||||
|
* @param absoluteAVMPath the path from which to extract the webapp path
|
||||||
|
*
|
||||||
|
* @return an absolute avm path to the webapp contained within
|
||||||
|
* the path or <tt>null</tt>.
|
||||||
|
*/
|
||||||
|
public static String getWebappPath(final String absoluteAVMPath)
|
||||||
|
{
|
||||||
|
final Matcher m = WEBAPP_RELATIVE_PATH_PATTERN.matcher(absoluteAVMPath);
|
||||||
|
return m.matches() && m.group(1).length() != 0 ? m.group(1) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a path relative to the sandbox porition of the avm path.
|
||||||
|
*
|
||||||
|
* @param absoluteAVMPath an absolute path within the avm
|
||||||
|
* @return a relative path within the sandbox.
|
||||||
|
*/
|
||||||
|
public static String getSandboxRelativePath(final String absoluteAVMPath)
|
||||||
|
{
|
||||||
|
final Matcher m = SANDBOX_RELATIVE_PATH_PATTERN.matcher(absoluteAVMPath);
|
||||||
|
return m.matches() && m.group(2).length() != 0 ? m.group(2) : "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the path portion up the sandbox
|
||||||
|
*
|
||||||
|
* @param absoluteAVMPath the path from which to extract the sandbox path
|
||||||
|
*
|
||||||
|
* @return an absolute avm path to the sandbox contained within
|
||||||
|
* the path or <tt>null</tt>.
|
||||||
|
*/
|
||||||
|
public static String getSandboxPath(final String absoluteAVMPath)
|
||||||
|
{
|
||||||
|
final Matcher m = SANDBOX_RELATIVE_PATH_PATTERN.matcher(absoluteAVMPath);
|
||||||
|
return m.matches() && m.group(1).length() != 0 ? m.group(1) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -274,7 +355,7 @@ public final class AVMConstants
|
|||||||
throw new IllegalArgumentException("Path value is mandatory.");
|
throw new IllegalArgumentException("Path value is mandatory.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return webinfPathPattern.matcher(path).matches();
|
return WEB_INF_PATH_PATTERN.matcher(path).matches();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -351,14 +432,15 @@ public final class AVMConstants
|
|||||||
private final static String PREVIEW_ASSET_URL = "http://www-{0}.{1}:{2}{3}";
|
private final static String PREVIEW_ASSET_URL = "http://www-{0}.{1}:{2}{3}";
|
||||||
|
|
||||||
// pattern for absolute AVM Path
|
// pattern for absolute AVM Path
|
||||||
private final static Pattern absoluteAVMPath = Pattern.compile(
|
private final static Pattern WEBAPP_RELATIVE_PATH_PATTERN =
|
||||||
"([^:]+:/" + AVMConstants.DIR_APPBASE + "/[^/]+/[^/]+).*");
|
Pattern.compile("([^:]+:/" + AVMConstants.DIR_APPBASE +
|
||||||
private final static Pattern webappRelativePath = Pattern.compile(
|
"/" + AVMConstants.DIR_WEBAPPS + "/([^/]+))(.*)");
|
||||||
"[^:]+:/" + AVMConstants.DIR_APPBASE +
|
private final static Pattern SANDBOX_RELATIVE_PATH_PATTERN =
|
||||||
"/" + AVMConstants.DIR_WEBAPPS + "/[^/]+(.*)");
|
Pattern.compile("([^:]+:/" + AVMConstants.DIR_APPBASE +
|
||||||
|
"/" + AVMConstants.DIR_WEBAPPS + ")(.*)");
|
||||||
|
|
||||||
// patterns for WEB-INF files that require virtualisation server reload
|
// patterns for WEB-INF files that require virtualisation server reload
|
||||||
private final static Pattern webinfPathPattern = Pattern.compile(
|
private final static Pattern WEB_INF_PATH_PATTERN = Pattern.compile(
|
||||||
".*:/" + AVMConstants.DIR_APPBASE + "/" + AVMConstants.DIR_WEBAPPS +
|
".*:/" + AVMConstants.DIR_APPBASE + "/" + AVMConstants.DIR_WEBAPPS +
|
||||||
"/.*/WEB-INF/((classes/.*)|(lib/.*)|(web.xml))",
|
"/.*/WEB-INF/((classes/.*)|(lib/.*)|(web.xml))",
|
||||||
Pattern.CASE_INSENSITIVE);
|
Pattern.CASE_INSENSITIVE);
|
||||||
|
@@ -45,6 +45,7 @@ import org.alfresco.web.bean.CheckinCheckoutBean;
|
|||||||
import org.alfresco.web.bean.FileUploadBean;
|
import org.alfresco.web.bean.FileUploadBean;
|
||||||
import org.alfresco.web.bean.repository.Repository;
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
import org.alfresco.web.forms.Form;
|
import org.alfresco.web.forms.Form;
|
||||||
|
import org.alfresco.web.forms.FormInstanceDataImpl;
|
||||||
import org.alfresco.web.forms.FormProcessor;
|
import org.alfresco.web.forms.FormProcessor;
|
||||||
import org.alfresco.web.forms.FormsService;
|
import org.alfresco.web.forms.FormsService;
|
||||||
import org.alfresco.web.forms.Rendition;
|
import org.alfresco.web.forms.Rendition;
|
||||||
@@ -409,8 +410,8 @@ public class AVMEditBean
|
|||||||
// regenerate form content
|
// regenerate form content
|
||||||
if (nodeService.hasAspect(avmRef, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
|
if (nodeService.hasAspect(avmRef, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
|
||||||
{
|
{
|
||||||
formsService.regenerateRenditions(avmRef);
|
formsService.regenerateRenditions(new FormInstanceDataImpl(avmRef));
|
||||||
NodeRef[] uploadedFiles = this.formProcessorSession.getUploadedFiles();
|
final NodeRef[] uploadedFiles = this.formProcessorSession.getUploadedFiles();
|
||||||
final List<AVMDifference> diffList = new ArrayList<AVMDifference>(uploadedFiles.length);
|
final List<AVMDifference> diffList = new ArrayList<AVMDifference>(uploadedFiles.length);
|
||||||
for (NodeRef uploadedFile : uploadedFiles)
|
for (NodeRef uploadedFile : uploadedFiles)
|
||||||
{
|
{
|
||||||
|
@@ -18,6 +18,7 @@ package org.alfresco.web.bean.wcm;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
import javax.faces.event.ActionEvent;
|
import javax.faces.event.ActionEvent;
|
||||||
@@ -366,19 +367,41 @@ public class CreateFormWizard
|
|||||||
// wizard implementations don't have to worry about
|
// wizard implementations don't have to worry about
|
||||||
// checking step numbers
|
// checking step numbers
|
||||||
|
|
||||||
boolean disabled = false;
|
|
||||||
final int step = Application.getWizardManager().getCurrentStep();
|
final int step = Application.getWizardManager().getCurrentStep();
|
||||||
switch(step)
|
switch(step)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
disabled = (this.getSchemaFileName() == null ||
|
return (this.getSchemaFileName() == null ||
|
||||||
this.getSchemaFileName().length() == 0);
|
this.getSchemaFileName().length() == 0);
|
||||||
break;
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return disabled;
|
@Override
|
||||||
|
public String getStepDescription()
|
||||||
|
{
|
||||||
|
final ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
|
||||||
|
final String stepName = Application.getWizardManager().getCurrentStepName();
|
||||||
|
if ("configure_rendering_engine_templates".equals(stepName))
|
||||||
|
{
|
||||||
|
return MessageFormat.format(bundle.getString("create_form_configure_rendering_engine_templates_desc"),
|
||||||
|
this.getFormName());
|
||||||
|
}
|
||||||
|
else if ("select_default_workflow".equals(stepName))
|
||||||
|
{
|
||||||
|
|
||||||
|
return MessageFormat.format(bundle.getString("create_form_select_default_workflow_desc"),
|
||||||
|
this.getFormName());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return super.getContainerDescription();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -306,11 +306,16 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
// reset all paths and structures to the main store
|
// reset all paths and structures to the main store
|
||||||
this.createdPath = this.createdPath.replaceFirst(AVMConstants.STORE_PREVIEW,
|
this.createdPath = this.createdPath.replaceFirst(AVMConstants.STORE_PREVIEW,
|
||||||
AVMConstants.STORE_MAIN);
|
AVMConstants.STORE_MAIN);
|
||||||
|
LOGGER.debug("reset path " + this.createdPath + " to main store");
|
||||||
|
|
||||||
|
|
||||||
boolean form = (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null);
|
boolean form = (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null);
|
||||||
if (form)
|
if (form)
|
||||||
{
|
{
|
||||||
this.formInstanceData = new FormInstanceDataImpl(AVMNodeConverter.ToNodeRef(-1, this.createdPath));
|
this.formInstanceData = new FormInstanceDataImpl(AVMNodeConverter.ToNodeRef(-1, this.createdPath));
|
||||||
this.renditions = this.formInstanceData.getRenditions();
|
this.renditions = this.formInstanceData.getRenditions();
|
||||||
|
LOGGER.debug("reset form instance data " + this.formInstanceData.getName() +
|
||||||
|
" and " + this.renditions.size() + " to main store");
|
||||||
}
|
}
|
||||||
if (this.startWorkflow)
|
if (this.startWorkflow)
|
||||||
{
|
{
|
||||||
@@ -378,6 +383,8 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
// create package paths (layered to user sandbox area as target)
|
// create package paths (layered to user sandbox area as target)
|
||||||
String stagingPath = AVMConstants.buildAVMStoreRootPath(this.avmBrowseBean.getStagingStore());
|
String stagingPath = AVMConstants.buildAVMStoreRootPath(this.avmBrowseBean.getStagingStore());
|
||||||
String packagesPath = AVMWorkflowUtil.createAVMLayeredPackage(this.avmService, stagingPath);
|
String packagesPath = AVMWorkflowUtil.createAVMLayeredPackage(this.avmService, stagingPath);
|
||||||
|
LOGGER.debug("created layered package " + packagesPath +
|
||||||
|
" above " + stagingPath);
|
||||||
|
|
||||||
List<AVMDifference> diffs = new ArrayList<AVMDifference>(8);
|
List<AVMDifference> diffs = new ArrayList<AVMDifference>(8);
|
||||||
// construct diffs for selected items for submission
|
// construct diffs for selected items for submission
|
||||||
@@ -484,7 +491,10 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
path = path.replaceFirst(AVMConstants.STORE_MAIN, AVMConstants.STORE_PREVIEW);
|
path = path.replaceFirst(AVMConstants.STORE_MAIN, AVMConstants.STORE_PREVIEW);
|
||||||
if (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null)
|
if (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null)
|
||||||
{
|
{
|
||||||
path = this.getForm().getOutputPathForFormInstanceData(path, fileName, this.instanceDataDocument);
|
path = this.getForm().getOutputPathForFormInstanceData(this.instanceDataDocument,
|
||||||
|
fileName,
|
||||||
|
path,
|
||||||
|
this.avmBrowseBean.getWebapp());
|
||||||
this.content = FormsService.getInstance().writeXMLToString(this.instanceDataDocument);
|
this.content = FormsService.getInstance().writeXMLToString(this.instanceDataDocument);
|
||||||
final String[] sb = AVMNodeConverter.SplitBase(path);
|
final String[] sb = AVMNodeConverter.SplitBase(path);
|
||||||
path = sb[0];
|
path = sb[0];
|
||||||
@@ -505,7 +515,7 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
new ByteArrayInputStream((this.content == null ? "" : this.content).getBytes()));
|
new ByteArrayInputStream((this.content == null ? "" : this.content).getBytes()));
|
||||||
|
|
||||||
// remember the created path
|
// remember the created path
|
||||||
this.createdPath = path + '/' + fileName;
|
this.createdPath = AVMNodeConverter.ExtendAVMPath(path, fileName);
|
||||||
|
|
||||||
// add titled aspect for the read/edit properties screens
|
// add titled aspect for the read/edit properties screens
|
||||||
final NodeRef formInstanceDataNodeRef = AVMNodeConverter.ToNodeRef(-1, this.createdPath);
|
final NodeRef formInstanceDataNodeRef = AVMNodeConverter.ToNodeRef(-1, this.createdPath);
|
||||||
@@ -517,7 +527,7 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
{
|
{
|
||||||
this.formInstanceData = new FormInstanceDataImpl(formInstanceDataNodeRef);
|
this.formInstanceData = new FormInstanceDataImpl(formInstanceDataNodeRef);
|
||||||
this.getForm().registerFormInstanceData(formInstanceDataNodeRef);
|
this.getForm().registerFormInstanceData(formInstanceDataNodeRef);
|
||||||
this.renditions = FormsService.getInstance().generateRenditions(formInstanceDataNodeRef);
|
this.renditions = FormsService.getInstance().generateRenditions(this.formInstanceData);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -706,7 +716,7 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
{
|
{
|
||||||
if (this.formProcessorSession == null)
|
if (this.formProcessorSession == null)
|
||||||
{
|
{
|
||||||
return Collections.emptyList();
|
return Collections.EMPTY_LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeRef[] uploadedFiles = this.formProcessorSession.getUploadedFiles();
|
NodeRef[] uploadedFiles = this.formProcessorSession.getUploadedFiles();
|
||||||
@@ -727,6 +737,15 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the number of submittable files which is the total number of
|
||||||
|
* uploaded files, renditions, and the form instance data.
|
||||||
|
*/
|
||||||
|
public int getNumberOfSubmittableFiles()
|
||||||
|
{
|
||||||
|
return 1 + this.getUploadedFiles().size() + this.getRenditions().size();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean getFormSelectDisabled()
|
public boolean getFormSelectDisabled()
|
||||||
{
|
{
|
||||||
return this.formSelectDisabled;
|
return this.formSelectDisabled;
|
||||||
|
@@ -20,8 +20,10 @@ import javax.faces.context.FacesContext;
|
|||||||
|
|
||||||
import org.alfresco.model.ApplicationModel;
|
import org.alfresco.model.ApplicationModel;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
|
import org.alfresco.model.WCMAppModel;
|
||||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||||
|
import org.alfresco.repo.domain.PropertyValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bean implementation for the AVM "Create Webapp Folder" dialog.
|
* Bean implementation for the AVM "Create Webapp Folder" dialog.
|
||||||
@@ -39,15 +41,18 @@ public class CreateWebappDialog extends CreateFolderDialog
|
|||||||
@Override
|
@Override
|
||||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||||
{
|
{
|
||||||
String parent = AVMConstants.buildAVMStoreRootPath(this.avmBrowseBean.getStagingStore());
|
final String parent = AVMConstants.buildAVMStoreRootPath(this.avmBrowseBean.getStagingStore());
|
||||||
this.avmService.createDirectory(parent, this.name);
|
this.avmService.createDirectory(parent, this.name);
|
||||||
|
|
||||||
String path = parent + '/' + this.name;
|
final String path = AVMNodeConverter.ExtendAVMPath(parent, this.name);
|
||||||
NodeRef nodeRef = AVMNodeConverter.ToNodeRef(-1, path);
|
this.avmService.addAspect(path, ApplicationModel.ASPECT_UIFACETS);
|
||||||
this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, null);
|
this.avmService.addAspect(path, WCMAppModel.ASPECT_WEBAPP);
|
||||||
if (this.description != null && this.description.length() != 0)
|
if (this.description != null && this.description.length() != 0)
|
||||||
{
|
{
|
||||||
this.nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, this.description);
|
this.avmService.setNodeProperty(path,
|
||||||
|
ContentModel.PROP_DESCRIPTION,
|
||||||
|
new PropertyValue(DataTypeDefinition.TEXT,
|
||||||
|
this.description));
|
||||||
}
|
}
|
||||||
|
|
||||||
return outcome;
|
return outcome;
|
||||||
|
@@ -33,6 +33,7 @@ import org.alfresco.error.AlfrescoRuntimeException;
|
|||||||
import org.alfresco.model.ApplicationModel;
|
import org.alfresco.model.ApplicationModel;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.model.WCMAppModel;
|
import org.alfresco.model.WCMAppModel;
|
||||||
|
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||||
import org.alfresco.service.cmr.avm.AVMService;
|
import org.alfresco.service.cmr.avm.AVMService;
|
||||||
import org.alfresco.service.cmr.model.FileInfo;
|
import org.alfresco.service.cmr.model.FileInfo;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
@@ -186,8 +187,12 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
|||||||
SandboxFactory.createStagingSandbox(avmStore, wiz.getManagers());
|
SandboxFactory.createStagingSandbox(avmStore, wiz.getManagers());
|
||||||
|
|
||||||
// create the default webapp folder under the hidden system folders
|
// create the default webapp folder under the hidden system folders
|
||||||
String stagingStore = AVMConstants.buildAVMStagingStoreName(avmStore);
|
final String stagingStore = AVMConstants.buildAVMStagingStoreName(avmStore);
|
||||||
this.avmService.createDirectory(AVMConstants.buildAVMStoreRootPath(stagingStore), webapp);
|
final String stagingStoreRoot = AVMConstants.buildAVMStoreRootPath(stagingStore);
|
||||||
|
this.avmService.createDirectory(stagingStoreRoot, webapp);
|
||||||
|
this.avmService.addAspect(AVMNodeConverter.ExtendAVMPath(stagingStoreRoot,
|
||||||
|
webapp),
|
||||||
|
WCMAppModel.ASPECT_WEBAPP);
|
||||||
|
|
||||||
// set the property on the node to reference the root AVM store
|
// set the property on the node to reference the root AVM store
|
||||||
this.nodeService.setProperty(nodeRef, WCMAppModel.PROP_AVMSTORE, avmStore);
|
this.nodeService.setProperty(nodeRef, WCMAppModel.PROP_AVMSTORE, avmStore);
|
||||||
|
@@ -45,6 +45,16 @@ public abstract class BaseWizardBean extends BaseDialogBean implements IWizardBe
|
|||||||
return Application.getMessage(FacesContext.getCurrentInstance(), "finish_button");
|
return Application.getMessage(FacesContext.getCurrentInstance(), "finish_button");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getStepTitle()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStepDescription()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build summary table from the specified list of Labels and Values
|
* Build summary table from the specified list of Labels and Values
|
||||||
*
|
*
|
||||||
|
@@ -43,4 +43,22 @@ public interface IWizardBean extends IDialogBean
|
|||||||
* @return true if the button should be disabled
|
* @return true if the button should be disabled
|
||||||
*/
|
*/
|
||||||
public boolean getNextButtonDisabled();
|
public boolean getNextButtonDisabled();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the title to be used for the current step
|
||||||
|
* <p>If this returns <tt>null</tt> the WizardManager will
|
||||||
|
* lookup the title via the dialog configuration</p>
|
||||||
|
*
|
||||||
|
* @return The title or <tt>null</tt> if the title is to be acquired via configuration
|
||||||
|
*/
|
||||||
|
public String getStepTitle();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the description to be used for the current step
|
||||||
|
* <p>If this returns <tt>null</tt> the WizardManager will
|
||||||
|
* lookup the description via the dialog configuration</p>
|
||||||
|
*
|
||||||
|
* @return The decsription or <tt>null</tt> if the title is to be acquired via configuration
|
||||||
|
*/
|
||||||
|
public String getStepDescription();
|
||||||
}
|
}
|
||||||
|
@@ -206,7 +206,6 @@ public final class WizardManager
|
|||||||
{
|
{
|
||||||
// try and get the description directly from the dialog
|
// try and get the description directly from the dialog
|
||||||
String desc = this.currentWizardState.getWizard().getContainerDescription();
|
String desc = this.currentWizardState.getWizard().getContainerDescription();
|
||||||
|
|
||||||
if (desc == null)
|
if (desc == null)
|
||||||
{
|
{
|
||||||
// try and get the description via a message bundle key
|
// try and get the description via a message bundle key
|
||||||
@@ -324,18 +323,15 @@ public final class WizardManager
|
|||||||
*/
|
*/
|
||||||
public String getStepTitle()
|
public String getStepTitle()
|
||||||
{
|
{
|
||||||
String title = this.currentWizardState.getCurrentPageCfg().getTitleId();
|
String result = this.currentWizardState.getWizard().getStepTitle();
|
||||||
|
if (result == null)
|
||||||
if (title != null)
|
|
||||||
{
|
{
|
||||||
title = Application.getMessage(FacesContext.getCurrentInstance(), title);
|
result = this.currentWizardState.getCurrentPageCfg().getTitleId();
|
||||||
|
result = (result != null
|
||||||
|
? Application.getMessage(FacesContext.getCurrentInstance(), result)
|
||||||
|
: this.currentWizardState.getCurrentPageCfg().getTitle());
|
||||||
}
|
}
|
||||||
else
|
return result;
|
||||||
{
|
|
||||||
title = this.currentWizardState.getCurrentPageCfg().getTitle();
|
|
||||||
}
|
|
||||||
|
|
||||||
return title;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -345,18 +341,15 @@ public final class WizardManager
|
|||||||
*/
|
*/
|
||||||
public String getStepDescription()
|
public String getStepDescription()
|
||||||
{
|
{
|
||||||
String desc = this.currentWizardState.getCurrentPageCfg().getDescriptionId();
|
String result = this.currentWizardState.getWizard().getStepDescription();
|
||||||
|
if (result == null)
|
||||||
if (desc != null)
|
|
||||||
{
|
{
|
||||||
desc = Application.getMessage(FacesContext.getCurrentInstance(), desc);
|
result = this.currentWizardState.getCurrentPageCfg().getDescriptionId();
|
||||||
|
result = (result != null
|
||||||
|
? Application.getMessage(FacesContext.getCurrentInstance(), result)
|
||||||
|
: this.currentWizardState.getCurrentPageCfg().getDescription());
|
||||||
}
|
}
|
||||||
else
|
return result;
|
||||||
{
|
|
||||||
desc = this.currentWizardState.getCurrentPageCfg().getDescription();
|
|
||||||
}
|
|
||||||
|
|
||||||
return desc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -397,14 +390,8 @@ public final class WizardManager
|
|||||||
*/
|
*/
|
||||||
public boolean getNextButtonDisabled()
|
public boolean getNextButtonDisabled()
|
||||||
{
|
{
|
||||||
if (this.currentWizardState.getCurrentStep() == this.currentWizardState.getSteps().size())
|
return (this.currentWizardState.getCurrentStep() == this.currentWizardState.getSteps().size() ||
|
||||||
{
|
this.currentWizardState.getWizard().getNextButtonDisabled());
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return this.currentWizardState.getWizard().getNextButtonDisabled();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -424,14 +411,7 @@ public final class WizardManager
|
|||||||
*/
|
*/
|
||||||
public boolean getBackButtonDisabled()
|
public boolean getBackButtonDisabled()
|
||||||
{
|
{
|
||||||
if (this.currentWizardState.getCurrentStep() == 1)
|
return this.currentWizardState.getCurrentStep() == 1;
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -461,14 +441,8 @@ public final class WizardManager
|
|||||||
*/
|
*/
|
||||||
public boolean getFinishButtonDisabled()
|
public boolean getFinishButtonDisabled()
|
||||||
{
|
{
|
||||||
if (this.currentWizardState.getCurrentStep() == this.currentWizardState.getSteps().size())
|
return (this.currentWizardState.getCurrentStep() != this.currentWizardState.getSteps().size() &&
|
||||||
{
|
this.currentWizardState.getWizard().getFinishButtonDisabled());
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return this.currentWizardState.getWizard().getFinishButtonDisabled();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -34,6 +34,8 @@ import org.alfresco.web.bean.repository.Node;
|
|||||||
import org.alfresco.web.bean.repository.NodePropertyResolver;
|
import org.alfresco.web.bean.repository.NodePropertyResolver;
|
||||||
import org.alfresco.web.bean.repository.Repository;
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
import org.alfresco.web.bean.repository.TransientNode;
|
import org.alfresco.web.bean.repository.TransientNode;
|
||||||
|
import org.alfresco.web.bean.wcm.AVMConstants;
|
||||||
|
import org.alfresco.web.bean.wcm.AVMNode;
|
||||||
import org.alfresco.web.config.DialogsConfigElement.DialogButtonConfig;
|
import org.alfresco.web.config.DialogsConfigElement.DialogButtonConfig;
|
||||||
import org.alfresco.web.ui.common.Utils;
|
import org.alfresco.web.ui.common.Utils;
|
||||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||||
@@ -41,6 +43,14 @@ import org.alfresco.web.ui.common.component.data.UIRichList;
|
|||||||
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.web.bean.wcm.AVMWorkflowUtil;
|
||||||
|
import org.alfresco.model.WCMModel;
|
||||||
|
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||||
|
import org.alfresco.service.cmr.repository.Path;
|
||||||
|
import org.alfresco.service.cmr.avm.AVMService;
|
||||||
|
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||||
|
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bean implementation for the "Manage Task" dialog.
|
* Bean implementation for the "Manage Task" dialog.
|
||||||
*
|
*
|
||||||
@@ -49,6 +59,8 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
public class ManageTaskDialog extends BaseDialogBean
|
public class ManageTaskDialog extends BaseDialogBean
|
||||||
{
|
{
|
||||||
protected WorkflowService workflowService;
|
protected WorkflowService workflowService;
|
||||||
|
protected AVMService avmService;
|
||||||
|
protected AVMSyncService avmSyncService;
|
||||||
protected Node taskNode;
|
protected Node taskNode;
|
||||||
protected WorkflowTask task;
|
protected WorkflowTask task;
|
||||||
protected WorkflowInstance workflowInstance;
|
protected WorkflowInstance workflowInstance;
|
||||||
@@ -62,7 +74,7 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
protected String[] itemsToAdd;
|
protected String[] itemsToAdd;
|
||||||
protected boolean isItemBeingAdded = false;
|
protected boolean isItemBeingAdded = false;
|
||||||
|
|
||||||
protected final Log logger = LogFactory.getLog(getClass());
|
private final static Log LOGGER = LogFactory.getLog(ManageTaskDialog.class);
|
||||||
|
|
||||||
protected static final String ID_PREFIX = "transition_";
|
protected static final String ID_PREFIX = "transition_";
|
||||||
protected static final String CLIENT_ID_PREFIX = AlfrescoNavigationHandler.DIALOG_PREFIX + ID_PREFIX;
|
protected static final String CLIENT_ID_PREFIX = AlfrescoNavigationHandler.DIALOG_PREFIX + ID_PREFIX;
|
||||||
@@ -109,11 +121,11 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
// setup the workflow package for the task
|
// setup the workflow package for the task
|
||||||
this.workflowPackage = (NodeRef)this.task.properties.get(WorkflowModel.ASSOC_PACKAGE);
|
this.workflowPackage = (NodeRef)this.task.properties.get(WorkflowModel.ASSOC_PACKAGE);
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
{
|
{
|
||||||
logger.debug("Task: " + this.task);
|
LOGGER.debug("Task: " + this.task);
|
||||||
logger.debug("Trasient node: " + this.taskNode);
|
LOGGER.debug("Trasient node: " + this.taskNode);
|
||||||
logger.debug("Workflow package: " + this.workflowPackage );
|
LOGGER.debug("Workflow package: " + this.workflowPackage );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,14 +145,14 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
protected String finishImpl(FacesContext context, String outcome)
|
protected String finishImpl(FacesContext context, String outcome)
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
if (logger.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
logger.debug("Saving task: " + this.task.id);
|
LOGGER.debug("Saving task: " + this.task.id);
|
||||||
|
|
||||||
// prepare the edited parameters for saving
|
// prepare the edited parameters for saving
|
||||||
Map<QName, Serializable> params = WorkflowUtil.prepareTaskParams(this.taskNode);
|
Map<QName, Serializable> params = WorkflowUtil.prepareTaskParams(this.taskNode);
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
logger.debug("Saving task with parameters: " + params);
|
LOGGER.debug("Saving task with parameters: " + params);
|
||||||
|
|
||||||
// remove any items the user selected to remove
|
// remove any items the user selected to remove
|
||||||
if (this.workflowPackage != null && this.packageItemsToRemove != null &&
|
if (this.workflowPackage != null && this.packageItemsToRemove != null &&
|
||||||
@@ -232,8 +244,8 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
String outcome = getDefaultFinishOutcome();
|
String outcome = getDefaultFinishOutcome();
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
logger.debug("Transitioning task: " + this.task.id);
|
LOGGER.debug("Transitioning task: " + this.task.id);
|
||||||
|
|
||||||
// to find out which transition button was pressed we need
|
// to find out which transition button was pressed we need
|
||||||
// to look for the button's id in the request parameters,
|
// to look for the button's id in the request parameters,
|
||||||
@@ -263,8 +275,8 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
// prepare the edited parameters for saving
|
// prepare the edited parameters for saving
|
||||||
Map<QName, Serializable> params = WorkflowUtil.prepareTaskParams(this.taskNode);
|
Map<QName, Serializable> params = WorkflowUtil.prepareTaskParams(this.taskNode);
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
logger.debug("Transitioning task with parameters: " + params);
|
LOGGER.debug("Transitioning task with parameters: " + params);
|
||||||
|
|
||||||
// update the task with the updated parameters
|
// update the task with the updated parameters
|
||||||
this.workflowService.updateTask(this.task.id, params, null, null);
|
this.workflowService.updateTask(this.task.id, params, null, null);
|
||||||
@@ -275,8 +287,8 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
// commit the changes
|
// commit the changes
|
||||||
tx.commit();
|
tx.commit();
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
logger.debug("Ended task with transition: " + selectedTransition);
|
LOGGER.debug("Ended task with transition: " + selectedTransition);
|
||||||
}
|
}
|
||||||
catch (Throwable e)
|
catch (Throwable e)
|
||||||
{
|
{
|
||||||
@@ -333,15 +345,15 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
this.packageItemsToRemove.remove(item);
|
this.packageItemsToRemove.remove(item);
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
logger.debug("Removed item from the removed list: " + item);
|
LOGGER.debug("Removed item from the removed list: " + item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.packageItemsToAdd.add(item);
|
this.packageItemsToAdd.add(item);
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
logger.debug("Added item to the added list: " + item);
|
LOGGER.debug("Added item to the added list: " + item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,8 +381,8 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
// remove the item from the added list if it was added in this dialog session
|
// remove the item from the added list if it was added in this dialog session
|
||||||
this.packageItemsToAdd.remove(nodeRef);
|
this.packageItemsToAdd.remove(nodeRef);
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
logger.debug("Removed item from the added list: " + nodeRef);
|
LOGGER.debug("Removed item from the added list: " + nodeRef);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -382,8 +394,8 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
|
|
||||||
this.packageItemsToRemove.add(nodeRef);
|
this.packageItemsToRemove.add(nodeRef);
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
logger.debug("Added item to the removed list: " + nodeRef);
|
LOGGER.debug("Added item to the removed list: " + nodeRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset the rich list so it re-renders
|
// reset the rich list so it re-renders
|
||||||
@@ -524,6 +536,33 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
tx = Repository.getUserTransaction(context, true);
|
tx = Repository.getUserTransaction(context, true);
|
||||||
tx.begin();
|
tx.begin();
|
||||||
|
|
||||||
|
if ((Boolean)this.nodeService.getProperty(this.workflowPackage,
|
||||||
|
WorkflowModel.PROP_IS_SYSTEM_PACKAGE))
|
||||||
|
{
|
||||||
|
final NodeRef stagingNodeRef = (NodeRef)
|
||||||
|
this.nodeService.getProperty(this.workflowPackage,
|
||||||
|
WCMModel.PROP_AVM_DIR_INDIRECTION);
|
||||||
|
final String fromAvmPath = (String)this.task.properties.get(AVMWorkflowUtil.PROP_FROM_PATH);
|
||||||
|
final String stagingAvmPath = AVMNodeConverter.ToAVMVersionPath(stagingNodeRef).getSecond();
|
||||||
|
final String packageAvmPath = AVMNodeConverter.ToAVMVersionPath(this.workflowPackage).getSecond();
|
||||||
|
LOGGER.debug("comparing " + packageAvmPath +
|
||||||
|
" with " + stagingAvmPath);
|
||||||
|
for (AVMDifference d : this.avmSyncService.compare(-1, packageAvmPath,
|
||||||
|
-1, stagingAvmPath,
|
||||||
|
null))
|
||||||
|
{
|
||||||
|
LOGGER.debug("got difference " + d);
|
||||||
|
if (d.getDifferenceCode() == AVMDifference.NEWER ||
|
||||||
|
d.getDifferenceCode() == AVMDifference.CONFLICT)
|
||||||
|
{
|
||||||
|
this.addAVMNode(new AVMNode(this.avmService.lookup(d.getSourceVersion(),
|
||||||
|
d.getSourcePath(),
|
||||||
|
true)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// get existing workflow package items
|
// get existing workflow package items
|
||||||
List<ChildAssociationRef> childRefs = this.nodeService.getChildAssocs(
|
List<ChildAssociationRef> childRefs = this.nodeService.getChildAssocs(
|
||||||
this.workflowPackage, ContentModel.ASSOC_CONTAINS,
|
this.workflowPackage, ContentModel.ASSOC_CONTAINS,
|
||||||
@@ -534,7 +573,12 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
// create our Node representation from the NodeRef
|
// create our Node representation from the NodeRef
|
||||||
NodeRef nodeRef = ref.getChildRef();
|
NodeRef nodeRef = ref.getChildRef();
|
||||||
|
|
||||||
if (this.nodeService.exists(nodeRef))
|
if (!this.nodeService.exists(nodeRef))
|
||||||
|
{
|
||||||
|
if (LOGGER.isDebugEnabled())
|
||||||
|
LOGGER.debug("Ignoring " + nodeRef + " as it has been removed from the repository");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// find it's type so we can see if it's a node we are interested in
|
// find it's type so we can see if it's a node we are interested in
|
||||||
QName type = this.nodeService.getType(nodeRef);
|
QName type = this.nodeService.getType(nodeRef);
|
||||||
@@ -542,7 +586,13 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
// make sure the type is defined in the data dictionary
|
// make sure the type is defined in the data dictionary
|
||||||
TypeDefinition typeDef = this.dictionaryService.getType(type);
|
TypeDefinition typeDef = this.dictionaryService.getType(type);
|
||||||
|
|
||||||
if (typeDef != null)
|
if (typeDef == null)
|
||||||
|
{
|
||||||
|
if (LOGGER.isWarnEnabled())
|
||||||
|
LOGGER.warn("Found invalid object in database: id = " + nodeRef +
|
||||||
|
", type = " + type);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// look for content nodes or links to content
|
// look for content nodes or links to content
|
||||||
// NOTE: folders within workflow packages are ignored for now
|
// NOTE: folders within workflow packages are ignored for now
|
||||||
@@ -558,19 +608,9 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (logger.isWarnEnabled())
|
|
||||||
logger.warn("Found invalid object in database: id = " + nodeRef + ", type = " + type);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (logger.isDebugEnabled())
|
|
||||||
logger.debug("Ignoring " + nodeRef + " as it has been removed from the repository");
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// now iterate through the items to add list and add them to the list of resources
|
// now iterate through the items to add list and add them to the list of resources
|
||||||
if (this.packageItemsToAdd != null)
|
if (this.packageItemsToAdd != null)
|
||||||
{
|
{
|
||||||
@@ -585,8 +625,8 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (logger.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
logger.debug("Ignoring " + nodeRef + " as it has been removed from the repository");
|
LOGGER.debug("Ignoring " + nodeRef + " as it has been removed from the repository");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -602,9 +642,9 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
|
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (logger.isDebugEnabled())
|
else if (LOGGER.isDebugEnabled())
|
||||||
{
|
{
|
||||||
logger.debug("Failed to find workflow package for task: " + this.task.id);
|
LOGGER.debug("Failed to find workflow package for task: " + this.task.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.resources;
|
return this.resources;
|
||||||
@@ -621,9 +661,66 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
this.workflowService = workflowService;
|
this.workflowService = workflowService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the avm service to use
|
||||||
|
*
|
||||||
|
* @param avmService
|
||||||
|
* AvmService instance
|
||||||
|
*/
|
||||||
|
public void setAvmService(final AVMService avmService)
|
||||||
|
{
|
||||||
|
this.avmService = avmService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the avm sync service to use
|
||||||
|
*
|
||||||
|
* @param avmSyncService
|
||||||
|
* AvmSycService instance
|
||||||
|
*/
|
||||||
|
public void setAvmSyncService(final AVMSyncService avmSyncService)
|
||||||
|
{
|
||||||
|
this.avmSyncService = avmSyncService;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Helper methods
|
// Helper methods
|
||||||
|
|
||||||
|
protected void addAVMNode(AVMNode node)
|
||||||
|
{
|
||||||
|
LOGGER.debug("adding node " + node);
|
||||||
|
node.getProperties().put("taskId", this.task.id);
|
||||||
|
this.browseBean.setupCommonBindingProperties(node);
|
||||||
|
final String packagePath = AVMNodeConverter.ToAVMVersionPath(this.workflowPackage).getSecond();
|
||||||
|
NodePropertyResolver resolverPath = new NodePropertyResolver()
|
||||||
|
{
|
||||||
|
public Object get(Node node)
|
||||||
|
{
|
||||||
|
Path result = new Path();
|
||||||
|
String s = node.getPath();
|
||||||
|
s = s.substring(packagePath.length());
|
||||||
|
for (final String s2 : s.split("/"))
|
||||||
|
{
|
||||||
|
if (s2.length() != 0)
|
||||||
|
{
|
||||||
|
result.append(new Path.Element()
|
||||||
|
{
|
||||||
|
public String getElementString() { return s2; }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
node.remove("path");
|
||||||
|
node.addPropertyResolver("path", resolverPath);
|
||||||
|
node.addPropertyResolver("displayPath", resolverPath);
|
||||||
|
|
||||||
|
LOGGER.debug("created mapnode " + node);
|
||||||
|
|
||||||
|
this.resources.add(node);
|
||||||
|
}
|
||||||
|
|
||||||
protected void createAndAddNode(NodeRef nodeRef)
|
protected void createAndAddNode(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
// create our Node representation
|
// create our Node representation
|
||||||
|
@@ -64,14 +64,16 @@ public interface Form
|
|||||||
* configured output path pattern.
|
* configured output path pattern.
|
||||||
*
|
*
|
||||||
* @param parentAVMPath the parent avm path
|
* @param parentAVMPath the parent avm path
|
||||||
|
* @param webappname the current webapp name
|
||||||
* @param formInstanceDataFileName the file name provided by the user.
|
* @param formInstanceDataFileName the file name provided by the user.
|
||||||
* @param formInstanceData the parsed xml content
|
* @param formInstanceData the parsed xml content
|
||||||
*
|
*
|
||||||
* @return the path to use for writing the form instance data.
|
* @return the path to use for writing the form instance data.
|
||||||
*/
|
*/
|
||||||
public String getOutputPathForFormInstanceData(final String parentAVMPath,
|
public String getOutputPathForFormInstanceData(final Document formInstanceData,
|
||||||
final String formInstanceDataFileName,
|
final String formInstanceDataFileName,
|
||||||
final Document formInstanceData);
|
final String parentAVMPath,
|
||||||
|
final String webappName);
|
||||||
|
|
||||||
//XXXarielb not used currently and not sure if it's necessary...
|
//XXXarielb not used currently and not sure if it's necessary...
|
||||||
// public void addInputMethod(final TemplateInputMethod in);
|
// public void addInputMethod(final TemplateInputMethod in);
|
||||||
|
@@ -108,13 +108,15 @@ class FormImpl
|
|||||||
: null);
|
: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOutputPathForFormInstanceData(final String parentAVMPath,
|
public String getOutputPathForFormInstanceData(final Document formInstanceData,
|
||||||
final String formInstanceDataName,
|
final String formInstanceDataName,
|
||||||
final Document formInstanceData)
|
final String parentAVMPath,
|
||||||
|
final String webappName)
|
||||||
{
|
{
|
||||||
final String outputPathPattern = this.getOutputPathPattern();
|
final String outputPathPattern = this.getOutputPathPattern();
|
||||||
|
|
||||||
final Map<String, Object> root = new HashMap<String, Object>();
|
final Map<String, Object> root = new HashMap<String, Object>();
|
||||||
|
root.put("webapp", webappName);
|
||||||
root.put("xml", NodeModel.wrap(formInstanceData));
|
root.put("xml", NodeModel.wrap(formInstanceData));
|
||||||
root.put("name", formInstanceDataName);
|
root.put("name", formInstanceDataName);
|
||||||
root.put("date", new SimpleDate(new Date(), SimpleDate.DATETIME));
|
root.put("date", new SimpleDate(new Date(), SimpleDate.DATETIME));
|
||||||
@@ -124,7 +126,9 @@ class FormImpl
|
|||||||
String result = templateService.processTemplateString(null,
|
String result = templateService.processTemplateString(null,
|
||||||
outputPathPattern,
|
outputPathPattern,
|
||||||
new SimpleHash(root));
|
new SimpleHash(root));
|
||||||
result = AVMConstants.buildAbsoluteAVMPath(parentAVMPath, result);
|
result = AVMConstants.buildAVMPath(parentAVMPath,
|
||||||
|
result,
|
||||||
|
AVMConstants.PathRelation.SANDBOX_RELATIVE);
|
||||||
LOGGER.debug("processed pattern " + outputPathPattern + " as " + result);
|
LOGGER.debug("processed pattern " + outputPathPattern + " as " + result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -38,6 +38,12 @@ public interface FormInstanceData
|
|||||||
/** the path relative to the containing webapp */
|
/** the path relative to the containing webapp */
|
||||||
public String getWebappRelativePath();
|
public String getWebappRelativePath();
|
||||||
|
|
||||||
|
/** the path relative to the sandbox */
|
||||||
|
public String getSandboxRelativePath();
|
||||||
|
|
||||||
|
/** the path to the contents of this form instance data */
|
||||||
|
public String getPath();
|
||||||
|
|
||||||
/** the url to the asset */
|
/** the url to the asset */
|
||||||
public String getUrl();
|
public String getUrl();
|
||||||
|
|
||||||
|
@@ -18,8 +18,6 @@ package org.alfresco.web.forms;
|
|||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.model.WCMAppModel;
|
import org.alfresco.model.WCMAppModel;
|
||||||
@@ -66,15 +64,19 @@ public class FormInstanceDataImpl
|
|||||||
nodeService.getProperty(this.nodeRef, ContentModel.PROP_NAME);
|
nodeService.getProperty(this.nodeRef, ContentModel.PROP_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** the path relative to the containing webapp */
|
|
||||||
public String getWebappRelativePath()
|
public String getWebappRelativePath()
|
||||||
{
|
{
|
||||||
final String path = AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getSecond();
|
return AVMConstants.getWebappRelativePath(this.getPath());
|
||||||
final String p = ("[^:]+:/" + AVMConstants.DIR_APPBASE +
|
}
|
||||||
"/" + AVMConstants.DIR_WEBAPPS +
|
|
||||||
"/[^/]+(.*)/" + this.getName());
|
public String getSandboxRelativePath()
|
||||||
final Matcher m = Pattern.compile(p).matcher(path);
|
{
|
||||||
return m.matches() && m.group(1).length() != 0 ? m.group(1) : "/";
|
return AVMConstants.getSandboxRelativePath(this.getPath());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPath()
|
||||||
|
{
|
||||||
|
return AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getSecond();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Form getForm()
|
public Form getForm()
|
||||||
@@ -94,7 +96,7 @@ public class FormInstanceDataImpl
|
|||||||
|
|
||||||
public String getUrl()
|
public String getUrl()
|
||||||
{
|
{
|
||||||
return AVMConstants.buildAVMAssetUrl(AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getSecond());
|
return AVMConstants.buildAVMAssetUrl(this.getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Rendition> getRenditions()
|
public List<Rendition> getRenditions()
|
||||||
@@ -103,8 +105,7 @@ public class FormInstanceDataImpl
|
|||||||
final List<Rendition> result = new LinkedList<Rendition>();
|
final List<Rendition> result = new LinkedList<Rendition>();
|
||||||
for (RenderingEngineTemplate ret : this.getForm().getRenderingEngineTemplates())
|
for (RenderingEngineTemplate ret : this.getForm().getRenderingEngineTemplates())
|
||||||
{
|
{
|
||||||
final String renditionAvmPath =
|
final String renditionAvmPath = ret.getOutputPathForRendition(this);
|
||||||
FormsService.getOutputAvmPathForRendition(ret, this.getNodeRef());
|
|
||||||
if (avmService.lookup(-1, renditionAvmPath) == null)
|
if (avmService.lookup(-1, renditionAvmPath) == null)
|
||||||
{
|
{
|
||||||
LOGGER.warn("unable to locate rendition " + renditionAvmPath +
|
LOGGER.warn("unable to locate rendition " + renditionAvmPath +
|
||||||
|
@@ -26,11 +26,13 @@ import java.io.OutputStream;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
@@ -266,28 +268,24 @@ public final class FormsService
|
|||||||
*
|
*
|
||||||
* @param formInstanceDataNodeRef the noderef containing the form instance data
|
* @param formInstanceDataNodeRef the noderef containing the form instance data
|
||||||
*/
|
*/
|
||||||
public List<Rendition> generateRenditions(final NodeRef formInstanceDataNodeRef)
|
public List<Rendition> generateRenditions(final FormInstanceData formInstanceData)
|
||||||
throws IOException,
|
throws IOException,
|
||||||
SAXException,
|
SAXException,
|
||||||
RenderingEngine.RenderingException
|
RenderingEngine.RenderingException
|
||||||
{
|
{
|
||||||
final Form form =
|
final Form form = formInstanceData.getForm();
|
||||||
this.getForm((NodeRef)this.nodeService.getProperty(formInstanceDataNodeRef,
|
|
||||||
WCMAppModel.PROP_PARENT_FORM));
|
|
||||||
final Document formInstanceData = this.parseXML(formInstanceDataNodeRef);
|
|
||||||
|
|
||||||
final String formInstanceDataFileName = (String)
|
final Document formInstanceDataDocument = this.parseXML(formInstanceData.getNodeRef());
|
||||||
this.nodeService.getProperty(formInstanceDataNodeRef, ContentModel.PROP_NAME);
|
|
||||||
final String formInstanceDataAvmPath =
|
final String formInstanceDataFileName = formInstanceData.getName();
|
||||||
AVMNodeConverter.ToAVMVersionPath(formInstanceDataNodeRef).getSecond();
|
final String formInstanceDataAvmPath = formInstanceData.getPath();
|
||||||
LOGGER.debug("generating renditions for " + formInstanceDataAvmPath);
|
LOGGER.debug("generating renditions for " + formInstanceDataAvmPath);
|
||||||
|
|
||||||
final List<Rendition> result = new LinkedList<Rendition>();
|
final List<Rendition> result = new LinkedList<Rendition>();
|
||||||
for (RenderingEngineTemplate ret : form.getRenderingEngineTemplates())
|
for (RenderingEngineTemplate ret : form.getRenderingEngineTemplates())
|
||||||
{
|
{
|
||||||
// get the node ref of the node that will contain the content
|
// get the node ref of the node that will contain the content
|
||||||
final String renditionAvmPath =
|
final String renditionAvmPath = ret.getOutputPathForRendition(formInstanceData);
|
||||||
this.getOutputAvmPathForRendition(ret, formInstanceDataNodeRef);
|
|
||||||
final String parentAVMPath = AVMNodeConverter.SplitBase(renditionAvmPath)[0];
|
final String parentAVMPath = AVMNodeConverter.SplitBase(renditionAvmPath)[0];
|
||||||
this.makeAllDirectories(parentAVMPath);
|
this.makeAllDirectories(parentAVMPath);
|
||||||
final OutputStream out = this.avmService.createFile(parentAVMPath,
|
final OutputStream out = this.avmService.createFile(parentAVMPath,
|
||||||
@@ -299,18 +297,24 @@ public final class FormsService
|
|||||||
final HashMap<String, String> parameters =
|
final HashMap<String, String> parameters =
|
||||||
this.getRenderingEngineParameters(formInstanceDataAvmPath,
|
this.getRenderingEngineParameters(formInstanceDataAvmPath,
|
||||||
renditionAvmPath);
|
renditionAvmPath);
|
||||||
ret.getRenderingEngine().render(formInstanceData, ret, parameters, out);
|
ret.getRenderingEngine().render(formInstanceDataDocument, ret, parameters, out);
|
||||||
out.close();
|
out.close();
|
||||||
|
|
||||||
final NodeRef renditionNodeRef =
|
final NodeRef renditionNodeRef = AVMNodeConverter.ToNodeRef(-1, renditionAvmPath);
|
||||||
AVMNodeConverter.ToNodeRef(-1, renditionAvmPath);
|
final Rendition rendition = new RenditionImpl(renditionNodeRef);
|
||||||
form.registerFormInstanceData(renditionNodeRef);
|
form.registerFormInstanceData(renditionNodeRef);
|
||||||
ret.registerRendition(renditionNodeRef, formInstanceDataNodeRef);
|
ret.registerRendition(rendition, formInstanceData);
|
||||||
|
|
||||||
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1, 1.0f);
|
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1, 1.0f);
|
||||||
props.put(ContentModel.PROP_TITLE, AVMNodeConverter.SplitBase(renditionAvmPath)[1]);
|
props.put(ContentModel.PROP_TITLE, AVMNodeConverter.SplitBase(renditionAvmPath)[1]);
|
||||||
|
|
||||||
|
final ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
|
||||||
|
props.put(ContentModel.PROP_DESCRIPTION,
|
||||||
|
MessageFormat.format(bundle.getString("default_rendition_description"),
|
||||||
|
ret.getTitle(),
|
||||||
|
AVMConstants.getSandboxRelativePath(renditionAvmPath)));
|
||||||
nodeService.addAspect(renditionNodeRef, ContentModel.ASPECT_TITLED, props);
|
nodeService.addAspect(renditionNodeRef, ContentModel.ASPECT_TITLED, props);
|
||||||
result.add(new RenditionImpl(renditionNodeRef));
|
result.add(rendition);
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug("generated " + renditionAvmPath + " using " + ret);
|
LOGGER.debug("generated " + renditionAvmPath + " using " + ret);
|
||||||
}
|
}
|
||||||
@@ -322,33 +326,27 @@ public final class FormsService
|
|||||||
*
|
*
|
||||||
* @param formInstanceDataNodeRef the node ref containing the form instance data.
|
* @param formInstanceDataNodeRef the node ref containing the form instance data.
|
||||||
*/
|
*/
|
||||||
public List<Rendition> regenerateRenditions(final NodeRef formInstanceDataNodeRef)
|
public List<Rendition> regenerateRenditions(final FormInstanceData formInstanceData)
|
||||||
throws IOException,
|
throws IOException,
|
||||||
SAXException,
|
SAXException,
|
||||||
RenderingEngine.RenderingException
|
RenderingEngine.RenderingException
|
||||||
{
|
{
|
||||||
final NodeRef formNodeRef = (NodeRef)
|
final Form form = formInstanceData.getForm();
|
||||||
nodeService.getProperty(formInstanceDataNodeRef, WCMAppModel.PROP_PARENT_FORM);
|
|
||||||
|
|
||||||
final Form form = this.getForm(formNodeRef);
|
final Document formInstanceDataDocument = this.parseXML(formInstanceData.getNodeRef());
|
||||||
|
final String formInstanceDataFileName = formInstanceData.getName();
|
||||||
final ContentReader reader = contentService.getReader(formInstanceDataNodeRef, ContentModel.PROP_CONTENT);
|
|
||||||
final Document formInstanceData = this.parseXML(reader.getContentInputStream());
|
|
||||||
final String formInstanceDataFileName = (String)
|
|
||||||
nodeService.getProperty(formInstanceDataNodeRef, ContentModel.PROP_NAME);
|
|
||||||
|
|
||||||
// other parameter values passed to rendering engine
|
// other parameter values passed to rendering engine
|
||||||
final String formInstanceDataAvmPath = AVMNodeConverter.ToAVMVersionPath(formInstanceDataNodeRef).getSecond();
|
final String formInstanceDataAvmPath = formInstanceData.getPath();
|
||||||
LOGGER.debug("regenerating renditions for " + formInstanceDataAvmPath);
|
LOGGER.debug("regenerating renditions for " + formInstanceDataAvmPath);
|
||||||
final List<Rendition> result = new LinkedList<Rendition>();
|
final List<Rendition> result = new LinkedList<Rendition>();
|
||||||
for (RenderingEngineTemplate ret : form.getRenderingEngineTemplates())
|
for (RenderingEngineTemplate ret : form.getRenderingEngineTemplates())
|
||||||
{
|
{
|
||||||
final String renditionAvmPath =
|
final String renditionAvmPath = ret.getOutputPathForRendition(formInstanceData);
|
||||||
this.getOutputAvmPathForRendition(ret, formInstanceDataNodeRef);
|
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug("regenerating file node for : " + formInstanceDataFileName +
|
LOGGER.debug("regenerating file node for : " + formInstanceDataFileName +
|
||||||
" (" + formInstanceDataNodeRef.toString() +
|
" (" + formInstanceData.toString() +
|
||||||
") to " + renditionAvmPath);
|
") to " + renditionAvmPath);
|
||||||
|
|
||||||
// get a writer for the content and put the file
|
// get a writer for the content and put the file
|
||||||
@@ -365,11 +363,10 @@ public final class FormsService
|
|||||||
|
|
||||||
final HashMap<String, String> parameters =
|
final HashMap<String, String> parameters =
|
||||||
this.getRenderingEngineParameters(formInstanceDataAvmPath, renditionAvmPath);
|
this.getRenderingEngineParameters(formInstanceDataAvmPath, renditionAvmPath);
|
||||||
ret.getRenderingEngine().render(formInstanceData, ret, parameters, out);
|
ret.getRenderingEngine().render(formInstanceDataDocument, ret, parameters, out);
|
||||||
out.close();
|
out.close();
|
||||||
|
|
||||||
final NodeRef renditionNodeRef =
|
final NodeRef renditionNodeRef = AVMNodeConverter.ToNodeRef(-1, renditionAvmPath);
|
||||||
AVMNodeConverter.ToNodeRef(-1, renditionAvmPath);
|
|
||||||
result.add(new RenditionImpl(renditionNodeRef));
|
result.add(new RenditionImpl(renditionNodeRef));
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug("regenerated " + renditionAvmPath + " using " + ret);
|
LOGGER.debug("regenerated " + renditionAvmPath + " using " + ret);
|
||||||
@@ -377,21 +374,6 @@ public final class FormsService
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getOutputAvmPathForRendition(final RenderingEngineTemplate ret,
|
|
||||||
final NodeRef formInstanceDataNodeRef)
|
|
||||||
{
|
|
||||||
// final String formInstanceDataAvmPath =
|
|
||||||
// AVMNodeConverter.ToAVMVersionPath(formInstanceDataNodeRef).getSecond();
|
|
||||||
// String formInstanceDataFileName = AVMNodeConverter.SplitBase(formInstanceDataAvmPath)[1];
|
|
||||||
// formInstanceDataFileName = FormsService.stripExtension(formInstanceDataFileName);
|
|
||||||
String result = ret.getOutputPathForRendition(formInstanceDataNodeRef);
|
|
||||||
// if (result != null && result.charAt(0) == '/')
|
|
||||||
// {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static HashMap<String, String> getRenderingEngineParameters(final String formInstanceDataAvmPath,
|
private static HashMap<String, String> getRenderingEngineParameters(final String formInstanceDataAvmPath,
|
||||||
final String renditionAvmPath)
|
final String renditionAvmPath)
|
||||||
{
|
{
|
||||||
|
@@ -98,8 +98,10 @@ public class FreeMarkerRenderingEngine
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
final FormDataFunctions ef = FreeMarkerRenderingEngine.getFormDataFunctions();
|
final FormDataFunctions ef = FreeMarkerRenderingEngine.getFormDataFunctions();
|
||||||
final String path = AVMConstants.buildAbsoluteAVMPath(parameters.get("parent_path"),
|
final String path =
|
||||||
(String)args.get(0));
|
AVMConstants.buildAVMPath(parameters.get("parent_path"),
|
||||||
|
(String)args.get(0),
|
||||||
|
AVMConstants.PathRelation.WEBAPP_RELATIVE);
|
||||||
final Document d = ef.parseXMLDocument(path);
|
final Document d = ef.parseXMLDocument(path);
|
||||||
return d != null ? d.getDocumentElement() : null;
|
return d != null ? d.getDocumentElement() : null;
|
||||||
}
|
}
|
||||||
@@ -119,8 +121,9 @@ public class FreeMarkerRenderingEngine
|
|||||||
{
|
{
|
||||||
final FormDataFunctions ef = FreeMarkerRenderingEngine.getFormDataFunctions();
|
final FormDataFunctions ef = FreeMarkerRenderingEngine.getFormDataFunctions();
|
||||||
final String path =
|
final String path =
|
||||||
AVMConstants.buildAbsoluteAVMPath(parameters.get("parent_path"),
|
AVMConstants.buildAVMPath(parameters.get("parent_path"),
|
||||||
args.size() == 1 ? "" : (String)args.get(1));
|
args.size() == 1 ? "" : (String)args.get(1),
|
||||||
|
AVMConstants.PathRelation.WEBAPP_RELATIVE);
|
||||||
final Map<String, Document> resultMap = ef.parseXMLDocuments((String)args.get(0), path);
|
final Map<String, Document> resultMap = ef.parseXMLDocuments((String)args.get(0), path);
|
||||||
LOGGER.debug("received " + resultMap.size() + " documents in " + path);
|
LOGGER.debug("received " + resultMap.size() + " documents in " + path);
|
||||||
|
|
||||||
@@ -165,8 +168,9 @@ public class FreeMarkerRenderingEngine
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return AVMConstants.buildAbsoluteAVMPath(parameters.get("parent_path"),
|
return AVMConstants.buildAVMPath(parameters.get("parent_path"),
|
||||||
(String)args.get(0));
|
(String)args.get(0),
|
||||||
|
AVMConstants.PathRelation.WEBAPP_RELATIVE);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@@ -71,7 +71,7 @@ public interface RenderingEngineTemplate
|
|||||||
*
|
*
|
||||||
* @return the output path for the rendition.
|
* @return the output path for the rendition.
|
||||||
*/
|
*/
|
||||||
public String getOutputPathForRendition(final NodeRef formInstanceDataNodeRef);
|
public String getOutputPathForRendition(final FormInstanceData formInstanceData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the mimetype to use when generating content for this
|
* Returns the mimetype to use when generating content for this
|
||||||
@@ -82,5 +82,6 @@ public interface RenderingEngineTemplate
|
|||||||
*/
|
*/
|
||||||
public String getMimetypeForRendition();
|
public String getMimetypeForRendition();
|
||||||
|
|
||||||
public void registerRendition(final NodeRef rendition, final NodeRef primaryFormInstanceData);
|
public void registerRendition(final Rendition rendition,
|
||||||
|
final FormInstanceData primaryFormInstanceData);
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,7 @@ import org.alfresco.model.ContentModel;
|
|||||||
import org.alfresco.model.WCMAppModel;
|
import org.alfresco.model.WCMAppModel;
|
||||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||||
import org.alfresco.service.ServiceRegistry;
|
import org.alfresco.service.ServiceRegistry;
|
||||||
|
import org.alfresco.service.cmr.avm.AVMService;
|
||||||
import org.alfresco.service.cmr.repository.ContentReader;
|
import org.alfresco.service.cmr.repository.ContentReader;
|
||||||
import org.alfresco.service.cmr.repository.ContentService;
|
import org.alfresco.service.cmr.repository.ContentService;
|
||||||
import org.alfresco.service.cmr.repository.MimetypeService;
|
import org.alfresco.service.cmr.repository.MimetypeService;
|
||||||
@@ -132,36 +133,43 @@ public class RenderingEngineTemplateImpl
|
|||||||
*
|
*
|
||||||
* @return the output path to use for renditions.
|
* @return the output path to use for renditions.
|
||||||
*/
|
*/
|
||||||
public String getOutputPathForRendition(final NodeRef formInstanceDataNodeRef)
|
public String getOutputPathForRendition(final FormInstanceData formInstanceData)
|
||||||
{
|
{
|
||||||
final ServiceRegistry sr = this.getServiceRegistry();
|
final ServiceRegistry sr = this.getServiceRegistry();
|
||||||
final NodeService nodeService = this.getServiceRegistry().getNodeService();
|
final NodeService nodeService = sr.getNodeService();
|
||||||
|
final AVMService avmService = sr.getAVMService();
|
||||||
|
|
||||||
final String outputPathPattern = (String)
|
final String outputPathPattern = (String)
|
||||||
nodeService.getProperty(this.renditionPropertiesNodeRef,
|
nodeService.getProperty(this.renditionPropertiesNodeRef,
|
||||||
WCMAppModel.PROP_OUTPUT_PATH_PATTERN_RENDITION);
|
WCMAppModel.PROP_OUTPUT_PATH_PATTERN_RENDITION);
|
||||||
final String formInstanceDataAVMPath =
|
final String formInstanceDataAVMPath = formInstanceData.getPath();
|
||||||
AVMNodeConverter.ToAVMVersionPath(formInstanceDataNodeRef).getSecond();
|
|
||||||
|
|
||||||
final Map<String, Object> root = new HashMap<String, Object>();
|
final Map<String, Object> root = new HashMap<String, Object>();
|
||||||
|
|
||||||
final String formInstanceDataName = (String)
|
final String webappName =
|
||||||
sr.getNodeService().getProperty(formInstanceDataNodeRef, ContentModel.PROP_NAME);
|
(avmService.hasAspect(-1,
|
||||||
root.put("name",
|
AVMConstants.getWebappPath(formInstanceDataAVMPath),
|
||||||
formInstanceDataName.replaceAll("(.+)\\..*", "$1"));
|
WCMAppModel.ASPECT_WEBAPP)
|
||||||
|
? AVMConstants.getWebapp(formInstanceDataAVMPath)
|
||||||
|
: null);
|
||||||
|
root.put("webapp", webappName);
|
||||||
|
|
||||||
|
final String formInstanceDataName = formInstanceData.getName();
|
||||||
|
root.put("name", formInstanceDataName.replaceAll("(.+)\\..*", "$1"));
|
||||||
root.put("extension",
|
root.put("extension",
|
||||||
sr.getMimetypeService().getExtension(this.getMimetypeForRendition()));
|
sr.getMimetypeService().getExtension(this.getMimetypeForRendition()));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final FormsService fs = FormsService.getInstance();
|
final FormsService fs = FormsService.getInstance();
|
||||||
root.put("xml", NodeModel.wrap(fs.parseXML(formInstanceDataNodeRef)));
|
root.put("xml", NodeModel.wrap(fs.parseXML(formInstanceData.getNodeRef())));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LOGGER.error(e);
|
LOGGER.error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
root.put("node", new TemplateNode(formInstanceDataNodeRef, sr, null));
|
root.put("node", new TemplateNode(formInstanceData.getNodeRef(), sr, null));
|
||||||
root.put("date", new SimpleDate(new Date(), SimpleDate.DATETIME));
|
root.put("date", new SimpleDate(new Date(), SimpleDate.DATETIME));
|
||||||
|
|
||||||
final TemplateService templateService = sr.getTemplateService();
|
final TemplateService templateService = sr.getTemplateService();
|
||||||
@@ -169,7 +177,9 @@ public class RenderingEngineTemplateImpl
|
|||||||
outputPathPattern,
|
outputPathPattern,
|
||||||
new SimpleHash(root));
|
new SimpleHash(root));
|
||||||
final String parentAVMPath = AVMNodeConverter.SplitBase(formInstanceDataAVMPath)[0];
|
final String parentAVMPath = AVMNodeConverter.SplitBase(formInstanceDataAVMPath)[0];
|
||||||
result = AVMConstants.buildAbsoluteAVMPath(parentAVMPath, result);
|
result = AVMConstants.buildAVMPath(parentAVMPath,
|
||||||
|
result,
|
||||||
|
AVMConstants.PathRelation.SANDBOX_RELATIVE);
|
||||||
LOGGER.debug("processed pattern " + outputPathPattern + " as " + result);
|
LOGGER.debug("processed pattern " + outputPathPattern + " as " + result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -186,19 +196,19 @@ public class RenderingEngineTemplateImpl
|
|||||||
WCMAppModel.PROP_MIMETYPE_FOR_RENDITION);
|
WCMAppModel.PROP_MIMETYPE_FOR_RENDITION);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerRendition(final NodeRef renditionNodeRef,
|
public void registerRendition(final Rendition rendition,
|
||||||
final NodeRef primaryFormInstanceDataNodeRef)
|
final FormInstanceData primaryFormInstanceData)
|
||||||
{
|
{
|
||||||
final NodeService nodeService = this.getServiceRegistry().getNodeService();
|
final NodeService nodeService = this.getServiceRegistry().getNodeService();
|
||||||
final Map<QName, Serializable> props = new HashMap<QName, Serializable>(2, 1.0f);
|
final Map<QName, Serializable> props = new HashMap<QName, Serializable>(2, 1.0f);
|
||||||
props.put(WCMAppModel.PROP_PARENT_RENDERING_ENGINE_TEMPLATE, this.nodeRef);
|
props.put(WCMAppModel.PROP_PARENT_RENDERING_ENGINE_TEMPLATE, this.nodeRef);
|
||||||
|
|
||||||
// extract a store relative path for the primary form instance data
|
// extract a store relative path for the primary form instance data
|
||||||
String path = AVMNodeConverter.ToAVMVersionPath(primaryFormInstanceDataNodeRef).getSecond();
|
String path = primaryFormInstanceData.getPath();
|
||||||
path = path.substring(path.indexOf(':') + 1);
|
path = path.substring(path.indexOf(':') + 1);
|
||||||
props.put(WCMAppModel.PROP_PRIMARY_FORM_INSTANCE_DATA, path);
|
props.put(WCMAppModel.PROP_PRIMARY_FORM_INSTANCE_DATA, path);
|
||||||
|
|
||||||
nodeService.addAspect(renditionNodeRef, WCMAppModel.ASPECT_RENDITION, props);
|
nodeService.addAspect(rendition.getNodeRef(), WCMAppModel.ASPECT_RENDITION, props);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ServiceRegistry getServiceRegistry()
|
private ServiceRegistry getServiceRegistry()
|
||||||
|
@@ -27,12 +27,18 @@ import java.io.Serializable;
|
|||||||
public interface Rendition
|
public interface Rendition
|
||||||
extends Serializable
|
extends Serializable
|
||||||
{
|
{
|
||||||
/** the name of this instance data */
|
/** the name of this rendition */
|
||||||
public String getName();
|
public String getName();
|
||||||
|
|
||||||
|
/** the description of this rendition */
|
||||||
|
public String getDescription();
|
||||||
|
|
||||||
/** the path relative to the containing webapp */
|
/** the path relative to the containing webapp */
|
||||||
public String getWebappRelativePath();
|
public String getWebappRelativePath();
|
||||||
|
|
||||||
|
/** the path relative to the sandbox */
|
||||||
|
public String getSandboxRelativePath();
|
||||||
|
|
||||||
/** the primary form instance data used to generate this rendition */
|
/** the primary form instance data used to generate this rendition */
|
||||||
public FormInstanceData getPrimaryFormInstanceData();
|
public FormInstanceData getPrimaryFormInstanceData();
|
||||||
|
|
||||||
|
@@ -16,8 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.web.forms;
|
package org.alfresco.web.forms;
|
||||||
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.model.WCMAppModel;
|
import org.alfresco.model.WCMAppModel;
|
||||||
@@ -64,15 +62,22 @@ public class RenditionImpl
|
|||||||
nodeService.getProperty(this.nodeRef, ContentModel.PROP_NAME);
|
nodeService.getProperty(this.nodeRef, ContentModel.PROP_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** the path relative to the containing webapp */
|
/** the description of this rendition */
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
final NodeService nodeService = this.getServiceRegistry().getNodeService();
|
||||||
|
return (String)
|
||||||
|
nodeService.getProperty(this.nodeRef, ContentModel.PROP_DESCRIPTION);
|
||||||
|
}
|
||||||
|
|
||||||
public String getWebappRelativePath()
|
public String getWebappRelativePath()
|
||||||
{
|
{
|
||||||
final String path = AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getSecond();
|
return AVMConstants.getWebappRelativePath(this.getPath());
|
||||||
final String p = ("[^:]+:/" + AVMConstants.DIR_APPBASE +
|
}
|
||||||
"/" + AVMConstants.DIR_WEBAPPS +
|
|
||||||
"/[^/]+(.*)/" + this.getName());
|
public String getSandboxRelativePath()
|
||||||
final Matcher m = Pattern.compile(p).matcher(path);
|
{
|
||||||
return m.matches() && m.group(1).length() != 0 ? m.group(1) : "/";
|
return AVMConstants.getSandboxRelativePath(this.getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
public FormInstanceData getPrimaryFormInstanceData()
|
public FormInstanceData getPrimaryFormInstanceData()
|
||||||
@@ -115,7 +120,7 @@ public class RenditionImpl
|
|||||||
|
|
||||||
public String getUrl()
|
public String getUrl()
|
||||||
{
|
{
|
||||||
return AVMConstants.buildAVMAssetUrl(AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getSecond());
|
return AVMConstants.buildAVMAssetUrl(this.getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFileTypeImage()
|
public String getFileTypeImage()
|
||||||
|
@@ -79,7 +79,9 @@ public class XSLTRenderingEngine
|
|||||||
throws TransformerException
|
throws TransformerException
|
||||||
{
|
{
|
||||||
final XObject o = ec.getVariableOrParam(new QName(ALFRESCO_NS, ALFRESCO_NS_PREFIX, "parent_path"));
|
final XObject o = ec.getVariableOrParam(new QName(ALFRESCO_NS, ALFRESCO_NS_PREFIX, "parent_path"));
|
||||||
return o == null ? null : AVMConstants.buildAbsoluteAVMPath(o.toString(), path);
|
return o == null ? null : AVMConstants.buildAVMPath(o.toString(),
|
||||||
|
path,
|
||||||
|
AVMConstants.PathRelation.WEBAPP_RELATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -434,8 +434,9 @@ public class XFormsBean
|
|||||||
final String previewStorePath =
|
final String previewStorePath =
|
||||||
this.avmBrowseBean.getCurrentPath().replaceFirst(AVMConstants.STORE_MAIN,
|
this.avmBrowseBean.getCurrentPath().replaceFirst(AVMConstants.STORE_MAIN,
|
||||||
AVMConstants.STORE_PREVIEW);
|
AVMConstants.STORE_PREVIEW);
|
||||||
currentPath = AVMConstants.buildAbsoluteAVMPath(previewStorePath,
|
currentPath = AVMConstants.buildAVMPath(previewStorePath,
|
||||||
currentPath);
|
currentPath,
|
||||||
|
AVMConstants.PathRelation.WEBAPP_RELATIVE);
|
||||||
}
|
}
|
||||||
LOGGER.debug(this + ".getFilePickerData(" + currentPath + ")");
|
LOGGER.debug(this + ".getFilePickerData(" + currentPath + ")");
|
||||||
|
|
||||||
@@ -519,8 +520,9 @@ public class XFormsBean
|
|||||||
final String previewStorePath =
|
final String previewStorePath =
|
||||||
this.avmBrowseBean.getCurrentPath().replaceFirst(AVMConstants.STORE_MAIN,
|
this.avmBrowseBean.getCurrentPath().replaceFirst(AVMConstants.STORE_MAIN,
|
||||||
AVMConstants.STORE_PREVIEW);
|
AVMConstants.STORE_PREVIEW);
|
||||||
currentPath = AVMConstants.buildAbsoluteAVMPath(previewStorePath,
|
currentPath = AVMConstants.buildAVMPath(previewStorePath,
|
||||||
item.getString());
|
item.getString(),
|
||||||
|
AVMConstants.PathRelation.WEBAPP_RELATIVE);
|
||||||
LOGGER.debug("currentPath is " + currentPath);
|
LOGGER.debug("currentPath is " + currentPath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -73,7 +73,7 @@ public class NodePathLinkRenderer extends BaseRenderer
|
|||||||
public void encodeEnd(FacesContext context, UIComponent component) throws IOException
|
public void encodeEnd(FacesContext context, UIComponent component) throws IOException
|
||||||
{
|
{
|
||||||
// always check for this flag - as per the spec
|
// always check for this flag - as per the spec
|
||||||
if (component.isRendered() == false)
|
if (!component.isRendered())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -84,17 +84,19 @@ public class NodePathLinkRenderer extends BaseRenderer
|
|||||||
Path path = null;
|
Path path = null;
|
||||||
NodeRef nodeRef = null;
|
NodeRef nodeRef = null;
|
||||||
Object val = ((UINodePath)component).getValue();
|
Object val = ((UINodePath)component).getValue();
|
||||||
if (val instanceof NodeRef == true)
|
if (val instanceof NodeRef)
|
||||||
{
|
{
|
||||||
nodeRef = (NodeRef)val;
|
nodeRef = (NodeRef)val;
|
||||||
}
|
}
|
||||||
else if (val instanceof Path == true)
|
else if (val instanceof Path)
|
||||||
{
|
{
|
||||||
path = (Path)val;
|
path = (Path)val;
|
||||||
}
|
}
|
||||||
else if (val != null)
|
else if (val != null)
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("UINodePath component 'value' property must resolve to a NodeRef or Path!");
|
throw new IllegalArgumentException("UINodePath component 'value' " +
|
||||||
|
"property must resolve to a NodeRef " +
|
||||||
|
"or Path. Got a " + val.getClass().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val != null)
|
if (val != null)
|
||||||
|
@@ -1782,6 +1782,15 @@
|
|||||||
<property-name>workflowService</property-name>
|
<property-name>workflowService</property-name>
|
||||||
<value>#{WorkflowService}</value>
|
<value>#{WorkflowService}</value>
|
||||||
</managed-property>
|
</managed-property>
|
||||||
|
<managed-property>
|
||||||
|
<property-name>avmService</property-name>
|
||||||
|
<value>#{AVMService}</value>
|
||||||
|
</managed-property>
|
||||||
|
<managed-property>
|
||||||
|
<property-name>avmSyncService</property-name>
|
||||||
|
<value>#{AVMSyncService}</value>
|
||||||
|
</managed-property>
|
||||||
|
|
||||||
</managed-bean>
|
</managed-bean>
|
||||||
|
|
||||||
<managed-bean>
|
<managed-bean>
|
||||||
|
@@ -24,13 +24,12 @@
|
|||||||
window.onload = function() { document.getElementById("wizard:finish-button").focus(); }
|
window.onload = function() { document.getElementById("wizard:finish-button").focus(); }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
|
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
|
||||||
width="100%" rowClasses="wizardSectionHeading">
|
width="100%" rowClasses="wizardSectionHeading">
|
||||||
<h:outputText value=" #{msg.create_web_content_summary_content_details}" escape="false" />
|
<h:outputText value=" #{msg.create_web_content_summary_content_details}" escape="false" />
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0">
|
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" width="100%">
|
||||||
<a:selectList id="form-instance-data-list"
|
<a:selectList id="form-instance-data-list"
|
||||||
multiSelect="false"
|
multiSelect="false"
|
||||||
activeSelect="true"
|
activeSelect="true"
|
||||||
@@ -41,18 +40,20 @@
|
|||||||
image="/images/filetypes32/xml.gif">
|
image="/images/filetypes32/xml.gif">
|
||||||
<jsp:attribute name="description">
|
<jsp:attribute name="description">
|
||||||
<div>${msg.form}: ${WizardManager.bean.formInstanceData.form.name}</div>
|
<div>${msg.form}: ${WizardManager.bean.formInstanceData.form.name}</div>
|
||||||
<div>${msg.location}: ${WizardManager.bean.formInstanceData.webappRelativePath}</div>
|
<div>${msg.location}: ${WizardManager.bean.formInstanceData.sandboxRelativePath}</div>
|
||||||
</jsp:attribute>
|
</jsp:attribute>
|
||||||
</a:listItem>
|
</a:listItem>
|
||||||
</a:selectList>
|
</a:selectList>
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
|
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
|
||||||
width="100%" rowClasses="wizardSectionHeading">
|
width="100%" rowClasses="wizardSectionHeading"
|
||||||
|
rendered="#{!empty WizardManager.bean.renditions}">
|
||||||
<h:outputText value=" #{msg.create_web_content_summary_rendition_details}" escape="false" />
|
<h:outputText value=" #{msg.create_web_content_summary_rendition_details}" escape="false" />
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" width="100%">
|
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" width="100%"
|
||||||
|
rendered="#{!empty WizardManager.bean.renditions}">
|
||||||
<a:selectList id="rendition-list"
|
<a:selectList id="rendition-list"
|
||||||
multiSelect="false"
|
multiSelect="false"
|
||||||
activeSelect="true"
|
activeSelect="true"
|
||||||
@@ -81,7 +82,7 @@
|
|||||||
</jsp:element>
|
</jsp:element>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
Rendered by ${rendition.renderingEngineTemplate.name} into ${rendition.webappRelativePath}
|
<span>${rendition.description}</span>
|
||||||
</jsp:attribute>
|
</jsp:attribute>
|
||||||
</a:listItem>
|
</a:listItem>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
@@ -89,11 +90,13 @@
|
|||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
|
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
|
||||||
width="100%" rowClasses="wizardSectionHeading">
|
width="100%" rowClasses="wizardSectionHeading"
|
||||||
|
rendered="#{!empty WizardManager.bean.uploadedFiles}">
|
||||||
<h:outputText value=" #{msg.create_web_content_summary_uploaded_files_details}" escape="false" />
|
<h:outputText value=" #{msg.create_web_content_summary_uploaded_files_details}" escape="false" />
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" width="100%">
|
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" width="100%"
|
||||||
|
rendered="#{!empty WizardManager.bean.uploadedFiles}">
|
||||||
<a:selectList id="uploaded-file-list"
|
<a:selectList id="uploaded-file-list"
|
||||||
multiSelect="false"
|
multiSelect="false"
|
||||||
activeSelect="true"
|
activeSelect="true"
|
||||||
@@ -108,6 +111,9 @@
|
|||||||
<h:column>
|
<h:column>
|
||||||
<h:selectBooleanCheckbox id="startWorkflow"
|
<h:selectBooleanCheckbox id="startWorkflow"
|
||||||
value="#{WizardManager.bean.startWorkflow}"/>
|
value="#{WizardManager.bean.startWorkflow}"/>
|
||||||
<h:outputText value=" #{msg.create_web_content_summary_submit_message}" escape="false" />
|
<h:outputFormat value=" #{msg.create_web_content_summary_submit_message}" escape="false">
|
||||||
|
<f:param value="#{WizardManager.bean.numberOfSubmittableFiles}"/>
|
||||||
|
<f:param value="#{WizardManager.bean.formInstanceData.name}"/>
|
||||||
|
</h:outputFormat>
|
||||||
</h:column>
|
</h:column>
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
Reference in New Issue
Block a user