The example below shows how to implement custom code in your application so that you can create different versions of a KM Document.
More information: Creating Composite Application Development Components .
More information: Creating Application Services .
More information: Defining Application Service Dependencies .
DocContentServiceLocal docContentLocal = getDocContentServiceLocal(); Collection<String> rids = docContentLocal.getRelatedObjectRids(docKey); String rid = rids.iterator().next(); if ( !docContentLocal.isDocumentVersioned(rid)) docContentLocal.enableDocumentVersioning(rid);
docContentLocal.checkout(rid);
byte[] contentVer2 = getResFileContentVersion2(); docContentLocal.checkin(rid, contentVer2);
String [] versionHistoryRidsArrStr = (String []) docContentLocal.getVersionHistory(rid).toArray(new String[0]);
docContentLocal.setAsCurrentVersion (versionHistoryRidsArrStr[versionHistoryRidsArrStr.length -1], rid);