Merged 5.2.N (5.2.1) to HEAD (5.2)

129608 mmuller: Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
      129597 mmuller: Merged 5.0.N (5.0.5) to 5.1.N (5.1.2) (PARTIAL MERGE)
         129593 mmuller: Merged 5.0.4 (5.0.4) to 5.0.N (5.0.5)
            129585 mmuller: Merged 5.0.3 (5.0.3.9) to 5.0.4 (5.0.4)
               129514 mmuller: MNT-16380, REPO-927, ESC-469 Regression fix from 4.2 --> 5.0. Can now use relative paths again.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@129876 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2016-08-25 10:39:50 +00:00
parent 421751d17f
commit b0fe463739
2 changed files with 118 additions and 100 deletions

View File

@@ -430,6 +430,13 @@ public class StreamContent extends AbstractWebScript
}
ObjectReference(StoreRef ref, String id)
{
String[] relativePath = id.split("/");
// bug fix MNT-16380
// for using a relative path to a node id eg. 18cc-.../folder1/.../folderN/fileA.txt
// if only one slash we don't have a relative path
if (relativePath.length <= 2)
{
if (id.indexOf('/') != -1)
{
@@ -437,6 +444,15 @@ public class StreamContent extends AbstractWebScript
}
this.ref = new NodeRef(ref, id);
}
else
{
String[] reference = new String[relativePath.length + 2];
reference[0] = ref.getProtocol();
reference[1] = ref.getIdentifier();
System.arraycopy(relativePath, 0, reference, 2, relativePath.length);
this.ref = repository.findNodeRef("node", reference);
}
}
ObjectReference(StoreRef ref, String[] path)
{

View File

@@ -62,6 +62,7 @@ import org.alfresco.repo.web.scripts.thumbnail.ThumbnailServiceTest;
import org.alfresco.repo.web.scripts.transfer.TransferWebScriptTest;
import org.alfresco.repo.web.scripts.workflow.ActivitiWorkflowRestApiTest;
import org.alfresco.repo.web.scripts.workflow.WorkflowModelBuilderTest;
import org.alfresco.repo.web.scripts.content.ContentGetTest;
/**
* Web Scripts test suite
@@ -109,6 +110,7 @@ public class WebScriptTestSuite extends TestSuite
suite.addTestSuite( FacetRestApiTest.class );
suite.addTestSuite( CommentsApiTest.class );
suite.addTestSuite( DeclarativeSpreadsheetWebScriptTest.class );
suite.addTestSuite( ContentGetTest.class);
suite.addTestSuite( XssVulnerabilityTest.class );
suite.addTestSuite( LinksRestApiTest.class );
suite.addTestSuite( RemoteFileFolderLoaderTest.class );