BAPI to checkin file as new content version

Hi,
I am looking for a BAPI that allows me to checkin an original as a new content version via SAP JCo (similar to the "Check In as New Version" UI feature). I couldn't get it to work using the standard BAPIs BAPI_DOCUMENT_*
Is there a remote capable standard BAPI that does the job?
Regards
Michael

Hi Thierry,
thanks for your quick response.
I tried that one. I found it to checkin new files.
With BAPI_DOCUMENT_CHECKIN_REPLACE2 I can replace originals.
But I failed to create new content version of an existing orginal.
Could you provide me with an example, of how to fill the BAPI parameters in order to create a new content version?
Many thanks
Michael

Similar Messages

  • Prestaged Content and new Content Versions

    I have a question concerning prestaged content in an SCCM 2012 R2 Environment. I have created several prestaged content files of some very large Applikations and Software Update Packages. In the meanwhile some of the Software Update Packages
    have a new Content Version, because some expired Updates where removed from the Package.
    So, if I now extract those Update Packages on a Distribution Point, the Content is not getting registrated as successfully distributed in the Content Monitoring Workspace, because the Content Version has increased in the meantime. I can
    see that after Content is extracted successfully, the success Status Message is send to the Site Server, but the status stays on waiting for prestaged content.
    I can’t sent a new USB Stick with the newer Version of those files to those offices and I can’t send the whole new Package via WAN to those office. I there a way to only create something like a delta prestaged content file or send only
    the delta via WAN to those distribution point ?

    See scenario #3 here: http://blogs.technet.com/b/configmgrdogs/archive/2015/03/11/different-scenarios-for-using-prestaged-content.aspx
    Torsten Meringer | http://www.mssccmfaq.de

  • After running ridc to checkin file into Oracle Content Center Server there is error: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line

    Hi,
       I use ridc to check in file into Oracle Center Content server. There is no problem at the beginning. But after running for several days, there is following error.
    I must restart my program to solve this issue.
       Can anyone help me solve this problem?
    Thanks,
    Tony
    2013-07-11 12:24:31,189 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
    ception: java.io.IOException: Input terminated before being able to read line
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
            at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
            at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
            at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
            ... 17 more
    Caused by: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
            ... 19 more
    2013-07-11 12:24:33,005 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
    ception: java.io.IOException: Input terminated before being able to read line
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
            at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
            at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
            at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
            ... 17 more
    Caused by: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
            ... 19 more
    2013-07-11 12:24:37,870 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
    ception: java.io.IOException: Input terminated before being able to read line
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
            at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
            at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
            at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
            ... 17 more
    Caused by: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
            ... 19 more
    2013-07-11 12:24:39,722 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
    ception: java.io.IOException: Input terminated before being able to read line
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
            at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
            at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
            at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
            ... 17 more
    Caused by: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
            ... 19 more

    The following is my testing code.
    package ebilling;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.security.SecureRandom;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Calendar;
    import java.util.List;
    import java.util.Properties;
    import java.util.concurrent.LinkedBlockingQueue;
    import java.util.concurrent.ThreadPoolExecutor;
    import java.util.concurrent.TimeUnit;
    import oracle.stellent.ridc.IdcClient;
    import oracle.stellent.ridc.IdcClientManager;
    import oracle.stellent.ridc.IdcContext;
    import oracle.stellent.ridc.model.DataBinder;
    import oracle.stellent.ridc.model.DataObject;
    import oracle.stellent.ridc.model.DataResultSet;
    import oracle.stellent.ridc.model.TransferFile;
    import oracle.stellent.ridc.protocol.ServiceResponse;
    import org.apache.commons.lang.StringUtils;
    public class UCMContentManager {
         * Check in a file into a Oracle WebCenter Content Server and return content id of uploaded content item in Oracle WebCenter Content Server.    
         * @param properties        The Oracle WebCenter Content Server connection properties.
         * @param contentFile       This file will be checked in a Oracle WebCenter Content Server.
         * @param path              The location path of checked in file in Oracle WebCenter Content Server. This path includes the file name.<br>
         *                             For example, "/folder1/folder2/file1.txt". The "file1.txt" is the file name part. <br>
         *                             The file name will be used as dDocName in Oracle WebCenter Server. It must be unique.<br>
         * @throws ContentException The exception when uploading file into Oracle WebCenter Content Server.
         * @return                  The content id of uploaded content item in Oracle WebCenter Content Server.
        public String saveContent(Properties properties, File contentFile, String path) throws ContentException{
            if(path.endsWith(SLASH)) {
                throw new ContentException("Require file name in Content Management Server");
            if(!path.startsWith(SLASH)) {
                throw new ContentException("The file store path in Content Management Server should be absolute.");
            if (path.indexOf("//") != -1) {
                path = path.replace("//", SLASH);
            String[] paths = path.split(SLASH);       
            String[] parents = new String[paths.length - 1];
            String itemName = paths[paths.length-1];
            System.arraycopy(paths, 0, parents, 0, paths.length-1);
            ServiceResponse response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                //create the parent folders if they don't exist
                String folderGUID = makeFolders(properties, parents);
                //check in the file
                DataBinder requestData = client.createBinder();
                requestData.putLocal("IdcService", "CHECKIN_UNIVERSAL");
                requestData.putLocal("IsJava", "1");
                requestData.putLocal("dDocName", itemName);           
                requestData.putLocal("dDocTitle", itemName);           
                requestData.putLocal("dDocType", "Binary");
                requestData.putLocal("dSecurityGroup", "Public");
                requestData.addFile("primaryFile", new TransferFile(contentFile));
                response = client.sendRequest(connectionContext, requestData);           
                DataBinder responseData = response.getResponseAsBinder();
                //String did = responseData.getLocal("dID");           
                String dDocname = responseData.getLocal("dDocName");
                closeResponse(response);
                //link the file in a folder
                requestData = client.createBinder();
                requestData.putLocal("IdcService", "FLD_CREATE_FILE");
                requestData.putLocal("fParentGUID", folderGUID);
                String fileType = "owner";
                requestData.putLocal("fFileType", fileType);           
                requestData.putLocal("dDocName", dDocname);           
                response = client.sendRequest(connectionContext, requestData);
                return dDocname;
            } catch (Throwable e) {
                throw new ContentException(e);
            } finally{
                closeResponse(response);
        public void deleteContent(Properties properties, String contentId) throws ContentException{
            List<String> didList = getDIds(properties, contentId);
            contentId = contentId.toUpperCase();
            ServiceResponse    response = null;
            try {           
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                DataBinder requestData = null;
                for(int i=0; i<didList.size(); i++) {
                    String did = didList.get(i);
                    requestData = client.createBinder();
                    requestData.putLocal("IdcService", "DELETE_DOC");
                    requestData.putLocal("dDocName", contentId);               
                    requestData.putLocal("dID", did);   
                    response = client.sendRequest(connectionContext, requestData);
                    closeResponse(response);
                    //delete parent folder
    //                try {
    //                    requestData = client.createBinder();           
    //                    requestData.putLocal("IdcService", "FLD_DELETE");       
    //                    requestData.putLocal("item1", "path:" + parentPath);
    //                    requestData.putLocal("constructDialog", "1");
    //                    response = client.sendRequest(connectionContext, requestData);
    //                } catch (Exception e) {
    //                    // TODO: handle exception
            } catch (Exception e) {
                throw new ContentException(e);
            } finally {
                closeResponse(response);
        public int getFileCountInFolder(Properties properties, String path) throws ContentException{
            ServiceResponse    response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                DataBinder binder = client.createBinder();
                binder.putLocal("IdcService", "FLD_BROWSE");
                binder.putLocal("path", path);
                response = client.sendRequest(connectionContext, binder);
                DataBinder result = response.getResponseAsBinder();
                String num = result.getLocal("numFiles");
                return Integer.parseInt(num);
            catch (Exception e) {
                throw new ContentException(e);
            } finally {
                closeResponse(response);
        private String getFolderGUID(Properties properties, String path) throws ContentException {
            ServiceResponse    response = null;       
            String tmpFolderGUID = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;   
                DataBinder requestData = client.createBinder();
                requestData.putLocal("IdcService", "FLD_INFO");
                requestData.putLocal("path", path);       
                response = client.sendRequest(connectionContext,
                        requestData);
                DataResultSet result = response.getResponseAsBinder().getResultSet("FolderInfo");
                tmpFolderGUID = result.getRows().get(0).get("fFolderGUID")
                    .toString();
                if(StringUtils.isBlank(tmpFolderGUID))
                    tmpFolderGUID = null;           
            } catch (Exception e) {               
            } finally {
                closeResponse(response);
            return tmpFolderGUID;
        public boolean deleteFolder(Properties properties, String path) throws ContentException {
            if(getFolderGUID(properties, path)==null)       
                return false;
            int fileCount = getFileCountInFolder(properties, path);
            ServiceResponse    response = null;
            if(fileCount==0) {
                try {
                    IdcClientManager manager = new IdcClientManager();
                    IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                    client.getConfig().setProperty ("http.library", "apache4");
                    String user = properties.getProperty(USERNAME_PROPERTY);
                    String pwd = properties.getProperty(PASSWORD_PROPERTY);
                    IdcContext connectionContext = new IdcContext(user, pwd);
                    pwd = null;               
                    DataBinder binder = client.createBinder();   
                    binder.putLocal("IdcService", "FLD_DELETE");       
                    binder.putLocal("item1", "path:" + path);
                    binder.putLocal("constructDialog", "1");
                    response = client.sendRequest(connectionContext, binder);
                    return true;
                catch (Exception e) {
                    throw new ContentException(e);
                } finally {
                    closeResponse(response);
            } else {
                return false;
        private String buildPath(String[] arr, int i) {
            StringBuilder buf = new StringBuilder();
            for(int j=0; j<=i; j++) {
                buf.append(arr[j]);
                buf.append(SLASH);
            return buf.toString();
        private String makeFolders(Properties properties, String[] paths) throws ContentException{
            String folderGUID = "";
            ServiceResponse response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                String parentFolderGUID = null;
                for(int i=0; i<paths.length; i++) {
                    String fullPath = buildPath(paths, i);
                    DataBinder requestData = null;                   
                    parentFolderGUID = folderGUID;
                    folderGUID = getFolderGUID(properties, fullPath);
                    boolean exists = folderGUID!=null;
                    DataResultSet result = null;               
                    if(!exists) {
                        //create new folder
                        try {
                            requestData = client.createBinder();                   
                            requestData.putLocal("IdcService", "FLD_CREATE_FOLDER");
                            requestData.putLocal("fParentGUID", parentFolderGUID);
                            requestData.putLocal("fFolderName", paths[i]);
                            response = client.sendRequest(connectionContext, requestData);
                        } finally {
                            closeResponse(response);
                        //retrieve folderGUID of new folder
                        folderGUID = getFolderGUID(properties, fullPath);                   
            } catch (Throwable e) {
                throw new ContentException(e);
            } finally{
                closeResponse(response);
            return folderGUID;
        public List<String> getDIds(Properties properties, String contentId) throws ContentException{
            contentId = contentId.toUpperCase();
            List<String> didList = new ArrayList<String>();
            ServiceResponse    response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                DataBinder requestData = null;
                requestData = client.createBinder();
                requestData.putLocal("IdcService", "GET_SEARCH_RESULTS");
                requestData.putLocal("SortField", "dInDate");
                requestData.putLocal("SortType", "DESC");
                requestData.putLocal("QueryText", "dDocName <matches> `" + contentId +"`");
                response = client.sendRequest(connectionContext, requestData);
                DataBinder result = response.getResponseAsBinder();
                DataResultSet resultSet = result.getResultSet("SearchResults");
                for (DataObject dataObject : resultSet.getRows()) {
    //                System.out.println("ID : " + dataObject.get("dID")+" dDocName : "
    //                        + dataObject.get("dDocName") + " Title : " + dataObject.get("dDocTitle")
    //                        + " Author : " + dataObject.get("dDocAuthor") + " Security Group : "
    //                        + dataObject.get("dSecurityGroup"));
                    String did = dataObject.get("dID");
                    didList.add(did);
                    //break;
            } catch (Exception e) {
                throw new ContentException(e);
            } finally{
                closeResponse(response);
            return didList;
         * Get the file content represented by contentId from a Oracle WebCenter Content Server.
         * The return value is the input stream of retrieved file content.
         * @param properties        The Oracle WebCenter Content Server connection properties.
         * @param contentId         The Content ID for the content item in Oracle WebCenter Content Server.
         * @throws ContentException The exception when retrieving content from Oracle WebCenter Content Server.
         * @return                  The input stream of retrieved file content.
        public InputStream retrieveContent(Properties properties, String contentId) throws ContentException{
            try {
                return new FileInputStream(retrieveContentFile(properties, contentId));
            } catch (Throwable e) {
                throw new ContentException(e);
        public File retrieveContentFile(Properties properties, String contentId) throws ContentException {
            contentId = contentId.toUpperCase();
            ServiceResponse response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                DataBinder binder = client.createBinder();
                binder.putLocal("IdcService", "GET_FILE");
                //binder.putLocal("dID", dID);
                binder.putLocal("dDocName", contentId);
                binder.putLocal("RevisionSelectionMethod", "Latest");
                response = client.sendRequest(connectionContext, binder);
                InputStream in = null;
                OutputStream out = null;
                String edxhome = System.getProperty("edx.home");
                File tmpParent = new File(edxhome);
                tmpParent = new File(tmpParent, "Output");
                tmpParent = new File(tmpParent, "tmp");
                tmpParent.mkdirs();
                File tmpFile = File.createTempFile("down_", "_ucm", tmpParent);
                tmpFile.deleteOnExit();
                try {
                    in = response.getResponseStream();
                    out = new FileOutputStream(tmpFile);
                    byte[] buf = new byte[1024];
                    int read = -1;
                    while((read = in.read(buf))!=-1) {
                        out.write(buf, 0, read);
                } finally{
                    try {
                        if(in!=null)
                            in.close();
                    } catch (Exception e2) {
                    try {
                        if(out!=null)
                            out.close();
                    } catch (Exception e2) {
                return tmpFile;
            } catch (Throwable e) {
                throw new ContentException(e);
            } finally{
                closeResponse(response);
        private void closeResponse(ServiceResponse response) {
            if(response!=null) {
                try {
                    response.close();
                } catch (Exception e) {
        private static final String SLASH = "/";   
        private static final String URL_PROPERTY = "contentServerURL";
        private static final String USERNAME_PROPERTY = "contentServerUser";
        private static final String PASSWORD_PROPERTY = "contentServerPassword";
        static volatile boolean flag = false;
        static class UploadTask implements Runnable{
            public void run() {           
                try {
                    while(!flag) {
                        UCMContentManager manager = new UCMContentManager();
                        Properties properties = new Properties();
                        properties.put(URL_PROPERTY, "https://slc402124:16201/cs/idcplg");
                        properties.put(USERNAME_PROPERTY, "weblogic");
                        properties.put(PASSWORD_PROPERTY, "weblogic1");
                        File contentFile = new File("C:/toding/mypro/UCM/test.txt");
                        String parentPath = "/new/test/multiThreadUpload/";
                        String location = makePath(parentPath);
                        manager.saveContent(properties, contentFile, location);
                        System.out.println(location);
                        Thread.sleep(5000);
                } catch (Exception e) {
                    e.printStackTrace();
                    flag = true;
        public static void main(String[] args) throws Exception{
            ThreadPoolExecutor executor = new ThreadPoolExecutor(10, 10, 60, TimeUnit.SECONDS,
                     new LinkedBlockingQueue<Runnable>());
            for(int i=0; i<10; i++) {
                 UploadTask uploadTask = new UploadTask();
                 executor.execute(uploadTask);
            while(!flag) {
                Thread.sleep(5000);
            executor.shutdown();
        public static String makePath(String parentPath) {
            StringBuilder buf = new StringBuilder();
            buf.append(parentPath);
            if(!parentPath.endsWith("/")) {
                buf.append("/");
            Calendar rightNow = Calendar.getInstance();
            String pattern = "yyyyMMdd";
            SimpleDateFormat simDateForm = new SimpleDateFormat(pattern);
            String dateStr = simDateForm.format((rightNow).getTime());       
            pattern = "HHmmssSSS";
            simDateForm = new SimpleDateFormat(pattern);
            String timeStr = simDateForm.format((rightNow).getTime());
            buf.append(dateStr);
            buf.append("/");
            buf.append(timeStr);
            buf.append("_");
            buf.append(random.nextInt(10000));
            String finalLocation = buf.toString();
            return finalLocation;
        private static SecureRandom random = new SecureRandom();

  • I can not load up my files on newer illustrator version. Please help me

    I recently saved my illustrator work files on an external hard drive due to me needing repair on my computer at the Apple store. I got it back with everything erased. So I had to redownload the illustrator from adobe but apparently its a different version from one i had before. Now that I have it back im trying to load my files but its telling me I have the wrong software. Please help
    Vnh Chung
    4079131721
    vchung78@gmai;

    What exactly is the warning in the dialog box?
    Did you save directly to the external drive or did you copy the files there?
    Did the files work directly after you copied them to the external drive? Did you test that with your old version?
    Do you know you can return to a previous version?
    Install a previous version of any Creative Cloud application

  • Viewing a pdf file with new and new content

    Hello folks,
    Assume that one creates a pdf and uses Preview or Reader to view it.
    Then adds something to the picture and opens the file again: new content, old filename.
    One would like to see one of the following schemes:
    a) Open would close the old window and present the new content in a new
    window.
    b) Open would keep the old window and create a new window for new content.
    What happens is:
    c) Open says: "I've already displayed a file with this name, I don't need to do a thing."
    Is there a way to force behaviour a) or b) ?
    Thanks,
    Miklos

    If the mountain does not come to Muhammad, then Muhammad goes to the mountain.
    On this basis I wrote a short perl script that increments a number, and constructs a new
    filename from the original filename and the incremented number.
    Then it copies the original file to the new name and runs Reader or Preview on the new file.
    Now I can see as many versions together as I like.
    Miklos

  • Problem in Creation of Content versions

    Dear Friends,
    As I know we can create many content versions, when it is activated.
    I have a doc. type ZAC with KPRo checked, and all statuses associated are checked with content version. I am using the workstation application MS word (DOX) in which content version as well as additional files has been checked
    Statuses defined for ZAc doc. type - Submission ; review ; released
    I have defined workstation apllication in network for DOX
    PC     DOX     1     Winword 2007     %SAP-OFFICE-INTEGRATION.INPLACE%
    PC     DOX     2     Winword 2007     %SAP-OFFICE-INTEGRATION.OUTPLACE%
    PC     DOX     3     Winword 2007     %SAP-OFFICE-INTEGRATION.INPLACE% %MAXSIZE%
    I created DIR.
    Changed to new statusu2026and moved to storage category, it prompted for log field, given. When I am viewing Original it prompted permissions / with stop protection etc (using MS office 2007) . Clicked on stop protection and did changes. The changes were not considered in originals. No new content version created.
    I have created another DIR.
    Not stored in storage category. Open the DIR in change mode,  select the originals on origianl tab,  click on check in as new version, entered log field. After selecting orinals, when I right click I am getting options: check in ; check in as ..;  check in as new version. No changes in Word document recorded. No new content version created.
    I have created 3rd DIR.
    Not stored in storage category. Open the DIR in change mode,  select the originals on origianl tab, change the tab and changed the status. No changes in Word document recorded. No new content version created.
    Did I miss any steps ? Why I couldn't able to make new content version?
    Regards,
    Sai Krishna

    Hi Pradeep,
    I have tried the same way. It didn't work for me.
    Can you clarify the following:
    1. If we want to make content version does the document to be check in or not ?
    2. Does we need to store the outside SAP & save as new one ?
    I go to CV02N, Originlal is not check in, open the originals, it open in SAP . Edited, saved the transaction.
    No changes saved.
    Then go to CV02N one more time done changes, changed status, clicked on check in as new version, then also changes didn't save.
    Can u explain me where I am missing ?
    Regards,
    Sai Krishna

  • Identification for Content versions

    Hi Gurus
    Is it possible to give different files names for each content version. Suppose there is a original file (example.pdf), when user create a new content version then different file name to be given by the user. For example example-1.pdf.
    The problem is that if any new content version is created then it is stored under the original file name and not able to give a new name for the content version.
    Regards
    Raja

    Hi Ravindra
    Thanks for your reply.
    I have downloaded the original file and renamed it, then attached the new file as "Copy as New Version" then checked in to the storage area.. Here the system doesn't create any new content version. The new file is attached as 2nd original. If i do the same then 3rd original file is only created in the system and content versions are not created at all. i can't see latest content version (in Green light) and old versions (Yellow light) in the system. Even though i defined the content version for the workstation application, the updated files are created as separate original files.
    Can you please help / correct me to solve this problem.
    Regards
    Raja.

  • Add new Content to a html/plain file

    Hi Everybody,
    how can is it possible to add new content (a new line) to a existing html/plain file? I have two methods, with the first one i can create a file but with the second one it is not possible to add new content to the just created file. What is my mistake?
    Create a file (works!)
    IResourceContext ctx1 = buildResourceContext();     
    RID rid1 = RID.getRID("/SP");     
    final IResourceFactory aResourceFactory = ResourceFactory.getInstance();
    aCollection =(ICollection) aResourceFactory.getResource(rid1, ctx1);
    String out = new String("<h3> Welcome </h3>");     
    filedataStream = new ByteArrayInputStream( out.getBytes() );
    fileContent =
         new Content(
           filedataStream,
           "text/html",
           filedataStream.available());
    if (aCollection != null) {          
         fileResource = aCollection.createResource(
                       "NewFile.html",
                       null,
                       fileContent );
    Add new Conent (doesn't work)
    private void addNewContentToFile(){
    IResourceFactory factory = ResourceFactory.getInstance();               
    IResourceContext ctx = buildResourceContext();                         
    RID rid = RID.getRID("/SP/NewFile.html" );
    IResource resource = factory.getResource(rid,ctx);
    String out = new String("<h3> my New Line </h3>");
    ByteArrayInputStream data = new ByteArrayInputStream(out.getBytes());
    IContent newContent = new Content(data, "html/plain", data.available());
    resource.updateContent( newContent );
    regards,
    Seed
    Edited by: seed_mopo on Oct 28, 2008 10:49 AM

    Sorry, there was an exception (NoCheckOut...) --> Versioning = false.

  • Content version,Additional file

    Dear all,
    plz let me know what us used of follwoing indicator in workstation detail,explain me with example.
    1) Content version
    2) Additional file
    Kindly help
    Rgds

    hi,
    1. Additional file
    You can maintain additional files for a document type whose have been original files have been stored via Knowledge Provider.
    You can call up functions for the additional files in the document info record in the tab page original files.
    Dependencies
    You can determine the scope of the originals model in Customizing Docuement Management System under the settings for the workstation application.
    Example
    You can create several graphics and the print template for a text file.
    Original file    Additional file
    Text file         Graphic
                        Print template
    2.Content vertion
    You can display content versions in document info records on the Originals tab page.
    Dependencies
    You can create content versions in the following way:
    Manually while processing a document info record
    The Original -> Store as new version function is only active for document types whose original application files are stored in a storage system (content repository) using the Knowledge Provider.
    Automatically while setting a chosen status.
    See also: Define document type -> Define document status.
    Benakaraj

  • How can I convert an old Numbers file to be compatible with the new Numbers version, without having access to the old?

    I received a Numbers file created in iWorks version 8 or earlier, but only have the newest version of Numbers on my MacBook Air. I can't request the sender to reformat the file. Is there any way to convert the file so I can open it in the new Numbers version?

    Are you sure you don't still have Numbers from iWork '09 on your MacBook Air. My Mid 2012 does. To be certain you can look in the Applications folder to see if there is an iWork 09 folder. You can also use Spotlight search to see if it will find that Numbers as well as the current one.
    If you do find to 09 version: iWork '09 and iWork '08: File compatibility

  • My DVR security sofware that I access remotely uses a "dvr .ocx" file....when I try it in Firefox , either the latest non beta (3.6.1.5) or the new beta version (4.0 rc) it will NOT work as it says the plugin is missing... it works in IE 8,but not IE9...

    My machine is Top of the range (my Company builds them so it had better be :) )
    Amd 1100t , 8gb ram , Windows 7 64 bit etc, etc...
    The is not a hardware problem , but a software problem with FF...Any help would be appreciated as I hate using IE 8 for anything at all :( but I have to keep it on my machines just to run my remote security cameras at my Computer shop ???
    Original question...as question length is limited ...not very bright that limit by the way :(
    "My DVR security sofware that I access remotely uses a "dvr .ocx" file....when I try it in Firefox , either the latest non beta (3.6.1.5) or the new beta version (4.0 rc) it will NOT work as it says the plugin is missing... it works in IE 8 (unfortunately) but not IE9...
    As I own a Computer company I am fairly computer literate but cannot find a plugin that allows this to work in Firefox.... but I would have expected it to work in the new Firefox :(
    All the best, Brett :)

    The longer this thread continues, the more ancillary comments you throw in that aren't directly pertinent to your problem with your DVR software not working with Firefox 4.0. Sorry, I don't intend to continue with this discussion.
    I do agree that ''something'' needs to be done better with regards to plugins for Firefox, but I do disagree with you as to whose responsibility that ''something'' is.

  • The new updated version of iMovie 10 won't let me open my previous files I created before the update today. I have a wedding that I'm trying to finish and deliver and now I can't because that file version won't open. I keep getting an error message

    Hello,
    Please help me figure this out. I'm very unhappy at the moment. I'm fustrated and don't have any idea how to revert to the original version before the update was done on iMovie 10. I NEVER hated APPLE until NOW!! I love APPLE products and apps so please help me stay in that mindset. So I worked on some movie projects when I got my macbook pro 6 months ago. I update reguarly. I saw the update prompt and honestly, I did not think I would have ANY issuess with opening my previous files that I created only a few months ago with this updated version.The new updated version of iMovie 10 won't let me open my previous files I created before the update today. I have a wedding that I'm trying to finish and deliver and now I can't because that file version won't open. I keep getting an error message and the iMovie app closes. Last night I saw the file and tried to open it but no luck. Error message came up again. I reboot and turned off my laptop for the evening and tried again just now but nothing!! I need that video. My job depends on it! I worked so hard on this wedding video and now it's lost and won't open. I work another job and don't have much time. I really don't want to start all over again. Please help me. Thanks so much for your assistance.
    Fustrated APPLE customer
    Jolly A. Rupp

    I also have Jolly's problem. I found the iMovie 9.0.9 folder and tried to launch the older version of iMove. It would not launch. I removed all of the iMovie preferences from the Preferences folder, removed iMove 10 from the applications folder, and restarted my Mac. iMove 9.0.9 still won't launch and I can't access my videos created with the older version of iMovie. Is there a way to uninstall iMovie 10 and reinstall iMovie 9.0.9?
    I am running Yosemitie on a  iMac.
    Paul

  • HT1473 Help I just moved my music files to a external hard drive and am using the new crappy version ( i know my opinion) of itunes and cant add the files to my libray it gives me the add file to library option but not the add folder to library option wha

    Help I just moved my music files to a external hard drive and am using the new crappy version ( i know my opinion) of itunes and cant add the files to my libray it gives me the add file to library option but not the add folder to library option what am i doing wrong?

    In iTunes 11 uncheck the preferences setting in in the iTunes Preferences panel "Advanced > Copy Files to iTunes Media folder when adding to Library"

  • To view the flash technology content in this pdf file please install this version of flash player

    I am getting an error while opening a pdf file I am using Windows 7 with adobe 10.1.7 installed error message " to view the flash technology content in this pdf file please install this version of flash player"

    Both ActiveX and plugin?  What versions?

  • I created a file yesterday in Pages version 5.1. Today when I went to open the file a box popped up saying that I needed a newer version pf Pages to open the file. Any thoughts??

    I created a file yesterday in Pages Version 5.1. Today I went back to open that file and a box popped up saying I need a newer version of Pages to open that file. Any thoughts??

    You have 2 versions of Pages on your Mac.
    Pages 5.2 is in your Applications folder.
    Pages '09/'08 is in your Applications/iWork folder.
    You are alternately opening the wrong versions.
    Pages '09/'08 can not open Pages 5 files and you will get the warning that you need a newer version.
    Pages 5.2 can open Pages '09 files but may damage/alter them. It can not open Pages '08 files at all.
    Older versions of Pages 5 can not open files from later versions of Pages 5.
    Once opened and saved in Pages 5 the Pages '09 files can not be opened in Pages '09.
    Anything that is saved to iCloud and opened in a newer version of Pages is also converted to Pages 5 files.
    All Pages files no matter what version and incompatibility have the same extension .pages.
    Pages 5 files are now only compatible with themselves on a very restricted set of hardware, software and Operating Systems and will not transfer correctly on any other server software than iCloud.
    Apple has removed almost 100 features from Pages 5 and added many bugs:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Peter

Maybe you are looking for