mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.0 to HEAD
5178: WCM-336, checkin performance 5182: Missing OpenSearch strings 5183: AR-1126 5185: OpenSearch externalized strings 5190: Schema and xforms 5191: WCM-343 5205: NTML using incorrect auth component 5210: No virtual server start 5211: WCM-352, WCM-353 5212: Manage Task Dialog issues git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5332 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1310,6 +1310,10 @@ search_in=Search In
|
|||||||
no_engines_registered=Failed to find any registered OpenSearch engines!
|
no_engines_registered=Failed to find any registered OpenSearch engines!
|
||||||
current_repo=Current Alfresco Repository
|
current_repo=Current Alfresco Repository
|
||||||
toggle_options=Toggle Options
|
toggle_options=Toggle Options
|
||||||
|
no_results=No results
|
||||||
|
of=of
|
||||||
|
failed_gen_url=Failed to generate url for search engine '{0}'.\\n\\nThis is probably caused by missing required parameters, check the template url for the search engine.
|
||||||
|
failed_search=Failed to retrieve search results for '{0}'
|
||||||
|
|
||||||
# UI Page Titles
|
# UI Page Titles
|
||||||
title_about=About Alfresco
|
title_about=About Alfresco
|
||||||
|
@@ -82,7 +82,7 @@
|
|||||||
<permissions>
|
<permissions>
|
||||||
<permission allow="true">Write</permission>
|
<permission allow="true">Write</permission>
|
||||||
</permissions>
|
</permissions>
|
||||||
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
|
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowDeletedEvaluator</evaluator>
|
||||||
<label-id>submit</label-id>
|
<label-id>submit</label-id>
|
||||||
<image>/images/icons/submit.gif</image>
|
<image>/images/icons/submit.gif</image>
|
||||||
<action-listener>#{AVMBrowseBean.setupContentAction}</action-listener>
|
<action-listener>#{AVMBrowseBean.setupContentAction}</action-listener>
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
<permissions>
|
<permissions>
|
||||||
<permission allow="true">Write</permission>
|
<permission allow="true">Write</permission>
|
||||||
</permissions>
|
</permissions>
|
||||||
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
|
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowDeletedEvaluator</evaluator>
|
||||||
<label-id>revert</label-id>
|
<label-id>revert</label-id>
|
||||||
<image>/images/icons/revert.gif</image>
|
<image>/images/icons/revert.gif</image>
|
||||||
<action-listener>#{AVMBrowseBean.revertNode}</action-listener>
|
<action-listener>#{AVMBrowseBean.revertNode}</action-listener>
|
||||||
|
@@ -135,6 +135,67 @@
|
|||||||
</params>
|
</params>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
|
<!-- Revert AVM workflow node -->
|
||||||
|
<action id="workflow_revert">
|
||||||
|
<permissions>
|
||||||
|
<permission allow="true">Write</permission>
|
||||||
|
</permissions>
|
||||||
|
<label-id>revert</label-id>
|
||||||
|
<image>/images/icons/revert.gif</image>
|
||||||
|
<action-listener>#{AVMBrowseBean.revertNode}</action-listener>
|
||||||
|
<params>
|
||||||
|
<param name="id">#{actionContext.id}</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<!-- Preview folder -->
|
||||||
|
<action id="workflow_preview_folder">
|
||||||
|
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
|
||||||
|
<label-id>folder_preview</label-id>
|
||||||
|
<image>/images/icons/preview_website.gif</image>
|
||||||
|
<href>#{actionContext.previewUrl}</href>
|
||||||
|
<target>new</target>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<!-- Preview file -->
|
||||||
|
<action id="workflow_preview_file">
|
||||||
|
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
|
||||||
|
<label-id>file_preview</label-id>
|
||||||
|
<image>/images/icons/preview_website.gif</image>
|
||||||
|
<href>#{actionContext.previewUrl}</href>
|
||||||
|
<target>new</target>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<!-- View File details -->
|
||||||
|
<action id="workflow_file_details">
|
||||||
|
<permissions>
|
||||||
|
<permission allow="true">Read</permission>
|
||||||
|
</permissions>
|
||||||
|
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
|
||||||
|
<label-id>view_details</label-id>
|
||||||
|
<image>/images/icons/View_details.gif</image>
|
||||||
|
<action-listener>#{AVMBrowseBean.setupContentAction}</action-listener>
|
||||||
|
<action>dialog:showFileDetails</action>
|
||||||
|
<params>
|
||||||
|
<param name="id">#{actionContext.id}</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<!-- View Folder details -->
|
||||||
|
<action id="workflow_folder_details">
|
||||||
|
<permissions>
|
||||||
|
<permission allow="true">Read</permission>
|
||||||
|
</permissions>
|
||||||
|
<evaluator>org.alfresco.web.action.evaluator.WCMWorkflowEvaluator</evaluator>
|
||||||
|
<label-id>view_details</label-id>
|
||||||
|
<image>/images/icons/View_details.gif</image>
|
||||||
|
<action-listener>#{AVMBrowseBean.setupContentAction}</action-listener>
|
||||||
|
<action>dialog:showFolderDetails</action>
|
||||||
|
<params>
|
||||||
|
<param name="id">#{actionContext.id}</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
|
||||||
<action-group id="document_browse_menu">
|
<action-group id="document_browse_menu">
|
||||||
<action idref="start_workflow" />
|
<action idref="start_workflow" />
|
||||||
</action-group>
|
</action-group>
|
||||||
@@ -185,9 +246,9 @@
|
|||||||
<action-group id="edit_wcm_package_item_actions">
|
<action-group id="edit_wcm_package_item_actions">
|
||||||
<action idref="edit_file" />
|
<action idref="edit_file" />
|
||||||
<action idref="update_file" />
|
<action idref="update_file" />
|
||||||
<action idref="revert" />
|
<action idref="workflow_revert" />
|
||||||
<action idref="preview_file" />
|
<action idref="workflow_preview_file" />
|
||||||
<action idref="file_details" />
|
<action idref="workflow_file_details" />
|
||||||
</action-group>
|
</action-group>
|
||||||
|
|
||||||
<action-group id="remove_package_item_actions">
|
<action-group id="remove_package_item_actions">
|
||||||
@@ -226,9 +287,9 @@
|
|||||||
<action-group id="edit_and_remove_wcm_package_item_actions">
|
<action-group id="edit_and_remove_wcm_package_item_actions">
|
||||||
<action idref="edit_file"/>
|
<action idref="edit_file"/>
|
||||||
<action idref="update_file" />
|
<action idref="update_file" />
|
||||||
<action idref="revert" />
|
<action idref="workflow_revert" />
|
||||||
<action idref="preview_file" />
|
<action idref="workflow_preview_file" />
|
||||||
<action idref="file_details" />
|
<action idref="workflow_file_details" />
|
||||||
<action idref="remove_package_item" />
|
<action idref="remove_package_item" />
|
||||||
</action-group>
|
</action-group>
|
||||||
|
|
||||||
@@ -245,12 +306,11 @@
|
|||||||
<action-group id="edit_wcm_package_item_actions">
|
<action-group id="edit_wcm_package_item_actions">
|
||||||
<action idref="edit_file" hide="true" />
|
<action idref="edit_file" hide="true" />
|
||||||
<action idref="update_file" hide="true" />
|
<action idref="update_file" hide="true" />
|
||||||
<action idref="preview_file" hide="true" />
|
<action idref="workflow_preview_file" hide="true" />
|
||||||
<action idref="file_details" hide="true" />
|
<action idref="workflow_file_details" hide="true" />
|
||||||
|
|
||||||
<action idref="revert" />
|
<action idref="workflow_preview_folder" />
|
||||||
<action idref="preview_folder" />
|
<action idref="workflow_folder_details" />
|
||||||
<action idref="folder_details" />
|
|
||||||
</action-group>
|
</action-group>
|
||||||
|
|
||||||
</actions>
|
</actions>
|
||||||
@@ -263,12 +323,11 @@
|
|||||||
<action-group id="edit_wcm_package_item_actions">
|
<action-group id="edit_wcm_package_item_actions">
|
||||||
<action idref="edit_file" hide="true" />
|
<action idref="edit_file" hide="true" />
|
||||||
<action idref="update_file" hide="true" />
|
<action idref="update_file" hide="true" />
|
||||||
<action idref="preview_file" hide="true" />
|
<action idref="workflow_preview_file" hide="true" />
|
||||||
<action idref="file_details" hide="true" />
|
<action idref="workflow_file_details" hide="true" />
|
||||||
|
|
||||||
<action idref="revert" />
|
<action idref="workflow_preview_folder" />
|
||||||
<action idref="preview_folder" />
|
<action idref="workflow_folder_details" />
|
||||||
<action idref="folder_details" />
|
|
||||||
</action-group>
|
</action-group>
|
||||||
|
|
||||||
</actions>
|
</actions>
|
||||||
|
@@ -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.repo.avm.AVMNodeConverter;
|
||||||
|
import org.alfresco.repo.avm.wf.AVMSubmittedAspect;
|
||||||
|
import org.alfresco.service.cmr.avm.AVMService;
|
||||||
|
import org.alfresco.util.Pair;
|
||||||
|
import org.alfresco.web.action.ActionEvaluator;
|
||||||
|
import org.alfresco.web.bean.repository.Node;
|
||||||
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
|
import org.alfresco.web.bean.wcm.AVMConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UI Action Evaluator - return true if the node is not part of an in-progress WCM workflow.
|
||||||
|
* No check for deleted items is made in this evaluator. @see WCMWorkflowEvaluator
|
||||||
|
*
|
||||||
|
* @author Kevin Roast
|
||||||
|
*/
|
||||||
|
public class WCMWorkflowDeletedEvaluator implements ActionEvaluator
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
|
||||||
|
*/
|
||||||
|
public boolean evaluate(final Node node)
|
||||||
|
{
|
||||||
|
final FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||||
|
final AVMService avmService = Repository.getServiceRegistry(facesContext).getAVMService();
|
||||||
|
final Pair<Integer, String> p = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef());
|
||||||
|
final int version = p.getFirst();
|
||||||
|
final String path = p.getSecond();
|
||||||
|
|
||||||
|
// evaluate to true if we are within a workflow store (i.e. list of resources in the task
|
||||||
|
// dialog) or not part of an already in-progress workflow
|
||||||
|
return (AVMConstants.isWorkflowStore(AVMConstants.getStoreName(path)) ||
|
||||||
|
avmService.hasAspect(version, path, AVMSubmittedAspect.ASPECT) == false);
|
||||||
|
}
|
||||||
|
}
|
@@ -26,10 +26,10 @@ package org.alfresco.web.action.evaluator;
|
|||||||
|
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
|
|
||||||
import org.alfresco.util.Pair;
|
|
||||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||||
import org.alfresco.repo.avm.wf.AVMSubmittedAspect;
|
import org.alfresco.repo.avm.wf.AVMSubmittedAspect;
|
||||||
import org.alfresco.service.cmr.avm.AVMService;
|
import org.alfresco.service.cmr.avm.AVMService;
|
||||||
|
import org.alfresco.util.Pair;
|
||||||
import org.alfresco.web.action.ActionEvaluator;
|
import org.alfresco.web.action.ActionEvaluator;
|
||||||
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.repository.Repository;
|
||||||
@@ -48,11 +48,15 @@ public class WCMWorkflowEvaluator implements ActionEvaluator
|
|||||||
public boolean evaluate(final Node node)
|
public boolean evaluate(final Node node)
|
||||||
{
|
{
|
||||||
final FacesContext facesContext = FacesContext.getCurrentInstance();
|
final FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||||
final AVMService avmService =
|
final AVMService avmService = Repository.getServiceRegistry(facesContext).getAVMService();
|
||||||
Repository.getServiceRegistry(facesContext).getAVMService();
|
|
||||||
final Pair<Integer, String> p = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef());
|
final Pair<Integer, String> p = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef());
|
||||||
|
final int version = p.getFirst();
|
||||||
final String path = p.getSecond();
|
final String path = p.getSecond();
|
||||||
return (!avmService.hasAspect(p.getFirst(), path, AVMSubmittedAspect.ASPECT) ||
|
|
||||||
AVMConstants.isWorkflowStore(AVMConstants.getStoreName(path)));
|
// evaluate to true if we are not deleted and within a workflow store (i.e. list of resources
|
||||||
|
// in the task dialog) or not part of an already in-progress workflow
|
||||||
|
return ((AVMConstants.isWorkflowStore(AVMConstants.getStoreName(path)) ||
|
||||||
|
avmService.hasAspect(version, path, AVMSubmittedAspect.ASPECT) == false) &&
|
||||||
|
avmService.lookup(version, path) != null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -173,8 +173,8 @@ public class NTLMAuthenticationFilter extends AbstractAuthenticationFilter imple
|
|||||||
m_nodeService = serviceRegistry.getNodeService();
|
m_nodeService = serviceRegistry.getNodeService();
|
||||||
m_transactionService = serviceRegistry.getTransactionService();
|
m_transactionService = serviceRegistry.getTransactionService();
|
||||||
|
|
||||||
m_authService = (AuthenticationService) ctx.getBean("authenticationService");
|
m_authService = (AuthenticationService) ctx.getBean("AuthenticationService");
|
||||||
m_authComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent");
|
m_authComponent = (AuthenticationComponent) ctx.getBean("AuthenticationComponent");
|
||||||
m_personService = (PersonService) ctx.getBean("personService");
|
m_personService = (PersonService) ctx.getBean("personService");
|
||||||
m_configService = (ConfigService) ctx.getBean("webClientConfigService");
|
m_configService = (ConfigService) ctx.getBean("webClientConfigService");
|
||||||
|
|
||||||
|
@@ -140,18 +140,7 @@ public class AVMNode extends Node implements Map<String, Object>
|
|||||||
this.avmRef = avmRef;
|
this.avmRef = avmRef;
|
||||||
this.version = -1; // TODO: always -1 for now...
|
this.version = -1; // TODO: always -1 for now...
|
||||||
this.id = avmRef.getPath();
|
this.id = avmRef.getPath();
|
||||||
}
|
this.deleted = avmRef.isDeleted();
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*
|
|
||||||
* @param avmRef The AVMNodeDescriptor that describes this node
|
|
||||||
* @param deleted True if the node represents a ghosted deleted node
|
|
||||||
*/
|
|
||||||
public AVMNode(AVMNodeDescriptor avmRef, boolean deleted)
|
|
||||||
{
|
|
||||||
this(avmRef);
|
|
||||||
this.deleted = deleted;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -196,12 +185,12 @@ public class AVMNode extends Node implements Map<String, Object>
|
|||||||
|
|
||||||
public final boolean isDirectory()
|
public final boolean isDirectory()
|
||||||
{
|
{
|
||||||
return this.avmRef.isDirectory();
|
return this.avmRef.isDirectory() || this.avmRef.isDeletedDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean isFile()
|
public final boolean isFile()
|
||||||
{
|
{
|
||||||
return this.avmRef.isFile();
|
return this.avmRef.isFile() || this.avmRef.isDeletedFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -33,6 +33,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
import javax.faces.application.FacesMessage;
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
import javax.faces.event.ActionEvent;
|
import javax.faces.event.ActionEvent;
|
||||||
import javax.faces.event.ValueChangeEvent;
|
import javax.faces.event.ValueChangeEvent;
|
||||||
@@ -62,6 +63,7 @@ import org.alfresco.web.forms.RenderingEngine;
|
|||||||
import org.alfresco.web.forms.RenderingEngineTemplate;
|
import org.alfresco.web.forms.RenderingEngineTemplate;
|
||||||
import org.alfresco.web.forms.RenderingEngineTemplateImpl;
|
import org.alfresco.web.forms.RenderingEngineTemplateImpl;
|
||||||
import org.alfresco.web.forms.XMLUtil;
|
import org.alfresco.web.forms.XMLUtil;
|
||||||
|
import org.alfresco.web.forms.xforms.FormBuilderException;
|
||||||
import org.alfresco.web.forms.xforms.SchemaUtil;
|
import org.alfresco.web.forms.xforms.SchemaUtil;
|
||||||
import org.alfresco.web.ui.common.Utils;
|
import org.alfresco.web.ui.common.Utils;
|
||||||
import org.alfresco.web.ui.common.component.UIListItem;
|
import org.alfresco.web.ui.common.component.UIListItem;
|
||||||
@@ -615,7 +617,16 @@ public class CreateFormWizard
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
final Document d = XMLUtil.parse(this.getSchemaFile());
|
final Document d = XMLUtil.parse(this.getSchemaFile());
|
||||||
this.schema = SchemaUtil.parseSchema(d);
|
try
|
||||||
|
{
|
||||||
|
this.schema = SchemaUtil.parseSchema(d, true);
|
||||||
|
}
|
||||||
|
catch (FormBuilderException fbe)
|
||||||
|
{
|
||||||
|
this.schema = SchemaUtil.parseSchema(d, false);
|
||||||
|
LOGGER.warn("non fatal errors encountered parsing schema " + this.getFileName(FILE_SCHEMA) +
|
||||||
|
"\n " + fbe.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@@ -309,24 +309,15 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.avmSyncService.update(diffList, null, true, true, true, true, null, null);
|
this.avmSyncService.update(diffList, null, true, true, true, true, null, null);
|
||||||
|
|
||||||
// reset all paths and structures to the main store
|
|
||||||
this.createdPath = AVMConstants.getCorrespondingPathInMainStore(this.createdPath);
|
|
||||||
if (LOGGER.isDebugEnabled())
|
|
||||||
LOGGER.debug("reset path " + this.createdPath + " to main store");
|
|
||||||
|
|
||||||
boolean form = (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null);
|
|
||||||
if (form)
|
|
||||||
{
|
|
||||||
this.formInstanceData = new FormInstanceDataImpl(AVMNodeConverter.ToNodeRef(-1, this.createdPath));
|
|
||||||
this.renditions = this.formInstanceData.getRenditions();
|
|
||||||
if (LOGGER.isDebugEnabled())
|
|
||||||
LOGGER.debug("reset form instance data " + this.formInstanceData.getName() +
|
|
||||||
" and " + this.renditions.size() + " to main store");
|
|
||||||
}
|
|
||||||
if (this.startWorkflow)
|
if (this.startWorkflow)
|
||||||
{
|
{
|
||||||
final WorkflowDefinition wd = this.getForm().getDefaultWorkflow();
|
final WorkflowDefinition wd = this.getForm().getDefaultWorkflow();
|
||||||
|
if (wd == null)
|
||||||
|
{
|
||||||
|
throw new AlfrescoRuntimeException(Application.getMessage(context, "submit_no_workflow_warning"));
|
||||||
|
}
|
||||||
|
|
||||||
final Map<QName, Serializable> parameters = this.getForm().getDefaultWorkflowParameters();
|
final Map<QName, Serializable> parameters = this.getForm().getDefaultWorkflowParameters();
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
@@ -334,8 +325,7 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
|
|
||||||
if (parameters == null)
|
if (parameters == null)
|
||||||
{
|
{
|
||||||
Utils.addErrorMessage(Application.getMessage(context, "submit_workflow_config_error"));
|
throw new AlfrescoRuntimeException(Application.getMessage(context, "submit_workflow_config_error"));
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// start the workflow to get access to the start task
|
// start the workflow to get access to the start task
|
||||||
@@ -357,7 +347,7 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
final List<String> srcPaths = new ArrayList<String>();
|
final List<String> srcPaths = new ArrayList<String>();
|
||||||
// construct diffs for selected items for submission
|
// construct diffs for selected items for submission
|
||||||
final String sandboxName = this.avmBrowseBean.getSandbox();
|
final String sandboxName = this.avmBrowseBean.getSandbox();
|
||||||
if (form)
|
if (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null)
|
||||||
{
|
{
|
||||||
// collect diffs for form data instance and all renditions
|
// collect diffs for form data instance and all renditions
|
||||||
for (Rendition rendition : this.getRenditions())
|
for (Rendition rendition : this.getRenditions())
|
||||||
@@ -379,10 +369,17 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug("creating workflow package with " + srcPaths.size() + " files");
|
{
|
||||||
|
LOGGER.debug("creating workflow package with " + srcPaths.size() + " files: {");
|
||||||
|
for (final String srcPath : srcPaths)
|
||||||
|
{
|
||||||
|
LOGGER.debug("-- " + srcPath + ",");
|
||||||
|
}
|
||||||
|
LOGGER.debug("}");
|
||||||
|
}
|
||||||
|
|
||||||
// Create workflow sandbox for workflow package
|
// Create workflow sandbox for workflow package
|
||||||
SandboxInfo sandboxInfo = SandboxFactory.createWorkflowSandbox(storeId);
|
final SandboxInfo sandboxInfo = SandboxFactory.createWorkflowSandbox(storeId);
|
||||||
|
|
||||||
final NodeRef packageNodeRef =
|
final NodeRef packageNodeRef =
|
||||||
AVMWorkflowUtil.createWorkflowPackage(srcPaths,
|
AVMWorkflowUtil.createWorkflowPackage(srcPaths,
|
||||||
@@ -396,7 +393,10 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
|
|
||||||
parameters.put(WorkflowModel.ASSOC_PACKAGE, packageNodeRef);
|
parameters.put(WorkflowModel.ASSOC_PACKAGE, packageNodeRef);
|
||||||
// TODO: capture label and comment?
|
// TODO: capture label and comment?
|
||||||
parameters.put(AVMWorkflowUtil.PROP_LABEL, form ? this.formInstanceData.getName() : this.getFileName());
|
parameters.put(AVMWorkflowUtil.PROP_LABEL,
|
||||||
|
MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null
|
||||||
|
? this.formInstanceData.getName()
|
||||||
|
: this.getFileName());
|
||||||
parameters.put(AVMWorkflowUtil.PROP_FROM_PATH, AVMConstants.buildStoreRootPath(sandboxName));
|
parameters.put(AVMWorkflowUtil.PROP_FROM_PATH, AVMConstants.buildStoreRootPath(sandboxName));
|
||||||
|
|
||||||
// update start task with submit parameters
|
// update start task with submit parameters
|
||||||
@@ -417,6 +417,25 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
// return the default outcome
|
// return the default outcome
|
||||||
return outcome;
|
return outcome;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String doPostCommitProcessing(final FacesContext facesContext, final String outcome)
|
||||||
|
{
|
||||||
|
// reset all paths and structures to the main store
|
||||||
|
this.createdPath = AVMConstants.getCorrespondingPathInMainStore(this.createdPath);
|
||||||
|
if (LOGGER.isDebugEnabled())
|
||||||
|
LOGGER.debug("reset path " + this.createdPath + " to main store");
|
||||||
|
|
||||||
|
if (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null)
|
||||||
|
{
|
||||||
|
this.formInstanceData = new FormInstanceDataImpl(AVMNodeConverter.ToNodeRef(-1, this.createdPath));
|
||||||
|
this.renditions = this.formInstanceData.getRenditions();
|
||||||
|
if (LOGGER.isDebugEnabled())
|
||||||
|
LOGGER.debug("reset form instance data " + this.formInstanceData.getName() +
|
||||||
|
" and " + this.renditions.size() + " to main store");
|
||||||
|
}
|
||||||
|
return super.doPostCommitProcessing(facesContext, outcome);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getNextButtonDisabled()
|
public boolean getNextButtonDisabled()
|
||||||
|
@@ -42,6 +42,7 @@ import org.alfresco.service.cmr.workflow.WorkflowDefinition;
|
|||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||||
|
import org.alfresco.web.forms.xforms.FormBuilderException;
|
||||||
import org.alfresco.web.forms.xforms.SchemaUtil;
|
import org.alfresco.web.forms.xforms.SchemaUtil;
|
||||||
import org.alfresco.web.forms.Form;
|
import org.alfresco.web.forms.Form;
|
||||||
import org.alfresco.web.forms.FormsService;
|
import org.alfresco.web.forms.FormsService;
|
||||||
@@ -94,7 +95,7 @@ public class EditFormWizard
|
|||||||
ContentModel.PROP_NAME));
|
ContentModel.PROP_NAME));
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.schema = SchemaUtil.parseSchema(form.getSchema());
|
this.schema = SchemaUtil.parseSchema(form.getSchema(), false);
|
||||||
}
|
}
|
||||||
catch (Throwable t)
|
catch (Throwable t)
|
||||||
{
|
{
|
||||||
|
@@ -658,12 +658,14 @@ public class ManageTaskDialog extends BaseDialogBean
|
|||||||
WCMModel.PROP_AVM_DIR_INDIRECTION);
|
WCMModel.PROP_AVM_DIR_INDIRECTION);
|
||||||
final String stagingAvmPath = AVMNodeConverter.ToAVMVersionPath(stagingNodeRef).getSecond();
|
final String stagingAvmPath = AVMNodeConverter.ToAVMVersionPath(stagingNodeRef).getSecond();
|
||||||
final String packageAvmPath = AVMNodeConverter.ToAVMVersionPath(this.workflowPackage).getSecond();
|
final String packageAvmPath = AVMNodeConverter.ToAVMVersionPath(this.workflowPackage).getSecond();
|
||||||
LOGGER.debug("comparing " + packageAvmPath + " with " + stagingAvmPath);
|
if (LOGGER.isDebugEnabled())
|
||||||
|
LOGGER.debug("comparing " + packageAvmPath + " with " + stagingAvmPath);
|
||||||
for (AVMDifference d : this.avmSyncService.compare(-1, packageAvmPath,
|
for (AVMDifference d : this.avmSyncService.compare(-1, packageAvmPath,
|
||||||
-1, stagingAvmPath,
|
-1, stagingAvmPath,
|
||||||
null))
|
null))
|
||||||
{
|
{
|
||||||
LOGGER.debug("got difference " + d);
|
if (LOGGER.isDebugEnabled())
|
||||||
|
LOGGER.debug("got difference " + d);
|
||||||
if (d.getDifferenceCode() == AVMDifference.NEWER ||
|
if (d.getDifferenceCode() == AVMDifference.NEWER ||
|
||||||
d.getDifferenceCode() == AVMDifference.CONFLICT)
|
d.getDifferenceCode() == AVMDifference.CONFLICT)
|
||||||
{
|
{
|
||||||
|
@@ -135,7 +135,7 @@ public class Schema2XForms
|
|||||||
final ResourceBundle resourceBundle)
|
final ResourceBundle resourceBundle)
|
||||||
throws FormBuilderException
|
throws FormBuilderException
|
||||||
{
|
{
|
||||||
final XSModel schema = SchemaUtil.parseSchema(schemaDocument);
|
final XSModel schema = SchemaUtil.parseSchema(schemaDocument, true);
|
||||||
this.typeTree = SchemaUtil.buildTypeTree(schema);
|
this.typeTree = SchemaUtil.buildTypeTree(schema);
|
||||||
|
|
||||||
//refCounter = 0;
|
//refCounter = 0;
|
||||||
@@ -278,9 +278,13 @@ public class Schema2XForms
|
|||||||
|
|
||||||
if (importedInstanceDocumentElement != null)
|
if (importedInstanceDocumentElement != null)
|
||||||
{
|
{
|
||||||
|
this.insertUpdatedNodes(importedInstanceDocumentElement,
|
||||||
|
defaultInstanceDocumentElement,
|
||||||
|
schemaNamespacesMap);
|
||||||
this.insertPrototypeNodes(importedInstanceDocumentElement,
|
this.insertPrototypeNodes(importedInstanceDocumentElement,
|
||||||
defaultInstanceDocumentElement,
|
defaultInstanceDocumentElement,
|
||||||
schemaNamespacesMap);
|
schemaNamespacesMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.createSubmitElements(xformsDocument, modelSection, rootGroup);
|
this.createSubmitElements(xformsDocument, modelSection, rootGroup);
|
||||||
@@ -303,6 +307,117 @@ public class Schema2XForms
|
|||||||
this.counter.clear();
|
this.counter.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts nodes that exist in the prototype document that are absent in the imported instance.
|
||||||
|
* This is to handle the case where a schema has been updated since the last time the
|
||||||
|
* imported document was modified.
|
||||||
|
*
|
||||||
|
* @param instanceDocumentElement the user provided instance document
|
||||||
|
* @param prototypeInstanceElement the generated prototype instance document
|
||||||
|
* @param schemaNamespaces the namespaces used by the instance document needed for
|
||||||
|
* initializing the xpath context.
|
||||||
|
*/
|
||||||
|
private void insertUpdatedNodes(final Element instanceDocumentElement,
|
||||||
|
final Element prototypeDocumentElement,
|
||||||
|
final HashMap<String, String> schemaNamespaces)
|
||||||
|
{
|
||||||
|
LOGGER.debug("updating imported instance document");
|
||||||
|
final JXPathContext prototypeContext =
|
||||||
|
JXPathContext.newContext(prototypeDocumentElement);
|
||||||
|
prototypeContext.registerNamespace(NamespaceService.ALFRESCO_PREFIX,
|
||||||
|
NamespaceService.ALFRESCO_URI);
|
||||||
|
final JXPathContext instanceContext =
|
||||||
|
JXPathContext.newContext(instanceDocumentElement);
|
||||||
|
instanceContext.registerNamespace(NamespaceService.ALFRESCO_PREFIX,
|
||||||
|
NamespaceService.ALFRESCO_URI);
|
||||||
|
|
||||||
|
// identify all non prototype elements in the prototypeDocument
|
||||||
|
for (final String prefix : schemaNamespaces.keySet())
|
||||||
|
{
|
||||||
|
prototypeContext.registerNamespace(prefix, schemaNamespaces.get(prefix));
|
||||||
|
instanceContext.registerNamespace(prefix, schemaNamespaces.get(prefix));
|
||||||
|
}
|
||||||
|
|
||||||
|
final Iterator it =
|
||||||
|
prototypeContext.iteratePointers("//*[not(@" + NamespaceService.ALFRESCO_PREFIX +
|
||||||
|
":prototype='true')] | //@*[name()!='" + NamespaceService.ALFRESCO_PREFIX +
|
||||||
|
":prototype']");
|
||||||
|
while (it.hasNext())
|
||||||
|
{
|
||||||
|
final Pointer p = (Pointer)it.next();
|
||||||
|
if (LOGGER.isDebugEnabled())
|
||||||
|
{
|
||||||
|
LOGGER.debug("evaluating prototype node " + p.asPath() +
|
||||||
|
" normalized " + p.asPath().replaceAll("\\[\\d+\\]", ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
String path = p.asPath().replaceAll("\\[\\d+\\]", "");
|
||||||
|
if (path.lastIndexOf("/") == 0)
|
||||||
|
{
|
||||||
|
if (instanceContext.selectNodes(path).size() == 0)
|
||||||
|
{
|
||||||
|
LOGGER.debug("copying " + path + " into imported instance");
|
||||||
|
// remove child elements - we want attributes but don't want to
|
||||||
|
// copy any potential prototyp nodes
|
||||||
|
final Node clone = ((Node)p.getNode()).cloneNode(true);
|
||||||
|
if (clone instanceof Attr)
|
||||||
|
{
|
||||||
|
instanceDocumentElement.setAttributeNode((Attr)clone);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final NodeList children = clone.getChildNodes();
|
||||||
|
for (int i = 0; i < children.getLength(); i++)
|
||||||
|
{
|
||||||
|
if (children.item(i) instanceof Element)
|
||||||
|
{
|
||||||
|
clone.removeChild(children.item(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
instanceDocumentElement.appendChild(clone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// change path /foo/bar into /foo[not(child::bar)]
|
||||||
|
if (path.indexOf("@") >= 0)
|
||||||
|
{
|
||||||
|
path = path.replaceAll("\\/(@.+)$", "[not($1)]");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
path = path.replaceAll("\\/([^/]+)$", "[not(child::$1)]");
|
||||||
|
}
|
||||||
|
final List<Node> l = (List<Node>)instanceContext.selectNodes(path);
|
||||||
|
LOGGER.debug("appending node " + ((Node)p.getNode()).getNodeName() +
|
||||||
|
" to the " + l.size() + " selected nodes matching path " + path);
|
||||||
|
for (Node n : l)
|
||||||
|
{
|
||||||
|
// remove child elements - we want attributes but don't want to
|
||||||
|
// copy any potential prototyp nodes
|
||||||
|
final Node clone = ((Node)p.getNode()).cloneNode(true);
|
||||||
|
if (clone instanceof Attr)
|
||||||
|
{
|
||||||
|
((Element)n).setAttributeNode((Attr)clone);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
final NodeList children = clone.getChildNodes();
|
||||||
|
for (int i = 0; i < children.getLength(); i++)
|
||||||
|
{
|
||||||
|
if (children.item(i) instanceof Element)
|
||||||
|
{
|
||||||
|
clone.removeChild(children.item(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
n.appendChild(clone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inserts prototype nodes into the provided instance document by aggregating insertion
|
* Inserts prototype nodes into the provided instance document by aggregating insertion
|
||||||
* points from the generated prototype instance docment.
|
* points from the generated prototype instance docment.
|
||||||
|
@@ -32,7 +32,7 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
import org.apache.xerces.xs.*;
|
import org.apache.xerces.xs.*;
|
||||||
import org.w3c.dom.bootstrap.DOMImplementationRegistry;
|
import org.w3c.dom.bootstrap.DOMImplementationRegistry;
|
||||||
import org.w3c.dom.ls.*;
|
import org.w3c.dom.ls.*;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides utility functions for xml schema parsing.
|
* Provides utility functions for xml schema parsing.
|
||||||
@@ -208,7 +208,8 @@ public class SchemaUtil
|
|||||||
return SchemaUtil.DATA_TYPE_TO_NAME.get(type);
|
return SchemaUtil.DATA_TYPE_TO_NAME.get(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static XSModel parseSchema(final Document schemaDocument)
|
public static XSModel parseSchema(final Document schemaDocument,
|
||||||
|
final boolean failOnError)
|
||||||
throws FormBuilderException
|
throws FormBuilderException
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -222,13 +223,59 @@ public class SchemaUtil
|
|||||||
|
|
||||||
final DOMImplementationLS lsImpl = (DOMImplementationLS)
|
final DOMImplementationLS lsImpl = (DOMImplementationLS)
|
||||||
registry.getDOMImplementation("XML 1.0 LS 3.0");
|
registry.getDOMImplementation("XML 1.0 LS 3.0");
|
||||||
|
if (lsImpl == null)
|
||||||
|
{
|
||||||
|
throw new FormBuilderException("unable to create DOMImplementationLS using " + registry);
|
||||||
|
}
|
||||||
final LSInput in = lsImpl.createLSInput();
|
final LSInput in = lsImpl.createLSInput();
|
||||||
in.setStringData(XMLUtil.toString(schemaDocument));
|
in.setStringData(XMLUtil.toString(schemaDocument));
|
||||||
|
|
||||||
final XSImplementation xsImpl = (XSImplementation)
|
final XSImplementation xsImpl = (XSImplementation)
|
||||||
registry.getDOMImplementation("XS-Loader");
|
registry.getDOMImplementation("XS-Loader");
|
||||||
final XSLoader schemaLoader = xsImpl.createXSLoader(null);
|
final XSLoader schemaLoader = xsImpl.createXSLoader(null);
|
||||||
|
final DOMConfiguration config = schemaLoader.getConfig();
|
||||||
|
final LinkedList<DOMError> errors = new LinkedList<DOMError>();
|
||||||
|
config.setParameter("error-handler", new DOMErrorHandler()
|
||||||
|
{
|
||||||
|
public boolean handleError(final DOMError domError)
|
||||||
|
{
|
||||||
|
errors.add(domError);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
final XSModel result = schemaLoader.load(in);
|
final XSModel result = schemaLoader.load(in);
|
||||||
|
if (failOnError && errors.size() != 0)
|
||||||
|
{
|
||||||
|
final HashSet<String> messages = new HashSet<String>();
|
||||||
|
StringBuilder message = null;
|
||||||
|
for (DOMError e : errors)
|
||||||
|
{
|
||||||
|
message = new StringBuilder();
|
||||||
|
final DOMLocator dl = e.getLocation();
|
||||||
|
if (dl != null)
|
||||||
|
{
|
||||||
|
message.append("at line ").append(dl.getLineNumber())
|
||||||
|
.append(" column ").append(dl.getColumnNumber());
|
||||||
|
if (dl.getRelatedNode() != null)
|
||||||
|
{
|
||||||
|
message.append(" node ").append(dl.getRelatedNode().getNodeName());
|
||||||
|
}
|
||||||
|
message.append(": ").append(e.getMessage());
|
||||||
|
}
|
||||||
|
messages.add(message.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
message = new StringBuilder();
|
||||||
|
message.append(messages.size() > 1 ? "errors" : "error").append(" parsing schema: \n");
|
||||||
|
for (final String s : messages)
|
||||||
|
{
|
||||||
|
message.append(s).append("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new FormBuilderException(message.toString());
|
||||||
|
}
|
||||||
|
|
||||||
if (result == null)
|
if (result == null)
|
||||||
{
|
{
|
||||||
throw new FormBuilderException("invalid schema");
|
throw new FormBuilderException("invalid schema");
|
||||||
|
@@ -115,48 +115,49 @@ public class UIOpenSearch extends SelfRenderingComponent
|
|||||||
out.write("', '");
|
out.write("', '");
|
||||||
out.write(engine.getUrl());
|
out.write(engine.getUrl());
|
||||||
out.write("');\n");
|
out.write("');\n");
|
||||||
|
|
||||||
// pass in NLS strings
|
|
||||||
out.write(clientId);
|
|
||||||
out.write(".setMsgNoResults(\"");
|
|
||||||
out.write(Application.getMessage(context, "no_results"));
|
|
||||||
out.write("\");\n");
|
|
||||||
|
|
||||||
out.write(clientId);
|
|
||||||
out.write(".setMsgOf(\"");
|
|
||||||
out.write(Application.getMessage(context, "of"));
|
|
||||||
out.write("\");\n");
|
|
||||||
|
|
||||||
out.write(clientId);
|
|
||||||
out.write(".setMsgFailedGenerateUrl(\"");
|
|
||||||
out.write(Application.getMessage(context, "failed_gen_url"));
|
|
||||||
out.write("\");\n");
|
|
||||||
|
|
||||||
out.write(clientId);
|
|
||||||
out.write(".setMsgFailedSearch(\"");
|
|
||||||
out.write(Application.getMessage(context, "failed_search"));
|
|
||||||
out.write("\");\n");
|
|
||||||
|
|
||||||
out.write(clientId);
|
|
||||||
out.write(".setMsgFirstPage(\"");
|
|
||||||
out.write(Application.getMessage(context, "first_page"));
|
|
||||||
out.write("\");\n");
|
|
||||||
|
|
||||||
out.write(clientId);
|
|
||||||
out.write(".setMsgPreviousPage(\"");
|
|
||||||
out.write(Application.getMessage(context, "prev_page"));
|
|
||||||
out.write("\");\n");
|
|
||||||
|
|
||||||
out.write(clientId);
|
|
||||||
out.write(".setMsgNextPage(\"");
|
|
||||||
out.write(Application.getMessage(context, "next_page"));
|
|
||||||
out.write("\");\n");
|
|
||||||
|
|
||||||
out.write(clientId);
|
|
||||||
out.write(".setMsgLastPage(\"");
|
|
||||||
out.write(Application.getMessage(context, "last_page"));
|
|
||||||
out.write("\");\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pass in NLS strings
|
||||||
|
out.write(clientId);
|
||||||
|
out.write(".setMsgNoResults(\"");
|
||||||
|
out.write(Application.getMessage(context, "no_results"));
|
||||||
|
out.write("\");\n");
|
||||||
|
|
||||||
|
out.write(clientId);
|
||||||
|
out.write(".setMsgOf(\"");
|
||||||
|
out.write(Application.getMessage(context, "of"));
|
||||||
|
out.write("\");\n");
|
||||||
|
|
||||||
|
out.write(clientId);
|
||||||
|
out.write(".setMsgFailedGenerateUrl(\"");
|
||||||
|
out.write(Application.getMessage(context, "failed_gen_url"));
|
||||||
|
out.write("\");\n");
|
||||||
|
|
||||||
|
out.write(clientId);
|
||||||
|
out.write(".setMsgFailedSearch(\"");
|
||||||
|
out.write(Application.getMessage(context, "failed_search"));
|
||||||
|
out.write("\");\n");
|
||||||
|
|
||||||
|
out.write(clientId);
|
||||||
|
out.write(".setMsgFirstPage(\"");
|
||||||
|
out.write(Application.getMessage(context, "first_page"));
|
||||||
|
out.write("\");\n");
|
||||||
|
|
||||||
|
out.write(clientId);
|
||||||
|
out.write(".setMsgPreviousPage(\"");
|
||||||
|
out.write(Application.getMessage(context, "prev_page"));
|
||||||
|
out.write("\");\n");
|
||||||
|
|
||||||
|
out.write(clientId);
|
||||||
|
out.write(".setMsgNextPage(\"");
|
||||||
|
out.write(Application.getMessage(context, "next_page"));
|
||||||
|
out.write("\");\n");
|
||||||
|
|
||||||
|
out.write(clientId);
|
||||||
|
out.write(".setMsgLastPage(\"");
|
||||||
|
out.write(Application.getMessage(context, "last_page"));
|
||||||
|
out.write("\");\n");
|
||||||
|
|
||||||
out.write("</script>\n");
|
out.write("</script>\n");
|
||||||
|
|
||||||
// write out the HTML
|
// write out the HTML
|
||||||
|
@@ -787,7 +787,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
|
|||||||
out.write("</td><td style='color:#aaaaaa'>");
|
out.write("</td><td style='color:#aaaaaa'>");
|
||||||
|
|
||||||
// deleted UI actions for this item
|
// deleted UI actions for this item
|
||||||
uiDeletedActions.setContext(new AVMNode(node, true));
|
uiDeletedActions.setContext(new AVMNode(node));
|
||||||
Utils.encodeRecursive(fc, uiDeletedActions);
|
Utils.encodeRecursive(fc, uiDeletedActions);
|
||||||
}
|
}
|
||||||
out.write("</td></tr>");
|
out.write("</td></tr>");
|
||||||
|
@@ -41,7 +41,7 @@ function apply_default_workflow_changed(value)
|
|||||||
<f:selectItem id="sdw-apply-default-workflow-yes-item"
|
<f:selectItem id="sdw-apply-default-workflow-yes-item"
|
||||||
itemLabel="#{msg.yes}" itemValue="true"/>
|
itemLabel="#{msg.yes}" itemValue="true"/>
|
||||||
<f:selectItem id="sdw-apply-defalt-workflow-no-item"
|
<f:selectItem id="sdw-apply-defalt-workflow-no-item"
|
||||||
itemLabel="#{msg.no_not_now}" itemValue="false" value="false"/>
|
itemLabel="#{msg.no_not_now}" itemValue="false"/>
|
||||||
</h:selectOneRadio>
|
</h:selectOneRadio>
|
||||||
<f:verbatim><div style="margin-top:10px"> </div></f:verbatim>
|
<f:verbatim><div style="margin-top:10px"> </div></f:verbatim>
|
||||||
<h:panelGroup id="sdw-pg-2" style="#{WizardManager.bean.applyDefaultWorkflow?'display:block':'display:none'}">
|
<h:panelGroup id="sdw-pg-2" style="#{WizardManager.bean.applyDefaultWorkflow?'display:block':'display:none'}">
|
||||||
|
@@ -35,12 +35,7 @@ dojo.require("dojo.date.common");
|
|||||||
dojo.require("dojo.debug.console");
|
dojo.require("dojo.debug.console");
|
||||||
dojo.require("dojo.lang.assert");
|
dojo.require("dojo.lang.assert");
|
||||||
dojo.require("dojo.lfx.html");
|
dojo.require("dojo.lfx.html");
|
||||||
dojo.require("dojo.widget.Button");
|
//dojo.hostenv.writeIncludes();
|
||||||
dojo.require("dojo.widget.DatePicker");
|
|
||||||
dojo.require("dojo.widget.DebugConsole");
|
|
||||||
dojo.require("dojo.widget.Slider");
|
|
||||||
dojo.require("dojo.widget.TimePicker");
|
|
||||||
dojo.hostenv.writeIncludes();
|
|
||||||
|
|
||||||
function _xforms_init()
|
function _xforms_init()
|
||||||
{
|
{
|
||||||
@@ -149,26 +144,32 @@ dojo.declare("alfresco.xforms.Widget",
|
|||||||
/** Sets the widget's modified state, as indicated by an XFormsEvent. */
|
/** Sets the widget's modified state, as indicated by an XFormsEvent. */
|
||||||
setModified: function(b)
|
setModified: function(b)
|
||||||
{
|
{
|
||||||
this._modified = b;
|
if (this._modified != b)
|
||||||
this._updateDisplay();
|
|
||||||
if (this.isValidForSubmit())
|
|
||||||
{
|
{
|
||||||
this.hideAlert();
|
this._modified = b;
|
||||||
|
this._updateDisplay(false);
|
||||||
|
if (this.isValidForSubmit())
|
||||||
|
{
|
||||||
|
this.hideAlert();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/** Sets the widget's valid state, as indicated by an XFormsEvent */
|
/** Sets the widget's valid state, as indicated by an XFormsEvent */
|
||||||
setValid: function(b)
|
setValid: function(b)
|
||||||
{
|
{
|
||||||
this._valid = b;
|
if (this._valid != b)
|
||||||
this._updateDisplay();
|
|
||||||
if (this.isValidForSubmit())
|
|
||||||
{
|
{
|
||||||
this.hideAlert();
|
this._valid = b;
|
||||||
}
|
this._updateDisplay(false);
|
||||||
else
|
if (this.isValidForSubmit())
|
||||||
{
|
{
|
||||||
this.showAlert();
|
this.hideAlert();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.showAlert();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -260,8 +261,11 @@ dojo.declare("alfresco.xforms.Widget",
|
|||||||
/** Sets the widget's required state, as indicated by an XFormsEvent */
|
/** Sets the widget's required state, as indicated by an XFormsEvent */
|
||||||
setRequired: function(b)
|
setRequired: function(b)
|
||||||
{
|
{
|
||||||
this._required = b;
|
if (this._required != b)
|
||||||
this._updateDisplay();
|
{
|
||||||
|
this._required = b;
|
||||||
|
this._updateDisplay(false);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/** Indicates if a value is required for the widget. */
|
/** Indicates if a value is required for the widget. */
|
||||||
@@ -473,10 +477,8 @@ dojo.declare("alfresco.xforms.Widget",
|
|||||||
},
|
},
|
||||||
|
|
||||||
/** Updates the display of the widget. This is intended to be overridden. */
|
/** Updates the display of the widget. This is intended to be overridden. */
|
||||||
_updateDisplay: function()
|
_updateDisplay: function(recursively)
|
||||||
{
|
{
|
||||||
// this.domContainer.style.backgroundColor =
|
|
||||||
// (!this._valid ? "yellow" : this._modified ? "lightgreen" : "white");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** Destroy the widget and any resources no longer needed. */
|
/** Destroy the widget and any resources no longer needed. */
|
||||||
@@ -666,6 +668,7 @@ dojo.declare("alfresco.xforms.NumericalRange",
|
|||||||
alfresco.xforms.Widget,
|
alfresco.xforms.Widget,
|
||||||
function(xform, xformsNode)
|
function(xform, xformsNode)
|
||||||
{
|
{
|
||||||
|
dojo.require("dojo.widget.Slider");
|
||||||
this.fractionDigits = (_hasAttribute(this.xformsNode, alfresco_xforms_constants.ALFRESCO_PREFIX + ":fractionDigits")
|
this.fractionDigits = (_hasAttribute(this.xformsNode, alfresco_xforms_constants.ALFRESCO_PREFIX + ":fractionDigits")
|
||||||
? Number(this.xformsNode.getAttribute(alfresco_xforms_constants.ALFRESCO_PREFIX + ":fractionDigits"))
|
? Number(this.xformsNode.getAttribute(alfresco_xforms_constants.ALFRESCO_PREFIX + ":fractionDigits"))
|
||||||
: -1);
|
: -1);
|
||||||
@@ -1366,6 +1369,7 @@ dojo.declare("alfresco.xforms.DatePicker",
|
|||||||
alfresco.xforms.Widget,
|
alfresco.xforms.Widget,
|
||||||
function(xform, xformsNode)
|
function(xform, xformsNode)
|
||||||
{
|
{
|
||||||
|
dojo.require("dojo.widget.DatePicker");
|
||||||
this._noValueSet = (alfresco_xforms_constants.resources["eg"] + " " +
|
this._noValueSet = (alfresco_xforms_constants.resources["eg"] + " " +
|
||||||
dojo.date.format(new Date(),
|
dojo.date.format(new Date(),
|
||||||
{datePattern: alfresco_xforms_constants.DATE_FORMAT,
|
{datePattern: alfresco_xforms_constants.DATE_FORMAT,
|
||||||
@@ -1520,6 +1524,7 @@ dojo.declare("alfresco.xforms.TimePicker",
|
|||||||
alfresco.xforms.Widget,
|
alfresco.xforms.Widget,
|
||||||
function(xform, xformsNode)
|
function(xform, xformsNode)
|
||||||
{
|
{
|
||||||
|
dojo.require("dojo.widget.TimePicker");
|
||||||
this._noValueSet = (alfresco_xforms_constants.resources["eg"] + " " +
|
this._noValueSet = (alfresco_xforms_constants.resources["eg"] + " " +
|
||||||
dojo.date.format(new Date(),
|
dojo.date.format(new Date(),
|
||||||
{timePattern: alfresco_xforms_constants.TIME_FORMAT,
|
{timePattern: alfresco_xforms_constants.TIME_FORMAT,
|
||||||
@@ -1682,6 +1687,9 @@ dojo.declare("alfresco.xforms.DateTimePicker",
|
|||||||
alfresco.xforms.Widget,
|
alfresco.xforms.Widget,
|
||||||
function(xform, xformsNode)
|
function(xform, xformsNode)
|
||||||
{
|
{
|
||||||
|
dojo.require("dojo.widget.DatePicker");
|
||||||
|
dojo.require("dojo.widget.TimePicker");
|
||||||
|
|
||||||
this._noValueSet = (alfresco_xforms_constants.resources["eg"] + " " +
|
this._noValueSet = (alfresco_xforms_constants.resources["eg"] + " " +
|
||||||
dojo.date.format(new Date(),
|
dojo.date.format(new Date(),
|
||||||
{datePattern: alfresco_xforms_constants.DATE_TIME_FORMAT,
|
{datePattern: alfresco_xforms_constants.DATE_TIME_FORMAT,
|
||||||
@@ -1716,10 +1724,10 @@ dojo.declare("alfresco.xforms.DateTimePicker",
|
|||||||
|
|
||||||
var jsDate = this.getValue() ? dojo.date.fromRfc3339(this.getValue()) : new Date();
|
var jsDate = this.getValue() ? dojo.date.fromRfc3339(this.getValue()) : new Date();
|
||||||
this.widget.timePicker = dojo.widget.createWidget("TimePicker",
|
this.widget.timePicker = dojo.widget.createWidget("TimePicker",
|
||||||
{
|
{
|
||||||
value: jsDate
|
value: jsDate
|
||||||
},
|
},
|
||||||
timePickerDiv);
|
timePickerDiv);
|
||||||
this.widget.timePicker.anyTimeContainerNode.innerHTML = "";
|
this.widget.timePicker.anyTimeContainerNode.innerHTML = "";
|
||||||
|
|
||||||
// don't let it float - it screws up layout somehow
|
// don't let it float - it screws up layout somehow
|
||||||
@@ -2247,7 +2255,7 @@ dojo.declare("alfresco.xforms.Group",
|
|||||||
}
|
}
|
||||||
contentDiv.widget = child;
|
contentDiv.widget = child;
|
||||||
|
|
||||||
this._updateDisplay();
|
this._updateDisplay(false);
|
||||||
this._childAdded(child);
|
this._childAdded(child);
|
||||||
return child.domContainer;
|
return child.domContainer;
|
||||||
},
|
},
|
||||||
@@ -2272,7 +2280,7 @@ dojo.declare("alfresco.xforms.Group",
|
|||||||
dojo.dom.removeChildren(child.domContainer);
|
dojo.dom.removeChildren(child.domContainer);
|
||||||
dojo.dom.removeNode(child.domContainer);
|
dojo.dom.removeNode(child.domContainer);
|
||||||
|
|
||||||
child.domContainer.group._updateDisplay();
|
child.domContainer.group._updateDisplay(false);
|
||||||
};
|
};
|
||||||
anim.play();
|
anim.play();
|
||||||
|
|
||||||
@@ -2414,7 +2422,7 @@ dojo.declare("alfresco.xforms.Group",
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateDisplay: function()
|
_updateDisplay: function(recursively)
|
||||||
{
|
{
|
||||||
if (dojo.render.html.ie)
|
if (dojo.render.html.ie)
|
||||||
{
|
{
|
||||||
@@ -2445,7 +2453,10 @@ dojo.declare("alfresco.xforms.Group",
|
|||||||
: (1 - (contentDiv.offsetLeft /
|
: (1 - (contentDiv.offsetLeft /
|
||||||
this._children[i].domContainer.parentNode.offsetWidth)) * 100 + "%");
|
this._children[i].domContainer.parentNode.offsetWidth)) * 100 + "%");
|
||||||
|
|
||||||
this._children[i]._updateDisplay();
|
if (recursively)
|
||||||
|
{
|
||||||
|
this._children[i]._updateDisplay(recursively);
|
||||||
|
}
|
||||||
|
|
||||||
if (!(this._children[i] instanceof alfresco.xforms.Group))
|
if (!(this._children[i] instanceof alfresco.xforms.Group))
|
||||||
{
|
{
|
||||||
@@ -2648,7 +2659,7 @@ dojo.declare("alfresco.xforms.SwitchGroup",
|
|||||||
this._children[i].domContainer.style.display = "none";
|
this._children[i].domContainer.style.display = "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._updateDisplay();
|
this._updateDisplay(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2836,7 +2847,7 @@ dojo.declare("alfresco.xforms.Repeat",
|
|||||||
{
|
{
|
||||||
oldFocusedRepeat._selectedIndex = -1;
|
oldFocusedRepeat._selectedIndex = -1;
|
||||||
}
|
}
|
||||||
oldFocusedRepeat._updateDisplay();
|
oldFocusedRepeat._updateDisplay(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
var repeatIndices = this.getRepeatIndices();
|
var repeatIndices = this.getRepeatIndices();
|
||||||
@@ -2888,13 +2899,13 @@ dojo.declare("alfresco.xforms.Repeat",
|
|||||||
for (var i = 0; i < this.repeatControls.length; i++)
|
for (var i = 0; i < this.repeatControls.length; i++)
|
||||||
{
|
{
|
||||||
dojo.html.setOpacity(this.repeatControls[i].moveRepeatItemUpImage,
|
dojo.html.setOpacity(this.repeatControls[i].moveRepeatItemUpImage,
|
||||||
i == 0 ? .3 : 1);
|
i == 0 ? .3 : 1);
|
||||||
dojo.html.setOpacity(this.repeatControls[i].moveRepeatItemDownImage,
|
dojo.html.setOpacity(this.repeatControls[i].moveRepeatItemDownImage,
|
||||||
i == this.repeatControls.length - 1 ? .3 : 1);
|
i == this.repeatControls.length - 1 ? .3 : 1);
|
||||||
dojo.html.setOpacity(this.repeatControls[i].insertRepeatItemImage,
|
dojo.html.setOpacity(this.repeatControls[i].insertRepeatItemImage,
|
||||||
insertEnabled ? 1 : .3);
|
insertEnabled ? 1 : .3);
|
||||||
dojo.html.setOpacity(this.repeatControls[i].removeRepeatItemImage,
|
dojo.html.setOpacity(this.repeatControls[i].removeRepeatItemImage,
|
||||||
removeEnabled ? 1 : .3);
|
removeEnabled ? 1 : .3);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -3046,9 +3057,9 @@ dojo.declare("alfresco.xforms.Repeat",
|
|||||||
return this.domNode;
|
return this.domNode;
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateDisplay: function()
|
_updateDisplay: function(recursively)
|
||||||
{
|
{
|
||||||
alfresco.xforms.Repeat.superclass._updateDisplay.call(this);
|
alfresco.xforms.Repeat.superclass._updateDisplay.call(this, recursively);
|
||||||
if (this.getViewRoot().focusedRepeat != null &&
|
if (this.getViewRoot().focusedRepeat != null &&
|
||||||
(this.getViewRoot().focusedRepeat == this ||
|
(this.getViewRoot().focusedRepeat == this ||
|
||||||
this.getViewRoot().focusedRepeat.isAncestorOf(this)))
|
this.getViewRoot().focusedRepeat.isAncestorOf(this)))
|
||||||
@@ -3065,28 +3076,29 @@ dojo.declare("alfresco.xforms.Repeat",
|
|||||||
|
|
||||||
for (var i = 0; i < this._children.length; i++)
|
for (var i = 0; i < this._children.length; i++)
|
||||||
{
|
{
|
||||||
|
var domContainerClasses = dojo.html.getClasses(this._children[i].domContainer);
|
||||||
if (i + 1 == this.getSelectedIndex() && this.getViewRoot().focusedRepeat == this)
|
if (i + 1 == this.getSelectedIndex() && this.getViewRoot().focusedRepeat == this)
|
||||||
{
|
{
|
||||||
if (dojo.html.hasClass(this._children[i].domContainer, "xformsRowOdd"))
|
if (domContainerClasses.indexOf("xformsRowOdd") >= 0)
|
||||||
{
|
{
|
||||||
dojo.html.removeClass(this._children[i].domContainer, "xformsRowOdd");
|
dojo.html.removeClass(this._children[i].domContainer, "xformsRowOdd");
|
||||||
}
|
}
|
||||||
if (dojo.html.hasClass(this._children[i].domContainer, "xformsRowEven"))
|
if (domContainerClasses.indexOf("xformsRowEven") >= 0)
|
||||||
{
|
{
|
||||||
dojo.html.removeClass(this._children[i].domContainer, "xformsRowEven");
|
dojo.html.removeClass(this._children[i].domContainer, "xformsRowEven");
|
||||||
}
|
}
|
||||||
if (!dojo.html.hasClass(this._children[i].domContainer,"xformsRepeatItemSelected"))
|
if (domContainerClasses.indexOf("xformsRepeatItemSelected") < 0)
|
||||||
{
|
{
|
||||||
dojo.html.addClass(this._children[i].domContainer, "xformsRepeatItemSelected");
|
dojo.html.addClass(this._children[i].domContainer, "xformsRepeatItemSelected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (dojo.html.hasClass(this._children[i].domContainer, "xformsRepeatItemSelected"))
|
if (domContainerClasses.indexOf("xformsRepeatItemSelected") >= 0)
|
||||||
{
|
{
|
||||||
dojo.html.removeClass(this._children[i].domContainer, "xformsRepeatItemSelected");
|
dojo.html.removeClass(this._children[i].domContainer, "xformsRepeatItemSelected");
|
||||||
}
|
}
|
||||||
if (dojo.html.hasClass(this._children[i].domContainer, "xformsRow" + (i % 2 ? "Odd" : "Even")))
|
if (domContainerClasses.indexOf("xformsRow" + (i % 2 ? "Odd" : "Even")) >= 0)
|
||||||
{
|
{
|
||||||
dojo.html.removeClass(this._children[i].domContainer, "xformsRow" + (i % 2 ? "Odd" : "Even"));
|
dojo.html.removeClass(this._children[i].domContainer, "xformsRow" + (i % 2 ? "Odd" : "Even"));
|
||||||
}
|
}
|
||||||
@@ -3206,7 +3218,7 @@ dojo.declare("alfresco.xforms.Repeat",
|
|||||||
{
|
{
|
||||||
dojo.debug(this.id + ".handleIndexChanged(" + index + ")");
|
dojo.debug(this.id + ".handleIndexChanged(" + index + ")");
|
||||||
this._selectedIndex = index;
|
this._selectedIndex = index;
|
||||||
this._updateDisplay();
|
this._updateDisplay(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/** Returns a clone of the specified prototype id. */
|
/** Returns a clone of the specified prototype id. */
|
||||||
@@ -3311,15 +3323,12 @@ dojo.declare("alfresco.xforms.Trigger",
|
|||||||
|
|
||||||
render: function(attach_point)
|
render: function(attach_point)
|
||||||
{
|
{
|
||||||
var nodeRef = document.createElement("div");
|
attach_point.appendChild(this.domNode);
|
||||||
attach_point.appendChild(nodeRef);
|
this.widget = document.createElement("input");
|
||||||
this.widget = dojo.widget.createWidget("Button",
|
this.widget.setAttribute("type", "submit");
|
||||||
{
|
this.widget.setAttribute("id", this.id + "-widget");
|
||||||
widgetId: this.id + "-widget",
|
this.widget.setAttribute("value", this.getLabel() + " " + this.id);
|
||||||
caption: this.getLabel() + " " + this.id
|
dojo.event.connect(this.widget, "onclick", this, this._clickHandler);
|
||||||
},
|
|
||||||
nodeRef);
|
|
||||||
dojo.event.connect(this.widget, "onClick", this, this._clickHandler);
|
|
||||||
this.domContainer.style.display = "none";
|
this.domContainer.style.display = "none";
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -3394,7 +3403,7 @@ dojo.declare("alfresco.xforms.Submit",
|
|||||||
_hide_errors();
|
_hide_errors();
|
||||||
xform.submitWidget = event.target.widget;
|
xform.submitWidget = event.target.widget;
|
||||||
xform.submitWidget.currentButton = event.target;
|
xform.submitWidget.currentButton = event.target;
|
||||||
xform.submitWidget.widget.buttonClick();
|
xform.submitWidget.fire();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3582,7 +3591,6 @@ dojo.declare("alfresco.xforms.XForm",
|
|||||||
this.rootWidget = new alfresco.xforms.ViewRoot(this, rootGroup);
|
this.rootWidget = new alfresco.xforms.ViewRoot(this, rootGroup);
|
||||||
this.rootWidget.render(alfUI);
|
this.rootWidget.render(alfUI);
|
||||||
this.loadWidgets(rootGroup, this.rootWidget);
|
this.loadWidgets(rootGroup, this.rootWidget);
|
||||||
// this.rootWidget._updateDisplay();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** Creates the widget for the provided xforms node. */
|
/** Creates the widget for the provided xforms node. */
|
||||||
|
Reference in New Issue
Block a user