Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Really all you need to do is
ReferenceFactory ref = new ReferenceFactory();
EPMDocument epdmDoc = ( EPMDocument )ref.getReference( epmID ).getObject;
This is a summary of the responses to my question. Some of these were sent to the list and some were sent only to me.
Original question:
I am working on a jsp page that asks the user to select some specific EPMDocument
versions in a form. When submitted the form is returning the identifiers of the
object(s) selected. The identifiers are what you get from:
PersistenceHelper.getObjectIdentifier(epmDoc)
The jsp page is outputting the form checkbox as follows:
out.println("\t\t<td><input type="checkbox" name="checkbox" value="" +=" persistencehelper.getobjectidentifier(epmdoc)=" +=" ""="></input></td>");
So upon submission I have an array of string values like this:
"wt.epm.EPMDocument:42864420", "wt.epm.EPMDocument:43075131", etc
So how do I turn take this string value and turn it into an EPMDocument object?
String epmID = "wt.epm.EPMDocument:42864420";
EPMDocument epmDoc = ?????(epmID);
Basically there were 3 approaches given to turn the string identifier back into an EPMDocument.
Given we have this:
String epmID = "wt.epm.EPMDocument:42864420";
===================================================================
1st approach is using the ReferenceFactory like this:
ReferenceFactory rf = new ReferenceFactory();
EPMDocument epmDoc = (EPMDocument)rf.getReference(epmID).getObject();
===================================================================
2nd approach is ObjectIdentifer and ObjectReference like this:
ObjectIdentifier oid = ObjectIdentifier.newObjectIdentifier(epmID);
EPMDocument epmDoc = (EPMDocument) wt.fc.ObjectReference.newObjectReference(oid).getObject();
===================================================================
3rd approach is to use BasicWebjectDelegate:
EPMDocument epmDoc = (EPMDocument) wt.adapter.BasicWebjectDelegate.getObjectByUfid(epmID);
===================================================================
I haven't yet decided which approach to use yet. I have tried all 3 and they work.
I want to thank all of you that responded. Per usual the users on this list are a fantastic resource.