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-94f89814c4df
master
jensp 2010-09-02 13:13:38 +00:00
parent 1be39e2909
commit bc47734c93
35 changed files with 309 additions and 79 deletions

View File

@ -132,6 +132,7 @@ public final class LoaderConfig extends AbstractConfig {
new String[] {"/WEB-INF/content-types/GenericAddress.xml", new String[] {"/WEB-INF/content-types/GenericAddress.xml",
"/WEB-INF/content-types/GenericArticle.xml", "/WEB-INF/content-types/GenericArticle.xml",
"/WEB-INF/content-types/GenericContact.xml", "/WEB-INF/content-types/GenericContact.xml",
"/WEB-INF/content-types/GenericOrganizationalUnit.xml",
"/WEB-INF/content-types/GenericPerson.xml", "/WEB-INF/content-types/GenericPerson.xml",
"/WEB-INF/content-types/Template.xml"} "/WEB-INF/content-types/Template.xml"}
); );

View File

@ -58,8 +58,8 @@ public class GenericOrganizationalUnit extends ContentPage {
this(BASE_DATA_OBJECT_TYPE); this(BASE_DATA_OBJECT_TYPE);
} }
public GenericOrganizationalUnit(BigDecimal id) throws public GenericOrganizationalUnit(BigDecimal id)
DataObjectNotFoundException { throws DataObjectNotFoundException {
this(new OID(BASE_DATA_OBJECT_TYPE, id)); this(new OID(BASE_DATA_OBJECT_TYPE, id));
} }

View File

@ -130,13 +130,47 @@ public class GenericPerson extends ContentPage implements RelationAttribute {
* @return {@code titlePre} {@code givenName) {@code surnameName} {@code titlePost} * @return {@code titlePre} {@code givenName) {@code surnameName} {@code titlePost}
*/ */
public String getFullName() { public String getFullName() {
return String.format("%s %s %s %s", getTitlePre(), getGivenName(), String titlePre;
getSurname(), getTitlePost()).trim(); 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 // Get all contacts for this person
public GenericPersonContactCollection getContacts() { public GenericPersonContactCollection getContacts() {
return new GenericPersonContactCollection((DataCollection) get(CONTACTS)); return new GenericPersonContactCollection(
(DataCollection) get(CONTACTS));
} }
// Add a contact for this person // Add a contact for this person

View File

@ -60,12 +60,15 @@ public class GenericOrganizationalUnitChildAddForm extends BasicItemForm {
@Override @Override
protected void addWidgets() { protected void addWidgets() {
add(new Label((String) ContenttypesGlobalizationUtil.globalize( add(new Label(
(String) ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericorgaunit.select_child").localize())); "cms.contenttypes.ui.genericorgaunit.select_child").localize()));
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
findByAssociatedObjectType( findByAssociatedObjectType(
getChildDataObjectType())); getChildDataObjectType()));
add(this.m_itemSearch); add(this.m_itemSearch);
} }
@Override @Override

View File

@ -141,4 +141,8 @@ public class GenericOrganizationalUnitPropertiesStep extends SimpleEditStep {
globalize(labelKey).localize()), globalize(labelKey).localize()),
step); step);
} }
protected SegmentedPanel getSegmentedPanel() {
return segmentedPanel;
}
} }

View File

@ -40,10 +40,14 @@ import org.apache.log4j.Logger;
* *
* @author Jens Pelzetter * @author Jens Pelzetter
*/ */
public class GenericOrganizationalUnitPropertyForm extends BasicPageForm public class GenericOrganizationalUnitPropertyForm
implements FormProcessListener, FormInitListener, FormSubmissionListener { 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; private GenericOrganizationalUnitPropertiesStep m_step;
//public static final String NAME = GenericOrganizationalUnit.NAME; //public static final String NAME = GenericOrganizationalUnit.NAME;
//public static final String ORGAUNIT_NAME = GenericOrganizationalUnit.ORGAUNIT_NAME; //public static final String ORGAUNIT_NAME = GenericOrganizationalUnit.ORGAUNIT_NAME;
@ -66,13 +70,15 @@ public class GenericOrganizationalUnitPropertyForm extends BasicPageForm
super.addWidgets(); super.addWidgets();
add(new Label( 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); ParameterModel nameParam = new StringParameter(NAME);
TextField name = new TextField(nameParam); TextField name = new TextField(nameParam);
add(name); add(name);
add(new Label( add(new Label(
(String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.genericorgaunit.addendum").localize())); (String) ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericorgaunit.addendum").localize()));
ParameterModel addendumParam = new StringParameter(ADDENDUM); ParameterModel addendumParam = new StringParameter(ADDENDUM);
TextField addendum = new TextField(addendumParam); TextField addendum = new TextField(addendumParam);
add(addendum); add(addendum);
@ -82,7 +88,8 @@ public class GenericOrganizationalUnitPropertyForm extends BasicPageForm
@Override @Override
public void submitted(FormSectionEvent fse) throws FormProcessException { public void submitted(FormSectionEvent fse) throws FormProcessException {
if ((m_step != null) if ((m_step != null)
&& getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) { && getSaveCancelSection().getCancelButton().isSelected(fse.
getPageState())) {
m_step.cancelStreamlinedCreation(fse.getPageState()); m_step.cancelStreamlinedCreation(fse.getPageState());
} }
} }
@ -91,7 +98,8 @@ public class GenericOrganizationalUnitPropertyForm extends BasicPageForm
public void init(FormSectionEvent fse) throws FormProcessException { public void init(FormSectionEvent fse) throws FormProcessException {
FormData data = fse.getFormData(); FormData data = fse.getFormData();
GenericOrganizationalUnit orgaunit = GenericOrganizationalUnit orgaunit =
(GenericOrganizationalUnit) super.initBasicWidgets(fse); (GenericOrganizationalUnit) super.
initBasicWidgets(fse);
data.put(NAME, orgaunit.getName()); data.put(NAME, orgaunit.getName());
data.put(ADDENDUM, orgaunit.getAddendum()); data.put(ADDENDUM, orgaunit.getAddendum());
@ -102,10 +110,12 @@ public class GenericOrganizationalUnitPropertyForm extends BasicPageForm
FormData data = fse.getFormData(); FormData data = fse.getFormData();
GenericOrganizationalUnit orgaunit = GenericOrganizationalUnit orgaunit =
(GenericOrganizationalUnit) super.processBasicWidgets(fse); (GenericOrganizationalUnit) super.
processBasicWidgets(fse);
if ((orgaunit != null) if ((orgaunit != null)
&& getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) { && getSaveCancelSection().getSaveButton().isSelected(fse.
getPageState())) {
orgaunit.setName((String) data.get(NAME)); orgaunit.setName((String) data.get(NAME));
orgaunit.setAddendum((String) data.get(ADDENDUM)); orgaunit.setAddendum((String) data.get(ADDENDUM));

View File

@ -28,7 +28,7 @@ object type CollectedVolume extends PublicationWithPublisher {
Integer[0..1] volume = ct_collected_volume.volume INTEGER; Integer[0..1] volume = ct_collected_volume.volume INTEGER;
Integer[0..1] numberOfVolumes = ct_collected_volume.number_of_volumes INTEGER; Integer[0..1] numberOfVolumes = ct_collected_volume.number_of_volumes INTEGER;
Integer[0..1] numberOfPages = ct_collected_volume._number_of_pages 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); reference key (ct_collected_volume.collected_volume_id);
} }

View File

@ -26,13 +26,14 @@ import com.arsdigita.cms.ContentPage;
object type Expertise extends Publication { object type Expertise extends Publication {
String[0..1] place = ct_expertise.place VARCHAR(256); String[0..1] place = ct_expertise.place VARCHAR(256);
GenericOrganizationalUnit[0..1] organization = join cms_organizationalunits.organizationalunit_id component GenericOrganizationalUnit[0..1] organization = join ct_expertise.organization_id
to ct_expertise.organization_id; to cms_organizationalunits.organizationalunit_id;
Integer[0..1] numberOfPages = ct_expertise.number_of_pages INTEGER; Integer[0..1] numberOfPages = ct_expertise.number_of_pages INTEGER;
String[0..1] url = ct_expertise.url VARCHAR(512); String[0..1] url = ct_expertise.url VARCHAR(512);
GenericOrganizationalUnit[0..1] orderer = join cms_organizationalunits.organizationalunit_id component GenericOrganizationalUnit[0..1] orderer = join ct_expertise.orderer_id
to ct_expertise.orderer_id; to cms_organizationalunits.organizationalunit_id;
reference key (ct_expertise.expertise_id); reference key (ct_expertise.expertise_id);
} }

View File

@ -30,10 +30,12 @@ object type InProceedings extends PublicationWithPublisher {
Date[0..1] dateFromOfConference = ct_inproceedings.date_from_of_conference DATE; Date[0..1] dateFromOfConference = ct_inproceedings.date_from_of_conference DATE;
Date[0..1] dateToOfConference = ct_inproceedings.date_to_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); String[0..1] placeOfConference = ct_inproceedings.place_of_conference VARCHAR(256);
Integer volume = ct_inproceedings.volume INTEGER; Integer[0..1] volume = ct_inproceedings.volume INTEGER;
Integer numberOfVolumes = ct_inproceedings.numberOfVolumes INTEGER; Integer[0..1] numberOfVolumes = ct_inproceedings.numberOfVolumes INTEGER;
Integer numberOfPages = ct_inproceedings.numberOfPages INTEGER; Integer[0..1] numberOfPages = ct_inproceedings.numberOfPages INTEGER;
Integer pagesFrom = ct_inproceedings.pages_from INTEGER; Integer[0..1] pagesFrom = ct_inproceedings.pages_from INTEGER;
Integer pagesTo = ct_inproceedings.pages_to INTEGER; Integer[0..1] pagesTo = ct_inproceedings.pages_to INTEGER;
reference key (ct_inproceedings.inproceedings_id);
} }

View File

@ -26,8 +26,8 @@ import com.arsdigita.cms.ContentPage;
object type InternetArticle extends Publication { object type InternetArticle extends Publication {
String[0..1] place = ct_internet_article.place VARCHAR(256); String[0..1] place = ct_internet_article.place VARCHAR(256);
GenericOrganizationalUnit[0..1] organization = join cms_organizationalunits.organizationalunit_id component GenericOrganizationalUnit[0..1] organization = join ct_internet_article.organization_id
to ct_internet_article.organization_id; to cms_organizationalunits.organizationalunit_id;
String[0..1] number = ct_internet_article.number VARCHAR(128); String[0..1] number = ct_internet_article.number VARCHAR(128);
Integer[0..1] numberOfPages = ct_internet_article.number_of_pages INTEGER; Integer[0..1] numberOfPages = ct_internet_article.number_of_pages INTEGER;
String[0..1] edition = ct_internet_article.edition VARCHAR(256); String[0..1] edition = ct_internet_article.edition VARCHAR(256);

View File

@ -32,7 +32,7 @@ object type Publication extends ContentPage {
reference key (ct_publications.publication_id); reference key (ct_publications.publication_id);
} }
//Assoication for the editors //Assoication for the authors
association { association {
Publication[0..1] publication = join cms_persons.person_id Publication[0..1] publication = join cms_persons.person_id
@ -40,7 +40,7 @@ association {
join ct_publications_authorship.publication_id join ct_publications_authorship.publication_id
to ct_publications.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, to ct_publications_authorship.publication_id,
join ct_publications_authorship.person_id join ct_publications_authorship.person_id
to cms_persons.person_id; to cms_persons.person_id;

View File

@ -26,7 +26,7 @@ import com.arsdigita.cms.ContentPage;
object type PublicationWithPublisher extends Publication { object type PublicationWithPublisher extends Publication {
String[0..1] isbn = ct_publication_with_publisher.isbn VARCHAR(17); 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 component Publisher[0..1] publisher = join ct_publication_with_publisher.publisher_id
to ct_publisher.publisher_id; to ct_publisher.publisher_id;
reference key (ct_publication_with_publisher.publication_with_publisher_id); reference key (ct_publication_with_publisher.publication_with_publisher_id);

View File

@ -29,7 +29,7 @@ object type Review extends Publication {
Integer[0..1] volume = ct_review.volume INTEGER; Integer[0..1] volume = ct_review.volume INTEGER;
String[0..1] issue = ct_review.issue VARCHAR(512); String[0..1] issue = ct_review.issue VARCHAR(512);
Integer[0..1] pagesFrom = ct_review.pages_from INTEGER; 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] issn = ct_review.issn VARCHAR(9);
String[0..1] url = ct_review.url VARCHAR(512); String[0..1] url = ct_review.url VARCHAR(512);
Date[0..1] publicationDate = ct_review.publication_date DATE; Date[0..1] publicationDate = ct_review.publication_date DATE;

View File

@ -26,8 +26,8 @@ import com.arsdigita.cms.ContentPage;
object type UnPublished extends Publication { object type UnPublished extends Publication {
String[0..1] place = ct_unpublished.place VARCHAR(256); String[0..1] place = ct_unpublished.place VARCHAR(256);
GenericOrganizationalUnit[0..1] organization = join cms_organizationalunits.organizationalunit_id component GenericOrganizationalUnit[0..1] organization = join ct_unpublished.organization_id
to ct_internet_article.organization_id; to cms_organizationalunits.organizationalunit_id;
String[0..1] number = ct_unpublished.number VARCHAR(128); String[0..1] number = ct_unpublished.number VARCHAR(128);
Integer[0..1] numberOfPages = ct_unpublished.number_of_pages INTEGER; Integer[0..1] numberOfPages = ct_unpublished.number_of_pages INTEGER;

View File

@ -17,7 +17,7 @@
labelBundle="cms.contenttypes.cms.ui.CMSResources" labelBundle="cms.contenttypes.cms.ui.CMSResources"
descriptionKey="cms.contenttypes.internetArticle.basic_properties.description" descriptionKey="cms.contenttypes.internetArticle.basic_properties.description"
descriptionBundle="com.arsdigita.cms.ui.CMSResources" descriptionBundle="com.arsdigita.cms.ui.CMSResources"
component="com.arsdigita.cms.contenttypes.ui.internetArticlePropertiesStep" component="com.arsdigita.cms.contenttypes.ui.InternetArticlePropertiesStep"
ordering="1"/> ordering="1"/>
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/> <ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>

View File

@ -30,8 +30,8 @@ import org.apache.log4j.Logger;
*/ */
public class ArticleInCollectedVolumeCollection extends DomainCollection { public class ArticleInCollectedVolumeCollection extends DomainCollection {
public static final String LINKORDER = "link.article_order"; public static final String LINKORDER = "link.articleOrder";
public static final String ORDER = "article_order"; public static final String ORDER = "articleOrder";
private static final Logger s_log = private static final Logger s_log =
Logger.getLogger( Logger.getLogger(
ArticleInCollectedVolumeCollection.class); ArticleInCollectedVolumeCollection.class);

View File

@ -31,14 +31,15 @@ public class AuthorshipCollection extends DomainCollection {
private final static Logger s_log = private final static Logger s_log =
Logger.getLogger(AuthorshipCollection.class); Logger.getLogger(AuthorshipCollection.class);
public static final String ORDER = "authorship_order"; public static final String ORDER = "authorOrder";
public static final String LINKORDER = "link.authorship_order"; public static final String LINKORDER = "link.authorOrder";
public static final String EDITOR = "editor"; public static final String EDITOR = "editor";
public static final String LINKEDITOR = "link.editor"; public static final String LINKEDITOR = "link.editor";
public AuthorshipCollection( public AuthorshipCollection(
DataCollection dataCollection) { DataCollection dataCollection) {
super(dataCollection); super(dataCollection);
m_dataCollection.addOrder(LINKORDER);
} }
public Integer getAuthorshipOrder() { public Integer getAuthorshipOrder() {

View File

@ -31,10 +31,10 @@ import org.apache.log4j.Logger;
*/ */
public class EditshipCollection extends DomainCollection { public class EditshipCollection extends DomainCollection {
public static final String LINK_FROM = "link.from"; public static final String LINK_FROM = "link.dateFrom";
public static final String LINK_TO = "link.to"; public static final String LINK_TO = "link.dateTo";
public static final String FROM = "from"; public static final String FROM = "dateFrom";
public static final String TO = "to"; public static final String TO = "dateTo";
public static final String LINKORDER = "link.editor_order"; public static final String LINKORDER = "link.editor_order";
public static final String ORDER = "editor_order"; public static final String ORDER = "editor_order";
private final static Logger s_log = private final static Logger s_log =

View File

@ -23,6 +23,7 @@ import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.DataObject;
import com.arsdigita.persistence.OID; import com.arsdigita.persistence.OID;
import java.math.BigDecimal; 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 URL = "url";
public static final String ORDERER = "orderer"; public static final String ORDERER = "orderer";
public static final String BASE_DATA_OBJECT_TYPE = 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() { public Expertise() {
this(BASE_DATA_OBJECT_TYPE); this(BASE_DATA_OBJECT_TYPE);
@ -67,10 +69,19 @@ public class Expertise extends Publication {
} }
public GenericOrganizationalUnit getOrganization() { 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) { public void setOrganization(GenericOrganizationalUnit orga) {
s_log.debug(String.format("Setting organization to %s", orga.toString()));
set(ORGANIZATION, orga); set(ORGANIZATION, orga);
} }
@ -91,7 +102,15 @@ public class Expertise extends Publication {
} }
public GenericOrganizationalUnit getOrderer() { 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) { public void setOrderer(GenericOrganizationalUnit orderer) {

View File

@ -41,7 +41,7 @@ public class InProceedings extends PublicationWithPublisher {
public static final String NUMBER_OF_VOLUMES = "numberOfVolumes"; public static final String NUMBER_OF_VOLUMES = "numberOfVolumes";
public static final String NUMBER_OF_PAGES = "numberOfPages"; public static final String NUMBER_OF_PAGES = "numberOfPages";
public static final String PAGES_FROM = "pagesFrom"; 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 = public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.cms.contenttypes.InProceedings"; "com.arsdigita.cms.contenttypes.InProceedings";

View File

@ -71,7 +71,15 @@ public class InternetArticle extends Publication {
} }
public GenericOrganizationalUnit getOrganization() { 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) { public void setOrganization(GenericOrganizationalUnit orga) {

View File

@ -37,7 +37,7 @@ public class Publication extends ContentPage {
public final static String MISC = "misc"; public final static String MISC = "misc";
public final static String AUTHORS = "authors"; public final static String AUTHORS = "authors";
public final static String EDITOR = "editor"; 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 = public final static String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.cms.contenttypes.Publication"; "com.arsdigita.cms.contenttypes.Publication";
@ -62,11 +62,11 @@ public class Publication extends ContentPage {
super(type); super(type);
} }
public int getYearOfPublication() { public Integer getYearOfPublication() {
return (Integer) get(YEAR_OF_PUBLICATION); return (Integer) get(YEAR_OF_PUBLICATION);
} }
public void setYearOfPublication(int year) { public void setYearOfPublication(Integer year) {
set(YEAR_OF_PUBLICATION, year); set(YEAR_OF_PUBLICATION, year);
} }

View File

@ -23,6 +23,7 @@ import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.DataObject;
import com.arsdigita.persistence.OID; import com.arsdigita.persistence.OID;
import java.math.BigDecimal; import java.math.BigDecimal;
import org.apache.log4j.Logger;
/** /**
* *
@ -34,6 +35,8 @@ public class PublicationWithPublisher extends Publication {
public final static String PUBLISHER = "publisher"; public final static String PUBLISHER = "publisher";
public final static String BASE_DATA_OBJECT_TYPE = 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() { public PublicationWithPublisher() {
this(BASE_DATA_OBJECT_TYPE); this(BASE_DATA_OBJECT_TYPE);
@ -66,7 +69,15 @@ public class PublicationWithPublisher extends Publication {
} }
public Publisher getPublisher() { 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) { public void setPublisher(Publisher publisher) {

View File

@ -72,7 +72,7 @@ public class Series extends ContentPage {
DataObject link = add(EDITORS, editor); DataObject link = add(EDITORS, editor);
link.set(EDITOR_FROM, from); link.set(EDITOR_FROM, from);
link.set(EDITOR_TO, to); 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) { public void removeEditor(GenericPerson editor) {

View File

@ -66,7 +66,15 @@ public abstract class UnPublished extends Publication {
} }
public GenericOrganizationalUnit getOrganization() { 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) { public void setOrganization(GenericOrganizationalUnit orga) {

View File

@ -76,6 +76,8 @@ public class CollectedVolumeArticlesTable
colModel.get(1).setCellRenderer(new DeleteCellRenderer()); colModel.get(1).setCellRenderer(new DeleteCellRenderer());
colModel.get(2).setCellRenderer(new UpCellRenderer()); colModel.get(2).setCellRenderer(new UpCellRenderer());
colModel.get(3).setCellRenderer(new DownCellRenderer()); colModel.get(3).setCellRenderer(new DownCellRenderer());
addTableActionListener(this);
} }
private class CollectedVolumeArticlesTableModelBuilder private class CollectedVolumeArticlesTableModelBuilder

View File

@ -120,9 +120,6 @@ public class ExpertisePropertyForm
expertise.save(); expertise.save();
if (m_step != null) {
m_step.maybeForwardToNextStep(fse.getPageState());
}
} }
} }
} }

View File

@ -123,7 +123,7 @@ public class InProceedingsPropertyForm
add(new Label((String) PublicationGlobalizationUtil.globalize( add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.inproceedings.pages_from").localize())); "publications.ui.inproceedings.pages_from").localize()));
ParameterModel pagesToParam = ParameterModel pagesToParam =
new IntegerParameter(InProceedings.PAGES_FROM); new IntegerParameter(InProceedings.PAGES_TO);
TextField pagesTo = new TextField(pagesToParam); TextField pagesTo = new TextField(pagesToParam);
add(pagesTo); add(pagesTo);
} }

View File

@ -63,7 +63,7 @@ public class InternetArticlePropertyForm
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, m_itemSearch = new ItemSearchWidget(ITEM_SEARCH,
ContentType. ContentType.
findByAssociatedObjectType( findByAssociatedObjectType(
GenericOrganizationalUnit.class.getName())); GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE));
add(m_itemSearch); add(m_itemSearch);
add(new Label((String) PublicationGlobalizationUtil.globalize( add(new Label((String) PublicationGlobalizationUtil.globalize(

View File

@ -79,6 +79,9 @@ public class PublicationAuthorsTable
colModel.get(2).setCellRenderer(new DeleteCellRenderer()); colModel.get(2).setCellRenderer(new DeleteCellRenderer());
colModel.get(3).setCellRenderer(new UpCellRenderer()); colModel.get(3).setCellRenderer(new UpCellRenderer());
colModel.get(4).setCellRenderer(new DownCellRenderer()); colModel.get(4).setCellRenderer(new DownCellRenderer());
s_log.info("Adding table action listener...");
addTableActionListener(this);
} }
private class PublicationAuthorsTableModelBuilder private class PublicationAuthorsTableModelBuilder
@ -294,6 +297,8 @@ public class PublicationAuthorsTable
public void cellSelected(TableActionEvent event) { public void cellSelected(TableActionEvent event) {
PageState state = event.getPageState(); PageState state = event.getPageState();
s_log.info("cellSelected!");
GenericPerson author = GenericPerson author =
new GenericPerson(new BigDecimal(event.getRowKey(). new GenericPerson(new BigDecimal(event.getRowKey().
toString())); toString()));
@ -309,8 +314,10 @@ public class PublicationAuthorsTable
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
publication.removeAuthor(author); publication.removeAuthor(author);
} else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) { } else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) {
s_log.info("UP");
authors.swapWithPrevious(author); authors.swapWithPrevious(author);
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) { } else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) {
s_log.info("DOWN");
authors.swapWithNext(author); authors.swapWithNext(author);
} }
} }

View File

@ -71,7 +71,7 @@ public class PublicationPropertyForm
add(new Label((String) PublicationGlobalizationUtil.globalize( add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.publication.misc").localize())); "publications.ui.publication.misc").localize()));
ParameterModel miscParam = new StringParameter(Publication.ABSTRACT); ParameterModel miscParam = new StringParameter(Publication.MISC);
TextArea misc = new TextArea(miscParam); TextArea misc = new TextArea(miscParam);
misc.setCols(60); misc.setCols(60);
misc.setRows(18); misc.setRows(18);

View File

@ -97,9 +97,5 @@ private ItemSelectionModel m_itemModel;
publication.save(); publication.save();
} }
if (m_step != null) {
m_step.maybeForwardToNextStep(fse.getPageState());
}
} }
} }

View File

@ -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);
}
}

View File

@ -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());
}
}
}