/* (non-Javadoc)
* @see de.innovationgate.webgate.api.WGContentEventListener#contentHasBeenSaved(de.innovationgate.webgate.api.WGContentEvent)
*/
public void contentHasBeenSaved(WGContentEvent contentEvent) {
WGContent newContent = null;
try {
newContent = contentEvent.getContent();
if (newContent == null) {
//_log.warn("Cannot process update event for content '" + contentEvent.getDocumentKey() + "' (DB " + contentEvent.getDatabase().getDbReference() + ") because the content is not retrievable. Might have been deleted in the meantime.");
return;
}
}
catch (WGAPIException e) {
_log.error("Cannot process update event for content '" + contentEvent.getDocumentKey() + "' (DB " + contentEvent.getDatabase().getDbReference() + ").", e);
return;
}
WGDatabase db = contentEvent.getDatabase();
if (!db.getSessionContext().isContentTypeEventsEnabled()) {
return;
}
String dbKey = (String) db.getAttribute(WGACore.DBATTRIB_DBKEY);
HttpServletRequest request = (HttpServletRequest) db.getSessionContext().getAttribute(WGACore.DBSESSIONCONTEXT_REQUEST);
TMLUserProfile userProfile = null;
if (request != null) {
userProfile = (TMLUserProfile) request.getAttribute(WGACore.ATTRIB_PROFILE + db.getDbReference());
}
String contentType = "*";
try {
if (newContent != null && newContent.hasCompleteRelationships()) {
contentType = newContent.getStructEntry().getContentType().getName();
}
EventPath eventPath = createContentEventPath(EVENTNAME_CONTENTHASBEENSAVED, dbKey, contentType, newContent.getContentKey().toString());
executeEvent(eventPath, newContent, userProfile, null);
}
catch (WGAPIException e) {
_log.error("Cannot process update event for content '" + contentEvent.getDocumentKey() + "' (DB " + contentEvent.getDatabase().getDbReference() + ").", e);
return;