In working with a FolderContent effect, I’m trying to obtain information about a content item which being added to the folder.
I’m obtaining the new folder relationship as:
// context is the IPSExecutionContext which is passed into the effect
PSRelationship originating = context.getOriginatingRelationship();
And then retrieving the content ID via:
int contentId = originating.getDependent().getId();
According to the documentation, getId() should be returning -1 if the content item hasn’t been assigned an ID yet.
If I create the item via Content Explorer’s New Item menu entry, contentId has a valid ID and I can load the underlying PSItem. Likewise, if I use Create | Create Translation, that also returns a valid ID.
From this I infer that the new content item is created before my Effect is triggered.
But if I create a new content item via Copy and then Paste | As New Copy, the value I retrieve for the content ID is Integer.MAX_VALUE. (We don’t anticipate that becoming a valid ID for another 35,000 years. :rolleyes:)
Q1: I assume this is a flag value; can anybody tell me what it means?
Q2: How can I obtain the PSItem for the copy?