dfc code for creating different versions of dm_document

Mayur_shivs
edited December 19, 2012 in Documentum #1

Hello

i want to create different version of my document using dfc how can i do it

Regards

Comments

  • JorgKrause
    edited December 19, 2012 #2

    Hi,

    See javadocs for IDfSysObject.checkout() and IDfSysObject.checkin().

    Alternatively, you may want to look at IDfCheckoutOperation and IDfCheckinOperation.

    Good luck

    Jørg

  • Mayur_shivs
    edited December 19, 2012 #3

    Hello , I have this method but iwant my version label to appear in documentum rather than 1.1 so what can i do

    below is the code i am implementing right now,

    public void doCheckIn(IDfSession sess , String strPath) throws DfException

        {       

            IDfDocument sysObj = (IDfDocument) sess.getObjectByPath(strPath);

            if(sysObj == null)

            {

            System.out.println("SysObject does not exist");

            return;

            }

            if(sysObj.isCheckedOut())

            {

                sysObj.checkin(true, "ver1.1");

                return;

            }

            else{

                sysObj.checkout();

                sysObj.checkin(false, "ver2");

                sysObj.save();

                return;

            }       

        }

  • VHK
    VHK
    edited December 19, 2012 #4

    Hi Mayur,

    Kindly try and use the following method

    sysobj.checkinEx()

    checkinEx(boolean keepLock, String versionLabels, String oldCompoundArchValue, String oldSpecialAppValue, String newCompoundArchValue, String newSpecialAppValue) throws DfException
    This is the extended method for checkin.

    Note: This method differs from checkin by providing arguments to set application-specific attributes. To use the checkinEx method, the following conditions must be met:

    • The object must have been retrieved from the repository with a checkout method.
    • The user must have at least Version permission on the object.
    • The user must have at least Write permission on the cabinet or folder in which the object is stored if the repository is running with folder security.
    Note: Folder security is on by default when a repository is configured. The folder security setting is recorded in the folder_security attribute of the docbase config object.
  • Mayur_shivs
    edited December 19, 2012 #5

    hello ,

    I am not getting last four parameters passed to this method

    IDfId checkinEx(boolean keepLock,

                    String versionLabels,

                    String oldCompoundArchValue,

                    String oldSpecialAppValue,

                    String newCompoundArchValue,

                    String newSpecialAppValue)

                    throws DfException  

    ie . 

    oldCompoundArchValue  ,  oldSpecialAppValue ,newCompoundArchValue , newSpecialAppValue  what are these attributes means , please elaborate with example .

    Regards

  • VHK
    VHK
    edited December 19, 2012 #6

    the parameters value are as follows

    Parameters:keepLock - Determines whether a lock is placed on the newly

    created version.versionLabels - Defines the version label for the new

    version. You can specify more than one label. If you do not define a label,

    the server automatically gives the new version an implicit version label

    and the symbolic label CURRENT.oldCompoundArchValue - Sets the

    a_compound_architecture attribute of the checked-out object.

    oldSpecialAppValue - Sets the a_special_app attribute of the checked-out

    object.newCompoundArchValue - Sets the a_compound_architecture attribute of

    the new version created by the check in.newSpecialAppValue - Sets the

    a_special_app attribute of the new version created by the checkin.

    kindly refer javadocs if you need further explanation about the

    functionality of this method.

    Hope this helps.

    On Wed, Dec 19, 2012 at 4:33 PM, Mayur Mitkari <