Die letzten groeberen Bugs in ccm-sci-publications sollten jetzt behoben sein.
git-svn-id: https://svn.libreccm.org/ccm/trunk@521 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
1be39e2909
commit
bc47734c93
|
|
@ -10,7 +10,7 @@
|
|||
description="A generic content type for organizations and projects."
|
||||
objectType="com.arsdigita.cms.contenttypes.GenericOrganizationalUnit"
|
||||
classname= "com.arsdigita.cms.contenttypes.GenericOrganizationalUnit"
|
||||
isInternal="yes">
|
||||
isInternal="yes">
|
||||
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
||||
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ public final class LoaderConfig extends AbstractConfig {
|
|||
new String[] {"/WEB-INF/content-types/GenericAddress.xml",
|
||||
"/WEB-INF/content-types/GenericArticle.xml",
|
||||
"/WEB-INF/content-types/GenericContact.xml",
|
||||
"/WEB-INF/content-types/GenericOrganizationalUnit.xml",
|
||||
"/WEB-INF/content-types/GenericPerson.xml",
|
||||
"/WEB-INF/content-types/Template.xml"}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ public class GenericOrganizationalUnit extends ContentPage {
|
|||
this(BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
public GenericOrganizationalUnit(BigDecimal id) throws
|
||||
DataObjectNotFoundException {
|
||||
public GenericOrganizationalUnit(BigDecimal id)
|
||||
throws DataObjectNotFoundException {
|
||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,13 +130,47 @@ public class GenericPerson extends ContentPage implements RelationAttribute {
|
|||
* @return {@code titlePre} {@code givenName) {@code surnameName} {@code titlePost}
|
||||
*/
|
||||
public String getFullName() {
|
||||
return String.format("%s %s %s %s", getTitlePre(), getGivenName(),
|
||||
getSurname(), getTitlePost()).trim();
|
||||
String titlePre;
|
||||
String titlePost;
|
||||
String givenName;
|
||||
String surname;
|
||||
String fullName = "";
|
||||
|
||||
titlePre = getTitlePre();
|
||||
titlePost = getTitlePost();
|
||||
givenName = getGivenName();
|
||||
surname = getSurname();
|
||||
|
||||
if (titlePre == null) {
|
||||
titlePre = "";
|
||||
}
|
||||
if (titlePost == null) {
|
||||
titlePost = "";
|
||||
}
|
||||
if (givenName == null) {
|
||||
givenName = "";
|
||||
}
|
||||
if (surname == null) {
|
||||
surname = "";
|
||||
}
|
||||
|
||||
if (0 == fullName.length()) {
|
||||
fullName = getTitle();
|
||||
}
|
||||
|
||||
fullName = String.format("%s %s %s %s",
|
||||
titlePre,
|
||||
givenName,
|
||||
surname,
|
||||
titlePost).trim();
|
||||
|
||||
return fullName;
|
||||
}
|
||||
|
||||
// Get all contacts for this person
|
||||
public GenericPersonContactCollection getContacts() {
|
||||
return new GenericPersonContactCollection((DataCollection) get(CONTACTS));
|
||||
return new GenericPersonContactCollection(
|
||||
(DataCollection) get(CONTACTS));
|
||||
}
|
||||
|
||||
// Add a contact for this person
|
||||
|
|
|
|||
|
|
@ -54,18 +54,21 @@ public class GenericOrganizationalUnitChildAddForm extends BasicItemForm {
|
|||
}
|
||||
|
||||
public GenericOrganizationalUnitChildAddForm(String formName,
|
||||
ItemSelectionModel itemModel) {
|
||||
ItemSelectionModel itemModel) {
|
||||
super(formName, itemModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.select_child").localize()));
|
||||
add(new Label(
|
||||
(String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.select_child").localize()));
|
||||
|
||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(
|
||||
getChildDataObjectType()));
|
||||
add(this.m_itemSearch);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -96,6 +99,6 @@ public class GenericOrganizationalUnitChildAddForm extends BasicItemForm {
|
|||
* @return The BASE_DATA_OBJECT_TYPE of the childs allowed.
|
||||
*/
|
||||
protected String getChildDataObjectType() {
|
||||
return GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE;
|
||||
return GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class GenericOrganizationalUnitPropertiesStep extends SimpleEditStep {
|
|||
|
||||
segmentedPanel = new SegmentedPanel();
|
||||
setDefaultEditKey(EDIT_SHEET_NAME);
|
||||
|
||||
|
||||
addBasicProperties(itemModel, parent);
|
||||
addSteps(itemModel, parent);
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ public class GenericOrganizationalUnitPropertiesStep extends SimpleEditStep {
|
|||
protected void addSteps(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel,
|
||||
parent),
|
||||
parent),
|
||||
"cms.contenttypes.ui.orgaunit.childs");
|
||||
addStep(new GenericOrganizationalUnitChildrenPropertiesStep(itemModel,
|
||||
parent),
|
||||
|
|
@ -141,4 +141,8 @@ public class GenericOrganizationalUnitPropertiesStep extends SimpleEditStep {
|
|||
globalize(labelKey).localize()),
|
||||
step);
|
||||
}
|
||||
|
||||
protected SegmentedPanel getSegmentedPanel() {
|
||||
return segmentedPanel;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2010 Jens Pelzetter,
|
||||
for the Center of Social Politics of the University of Bremen
|
||||
for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
|
|
@ -40,10 +40,14 @@ import org.apache.log4j.Logger;
|
|||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class GenericOrganizationalUnitPropertyForm extends BasicPageForm
|
||||
implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
public class GenericOrganizationalUnitPropertyForm
|
||||
extends BasicPageForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private final static Logger s_log = Logger.getLogger(GenericOrganizationalUnitPropertyForm.class);
|
||||
private final static Logger s_log = Logger.getLogger(
|
||||
GenericOrganizationalUnitPropertyForm.class);
|
||||
private GenericOrganizationalUnitPropertiesStep m_step;
|
||||
//public static final String NAME = GenericOrganizationalUnit.NAME;
|
||||
//public static final String ORGAUNIT_NAME = GenericOrganizationalUnit.ORGAUNIT_NAME;
|
||||
|
|
@ -55,7 +59,7 @@ public class GenericOrganizationalUnitPropertyForm extends BasicPageForm
|
|||
}
|
||||
|
||||
public GenericOrganizationalUnitPropertyForm(ItemSelectionModel itemModel,
|
||||
GenericOrganizationalUnitPropertiesStep step) {
|
||||
GenericOrganizationalUnitPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
|
|
@ -66,23 +70,26 @@ public class GenericOrganizationalUnitPropertyForm extends BasicPageForm
|
|||
super.addWidgets();
|
||||
|
||||
add(new Label(
|
||||
(String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.genericorganunit.name").localize()));
|
||||
(String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorganunit.name").localize()));
|
||||
ParameterModel nameParam = new StringParameter(NAME);
|
||||
TextField name = new TextField(nameParam);
|
||||
add(name);
|
||||
|
||||
add(new Label(
|
||||
(String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.genericorgaunit.addendum").localize()));
|
||||
(String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.addendum").localize()));
|
||||
ParameterModel addendumParam = new StringParameter(ADDENDUM);
|
||||
TextField addendum = new TextField(addendumParam);
|
||||
add(addendum);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
||||
if ((m_step != null)
|
||||
&& getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) {
|
||||
&& getSaveCancelSection().getCancelButton().isSelected(fse.
|
||||
getPageState())) {
|
||||
m_step.cancelStreamlinedCreation(fse.getPageState());
|
||||
}
|
||||
}
|
||||
|
|
@ -91,7 +98,8 @@ public class GenericOrganizationalUnitPropertyForm extends BasicPageForm
|
|||
public void init(FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
GenericOrganizationalUnit orgaunit =
|
||||
(GenericOrganizationalUnit) super.initBasicWidgets(fse);
|
||||
(GenericOrganizationalUnit) super.
|
||||
initBasicWidgets(fse);
|
||||
|
||||
data.put(NAME, orgaunit.getName());
|
||||
data.put(ADDENDUM, orgaunit.getAddendum());
|
||||
|
|
@ -102,10 +110,12 @@ public class GenericOrganizationalUnitPropertyForm extends BasicPageForm
|
|||
FormData data = fse.getFormData();
|
||||
|
||||
GenericOrganizationalUnit orgaunit =
|
||||
(GenericOrganizationalUnit) super.processBasicWidgets(fse);
|
||||
(GenericOrganizationalUnit) super.
|
||||
processBasicWidgets(fse);
|
||||
|
||||
if ((orgaunit != null)
|
||||
&& getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||
&& getSaveCancelSection().getSaveButton().isSelected(fse.
|
||||
getPageState())) {
|
||||
orgaunit.setName((String) data.get(NAME));
|
||||
orgaunit.setAddendum((String) data.get(ADDENDUM));
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ object type CollectedVolume extends PublicationWithPublisher {
|
|||
Integer[0..1] volume = ct_collected_volume.volume INTEGER;
|
||||
Integer[0..1] numberOfVolumes = ct_collected_volume.number_of_volumes INTEGER;
|
||||
Integer[0..1] numberOfPages = ct_collected_volume._number_of_pages INTEGER;
|
||||
String[0..1] editon = ct_collected_volume.editon VARCHAR(256);
|
||||
String[0..1] edition = ct_collected_volume.edition VARCHAR(256);
|
||||
|
||||
reference key (ct_collected_volume.collected_volume_id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,13 +26,14 @@ import com.arsdigita.cms.ContentPage;
|
|||
object type Expertise extends Publication {
|
||||
|
||||
String[0..1] place = ct_expertise.place VARCHAR(256);
|
||||
GenericOrganizationalUnit[0..1] organization = join cms_organizationalunits.organizationalunit_id
|
||||
to ct_expertise.organization_id;
|
||||
component GenericOrganizationalUnit[0..1] organization = join ct_expertise.organization_id
|
||||
to cms_organizationalunits.organizationalunit_id;
|
||||
Integer[0..1] numberOfPages = ct_expertise.number_of_pages INTEGER;
|
||||
String[0..1] url = ct_expertise.url VARCHAR(512);
|
||||
GenericOrganizationalUnit[0..1] orderer = join cms_organizationalunits.organizationalunit_id
|
||||
to ct_expertise.orderer_id;
|
||||
component GenericOrganizationalUnit[0..1] orderer = join ct_expertise.orderer_id
|
||||
to cms_organizationalunits.organizationalunit_id;
|
||||
|
||||
reference key (ct_expertise.expertise_id);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,10 +30,12 @@ object type InProceedings extends PublicationWithPublisher {
|
|||
Date[0..1] dateFromOfConference = ct_inproceedings.date_from_of_conference DATE;
|
||||
Date[0..1] dateToOfConference = ct_inproceedings.date_to_of_conference DATE;
|
||||
String[0..1] placeOfConference = ct_inproceedings.place_of_conference VARCHAR(256);
|
||||
Integer volume = ct_inproceedings.volume INTEGER;
|
||||
Integer numberOfVolumes = ct_inproceedings.numberOfVolumes INTEGER;
|
||||
Integer numberOfPages = ct_inproceedings.numberOfPages INTEGER;
|
||||
Integer pagesFrom = ct_inproceedings.pages_from INTEGER;
|
||||
Integer pagesTo = ct_inproceedings.pages_to INTEGER;
|
||||
Integer[0..1] volume = ct_inproceedings.volume INTEGER;
|
||||
Integer[0..1] numberOfVolumes = ct_inproceedings.numberOfVolumes INTEGER;
|
||||
Integer[0..1] numberOfPages = ct_inproceedings.numberOfPages INTEGER;
|
||||
Integer[0..1] pagesFrom = ct_inproceedings.pages_from INTEGER;
|
||||
Integer[0..1] pagesTo = ct_inproceedings.pages_to INTEGER;
|
||||
|
||||
reference key (ct_inproceedings.inproceedings_id);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ import com.arsdigita.cms.ContentPage;
|
|||
object type InternetArticle extends Publication {
|
||||
|
||||
String[0..1] place = ct_internet_article.place VARCHAR(256);
|
||||
GenericOrganizationalUnit[0..1] organization = join cms_organizationalunits.organizationalunit_id
|
||||
to ct_internet_article.organization_id;
|
||||
component GenericOrganizationalUnit[0..1] organization = join ct_internet_article.organization_id
|
||||
to cms_organizationalunits.organizationalunit_id;
|
||||
String[0..1] number = ct_internet_article.number VARCHAR(128);
|
||||
Integer[0..1] numberOfPages = ct_internet_article.number_of_pages INTEGER;
|
||||
String[0..1] edition = ct_internet_article.edition VARCHAR(256);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ object type Publication extends ContentPage {
|
|||
reference key (ct_publications.publication_id);
|
||||
}
|
||||
|
||||
//Assoication for the editors
|
||||
//Assoication for the authors
|
||||
association {
|
||||
|
||||
Publication[0..1] publication = join cms_persons.person_id
|
||||
|
|
@ -40,7 +40,7 @@ association {
|
|||
join ct_publications_authorship.publication_id
|
||||
to ct_publications.publication_id;
|
||||
|
||||
GenericPerson[0..n] persons = join ct_publications.publication_id
|
||||
GenericPerson[0..n] authors = join ct_publications.publication_id
|
||||
to ct_publications_authorship.publication_id,
|
||||
join ct_publications_authorship.person_id
|
||||
to cms_persons.person_id;
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ import com.arsdigita.cms.ContentPage;
|
|||
object type PublicationWithPublisher extends Publication {
|
||||
|
||||
String[0..1] isbn = ct_publication_with_publisher.isbn VARCHAR(17);
|
||||
component Publisher[0..1] publisher = join ct_publication_with_publisher.publication_with_publisher_id
|
||||
to ct_publisher.publisher_id;
|
||||
component Publisher[0..1] publisher = join ct_publication_with_publisher.publisher_id
|
||||
to ct_publisher.publisher_id;
|
||||
|
||||
reference key (ct_publication_with_publisher.publication_with_publisher_id);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ object type Review extends Publication {
|
|||
Integer[0..1] volume = ct_review.volume INTEGER;
|
||||
String[0..1] issue = ct_review.issue VARCHAR(512);
|
||||
Integer[0..1] pagesFrom = ct_review.pages_from INTEGER;
|
||||
Integer[0..1] pagesto = ct_review.pages_to INTEGER;
|
||||
Integer[0..1] pagesTo = ct_review.pages_to INTEGER;
|
||||
String[0..1] issn = ct_review.issn VARCHAR(9);
|
||||
String[0..1] url = ct_review.url VARCHAR(512);
|
||||
Date[0..1] publicationDate = ct_review.publication_date DATE;
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ import com.arsdigita.cms.ContentPage;
|
|||
object type UnPublished extends Publication {
|
||||
|
||||
String[0..1] place = ct_unpublished.place VARCHAR(256);
|
||||
GenericOrganizationalUnit[0..1] organization = join cms_organizationalunits.organizationalunit_id
|
||||
to ct_internet_article.organization_id;
|
||||
component GenericOrganizationalUnit[0..1] organization = join ct_unpublished.organization_id
|
||||
to cms_organizationalunits.organizationalunit_id;
|
||||
String[0..1] number = ct_unpublished.number VARCHAR(128);
|
||||
Integer[0..1] numberOfPages = ct_unpublished.number_of_pages INTEGER;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
labelBundle="cms.contenttypes.cms.ui.CMSResources"
|
||||
descriptionKey="cms.contenttypes.internetArticle.basic_properties.description"
|
||||
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
||||
component="com.arsdigita.cms.contenttypes.ui.internetArticlePropertiesStep"
|
||||
component="com.arsdigita.cms.contenttypes.ui.InternetArticlePropertiesStep"
|
||||
ordering="1"/>
|
||||
|
||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class ArticleInCollectedVolumeCollection extends DomainCollection {
|
||||
|
||||
public static final String LINKORDER = "link.article_order";
|
||||
public static final String ORDER = "article_order";
|
||||
public static final String LINKORDER = "link.articleOrder";
|
||||
public static final String ORDER = "articleOrder";
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(
|
||||
ArticleInCollectedVolumeCollection.class);
|
||||
|
|
|
|||
|
|
@ -31,14 +31,15 @@ public class AuthorshipCollection extends DomainCollection {
|
|||
|
||||
private final static Logger s_log =
|
||||
Logger.getLogger(AuthorshipCollection.class);
|
||||
public static final String ORDER = "authorship_order";
|
||||
public static final String LINKORDER = "link.authorship_order";
|
||||
public static final String ORDER = "authorOrder";
|
||||
public static final String LINKORDER = "link.authorOrder";
|
||||
public static final String EDITOR = "editor";
|
||||
public static final String LINKEDITOR = "link.editor";
|
||||
|
||||
public AuthorshipCollection(
|
||||
DataCollection dataCollection) {
|
||||
super(dataCollection);
|
||||
m_dataCollection.addOrder(LINKORDER);
|
||||
}
|
||||
|
||||
public Integer getAuthorshipOrder() {
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class EditshipCollection extends DomainCollection {
|
||||
|
||||
public static final String LINK_FROM = "link.from";
|
||||
public static final String LINK_TO = "link.to";
|
||||
public static final String FROM = "from";
|
||||
public static final String TO = "to";
|
||||
public static final String LINK_FROM = "link.dateFrom";
|
||||
public static final String LINK_TO = "link.dateTo";
|
||||
public static final String FROM = "dateFrom";
|
||||
public static final String TO = "dateTo";
|
||||
public static final String LINKORDER = "link.editor_order";
|
||||
public static final String ORDER = "editor_order";
|
||||
private final static Logger s_log =
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import com.arsdigita.domain.DataObjectNotFoundException;
|
|||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -36,7 +37,8 @@ public class Expertise extends Publication {
|
|||
public static final String URL = "url";
|
||||
public static final String ORDERER = "orderer";
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contentttypes.Expertise";
|
||||
"com.arsdigita.cms.contenttypes.Expertise";
|
||||
private static final Logger s_log = Logger.getLogger(Expertise.class);
|
||||
|
||||
public Expertise() {
|
||||
this(BASE_DATA_OBJECT_TYPE);
|
||||
|
|
@ -67,10 +69,19 @@ public class Expertise extends Publication {
|
|||
}
|
||||
|
||||
public GenericOrganizationalUnit getOrganization() {
|
||||
return (GenericOrganizationalUnit) get(ORGANIZATION);
|
||||
DataObject dataObj;
|
||||
|
||||
dataObj = (DataObject) get(ORGANIZATION);
|
||||
|
||||
if (dataObj == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new GenericOrganizationalUnit(dataObj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrganization(GenericOrganizationalUnit orga) {
|
||||
s_log.debug(String.format("Setting organization to %s", orga.toString()));
|
||||
set(ORGANIZATION, orga);
|
||||
}
|
||||
|
||||
|
|
@ -91,7 +102,15 @@ public class Expertise extends Publication {
|
|||
}
|
||||
|
||||
public GenericOrganizationalUnit getOrderer() {
|
||||
return (GenericOrganizationalUnit) get(ORDERER);
|
||||
DataObject dataObj;
|
||||
|
||||
dataObj = (DataObject) get(ORDERER);
|
||||
|
||||
if (dataObj == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new GenericOrganizationalUnit(dataObj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrderer(GenericOrganizationalUnit orderer) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class InProceedings extends PublicationWithPublisher {
|
|||
public static final String NUMBER_OF_VOLUMES = "numberOfVolumes";
|
||||
public static final String NUMBER_OF_PAGES = "numberOfPages";
|
||||
public static final String PAGES_FROM = "pagesFrom";
|
||||
public static final String PAGES_TO = "pagesFrom";
|
||||
public static final String PAGES_TO = "pagesTo";
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.InProceedings";
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,15 @@ public class InternetArticle extends Publication {
|
|||
}
|
||||
|
||||
public GenericOrganizationalUnit getOrganization() {
|
||||
return (GenericOrganizationalUnit) get(ORGANIZATION);
|
||||
DataObject dataObj;
|
||||
|
||||
dataObj = (DataObject) get(ORGANIZATION);
|
||||
|
||||
if (dataObj == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new GenericOrganizationalUnit(dataObj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrganization(GenericOrganizationalUnit orga) {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class Publication extends ContentPage {
|
|||
public final static String MISC = "misc";
|
||||
public final static String AUTHORS = "authors";
|
||||
public final static String EDITOR = "editor";
|
||||
public final static String AUTHOR_ORDER = "author_order";
|
||||
public final static String AUTHOR_ORDER = "authorOrder";
|
||||
public final static String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.Publication";
|
||||
|
||||
|
|
@ -62,11 +62,11 @@ public class Publication extends ContentPage {
|
|||
super(type);
|
||||
}
|
||||
|
||||
public int getYearOfPublication() {
|
||||
public Integer getYearOfPublication() {
|
||||
return (Integer) get(YEAR_OF_PUBLICATION);
|
||||
}
|
||||
|
||||
public void setYearOfPublication(int year) {
|
||||
public void setYearOfPublication(Integer year) {
|
||||
set(YEAR_OF_PUBLICATION, year);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import com.arsdigita.domain.DataObjectNotFoundException;
|
|||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -31,9 +32,11 @@ import java.math.BigDecimal;
|
|||
public class PublicationWithPublisher extends Publication {
|
||||
|
||||
public final static String ISBN = "isbn";
|
||||
public final static String PUBLISHER = "publisher";
|
||||
public final static String PUBLISHER = "publisher";
|
||||
public final static String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.PublicationWithPublisher";
|
||||
"com.arsdigita.cms.contenttypes.PublicationWithPublisher";
|
||||
private static final Logger s_log = Logger.getLogger(
|
||||
PublicationWithPublisher.class);
|
||||
|
||||
public PublicationWithPublisher() {
|
||||
this(BASE_DATA_OBJECT_TYPE);
|
||||
|
|
@ -66,7 +69,15 @@ public class PublicationWithPublisher extends Publication {
|
|||
}
|
||||
|
||||
public Publisher getPublisher() {
|
||||
return (Publisher) get(PUBLISHER);
|
||||
DataObject dataObj;
|
||||
|
||||
dataObj = (DataObject) get(PUBLISHER);
|
||||
|
||||
if (dataObj == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new Publisher(dataObj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPublisher(Publisher publisher) {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class Series extends ContentPage {
|
|||
DataObject link = add(EDITORS, editor);
|
||||
link.set(EDITOR_FROM, from);
|
||||
link.set(EDITOR_TO, to);
|
||||
link.set(EDITOR_ORDER, BigDecimal.valueOf(getEditors().size()));
|
||||
link.set(EDITOR_ORDER, Integer.valueOf((int)getEditors().size()));
|
||||
}
|
||||
|
||||
public void removeEditor(GenericPerson editor) {
|
||||
|
|
|
|||
|
|
@ -66,7 +66,15 @@ public abstract class UnPublished extends Publication {
|
|||
}
|
||||
|
||||
public GenericOrganizationalUnit getOrganization() {
|
||||
return (GenericOrganizationalUnit) get(ORGANIZATION);
|
||||
DataObject dataObj;
|
||||
|
||||
dataObj = (DataObject) get(ORGANIZATION);
|
||||
|
||||
if (dataObj == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new GenericOrganizationalUnit(dataObj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrganization(GenericOrganizationalUnit orga) {
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ public class CollectedVolumeArticlesTable
|
|||
colModel.get(1).setCellRenderer(new DeleteCellRenderer());
|
||||
colModel.get(2).setCellRenderer(new UpCellRenderer());
|
||||
colModel.get(3).setCellRenderer(new DownCellRenderer());
|
||||
|
||||
addTableActionListener(this);
|
||||
}
|
||||
|
||||
private class CollectedVolumeArticlesTableModelBuilder
|
||||
|
|
|
|||
|
|
@ -119,10 +119,7 @@ public class ExpertisePropertyForm
|
|||
(GenericOrganizationalUnit) data.get(ITEM_SEARCH_ORDERER));
|
||||
|
||||
expertise.save();
|
||||
|
||||
if (m_step != null) {
|
||||
m_step.maybeForwardToNextStep(fse.getPageState());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public class InProceedingsPropertyForm
|
|||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.inproceedings.pages_from").localize()));
|
||||
ParameterModel pagesToParam =
|
||||
new IntegerParameter(InProceedings.PAGES_FROM);
|
||||
new IntegerParameter(InProceedings.PAGES_TO);
|
||||
TextField pagesTo = new TextField(pagesToParam);
|
||||
add(pagesTo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class InternetArticlePropertyForm
|
|||
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH,
|
||||
ContentType.
|
||||
findByAssociatedObjectType(
|
||||
GenericOrganizationalUnit.class.getName()));
|
||||
GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE));
|
||||
add(m_itemSearch);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class PublicationAuthorsTable
|
|||
public PublicationAuthorsTable(ItemSelectionModel itemModel) {
|
||||
super();
|
||||
m_itemModel = itemModel;
|
||||
|
||||
|
||||
setEmptyView(
|
||||
new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.none")));
|
||||
|
|
@ -79,6 +79,9 @@ public class PublicationAuthorsTable
|
|||
colModel.get(2).setCellRenderer(new DeleteCellRenderer());
|
||||
colModel.get(3).setCellRenderer(new UpCellRenderer());
|
||||
colModel.get(4).setCellRenderer(new DownCellRenderer());
|
||||
|
||||
s_log.info("Adding table action listener...");
|
||||
addTableActionListener(this);
|
||||
}
|
||||
|
||||
private class PublicationAuthorsTableModelBuilder
|
||||
|
|
@ -294,6 +297,8 @@ public class PublicationAuthorsTable
|
|||
public void cellSelected(TableActionEvent event) {
|
||||
PageState state = event.getPageState();
|
||||
|
||||
s_log.info("cellSelected!");
|
||||
|
||||
GenericPerson author =
|
||||
new GenericPerson(new BigDecimal(event.getRowKey().
|
||||
toString()));
|
||||
|
|
@ -309,8 +314,10 @@ public class PublicationAuthorsTable
|
|||
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
|
||||
publication.removeAuthor(author);
|
||||
} else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) {
|
||||
s_log.info("UP");
|
||||
authors.swapWithPrevious(author);
|
||||
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) {
|
||||
s_log.info("DOWN");
|
||||
authors.swapWithNext(author);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class PublicationPropertyForm
|
|||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.publication.misc").localize()));
|
||||
ParameterModel miscParam = new StringParameter(Publication.ABSTRACT);
|
||||
ParameterModel miscParam = new StringParameter(Publication.MISC);
|
||||
TextArea misc = new TextArea(miscParam);
|
||||
misc.setCols(60);
|
||||
misc.setRows(18);
|
||||
|
|
@ -97,7 +97,7 @@ public class PublicationPropertyForm
|
|||
|
||||
if ((publication != null) && getSaveCancelSection().getSaveButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
publication.setTitle((String) data.get(Publication.NAME));
|
||||
publication.setTitle((String) data.get(Publication.NAME));
|
||||
publication.setYearOfPublication((Integer) data.get(
|
||||
Publication.YEAR_OF_PUBLICATION));
|
||||
publication.setAbstract((String) data.get(Publication.ABSTRACT));
|
||||
|
|
|
|||
|
|
@ -96,10 +96,6 @@ private ItemSelectionModel m_itemModel;
|
|||
publication.setISBN((String) data.get(PublicationWithPublisher.ISBN));
|
||||
|
||||
publication.save();
|
||||
}
|
||||
|
||||
if (m_step != null) {
|
||||
m_step.maybeForwardToNextStep(fse.getPageState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class PublisherPropertiesStep
|
||||
extends GenericOrganizationalUnitPropertiesStep {
|
||||
|
||||
public PublisherPropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
super(itemModel, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addBasicProperties(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
SimpleEditStep basicProperties = new SimpleEditStep(itemModel,
|
||||
parent,
|
||||
EDIT_SHEET_NAME);
|
||||
BasicPageForm editBasicSheet = new PublisherPropertyForm(itemModel,
|
||||
this);
|
||||
basicProperties.add(EDIT_SHEET_NAME,
|
||||
(String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.publisher.edit_basic_properties").localize(),
|
||||
new WorkflowLockedComponentAccess(editBasicSheet,
|
||||
itemModel),
|
||||
editBasicSheet.getSaveCancelSection().
|
||||
getCancelButton());
|
||||
|
||||
basicProperties.setDisplayComponent(
|
||||
getGenericOrganizationalUnitPropertySheet(itemModel));
|
||||
|
||||
getSegmentedPanel().addSegment(
|
||||
new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.publisher.basic_properties").localize()),
|
||||
basicProperties);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
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.Publisher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class PublisherPropertyForm
|
||||
extends GenericOrganizationalUnitPropertyForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private PublisherPropertiesStep m_step;
|
||||
public static final String PLACE = "place";
|
||||
public static final String ID = "Publisher_edit";
|
||||
|
||||
public PublisherPropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
}
|
||||
|
||||
public PublisherPropertyForm(ItemSelectionModel itemModel,
|
||||
PublisherPropertiesStep step) {
|
||||
super(itemModel, step);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.publisher.place").localize()));
|
||||
ParameterModel placeParam = new StringParameter(PLACE);
|
||||
TextField place = new TextField(placeParam);
|
||||
add(place);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FormSectionEvent fse) throws FormProcessException {
|
||||
super.init(fse);
|
||||
|
||||
FormData data = fse.getFormData();
|
||||
Publisher publisher = (Publisher) super.initBasicWidgets(fse);
|
||||
|
||||
data.put(PLACE, publisher.getPlace());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(FormSectionEvent fse) throws FormProcessException {
|
||||
super.process(fse);
|
||||
|
||||
FormData data = fse.getFormData();
|
||||
Publisher publisher = (Publisher) super.processBasicWidgets(fse);
|
||||
|
||||
if ((publisher != null) && getSaveCancelSection().getSaveButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
publisher.setPlace((String) data.get(PLACE));
|
||||
}
|
||||
|
||||
publisher.save();
|
||||
|
||||
if (m_step != null) {
|
||||
m_step.maybeForwardToNextStep(fse.getPageState());
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue