Sitemap

Showing posts with label Folders. Show all posts
Showing posts with label Folders. Show all posts

Wednesday, June 10, 2015

UCM: Deleting contents or folders inside a framework folders

Use FLD_DELETE service to delete files or folders.
binder.putLocal("IdcService", "FLD_DELETE")

// Deleting a folder. Use any of the 2 ways below
  binder.putLocal("item1", "fFolderGUID:69A93E7E99FA46CC35CBCEA0E1B9F8DB")
  // binder.putLocal("item1", "path:/Enterprise Libraries/My Library/Folder2")

// Deleting a file. Use any of the 2 ways below
  binder.putLocal("item2", "fFileGUID:8F9E18BB9D8609A0E07F391C8A3737F4")
  //binder.putLocal("item2", "path:/Enterprise Libraries/My Library/Folder4/file1.txt")


UCM: Checkin new content inside a framework folder using RIDC


public class CheckinFrameworkRIDC {

    public static void main(String[] args) {
        IdcClientManager manager = new IdcClientManager();
        try {
            // Creating a new IdcClient Connection using idc protocol
            //IdcClient idcClient = manager.createClient("idc://localhost:4444");
   //IdcContext userContext = new IdcContext("sysadmin");

            // Creating a new IdcClient Connection using HTTP protocol
            IdcClient idcClient = manager.createClient("http://localhost:16200/cs/idcplg");
     IdcContext userContext = new IdcContext("weblogic", "welcome1");
   
            HdaBinderSerializer serializer = new HdaBinderSerializer("UTF-8", idcClient.getDataFactory());
            DataBinder dataBinder = idcClient.createBinder();
            dataBinder.putLocal("IdcService", "CHECKIN_NEW");
            dataBinder.putLocal("dDocTitle", "Framework Folder Testing");
            dataBinder.putLocal("dDocType", "Document");
            dataBinder.putLocal("dSecurityGroup", "Public");
            dataBinder.addFile("primaryFile", new File("C:\\samplefile.txt"));
            dataBinder.putLocal("doFileCopy", "true");
            dataBinder.putLocal("dDocAuthor", "weblogic");
            
            // Either fParentGUID or parentFolderPath/fParentPath needs to be passed. Meatadata defaults are copied from the folder except SecurityGroup and Account
            //dataBinder.putLocal("fParentGUID", "5B0AC7C33BF951078772DFF757535B99");
            dataBinder.putLocal("fParentPath", "/Contribution Folders/ElPiju/Straw Bale/resources");
   
            serializer.serializeBinder(System.out, dataBinder);
            ServiceResponse response = idcClient.sendRequest(userContext, dataBinder);
            DataBinder responseData = response.getResponseAsBinder();
            serializer.serializeBinder(System.out, responseData);
        } catch (IdcClientException ice) {
            ice.printStackTrace();
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }
    }
}


UCM: Framework Folders

When using the FrameworkFolders component, each folder is identified by its fFolderGUID and fParentGUID values. The fFolderGUID is the unique identifier for the folder, and the fParentGUID is set to the value of fFolderGUID for the folder's parent folder.



To list all the 2 contents under Cob folder:
SELECT ffileguid, ffilename, ddocname FROM folderfiles WHERE fparentguid='94B2FCB3A3D15A27E96B927CA80A3BD7';

To list all the 3 folders which are present under Cob folder:
SELECT ffolderguid, ffoldername FROM folderfolders WHERE fparentguid='94B2FCB3A3D15A27E96B927CA80A3BD7';

NOTE: A content item is not associated with fFolderGUID. It has only fParentGUID.

Saturday, April 4, 2015

UCM: Creating a Top Level Folder with No Parent Folder

Out of the box two folders are created and they are Contribution Folder and Library Folders. If you want to create another top level folder you can use the IDC Service COLLECTION_ADD. You can call this service through HTTP by executing the following command in a browser window:

http://HOST_NAME/cs/idcplg?IdcService=COLLECTION_ADD&hasParentCollectionID=true&dParentCollectionID=-1&dCollectionName=FOLDER_NAME&force=1&idcToken=IDC_TOKEN

where
HOST_NAME is your Content Server’s host/cluster name
FOLDER_NAME is the Name of the Parent Folder you want to create
IDC_TOKEN is your environments unique token. You can find this by performing the following:
Click on Browse Content > Contribution Folders > View source in Browser > Click Edit > Find: idcToken