Skip to main content
1-Visitor
July 12, 2012
Solved

Can anyone help me with a little function?

  • July 12, 2012
  • 2 replies
  • 1255 views

Hi all,

The function below returns the creator of a wt.document, how (if possible) would it need to be changed in order to return the principal who last updated the document instead of it's creator?

public static WTUser getCreatedBy(WTObject pbo){

try {

pbo = (WTObject)PersistenceHelper.manager.refresh(pbo);

if (pbo instanceof RevisionControlled){

return (WTUser) ((RevisionControlled)pbo).getCreator().getPrincipal();

} else {

log.error("Object was not revision controlled");

return null;

}

} catch (WTException ex) {

log.error("Unable to find creator",ex);

return null;

}

}

Many thanks advance.

B

Best answer by MatthewKnight

Yes. Call RevisionControlled.getModifier() instead

2 replies

1-Visitor
July 12, 2012

Yes. Call RevisionControlled.getModifier() instead

1-Visitor
July 13, 2012

Thank you Mathew, it works like a charm.