get-/set- Methoden für Reviewed publications sowie GUI (Checkboxen)
git-svn-id: https://svn.libreccm.org/ccm/trunk@843 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
7b9cb0cb30
commit
5c3f540390
|
|
@ -37,6 +37,7 @@ public class ArticleInCollectedVolume extends Publication {
|
|||
public final static String PAGES_TO = "pagesTo";
|
||||
public final static String CHAPTER = "chapter";
|
||||
public final static String COLLECTED_VOLUME = "collectedVolume";
|
||||
public static final String REVIEWED = "reviewed";
|
||||
public final static String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.ArticleInCollectedVolume";
|
||||
|
||||
|
|
@ -87,6 +88,14 @@ public class ArticleInCollectedVolume extends Publication {
|
|||
set(CHAPTER, chapter);
|
||||
}
|
||||
|
||||
public Boolean getReviewed() {
|
||||
return (Boolean) get(REVIEWED);
|
||||
}
|
||||
|
||||
public void setReviewed(Boolean reviewed) {
|
||||
set(REVIEWED, reviewed);
|
||||
}
|
||||
|
||||
public CollectedVolume getCollectedVolume() {
|
||||
DataCollection collection;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ public class ArticleInJournal extends Publication {
|
|||
public static final String PAGES_TO = "pagesTo";
|
||||
public static final String JOURNAL = "journal";
|
||||
public static final String PUBLICATION_DATE = "publicationDate";
|
||||
public static final String REVIEWED = "reviewed";
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.ArticleInJournal";
|
||||
|
||||
|
|
@ -103,6 +104,14 @@ public class ArticleInJournal extends Publication {
|
|||
set(PUBLICATION_DATE, publicationDate);
|
||||
}
|
||||
|
||||
public Boolean getReviewed() {
|
||||
return (Boolean) get(REVIEWED);
|
||||
}
|
||||
|
||||
public void setReviewed(Boolean reviewed) {
|
||||
set(REVIEWED, reviewed);
|
||||
}
|
||||
|
||||
public Journal getJournal() {
|
||||
DataCollection collection;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ public class CollectedVolume extends PublicationWithPublisher {
|
|||
|
||||
public static final String ARTICLES = "articles";
|
||||
public static final String ARTICLE_ORDER = "articleOrder";
|
||||
public static final String REVIEWED = "reviewed";
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.CollectedVolume";
|
||||
|
||||
|
|
@ -59,6 +60,14 @@ public class CollectedVolume extends PublicationWithPublisher {
|
|||
super(type);
|
||||
}
|
||||
|
||||
public Boolean getReviewed() {
|
||||
return (Boolean) get(REVIEWED);
|
||||
}
|
||||
|
||||
public void setReviewed(Boolean reviewed) {
|
||||
set(REVIEWED, reviewed);
|
||||
}
|
||||
|
||||
public ArticleInCollectedVolumeCollection getArticles() {
|
||||
return new ArticleInCollectedVolumeCollection(
|
||||
(DataCollection) get(ARTICLES));
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import java.math.BigDecimal;
|
|||
*/
|
||||
public class WorkingPaper extends UnPublished {
|
||||
|
||||
public static final String REVIEWED = "reviewed";
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.WorkingPaper";
|
||||
|
||||
|
|
@ -51,4 +52,12 @@ public class WorkingPaper extends UnPublished {
|
|||
public WorkingPaper(String type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public Boolean getReviewed() {
|
||||
return (Boolean) get(REVIEWED);
|
||||
}
|
||||
|
||||
public void setReviewed(Boolean reviewed) {
|
||||
set(REVIEWED, reviewed);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,5 +61,5 @@ public class ArticleInCollectedVolumeCollectedVolumeStep
|
|||
new ArticleInCollectedVolumeCollectedVolumeSheet(
|
||||
itemModel);
|
||||
setDisplayComponent(sheet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,12 +21,15 @@ package com.arsdigita.cms.contenttypes.ui;
|
|||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.ArticleInCollectedVolume;
|
||||
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.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainService;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
|
||||
/**
|
||||
|
|
@ -58,6 +61,10 @@ public class ArticleInCollectedVolumePropertiesStep
|
|||
"publications.ui.article_in_collected_volume.chapter"),
|
||||
ArticleInCollectedVolume.CHAPTER);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleInCollectedVolume.reviewed"),
|
||||
ArticleInCollectedVolume.REVIEWED, new ReviewedFormatter());
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
||||
|
|
@ -100,4 +107,25 @@ public class ArticleInCollectedVolumePropertiesStep
|
|||
localize());
|
||||
|
||||
}
|
||||
|
||||
private static class ReviewedFormatter
|
||||
extends DomainService
|
||||
implements DomainObjectPropertySheet.AttributeFormatter {
|
||||
|
||||
public ReviewedFormatter() {
|
||||
super();
|
||||
}
|
||||
|
||||
public String format(DomainObject obj, String attribute, PageState state) {
|
||||
if ((get(obj, attribute) != null)
|
||||
&& (get(obj, attribute) instanceof Boolean)
|
||||
&& ((Boolean) get(obj, attribute) == true)) {
|
||||
return (String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleInCollectedVolume.reviewed.yes").localize();
|
||||
} else {
|
||||
return (String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleInCollectedVolume.reviewed.no").localize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ 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.CheckboxGroup;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.IntegerParameter;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
|
|
@ -43,8 +45,10 @@ public class ArticleInCollectedVolumePropertyForm
|
|||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private static final String REVIEWED = "reviewed";
|
||||
private ArticleInCollectedVolumePropertiesStep m_step;
|
||||
public static final String ID = "ArticleInCollectedVolumeEdit";
|
||||
private CheckboxGroup reviewed;
|
||||
|
||||
public ArticleInCollectedVolumePropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
|
|
@ -85,6 +89,12 @@ public class ArticleInCollectedVolumePropertyForm
|
|||
ArticleInCollectedVolume.CHAPTER);
|
||||
TextField chapter = new TextField(chapterParam);
|
||||
add(chapter);
|
||||
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleInCollectedVolume.reviewed")));
|
||||
reviewed = new CheckboxGroup("reviewedGroup");
|
||||
reviewed.addOption(new Option(REVIEWED, ""));
|
||||
add(reviewed);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -99,6 +109,12 @@ public class ArticleInCollectedVolumePropertyForm
|
|||
data.put(ArticleInCollectedVolume.PAGES_FROM, article.getPagesFrom());
|
||||
data.put(ArticleInCollectedVolume.PAGES_TO, article.getPagesTo());
|
||||
data.put(ArticleInCollectedVolume.CHAPTER, article.getChapter());
|
||||
|
||||
if ((article.getReviewed() != null) && (article.getReviewed())) {
|
||||
reviewed.setValue(fse.getPageState(), new String[]{REVIEWED});
|
||||
} else {
|
||||
reviewed.setValue(fse.getPageState(), null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -119,6 +135,12 @@ public class ArticleInCollectedVolumePropertyForm
|
|||
article.setChapter((String) data.get(
|
||||
ArticleInCollectedVolume.CHAPTER));
|
||||
|
||||
if (reviewed.getValue(fse.getPageState()) == null) {
|
||||
article.setReviewed(false);
|
||||
} else {
|
||||
article.setReviewed(true);
|
||||
}
|
||||
|
||||
article.save();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,12 +21,15 @@ package com.arsdigita.cms.contenttypes.ui;
|
|||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.ArticleInJournal;
|
||||
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.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainService;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
|
||||
/**
|
||||
|
|
@ -65,6 +68,10 @@ public class ArticleInJournalPropertiesStep extends PublicationPropertiesStep {
|
|||
"publications.ui.articleinjournal.publication_date"),
|
||||
ArticleInJournal.PUBLICATION_DATE);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleinjournal.reviewed"),
|
||||
ArticleInJournal.REVIEWED, new ReviewedFormatter());
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
||||
|
|
@ -106,4 +113,25 @@ public class ArticleInJournalPropertiesStep extends PublicationPropertiesStep {
|
|||
"publication.ui.articleInJournal.journal").localize());
|
||||
|
||||
}
|
||||
|
||||
private static class ReviewedFormatter
|
||||
extends DomainService
|
||||
implements DomainObjectPropertySheet.AttributeFormatter {
|
||||
|
||||
public ReviewedFormatter() {
|
||||
super();
|
||||
}
|
||||
|
||||
public String format(DomainObject obj, String attribute, PageState state) {
|
||||
if ((get(obj, attribute) != null)
|
||||
&& (get(obj, attribute) instanceof Boolean)
|
||||
&& ((Boolean) get(obj, attribute) == true)) {
|
||||
return (String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleinjournal.reviewed.yes").localize();
|
||||
} else {
|
||||
return (String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleinjournal.reviewed.no").localize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ 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.CheckboxGroup;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.DateParameter;
|
||||
import com.arsdigita.bebop.parameters.IntegerParameter;
|
||||
|
|
@ -47,8 +49,10 @@ public class ArticleInJournalPropertyForm
|
|||
FormProcessListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private static final String REVIEWED = "reviewed";
|
||||
private ArticleInJournalPropertiesStep m_step;
|
||||
public static final String ID = "ArticleInJournalEdit";
|
||||
private CheckboxGroup reviewed;
|
||||
|
||||
public ArticleInJournalPropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
|
|
@ -63,7 +67,7 @@ public class ArticleInJournalPropertyForm
|
|||
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
super.addWidgets();
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleinjournal.volume").localize()));
|
||||
|
|
@ -103,6 +107,12 @@ public class ArticleInJournalPropertyForm
|
|||
pubDateParam);
|
||||
pubDate.setYearRange(1900, today.get(Calendar.YEAR) + 2);
|
||||
add(pubDate);
|
||||
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleinjournal.reviewed")));
|
||||
reviewed = new CheckboxGroup("reviewedGroup");
|
||||
reviewed.addOption(new Option(REVIEWED, ""));
|
||||
add(reviewed);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -111,13 +121,19 @@ public class ArticleInJournalPropertyForm
|
|||
|
||||
FormData data = fse.getFormData();
|
||||
ArticleInJournal article = (ArticleInJournal) initBasicWidgets(fse);
|
||||
|
||||
|
||||
data.put(ArticleInJournal.VOLUME, article.getVolume());
|
||||
data.put(ArticleInJournal.ISSUE, article.getIssue());
|
||||
data.put(ArticleInJournal.PAGES_FROM, article.getPagesFrom());
|
||||
data.put(ArticleInJournal.PAGES_TO, article.getPagesTo());
|
||||
data.put(ArticleInJournal.PAGES_TO, article.getPagesTo());
|
||||
data.put(ArticleInJournal.PUBLICATION_DATE,
|
||||
article.getPublicationDate());
|
||||
|
||||
if ((article.getReviewed() != null) && (article.getReviewed())) {
|
||||
reviewed.setValue(fse.getPageState(), new String[]{REVIEWED});
|
||||
} else {
|
||||
reviewed.setValue(fse.getPageState(), null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -128,16 +144,22 @@ public class ArticleInJournalPropertyForm
|
|||
ArticleInJournal article = (ArticleInJournal) initBasicWidgets(fse);
|
||||
|
||||
if ((article != null) && getSaveCancelSection().getSaveButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
isSelected(fse.getPageState())) {
|
||||
article.setVolume((Integer) data.get(ArticleInJournal.VOLUME));
|
||||
article.setIssue((String) data.get(ArticleInJournal.ISSUE));
|
||||
article.setPagesFrom(
|
||||
(Integer) data.get(ArticleInJournal.PAGES_FROM));
|
||||
article.setPagesTo(
|
||||
(Integer) data.get(ArticleInJournal.PAGES_TO));
|
||||
(Integer) data.get(ArticleInJournal.PAGES_TO));
|
||||
article.setPublicationDate(
|
||||
(Date) data.get(ArticleInJournal.PUBLICATION_DATE));
|
||||
|
||||
if (reviewed.getValue(fse.getPageState()) == null) {
|
||||
article.setReviewed(false);
|
||||
} else {
|
||||
article.setReviewed(true);
|
||||
}
|
||||
|
||||
article.save();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,11 +21,15 @@ package com.arsdigita.cms.contenttypes.ui;
|
|||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.CollectedVolume;
|
||||
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.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainService;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
|
||||
/**
|
||||
|
|
@ -45,7 +49,11 @@ public class CollectedVolumePropertiesStep
|
|||
ItemSelectionModel itemModel) {
|
||||
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) PublicationWithPublisherPropertiesStep.
|
||||
getPublicationWithPublisherPropertySheet(itemModel);
|
||||
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.collectedVolume.reviewed"),
|
||||
CollectedVolume.REVIEWED, new ReviewedFormatter());
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
||||
|
|
@ -87,4 +95,25 @@ public class CollectedVolumePropertiesStep
|
|||
addStep(new CollectedVolumeArticlesStep(itemModel, parent),
|
||||
"publications.ui.collected_volume_articles");
|
||||
}
|
||||
|
||||
private static class ReviewedFormatter
|
||||
extends DomainService
|
||||
implements DomainObjectPropertySheet.AttributeFormatter {
|
||||
|
||||
public ReviewedFormatter() {
|
||||
super();
|
||||
}
|
||||
|
||||
public String format(DomainObject obj, String attribute, PageState state) {
|
||||
if ((get(obj, attribute) != null)
|
||||
&& (get(obj, attribute) instanceof Boolean)
|
||||
&& ((Boolean) get(obj, attribute) == true)) {
|
||||
return (String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.collectedVolume.reviewed.yes").localize();
|
||||
} else {
|
||||
return (String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.collectedVolume.reviewed.no").localize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,10 +21,13 @@ 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.CheckboxGroup;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.CollectedVolume;
|
||||
import org.apache.log4j.Logger;
|
||||
|
|
@ -42,8 +45,10 @@ public class CollectedVolumePropertyForm
|
|||
private static final Logger s_log =
|
||||
Logger.getLogger(
|
||||
CollectedVolumePropertyForm.class);
|
||||
private static final String REVIEWED = "reviewed";
|
||||
private CollectedVolumePropertiesStep m_step;
|
||||
public static final String ID = "CollectedVolumeEdit";
|
||||
private CheckboxGroup reviewed;
|
||||
|
||||
public CollectedVolumePropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
|
|
@ -59,6 +64,11 @@ public class CollectedVolumePropertyForm
|
|||
@Override
|
||||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
add(new Label(PublicationGlobalizationUtil.globalize("publications.ui.collectedVolume.reviewed")));
|
||||
reviewed = new CheckboxGroup("reviewedGroup");
|
||||
reviewed.addOption(new Option(REVIEWED, ""));
|
||||
add(reviewed);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -68,6 +78,13 @@ public class CollectedVolumePropertyForm
|
|||
FormData data = fse.getFormData();
|
||||
CollectedVolume collectedVolume =
|
||||
(CollectedVolume) super.initBasicWidgets(fse);
|
||||
|
||||
if ((collectedVolume.getReviewed() != null)
|
||||
&&(collectedVolume.getReviewed())) {
|
||||
reviewed.setValue(fse.getPageState(), new String[]{REVIEWED});
|
||||
} else {
|
||||
reviewed.setValue(fse.getPageState(), null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -77,5 +94,16 @@ public class CollectedVolumePropertyForm
|
|||
FormData data = fse.getFormData();
|
||||
CollectedVolume collectedVolume =
|
||||
(CollectedVolume) super.processBasicWidgets(fse);
|
||||
|
||||
if ((collectedVolume != null) && getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||
|
||||
if (reviewed.getValue(fse.getPageState()) == null) {
|
||||
collectedVolume.setReviewed(false);
|
||||
} else {
|
||||
collectedVolume.setReviewed(true);
|
||||
}
|
||||
|
||||
collectedVolume.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ public class MonographPropertiesStep
|
|||
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) PublicationWithPublisherPropertiesStep.
|
||||
getPublicationWithPublisherPropertySheet(itemModel);
|
||||
|
||||
/*sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.monograph.reviewed"),
|
||||
Monograph.REVIEWED, new ReviewedFormatter());*/
|
||||
Monograph.REVIEWED, new ReviewedFormatter());
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.form.CheckboxGroup;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.parameters.ArrayParameter;
|
||||
import com.arsdigita.bebop.parameters.BooleanParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Monograph;
|
||||
|
||||
|
|
@ -63,11 +61,11 @@ public class MonographPropertyForm
|
|||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
/*add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.monograph.reviewed")));
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.monograph.reviewed")));
|
||||
reviewed = new CheckboxGroup("reviewedGroup");
|
||||
reviewed.addOption(new Option(REVIEWED, ""));
|
||||
add(reviewed); */
|
||||
add(reviewed);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -77,14 +75,14 @@ public class MonographPropertyForm
|
|||
FormData data = fse.getFormData();
|
||||
Monograph monograph = (Monograph) super.initBasicWidgets(fse);
|
||||
|
||||
if (reviewed != null) {
|
||||
if ((monograph.getReviewed() != null)
|
||||
&& (monograph.getReviewed())) {
|
||||
reviewed.setValue(fse.getPageState(), new String[]{REVIEWED});
|
||||
} else {
|
||||
reviewed.setValue(fse.getPageState(), null);
|
||||
}
|
||||
|
||||
if ((monograph.getReviewed() != null)
|
||||
&& (monograph.getReviewed())) {
|
||||
reviewed.setValue(fse.getPageState(), new String[]{REVIEWED});
|
||||
} else {
|
||||
reviewed.setValue(fse.getPageState(), null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -96,12 +94,11 @@ public class MonographPropertyForm
|
|||
|
||||
if ((monograph != null) && getSaveCancelSection().getSaveButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
if (reviewed != null) {
|
||||
if (reviewed.getValue(fse.getPageState()) == null) {
|
||||
monograph.setReviewed(false);
|
||||
} else {
|
||||
monograph.setReviewed(true);
|
||||
}
|
||||
|
||||
if (reviewed.getValue(fse.getPageState()) == null) {
|
||||
monograph.setReviewed(false);
|
||||
} else {
|
||||
monograph.setReviewed(true);
|
||||
}
|
||||
|
||||
monograph.save();
|
||||
|
|
|
|||
|
|
@ -306,3 +306,15 @@ publications.ui.invalid_isbn=The ISBN entered is invalid
|
|||
publications.ui.invalid_issn=The ISSN entered is invalid
|
||||
publications.ui.journal.lastYearOfPublication=Last year of publication
|
||||
publications.ui.series.abstract=Description
|
||||
publications.ui.collectedVolume.reviewed=Reviewed?
|
||||
publications.ui.collectedVolume.reviewed.yes=Yes
|
||||
publications.ui.collectedVolume.reviewed.no=No
|
||||
publications.ui.articleInCollectedVolume.reviewed.yes=Yes
|
||||
publications.ui.articleInCollectedVolume.reviewed.no=No
|
||||
publications.ui.articleInCollectedVolume.reviewed=Reviewed?
|
||||
publications.ui.articleinjournal.reviewed=Reviewed?
|
||||
publications.ui.articleinjournal.reviewed.yes=Yes
|
||||
publications.ui.articleinjournal.reviewed.no=No
|
||||
publications.ui.workingpaper.reviewed=Reviewed?
|
||||
publications.ui.workingpaper.reviewed.yes=Yes
|
||||
publications.ui.workingpaper.reviewed.no=No
|
||||
|
|
|
|||
|
|
@ -305,3 +305,15 @@ publications.ui.invalid_isbn=Die eingegebene ISBN ist fehlerhaft.
|
|||
publications.ui.invalid_issn=Die eingegebene ISSN ist fehlerhaft.
|
||||
publications.ui.journal.lastYearOfPublication=Letztes Jahr der Ver\u00f6ffentlichung
|
||||
publications.ui.series.abstract=Beschreibung
|
||||
publications.ui.collectedVolume.reviewed=Begutachtet?
|
||||
publications.ui.collectedVolume.reviewed.yes=Ja
|
||||
publications.ui.collectedVolume.reviewed.no=Nein
|
||||
publications.ui.articleInCollectedVolume.reviewed.yes=Ja
|
||||
publications.ui.articleInCollectedVolume.reviewed.no=Nein
|
||||
publications.ui.articleInCollectedVolume.reviewed=Begutachtet?
|
||||
publications.ui.articleinjournal.reviewed=Begutachtet?
|
||||
publications.ui.articleinjournal.reviewed.yes=Ja
|
||||
publications.ui.articleinjournal.reviewed.no=Nein
|
||||
publications.ui.workingpaper.reviewed=Begutachtet?
|
||||
publications.ui.workingpaper.reviewed.yes=Ja
|
||||
publications.ui.workingpaper.reviewed.no=Nein
|
||||
|
|
|
|||
|
|
@ -21,14 +21,17 @@ package com.arsdigita.cms.contenttypes.ui;
|
|||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.WorkingPaper;
|
||||
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.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainService;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
|
|
@ -42,8 +45,12 @@ public class WorkingPaperPropertiesStep extends UnPublishedPropertiesStep {
|
|||
|
||||
public static Component getWorkingPaperPropertySheet(
|
||||
ItemSelectionModel itemModel) {
|
||||
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet)
|
||||
getUnPublishedPropertySheet(itemModel);
|
||||
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) getUnPublishedPropertySheet(
|
||||
itemModel);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.workingpaper.reviewed"),
|
||||
WorkingPaper.REVIEWED, new ReviewedFormatter());
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
|
@ -51,7 +58,7 @@ public class WorkingPaperPropertiesStep extends UnPublishedPropertiesStep {
|
|||
@Override
|
||||
protected void addBasicProperties(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
SimpleEditStep basicProperties = new SimpleEditStep(itemModel,
|
||||
SimpleEditStep basicProperties = new SimpleEditStep(itemModel,
|
||||
parent,
|
||||
EDIT_SHEET_NAME);
|
||||
|
||||
|
|
@ -74,4 +81,25 @@ public class WorkingPaperPropertiesStep extends UnPublishedPropertiesStep {
|
|||
"publications.ui.publication.basic_properties").
|
||||
localize()), basicProperties);
|
||||
}
|
||||
|
||||
private static class ReviewedFormatter
|
||||
extends DomainService
|
||||
implements DomainObjectPropertySheet.AttributeFormatter {
|
||||
|
||||
public ReviewedFormatter() {
|
||||
super();
|
||||
}
|
||||
|
||||
public String format(DomainObject obj, String attribute, PageState state) {
|
||||
if ((get(obj, attribute) != null)
|
||||
&& (get(obj, attribute) instanceof Boolean)
|
||||
&& ((Boolean) get(obj, attribute) == true)) {
|
||||
return (String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.workingpaper.reviewed.yes").localize();
|
||||
} else {
|
||||
return (String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.workingpaper.reviewed.no").localize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,11 +20,15 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
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.CheckboxGroup;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.WorkingPaper;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -36,8 +40,10 @@ public class WorkingPaperPropertyForm
|
|||
FormProcessListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private static final String REVIEWED = "reviewed";
|
||||
private WorkingPaperPropertiesStep m_step;
|
||||
public static final String ID = "WorkingPaperEdit";
|
||||
private CheckboxGroup reviewed;
|
||||
|
||||
public WorkingPaperPropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
|
|
@ -53,15 +59,43 @@ public class WorkingPaperPropertyForm
|
|||
@Override
|
||||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.workingpaper.reviewed")));
|
||||
reviewed = new CheckboxGroup("reviewedGroup");
|
||||
reviewed.addOption(new Option(REVIEWED, ""));
|
||||
add(reviewed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FormSectionEvent fse) throws FormProcessException {
|
||||
super.init(fse);
|
||||
|
||||
WorkingPaper paper = (WorkingPaper) super.initBasicWidgets(fse);
|
||||
|
||||
if ((paper.getReviewed() != null) && (paper.getReviewed())) {
|
||||
reviewed.setValue(fse.getPageState(), new String[]{REVIEWED});
|
||||
} else {
|
||||
reviewed.setValue(fse.getPageState(), null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(FormSectionEvent fse) throws FormProcessException {
|
||||
super.process(fse);
|
||||
|
||||
WorkingPaper paper = (WorkingPaper) super.processBasicWidgets(fse);
|
||||
|
||||
if ((paper != null) && getSaveCancelSection().getSaveButton().isSelected(
|
||||
fse.getPageState())) {
|
||||
|
||||
if (reviewed.getValue(fse.getPageState()) == null) {
|
||||
paper.setReviewed(false);
|
||||
} else {
|
||||
paper.setReviewed(true);
|
||||
}
|
||||
|
||||
paper.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue