- Anzeige des Datums des letzten Republizieren im Publizieren-Tab (Ticket #1191)

- Automatische Benachrichtung des Admins, wenn das publizieren eines Content-Items fehlschlägt (Ticket #1192)


git-svn-id: https://svn.libreccm.org/ccm/trunk@1592 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2012-04-14 08:28:54 +00:00
parent 3fcd1f5d68
commit c35db8039e
7 changed files with 311 additions and 7 deletions

View File

@ -1089,5 +1089,6 @@ cms.ui.item.lifecycle.do=Execute
cms.ui.item.lifecycle.do.not_authorized=Your not authorized to publish this item. cms.ui.item.lifecycle.do.not_authorized=Your not authorized to publish this item.
cms.ui.item.lifecycle.publish_locked=This content item is being (re-)published cms.ui.item.lifecycle.publish_locked=This content item is being (re-)published
cms.ui.item.lifecycle.publish_locked.update=Update cms.ui.item.lifecycle.publish_locked.update=Update
cms.ui.lifecycle.publish.error=An error occured while publishing this item. Please inform your system administrator. This item will stay locked until the locked is removed by the system administrator manually. cms.ui.lifecycle.publish.error=An error occured while publishing this item.The system administrator has been notified about this problem. This item will stay locked until the lock is removed by the system administrator manually.
cms.ui.delete_confirmation=Permanently delete this item? cms.ui.delete_confirmation=Permanently delete this item?
cms.ui.lifecycle.details.last_published=Item last (re-)published

View File

@ -1080,5 +1080,6 @@ cms.ui.item.lifecycle.do=Ausf\u00fchren
cms.ui.item.lifecycle.do.not_authorized=Sie sind nicht berechtigt, dieses Item zu publizieren. cms.ui.item.lifecycle.do.not_authorized=Sie sind nicht berechtigt, dieses Item zu publizieren.
cms.ui.item.lifecycle.publish_locked=Dieses Content-Item wird gerade (re-)publiziert cms.ui.item.lifecycle.publish_locked=Dieses Content-Item wird gerade (re-)publiziert
cms.ui.item.lifecycle.publish_locked.update=Aktualisieren cms.ui.item.lifecycle.publish_locked.update=Aktualisieren
cms.ui.lifecycle.publish.error=W\u00e4hrend des Publizierens ist ein Fehler aufgetreten. Bitte informieren Sie Ihren System-Administrator. Dieses Item bleibt besperrt, bis der Administrator die Sperre manuell entfernt. cms.ui.lifecycle.publish.error=W\u00e4hrend des Publizierens ist ein Fehler aufgetreten. Der System-Administrator wurde per \u00fcber das Problem informiert. Dieses Item bleibt besperrt, bis der Administrator die Sperre manuell entfernt.
cms.ui.delete_confirmation=Wollen Sie dieses Content-Item l\u00f6schen? cms.ui.delete_confirmation=Wollen Sie dieses Content-Item l\u00f6schen?
cms.ui.lifecycle.details.last_published=Das Item wurde zuletzt republiziert am

View File

@ -30,3 +30,4 @@ cms.ui.item.lifecycle.publish_locked=
cms.ui.item.lifecycle.publish_locked.update= cms.ui.item.lifecycle.publish_locked.update=
cms.ui.lifecycle.publish.error= cms.ui.lifecycle.publish.error=
cms.ui.delete_confirmation= cms.ui.delete_confirmation=
cms.ui.lifecycle.details.last_published=

View File

@ -561,3 +561,4 @@ cms.ui.item.lifecycle.publish_locked=
cms.ui.item.lifecycle.publish_locked.update= cms.ui.item.lifecycle.publish_locked.update=
cms.ui.lifecycle.publish.error= cms.ui.lifecycle.publish.error=
cms.ui.delete_confirmation= cms.ui.delete_confirmation=
cms.ui.lifecycle.details.last_published=

View File

@ -38,6 +38,8 @@ import com.arsdigita.bebop.event.ActionEvent;
import com.arsdigita.bebop.event.ActionListener; import com.arsdigita.bebop.event.ActionListener;
import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormInitListener;
import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.PrintEvent;
import com.arsdigita.bebop.event.PrintListener;
import com.arsdigita.bebop.form.Option; import com.arsdigita.bebop.form.Option;
import com.arsdigita.bebop.form.SingleSelect; import com.arsdigita.bebop.form.SingleSelect;
import com.arsdigita.bebop.form.Submit; import com.arsdigita.bebop.form.Submit;
@ -54,6 +56,11 @@ import com.arsdigita.cms.ui.BaseItemPane;
import com.arsdigita.cms.ui.ContentItemPage; import com.arsdigita.cms.ui.ContentItemPage;
import com.arsdigita.cms.ui.item.ContentItemRequestLocal; import com.arsdigita.cms.ui.item.ContentItemRequestLocal;
import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.globalization.GlobalizationHelper;
import com.arsdigita.globalization.GlobalizedMessage;
import com.arsdigita.kernel.Party;
import com.arsdigita.kernel.PartyCollection;
import com.arsdigita.notification.Notification;
import com.arsdigita.persistence.OID; import com.arsdigita.persistence.OID;
import com.arsdigita.toolbox.ui.ActionGroup; import com.arsdigita.toolbox.ui.ActionGroup;
import com.arsdigita.toolbox.ui.PropertyList; import com.arsdigita.toolbox.ui.PropertyList;
@ -65,6 +72,10 @@ import com.arsdigita.web.Web;
import com.arsdigita.workflow.simple.TaskException; import com.arsdigita.workflow.simple.TaskException;
import com.arsdigita.workflow.simple.Workflow; import com.arsdigita.workflow.simple.Workflow;
import com.arsdigita.xml.Element; import com.arsdigita.xml.Element;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Locale;
/** /**
* This class contains the component which displays the information for a * This class contains the component which displays the information for a
@ -97,6 +108,29 @@ class ItemLifecycleItemPane extends BaseItemPane {
setDefault(m_detailPane); setDefault(m_detailPane);
m_detailPane.add(new SummarySection()); m_detailPane.add(new SummarySection());
final Label lastPublishedLabel = new Label();
lastPublishedLabel.addPrintListener(new PrintListener() {
public void prepare(final PrintEvent event) {
final PageState state = event.getPageState();
final ContentItem item = m_item.getContentItem(state).
getLiveVersion();
final Label label = (Label) event.getTarget();
final String dateStr =
DateFormat.getDateTimeInstance(DateFormat.LONG,
DateFormat.SHORT,
GlobalizationHelper.
getNegotiatedLocale()).format(item.getLastModifiedDate());
final String msg = String.format(
"%s %s",
new GlobalizedMessage(
"cms.ui.lifecycle.details.last_published",
"com.arsdigita.cms.CMSResources").localize(),
dateStr);
label.setLabel(msg);
}
});
m_detailPane.add(lastPublishedLabel);
m_detailPane.add(new PhaseSection()); m_detailPane.add(new PhaseSection());
} }
@ -258,6 +292,59 @@ class ItemLifecycleItemPane extends BaseItemPane {
+ "publishing the item '%s': ", + "publishing the item '%s': ",
item.getOID().toString()), item.getOID().toString()),
ex); ex);
if ((CMSConfig.getInstance().
getPublicationFailureSender()
== null)
&& (CMSConfig.getInstance().
getPublicationFailureReceiver() == null)) {
return;
}
final PartyCollection receiverParties = Party.
retrieveAllParties();
Party receiver = null;
receiverParties.addEqualsFilter("primaryEmail",
CMSConfig.
getInstance().
getPublicationFailureReceiver());
if (receiverParties.next()) {
receiver = receiverParties.getParty();
}
receiverParties.close();
final PartyCollection senderParties = Party.
retrieveAllParties();
Party sender = null;
senderParties.addEqualsFilter("primaryEmail",
CMSConfig.getInstance().
getPublicationFailureReceiver());
if (senderParties.next()) {
sender = senderParties.getParty();
}
senderParties.close();
if ((sender != null) && (receiver != null)) {
final Writer traceWriter = new StringWriter();
final PrintWriter printWriter = new PrintWriter(
traceWriter);
ex.printStackTrace(printWriter);
final Notification notification =
new Notification(
sender,
receiver,
String.format(
"Failed to publish item '%s'",
item.getOID().toString()),
String.format("Publishing item '%s' failed "
+ "with error message: %s.\n\n"
+ "Stacktrace:\n%s",
item.getOID().toString(),
ex.getMessage(),
traceWriter.toString()));
notification.save();
}
} }
}); });
@ -345,6 +432,59 @@ class ItemLifecycleItemPane extends BaseItemPane {
+ "publishing the item '%s': ", + "publishing the item '%s': ",
item.getOID().toString()), item.getOID().toString()),
ex); ex);
if ((CMSConfig.getInstance().
getPublicationFailureSender()
== null)
&& (CMSConfig.getInstance().
getPublicationFailureReceiver() == null)) {
return;
}
final PartyCollection receiverParties = Party.
retrieveAllParties();
Party receiver = null;
receiverParties.addEqualsFilter("primaryEmail",
CMSConfig.
getInstance().
getPublicationFailureReceiver());
if (receiverParties.next()) {
receiver = receiverParties.getParty();
}
receiverParties.close();
final PartyCollection senderParties = Party.
retrieveAllParties();
Party sender = null;
senderParties.addEqualsFilter("primaryEmail",
CMSConfig.getInstance().
getPublicationFailureReceiver());
if (senderParties.next()) {
sender = senderParties.getParty();
}
senderParties.close();
if ((sender != null) && (receiver != null)) {
final Writer traceWriter = new StringWriter();
final PrintWriter printWriter = new PrintWriter(
traceWriter);
ex.printStackTrace(printWriter);
final Notification notification =
new Notification(
sender,
receiver,
String.format(
"Failed to publish item '%s'",
item.getOID().toString()),
String.format("Publishing item '%s' failed "
+ "with error message: %s.\n\n"
+ "Stacktrace:\n%s",
item.getOID().toString(),
ex.getMessage(),
traceWriter.toString()));
notification.save();
}
} }
}); });
@ -515,6 +655,59 @@ class ItemLifecycleItemPane extends BaseItemPane {
+ "publishing the item '%s': ", + "publishing the item '%s': ",
item.getOID().toString()), item.getOID().toString()),
ex); ex);
if ((CMSConfig.getInstance().
getPublicationFailureSender()
== null)
&& (CMSConfig.getInstance().
getPublicationFailureReceiver() == null)) {
return;
}
final PartyCollection receiverParties = Party.
retrieveAllParties();
Party receiver = null;
receiverParties.addEqualsFilter("primaryEmail",
CMSConfig.
getInstance().
getPublicationFailureReceiver());
if (receiverParties.next()) {
receiver = receiverParties.getParty();
}
receiverParties.close();
final PartyCollection senderParties = Party.
retrieveAllParties();
Party sender = null;
senderParties.addEqualsFilter("primaryEmail",
CMSConfig.getInstance().
getPublicationFailureReceiver());
if (senderParties.next()) {
sender = senderParties.getParty();
}
senderParties.close();
if ((sender != null) && (receiver != null)) {
final Writer traceWriter = new StringWriter();
final PrintWriter printWriter = new PrintWriter(
traceWriter);
ex.printStackTrace(printWriter);
final Notification notification =
new Notification(
sender,
receiver,
String.format(
"Failed to publish item '%s'",
item.getOID().toString()),
String.format("Publishing item '%s' failed "
+ "with error message: %s.\n\n"
+ "Stacktrace:\n%s",
item.getOID().toString(),
ex.getMessage(),
traceWriter.toString()));
notification.save();
}
} }
}); });
@ -550,6 +743,59 @@ class ItemLifecycleItemPane extends BaseItemPane {
+ "publishing the item '%s': ", + "publishing the item '%s': ",
item.getOID().toString()), item.getOID().toString()),
ex); ex);
if ((CMSConfig.getInstance().
getPublicationFailureSender()
== null)
&& (CMSConfig.getInstance().
getPublicationFailureReceiver() == null)) {
return;
}
final PartyCollection receiverParties = Party.
retrieveAllParties();
Party receiver = null;
receiverParties.addEqualsFilter("primaryEmail",
CMSConfig.
getInstance().
getPublicationFailureReceiver());
if (receiverParties.next()) {
receiver = receiverParties.getParty();
}
receiverParties.close();
final PartyCollection senderParties = Party.
retrieveAllParties();
Party sender = null;
senderParties.addEqualsFilter("primaryEmail",
CMSConfig.getInstance().
getPublicationFailureReceiver());
if (senderParties.next()) {
sender = senderParties.getParty();
}
senderParties.close();
if ((sender != null) && (receiver != null)) {
final Writer traceWriter = new StringWriter();
final PrintWriter printWriter = new PrintWriter(
traceWriter);
ex.printStackTrace(printWriter);
final Notification notification =
new Notification(
sender,
receiver,
String.format(
"Failed to publish item '%s'",
item.getOID().toString()),
String.format("Publishing item '%s' failed "
+ "with error message: %s.\n\n"
+ "Stacktrace:\n%s",
item.getOID().toString(),
ex.getMessage(),
traceWriter.toString()));
notification.save();
}
} }
}); });

View File

@ -60,7 +60,10 @@ import com.arsdigita.cms.workflow.CMSEngine;
import com.arsdigita.cms.workflow.CMSTask; import com.arsdigita.cms.workflow.CMSTask;
import com.arsdigita.cms.workflow.CMSTaskType; import com.arsdigita.cms.workflow.CMSTaskType;
import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.kernel.Party;
import com.arsdigita.kernel.PartyCollection;
import com.arsdigita.kernel.User; import com.arsdigita.kernel.User;
import com.arsdigita.notification.Notification;
import com.arsdigita.persistence.OID; import com.arsdigita.persistence.OID;
import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.UncheckedWrapperException;
import com.arsdigita.web.RedirectSignal; import com.arsdigita.web.RedirectSignal;
@ -70,6 +73,9 @@ import com.arsdigita.workflow.simple.Engine;
import com.arsdigita.workflow.simple.TaskException; import com.arsdigita.workflow.simple.TaskException;
import com.arsdigita.workflow.simple.Workflow; import com.arsdigita.workflow.simple.Workflow;
import com.arsdigita.workflow.simple.WorkflowTemplate; import com.arsdigita.workflow.simple.WorkflowTemplate;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.Calendar; import java.util.Calendar;
@ -397,6 +403,54 @@ class ItemLifecycleSelectForm extends BaseForm {
+ "publishing the item '%s': ", + "publishing the item '%s': ",
item.getOID().toString()), item.getOID().toString()),
ex); ex);
if ((CMSConfig.getInstance().getPublicationFailureSender()
== null)
&& (CMSConfig.getInstance().
getPublicationFailureReceiver() == null)) {
return;
}
final PartyCollection receiverParties = Party.
retrieveAllParties();
Party receiver = null;
receiverParties.addEqualsFilter("primaryEmail",
CMSConfig.getInstance().
getPublicationFailureReceiver());
if (receiverParties.next()) {
receiver = receiverParties.getParty();
}
receiverParties.close();
final PartyCollection senderParties = Party.
retrieveAllParties();
Party sender = null;
senderParties.addEqualsFilter("primaryEmail", CMSConfig.
getInstance().getPublicationFailureReceiver());
if (senderParties.next()) {
sender = senderParties.getParty();
}
senderParties.close();
if ((sender != null) && (receiver != null)) {
final Writer traceWriter = new StringWriter();
final PrintWriter printWriter = new PrintWriter(
traceWriter);
ex.printStackTrace(printWriter);
final Notification notification = new Notification(
sender,
receiver,
String.format("Failed to publish item '%s'",
item.getOID().toString()),
String.format("Publishing item '%s' failed "
+ "with error message: %s.\n\n"
+ "Stacktrace:\n%s",
item.getOID().toString(),
ex.getMessage(),
traceWriter.toString()));
notification.save();
}
} }
}); });
thread.start(); thread.start();