How to get the Version History of a stored document?

Hi,
I am trying to store and retrieve the content using Content Services features of ADEP 10.0.
I am able to store and retrieve content where as I am not able to get the version of the document. I am trying to store same or different document, but I donot get the version history or version label. Please guide me how I can get  the version of a stored document.
Also, please advise me if there are simple alternative to do the same in ADEP10.
Please see below my sample code below:
package test.sample;
import java.io.File;
import java.util.*;
import com.adobe.idp.Document;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
import com.adobe.livecycle.contentservices.client.CRCResult;
import com.adobe.livecycle.contentservices.client.impl.DocumentManagementServiceClientImpl;
import com.adobe.livecycle.contentservices.client.impl.UpdateVersionType;
public class AddContent {
    public static void main(String[] args) {
        try{
            //Set connection properties required to invoke Document Services in EJB mode                                
            Properties connectionProps = new Properties();
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://localhost:1099");
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,Service ClientFactoryProperties.DSC_EJB_PROTOCOL);          
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
            //Create a ServiceClientFactory object
            ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
            //Create a DocumentManagementServiceClientImpl object
            DocumentManagementServiceClientImpl    docManager = new DocumentManagementServiceClientImpl(myFactory);
            //Specify the store and node name
            String storeName ="SpacesStore"; 
            String nodeName = "/Company Home/Test Directory";
            //Retrieve the document to store in /Company Home/Test Directory
            Document contentA =  new Document(new File("C://Adobe/New files/Data-A.pdf"), false);
            Document contentB =  new Document(new File("C://Adobe/New files/Data-B.txt"), false);
            Document contentC =  new Document(new File("C://Adobe/New files/Data-C.xlsx"), false);
            //Create a MAP instance to store attributes
            Map<String,Object> inputs = new HashMap<String,Object>();
            //Specify attributes that belong to the new content
            String creator = "{http://www.alfresco.org/model/content/1.0}creator";
            String description = "{http://www.alfresco.org/model/content/1.0}description"; 
            inputs.put(creator,"Veeraganteppa Sajjan");
            inputs.put(description,"A sample application form");
            //Store MortgageForm.pdf in /Company Home/Test Directory
            CRCResult resultA = docManager.storeContent(storeName, 
                     nodeName,
                    "dataA.pdf",
                    "{http://www.alfresco.org/model/content/1.0}content", 
                    contentA,
                    "UTF-8",
                    UpdateVersionType.INCREMENT_MAJOR_VERSION,
                    null,
                    inputs); 
            CRCResult resultB = docManager.storeContent(storeName, 
                    nodeName,
                   "dataB.pdf",
                   "{http://www.alfresco.org/model/content/1.0}content", 
                   contentB,
                   "UTF-8",
                   UpdateVersionType.INCREMENT_MAJOR_VERSION,
                   null,
                   inputs);
            CRCResult resultC = docManager.storeContent(storeName, 
                    nodeName,
                   "dataC",
                   "{http://www.alfresco.org/model/content/1.0}content", 
                   contentC,
                   "UTF-8",
                   UpdateVersionType.INCREMENT_MAJOR_VERSION,
                   null,
                   inputs);
            //Get the identifier value of the new resource
            String idA = resultA.getNodeUuid();
            String idB = resultB.getNodeUuid();
            String idC = resultC.getNodeUuid();
            System.out.println("A -The identifier value of the new content is "+idA);
            System.out.println("B - The identifier value of the new content is "+idB);
            System.out.println("C - The identifier value of the new content is "+idC);
           System.out.println("A - The Browse Link is "+resultA.getBrowseLink());
            System.out.println("B - The Browse Link is "+resultB.getBrowseLink());
            System.out.println("C - The Browse Link is "+resultC.getBrowseLink());
          System.out.println("A-The Version Label is "+resultA.getVersionLabel());
          System.out.println("B-The Version Label is "+resultB.getVersionLabel());
          System.out.println("C-The Version Label is "+resultC.getVersionLabel());
          System.out.println("The Version History is "+docManager.getVersionHistory(storeName,nodeName, true));
    }catch(Exception e)
        e.printStackTrace();
Message was edited by: V B Sajjan

Sorry I did not attach the output and errors. Please find the same below.
A -The identifier value of the new content is f5427f5b-c7c1-4c3c-b959-cb84e4e49a13
B - The identifier value of the new content is b237d22c-5ff5-4628-a83a-23f5e49ae48e
C - The identifier value of the new content is 34a9992c-3705-4488-bb55-6dd7ddfa0517
A - The Browse Link is http://localhost:8080/contentspace/wcs/api/node/content/workspace/SpacesStore/f5427f5b-c7c 1-4c3c-b959-cb84e4e49a13/dataA.pdf
B - The Browse Link is http://localhost:8080/contentspace/wcs/api/node/content/workspace/SpacesStore/b237d22c-5ff 5-4628-a83a-23f5e49ae48e/dataB.pdf
C - The Browse Link is http://localhost:8080/contentspace/wcs/api/node/content/workspace/SpacesStore/34a9992c-370 5-4488-bb55-6dd7ddfa0517/dataC
A-The Version Label is null
B-The Version Label is null
C-The Version Label is null
ALC-CSV-30015-000: com.adobe.livecycle.contentservices.client.exceptions.CSInvocationException: ALC-CSV-030-015-The node [/Company Home/Test Directory] is not versioned.
at com.adobe.contentservices.webscripts.impl.AbstractContentManager.doGetVersionHistory(Abst ractContentManager.java:1362)
at com.adobe.contentservices.webscripts.impl.ContentManagerImpl.executeParams(ContentManager Impl.java:198)
at com.adobe.contentservices.webscripts.impl.CSRetryingTransactionCallback.execute(CSRetryin gTransactionCallback.java:45)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransacti onHelper.java:326)
at com.adobe.contentservices.webscripts.impl.ContentManagerImpl.execute(ContentManagerImpl.j ava:114)
at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:333)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransacti onHelper.java:326)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContaine r.java:386)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContai ner.java:404)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java: 246)
at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:294)
at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:172)
at org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.adobe.idp.um.auth.filter.CSRFFilter.doFilter(CSRFFilter.java:86)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.ja va:183)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEs tablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEst ablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java: 158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja va:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
at java.lang.Thread.run(Thread.java:662)

Similar Messages

  • How to get the version no. for service po?

    Hi,
    How to get the version no. for service po?For material po we are getting the version from EKKO-REVNO but for service po Ekko-revno is blank.
    Regards,
    Rachel.

    Hiee,
    It is not like service PO does not have revision.
    REVNO will only exists for any document if amendment is made after releasing it. If in EKKO for all service PO revision number is blank then test if version management is active for document type
    MM->Purchasing->Version management -> External documents
    Here check for your doc type and purchase org version management is active.
    Regs,
    Appie

  • How to get the version no of a document created/updated in KM

    Hi All,
    We are currently working on SAP 7.0 SP16.
    We have used the KM API to store our documents into the KM repositories.
    The problem we are facing here is related to the version no of the documents created.
    I will explain this with an example :
    I have created a document "test.txt" --> default version no is 1
    I updated the same twice now there are 3 version for this document 1, 2 & 3.
    Now if I delete the version no 1 then there are only 2 document versions remaining in the system, but the Portal still displays them as 2 and 3.
    Now when I want to read the version history of this document I get an IResource object for each version but I am not able to find any means through which I can retrieve the version no of the IResource object which is currently being read.
    Can someone please help me the information regarding how to retrieve the version no from the IResource object returned whenever a document is read using KM API.
    Thanks in advance!
    Regards,
    Manish

    Hi,
    try something like this:
    String strRevisionID = null;
    if (resource.isVersioned())  {
      IVersionHistory versions = resource.getVersionHistory();
      if (versions != null) {
        IResource version = versions.get(i);
        strRevisionID = actResource.getRevisionID();
    hope this helps,
    Romano

  • How to get the version changes programatically in ItemCheckedin event

    Hi,
    I am creating a custom version history page.
    I have a requirement were I have to capture the changes after file check-in and display it in the custom page.
    Is there anyway to get the version changes programatically after the file has been checked-in?
    Is is possible to get the current version and previous version in ItemCheckedin event
    and get the version changes?
    Thanks in advance,
    dhijit

    Hi,
    As Dimitri said, we can use ItemCheckingIn event to achieve it.
    The following code snippet for your reference:
    public override void ItemCheckingIn(SPItemEventProperties properties)
    base.ItemCheckingIn(properties);
    int beforeLevel = (int)properties.BeforeProperties["vti_level"];
    int afterLevel= (int)properties.AfterProperties ["vti_level"];
    if((beforeLevel==255) && (afterLevel==1))
    // This is a major version that is being checked in . . .
    int majorVer= properties.ListItem.File.MajorVersion+1;
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to get the sms history for iphone 4S

    Hello,
    I would like some help to find out how to ressurect the message history for messages that I have received on my phone and never backed up anywhere. The messages have dissapeared by themselves, without having me deleting them or changing any default settings. Please help me to get the message history back.
    With regards,
    Caroline

    Apple does not sell parts. You may be able to find something out there, but what you will get is either something stripped from a damaged phone, a knockoff, or marginal parts that failed factory inspection and are now being illegaly sold.

  • Get the Version history of a sharepoint 2013 Custom List item

    Hi All,
    I am having doubt to retrieve the field version information with the comments.
    For this field i am done like this
    1.Creating a custom list
    2.And enable versioning for the list
    3.And add a field with field type 'Multiple Lines of Text' and in the Addition Column Settings section 'select yes radio button option in 'Append changes to the Existing text'.
    4.If we done like this the changes to the list item are available outside of field control.
    Can any one help me regarding this field to get the all the versions of list item along with modified data.

    hi Asatish,
    Thanks for posting your issue, Kindly browse the below mentioned URLs to know about the fixes of this issue
    http://berg-henry.blogspot.in/2010/11/custom-list-form-with-version-history.html
    http://somnathmatere.blogspot.in/2013/10/sharepoint-2010-custom-display-form.html
    http://blog.qumsieh.ca/2009/01/29/understanding-the-append-changes-to-existing-text-option/
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • How to get the User History

    Hi All
    I want to get all information (history) about the user which application he used with date and time.
    Is it possible?
    One way we can maintain log in code. But I need the solution in portal using any other application.

    how did you find the answer please tell me

  • How To Get The Version Of Music Player Back?

    Welcome,,
    i have Nokia N8 and i install an update for music player and it is too bad and  not easy as the past version
    so is there a way to get past version back?
    Thanks,,

    there is no way to downgrade firmware, sorry.

  • How to get the Version of the Solution Manager

    Hi Experts,
    The Solution Manager is Already Insatlled on our Machine.
    How to Find out the Version of the Solution Manager???
    How to Disply the Solution Manager Key????
    Please give me the Proper Solution on this.
    Regards
    Khanna

    Hi,
    Check this link
    http://www30.sap.com/korea//services/pdf/Solman_4.0_Maintenance_Optimizer_Setup_Guide.pdf
    you might have to use t-code  SPRO
    Regards,
    Ramesh P
    Message was edited by:
            Ramesh Parashivamurthy

  • Getting the version history of a list item

    I am creating a content web part and one the list items is used with versioning. I want to show all the versioning on the page. Is there anyway to do this? maybe using CSOM or something. In Javascript

    Hi,
    According to your post, my understanding is that you want to get the list item version using CSOM or JavaScript.
    There is no directly way to get the list item version using CSOM or REST Api, however, there are alternative options as below.
    We can use the SharePoint List web service
    that exposes Lists.GetVersionCollection Method to return version information for the specified field in a SharePoint list.
    There is a code demo to retrieve the List1 item version, it works like a charm, you can refer to it.
    <script type="text/javascript" src="../Shared Documents/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="../Shared Documents/jquery.SPServices-2014.01.min.js"></script>
    <script type="text/javascript">
    $(function(){
    $().SPServices({
    operation: "GetVersionCollection",
    async: false,
    strlistID: "Lists_1",
    strlistItemID: 1,
    strFieldName: "Title",
    completefunc: function (xData, Status) {
    console.log(xData);
    $(xData.responseText).find("Version").each(function(i) {
    console.log("Name: " + $(this).attr("Title") + " Modified: " + $(this).attr("Modified"));
    </script>
    What’s more, we can also get request to Versions.aspx page to get the list item version.
    There is an article about this topic, you can have a look at it.
    http://stackoverflow.com/questions/24423657/sharepoint-2013-get-splistitem-versions-via-rest
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to compare the version history values

    Hi Everone,
    I've an requirement to compare the column values between present version and previous version of the document in the document library.
    Versioning is enabled in the doc., lib... Please suggest how to achieve the same without opening the version of the file manually. 
    Thanks in advance!
    Thanks
    Arun
    Arun Prakash

    Hi Rodrigo,
    Thanks for your response!
    we don't have any access to server to execute the code or to run the power shell. So please suggest to do same with client side  to achieve this requirement.
    Thanks again!
    Arun Prakash

  • How to get the version of the Document opened.

    Hello all,
    When a document is opened I want to know in which Indesign version this document was created.
    Depending on the version I need to route to different functions in my code.
    Is there a way to know this.
    Thank you
    Madhu

    Hi Madhu,
    have a look at iDataBase->GetVersionNumber
    Best,
    Peter

  • How to get the number of Item in Material Document?

    Hi all.
    I'm using the BAPI_GOODSMVT_CREATE, and want to get the Item number in Material Document of every entry in the internal table. How can I do that?
    Thanks in advance.

    Hi YiNing
    You can use this code after calling BAPI.
          SELECT SINGLE mblnr
           INTO CORRESPONDING FIELDS OF wa_mkpf
           FROM mkpf
           WHERE mblnr = p_mblnr.
          IF sy-subrc EQ 0.
            EXIT.
          ELSE.
            CALL FUNCTION 'RZL_SLEEP'
              EXPORTING
                seconds        = 2
              EXCEPTIONS
                argument_error = 1
                OTHERS         = 2.
          ENDIF.
    *Check material document number is in table MKPF
      CHECK wa_mkpf-mblnr IS NOT INITIAL.
      REFRESH : i_mseg[],i_ser03[],i_objk[]..
      SELECT matnr charg vfdat erfmg erfme mblnr zeile
             INTO CORRESPONDING FIELDS OF TABLE i_mseg
             FROM mseg
             WHERE mblnr = wa_mkpf-mblnr.
    Here you will get  the item in material number (ZEILE).
    Regards,
    Mukesh Kumar

  • BPC - Script - How to get the month of a date stored as an amount?

    We have a account called "StartDate" in our database.
    The user enter a date for this account: 01/07/2010
    This date is then stored as 40360 in the db
    We are trying to get the month number (7) out of this record.
    We succeeded to write an sql query to do that:
    Select Month( cast( as datetime ) )
    From tblFact
    Where = 'StartDate'
    Any idea how to do that in a bpc script logic ?
    Thanks,
    Bénédicte

    There's no built-in support for any type of date math in BPC script logic.
    One approach I've used is to add a property to the time dimension, ExcelTimeID. Then you can compare the value to your time periods, if your logic requires this type of condition.
    *WHEN SignedData
    *IS < Time.ExcelTimeID
    But that doesn't solve the problem you have, where you want to know the month. I can't think of an immediate solution, other than perhaps in the original input schedule to hide a second account that submits the month number (as an integer) along with the account you have now (with the full date).
    Or stick a stored proc in some logic package, scheduled to run every 10 minutes or whatever, that takes the account with the date in it, and runs your query, saving the result as the month number. Ugly in so many different ways, but it's another way to tackle the problem further upstream.
    And last result is to build script logic with ridiculous hard-coding of Excel time IDs all over the place.

  • How to get the version of Java in browser??

    I need to check the verson of Java in browser?? Can anybody help me?
    I need to check that, and send it to serwer somehow :)
    Any code would be usefull. Thanks

    see if this helps :
    http://www.javatester.org/version.html

Maybe you are looking for

  • Upload Sales order item from excel to SAP in VA01 thru frontend

    Hi, I am a front end user. SAP version 710. we enter sales order thru frontend in VA01 in SAP. The data is stored in excel. Currently the following is performed. Open VA01. In transaction entry screen , Copy from Excel & Paste In SAP the following SA

  • Changing text hilite color?

    Is there a property to change the hilite color for editable text sprites? I've got white text on a blue background and the default hilite color is a lighter shade of blue that's almost impossible to see. Thanks.

  • JavaFX 2.3 Mac OS X "Preferences" and "About" screen menu entries

    Hi there, I'm currently using the 1.7.0_10 JDK and JavaFX 2.3 under Mac OS X 10.7.5 and was wondering if it is possible to move the menu entries "Preferences" and "About Application..." to the standard Mac screen menu locations, means under the appli

  • Standby Database Creation in the same Box Oracle 9.2.0.1

    Box - Sun Solaris 64 bit Oracle Version - 9.2.0.1 I have a database called 'sales' in the above box. I want to create a standby database in the same box (in different mount point). This is what I did: 1. took cold backup of all datafiles 2. created s

  • Pass substitution variable to a region source

    Hi, I am trying to show an oracle report in a region. I was able to display it using javascript popupurl , in a seperate window. But, now I need to display it in the region. I want to pass the &Reports_url to region source, instead of writing the who