* @param olatResourceable a general OlatResourceable
* @param type the type of the olatResourceable
* @return a LoggingResourceable wrapping the given olatResourceable type pair
*/
public static LoggingResourceable wrap(OLATResourceable olatResourceable, ILoggingResourceableType type) {
RepositoryEntry repoEntry = null;
if (olatResourceable instanceof RepositoryEntry) {
repoEntry = (RepositoryEntry) olatResourceable;
} else {
repoEntry = RepositoryManager.getInstance().lookupRepositoryEntry(olatResourceable, false);
}
if (repoEntry!=null) {
return new LoggingResourceable(repoEntry, type, repoEntry.getOlatResource().getResourceableTypeName(),
String.valueOf(repoEntry.getOlatResource().getResourceableId()), repoEntry.getDisplayname());
} else if (olatResourceable instanceof OLATResource) {
OLATResource olatResource = (OLATResource) olatResourceable;
return new LoggingResourceable(olatResource, type, olatResource.getResourceableTypeName(),
String.valueOf(olatResource.getResourceableId()), String.valueOf(olatResource.getKey()));
} else {