3 Replies Latest reply: Apr 8, 2013 1:59 PM by Bunty RSS

    How to create/delete/zip files into UCM

    885031
      We’re working for an enhancement where it requires to export publishing all entity level data (payloads) to UCM. Here, each payload should be generated as an XML file. Our requirement is to zip those all generated files and uploaded into UCM. It is not an Import Export process.

      Basic question here is, Is it possible to do create/delete/zip files using direct UCM API calls rather than from Attachments API?

      If yes,
      1.     Is there a way to save file temporarily so that at the end we can zip and upload into UCM?
      2.     What is the API for zipping UCM files.

      I’ve tried below code to insert a file into UCM. (as per the doc http://docs.oracle.com/cd/E23943_01/doc.1111/e10807/c23_ridc.htm)

      JaxWSClient jaxwsClient = (JaxWSClient) StellentUtils.getIdcClient("FusionAppsContentRepository");
      IdcContext userContext = new IdcContext(ADFContext.getCurrent().getSecurityContext().getUserName());

      DataBinder binder = jaxwsClient.createBinder();
      binder.putLocal (IdcService.NAME, IdcService.CHECKIN);
      binder.putLocal ("dDocTitle", "tempfile");
      binder.putLocal ("dDocName", "temp");
      binder.putLocal ("dDocType", "Document");

      // add a file
      binder.addFile ("primaryFile", new File("/scratch/software/file.txt"));

      //checkin the file
      ServiceResponse response = jaxwsClient.sendRequest(userContext, request);

      But the user doesn’t have privilege for IdcService of type “CHECKIN_UNIVERSAL” and which is causing of below failure.

      <?hda version="11gR1-11.1.1.7.0-idcprod1-121003T173259" jcharset="UTF-8" encoding="UTF-8"?>
      @Properties LocalData
      ClientEncoding=UTF-8
      ECID-Context=1.b3219779b3a4ade3:-3c7e1c4e:13de91a9772:-8000-000000000000a157;kXhsv0ZGZKSULGSPXKTPJHSRo4USpLO
      IdcService=CHECKIN_UNIVERSAL
      NoHttpHeaders=0
      StatusCode=-18
      StatusMessage=Content item 'temp' was not successfully checked in. User 'SCM_USER10A' does not have sufficient privileges.
      UserDateFormat=iso8601
      UserTimeZone=UTC
      blDateFormat=yyyy-MM-dd HH:mm:ssZ!tUTC!mAM,PM
      blFieldTypes=xIPM_APP_1_6 bigtext,xIPM_APP_1_5 bigtext,xIPM_APP_1_8 bigtext,xIPM_APP_1_7 bigtext,xIPM_APP_1_9 bigtext,xWCPageId bigtext,xIPM_APP_2_0 bigtext,xIPM_APP_1_0 bigtext,xPartnerLevel bigtext,xIPM_APP_1_2 bigtext,xIPM_APP_1_1 bigtext,xIPM_APP_1_4 date,dSubscriptionNotifyDate date,xIPM_APP_1_3 decimal,xIPMSYS_BATCH_ID1 int,xIPMSYS_PARENT_ID int,xWebFlag text,xIPMSYS_STATUS text,xStorageRule text,dOutDate date,xExternalDataSet bigtext,xIPMSYS_REDACTION int,xForceFolderSecurity text,xIPM_APP_1_10 bigtext,xPartitionId text,xIPM_APP_1_11 bigtext,dInDate date,xReadOnly text,xIPMSYS_BATCH_SEQ text,xWCTags text,dMessage message,xInhibitUpdate text,xWCWorkflowAssignment text,xPartnerProgram bigtext,dCreateDate date,xIPMSYS_SCKEY text,xHidden text,dSubscriptionCreateDate date,xPartnerType bigtext,dReleaseDate date,StatusMessage message,xCollectionID int,dSubscriptionUsedDate date,xIPMSYS_APP_ID text,xWCWorkflowApproverUserList memo,xIdcProfile text,xComments memo
      dDocName=temp
      dDocTitle=tempfile
      dDocType=Document
      dUser=SCM_USER10A
      primaryFile=file.txt
      @end


      Please anyone suggestion approach to solve my problem.