DCTM Rest Service - Copy ACL + Folders

Options
San561
edited September 13, 2016 in Documentum #1

I need to copy ACL + folders using Rest Webservices from Source -> Destination within same repository but different cabinets. I'm able to implement copy operation using rest services and found that ACL's are not copied to destination folder.


Reason - Folder structure is complex and approx 120 folders need to be copied as part of a Template per project. Creating 120+ folders in run time will cause troubles and process may hangup.


Request you to suggest a better approach/way to handle this.

Comments

  • DCTM_Guru
    edited July 21, 2016 #2
    Options

    Whats your code to do this?  What is the ACL getting assigned to the destination folder?  Sounds like the folders are inheriting permissions from either the user who is calling this service or from the parent folder/cabinet.

  • San561
    edited July 21, 2016 #3
    Options

    True sir, it's taking Folder level ACL's at destination.I'm looking for a way to retain the Source level ACL after copying to destination. Else I need to copy all folders and iterate thru them to apply ACL's by manual program.

  • DCTM_Guru
    edited July 21, 2016 #4
    Options

    You are correct in your logic.  Are you manually copy the rest of the folder attributes in your code?  Since you havent posted your comments, I cant tell

  • San561
    edited July 22, 2016 #5
    Options

    Honestly i didn't verified that and not worried on other attributes. For now i tried with subject field by adding some text and it's getting copied successfully.

    Now using my code I copied the folders to destination and writing a File Operation to iterate thru all folders + subfolders and read the Subject tag (where im adding ACL Name) and planning to overide/apply ACL on destination folders.
    Issue faced - Need to find a way to get Absolute Path of folders on DCTM

    e.g :

    folderPath on Documentum = [/Construction Management (CM)/Capital Project/San圣_AR22_111_CN圣]

    folderAbsolutePath =C:\Interface\[\Construction Management (CM)\Capital Project\San圣_AR22_111_CN圣]

    Any other idea to ease up my job ?

  • abc123
    edited July 24, 2016 #6
    Options

    , we checked the DFC/CS API doc and tested the copy behavior, it is impossible to recursively apply the specified ACL during the copy so far. This looks like a common use case, so we will file a new feature request to the underlying API so that we can add it to REST.

    The workaround is as you observed, you need to iterate all sub folders to apply the acl.

  • abc123
    edited July 24, 2016 #7
    Options

    , If you know the root folder URI, you can get its child folder paths, by GET on the link relation "http://identifiers.emc.com/linkrel/folders", with query parameters. Here is an URI example "/repositories/REPO/folders/0b00000580004941/folders?links=false&inline=true&view=r_object_id,object_name,r_folder_path". (get sub folders, inline entries, exclude links, view 3 attributes only).

  • San561
    edited July 25, 2016 #8
    Options

    Thanks Sir, it would be very useful for folks like me if you can get this feature using REST. Please keep me posted with planned dates of release.

    Also if i'm correct there is no way of reading all folders in one shot using URL and pass it to Java FILE Operation , i realized this after few test scenario's.

    Even if i read the stream from URL , i can read only the details displayed on page when i use <link rel="http://identifiers.emc.com/linkrel/folders"> but not all folders. Can you suggest any better approach ? Literally I'm stuck

  • abc123
    edited July 25, 2016 #9
    Options

    , your understanding is correct. The REST API lists 1 level of paginated child folders (objects) only, not all descendants. It is a challenge for both client and server to handle a large folder tree in one shot. To iterate all folder descendants in REST API, you need to list folder children level by level (each child folder has the link relation "../folders" as well if the original query parameter is set with links=true).

  • San561
    edited September 6, 2016 #10
    Options

    Checking on if you are able to add new feature of copying folder + acl?

  • abc123
    edited September 7, 2016 #11
    Options

    Yes, , with effort of our REST engineers, we added it to REST 7.3 at the last minute before feature freezing. Copy now will have an option to specify whether applying the source folder's ACL to the replicated objects. If not (default), the system default ACL will be applied to the replicated objects.

    Regards,

    William

  • San561
    edited September 7, 2016 #12
    Options

    Thanks alot Sir. can you share the link to see the sample code and to test it.

  • jonathan.robie
    edited September 7, 2016 #13
    Options

    Thanks to the Shanghai team for squeezing this in!

    Jonathan

  • abc123
    edited September 7, 2016 #14
    Options

    Hi , REST 7.3 is not general available yet, but will come soon. Here just showing you an idea about how to make a JSON copy request.

    {

      "href":"<to-copy-sysobject-resource-uri>",
      "deep-copy":true,

      "replicate-vd-children":true,

      "retain-acl":true,

      "properties": {

         "object_name":"<new name>", ...

      }

    }

    As the sample indicates, copy in REST 7.3 will have these further improvements:

    • replicate virtual document children for a virtual document node
    • retain acl for a folder descendants
    • copy with new properties

    Regards,

    William

  • San561
    edited September 12, 2016 #15
    Options

    Thanks a lot Sir :-) eagerly waiting to consume REST 7.3 which will save my need !!!

  • San561
    edited September 13, 2016 #16
    Options

    Sir, I can see WEBTOP 6.8.2 released on 09/12. Is there any plan to release REST 7.3 this week? or any tentative date

  • abc123
    edited September 13, 2016 #17
    Options

    Many people like you and me are looking forward to seeing REST 7.3 release. As planned, it will be released together with platform in Q4, most possibly in November.

    Regards,

    William

  • SenthilKumar001
    edited January 30, 2019 #18
    Options

    My requirement is to create a folder hierarchy template once and deep copy the template folder whenever required so that there is no need of creating the folders everytime but this is not working in documentum rest api version 7.3

    Target folder id - 0b000ABC
    TEMPLATE folder id - 0b0003XYZ ( this folder contains subfolder)

    POST http://localhost:8080/dctm-rest/repositories/REPO/objects/0b000ABC

    request body
    {
    "href":"http://localhost:8080/dctm-rest/repositories/REPO/objects/0b0003XYZ",
    "deep-copy": true,
    "replicate-vd-children": true,
    "retain-acl":true,
    "properties": {
    "object_name":"ABC1",
    "r_object_type": "dm_sysobject"
    }
    }

    Note : Tried both dm_sysobject and dm_folder options in r_object_type but deep copy is not working

  • SenthilKumar001
    edited February 25, 2019 #19
    Options

    Below is the correct code and work in Documentum 7.3 rest API

    POST http://localhost:8080/dctm-rest/repositories/REPO/folders/[target_folder_id]/objects

    {
    "href":"http://localhost:8080/dctm-rest/repositories/REPO/folders/[source_folder_id]",
    "deep-copy": true,
    "replicate-vd-children": true,
    "retain-acl":true,
    "properties": {
    "object_name":"NEW FOLDER NAME"
    }
    }