diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertyForm.java index 3a1e0b9ba..024c1559d 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertyForm.java @@ -69,12 +69,12 @@ public class GenericOrganizationalUnitPropertyForm protected void addWidgets() { super.addWidgets(); - add(new Label( + /*add(new Label( (String) ContenttypesGlobalizationUtil.globalize( "cms.contenttypes.ui.genericorganunit.name").localize())); ParameterModel nameParam = new StringParameter(NAME); TextField name = new TextField(nameParam); - add(name); + add(name);*/ add(new Label( (String) ContenttypesGlobalizationUtil.globalize( @@ -101,7 +101,7 @@ public class GenericOrganizationalUnitPropertyForm (GenericOrganizationalUnit) super. initBasicWidgets(fse); - data.put(NAME, orgaunit.getName()); + //data.put(NAME, orgaunit.getName()); data.put(ADDENDUM, orgaunit.getAddendum()); } @@ -116,7 +116,7 @@ public class GenericOrganizationalUnitPropertyForm if ((orgaunit != null) && getSaveCancelSection().getSaveButton().isSelected(fse. getPageState())) { - orgaunit.setName((String) data.get(NAME)); + //orgaunit.setName((String) data.get(NAME)); orgaunit.setAddendum((String) data.get(ADDENDUM)); orgaunit.save(); diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java index e0a969d5c..eea93f821 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/BasicItemForm.java @@ -58,12 +58,11 @@ import java.util.Collection; public abstract class BasicItemForm extends FormSection implements FormInitListener, FormProcessListener, 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 SaveCancelSection m_saveCancelSection; private FormSection m_widgetSection; - public static final String NAME = ContentItem.NAME; public static final String TITLE = ContentPage.TITLE; public static final String LANGUAGE = ContentItem.LANGUAGE; @@ -113,7 +112,7 @@ public abstract class BasicItemForm extends FormSection super(columnPanel); //super(formName, columnPanel); m_widgetSection = - new FormSection(new ColumnPanel(columnPanel.getNumCols(), true)); + new FormSection(new ColumnPanel(columnPanel.getNumCols(), true)); super.add(m_widgetSection, ColumnPanel.INSERT); m_itemModel = itemModel; } @@ -125,10 +124,9 @@ public abstract class BasicItemForm extends FormSection m_saveCancelSection = new SaveCancelSection(); super.add(m_saveCancelSection, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); } - - private Label m_script = new Label("", false); - - + private Label m_script = new Label( + "", + false); /** * 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 // 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)); titleWidget.addValidationListener(new NotNullValidationListener()); - titleWidget.setOnFocus("if (this.form." + NAME + ".value == '') { " + - " defaulting = true; this.form." + NAME + - ".value = urlize(this.value); }"); + titleWidget.setOnFocus("if (this.form." + NAME + ".value == '') { " + + " defaulting = true; this.form." + NAME + + ".value = urlize(this.value); }"); titleWidget.setOnKeyUp( - "if (defaulting) { this.form." + NAME + - ".value = urlize(this.value) }" - ); + "if (defaulting) { this.form." + NAME + + ".value = urlize(this.value) }"); 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)); nameWidget.addValidationListener(new NameValidationListener()); nameWidget.setOnFocus("defaulting = false"); nameWidget.setOnBlur( - "if (this.value == '') " + - "{ defaulting = true; this.value = urlize(this.form." + TITLE + - ".value) } " + - " else { this.value = urlize(this.value); }" - ); + "if (this.value == '') " + + "{ defaulting = true; this.value = urlize(this.form." + TITLE + + ".value) } " + " else { this.value = urlize(this.value); }"); add(nameWidget); } @@ -226,7 +229,7 @@ public abstract class BasicItemForm extends FormSection * with the name the user provided on the input form. */ public void validateNameUniqueness(Folder parent, FormSectionEvent event) - throws FormProcessException { + throws FormProcessException { FormData data = event.getFormData(); String newName = (String) data.get(NAME); @@ -234,15 +237,16 @@ public abstract class BasicItemForm extends FormSection validateNameUniqueness(parent, event, newName); } - public void validateNameUniqueness(Folder parent, FormSectionEvent event, String newName) - throws FormProcessException { - if ( newName != null ) { + public void validateNameUniqueness(Folder parent, FormSectionEvent event, + String newName) + throws FormProcessException { + if (newName != null) { final String query = "com.arsdigita.cms.validateUniqueItemName"; DataQuery dq = SessionManager.getSession().retrieveQuery(query); dq.setParameter("parentId", parent.getID()); dq.setParameter("name", newName.toUpperCase()); - if ( dq.size() > 0) { + if (dq.size() > 0) { // we need to add all of the items that are // different versions of this item to the list // so that we do not throw an error if those @@ -251,28 +255,27 @@ public abstract class BasicItemForm extends FormSection ContentItem item = null; if (getItemSelectionModel() != null) { - item = (ContentItem) getItemSelectionModel() - .getSelectedObject(event.getPageState()); + item = (ContentItem) getItemSelectionModel(). + getSelectedObject(event.getPageState()); } if (item == null) { // this means it is a creation form - throw new FormProcessException - ("An item with this name already exists"); + throw new FormProcessException( + "An item with this name already exists"); } Collection list = getAllVersionIDs(item); while (dq.next()) { - itemID = (BigDecimal)dq.get("itemID"); + itemID = (BigDecimal) dq.get("itemID"); if (!list.contains(itemID)) { dq.close(); - throw new FormProcessException - ("An item with this name already exists"); + throw new FormProcessException( + "An item with this name already exists"); } } - } + } } } - /** * 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. @@ -286,12 +289,12 @@ public abstract class BasicItemForm extends FormSection */ public void validateNameUniquenessWithinCategory(FormSectionEvent event, BigDecimal id) - throws FormProcessException { + throws FormProcessException { if (id == null) { - s_log.warn("Trying to validation the name uniqueness without " + - " a valid item is invalid. This method should only " + - " be called in \"edit\" forms. The passed in id " + - " was null."); + s_log.warn("Trying to validation the name uniqueness without " + + " a valid item is invalid. This method should only " + + " be called in \"edit\" forms. The passed in id " + + " was null."); return; } // 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) { return; } - DataQuery query = SessionManager.getSession().retrieveQuery - ("com.arsdigita.categorization.getAllItemURLsForCategoryFromItem"); + DataQuery query = + SessionManager.getSession().retrieveQuery( + "com.arsdigita.categorization.getAllItemURLsForCategoryFromItem"); query.setParameter("itemID", id); query.addEqualsFilter("lower(url)", url.toLowerCase()); if (query.size() > 0) { @@ -312,18 +316,18 @@ public abstract class BasicItemForm extends FormSection BigDecimal itemID = null; ContentItem item = - (ContentItem) getItemSelectionModel() - .getSelectedObject(event.getPageState()); + (ContentItem) getItemSelectionModel().getSelectedObject(event. + getPageState()); Collection list = getAllVersionIDs(item); try { while (query.next()) { - itemID = (BigDecimal)query.get("itemID"); + itemID = (BigDecimal) query.get("itemID"); if (!list.contains(itemID)) { StringBuffer buffer = - new StringBuffer("There are conflicts with this URL. " + - "Specifically, there is at least one item " + - "in the same category as this item with " + - "the name (url) of "); + new StringBuffer("There are conflicts with this URL. " + + "Specifically, there is at least one item " + + "in the same category as this item with " + + "the name (url) of "); buffer.append(url); throw new FormProcessException(buffer.toString()); } @@ -374,4 +378,32 @@ public abstract class BasicItemForm extends FormSection public void add(Component pc, int 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(); + } } diff --git a/ccm-forum/pdl/com/arsdigita/forum/Forum.pdl b/ccm-forum/pdl/com/arsdigita/forum/Forum.pdl index e1fd1690b..16f68c034 100755 --- a/ccm-forum/pdl/com/arsdigita/forum/Forum.pdl +++ b/ccm-forum/pdl/com/arsdigita/forum/Forum.pdl @@ -32,6 +32,7 @@ object type Forum extends Application { Boolean [1..1] isModerated = forum_forums.is_moderated; Boolean [1..1] isNoticeboard = forum_forums.is_noticeboard; + Boolean [1..1] isPublic = forum_forums.is_public; component Group [0..1] adminGroup = join forum_forums.admin_group_id to groups.group_id; diff --git a/ccm-forum/src/com/arsdigita/forum/Forum.java b/ccm-forum/src/com/arsdigita/forum/Forum.java index bbf6c1cf9..6bcae3f1e 100755 --- a/ccm-forum/src/com/arsdigita/forum/Forum.java +++ b/ccm-forum/src/com/arsdigita/forum/Forum.java @@ -116,6 +116,7 @@ public class Forum extends Application { private static final String POSTS = "posts"; private static final String SUBSCRIPTIONS = "subscriptions"; private static final String MODERATION = "isModerated"; + private static final String PUBLIC = "isPublic"; private static final String NOTICEBOARD = "isNoticeboard"; private static final String ADMIN_GROUP = "adminGroup"; @@ -205,6 +206,7 @@ public class Forum extends Application { title, parent, true); forum.setModerated(moderated); + forum.setPublic(true); // default settings ensure legacy forum users do not // see any change chris.gilbert@westsussex.gov.uk forum.setAllowFileAttachments(false); @@ -768,6 +770,16 @@ public class Forum extends Application { 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. * If enabled, no replies will be allowed. diff --git a/ccm-forum/src/com/arsdigita/forum/ui/admin/SetupView.java b/ccm-forum/src/com/arsdigita/forum/ui/admin/SetupView.java index 6e856e1dc..ebad9277e 100644 --- a/ccm-forum/src/com/arsdigita/forum/ui/admin/SetupView.java +++ b/ccm-forum/src/com/arsdigita/forum/ui/admin/SetupView.java @@ -55,158 +55,167 @@ import org.apache.log4j.Logger; * that apply to this forum instance */ public class SetupView - extends Form - implements FormInitListener, FormSubmissionListener, FormProcessListener, Constants { - private static final Logger s_log = Logger.getLogger(SetupView.class); + extends Form + implements FormInitListener, FormSubmissionListener, FormProcessListener, + Constants { - // values for checkboxes - private static final String MODERATED = "moderated"; - private static final String NOTICEBOARD = "noticeboard"; - private static final String ALLOW_FILES = "filesAllowed"; - private static final String ALLOW_IMAGES = "imagesallowed"; - 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 static final Logger s_log = Logger.getLogger(SetupView.class); + // values for checkboxes + private static final String MODERATED = "moderated"; + private static final String PUBLIC = "public"; + private static final String NOTICEBOARD = "noticeboard"; + private static final String ALLOW_FILES = "filesAllowed"; + private static final String ALLOW_IMAGES = "imagesallowed"; + 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; - private TextField m_expiry; - private SaveCancelSection m_saveCancel; - private TextArea m_introduction; - private TextField m_title; - - public SetupView() { - super("setupForm", new SimpleContainer("forum:setup", FORUM_XML_NS)); - m_settings = new CheckboxGroup("settings"); - m_settings.addOption( - new Option( - MODERATED, - (String) Text.gz("forum.ui.settings.moderated").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())); - - 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())); - - + public SetupView() { + super("setupForm", new SimpleContainer("forum:setup", FORUM_XML_NS)); + m_settings = new CheckboxGroup("settings"); + m_settings.addOption( + 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())); - m_expiry = new TextField(new IntegerParameter("expiry")); - m_expiry.setMetaDataAttribute("label", (String)Text.gz("forum.ui.noticeboard.expiry_after").localize()); - m_saveCancel = new SaveCancelSection(); - m_saveCancel.getSaveButton().setButtonLabel(Text.gz("forum.ui.settings.save")); - 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.setMetaDataAttribute("label", (String)Text.gz("forum.ui.settings.title").localize()); - m_title.setSize(70); - - add(m_title); - add(m_introduction); - add(m_settings); - add(m_expiry); - add(m_saveCancel); + 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())); - addInitListener(this); - addSubmissionListener(this); - addProcessListener(this); - } - public void init(FormSectionEvent e) throws FormProcessException { - PageState state = e.getPageState(); - Forum forum = ForumContext.getContext(state).getForum(); - Set settingsSet = new HashSet(); - if (forum.isModerated()) { - settingsSet.add(MODERATED); - } - if (forum.isNoticeboard()) { - settingsSet.add(NOTICEBOARD); - } - if (forum.allowFileAttachments()) { - settingsSet.add(ALLOW_FILES); - } - if (forum.allowImageUploads()) { - settingsSet.add(ALLOW_IMAGES); - } - if (forum.autoSubscribeThreadStarter()) { - settingsSet.add(AUTOSUBSCRIBE_THREAD_STARTERS); - } - if (forum.noCategoryPostsAllowed()) { - settingsSet.add(NO_CATEGORY_POSTS_ALLOWED); - } - if (forum.anonymousPostsAllowed()) { - settingsSet.add(ANONYMOUS_POSTS_ALLOWED); - } - m_settings.setValue(state, settingsSet.toArray()); - m_expiry.setValue(state, new Integer(forum.getExpireAfter())); - - m_introduction.setValue(state, forum.getIntroduction()); - - m_title.setValue(state, forum.getTitle()); + m_expiry = new TextField(new IntegerParameter("expiry")); + m_expiry.setMetaDataAttribute("label", (String) Text.gz( + "forum.ui.noticeboard.expiry_after").localize()); + m_saveCancel = new SaveCancelSection(); + m_saveCancel.getSaveButton().setButtonLabel(Text.gz( + "forum.ui.settings.save")); + 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.setMetaDataAttribute("label", (String) Text.gz( + "forum.ui.settings.title").localize()); + m_title.setSize(70); - public void submitted(FormSectionEvent e) throws FormProcessException { - PageState state = e.getPageState(); + add(m_title); + add(m_introduction); + add(m_settings); + add(m_expiry); + add(m_saveCancel); - if (m_saveCancel.getCancelButton().isSelected(state)) { - s_log.debug("cancelled"); - throw new FormProcessException("cancelled"); - } - } + addInitListener(this); + addSubmissionListener(this); + addProcessListener(this); + } - public void process(FormSectionEvent e) throws FormProcessException { - PageState state = e.getPageState(); - Forum forum = ForumContext.getContext(state).getForum(); - String[] settingsArray = (String[]) m_settings.getValue(state); - List settings = Collections.EMPTY_LIST; - if (settingsArray != null) { - - settings = Arrays.asList(settingsArray); - } - forum.setModerated(settings.contains(MODERATED)); - forum.setNoticeboard(settings.contains(NOTICEBOARD)); - // could remove any existing files but i don't think that would be desirable - forum.setAllowFileAttachments(settings.contains(ALLOW_FILES)); - forum.setAllowImageUploads(settings.contains(ALLOW_IMAGES)); - forum.setAutoSubscribeThreadCreator(settings.contains(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.setIntroduction((String)m_introduction.getValue(state)); - Integer expiry = (m_expiry.getValue(state) == null) ? new Integer(0) : (Integer) m_expiry.getValue(state); - int newExpiry = expiry.intValue(); - if (forum.getExpireAfter() != newExpiry) { - forum.setExpireAfter(newExpiry); - } + public void init(FormSectionEvent e) throws FormProcessException { + PageState state = e.getPageState(); + Forum forum = ForumContext.getContext(state).getForum(); + Set settingsSet = new HashSet(); + if (forum.isModerated()) { + settingsSet.add(MODERATED); + } + if (forum.isNoticeboard()) { + settingsSet.add(NOTICEBOARD); + } + if (forum.allowFileAttachments()) { + settingsSet.add(ALLOW_FILES); + } + if (forum.allowImageUploads()) { + settingsSet.add(ALLOW_IMAGES); + } + if (forum.autoSubscribeThreadStarter()) { + settingsSet.add(AUTOSUBSCRIBE_THREAD_STARTERS); + } + if (forum.noCategoryPostsAllowed()) { + settingsSet.add(NO_CATEGORY_POSTS_ALLOWED); + } + if (forum.anonymousPostsAllowed()) { + settingsSet.add(ANONYMOUS_POSTS_ALLOWED); + } + m_settings.setValue(state, settingsSet.toArray()); - } + m_expiry.setValue(state, new Integer(forum.getExpireAfter())); + + m_introduction.setValue(state, forum.getIntroduction()); + + m_title.setValue(state, forum.getTitle()); + + } + + public void submitted(FormSectionEvent e) throws FormProcessException { + PageState state = e.getPageState(); + + if (m_saveCancel.getCancelButton().isSelected(state)) { + s_log.debug("cancelled"); + throw new FormProcessException("cancelled"); + } + } + + public void process(FormSectionEvent e) throws FormProcessException { + PageState state = e.getPageState(); + Forum forum = ForumContext.getContext(state).getForum(); + String[] settingsArray = (String[]) m_settings.getValue(state); + List settings = Collections.EMPTY_LIST; + if (settingsArray != null) { + + settings = Arrays.asList(settingsArray); + } + forum.setModerated(settings.contains(MODERATED)); + forum.setPublic(settings.contains(PUBLIC)); + forum.setNoticeboard(settings.contains(NOTICEBOARD)); + // could remove any existing files but i don't think that would be desirable + forum.setAllowFileAttachments(settings.contains(ALLOW_FILES)); + forum.setAllowImageUploads(settings.contains(ALLOW_IMAGES)); + forum.setAutoSubscribeThreadCreator(settings.contains( + 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.setIntroduction((String) m_introduction.getValue(state)); + Integer expiry = (m_expiry.getValue(state) == null) ? new Integer(0) : (Integer) m_expiry. + getValue(state); + int newExpiry = expiry.intValue(); + if (forum.getExpireAfter() != newExpiry) { + forum.setExpireAfter(newExpiry); + } + + } } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumePropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumePropertiesStep.java index 3988369a7..d10ec06d7 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumePropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumePropertiesStep.java @@ -44,8 +44,8 @@ public class CollectedVolumePropertiesStep public static Component getCollectedVolumePropertySheet( ItemSelectionModel itemModel) { DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) PublicationWithPublisherPropertiesStep. - getPublicationPropertySheet(itemModel); - + getPublicationWithPublisherPropertySheet(itemModel); + return sheet; } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InternetArticlePropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InternetArticlePropertiesStep.java index 03f80962e..6b6cc6f6a 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InternetArticlePropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InternetArticlePropertiesStep.java @@ -96,7 +96,7 @@ public class InternetArticlePropertiesStep extends PublicationPropertiesStep { getCancelButton()); basicProperties.setDisplayComponent( - getPublicationPropertySheet(itemModel)); + getInternetArticlePropertySheet(itemModel)); getSegmentedPanel().addSegment( new Label((String) PublicationGlobalizationUtil.globalize( diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/JournalPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/JournalPropertiesStep.java index 6ed9fff12..036468194 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/JournalPropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/JournalPropertiesStep.java @@ -22,6 +22,7 @@ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Label; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.Journal; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; @@ -45,6 +46,10 @@ public class JournalPropertiesStep extends PublicationPropertiesStep { DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) PublicationPropertiesStep. getPublicationPropertySheet(itemModel); + sheet.add(PublicationGlobalizationUtil.globalize( + "publications.ui.journal.issn"), + Journal.ISSN); + return sheet; } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPropertiesStep.java index cda535bd5..58a561908 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPropertiesStep.java @@ -90,7 +90,7 @@ public class ProceedingsPropertiesStep getCancelButton()); basicProperties.setDisplayComponent( - getPublicationPropertySheet(itemModel)); + getProceedingsPropertySheet(itemModel)); getSegmentedPanel().addSegment( new Label((String) PublicationGlobalizationUtil.globalize( diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPropertyForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPropertyForm.java index c92627eb5..3210515f6 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPropertyForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPropertyForm.java @@ -112,6 +112,7 @@ public class ProceedingsPropertyForm @Override public void init(FormSectionEvent fse) throws FormProcessException { + super.init(fse); FormData data = fse.getFormData(); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationPropertyForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationPropertyForm.java index fdbd0d0df..f60b20cf6 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationPropertyForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationPropertyForm.java @@ -66,11 +66,11 @@ public class PublicationPropertyForm protected void addWidgets() { super.addWidgets(); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.publication.title").localize())); + /*add(new Label((String) PublicationGlobalizationUtil.globalize( + "publications.ui.publication.title").localize())); ParameterModel titleParam = new StringParameter(Publication.TITLE); TextField title = new TextField(titleParam); - add(title); + add(title);*/ add(new Label((String) PublicationGlobalizationUtil.globalize( "publications.ui.publication.year_of_publication").localize())); @@ -102,7 +102,7 @@ public class PublicationPropertyForm FormData data = fse.getFormData(); 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. getYearOfPublication()); data.put(Publication.ABSTRACT, publication.getAbstract()); @@ -116,14 +116,16 @@ public class PublicationPropertyForm if ((publication != null) && getSaveCancelSection().getSaveButton(). isSelected(fse.getPageState())) { - publication.setTitle((String) data.get(Publication.TITLE)); + //publication.setTitle((String) data.get(Publication.TITLE)); publication.setYearOfPublication((Integer) data.get( Publication.YEAR_OF_PUBLICATION)); publication.setAbstract((String) data.get(Publication.ABSTRACT)); publication.setMisc((String) data.get(Publication.MISC)); publication.save(); - } + + init(fse); + } } @Override @@ -133,4 +135,10 @@ public class PublicationPropertyForm m_step.cancelStreamlinedCreation(fse.getPageState()); } } + + @Override + protected String getTitleLabel() { + return (String) PublicationGlobalizationUtil.globalize( + "publications.ui.publication.title").localize(); + } } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources.properties b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources.properties index 713c3d98b..21fb3afae 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources.properties +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources.properties @@ -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.organizer_of_conference=Organizer of conference 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.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.volume_of_series=Volume of series 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.publication_date=Date of publication 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.remove=Remove this association publications.ui.inProceedings.proceedings.confirm_remove=Do really want to remove this association +publications.ui.series.name=Name (URL) diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources_de.properties b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources_de.properties index 2f69e4f83..1db8c8e03 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources_de.properties +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources_de.properties @@ -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.organizer_of_conference=Veranstalter der Konferenz 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.volume=Band @@ -178,7 +178,7 @@ publications.ui.authors.selectAuthor=Autor ausw\u00e4hlen #========= publications.ui.publisher.basic_properties=Basiseigenschaften publications.ui.publisher.edit_basic_properties=Basiseigenschaften bearbeiten -publications.ui.publisher.place=Erscheinungsort +publications.ui.publisher.place=Sitz des Verlages #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.volume_of_series=Band der Serie 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.publication_date=Publikationsdatum 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.remove=Verkn\u00fcpfung entfernen publications.ui.inProceedings.proceedings.confirm_remove=Wollen Sie diese Verkn\u00fcpfung wirklich entfernen +publications.ui.series.name=Name (URL) diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPropertiesStep.java index 9db40fea7..41fd88dbf 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPropertiesStep.java @@ -19,12 +19,15 @@ */ package com.arsdigita.cms.contenttypes.ui; +import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Label; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.Publisher; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; +import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; /** * @@ -38,6 +41,18 @@ public class PublisherPropertiesStep 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 protected void addBasicProperties(ItemSelectionModel itemModel, AuthoringKitWizard parent) { @@ -55,7 +70,7 @@ public class PublisherPropertiesStep getCancelButton()); basicProperties.setDisplayComponent( - getGenericOrganizationalUnitPropertySheet(itemModel)); + getPublisherPropertySheet(itemModel)); getSegmentedPanel().addSegment( new Label((String) PublicationGlobalizationUtil.globalize( diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ReviewPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ReviewPropertiesStep.java index 158d9e71b..8875b9e23 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ReviewPropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ReviewPropertiesStep.java @@ -41,8 +41,8 @@ public class ReviewPropertiesStep extends ArticleInJournalPropertiesStep { public static Component getReviewPropertySheet( ItemSelectionModel itemModel) { - DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) PublicationPropertiesStep. - getPublicationPropertySheet(itemModel); + DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) ArticleInJournalPropertiesStep. + getArticleInJournalPropertySheet(itemModel); return sheet; } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertiesStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertiesStep.java index 82fcc3883..09c2b40d6 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertiesStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertiesStep.java @@ -31,7 +31,7 @@ import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicPageForm; 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.toolbox.ui.DomainObjectPropertySheet; import java.text.DateFormat; @@ -64,8 +64,12 @@ public class SeriesPropertiesStep extends SimpleEditStep { itemModel); sheet.add(PublicationGlobalizationUtil.globalize( - "publications.ui.series.title"), + "publications.ui.series.name"), Series.NAME); + sheet.add(PublicationGlobalizationUtil.globalize( + "publications.ui.series.title"), + Series.TITLE); + if (!ContentSection.getConfig().getHideLaunchDate()) { sheet.add(ContenttypesGlobalizationUtil.globalize( @@ -104,18 +108,18 @@ public class SeriesPropertiesStep extends SimpleEditStep { (String) PublicationGlobalizationUtil.globalize( "publications.ui.series.edit_basic_sheet").localize(), new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), + itemModel), editBasicSheet.getSaveCancelSection().getCancelButton()); basicProperties.setDisplayComponent(getSeriesPropertySheet(itemModel)); segmentedPanel.addSegment(new Label((String) PublicationGlobalizationUtil. globalize("publications.ui.series.basic_properties").localize()), - basicProperties); - } + basicProperties); + } protected void addSteps(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { + AuthoringKitWizard parent) { addStep(new SeriesEditshipStep(itemModel, parent), "publications.ui.series.editors"); addStep(new SeriesVolumesStep(itemModel, parent), diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertyForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertyForm.java index 51811fb05..d74c62d77 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertyForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesPropertyForm.java @@ -21,14 +21,10 @@ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; 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.contenttypes.Series; import com.arsdigita.cms.ui.authoring.BasicPageForm; @@ -64,11 +60,11 @@ public class SeriesPropertyForm protected void addWidgets() { super.addWidgets(); - add(new Label((String) PublicationGlobalizationUtil.globalize( - "publications.ui.series.title").localize())); + /*add(new Label((String) PublicationGlobalizationUtil.globalize( + "publications.ui.series.title").localize())); ParameterModel titleParam = new StringParameter(Series.NAME); TextField title = new TextField(titleParam); - add(title); + add(title);*/ } @Override @@ -76,7 +72,7 @@ public class SeriesPropertyForm FormData data = fse.getFormData(); Series series = (Series) super.initBasicWidgets(fse); - data.put(Series.NAME, series.getTitle()); + //data.put(Series.NAME, series.getTitle()); } @Override @@ -86,10 +82,10 @@ public class SeriesPropertyForm if ((series != null) && getSaveCancelSection().getSaveButton(). isSelected(fse.getPageState())) { - series.setTitle((String) data.get(Series.NAME)); + /*series.setTitle((String) data.get(Series.NAME)); - series.save(); - } + series.save();*/ + } } @Override @@ -99,4 +95,10 @@ public class SeriesPropertyForm m_step.cancelStreamlinedCreation(fse.getPageState()); } } + + @Override + protected String getTitleLabel() { + return (String) PublicationGlobalizationUtil.globalize( + "publications.ui.series.title").localize(); + } }