- cleanup of create form configure rendering engines step

- first pass at starting the workflow from create content.  i'm able to start a workflow with parameters collected by the create website wizard.  however, i'm not able to associate files with the workflow yet due to some problems with the workflowservice.  i'll wait until word from britt or dave before continuing on this.
- making usage of workflowdefinition.id the key for workflows across the model since getWorkflowDefinitionByName isn't as reliable as getWorkflowdefinitionById for some reason
- adding FormProcessor back in; looks like it got removed in a merge.
- fixing localized strings in configure rendering engines

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4431 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2006-11-23 01:43:12 +00:00
parent 2985d1d77d
commit edd6d29cf4
12 changed files with 214 additions and 58 deletions

View File

@@ -650,6 +650,8 @@ 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 this form.
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_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 this form.
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.
@@ -664,7 +666,6 @@ rendering_engine_template_file=Rendering Engine Template File
rendering_engine=Rendering Engine rendering_engine=Rendering Engine
output_path_pattern=Output path pattern output_path_pattern=Output path pattern
mimetype_for_renditions=Mimetype for renditions mimetype_for_renditions=Mimetype for renditions
file_extension=Extension
schema=Schema schema=Schema
schema_root_element_name=Root element schema_root_element_name=Root element
form=Form form=Form

View File

@@ -16,11 +16,7 @@
*/ */
package org.alfresco.web.bean.wcm; package org.alfresco.web.bean.wcm;
import java.io.BufferedInputStream; import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@@ -37,11 +33,13 @@ import org.alfresco.config.ConfigService;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.content.MimetypeMap; import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.workflow.WorkflowModel;
import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.avmsync.AVMDifference; import org.alfresco.service.cmr.avmsync.AVMDifference;
import org.alfresco.service.cmr.avmsync.AVMSyncService; import org.alfresco.service.cmr.avmsync.AVMSyncService;
import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.*;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.workflow.*;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern; import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
@@ -56,6 +54,7 @@ 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;
import org.alfresco.web.forms.RenditionImpl;
import org.alfresco.web.ui.wcm.component.UIUserSandboxes; import org.alfresco.web.ui.wcm.component.UIUserSandboxes;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@@ -85,7 +84,9 @@ public class CreateWebContentWizard extends BaseContentWizard
/** AVM Browse Bean reference */ /** AVM Browse Bean reference */
protected AVMBrowseBean avmBrowseBean; protected AVMBrowseBean avmBrowseBean;
/** Workflow service bean reference */
protected WorkflowService workflowService;
/** /**
* @param avmService The AVMService to set. * @param avmService The AVMService to set.
@@ -103,6 +104,15 @@ public class CreateWebContentWizard extends BaseContentWizard
this.avmSyncService = avmSyncService; this.avmSyncService = avmSyncService;
} }
/**
* @param workflowService The WorkflowService to set.
*/
public void setWorkflowService(WorkflowService workflowService)
{
this.workflowService = workflowService;
}
/** /**
* @param avmBrowseBean The AVMBrowseBean to set. * @param avmBrowseBean The AVMBrowseBean to set.
*/ */
@@ -164,7 +174,92 @@ public class CreateWebContentWizard extends BaseContentWizard
if (this.startWorkflow) if (this.startWorkflow)
{ {
System.err.println("************* starting workflow"); WorkflowDefinition wd = null;
Map<QName, Serializable> parameters = null;
// get the workflow definition and parameters
{
final Node website = this.avmBrowseBean.getWebsite();
final List<ChildAssociationRef> webFormRefs = this.nodeService.getChildAssocs(
website.getNodeRef(), ContentModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL);
for (ChildAssociationRef ref : webFormRefs)
{
final String formName = (String)
this.nodeService.getProperty(ref.getChildRef(), ContentModel.PROP_FORMNAME);
if (formName.equals(this.getForm().getName()))
{
System.err.println("loading workflowRefs for " + formName);
final List<ChildAssociationRef> workflowRefs =
this.nodeService.getChildAssocs(ref.getChildRef(),
ContentModel.ASSOC_WORKFLOWDEFAULTS,
RegexQNamePattern.MATCH_ALL);
if (workflowRefs.size() == 0)
{
throw new RuntimeException("no workflow parameters found for form " + formName);
}
if (workflowRefs.size() > 1)
{
throw new RuntimeException("found more than one workflow parameters node for " + formName);
}
final NodeRef workflowRef = workflowRefs.get(0).getChildRef();
final String workflowId = (String)
this.nodeService.getProperty(workflowRef, ContentModel.PROP_WORKFLOW_ID);
if (workflowId == null)
{
throw new RuntimeException("no workflow found for form " + formName);
}
System.err.println("using workflow " + workflowId + " for form " + formName);
wd = this.workflowService.getDefinitionById(workflowId);
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final ContentReader cr = this.contentService.getReader(workflowRef, ContentModel.PROP_WORKFLOWDEFAULTS);
if (cr == null)
{
parameters = new HashMap<QName, Serializable>();
}
else
{
cr.getContent(baos);
final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
final ObjectInputStream ois = new ObjectInputStream(bais);
parameters = (Map<QName, Serializable>)ois.readObject();
}
break;
}
}
}
System.err.println("creating workflow package");
final NodeRef workflowPackageNodeRef = this.workflowService.createPackage(null);
// doesn't work yet. need to use ASPECT_REFERENCES_NODE to get it to deal with avm nodes
// and we need some fixes from dave before we can enable.
// QName qn = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,
// QName.createValidLocalName(this.formInstanceData.getName()));
// String s = AVMNodeConverter.ToAVMVersionPath(this.formInstanceData.getNodeRef()).getSecond();
// s = s.replaceFirst(AVMConstants.STORE_PREVIEW, AVMConstants.STORE_MAIN);
// System.err.println("adding " + s + " to workflow package with qname" + qn);
// this.nodeService.addChild(workflowPackageNodeRef,
// AVMNodeConverter.ToNodeRef(-1, s),
// ContentModel.ASSOC_CONTAINS,
// qn);
// for (Rendition rendition : this.getRenditions())
// {
// qn = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,
// QName.createValidLocalName(rendition.getName()));
// s = AVMNodeConverter.ToAVMVersionPath(rendition.getNodeRef()).getSecond();
// s = s.replaceFirst(AVMConstants.STORE_PREVIEW, AVMConstants.STORE_MAIN);
// System.err.println("adding " + s + " to workflow package with qname " + qn);
//
// this.nodeService.addChild(workflowPackageNodeRef,
// AVMNodeConverter.ToNodeRef(-1, s),
// ContentModel.ASSOC_CONTAINS,
// qn);
// }
parameters.put(WorkflowModel.ASSOC_PACKAGE, workflowPackageNodeRef);
System.err.println("starting workflow " + wd + " with parameters " + parameters);
final WorkflowPath wp = this.workflowService.startWorkflow(wd.getId(), parameters);
} }
else else
{ {
@@ -226,6 +321,9 @@ public class CreateWebContentWizard extends BaseContentWizard
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("creating file " + this.fileName + " in " + path); logger.debug("creating file " + this.fileName + " in " + path);
this.avmSyncService.resetLayer(path.split(":")[0] + ":/" + AVMConstants.DIR_APPBASE);
// put the content of the file into the AVM store // put the content of the file into the AVM store
if (fileContent != null) if (fileContent != null)
{ {
@@ -248,8 +346,7 @@ public class CreateWebContentWizard extends BaseContentWizard
if (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null) if (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null)
{ {
final Form form = this.getForm(); this.getForm().registerFormInstanceData(formInstanceDataNodeRef);
form.registerFormInstanceData(formInstanceDataNodeRef);
this.renditions = FormsService.getInstance().generateRenditions(formInstanceDataNodeRef); this.renditions = FormsService.getInstance().generateRenditions(formInstanceDataNodeRef);
} }
} }
@@ -279,18 +376,19 @@ public class CreateWebContentWizard extends BaseContentWizard
*/ */
public List<SelectItem> getFormChoices() public List<SelectItem> getFormChoices()
{ {
Node website = this.avmBrowseBean.getWebsite(); final Node website = this.avmBrowseBean.getWebsite();
if (website == null) if (website == null)
{ {
throw new IllegalStateException("CreateWebContentWizard must be called within a Web Project context!"); throw new IllegalStateException("CreateWebContentWizard must be called within a Web Project context!");
} }
List<ChildAssociationRef> webFormRefs = this.nodeService.getChildAssocs( final List<ChildAssociationRef> webFormRefs = this.nodeService.getChildAssocs(
website.getNodeRef(), ContentModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL); website.getNodeRef(), ContentModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL);
List<SelectItem> items = new ArrayList<SelectItem>(webFormRefs.size()); final List<SelectItem> items = new ArrayList<SelectItem>(webFormRefs.size());
for (ChildAssociationRef ref : webFormRefs) for (ChildAssociationRef ref : webFormRefs)
{ {
String formName = (String)this.nodeService.getProperty(ref.getChildRef(), ContentModel.PROP_FORMNAME); final String formName = (String)
Form form = FormsService.getInstance().getForm(formName); this.nodeService.getProperty(ref.getChildRef(), ContentModel.PROP_FORMNAME);
final Form form = FormsService.getInstance().getForm(formName);
if (form != null) if (form != null)
{ {
items.add(new SelectItem(formName, form.getTitle())); items.add(new SelectItem(formName, form.getTitle()));

View File

@@ -283,7 +283,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
{ {
WorkflowWrapper workflow = form.getWorkflow(); WorkflowWrapper workflow = form.getWorkflow();
props.clear(); props.clear();
props.put(ContentModel.PROP_WORKFLOWNAME, workflow.getName()); props.put(ContentModel.PROP_WORKFLOW_ID, workflow.getId());
NodeRef workflowRef = this.nodeService.createNode(formRef, NodeRef workflowRef = this.nodeService.createNode(formRef,
ContentModel.ASSOC_WORKFLOWDEFAULTS, ContentModel.ASSOC_WORKFLOWDEFAULTS,
ContentModel.ASSOC_WORKFLOWDEFAULTS, ContentModel.ASSOC_WORKFLOWDEFAULTS,
@@ -322,7 +322,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
for (WorkflowWrapper workflow : this.workflows) for (WorkflowWrapper workflow : this.workflows)
{ {
props.clear(); props.clear();
props.put(ContentModel.PROP_NAME, workflow.getName()); props.put(ContentModel.PROP_NAME, workflow.getId());
NodeRef workflowRef = this.nodeService.createNode(nodeRef, NodeRef workflowRef = this.nodeService.createNode(nodeRef,
ContentModel.ASSOC_WEBWORKFLOWDEFAULTS, ContentModel.ASSOC_WEBWORKFLOWDEFAULTS,
ContentModel.ASSOC_WEBWORKFLOWDEFAULTS, ContentModel.ASSOC_WEBWORKFLOWDEFAULTS,
@@ -575,7 +575,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
if (index != -1) if (index != -1)
{ {
Form form = (Form)this.formsList.get(index).getValue(); Form form = (Form)this.formsList.get(index).getValue();
this.forms.add(new FormWrapper(form)); this.forms.add(this.new FormWrapper(form));
} }
} }
@@ -686,7 +686,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
for (WorkflowDefinition workflowDef : workflowDefs) for (WorkflowDefinition workflowDef : workflowDefs)
{ {
UIListItem item = new UIListItem(); UIListItem item = new UIListItem();
item.setValue(workflowDef.name); item.setValue(workflowDef.id);
item.setLabel(workflowDef.title); item.setLabel(workflowDef.title);
item.setDescription(workflowDef.description); item.setDescription(workflowDef.description);
item.setImage(WebResources.IMAGE_WORKFLOW_32); item.setImage(WebResources.IMAGE_WORKFLOW_32);
@@ -706,7 +706,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
if (index != -1) if (index != -1)
{ {
String workflow = (String)this.workflowsList.get(index).getValue(); String workflow = (String)this.workflowsList.get(index).getValue();
this.workflows.add(new WorkflowWrapper(workflow)); this.workflows.add(this.new WorkflowWrapper(workflow));
} }
} }
@@ -1008,7 +1008,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
/** /**
* Wrapper class for a configurable template Form instance * Wrapper class for a configurable template Form instance
*/ */
public static class FormWrapper public class FormWrapper
{ {
private Form form; private Form form;
private String title; private String title;
@@ -1061,7 +1061,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
WorkflowDefinition wf = this.form.getDefaultWorkflow(); WorkflowDefinition wf = this.form.getDefaultWorkflow();
if (this.workflow == null && wf != null) if (this.workflow == null && wf != null)
{ {
this.workflow = new WorkflowWrapper(wf.name); this.workflow = CreateWebsiteWizard.this.new WorkflowWrapper(wf.getId());
} }
return this.workflow; return this.workflow;
} }
@@ -1126,9 +1126,9 @@ public class CreateWebsiteWizard extends BaseWizardBean
{ {
String none = '<' + Application.getMessage(FacesContext.getCurrentInstance(), MSG_NONE) + '>'; String none = '<' + Application.getMessage(FacesContext.getCurrentInstance(), MSG_NONE) + '>';
return MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), MSG_FORM_SUMMARY), return MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), MSG_FORM_SUMMARY),
getWorkflow() != null ? this.workflow.name : none, getWorkflow() != null ? this.workflow.getName() : none,
getFilenamePattern() != null ? this.filenamePattern : none, getFilenamePattern() != null ? this.filenamePattern : none,
getTemplates() != null ? this.templates.size() : 0); getTemplates() != null ? this.templates.size() : 0);
} }
} }
@@ -1197,28 +1197,41 @@ public class CreateWebsiteWizard extends BaseWizardBean
} }
} }
public WorkflowWrapper getWorkflowWrapper(String id)
{
return this.new WorkflowWrapper(id);
}
/** /**
* Class to represent a single configured Workflow instance * Class to represent a single configured Workflow instance
*/ */
public static class WorkflowWrapper public class WorkflowWrapper
{ {
private String name; private String id;
private String filenamePattern; private String filenamePattern;
private QName type; private QName type;
private Map<QName, Serializable> params; private Map<QName, Serializable> params;
public WorkflowWrapper(String name) public WorkflowWrapper(String id)
{ {
this.name = name; this.id = id;
this.filenamePattern = filenamePattern; this.filenamePattern = filenamePattern;
} }
/**
* @return Returns the id of the workflow.
*/
public String getId()
{
return this.id;
}
/** /**
* @return Returns the name of the workflow. * @return Returns the name of the workflow.
*/ */
public String getName() public String getName()
{ {
return this.name; return workflowService.getDefinitionById(this.getId()).getName();
} }
/** /**

View File

@@ -169,7 +169,7 @@ public class FormDetailsDialog extends BaseDialogBean
WorkflowWrapper workflow = getActionForm().getWorkflow(); WorkflowWrapper workflow = getActionForm().getWorkflow();
if (workflow != null) if (workflow != null)
{ {
this.workflowSelectedValue = new String[] {workflow.getName()}; this.workflowSelectedValue = new String[] {workflow.getId()};
} }
} }
return this.workflowSelectedValue; return this.workflowSelectedValue;
@@ -195,9 +195,9 @@ public class FormDetailsDialog extends BaseDialogBean
for (WorkflowDefinition workflowDef : workflowDefs) for (WorkflowDefinition workflowDef : workflowDefs)
{ {
UIListItem item = new UIListItem(); UIListItem item = new UIListItem();
item.setValue(workflowDef.name); item.setValue(workflowDef.getId());
item.setLabel(workflowDef.title); item.setLabel(workflowDef.getTitle());
item.setDescription(workflowDef.description); item.setDescription(workflowDef.getDescription());
item.setImage(WebResources.IMAGE_WORKFLOW_32); item.setImage(WebResources.IMAGE_WORKFLOW_32);
items.add(item); items.add(item);
} }
@@ -231,7 +231,7 @@ public class FormDetailsDialog extends BaseDialogBean
} }
if (this.workflowSelectedValue != null && this.workflowSelectedValue.length != 0) if (this.workflowSelectedValue != null && this.workflowSelectedValue.length != 0)
{ {
form.setWorkflow(new CreateWebsiteWizard.WorkflowWrapper(this.workflowSelectedValue[0])); form.setWorkflow(websiteWizard.getWorkflowWrapper(this.workflowSelectedValue[0]));
} }
return outcome; return outcome;
} }

View File

@@ -122,7 +122,7 @@ public class FormWorkflowDialog extends BaseDialogBean
if (this.workflowNode == null) if (this.workflowNode == null)
{ {
// TODO: remove the 'jbpm$' prefix once bug fix to WorkflowService has been merged across! // TODO: remove the 'jbpm$' prefix once bug fix to WorkflowService has been merged across!
WorkflowDefinition flowDef = this.workflowService.getDefinitionByName("jbpm$" + getActionWorkflow().getName()); WorkflowDefinition flowDef = this.workflowService.getDefinitionById(getActionWorkflow().getId());
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("Selected workflow: "+ flowDef); logger.debug("Selected workflow: "+ flowDef);

View File

@@ -17,6 +17,7 @@
package org.alfresco.web.forms; package org.alfresco.web.forms;
import java.io.Serializable; import java.io.Serializable;
import org.alfresco.service.cmr.repository.NodeRef;
/** /**
* Encapsulation of form instance data. * Encapsulation of form instance data.
@@ -38,4 +39,7 @@ public interface FormInstanceData
/** the url to the asset */ /** the url to the asset */
public String getUrl(); public String getUrl();
/** the noderef containing the form instance data */
public NodeRef getNodeRef();
} }

View File

@@ -16,6 +16,8 @@
*/ */
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.WCMModel; import org.alfresco.model.WCMModel;
@@ -50,6 +52,7 @@ public class FormInstanceDataImpl
{ {
this.nodeRef = nodeRef; this.nodeRef = nodeRef;
} }
/** the name of this rendition */ /** the name of this rendition */
public String getName() public String getName()
{ {
@@ -61,7 +64,12 @@ public class FormInstanceDataImpl
/** the path relative to the containing webapp */ /** the path relative to the containing webapp */
public String getWebappRelativePath() public String getWebappRelativePath()
{ {
return AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getSecond(); final String path = AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getSecond();
final String p = ("[^:]+:/" + AVMConstants.DIR_APPBASE +
"/" + AVMConstants.DIR_WEBAPPS +
"/[^/]+(.*)/" + this.getName());
final Matcher m = Pattern.compile(p).matcher(path);
return m.matches() && m.group(1).length() != 0 ? m.group(1) : "/";
} }
public Form getForm() public Form getForm()

View File

@@ -16,6 +16,8 @@
*/ */
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.WCMModel; import org.alfresco.model.WCMModel;
@@ -62,7 +64,12 @@ public class RenditionImpl
/** the path relative to the containing webapp */ /** the path relative to the containing webapp */
public String getWebappRelativePath() public String getWebappRelativePath()
{ {
return AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getSecond(); final String path = AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getSecond();
final String p = ("[^:]+:/" + AVMConstants.DIR_APPBASE +
"/" + AVMConstants.DIR_WEBAPPS +
"/[^/]+(.*)/" + this.getName());
final Matcher m = Pattern.compile(p).matcher(path);
return m.matches() && m.group(1).length() != 0 ? m.group(1) : "/";
} }
public FormInstanceData getPrimaryFormInstanceData() public FormInstanceData getPrimaryFormInstanceData()

View File

@@ -18,6 +18,7 @@ package org.alfresco.web.ui.wcm.component;
import java.io.IOException; import java.io.IOException;
import java.text.DateFormat; import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@@ -181,7 +182,12 @@ public class UISandboxSnapshots extends SelfRenderingComponent
Date fromDate; Date fromDate;
if (FILTER_DATE_TODAY.equals(dateFilter)) if (FILTER_DATE_TODAY.equals(dateFilter))
{ {
fromDate = new Date(toDate.getYear(), toDate.getMonth(), toDate.getDate(), 0, 0, 0); final Calendar c = Calendar.getInstance();
c.setTime(toDate);
c.set(Calendar.HOUR, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
fromDate = c.getTime();
} }
else if (FILTER_DATE_WEEK.equals(dateFilter)) else if (FILTER_DATE_WEEK.equals(dateFilter))
{ {

View File

@@ -2111,6 +2111,10 @@
<property-name>dictionaryService</property-name> <property-name>dictionaryService</property-name>
<value>#{DictionaryService}</value> <value>#{DictionaryService}</value>
</managed-property> </managed-property>
<managed-property>
<property-name>workflowService</property-name>
<value>#{WorkflowService}</value>
</managed-property>
<managed-property> <managed-property>
<property-name>avmService</property-name> <property-name>avmService</property-name>
<value>#{AVMService}</value> <value>#{AVMService}</value>

View File

@@ -18,6 +18,11 @@
<component-type>org.alfresco.faces.SandboxSnapshots</component-type> <component-type>org.alfresco.faces.SandboxSnapshots</component-type>
<component-class>org.alfresco.web.ui.wcm.component.UISandboxSnapshots</component-class> <component-class>org.alfresco.web.ui.wcm.component.UISandboxSnapshots</component-class>
</component> </component>
<component>
<component-type>org.alfresco.faces.FormProcessor</component-type>
<component-class>org.alfresco.web.ui.wcm.component.UIFormProcessor</component-class>
</component>
<!-- ==================== CONVERTERS ==================== --> <!-- ==================== CONVERTERS ==================== -->

View File

@@ -43,14 +43,16 @@
<h:panelGrid id="general-properties-panel-grid" <h:panelGrid id="general-properties-panel-grid"
columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;" columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
width="100%"> width="100%">
<h:outputText id="step-1-text" value="1. #{msg.create_form_configure_rendering_engines_step1_desc}" escape="false" /> <h:outputText id="step-1-text"
value="1. #{msg.create_form_configure_rendering_engine_templates_step1_desc}"
escape="false" />
<h:panelGrid id="panel_grid_3" <h:panelGrid id="panel_grid_3"
columns="3" cellpadding="3" cellspacing="3" border="0" columns="3" cellpadding="3" cellspacing="3" border="0"
width="100%"> width="100%">
<h:graphicImage id="required_image_rendering_engine_template_file" <h:graphicImage id="required_image_rendering_engine_template_file"
value="/images/icons/required_field.gif" alt="Required Field" /> value="/images/icons/required_field.gif" alt="Required Field" />
<h:outputText id="output_text_rendering_engine_tempalte_file" <h:outputText id="output_text_rendering_engine_template_file"
value="#{msg.rendering_engine_file}:"/> value="#{msg.rendering_engine_template_file}:"/>
<h:column id="column_pt"> <h:column id="column_pt">
<% <%
final FileUploadBean upload = (FileUploadBean) final FileUploadBean upload = (FileUploadBean)
@@ -69,7 +71,7 @@ if (upload == null || upload.getFile() == null)
else else
{ {
%> %>
<h:outputText id="rendering-engine-file-name" <h:outputText id="rendering-engine-template-file-name"
value="#{WizardManager.bean.renderingEngineTemplateFileName}"/> value="#{WizardManager.bean.renderingEngineTemplateFileName}"/>
<h:outputText id="output_text_rendering_engine_template_space" <h:outputText id="output_text_rendering_engine_template_space"
value="&nbsp;" value="&nbsp;"
@@ -84,14 +86,22 @@ else
} }
%> %>
</h:column> </h:column>
</h:panelGrid>
<h:graphicImage id="required-image-rendering-engine-type" <h:outputText id="step-2-text"
value="2. #{msg.create_form_configure_rendering_engine_templates_step2_desc}"
escape="false" />
<h:panelGrid id="panel_grid_specify_details"
columns="3" cellpadding="3" cellspacing="3" border="0"
width="100%">
<h:graphicImage id="required-image-rendering-engine"
value="/images/icons/required_field.gif" alt="Required Field" /> value="/images/icons/required_field.gif" alt="Required Field" />
<h:outputText id="rendering-engine-type-output-text" <h:outputText id="rendering-engine-output-text"
value="#{msg.rendering_engine_type}:"/> value="#{msg.rendering_engine}:"/>
<h:selectOneRadio id="rendering-engine-type" <h:selectOneRadio id="rendering-engine"
value="#{WizardManager.bean.renderingEngineName}"> value="#{WizardManager.bean.renderingEngineName}">
<f:selectItems id="rendering-engine-type-choices" <f:selectItems id="rendering-engine-choices"
value="#{WizardManager.bean.renderingEngineChoices}"/> value="#{WizardManager.bean.renderingEngineChoices}"/>
</h:selectOneRadio> </h:selectOneRadio>
@@ -106,17 +116,17 @@ else
value="#{WizardManager.bean.mimeTypeChoices}" /> value="#{WizardManager.bean.mimeTypeChoices}" />
</h:selectOneMenu> </h:selectOneMenu>
<h:graphicImage id="required-image-file-extension" <h:graphicImage id="required-image-output-path-pattern"
value="/images/icons/required_field.gif" alt="Required Field" /> value="/images/icons/required_field.gif" alt="Required Field" />
<h:outputText id="file-extension-output-text" <h:outputText id="output-path-pattern-output-text"
value="#{msg.extension_for_renditions}:"/> value="#{msg.output_path_pattern}:"/>
<h:inputText id="file-extension" <h:inputText id="output-path-pattern"
value="#{WizardManager.bean.outputPathPatternForRendition}" value="#{WizardManager.bean.outputPathPatternForRendition}"
style="width:100%;"/> style="width:100%;"/>
</h:panelGrid> </h:panelGrid>
<h:panelGroup id="step-2-panel-group" styleClass="mainSubText"> <h:panelGroup id="step-3-panel-group" styleClass="mainSubText">
<h:outputText id="step-2-output-text" value="2." /> <h:outputText id="step-3-output-text" value="3. " />
<h:commandButton id="add-to-list-button" <h:commandButton id="add-to-list-button"
value="#{msg.add_to_list_button}" value="#{msg.add_to_list_button}"
actionListener="#{WizardManager.bean.addSelectedRenderingEngineTemplate}" actionListener="#{WizardManager.bean.addSelectedRenderingEngineTemplate}"
@@ -125,7 +135,7 @@ else
</h:panelGroup> </h:panelGroup>
<h:outputText id="selected-rendering-engine-templates-output-text" <h:outputText id="selected-rendering-engine-templates-output-text"
styleClass="mainSubText" styleClass="mainSubText"
value="#{msg.selected_rendering_engines}" /> value="#{msg.selected_rendering_engine_templates}" />
<h:panelGroup id="data-table-panel-group"> <h:panelGroup id="data-table-panel-group">
<h:dataTable id="rendering-engine-template-data-table" <h:dataTable id="rendering-engine-template-data-table"
value="#{WizardManager.bean.renderingEngineTemplatesDataModel}" value="#{WizardManager.bean.renderingEngineTemplatesDataModel}"
@@ -150,7 +160,7 @@ else
</h:column> </h:column>
<h:column id="data-table-column-3"> <h:column id="data-table-column-3">
<f:facet name="header"> <f:facet name="header">
<h:outputText id="data-table-name-3" value="#{msg.file_extension}" /> <h:outputText id="data-table-name-3" value="#{msg.output_path_pattern}" />
</f:facet> </f:facet>
<h:outputText id="data-table-value-3" value="#{row.outputPathPatternForRendition}" /> <h:outputText id="data-table-value-3" value="#{row.outputPathPatternForRendition}" />
</h:column> </h:column>