0

I am trying to get the information associated with a record using Java. I was ablr to get basic information like Title, Owner, Date created etc. Now I need to get the information about the document associated with that particular record. Say we have created Rec1 from Doc1, I need to fetch the information about Doc1. I tried searching for possible solution but no luck. Please let me know where I can find the required info.

    // Create a JARM connection to the CE
    jarmDomainConnection = RMFactory.DomainConnection.createInstance(DomainType.P8_CE, ceServerURL, null);
    // Set the IER subject
    com.ibm.jarm.api.util.RMUserContext ierUC = com.ibm.jarm.api.util.RMUserContext.get();
    javax.security.auth.Subject subject = com.ibm.jarm.api.util.RMUserContext.createSubject(jarmDomainConnection, userName,
    password, JAAS_STANZA);
    ierUC.setSubject(subject);
    // Get the IER JARM domain
    jarmDomain = RMFactory.RMDomain.fetchInstance(jarmDomainConnection, null, null);    
    // Connect to the IER object stores
    jarmROS = com.ibm.jarm.api.core.RMFactory.ContentRepository.fetchInstance(jarmDomain, rosName,null);
    jarmFPOS = RMFactory.FilePlanRepository.fetchInstance(jarmDomain, fposName,null);
    com.ibm.jarm.api.core.Record r = RMFactory.Record.fetchInstance(jarmFPOS, "{C3EBF49F-B193-432C-8A18-3EED321F7051}", pf);
    System.out.println(r.getName().toString());

I am getting an option to get the recordAssociatedByIDs but it is for RecordInfo objects and not for Record type. Even if I try to cast Record to RecordInfo type its throwing an error. Please provide any inputs.

ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
user1194310
  • 129
  • 1
  • 4
  • 14

2 Answers2

0

I hope you found the answer already as this is long overdue. The documents associated with a record (you can have multiple) can be retrieved via the associated Content Items. However, the ContentItem is in the JARM context and not in your usual Document / P8 API context, so you need to change it. In JARM you have the P8CE_Convert util class, which does just this.

For anyone looking for the solution for this, the answer lies in the following:

PageableSet<ContentItem> contentItems = record.getAssociatedContentItems();

Iterator<ContentItem> iter = contentItems.iterator();
while(iter.hasNext())
{
   ContentItem jarmContentItem = iter.next();
   Document p8Doc = P8CE_Convert.fromJARM(jarmContentItem);
   // read stuff
}
0

I tried this but getting error like below

com.filenet. api.exception. EngineRuntimeException: FRCA0024E: API PROPERTY NOT IN CACHE:

Ajay
  • 1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 22 '22 at 21:50
  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/33470355) – Antoine Dec 24 '22 at 00:14