Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-11909

Folder created from template has incorrect primary path or name

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.2
    • Fix Version/s: 4.2.4
    • Component/s: Share Application
    • Labels:
      None
    • Environment:
      Linux and Alfresco Enterprise 4.2

      Description

      The folder that is created using the space template has an incorrect name behind the scenes in Alfresco - it keeps the name of the template, ie: 'Content Folder' rather than the name you provided. This means that the primary path is not correct. Changing the folder name in the properties will update the behind the scenes information. See the attached screenshots.

      Webscript - alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/folder-templates.post.desc.xml

      the js

      /**

      • Document List Component: Create New Node - create copy of node template in the Data Dictionary
        */
        function main()
        {
        // get the arguments - expecting the "sourceNodeRef" and "parentNodeRef" of the source node to copy
        // and the parent node to contain the new copy of the source.
        var sourceNodeRef = json.get("sourceNodeRef");
        if (sourceNodeRef == null || sourceNodeRef.length === 0) { status.setCode(status.STATUS_BAD_REQUEST, "Mandatory 'sourceNodeRef' parameter missing."); return; }

        var parentNodeRef = json.get("parentNodeRef");
        if (parentNodeRef == null || parentNodeRef.length === 0)

        { status.setCode(status.STATUS_BAD_REQUEST, "Mandatory 'parentNodeRef' parameter missing."); return; }

      // get the nodes and perform the copy - permission failures etc. will produce a status code response
      var sourceNode = search.findNode(sourceNodeRef),
      parentNode = search.findNode(parentNodeRef);
      if (sourceNode == null || parentNode == null)

      { status.setCode(status.STATUS_NOT_FOUND, "Source or destination node is missing for copy operation."); }

      var copy = sourceNode.copy(parentNode, true);
      copy.properties["cm:name"] = json.get("prop_cm_name").toString();
      copy.properties["cm:description"] = json.get("prop_cm_description").toString();
      copy.properties["cm:title"] = json.get("prop_cm_title").toString();
      copy.save();
      model.name = json.get("prop_cm_name").toString();
      }

      main();

      The copy.save() method does not change the primary path.

        Attachments

          Activity

            People

            • Assignee:
              closedbugs Closed Bugs
              Reporter:
              ezeng Eric Zeng
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 7 hours
                7h