mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
"Create from existing Web Project" added to the Create Web Project wizard
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7004 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -979,6 +979,12 @@ website_dnsname=DNS name
|
|||||||
website_deployto=Deploy To
|
website_deployto=Deploy To
|
||||||
validation_invalid_dns_name=Invalid website DNS name: only alpha-numeric and non-initial/final hyphen characters are allowed (max length < 64).
|
validation_invalid_dns_name=Invalid website DNS name: only alpha-numeric and non-initial/final hyphen characters are allowed (max length < 64).
|
||||||
website_webapp=Default Webapp
|
website_webapp=Default Webapp
|
||||||
|
website_createfrom=Create From Existing Web Project
|
||||||
|
create_website_step2_title=Step Two - Create From Existing Web Project
|
||||||
|
create_website_step2_desc=Optionally select an existing project to be used as the template for this website
|
||||||
|
website_create_empty=Create a new empty Web Project
|
||||||
|
website_create_existing=Create a Web Project based on an existing one. The Staging Sandbox structure, Web Forms, Workflow and Users will be copied from the selected Web Project
|
||||||
|
website_sourcewebsite=Created from Web Project
|
||||||
website_selected_forms=Selected Web Content Forms
|
website_selected_forms=Selected Web Content Forms
|
||||||
website_web_content_forms=Web Content Forms
|
website_web_content_forms=Web Content Forms
|
||||||
website_save_location=Save Location
|
website_save_location=Save Location
|
||||||
@@ -996,22 +1002,22 @@ form_template_templates=Configure Templates
|
|||||||
form_template_templates_desc=Setup the Templates you want to use for the Web Form {0} in Web Project {1}.
|
form_template_templates_desc=Setup the Templates you want to use for the Web Form {0} in Web Project {1}.
|
||||||
form_template_workflow=Configure Workflow
|
form_template_workflow=Configure Workflow
|
||||||
form_template_workflow_desc=Configure the workflow defaults for this Web Project
|
form_template_workflow_desc=Configure the workflow defaults for this Web Project
|
||||||
create_website_step2_title=Step Two - Configure Web Content Forms
|
create_website_step3_title=Step Three - Configure Web Content Forms
|
||||||
create_website_step2_desc=Select and configure web forms for generating site content.
|
create_website_step3_desc=Select and configure web forms for generating site content.
|
||||||
website_select_form=Select Web Forms
|
website_select_form=Select Web Forms
|
||||||
website_select_templates=Select Templates
|
website_select_templates=Select Templates
|
||||||
website_selected_templates=Selected Templates
|
website_selected_templates=Selected Templates
|
||||||
website_settings=Configure Workflow
|
website_settings=Configure Workflow
|
||||||
create_website_step3_title=Step Three - Configure Workflow
|
create_website_step4_title=Step Four - Configure Workflow
|
||||||
create_website_step3_desc=Select and configure workflow for non-form generated assets.
|
create_website_step4_desc=Select and configure workflow for non-form generated assets.
|
||||||
website_select_workflows=Select Workflows
|
website_select_workflows=Select Workflows
|
||||||
website_selected_workflows=Selected Workflows
|
website_selected_workflows=Selected Workflows
|
||||||
website_invite=Add Users
|
website_invite=Add Users
|
||||||
create_website_step4_title=Step Four - Add Users
|
create_website_step5_title=Step Five - Add Users
|
||||||
create_website_step4_desc=Select users and their roles.
|
create_website_step5_desc=Select users and their roles.
|
||||||
website_notify=Email Users
|
website_notify=Email Users
|
||||||
create_website_step5_title=Step Five - Email Users
|
create_website_step6_title=Step Six - Email Users
|
||||||
create_website_step5_desc=Notify the invited users.
|
create_website_step6_desc=Notify the website users.
|
||||||
create_website_finish_instruction=To close this wizard and create your web project space click Finish. To review or change your selections click Back.
|
create_website_finish_instruction=To close this wizard and create your web project space click Finish. To review or change your selections click Back.
|
||||||
create_website_summary_users=Users and Roles
|
create_website_summary_users=Users and Roles
|
||||||
edit_website_title=Edit Web Project Wizard
|
edit_website_title=Edit Web Project Wizard
|
||||||
|
@@ -596,7 +596,7 @@
|
|||||||
<property-sheet>
|
<property-sheet>
|
||||||
<show-property name="wca:avmstore" read-only="true" />
|
<show-property name="wca:avmstore" read-only="true" />
|
||||||
<show-property name="wca:defaultwebapp" read-only="true" />
|
<show-property name="wca:defaultwebapp" read-only="true" />
|
||||||
<show-property name="wca:deployto" read-only="true" />
|
<show-property name="wca:deployto" converter="org.alfresco.faces.MultiValueConverter" read-only="true" />
|
||||||
<show-property name="app:icon" show-in-view-mode="false" show-in-edit-mode="false" />
|
<show-property name="app:icon" show-in-view-mode="false" show-in-edit-mode="false" />
|
||||||
</property-sheet>
|
</property-sheet>
|
||||||
</config>
|
</config>
|
||||||
|
@@ -16,30 +16,36 @@
|
|||||||
description-id="create_website_step1_desc"
|
description-id="create_website_step1_desc"
|
||||||
instruction-id="default_instruction" />
|
instruction-id="default_instruction" />
|
||||||
</step>
|
</step>
|
||||||
<step name="forms" title-id="website_forms" description-id="create_website_step2_desc">
|
<step name="createfrom" title-id="website_createfrom" description-id="create_website_step2_desc">
|
||||||
<page path="/jsp/wcm/create-website-wizard/forms.jsp"
|
<page path="/jsp/wcm/create-website-wizard/create-from.jsp"
|
||||||
title-id="create_website_step2_title"
|
title-id="create_website_step2_title"
|
||||||
description-id="create_website_step2_desc"
|
description-id="create_website_step2_desc"
|
||||||
instruction-id="default_instruction" />
|
instruction-id="default_instruction" />
|
||||||
</step>
|
</step>
|
||||||
<step name="settings" title-id="website_settings" description-id="create_website_step3_desc">
|
<step name="forms" title-id="website_forms" description-id="create_website_step3_desc">
|
||||||
<page path="/jsp/wcm/create-website-wizard/settings.jsp"
|
<page path="/jsp/wcm/create-website-wizard/forms.jsp"
|
||||||
title-id="create_website_step3_title"
|
title-id="create_website_step3_title"
|
||||||
description-id="create_website_step3_desc"
|
description-id="create_website_step3_desc"
|
||||||
instruction-id="default_instruction" />
|
instruction-id="default_instruction" />
|
||||||
</step>
|
</step>
|
||||||
<step name="invite" title-id="website_invite" description-id="create_website_step4_desc">
|
<step name="settings" title-id="website_settings" description-id="create_website_step4_desc">
|
||||||
<page path="/jsp/wcm/create-website-wizard/invite.jsp"
|
<page path="/jsp/wcm/create-website-wizard/settings.jsp"
|
||||||
title-id="create_website_step4_title"
|
title-id="create_website_step4_title"
|
||||||
description-id="create_website_step4_desc"
|
description-id="create_website_step4_desc"
|
||||||
instruction-id="default_instruction" />
|
instruction-id="default_instruction" />
|
||||||
</step>
|
</step>
|
||||||
<step name="notify" title-id="website_notify" description-id="create_website_step5_desc">
|
<step name="invite" title-id="website_invite" description-id="create_website_step5_desc">
|
||||||
<page path="/jsp/wcm/create-website-wizard/notify.jsp"
|
<page path="/jsp/wcm/create-website-wizard/invite.jsp"
|
||||||
title-id="create_website_step5_title"
|
title-id="create_website_step5_title"
|
||||||
description-id="create_website_step5_desc"
|
description-id="create_website_step5_desc"
|
||||||
instruction-id="default_instruction" />
|
instruction-id="default_instruction" />
|
||||||
</step>
|
</step>
|
||||||
|
<step name="notify" title-id="website_notify" description-id="create_website_step6_desc">
|
||||||
|
<page path="/jsp/wcm/create-website-wizard/notify.jsp"
|
||||||
|
title-id="create_website_step6_title"
|
||||||
|
description-id="create_website_step6_desc"
|
||||||
|
instruction-id="default_instruction" />
|
||||||
|
</step>
|
||||||
<step name="summary" title-id="summary" description-id="summary_step_description">
|
<step name="summary" title-id="summary" description-id="summary_step_description">
|
||||||
<page path="/jsp/wcm/create-website-wizard/summary.jsp"
|
<page path="/jsp/wcm/create-website-wizard/summary.jsp"
|
||||||
title-id="summary"
|
title-id="summary"
|
||||||
|
@@ -42,24 +42,33 @@ import org.alfresco.model.ApplicationModel;
|
|||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.model.WCMAppModel;
|
import org.alfresco.model.WCMAppModel;
|
||||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||||
|
import org.alfresco.repo.cache.ExpiringValueCache;
|
||||||
import org.alfresco.service.cmr.avm.AVMService;
|
import org.alfresco.service.cmr.avm.AVMService;
|
||||||
import org.alfresco.service.cmr.avm.locking.AVMLockingService;
|
import org.alfresco.service.cmr.avm.locking.AVMLockingService;
|
||||||
import org.alfresco.service.cmr.model.FileInfo;
|
import org.alfresco.service.cmr.model.FileInfo;
|
||||||
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.alfresco.service.cmr.search.ResultSet;
|
||||||
|
import org.alfresco.service.cmr.search.ResultSetRow;
|
||||||
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
import org.alfresco.service.cmr.security.AuthorityType;
|
import org.alfresco.service.cmr.security.AuthorityType;
|
||||||
import org.alfresco.service.cmr.security.PermissionService;
|
import org.alfresco.service.cmr.security.PermissionService;
|
||||||
import org.alfresco.service.cmr.security.PersonService;
|
import org.alfresco.service.cmr.security.PersonService;
|
||||||
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
|
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
|
||||||
import org.alfresco.service.cmr.workflow.WorkflowService;
|
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||||
|
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.util.DNSNameMangler;
|
import org.alfresco.util.DNSNameMangler;
|
||||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.app.servlet.FacesHelper;
|
import org.alfresco.web.app.servlet.FacesHelper;
|
||||||
import org.alfresco.web.bean.repository.Node;
|
import org.alfresco.web.bean.repository.Node;
|
||||||
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
import org.alfresco.web.bean.wizard.BaseWizardBean;
|
import org.alfresco.web.bean.wizard.BaseWizardBean;
|
||||||
import org.alfresco.web.bean.wizard.InviteUsersWizard.UserGroupRole;
|
import org.alfresco.web.bean.wizard.InviteUsersWizard.UserGroupRole;
|
||||||
import org.alfresco.web.forms.Form;
|
import org.alfresco.web.forms.Form;
|
||||||
|
import org.alfresco.web.forms.FormNotFoundException;
|
||||||
import org.alfresco.web.forms.FormsService;
|
import org.alfresco.web.forms.FormsService;
|
||||||
import org.alfresco.web.forms.RenderingEngineTemplate;
|
import org.alfresco.web.forms.RenderingEngineTemplate;
|
||||||
import org.alfresco.web.ui.common.component.UIListItem;
|
import org.alfresco.web.ui.common.component.UIListItem;
|
||||||
@@ -75,15 +84,23 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
*/
|
*/
|
||||||
public class CreateWebsiteWizard extends BaseWizardBean
|
public class CreateWebsiteWizard extends BaseWizardBean
|
||||||
{
|
{
|
||||||
|
private static final String MSG_DEPLOY_TO_HELP = "deploy_to_help";
|
||||||
private static final String MSG_USERROLES = "create_website_summary_users";
|
private static final String MSG_USERROLES = "create_website_summary_users";
|
||||||
|
|
||||||
private static final String COMPONENT_FORMLIST = "form-list";
|
private static final String COMPONENT_FORMLIST = "form-list";
|
||||||
private static final String COMPONENT_WORKFLOWLIST = "workflow-list";
|
private static final String COMPONENT_WORKFLOWLIST = "workflow-list";
|
||||||
|
|
||||||
|
// wizard step names (that are referenced)
|
||||||
|
private static final String STEP_FORMS = "forms";
|
||||||
|
|
||||||
private static final String MATCH_DEFAULT = ".*";
|
private static final String MATCH_DEFAULT = ".*";
|
||||||
|
|
||||||
private static final String WEBAPP_DEFAULT = "ROOT";
|
private static final String WEBAPP_DEFAULT = "ROOT";
|
||||||
|
|
||||||
|
// Create From drop-down control selection values
|
||||||
|
private static final String CREATE_EMPTY = "empty";
|
||||||
|
private static final String CREATE_EXISTING = "existing";
|
||||||
|
|
||||||
protected final static Log logger = LogFactory.getLog(CreateWebsiteWizard.class);
|
protected final static Log logger = LogFactory.getLog(CreateWebsiteWizard.class);
|
||||||
|
|
||||||
protected boolean editMode = false;
|
protected boolean editMode = false;
|
||||||
@@ -94,6 +111,9 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
|||||||
protected String description;
|
protected String description;
|
||||||
protected String webapp = WEBAPP_DEFAULT;
|
protected String webapp = WEBAPP_DEFAULT;
|
||||||
protected List<String> deployTo;
|
protected List<String> deployTo;
|
||||||
|
protected String createFrom = null;
|
||||||
|
protected String[] sourceWebProject = null;
|
||||||
|
protected ExpiringValueCache<List<UIListItem>> webProjectsList;
|
||||||
|
|
||||||
protected AVMService avmService;
|
protected AVMService avmService;
|
||||||
protected WorkflowService workflowService;
|
protected WorkflowService workflowService;
|
||||||
@@ -101,6 +121,10 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
|||||||
protected AVMLockingService avmLockingService;
|
protected AVMLockingService avmLockingService;
|
||||||
protected FormsService formsService;
|
protected FormsService formsService;
|
||||||
|
|
||||||
|
/** set true when an option in the Create From screen is changed - this is used as an
|
||||||
|
indicator to reload the wizard data model from the selected source web project */
|
||||||
|
private boolean createFromValueChanged;
|
||||||
|
|
||||||
/** datamodel for table of selected forms */
|
/** datamodel for table of selected forms */
|
||||||
protected DataModel formsDataModel = null;
|
protected DataModel formsDataModel = null;
|
||||||
|
|
||||||
@@ -144,6 +168,16 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
|||||||
this.title = null;
|
this.title = null;
|
||||||
this.description = null;
|
this.description = null;
|
||||||
this.deployTo = null;
|
this.deployTo = null;
|
||||||
|
clearFormsWorkflowsAndUsers();
|
||||||
|
this.createFrom = CREATE_EMPTY;
|
||||||
|
// requry existing web projects list every 10 seconds
|
||||||
|
this.webProjectsList = new ExpiringValueCache<List<UIListItem>>(1000L*10L);
|
||||||
|
this.sourceWebProject = null;
|
||||||
|
this.createFromValueChanged = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clearFormsWorkflowsAndUsers()
|
||||||
|
{
|
||||||
this.formsDataModel = null;
|
this.formsDataModel = null;
|
||||||
this.forms = new ArrayList<FormWrapper>(8);
|
this.forms = new ArrayList<FormWrapper>(8);
|
||||||
this.workflowsDataModel = null;
|
this.workflowsDataModel = null;
|
||||||
@@ -200,15 +234,27 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
|||||||
outcome = wiz.finish();
|
outcome = wiz.finish();
|
||||||
if (outcome != null)
|
if (outcome != null)
|
||||||
{
|
{
|
||||||
|
// if the user selected Create From existing web project we will branch from it
|
||||||
|
String branchStoreId = null;
|
||||||
|
if (CREATE_EXISTING.equals(this.createFrom) &&
|
||||||
|
(this.sourceWebProject != null && this.sourceWebProject.length != 0))
|
||||||
|
{
|
||||||
|
NodeRef sourceNodeRef = new NodeRef(this.sourceWebProject[0]);
|
||||||
|
branchStoreId = (String)this.nodeService.getProperty(sourceNodeRef, WCMAppModel.PROP_AVMSTORE);
|
||||||
|
}
|
||||||
|
|
||||||
// create the AVM staging store to represent the newly created location website
|
// create the AVM staging store to represent the newly created location website
|
||||||
this.sandboxInfo = SandboxFactory.createStagingSandbox(avmStore, nodeRef);
|
this.sandboxInfo = SandboxFactory.createStagingSandbox(avmStore, nodeRef, branchStoreId);
|
||||||
|
|
||||||
// create the default webapp folder under the hidden system folders
|
// create the default webapp folder under the hidden system folders
|
||||||
|
if (branchStoreId == null)
|
||||||
|
{
|
||||||
final String stagingStore = AVMUtil.buildStagingStoreName(avmStore);
|
final String stagingStore = AVMUtil.buildStagingStoreName(avmStore);
|
||||||
final String stagingStoreRoot = AVMUtil.buildSandboxRootPath(stagingStore);
|
final String stagingStoreRoot = AVMUtil.buildSandboxRootPath(stagingStore);
|
||||||
this.avmService.createDirectory(stagingStoreRoot, webapp);
|
this.avmService.createDirectory(stagingStoreRoot, webapp);
|
||||||
this.avmService.addAspect(AVMNodeConverter.ExtendAVMPath(stagingStoreRoot, webapp),
|
this.avmService.addAspect(AVMNodeConverter.ExtendAVMPath(stagingStoreRoot, webapp),
|
||||||
WCMAppModel.ASPECT_WEBAPP);
|
WCMAppModel.ASPECT_WEBAPP);
|
||||||
|
}
|
||||||
|
|
||||||
// set the property on the node to reference the root AVM store
|
// set the property on the node to reference the root AVM store
|
||||||
this.nodeService.setProperty(nodeRef, WCMAppModel.PROP_AVMSTORE, avmStore);
|
this.nodeService.setProperty(nodeRef, WCMAppModel.PROP_AVMSTORE, avmStore);
|
||||||
@@ -351,6 +397,132 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restore the forms, templates and workflows from the model for a web project. Can also
|
||||||
|
* optional restore the basic node propetries and user details.
|
||||||
|
*
|
||||||
|
* @param nodeRef NodeRef to the web project to load model from
|
||||||
|
* @param loadProperties Load the basic properties such as name, title, DNS.
|
||||||
|
* @param loadUsers Load the user details.
|
||||||
|
*/
|
||||||
|
protected void loadWebProjectModel(NodeRef nodeRef, boolean loadProperties, boolean loadUsers)
|
||||||
|
{
|
||||||
|
// simple properties are optionally loaded
|
||||||
|
if (loadProperties)
|
||||||
|
{
|
||||||
|
Map<QName, Serializable> props = this.nodeService.getProperties(nodeRef);
|
||||||
|
this.name = (String)props.get(ContentModel.PROP_NAME);
|
||||||
|
this.title = (String)props.get(ContentModel.PROP_TITLE);
|
||||||
|
this.description = (String)props.get(ContentModel.PROP_DESCRIPTION);
|
||||||
|
this.dnsName = (String)props.get(WCMAppModel.PROP_AVMSTORE);
|
||||||
|
this.webapp = (String)props.get(WCMAppModel.PROP_DEFAULTWEBAPP);
|
||||||
|
this.deployTo = (List<String>)props.get(WCMAppModel.PROP_DEPLOYTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loadUsers)
|
||||||
|
{
|
||||||
|
InviteWebsiteUsersWizard wiz = getInviteUsersWizard();
|
||||||
|
wiz.reset();
|
||||||
|
|
||||||
|
// load the users assigned to the web project
|
||||||
|
List<ChildAssociationRef> userInfoRefs = this.nodeService.getChildAssocs(
|
||||||
|
nodeRef, WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL);
|
||||||
|
for (ChildAssociationRef ref : userInfoRefs)
|
||||||
|
{
|
||||||
|
NodeRef userRef = ref.getChildRef();
|
||||||
|
String username = (String)this.nodeService.getProperty(userRef, WCMAppModel.PROP_WEBUSERNAME);
|
||||||
|
String userrole = (String)this.nodeService.getProperty(userRef, WCMAppModel.PROP_WEBUSERROLE);
|
||||||
|
wiz.addAuthorityWithRole(username, userrole);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// load the form templates
|
||||||
|
List<ChildAssociationRef> webFormRefs = this.nodeService.getChildAssocs(
|
||||||
|
nodeRef, WCMAppModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL);
|
||||||
|
for (ChildAssociationRef ref : webFormRefs)
|
||||||
|
{
|
||||||
|
NodeRef formRef = ref.getChildRef();
|
||||||
|
|
||||||
|
String name = (String)this.nodeService.getProperty(formRef, WCMAppModel.PROP_FORMNAME);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Form formImpl = this.formsService.getForm(name);
|
||||||
|
FormWrapper form = new FormWrapper(formImpl);
|
||||||
|
form.setTitle((String)this.nodeService.getProperty(formRef, ContentModel.PROP_TITLE));
|
||||||
|
form.setDescription((String)this.nodeService.getProperty(formRef, ContentModel.PROP_DESCRIPTION));
|
||||||
|
form.setOutputPathPattern((String)this.nodeService.getProperty(formRef, WCMAppModel.PROP_OUTPUT_PATH_PATTERN));
|
||||||
|
|
||||||
|
// the single workflow attached to the form
|
||||||
|
List<ChildAssociationRef> workflowRefs = this.nodeService.getChildAssocs(
|
||||||
|
formRef, WCMAppModel.ASSOC_WORKFLOWDEFAULTS, RegexQNamePattern.MATCH_ALL);
|
||||||
|
if (workflowRefs.size() == 1)
|
||||||
|
{
|
||||||
|
NodeRef wfRef = workflowRefs.get(0).getChildRef();
|
||||||
|
String wfName = (String)this.nodeService.getProperty(wfRef, WCMAppModel.PROP_WORKFLOW_NAME);
|
||||||
|
WorkflowDefinition wfDef = this.workflowService.getDefinitionByName(wfName);
|
||||||
|
if (wfDef != null)
|
||||||
|
{
|
||||||
|
WorkflowWrapper wfWrapper = new WorkflowWrapper(wfName, wfDef.getTitle(), wfDef.getDescription());
|
||||||
|
wfWrapper.setParams((Map<QName, Serializable>)AVMWorkflowUtil.deserializeWorkflowParams(wfRef));
|
||||||
|
if (wfDef.startTaskDefinition != null)
|
||||||
|
{
|
||||||
|
wfWrapper.setType(wfDef.startTaskDefinition.metadata.getName());
|
||||||
|
}
|
||||||
|
form.setWorkflow(wfWrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// the templates attached to the form
|
||||||
|
List<ChildAssociationRef> templateRefs = this.nodeService.getChildAssocs(
|
||||||
|
formRef, WCMAppModel.ASSOC_WEBFORMTEMPLATE, RegexQNamePattern.MATCH_ALL);
|
||||||
|
for (ChildAssociationRef tChildRef : templateRefs)
|
||||||
|
{
|
||||||
|
NodeRef templateRef = tChildRef.getChildRef();
|
||||||
|
String renderingEngineTemplateName = (String)this.nodeService.getProperty(
|
||||||
|
templateRef, WCMAppModel.PROP_BASE_RENDERING_ENGINE_TEMPLATE_NAME);
|
||||||
|
RenderingEngineTemplate ret = formImpl.getRenderingEngineTemplate(renderingEngineTemplateName);
|
||||||
|
if (ret != null)
|
||||||
|
{
|
||||||
|
String outputPathPattern = (String)this.nodeService.getProperty(
|
||||||
|
templateRef, WCMAppModel.PROP_OUTPUT_PATH_PATTERN);
|
||||||
|
form.addTemplate(new PresentationTemplate(ret, outputPathPattern));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.forms.add(form);
|
||||||
|
}
|
||||||
|
catch (FormNotFoundException fnfe)
|
||||||
|
{
|
||||||
|
// ignore as we cannot do anything about a missing form
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
logger.debug("Unable to find Web Form named '" + fnfe.getFormName() +
|
||||||
|
"' as referenced in web project: " + nodeRef.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// load the workflows associated with the website
|
||||||
|
List<ChildAssociationRef> workflowRefs = this.nodeService.getChildAssocs(
|
||||||
|
nodeRef, WCMAppModel.ASSOC_WEBWORKFLOWDEFAULTS, RegexQNamePattern.MATCH_ALL);
|
||||||
|
for (ChildAssociationRef wChildRef : workflowRefs)
|
||||||
|
{
|
||||||
|
NodeRef wfRef = wChildRef.getChildRef();
|
||||||
|
String wfName = (String)this.nodeService.getProperty(wfRef, WCMAppModel.PROP_WORKFLOW_NAME);
|
||||||
|
WorkflowDefinition wfDef = this.workflowService.getDefinitionByName(wfName);
|
||||||
|
if (wfDef != null)
|
||||||
|
{
|
||||||
|
WorkflowWrapper wfWrapper = new WorkflowWrapper(wfName, wfDef.getTitle(), wfDef.getDescription());
|
||||||
|
wfWrapper.setParams((Map<QName, Serializable>)AVMWorkflowUtil.deserializeWorkflowParams(wfRef));
|
||||||
|
wfWrapper.setFilenamePattern((String)this.nodeService.getProperty(wfRef,
|
||||||
|
WCMAppModel.PROP_FILENAMEPATTERN));
|
||||||
|
if (wfDef.startTaskDefinition != null)
|
||||||
|
{
|
||||||
|
wfWrapper.setType(wfDef.startTaskDefinition.metadata.getName());
|
||||||
|
}
|
||||||
|
this.workflows.add(wfWrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Service setters
|
// Service setters
|
||||||
@@ -511,6 +683,119 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
|||||||
this.deployTo = deployTo;
|
this.deployTo = deployTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the create from selection value
|
||||||
|
*/
|
||||||
|
public String getCreateFrom()
|
||||||
|
{
|
||||||
|
return this.createFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param createFrom the create from selection value
|
||||||
|
*/
|
||||||
|
public void setCreateFrom(String createFrom)
|
||||||
|
{
|
||||||
|
if (createFrom != null && createFrom.equals(this.createFrom) == false)
|
||||||
|
{
|
||||||
|
this.createFromValueChanged = true;
|
||||||
|
}
|
||||||
|
this.createFrom = createFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the existing Web Project to use
|
||||||
|
*/
|
||||||
|
public String[] getSourceWebProject()
|
||||||
|
{
|
||||||
|
return this.sourceWebProject;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param existingWebProject the existing Web Project to set
|
||||||
|
*/
|
||||||
|
public void setSourceWebProject(String[] existingWebProject)
|
||||||
|
{
|
||||||
|
if (this.sourceWebProject != null && this.sourceWebProject.length != 0)
|
||||||
|
{
|
||||||
|
if ((existingWebProject == null || existingWebProject.length == 0) ||
|
||||||
|
(existingWebProject[0].equals(this.sourceWebProject[0]) == false))
|
||||||
|
{
|
||||||
|
this.createFromValueChanged = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (existingWebProject != null || existingWebProject.length != 0)
|
||||||
|
{
|
||||||
|
this.createFromValueChanged = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.sourceWebProject = existingWebProject;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return name of the source web project selected - or null if none set
|
||||||
|
*/
|
||||||
|
public String getSourceWebProjectName()
|
||||||
|
{
|
||||||
|
String name = null;
|
||||||
|
if (CREATE_EXISTING.equals(this.createFrom) &&
|
||||||
|
(this.sourceWebProject != null && this.sourceWebProject.length != 0))
|
||||||
|
{
|
||||||
|
NodeRef sourceNodeRef = new NodeRef(this.sourceWebProject[0]);
|
||||||
|
name = (String)this.nodeService.getProperty(sourceNodeRef, ContentModel.PROP_NAME);
|
||||||
|
}
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the existingWebProjects
|
||||||
|
*/
|
||||||
|
public List<UIListItem> getWebProjectsList()
|
||||||
|
{
|
||||||
|
List<UIListItem> webProjects = this.webProjectsList.get();
|
||||||
|
if (webProjects == null)
|
||||||
|
{
|
||||||
|
FacesContext fc = FacesContext.getCurrentInstance();
|
||||||
|
|
||||||
|
// construct the query to retrieve all web projects
|
||||||
|
String path = Application.getRootPath(fc) + "/" + Application.getWebsitesFolderName(fc) + "/*";
|
||||||
|
String query = "PATH:\"/" + path + "\" +TYPE:\"{" + NamespaceService.WCMAPP_MODEL_1_0_URI + "}webfolder\"";
|
||||||
|
|
||||||
|
ResultSet results = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// execute the query
|
||||||
|
results = searchService.query(Repository.getStoreRef(),
|
||||||
|
SearchService.LANGUAGE_LUCENE, query);
|
||||||
|
webProjects = new ArrayList<UIListItem>(results.length());
|
||||||
|
for (ResultSetRow row : results)
|
||||||
|
{
|
||||||
|
NodeRef ref = row.getNodeRef();
|
||||||
|
String name = (String)this.nodeService.getProperty(ref, ContentModel.PROP_NAME);
|
||||||
|
String desc = (String)this.nodeService.getProperty(ref, ContentModel.PROP_DESCRIPTION);
|
||||||
|
UIListItem item = new UIListItem();
|
||||||
|
item.setLabel(name);
|
||||||
|
item.setDescription(desc);
|
||||||
|
item.setValue(ref.toString());
|
||||||
|
item.setImage(WebResources.IMAGE_WEBPROJECT_32);
|
||||||
|
webProjects.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (results != null)
|
||||||
|
{
|
||||||
|
results.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.webProjectsList.put(webProjects);
|
||||||
|
}
|
||||||
|
return webProjects;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the deploy to help text that gets displayed if the user
|
* @return the deploy to help text that gets displayed if the user
|
||||||
* clicks the Help icon
|
* clicks the Help icon
|
||||||
@@ -518,12 +803,44 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
|||||||
public String getDeployToHelp()
|
public String getDeployToHelp()
|
||||||
{
|
{
|
||||||
String pattern = Application.getMessage(FacesContext.getCurrentInstance(),
|
String pattern = Application.getMessage(FacesContext.getCurrentInstance(),
|
||||||
"deploy_to_help");
|
MSG_DEPLOY_TO_HELP);
|
||||||
String defaultAlfPort = Integer.toString(AVMUtil.getRemoteRMIRegistryPort());
|
String defaultAlfPort = Integer.toString(AVMUtil.getRemoteRMIRegistryPort());
|
||||||
String defaultReceiverPort = Integer.toString(AVMUtil.getRemoteReceiverRMIPort());
|
String defaultReceiverPort = Integer.toString(AVMUtil.getRemoteReceiverRMIPort());
|
||||||
return MessageFormat.format(pattern, new Object[] {defaultReceiverPort, defaultAlfPort});
|
return MessageFormat.format(pattern, new Object[] {defaultReceiverPort, defaultAlfPort});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.alfresco.web.bean.wizard.BaseWizardBean#next()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String next()
|
||||||
|
{
|
||||||
|
String stepName = Application.getWizardManager().getCurrentStepName();
|
||||||
|
if (STEP_FORMS.equals(stepName))
|
||||||
|
{
|
||||||
|
// if we have just entered the Forms page and the Create From page data has changed
|
||||||
|
// then we need to pre-populate the Forms etc. from the template web project
|
||||||
|
if (this.createFromValueChanged)
|
||||||
|
{
|
||||||
|
if (CREATE_EXISTING.equals(this.createFrom))
|
||||||
|
{
|
||||||
|
if (this.sourceWebProject != null && this.sourceWebProject.length != 0)
|
||||||
|
{
|
||||||
|
clearFormsWorkflowsAndUsers();
|
||||||
|
loadWebProjectModel(new NodeRef(this.sourceWebProject[0]), false, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clearFormsWorkflowsAndUsers();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.createFromValueChanged = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.next();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return summary text for the wizard
|
* @return summary text for the wizard
|
||||||
*/
|
*/
|
||||||
@@ -822,10 +1139,6 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
|
||||||
// Helper methods
|
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Inner classes
|
// Inner classes
|
||||||
|
|
||||||
|
@@ -34,14 +34,8 @@ import org.alfresco.model.ContentModel;
|
|||||||
import org.alfresco.model.WCMAppModel;
|
import org.alfresco.model.WCMAppModel;
|
||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
|
|
||||||
import org.alfresco.service.namespace.QName;
|
|
||||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||||
import org.alfresco.web.forms.Form;
|
|
||||||
import org.alfresco.web.forms.FormNotFoundException;
|
|
||||||
import org.alfresco.web.forms.FormsService;
|
|
||||||
import org.alfresco.web.forms.RenderingEngineTemplate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Backing bean for the Edit Web Project wizard.
|
* Backing bean for the Edit Web Project wizard.
|
||||||
@@ -69,109 +63,7 @@ public class EditWebsiteWizard extends CreateWebsiteWizard
|
|||||||
throw new IllegalArgumentException("Edit Web Project wizard requires action node context.");
|
throw new IllegalArgumentException("Edit Web Project wizard requires action node context.");
|
||||||
}
|
}
|
||||||
|
|
||||||
loadWebProjectModel(websiteRef);
|
loadWebProjectModel(websiteRef, true, false);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Restore the forms, templates and workflows from the model for this web project
|
|
||||||
*
|
|
||||||
* @param nodeRef NodeRef to the web project
|
|
||||||
*/
|
|
||||||
private void loadWebProjectModel(NodeRef nodeRef)
|
|
||||||
{
|
|
||||||
// simple properties
|
|
||||||
Map<QName, Serializable> props = this.nodeService.getProperties(nodeRef);
|
|
||||||
this.name = (String)props.get(ContentModel.PROP_NAME);
|
|
||||||
this.title = (String)props.get(ContentModel.PROP_TITLE);
|
|
||||||
this.description = (String)props.get(ContentModel.PROP_DESCRIPTION);
|
|
||||||
this.dnsName = (String)props.get(WCMAppModel.PROP_AVMSTORE);
|
|
||||||
this.webapp = (String)props.get(WCMAppModel.PROP_DEFAULTWEBAPP);
|
|
||||||
this.deployTo = (List<String>)props.get(WCMAppModel.PROP_DEPLOYTO);
|
|
||||||
|
|
||||||
// load the form templates
|
|
||||||
List<ChildAssociationRef> webFormRefs = this.nodeService.getChildAssocs(
|
|
||||||
nodeRef, WCMAppModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL);
|
|
||||||
for (ChildAssociationRef ref : webFormRefs)
|
|
||||||
{
|
|
||||||
NodeRef formRef = ref.getChildRef();
|
|
||||||
|
|
||||||
String name = (String)this.nodeService.getProperty(formRef, WCMAppModel.PROP_FORMNAME);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final Form formImpl = this.formsService.getForm(name);
|
|
||||||
FormWrapper form = new FormWrapper(formImpl);
|
|
||||||
form.setTitle((String)this.nodeService.getProperty(formRef, ContentModel.PROP_TITLE));
|
|
||||||
form.setDescription((String)this.nodeService.getProperty(formRef, ContentModel.PROP_DESCRIPTION));
|
|
||||||
form.setOutputPathPattern((String)this.nodeService.getProperty(formRef, WCMAppModel.PROP_OUTPUT_PATH_PATTERN));
|
|
||||||
|
|
||||||
// the single workflow attached to the form
|
|
||||||
List<ChildAssociationRef> workflowRefs = this.nodeService.getChildAssocs(
|
|
||||||
formRef, WCMAppModel.ASSOC_WORKFLOWDEFAULTS, RegexQNamePattern.MATCH_ALL);
|
|
||||||
if (workflowRefs.size() == 1)
|
|
||||||
{
|
|
||||||
NodeRef wfRef = workflowRefs.get(0).getChildRef();
|
|
||||||
String wfName = (String)this.nodeService.getProperty(wfRef, WCMAppModel.PROP_WORKFLOW_NAME);
|
|
||||||
WorkflowDefinition wfDef = this.workflowService.getDefinitionByName(wfName);
|
|
||||||
if (wfDef != null)
|
|
||||||
{
|
|
||||||
WorkflowWrapper wfWrapper = new WorkflowWrapper(wfName, wfDef.getTitle(), wfDef.getDescription());
|
|
||||||
wfWrapper.setParams((Map<QName, Serializable>)AVMWorkflowUtil.deserializeWorkflowParams(wfRef));
|
|
||||||
if (wfDef.startTaskDefinition != null)
|
|
||||||
{
|
|
||||||
wfWrapper.setType(wfDef.startTaskDefinition.metadata.getName());
|
|
||||||
}
|
|
||||||
form.setWorkflow(wfWrapper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// the templates attached to the form
|
|
||||||
List<ChildAssociationRef> templateRefs = this.nodeService.getChildAssocs(
|
|
||||||
formRef, WCMAppModel.ASSOC_WEBFORMTEMPLATE, RegexQNamePattern.MATCH_ALL);
|
|
||||||
for (ChildAssociationRef tChildRef : templateRefs)
|
|
||||||
{
|
|
||||||
final NodeRef templateRef = tChildRef.getChildRef();
|
|
||||||
final String renderingEngineTemplateName = (String)
|
|
||||||
this.nodeService.getProperty(templateRef,
|
|
||||||
WCMAppModel.PROP_BASE_RENDERING_ENGINE_TEMPLATE_NAME);
|
|
||||||
final RenderingEngineTemplate ret = formImpl.getRenderingEngineTemplate(renderingEngineTemplateName);
|
|
||||||
if (ret != null)
|
|
||||||
{
|
|
||||||
final String outputPathPattern = (String)
|
|
||||||
this.nodeService.getProperty(templateRef, WCMAppModel.PROP_OUTPUT_PATH_PATTERN);
|
|
||||||
form.addTemplate(new PresentationTemplate(ret, outputPathPattern));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.forms.add(form);
|
|
||||||
}
|
|
||||||
catch (FormNotFoundException fnfe)
|
|
||||||
{
|
|
||||||
//ignore
|
|
||||||
logger.debug(fnfe.getMessage(), fnfe);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// load the workflows associated with the website
|
|
||||||
List<ChildAssociationRef> workflowRefs = this.nodeService.getChildAssocs(
|
|
||||||
nodeRef, WCMAppModel.ASSOC_WEBWORKFLOWDEFAULTS, RegexQNamePattern.MATCH_ALL);
|
|
||||||
for (ChildAssociationRef wChildRef : workflowRefs)
|
|
||||||
{
|
|
||||||
NodeRef wfRef = wChildRef.getChildRef();
|
|
||||||
String wfName = (String)this.nodeService.getProperty(wfRef, WCMAppModel.PROP_WORKFLOW_NAME);
|
|
||||||
WorkflowDefinition wfDef = this.workflowService.getDefinitionByName(wfName);
|
|
||||||
if (wfDef != null)
|
|
||||||
{
|
|
||||||
WorkflowWrapper wfWrapper = new WorkflowWrapper(wfName, wfDef.getTitle(), wfDef.getDescription());
|
|
||||||
wfWrapper.setParams((Map<QName, Serializable>)AVMWorkflowUtil.deserializeWorkflowParams(wfRef));
|
|
||||||
wfWrapper.setFilenamePattern((String)this.nodeService.getProperty(wfRef,
|
|
||||||
WCMAppModel.PROP_FILENAMEPATTERN));
|
|
||||||
if (wfDef.startTaskDefinition != null)
|
|
||||||
{
|
|
||||||
wfWrapper.setType(wfDef.startTaskDefinition.metadata.getName());
|
|
||||||
}
|
|
||||||
this.workflows.add(wfWrapper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -73,31 +73,44 @@ public final class SandboxFactory
|
|||||||
* DNS: .dns.<store> = <path-to-webapps-root>
|
* DNS: .dns.<store> = <path-to-webapps-root>
|
||||||
* Website Name: .website.name = website name
|
* Website Name: .website.name = website name
|
||||||
*
|
*
|
||||||
* @param storeId The store name to create the sandbox for
|
* @param storeId The store name to create the sandbox for.
|
||||||
* @param webProjectNodeRef The noderef for the webproject.
|
* @param webProjectNodeRef The noderef for the webproject.
|
||||||
|
* @param branchStoreId The ID of the store to branch this staging store from.
|
||||||
*/
|
*/
|
||||||
public static SandboxInfo createStagingSandbox(final String storeId,
|
public static SandboxInfo createStagingSandbox(String storeId,
|
||||||
final NodeRef webProjectNodeRef)
|
NodeRef webProjectNodeRef,
|
||||||
|
String branchStoreId)
|
||||||
{
|
{
|
||||||
final ServiceRegistry services = Repository.getServiceRegistry(FacesContext.getCurrentInstance());
|
ServiceRegistry services = Repository.getServiceRegistry(FacesContext.getCurrentInstance());
|
||||||
final AVMService avmService = services.getAVMService();
|
AVMService avmService = services.getAVMService();
|
||||||
final PermissionService permissionService = services.getPermissionService();
|
PermissionService permissionService = services.getPermissionService();
|
||||||
|
|
||||||
// create the 'staging' store for the website
|
// create the 'staging' store for the website
|
||||||
final String stagingStoreName = AVMUtil.buildStagingStoreName(storeId);
|
String stagingStoreName = AVMUtil.buildStagingStoreName(storeId);
|
||||||
avmService.createStore(stagingStoreName);
|
avmService.createStore(stagingStoreName);
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Created staging sandbox store: " + stagingStoreName);
|
logger.debug("Created staging sandbox store: " + stagingStoreName);
|
||||||
|
|
||||||
|
// we can either branch from an existing staging store or create a new structure
|
||||||
|
if (branchStoreId != null)
|
||||||
|
{
|
||||||
|
String branchStorePath = AVMUtil.buildStagingStoreName(branchStoreId) + ":/" +
|
||||||
|
JNDIConstants.DIR_DEFAULT_WWW;
|
||||||
|
avmService.createBranch(-1, branchStorePath,
|
||||||
|
stagingStoreName + ":/", JNDIConstants.DIR_DEFAULT_WWW);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// create the system directories 'www' and 'avm_webapps'
|
// create the system directories 'www' and 'avm_webapps'
|
||||||
avmService.createDirectory(stagingStoreName + ":/", JNDIConstants.DIR_DEFAULT_WWW);
|
avmService.createDirectory(stagingStoreName + ":/", JNDIConstants.DIR_DEFAULT_WWW);
|
||||||
|
avmService.createDirectory(AVMUtil.buildStoreRootPath(stagingStoreName),
|
||||||
|
JNDIConstants.DIR_DEFAULT_APPBASE);
|
||||||
|
}
|
||||||
|
|
||||||
// apply READ permissions for all users
|
// apply READ permissions for all users
|
||||||
NodeRef dirRef = AVMNodeConverter.ToNodeRef(-1, AVMUtil.buildStoreRootPath(stagingStoreName));
|
NodeRef dirRef = AVMNodeConverter.ToNodeRef(-1, AVMUtil.buildStoreRootPath(stagingStoreName));
|
||||||
permissionService.setPermission(dirRef, PermissionService.ALL_AUTHORITIES, PermissionService.READ, true);
|
permissionService.setPermission(dirRef, PermissionService.ALL_AUTHORITIES, PermissionService.READ, true);
|
||||||
|
|
||||||
avmService.createDirectory(AVMUtil.buildStoreRootPath(stagingStoreName),
|
|
||||||
JNDIConstants.DIR_DEFAULT_APPBASE);
|
|
||||||
|
|
||||||
// tag the store with the store type
|
// tag the store with the store type
|
||||||
avmService.setStoreProperty(stagingStoreName,
|
avmService.setStoreProperty(stagingStoreName,
|
||||||
SandboxConstants.PROP_SANDBOX_STAGING_MAIN,
|
SandboxConstants.PROP_SANDBOX_STAGING_MAIN,
|
||||||
@@ -114,7 +127,7 @@ public final class SandboxFactory
|
|||||||
|
|
||||||
|
|
||||||
// create the 'preview' store for the website
|
// create the 'preview' store for the website
|
||||||
final String previewStoreName = AVMUtil.buildStagingPreviewStoreName(storeId);
|
String previewStoreName = AVMUtil.buildStagingPreviewStoreName(storeId);
|
||||||
avmService.createStore(previewStoreName);
|
avmService.createStore(previewStoreName);
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Created staging preview sandbox store: " + previewStoreName +
|
logger.debug("Created staging preview sandbox store: " + previewStoreName +
|
||||||
@@ -180,18 +193,18 @@ public final class SandboxFactory
|
|||||||
* @param role Role permission for the user
|
* @param role Role permission for the user
|
||||||
* @return Summary information regarding the sandbox
|
* @return Summary information regarding the sandbox
|
||||||
*/
|
*/
|
||||||
public static SandboxInfo createUserSandbox(final String storeId,
|
public static SandboxInfo createUserSandbox(String storeId,
|
||||||
final List<String> managers,
|
List<String> managers,
|
||||||
final String username,
|
String username,
|
||||||
final String role)
|
String role)
|
||||||
{
|
{
|
||||||
final ServiceRegistry services = Repository.getServiceRegistry(FacesContext.getCurrentInstance());
|
ServiceRegistry services = Repository.getServiceRegistry(FacesContext.getCurrentInstance());
|
||||||
final AVMService avmService = services.getAVMService();
|
AVMService avmService = services.getAVMService();
|
||||||
final PermissionService permissionService = services.getPermissionService();
|
PermissionService permissionService = services.getPermissionService();
|
||||||
|
|
||||||
// create the user 'main' store
|
// create the user 'main' store
|
||||||
final String userStoreName = AVMUtil.buildUserMainStoreName(storeId, username);
|
String userStoreName = AVMUtil.buildUserMainStoreName(storeId, username);
|
||||||
final String previewStoreName = AVMUtil.buildUserPreviewStoreName(storeId, username);
|
String previewStoreName = AVMUtil.buildUserPreviewStoreName(storeId, username);
|
||||||
|
|
||||||
if (avmService.getStore(userStoreName) != null)
|
if (avmService.getStore(userStoreName) != null)
|
||||||
{
|
{
|
||||||
@@ -203,7 +216,7 @@ public final class SandboxFactory
|
|||||||
}
|
}
|
||||||
|
|
||||||
avmService.createStore(userStoreName);
|
avmService.createStore(userStoreName);
|
||||||
final String stagingStoreName = AVMUtil.buildStagingStoreName(storeId);
|
String stagingStoreName = AVMUtil.buildStagingStoreName(storeId);
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Created user sandbox store: " + userStoreName +
|
logger.debug("Created user sandbox store: " + userStoreName +
|
||||||
" above staging store " + stagingStoreName);
|
" above staging store " + stagingStoreName);
|
||||||
|
@@ -370,13 +370,24 @@ public abstract class InviteUsersWizard extends BaseWizardBean
|
|||||||
if (results != null)
|
if (results != null)
|
||||||
{
|
{
|
||||||
String role = (String)rolePicker.getValue();
|
String role = (String)rolePicker.getValue();
|
||||||
|
|
||||||
if (role != null)
|
if (role != null)
|
||||||
{
|
{
|
||||||
for (int i=0; i<results.length; i++)
|
for (int i=0; i<results.length; i++)
|
||||||
{
|
{
|
||||||
String authority = results[i];
|
addAuthorityWithRole(results[i], role);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add an authority with the specified role to the list managed by this wizard.
|
||||||
|
*
|
||||||
|
* @param authority Authority to add (cannot be null)
|
||||||
|
* @param role Role for the authorities (cannot be null)
|
||||||
|
*/
|
||||||
|
public void addAuthorityWithRole(String authority, String role)
|
||||||
|
{
|
||||||
// only add if authority not already present in the list with same role
|
// only add if authority not already present in the list with same role
|
||||||
boolean foundExisting = false;
|
boolean foundExisting = false;
|
||||||
for (int n=0; n<this.userGroupRoles.size(); n++)
|
for (int n=0; n<this.userGroupRoles.size(); n++)
|
||||||
@@ -413,9 +424,6 @@ public abstract class InviteUsersWizard extends BaseWizardBean
|
|||||||
this.userGroupRoles.add(new UserGroupRole(authority, role, label.toString()));
|
this.userGroupRoles.add(new UserGroupRole(authority, role, label.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action handler called when the Remove button is pressed to remove a user+role
|
* Action handler called when the Remove button is pressed to remove a user+role
|
||||||
|
@@ -34,4 +34,5 @@ public class WebResources extends org.alfresco.web.ui.repo.WebResources
|
|||||||
public static final String IMAGE_USERSANDBOX_32 = "/images/icons/user_sandbox_large.gif";
|
public static final String IMAGE_USERSANDBOX_32 = "/images/icons/user_sandbox_large.gif";
|
||||||
public static final String IMAGE_WEBFORM_32 = "/images/icons/webform_large.gif";
|
public static final String IMAGE_WEBFORM_32 = "/images/icons/webform_large.gif";
|
||||||
public static final String IMAGE_TEMPLATE_32 = "/images/icons/template_large.gif";
|
public static final String IMAGE_TEMPLATE_32 = "/images/icons/template_large.gif";
|
||||||
|
public static final String IMAGE_WEBPROJECT_32 = "/images/icons/website_large.gif";
|
||||||
}
|
}
|
||||||
|
43
source/web/jsp/wcm/create-website-wizard/create-from.jsp
Normal file
43
source/web/jsp/wcm/create-website-wizard/create-from.jsp
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<%--
|
||||||
|
* 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="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" %>
|
||||||
|
|
||||||
|
<h:panelGrid columns="1">
|
||||||
|
<h:selectOneRadio id="create-from" value="#{WizardManager.bean.createFrom}" layout="pageDirection">
|
||||||
|
<f:selectItem itemValue="empty" itemLabel="#{msg.website_create_empty}" />
|
||||||
|
<f:selectItem itemValue="existing" itemLabel="#{msg.website_create_existing}:" />
|
||||||
|
</h:selectOneRadio>
|
||||||
|
<h:panelGroup id="grp-1">
|
||||||
|
<f:verbatim><div style="height:180px;*height:184px;margin-left:28px;width:90%;overflow:auto" class='selectListTable'></f:verbatim>
|
||||||
|
<a:selectList id="website-list" value="#{WizardManager.bean.sourceWebProject}" style="width:100%" itemStyleClass="selectListItem">
|
||||||
|
<a:listItems id="website-items" value="#{WizardManager.bean.webProjectsList}" />
|
||||||
|
</a:selectList>
|
||||||
|
<f:verbatim></div></f:verbatim>
|
||||||
|
</h:panelGroup>
|
||||||
|
</h:panelGrid>
|
@@ -160,7 +160,7 @@
|
|||||||
value="/images/icons/Help_icon.gif" style="cursor:help; padding-left: 4px; vertical-align: -4px;"
|
value="/images/icons/Help_icon.gif" style="cursor:help; padding-left: 4px; vertical-align: -4px;"
|
||||||
onclick="javascript:toggleDeployToHelp()" />
|
onclick="javascript:toggleDeployToHelp()" />
|
||||||
<f:verbatim>
|
<f:verbatim>
|
||||||
<div id="deploy-to-help" class="summary infoText statusInfoText" style="display: none; padding: 5px; width: 220px;">
|
<div id="deploy-to-help" class="summary infoText statusInfoText" style="display:none; padding:5px;">
|
||||||
</f:verbatim>
|
</f:verbatim>
|
||||||
<h:outputText id="deploy-top-help-text" value="#{WizardManager.bean.deployToHelp}" escape="false" />
|
<h:outputText id="deploy-top-help-text" value="#{WizardManager.bean.deployToHelp}" escape="false" />
|
||||||
<f:verbatim>
|
<f:verbatim>
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
* FLOSS exception. You should have recieved a copy of the text describing
|
* FLOSS exception. You should have recieved a copy of the text describing
|
||||||
* the FLOSS exception, and it is also available here:
|
* the FLOSS exception, and it is also available here:
|
||||||
* http://www.alfresco.com/legal/licensing"
|
* http://www.alfresco.com/legal/licensing"
|
||||||
-->
|
-->
|
||||||
<jsp:root version="1.2"
|
<jsp:root version="1.2"
|
||||||
xmlns:jsp="http://java.sun.com/JSP/Page"
|
xmlns:jsp="http://java.sun.com/JSP/Page"
|
||||||
xmlns:c="http://java.sun.com/jsp/jstl/core"
|
xmlns:c="http://java.sun.com/jsp/jstl/core"
|
||||||
@@ -37,28 +37,30 @@
|
|||||||
<jsp:directive.page language="java" buffer="32kb" contentType="text/html; charset=UTF-8"/>
|
<jsp:directive.page language="java" buffer="32kb" contentType="text/html; charset=UTF-8"/>
|
||||||
<jsp:directive.page isELIgnored="false"/>
|
<jsp:directive.page isELIgnored="false"/>
|
||||||
|
|
||||||
|
<f:verbatim>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.onload = function() { document.getElementById("wizard:finish-button").focus(); }
|
window.onload = function() { document.getElementById("wizard:finish-button").focus(); }
|
||||||
</script>
|
</script>
|
||||||
|
</f:verbatim>
|
||||||
|
|
||||||
|
<!-- General properties -->
|
||||||
<h:panelGrid columns="1" cellpadding="2" style="padding-top:4px;padding-bottom:4px;"
|
<h:panelGrid columns="1" cellpadding="2" style="padding-top:4px;padding-bottom:4px;"
|
||||||
width="100%" rowClasses="wizardSectionHeading">
|
width="100%" rowClasses="wizardSectionHeading">
|
||||||
<h:outputText value=" #{msg.general_properties}" escape="false" />
|
<h:outputText value=" #{msg.general_properties}" escape="false" />
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
|
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
|
||||||
<a:selectList id="webproject-list"
|
<a:selectList id="webproject-list" multiSelect="false" activeSelect="true"
|
||||||
multiSelect="false"
|
style="width:100%;" itemStyle="vertical-align: top; margin-right: 5px;">
|
||||||
activeSelect="true"
|
<a:listItem value="${WizardManager.bean.name}" image="/images/icons/website_large.gif">
|
||||||
style="width:100%;"
|
|
||||||
itemStyle="vertical-align: top; margin-right: 5px;">
|
|
||||||
<a:listItem value="${WizardManager.bean.name}"
|
|
||||||
image="/images/icons/website_large.gif">
|
|
||||||
<jsp:attribute name="label"><b>${WizardManager.bean.name}</b></jsp:attribute>
|
<jsp:attribute name="label"><b>${WizardManager.bean.name}</b></jsp:attribute>
|
||||||
<jsp:attribute name="description">
|
<jsp:attribute name="description">
|
||||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
<colgroup><col width="25%"/><col width="75%"/></colgroup>
|
<colgroup><col width="25%"/><col width="75%"/></colgroup>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<c:if test="${!empty WizardManager.bean.sourceWebProjectName}">
|
||||||
|
<tr><td>${msg.website_sourcewebsite}:</td><td> ${WizardManager.bean.sourceWebProjectName}</td></tr>
|
||||||
|
</c:if>
|
||||||
<tr><td>${msg.website_dnsname}:</td><td> ${WizardManager.bean.dnsName}</td></tr>
|
<tr><td>${msg.website_dnsname}:</td><td> ${WizardManager.bean.dnsName}</td></tr>
|
||||||
<tr><td>${msg.website_webapp}:</td><td> ${WizardManager.bean.webapp}</td></tr>
|
<tr><td>${msg.website_webapp}:</td><td> ${WizardManager.bean.webapp}</td></tr>
|
||||||
<tr><td>${msg.title}:</td><td> ${WizardManager.bean.title}</td></tr>
|
<tr><td>${msg.title}:</td><td> ${WizardManager.bean.title}</td></tr>
|
||||||
@@ -79,22 +81,18 @@
|
|||||||
</a:selectList>
|
</a:selectList>
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
|
<!-- Web Content Forms -->
|
||||||
<h:panelGrid columns="1" cellpadding="2" style="padding-top:16px;padding-bottom:4px;"
|
<h:panelGrid columns="1" cellpadding="2" style="padding-top:16px;padding-bottom:4px;"
|
||||||
width="100%" rowClasses="wizardSectionHeading">
|
width="100%" rowClasses="wizardSectionHeading">
|
||||||
<h:outputText value=" #{msg.website_web_content_forms}" escape="false" />
|
<h:outputText value=" #{msg.website_web_content_forms}" escape="false" />
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" width="100%">
|
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" width="100%">
|
||||||
<h:outputText rendered="#{empty WizardManager.bean.forms}"
|
<h:outputText rendered="#{empty WizardManager.bean.forms}" value="#{msg.no_selected_items}"/>
|
||||||
value="#{msg.no_selected_items}"/>
|
<a:selectList id="form-list" multiSelect="false" activeSelect="true"
|
||||||
<a:selectList id="form-list"
|
style="width:100%;" itemStyle="vertical-align: top; margin-right: 5px;">
|
||||||
multiSelect="false"
|
|
||||||
activeSelect="true"
|
|
||||||
style="width:100%;"
|
|
||||||
itemStyle="vertical-align: top; margin-right: 5px;">
|
|
||||||
<c:forEach items="${WizardManager.bean.forms}" var="r">
|
<c:forEach items="${WizardManager.bean.forms}" var="r">
|
||||||
<a:listItem value="${r.name}"
|
<a:listItem value="${r.name}" image="/images/icons/webform_large.gif">
|
||||||
image="/images/icons/webform_large.gif">
|
|
||||||
<jsp:attribute name="label"><b>${r.name}</b></jsp:attribute>
|
<jsp:attribute name="label"><b>${r.name}</b></jsp:attribute>
|
||||||
<jsp:attribute name="description">
|
<jsp:attribute name="description">
|
||||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
@@ -131,6 +129,7 @@
|
|||||||
</a:selectList>
|
</a:selectList>
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
|
<!-- Selected Workflows -->
|
||||||
<h:panelGrid columns="1" cellpadding="2" style="padding-top:16px;padding-bottom:4px;"
|
<h:panelGrid columns="1" cellpadding="2" style="padding-top:16px;padding-bottom:4px;"
|
||||||
width="100%" rowClasses="wizardSectionHeading">
|
width="100%" rowClasses="wizardSectionHeading">
|
||||||
<h:outputText value=" #{msg.website_selected_workflows}" escape="false" />
|
<h:outputText value=" #{msg.website_selected_workflows}" escape="false" />
|
||||||
@@ -139,14 +138,10 @@
|
|||||||
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
|
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
|
||||||
<h:outputText rendered="#{empty WizardManager.bean.workflows}"
|
<h:outputText rendered="#{empty WizardManager.bean.workflows}"
|
||||||
value="#{msg.no_selected_items}"/>
|
value="#{msg.no_selected_items}"/>
|
||||||
<a:selectList id="workflow-list"
|
<a:selectList id="workflow-list" multiSelect="false" activeSelect="true"
|
||||||
multiSelect="false"
|
style="width:100%;" itemStyle="vertical-align: top; margin-right: 5px;">
|
||||||
activeSelect="true"
|
|
||||||
style="width:100%;"
|
|
||||||
itemStyle="vertical-align: top; margin-right: 5px;">
|
|
||||||
<c:forEach items="${WizardManager.bean.workflows}" var="r">
|
<c:forEach items="${WizardManager.bean.workflows}" var="r">
|
||||||
<a:listItem value="${r.name}"
|
<a:listItem value="${r.name}" image="/images/icons/workflow_large.gif">
|
||||||
image="/images/icons/workflow_large.gif">
|
|
||||||
<jsp:attribute name="label"><b>${r.title}</b></jsp:attribute>
|
<jsp:attribute name="label"><b>${r.title}</b></jsp:attribute>
|
||||||
<jsp:attribute name="description">
|
<jsp:attribute name="description">
|
||||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
@@ -171,22 +166,17 @@
|
|||||||
</a:selectList>
|
</a:selectList>
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
|
<!-- Users and Roles -->
|
||||||
<h:panelGrid columns="1" cellpadding="2" style="padding-top:16px"
|
<h:panelGrid columns="1" cellpadding="2" style="padding-top:16px"
|
||||||
width="100%" rowClasses="wizardSectionHeading">
|
width="100%" rowClasses="wizardSectionHeading">
|
||||||
<h:outputText value=" #{msg.create_website_summary_users}" escape="false" />
|
<h:outputText value=" #{msg.create_website_summary_users}" escape="false" />
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0"
|
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%" style="margin-left:12px">
|
||||||
width="100%"
|
<a:selectList id="users-list" multiSelect="false" activeSelect="true"
|
||||||
style="margin-left:12px">
|
style="width:100%;" itemStyle="vertical-align: top; margin-right: 5px;">
|
||||||
<a:selectList id="users-list"
|
|
||||||
multiSelect="false"
|
|
||||||
activeSelect="true"
|
|
||||||
style="width:100%;"
|
|
||||||
itemStyle="vertical-align: top; margin-right: 5px;">
|
|
||||||
<c:forEach items="${WizardManager.bean.invitedUsers}" var="r">
|
<c:forEach items="${WizardManager.bean.invitedUsers}" var="r">
|
||||||
<a:listItem value="${r.name}"
|
<a:listItem value="${r.name}" image="/images/icons/user_large.gif">
|
||||||
image="/images/icons/user_large.gif">
|
|
||||||
<jsp:attribute name="label"><b>${r.name}</b></jsp:attribute>
|
<jsp:attribute name="label"><b>${r.name}</b></jsp:attribute>
|
||||||
<jsp:attribute name="description">
|
<jsp:attribute name="description">
|
||||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
@@ -200,4 +190,5 @@
|
|||||||
</c:forEach>
|
</c:forEach>
|
||||||
</a:selectList>
|
</a:selectList>
|
||||||
</h:panelGrid>
|
</h:panelGrid>
|
||||||
|
|
||||||
</jsp:root>
|
</jsp:root>
|
Reference in New Issue
Block a user