Fehler #2400 FormprocessException, modul ccm-cms PART I
git-svn-id: https://svn.libreccm.org/ccm/trunk@3139 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
578995ebcb
commit
1cfc7d7648
|
|
@ -1085,3 +1085,4 @@ cms.ui.contentcenter.section_hint=All content items are organized in one or more
|
||||||
cms.ui.contentcenter.location=Location
|
cms.ui.contentcenter.location=Location
|
||||||
cms.ui.contentcenter.location_hint=In Legacy mode links to public pages.
|
cms.ui.contentcenter.location_hint=In Legacy mode links to public pages.
|
||||||
cms.ui.contentcenter.action_hint=If activated displays a form for each content section to create an object of a given type (configurable) in the root of the given content section. The list of available types retrieved for each content section. Administrators will disable this option in order to prevent disorganizing the root directory.
|
cms.ui.contentcenter.action_hint=If activated displays a form for each content section to create an object of a given type (configurable) in the root of the given content section. The list of available types retrieved for each content section. Administrators will disable this option in order to prevent disorganizing the root directory.
|
||||||
|
cms.ui.property_already_exist=The following Property already exists:
|
||||||
|
|
|
||||||
|
|
@ -1079,3 +1079,4 @@ cms.ui.contentcenter.section_hint=All documents are organized in one or more con
|
||||||
cms.ui.contentcenter.location=Ort
|
cms.ui.contentcenter.location=Ort
|
||||||
cms.ui.contentcenter.location_hint=In Legacy mode links to public pages.
|
cms.ui.contentcenter.location_hint=In Legacy mode links to public pages.
|
||||||
cms.ui.contentcenter.action_hint=Falls aktiv wird ein Formular angezeigt, um im ROOT Verzeichnis der entsprechenden Sektion ein neues Dokument anzulegen. Administratoren deaktivieren diese Option, um das ROOT Verzeichnis nicht zu \u00fcberfrachten.
|
cms.ui.contentcenter.action_hint=Falls aktiv wird ein Formular angezeigt, um im ROOT Verzeichnis der entsprechenden Sektion ein neues Dokument anzulegen. Administratoren deaktivieren diese Option, um das ROOT Verzeichnis nicht zu \u00fcberfrachten.
|
||||||
|
cms.ui.property_already_exist=Das folgende Objekt existiert bereits:
|
||||||
|
|
|
||||||
|
|
@ -122,3 +122,4 @@ cms.ui.contentcenter.section_hint=All content items are organized in one or more
|
||||||
cms.ui.contentcenter.location=Location
|
cms.ui.contentcenter.location=Location
|
||||||
cms.ui.contentcenter.location_hint=In Legacy mode links to public pages.
|
cms.ui.contentcenter.location_hint=In Legacy mode links to public pages.
|
||||||
cms.ui.contentcenter.action_hint=If activated displays a form for each content section to create an object of a given type (configurable) in the root of the given content section. The list of available types retrieved for each content section. Administrators will disable this option in order to prevent disorganizing the root directory.
|
cms.ui.contentcenter.action_hint=If activated displays a form for each content section to create an object of a given type (configurable) in the root of the given content section. The list of available types retrieved for each content section. Administrators will disable this option in order to prevent disorganizing the root directory.
|
||||||
|
cms.ui.property_already_exist=The following Property already exists:
|
||||||
|
|
|
||||||
|
|
@ -591,3 +591,4 @@ cms.ui.contentcenter.section_hint=All documents are organized in one or more con
|
||||||
cms.ui.contentcenter.location=TRANSLATE: Location
|
cms.ui.contentcenter.location=TRANSLATE: Location
|
||||||
cms.ui.contentcenter.location_hint=In Legacy mode links to public pages.
|
cms.ui.contentcenter.location_hint=In Legacy mode links to public pages.
|
||||||
cms.ui.contentcenter.action_hint=If activated displays a form for each content section to create an object of a given type (configurable) in the root of the given content section. The list of available types retrieved for each content section. Administrators will disable this option in order to prevent disorganizing the root directory.
|
cms.ui.contentcenter.action_hint=If activated displays a form for each content section to create an object of a given type (configurable) in the root of the given content section. The list of available types retrieved for each content section. Administrators will disable this option in order to prevent disorganizing the root directory.
|
||||||
|
cms.ui.property_already_exist=The following Property already exists:
|
||||||
|
|
|
||||||
|
|
@ -385,9 +385,8 @@ public class PageCreateDynamic extends FormSection
|
||||||
|
|
||||||
if(getSaveCancelSection().getCancelButton().isSelected(state)) {
|
if(getSaveCancelSection().getCancelButton().isSelected(state)) {
|
||||||
m_parent.redirectBack(state);
|
m_parent.redirectBack(state);
|
||||||
throw new FormProcessException( (String) GlobalizationUtil
|
throw new FormProcessException(GlobalizationUtil
|
||||||
.globalize("cms.ui.authoring.submission_cancelled")
|
.globalize("cms.ui.authoring.submission_cancelled"));
|
||||||
.localize());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ public class EditKit extends Form
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
if ( isCancelled(state) ) {
|
if ( isCancelled(state) ) {
|
||||||
throw new FormProcessException( (String) GlobalizationUtil.globalize("cms.ui.cancel_hit").localize());
|
throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.cancel_hit"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ public class CategoryLocalizationForm extends BaseForm {
|
||||||
if (compField.equalsIgnoreCase(title)
|
if (compField.equalsIgnoreCase(title)
|
||||||
&& (m_category == null
|
&& (m_category == null
|
||||||
|| !m_category.getCategory(state).equals(child))) {
|
|| !m_category.getCategory(state).equals(child))) {
|
||||||
throw new FormProcessException(lz("cms.ui.category.name_not_unique"));
|
throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.category.name_not_unique"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ import com.arsdigita.cms.ItemCollection;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import com.arsdigita.cms.lifecycle.LifecycleDefinition;
|
import com.arsdigita.cms.lifecycle.LifecycleDefinition;
|
||||||
import com.arsdigita.cms.ui.lifecycle.PublishLock;
|
import com.arsdigita.cms.ui.lifecycle.PublishLock;
|
||||||
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.kernel.ACSObject;
|
import com.arsdigita.kernel.ACSObject;
|
||||||
|
|
@ -627,7 +628,7 @@ public class FolderManipulator extends SimpleContainer implements
|
||||||
|
|
||||||
if (targetSelector.isCancelled(state)) {
|
if (targetSelector.isCancelled(state)) {
|
||||||
reset(state);
|
reset(state);
|
||||||
throw new FormProcessException("cms.ui.folder.cancelled");
|
throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.folder.cancelled"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ import com.arsdigita.cms.lifecycle.LifecycleDefinition;
|
||||||
import com.arsdigita.cms.lifecycle.LifecycleDefinitionCollection;
|
import com.arsdigita.cms.lifecycle.LifecycleDefinitionCollection;
|
||||||
import com.arsdigita.cms.ui.BaseForm;
|
import com.arsdigita.cms.ui.BaseForm;
|
||||||
import com.arsdigita.cms.ui.FormSecurityListener;
|
import com.arsdigita.cms.ui.FormSecurityListener;
|
||||||
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
@ -100,7 +101,7 @@ class BaseLifecycleForm extends BaseForm {
|
||||||
definitions.close();
|
definitions.close();
|
||||||
|
|
||||||
throw new FormProcessException
|
throw new FormProcessException
|
||||||
(lz("cms.ui.lifecycle.name_not_unique"));
|
(GlobalizationUtil.globalize("cms.ui.lifecycle.name_not_unique"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>A form to select and apply a lifecycle to a content item.</p>
|
* <p>
|
||||||
|
* A form to select and apply a lifecycle to a content item.</p>
|
||||||
*
|
*
|
||||||
* @author Michael Pih
|
* @author Michael Pih
|
||||||
* @author Xixi D'moon <xdmoon@redhat.com>
|
* @author Xixi D'moon <xdmoon@redhat.com>
|
||||||
|
|
@ -96,8 +97,8 @@ import org.apache.log4j.Logger;
|
||||||
*/
|
*/
|
||||||
class ItemLifecycleSelectForm extends BaseForm {
|
class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
private static final Logger s_log =
|
private static final Logger s_log
|
||||||
Logger.getLogger(ItemLifecycleSelectForm.class);
|
= Logger.getLogger(ItemLifecycleSelectForm.class);
|
||||||
private final static String LIFECYCLE = "lifecycle";
|
private final static String LIFECYCLE = "lifecycle";
|
||||||
private final static String START_DATE = "start_date";
|
private final static String START_DATE = "start_date";
|
||||||
private final static String END_DATE = "end_date";
|
private final static String END_DATE = "end_date";
|
||||||
|
|
@ -157,7 +158,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
m_startHour.setSize(3);
|
m_startHour.setSize(3);
|
||||||
m_startHour.addValidationListener(
|
m_startHour.addValidationListener(
|
||||||
new NumberInRangeValidationListener(1, 12));
|
new NumberInRangeValidationListener(1, 12));
|
||||||
|
|
||||||
// Minute
|
// Minute
|
||||||
m_startMinute = new TextField(new IntegerParameter("start_minute"));
|
m_startMinute = new TextField(new IntegerParameter("start_minute"));
|
||||||
|
|
@ -165,7 +166,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
m_startMinute.setSize(3);
|
m_startMinute.setSize(3);
|
||||||
m_startMinute.addValidationListener(new NumberInRangeValidationListener(
|
m_startMinute.addValidationListener(new NumberInRangeValidationListener(
|
||||||
0, 59));
|
0, 59));
|
||||||
|
|
||||||
// AM/PM
|
// AM/PM
|
||||||
m_startAmpm = new SingleSelect(new IntegerParameter("start_ampm"));
|
m_startAmpm = new SingleSelect(new IntegerParameter("start_ampm"));
|
||||||
|
|
@ -202,7 +203,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
m_endHour.setSize(3);
|
m_endHour.setSize(3);
|
||||||
m_endHour.addValidationListener(new NumberInRangeValidationListener(1,
|
m_endHour.addValidationListener(new NumberInRangeValidationListener(1,
|
||||||
12));
|
12));
|
||||||
|
|
||||||
// Minute
|
// Minute
|
||||||
m_endMinute = new TextField(new IntegerParameter("end_minute"));
|
m_endMinute = new TextField(new IntegerParameter("end_minute"));
|
||||||
|
|
@ -210,7 +211,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
m_endMinute.setSize(3);
|
m_endMinute.setSize(3);
|
||||||
m_endMinute.addValidationListener(
|
m_endMinute.addValidationListener(
|
||||||
new NumberInRangeValidationListener(0, 59));
|
new NumberInRangeValidationListener(0, 59));
|
||||||
|
|
||||||
// AM/PM
|
// AM/PM
|
||||||
m_endAmpm = new SingleSelect(new IntegerParameter("end_ampm"));
|
m_endAmpm = new SingleSelect(new IntegerParameter("end_ampm"));
|
||||||
|
|
@ -228,10 +229,10 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
SimpleContainer cont = new SimpleContainer();
|
SimpleContainer cont = new SimpleContainer();
|
||||||
cont.add(m_notificationDays);
|
cont.add(m_notificationDays);
|
||||||
cont.add(new Label(GlobalizationUtil.globalize("cms.ui.item.days"),
|
cont.add(new Label(GlobalizationUtil.globalize("cms.ui.item.days"),
|
||||||
false));
|
false));
|
||||||
cont.add(m_notificationHours);
|
cont.add(m_notificationHours);
|
||||||
cont.add(new Label(GlobalizationUtil.globalize("cms.ui.item.hours"),
|
cont.add(new Label(GlobalizationUtil.globalize("cms.ui.item.hours"),
|
||||||
false));
|
false));
|
||||||
|
|
||||||
addField(gz("cms.ui.item.notification_period"), cont);
|
addField(gz("cms.ui.item.notification_period"), cont);
|
||||||
|
|
||||||
|
|
@ -267,7 +268,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
// ready to be applied to an item.
|
// ready to be applied to an item.
|
||||||
if (!pdc.isEmpty()) {
|
if (!pdc.isEmpty()) {
|
||||||
target.addOption(new Option(ld.getID().toString(),
|
target.addOption(new Option(ld.getID().toString(),
|
||||||
ld.getLabel()));
|
ld.getLabel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
pdc.close();
|
pdc.close();
|
||||||
|
|
@ -291,14 +292,14 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
// associated lifecycle.
|
// associated lifecycle.
|
||||||
|
|
||||||
final LifecycleDefinition ld = item.getLifecycle().
|
final LifecycleDefinition ld = item.getLifecycle().
|
||||||
getLifecycleDefinition();
|
getLifecycleDefinition();
|
||||||
m_cycleSelect.setValue(state, ld.getID());
|
m_cycleSelect.setValue(state, ld.getID());
|
||||||
} else {
|
} else {
|
||||||
// Set the default lifecycle (if it exists).
|
// Set the default lifecycle (if it exists).
|
||||||
|
|
||||||
final ContentSection section = CMS.getContext().getContentSection();
|
final ContentSection section = CMS.getContext().getContentSection();
|
||||||
final LifecycleDefinition ld = ContentTypeLifecycleDefinition.
|
final LifecycleDefinition ld = ContentTypeLifecycleDefinition.
|
||||||
getLifecycleDefinition(section, item.getContentType());
|
getLifecycleDefinition(section, item.getContentType());
|
||||||
|
|
||||||
if (ld != null) {
|
if (ld != null) {
|
||||||
m_cycleSelect.setValue(state, ld.getID());
|
m_cycleSelect.setValue(state, ld.getID());
|
||||||
|
|
@ -308,7 +309,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
// Set the default start date.
|
// Set the default start date.
|
||||||
// XXX Isn't just new Date() sufficient?
|
// XXX Isn't just new Date() sufficient?
|
||||||
final java.util.Date start = new java.util.Date(System.
|
final java.util.Date start = new java.util.Date(System.
|
||||||
currentTimeMillis());
|
currentTimeMillis());
|
||||||
m_startDate.setValue(state, start);
|
m_startDate.setValue(state, start);
|
||||||
|
|
||||||
final Calendar calendar = Calendar.getInstance();
|
final Calendar calendar = Calendar.getInstance();
|
||||||
|
|
@ -321,7 +322,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
m_startHour.setValue(state, new Integer(12));
|
m_startHour.setValue(state, new Integer(12));
|
||||||
} else {
|
} else {
|
||||||
m_startHour.setValue(state, new Integer(calendar.get(
|
m_startHour.setValue(state, new Integer(calendar.get(
|
||||||
Calendar.HOUR)));
|
Calendar.HOUR)));
|
||||||
}
|
}
|
||||||
|
|
||||||
final Integer min = new Integer(calendar.get(Calendar.MINUTE));
|
final Integer min = new Integer(calendar.get(Calendar.MINUTE));
|
||||||
|
|
@ -333,16 +334,16 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
m_startAmpm.setValue(state,
|
m_startAmpm.setValue(state,
|
||||||
new Integer(calendar.get(Calendar.AM_PM)));
|
new Integer(calendar.get(Calendar.AM_PM)));
|
||||||
|
|
||||||
BigInteger[] defaultTime = BigInteger.valueOf(ContentSection.getConfig().
|
BigInteger[] defaultTime = BigInteger.valueOf(ContentSection.getConfig().
|
||||||
getDefaultNotificationTime()).
|
getDefaultNotificationTime()).
|
||||||
divideAndRemainder(BigInteger.valueOf(24));
|
divideAndRemainder(BigInteger.valueOf(24));
|
||||||
|
|
||||||
m_notificationDays.setValue(state, new Integer(defaultTime[0].
|
m_notificationDays.setValue(state, new Integer(defaultTime[0].
|
||||||
intValue()));
|
intValue()));
|
||||||
m_notificationHours.setValue(state, new Integer(defaultTime[1].
|
m_notificationHours.setValue(state, new Integer(defaultTime[1].
|
||||||
intValue()));
|
intValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -359,7 +360,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void process(final FormSectionEvent e)
|
public final void process(final FormSectionEvent e)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
final PageState state = e.getPageState();
|
final PageState state = e.getPageState();
|
||||||
final ContentItem item = m_item.getContentItem(state);
|
final ContentItem item = m_item.getContentItem(state);
|
||||||
|
|
||||||
|
|
@ -380,41 +381,41 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uncaughtException(final Thread thread,
|
public void uncaughtException(final Thread thread,
|
||||||
final Throwable ex) {
|
final Throwable ex) {
|
||||||
final StringWriter strWriter = new StringWriter();
|
final StringWriter strWriter = new StringWriter();
|
||||||
final PrintWriter writer = new PrintWriter(strWriter);
|
final PrintWriter writer = new PrintWriter(strWriter);
|
||||||
ex.printStackTrace(writer);
|
ex.printStackTrace(writer);
|
||||||
|
|
||||||
PublishLock.getInstance().setError(item, strWriter.toString());
|
PublishLock.getInstance().setError(item, strWriter.toString());
|
||||||
s_log.error(String.format(
|
s_log.error(String.format(
|
||||||
"An error occurred while "
|
"An error occurred while "
|
||||||
+ "publishing the item '%s': ",
|
+ "publishing the item '%s': ",
|
||||||
item.getOID().toString()),
|
item.getOID().toString()),
|
||||||
ex);
|
ex);
|
||||||
|
|
||||||
if ((CMSConfig.getInstanceOf().getPublicationFailureSender()
|
if ((CMSConfig.getInstanceOf().getPublicationFailureSender()
|
||||||
== null)
|
== null)
|
||||||
&& (CMSConfig.getInstanceOf().
|
&& (CMSConfig.getInstanceOf().
|
||||||
getPublicationFailureReceiver() == null)) {
|
getPublicationFailureReceiver() == null)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final PartyCollection receiverParties = Party.
|
final PartyCollection receiverParties = Party.
|
||||||
retrieveAllParties();
|
retrieveAllParties();
|
||||||
Party receiver = null;
|
Party receiver = null;
|
||||||
receiverParties.addEqualsFilter("primaryEmail",
|
receiverParties.addEqualsFilter("primaryEmail",
|
||||||
CMSConfig.getInstanceOf().
|
CMSConfig.getInstanceOf().
|
||||||
getPublicationFailureReceiver());
|
getPublicationFailureReceiver());
|
||||||
if (receiverParties.next()) {
|
if (receiverParties.next()) {
|
||||||
receiver = receiverParties.getParty();
|
receiver = receiverParties.getParty();
|
||||||
}
|
}
|
||||||
receiverParties.close();
|
receiverParties.close();
|
||||||
|
|
||||||
final PartyCollection senderParties = Party.
|
final PartyCollection senderParties = Party.
|
||||||
retrieveAllParties();
|
retrieveAllParties();
|
||||||
Party sender = null;
|
Party sender = null;
|
||||||
senderParties.addEqualsFilter("primaryEmail", CMSConfig.
|
senderParties.addEqualsFilter("primaryEmail", CMSConfig.
|
||||||
getInstanceOf().getPublicationFailureReceiver());
|
getInstanceOf().getPublicationFailureReceiver());
|
||||||
if (senderParties.next()) {
|
if (senderParties.next()) {
|
||||||
sender = senderParties.getParty();
|
sender = senderParties.getParty();
|
||||||
}
|
}
|
||||||
|
|
@ -423,20 +424,20 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
if ((sender != null) && (receiver != null)) {
|
if ((sender != null) && (receiver != null)) {
|
||||||
final Writer traceWriter = new StringWriter();
|
final Writer traceWriter = new StringWriter();
|
||||||
final PrintWriter printWriter = new PrintWriter(
|
final PrintWriter printWriter = new PrintWriter(
|
||||||
traceWriter);
|
traceWriter);
|
||||||
ex.printStackTrace(printWriter);
|
ex.printStackTrace(printWriter);
|
||||||
|
|
||||||
final Notification notification = new Notification(
|
final Notification notification = new Notification(
|
||||||
sender,
|
sender,
|
||||||
receiver,
|
receiver,
|
||||||
String.format("Failed to publish item '%s'",
|
String.format("Failed to publish item '%s'",
|
||||||
item.getOID().toString()),
|
item.getOID().toString()),
|
||||||
String.format("Publishing item '%s' failed "
|
String.format("Publishing item '%s' failed "
|
||||||
+ "with error message: %s.\n\n"
|
+ "with error message: %s.\n\n"
|
||||||
+ "Stacktrace:\n%s",
|
+ "Stacktrace:\n%s",
|
||||||
item.getOID().toString(),
|
item.getOID().toString(),
|
||||||
ex.getMessage(),
|
ex.getMessage(),
|
||||||
traceWriter.toString()));
|
traceWriter.toString()));
|
||||||
notification.save();
|
notification.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -449,16 +450,16 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
if (CMSConfig.getInstanceOf().getThreadedPublishing()) {
|
if (CMSConfig.getInstanceOf().getThreadedPublishing()) {
|
||||||
throw new RedirectSignal(
|
throw new RedirectSignal(
|
||||||
URL.getDispatcherPath()
|
URL.getDispatcherPath()
|
||||||
+ ContentItemPage.getItemURL(item,
|
+ ContentItemPage.getItemURL(item,
|
||||||
ContentItemPage.PUBLISHING_TAB),
|
ContentItemPage.PUBLISHING_TAB),
|
||||||
true);
|
true);
|
||||||
} else {
|
} else {
|
||||||
if (ContentSection.getConfig().getUseStreamlinedCreation()) {
|
if (ContentSection.getConfig().getUseStreamlinedCreation()) {
|
||||||
throw new RedirectSignal(
|
throw new RedirectSignal(
|
||||||
URL.there(state.getRequest(),
|
URL.there(state.getRequest(),
|
||||||
ContentCenter.getURL()),
|
ContentCenter.getURL()),
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -642,7 +643,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
start.set(Calendar.AM_PM, startAmpm.intValue());
|
start.set(Calendar.AM_PM, startAmpm.intValue());
|
||||||
if (startHour.intValue() != 12) {
|
if (startHour.intValue() != 12) {
|
||||||
start.set(Calendar.HOUR_OF_DAY,
|
start.set(Calendar.HOUR_OF_DAY,
|
||||||
12 * startAmpm.intValue() + startHour.intValue());
|
12 * startAmpm.intValue() + startHour.intValue());
|
||||||
start.set(Calendar.HOUR, startHour.intValue());
|
start.set(Calendar.HOUR, startHour.intValue());
|
||||||
} else {
|
} else {
|
||||||
if (startAmpm.intValue() == 0) {
|
if (startAmpm.intValue() == 0) {
|
||||||
|
|
@ -704,7 +705,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
*/
|
*/
|
||||||
final OID oid = OID.valueOf(oidStr);
|
final OID oid = OID.valueOf(oidStr);
|
||||||
final ContentItem item = (ContentItem) DomainObjectFactory.
|
final ContentItem item = (ContentItem) DomainObjectFactory.
|
||||||
newInstance(oid);
|
newInstance(oid);
|
||||||
|
|
||||||
// If the item is already published, remove the current lifecycle.
|
// If the item is already published, remove the current lifecycle.
|
||||||
// Do not touch the live version.
|
// Do not touch the live version.
|
||||||
|
|
@ -765,13 +766,13 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
notificationDate = computeNotificationDate(endOfCycle, notificationPeriod);
|
notificationDate = computeNotificationDate(endOfCycle, notificationPeriod);
|
||||||
s_log.debug("adding custom phase");
|
s_log.debug("adding custom phase");
|
||||||
Phase expirationImminentPhase = lifecycle.addCustomPhase("expirationImminent",
|
Phase expirationImminentPhase = lifecycle.addCustomPhase("expirationImminent",
|
||||||
new Long(
|
new Long(
|
||||||
notificationDate.
|
notificationDate.
|
||||||
getTime()),
|
getTime()),
|
||||||
new Long(endOfCycle.
|
new Long(endOfCycle.
|
||||||
getTime()));
|
getTime()));
|
||||||
expirationImminentPhase.setListenerClassName(
|
expirationImminentPhase.setListenerClassName(
|
||||||
"com.arsdigita.cms.lifecycle.NotifyLifecycleListener");
|
"com.arsdigita.cms.lifecycle.NotifyLifecycleListener");
|
||||||
expirationImminentPhase.save();
|
expirationImminentPhase.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -785,7 +786,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
if (workflowOid != null) {
|
if (workflowOid != null) {
|
||||||
final Workflow workflow = (Workflow) DomainObjectFactory.newInstance(OID.
|
final Workflow workflow = (Workflow) DomainObjectFactory.newInstance(OID.
|
||||||
valueOf(workflowOid));
|
valueOf(workflowOid));
|
||||||
try {
|
try {
|
||||||
finish(workflow, item, user);
|
finish(workflow, item, user);
|
||||||
} catch (TaskException ex) {
|
} catch (TaskException ex) {
|
||||||
|
|
@ -797,13 +798,13 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void finish(Workflow workflow, ContentItem item, User user) throws
|
static void finish(Workflow workflow, ContentItem item, User user) throws
|
||||||
TaskException {
|
TaskException {
|
||||||
if ((workflow != null) && (user != null)) {
|
if ((workflow != null) && (user != null)) {
|
||||||
final Engine engine = Engine.getInstance(CMSEngine.CMS_ENGINE_TYPE);
|
final Engine engine = Engine.getInstance(CMSEngine.CMS_ENGINE_TYPE);
|
||||||
// ;
|
// ;
|
||||||
|
|
||||||
final Iterator iter = engine.getEnabledTasks(user, workflow.getID()).
|
final Iterator iter = engine.getEnabledTasks(user, workflow.getID()).
|
||||||
iterator();
|
iterator();
|
||||||
|
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
final CMSTask task = (CMSTask) iter.next();
|
final CMSTask task = (CMSTask) iter.next();
|
||||||
|
|
@ -840,8 +841,8 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
final Integer startHour = (Integer) m_startHour.getValue(state);
|
final Integer startHour = (Integer) m_startHour.getValue(state);
|
||||||
if (startHour == null) {
|
if (startHour == null) {
|
||||||
throw new FormProcessException(lz(
|
throw new FormProcessException(GlobalizationUtil.globalize(
|
||||||
"cms.ui.item.start_time_incomplete"));
|
"cms.ui.item.start_time_incomplete"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer startMinute = (Integer) m_startMinute.getValue(state);
|
Integer startMinute = (Integer) m_startMinute.getValue(state);
|
||||||
|
|
@ -852,10 +853,10 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
Integer startAmpm = (Integer) m_startAmpm.getValue(state);
|
Integer startAmpm = (Integer) m_startAmpm.getValue(state);
|
||||||
|
|
||||||
java.util.Date startDate = (java.util.Date) m_startDate.getValue(
|
java.util.Date startDate = (java.util.Date) m_startDate.getValue(
|
||||||
state);
|
state);
|
||||||
if (startDate == null) {
|
if (startDate == null) {
|
||||||
throw new FormProcessException(lz(
|
throw new FormProcessException(GlobalizationUtil.globalize(
|
||||||
"cms.ui.item.lifecycle.start_date_invalid"));
|
"cms.ui.item.lifecycle.start_date_invalid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
java.util.Date nowDate = new java.util.Date(System.currentTimeMillis());
|
java.util.Date nowDate = new java.util.Date(System.currentTimeMillis());
|
||||||
|
|
@ -867,7 +868,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
if (startHour.intValue() != 12) {
|
if (startHour.intValue() != 12) {
|
||||||
cStart.set(Calendar.HOUR_OF_DAY,
|
cStart.set(Calendar.HOUR_OF_DAY,
|
||||||
12 * startAmpm.intValue() + startHour.intValue());
|
12 * startAmpm.intValue() + startHour.intValue());
|
||||||
cStart.set(Calendar.HOUR, startHour.intValue());
|
cStart.set(Calendar.HOUR, startHour.intValue());
|
||||||
} else {
|
} else {
|
||||||
if (startAmpm.intValue() == 0) {
|
if (startAmpm.intValue() == 0) {
|
||||||
|
|
@ -887,8 +888,8 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
cStart.set(Calendar.MILLISECOND, cNow.get(Calendar.MILLISECOND));
|
cStart.set(Calendar.MILLISECOND, cNow.get(Calendar.MILLISECOND));
|
||||||
|
|
||||||
if (cNow.after(cStart)) {
|
if (cNow.after(cStart)) {
|
||||||
throw new FormProcessException(lz(
|
throw new FormProcessException(GlobalizationUtil.globalize(
|
||||||
"cms.ui.item.lifecycle.start_date_in_past"));
|
"cms.ui.item.lifecycle.start_date_in_past"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer endHour = (Integer) m_endHour.getValue(state);
|
Integer endHour = (Integer) m_endHour.getValue(state);
|
||||||
|
|
@ -896,8 +897,8 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
java.util.Date endDate = (java.util.Date) m_endDate.getValue(state);
|
java.util.Date endDate = (java.util.Date) m_endDate.getValue(state);
|
||||||
|
|
||||||
if (endHour == null && (endMinute != null || endDate != null)) {
|
if (endHour == null && (endMinute != null || endDate != null)) {
|
||||||
throw new FormProcessException(lz(
|
throw new FormProcessException(GlobalizationUtil.globalize(
|
||||||
"cms.ui.item.lifecycle.end_time_incomplete"));
|
"cms.ui.item.lifecycle.end_time_incomplete"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (endMinute == null && endHour != null) {
|
if (endMinute == null && endHour != null) {
|
||||||
|
|
@ -909,8 +910,8 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
Integer endAmpm = (Integer) m_endAmpm.getValue(state);
|
Integer endAmpm = (Integer) m_endAmpm.getValue(state);
|
||||||
|
|
||||||
if (endDate == null && !timeBlank) {
|
if (endDate == null && !timeBlank) {
|
||||||
throw new FormProcessException(lz(
|
throw new FormProcessException(GlobalizationUtil.globalize(
|
||||||
"cms.ui.item.lifecycle.end_date_invalid"));
|
"cms.ui.item.lifecycle.end_date_invalid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (endDate != null) {
|
if (endDate != null) {
|
||||||
|
|
@ -919,7 +920,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
if (endHour.intValue() != 12) {
|
if (endHour.intValue() != 12) {
|
||||||
cEnd.set(Calendar.HOUR_OF_DAY,
|
cEnd.set(Calendar.HOUR_OF_DAY,
|
||||||
12 * endAmpm.intValue() + endHour.intValue());
|
12 * endAmpm.intValue() + endHour.intValue());
|
||||||
cEnd.set(Calendar.HOUR, endHour.intValue());
|
cEnd.set(Calendar.HOUR, endHour.intValue());
|
||||||
} else {
|
} else {
|
||||||
if (endAmpm.intValue() == 0) {
|
if (endAmpm.intValue() == 0) {
|
||||||
|
|
@ -940,8 +941,8 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
//check if the end date is prior to the start date
|
//check if the end date is prior to the start date
|
||||||
if (cStart.after(cEnd)) {
|
if (cStart.after(cEnd)) {
|
||||||
throw new FormProcessException(lz(
|
throw new FormProcessException(GlobalizationUtil.globalize(
|
||||||
"cms.ui.item.lifecycle.end_date_before_start_date"));
|
"cms.ui.item.lifecycle.end_date_before_start_date"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer notificationDays = (Integer) m_notificationDays.getValue(state);
|
Integer notificationDays = (Integer) m_notificationDays.getValue(state);
|
||||||
|
|
@ -958,17 +959,14 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
if (notificationPeriod > 0) {
|
if (notificationPeriod > 0) {
|
||||||
// point in time for notification == end date - notificationPeriod
|
// point in time for notification == end date - notificationPeriod
|
||||||
java.util.Date notificationDate = computeNotificationDate(cEnd.getTime(),
|
java.util.Date notificationDate = computeNotificationDate(cEnd.getTime(),
|
||||||
notificationPeriod);
|
notificationPeriod);
|
||||||
s_log.debug("cStart (Date): " + cStart.getTime());
|
s_log.debug("cStart (Date): " + cStart.getTime());
|
||||||
s_log.debug("notificationDate: " + notificationDate);
|
s_log.debug("notificationDate: " + notificationDate);
|
||||||
// complain if date for notification is before the start date
|
// complain if date for notification is before the start date
|
||||||
if (notificationDate.before(cStart.getTime())) {
|
if (notificationDate.before(cStart.getTime())) {
|
||||||
s_log.debug("notification date is before start date!");
|
s_log.debug("notification date is before start date!");
|
||||||
String errorMessage = (String) GlobalizationUtil.
|
|
||||||
globalize(
|
throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.item.notification_period_before_start"));
|
||||||
"cms.ui.item.notification_period_before_start").
|
|
||||||
localize();
|
|
||||||
throw new FormProcessException(errorMessage);
|
|
||||||
} else {
|
} else {
|
||||||
s_log.debug("notification date is after start date, OK");
|
s_log.debug("notification date is after start date, OK");
|
||||||
}
|
}
|
||||||
|
|
@ -995,7 +993,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
final String zone = mStart.getTimeZone().getDisplayName(true,
|
final String zone = mStart.getTimeZone().getDisplayName(true,
|
||||||
TimeZone.SHORT);
|
TimeZone.SHORT);
|
||||||
|
|
||||||
target.setLabel(zone);
|
target.setLabel(zone);
|
||||||
}
|
}
|
||||||
|
|
@ -1009,18 +1007,18 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
* is unpublished) and the notification period.
|
* is unpublished) and the notification period.
|
||||||
*
|
*
|
||||||
* @param endDate the endDate of the lifecycle, i.e. the date when the item
|
* @param endDate the endDate of the lifecycle, i.e. the date when the item
|
||||||
* is going to be unpublished
|
* is going to be unpublished
|
||||||
* @param notification how many hours the users shouls be notified in
|
* @param notification how many hours the users shouls be notified in
|
||||||
* advance
|
* advance
|
||||||
*/
|
*/
|
||||||
private java.util.Date computeNotificationDate(java.util.Date endDate,
|
private java.util.Date computeNotificationDate(java.util.Date endDate,
|
||||||
int notificationPeriod) {
|
int notificationPeriod) {
|
||||||
if (endDate == null) {
|
if (endDate == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new java.util.Date(endDate.getTime() - (long) notificationPeriod
|
return new java.util.Date(endDate.getTime() - (long) notificationPeriod
|
||||||
* 3600000L);
|
* 3600000L);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ import com.arsdigita.bebop.event.ActionEvent;
|
||||||
import com.arsdigita.bebop.event.ActionListener;
|
import com.arsdigita.bebop.event.ActionListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.form.SingleSelect;
|
|
||||||
import com.arsdigita.bebop.form.TextArea;
|
import com.arsdigita.bebop.form.TextArea;
|
||||||
import com.arsdigita.bebop.form.Option;
|
import com.arsdigita.bebop.form.Option;
|
||||||
import com.arsdigita.bebop.form.SingleSelect;
|
import com.arsdigita.bebop.form.SingleSelect;
|
||||||
|
|
@ -65,12 +64,12 @@ public class TemplateBody extends TextAssetBody {
|
||||||
/**
|
/**
|
||||||
* Construct a new TemplateBody component
|
* Construct a new TemplateBody component
|
||||||
*
|
*
|
||||||
* @param itemModel The {@link ItemSelectionModel} which will
|
* @param itemModel The {@link ItemSelectionModel} which will be responsible
|
||||||
* be responsible for loading the current template
|
* for loading the current template
|
||||||
*
|
*
|
||||||
* @param parent The parent wizard which contains the form. The form
|
* @param parent The parent wizard which contains the form. The form may use
|
||||||
* may use the wizard's methods, such as stepForward and stepBack,
|
* the wizard's methods, such as stepForward and stepBack, in its process
|
||||||
* in its process listener.
|
* listener.
|
||||||
*/
|
*/
|
||||||
public TemplateBody(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
public TemplateBody(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||||
super(itemModel);
|
super(itemModel);
|
||||||
|
|
@ -78,27 +77,27 @@ public class TemplateBody extends TextAssetBody {
|
||||||
|
|
||||||
// Reset the component when it is hidden
|
// Reset the component when it is hidden
|
||||||
parent.getList().addActionListener(new ActionListener() {
|
parent.getList().addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
reset(state);
|
reset(state);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set the right component access on the forms -
|
// Set the right component access on the forms -
|
||||||
// FIXME: Update this for templating permissions !
|
// FIXME: Update this for templating permissions !
|
||||||
Component f = getComponent(FILE_UPLOAD);
|
Component f = getComponent(FILE_UPLOAD);
|
||||||
if (f != null) {
|
if (f != null) {
|
||||||
setComponentAccess(FILE_UPLOAD,
|
setComponentAccess(FILE_UPLOAD,
|
||||||
new WorkflowLockedComponentAccess(f, itemModel));
|
new WorkflowLockedComponentAccess(f, itemModel));
|
||||||
}
|
}
|
||||||
Component t = getComponent(TEXT_ENTRY);
|
Component t = getComponent(TEXT_ENTRY);
|
||||||
setComponentAccess(TEXT_ENTRY,
|
setComponentAccess(TEXT_ENTRY,
|
||||||
new WorkflowLockedComponentAccess(t, itemModel));
|
new WorkflowLockedComponentAccess(t, itemModel));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected DomainObjectPropertySheet getBodyPropertySheet(ItemSelectionModel assetModel) {
|
protected DomainObjectPropertySheet getBodyPropertySheet(ItemSelectionModel assetModel) {
|
||||||
TextAssetBodyPropertySheet sheet =
|
TextAssetBodyPropertySheet sheet
|
||||||
new TextAssetBodyPropertySheet(assetModel);
|
= new TextAssetBodyPropertySheet(assetModel);
|
||||||
sheet.getColumn(1).setCellRenderer(new TemplateLabelCellRenderer());
|
sheet.getColumn(1).setCellRenderer(new TemplateLabelCellRenderer());
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
|
|
@ -114,8 +113,8 @@ public class TemplateBody extends TextAssetBody {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set additional parameters of a brand new text asset, such as the
|
* Set additional parameters of a brand new text asset, such as the parent
|
||||||
* parent ID, after the asset has been successfully uploaded
|
* ID, after the asset has been successfully uploaded
|
||||||
*
|
*
|
||||||
* @param s the current page state
|
* @param s the current page state
|
||||||
* @param a the new <code>TextAsset</code>
|
* @param a the new <code>TextAsset</code>
|
||||||
|
|
@ -126,15 +125,15 @@ public class TemplateBody extends TextAssetBody {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the options for the mime type select widget
|
* Adds the options for the mime type select widget
|
||||||
**/
|
*
|
||||||
|
*/
|
||||||
protected void setMimeTypeOptions(SingleSelect mimeSelect) {
|
protected void setMimeTypeOptions(SingleSelect mimeSelect) {
|
||||||
Map mimeTypes = Template.SUPPORTED_MIME_TYPES;
|
Map mimeTypes = Template.SUPPORTED_MIME_TYPES;
|
||||||
Iterator keys = mimeTypes.keySet().iterator();
|
Iterator keys = mimeTypes.keySet().iterator();
|
||||||
while (keys.hasNext()) {
|
while (keys.hasNext()) {
|
||||||
String key = (String)keys.next();
|
String key = (String) keys.next();
|
||||||
mimeSelect.addOption
|
mimeSelect.addOption(new Option(key,
|
||||||
(new Option(key,
|
new Label((GlobalizedMessage) mimeTypes.get(key))));
|
||||||
new Label((GlobalizedMessage)mimeTypes.get(key))));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -144,7 +143,7 @@ public class TemplateBody extends TextAssetBody {
|
||||||
s_log.debug("Adding text widgets to " + c);
|
s_log.debug("Adding text widgets to " + c);
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnPanel panel = (ColumnPanel)c.getPanel();
|
ColumnPanel panel = (ColumnPanel) c.getPanel();
|
||||||
panel.setBorder(false);
|
panel.setBorder(false);
|
||||||
panel.setPadColor("#FFFFFF");
|
panel.setPadColor("#FFFFFF");
|
||||||
panel.setColumnWidth(1, "20%");
|
panel.setColumnWidth(1, "20%");
|
||||||
|
|
@ -161,7 +160,7 @@ public class TemplateBody extends TextAssetBody {
|
||||||
mime.setClassAttr("displayOneOptionAsLabel");
|
mime.setClassAttr("displayOneOptionAsLabel");
|
||||||
|
|
||||||
c.add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.edit_body_text")),
|
c.add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.edit_body_text")),
|
||||||
ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH);
|
ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH);
|
||||||
|
|
||||||
final TextArea text = new TextArea(PageTextForm.TEXT_ENTRY);
|
final TextArea text = new TextArea(PageTextForm.TEXT_ENTRY);
|
||||||
c.add(text, ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH);
|
c.add(text, ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH);
|
||||||
|
|
@ -187,15 +186,12 @@ public class TemplateBody extends TextAssetBody {
|
||||||
mimeWidget.clearOptions();
|
mimeWidget.clearOptions();
|
||||||
setMimeTypeOptions(mimeWidget);
|
setMimeTypeOptions(mimeWidget);
|
||||||
mimeWidget.setDefaultValue(FileUploadSection.GUESS_MIME);
|
mimeWidget.setDefaultValue(FileUploadSection.GUESS_MIME);
|
||||||
mimeWidget.addOption
|
mimeWidget.addOption(new Option(FileUploadSection.GUESS_MIME, new Label(GlobalizationUtil.globalize("cms.ui.authoring.file_upload.auto_detect"))));
|
||||||
(new Option(FileUploadSection.GUESS_MIME, new Label
|
|
||||||
(GlobalizationUtil.globalize
|
|
||||||
("cms.ui.authoring.file_upload.auto_detect"))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the form that is used to upload files. This method can
|
* This is the form that is used to upload files. This method can be used so
|
||||||
* be used so that a subclass can use their own subclass of PageFileForm.
|
* that a subclass can use their own subclass of PageFileForm.
|
||||||
*/
|
*/
|
||||||
protected PageFileForm getPageFileForm() {
|
protected PageFileForm getPageFileForm() {
|
||||||
return new TemplateFileForm();
|
return new TemplateFileForm();
|
||||||
|
|
@ -220,9 +216,7 @@ public class TemplateBody extends TextAssetBody {
|
||||||
|
|
||||||
String mimeType = mime.getMimeType();
|
String mimeType = mime.getMimeType();
|
||||||
if (!Template.SUPPORTED_MIME_TYPES.keySet().contains(mimeType)) {
|
if (!Template.SUPPORTED_MIME_TYPES.keySet().contains(mimeType)) {
|
||||||
throw new FormProcessException
|
throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.template_not_supportet"));
|
||||||
("The mime type " + mimeType + "is not one of the " +
|
|
||||||
"supported Template Mime Types");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Template.XSL_MIME_TYPE.equals(mimeType)) {
|
if (Template.XSL_MIME_TYPE.equals(mimeType)) {
|
||||||
|
|
@ -230,9 +224,8 @@ public class TemplateBody extends TextAssetBody {
|
||||||
try {
|
try {
|
||||||
new Document(content);
|
new Document(content);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw new FormProcessException
|
throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.uploaded_file_not_properly_formatted"
|
||||||
("The uploaded file is not properly formatted XML: " +
|
+ ex.getMessage()));
|
||||||
ex.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -241,23 +234,22 @@ public class TemplateBody extends TextAssetBody {
|
||||||
protected class TemplateLabelCellRenderer extends TextAssetBodyLabelCellRenderer {
|
protected class TemplateLabelCellRenderer extends TextAssetBodyLabelCellRenderer {
|
||||||
|
|
||||||
public Component getComponent(Table table, PageState state, Object value,
|
public Component getComponent(Table table, PageState state, Object value,
|
||||||
boolean isSelected, Object key,
|
boolean isSelected, Object key,
|
||||||
int row, int column) {
|
int row, int column) {
|
||||||
Label label = null;
|
Label label = null;
|
||||||
if (MIME_TYPE_KEY.equals(key) &&
|
if (MIME_TYPE_KEY.equals(key)
|
||||||
value instanceof TextAsset) {
|
&& value instanceof TextAsset) {
|
||||||
MimeType type = ((TextAsset)value).getMimeType();
|
MimeType type = ((TextAsset) value).getMimeType();
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
GlobalizedMessage mimeTypeMessage =
|
GlobalizedMessage mimeTypeMessage
|
||||||
(GlobalizedMessage)Template.SUPPORTED_MIME_TYPES.get
|
= (GlobalizedMessage) Template.SUPPORTED_MIME_TYPES.get(type.getMimeType());
|
||||||
(type.getMimeType());
|
|
||||||
if (mimeTypeMessage != null) {
|
if (mimeTypeMessage != null) {
|
||||||
return new Label(mimeTypeMessage, false);
|
return new Label(mimeTypeMessage, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.getComponent(table, state, value, isSelected,
|
return super.getComponent(table, state, value, isSelected,
|
||||||
key, row, column);
|
key, row, column);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -290,8 +290,7 @@ public abstract class ElementAddForm extends CMSForm {
|
||||||
|
|
||||||
if ( dot.hasProperty(label) ) {
|
if ( dot.hasProperty(label) ) {
|
||||||
throw new FormProcessException
|
throw new FormProcessException
|
||||||
("A property named \"" + label.toLowerCase() +
|
(GlobalizationUtil.globalize("cms.ui.property_already_exist" + label.toLowerCase()));
|
||||||
"\" already exists.");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
doValidate(event);
|
doValidate(event);
|
||||||
|
|
@ -326,7 +325,7 @@ public abstract class ElementAddForm extends CMSForm {
|
||||||
private final class SubmissionListener implements FormSubmissionListener {
|
private final class SubmissionListener implements FormSubmissionListener {
|
||||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||||
if (m_cancel.isSelected(e.getPageState())) {
|
if (m_cancel.isSelected(e.getPageState())) {
|
||||||
throw new FormProcessException("cancelled");
|
throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.cancelled"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ class TaskAddUser extends SimpleContainer {
|
||||||
|
|
||||||
if (users == null) {
|
if (users == null) {
|
||||||
throw new FormProcessException
|
throw new FormProcessException
|
||||||
(lz("cms.ui.workflow.no_users_were_selected"));
|
((GlobalizationUtil.globalize("cms.ui.workflow.no_users_were_selected"));
|
||||||
} else {
|
} else {
|
||||||
// Add each checked user to the task.
|
// Add each checked user to the task.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue