Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
 contentManager.delete(contentId);

Move content

The following example shows how to move content between content managers:

Code Block
languagejava
// Get the active user data
IUserData userData = context.getSessionScope().getActiveUser();

// Pre-emptive check if the both content managers are the of the same implemation so we can check if can move the files.
// This is should also be done in the move function of the IContentManager.

if (!sourceContentManager.getImplementation().getClass().equals(targetImplementation.getImplementation().getClass())) {
   // Both content managers require the same implementation to perform a direct move.
   return null;
}


GUID newContentId = sourceContentManager.move(targetContentManager, contentId, userData);