Reputation: 129
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.
Upvotes: 0
Views: 1037
Reputation: 1
I tried this but getting error like below
com.filenet. api.exception. EngineRuntimeException: FRCA0024E: API PROPERTY NOT IN CACHE:
Upvotes: 0
Reputation: 1
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
}
Upvotes: 0