문제

If we use IDfId checkin(boolean keepLock, String versionLabels) throws DfException method, we get new version of IDfSysObject. How can I remove the latest version and get back to the previous version?

도움이 되었습니까?

해결책

To revert to a previous major version You need to do the following:

  1. get any previous major version of object You need to make current as IDfPersistentObject.
  2. Add "CURRENT" to [0] index in R_VERSION_LABEL attribute
  3. save modified IDfPersistentObject

  4. get all IDfPersistentObject with R_VERSION_LABEL > than your new current version

  5. remove "CURRENT" from [0] index in R_VERSION_LABEL if it exists.
  6. save IDfPersistentObject
  7. call IDfPersistentObject.destroy(). It will not fail.

다른 팁

If you wish to keep the latest then you can check out the latest version, read the contents of the previous version in a ByteArrayOutputStream using the getContent() method and set that content to the latest version, using setContent().

Or if you do not wish to keep the latest version you user the IDfPersistentObject.destroy() method for the object to delete the only latest version so the previous version will become current.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top