Fehlerkorrekturen für verschiedene Assoziationen, da CCM nicht mit ContentItems als components klar kommt.
git-svn-id: https://svn.libreccm.org/ccm/trunk@785 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
016617c60c
commit
0bd2770fe1
|
|
@ -1952,7 +1952,7 @@ public class DaBInImporter extends Program {
|
|||
String.format("kontakt-%s", personEn.getName()));
|
||||
contactEn.setTitle(String.format("Kontakt %s",
|
||||
personEn.getTitle()));
|
||||
contactEn.setPerson(personDe, "commonContact");
|
||||
contactEn.setPerson(personEn, "commonContact");
|
||||
String homepage = null;
|
||||
while (contactData.hasMoreTokens()) {
|
||||
String token;
|
||||
|
|
@ -2983,8 +2983,12 @@ public class DaBInImporter extends Program {
|
|||
workingPaper.setLifecycle(createLifecycle(publicationsLifecycle));
|
||||
workingPaper.setContentSection(publicationsSection);
|
||||
|
||||
if (workingPaperDe != null) {
|
||||
workingPaperDe.setContentSection(publicationsSection);
|
||||
}
|
||||
if (workingPaperEn != null) {
|
||||
workingPaperEn.setContentSection(publicationsSection);
|
||||
}
|
||||
|
||||
workingPaperMap.put(workingPaperData.getDabinId(), workingPaper);
|
||||
insertIntoAZFolder(workingPaper, publicationsAlpha);
|
||||
|
|
|
|||
|
|
@ -207,7 +207,10 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
|||
+ "found for '%s' for language '%s' Using key.",
|
||||
m_contactCollection.getContactType(),
|
||||
lang));
|
||||
return m_contactCollection.getContactType();
|
||||
String contactType =
|
||||
m_contactCollection.getContactType();
|
||||
m_contacttypes.close();
|
||||
return contactType;
|
||||
} else {
|
||||
s_log.debug(String.format(
|
||||
"Human readable contact type is: \"%s\"...",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.categorization;
|
||||
|
||||
import com.arsdigita.kernel.ACSObject;
|
||||
|
|
@ -121,7 +120,8 @@ public class CategoryLocalizationCollection extends ACSObjectCollection {
|
|||
if (!m_dataCollection.isEmpty() && locale != "") {
|
||||
|
||||
// First check, if we are already at the right position. This will speed up repeated access for the same locale
|
||||
if(this.getPosition() > 0 && this.getCategoryLocalization().getLocale().equals(locale)) {
|
||||
if (this.getPosition() > 0 && this.getCategoryLocalization().
|
||||
getLocale().equals(locale)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,13 +26,36 @@ import com.arsdigita.cms.ContentPage;
|
|||
object type Expertise extends Publication {
|
||||
|
||||
String[0..1] place = ct_expertise.place VARCHAR(256);
|
||||
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;
|
||||
component GenericOrganizationalUnit[0..1] orderer = join ct_expertise.orderer_id
|
||||
to cms_organizationalunits.organizationalunit_id;
|
||||
|
||||
reference key (ct_expertise.expertise_id);
|
||||
|
||||
}
|
||||
|
||||
association {
|
||||
Expertise[0..n] expertise = join cms_organizationalunits.organizationalunit_id
|
||||
to ct_expertise_organization_map.organization_id,
|
||||
join ct_expertise_organization_map.experise_id
|
||||
to ct_expertise.expertise_id;
|
||||
|
||||
GenericOrganizationalUnit[0..n] organization = join ct_expertise.expertise_id
|
||||
to ct_expertise_organization_map.experise_id,
|
||||
join ct_expertise_organization_map.organization_id
|
||||
to cms_organizationalunits.organizationalunit_id;
|
||||
|
||||
Integer[0..1] orgaOrder = ct_expertise_organization_map.orga_order INTEGER;
|
||||
}
|
||||
|
||||
association {
|
||||
Expertise[0..n] orderedExpertise = join cms_organizationalunits.organizationalunit_id
|
||||
to ct_expertise_orderer_map.orderer_id,
|
||||
join ct_expertise_orderer_map.experise_id
|
||||
to ct_expertise.expertise_id;
|
||||
|
||||
GenericOrganizationalUnit[0..n] orderer = join ct_expertise.expertise_id
|
||||
to ct_expertise_orderer_map.experise_id,
|
||||
join ct_expertise_orderer_map.orderer_id
|
||||
to cms_organizationalunits.organizationalunit_id;
|
||||
|
||||
Integer[0..1] ordererOrder = ct_expertise_orderer_map.orderer_order INTEGER;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,13 +26,25 @@ import com.arsdigita.cms.ContentPage;
|
|||
object type InternetArticle extends Publication {
|
||||
|
||||
String[0..1] place = ct_internet_article.place VARCHAR(256);
|
||||
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);
|
||||
String[0..1] issn = ct_internet_article.issn VARCHAR(9);
|
||||
Date[0..1] publicationDate = ct_internet_article.publicationDate DATE;
|
||||
|
||||
reference key (ct_internet_article.internet_article_Id);
|
||||
reference key (ct_internet_article.internet_article_id);
|
||||
}
|
||||
|
||||
association {
|
||||
InternetArticle[0..n] internetArticle = join cms_organizationalunits.organizationalunit_id
|
||||
to ct_internet_article_organization_map.organization_id,
|
||||
join ct_internet_article_organization_map.internet_article_id
|
||||
to ct_internet_article.internet_article_id;
|
||||
|
||||
GenericOrganizationalUnit[0..n] organization = join ct_internet_article.internet_article_id
|
||||
to ct_internet_article_organization_map.internet_article_id,
|
||||
join ct_internet_article_organization_map.organization_id
|
||||
to cms_organizationalunits.organizationalunit_id;
|
||||
|
||||
Integer[0..1] orgaOrder = ct_internet_article_organization_map.orga_order INTEGER;
|
||||
}
|
||||
|
|
@ -25,8 +25,6 @@ import com.arsdigita.cms.ContentPage;
|
|||
// PDL definition for proceedings
|
||||
object type Proceedings extends PublicationWithPublisher {
|
||||
|
||||
component GenericOrganizationalUnit[0..1] organizerOfConference = join ct_proceedings.organizer_id
|
||||
to cms_organizationalunits.organizationalunit_id;
|
||||
String[0..1] nameOfConference = ct_proceedings.nameOfConference;
|
||||
String[0..1] placeOfConference = ct_proceedings.place_of_conference;
|
||||
Date[0..1] dateFromOfConference = ct_proceedings.date_from_of_conference DATE;
|
||||
|
|
@ -35,6 +33,20 @@ object type Proceedings extends PublicationWithPublisher {
|
|||
reference key (ct_proceedings.proceedings_id);
|
||||
}
|
||||
|
||||
association {
|
||||
Proceedings[0..n] proceedingOfConference = join cms_organizationalunits.organizationalunit_id
|
||||
to ct_proceedings_organizer_map.organizer_id,
|
||||
join ct_proceedings_organizer_map.proceeding_id
|
||||
to ct_proceedings.proceedings_id;
|
||||
|
||||
GenericOrganizationalUnit[0..n] organizerOfConference = join ct_proceedings.proceedings_id
|
||||
to ct_proceedings_organizer_map.proceeding_id,
|
||||
join ct_proceedings_organizer_map.organizer_id
|
||||
to cms_organizationalunits.organizationalunit_id;
|
||||
|
||||
Integer[0..1] organizerOrder = ct_proceedings_organizer_map.organizer_order INTEGER;
|
||||
}
|
||||
|
||||
association {
|
||||
|
||||
Proceedings[0..n] proceedings = join ct_inproceedings.inproceedings_id
|
||||
|
|
|
|||
|
|
@ -30,10 +30,21 @@ object type PublicationWithPublisher extends Publication {
|
|||
Integer[0..1] numberOfVolumes = ct_publication_with_publisher.number_of_volumes INTEGER;
|
||||
Integer[0..1] numberOfPages = ct_publication_with_publisher._number_of_pages INTEGER;
|
||||
String[0..1] edition = ct_publication_with_publisher.edition VARCHAR(256);
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
association {
|
||||
PublicationWithPublisher[0..n] publication = join ct_publisher.publisher_id
|
||||
to ct_publication_with_publisher_publisher_map.publisher_id,
|
||||
join ct_publication_with_publisher_publisher_map.publication_id
|
||||
to ct_publication_with_publisher.publication_with_publisher_id;
|
||||
|
||||
Publisher[0..n] publisher = join ct_publication_with_publisher.publication_with_publisher_id
|
||||
to ct_publication_with_publisher_publisher_map.publication_id,
|
||||
join ct_publication_with_publisher_publisher_map.publisher_id
|
||||
to ct_publisher.publisher_id;
|
||||
|
||||
Integer[0..1] publisherOrder = ct_publication_with_publisher_publisher_map.publisher_order INTEGER;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,16 +20,28 @@
|
|||
|
||||
model com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.*;
|
||||
|
||||
//PDL definition for an unpublished publication (grey literature)
|
||||
object type UnPublished extends Publication {
|
||||
|
||||
String[0..1] place = ct_unpublished.place VARCHAR(256);
|
||||
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;
|
||||
|
||||
reference key (ct_unpublished.unpublished_id);
|
||||
}
|
||||
|
||||
association {
|
||||
UnPublished[0..n] unPublished = join cms_organizationalunits.organizationalunit_id
|
||||
to ct_unpublished_organization_map.organization_id,
|
||||
join ct_unpublished_organization_map.unpublished_id
|
||||
to ct_unpublished.unpublished_id;
|
||||
|
||||
GenericOrganizationalUnit[0..n] organization = join ct_unpublished.unpublished_id
|
||||
to ct_unpublished_organization_map.unpublished_id,
|
||||
join ct_unpublished_organization_map.organization_id
|
||||
to cms_organizationalunits.organizationalunit_id;
|
||||
|
||||
Integer[0..1] orgaOrder = ct_unpublished_organization_map.orga_order INTEGER;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xrd:adapters
|
||||
xmlns:xrd="http://xmlns.redhat.com/schemas/waf/xml-renderer-rules"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd">
|
||||
|
||||
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator" >
|
||||
|
||||
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.Expertise"
|
||||
extends="com.arsdigita.cms.contenttypes.PublicationWithPublisher">
|
||||
|
||||
<xrd:associations rule="include">
|
||||
<xrd:property name="/object/organization"/>
|
||||
<xrd:property name="/object/orderer"/>
|
||||
</xrd:associations>
|
||||
|
||||
</xrd:adapter>
|
||||
|
||||
</xrd:context>
|
||||
|
||||
</xrd:adapters>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xrd:adapters
|
||||
xmlns:xrd="http://xmlns.redhat.com/schemas/waf/xml-renderer-rules"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd">
|
||||
|
||||
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator" >
|
||||
|
||||
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.Expertise"
|
||||
extends="com.arsdigita.cms.contenttypes.PublicationWithPublisher">
|
||||
|
||||
<xrd:associations rule="include">
|
||||
<xrd:property name="/object/organization"/>
|
||||
</xrd:associations>
|
||||
|
||||
</xrd:adapter>
|
||||
|
||||
</xrd:context>
|
||||
|
||||
</xrd:adapters>
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
<xrd:associations rule="include">
|
||||
<xrd:property name="/object/papers"/>
|
||||
<xrd:property name="/object/organizer"/>
|
||||
</xrd:associations>
|
||||
|
||||
</xrd:adapter>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xrd:adapters
|
||||
xmlns:xrd="http://xmlns.redhat.com/schemas/waf/xml-renderer-rules"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd">
|
||||
|
||||
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator" >
|
||||
|
||||
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.UnPublished"
|
||||
extends="com.arsdigita.cms.contenttypes.PublicationWithPublisher">
|
||||
|
||||
<xrd:associations rule="include">
|
||||
<xrd:property name="/object/organization"/>
|
||||
</xrd:associations>
|
||||
|
||||
</xrd:adapter>
|
||||
|
||||
</xrd:context>
|
||||
|
||||
</xrd:adapters>
|
||||
|
|
@ -20,8 +20,11 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
|
@ -68,20 +71,37 @@ public class Expertise extends Publication {
|
|||
}
|
||||
|
||||
public GenericOrganizationalUnit getOrganization() {
|
||||
DataObject dataObj;
|
||||
DataCollection collection;
|
||||
|
||||
dataObj = (DataObject) get(ORGANIZATION);
|
||||
collection = (DataCollection) get(ORGANIZATION);
|
||||
|
||||
if (dataObj == null) {
|
||||
if (0 == collection.size()) {
|
||||
return null;
|
||||
} else {
|
||||
return new GenericOrganizationalUnit(dataObj);
|
||||
DataObject dobj;
|
||||
|
||||
collection.next();
|
||||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return (GenericOrganizationalUnit) DomainObjectFactory.newInstance(dobj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrganization(GenericOrganizationalUnit orga) {
|
||||
s_log.debug(String.format("Setting organization to %s", orga.toString()));
|
||||
set(ORGANIZATION, orga);
|
||||
public void setOrganization(final GenericOrganizationalUnit orga) {
|
||||
GenericOrganizationalUnit oldOrga;
|
||||
|
||||
oldOrga = getOrganization();
|
||||
if (oldOrga != null) {
|
||||
remove(ORGANIZATION, oldOrga);
|
||||
}
|
||||
|
||||
if (null != orga) {
|
||||
Assert.exists(orga, GenericOrganizationalUnit.class);
|
||||
DataObject link = add(ORGANIZATION, orga);
|
||||
link.set("orgaOrder", 1);
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getNumberOfPages() {
|
||||
|
|
@ -93,18 +113,36 @@ public class Expertise extends Publication {
|
|||
}
|
||||
|
||||
public GenericOrganizationalUnit getOrderer() {
|
||||
DataObject dataObj;
|
||||
DataCollection collection;
|
||||
|
||||
dataObj = (DataObject) get(ORDERER);
|
||||
collection = (DataCollection) get(ORDERER);
|
||||
|
||||
if (dataObj == null) {
|
||||
if (0 == collection.size()) {
|
||||
return null;
|
||||
} else {
|
||||
return new GenericOrganizationalUnit(dataObj);
|
||||
DataObject dobj;
|
||||
|
||||
collection.next();
|
||||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return (GenericOrganizationalUnit) DomainObjectFactory.newInstance(dobj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrderer(GenericOrganizationalUnit orderer) {
|
||||
set(ORDERER, orderer);
|
||||
GenericOrganizationalUnit oldOrga;
|
||||
|
||||
oldOrga = getOrganization();
|
||||
if (oldOrga != null) {
|
||||
remove(ORDERER, oldOrga);
|
||||
}
|
||||
|
||||
if (null != orderer) {
|
||||
Assert.exists(orderer, GenericOrganizationalUnit.class);
|
||||
DataObject link = add(ORDERER, orderer);
|
||||
link.set("ordererOrder", 1);
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,11 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -70,19 +73,38 @@ public class InternetArticle extends Publication {
|
|||
}
|
||||
|
||||
public GenericOrganizationalUnit getOrganization() {
|
||||
DataObject dataObj;
|
||||
DataCollection collection;
|
||||
|
||||
dataObj = (DataObject) get(ORGANIZATION);
|
||||
collection = (DataCollection) get(ORGANIZATION);
|
||||
|
||||
if (dataObj == null) {
|
||||
if (collection.size() == 0) {
|
||||
return null;
|
||||
} else {
|
||||
return new GenericOrganizationalUnit(dataObj);
|
||||
DataObject dobj;
|
||||
|
||||
collection.next();
|
||||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return (GenericOrganizationalUnit) DomainObjectFactory.newInstance(dobj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrganization(GenericOrganizationalUnit orga) {
|
||||
set(ORGANIZATION, orga);
|
||||
GenericOrganizationalUnit oldOrga;
|
||||
|
||||
oldOrga = getOrganization();
|
||||
if(oldOrga != null) {
|
||||
remove(ORGANIZATION, oldOrga);
|
||||
}
|
||||
|
||||
if (orga != null) {
|
||||
Assert.exists(orga, GenericOrganizationalUnit.class);
|
||||
DataObject link = add(ORGANIZATION, orga);
|
||||
link.set("orgaOrder", 1);
|
||||
link.save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
|
|
@ -68,19 +70,38 @@ public class Proceedings extends PublicationWithPublisher {
|
|||
}
|
||||
|
||||
public GenericOrganizationalUnit getOrganizerOfConference() {
|
||||
DataObject dataObj;
|
||||
DataCollection collection;
|
||||
|
||||
dataObj = (DataObject) get(ORGANIZER_OF_CONFERENCE);
|
||||
collection = (DataCollection) get(ORGANIZER_OF_CONFERENCE);
|
||||
|
||||
if (dataObj == null) {
|
||||
if (0 == collection.size()) {
|
||||
return null;
|
||||
} else {
|
||||
return new GenericOrganizationalUnit(dataObj);
|
||||
DataObject dobj;
|
||||
|
||||
collection.next();
|
||||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return (GenericOrganizationalUnit) DomainObjectFactory.newInstance(
|
||||
dobj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrganizerOfConference(GenericOrganizationalUnit organizer) {
|
||||
set(ORGANIZER_OF_CONFERENCE, organizer);
|
||||
GenericOrganizationalUnit oldOrga;
|
||||
|
||||
oldOrga = getOrganizerOfConference();
|
||||
if (oldOrga != null) {
|
||||
remove(ORGANIZER_OF_CONFERENCE, oldOrga);
|
||||
}
|
||||
|
||||
if (null != organizer) {
|
||||
Assert.exists(organizer, GenericOrganizationalUnit.class);
|
||||
DataObject link = add(ORGANIZER_OF_CONFERENCE, organizer);
|
||||
link.set("organizerOrder", 1);
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
|
||||
public String getNameOfConference() {
|
||||
|
|
|
|||
|
|
@ -20,8 +20,11 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
|
@ -137,14 +140,20 @@ public class PublicationWithPublisher extends Publication {
|
|||
* @return The publisher of the publication.
|
||||
*/
|
||||
public Publisher getPublisher() {
|
||||
DataObject dataObj;
|
||||
DataCollection collection;
|
||||
|
||||
dataObj = (DataObject) get(PUBLISHER);
|
||||
collection = (DataCollection) get(PUBLISHER);
|
||||
|
||||
if (dataObj == null) {
|
||||
if (0 == collection.size()) {
|
||||
return null;
|
||||
} else {
|
||||
return new Publisher(dataObj);
|
||||
DataObject dobj;
|
||||
|
||||
collection.next();
|
||||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return (Publisher) DomainObjectFactory.newInstance(dobj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -154,6 +163,18 @@ public class PublicationWithPublisher extends Publication {
|
|||
* @param publisher The publisher of the publication.
|
||||
*/
|
||||
public void setPublisher(Publisher publisher) {
|
||||
set(PUBLISHER, publisher);
|
||||
Publisher oldPublisher;
|
||||
|
||||
oldPublisher = getPublisher();
|
||||
if (oldPublisher != null) {
|
||||
remove(PUBLISHER, oldPublisher);
|
||||
}
|
||||
|
||||
if (null != publisher) {
|
||||
Assert.exists(publisher, Publisher.class);
|
||||
DataObject link = add(PUBLISHER, publisher);
|
||||
link.set("publisherOrder", 1);
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,9 +20,13 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -66,19 +70,39 @@ public abstract class UnPublished extends Publication {
|
|||
}
|
||||
|
||||
public GenericOrganizationalUnit getOrganization() {
|
||||
DataObject dataObj;
|
||||
DataCollection collection;
|
||||
|
||||
dataObj = (DataObject) get(ORGANIZATION);
|
||||
collection = (DataCollection) get(ORGANIZATION);
|
||||
|
||||
if (dataObj == null) {
|
||||
if (0 == collection.size()) {
|
||||
return null;
|
||||
} else {
|
||||
return new GenericOrganizationalUnit(dataObj);
|
||||
DataObject dobj;
|
||||
|
||||
collection.next();
|
||||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return (GenericOrganizationalUnit) DomainObjectFactory.newInstance(
|
||||
dobj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrganization(GenericOrganizationalUnit orga) {
|
||||
set(ORGANIZATION, orga);
|
||||
public void setOrganization(final GenericOrganizationalUnit orga) {
|
||||
GenericOrganizationalUnit oldOrga;
|
||||
|
||||
oldOrga = getOrganization();
|
||||
|
||||
if (oldOrga != null) {
|
||||
remove(ORGANIZATION, oldOrga);
|
||||
}
|
||||
|
||||
if (null != orga) {
|
||||
Assert.exists(orga, GenericOrganizationalUnit.class);
|
||||
DataObject link = add(ORGANIZATION, orga);
|
||||
link.set("orgaOrder", 1);
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
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.PageState;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Expertise;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class ExpertiseOrdererForm
|
||||
extends BasicItemForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener {
|
||||
|
||||
private ItemSearchWidget itemSearch;
|
||||
private final String ITEM_SEARCH = "expertiseOrderer";
|
||||
|
||||
public ExpertiseOrdererForm(final ItemSelectionModel itemModel) {
|
||||
super("ExpertiseOrdererForm", itemModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.orderer")));
|
||||
itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(GenericOrganizationalUnit.class.
|
||||
getName()));
|
||||
add(itemSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final FormSectionEvent fse) throws FormProcessException{
|
||||
PageState state = fse.getPageState();
|
||||
|
||||
setVisible(state, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
Expertise expertise = (Expertise) getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
expertise.setOrderer((GenericOrganizationalUnit) data.get(ITEM_SEARCH));
|
||||
|
||||
init(fse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,202 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.ControlLink;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.Table;
|
||||
import com.arsdigita.bebop.event.TableActionEvent;
|
||||
import com.arsdigita.bebop.event.TableActionListener;
|
||||
import com.arsdigita.bebop.table.TableCellRenderer;
|
||||
import com.arsdigita.bebop.table.TableColumn;
|
||||
import com.arsdigita.bebop.table.TableColumnModel;
|
||||
import com.arsdigita.bebop.table.TableModel;
|
||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Expertise;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class ExpertiseOrdererSheet
|
||||
extends Table
|
||||
implements TableActionListener {
|
||||
|
||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||
private final String TABLE_COL_DEL = "table_col_del";
|
||||
private ItemSelectionModel itemModel;
|
||||
|
||||
public ExpertiseOrdererSheet(final ItemSelectionModel itemModel) {
|
||||
super();
|
||||
|
||||
this.itemModel = itemModel;
|
||||
|
||||
setEmptyView(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.orderer.none")));
|
||||
|
||||
TableColumnModel columnModel = getColumnModel();
|
||||
columnModel.add(new TableColumn(
|
||||
0,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.orderer").localize(),
|
||||
TABLE_COL_EDIT));
|
||||
columnModel.add(new TableColumn(
|
||||
0,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.orderer.remove").localize(),
|
||||
TABLE_COL_DEL));
|
||||
|
||||
setModelBuilder(new ExpertiseOrganizationSheetModelBuilder(itemModel));
|
||||
columnModel.get(0).setCellRenderer(new EditCellRenderer());
|
||||
columnModel.get(1).setCellRenderer(new DeleteCellRenderer());
|
||||
|
||||
addTableActionListener(this);
|
||||
}
|
||||
|
||||
private class ExpertiseOrganizationSheetModelBuilder
|
||||
extends LockableImpl
|
||||
implements TableModelBuilder {
|
||||
|
||||
private ItemSelectionModel itemModel;
|
||||
|
||||
public ExpertiseOrganizationSheetModelBuilder(
|
||||
final ItemSelectionModel itemModel) {
|
||||
this.itemModel = itemModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableModel makeModel(final Table table, final PageState state) {
|
||||
table.getRowSelectionModel().clearSelection(state);
|
||||
Expertise expertise = (Expertise) itemModel.getSelectedObject(state);
|
||||
return new ExpertiseOrganizationSheetModel(table, state, expertise);
|
||||
}
|
||||
}
|
||||
|
||||
private class ExpertiseOrganizationSheetModel implements TableModel {
|
||||
|
||||
private Table table;
|
||||
private GenericOrganizationalUnit orga;
|
||||
private boolean done;
|
||||
|
||||
public ExpertiseOrganizationSheetModel(final Table table,
|
||||
final PageState state,
|
||||
final Expertise expertise) {
|
||||
this.table = table;
|
||||
orga = expertise.getOrderer();
|
||||
if (orga == null) {
|
||||
done = false;
|
||||
} else {
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getColumnCount() {
|
||||
return table.getColumnModel().size();
|
||||
}
|
||||
|
||||
public boolean nextRow() {
|
||||
boolean ret;
|
||||
|
||||
if (done) {
|
||||
ret = true;
|
||||
done = false;
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Object getElementAt(final int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 0:
|
||||
return orga.getTitle();
|
||||
case 1:
|
||||
return PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.orderer.remove").localize();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Object getKeyAt(final int columnIndex) {
|
||||
return orga.getID();
|
||||
}
|
||||
}
|
||||
|
||||
private class EditCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(Table table,
|
||||
PageState state,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
Object key,
|
||||
int row,
|
||||
int column) {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
||||
private class DeleteCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(Table table,
|
||||
PageState state,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
Object key,
|
||||
int row,
|
||||
int col) {
|
||||
com.arsdigita.cms.SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
Expertise expertise = (Expertise) itemModel.getSelectedObject(
|
||||
state);
|
||||
|
||||
boolean canEdit = securityManager.canAccess(
|
||||
state.getRequest(),
|
||||
com.arsdigita.cms.SecurityManager.DELETE_ITEM,
|
||||
expertise);
|
||||
|
||||
if (canEdit) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
link.setConfirmation((String) PublicationGlobalizationUtil.
|
||||
globalize(
|
||||
"publication.ui.expertise.orderer.remove.confirm").
|
||||
localize());
|
||||
return link;
|
||||
} else {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cellSelected(final TableActionEvent event) {
|
||||
PageState state = event.getPageState();
|
||||
|
||||
Expertise expertise = (Expertise) itemModel.getSelectedObject(state);
|
||||
|
||||
TableColumn column = getColumnModel().get(event.getColumn().intValue());
|
||||
|
||||
if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
|
||||
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
|
||||
expertise.setOrganization(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void headSelected(final TableActionEvent event) {
|
||||
//Nothing to do
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class ExpertiseOrdererStep extends SimpleEditStep {
|
||||
|
||||
private String SET_EXPERTISE_ORDERER_STEP = "setExpertiseOrdererStep";
|
||||
|
||||
public ExpertiseOrdererStep(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent) {
|
||||
this(itemModel, parent, null);
|
||||
}
|
||||
|
||||
public ExpertiseOrdererStep(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
String prefix) {
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm setOrdererForm = new ExpertiseOrdererForm(itemModel);
|
||||
add(SET_EXPERTISE_ORDERER_STEP,
|
||||
(String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.setOrderer").localize(),
|
||||
new WorkflowLockedComponentAccess(setOrdererForm, itemModel),
|
||||
setOrdererForm.getSaveCancelSection().getCancelButton());
|
||||
|
||||
ExpertiseOrdererSheet sheet = new ExpertiseOrdererSheet(
|
||||
itemModel);
|
||||
setDisplayComponent(sheet);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
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.PageState;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Expertise;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class ExpertiseOrganizationForm
|
||||
extends BasicItemForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener {
|
||||
|
||||
private ItemSearchWidget itemSearch;
|
||||
private final String ITEM_SEARCH = "expertiseOrganization";
|
||||
|
||||
public ExpertiseOrganizationForm(final ItemSelectionModel itemModel) {
|
||||
super("ExpertiseOrganizationForm", itemModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.organization")));
|
||||
itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(GenericOrganizationalUnit.class.
|
||||
getName()));
|
||||
add(itemSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final FormSectionEvent fse) throws FormProcessException{
|
||||
PageState state = fse.getPageState();
|
||||
|
||||
setVisible(state, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
Expertise expertise = (Expertise) getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
expertise.setOrganization((GenericOrganizationalUnit) data.get(ITEM_SEARCH));
|
||||
|
||||
init(fse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,203 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.ControlLink;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.Table;
|
||||
import com.arsdigita.bebop.event.TableActionEvent;
|
||||
import com.arsdigita.bebop.event.TableActionListener;
|
||||
import com.arsdigita.bebop.table.TableCellRenderer;
|
||||
import com.arsdigita.bebop.table.TableColumn;
|
||||
import com.arsdigita.bebop.table.TableColumnModel;
|
||||
import com.arsdigita.bebop.table.TableModel;
|
||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Expertise;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class ExpertiseOrganizationSheet
|
||||
extends Table
|
||||
implements TableActionListener {
|
||||
|
||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||
private final String TABLE_COL_DEL = "table_col_del";
|
||||
private ItemSelectionModel itemModel;
|
||||
|
||||
public ExpertiseOrganizationSheet(final ItemSelectionModel itemModel) {
|
||||
super();
|
||||
|
||||
this.itemModel = itemModel;
|
||||
|
||||
setEmptyView(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.organization.none")));
|
||||
|
||||
TableColumnModel columnModel = getColumnModel();
|
||||
columnModel.add(new TableColumn(
|
||||
0,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.organization").localize(),
|
||||
TABLE_COL_EDIT));
|
||||
columnModel.add(new TableColumn(
|
||||
0,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.organization.remove").localize(),
|
||||
TABLE_COL_DEL));
|
||||
|
||||
setModelBuilder(new ExpertiseOrganizationSheetModelBuilder(itemModel));
|
||||
columnModel.get(0).setCellRenderer(new EditCellRenderer());
|
||||
columnModel.get(1).setCellRenderer(new DeleteCellRenderer());
|
||||
|
||||
addTableActionListener(this);
|
||||
}
|
||||
|
||||
private class ExpertiseOrganizationSheetModelBuilder
|
||||
extends LockableImpl
|
||||
implements TableModelBuilder {
|
||||
|
||||
private ItemSelectionModel itemModel;
|
||||
|
||||
public ExpertiseOrganizationSheetModelBuilder(
|
||||
final ItemSelectionModel itemModel) {
|
||||
this.itemModel = itemModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableModel makeModel(final Table table, final PageState state) {
|
||||
table.getRowSelectionModel().clearSelection(state);
|
||||
Expertise expertise = (Expertise) itemModel.getSelectedObject(state);
|
||||
return new ExpertiseOrganizationSheetModel(table, state, expertise);
|
||||
}
|
||||
}
|
||||
|
||||
private class ExpertiseOrganizationSheetModel implements TableModel {
|
||||
|
||||
private Table table;
|
||||
private GenericOrganizationalUnit orga;
|
||||
private boolean done;
|
||||
|
||||
public ExpertiseOrganizationSheetModel(final Table table,
|
||||
final PageState state,
|
||||
final Expertise expertise) {
|
||||
this.table = table;
|
||||
orga = expertise.getOrganization();
|
||||
if (orga == null) {
|
||||
done = false;
|
||||
} else {
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getColumnCount() {
|
||||
return table.getColumnModel().size();
|
||||
}
|
||||
|
||||
public boolean nextRow() {
|
||||
boolean ret;
|
||||
|
||||
if (done) {
|
||||
ret = true;
|
||||
done = false;
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Object getElementAt(final int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 0:
|
||||
return orga.getTitle();
|
||||
case 1:
|
||||
return PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.organization.remove").
|
||||
localize();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Object getKeyAt(final int columnIndex) {
|
||||
return orga.getID();
|
||||
}
|
||||
}
|
||||
|
||||
private class EditCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(Table table,
|
||||
PageState state,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
Object key,
|
||||
int row,
|
||||
int column) {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
||||
private class DeleteCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(Table table,
|
||||
PageState state,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
Object key,
|
||||
int row,
|
||||
int col) {
|
||||
com.arsdigita.cms.SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
Expertise expertise = (Expertise) itemModel.getSelectedObject(
|
||||
state);
|
||||
|
||||
boolean canEdit = securityManager.canAccess(
|
||||
state.getRequest(),
|
||||
com.arsdigita.cms.SecurityManager.DELETE_ITEM,
|
||||
expertise);
|
||||
|
||||
if (canEdit) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
link.setConfirmation((String) PublicationGlobalizationUtil.
|
||||
globalize(
|
||||
"publication.ui.expertise.organization.remove.confirm").
|
||||
localize());
|
||||
return link;
|
||||
} else {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cellSelected(final TableActionEvent event) {
|
||||
PageState state = event.getPageState();
|
||||
|
||||
Expertise expertise = (Expertise) itemModel.getSelectedObject(state);
|
||||
|
||||
TableColumn column = getColumnModel().get(event.getColumn().intValue());
|
||||
|
||||
if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
|
||||
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
|
||||
expertise.setOrganization(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void headSelected(final TableActionEvent event) {
|
||||
//Nothing to do
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class ExpertiseOrganizationStep extends SimpleEditStep {
|
||||
|
||||
private String SET_EXPERTISE_ORGANIZATION_STEP =
|
||||
"setExpertiseOrganizationStep";
|
||||
|
||||
public ExpertiseOrganizationStep(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent) {
|
||||
this(itemModel, parent, null);
|
||||
}
|
||||
|
||||
public ExpertiseOrganizationStep(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
String prefix) {
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm setOrgaForm = new ExpertiseOrganizationForm(itemModel);
|
||||
add(SET_EXPERTISE_ORGANIZATION_STEP,
|
||||
(String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.setOrganization").localize(),
|
||||
new WorkflowLockedComponentAccess(setOrgaForm, itemModel),
|
||||
setOrgaForm.getSaveCancelSection().getCancelButton());
|
||||
|
||||
ExpertiseOrganizationSheet sheet = new ExpertiseOrganizationSheet(
|
||||
itemModel);
|
||||
setDisplayComponent(sheet);
|
||||
}
|
||||
}
|
||||
|
|
@ -49,18 +49,10 @@ public class ExpertisePropertiesStep extends PublicationPropertiesStep {
|
|||
"publications.ui.expertise.place"),
|
||||
Expertise.PLACE);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"organization.title"),
|
||||
Expertise.ORGANIZATION);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.number_of_pages"),
|
||||
Expertise.NUMBER_OF_PAGES);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"orderer.title"),
|
||||
Expertise.ORDERER);
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
||||
|
|
@ -90,4 +82,15 @@ public class ExpertisePropertiesStep extends PublicationPropertiesStep {
|
|||
"publications.ui.publication.basic_properties").
|
||||
localize()), basicProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addSteps(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
super.addSteps(itemModel, parent);
|
||||
|
||||
addStep(new ExpertiseOrganizationStep(itemModel, parent),
|
||||
"publications.ui.expertise.setOrganization");
|
||||
addStep(new ExpertiseOrdererStep(itemModel, parent),
|
||||
"publications.ui.expertise.setOrderer");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,10 +47,6 @@ public class ExpertisePropertyForm
|
|||
FormSubmissionListener {
|
||||
|
||||
private ExpertisePropertiesStep m_step;
|
||||
private ItemSearchWidget m_itemSearchOrga;
|
||||
private final String ITEM_SEARCH_ORGA = "organization";
|
||||
private ItemSearchWidget m_itemSearchOrderer;
|
||||
private final String ITEM_SEARCH_ORDERER = "orderer";
|
||||
public static final String ID = "ExpertiseEdit";
|
||||
|
||||
public ExpertisePropertyForm(ItemSelectionModel itemModel) {
|
||||
|
|
@ -74,28 +70,12 @@ public class ExpertisePropertyForm
|
|||
TextField place = new TextField(placeParam);
|
||||
add(place);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.organization").localize()));
|
||||
m_itemSearchOrga = new ItemSearchWidget(ITEM_SEARCH_ORGA,
|
||||
ContentType.
|
||||
findByAssociatedObjectType(
|
||||
GenericOrganizationalUnit.class.getName()));
|
||||
add(m_itemSearchOrga);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.number_of_pages").localize()));
|
||||
ParameterModel numberOfPagesParam =
|
||||
new IntegerParameter(Expertise.NUMBER_OF_PAGES);
|
||||
TextField numberOfPages = new TextField(numberOfPagesParam);
|
||||
add(numberOfPages);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.orderer").localize()));
|
||||
m_itemSearchOrderer = new ItemSearchWidget(ITEM_SEARCH_ORDERER,
|
||||
ContentType.
|
||||
findByAssociatedObjectType(
|
||||
GenericOrganizationalUnit.class.getName()));
|
||||
add(m_itemSearchOrderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -106,9 +86,7 @@ public class ExpertisePropertyForm
|
|||
Expertise expertise = (Expertise) initBasicWidgets(fse);
|
||||
|
||||
data.put(Expertise.PLACE, expertise.getPlace());
|
||||
data.put(ITEM_SEARCH_ORGA, expertise.getOrganization());
|
||||
data.put(Expertise.NUMBER_OF_PAGES, expertise.getNumberOfPages());
|
||||
data.put(ITEM_SEARCH_ORDERER, expertise.getOrderer());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -121,15 +99,10 @@ public class ExpertisePropertyForm
|
|||
if ((expertise != null) && getSaveCancelSection().getSaveButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
expertise.setPlace((String) data.get(Expertise.PLACE));
|
||||
expertise.setOrganization(
|
||||
(GenericOrganizationalUnit) data.get(ITEM_SEARCH_ORGA));
|
||||
expertise.setNumberOfPages(
|
||||
(Integer) data.get(Expertise.NUMBER_OF_PAGES));
|
||||
expertise.setOrderer(
|
||||
(GenericOrganizationalUnit) data.get(ITEM_SEARCH_ORDERER));
|
||||
|
||||
expertise.save();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
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.PageState;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||
import com.arsdigita.cms.contenttypes.InternetArticle;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class InternetArticleOrganizationForm
|
||||
extends BasicItemForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener {
|
||||
|
||||
private ItemSearchWidget itemSearch;
|
||||
private final String ITEM_SEARCH = "internetArticleOrga";
|
||||
|
||||
public InternetArticleOrganizationForm(final ItemSelectionModel itemModel) {
|
||||
super("InternetArticleOrganizationForm", itemModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.select_organization")));
|
||||
itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(GenericOrganizationalUnit.class.
|
||||
getName()));
|
||||
add(itemSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final FormSectionEvent fse) throws FormProcessException {
|
||||
PageState state = fse.getPageState();
|
||||
|
||||
setVisible(state, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
InternetArticle article = (InternetArticle) getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
article.setOrganization((GenericOrganizationalUnit) data.get(ITEM_SEARCH));
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,208 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.ControlLink;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.Table;
|
||||
import com.arsdigita.bebop.event.TableActionEvent;
|
||||
import com.arsdigita.bebop.event.TableActionListener;
|
||||
import com.arsdigita.bebop.table.TableCellRenderer;
|
||||
import com.arsdigita.bebop.table.TableColumn;
|
||||
import com.arsdigita.bebop.table.TableColumnModel;
|
||||
import com.arsdigita.bebop.table.TableModel;
|
||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||
import com.arsdigita.cms.contenttypes.InternetArticle;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class InternetArticleOrganizationSheet
|
||||
extends Table
|
||||
implements TableActionListener {
|
||||
|
||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||
private final String TABLE_COL_DEL = "table_col_del";
|
||||
private ItemSelectionModel itemModel;
|
||||
|
||||
public InternetArticleOrganizationSheet(final ItemSelectionModel itemModel) {
|
||||
super();
|
||||
this.itemModel = itemModel;
|
||||
|
||||
setEmptyView(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.organization.none")));
|
||||
|
||||
TableColumnModel columnModel = getColumnModel();
|
||||
columnModel.add(new TableColumn(
|
||||
0,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.organization").localize(),
|
||||
TABLE_COL_EDIT));
|
||||
columnModel.add(new TableColumn(
|
||||
1,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.organization.remove").localize(),
|
||||
TABLE_COL_DEL));
|
||||
|
||||
setModelBuilder(new InternetArticleOrganizationSheetModelBuilder(
|
||||
itemModel));
|
||||
columnModel.get(0).setCellRenderer(new EditCellRenderer());
|
||||
columnModel.get(1).setCellRenderer(new DeleteCellRenderer());
|
||||
|
||||
addTableActionListener(this);
|
||||
}
|
||||
|
||||
private class InternetArticleOrganizationSheetModelBuilder
|
||||
extends LockableImpl
|
||||
implements TableModelBuilder {
|
||||
|
||||
private ItemSelectionModel itemModel;
|
||||
|
||||
public InternetArticleOrganizationSheetModelBuilder(
|
||||
final ItemSelectionModel itemModel) {
|
||||
this.itemModel = itemModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableModel makeModel(final Table table, final PageState state) {
|
||||
table.getRowSelectionModel().clearSelection(state);
|
||||
InternetArticle article = (InternetArticle) itemModel.
|
||||
getSelectedObject(state);
|
||||
return new InternetArticleOrganizationSheetModel(table,
|
||||
state,
|
||||
article);
|
||||
}
|
||||
}
|
||||
|
||||
private class InternetArticleOrganizationSheetModel
|
||||
implements TableModel {
|
||||
|
||||
private Table table;
|
||||
private GenericOrganizationalUnit orga;
|
||||
private boolean done;
|
||||
|
||||
public InternetArticleOrganizationSheetModel(final Table table,
|
||||
final PageState state,
|
||||
final InternetArticle article) {
|
||||
this.table = table;
|
||||
orga = article.getOrganization();
|
||||
if (orga == null) {
|
||||
done = false;
|
||||
} else {
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getColumnCount() {
|
||||
return table.getColumnModel().size();
|
||||
}
|
||||
|
||||
public boolean nextRow() {
|
||||
boolean ret;
|
||||
|
||||
if (done) {
|
||||
ret = true;
|
||||
done = false;
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Object getElementAt(final int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 0:
|
||||
return orga.getTitle();
|
||||
case 1:
|
||||
return PublicationGlobalizationUtil.globalize(
|
||||
"publication.ui.internetarticle.organization.remove").
|
||||
localize();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Object getKeyAt(final int columnIndex) {
|
||||
return orga.getID();
|
||||
}
|
||||
}
|
||||
|
||||
private class EditCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(Table table,
|
||||
PageState state,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
Object key,
|
||||
int row,
|
||||
int column) {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
||||
private class DeleteCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(Table table,
|
||||
PageState state,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
Object key,
|
||||
int row,
|
||||
int col) {
|
||||
com.arsdigita.cms.SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
InternetArticle article = (InternetArticle) itemModel.
|
||||
getSelectedObject(state);
|
||||
|
||||
boolean canEdit = securityManager.canAccess(
|
||||
state.getRequest(),
|
||||
com.arsdigita.cms.SecurityManager.DELETE_ITEM,
|
||||
article);
|
||||
|
||||
if (canEdit) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
link.setConfirmation((String) PublicationGlobalizationUtil.
|
||||
globalize(
|
||||
"publications.ui.internetarticle.organization.remove.confirm").
|
||||
localize());
|
||||
return link;
|
||||
} else {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cellSelected(final TableActionEvent event) {
|
||||
PageState state = event.getPageState();
|
||||
|
||||
InternetArticle article = (InternetArticle) itemModel.getSelectedObject(
|
||||
state);
|
||||
|
||||
TableColumn column = getColumnModel().get(event.getColumn().intValue());
|
||||
|
||||
if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
|
||||
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
|
||||
article.setOrganization(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void headSelected(TableActionEvent event) {
|
||||
//Nothing to do
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class InternetArticleOrganizationStep extends SimpleEditStep {
|
||||
|
||||
private String SET_INTERNET_ARTICLE_ORGANIZATION_STEP =
|
||||
"setInternetArticleOrganizationStep";
|
||||
|
||||
public InternetArticleOrganizationStep(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent) {
|
||||
this(itemModel, parent, null);
|
||||
}
|
||||
|
||||
public InternetArticleOrganizationStep(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
final String prefix) {
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm setOrgaForm = new InternetArticleOrganizationForm(
|
||||
itemModel);
|
||||
add(SET_INTERNET_ARTICLE_ORGANIZATION_STEP,
|
||||
(String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.setOrganization").localize(),
|
||||
new WorkflowLockedComponentAccess(setOrgaForm, itemModel),
|
||||
setOrgaForm.getSaveCancelSection().getCancelButton());
|
||||
|
||||
InternetArticleOrganizationSheet sheet = new InternetArticleOrganizationSheet(
|
||||
itemModel);
|
||||
setDisplayComponent(sheet);
|
||||
}
|
||||
}
|
||||
|
|
@ -49,10 +49,6 @@ public class InternetArticlePropertiesStep extends PublicationPropertiesStep {
|
|||
"publications.ui.internetarticle.place"),
|
||||
InternetArticle.PLACE);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.organization"),
|
||||
"organization.title");
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.number"),
|
||||
InternetArticle.NUMBER);
|
||||
|
|
@ -103,4 +99,13 @@ public class InternetArticlePropertiesStep extends PublicationPropertiesStep {
|
|||
"publications.ui.publication.basic_properties").localize()),
|
||||
basicProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addSteps(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent) {
|
||||
super.addSteps(itemModel, parent);
|
||||
|
||||
addStep(new InternetArticleOrganizationStep(itemModel, parent),
|
||||
"publications.ui.internetarticle.setOrganization");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,8 +51,6 @@ public class InternetArticlePropertyForm
|
|||
FormSubmissionListener {
|
||||
|
||||
private InternetArticlePropertiesStep m_step;
|
||||
private ItemSearchWidget m_itemSearch;
|
||||
private final String ITEM_SEARCH = "organization";
|
||||
public static final String ID = "InternetArticleEdit";
|
||||
|
||||
public InternetArticlePropertyForm(ItemSelectionModel itemModel) {
|
||||
|
|
@ -77,14 +75,6 @@ public class InternetArticlePropertyForm
|
|||
TextField place = new TextField(placeParam);
|
||||
add(place);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.organization").localize()));
|
||||
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH,
|
||||
ContentType.
|
||||
findByAssociatedObjectType(
|
||||
GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE));
|
||||
add(m_itemSearch);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.number").localize()));
|
||||
ParameterModel numberParam =
|
||||
|
|
@ -135,7 +125,6 @@ public class InternetArticlePropertyForm
|
|||
InternetArticle article = (InternetArticle) initBasicWidgets(fse);
|
||||
|
||||
data.put(InternetArticle.PLACE, article.getPlace());
|
||||
data.put(ITEM_SEARCH, article.getOrganization());
|
||||
data.put(InternetArticle.NUMBER, article.getNumber());
|
||||
data.put(InternetArticle.NUMBER_OF_PAGES, article.getNumberOfPages());
|
||||
data.put(InternetArticle.EDITION, article.getEdition());
|
||||
|
|
@ -154,8 +143,6 @@ public class InternetArticlePropertyForm
|
|||
if ((article != null) && getSaveCancelSection().getSaveButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
article.setPlace((String) data.get(InternetArticle.PLACE));
|
||||
article.setOrganization(
|
||||
(GenericOrganizationalUnit) data.get(ITEM_SEARCH));
|
||||
article.setNumber((String) data.get(InternetArticle.NUMBER));
|
||||
article.setNumberOfPages(
|
||||
(Integer) data.get(InternetArticle.NUMBER_OF_PAGES));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
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.PageState;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||
import com.arsdigita.cms.contenttypes.Proceedings;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class ProceedingsOrganizerForm
|
||||
extends BasicItemForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener {
|
||||
|
||||
private ItemSearchWidget itemSearch;
|
||||
private final String ITEM_SEARCH = "departmentOrga";
|
||||
|
||||
public ProceedingsOrganizerForm(final ItemSelectionModel itemModel) {
|
||||
super("ProceedingsOrganizerForm", itemModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.organizer")));
|
||||
itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(GenericOrganizationalUnit.class.
|
||||
getName()));
|
||||
add(itemSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final FormSectionEvent fse) throws FormProcessException {
|
||||
PageState state = fse.getPageState();
|
||||
|
||||
setVisible(state, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
Proceedings proceedings = (Proceedings) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
proceedings.setOrganizerOfConference((GenericOrganizationalUnit) data.
|
||||
get(ITEM_SEARCH));
|
||||
|
||||
init(fse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.ControlLink;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.Table;
|
||||
import com.arsdigita.bebop.event.TableActionEvent;
|
||||
import com.arsdigita.bebop.event.TableActionListener;
|
||||
import com.arsdigita.bebop.table.TableCellRenderer;
|
||||
import com.arsdigita.bebop.table.TableColumn;
|
||||
import com.arsdigita.bebop.table.TableColumnModel;
|
||||
import com.arsdigita.bebop.table.TableModel;
|
||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||
import com.arsdigita.cms.contenttypes.Proceedings;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class ProceedingsOrganizerSheet
|
||||
extends Table
|
||||
implements TableActionListener {
|
||||
|
||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||
private final String TABLE_COL_DEL = "table_col_del";
|
||||
private ItemSelectionModel itemModel;
|
||||
|
||||
public ProceedingsOrganizerSheet(final ItemSelectionModel itemModel) {
|
||||
super();
|
||||
|
||||
this.itemModel = itemModel;
|
||||
|
||||
setEmptyView(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.organizer.none")));
|
||||
|
||||
TableColumnModel columnModel = getColumnModel();
|
||||
columnModel.add(new TableColumn(
|
||||
0,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.organizer").localize(),
|
||||
TABLE_COL_EDIT));
|
||||
columnModel.add(new TableColumn(
|
||||
1,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.organizer.remove").localize(),
|
||||
TABLE_COL_DEL));
|
||||
|
||||
setModelBuilder(new ProceedingsOrganizerSheetModelBuilder(itemModel));
|
||||
columnModel.get(0).setCellRenderer(new EditCellRenderer());
|
||||
columnModel.get(1).setCellRenderer(new DeleteCellRenderer());
|
||||
|
||||
addTableActionListener(this);
|
||||
}
|
||||
|
||||
private class ProceedingsOrganizerSheetModelBuilder
|
||||
extends LockableImpl
|
||||
implements TableModelBuilder {
|
||||
|
||||
private ItemSelectionModel itemModel;
|
||||
|
||||
public ProceedingsOrganizerSheetModelBuilder(
|
||||
final ItemSelectionModel itemModel) {
|
||||
this.itemModel = itemModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableModel makeModel(final Table table, final PageState state) {
|
||||
table.getRowSelectionModel().clearSelection(state);
|
||||
Proceedings proceedings = (Proceedings) itemModel.getSelectedObject(
|
||||
state);
|
||||
return new ProceedingsOrganizerSheetModel(table, state, proceedings);
|
||||
}
|
||||
}
|
||||
|
||||
private class ProceedingsOrganizerSheetModel implements TableModel {
|
||||
|
||||
private Table table;
|
||||
private GenericOrganizationalUnit organizer;
|
||||
private boolean done;
|
||||
|
||||
public ProceedingsOrganizerSheetModel(final Table table,
|
||||
final PageState state,
|
||||
final Proceedings proceedings) {
|
||||
this.table = table;
|
||||
organizer = proceedings.getOrganizerOfConference();
|
||||
if (organizer == null) {
|
||||
done = false;
|
||||
} else {
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getColumnCount() {
|
||||
return table.getColumnModel().size();
|
||||
}
|
||||
|
||||
public boolean nextRow() {
|
||||
boolean ret;
|
||||
|
||||
if (done) {
|
||||
ret = true;
|
||||
done = false;
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Object getElementAt(final int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 0:
|
||||
return organizer.getTitle();
|
||||
case 1:
|
||||
return PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.organizer.remove").
|
||||
localize();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Object getKeyAt(final int columnIndex) {
|
||||
return organizer.getID();
|
||||
}
|
||||
}
|
||||
|
||||
private class EditCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(Table table,
|
||||
PageState state,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
Object key,
|
||||
int row,
|
||||
int column) {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
||||
private class DeleteCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(Table table,
|
||||
PageState state,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
Object key,
|
||||
int row,
|
||||
int col) {
|
||||
com.arsdigita.cms.SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
Proceedings proceedings = (Proceedings) itemModel.getSelectedObject(
|
||||
state);
|
||||
|
||||
boolean canEdit = securityManager.canAccess(
|
||||
state.getRequest(),
|
||||
com.arsdigita.cms.SecurityManager.DELETE_ITEM,
|
||||
proceedings);
|
||||
|
||||
if (canEdit) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
link.setConfirmation((String) PublicationGlobalizationUtil.
|
||||
globalize(
|
||||
"publications.ui.proceedings.organizer.remove.confirm").
|
||||
localize());
|
||||
return link;
|
||||
} else {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cellSelected(final TableActionEvent event) {
|
||||
PageState state = event.getPageState();
|
||||
|
||||
Proceedings proceedings = (Proceedings) itemModel.getSelectedObject(
|
||||
state);
|
||||
|
||||
TableColumn column = getColumnModel().get(event.getColumn().intValue());
|
||||
|
||||
if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
|
||||
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
|
||||
proceedings.setOrganizerOfConference(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void headSelected(final TableActionEvent event) {
|
||||
//Nothing to do.
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class ProceedingsOrganizerStep extends SimpleEditStep {
|
||||
|
||||
private String SET_PROCEEDINGS_ORGANIZER_STEP = "setProceedingsOrganizerStep";
|
||||
|
||||
public ProceedingsOrganizerStep(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent) {
|
||||
this(itemModel, parent, null);
|
||||
}
|
||||
|
||||
public ProceedingsOrganizerStep(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
final String prefix) {
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm setOrganizerForm = new ProceedingsOrganizerForm(itemModel);
|
||||
add(SET_PROCEEDINGS_ORGANIZER_STEP,
|
||||
(String) PublicationGlobalizationUtil.globalize("publications.ui.proceedings.setOrganizer").localize(),
|
||||
new WorkflowLockedComponentAccess(setOrganizerForm, itemModel),
|
||||
setOrganizerForm.getSaveCancelSection().getCancelButton());
|
||||
|
||||
ProceedingsOrganizerSheet sheet = new ProceedingsOrganizerSheet(
|
||||
itemModel);
|
||||
setDisplayComponent(sheet);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -47,10 +47,6 @@ public class ProceedingsPropertiesStep
|
|||
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) getPublicationPropertySheet(
|
||||
itemModel);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.organizer_of_conference"),
|
||||
"organizerOfConference.title");
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.name_of_conference"),
|
||||
Proceedings.NAME_OF_CONFERENCE);
|
||||
|
|
@ -103,6 +99,9 @@ public class ProceedingsPropertiesStep
|
|||
AuthoringKitWizard parent) {
|
||||
super.addSteps(itemModel, parent);
|
||||
|
||||
addStep(new ProceedingsOrganizerStep(itemModel, parent),
|
||||
"publications.ui.proceedings.organizer");
|
||||
|
||||
addStep(new ProceedingsPapersStep(itemModel, parent),
|
||||
"publications.ui.proceedings.papers");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@ public class ProceedingsPropertyForm
|
|||
FormSubmissionListener {
|
||||
|
||||
private ProceedingsPropertiesStep m_step;
|
||||
private ItemSearchWidget m_itemSearch;
|
||||
private final String ITEM_SEARCH = "organizerOfConference";
|
||||
public static final String ID = "proceedingsEdit";
|
||||
|
||||
public ProceedingsPropertyForm(ItemSelectionModel itemModel) {
|
||||
|
|
@ -69,15 +67,6 @@ public class ProceedingsPropertyForm
|
|||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.organizer_of_conference").
|
||||
localize()));
|
||||
m_itemSearch =
|
||||
new ItemSearchWidget(ITEM_SEARCH,
|
||||
ContentType.findByAssociatedObjectType(
|
||||
GenericOrganizationalUnit.class.getName()));
|
||||
add(m_itemSearch);
|
||||
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.name_of_conference")));
|
||||
ParameterModel nameOfConfParam = new StringParameter(
|
||||
|
|
@ -118,7 +107,6 @@ public class ProceedingsPropertyForm
|
|||
FormData data = fse.getFormData();
|
||||
Proceedings proceedings = (Proceedings) super.initBasicWidgets(fse);
|
||||
|
||||
data.put(ITEM_SEARCH, proceedings.getOrganizerOfConference());
|
||||
data.put(Proceedings.NAME_OF_CONFERENCE,
|
||||
proceedings.getNameOfConference());
|
||||
data.put(Proceedings.PLACE_OF_CONFERENCE,
|
||||
|
|
@ -139,8 +127,6 @@ public class ProceedingsPropertyForm
|
|||
|
||||
if ((proceedings != null) && getSaveCancelSection().getSaveButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
proceedings.setOrganizerOfConference(
|
||||
(GenericOrganizationalUnit) data.get(ITEM_SEARCH));
|
||||
proceedings.setNameOfConference((String) data.get(
|
||||
Proceedings.NAME_OF_CONFERENCE));
|
||||
proceedings.setPlaceOfConference((String) data.get(
|
||||
|
|
|
|||
|
|
@ -273,3 +273,28 @@ publications.ui.inProceedings.proceedings.confirm_remove=Do really want to remov
|
|||
publications.ui.series.name=Name (URL)
|
||||
publications.ui.authors.edit_assoc=Edit association
|
||||
publications.ui.series.editship.edit=Edit edithship
|
||||
publications.ui.unpublished.organization.none=No organization associated
|
||||
publications.ui.unpublished.organization.remove=Remove association
|
||||
publications.ui.unpublished.organization.confirm_remove=Are you sure to remove the association between the selected publication and the organization?
|
||||
publications.ui.with_publisher.publisher.none=No publisher associated
|
||||
publications.ui.with_publisher.publisher.remove=Remove publisher
|
||||
publications.ui.with_publisher.publisher.remove.confirm=Are you sure to remove this publisher association?
|
||||
publications.ui.with_publisher.setPublisher=Set publisher
|
||||
publications.ui.expertise.organization.none=No organization associated
|
||||
publications.ui.expertise.organization.remove=Remove
|
||||
publication.ui.expertise.organization.remove.confirm=Do you really want to remove this association?
|
||||
publication.ui.expertise.orderer.remove.confirm=Do you really want to remove this association?
|
||||
publications.ui.expertise.orderer.remove=Remove
|
||||
publications.ui.expertise.orderer.none=No orderer asssociated
|
||||
publications.ui.expertise.setOrganization=Set organization
|
||||
publications.ui.expertise.setOrderer=Set orderer
|
||||
publications.ui.proceedings.organizer=Organizer of conference
|
||||
publications.ui.proceedings.organizer.none=No organizer associated
|
||||
publications.ui.proceedings.organizer.remove=Remove
|
||||
publications.ui.proceedings.organizer.remove.confirm=Do you really want to remove this association?
|
||||
publications.ui.proceedings.setOrganizer=Set organizer of conference
|
||||
publications.ui.unpublished.setOrganization=Set organization
|
||||
publications.ui.internetarticle.setOrganization=Set organization
|
||||
publications.ui.internetarticle.organization.none=No organization associated
|
||||
publications.ui.internetarticle.select_organization=Select organization
|
||||
publication.ui.internetarticle.organization.remove=Remove
|
||||
|
|
|
|||
|
|
@ -272,3 +272,28 @@ publications.ui.inProceedings.proceedings.confirm_remove=Wollen Sie diese Verkn\
|
|||
publications.ui.series.name=Name (URL)
|
||||
publications.ui.authors.edit_assoc=Verkn\u00fcpfung bearbeiten
|
||||
publications.ui.series.editship.edit=Herausgeberschaft bearbeiten
|
||||
publications.ui.unpublished.organization.none=Keine Organisation zugewiesen
|
||||
publications.ui.unpublished.organization.remove=Verkn\u00fcpfung entfernen
|
||||
publications.ui.unpublished.organization.confirm_remove=Verkn\u00fcpfung der ausgew\u00e4hlten Publikation mit der Organisation wirklich entfernen?
|
||||
publications.ui.with_publisher.publisher.none=Kein Verlag zugewiesen
|
||||
publications.ui.with_publisher.publisher.remove=Verlag entfernen
|
||||
publications.ui.with_publisher.publisher.remove.confirm=Zuordnung zum Verlag wirklich entfernen?
|
||||
publications.ui.with_publisher.setPublisher=Verlag zuordnen
|
||||
publications.ui.expertise.organization.none=Keine Organisation zugewiesen
|
||||
publications.ui.expertise.organization.remove=Entfernen
|
||||
publication.ui.expertise.organization.remove.confirm=Wollen Sie diese Verkn\u00fcpfung wirklich entfernen?
|
||||
publication.ui.expertise.orderer.remove.confirm=Wollen Sie diese Verkn\u00fcpfung wirklich entfernen?
|
||||
publications.ui.expertise.orderer.remove=Entfernen
|
||||
publications.ui.expertise.orderer.none=Kein Auftraggeber zugewiesen
|
||||
publications.ui.expertise.setOrganization=Organisation zuweisen
|
||||
publications.ui.expertise.setOrderer=Auftraggeber zuweisen
|
||||
publications.ui.proceedings.organizer=Veranstalter der Konferenz
|
||||
publications.ui.proceedings.organizer.none=Kein Veranstalter zugewiesen
|
||||
publications.ui.proceedings.organizer.remove=Entfernen
|
||||
publications.ui.proceedings.organizer.remove.confirm=Wollen Sie diese Verkn\u00fcpfung wirklich entfernen?
|
||||
publications.ui.proceedings.setOrganizer=Veranstalter der Konferenz zuweisen
|
||||
publications.ui.unpublished.setOrganization=Organisation zuweisen
|
||||
publications.ui.internetarticle.setOrganization=Organisation zuweisen
|
||||
publications.ui.internetarticle.organization.none=Keine Organisation zugewiesen
|
||||
publications.ui.internetarticle.select_organization=Organisation ausw\u00e4hlen
|
||||
publication.ui.internetarticle.organization.remove=Entfernen
|
||||
|
|
|
|||
|
|
@ -67,10 +67,6 @@ public class PublicationWithPublisherPropertiesStep
|
|||
"publications.ui.with_publisher.edition"),
|
||||
PublicationWithPublisher.EDITION);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.with_publisher.publisher"),
|
||||
"publisher.title");
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
||||
|
|
@ -102,4 +98,13 @@ public class PublicationWithPublisherPropertiesStep
|
|||
"publications.ui.publication.basic_properties").
|
||||
localize()), basicProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addSteps(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent) {
|
||||
super.addSteps(itemModel, parent);
|
||||
|
||||
addStep(new PublicationWithPublisherSetPublisherStep(itemModel, parent),
|
||||
"publications.ui.with_publisher.publisher");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,15 +71,6 @@ public class PublicationWithPublisherPropertyForm
|
|||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.with_publisher.publisher").localize()));
|
||||
m_itemSearch =
|
||||
new ItemSearchWidget(
|
||||
ITEM_SEARCH,
|
||||
ContentType.findByAssociatedObjectType(
|
||||
Publisher.class.getName()));
|
||||
add(m_itemSearch);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.with_publisher.isbn").localize()));
|
||||
ParameterModel isbnParam = new StringParameter(
|
||||
|
|
@ -131,7 +122,6 @@ public class PublicationWithPublisherPropertyForm
|
|||
(PublicationWithPublisher) super.
|
||||
initBasicWidgets(fse);
|
||||
|
||||
data.put(ITEM_SEARCH, publication.getPublisher());
|
||||
data.put(PublicationWithPublisher.ISBN, publication.getISBN());
|
||||
data.put(PublicationWithPublisher.VOLUME, publication.getVolume());
|
||||
data.put(PublicationWithPublisher.NUMBER_OF_VOLUMES,
|
||||
|
|
@ -153,7 +143,6 @@ public class PublicationWithPublisherPropertyForm
|
|||
|
||||
if ((publication != null) && getSaveCancelSection().getSaveButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
publication.setPublisher((Publisher) data.get(ITEM_SEARCH));
|
||||
publication.setISBN((String) data.get(PublicationWithPublisher.ISBN));
|
||||
|
||||
publication.setVolume((Integer) data.get(
|
||||
|
|
|
|||
|
|
@ -0,0 +1,67 @@
|
|||
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.PageState;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.PublicationWithPublisher;
|
||||
import com.arsdigita.cms.contenttypes.Publisher;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class PublicationWithPublisherSetPublisherForm
|
||||
extends BasicItemForm
|
||||
implements FormInitListener,
|
||||
FormProcessListener {
|
||||
|
||||
private ItemSearchWidget itemSearch;
|
||||
private final String ITEM_SEARCH = "setPublisher";
|
||||
|
||||
public PublicationWithPublisherSetPublisherForm(
|
||||
final ItemSelectionModel itemModel) {
|
||||
super("PublicationWithPublisherSetPublisher", itemModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.with_publisher.publisher").localize()));
|
||||
itemSearch =
|
||||
new ItemSearchWidget(
|
||||
ITEM_SEARCH,
|
||||
ContentType.findByAssociatedObjectType(
|
||||
Publisher.class.getName()));
|
||||
add(itemSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final FormSectionEvent fse) throws FormProcessException {
|
||||
PageState state = fse.getPageState();
|
||||
|
||||
setVisible(state, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
PublicationWithPublisher publication = (PublicationWithPublisher) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
publication.setPublisher((Publisher) data.get(ITEM_SEARCH));
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,209 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.ControlLink;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.Table;
|
||||
import com.arsdigita.bebop.event.TableActionEvent;
|
||||
import com.arsdigita.bebop.event.TableActionListener;
|
||||
import com.arsdigita.bebop.table.TableCellRenderer;
|
||||
import com.arsdigita.bebop.table.TableColumn;
|
||||
import com.arsdigita.bebop.table.TableColumnModel;
|
||||
import com.arsdigita.bebop.table.TableModel;
|
||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.PublicationWithPublisher;
|
||||
import com.arsdigita.cms.contenttypes.Publisher;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class PublicationWithPublisherSetPublisherSheet
|
||||
extends Table
|
||||
implements TableActionListener {
|
||||
|
||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||
private final String TABLE_COL_DEL = "table_col_del";
|
||||
private ItemSelectionModel itemModel;
|
||||
|
||||
public PublicationWithPublisherSetPublisherSheet(
|
||||
final ItemSelectionModel itemModel) {
|
||||
super();
|
||||
this.itemModel = itemModel;
|
||||
|
||||
setEmptyView(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.with_publisher.publisher.none")));
|
||||
|
||||
TableColumnModel columnModel = getColumnModel();
|
||||
columnModel.add(new TableColumn(
|
||||
0,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.with_publisher.publisher").localize(),
|
||||
TABLE_COL_EDIT));
|
||||
columnModel.add(new TableColumn(
|
||||
1,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.with_publisher.publisher.remove").localize(),
|
||||
TABLE_COL_EDIT));
|
||||
|
||||
setModelBuilder(new PublicationWithPublisherSetPublisherSheetModelBuilder(
|
||||
itemModel));
|
||||
columnModel.get(0).setCellRenderer(new EditCellRenderer());
|
||||
columnModel.get(1).setCellRenderer((new DeleteCellRenderer()));
|
||||
|
||||
addTableActionListener(this);
|
||||
}
|
||||
|
||||
private class PublicationWithPublisherSetPublisherSheetModelBuilder
|
||||
extends LockableImpl
|
||||
implements TableModelBuilder {
|
||||
|
||||
private ItemSelectionModel itemModel;
|
||||
|
||||
public PublicationWithPublisherSetPublisherSheetModelBuilder(
|
||||
final ItemSelectionModel itemModel) {
|
||||
this.itemModel = itemModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableModel makeModel(final Table table, final PageState state) {
|
||||
table.getRowSelectionModel().clearSelection(state);
|
||||
PublicationWithPublisher publication = (PublicationWithPublisher) itemModel.
|
||||
getSelectedObject(state);
|
||||
return new PublicationWithPublisherSetPublisherSheetModel(table,
|
||||
state,
|
||||
publication);
|
||||
}
|
||||
}
|
||||
|
||||
private class PublicationWithPublisherSetPublisherSheetModel
|
||||
implements TableModel {
|
||||
|
||||
private Table table;
|
||||
private Publisher publisher;
|
||||
private boolean m_done;
|
||||
|
||||
public PublicationWithPublisherSetPublisherSheetModel(final Table table,
|
||||
final PageState state,
|
||||
final PublicationWithPublisher publication) {
|
||||
this.table = table;
|
||||
publisher = publication.getPublisher();
|
||||
if (publisher == null) {
|
||||
m_done = false;
|
||||
} else {
|
||||
m_done = true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getColumnCount() {
|
||||
return table.getColumnModel().size();
|
||||
}
|
||||
|
||||
public boolean nextRow() {
|
||||
boolean ret;
|
||||
|
||||
if (m_done) {
|
||||
ret = true;
|
||||
m_done = false;
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Object getElementAt(final int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 0:
|
||||
return publisher.getTitle();
|
||||
case 1:
|
||||
return PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.with_publisher.publisher.remove").
|
||||
localize();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Object getKeyAt(final int columnIndex) {
|
||||
return publisher.getID();
|
||||
}
|
||||
}
|
||||
|
||||
private class EditCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(Table table,
|
||||
PageState state,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
Object key,
|
||||
int row,
|
||||
int column) {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
||||
private class DeleteCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(Table table,
|
||||
PageState state,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
Object key,
|
||||
int row,
|
||||
int col) {
|
||||
com.arsdigita.cms.SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
PublicationWithPublisher publication = (PublicationWithPublisher) itemModel.
|
||||
getSelectedObject(
|
||||
state);
|
||||
|
||||
boolean canEdit = securityManager.canAccess(
|
||||
state.getRequest(),
|
||||
com.arsdigita.cms.SecurityManager.DELETE_ITEM,
|
||||
publication);
|
||||
|
||||
if (canEdit) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
link.setConfirmation((String) PublicationGlobalizationUtil.
|
||||
globalize(
|
||||
"publications.ui.with_publisher.publisher.remove.confirm").
|
||||
localize());
|
||||
return link;
|
||||
} else {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void cellSelected(final TableActionEvent event) {
|
||||
PageState state = event.getPageState();
|
||||
|
||||
PublicationWithPublisher publication = (PublicationWithPublisher) itemModel.getSelectedObject(state);
|
||||
|
||||
TableColumn column = getColumnModel().get(event.getColumn().intValue());
|
||||
|
||||
if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
|
||||
|
||||
} else if(column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
|
||||
publication.setPublisher(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void headSelected(final TableActionEvent event) {
|
||||
//Nothing to do
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class PublicationWithPublisherSetPublisherStep extends SimpleEditStep {
|
||||
|
||||
private String SET_PUBLICATION_PUBLISHER_STEP =
|
||||
"setPublicationPublisherStep";
|
||||
|
||||
public PublicationWithPublisherSetPublisherStep(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent) {
|
||||
this(itemModel, parent, null);
|
||||
}
|
||||
|
||||
public PublicationWithPublisherSetPublisherStep(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
final String prefix) {
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm setPublisherForm = new PublicationWithPublisherSetPublisherForm(
|
||||
itemModel);
|
||||
add(SET_PUBLICATION_PUBLISHER_STEP,
|
||||
(String) PublicationGlobalizationUtil.globalize("publications.ui.with_publisher.setPublisher").localize(),
|
||||
new WorkflowLockedComponentAccess(setPublisherForm, itemModel),
|
||||
setPublisherForm.getSaveCancelSection().getCancelButton());
|
||||
|
||||
PublicationWithPublisherSetPublisherSheet sheet = new PublicationWithPublisherSetPublisherSheet(
|
||||
itemModel);
|
||||
setDisplayComponent(sheet);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
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.PageState;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||
import com.arsdigita.cms.contenttypes.UnPublished;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class UnPublishedOrganizationForm
|
||||
extends BasicItemForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener {
|
||||
|
||||
private ItemSearchWidget itemSearch;
|
||||
private final String ITEM_SEARCH = "unPublishedOrga";
|
||||
|
||||
public UnPublishedOrganizationForm(final ItemSelectionModel itemModel) {
|
||||
super("UnPublishedOrganizationForm", itemModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.organization").localize()));
|
||||
itemSearch = new ItemSearchWidget(ITEM_SEARCH,
|
||||
ContentType.findByAssociatedObjectType(
|
||||
GenericOrganizationalUnit.class.getName()));
|
||||
add(itemSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final FormSectionEvent fse) throws FormProcessException {
|
||||
PageState state = fse.getPageState();
|
||||
|
||||
setVisible(state, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
UnPublished unPublished = (UnPublished) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
unPublished.setOrganization((GenericOrganizationalUnit) data.get(ITEM_SEARCH));
|
||||
|
||||
init(fse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,202 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.ControlLink;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.Table;
|
||||
import com.arsdigita.bebop.event.TableActionEvent;
|
||||
import com.arsdigita.bebop.event.TableActionListener;
|
||||
import com.arsdigita.bebop.table.TableCellRenderer;
|
||||
import com.arsdigita.bebop.table.TableColumn;
|
||||
import com.arsdigita.bebop.table.TableColumnModel;
|
||||
import com.arsdigita.bebop.table.TableModel;
|
||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.SecurityManager;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||
import com.arsdigita.cms.contenttypes.UnPublished;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class UnPublishedOrganizationSheet
|
||||
extends Table
|
||||
implements TableActionListener {
|
||||
|
||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||
private final String TABLE_COL_DELETE = "table_col_delete";
|
||||
private ItemSelectionModel itemModel;
|
||||
|
||||
public UnPublishedOrganizationSheet(final ItemSelectionModel itemModel) {
|
||||
super();
|
||||
this.itemModel = itemModel;
|
||||
|
||||
setEmptyView(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.organization.none")));
|
||||
|
||||
TableColumnModel columnModel = getColumnModel();
|
||||
columnModel.add(new TableColumn(
|
||||
0,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.organization").localize(),
|
||||
TABLE_COL_EDIT));
|
||||
columnModel.add(new TableColumn(
|
||||
1,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.organization.remove").localize(),
|
||||
TABLE_COL_DELETE));
|
||||
|
||||
setModelBuilder(new UnPublishedOrganizationSheetModelBuilder(itemModel));
|
||||
columnModel.get(0).setCellRenderer(new EditCellRenderer());
|
||||
columnModel.get(1).setCellRenderer(new DeleteCellRenderer());
|
||||
|
||||
addTableActionListener(this);
|
||||
}
|
||||
|
||||
private class UnPublishedOrganizationSheetModelBuilder
|
||||
extends LockableImpl
|
||||
implements TableModelBuilder {
|
||||
|
||||
private ItemSelectionModel itemModel;
|
||||
|
||||
public UnPublishedOrganizationSheetModelBuilder(
|
||||
final ItemSelectionModel itemModel) {
|
||||
this.itemModel = itemModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableModel makeModel(final Table table, final PageState state) {
|
||||
table.getRowSelectionModel().clearSelection(state);
|
||||
UnPublished unPublished = (UnPublished) itemModel.getSelectedObject(
|
||||
state);
|
||||
return new UnPublishedOrganizationSheetModel(table, state,
|
||||
unPublished);
|
||||
}
|
||||
}
|
||||
|
||||
private class UnPublishedOrganizationSheetModel implements TableModel {
|
||||
|
||||
private Table table;
|
||||
private GenericOrganizationalUnit orga;
|
||||
private boolean m_done;
|
||||
|
||||
public UnPublishedOrganizationSheetModel(final Table table,
|
||||
final PageState state,
|
||||
final UnPublished unPublished) {
|
||||
this.table = table;
|
||||
orga = unPublished.getOrganization();
|
||||
if (orga == null) {
|
||||
m_done = false;
|
||||
} else {
|
||||
m_done = true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getColumnCount() {
|
||||
return table.getColumnModel().size();
|
||||
}
|
||||
|
||||
public boolean nextRow() {
|
||||
boolean ret;
|
||||
|
||||
if (m_done) {
|
||||
ret = true;
|
||||
m_done = false;
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Object getElementAt(final int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 0:
|
||||
return orga.getTitle();
|
||||
case 1:
|
||||
return PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.organization.remove").
|
||||
localize();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Object getKeyAt(int columnIndex) {
|
||||
return orga.getID();
|
||||
}
|
||||
}
|
||||
|
||||
private class EditCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(final Table table,
|
||||
final PageState state,
|
||||
final Object value,
|
||||
final boolean isSelected,
|
||||
final Object key,
|
||||
final int row,
|
||||
final int column) {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
||||
private class DeleteCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(final Table table,
|
||||
final PageState state,
|
||||
final Object value,
|
||||
final boolean isSelected,
|
||||
final Object key,
|
||||
final int row,
|
||||
final int column) {
|
||||
SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
UnPublished unPublished = (UnPublished) itemModel.getSelectedObject(
|
||||
state);
|
||||
|
||||
boolean canEdit = securityManager.canAccess(state.getRequest(),
|
||||
SecurityManager.DELETE_ITEM,
|
||||
unPublished);
|
||||
|
||||
if (canEdit) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
link.setConfirmation((String) PublicationGlobalizationUtil.
|
||||
globalize(
|
||||
"publications.ui.unpublished.organization.confirm_remove").
|
||||
localize());
|
||||
return link;
|
||||
} else {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void cellSelected(final TableActionEvent event) {
|
||||
PageState state = event.getPageState();
|
||||
|
||||
UnPublished unPublished = (UnPublished) itemModel.getSelectedObject(
|
||||
state);
|
||||
|
||||
TableColumn column = getColumnModel().get(event.getColumn().intValue());
|
||||
if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
|
||||
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DELETE)) {
|
||||
unPublished.setOrganization(null);
|
||||
}
|
||||
}
|
||||
|
||||
public void headSelected(final TableActionEvent event) {
|
||||
//Nothing to do
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class UnPublishedOrganizationStep extends SimpleEditStep {
|
||||
|
||||
private String SET_UNPUBLISHED_ORGANIZATION_STEP =
|
||||
"setUnPublishedOrganizationStep";
|
||||
|
||||
public UnPublishedOrganizationStep(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent) {
|
||||
this(itemModel, parent, null);
|
||||
}
|
||||
|
||||
public UnPublishedOrganizationStep(final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
String prefix) {
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm setOrgaForm = new UnPublishedOrganizationForm(itemModel);
|
||||
add(SET_UNPUBLISHED_ORGANIZATION_STEP,
|
||||
(String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.setOrganization").localize(),
|
||||
new WorkflowLockedComponentAccess(setOrgaForm, itemModel),
|
||||
setOrgaForm.getSaveCancelSection().getCancelButton());
|
||||
|
||||
UnPublishedOrganizationSheet sheet = new UnPublishedOrganizationSheet(
|
||||
itemModel);
|
||||
setDisplayComponent(sheet);
|
||||
}
|
||||
}
|
||||
|
|
@ -29,7 +29,6 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
|||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
|
|
@ -50,10 +49,6 @@ public class UnPublishedPropertiesStep extends PublicationPropertiesStep {
|
|||
"publications.ui.unpublished.place"),
|
||||
UnPublished.PLACE);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.organization"),
|
||||
"organization.title");
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.number"),
|
||||
UnPublished.NUMBER);
|
||||
|
|
@ -93,4 +88,14 @@ public class UnPublishedPropertiesStep extends PublicationPropertiesStep {
|
|||
"publications.ui.publication.basic_properties").
|
||||
localize()), basicProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addSteps(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
super.addSteps(itemModel, parent);
|
||||
|
||||
addStep(new UnPublishedOrganizationStep(itemModel,
|
||||
parent),
|
||||
"publications.ui.unpublished.organization");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,14 +74,6 @@ public class UnPublishedPropertyForm
|
|||
TextField place = new TextField(placeParam);
|
||||
add(place);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.organization").localize()));
|
||||
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH,
|
||||
ContentType.
|
||||
findByAssociatedObjectType(
|
||||
GenericOrganizationalUnit.class.getName()));
|
||||
add(m_itemSearch);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.number").localize()));
|
||||
ParameterModel numberParam =
|
||||
|
|
@ -105,7 +97,6 @@ public class UnPublishedPropertyForm
|
|||
UnPublished unpublished = (UnPublished) initBasicWidgets(fse);
|
||||
|
||||
data.put(UnPublished.PLACE, unpublished.getPlace());
|
||||
data.put(ITEM_SEARCH, unpublished.getOrganization());
|
||||
data.put(UnPublished.NUMBER, unpublished.getNumber());
|
||||
data.put(UnPublished.NUMBER_OF_PAGES, unpublished.getNumberOfPages());
|
||||
}
|
||||
|
|
@ -120,8 +111,6 @@ public class UnPublishedPropertyForm
|
|||
if ((unpublished != null) && getSaveCancelSection().getSaveButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
unpublished.setPlace((String) data.get(UnPublished.PLACE));
|
||||
unpublished.setOrganization(
|
||||
(GenericOrganizationalUnit) data.get(ITEM_SEARCH));
|
||||
unpublished.setNumber((String) data.get(UnPublished.NUMBER));
|
||||
unpublished.setNumberOfPages(
|
||||
(Integer) data.get(UnPublished.NUMBER_OF_PAGES));
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
|
|
@ -150,7 +151,7 @@ public class SciDepartment extends GenericOrganizationalUnit {
|
|||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return new SciDepartment(dobj);
|
||||
return (SciDepartment) DomainObjectFactory.newInstance(dobj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -190,7 +191,7 @@ public class SciDepartment extends GenericOrganizationalUnit {
|
|||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return new SciOrganization(dobj);
|
||||
return (SciOrganization) DomainObjectFactory.newInstance(dobj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@
|
|||
|
||||
<define:component name="assignedTerms"
|
||||
classname="com.arsdigita.london.navigation.ui.CategoryIndexAssignedTerms"/>
|
||||
</jsp:scriptlet>
|
||||
<show:all/>
|
||||
</define:page>
|
||||
<show:all/>
|
||||
</jsp:root>
|
||||
Loading…
Reference in New Issue