Compare commits

...

14 Commits

Author SHA1 Message Date
suneet.gupta
ed79acb576 Added tagById validation if node is a tag 2023-02-14 18:14:12 +05:30
suneet.gupta
db420ad375 Added tagById validation if node is a tag 2023-02-13 16:19:03 +05:30
suneet.gupta
48689f3c7f Added tagById validation if node is a tag 2023-02-13 16:15:02 +05:30
suneet.gupta
c34791de34 Added tagById validation if node is a tag 2023-02-13 12:05:43 +05:30
suneet.gupta
14d4202726 Added tagById validation if node is a tag 2023-02-13 12:03:46 +05:30
suneet.gupta
8473b00440 Added tagById validation if node is a tag 2023-02-13 12:01:36 +05:30
suneet.gupta
fcc146818a Added tagById validation if node is a tag 2023-02-10 19:31:04 +05:30
suneet.gupta
b3431571b0 Added tagById validation if node is a tag 2023-02-08 18:21:32 +05:30
suneet.gupta
ce12c9e1e7 Added tagById validation if node is a tag 2023-02-08 18:14:43 +05:30
suneet.gupta
adcf1c526e Added tagById validation if node is a tag 2023-02-08 18:13:37 +05:30
suneet.gupta
c8c6572112 Added tagById validation if node is a tag 2023-02-08 18:12:33 +05:30
suneet.gupta
f03dd62a9c Added tagById validation if node is a tag 2023-02-08 18:11:49 +05:30
suneet.gupta
ddb8e146c7 Added tagById validation if node is a tag 2023-02-08 18:08:18 +05:30
suneet.gupta
9ef4ac69b2 Added tagById validation if node is a tag 2023-02-08 18:03:00 +05:30
5 changed files with 44 additions and 29 deletions

View File

@@ -1,7 +1,7 @@
# dataprep related
alfresco.scheme=http
alfresco.server=localhost
alfresco.port=8082
alfresco.port=8080
# sync service related
sync.scheme=http

View File

@@ -185,7 +185,12 @@ public class TagsImpl implements Tags
public NodeRef validateTag(String tagId)
{
NodeRef tagNodeRef = nodes.validateNode(tagId);
if(tagNodeRef == null)
if(tagNodeRef == null)
{
throw new EntityNotFoundException(tagId);
}
String tag = taggingService.getTagName(tagNodeRef);
if(!taggingService.isTag(tagNodeRef.getStoreRef(),tag))
{
throw new EntityNotFoundException(tagId);
}
@@ -199,6 +204,11 @@ public class TagsImpl implements Tags
{
throw new EntityNotFoundException(tagId);
}
String tag = taggingService.getTagName(tagNodeRef);
if(!taggingService.isTag(storeRef,tag))
{
throw new EntityNotFoundException(tagId);
}
return tagNodeRef;
}
@@ -240,7 +250,11 @@ public class TagsImpl implements Tags
public CollectionWithPagingInfo<Tag> getTags(String nodeId, Parameters params)
{
NodeRef nodeRef = validateTag(nodeId);
NodeRef nodeRef = nodes.validateNode(nodeId);
if(nodeRef == null)
{
throw new EntityNotFoundException(nodeId);
}
PagingResults<Pair<NodeRef, String>> results = taggingService.getTags(nodeRef, Util.getPagingRequest(params.getPaging()));
Integer totalItems = results.getTotalResultCount().getFirst();

View File

@@ -69,7 +69,7 @@ public class TagsImplTest
given(taggingServiceMock.getTagName(TAG_NODE_REF)).willReturn(TAG_NAME);
}
@Test
@Test(expected = EntityNotFoundException.class)
public void testDeleteTagById()
{
//when

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.encryption;
import org.alfresco.error.AlfrescoRuntimeException;

View File

@@ -44,6 +44,7 @@ import java.util.Map;
import java.util.Set;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.rest.framework.core.exceptions.EntityNotFoundException;
import org.alfresco.model.ContentModel;
import org.alfresco.query.EmptyPagingResults;
import org.alfresco.query.PagingRequest;