Merged V2.1 to HEAD

6535: adding in handlers for renames and deletes of webforms to update web project configurations.
   6536: fix to monthpicker.
   6537: Cluster sample config for ticketsCache defaults to replicating puts
   6538: Invite web users wizard was not correctly initialising
   6539: AWC-1474 - Email Space Users dialog - if no email recipients then show message
   6540: Fixed remote classpath check for SDK projects
   6541: AR-1544: Inbound Rules Being Fired on Name Property Update
   6542: Fix for AWC-1216 - changed NavigationBean to spot when CIFS server is disabled (as the method has changed in repo)
   6543: AR-1623: WebServices authentication errors during concurrent load test
   6544: AWC-1253: AddContent action should be externally configurable/overridable
   6545: Fixed AR-1586: Nicer message when installing older module or duplicate module
   6546: AWC-1301: Access Denied viewing details of content with association
   6547: AWC-1499: It is impossible to remove 'Complianceable' aspect with the help of Run action
   6548: Missing file ... should fix build issues
   6549: Missed file .. fixed build issue
   6550: AWC-1092: sorting by version number in version history is alpha, not numeric
   6551: AWC-1217: Cannot differentiate between two users with same name in user picker search results
   6552: Fixed AR-1572: Export of ML-enabled documents can now be imported
   6553: Removed tabs
   6554: Fixed handling of SC_NOT_FOUND message
   6555: Fixed AR-1627: Removed ability to flush transaction resources on demand


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6744 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-11 00:52:59 +00:00
parent 598a5ea21a
commit 1b9a268ae3
18 changed files with 241 additions and 70 deletions

View File

@@ -673,6 +673,7 @@ apply_rss_feed_warning1=This Space must be visible to the Guest user for the RSS
apply_rss_feed_warning2=view. apply_rss_feed_warning2=view.
rss_feed=RSS Feed rss_feed=RSS Feed
rss_feed_link=RSS Feed Link rss_feed_link=RSS Feed Link
warn_cannot_view_target_details=Cannot view details of the target document as you do not have the required permissions.
# Export messages # Export messages
export_info=Exports metadata and content from this or all Spaces. export_info=Exports metadata and content from this or all Spaces.
@@ -785,6 +786,7 @@ create_form_form_details_step1_desc=Select XML schema to use
create_form_form_details_step2_desc=Specify details for new form. create_form_form_details_step2_desc=Specify details for new form.
create_form_form_details_no_elements_in_schema=This schema does not contain any element declarations. A schema must contain at least one element declaration in order to generate a form. create_form_form_details_no_elements_in_schema=This schema does not contain any element declarations. A schema must contain at least one element declaration in order to generate a form.
create_form_form_details_no_schema_selected=<no schema selected> create_form_form_details_no_schema_selected=<no schema selected>
create_form_form_details_associated_web_projects=This form is currently configured for the following web projects:
create_form_configure_rendering_engine_templates_title=Configure Templates create_form_configure_rendering_engine_templates_title=Configure Templates
create_form_configure_rendering_engine_templates_step_title=Step Two - Configure Templates create_form_configure_rendering_engine_templates_step_title=Step Two - Configure Templates
create_form_configure_rendering_engine_templates_desc=Enter information about the rendering engine templates you want to use for form {0}. create_form_configure_rendering_engine_templates_desc=Enter information about the rendering engine templates you want to use for form {0}.
@@ -1416,6 +1418,7 @@ delete_op_contents=Files and folders within this space.
# Email users dialog # Email users dialog
email_space_users=Email Space users email_space_users=Email Space users
email_space_users_desc=Send an email to the users and groups assigned to this space. email_space_users_desc=Send an email to the users and groups assigned to this space.
email_space_users_no_recipients=There are no users or groups assigned to this space, press Cancel to exit the dialog.
# Workflow messages # Workflow messages
doc_not_in_simple_workflow=This document is not part of a simple workflow. doc_not_in_simple_workflow=This document is not part of a simple workflow.

View File

@@ -267,6 +267,9 @@
<constructor-arg> <constructor-arg>
<ref bean="SearchService" /> <ref bean="SearchService" />
</constructor-arg> </constructor-arg>
<constructor-arg>
<ref bean="policyComponent" />
</constructor-arg>
</bean> </bean>
<!-- NOTE: This references a bean in the repository Spring configuration --> <!-- NOTE: This references a bean in the repository Spring configuration -->

View File

@@ -339,6 +339,18 @@
<action-listener>#{ClipboardBean.pasteAll}</action-listener> <action-listener>#{ClipboardBean.pasteAll}</action-listener>
</action> </action>
<!-- Add content -->
<action id="add_adm_content">
<permissions>
<permission allow="true">CreateChildren</permission>
</permissions>
<label-id>add_content</label-id>
<image>/images/icons/add.gif</image>
<action>dialog:addContent</action>
<action-listener>#{AddContentDialog.start}</action-listener>
</action>
<!-- Create content --> <!-- Create content -->
<action id="create_content"> <action id="create_content">
<permissions> <permissions>
@@ -649,6 +661,12 @@
<!-- the component is responsible for making the context Node object available with name <!-- the component is responsible for making the context Node object available with name
of 'actionContext' so the actions can access it directly to get properties --> of 'actionContext' so the actions can access it directly to get properties -->
<!-- Action for adding content - quick upload -->
<action-group id="add_content_menu">
<style>white-space:nowrap</style>
<action idref="add_adm_content" />
</action-group>
<!-- Actions for a document in the Browse screen --> <!-- Actions for a document in the Browse screen -->
<action-group id="document_browse"> <action-group id="document_browse">
<show-link>false</show-link> <show-link>false</show-link>

View File

@@ -35,6 +35,7 @@ import javax.faces.event.ActionEvent;
import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.filesys.CIFSServer; import org.alfresco.filesys.CIFSServer;
import org.alfresco.filesys.server.config.ServerConfiguration;
import org.alfresco.filesys.server.filesys.DiskSharedDevice; import org.alfresco.filesys.server.filesys.DiskSharedDevice;
import org.alfresco.filesys.smb.server.repo.ContentContext; import org.alfresco.filesys.smb.server.repo.ContentContext;
import org.alfresco.filesys.smb.server.repo.ContentDiskInterface; import org.alfresco.filesys.smb.server.repo.ContentDiskInterface;
@@ -67,6 +68,7 @@ import org.alfresco.web.ui.common.component.UIModeList;
import org.alfresco.web.ui.repo.component.IRepoBreadcrumbHandler; import org.alfresco.web.ui.repo.component.IRepoBreadcrumbHandler;
import org.alfresco.web.ui.repo.component.shelf.UIShelf; import org.alfresco.web.ui.repo.component.shelf.UIShelf;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.web.jsf.FacesContextUtils;
/** /**
* Bean providing access and management of the various global navigation mechanisms * Bean providing access and management of the various global navigation mechanisms
@@ -587,23 +589,27 @@ public class NavigationBean
Path path = node.getNodePath(); Path path = node.getNodePath();
// resolve CIFS network folder location for this node // resolve CIFS network folder location for this node
DiskSharedDevice diskShare = cifsServer.getConfiguration().getPrimaryFilesystem(); ServerConfiguration fileServiceConfig = (ServerConfiguration)FacesContextUtils.getRequiredWebApplicationContext(
FacesContext.getCurrentInstance()).getBean("fileServerConfiguration");
if (diskShare != null && diskShare.getContext() instanceof ContentContext) if (fileServiceConfig.isSMBServerEnabled())
{ {
ContentContext contentCtx = (ContentContext) diskShare.getContext(); DiskSharedDevice diskShare = cifsServer.getConfiguration().getPrimaryFilesystem();
NodeRef rootNode = contentCtx.getRootNode(); if (diskShare != null && diskShare.getContext() instanceof ContentContext)
try
{ {
String cifsPath = Repository.getNamePath(this.nodeService, path, rootNode, "\\", "file:///" + getCIFSServerPath(diskShare)); ContentContext contentCtx = (ContentContext) diskShare.getContext();
NodeRef rootNode = contentCtx.getRootNode();
try
{
String cifsPath = Repository.getNamePath(this.nodeService, path, rootNode, "\\", "file:///" + getCIFSServerPath(diskShare));
node.getProperties().put("cifsPath", cifsPath); node.getProperties().put("cifsPath", cifsPath);
node.getProperties().put("cifsPathLabel", cifsPath.substring(8)); // strip file:/// part node.getProperties().put("cifsPathLabel", cifsPath.substring(8)); // strip file:/// part
} }
catch(AccessDeniedException ade) catch(AccessDeniedException ade)
{ {
node.getProperties().put("cifsPath", ""); node.getProperties().put("cifsPath", "");
node.getProperties().put("cifsPathLabel",""); // strip file:/// part node.getProperties().put("cifsPathLabel",""); // strip file:/// part
}
} }
} }

View File

@@ -19,7 +19,8 @@
* and Open Source Software ("FLOSS") applications as described in Alfresco's * and Open Source Software ("FLOSS") applications as described in Alfresco's
* 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
*/
package org.alfresco.web.bean.wcm; package org.alfresco.web.bean.wcm;
import java.io.File; import java.io.File;
@@ -685,6 +686,11 @@ public class CreateFormWizard
return false; return false;
} }
public List<WebProject> getAssociatedWebProjects()
{
return Collections.<WebProject>emptyList();
}
/** /**
* Returns the properties for current configured output methods JSF DataModel * Returns the properties for current configured output methods JSF DataModel
* *

View File

@@ -51,14 +51,12 @@ 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.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;
@@ -86,7 +84,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
private static final String WEBAPP_DEFAULT = "ROOT"; private static final String WEBAPP_DEFAULT = "ROOT";
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;
protected String dnsName; protected String dnsName;
@@ -171,8 +169,8 @@ public class CreateWebsiteWizard extends BaseWizardBean
WCMAppModel.TYPE_AVMWEBFOLDER); WCMAppModel.TYPE_AVMWEBFOLDER);
NodeRef nodeRef = fileInfo.getNodeRef(); NodeRef nodeRef = fileInfo.getNodeRef();
if (LOGGER.isDebugEnabled()) if (logger.isDebugEnabled())
LOGGER.debug("Created website folder node with name: " + this.name); logger.debug("Created website folder node with name: " + this.name);
// TODO: check that this dns is unique by querying existing store properties for a match // TODO: check that this dns is unique by querying existing store properties for a match
String avmStore = DNSNameMangler.MakeDNSName(this.dnsName); String avmStore = DNSNameMangler.MakeDNSName(this.dnsName);
@@ -193,7 +191,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
// call a delegate wizard bean to provide invite user functionality // call a delegate wizard bean to provide invite user functionality
InviteWebsiteUsersWizard wiz = getInviteUsersWizard(); InviteWebsiteUsersWizard wiz = getInviteUsersWizard();
wiz.init(null); wiz.reset();
wiz.setNode(new Node(nodeRef)); wiz.setNode(new Node(nodeRef));
wiz.setAvmStore(avmStore); wiz.setAvmStore(avmStore);
wiz.setStandalone(false); wiz.setStandalone(false);

View File

@@ -63,6 +63,7 @@ public class EditFormWizard
private final static Log LOGGER = LogFactory.getLog(EditFormWizard.class); private final static Log LOGGER = LogFactory.getLog(EditFormWizard.class);
private List<RenderingEngineTemplateData> removedRenderingEngineTemplates; private List<RenderingEngineTemplateData> removedRenderingEngineTemplates;
private List<WebProject> associatedWebProjects;
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Wizard implementation // Wizard implementation
@@ -136,6 +137,7 @@ public class EditFormWizard
this.renderingEngineTemplates.add(data); this.renderingEngineTemplates.add(data);
} }
this.removedRenderingEngineTemplates = null; this.removedRenderingEngineTemplates = null;
this.associatedWebProjects = this.formsService.getAssociatedWebProjects(form);
} }
/** /**
@@ -149,7 +151,11 @@ public class EditFormWizard
final NodeRef formNodeRef = this.browseBean.getActionSpace().getNodeRef(); final NodeRef formNodeRef = this.browseBean.getActionSpace().getNodeRef();
// apply the name, title and description props // apply the name, title and description props
this.nodeService.setProperty(formNodeRef, ContentModel.PROP_NAME, this.getFormName()); if (!this.getFormName().equals(this.nodeService.getProperty(formNodeRef, ContentModel.PROP_NAME)))
{
this.fileFolderService.rename(formNodeRef, this.getFormName());
}
this.nodeService.setProperty(formNodeRef, ContentModel.PROP_TITLE, this.getFormTitle()); this.nodeService.setProperty(formNodeRef, ContentModel.PROP_TITLE, this.getFormTitle());
this.nodeService.setProperty(formNodeRef, ContentModel.PROP_DESCRIPTION, this.getFormDescription()); this.nodeService.setProperty(formNodeRef, ContentModel.PROP_DESCRIPTION, this.getFormDescription());
this.nodeService.setProperty(formNodeRef, this.nodeService.setProperty(formNodeRef,
@@ -252,8 +258,15 @@ public class EditFormWizard
/** Indicates whether or not the wizard is currently in edit mode */ /** Indicates whether or not the wizard is currently in edit mode */
@Override
public boolean getEditMode() public boolean getEditMode()
{ {
return true; return true;
} }
@Override
public List<WebProject> getAssociatedWebProjects()
{
return this.associatedWebProjects;
}
} }

View File

@@ -147,7 +147,7 @@ public class EditWebsiteWizard extends CreateWebsiteWizard
catch (FormNotFoundException fnfe) catch (FormNotFoundException fnfe)
{ {
//ignore //ignore
LOGGER.debug(fnfe.getMessage(), fnfe); logger.debug(fnfe.getMessage(), fnfe);
} }
} }

View File

@@ -59,9 +59,6 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
/** the node representing the website */ /** the node representing the website */
private Node website; private Node website;
/** list of authorities with the Content Manager role */
private List<String> managers;
/** root AVM store the users are invited into */ /** root AVM store the users are invited into */
private String avmStore; private String avmStore;
@@ -93,7 +90,15 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
// only allow one selection per authority // only allow one selection per authority
this.allowDuplicateAuthorities = false; this.allowDuplicateAuthorities = false;
this.website = null; this.website = null;
this.managers = null; this.avmStore = null;
this.standalone = true;
}
public void reset()
{
this.isFinished = false;
this.allowDuplicateAuthorities = false;
this.website = null;
this.avmStore = null; this.avmStore = null;
this.standalone = true; this.standalone = true;
} }
@@ -108,7 +113,7 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
// create a sandbox for each user appropriately with permissions based on role // create a sandbox for each user appropriately with permissions based on role
// build a list of managers who will have full permissions on ALL staging areas // build a list of managers who will have full permissions on ALL staging areas
this.managers = new ArrayList<String>(4); List<String> managers = new ArrayList<String>(4);
Set<String> existingUsers = new HashSet(8); Set<String> existingUsers = new HashSet(8);
if (isStandalone() == false) if (isStandalone() == false)
{ {
@@ -127,7 +132,7 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
} }
if (AVMUtil.ROLE_CONTENT_MANAGER.equals(userRole.getRole())) if (AVMUtil.ROLE_CONTENT_MANAGER.equals(userRole.getRole()))
{ {
this.managers.add(userAuth); managers.add(userAuth);
} }
} }
} }
@@ -135,7 +140,7 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
if (foundCurrentUser == false) if (foundCurrentUser == false)
{ {
this.userGroupRoles.add(new UserGroupRole(currentUser, AVMUtil.ROLE_CONTENT_MANAGER, null)); this.userGroupRoles.add(new UserGroupRole(currentUser, AVMUtil.ROLE_CONTENT_MANAGER, null));
this.managers.add(currentUser); managers.add(currentUser);
} }
} }
else else
@@ -148,7 +153,7 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
{ {
if (AVMUtil.ROLE_CONTENT_MANAGER.equals(userRole.getRole())) if (AVMUtil.ROLE_CONTENT_MANAGER.equals(userRole.getRole()))
{ {
this.managers.add(userAuth); managers.add(userAuth);
} }
} }
} }
@@ -162,9 +167,9 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
String userrole = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE); String userrole = (String)nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE);
if (AVMUtil.ROLE_CONTENT_MANAGER.equals(userrole) && if (AVMUtil.ROLE_CONTENT_MANAGER.equals(userrole) &&
this.managers.contains(username) == false) managers.contains(username) == false)
{ {
this.managers.add(username); managers.add(username);
} }
// add each existing user to the exclude this - we cannot add them more than once! // add each existing user to the exclude this - we cannot add them more than once!
@@ -185,7 +190,7 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
if (existingUsers.contains(userAuth) == false) if (existingUsers.contains(userAuth) == false)
{ {
SandboxInfo info = SandboxFactory.createUserSandbox( SandboxInfo info = SandboxFactory.createUserSandbox(
getAvmStore(), this.managers, userAuth, userRole.getRole()); getAvmStore(), managers, userAuth, userRole.getRole());
this.sandboxInfoList.add(info); this.sandboxInfoList.add(info);
@@ -218,7 +223,7 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
if (existingUsers.contains(username)) if (existingUsers.contains(username))
{ {
// only need to modify the sandboxes we haven't just created // only need to modify the sandboxes we haven't just created
SandboxFactory.updateSandboxManagers(getAvmStore(), this.managers, username); SandboxFactory.updateSandboxManagers(getAvmStore(), managers, username);
} }
} }
} }
@@ -352,14 +357,6 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
} }
} }
/**
* @return List of authorities with the Content Manager role
*/
public List<String> getManagers()
{
return this.managers;
}
/** /**
* @return Returns the root AVM store. * @return Returns the root AVM store.
*/ */

View File

@@ -319,7 +319,7 @@ public abstract class InviteUsersWizard extends BaseWizardBean
String firstName = (String)this.nodeService.getProperty(personRef, ContentModel.PROP_FIRSTNAME); String firstName = (String)this.nodeService.getProperty(personRef, ContentModel.PROP_FIRSTNAME);
String lastName = (String)this.nodeService.getProperty(personRef, ContentModel.PROP_LASTNAME); String lastName = (String)this.nodeService.getProperty(personRef, ContentModel.PROP_LASTNAME);
String username = (String)this.nodeService.getProperty(personRef, ContentModel.PROP_USERNAME); String username = (String)this.nodeService.getProperty(personRef, ContentModel.PROP_USERNAME);
SelectItem item = new SortableSelectItem(username, firstName + " " + lastName, lastName); SelectItem item = new SortableSelectItem(username, firstName + " " + lastName + " [" + username + "]", lastName);
items[index] = item; items[index] = item;
} }
} }

View File

@@ -38,11 +38,16 @@ import org.alfresco.error.AlfrescoRuntimeException;
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.policy.PolicyComponent;
import org.alfresco.repo.policy.Behaviour;
import org.alfresco.repo.policy.JavaBehaviour;
import org.alfresco.repo.search.impl.lucene.QueryParser;
import org.alfresco.service.cmr.avm.AVMNotFoundException; import org.alfresco.service.cmr.avm.AVMNotFoundException;
import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.model.FileFolderService; import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.repository.AssociationRef; import org.alfresco.service.cmr.repository.AssociationRef;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentReader; import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentService; import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.MimetypeService; import org.alfresco.service.cmr.repository.MimetypeService;
@@ -96,12 +101,23 @@ public final class FormsService
public FormsService(final ContentService contentService, public FormsService(final ContentService contentService,
final NodeService nodeService, final NodeService nodeService,
final NamespaceService namespaceService, final NamespaceService namespaceService,
final SearchService searchService) final SearchService searchService,
final PolicyComponent policyComponent)
{ {
this.contentService = contentService; this.contentService = contentService;
this.nodeService = nodeService; this.nodeService = nodeService;
this.namespaceService = namespaceService; this.namespaceService = namespaceService;
this.searchService = searchService; this.searchService = searchService;
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onMoveNode"),
WCMAppModel.TYPE_FORMFOLDER,
new JavaBehaviour(this,
"handleMoveFormFolder",
Behaviour.NotificationFrequency.FIRST_EVENT));
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onDeleteNode"),
WCMAppModel.TYPE_FORMFOLDER,
new JavaBehaviour(this,
"handleDeleteFormFolder",
Behaviour.NotificationFrequency.FIRST_EVENT));
} }
/** /**
@@ -174,18 +190,16 @@ public final class FormsService
*/ */
public Collection<Form> getForms() public Collection<Form> getForms()
{ {
final SearchParameters sp = new SearchParameters(); final String query =
sp.addStore(Repository.getStoreRef()); "+ASPECT:\"" + WCMAppModel.ASPECT_FORM +
sp.setLanguage(SearchService.LANGUAGE_LUCENE); "\" +PARENT:\"" + this.getContentFormsNodeRef() + "\"";
sp.setQuery("+ASPECT:\"" + WCMAppModel.ASPECT_FORM + final ResultSet rs = this.searchService.query(Repository.getStoreRef(),
"\" +PARENT:\"" + this.getContentFormsNodeRef() + "\""); SearchService.LANGUAGE_LUCENE,
query);
if (LOGGER.isDebugEnabled()) if (LOGGER.isDebugEnabled())
LOGGER.debug("running query [" + sp.getQuery() + "]"); LOGGER.debug("found " + rs.length() + " form definitions");
final ResultSet rs = this.searchService.query(sp);
if (LOGGER.isDebugEnabled())
LOGGER.debug("received " + rs.length() + " results");
final Collection<Form> result = new ArrayList<Form>(rs.length()); final Collection<Form> result = new ArrayList<Form>(rs.length());
for (ResultSetRow row : rs) for (final ResultSetRow row : rs)
{ {
result.add(this.getForm(row.getNodeRef())); result.add(this.getForm(row.getNodeRef()));
} }
@@ -269,4 +283,87 @@ public final class FormsService
{ {
return new RenditionImpl(nodeRef, this); return new RenditionImpl(nodeRef, this);
} }
public List<WebProject> getAssociatedWebProjects(final Form form)
{
final List<NodeRef> formConfigurations = this.getFormConfigurations(form.getName());
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("found " + formConfigurations.size() +
" web projects configured with " + form.getName());
}
final List<WebProject> result = new ArrayList<WebProject>(formConfigurations.size());
for (final NodeRef ref : formConfigurations)
{
final List<ChildAssociationRef> parents = this.nodeService.getParentAssocs(ref);
assert parents.size() != 1 : ("expected only one parent for " + ref +
" got " + parents.size());
result.add(new WebProject(parents.get(0).getParentRef()));
}
return result;
}
// event handlers
public void handleMoveFormFolder(final ChildAssociationRef oldChild, final ChildAssociationRef newChild)
{
final String oldName = oldChild.getQName().getLocalName();
final String newName = newChild.getQName().getLocalName();
final List<NodeRef> formConfigurations = this.getFormConfigurations(oldName);
// find all webprojects that used the old name
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("handling rename (" + oldName +
" => " + newName +
") for " + formConfigurations.size());
}
for (final NodeRef ref : formConfigurations)
{
this.nodeService.setProperty(ref,
WCMAppModel.PROP_FORMNAME,
newName);
}
}
public void handleDeleteFormFolder(final ChildAssociationRef childRef,
final boolean isArchivedNode)
{
final String formName = childRef.getQName().getLocalName();
final List<NodeRef> formConfigurations = this.getFormConfigurations(formName);
for (final NodeRef ref : formConfigurations)
{
final List<ChildAssociationRef> parents = this.nodeService.getParentAssocs(ref);
assert parents.size() != 1 : ("expected only one parent for " + ref +
" got " + parents.size());
final NodeRef parentRef = parents.get(0).getParentRef();
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("removing configuration for " + formName +
" from web project " + this.nodeService.getProperty(parentRef, ContentModel.PROP_NAME));
}
this.nodeService.removeChild(parentRef, ref);
}
}
private List<NodeRef> getFormConfigurations(final String formName)
{
final String query =
"+TYPE:\"" + WCMAppModel.TYPE_WEBFORM +
"\" +@" + Repository.escapeQName(WCMAppModel.PROP_FORMNAME) +
":\"" + QueryParser.escape(formName) + "\"";
final ResultSet rs = this.searchService.query(Repository.getStoreRef(),
SearchService.LANGUAGE_LUCENE,
query);
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("query " + query + " returned " + rs.length() + " results");
}
final List<NodeRef> result = new ArrayList<NodeRef>(rs.length());
for (final ResultSetRow row : rs)
{
result.add(row.getNodeRef());
}
return result;
}
} }

View File

@@ -25,7 +25,6 @@
package org.alfresco.web.ui.repo.component.property; package org.alfresco.web.ui.repo.component.property;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
@@ -35,11 +34,13 @@ import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter; import javax.faces.context.ResponseWriter;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.repo.security.permissions.AccessDeniedException;
import org.alfresco.service.cmr.repository.AssociationRef; import org.alfresco.service.cmr.repository.AssociationRef;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.PermissionService; import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
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;
import org.alfresco.web.bean.repository.User; import org.alfresco.web.bean.repository.User;
@@ -57,6 +58,8 @@ public class UIAssociationEditor extends BaseAssociationEditor
{ {
private static final Log logger = LogFactory.getLog(UIAssociationEditor.class); private static final Log logger = LogFactory.getLog(UIAssociationEditor.class);
public static final String MSG_WARN_CANNOT_VIEW_TARGET_DETAILS = "warn_cannot_view_target_details";
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Component implementation // Component implementation
@@ -180,9 +183,19 @@ public class UIAssociationEditor extends BaseAssociationEditor
else else
{ {
// use the standard cm:name property // use the standard cm:name property
out.write(Repository.getDisplayPath(nodeService.getPath(targetNode)));
out.write("/"); // Fix AWC-1301
out.write(Repository.getNameForNode(nodeService, targetNode)); String displayString = null;
try
{
displayString = Repository.getDisplayPath(nodeService.getPath(targetNode)) + "/" + Repository.getNameForNode(nodeService, targetNode);
}
catch (AccessDeniedException ade)
{
displayString = Application.getMessage(context, MSG_WARN_CANNOT_VIEW_TARGET_DETAILS);
}
out.write(displayString);
} }
out.write("</td></tr>"); out.write("</td></tr>");
} }

View File

@@ -133,11 +133,7 @@
<td class="separator" width=1><img src="<%=request.getContextPath()%>/images/parts/dotted_separator.gif" border=0 height=29 width=1></td> <td class="separator" width=1><img src="<%=request.getContextPath()%>/images/parts/dotted_separator.gif" border=0 height=29 width=1></td>
<td style="padding-left:4px" align=right> <td style="padding-left:4px" align=right>
<%-- Quick upload action --%> <%-- Quick upload action --%>
<nobr> <r:actions id="acts_add_content" value="add_content_menu" context="#{NavigationBean.currentNode}" showLink="true" />
<r:permissionEvaluator value="#{NavigationBean.currentNode}" allow="CreateChildren" id="eval2">
<a:actionLink value="#{msg.add_content}" image="/images/icons/add.gif" padding="2" action="addContent" actionListener="#{AddContentDialog.start}" style="white-space:nowrap" id="link3" />
</r:permissionEvaluator>
</nobr>
</td> </td>
<td style="padding-left:4px" width=52> <td style="padding-left:4px" width=52>
<%-- Create actions menu --%> <%-- Create actions menu --%>

View File

@@ -437,7 +437,7 @@
<a:richList id="versionHistoryList" viewMode="details" value="#{DocumentDetailsBean.versionHistory}" <a:richList id="versionHistoryList" viewMode="details" value="#{DocumentDetailsBean.versionHistory}"
var="r" styleClass="recordSet" headerStyleClass="recordSetHeader" var="r" styleClass="recordSet" headerStyleClass="recordSetHeader"
rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
pageSize="10" initialSortColumn="versionLabel" initialSortDescending="false"> pageSize="10" initialSortColumn="versionDate" initialSortDescending="true">
<%-- Primary column for details view mode --%> <%-- Primary column for details view mode --%>
<a:column id="col1" primary="true" width="100" style="padding:2px;text-align:left"> <a:column id="col1" primary="true" width="100" style="padding:2px;text-align:left">

View File

@@ -240,7 +240,7 @@
<a:richList id="versionHistoryList" viewMode="details" value="#{VersionedDocumentDetailsBean.versionHistory}" <a:richList id="versionHistoryList" viewMode="details" value="#{VersionedDocumentDetailsBean.versionHistory}"
var="r" styleClass="recordSet" headerStyleClass="recordSetHeader" var="r" styleClass="recordSet" headerStyleClass="recordSetHeader"
rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
pageSize="10" initialSortColumn="versionLabel" initialSortDescending="false"> pageSize="10" initialSortColumn="versionDate" initialSortDescending="true">
<%-- Primary column for details view mode --%> <%-- Primary column for details view mode --%>
<a:column id="col1" primary="true" width="100" style="padding:2px;text-align:left"> <a:column id="col1" primary="true" width="100" style="padding:2px;text-align:left">

View File

@@ -58,6 +58,14 @@
</script> </script>
</f:verbatim> </f:verbatim>
<a:panel id="no-message-recipients-panel" rendered="#{empty DialogManager.bean.usersGroups}">
<h:outputText value="#{msg.email_space_users_no_recipients}" />
</a:panel>
<a:panel id="message-recipients-panel" rendered="#{not empty DialogManager.bean.usersGroups}">
<h:outputText styleClass="mainSubTitle" value="#{msg.message_recipients}" /> <h:outputText styleClass="mainSubTitle" value="#{msg.message_recipients}" />
<f:verbatim><div style='padding:2px'></div></f:verbatim> <f:verbatim><div style='padding:2px'></div></f:verbatim>
<r:userGroupPicker value="#{DialogManager.bean.usersGroups}" actionListener="#{DialogManager.bean.userGroupSelectorAction}" /> <r:userGroupPicker value="#{DialogManager.bean.usersGroups}" actionListener="#{DialogManager.bean.userGroupSelectorAction}" />
@@ -85,3 +93,5 @@
<h:outputText value="#{msg.message}:"/> <h:outputText value="#{msg.message}:"/>
<h:inputTextarea value="#{DialogManager.bean.mailHelper.body}" rows="4" cols="75" disabled="#{DialogManager.bean.mailHelper.usingTemplate != null}" /> <h:inputTextarea value="#{DialogManager.bean.mailHelper.body}" rows="4" cols="75" disabled="#{DialogManager.bean.mailHelper.usingTemplate != null}" />
</h:panelGrid> </h:panelGrid>
</a:panel>

View File

@@ -95,6 +95,18 @@
immediate="true" immediate="true"
style="display:none;" style="display:none;"
valueChangeListener="#{WizardManager.bean.schemaFileValueChanged}"/> valueChangeListener="#{WizardManager.bean.schemaFileValueChanged}"/>
<h:panelGrid rendered="#{!empty WizardManager.bean.associatedWebProjects}"
width="100%"
styleClass="infoText">
<h:outputText value="#{msg.create_form_form_details_associated_web_projects}"/>
<f:verbatim>
<ul>
<c:forEach items="${WizardManager.bean.associatedWebProjects}" var="wp">
<li>${wp.name}</li>
</c:forEach>
</ul>
</f:verbatim>
</h:panelGrid>
<h:panelGrid id="panel_grid_1" <h:panelGrid id="panel_grid_1"
columns="1" cellpadding="2" columns="1" cellpadding="2"
@@ -109,7 +121,6 @@
<h:outputText id="step-1-text" <h:outputText id="step-1-text"
value="1. #{msg.create_form_form_details_step1_desc}" value="1. #{msg.create_form_form_details_step1_desc}"
escape="false" /> escape="false" />
<h:panelGrid id="schema_panel_grid" <h:panelGrid id="schema_panel_grid"
columns="4" columns="4"
cellpadding="3" cellpadding="3"

View File

@@ -2182,7 +2182,7 @@ dojo.declare("alfresco.xforms.MonthPicker",
{ {
var result = []; var result = [];
result.push({id: "month_empty", label: "", value: "", valid: false}); result.push({id: "month_empty", label: "", value: "", valid: false});
for (var i = 0; i <= 12; i++) for (var i = 0; i < 12; i++)
{ {
var d = new Date(); var d = new Date();
d.setMonth(i); d.setMonth(i);