. Create Web Project wizard now reads default selections

- for file patterns, templates and rendering file patterns from model as persisted by the Create Form Wizard
. Some UI tidy ups

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4356 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-11-14 19:51:41 +00:00
parent 42be18790d
commit b800048730
9 changed files with 57 additions and 12 deletions

View File

@@ -978,7 +978,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
private String description; private String description;
private WorkflowWrapper workflow; private WorkflowWrapper workflow;
private String filenamePattern; private String filenamePattern;
private List<PresentationTemplate> templates = new ArrayList<PresentationTemplate>(4); private List<PresentationTemplate> templates = null;
FormWrapper(Form form) FormWrapper(Form form)
{ {
@@ -1037,6 +1037,10 @@ public class CreateWebsiteWizard extends BaseWizardBean
*/ */
public String getFilenamePattern() public String getFilenamePattern()
{ {
if (this.filenamePattern == null)
{
this.filenamePattern = this.form.getOutputPathPattern();
}
return this.filenamePattern; return this.filenamePattern;
} }
@@ -1053,6 +1057,15 @@ public class CreateWebsiteWizard extends BaseWizardBean
*/ */
public List<PresentationTemplate> getTemplates() public List<PresentationTemplate> getTemplates()
{ {
if (this.templates == null)
{
List<RenderingEngineTemplate> templates = this.form.getRenderingEngineTemplates();
this.templates = new ArrayList<PresentationTemplate>(templates.size());
for (RenderingEngineTemplate template : templates)
{
this.templates.add(new PresentationTemplate(template));
}
}
return this.templates; return this.templates;
} }
@@ -1071,9 +1084,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),
this.workflow != null ? this.workflow.name : none, getWorkflow() != null ? this.workflow.name : none,
this.filenamePattern != null ? this.filenamePattern : none, getFilenamePattern() != null ? this.filenamePattern : none,
this.templates != null ? this.templates.size() : 0); getTemplates() != null ? this.templates.size() : 0);
} }
} }
@@ -1087,6 +1100,11 @@ public class CreateWebsiteWizard extends BaseWizardBean
private String description; private String description;
private String filenamePattern; private String filenamePattern;
public PresentationTemplate(RenderingEngineTemplate ret)
{
this(ret, null);
}
public PresentationTemplate(RenderingEngineTemplate ret, String filenamePattern) public PresentationTemplate(RenderingEngineTemplate ret, String filenamePattern)
{ {
this.ret = ret; this.ret = ret;
@@ -1121,6 +1139,10 @@ public class CreateWebsiteWizard extends BaseWizardBean
*/ */
public String getFilenamePattern() public String getFilenamePattern()
{ {
if (this.filenamePattern == null)
{
this.filenamePattern = ret.getOutputPathPattern();
}
return this.filenamePattern; return this.filenamePattern;
} }

View File

@@ -130,7 +130,7 @@ public class FormTemplatesDialog extends BaseDialogBean
List<UIListItem> items = new ArrayList<UIListItem>(engines.size()); List<UIListItem> items = new ArrayList<UIListItem>(engines.size());
for (RenderingEngineTemplate engine : engines) for (RenderingEngineTemplate engine : engines)
{ {
PresentationTemplate wrapper = new PresentationTemplate(engine, null); PresentationTemplate wrapper = new PresentationTemplate(engine);
UIListItem item = new UIListItem(); UIListItem item = new UIListItem();
item.setValue(wrapper); item.setValue(wrapper);
item.setLabel(wrapper.getTitle()); item.setLabel(wrapper.getTitle());

View File

@@ -41,6 +41,9 @@ public interface Form
/** the root tag to use within the schema */ /** the root tag to use within the schema */
public String getSchemaRootElementName(); public String getSchemaRootElementName();
/** the output path pattern for form instance data */
public String getOutputPathPattern();
/** the xml schema for this template type */ /** the xml schema for this template type */
public Document getSchema() public Document getSchema()

View File

@@ -86,6 +86,13 @@ public class FormImpl
this.nodeService.getProperty(this.folderNodeRef, this.nodeService.getProperty(this.folderNodeRef,
ContentModel.PROP_DESCRIPTION); ContentModel.PROP_DESCRIPTION);
} }
public String getOutputPathPattern()
{
return (String)
this.nodeService.getProperty(this.folderNodeRef,
WCMModel.PROP_OUTPUT_PATH_PATTERN_FOR_FORM_INSTANCE_DATA);
}
public String getOutputPathForFormInstanceData(final String parentAVMPath, public String getOutputPathForFormInstanceData(final String parentAVMPath,
final String formInstanceDataFileName, final String formInstanceDataFileName,
@@ -175,9 +182,10 @@ public class FormImpl
public List<RenderingEngineTemplate> getRenderingEngineTemplates() public List<RenderingEngineTemplate> getRenderingEngineTemplates()
{ {
final List<RenderingEngineTemplate> result = new ArrayList<RenderingEngineTemplate>(); final List<AssociationRef> refs = this.nodeService.getTargetAssocs(this.folderNodeRef,
for (AssociationRef assoc : this.nodeService.getTargetAssocs(this.folderNodeRef, WCMModel.ASSOC_RENDERING_ENGINE_TEMPLATES);
WCMModel.ASSOC_RENDERING_ENGINE_TEMPLATES)) final List<RenderingEngineTemplate> result = new ArrayList<RenderingEngineTemplate>(refs.size());
for (AssociationRef assoc : refs)
{ {
final NodeRef retNodeRef = assoc.getTargetRef(); final NodeRef retNodeRef = assoc.getTargetRef();
for (ChildAssociationRef assoc2 : this.nodeService.getChildAssocs(retNodeRef, for (ChildAssociationRef assoc2 : this.nodeService.getChildAssocs(retNodeRef,

View File

@@ -38,6 +38,9 @@ public interface RenderingEngineTemplate
/** the description of the form */ /** the description of the form */
public String getDescription(); public String getDescription();
/** the output path pattern for renditions */
public String getOutputPathPattern();
/** /**
* Provides the rendering engine to use to process this template. * Provides the rendering engine to use to process this template.
* *

View File

@@ -84,6 +84,13 @@ public class RenderingEngineTemplateImpl
this.nodeService.getProperty(this.nodeRef, this.nodeService.getProperty(this.nodeRef,
ContentModel.PROP_DESCRIPTION); ContentModel.PROP_DESCRIPTION);
} }
public String getOutputPathPattern()
{
return (String)
this.nodeService.getProperty(this.renditionPropertiesNodeRef,
WCMModel.PROP_OUTPUT_PATH_PATTERN_FOR_RENDITION);
}
public NodeRef getNodeRef() public NodeRef getNodeRef()
{ {
@@ -132,7 +139,6 @@ public class RenderingEngineTemplateImpl
final TemplateHashModel formInstanceDataModel = new TemplateHashModel() final TemplateHashModel formInstanceDataModel = new TemplateHashModel()
{ {
private TemplateModel formInstanceDataModel; private TemplateModel formInstanceDataModel;
public TemplateModel get(final String key) public TemplateModel get(final String key)

View File

@@ -32,7 +32,8 @@
</a:selectList> </a:selectList>
</h:panelGroup> </h:panelGroup>
<h:outputText styleClass="mainSubText" value="#{msg.website_selected_templates}:" style="padding-top:8px" /> <f:verbatim><div style='padding:4px'></div></f:verbatim>
<h:outputText styleClass="mainSubText" value="#{msg.website_selected_templates}:" />
<h:dataTable value="#{DialogManager.bean.templatesDataModel}" var="row" <h:dataTable value="#{DialogManager.bean.templatesDataModel}" var="row"
rowClasses="selectedItemsRow,selectedItemsRowAlt" rowClasses="selectedItemsRow,selectedItemsRowAlt"
styleClass="selectedItems" headerClass="selectedItemsHeader" styleClass="selectedItems" headerClass="selectedItemsHeader"

View File

@@ -35,7 +35,8 @@
</h:panelGroup> </h:panelGroup>
<%-- Selected Form table, with configuration buttons and info text --%> <%-- Selected Form table, with configuration buttons and info text --%>
<h:outputText styleClass="mainSubText" style="padding-top:8px" value="#{msg.website_selected_forms}:" /> <f:verbatim><div style='padding:4px'></div></f:verbatim>
<h:outputText styleClass="mainSubText" value="#{msg.website_selected_forms}:" />
<h:dataTable value="#{WizardManager.bean.formsDataModel}" var="row" <h:dataTable value="#{WizardManager.bean.formsDataModel}" var="row"
rowClasses="selectedItemsRow,selectedItemsRowAlt" rowClasses="selectedItemsRow,selectedItemsRowAlt"
styleClass="selectedItems" headerClass="selectedItemsHeader" styleClass="selectedItems" headerClass="selectedItemsHeader"

View File

@@ -35,7 +35,8 @@
</h:panelGroup> </h:panelGroup>
<%-- Selected Workflow table, with configuration buttons and info text --%> <%-- Selected Workflow table, with configuration buttons and info text --%>
<h:outputText styleClass="mainSubText" style="padding-top:8px" value="#{msg.website_selected_workflows}:" /> <f:verbatim><div style='padding:4px'></div></f:verbatim>
<h:outputText styleClass="mainSubText" value="#{msg.website_selected_workflows}:" />
<h:dataTable value="#{WizardManager.bean.workflowsDataModel}" var="row" <h:dataTable value="#{WizardManager.bean.workflowsDataModel}" var="row"
rowClasses="selectedItemsRow,selectedItemsRowAlt" rowClasses="selectedItemsRow,selectedItemsRowAlt"
styleClass="selectedItems" headerClass="selectedItemsHeader" styleClass="selectedItems" headerClass="selectedItemsHeader"