- SciPublications: PropertySheets in SciPublications enthalten jetzt alle Properties des jeweiligen Contenttyps

- BasicItemForm: Zwei neue Methoden eingeführt, die das Label für Titel und URL zurückgeben. Dies erlaubt es, die Bezeichnungen für diese Felder durch überschreiben der Felder an den Contenttyp 
  anzupassen. Die Benzeichnung 'Titel der Seite' ist doch ein wenig verwirrend, z.B. bei einer Abteilung.
- Zusätzlich Konfigurationseinstellung für das Forum: isPublic. Diese soll festlegen, ob ein Forum öffentlich sichtbar ist oder nicht.


git-svn-id: https://svn.libreccm.org/ccm/trunk@719 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2011-01-28 15:28:12 +00:00
parent 657e7e423f
commit 9458a60164
17 changed files with 321 additions and 230 deletions

View File

@ -69,12 +69,12 @@ public class GenericOrganizationalUnitPropertyForm
protected void addWidgets() { protected void addWidgets() {
super.addWidgets(); super.addWidgets();
add(new Label( /*add(new Label(
(String) ContenttypesGlobalizationUtil.globalize( (String) ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericorganunit.name").localize())); "cms.contenttypes.ui.genericorganunit.name").localize()));
ParameterModel nameParam = new StringParameter(NAME); ParameterModel nameParam = new StringParameter(NAME);
TextField name = new TextField(nameParam); TextField name = new TextField(nameParam);
add(name); add(name);*/
add(new Label( add(new Label(
(String) ContenttypesGlobalizationUtil.globalize( (String) ContenttypesGlobalizationUtil.globalize(
@ -101,7 +101,7 @@ public class GenericOrganizationalUnitPropertyForm
(GenericOrganizationalUnit) super. (GenericOrganizationalUnit) super.
initBasicWidgets(fse); initBasicWidgets(fse);
data.put(NAME, orgaunit.getName()); //data.put(NAME, orgaunit.getName());
data.put(ADDENDUM, orgaunit.getAddendum()); data.put(ADDENDUM, orgaunit.getAddendum());
} }
@ -116,7 +116,7 @@ public class GenericOrganizationalUnitPropertyForm
if ((orgaunit != null) if ((orgaunit != null)
&& getSaveCancelSection().getSaveButton().isSelected(fse. && getSaveCancelSection().getSaveButton().isSelected(fse.
getPageState())) { getPageState())) {
orgaunit.setName((String) data.get(NAME)); //orgaunit.setName((String) data.get(NAME));
orgaunit.setAddendum((String) data.get(ADDENDUM)); orgaunit.setAddendum((String) data.get(ADDENDUM));
orgaunit.save(); orgaunit.save();

View File

@ -58,12 +58,11 @@ import java.util.Collection;
public abstract class BasicItemForm extends FormSection public abstract class BasicItemForm extends FormSection
implements FormInitListener, FormProcessListener, implements FormInitListener, FormProcessListener,
FormValidationListener { FormValidationListener {
private static final Logger s_log = Logger.getLogger(BasicItemForm.class);
private static final Logger s_log = Logger.getLogger(BasicItemForm.class);
private final ItemSelectionModel m_itemModel; private final ItemSelectionModel m_itemModel;
private SaveCancelSection m_saveCancelSection; private SaveCancelSection m_saveCancelSection;
private FormSection m_widgetSection; private FormSection m_widgetSection;
public static final String NAME = ContentItem.NAME; public static final String NAME = ContentItem.NAME;
public static final String TITLE = ContentPage.TITLE; public static final String TITLE = ContentPage.TITLE;
public static final String LANGUAGE = ContentItem.LANGUAGE; public static final String LANGUAGE = ContentItem.LANGUAGE;
@ -113,7 +112,7 @@ public abstract class BasicItemForm extends FormSection
super(columnPanel); super(columnPanel);
//super(formName, columnPanel); //super(formName, columnPanel);
m_widgetSection = m_widgetSection =
new FormSection(new ColumnPanel(columnPanel.getNumCols(), true)); new FormSection(new ColumnPanel(columnPanel.getNumCols(), true));
super.add(m_widgetSection, ColumnPanel.INSERT); super.add(m_widgetSection, ColumnPanel.INSERT);
m_itemModel = itemModel; m_itemModel = itemModel;
} }
@ -125,10 +124,9 @@ public abstract class BasicItemForm extends FormSection
m_saveCancelSection = new SaveCancelSection(); m_saveCancelSection = new SaveCancelSection();
super.add(m_saveCancelSection, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); super.add(m_saveCancelSection, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT);
} }
private Label m_script = new Label(
private Label m_script = new Label("<script language=\"javascript\" src=\"/javascript/manipulate-input.js\"></script>", false); "<script language=\"javascript\" src=\"/javascript/manipulate-input.js\"></script>",
false);
/** /**
* Add various widgets to the form. Child classes should override * Add various widgets to the form. Child classes should override
@ -149,28 +147,33 @@ public abstract class BasicItemForm extends FormSection
// it breaks URLs & potentially overwrites the user's // it breaks URLs & potentially overwrites the user's
// customizations. // customizations.
add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.page_title"))); //jensp 2011-01-28: For some content types it is maybe useful to change
//the label of this field to something other than 'title'. This can now
//be done by overwriting the getTitleLabel() method.
//add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.page_title")));
add(new Label(getTitleLabel()));
TextField titleWidget = new TextField(new TrimmedStringParameter(TITLE)); TextField titleWidget = new TextField(new TrimmedStringParameter(TITLE));
titleWidget.addValidationListener(new NotNullValidationListener()); titleWidget.addValidationListener(new NotNullValidationListener());
titleWidget.setOnFocus("if (this.form." + NAME + ".value == '') { " + titleWidget.setOnFocus("if (this.form." + NAME + ".value == '') { "
" defaulting = true; this.form." + NAME + + " defaulting = true; this.form." + NAME
".value = urlize(this.value); }"); + ".value = urlize(this.value); }");
titleWidget.setOnKeyUp( titleWidget.setOnKeyUp(
"if (defaulting) { this.form." + NAME + "if (defaulting) { this.form." + NAME
".value = urlize(this.value) }" + ".value = urlize(this.value) }");
);
add(titleWidget); add(titleWidget);
add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.name_url"))); //jensp 2011-01-28: For some content types it is maybe useful to change
//the label of this field to something other than 'title'. This can now
//be done by overwriting the getNameLabel() method.
//add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.name_url")));
add(new Label(getNameLabel()));
TextField nameWidget = new TextField(new TrimmedStringParameter(NAME)); TextField nameWidget = new TextField(new TrimmedStringParameter(NAME));
nameWidget.addValidationListener(new NameValidationListener()); nameWidget.addValidationListener(new NameValidationListener());
nameWidget.setOnFocus("defaulting = false"); nameWidget.setOnFocus("defaulting = false");
nameWidget.setOnBlur( nameWidget.setOnBlur(
"if (this.value == '') " + "if (this.value == '') "
"{ defaulting = true; this.value = urlize(this.form." + TITLE + + "{ defaulting = true; this.value = urlize(this.form." + TITLE
".value) } " + + ".value) } " + " else { this.value = urlize(this.value); }");
" else { this.value = urlize(this.value); }"
);
add(nameWidget); add(nameWidget);
} }
@ -226,7 +229,7 @@ public abstract class BasicItemForm extends FormSection
* with the name the user provided on the input form. * with the name the user provided on the input form.
*/ */
public void validateNameUniqueness(Folder parent, FormSectionEvent event) public void validateNameUniqueness(Folder parent, FormSectionEvent event)
throws FormProcessException { throws FormProcessException {
FormData data = event.getFormData(); FormData data = event.getFormData();
String newName = (String) data.get(NAME); String newName = (String) data.get(NAME);
@ -234,15 +237,16 @@ public abstract class BasicItemForm extends FormSection
validateNameUniqueness(parent, event, newName); validateNameUniqueness(parent, event, newName);
} }
public void validateNameUniqueness(Folder parent, FormSectionEvent event, String newName) public void validateNameUniqueness(Folder parent, FormSectionEvent event,
throws FormProcessException { String newName)
if ( newName != null ) { throws FormProcessException {
if (newName != null) {
final String query = "com.arsdigita.cms.validateUniqueItemName"; final String query = "com.arsdigita.cms.validateUniqueItemName";
DataQuery dq = SessionManager.getSession().retrieveQuery(query); DataQuery dq = SessionManager.getSession().retrieveQuery(query);
dq.setParameter("parentId", parent.getID()); dq.setParameter("parentId", parent.getID());
dq.setParameter("name", newName.toUpperCase()); dq.setParameter("name", newName.toUpperCase());
if ( dq.size() > 0) { if (dq.size() > 0) {
// we need to add all of the items that are // we need to add all of the items that are
// different versions of this item to the list // different versions of this item to the list
// so that we do not throw an error if those // so that we do not throw an error if those
@ -251,28 +255,27 @@ public abstract class BasicItemForm extends FormSection
ContentItem item = null; ContentItem item = null;
if (getItemSelectionModel() != null) { if (getItemSelectionModel() != null) {
item = (ContentItem) getItemSelectionModel() item = (ContentItem) getItemSelectionModel().
.getSelectedObject(event.getPageState()); getSelectedObject(event.getPageState());
} }
if (item == null) { if (item == null) {
// this means it is a creation form // this means it is a creation form
throw new FormProcessException throw new FormProcessException(
("An item with this name already exists"); "An item with this name already exists");
} }
Collection list = getAllVersionIDs(item); Collection list = getAllVersionIDs(item);
while (dq.next()) { while (dq.next()) {
itemID = (BigDecimal)dq.get("itemID"); itemID = (BigDecimal) dq.get("itemID");
if (!list.contains(itemID)) { if (!list.contains(itemID)) {
dq.close(); dq.close();
throw new FormProcessException throw new FormProcessException(
("An item with this name already exists"); "An item with this name already exists");
} }
} }
} }
} }
} }
/** /**
* Ensure that the name of an item is unique within a category. This * Ensure that the name of an item is unique within a category. This
* should only be called from the validation listener of an "edit" form. * should only be called from the validation listener of an "edit" form.
@ -286,12 +289,12 @@ public abstract class BasicItemForm extends FormSection
*/ */
public void validateNameUniquenessWithinCategory(FormSectionEvent event, public void validateNameUniquenessWithinCategory(FormSectionEvent event,
BigDecimal id) BigDecimal id)
throws FormProcessException { throws FormProcessException {
if (id == null) { if (id == null) {
s_log.warn("Trying to validation the name uniqueness without " + s_log.warn("Trying to validation the name uniqueness without "
" a valid item is invalid. This method should only " + + " a valid item is invalid. This method should only "
" be called in \"edit\" forms. The passed in id " + + " be called in \"edit\" forms. The passed in id "
" was null."); + " was null.");
return; return;
} }
// now we check to make sure that the new name is valid // now we check to make sure that the new name is valid
@ -302,8 +305,9 @@ public abstract class BasicItemForm extends FormSection
if (url == null) { if (url == null) {
return; return;
} }
DataQuery query = SessionManager.getSession().retrieveQuery DataQuery query =
("com.arsdigita.categorization.getAllItemURLsForCategoryFromItem"); SessionManager.getSession().retrieveQuery(
"com.arsdigita.categorization.getAllItemURLsForCategoryFromItem");
query.setParameter("itemID", id); query.setParameter("itemID", id);
query.addEqualsFilter("lower(url)", url.toLowerCase()); query.addEqualsFilter("lower(url)", url.toLowerCase());
if (query.size() > 0) { if (query.size() > 0) {
@ -312,18 +316,18 @@ public abstract class BasicItemForm extends FormSection
BigDecimal itemID = null; BigDecimal itemID = null;
ContentItem item = ContentItem item =
(ContentItem) getItemSelectionModel() (ContentItem) getItemSelectionModel().getSelectedObject(event.
.getSelectedObject(event.getPageState()); getPageState());
Collection list = getAllVersionIDs(item); Collection list = getAllVersionIDs(item);
try { try {
while (query.next()) { while (query.next()) {
itemID = (BigDecimal)query.get("itemID"); itemID = (BigDecimal) query.get("itemID");
if (!list.contains(itemID)) { if (!list.contains(itemID)) {
StringBuffer buffer = StringBuffer buffer =
new StringBuffer("There are conflicts with this URL. " + new StringBuffer("There are conflicts with this URL. "
"Specifically, there is at least one item " + + "Specifically, there is at least one item "
"in the same category as this item with " + + "in the same category as this item with "
"the name (url) of "); + "the name (url) of ");
buffer.append(url); buffer.append(url);
throw new FormProcessException(buffer.toString()); throw new FormProcessException(buffer.toString());
} }
@ -374,4 +378,32 @@ public abstract class BasicItemForm extends FormSection
public void add(Component pc, int constraints) { public void add(Component pc, int constraints) {
m_widgetSection.add(pc, constraints); m_widgetSection.add(pc, constraints);
} }
/**
* jensp, 2011-01-28
* This method can be overridden to change the label of the title field.
* To change to label of the title field can be useful for some
* content types. For example, for an organization the label "Title" for
* the field is may confusing for the normal user. For such a content type,
* the label would be changed to something like "Name of the organization".
*
* @return (Content for the) Label for the title field as string
*/
protected String getTitleLabel() {
return (String) GlobalizationUtil.globalize(
"cms.ui.authoring.page_title").
localize();
}
/**
* jensp, 2011-01-28
* This method does the same as {@link #getTitleLabel() } for the label of
* the name (URL) field.
*
* @return (Content for the) Label for the name field as string
*/
protected String getNameLabel() {
return (String) GlobalizationUtil.globalize("cms.ui.authoring.name_url").
localize();
}
} }

View File

@ -32,6 +32,7 @@ object type Forum extends Application {
Boolean [1..1] isModerated = forum_forums.is_moderated; Boolean [1..1] isModerated = forum_forums.is_moderated;
Boolean [1..1] isNoticeboard = forum_forums.is_noticeboard; Boolean [1..1] isNoticeboard = forum_forums.is_noticeboard;
Boolean [1..1] isPublic = forum_forums.is_public;
component Group [0..1] adminGroup = component Group [0..1] adminGroup =
join forum_forums.admin_group_id to groups.group_id; join forum_forums.admin_group_id to groups.group_id;

View File

@ -116,6 +116,7 @@ public class Forum extends Application {
private static final String POSTS = "posts"; private static final String POSTS = "posts";
private static final String SUBSCRIPTIONS = "subscriptions"; private static final String SUBSCRIPTIONS = "subscriptions";
private static final String MODERATION = "isModerated"; private static final String MODERATION = "isModerated";
private static final String PUBLIC = "isPublic";
private static final String NOTICEBOARD = "isNoticeboard"; private static final String NOTICEBOARD = "isNoticeboard";
private static final String ADMIN_GROUP = "adminGroup"; private static final String ADMIN_GROUP = "adminGroup";
@ -205,6 +206,7 @@ public class Forum extends Application {
title, parent, true); title, parent, true);
forum.setModerated(moderated); forum.setModerated(moderated);
forum.setPublic(true);
// default settings ensure legacy forum users do not // default settings ensure legacy forum users do not
// see any change chris.gilbert@westsussex.gov.uk // see any change chris.gilbert@westsussex.gov.uk
forum.setAllowFileAttachments(false); forum.setAllowFileAttachments(false);
@ -768,6 +770,16 @@ public class Forum extends Application {
return isModerated.booleanValue(); return isModerated.booleanValue();
} }
public boolean isPublic() {
Boolean isPublic = (Boolean)get(PUBLIC);
Assert.exists(isPublic);
return isPublic.booleanValue();
}
public void setPublic(boolean isPublic) {
set(PUBLIC, new Boolean(isPublic));
}
/** /**
* Enables/disables the noticeboard functionality. * Enables/disables the noticeboard functionality.
* If enabled, no replies will be allowed. * If enabled, no replies will be allowed.

View File

@ -55,158 +55,167 @@ import org.apache.log4j.Logger;
* that apply to this forum instance * that apply to this forum instance
*/ */
public class SetupView public class SetupView
extends Form extends Form
implements FormInitListener, FormSubmissionListener, FormProcessListener, Constants { implements FormInitListener, FormSubmissionListener, FormProcessListener,
private static final Logger s_log = Logger.getLogger(SetupView.class); Constants {
// values for checkboxes private static final Logger s_log = Logger.getLogger(SetupView.class);
private static final String MODERATED = "moderated"; // values for checkboxes
private static final String NOTICEBOARD = "noticeboard"; private static final String MODERATED = "moderated";
private static final String ALLOW_FILES = "filesAllowed"; private static final String PUBLIC = "public";
private static final String ALLOW_IMAGES = "imagesallowed"; private static final String NOTICEBOARD = "noticeboard";
private static final String AUTOSUBSCRIBE_THREAD_STARTERS = "autosubscribe"; private static final String ALLOW_FILES = "filesAllowed";
private static final String NO_CATEGORY_POSTS_ALLOWED = "nocategory"; private static final String ALLOW_IMAGES = "imagesallowed";
private static final String ANONYMOUS_POSTS_ALLOWED = "anonymous"; private static final String AUTOSUBSCRIBE_THREAD_STARTERS = "autosubscribe";
private static final String NO_CATEGORY_POSTS_ALLOWED = "nocategory";
private static final String ANONYMOUS_POSTS_ALLOWED = "anonymous";
private CheckboxGroup m_settings;
private TextField m_expiry;
private SaveCancelSection m_saveCancel;
private TextArea m_introduction;
private TextField m_title;
private CheckboxGroup m_settings; public SetupView() {
private TextField m_expiry; super("setupForm", new SimpleContainer("forum:setup", FORUM_XML_NS));
private SaveCancelSection m_saveCancel; m_settings = new CheckboxGroup("settings");
private TextArea m_introduction; m_settings.addOption(
private TextField m_title; new Option(
MODERATED,
(String) Text.gz("forum.ui.settings.moderated").localize()));
m_settings.addOption(
new Option(PUBLIC,
(String) Text.gz("forum.ui.settings.public").localize()));
m_settings.addOption(
new Option(
NOTICEBOARD,
(String) Text.gz("forum.ui.settings.noticeboard").
localize()));
m_settings.addOption(
new Option(
ALLOW_FILES,
(String) Text.gz("forum.ui.settings.allowFiles").localize()));
m_settings.addOption(
new Option(
ALLOW_IMAGES,
(String) Text.gz("forum.ui.settings.allowImages").localize()));
m_settings.addOption(
new Option(
AUTOSUBSCRIBE_THREAD_STARTERS,
(String) Text.gz("forum.ui.settings.autosubscribe").localize()));
public SetupView() { m_settings.addOption(
super("setupForm", new SimpleContainer("forum:setup", FORUM_XML_NS)); new Option(
m_settings = new CheckboxGroup("settings"); NO_CATEGORY_POSTS_ALLOWED,
m_settings.addOption( (String) Text.gz("forum.ui.settings.noCategoryPosts").localize()));
new Option( m_settings.addOption(
MODERATED, new Option(
(String) Text.gz("forum.ui.settings.moderated").localize())); ANONYMOUS_POSTS_ALLOWED,
m_settings.addOption( (String) Text.gz("forum.ui.settings.anonymousPosts").localize()));
new Option(
NOTICEBOARD,
(String) Text.gz("forum.ui.settings.noticeboard").localize()));
m_settings.addOption(
new Option(
ALLOW_FILES,
(String) Text.gz("forum.ui.settings.allowFiles").localize()));
m_settings.addOption(
new Option(
ALLOW_IMAGES,
(String) Text.gz("forum.ui.settings.allowImages").localize()));
m_settings.addOption(
new Option(
AUTOSUBSCRIBE_THREAD_STARTERS,
(String) Text
.gz("forum.ui.settings.autosubscribe")
.localize()));
m_settings.addOption(
new Option(
NO_CATEGORY_POSTS_ALLOWED,
(String) Text
.gz("forum.ui.settings.noCategoryPosts")
.localize()));
m_settings.addOption(
new Option(
ANONYMOUS_POSTS_ALLOWED,
(String) Text
.gz("forum.ui.settings.anonymousPosts")
.localize()));
m_expiry = new TextField(new IntegerParameter("expiry")); m_expiry = new TextField(new IntegerParameter("expiry"));
m_expiry.setMetaDataAttribute("label", (String)Text.gz("forum.ui.noticeboard.expiry_after").localize()); m_expiry.setMetaDataAttribute("label", (String) Text.gz(
m_saveCancel = new SaveCancelSection(); "forum.ui.noticeboard.expiry_after").localize());
m_saveCancel.getSaveButton().setButtonLabel(Text.gz("forum.ui.settings.save")); m_saveCancel = new SaveCancelSection();
m_introduction = new TextArea("introduction", 8, 60, TextArea.SOFT); m_saveCancel.getSaveButton().setButtonLabel(Text.gz(
m_introduction.addValidationListener(new StringInRangeValidationListener(0, 4000, Text.gz("forum.ui.validation.introduction_too_long"))); "forum.ui.settings.save"));
m_introduction.setMetaDataAttribute("label", (String)Text.gz("forum.ui.settings.introduction").localize()); m_introduction = new TextArea("introduction", 8, 60, TextArea.SOFT);
m_introduction.addValidationListener(new StringInRangeValidationListener(
0, 4000, Text.gz("forum.ui.validation.introduction_too_long")));
m_introduction.setMetaDataAttribute("label", (String) Text.gz(
"forum.ui.settings.introduction").localize());
m_title = new TextField("title"); m_title = new TextField("title");
m_title.setMetaDataAttribute("label", (String)Text.gz("forum.ui.settings.title").localize()); m_title.setMetaDataAttribute("label", (String) Text.gz(
m_title.setSize(70); "forum.ui.settings.title").localize());
m_title.setSize(70);
add(m_title); add(m_title);
add(m_introduction); add(m_introduction);
add(m_settings); add(m_settings);
add(m_expiry); add(m_expiry);
add(m_saveCancel); add(m_saveCancel);
addInitListener(this); addInitListener(this);
addSubmissionListener(this); addSubmissionListener(this);
addProcessListener(this); addProcessListener(this);
} }
public void init(FormSectionEvent e) throws FormProcessException { public void init(FormSectionEvent e) throws FormProcessException {
PageState state = e.getPageState(); PageState state = e.getPageState();
Forum forum = ForumContext.getContext(state).getForum(); Forum forum = ForumContext.getContext(state).getForum();
Set settingsSet = new HashSet(); Set settingsSet = new HashSet();
if (forum.isModerated()) { if (forum.isModerated()) {
settingsSet.add(MODERATED); settingsSet.add(MODERATED);
} }
if (forum.isNoticeboard()) { if (forum.isNoticeboard()) {
settingsSet.add(NOTICEBOARD); settingsSet.add(NOTICEBOARD);
} }
if (forum.allowFileAttachments()) { if (forum.allowFileAttachments()) {
settingsSet.add(ALLOW_FILES); settingsSet.add(ALLOW_FILES);
} }
if (forum.allowImageUploads()) { if (forum.allowImageUploads()) {
settingsSet.add(ALLOW_IMAGES); settingsSet.add(ALLOW_IMAGES);
} }
if (forum.autoSubscribeThreadStarter()) { if (forum.autoSubscribeThreadStarter()) {
settingsSet.add(AUTOSUBSCRIBE_THREAD_STARTERS); settingsSet.add(AUTOSUBSCRIBE_THREAD_STARTERS);
} }
if (forum.noCategoryPostsAllowed()) { if (forum.noCategoryPostsAllowed()) {
settingsSet.add(NO_CATEGORY_POSTS_ALLOWED); settingsSet.add(NO_CATEGORY_POSTS_ALLOWED);
} }
if (forum.anonymousPostsAllowed()) { if (forum.anonymousPostsAllowed()) {
settingsSet.add(ANONYMOUS_POSTS_ALLOWED); settingsSet.add(ANONYMOUS_POSTS_ALLOWED);
} }
m_settings.setValue(state, settingsSet.toArray()); m_settings.setValue(state, settingsSet.toArray());
m_expiry.setValue(state, new Integer(forum.getExpireAfter())); m_expiry.setValue(state, new Integer(forum.getExpireAfter()));
m_introduction.setValue(state, forum.getIntroduction()); m_introduction.setValue(state, forum.getIntroduction());
m_title.setValue(state, forum.getTitle()); m_title.setValue(state, forum.getTitle());
} }
public void submitted(FormSectionEvent e) throws FormProcessException { public void submitted(FormSectionEvent e) throws FormProcessException {
PageState state = e.getPageState(); PageState state = e.getPageState();
if (m_saveCancel.getCancelButton().isSelected(state)) { if (m_saveCancel.getCancelButton().isSelected(state)) {
s_log.debug("cancelled"); s_log.debug("cancelled");
throw new FormProcessException("cancelled"); throw new FormProcessException("cancelled");
} }
} }
public void process(FormSectionEvent e) throws FormProcessException { public void process(FormSectionEvent e) throws FormProcessException {
PageState state = e.getPageState(); PageState state = e.getPageState();
Forum forum = ForumContext.getContext(state).getForum(); Forum forum = ForumContext.getContext(state).getForum();
String[] settingsArray = (String[]) m_settings.getValue(state); String[] settingsArray = (String[]) m_settings.getValue(state);
List settings = Collections.EMPTY_LIST; List settings = Collections.EMPTY_LIST;
if (settingsArray != null) { if (settingsArray != null) {
settings = Arrays.asList(settingsArray); settings = Arrays.asList(settingsArray);
} }
forum.setModerated(settings.contains(MODERATED)); forum.setModerated(settings.contains(MODERATED));
forum.setNoticeboard(settings.contains(NOTICEBOARD)); forum.setPublic(settings.contains(PUBLIC));
// could remove any existing files but i don't think that would be desirable forum.setNoticeboard(settings.contains(NOTICEBOARD));
forum.setAllowFileAttachments(settings.contains(ALLOW_FILES)); // could remove any existing files but i don't think that would be desirable
forum.setAllowImageUploads(settings.contains(ALLOW_IMAGES)); forum.setAllowFileAttachments(settings.contains(ALLOW_FILES));
forum.setAutoSubscribeThreadCreator(settings.contains(AUTOSUBSCRIBE_THREAD_STARTERS)); forum.setAllowImageUploads(settings.contains(ALLOW_IMAGES));
forum.setNoCategoryPostsAllowed(settings.contains(NO_CATEGORY_POSTS_ALLOWED)); forum.setAutoSubscribeThreadCreator(settings.contains(
forum.setAnonymousPostsAllowed(settings.contains(ANONYMOUS_POSTS_ALLOWED)); AUTOSUBSCRIBE_THREAD_STARTERS));
forum.setNoCategoryPostsAllowed(settings.contains(
NO_CATEGORY_POSTS_ALLOWED));
forum.setAnonymousPostsAllowed(
settings.contains(ANONYMOUS_POSTS_ALLOWED));
forum.setTitle((String)m_title.getValue(state)); forum.setTitle((String) m_title.getValue(state));
forum.setIntroduction((String)m_introduction.getValue(state)); forum.setIntroduction((String) m_introduction.getValue(state));
Integer expiry = (m_expiry.getValue(state) == null) ? new Integer(0) : (Integer) m_expiry.getValue(state); Integer expiry = (m_expiry.getValue(state) == null) ? new Integer(0) : (Integer) m_expiry.
int newExpiry = expiry.intValue(); getValue(state);
if (forum.getExpireAfter() != newExpiry) { int newExpiry = expiry.intValue();
forum.setExpireAfter(newExpiry); if (forum.getExpireAfter() != newExpiry) {
} forum.setExpireAfter(newExpiry);
}
} }
} }

View File

@ -44,7 +44,7 @@ public class CollectedVolumePropertiesStep
public static Component getCollectedVolumePropertySheet( public static Component getCollectedVolumePropertySheet(
ItemSelectionModel itemModel) { ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) PublicationWithPublisherPropertiesStep. DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) PublicationWithPublisherPropertiesStep.
getPublicationPropertySheet(itemModel); getPublicationWithPublisherPropertySheet(itemModel);
return sheet; return sheet;
} }

View File

@ -96,7 +96,7 @@ public class InternetArticlePropertiesStep extends PublicationPropertiesStep {
getCancelButton()); getCancelButton());
basicProperties.setDisplayComponent( basicProperties.setDisplayComponent(
getPublicationPropertySheet(itemModel)); getInternetArticlePropertySheet(itemModel));
getSegmentedPanel().addSegment( getSegmentedPanel().addSegment(
new Label((String) PublicationGlobalizationUtil.globalize( new Label((String) PublicationGlobalizationUtil.globalize(

View File

@ -22,6 +22,7 @@ package com.arsdigita.cms.contenttypes.ui;
import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Component;
import com.arsdigita.bebop.Label; import com.arsdigita.bebop.Label;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.Journal;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.authoring.SimpleEditStep;
@ -45,6 +46,10 @@ public class JournalPropertiesStep extends PublicationPropertiesStep {
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) PublicationPropertiesStep. DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) PublicationPropertiesStep.
getPublicationPropertySheet(itemModel); getPublicationPropertySheet(itemModel);
sheet.add(PublicationGlobalizationUtil.globalize(
"publications.ui.journal.issn"),
Journal.ISSN);
return sheet; return sheet;
} }

View File

@ -90,7 +90,7 @@ public class ProceedingsPropertiesStep
getCancelButton()); getCancelButton());
basicProperties.setDisplayComponent( basicProperties.setDisplayComponent(
getPublicationPropertySheet(itemModel)); getProceedingsPropertySheet(itemModel));
getSegmentedPanel().addSegment( getSegmentedPanel().addSegment(
new Label((String) PublicationGlobalizationUtil.globalize( new Label((String) PublicationGlobalizationUtil.globalize(

View File

@ -112,6 +112,7 @@ public class ProceedingsPropertyForm
@Override @Override
public void init(FormSectionEvent fse) throws FormProcessException { public void init(FormSectionEvent fse) throws FormProcessException {
super.init(fse); super.init(fse);
FormData data = fse.getFormData(); FormData data = fse.getFormData();

View File

@ -66,11 +66,11 @@ public class PublicationPropertyForm
protected void addWidgets() { protected void addWidgets() {
super.addWidgets(); super.addWidgets();
add(new Label((String) PublicationGlobalizationUtil.globalize( /*add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.publication.title").localize())); "publications.ui.publication.title").localize()));
ParameterModel titleParam = new StringParameter(Publication.TITLE); ParameterModel titleParam = new StringParameter(Publication.TITLE);
TextField title = new TextField(titleParam); TextField title = new TextField(titleParam);
add(title); add(title);*/
add(new Label((String) PublicationGlobalizationUtil.globalize( add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.publication.year_of_publication").localize())); "publications.ui.publication.year_of_publication").localize()));
@ -102,7 +102,7 @@ public class PublicationPropertyForm
FormData data = fse.getFormData(); FormData data = fse.getFormData();
Publication publication = (Publication) super.initBasicWidgets(fse); Publication publication = (Publication) super.initBasicWidgets(fse);
data.put(Publication.TITLE, publication.getTitle()); //data.put(Publication.TITLE, publication.getTitle());
data.put(Publication.YEAR_OF_PUBLICATION, publication. data.put(Publication.YEAR_OF_PUBLICATION, publication.
getYearOfPublication()); getYearOfPublication());
data.put(Publication.ABSTRACT, publication.getAbstract()); data.put(Publication.ABSTRACT, publication.getAbstract());
@ -116,13 +116,15 @@ public class PublicationPropertyForm
if ((publication != null) && getSaveCancelSection().getSaveButton(). if ((publication != null) && getSaveCancelSection().getSaveButton().
isSelected(fse.getPageState())) { isSelected(fse.getPageState())) {
publication.setTitle((String) data.get(Publication.TITLE)); //publication.setTitle((String) data.get(Publication.TITLE));
publication.setYearOfPublication((Integer) data.get( publication.setYearOfPublication((Integer) data.get(
Publication.YEAR_OF_PUBLICATION)); Publication.YEAR_OF_PUBLICATION));
publication.setAbstract((String) data.get(Publication.ABSTRACT)); publication.setAbstract((String) data.get(Publication.ABSTRACT));
publication.setMisc((String) data.get(Publication.MISC)); publication.setMisc((String) data.get(Publication.MISC));
publication.save(); publication.save();
init(fse);
} }
} }
@ -133,4 +135,10 @@ public class PublicationPropertyForm
m_step.cancelStreamlinedCreation(fse.getPageState()); m_step.cancelStreamlinedCreation(fse.getPageState());
} }
} }
@Override
protected String getTitleLabel() {
return (String) PublicationGlobalizationUtil.globalize(
"publications.ui.publication.title").localize();
}
} }

View File

@ -92,7 +92,7 @@ publications.ui.inproceedings.number_of_pages=Number of pages
publications.ui.inproceedings.number_of_volumes=Number of volumes publications.ui.inproceedings.number_of_volumes=Number of volumes
publications.ui.inproceedings.organizer_of_conference=Organizer of conference publications.ui.inproceedings.organizer_of_conference=Organizer of conference
publications.ui.inproceedings.pages_from=First page publications.ui.inproceedings.pages_from=First page
publications.ui.inproceedings.pages_from=Last page publications.ui.inproceedings.pages_from=Pages to
publications.ui.inproceedings.place_of_conference=Place of conference publications.ui.inproceedings.place_of_conference=Place of conference
publications.ui.inproceedings.volume=Volume publications.ui.inproceedings.volume=Volume
@ -207,7 +207,7 @@ publications.ui.series.volumes.remove=Remove volume
publications.ui.series.volumes.remove.confirm=Really remove this volume? publications.ui.series.volumes.remove.confirm=Really remove this volume?
publications.ui.series.volumes.volume_of_series=Volume of series publications.ui.series.volumes.volume_of_series=Volume of series
sciauthor.ui.edit_basic_properties=Basic properties sciauthor.ui.edit_basic_properties=Basic properties
publications.ui.inproceedings.pages_to=Pages to publications.ui.inproceedings.pages_to=Pages from
publications.ui.internetarticle.issn=ISSN publications.ui.internetarticle.issn=ISSN
publications.ui.internetarticle.publication_date=Date of publication publications.ui.internetarticle.publication_date=Date of publication
publications.ui.proceedings.add_paper=Add paper publications.ui.proceedings.add_paper=Add paper
@ -270,3 +270,4 @@ publications.ui.inProceedings.selectProceedings=Selected proceedings
publications.ui.inProceedings.proceedings.none=Not associated with a procedings publication yet publications.ui.inProceedings.proceedings.none=Not associated with a procedings publication yet
publications.ui.inProceedings.proceedings.remove=Remove this association publications.ui.inProceedings.proceedings.remove=Remove this association
publications.ui.inProceedings.proceedings.confirm_remove=Do really want to remove this association publications.ui.inProceedings.proceedings.confirm_remove=Do really want to remove this association
publications.ui.series.name=Name (URL)

View File

@ -91,7 +91,7 @@ publications.ui.inproceedings.number_of_pages=Anzahl der Seiten
publications.ui.inproceedings.number_of_volumes=Anzahl der B\u00e4nde publications.ui.inproceedings.number_of_volumes=Anzahl der B\u00e4nde
publications.ui.inproceedings.organizer_of_conference=Veranstalter der Konferenz publications.ui.inproceedings.organizer_of_conference=Veranstalter der Konferenz
publications.ui.inproceedings.pages_from=Erste Seite publications.ui.inproceedings.pages_from=Erste Seite
publications.ui.inproceedings.pages_from=Letzte Seite publications.ui.inproceedings.pages_from=Seiten bis
publications.ui.inproceedings.place_of_conference=Veranstaltungsort publications.ui.inproceedings.place_of_conference=Veranstaltungsort
publications.ui.inproceedings.volume=Band publications.ui.inproceedings.volume=Band
@ -178,7 +178,7 @@ publications.ui.authors.selectAuthor=Autor ausw\u00e4hlen
#========= #=========
publications.ui.publisher.basic_properties=Basiseigenschaften publications.ui.publisher.basic_properties=Basiseigenschaften
publications.ui.publisher.edit_basic_properties=Basiseigenschaften bearbeiten publications.ui.publisher.edit_basic_properties=Basiseigenschaften bearbeiten
publications.ui.publisher.place=Erscheinungsort publications.ui.publisher.place=Sitz des Verlages
#Series #Series
#====== #======
@ -206,7 +206,7 @@ publications.ui.series.volumes.remove=Band entfernen.
publications.ui.series.volumes.remove.confirm=Diesen Band wirklich entfernen publications.ui.series.volumes.remove.confirm=Diesen Band wirklich entfernen
publications.ui.series.volumes.volume_of_series=Band der Serie publications.ui.series.volumes.volume_of_series=Band der Serie
sciauthor.ui.edit_basic_properties=Basiseigenschaften sciauthor.ui.edit_basic_properties=Basiseigenschaften
publications.ui.inproceedings.pages_to=Seiten bis publications.ui.inproceedings.pages_to=Seiten von
publications.ui.internetarticle.issn=ISSN publications.ui.internetarticle.issn=ISSN
publications.ui.internetarticle.publication_date=Publikationsdatum publications.ui.internetarticle.publication_date=Publikationsdatum
publications.ui.proceedings.add_paper=Beitrag hinzuf\u00fcgen publications.ui.proceedings.add_paper=Beitrag hinzuf\u00fcgen
@ -269,3 +269,4 @@ publications.ui.inProceedings.selectProceedings=Tagungsband ausw\u00e4hlen
publications.ui.inProceedings.proceedings.none=Derzeit mit keinem Tagungsband verkn\u00fcpft publications.ui.inProceedings.proceedings.none=Derzeit mit keinem Tagungsband verkn\u00fcpft
publications.ui.inProceedings.proceedings.remove=Verkn\u00fcpfung entfernen publications.ui.inProceedings.proceedings.remove=Verkn\u00fcpfung entfernen
publications.ui.inProceedings.proceedings.confirm_remove=Wollen Sie diese Verkn\u00fcpfung wirklich entfernen publications.ui.inProceedings.proceedings.confirm_remove=Wollen Sie diese Verkn\u00fcpfung wirklich entfernen
publications.ui.series.name=Name (URL)

View File

@ -19,12 +19,15 @@
*/ */
package com.arsdigita.cms.contenttypes.ui; package com.arsdigita.cms.contenttypes.ui;
import com.arsdigita.bebop.Component;
import com.arsdigita.bebop.Label; import com.arsdigita.bebop.Label;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.Publisher;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
/** /**
* *
@ -38,6 +41,18 @@ public class PublisherPropertiesStep
super(itemModel, parent); super(itemModel, parent);
} }
public static Component getPublisherPropertySheet(
ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) getGenericOrganizationalUnitPropertySheet(
itemModel);
sheet.add(PublicationGlobalizationUtil.globalize(
"publications.ui.publisher.place"),
Publisher.PLACE);
return sheet;
}
@Override @Override
protected void addBasicProperties(ItemSelectionModel itemModel, protected void addBasicProperties(ItemSelectionModel itemModel,
AuthoringKitWizard parent) { AuthoringKitWizard parent) {
@ -55,7 +70,7 @@ public class PublisherPropertiesStep
getCancelButton()); getCancelButton());
basicProperties.setDisplayComponent( basicProperties.setDisplayComponent(
getGenericOrganizationalUnitPropertySheet(itemModel)); getPublisherPropertySheet(itemModel));
getSegmentedPanel().addSegment( getSegmentedPanel().addSegment(
new Label((String) PublicationGlobalizationUtil.globalize( new Label((String) PublicationGlobalizationUtil.globalize(

View File

@ -41,8 +41,8 @@ public class ReviewPropertiesStep extends ArticleInJournalPropertiesStep {
public static Component getReviewPropertySheet( public static Component getReviewPropertySheet(
ItemSelectionModel itemModel) { ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) PublicationPropertiesStep. DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) ArticleInJournalPropertiesStep.
getPublicationPropertySheet(itemModel); getArticleInJournalPropertySheet(itemModel);
return sheet; return sheet;
} }

View File

@ -31,7 +31,7 @@ import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.authoring.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.domain.DomainObject; import com.arsdigita.domain.DomainObject;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
import java.text.DateFormat; import java.text.DateFormat;
@ -64,8 +64,12 @@ public class SeriesPropertiesStep extends SimpleEditStep {
itemModel); itemModel);
sheet.add(PublicationGlobalizationUtil.globalize( sheet.add(PublicationGlobalizationUtil.globalize(
"publications.ui.series.title"), "publications.ui.series.name"),
Series.NAME); Series.NAME);
sheet.add(PublicationGlobalizationUtil.globalize(
"publications.ui.series.title"),
Series.TITLE);
if (!ContentSection.getConfig().getHideLaunchDate()) { if (!ContentSection.getConfig().getHideLaunchDate()) {
sheet.add(ContenttypesGlobalizationUtil.globalize( sheet.add(ContenttypesGlobalizationUtil.globalize(
@ -104,7 +108,7 @@ public class SeriesPropertiesStep extends SimpleEditStep {
(String) PublicationGlobalizationUtil.globalize( (String) PublicationGlobalizationUtil.globalize(
"publications.ui.series.edit_basic_sheet").localize(), "publications.ui.series.edit_basic_sheet").localize(),
new WorkflowLockedComponentAccess(editBasicSheet, new WorkflowLockedComponentAccess(editBasicSheet,
itemModel), itemModel),
editBasicSheet.getSaveCancelSection().getCancelButton()); editBasicSheet.getSaveCancelSection().getCancelButton());
basicProperties.setDisplayComponent(getSeriesPropertySheet(itemModel)); basicProperties.setDisplayComponent(getSeriesPropertySheet(itemModel));
@ -112,10 +116,10 @@ public class SeriesPropertiesStep extends SimpleEditStep {
segmentedPanel.addSegment(new Label((String) PublicationGlobalizationUtil. segmentedPanel.addSegment(new Label((String) PublicationGlobalizationUtil.
globalize("publications.ui.series.basic_properties").localize()), globalize("publications.ui.series.basic_properties").localize()),
basicProperties); basicProperties);
} }
protected void addSteps(ItemSelectionModel itemModel, protected void addSteps(ItemSelectionModel itemModel,
AuthoringKitWizard parent) { AuthoringKitWizard parent) {
addStep(new SeriesEditshipStep(itemModel, parent), addStep(new SeriesEditshipStep(itemModel, parent),
"publications.ui.series.editors"); "publications.ui.series.editors");
addStep(new SeriesVolumesStep(itemModel, parent), addStep(new SeriesVolumesStep(itemModel, parent),

View File

@ -21,14 +21,10 @@ package com.arsdigita.cms.contenttypes.ui;
import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormData;
import com.arsdigita.bebop.FormProcessException; import com.arsdigita.bebop.FormProcessException;
import com.arsdigita.bebop.Label;
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.FormSectionEvent; import com.arsdigita.bebop.event.FormSectionEvent;
import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.bebop.event.FormSubmissionListener;
import com.arsdigita.bebop.form.TextField;
import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.Series; import com.arsdigita.cms.contenttypes.Series;
import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.BasicPageForm;
@ -64,11 +60,11 @@ public class SeriesPropertyForm
protected void addWidgets() { protected void addWidgets() {
super.addWidgets(); super.addWidgets();
add(new Label((String) PublicationGlobalizationUtil.globalize( /*add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.series.title").localize())); "publications.ui.series.title").localize()));
ParameterModel titleParam = new StringParameter(Series.NAME); ParameterModel titleParam = new StringParameter(Series.NAME);
TextField title = new TextField(titleParam); TextField title = new TextField(titleParam);
add(title); add(title);*/
} }
@Override @Override
@ -76,7 +72,7 @@ public class SeriesPropertyForm
FormData data = fse.getFormData(); FormData data = fse.getFormData();
Series series = (Series) super.initBasicWidgets(fse); Series series = (Series) super.initBasicWidgets(fse);
data.put(Series.NAME, series.getTitle()); //data.put(Series.NAME, series.getTitle());
} }
@Override @Override
@ -86,9 +82,9 @@ public class SeriesPropertyForm
if ((series != null) && getSaveCancelSection().getSaveButton(). if ((series != null) && getSaveCancelSection().getSaveButton().
isSelected(fse.getPageState())) { isSelected(fse.getPageState())) {
series.setTitle((String) data.get(Series.NAME)); /*series.setTitle((String) data.get(Series.NAME));
series.save(); series.save();*/
} }
} }
@ -99,4 +95,10 @@ public class SeriesPropertyForm
m_step.cancelStreamlinedCreation(fse.getPageState()); m_step.cancelStreamlinedCreation(fse.getPageState());
} }
} }
@Override
protected String getTitleLabel() {
return (String) PublicationGlobalizationUtil.globalize(
"publications.ui.series.title").localize();
}
} }