First-cut form-based XML editing in DM (WCM-303)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7399 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2007-11-16 18:50:07 +00:00
parent 3a2a6c999f
commit ca59c8b248
33 changed files with 1340 additions and 176 deletions

View File

@@ -335,8 +335,10 @@ remove_user=Remove User
create_space=Create Space
add_content=Add Content
create_content=Create Content
create_form=Create Web Form
edit_form=Edit Web Form
create_form=Create Form
edit_form=Edit Form
create_web_form=Create Web Form
edit_web_form=Edit Web Form
regenerate_renditions=Regenerate Renditions
add_multiple_files=Add Multiple Files
import_directory=Import Directory
@@ -775,13 +777,17 @@ regenerate_renditions_snapshot_description_scope_form=Regenerated all rendition
regenerate_renditions_snapshot_description_scope_rendering_engine_template=Regenerated all renditions generated by {0}.
regenerate_renditions_snapshot_description_scope_web_project=Regenerated all renditions in web project {0}.
regenerate_renditions_snapshot_short_description=Regenerated {0} {0,choice,0#renditions|1#rendition|1<renditions}.
create_form_title=Create Web Form Wizard
edit_form_title=Edit Web Form Wizard
create_form_title=Create Form Wizard
edit_form_title=Edit Form Wizard
create_form_desc=This wizard helps you create a new form.
edit_form_desc=This wizard helps you edit a form.
create_form_form_details_title=Web Form Details
create_form_form_details_step_title=Step One - Web Form Details
create_form_form_details_desc=Enter information about the web form you want to create.
create_form_form_details_title=Form Details
create_form_form_details_step_title=Step One - Form Details
create_web_form_title=Create Web Form Wizard
edit_web_form_title=Edit Web Form Wizard
create_web_form_form_details_title=Web Form Details
create_web_form_form_details_step_title=Step One - Web Form Details
create_form_form_details_desc=Enter information about the form you want to create.
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_no_elements_in_schema=This schema does not contain any element declarations. A schema must contain at least one element declaration in order to generate a form.
@@ -819,7 +825,8 @@ output_path_pattern=Output path pattern
mimetype_for_renditions=Rendition mimetype
schema=Schema
schema_root_element_name=Root element
form=Web Form
form=Form
web_form=Web Form
web_project=Web Project
# Form Not Found Exception messages

View File

@@ -288,8 +288,13 @@
</constructor-arg>
<property name="locations">
<list>
<!-- TODO currently WCM form string will override form string, which may not be desired -->
<value>alfresco:/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.wcm_content_forms.childname}/${form.name}/cm:strings</value>
<value>alfresco:/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.wcm_content_forms.childname}/cm:strings</value>
<value>alfresco:/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.content_forms.childname}/${form.name}/cm:strings</value>
<value>alfresco:/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.content_forms.childname}/cm:strings</value>
<value>classpath:alfresco/messages/webclient</value>
</list>
</property>

View File

@@ -384,7 +384,30 @@
</params>
</action>
<!-- Create XML content type -->
<!-- Create XML content type (WCM) -->
<action id="create_web_form">
<evaluator>org.alfresco.web.action.evaluator.CreateWebFormEvaluator</evaluator>
<label-id>create_web_form</label-id>
<image>/images/icons/create_form.gif</image>
<action>wizard:createWebForm</action>
</action>
<!-- Edit XML content type (WCM) -->
<action id="edit_web_form">
<permissions>
<permission allow="true">Write,AddChildren</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.EditWebFormEvaluator</evaluator>
<label-id>edit_web_form</label-id>
<image>/images/icons/edit_form.gif</image>
<action>wizard:editWebForm</action>
<action-listener>#{BrowseBean.setupSpaceAction}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
</params>
</action>
<!-- Regenerate Renditions (WCM) -->
<action id="regenerate_renditions">
<evaluator>org.alfresco.web.action.evaluator.RegenerateRenditionsEvaluator</evaluator>
<label-id>regenerate_renditions</label-id>
@@ -798,6 +821,7 @@
<action-group id="browse_create_menu">
<action idref="create_content" />
<action idref="create_form" />
<action idref="create_web_form" />
<action idref="create_website_wizard" />
<action idref="create_space" />
<action idref="create_space_wizard" />

View File

@@ -425,6 +425,7 @@
<show-link>false</show-link>
<!-- add the edit form action -->
<action idref="edit_form"/>
<action idref="edit_web_form"/>
<action idref="regenerate_renditions"/>
<!-- hide the cut and copy operations for web form -->
<action idref="cut_node" hide="true" />
@@ -435,6 +436,7 @@
<action-group id="browse_actions_menu">
<!-- add the edit form action -->
<action idref="edit_form" />
<action idref="edit_web_form"/>
<action idref="regenerate_renditions" />
<!-- hide the cut and copy operations for web form -->
<action idref="cut_node" hide="true" />
@@ -445,6 +447,7 @@
<action-group id="space_details_actions">
<!-- add the edit form action -->
<action idref="edit_form" />
<action idref="edit_web_form"/>
<action idref="regenerate_renditions" />
<!-- hide the cut and copy operations for web form -->
<action idref="cut_node" hide="true" />

View File

@@ -289,6 +289,18 @@
instruction-id="default_instruction" />
</step>
<step name="content" title-id="enter_content" description-id="create_content_step2_desc">
<condition if="#{CreateContentWizard.formName != ''}">
<page path="/jsp/content/create-content-wizard/create-form.jsp"
title-id="create_content_step2_title"
description-id="create_content_step2_desc"
instruction-id="default_instruction" />
</condition>
<condition if="#{CreateContentWizard.mimeType == 'text/xml'}">
<page path="/jsp/content/create-content-wizard/create-xml.jsp"
title-id="create_content_step2_title"
description-id="create_content_step2_desc"
instruction-id="default_instruction" />
</condition>
<condition if="#{CreateContentWizard.mimeType == 'text/html'}">
<page path="/jsp/content/create-content-wizard/create-html.jsp"
title-id="create_content_step2_title"
@@ -309,6 +321,52 @@
</step>
</wizard>
<!-- Definition of the Edit Content wizard -->
<wizard name="editContent" managed-bean="EditContentWizard"
title-id="edit_web_content_title" description-id="edit_web_content_desc"
icon="/images/icons/edit_large.gif">
<step name="content"
title-id="create_web_content_enter_content_title"
description-id="create_content_step2_desc">
<!-- JanV -->
<condition if="#{EditContentWizard.formName != ''}">
<page path="/jsp/content/create-content-wizard/create-form.jsp"
title-id="create_content_step2_title"
description-id="create_content_step2_desc"
instruction-id="default_instruction" />
</condition>
<condition if="#{EditContentWizard.mimeType == 'text/xml'}">
<page path="/jsp/content/create-content-wizard/create-xml.jsp"
title-id="edit_web_content_enter_content_step_title"
description-id="create_content_step2_desc"
instruction-id="default_instruction" />
</condition>
<condition if="#{EditContentWizard.mimeType == 'text/html'}">
<page path="/jsp/content/create-content-wizard/create-html.jsp"
title-id="edit_web_content_enter_content_step_title"
description-id="create_content_step2_desc"
instruction-id="default_instruction" />
</condition>
<!-- Default to the inline text editor -->
<page path="/jsp/content/create-content-wizard/create-text.jsp"
title-id="edit_web_content_enter_content_step_title"
description-id="create_content_step2_desc"
instruction-id="default_instruction" />
</step>
<step name="summary" title-id="summary" description-id="summary_step_description">
<condition if="#{EditWebContentWizard.mimeType == 'text/xml'}">
<page path="/jsp/content/create-content-wizard/summary.jsp"
title-id="summary"
description-id="create_web_content_summary_desc"
instruction-id="content_finish_instruction" />
</condition>
<page path="/jsp/wizard/summary.jsp"
title-id="summary"
description-id="summary_desc"
instruction-id="content_finish_instruction" />
</step>
</wizard>
<!-- Definition of the Create Web Content wizard -->
<wizard name="createWebContent" managed-bean="CreateWebContentWizard"
title-id="create_web_content_title" description-id="create_web_content_desc"
@@ -406,24 +464,8 @@
description-id="create_form_form_details_desc"
instruction-id="default_instruction" />
</step>
<step name="configure_rendering_engine_templates"
title-id="create_form_configure_rendering_engine_templates_title"
description-id="create_form_configure_rendering_engine_templates_desc">
<page path="/jsp/wcm/create-form-wizard/configure-rendering-engines.jsp"
title-id="create_form_configure_rendering_engine_templates_step_title"
description-id="create_form_configure_rendering_engine_templates_desc"
instruction-id="default_instruction" />
</step>
<step name="select_default_workflow"
title-id="create_form_select_default_workflow_title"
description-id="create_form_select_default_workflow_desc">
<page path="/jsp/wcm/create-form-wizard/select-default-workflow.jsp"
title-id="create_form_select_default_workflow_step_title"
description-id="create_form_select_default_workflow_desc"
instruction-id="default_instruction" />
</step>
<step name="summary" title-id="summary" description-id="summary_step_description">
<page path="/jsp/wcm/create-form-wizard/summary.jsp"
<page path="/jsp/wcm/create-form-wizard/form-summary.jsp"
title-id="summary"
description-id="summary_desc"
instruction-id="content_finish_instruction" />
@@ -441,6 +483,25 @@
description-id="create_form_form_details_desc"
instruction-id="default_instruction" />
</step>
<step name="summary" title-id="summary" description-id="summary_step_description">
<page path="/jsp/wcm/create-form-wizard/form-summary.jsp"
title-id="summary"
description-id="summary_desc"
instruction-id="content_finish_instruction" />
</step>
</wizard>
<!-- Definition of the create web form wizard -->
<wizard name="createWebForm" managed-bean="CreateWebFormWizard"
title-id="create_web_form_title" description-id="create_form_desc"
icon="/images/icons/create_form_large.gif">
<step name="form_details" title-id="create_web_form_form_details_title"
description-id="create_form_form_details_desc">
<page path="/jsp/wcm/create-form-wizard/details.jsp"
title-id="create_web_form_form_details_step_title"
description-id="create_form_form_details_desc"
instruction-id="default_instruction" />
</step>
<step name="configure_rendering_engine_templates"
title-id="create_form_configure_rendering_engine_templates_title"
description-id="create_form_configure_rendering_engine_templates_desc">
@@ -458,14 +519,49 @@
instruction-id="default_instruction" />
</step>
<step name="summary" title-id="summary" description-id="summary_step_description">
<page path="/jsp/wcm/create-form-wizard/summary.jsp"
<page path="/jsp/wcm/create-form-wizard/web-form-summary.jsp"
title-id="summary"
description-id="summary_desc"
instruction-id="content_finish_instruction" />
</step>
</wizard>
<!-- Definition of the create form wizard -->
<!-- Definition of the edit web form wizard -->
<wizard name="editWebForm" managed-bean="EditWebFormWizard"
title-id="edit_web_form_title" description-id="edit_form_desc"
icon="/images/icons/edit_form_large.gif">
<step name="form_details" title-id="create_web_form_form_details_title"
description-id="create_form_form_details_desc">
<page path="/jsp/wcm/create-form-wizard/details.jsp"
title-id="create_web_form_form_details_step_title"
description-id="create_form_form_details_desc"
instruction-id="default_instruction" />
</step>
<step name="configure_rendering_engine_templates"
title-id="create_form_configure_rendering_engine_templates_title"
description-id="create_form_configure_rendering_engine_templates_desc">
<page path="/jsp/wcm/create-form-wizard/configure-rendering-engines.jsp"
title-id="create_form_configure_rendering_engine_templates_step_title"
description-id="create_form_configure_rendering_engine_templates_desc"
instruction-id="default_instruction" />
</step>
<step name="select_default_workflow"
title-id="create_form_select_default_workflow_title"
description-id="create_form_select_default_workflow_desc">
<page path="/jsp/wcm/create-form-wizard/select-default-workflow.jsp"
title-id="create_form_select_default_workflow_step_title"
description-id="create_form_select_default_workflow_desc"
instruction-id="default_instruction" />
</step>
<step name="summary" title-id="summary" description-id="summary_step_description">
<page path="/jsp/wcm/create-form-wizard/web-form-summary.jsp"
title-id="summary"
description-id="summary_desc"
instruction-id="content_finish_instruction" />
</step>
</wizard>
<!-- Definition of the regenerate renditions wizard -->
<wizard name="regenerateRenditions" managed-bean="RegenerateRenditionsWizard"
title-id="regenerate_renditions_title" description-id="regenerate_renditions_desc"
icon="/images/icons/regenerate_renditions_large.gif">

View File

@@ -36,7 +36,7 @@ import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
* UI Action Evaluator - Create Web Form in the Forms DataDictionary folder
* UI Action Evaluator - Create Form in the Forms DataDictionary folder
*
* @author Kevin Roast
*/
@@ -51,12 +51,12 @@ public class CreateFormEvaluator extends BaseActionEvaluator
final ServiceRegistry services = Repository.getServiceRegistry(fc);
final NavigationBean navigator = (NavigationBean)FacesHelper.getManagedBean(fc, NavigationBean.BEAN_NAME);
// get the path to the current name - compare last element with the Website folder assoc name
// get the path to the current name - compare last element with the Forms folder name
final Path path = navigator.getCurrentNode().getNodePath();
final Path.Element element = path.get(path.size() - 1);
final String endPath = element.getPrefixedString(services.getNamespaceService());
// check we have the permission to create nodes in that Website folder
// check we have the permission to create nodes in that Forma folder
return (Application.getContentFormsFolderName(fc).equals(endPath) &&
navigator.getCurrentNode().hasPermission(PermissionService.ADD_CHILDREN));
}

View File

@@ -0,0 +1,62 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.action.evaluator;
import javax.faces.context.FacesContext;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.Path;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.NavigationBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
* UI Action Evaluator - Create Web Forms in the Web Forms DataDictionary folder
*
*/
public class CreateWebFormEvaluator extends BaseActionEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
final FacesContext fc = FacesContext.getCurrentInstance();
final ServiceRegistry services = Repository.getServiceRegistry(fc);
final NavigationBean navigator = (NavigationBean)FacesHelper.getManagedBean(fc, NavigationBean.BEAN_NAME);
// get the path to the current name - compare last element with the Web Forms folder name
final Path path = navigator.getCurrentNode().getNodePath();
final Path.Element element = path.get(path.size() - 1);
final String endPath = element.getPrefixedString(services.getNamespaceService());
// check we have the permission to create nodes in that Web Forms folder
return (Application.getWebContentFormsFolderName(fc).equals(endPath) &&
navigator.getCurrentNode().hasPermission(PermissionService.ADD_CHILDREN));
}
}

View File

@@ -22,11 +22,19 @@
* http://www.alfresco.com/legal/licensing" */
package org.alfresco.web.action.evaluator;
import javax.faces.context.FacesContext;
import org.alfresco.model.WCMAppModel;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.Path;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.NavigationBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
* UI Action Evaluator - Edit Web Form in the Forms DataDictionary folder
* UI Action Evaluator - Edit Form in the Forms DataDictionary folder
*
* @author Ariel Backenroth
*/
@@ -37,6 +45,16 @@ public class EditFormEvaluator extends BaseActionEvaluator
*/
public boolean evaluate(final Node node)
{
return node.hasAspect(WCMAppModel.ASPECT_FORM);
final FacesContext fc = FacesContext.getCurrentInstance();
final ServiceRegistry services = Repository.getServiceRegistry(fc);
final NavigationBean navigator = (NavigationBean)FacesHelper.getManagedBean(fc, NavigationBean.BEAN_NAME);
// get the path to the current name - compare last element with the Forms folder name
final Path path = navigator.getCurrentNode().getNodePath();
final Path.Element element = path.get(path.size() - 1);
final String endPath = element.getPrefixedString(services.getNamespaceService());
return (Application.getContentFormsFolderName(fc).equals(endPath) &&
node.hasAspect(WCMAppModel.ASPECT_FORM));
}
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing" */
package org.alfresco.web.action.evaluator;
import javax.faces.context.FacesContext;
import org.alfresco.model.WCMAppModel;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.Path;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.NavigationBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
* UI Action Evaluator - Edit Web Form in the Web Forms DataDictionary folder
*
* @author Ariel Backenroth
*/
public class EditWebFormEvaluator extends BaseActionEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(final Node node)
{
final FacesContext fc = FacesContext.getCurrentInstance();
final ServiceRegistry services = Repository.getServiceRegistry(fc);
final NavigationBean navigator = (NavigationBean)FacesHelper.getManagedBean(fc, NavigationBean.BEAN_NAME);
// get the path to the current name - compare last element with the Web Forms folder name
final Path path = navigator.getCurrentNode().getNodePath();
final Path.Element element = path.get(path.size() - 1);
final String endPath = element.getPrefixedString(services.getNamespaceService());
return (Application.getWebContentFormsFolderName(fc).equals(endPath) &&
node.hasAspect(WCMAppModel.ASPECT_FORM));
}
}

View File

@@ -23,6 +23,8 @@
*/
package org.alfresco.web.action.evaluator;
import java.util.Iterator;
import javax.faces.context.FacesContext;
import org.alfresco.model.WCMAppModel;
@@ -35,7 +37,7 @@ import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
* UI Action Evaluator for Regenerate Renditions in the Forms DataDictionary folder
* UI Action Evaluator for Regenerate Renditions in the Web Forms DataDictionary folder
*
* @author Ariel Backenroth
*/
@@ -50,13 +52,24 @@ public class RegenerateRenditionsEvaluator extends BaseActionEvaluator
final ServiceRegistry services = Repository.getServiceRegistry(fc);
final NavigationBean navigator = (NavigationBean)FacesHelper.getManagedBean(fc, NavigationBean.BEAN_NAME);
// get the path to the current name - compare last element with the Website folder assoc name
final Path path = navigator.getCurrentNode().getNodePath();
final Path.Element element = path.get(path.size() - 1);
final String endPath = element.getPrefixedString(services.getNamespaceService());
// TODO improve how we determine whether the form supports the ability to regenerate renditions or not
return (node.hasAspect(WCMAppModel.ASPECT_FORM) ||
node.hasAspect(WCMAppModel.ASPECT_RENDERING_ENGINE_TEMPLATE) ||
Application.getContentFormsFolderName(fc).equals(endPath));
// get the path to the current name - compare each path element with the Web Forms folder name
final Path path = navigator.getCurrentNode().getNodePath();
boolean isWebFormsPath = false;
Iterator<Path.Element> itr = path.iterator();
while (itr.hasNext())
{
Path.Element element = (Path.Element)itr.next();
String pathElement = element.getPrefixedString(services.getNamespaceService());
if (Application.getWebContentFormsFolderName(fc).equals(pathElement))
{
isWebFormsPath = true;
break;
}
}
return (node.hasAspect(WCMAppModel.ASPECT_RENDERING_ENGINE_TEMPLATE) || isWebFormsPath);
}
}

View File

@@ -86,6 +86,7 @@ public class Application
private static String scriptsFolderName;
private static String guestHomeFolderName;
private static String websitesFolderName;
private static String webContentFormsFolderName;
private static String contentFormsFolderName;
private static Boolean isDynamicConfig = null;
@@ -523,13 +524,29 @@ public class Application
/**
* @return the WCM Content Forms folder name
*/
public static String getWebContentFormsFolderName(ServletContext context)
{
return getWebContentFormsFolderName(WebApplicationContextUtils.getRequiredWebApplicationContext(context));
}
/**
* @return the WCM Content Forms folder name
*/
public static String getWebContentFormsFolderName(FacesContext context)
{
return getWebContentFormsFolderName(FacesContextUtils.getRequiredWebApplicationContext(context));
}
/**
* @return the Content Forms folder name
*/
public static String getContentFormsFolderName(ServletContext context)
{
return getContentFormsFolderName(WebApplicationContextUtils.getRequiredWebApplicationContext(context));
}
/**
* @return the WCM Content Forms folder name
* @return the Content Forms folder name
*/
public static String getContentFormsFolderName(FacesContext context)
{
@@ -939,6 +956,24 @@ public class Application
* @param context The Spring context
* @return The WCM Content Forms folder name
*/
private static String getWebContentFormsFolderName(WebApplicationContext context)
{
if (webContentFormsFolderName == null)
{
ImporterBootstrap bootstrap = (ImporterBootstrap)context.getBean(BEAN_IMPORTER_BOOTSTRAP);
Properties configuration = bootstrap.getConfiguration();
webContentFormsFolderName = configuration.getProperty("spaces.wcm_content_forms.childname");
}
return webContentFormsFolderName;
}
/**
* Returns the Content Forms folder name
*
* @param context The Spring context
* @return The WCM Content Forms folder name
*/
private static String getContentFormsFolderName(WebApplicationContext context)
{
if (contentFormsFolderName == null)

View File

@@ -24,7 +24,10 @@
*/
package org.alfresco.web.bean.content;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
@@ -36,14 +39,24 @@ import javax.faces.model.SelectItem;
import org.alfresco.config.Config;
import org.alfresco.config.ConfigElement;
import org.alfresco.config.ConfigService;
import org.alfresco.model.WCMAppModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.data.IDataContainer;
import org.alfresco.web.data.QuickSort;
import org.alfresco.web.forms.Form;
import org.alfresco.web.forms.FormNotFoundException;
import org.alfresco.web.forms.FormProcessor;
import org.alfresco.web.forms.FormsService;
import org.alfresco.web.forms.XMLUtil;
import org.alfresco.web.ui.common.Utils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Document;
/**
* Bean implementation for the "Create Content Wizard" dialog
@@ -55,12 +68,50 @@ public class CreateContentWizard extends BaseContentWizard
protected String content = null;
protected List<SelectItem> createMimeTypes;
protected FormsService formsService;
protected String formName;
protected FormProcessor.Session formProcessorSession = null;
protected Document instanceDataDocument = null;
private static Log logger = LogFactory.getLog(CreateContentWizard.class);
/**
* @param formsService The FormsService to set.
*/
public void setFormsService(final FormsService formsService)
{
this.formsService = formsService;
}
// ------------------------------------------------------------------------------
// Wizard implementation
@Override
public String finish()
{
// if a form is entered, then save the form instance data as XML ...
if (this.instanceDataDocument != null)
{
this.content = XMLUtil.toString(this.instanceDataDocument, true);
// TODO - first step in wizard should auto-select XML when form is selected
this.mimeType = MimetypeMap.MIMETYPE_XML; // override mimetype (in case is not set to XML)
}
String result = super.finish();
if ((super.createdNode != null) && (this.instanceDataDocument != null))
{
final Map<QName, Serializable> props = new HashMap<QName, Serializable>(1, 1.0f);
props.put(WCMAppModel.PROP_PARENT_FORM_NAME, getFormName());
props.put(WCMAppModel.PROP_ORIGINAL_PARENT_PATH, "");
this.nodeService.addAspect(super.createdNode, WCMAppModel.ASPECT_FORM_INSTANCE_DATA, props);
}
return result;
}
@Override
protected String finishImpl(FacesContext context, String outcome)
throws Exception
@@ -79,6 +130,13 @@ public class CreateContentWizard extends BaseContentWizard
this.content = null;
this.inlineEdit = true;
this.mimeType = MimetypeMap.MIMETYPE_HTML;
this.instanceDataDocument = null;
if (this.formProcessorSession != null)
{
this.formProcessorSession.destroy();
}
this.formProcessorSession = null;
}
@Override
@@ -197,6 +255,12 @@ public class CreateContentWizard extends BaseContentWizard
{
ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
if (this.instanceDataDocument != null)
{
// TODO - first step in wizard should auto-select XML when form is selected
this.mimeType = MimetypeMap.MIMETYPE_XML; // override mimetype (in case it is not set to XML)
}
// TODO: show first few lines of content here?
return buildSummary(
new String[] {bundle.getString("file_name"),
@@ -206,6 +270,81 @@ public class CreateContentWizard extends BaseContentWizard
getSummaryMimeType(this.mimeType)});
}
/**
* @return List of UI items to represent the full list of available ECM Forms
*/
public List<SelectItem> getFormsList()
{
Collection<Form> forms = this.formsService.getForms();
List<SelectItem> items = new ArrayList<SelectItem>(forms.size()+1);
items.add(new SelectItem("", ""));
for (Form form : forms)
{
items.add(new SelectItem(form.getName(), form.getTitle()));
}
return items;
}
public String getFormName()
{
return this.formName;
}
public void setFormName(String formName)
{
this.formName = formName;
}
public Form getForm() throws FormNotFoundException
{
return (this.getFormName() != null
? formsService.getForm(formName)
: null);
}
public FormProcessor.Session getFormProcessorSession()
{
return this.formProcessorSession;
}
public void setFormProcessorSession(final FormProcessor.Session formProcessorSession)
{
this.formProcessorSession = formProcessorSession;
}
public Document getInstanceDataDocument()
{
if (this.instanceDataDocument == null)
{
final String content = this.getContent();
try
{
this.instanceDataDocument = (content != null
? XMLUtil.parse(content)
: XMLUtil.newDocument());
}
catch (Exception e)
{
Utils.addErrorMessage("error parsing document", e);
this.instanceDataDocument = XMLUtil.newDocument();
}
}
return this.instanceDataDocument;
}
/** Overrides in order to strip an xml extension if the user entered it */
// TODO do we need ? it is currently referenced in create-forms.jsp (copied from wcm create-xml.jsp)
@Override
public String getFileName()
{
final String result = super.getFileName();
return (result != null &&
MimetypeMap.MIMETYPE_XML.equals(this.mimeType) &&
this.getFormName() != null &&
"xml".equals(FilenameUtils.getExtension(result).toLowerCase())
? FilenameUtils.removeExtension(result)
: result);
}
// ------------------------------------------------------------------------------
// Action event handlers

View File

@@ -0,0 +1,157 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.web.bean.content;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
import javax.faces.context.FacesContext;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import org.alfresco.config.Config;
import org.alfresco.config.ConfigElement;
import org.alfresco.config.ConfigService;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMAppModel;
import org.alfresco.model.WCMWorkflowModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.workflow.WorkflowModel;
import org.alfresco.service.cmr.avm.AVMExistsException;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.avm.locking.AVMLock;
import org.alfresco.service.cmr.avmsync.AVMDifference;
import org.alfresco.service.cmr.avmsync.AVMSyncService;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
import org.alfresco.service.cmr.workflow.WorkflowPath;
import org.alfresco.service.cmr.workflow.WorkflowService;
import org.alfresco.service.cmr.workflow.WorkflowTask;
import org.alfresco.service.cmr.workflow.WorkflowTaskState;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.content.BaseContentWizard;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.data.IDataContainer;
import org.alfresco.web.data.QuickSort;
import org.alfresco.web.forms.Form;
import org.alfresco.web.forms.FormInstanceData;
import org.alfresco.web.forms.FormNotFoundException;
import org.alfresco.web.forms.FormProcessor;
import org.alfresco.web.forms.FormsService;
import org.alfresco.web.forms.RenderingEngineTemplate;
import org.alfresco.web.forms.Rendition;
import org.alfresco.web.forms.XMLUtil;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIListItem;
import org.alfresco.web.ui.wcm.component.UIUserSandboxes;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Document;
/**
* Bean implementation for the "Edit Content Wizard" dialog
*/
public class EditContentWizard extends CreateContentWizard
{
private static final Log LOGGER = LogFactory.getLog(EditContentWizard.class);
private NodeRef nodeRef;
private Form form;
// ------------------------------------------------------------------------------
// Wizard implementation
@Override
public void init(final Map<String, String> parameters)
{
// TODO - currently assumes this is form content
super.init(parameters);
Node node = this.navigator.getDispatchContextNode();
if (node == null)
{
throw new IllegalArgumentException("Edit Form wizard requires action node context.");
}
this.nodeRef = node.getNodeRef();
try
{
formName = (String)nodeService.getProperty(nodeRef, WCMAppModel.PROP_PARENT_FORM_NAME); // getFormName() ...
form = formsService.getForm(this.formName);
}
catch (FormNotFoundException fnfe)
{
Utils.addErrorMessage(fnfe.getMessage(), fnfe);
throw new IllegalArgumentException(fnfe);
}
this.content = this.contentService.getReader(nodeRef, ContentModel.PROP_CONTENT).getContentString();
this.fileName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME); // getName() ...
this.mimeType = MimetypeMap.MIMETYPE_XML;
}
@Override
public String back()
{
return super.back();
}
@Override
protected void saveContent(File fileContent, String strContent) throws Exception
{
ContentWriter writer = contentService.getWriter(nodeRef, ContentModel.PROP_CONTENT, true);
writer.putContent(strContent);
}
@Override
protected String doPostCommitProcessing(FacesContext context, String outcome)
{
return outcome;
}
@Override
public Form getForm()
{
return this.form;
}
}

View File

@@ -499,7 +499,8 @@ public class AVMBrowseBean implements IContextListener
{
if (this.webapp == null)
{
this.webapp = this.getWebProject().getDefaultWebapp();
// TODO - temporary, should only be called for WCM forms (not ECM forms)
this.webapp = this.getWebProject() != null ? this.getWebProject().getDefaultWebapp() : null;
}
return this.webapp;
}
@@ -717,7 +718,12 @@ public class AVMBrowseBean implements IContextListener
{
if (this.currentPath == null)
{
this.currentPath = AVMUtil.buildStoreWebappPath(getSandbox(), getWebapp());
// TODO - temporary, should only be called for WCM forms (not ECM forms)
String webApp = getWebapp();
if (webApp != null)
{
this.currentPath = AVMUtil.buildStoreWebappPath(getSandbox(), webApp);
}
}
return this.currentPath;
}

View File

@@ -235,8 +235,8 @@ public class CreateFormWizard
if (LOGGER.isDebugEnabled())
LOGGER.debug("creating form " + this.getFormName());
// get the node ref of the node that will contain the content
final NodeRef contentFormsNodeRef = this.formsService.getContentFormsNodeRef();
// get the node ref of the node that will contain the content (either Forms or Web Forms dictionary space)
final NodeRef contentFormsNodeRef = this.navigator.getCurrentNode().getNodeRef();
final FileInfo folderInfo =
this.fileFolderService.create(contentFormsNodeRef,
@@ -430,6 +430,23 @@ public class CreateFormWizard
}
}
@Override
public boolean getFinishButtonDisabled()
{
final int step = Application.getWizardManager().getCurrentStep();
final int stepCount = Application.getWizardManager().getStepItems().size();
if ((stepCount == 1) && (step == 1))
{
// assume Create Form Wizard
return false;
}
else
{
return true;
}
}
@Override
public String getStepDescription()
{

View File

@@ -28,6 +28,7 @@ import java.io.ByteArrayInputStream;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
@@ -60,15 +61,13 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.content.BaseContentWizard;
import org.alfresco.web.bean.content.CreateContentWizard;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.data.IDataContainer;
import org.alfresco.web.data.QuickSort;
import org.alfresco.web.forms.Form;
import org.alfresco.web.forms.FormInstanceData;
import org.alfresco.web.forms.FormNotFoundException;
import org.alfresco.web.forms.FormProcessor;
import org.alfresco.web.forms.FormsService;
import org.alfresco.web.forms.RenderingEngineTemplate;
import org.alfresco.web.forms.Rendition;
import org.alfresco.web.forms.XMLUtil;
@@ -83,19 +82,16 @@ import org.w3c.dom.Document;
/**
* Bean implementation for the "Create Web Content Wizard" dialog
*/
public class CreateWebContentWizard extends BaseContentWizard
public class CreateWebContentWizard extends CreateContentWizard
{
private static final Log LOGGER = LogFactory.getLog(CreateWebContentWizard.class);
protected String content = null;
protected String formName;
protected transient List<SelectItem> createMimeTypes;
protected transient List<SelectItem> formChoices;
protected String createdPath = null;
protected List<Rendition> renditions = null;
protected FormInstanceData formInstanceData = null;
protected FormProcessor.Session formProcessorSession = null;
protected Document instanceDataDocument = null;
protected boolean formSelectDisabled = false;
protected boolean startWorkflow = false;
@@ -104,7 +100,6 @@ public class CreateWebContentWizard extends BaseContentWizard
protected AVMSyncService avmSyncService;
protected AVMBrowseBean avmBrowseBean;
protected FilePickerBean filePickerBean;
protected FormsService formsService;
/**
* @param avmService The AVMService to set.
@@ -146,14 +141,6 @@ public class CreateWebContentWizard extends BaseContentWizard
this.filePickerBean = filePickerBean;
}
/**
* @param formsService The FormsService to set.
*/
public void setFormsService(final FormsService formsService)
{
this.formsService = formsService;
}
// ------------------------------------------------------------------------------
// Wizard implementation
@@ -167,12 +154,7 @@ public class CreateWebContentWizard extends BaseContentWizard
this.formName = null;
this.mimeType = MimetypeMap.MIMETYPE_XML;
this.formInstanceData = null;
if (this.formProcessorSession != null)
{
this.formProcessorSession.destroy();
}
this.formProcessorSession = null;
this.instanceDataDocument = null;
this.renditions = null;
this.startWorkflow = false;
this.formSelectDisabled = false;
@@ -415,7 +397,8 @@ public class CreateWebContentWizard extends BaseContentWizard
LOGGER.debug("reset form instance data " + this.formInstanceData.getName() +
" and " + this.renditions.size() + " to main store");
}
return super.doPostCommitProcessing(facesContext, outcome);
return outcome;
}
@Override
@@ -642,14 +625,6 @@ public class CreateWebContentWizard extends BaseContentWizard
return this.createMimeTypes;
}
/**
* @return the current seleted form's name or <tt>null</tt>.
*/
public String getFormName()
{
return this.formName;
}
public Form getForm()
throws FormNotFoundException
{
@@ -658,14 +633,6 @@ public class CreateWebContentWizard extends BaseContentWizard
: null);
}
/**
* @param form Sets the currently selected form
*/
public void setFormName(final String formName)
{
this.formName = formName;
}
/**
* @return Returns the wrapper instance data for feeding the xml
* content to the form processor.
@@ -691,19 +658,18 @@ public class CreateWebContentWizard extends BaseContentWizard
}
/**
* Returns the form processor session.
* @return List of UI items to represent the full list of available Web Forms
*/
public FormProcessor.Session getFormProcessorSession()
public List<SelectItem> getFormsList()
{
return this.formProcessorSession;
Collection<Form> forms = this.formsService.getWebForms();
List<SelectItem> items = new ArrayList<SelectItem>(forms.size()+1);
items.add(new SelectItem("", ""));
for (Form form : forms)
{
items.add(new SelectItem(form.getName(), form.getTitle()));
}
/**
* Sets the form processor session.
*/
public void setFormProcessorSession(final FormProcessor.Session formProcessorSession)
{
this.formProcessorSession = formProcessorSession;
return items;
}
/**

View File

@@ -1017,7 +1017,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
*/
public List<UIListItem> getFormsList()
{
Collection<Form> forms = this.formsService.getForms();
Collection<Form> forms = this.formsService.getWebForms();
List<UIListItem> items = new ArrayList<UIListItem>(forms.size());
for (Form form : forms)
{

View File

@@ -442,7 +442,7 @@ public class WebProject
nodeService.getProperty(ref.getChildRef(), WCMAppModel.PROP_FORMNAME);
try
{
final Form baseForm = formsService.getForm(formName);
final Form baseForm = formsService.getWebForm(formName);
result.put(formName, new FormWrapper(baseForm, ref.getChildRef(), formsService));
}
catch (FormNotFoundException fnfe)

View File

@@ -42,6 +42,7 @@ import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wcm.AVMUtil;
import org.apache.commons.logging.Log;
@@ -129,9 +130,17 @@ import org.xml.sax.SAXException;
{
final String parentFormName = this.getParentFormName();
try
{
// TODO - forms should be identified by nodeRef rather than name (which can be non-unique)
if (getNodeRef().getStoreRef().getProtocol().equals(StoreRef.PROTOCOL_AVM))
{
return this.formsService.getWebForm(parentFormName);
}
else
{
return this.formsService.getForm(parentFormName);
}
}
catch (FormNotFoundException fnfe)
{
throw new FormNotFoundException(parentFormName, this);

View File

@@ -96,6 +96,7 @@ public final class FormsService
private final SearchService searchService;
private NodeRef contentFormsNodeRef;
private NodeRef webContentFormsNodeRef;
/** instantiated using spring */
public FormsService(final ContentService contentService,
@@ -170,29 +171,72 @@ public final class FormsService
final String xpath = (Application.getRootPath(fc) + "/" +
Application.getGlossaryFolderName(fc) + "/" +
Application.getContentFormsFolderName(fc));
this.contentFormsNodeRef = getNodeRefFromXPath(xpath);
}
return this.contentFormsNodeRef;
}
/**
* @return the cached reference to the WCM Content Forms folder
*/
public NodeRef getWebContentFormsNodeRef()
{
if (this.webContentFormsNodeRef == null)
{
final FacesContext fc = FacesContext.getCurrentInstance();
final String xpath = (Application.getRootPath(fc) + "/" +
Application.getGlossaryFolderName(fc) + "/" +
Application.getWebContentFormsFolderName(fc));
this.webContentFormsNodeRef = getNodeRefFromXPath(xpath);
}
return this.webContentFormsNodeRef;
}
private NodeRef getNodeRefFromXPath(String xpath)
{
if (LOGGER.isDebugEnabled())
LOGGER.debug("locating content forms at " + xpath);
LOGGER.debug("locating noderef at " + xpath);
final List<NodeRef> results =
searchService.selectNodes(this.nodeService.getRootNode(Repository.getStoreRef()),
xpath,
null,
namespaceService,
false);
this.contentFormsNodeRef = (results != null && results.size() == 1 ? results.get(0) : null);
}
return this.contentFormsNodeRef;
return (results != null && results.size() == 1 ? results.get(0) : null);
}
/**
* returns all registered forms
* returns registered forms
*
* @return all registered forms.
* @return registered (ECM) forms
*/
public Collection<Form> getForms()
{
final String query =
"+ASPECT:\"" + WCMAppModel.ASPECT_FORM +
"\" +PARENT:\"" + this.getContentFormsNodeRef() + "\"";
return getForms(query);
}
/**
* returns registered web forms
*
* @return registered (WCM) forms
*/
public Collection<Form> getWebForms()
{
final String query =
"+ASPECT:\"" + WCMAppModel.ASPECT_FORM +
"\" +PARENT:\"" + this.getWebContentFormsNodeRef() + "\"";
return getForms(query);
}
private Collection<Form> getForms(String query)
{
final ResultSet rs = this.searchService.query(Repository.getStoreRef(),
SearchService.LANGUAGE_LUCENE,
query);
@@ -213,6 +257,7 @@ public final class FormsService
* return the form by name or <tt>null</tt> if not found
*
* @return the form by name or <tt>null</tt> if not found
* @deprecated
*/
public Form getForm(final String name)
throws FormNotFoundException
@@ -227,6 +272,25 @@ public final class FormsService
return this.getForm(result);
}
/**
* return the web form by name or <tt>null</tt> if not found
*
* @return the (WCM) form by name or <tt>null</tt> if not found
* @deprecated
*/
public Form getWebForm(final String name)
throws FormNotFoundException
{
final NodeRef result = this.nodeService.getChildByName(this.getWebContentFormsNodeRef(),
ContentModel.ASSOC_CONTAINS,
name);
if (result == null)
{
throw new FormNotFoundException(name);
}
return this.getForm(result);
}
/**
* Returns the form backed by the given NodeRef. The NodeRef should
* point to the schema for this form.

View File

@@ -23,72 +23,58 @@
*/
package org.alfresco.web.forms.xforms;
import java.io.*;
import java.util.*;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.TempFileProvider;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.app.servlet.ajax.InvokeCommand;
import org.alfresco.web.bean.FileUploadBean;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.NavigationBean;
import org.alfresco.web.bean.wcm.AVMBrowseBean;
import org.alfresco.web.bean.wcm.AVMNode;
import org.alfresco.web.bean.wcm.AVMUtil;
import org.alfresco.web.forms.*;
import org.alfresco.web.ui.common.Utils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.servlet.ServletRequestContext;
import org.alfresco.web.forms.Form;
import org.alfresco.web.forms.FormProcessor;
import org.alfresco.web.forms.XMLUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chiba.xml.events.ChibaEventNames;
import org.chiba.xml.events.DOMEventNames;
import org.chiba.xml.events.XFormsEventNames;
import org.chiba.xml.events.XMLEvent;
import org.chiba.xml.ns.NamespaceConstants;
import org.chiba.xml.xforms.ChibaBean;
import org.chiba.xml.xforms.XFormsElement;
import org.chiba.xml.xforms.connector.SubmissionHandler;
import org.chiba.xml.xforms.connector.AbstractConnector;
import org.chiba.xml.xforms.connector.SubmissionHandler;
import org.chiba.xml.xforms.core.Instance;
import org.chiba.xml.xforms.core.ModelItem;
import org.chiba.xml.xforms.core.Model;
import org.chiba.xml.xforms.core.ModelItem;
import org.chiba.xml.xforms.core.Submission;
import org.chiba.xml.xforms.core.UpdateHandler;
import org.chiba.xml.xforms.core.impl.DefaultValidatorMode;
import org.chiba.xml.xforms.exception.XFormsException;
import org.chiba.xml.xforms.ui.RepeatItem;
import org.chiba.xml.xforms.ui.Upload;
import org.chiba.xml.ns.NamespaceConstants;
import org.springframework.util.FileCopyUtils;
import org.w3c.dom.*;
import org.w3c.dom.bootstrap.DOMImplementationRegistry;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.events.Event;
import org.w3c.dom.events.EventListener;
import org.w3c.dom.events.EventTarget;
import org.w3c.dom.ls.*;
import org.xml.sax.SAXException;
/**
@@ -187,6 +173,7 @@ public class XFormsBean
private Schema2XFormsProperties schema2XFormsProperties;
private AVMBrowseBean avmBrowseBean;
private AVMService avmService;
private NavigationBean navigator;
public XFormsBean()
{
@@ -208,6 +195,11 @@ public class XFormsBean
this.avmBrowseBean = avmBrowseBean;
}
public void setNavigator(final NavigationBean navigator)
{
this.navigator = navigator;
}
/**
* @param avmService the avmService to set.
*/
@@ -665,13 +657,19 @@ public class XFormsBean
private Document getXFormsDocument()
throws FormBuilderException
{
final String cwdAVMPath = this.getCurrentAVMPath();
// TODO - need better way to to determine if WCM or ECM context, or earlier ...
final String path = this.getCurrentPath();
if (path == null)
{
this.getCurrentAVMPath();
}
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("building xform for schema " + this.xformsSession.form.getName() +
" root element " + this.xformsSession.form.getSchemaRootElementName() +
" avm cwd " + cwdAVMPath);
" cwd " + path);
}
final Locale locale =
@@ -682,7 +680,7 @@ public class XFormsBean
try
{
final Document schemaDocument = this.xformsSession.form.getSchema();
XFormsBean.rewriteInlineURIs(schemaDocument, cwdAVMPath);
XFormsBean.rewriteInlineURIs(schemaDocument, path);
final String rootElementName = this.xformsSession.form.getSchemaRootElementName();
final Document result =
this.xformsSession.schema2XForms.buildXForm(this.xformsSession.formInstanceData,
@@ -716,4 +714,16 @@ public class XFormsBean
final String result = node.getPath();
return node.isDirectory() ? result : AVMNodeConverter.SplitBase(result)[0];
}
private String getCurrentPath()
{
org.alfresco.web.bean.repository.Node node = this.navigator.getCurrentNode();
if (node == null)
{
return null;
}
final String result = node.getPath();
return result;
}
}

View File

@@ -192,13 +192,29 @@ public class XFormsProcessor
js.append("alfresco.constants.WEBAPP_CONTEXT = '").
append(JavaScriptUtils.javaScriptEscape(contextPath)).
append("';\n");
js.append("alfresco.constants.AVM_WEBAPP_CONTEXT = '").
append(JavaScriptUtils.javaScriptEscape(avmBrowseBean.getWebapp())).
append("';\n");
js.append("alfresco.constants.AVM_WEBAPP_URL = '").
append(JavaScriptUtils.javaScriptEscape(AVMUtil.buildWebappUrl(AVMUtil.getCorrespondingPreviewStoreName(avmBrowseBean.getSandbox()),
avmBrowseBean.getWebapp()))).
append("';\n");
String avmWebApp = avmBrowseBean.getWebapp();
// TODO - need better way to determine WCM vs ECM context
js.append("alfresco.constants.AVM_WEBAPP_CONTEXT = '");
if (avmWebApp != null)
{
js.append(JavaScriptUtils.javaScriptEscape(avmWebApp));
}
js.append("';\n");
// TODO - need better way to determine WCM vs ECM context
js.append("alfresco.constants.AVM_WEBAPP_URL = '");
if (avmWebApp != null)
{
String storeName = avmBrowseBean.getSandbox();
if (storeName != null)
{
js.append(JavaScriptUtils.javaScriptEscape(AVMUtil.buildWebappUrl(AVMUtil.getCorrespondingPreviewStoreName(storeName), avmBrowseBean.getWebapp())));
}
}
js.append("';\n");
js.append("alfresco.xforms.constants.XFORMS_UI_DIV_ID = '").
append(xformsUIDivId).
append("';\n");

View File

@@ -718,6 +718,51 @@
<property-name>dictionaryService</property-name>
<value>#{DictionaryService}</value>
</managed-property>
<managed-property>
<property-name>formsService</property-name>
<value>#{FormsService}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>
The bean that backs up the Edit Content Wizard
</description>
<managed-bean-name>EditContentWizard</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.content.EditContentWizard</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
<managed-property>
<property-name>fileFolderService</property-name>
<value>#{FileFolderService}</value>
</managed-property>
<managed-property>
<property-name>searchService</property-name>
<value>#{SearchService}</value>
</managed-property>
<managed-property>
<property-name>navigator</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>browseBean</property-name>
<value>#{BrowseBean}</value>
</managed-property>
<managed-property>
<property-name>contentService</property-name>
<value>#{ContentService}</value>
</managed-property>
<managed-property>
<property-name>dictionaryService</property-name>
<value>#{DictionaryService}</value>
</managed-property>
<managed-property>
<property-name>formsService</property-name>
<value>#{FormsService}</value>
</managed-property>
</managed-bean>
<managed-bean>
@@ -2541,6 +2586,7 @@
</managed-bean>
<!-- ==================== WCM BEANS ==================== -->
<managed-bean>
<description>
The bean that backs up the Create XML Content Type Wizard
@@ -2639,6 +2685,104 @@
</managed-property>
</managed-bean>
<managed-bean>
<description>
The bean that backs up the Create XML Content Type Wizard (WCM)
</description>
<managed-bean-name>CreateWebFormWizard</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.wcm.CreateFormWizard</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
<managed-property>
<property-name>fileFolderService</property-name>
<value>#{FileFolderService}</value>
</managed-property>
<managed-property>
<property-name>searchService</property-name>
<value>#{SearchService}</value>
</managed-property>
<managed-property>
<property-name>namespaceService</property-name>
<value>#{NamespaceService}</value>
</managed-property>
<managed-property>
<property-name>navigator</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>browseBean</property-name>
<value>#{BrowseBean}</value>
</managed-property>
<managed-property>
<property-name>contentService</property-name>
<value>#{ContentService}</value>
</managed-property>
<managed-property>
<property-name>mimetypeService</property-name>
<value>#{MimetypeService}</value>
</managed-property>
<managed-property>
<property-name>workflowService</property-name>
<value>#{WorkflowService}</value>
</managed-property>
<managed-property>
<property-name>formsService</property-name>
<value>#{FormsService}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>
The bean that backs up the Edit Web Form Wizard (WCM)
</description>
<managed-bean-name>EditWebFormWizard</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.wcm.EditFormWizard</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
<managed-property>
<property-name>fileFolderService</property-name>
<value>#{FileFolderService}</value>
</managed-property>
<managed-property>
<property-name>searchService</property-name>
<value>#{SearchService}</value>
</managed-property>
<managed-property>
<property-name>namespaceService</property-name>
<value>#{NamespaceService}</value>
</managed-property>
<managed-property>
<property-name>navigator</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>browseBean</property-name>
<value>#{BrowseBean}</value>
</managed-property>
<managed-property>
<property-name>contentService</property-name>
<value>#{ContentService}</value>
</managed-property>
<managed-property>
<property-name>mimetypeService</property-name>
<value>#{MimetypeService}</value>
</managed-property>
<managed-property>
<property-name>workflowService</property-name>
<value>#{WorkflowService}</value>
</managed-property>
<managed-property>
<property-name>formsService</property-name>
<value>#{FormsService}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>
The bean that backs up the Regenerate Renditions Wizard
@@ -4089,6 +4233,10 @@
<property-name>avmBrowseBean</property-name>
<value>#{AVMBrowseBean}</value>
</managed-property>
<managed-property>
<property-name>navigator</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>schema2XFormsProperties</property-name>
<value>#{Schema2XFormsProperties}</value>

View File

@@ -0,0 +1,48 @@
<!--
* Copyright (C) 2005-2007 Alfresco Software Limited.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
-->
<jsp:root version="1.2"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:wcm="urn:jsptld:/WEB-INF/wcm.tld"
xmlns:f="http://java.sun.com/jsf/core">
<script type="text/javascript">
function _xforms_getSubmitButtons()
{
return [ document.getElementById("wizard:next-button"),
document.getElementById("wizard:finish-button") ];
}
function _xforms_getSaveDraftButtons()
{
return [ document.getElementById("wizard:back-button") ];
}
</script>
<wcm:formProcessor id="form-data-renderer"
formProcessorSession="#{WizardManager.bean.formProcessorSession}"
formInstanceData="#{WizardManager.bean.instanceDataDocument}"
formInstanceDataName="#{WizardManager.bean.fileName}"
form="#{WizardManager.bean.form}"/>
</jsp:root>

View File

@@ -0,0 +1,32 @@
<%--
* Copyright (C) 2005-2007 Alfresco Software Limited.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<h:inputTextarea id="textArea" rows="24" cols="112" value="#{WizardManager.bean.content}" />

View File

@@ -47,12 +47,12 @@
if (document.getElementById("wizard:wizard-body:file-name").value.length == 0 )
{
document.getElementById("wizard:next-button").disabled = true;
document.getElementById("wizard:finish-button").disabled = true;
//document.getElementById("wizard:finish-button").disabled = true;
}
else
{
document.getElementById("wizard:next-button").disabled = false;
document.getElementById("wizard:finish-button").disabled = false;
//document.getElementById("wizard:finish-button").disabled = false;
}
}
@@ -99,6 +99,12 @@
valueChangeListener="#{WizardManager.bean.createContentChanged}">
<f:selectItems value="#{WizardManager.bean.createMimeTypes}" />
</h:selectOneMenu>
<h:outputText value=""/>
<h:outputText value="#{msg.form}:"/>
<h:selectOneMenu value="#{WizardManager.bean.formName}">
<f:selectItems value="#{WizardManager.bean.formsList}" />
</h:selectOneMenu>
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" style="padding-top: 4px;"

View File

@@ -0,0 +1,69 @@
<%--
* Copyright (C) 2005-2007 Alfresco Software Limited.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page isELIgnored="false" %>
<script type="text/javascript">
window.onload = function() { document.getElementById("wizard:finish-button").focus(); }
</script>
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
width="100%" rowClasses="wizardSectionHeading">
<h:outputText value="&nbsp;#{msg.general_properties}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
<a:selectList id="form-list"
multiSelect="false"
activeSelect="true"
style="width:100%"
itemStyle="vertical-align: top; margin-right: 5px;">
<a:listItem label="<b>${WizardManager.bean.formTitle}</b>"
value="${WizardManager.bean.formName}"
image="/images/icons/webform_large.gif">
<jsp:attribute name="description">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.description}:</td>
<td>
<c:choose>
<c:when test="${empty WizardManager.bean.formDescription}">
<span style="font-style:italic">${msg.description_not_set}</span>
</c:when>
<c:otherwise>${WizardManager.bean.formDescription}</c:otherwise>
</c:choose>
</td>
</tr>
<tr><td>${msg.schema_root_element_name}:</td><td>${WizardManager.bean.schemaRootElementName}</td></tr>
<tr><td>${msg.output_path_pattern}:</td><td>${WizardManager.bean.outputPathPatternForFormInstanceData}</td></tr>
</tbody>
</table>
</jsp:attribute>
</a:listItem>
</a:selectList>
</h:panelGrid>

View File

@@ -0,0 +1,150 @@
<%--
* Copyright (C) 2005-2007 Alfresco Software Limited.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page isELIgnored="false" %>
<script type="text/javascript">
window.onload = function() { document.getElementById("wizard:finish-button").focus(); }
</script>
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
width="100%" rowClasses="wizardSectionHeading">
<h:outputText value="&nbsp;#{msg.general_properties}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
<a:selectList id="form-list"
multiSelect="false"
activeSelect="true"
style="width:100%"
itemStyle="vertical-align: top; margin-right: 5px;">
<a:listItem label="<b>${WizardManager.bean.formTitle}</b>"
value="${WizardManager.bean.formName}"
image="/images/icons/webform_large.gif">
<jsp:attribute name="description">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.description}:</td>
<td>
<c:choose>
<c:when test="${empty WizardManager.bean.formDescription}">
<span style="font-style:italic">${msg.description_not_set}</span>
</c:when>
<c:otherwise>${WizardManager.bean.formDescription}</c:otherwise>
</c:choose>
</td>
</tr>
<tr><td>${msg.schema_root_element_name}:</td><td>${WizardManager.bean.schemaRootElementName}</td></tr>
<tr><td>${msg.output_path_pattern}:</td><td>${WizardManager.bean.outputPathPatternForFormInstanceData}</td></tr>
</tbody>
</table>
</jsp:attribute>
</a:listItem>
</a:selectList>
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
width="100%" rowClasses="wizardSectionHeading">
<h:outputText value="&nbsp;#{msg.rendering_engine_templates}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
<h:outputText rendered="#{empty WizardManager.bean.renderingEngineTemplates}"
value="#{msg.no_selected_items}"/>
<a:selectList id="rendering-engine-template-list"
multiSelect="false"
itemStyle="vertical-align: top; margin-right: 5px;"
activeSelect="true"
style="width:100%">
<c:forEach items="${WizardManager.bean.renderingEngineTemplates}" var="ret">
<a:listItem label="<b>${ret.title}</b>"
value="${ret.name}"
image="/images/icons/template_large.gif">
<jsp:attribute name="description">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.description}:</td>
<td>
<c:choose>
<c:when test="${empty ret.description}">
<span style="font-style:italic">${msg.description_not_set}</span>
</c:when>
<c:otherwise>${ret.description}</c:otherwise>
</c:choose>
</td>
</tr>
<tr><td>${msg.rendering_engine_type}:</td><td>${ret.renderingEngine.name}</td></tr>
<tr><td>${msg.output_path_pattern}:</td><td>${ret.outputPathPatternForRendition}</td></tr>
<tr><td>${msg.mimetype_for_renditions}:</td><td>${ret.mimetypeForRendition}</td></tr>
</tbody>
</table>
</jsp:attribute>
</a:listItem>
</c:forEach>
</a:selectList>
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
width="100%" rowClasses="wizardSectionHeading">
<h:outputText value="&nbsp;#{msg.default_workflow}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
<h:outputText value="#{msg.no_selected_items}"
rendered="#{WizardManager.bean.defaultWorkflowDefinition == null}"/>
<a:selectList id="workflow-list"
rendered="#{WizardManager.bean.defaultWorkflowDefinition != null}"
multiSelect="false"
activeSelect="true"
itemStyle="vertical-align: top; margin-right: 5px;"
style="width:100%">
<a:listItem label="<b>${WizardManager.bean.defaultWorkflowDefinition.title}</b>"
value="${WizardManager.bean.defaultWorkflowDefinition.name}"
image="/images/icons/workflow_large.gif">
<jsp:attribute name="description">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.description}:</td>
<td>
<c:choose>
<c:when test="${empty WizardManager.bean.defaultWorkflowDefinition.description}">
<span style="font-style:italic">${msg.description_not_set}</span>
</c:when>
<c:otherwise>${WizardManager.bean.defaultWorkflowDefinition.description}</c:otherwise>
</c:choose>
</td>
</tr>
</tbody>
</table>
</jsp:attribute>
</a:listItem>
</a:selectList>
</h:panelGrid>

View File

@@ -106,7 +106,7 @@
</h:selectOneMenu>
<h:outputText value=""/>
<h:outputText value="#{msg.form}:"/>
<h:outputText value="#{msg.web_form}:"/>
<h:selectOneMenu value="#{WizardManager.bean.formName}"
disabled="#{WizardManager.bean.formSelectDisabled}"
rendered="#{!empty WizardManager.bean.formChoices}">

View File

@@ -72,7 +72,7 @@
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.form}:</td><td>${WizardManager.bean.form.title}</td></tr>
<tr><td>${msg.web_form}:</td><td>${WizardManager.bean.form.title}</td></tr>
<tr><td>${msg.location}:</td><td>${WizardManager.bean.formInstanceData.sandboxRelativePath}</td></tr>
</tbody>
</table>

View File

@@ -39,7 +39,7 @@
</h:panelGrid>
<h:panelGrid columns="3" cellpadding="3" cellspacing="3" border="0">
<h:graphicImage value="/images/icons/required_field.gif" alt="#{msg.required_field}" />
<h:outputText value="#{msg.form}:"/>
<h:outputText value="#{msg.web_form}:"/>
<h:selectOneMenu value="#{DialogManager.bean.formName}"
rendered="#{!empty DialogManager.bean.formChoices}">
<f:selectItems value="#{DialogManager.bean.formChoices}" />

View File

@@ -79,7 +79,7 @@
columnClasses="panelGridRequiredImageColumn,panelGridLabelColumn,panelGridValueColumn">
<h:graphicImage value="/images/icons/required_field.gif"
alt="#{msg.required_field}" />
<h:outputText value="#{msg.form}:"/>
<h:outputText value="#{msg.web_form}:"/>
<a:selectList id="select_list_form_choices"
style="width:100%;"
onchange="this.form.submit()"

View File

@@ -508,6 +508,9 @@ alfresco.xforms.FilePicker = alfresco.xforms.Widget.extend({
this.parent(xform, xformsNode);
this._selectableTypes = "selectable_types" in params ? params["selectable_types"].split(",") : null;
this._filterMimetypes = "filter_mimetypes" in params ? params["filter_mimetypes"].split(",") : [];
// JanV - temp
this._dirPath = "dir_path" in params ? params["dir_path"] : null;
},
/////////////////////////////////////////////////////////////////
@@ -527,7 +530,8 @@ alfresco.xforms.FilePicker = alfresco.xforms.Widget.extend({
null /* cancel is ignored */,
this._filePicker_resizeHandler.bindAsEventListener(this),
this._selectableTypes,
this._filterMimetypes);
this._filterMimetypes,
this._dirPath);
this.widget.render();
},