Finished testing of the new publication types for dramatic artsFinished testing of the new publication types for dramatic arts.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2661 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-05-31 14:55:58 +00:00
parent ac7d3b34ab
commit acd0b15c62
25 changed files with 225 additions and 100 deletions

View File

@ -115,38 +115,40 @@ public final class RuntimeConfig extends AbstractConfig {
public final String getJDBCURL() { public final String getJDBCURL() {
//Try to get URL from JNDI //Try to get URL from JNDI
final String url = getJDBCURLfromJNDI(); // final String url = getJDBCURLfromJNDI();
//
if (url == null) { // if (url == null) {
//No JNDI datasource configured, use old behaviour // //No JNDI datasource configured, use old behaviour
return (String) get(m_url); // return (String) get(m_url);
} else { // } else {
//Return URL acquired via JNDI // //Return URL acquired via JNDI
return url; // return url;
} // }
return (String) get(m_url);
} }
private String getJDBCURLfromJNDI() { // private String getJDBCURLfromJNDI() {
final Connection connection; // final Connection connection;
try { // try {
final Context initialContext = new InitialContext(); // final Context initialContext = new InitialContext();
final DataSource dataSource = (DataSource) initialContext.lookup( // final DataSource dataSource = (DataSource) initialContext.lookup(
"java:/comp/env/jdbc/ccm-ds"); // "java:/comp/env/jdbc/ccm-ds");
connection = dataSource.getConnection(); // connection = dataSource.getConnection();
final DatabaseMetaData metaData = connection.getMetaData(); // final DatabaseMetaData metaData = connection.getMetaData();
final String url = metaData.getURL(); // final String url = metaData.getURL();
connection.close(); // connection.close();
return url; // return url;
} catch (NamingException ex) { // } catch (NamingException ex) {
s_log.warn("Failed to find JNDI datasource 'java:/comp/env/jdbc/ccm-ds'. " // s_log.warn("Failed to find JNDI datasource 'java:/comp/env/jdbc/ccm-ds'. "
+ "Falling back to configuration via properties file."); // + "Falling back to configuration via properties file.");
return null; // return null;
} catch (SQLException ex) { // } catch (SQLException ex) {
s_log.warn("Failed to to determine JDBC URL from JNDI datasource 'java:/comp/env/jdbc/ccm-ds'. " // s_log.warn("Failed to to determine JDBC URL from JNDI datasource 'java:/comp/env/jdbc/ccm-ds'. "
+ "Falling back to configuration via properties file."); // + "Falling back to configuration via properties file.");
return null; // return null;
} // }
} // }
/** /**
* Returns the maximum size to be used for the connection pool. * Returns the maximum size to be used for the connection pool.

View File

@ -73,6 +73,30 @@
</listener> </listener>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Apache Pluto
portlet injection code
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!--<servlet>
<servlet-name>ContentItemJSRPortlet</servlet-name>
<servlet-class>
org.apache.pluto.container.driver.PortletServlet
</servlet-class>
<init-param>
<param-name>portlet-name</param-name>
<param-value>ContentItemJSRPortlet</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ContentItemJSRPortlet</servlet-name>
<url-pattern>/PlutoInvoker/ContentItemJSRPortlet</url-pattern>
</servlet-mapping>-->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BASE SERVLET DECLARATIONS SECTION BASE SERVLET DECLARATIONS SECTION
basically requirred by ccm-core basically requirred by ccm-core
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

View File

@ -23,10 +23,12 @@ import com.arsdigita.cms.ContentPage;
object type SciPublicationsMovie extends Publication { object type SciPublicationsMovie extends Publication {
reference key (ct_scipublications_movie.movie_id); String[0..1] directorsStr = ct_scipublications_movies.directorsstr VARCHAR(4096);
reference key (ct_scipublications_movies.movie_id);
} }
object type SciPublicationMovieBundle extends PublicationBundle { object type SciPublicationsMovieBundle extends PublicationBundle {
reference key (ct_scipublications_movie_bundles.bundle_id); reference key (ct_scipublications_movie_bundles.bundle_id);
} }
@ -51,13 +53,13 @@ association {
association { association {
PublicationBundle[0..n] producedMovie = join cms_orgaunit_bundles.bundle_id PublicationBundle[0..n] producedMovie = join cms_orgaunit_bundles.bundle_id
to ct_scipublications_movie_productioncompanies.producationcompany_id, to ct_scipublications_movie_productioncompanies.productioncompany_id,
join ct_scipublications_movie_productioncompanies.movie_id join ct_scipublications_movie_productioncompanies.movie_id
to ct_scipublications_movie_bundles.bundle_id; to ct_scipublications_movie_bundles.bundle_id;
GenericOrganizationalUnitBundle[0..n] productionCompany = join ct_scipublications_movie_bundles.bundle_id GenericOrganizationalUnitBundle[0..n] productionCompany = join ct_scipublications_movie_bundles.bundle_id
to ct_scipublications_movie_productioncompanies.movie_id, to ct_scipublications_movie_productioncompanies.movie_id,
join ct_scipublications_movie_productioncompanies.producationcompany_id join ct_scipublications_movie_productioncompanies.productioncompany_id
to cms_orgaunit_bundles.bundle_id; to cms_orgaunit_bundles.bundle_id;
Integer[0..1] companyOrder = ct_scipublications_movie_productioncompanies.company_order INTEGER; Integer[0..1] companyOrder = ct_scipublications_movie_productioncompanies.company_order INTEGER;

View File

@ -27,7 +27,7 @@ object type SciPublicationsPlay extends PublicationWithPublisher {
reference key (ct_scipublications_plays.play_id); reference key (ct_scipublications_plays.play_id);
} }
object type SciPublicationPlayBundle extends PublicationWithPublisherBundle { object type SciPublicationsPlayBundle extends PublicationWithPublisherBundle {
reference key (ct_scipublications_play_bundles.bundle_id); reference key (ct_scipublications_play_bundles.bundle_id);
} }
@ -36,13 +36,13 @@ object type SciPublicationPlayBundle extends PublicationWithPublisherBundle {
association { association {
PublicationBundle[0..n] producedPlay = join cms_orgaunit_bundles.bundle_id PublicationBundle[0..n] producedPlay = join cms_orgaunit_bundles.bundle_id
to ct_scipublications_play_firstproductiontheatre.theatre_id, to ct_scipublications_play_productiontheatre.theatre_id,
join ct_scipublications_play_firstproductiontheatre.play_id join ct_scipublications_play_productiontheatre.play_id
to ct_scipublications_play_bundles.bundle_id; to ct_scipublications_play_bundles.bundle_id;
GenericOrganizationalUnitBundle[0..n] productionTheater = join ct_scipublications_play_bundles.bundle_id GenericOrganizationalUnitBundle[0..n] productionTheatre = join ct_scipublications_play_bundles.bundle_id
to ct_scipublications_play_firstproductiontheatre.play_id, to ct_scipublications_play_productiontheatre.play_id,
join ct_scipublications_play_firstproductiontheatre.theatre_id join ct_scipublications_play_productiontheatre.theatre_id
to cms_orgaunit_bundles.bundle_id; to cms_orgaunit_bundles.bundle_id;
Integer[0..1] theatreOrder = ct_scipublications_play_productiontheatre.theatre_order INTEGER; Integer[0..1] theatreOrder = ct_scipublications_play_productiontheatre.theatre_order INTEGER;

View File

@ -7,8 +7,7 @@
<ctd:content-type label="SciPublications/Movie" <ctd:content-type label="SciPublications/Movie"
description="Publications for movies" description="Publications for movies"
objectType="com.arsdigita.cms.contenttypes.SciPublicationsMovie" objectType="com.arsdigita.cms.contenttypes.SciPublicationsMovie"
classname="com.arsdigita.cms.contenttypes.SciPublicationsMovie" classname="com.arsdigita.cms.contenttypes.SciPublicationsMovie">
mode="hidden">
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.SciPublicationsMovieCreate"> <ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.SciPublicationsMovieCreate">
@ -17,7 +16,7 @@
labelBundle="com.arsdigita.cms.contenttypes.ui.PublicationResources" labelBundle="com.arsdigita.cms.contenttypes.ui.PublicationResources"
descriptionKey="publications.ui.publication_properties.title.description" descriptionKey="publications.ui.publication_properties.title.description"
descriptionBundle="com.arsdigita.cms.contenttypes.ui.PublicationResources" descriptionBundle="com.arsdigita.cms.contenttypes.ui.PublicationResources"
component="com.arsdigita.cms.contenttypes.ui.PublicationPropertiesStep" component="com.arsdigita.cms.contenttypes.ui.SciPublicationsMoviePropertiesStep"
ordering="1"/> ordering="1"/>
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/> <ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>

View File

@ -7,8 +7,7 @@
<ctd:content-type label="SciPublications/Play" <ctd:content-type label="SciPublications/Play"
description="Publications for plays" description="Publications for plays"
objectType="com.arsdigita.cms.contenttypes.SciPublicationsPlay" objectType="com.arsdigita.cms.contenttypes.SciPublicationsPlay"
classname="com.arsdigita.cms.contenttypes.SciPublicationsPlay" classname="com.arsdigita.cms.contenttypes.SciPublicationsPlay">
mode="hidden">
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.SciPublicationsPlayCreate"> <ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.SciPublicationsPlayCreate">
@ -17,7 +16,7 @@
labelBundle="com.arsdigita.cms.contenttypes.ui.PublicationResources" labelBundle="com.arsdigita.cms.contenttypes.ui.PublicationResources"
descriptionKey="publications.ui.publication_properties.title.description" descriptionKey="publications.ui.publication_properties.title.description"
descriptionBundle="com.arsdigita.cms.contenttypes.ui.PublicationResources" descriptionBundle="com.arsdigita.cms.contenttypes.ui.PublicationResources"
component="com.arsdigita.cms.contenttypes.ui.PublicationPropertiesStep" component="com.arsdigita.cms.contenttypes.ui.SciPublicationsPlayPropertiesStep"
ordering="1"/> ordering="1"/>
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/> <ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>

View File

@ -0,0 +1,18 @@
publications.ui.dramaticarts.movie.productioncompany=Production Company
publications.dramaticarts.ui.movie.director=Director
publications.dramaticarts.ui.movie.director.no_director_selected=No director selected
publications.dramaticarts.ui.movie.production_company.none=No production company assigned
publications.dramaticarts.ui.movie.production_company=Production Company
publications.dramaticarts.ui.movie.production_company.remove=Remove
publications.dramaticarts.ui.movie.production_company.remove.confirm=Are you sure to remove the asssigned production company from this movie?
publications.dramaticarts.ui.movie.director.none=No director assigned
publications.dramaticarts.ui.movie.director.remove=Remove
publications.dramaticarts.ui.movie.director.remove.confirm=Are you sure to remove the director assigned to this movie?
publications.dramaticarts.play.ui.productiontheater=First production theatre
publications.dramaticarts.ui.play.first_production_year=First production year
publications.dramaticarts.ui.play.production_theater.no_theater_selected=No theatre selected
publications.dramaticarts.ui.movie.production_company.no_company_selected=No production company assigned
publications.dramaticarts.ui.play.production_theater.none=No theatre assigned
publications.dramaticarts.ui.play.production_theater.remove=Remove
publications.dramaticarts.ui.play.production_theater.remove.confirm=Are you sure to remove the assigned theatre?

View File

@ -0,0 +1,18 @@
publications.ui.dramaticarts.movie.productioncompany=Produktionsgesellschaft
publications.dramaticarts.ui.movie.director=Regisseur
publications.dramaticarts.ui.movie.director.no_director_selected=Kein Regisseur ausgew\u00e4hlt
publications.dramaticarts.ui.movie.production_company.none=Keine Produktionsgesellschaft zugewiesen
publications.dramaticarts.ui.movie.production_company=Produktionsgesellschaft
publications.dramaticarts.ui.movie.production_company.remove=Entfernen
publications.dramaticarts.ui.movie.production_company.remove.confirm=Sind Sie sicher das die Zuweisung der Produktionsgesellschaft entfernen wollen?
publications.dramaticarts.ui.movie.director.none=Kein Regisseur zugewiesen
publications.dramaticarts.ui.movie.director.remove=Entfernen
publications.dramaticarts.ui.movie.director.remove.confirm=Wollen die den zugewiesenen Regisseur wirklich entfernen?
publications.dramaticarts.play.ui.productiontheater=Erstes Theater
publications.dramaticarts.ui.play.first_production_year=Erstes Jahr der Produktion
publications.dramaticarts.ui.play.production_theater.no_theater_selected=Kein Theater ausgew\u00e4hlt
publications.dramaticarts.ui.movie.production_company.no_company_selected=Keine Gesellschaft zugewiesen
publications.dramaticarts.ui.play.production_theater.none=Kein Theater zugewiesen
publications.dramaticarts.ui.play.production_theater.remove=Entfernen
publications.dramaticarts.ui.play.production_theater.remove.confirm=Sind Sie sicher, dass Sie das zugewiesene Theater entfernen wollen?

View File

@ -80,7 +80,7 @@ public class SciPublicationsMovie extends Publication {
} }
public void setDirector(final GenericPerson director) { public void setDirector(final GenericPerson director) {
getSciPublicationsMovieBundle().addDirector(director); getSciPublicationsMovieBundle().setDirector(director);
} }
public GenericOrganizationalUnit getProductionCompany() { public GenericOrganizationalUnit getProductionCompany() {
@ -146,7 +146,7 @@ public class SciPublicationsMovie extends Publication {
} }
private void addProductionCompany(final GenericOrganizationalUnit company) { private void addProductionCompany(final GenericOrganizationalUnit company) {
getSciPublicationsMovieBundle().addProducationCompany(company); getSciPublicationsMovieBundle().addProductionCompany(company);
} }
private void removeProductionCompany(final GenericOrganizationalUnit company) { private void removeProductionCompany(final GenericOrganizationalUnit company) {

View File

@ -39,13 +39,13 @@ import java.math.BigDecimal;
*/ */
public class SciPublicationsMovieBundle extends PublicationBundle { public class SciPublicationsMovieBundle extends PublicationBundle {
public static final String BASE_BASE_OBJECT_TYPE public static final String BASE_DATA_OBJECT_TYPE
= "com.arsdigita.cms.contenttypes.SciPublicationsMovieBundle"; = "com.arsdigita.cms.contenttypes.SciPublicationsMovieBundle";
public static final String DIRECTOR = "director"; public static final String DIRECTOR = "director";
public static final String DIRECTOR_ORDER = "directorOrder"; public static final String DIRECTOR_ORDER = "directorOrder";
public static final String PRODUCATION_COMPANY public static final String PRODUCTION_COMPANY
= "producationCompany"; = "productionCompany";
public static final String PRODUCATION_COMPANY_ORDER = "companyOrder"; public static final String PRODUCTION_COMPANY_ORDER = "companyOrder";
public SciPublicationsMovieBundle(final ContentItem primary) { public SciPublicationsMovieBundle(final ContentItem primary) {
@ -65,7 +65,7 @@ public class SciPublicationsMovieBundle extends PublicationBundle {
} }
public SciPublicationsMovieBundle(final BigDecimal id) { public SciPublicationsMovieBundle(final BigDecimal id) {
this(new OID(BASE_BASE_OBJECT_TYPE, id)); this(new OID(BASE_DATA_OBJECT_TYPE, id));
} }
public SciPublicationsMovieBundle(final DataObject dataObject) { public SciPublicationsMovieBundle(final DataObject dataObject) {
@ -96,9 +96,9 @@ public class SciPublicationsMovieBundle extends PublicationBundle {
return true; return true;
} else if (PRODUCATION_COMPANY.equals(attribute)) { } else if (PRODUCTION_COMPANY.equals(attribute)) {
final DataCollection companies = (DataCollection) pubBundle.get(PRODUCATION_COMPANY); final DataCollection companies = (DataCollection) pubBundle.get(PRODUCTION_COMPANY);
while (companies.next()) { while (companies.next()) {
createProductionCompanyAssoc(companies); createProductionCompanyAssoc(companies);
@ -107,10 +107,10 @@ public class SciPublicationsMovieBundle extends PublicationBundle {
return true; return true;
} else { } else {
return super.copyProperty(source, null, copier); return super.copyProperty(source, property, copier);
} }
} else { } else {
return super.copyProperty(source, null, copier); return super.copyProperty(source, property, copier);
} }
} }
@ -143,9 +143,9 @@ public class SciPublicationsMovieBundle extends PublicationBundle {
.getLiveVersion(); .getLiveVersion();
if (liveCompany != null) { if (liveCompany != null) {
final DataObject link = add(PRODUCATION_COMPANY, liveCompany); final DataObject link = add(PRODUCTION_COMPANY, liveCompany);
link.set(PRODUCATION_COMPANY_ORDER, companies.get( link.set(PRODUCTION_COMPANY_ORDER, companies.get(
SciPublicationsProductionCompanyCollection.LINK_ORDER)); SciPublicationsProductionCompanyCollection.LINK_ORDER));
link.save(); link.save();
@ -311,7 +311,7 @@ public class SciPublicationsMovieBundle extends PublicationBundle {
} }
public GenericOrganizationalUnitBundle getProductionCompany() { public GenericOrganizationalUnitBundle getProductionCompany() {
final DataCollection collection = (DataCollection) get(PRODUCATION_COMPANY); final DataCollection collection = (DataCollection) get(PRODUCTION_COMPANY);
if (collection.size() == 0) { if (collection.size() == 0) {
return null; return null;
@ -330,15 +330,15 @@ public class SciPublicationsMovieBundle extends PublicationBundle {
final GenericOrganizationalUnitBundle oldCompany = getProductionCompany(); final GenericOrganizationalUnitBundle oldCompany = getProductionCompany();
if (oldCompany != null) { if (oldCompany != null) {
remove(PRODUCATION_COMPANY, oldCompany); remove(PRODUCTION_COMPANY, oldCompany);
} }
if (productionCompany != null) { if (productionCompany != null) {
Assert.exists(productionCompany, GenericOrganizationalUnit.class); Assert.exists(productionCompany, GenericOrganizationalUnit.class);
final DataObject link = add(PRODUCATION_COMPANY, final DataObject link = add(PRODUCTION_COMPANY,
productionCompany.getGenericOrganizationalUnitBundle()); productionCompany.getGenericOrganizationalUnitBundle());
link.set(PRODUCATION_COMPANY_ORDER, Integer.valueOf(1)); link.set(PRODUCTION_COMPANY_ORDER, Integer.valueOf(1));
link.save(); link.save();
} }
} }
@ -346,17 +346,17 @@ public class SciPublicationsMovieBundle extends PublicationBundle {
protected SciPublicationsProductionCompanyCollection getProductionCompanies() { protected SciPublicationsProductionCompanyCollection getProductionCompanies() {
return new SciPublicationsProductionCompanyCollection((DataCollection) get( return new SciPublicationsProductionCompanyCollection((DataCollection) get(
PRODUCATION_COMPANY)); PRODUCTION_COMPANY));
} }
protected void addProducationCompany(final GenericOrganizationalUnit company) { protected void addProductionCompany(final GenericOrganizationalUnit company) {
Assert.exists(company, GenericOrganizationalUnit.class); Assert.exists(company, GenericOrganizationalUnit.class);
final DataObject link = add(PRODUCATION_COMPANY, final DataObject link = add(PRODUCTION_COMPANY,
company.getGenericOrganizationalUnitBundle()); company.getGenericOrganizationalUnitBundle());
link.set(PRODUCATION_COMPANY, Integer.valueOf((int) getProductionCompanies().size())); link.set(PRODUCTION_COMPANY, Integer.valueOf((int) getProductionCompanies().size()));
link.save(); link.save();
} }
@ -365,7 +365,7 @@ public class SciPublicationsMovieBundle extends PublicationBundle {
Assert.exists(company, GenericOrganizationalUnit.class); Assert.exists(company, GenericOrganizationalUnit.class);
remove(PRODUCATION_COMPANY, company.getGenericOrganizationalUnitBundle()); remove(PRODUCTION_COMPANY, company.getGenericOrganizationalUnitBundle());
} }

View File

@ -102,7 +102,7 @@ public class SciPublicationsPlay extends PublicationWithPublisher {
} }
private void addProductionTheater(final GenericOrganizationalUnit theater) { private void addProductionTheater(final GenericOrganizationalUnit theater) {
getSciPublicationsPlayBundle().addProducationTheater(theater); getSciPublicationsPlayBundle().addProductionTheater(theater);
} }
private void removeProductionTheater(final GenericOrganizationalUnit theater) { private void removeProductionTheater(final GenericOrganizationalUnit theater) {

View File

@ -39,14 +39,14 @@ import java.math.BigDecimal;
*/ */
public class SciPublicationsPlayBundle extends PublicationWithPublisherBundle { public class SciPublicationsPlayBundle extends PublicationWithPublisherBundle {
public static final String BASE_BASE_OBJECT_TYPE public static final String BASE_DATA_OBJECT_TYPE
= "com.arsdigita.cms.contenttypes.SciPublicationsPlayBundle"; = "com.arsdigita.cms.contenttypes.SciPublicationsPlayBundle";
public static final String PRODUCTION_THEATER = "productionTheatre"; public static final String PRODUCTION_THEATER = "productionTheatre";
public static final String PRODUCTION_THEATER_ORDER = "theatreOrder"; public static final String PRODUCTION_THEATER_ORDER = "theatreOrder";
public SciPublicationsPlayBundle(final ContentItem primary) { public SciPublicationsPlayBundle(final ContentItem primary) {
super(BASE_BASE_OBJECT_TYPE); super(BASE_DATA_OBJECT_TYPE);
Assert.exists(primary, ContentItem.class); Assert.exists(primary, ContentItem.class);
@ -62,7 +62,7 @@ public class SciPublicationsPlayBundle extends PublicationWithPublisherBundle {
} }
public SciPublicationsPlayBundle(final BigDecimal id) throws DataObjectNotFoundException { public SciPublicationsPlayBundle(final BigDecimal id) throws DataObjectNotFoundException {
this(new OID(BASE_BASE_OBJECT_TYPE, id)); this(new OID(BASE_DATA_OBJECT_TYPE, id));
} }
public SciPublicationsPlayBundle(final DataObject dataObject) { public SciPublicationsPlayBundle(final DataObject dataObject) {
@ -212,7 +212,7 @@ public class SciPublicationsPlayBundle extends PublicationWithPublisherBundle {
} }
protected void addProducationTheater(final GenericOrganizationalUnit theater) { protected void addProductionTheater(final GenericOrganizationalUnit theater) {
Assert.exists(theater, GenericOrganizationalUnit.class); Assert.exists(theater, GenericOrganizationalUnit.class);

View File

@ -77,7 +77,7 @@ public class SciPublicationsProductionCompanyCollection extends DomainCollection
if (currentPos == 0) { if (currentPos == 0) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
String.format("The provided organisation is not a producation company " String.format("The provided organisation is not a production company "
+ "of this movie.")); + "of this movie."));
} }

View File

@ -40,7 +40,7 @@ public class SciPublicationsMovieCreate extends PublicationCreate {
} }
@Override @Override
public PublicationBundle createBundle(final ContentItem primary) { protected PublicationBundle createBundle(final ContentItem primary) {
return new SciPublicationsMovieBundle(primary); return new SciPublicationsMovieBundle(primary);

View File

@ -110,8 +110,8 @@ public class SciPublicationsMovieDirectorSheet
private boolean done; private boolean done;
public SheetModel(final Table table, public SheetModel(final Table table,
final PageState state, final PageState state,
final SciPublicationsMovie movie) { final SciPublicationsMovie movie) {
this.table = table; this.table = table;
director = movie.getDirector(); director = movie.getDirector();
if (director == null) { if (director == null) {
@ -244,22 +244,22 @@ public class SciPublicationsMovieDirectorSheet
} }
} }
@Override @Override
public void cellSelected(final TableActionEvent event) { public void cellSelected(final TableActionEvent event) {
final PageState state = event.getPageState(); final PageState state = event.getPageState();
final SciPublicationsMovie movie = (SciPublicationsMovie) itemModel.getSelectedObject(state); final SciPublicationsMovie movie = (SciPublicationsMovie) itemModel.getSelectedObject(state);
final TableColumn column = getColumnModel().get(event.getColumn().intValue()); final TableColumn column = getColumnModel().get(event.getColumn().intValue());
if (TABLE_COL_EDIT.equals(column.getHeaderKey().toString())) { if (TABLE_COL_EDIT.equals(column.getHeaderKey().toString())) {
//Nothing //Nothing
} else if(TABLE_COL_DEL.equals(column.getHeaderKey().toString())){ } else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) {
movie.setDirector(null); movie.setDirector(null);
} }
} }
@Override @Override
public void headSelected(final TableActionEvent event) { public void headSelected(final TableActionEvent event) {
//Nothing //Nothing

View File

@ -48,7 +48,7 @@ public class SciPublicationsMovieDirectorStep extends SimpleEditStep {
= new SciPublicationsDramaticArtsGlobalisationUtil(); = new SciPublicationsDramaticArtsGlobalisationUtil();
final BasicItemForm setDirectorForm = new SciPublicationsMovieDirectorForm(itemModel); final BasicItemForm setDirectorForm = new SciPublicationsMovieDirectorForm(itemModel);
add(SET_MOVIE_DIRECTOR_STEP, add(SET_MOVIE_DIRECTOR_STEP,
globalisationUtil.globalise("publications.dramaticarts.movie.ui.director"), globalisationUtil.globalise("publications.dramaticarts.ui.movie.director"),
new WorkflowLockedComponentAccess(setDirectorForm, itemModel), new WorkflowLockedComponentAccess(setDirectorForm, itemModel),
setDirectorForm.getSaveCancelSection().getCancelButton()); setDirectorForm.getSaveCancelSection().getCancelButton());

View File

@ -22,6 +22,8 @@ import com.arsdigita.bebop.Page;
import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.PageState;
import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ExtraXMLGenerator; import com.arsdigita.cms.ExtraXMLGenerator;
import com.arsdigita.cms.contenttypes.SciPublicationsMovie;
import com.arsdigita.cms.dispatcher.SimpleXMLGenerator;
import com.arsdigita.xml.Element; import com.arsdigita.xml.Element;
/** /**
@ -37,7 +39,27 @@ public class SciPublicationsMovieExtraXMLGenerator implements ExtraXMLGenerator
public void generateXML(final ContentItem item, public void generateXML(final ContentItem item,
final Element element, final Element element,
final PageState state) { final PageState state) {
if (item instanceof SciPublicationsMovie) {
final SciPublicationsMovie movie = (SciPublicationsMovie) item;
if (movie.getDirector() != null) {
final XmlGenerator generator = new XmlGenerator(movie.getDirector());
generator.setItemElemName("director", "");
generator.setListMode(true);
generator.generateXML(state, element, "");
}
if (movie.getProductionCompany() != null) {
final XmlGenerator generator = new XmlGenerator(movie.getProductionCompany());
generator.setItemElemName("productionCompany", "");
generator.setListMode(true);
generator.generateXML(state, element, "");
}
} else {
throw new IllegalArgumentException(
"This ExtraXMLGenerator can only process item of type SciPublicationsMovie");
}
} }
public void addGlobalStateParams(final Page page) { public void addGlobalStateParams(final Page page) {
@ -49,4 +71,19 @@ public class SciPublicationsMovieExtraXMLGenerator implements ExtraXMLGenerator
this.listMode = listMode; this.listMode = listMode;
} }
private class XmlGenerator extends SimpleXMLGenerator {
private final ContentItem item;
public XmlGenerator(final ContentItem item) {
super();
this.item = item;
}
@Override
protected ContentItem getContentItem(final PageState state) {
return item;
}
}
} }

View File

@ -49,14 +49,14 @@ public class SciPublicationsMovieProductionCompanyStep extends SimpleEditStep {
final BasicItemForm setProductionCompanyForm final BasicItemForm setProductionCompanyForm
= new SciPublicationsMovieProductionCompanyForm(itemModel); = new SciPublicationsMovieProductionCompanyForm(itemModel);
add(SET_PRODUCTION_COMPANY_STEP, add(SET_PRODUCTION_COMPANY_STEP,
globalisationUtil.globalise("publications.ui.dramaticarts.movie.producationcompany"), globalisationUtil.globalise("publications.ui.dramaticarts.movie.productioncompany"),
new WorkflowLockedComponentAccess(setProductionCompanyForm, itemModel), new WorkflowLockedComponentAccess(setProductionCompanyForm, itemModel),
setProductionCompanyForm.getSaveCancelSection().getCancelButton()); setProductionCompanyForm.getSaveCancelSection().getCancelButton());
final SciPublicationsMovieProductionCompanySheet sheet final SciPublicationsMovieProductionCompanySheet sheet
= new SciPublicationsMovieProductionCompanySheet( = new SciPublicationsMovieProductionCompanySheet(
itemModel); itemModel);
setDisplayComponent(this); setDisplayComponent(sheet);
} }
} }

View File

@ -59,7 +59,6 @@ public class SciPublicationsMoviePropertiesStep extends PublicationPropertiesSte
final BasicPageForm editBasicSheet = new SciPublicationsMoviePropertyForm(itemModel, this); final BasicPageForm editBasicSheet = new SciPublicationsMoviePropertyForm(itemModel, this);
final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil = new SciPublicationsDramaticArtsGlobalisationUtil();
basicProperties.add(EDIT_SHEET_NAME, basicProperties.add(EDIT_SHEET_NAME,
PublicationGlobalizationUtil.globalize( PublicationGlobalizationUtil.globalize(
"publications.ui.publication.edit_basic_sheet"), "publications.ui.publication.edit_basic_sheet"),
@ -83,8 +82,8 @@ public class SciPublicationsMoviePropertiesStep extends PublicationPropertiesSte
final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil = new SciPublicationsDramaticArtsGlobalisationUtil(); final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil = new SciPublicationsDramaticArtsGlobalisationUtil();
addStep(new SciPublicationsMovieDirectorStep(itemModel, parent), addStep(new SciPublicationsMovieDirectorStep(itemModel, parent),
globalisationUtil.globalise("publications.dramaticarts.ui.director")); globalisationUtil.globalise("publications.dramaticarts.ui.movie.director"));
addStep(new SciPublicationsMovieProductionCompanyStep(itemModel, parent), addStep(new SciPublicationsMovieProductionCompanyStep(itemModel, parent),
globalisationUtil.globalise("publications.dramaticarts.ui.producationcompany")); globalisationUtil.globalise("publications.dramaticarts.ui.movie.production_company"));
} }
} }

View File

@ -43,22 +43,22 @@ public class SciPublicationsMoviePropertyForm
} }
public SciPublicationsMoviePropertyForm(final ItemSelectionModel itemModel, public SciPublicationsMoviePropertyForm(final ItemSelectionModel itemModel,
final SciPublicationsMoviePropertiesStep step) { final SciPublicationsMoviePropertiesStep step) {
super(itemModel, step); super(itemModel, step);
this.step = step; this.step = step;
addSubmissionListener(this); addSubmissionListener(this);
} }
@Override @Override
protected void addWidgets() { protected void addWidgets() {
super.addWidgets(); super.addWidgets();
} }
@Override @Override
public void init(final FormSectionEvent event) throws FormProcessException { public void init(final FormSectionEvent event) throws FormProcessException {
super.init(event); super.init(event);
} }
@Override @Override
public void process(final FormSectionEvent event) throws FormProcessException { public void process(final FormSectionEvent event) throws FormProcessException {
super.process(event); super.process(event);

View File

@ -22,6 +22,8 @@ import com.arsdigita.bebop.Page;
import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.PageState;
import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ExtraXMLGenerator; import com.arsdigita.cms.ExtraXMLGenerator;
import com.arsdigita.cms.contenttypes.SciPublicationsPlay;
import com.arsdigita.cms.dispatcher.SimpleXMLGenerator;
import com.arsdigita.xml.Element; import com.arsdigita.xml.Element;
/** /**
@ -37,7 +39,16 @@ public class SciPublicationsPlayExtraXMLGenerator implements ExtraXMLGenerator {
public void generateXML(final ContentItem item, public void generateXML(final ContentItem item,
final Element element, final Element element,
final PageState state) { final PageState state) {
if (item instanceof SciPublicationsPlay) {
final SciPublicationsPlay play = (SciPublicationsPlay) item;
if (play.getProductionTheater() != null) {
final XmlGenerator generator = new XmlGenerator(play.getProductionTheater());
generator.setItemElemName("firstProductionTheatre", "");
generator.setListMode(true);
generator.generateXML(state, element, "");
}
}
} }
public void addGlobalStateParams(final Page page) { public void addGlobalStateParams(final Page page) {
@ -48,5 +59,21 @@ public class SciPublicationsPlayExtraXMLGenerator implements ExtraXMLGenerator {
public void setListMode(final boolean listMode) { public void setListMode(final boolean listMode) {
this.listMode = listMode; this.listMode = listMode;
} }
private class XmlGenerator extends SimpleXMLGenerator {
private final ContentItem item;
public XmlGenerator(final ContentItem item) {
super();
this.item = item;
}
@Override
protected ContentItem getContentItem(final PageState state) {
return item;
}
}
} }

View File

@ -57,7 +57,7 @@ public class SciPublicationsPlayProductionTheaterForm
final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil
= new SciPublicationsDramaticArtsGlobalisationUtil(); = new SciPublicationsDramaticArtsGlobalisationUtil();
add(new Label(globalisationUtil.globalise( add(new Label(globalisationUtil.globalise(
"publications.dramaticarts.ui.play.production_theater"))); "publications.dramaticarts.play.ui.productiontheater")));
itemSearch = new ItemSearchWidget( itemSearch = new ItemSearchWidget(
ITEM_SEARCH, ContentType.findByAssociatedObjectType( ITEM_SEARCH, ContentType.findByAssociatedObjectType(
GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE)); GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE));

View File

@ -67,7 +67,7 @@ public class SciPublicationsPlayProductionTheaterSheet
final TableColumnModel columnModel = getColumnModel(); final TableColumnModel columnModel = getColumnModel();
columnModel.add(new TableColumn( columnModel.add(new TableColumn(
0, 0,
globalisationUtil.globalise("publications.dramaticarts.ui.play.production_theater"), globalisationUtil.globalise("publications.dramaticarts.ui.play.productiontheater"),
TABLE_COL_EDIT)); TABLE_COL_EDIT));
columnModel.add(new TableColumn( columnModel.add(new TableColumn(
1, 1,

View File

@ -95,7 +95,7 @@ public class SciPublicationsPlayPropertiesStep extends PublicationWithPublisherP
= new SciPublicationsDramaticArtsGlobalisationUtil(); = new SciPublicationsDramaticArtsGlobalisationUtil();
addStep(new SciPublicationsPlayProductionTheaterStep(itemModel, parent), addStep(new SciPublicationsPlayProductionTheaterStep(itemModel, parent),
globalisationUtil. globalisationUtil.
globalise("publications.dramaticarts.ui.first_producation_theater")); globalise("publications.dramaticarts.ui.play.first_production_theater"));
} }

View File

@ -63,7 +63,7 @@ public class SciPublicationsPlayPropertyForm
final ParameterModel firstProdYearParam = new IntegerParameter(SciPublicationsPlay.FIRST_PRODUCTION_YEAR); final ParameterModel firstProdYearParam = new IntegerParameter(SciPublicationsPlay.FIRST_PRODUCTION_YEAR);
final TextField firstProdYear = new TextField(firstProdYearParam); final TextField firstProdYear = new TextField(firstProdYearParam);
firstProdYear.setMaxLength(4); firstProdYear.setMaxLength(4);
firstProdYear.setLabel(globalisationUtil.globalise("publications.dramaticarts.ui.play.first_producation_year")); firstProdYear.setLabel(globalisationUtil.globalise("publications.dramaticarts.ui.play.first_production_year"));
add(firstProdYear); add(firstProdYear);
} }