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

View File

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

View File

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

View File

@@ -87,6 +87,13 @@ public class FormImpl
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,
final String formInstanceDataFileName,
final Document formInstanceData)
@@ -175,9 +182,10 @@ public class FormImpl
public List<RenderingEngineTemplate> getRenderingEngineTemplates()
{
final List<RenderingEngineTemplate> result = new ArrayList<RenderingEngineTemplate>();
for (AssociationRef assoc : this.nodeService.getTargetAssocs(this.folderNodeRef,
WCMModel.ASSOC_RENDERING_ENGINE_TEMPLATES))
final List<AssociationRef> refs = this.nodeService.getTargetAssocs(this.folderNodeRef,
WCMModel.ASSOC_RENDERING_ENGINE_TEMPLATES);
final List<RenderingEngineTemplate> result = new ArrayList<RenderingEngineTemplate>(refs.size());
for (AssociationRef assoc : refs)
{
final NodeRef retNodeRef = assoc.getTargetRef();
for (ChildAssociationRef assoc2 : this.nodeService.getChildAssocs(retNodeRef,

View File

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

View File

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

View File

@@ -32,7 +32,8 @@
</a:selectList>
</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"
rowClasses="selectedItemsRow,selectedItemsRowAlt"
styleClass="selectedItems" headerClass="selectedItemsHeader"

View File

@@ -35,7 +35,8 @@
</h:panelGroup>
<%-- 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"
rowClasses="selectedItemsRow,selectedItemsRowAlt"
styleClass="selectedItems" headerClass="selectedItemsHeader"

View File

@@ -35,7 +35,8 @@
</h:panelGroup>
<%-- 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"
rowClasses="selectedItemsRow,selectedItemsRowAlt"
styleClass="selectedItems" headerClass="selectedItemsHeader"