mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V1.3 to HEAD(3161:3179)
svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3161 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3179 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3406 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -595,6 +595,7 @@ system_props=System Properties
|
|||||||
hide_details=Hide Details
|
hide_details=Hide Details
|
||||||
show_details=Show Details
|
show_details=Show Details
|
||||||
user_search_info=To find a user search for them using their first name, last name and/or user name. Alternatively to see all users click 'Show All', however, this may take some time if there are a lot of users in the system.
|
user_search_info=To find a user search for them using their first name, last name and/or user name. Alternatively to see all users click 'Show All', however, this may take some time if there are a lot of users in the system.
|
||||||
|
user_change_homespace_info=Selecting a new home space for a user will not remove the existing permissions on the original home space. You may wish to use the Manage Space Users dialog to modify permissions if they are no longer required on the original home space.
|
||||||
|
|
||||||
# Content Wizard messages
|
# Content Wizard messages
|
||||||
add_content_dialog_title=Add Content Dialog
|
add_content_dialog_title=Add Content Dialog
|
||||||
|
@@ -28,6 +28,9 @@ import javax.faces.event.ActionEvent;
|
|||||||
import javax.transaction.UserTransaction;
|
import javax.transaction.UserTransaction;
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
|
import org.alfresco.repo.search.QueryParameterDefImpl;
|
||||||
|
import org.alfresco.service.ServiceRegistry;
|
||||||
|
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
import org.alfresco.service.cmr.model.FileExistsException;
|
import org.alfresco.service.cmr.model.FileExistsException;
|
||||||
import org.alfresco.service.cmr.model.FileFolderService;
|
import org.alfresco.service.cmr.model.FileFolderService;
|
||||||
@@ -38,6 +41,8 @@ import org.alfresco.service.cmr.repository.CopyService;
|
|||||||
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||||
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.search.QueryParameterDefinition;
|
||||||
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.app.context.UIContextService;
|
import org.alfresco.web.app.context.UIContextService;
|
||||||
@@ -81,6 +86,14 @@ public class ClipboardBean
|
|||||||
this.copyService = copyService;
|
this.copyService = copyService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param searchService The SearchService to set.
|
||||||
|
*/
|
||||||
|
public void setSearchService(SearchService searchService)
|
||||||
|
{
|
||||||
|
this.searchService = searchService;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param navigator The NavigationBean to set.
|
* @param navigator The NavigationBean to set.
|
||||||
*/
|
*/
|
||||||
@@ -244,6 +257,12 @@ public class ClipboardBean
|
|||||||
|
|
||||||
// initial name to attempt the copy of the item with
|
// initial name to attempt the copy of the item with
|
||||||
String name = item.Node.getName();
|
String name = item.Node.getName();
|
||||||
|
if (action == UIClipboardShelfItem.ACTION_PASTE_LINK)
|
||||||
|
{
|
||||||
|
// copy as link was specifically requested by the user
|
||||||
|
String linkTo = Application.getMessage(FacesContext.getCurrentInstance(), MSG_LINK_TO);
|
||||||
|
name = linkTo + ' ' + name;
|
||||||
|
}
|
||||||
|
|
||||||
boolean operationComplete = false;
|
boolean operationComplete = false;
|
||||||
while (operationComplete == false)
|
while (operationComplete == false)
|
||||||
@@ -254,56 +273,58 @@ public class ClipboardBean
|
|||||||
{
|
{
|
||||||
if (action == UIClipboardShelfItem.ACTION_PASTE_LINK)
|
if (action == UIClipboardShelfItem.ACTION_PASTE_LINK)
|
||||||
{
|
{
|
||||||
|
// LINK operation
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Attempting to link node ID: " + item.Node.getId() + " into node ID: " + destRef.getId());
|
logger.debug("Attempting to link node ID: " + item.Node.getId() + " into node ID: " + destRef.getId());
|
||||||
|
|
||||||
// copy as link was specifically requested by the user
|
|
||||||
|
|
||||||
// we create a special Link Object node that has a property to reference the original
|
// we create a special Link Object node that has a property to reference the original
|
||||||
// use FileFolderService to check if already exists as using nodeService directly here
|
|
||||||
String linkTo = Application.getMessage(FacesContext.getCurrentInstance(), MSG_LINK_TO);
|
|
||||||
|
|
||||||
// create the node using the nodeService (can only use FileFolderService for content)
|
// create the node using the nodeService (can only use FileFolderService for content)
|
||||||
Map<QName, Serializable> props = new HashMap<QName, Serializable>(4, 1.0f);
|
if (checkExists(name + ".lnk", destRef) == false)
|
||||||
String linkName = linkTo + ' ' + name;
|
|
||||||
props.put(ContentModel.PROP_NAME, linkName + ".lnk");
|
|
||||||
props.put(ContentModel.PROP_LINK_DESTINATION, item.Node.getNodeRef());
|
|
||||||
if (dd.isSubClass(item.Node.getType(), ContentModel.TYPE_CONTENT))
|
|
||||||
{
|
{
|
||||||
// create File Link node
|
Map<QName, Serializable> props = new HashMap<QName, Serializable>(2, 1.0f);
|
||||||
ChildAssociationRef childRef = this.nodeService.createNode(
|
props.put(ContentModel.PROP_NAME, name + ".lnk");
|
||||||
destRef,
|
props.put(ContentModel.PROP_LINK_DESTINATION, item.Node.getNodeRef());
|
||||||
ContentModel.ASSOC_CONTAINS,
|
if (dd.isSubClass(item.Node.getType(), ContentModel.TYPE_CONTENT))
|
||||||
assocRef.getQName(),
|
{
|
||||||
ContentModel.TYPE_FILELINK,
|
// create File Link node
|
||||||
props);
|
ChildAssociationRef childRef = this.nodeService.createNode(
|
||||||
|
destRef,
|
||||||
|
ContentModel.ASSOC_CONTAINS,
|
||||||
|
assocRef.getQName(),
|
||||||
|
ContentModel.TYPE_FILELINK,
|
||||||
|
props);
|
||||||
|
|
||||||
// apply the titled aspect - title and description
|
// apply the titled aspect - title and description
|
||||||
Map<QName, Serializable> titledProps = new HashMap<QName, Serializable>(2, 1.0f);
|
Map<QName, Serializable> titledProps = new HashMap<QName, Serializable>(2, 1.0f);
|
||||||
titledProps.put(ContentModel.PROP_TITLE, linkName);
|
titledProps.put(ContentModel.PROP_TITLE, name);
|
||||||
titledProps.put(ContentModel.PROP_DESCRIPTION, linkName);
|
titledProps.put(ContentModel.PROP_DESCRIPTION, name);
|
||||||
this.nodeService.addAspect(childRef.getChildRef(), ContentModel.ASPECT_TITLED, titledProps);
|
this.nodeService.addAspect(childRef.getChildRef(), ContentModel.ASPECT_TITLED, titledProps);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// create Folder link node
|
// create Folder link node
|
||||||
ChildAssociationRef childRef = this.nodeService.createNode(
|
ChildAssociationRef childRef = this.nodeService.createNode(
|
||||||
destRef,
|
destRef,
|
||||||
ContentModel.ASSOC_CONTAINS,
|
ContentModel.ASSOC_CONTAINS,
|
||||||
assocRef.getQName(),
|
assocRef.getQName(),
|
||||||
ContentModel.TYPE_FOLDERLINK,
|
ContentModel.TYPE_FOLDERLINK,
|
||||||
props);
|
props);
|
||||||
|
|
||||||
// apply the uifacets aspect - icon, title and description props
|
// apply the uifacets aspect - icon, title and description props
|
||||||
Map<QName, Serializable> uiFacetsProps = new HashMap<QName, Serializable>(3, 1.0f);
|
Map<QName, Serializable> uiFacetsProps = new HashMap<QName, Serializable>(4, 1.0f);
|
||||||
uiFacetsProps.put(ContentModel.PROP_ICON, "space-icon-link");
|
uiFacetsProps.put(ContentModel.PROP_ICON, "space-icon-link");
|
||||||
uiFacetsProps.put(ContentModel.PROP_TITLE, linkName);
|
uiFacetsProps.put(ContentModel.PROP_TITLE, name);
|
||||||
uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, linkName);
|
uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, name);
|
||||||
this.nodeService.addAspect(childRef.getChildRef(), ContentModel.ASPECT_UIFACETS, uiFacetsProps);
|
this.nodeService.addAspect(childRef.getChildRef(), ContentModel.ASPECT_UIFACETS, uiFacetsProps);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we get here without an exception, the clipboard link operation was successful
|
||||||
|
operationComplete = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// COPY operation
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Attempting to copy node ID: " + item.Node.getId() + " into node ID: " + destRef.getId());
|
logger.debug("Attempting to copy node ID: " + item.Node.getId() + " into node ID: " + destRef.getId());
|
||||||
|
|
||||||
@@ -326,17 +347,24 @@ public class ClipboardBean
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// copy the node
|
// copy the node
|
||||||
this.copyService.copy(
|
if (checkExists(name, destRef) == false)
|
||||||
item.Node.getNodeRef(),
|
{
|
||||||
destRef,
|
this.copyService.copy(
|
||||||
ContentModel.ASSOC_CONTAINS,
|
item.Node.getNodeRef(),
|
||||||
assocRef.getQName(),
|
destRef,
|
||||||
true);
|
ContentModel.ASSOC_CONTAINS,
|
||||||
|
assocRef.getQName(),
|
||||||
|
true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we get here without an exception, the clipboard copy operation was successful
|
||||||
|
operationComplete = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// MOVE operation
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Attempting to move node ID: " + item.Node.getId() + " into node ID: " + destRef.getId());
|
logger.debug("Attempting to move node ID: " + item.Node.getId() + " into node ID: " + destRef.getId());
|
||||||
|
|
||||||
@@ -358,27 +386,57 @@ public class ClipboardBean
|
|||||||
ContentModel.ASSOC_CONTAINS,
|
ContentModel.ASSOC_CONTAINS,
|
||||||
assocRef.getQName());
|
assocRef.getQName());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// if we get here without an exception, the clipboard operation was successful
|
// if we get here without an exception, the clipboard move operation was successful
|
||||||
operationComplete = true;
|
operationComplete = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (FileExistsException fileExistsErr)
|
catch (FileExistsException fileExistsErr)
|
||||||
{
|
{
|
||||||
if (item.Mode == ClipboardStatus.COPY)
|
if (item.Mode != ClipboardStatus.COPY)
|
||||||
{
|
{
|
||||||
String copyOf = Application.getMessage(FacesContext.getCurrentInstance(), MSG_COPY_OF);
|
// we should not rename an item when it is being moved - so exit
|
||||||
name = copyOf + ' ' + name;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// we should not rename an item when it is being moved
|
|
||||||
throw fileExistsErr;
|
throw fileExistsErr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (operationComplete == false)
|
||||||
|
{
|
||||||
|
String copyOf = Application.getMessage(FacesContext.getCurrentInstance(), MSG_COPY_OF);
|
||||||
|
name = copyOf + ' ' + name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean checkExists(String name, NodeRef parent)
|
||||||
|
{
|
||||||
|
ServiceRegistry services = Repository.getServiceRegistry(FacesContext.getCurrentInstance());
|
||||||
|
|
||||||
|
QueryParameterDefinition[] params = new QueryParameterDefinition[1];
|
||||||
|
params[0] = new QueryParameterDefImpl(
|
||||||
|
ContentModel.PROP_NAME,
|
||||||
|
services.getDictionaryService().getDataType(
|
||||||
|
DataTypeDefinition.TEXT),
|
||||||
|
true,
|
||||||
|
name);
|
||||||
|
|
||||||
|
// execute the query
|
||||||
|
List<NodeRef> nodeRefs = searchService.selectNodes(
|
||||||
|
parent,
|
||||||
|
XPATH_QUERY_NODE_MATCH,
|
||||||
|
params,
|
||||||
|
services.getNamespaceService(),
|
||||||
|
false);
|
||||||
|
|
||||||
|
return (nodeRefs.size() != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Shallow search for nodes with a name pattern */
|
||||||
|
private static final String XPATH_QUERY_NODE_MATCH =
|
||||||
|
"./*" +
|
||||||
|
"[like(@cm:name, $cm:name, false)]";// +
|
||||||
|
//" and not (subtypeOf('" + ContentModel.TYPE_SYSTEM_FOLDER + "'))" +
|
||||||
|
//" and (subtypeOf('" + ContentModel.TYPE_FOLDER + "') or subtypeOf('" + ContentModel.TYPE_CONTENT + "'))]";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a clipboard node for an operation to the clipboard
|
* Add a clipboard node for an operation to the clipboard
|
||||||
*
|
*
|
||||||
@@ -437,6 +495,9 @@ public class ClipboardBean
|
|||||||
/** The CopyService to be used by the bean */
|
/** The CopyService to be used by the bean */
|
||||||
protected CopyService copyService;
|
protected CopyService copyService;
|
||||||
|
|
||||||
|
/** The SearchService to be used by the bean */
|
||||||
|
protected SearchService searchService;
|
||||||
|
|
||||||
/** The NavigationBean reference */
|
/** The NavigationBean reference */
|
||||||
protected NavigationBean navigator;
|
protected NavigationBean navigator;
|
||||||
|
|
||||||
|
@@ -239,6 +239,10 @@
|
|||||||
<property-name>copyService</property-name>
|
<property-name>copyService</property-name>
|
||||||
<value>#{CopyService}</value>
|
<value>#{CopyService}</value>
|
||||||
</managed-property>
|
</managed-property>
|
||||||
|
<managed-property>
|
||||||
|
<property-name>searchService</property-name>
|
||||||
|
<value>#{SearchService}</value>
|
||||||
|
</managed-property>
|
||||||
</managed-bean>
|
</managed-bean>
|
||||||
|
|
||||||
<managed-bean>
|
<managed-bean>
|
||||||
|
@@ -205,6 +205,23 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<a:panel id="home-info-panel" rendered="#{NewUserWizard.editMode}">
|
||||||
|
<tr>
|
||||||
|
<td colspan=2>
|
||||||
|
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc"); %>
|
||||||
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
|
<tr>
|
||||||
|
<td valign=top style="padding-top:2px" width=20><h:graphicImage url="/images/icons/info_icon.gif" width="16" height="16"/></td>
|
||||||
|
<td class="mainSubText">
|
||||||
|
<h:outputText value="#{msg.user_change_homespace_info}" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</a:panel>
|
||||||
|
|
||||||
<tr><td colspan="2" class="paddingRow"></td></tr>
|
<tr><td colspan="2" class="paddingRow"></td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2"><h:outputText value="#{NewUserWizard.stepInstructions}" /></td>
|
<td colspan="2"><h:outputText value="#{NewUserWizard.stepInstructions}" /></td>
|
||||||
|
Reference in New Issue
Block a user