mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merge branch 'master' into dev-dhrn-ACS-777
This commit is contained in:
@@ -2348,6 +2348,11 @@ public class NodesImpl implements Nodes
|
||||
private void handleNodeRename(Map<QName, Serializable> props, NodeRef nodeRef)
|
||||
{
|
||||
Serializable nameProp = props.get(ContentModel.PROP_NAME);
|
||||
handleNodeRename(nameProp, nodeRef);
|
||||
}
|
||||
|
||||
private void handleNodeRename(Serializable nameProp, NodeRef nodeRef)
|
||||
{
|
||||
if ((nameProp != null))
|
||||
{
|
||||
String currentName = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
|
||||
@@ -2722,6 +2727,7 @@ public class NodesImpl implements Nodes
|
||||
String fileName = parameters.getParameter(PARAM_NAME);
|
||||
if (fileName != null)
|
||||
{
|
||||
handleNodeRename(fileName, nodeRef);
|
||||
// optionally rename, before updating the content
|
||||
nodeService.setProperty(nodeRef, ContentModel.PROP_NAME, fileName);
|
||||
}
|
||||
|
@@ -54,9 +54,9 @@ cmm.rest_api.property_change_mandatory_enforced_opt_err=\u6709\u52b9\u5316\u3055
|
||||
cmm.rest_api.property_change_multi_valued_opt_err=\u6709\u52b9\u5316\u3055\u308c\u3066\u3044\u308b\u30e2\u30c7\u30eb\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u8907\u6570\u5024\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u5909\u66f4\u3067\u304d\u307e\u305b\u3093\u3002
|
||||
# validation
|
||||
cmm.rest_api.input_validation_err=''{0}'' \u306f\u6709\u52b9\u306a\u5024\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u6570\u5b57\u3001\u82f1\u5b57\u3001\u30cf\u30a4\u30d5\u30f3 (-)\u3001\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2 (_) \u3060\u3051\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002
|
||||
cmm.rest_api.prefix_not_registered=URI ''{0}'' \u7528\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u540d\u524d\u7a7a\u9593\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u304c\u3042\u308a\u307e\u305b\u3093\u3002 \u30e2\u30c7\u30eb\u304c\u6709\u52b9\u5316\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044.
|
||||
cmm.rest_api.prefix_not_registered=URI ''{0}'' \u7528\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u540d\u524d\u7a7a\u9593\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u304c\u3042\u308a\u307e\u305b\u3093\u3002 \u30e2\u30c7\u30eb\u304c\u6709\u52b9\u5316\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002
|
||||
cmm.rest_api.prefixed_qname_invalid=''{0}'' \u306f\u6709\u52b9\u306a\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u4ed8\u304d QName \u5024\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 {1}
|
||||
cmm.rest_api.circular_dependency_err=\u5faa\u74b0\u4f9d\u5b58\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f\u3002 ''{0}'' \u306f\u3059\u3067\u306b ''{1}'' \u306b\u4f9d\u5b58\u3059\u308b\u30e2\u30c7\u30eb\u3067\u3042\u308b\u305f\u3081\u3001\u89aa\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093.
|
||||
cmm.rest_api.circular_dependency_err=\u5faa\u74b0\u4f9d\u5b58\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f\u3002 ''{0}'' \u306f\u3059\u3067\u306b ''{1}'' \u306b\u4f9d\u5b58\u3059\u308b\u30e2\u30c7\u30eb\u3067\u3042\u308b\u305f\u3081\u3001\u89aa\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002
|
||||
cmm.rest_api.prefixed_qname_invalid_format=''{0}'' \u306f\u6709\u52b9\u306a\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u4ed8\u304d QName \u5f62\u5f0f\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u6709\u52b9\u306a\u5f62\u5f0f\u306f\u3001\u540d\u524d\u7a7a\u9593\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3001\u30b3\u30ed\u30f3 (:)\u3001\u540d\u524d\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u3059\u3002\u4f8b: cm:content\u3002
|
||||
# model import
|
||||
cmm.rest_api.model.import_namespace_multiple_found=\u30ab\u30b9\u30bf\u30e0\u30e2\u30c7\u30eb\u306b\u5b9a\u7fa9\u3067\u304d\u308b\u540d\u524d\u7a7a\u9593\u306f 1 \u3064\u3060\u3051\u3067\u3059\u304c\u3001 ''{0}'' \u500b\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002
|
||||
|
@@ -55,7 +55,7 @@ nodebrowser.delete-permissions=\u6062\u590d\u6743\u9650
|
||||
nodebrowser.delete-permissions.tip=\u5220\u9664\u6240\u6709\u5feb\u901f\u6307\u6d3e\u5f97\u5230\u6b64\u8282\u70b9\u7684\u6743\u9650\u5e76\u8fd8\u539f\u6743\u9650\u7ee7\u627f\u3002
|
||||
nodebrowser.unlock=\u89e3\u9501
|
||||
nodebrowser.unlock.tip=\u5220\u9664\u6b64\u8282\u70b9\u4fdd\u7559\u7684\u4efb\u4f55\u9501\u3002\u53d6\u6d88\u4efb\u4f55\u76f8\u5173\u8054\u5de5\u4f5c\u526f\u672c\u7684\u68c0\u51fa\uff0c\u5de5\u4f5c\u526f\u672c\u88ab\u5220\u9664\u3002\u8bf7\u6ce8\u610f\uff0c\u5bf9\u5de5\u4f5c\u526f\u672c\u6240\u505a\u7684\u5168\u90e8\u4fee\u6539\u5c06\u4e22\u5931\u3002
|
||||
nodebrowser.confirm=\u786e\u5b9a\u5417\uff1f?
|
||||
nodebrowser.confirm=\u786e\u5b9a\u5417\uff1f
|
||||
nodebrowser.message.delete=\u5df2\u6210\u529f\u5220\u9664\u8282\u70b9\u3002
|
||||
nodebrowser.message.restore=\u5df2\u6210\u529f\u8fd8\u539f\u8282\u70b9\u3002
|
||||
nodebrowser.message.take-ownership=\u5df2\u6210\u529f\u83b7\u53d6\u6240\u6709\u6743\u3002
|
||||
|
@@ -5714,6 +5714,55 @@ public class NodeApiTest extends AbstractSingleNetworkSiteTest
|
||||
assertTrue(currentPath.equals(expectedPath));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPrimaryPathVersion() throws Exception
|
||||
{
|
||||
setRequestContext(user1);
|
||||
AuthenticationUtil.setFullyAuthenticatedUser(user1);
|
||||
String myNodeId = getMyNodeId();
|
||||
|
||||
// /Company Home/User Homes/user<timestamp>/folder_A
|
||||
String folderName = "folder_A";
|
||||
Folder folder = createFolder(myNodeId, folderName);
|
||||
NodeRef folderNodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, folder.getId());
|
||||
|
||||
// /Company Home/User Homes/user<timestamp>/folder_A/testDoc<GUID>
|
||||
String docName = "testDoc" + GUID.generate();
|
||||
Document doc = new Document();
|
||||
doc.setName(docName);
|
||||
doc.setNodeType(TYPE_CM_CONTENT);
|
||||
HttpResponse response = post(getNodeChildrenUrl(folderNodeRef.getId()), toJsonAsStringNonNull(doc), 201);
|
||||
Document docResp = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
NodeRef docNodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, docResp.getId());
|
||||
|
||||
// Checks that current path and name match
|
||||
String expectedPath1 = "/Company Home/User Homes/" + user1 + "/" + folderName + "/" + docName;
|
||||
Path docPath1 = nodeService.getPath(docNodeRef);
|
||||
Path.ChildAssocElement docPathLast1 = (Path.ChildAssocElement) docPath1.last();
|
||||
String docLocalName1 = docPathLast1.getRef().getQName().getLocalName();
|
||||
String currentPath1 = docPath1.toDisplayPath(nodeService, permissionService) + "/" + docLocalName1;
|
||||
assertTrue(docName.equals(docLocalName1));
|
||||
assertTrue(expectedPath1.equals(currentPath1));
|
||||
|
||||
// Upload document new content supplying a different name
|
||||
String docName2 = "testDoc2" + GUID.generate();
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("name", docName2);
|
||||
Document docResp2 = updateTextFileWithRandomContent(docNodeRef.getId(), 1024L, params);
|
||||
NodeRef docNodeRef2 = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, docResp2.getId());
|
||||
|
||||
// Checks new path and name after new version upload
|
||||
String expectedPath2 = "/Company Home/User Homes/" + user1 + "/" + folderName + "/" + docName2;
|
||||
Path docPath2 = nodeService.getPath(docNodeRef2);
|
||||
Path.ChildAssocElement docPathLast2 = (Path.ChildAssocElement) docPath2.last();
|
||||
String docLocalName2 = docPathLast2.getRef().getQName().getLocalName();
|
||||
String currentPath2 = docPath2.toDisplayPath(nodeService, permissionService) + "/" + docLocalName2;
|
||||
assertFalse(docLocalName1.equals(docLocalName2));
|
||||
assertTrue(docName2.equals(docLocalName2));
|
||||
assertFalse(expectedPath1.equals(currentPath2));
|
||||
assertTrue(expectedPath2.equals(currentPath2));
|
||||
}
|
||||
|
||||
private String getDataDictionaryNodeId() throws Exception
|
||||
{
|
||||
Map params = new HashMap<>();
|
||||
|
Reference in New Issue
Block a user