Basetypes umbenannt nach GenericXXX und in cms.contenttypes verschoben
git-svn-id: https://svn.libreccm.org/ccm/trunk@448 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
6eb01bf684
commit
2b74a1ab21
|
|
@ -22,7 +22,7 @@ import com.arsdigita.cms.AuthoringKit;
|
||||||
import com.arsdigita.cms.AuthoringKitStepAssociation;
|
import com.arsdigita.cms.AuthoringKitStepAssociation;
|
||||||
import com.arsdigita.cms.AuthoringStep;
|
import com.arsdigita.cms.AuthoringStep;
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.basetypes.Article;
|
import com.arsdigita.cms.contenttypes.GenericArticle;
|
||||||
import com.arsdigita.cms.contenttypes.ContentAssetInitializer;
|
import com.arsdigita.cms.contenttypes.ContentAssetInitializer;
|
||||||
// import com.arsdigita.cms.contentassets.ItemImageAttachment;
|
// import com.arsdigita.cms.contentassets.ItemImageAttachment;
|
||||||
import com.arsdigita.cms.contentassets.ui.ImageStep;
|
import com.arsdigita.cms.contentassets.ui.ImageStep;
|
||||||
|
|
@ -75,7 +75,7 @@ public class ItemImageAttachmentInitializer extends ContentAssetInitializer {
|
||||||
DataCollection steps = SessionManager.getSession().retrieve
|
DataCollection steps = SessionManager.getSession().retrieve
|
||||||
( AuthoringStep.BASE_DATA_OBJECT_TYPE );
|
( AuthoringStep.BASE_DATA_OBJECT_TYPE );
|
||||||
|
|
||||||
// Don't use defined constant to reduce dependency on Article
|
// Don't use defined constant to reduce dependency on GenericArticle
|
||||||
steps.addEqualsFilter( "component",
|
steps.addEqualsFilter( "component",
|
||||||
"com.arsdigita.cms.ui.authoring.ArticleImage" );
|
"com.arsdigita.cms.ui.authoring.ArticleImage" );
|
||||||
|
|
||||||
|
|
@ -90,14 +90,14 @@ public class ItemImageAttachmentInitializer extends ContentAssetInitializer {
|
||||||
DataObject kitStep = kits.getDataObject();
|
DataObject kitStep = kits.getDataObject();
|
||||||
AuthoringKitStepAssociation kitStepAsso = new AuthoringKitStepAssociation(kitStep);
|
AuthoringKitStepAssociation kitStepAsso = new AuthoringKitStepAssociation(kitStep);
|
||||||
// Check whether the content type is (persistence-wise) subtype
|
// Check whether the content type is (persistence-wise) subtype
|
||||||
// of com.ad.cms.Article. This is lame, but I couldn't find a better API to do this:
|
// of com.ad.cms.GenericArticle. This is lame, but I couldn't find a better API to do this:
|
||||||
AuthoringKit kit = new AuthoringKit (kitStepAsso.getKitID());
|
AuthoringKit kit = new AuthoringKit (kitStepAsso.getKitID());
|
||||||
try {
|
try {
|
||||||
ObjectType.verifySubtype(Article.BASE_DATA_OBJECT_TYPE,
|
ObjectType.verifySubtype(GenericArticle.BASE_DATA_OBJECT_TYPE,
|
||||||
kit.getContentType().getAssociatedObjectType());
|
kit.getContentType().getAssociatedObjectType());
|
||||||
kitStepAsso.delete();
|
kitStepAsso.delete();
|
||||||
} catch (PersistenceException pe) {
|
} catch (PersistenceException pe) {
|
||||||
// Do nothing, the content type is not subtyping com.arsdigita.cms.Article
|
// Do nothing, the content type is not subtyping com.arsdigita.cms.GenericArticle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
model com.arsdigita.cms.contenttypes;
|
model com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.basetypes.Address;
|
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
|
|
||||||
// Address object
|
// Address object
|
||||||
object type Address extends com.arsdigita.cms.basetypes.Address {
|
object type Address extends GenericAddress {
|
||||||
|
|
||||||
reference key ( ct_addresses.address_id );
|
reference key ( ct_addresses.address_id );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@
|
||||||
|
|
||||||
<ctd:authoring-step
|
<ctd:authoring-step
|
||||||
labelKey="address.authoring.basic_properties.title"
|
labelKey="address.authoring.basic_properties.title"
|
||||||
labelBundle="com.arsdigita.cms.basetypes.BasetypesResources"
|
labelBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
||||||
descriptionKey="address.authoring.basic_properties.description"
|
descriptionKey="address.authoring.basic_properties.description"
|
||||||
descriptionBundle="com.arsdigita.cms.basetypes.BasetypesResources"
|
descriptionBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
||||||
component="com.arsdigita.cms.basetypes.ui.AddressPropertiesStep"
|
component="com.arsdigita.cms.contenttypes.ui.GenericAddressPropertiesStep"
|
||||||
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"/>
|
||||||
|
|
|
||||||
|
|
@ -37,13 +37,13 @@ import java.math.BigDecimal;
|
||||||
*
|
*
|
||||||
* @author Sören Bernstein
|
* @author Sören Bernstein
|
||||||
**/
|
**/
|
||||||
public class Address extends com.arsdigita.cms.basetypes.Address {
|
public class Address extends GenericAddress {
|
||||||
|
|
||||||
/** Data object type for this domain object */
|
/** Data object type for this domain object */
|
||||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Address";
|
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Address";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor. This creates a new (empty) Address.
|
* Default constructor. This creates a new (empty) GenericAddress.
|
||||||
**/
|
**/
|
||||||
public Address() {
|
public Address() {
|
||||||
this(BASE_DATA_OBJECT_TYPE);
|
this(BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
@ -53,7 +53,7 @@ public class Address extends com.arsdigita.cms.basetypes.Address {
|
||||||
* Constructor. The contained <code>DataObject</code> is retrieved
|
* Constructor. The contained <code>DataObject</code> is retrieved
|
||||||
* from the persistent storage mechanism with an <code>OID</code>
|
* from the persistent storage mechanism with an <code>OID</code>
|
||||||
* specified by <i>id</i> and
|
* specified by <i>id</i> and
|
||||||
* <code>Address.BASE_DATA_OBJECT_TYPE</code>.
|
* <code>GenericAddress.BASE_DATA_OBJECT_TYPE</code>.
|
||||||
*
|
*
|
||||||
* @param id The <code>id</code> for the retrieved
|
* @param id The <code>id</code> for the retrieved
|
||||||
* <code>DataObject</code>.
|
* <code>DataObject</code>.
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@
|
||||||
// $DateTime: 2004/08/17 23:15:09 $
|
// $DateTime: 2004/08/17 23:15:09 $
|
||||||
model com.arsdigita.cms.contenttypes;
|
model com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.basetypes.*;
|
object type Article extends GenericArticle {
|
||||||
|
|
||||||
object type Article extends com.arsdigita.cms.basetypes.Article {
|
|
||||||
String [0..1] lead = ct_articles.lead VARCHAR(1000);
|
String [0..1] lead = ct_articles.lead VARCHAR(1000);
|
||||||
|
|
||||||
reference key (ct_articles.item_id);
|
reference key (ct_articles.item_id);
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,28 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
||||||
<ctd:content-type label="Article" description="An article type with image" objectType="com.arsdigita.cms.contenttypes.Article" classname="com.arsdigita.cms.contenttypes.Article">
|
<ctd:content-type label="Article" description="An article type with image"
|
||||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
objectType="com.arsdigita.cms.contenttypes.Article"
|
||||||
<ctd:authoring-step
|
classname="com.arsdigita.cms.contenttypes.Article">
|
||||||
labelKey="cms.contenttypes.shared.basic_properties.title"
|
|
||||||
labelBundle="com.arsdigita.cms.ui.CMSResources"
|
|
||||||
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
|
||||||
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
|
||||||
component="com.arsdigita.cms.contenttypes.ui.ArticlePropertiesStep"/>
|
|
||||||
|
|
||||||
<ctd:include href="/WEB-INF/content-types/edit-body-text-step.xml"/>
|
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
||||||
|
|
||||||
|
<ctd:authoring-step
|
||||||
|
labelKey="cms.contenttypes.shared.basic_properties.title"
|
||||||
|
labelBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
|
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
||||||
|
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
|
component="com.arsdigita.cms.contenttypes.ui.ArticlePropertiesStep"/>
|
||||||
|
|
||||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
<ctd:include href="/WEB-INF/content-types/edit-body-text-step.xml"/>
|
||||||
|
|
||||||
<ctd:authoring-step label="Image" description="Image"
|
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||||
labelKey="article.authoring.image.title"
|
|
||||||
labelBundle="com.arsdigita.cms.contenttypes.ArticleResources"
|
<ctd:authoring-step label="Image" description="Image"
|
||||||
descriptionKey="article.authoring.image.description"
|
labelKey="article.authoring.image.title"
|
||||||
descriptionBundle="com.arsdigita.cms.contenttypes.ArticleResources"
|
labelBundle="com.arsdigita.cms.contenttypes.ArticleResources"
|
||||||
component="com.arsdigita.cms.ui.authoring.ArticleImage"/>
|
descriptionKey="article.authoring.image.description"
|
||||||
</ctd:authoring-kit>
|
descriptionBundle="com.arsdigita.cms.contenttypes.ArticleResources"
|
||||||
</ctd:content-type>
|
component="com.arsdigita.cms.ui.authoring.ArticleImage"/>
|
||||||
|
</ctd:authoring-kit>
|
||||||
|
</ctd:content-type>
|
||||||
</ctd:content-types>
|
</ctd:content-types>
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,11 @@ import java.math.BigDecimal;
|
||||||
*
|
*
|
||||||
* @version $Revision: #6 $ $Date: 2004/08/17 $
|
* @version $Revision: #6 $ $Date: 2004/08/17 $
|
||||||
*/
|
*/
|
||||||
public class Article extends com.arsdigita.cms.basetypes.Article {
|
public class Article extends GenericArticle {
|
||||||
|
|
||||||
|
|
||||||
private final static org.apache.log4j.Logger s_log =
|
private final static org.apache.log4j.Logger s_log =
|
||||||
org.apache.log4j.Logger.getLogger(Article.class);
|
org.apache.log4j.Logger.getLogger(GenericArticle.class);
|
||||||
|
|
||||||
/** PDL property name for lead */
|
/** PDL property name for lead */
|
||||||
public static final String LEAD = "lead";
|
public static final String LEAD = "lead";
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ package com.arsdigita.cms.contenttypes;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the Article content type.
|
* Initializes the GenericArticle content type.
|
||||||
* Defines the content type specific properties and just uses the super class
|
* Defines the content type specific properties and just uses the super class
|
||||||
* methods to register the content type with the (transient) content type store
|
* methods to register the content type with the (transient) content type store
|
||||||
* (map).
|
* (map).
|
||||||
|
|
@ -34,7 +34,7 @@ public class ArticleInitializer extends ContentTypeInitializer {
|
||||||
private static final Logger s_log = Logger.getLogger(ArticleInitializer.class);
|
private static final Logger s_log = Logger.getLogger(ArticleInitializer.class);
|
||||||
|
|
||||||
public ArticleInitializer() {
|
public ArticleInitializer() {
|
||||||
super("ccm-cms-types-article.pdl.mf", Article.BASE_DATA_OBJECT_TYPE);
|
super("ccm-cms-types-article.pdl.mf", GenericArticle.BASE_DATA_OBJECT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
model com.arsdigita.cms.contenttypes;
|
model com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
|
||||||
import com.arsdigita.kernel.ACSObject;
|
import com.arsdigita.kernel.ACSObject;
|
||||||
import com.arsdigita.cms.*;
|
import com.arsdigita.cms.*;
|
||||||
|
|
||||||
// Contact Object
|
// Contact Object
|
||||||
object type Contact extends com.arsdigita.cms.basetypes.Contact {
|
object type Contact extends GenericContact {
|
||||||
reference key ( ct_contacts.contact_id );
|
reference key ( ct_contacts.contact_id );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
labelBundle="com.arsdigita.cms.ui.CMSResources"
|
labelBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
||||||
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
component="com.arsdigita.cms.basetypes.ui.ContactPropertiesStep"
|
component="com.arsdigita.cms.contenttypes.ui.GenericContactPropertiesStep"
|
||||||
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"/>
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,10 @@ import java.math.BigDecimal;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This content type represents an Contact
|
* This content type represents an GenericContact
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Contact extends com.arsdigita.cms.basetypes.Contact {
|
public class Contact extends GenericContact {
|
||||||
|
|
||||||
/** Data object type for tihs domain object */
|
/** Data object type for tihs domain object */
|
||||||
public static final String BASE_DATA_OBJECT_TYPE
|
public static final String BASE_DATA_OBJECT_TYPE
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,11 @@ model com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.kernel.ACSObject;
|
import com.arsdigita.kernel.ACSObject;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
|
|
||||||
object type OrganizationRole extends ACSObject {
|
object type OrganizationRole extends ACSObject {
|
||||||
String[1..1] roleName = ct_organizationroles.rolename VARCHAR(150);
|
String[1..1] roleName = ct_organizationroles.rolename VARCHAR(150);
|
||||||
Person[0..1] targetItem = join ct_organizationroles.target_item_id to cms_persons.person_id;
|
GenericPerson[0..1] targetItem = join ct_organizationroles.target_item_id to cms_persons.person_id;
|
||||||
|
|
||||||
Integer[0..1] roleOrder = ct_organizationroles.role_order INTEGER;
|
Integer[0..1] roleOrder = ct_organizationroles.role_order INTEGER;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,9 +139,9 @@ public class OrganizationRole extends ACSObject {
|
||||||
*
|
*
|
||||||
* @return The person associated with the role.
|
* @return The person associated with the role.
|
||||||
*/
|
*/
|
||||||
public com.arsdigita.cms.basetypes.Person getTargetItem() {
|
public com.arsdigita.cms.contenttypes.GenericPerson getTargetItem() {
|
||||||
DataObject object = (DataObject) get(TARGETITEM);
|
DataObject object = (DataObject) get(TARGETITEM);
|
||||||
return (com.arsdigita.cms.basetypes.Person) DomainObjectFactory.newInstance(object);
|
return (com.arsdigita.cms.contenttypes.GenericPerson) DomainObjectFactory.newInstance(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -149,7 +149,7 @@ public class OrganizationRole extends ACSObject {
|
||||||
*
|
*
|
||||||
* @param item
|
* @param item
|
||||||
*/
|
*/
|
||||||
public void setTargetItem(com.arsdigita.cms.basetypes.Person item) {
|
public void setTargetItem(com.arsdigita.cms.contenttypes.GenericPerson item) {
|
||||||
setAssociation(TARGETITEM, item);
|
setAssociation(TARGETITEM, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -177,7 +177,7 @@ public class OrganizationRole extends ACSObject {
|
||||||
* @return The URI of the target item.
|
* @return The URI of the target item.
|
||||||
*/
|
*/
|
||||||
public String getURI(PageState s) {
|
public String getURI(PageState s) {
|
||||||
com.arsdigita.cms.basetypes.Person item = getTargetItem();
|
com.arsdigita.cms.contenttypes.GenericPerson item = getTargetItem();
|
||||||
|
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
logger.error(getOID() + " is a link between an organization and a person, but the associated person is null");
|
logger.error(getOID() + " is a link between an organization and a person, but the associated person is null");
|
||||||
|
|
@ -196,7 +196,7 @@ public class OrganizationRole extends ACSObject {
|
||||||
* @param person
|
* @param person
|
||||||
* @return All roles a person is associated with.
|
* @return All roles a person is associated with.
|
||||||
*/
|
*/
|
||||||
public static DataCollection getReferingRoles(com.arsdigita.cms.basetypes.Person person) {
|
public static DataCollection getReferingRoles(com.arsdigita.cms.contenttypes.GenericPerson person) {
|
||||||
Session session = SessionManager.getSession();
|
Session session = SessionManager.getSession();
|
||||||
DataCollection roles = session.retrieve(BASE_DATA_OBJECT_TYPE);
|
DataCollection roles = session.retrieve(BASE_DATA_OBJECT_TYPE);
|
||||||
Filter filter = roles.addInSubqueryFilter("id", "com.arsdigita.cms.contenttypes.getRefferingRoles");
|
Filter filter = roles.addInSubqueryFilter("id", "com.arsdigita.cms.contenttypes.getRefferingRoles");
|
||||||
|
|
|
||||||
|
|
@ -83,11 +83,11 @@ public class OrganizationRolePropertyForm extends FormSection implements FormIni
|
||||||
|
|
||||||
add(new Label(GenericOrganizationGlobalizationUtil.globalize("cms.contenttypes.ui.genericorganization.person")));
|
add(new Label(GenericOrganizationGlobalizationUtil.globalize("cms.contenttypes.ui.genericorganization.person")));
|
||||||
/* Create the ItemSearchWidget. The ContentType.findByAssociatedObjecType
|
/* Create the ItemSearchWidget. The ContentType.findByAssociatedObjecType
|
||||||
* gets the ContentType of com.arsdigita.cms.contenttypes.Person and passes
|
* gets the ContentType of com.arsdigita.cms.contenttypes.GenericPerson and passes
|
||||||
* it to the constructor of the ItemSearchWidget. The ItemSearchWidget will only
|
* it to the constructor of the ItemSearchWidget. The ItemSearchWidget will only
|
||||||
* display object of type Person or derivated types.
|
* display object of type GenericPerson or derivated types.
|
||||||
*/
|
*/
|
||||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.basetypes.Person"));
|
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericPerson"));
|
||||||
add(this.m_itemSearch);
|
add(this.m_itemSearch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,8 +142,8 @@ public class OrganizationRolePropertyForm extends FormSection implements FormIni
|
||||||
return this.m_roleModel;
|
return this.m_roleModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*protected Person getPerson(PageState s) {
|
/*protected GenericPerson getPerson(PageState s) {
|
||||||
return (Person) m_itemModel.getSelectedObject(s);
|
return (GenericPerson) m_itemModel.getSelectedObject(s);
|
||||||
}*/
|
}*/
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -161,7 +161,7 @@ public class OrganizationRolePropertyForm extends FormSection implements FormIni
|
||||||
* @return Newly created OrganizationRole.
|
* @return Newly created OrganizationRole.
|
||||||
*/
|
*/
|
||||||
protected OrganizationRole createOrganizationRole(PageState s) {
|
protected OrganizationRole createOrganizationRole(PageState s) {
|
||||||
//Person person = this.getPerson(s);
|
//GenericPerson person = this.getPerson(s);
|
||||||
//Assert.exists(person);
|
//Assert.exists(person);
|
||||||
GenericOrganization orga = this.getOrganization(s);
|
GenericOrganization orga = this.getOrganization(s);
|
||||||
Assert.exists(orga);
|
Assert.exists(orga);
|
||||||
|
|
@ -181,7 +181,7 @@ public class OrganizationRolePropertyForm extends FormSection implements FormIni
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
|
|
||||||
role.setRolename((String) m_rolename.getValue(state));
|
role.setRolename((String) m_rolename.getValue(state));
|
||||||
role.setTargetItem((com.arsdigita.cms.basetypes.Person) data.get(ITEM_SEARCH));
|
role.setTargetItem((com.arsdigita.cms.contenttypes.GenericPerson) data.get(ITEM_SEARCH));
|
||||||
|
|
||||||
role.save();
|
role.save();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
model com.arsdigita.cms.contenttypes;
|
model com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.contenttypes.GenricOrganization;
|
import com.arsdigita.cms.contenttypes.GenricOrganization;
|
||||||
import com.arsdigita.cms.basetypes.Address;
|
import com.arsdigita.cms.contenttypes.GenericAddress;
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
|
|
||||||
import com.arsdigita.kernel.ACSObject;
|
import com.arsdigita.kernel.ACSObject;
|
||||||
import com.arsdigita.cms.*;
|
import com.arsdigita.cms.*;
|
||||||
|
|
@ -10,7 +10,7 @@ import com.arsdigita.cms.*;
|
||||||
// HealthCareFacility Object
|
// HealthCareFacility Object
|
||||||
object type HealthCareFacility extends GenericOrganization {
|
object type HealthCareFacility extends GenericOrganization {
|
||||||
|
|
||||||
com.arsdigita.cms.basetypes.Address[0..1] address = join ct_healthCareFacilities.address_id
|
GenericAddress[0..1] address = join ct_healthCareFacilities.address_id
|
||||||
to cms_addresses.address_id;
|
to cms_addresses.address_id;
|
||||||
|
|
||||||
reference key ( ct_healthCareFacilities.hcf_id );
|
reference key ( ct_healthCareFacilities.hcf_id );
|
||||||
|
|
@ -18,7 +18,7 @@ object type HealthCareFacility extends GenericOrganization {
|
||||||
|
|
||||||
association {
|
association {
|
||||||
|
|
||||||
com.arsdigita.cms.basetypes.Contact[0..n] contacts = join ct_healthCareFacilities.hcf_id
|
GenericContact[0..n] contacts = join ct_healthCareFacilities.hcf_id
|
||||||
to ct_healthCareFacility_contact_map.hcf_id,
|
to ct_healthCareFacility_contact_map.hcf_id,
|
||||||
join ct_healthCareFacility_contact_map.contact_id
|
join ct_healthCareFacility_contact_map.contact_id
|
||||||
to cms_contacts.contact_id;
|
to cms_contacts.contact_id;
|
||||||
|
|
|
||||||
|
|
@ -123,12 +123,12 @@ public class HealthCareFacility extends GenericOrganization {
|
||||||
/* accessors *************************************************/
|
/* accessors *************************************************/
|
||||||
|
|
||||||
// Get the address for this contact
|
// Get the address for this contact
|
||||||
public com.arsdigita.cms.basetypes.Address getAddress() {
|
public com.arsdigita.cms.contenttypes.GenericAddress getAddress() {
|
||||||
return (com.arsdigita.cms.basetypes.Address)DomainObjectFactory.newInstance((DataObject)get(ADDRESS));
|
return (com.arsdigita.cms.contenttypes.GenericAddress)DomainObjectFactory.newInstance((DataObject)get(ADDRESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the address for this contact
|
// Set the address for this contact
|
||||||
public void setAddress(com.arsdigita.cms.basetypes.Address address) {
|
public void setAddress(com.arsdigita.cms.contenttypes.GenericAddress address) {
|
||||||
set(ADDRESS, address);
|
set(ADDRESS, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -143,8 +143,8 @@ public class HealthCareFacility extends GenericOrganization {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a contact for this health care facility
|
// Add a contact for this health care facility
|
||||||
public void addContact(com.arsdigita.cms.basetypes.Contact contact, String contactType) {
|
public void addContact(com.arsdigita.cms.contenttypes.GenericContact contact, String contactType) {
|
||||||
Assert.exists(contact, com.arsdigita.cms.basetypes.Contact.class);
|
Assert.exists(contact, com.arsdigita.cms.contenttypes.GenericContact.class);
|
||||||
|
|
||||||
DataObject link = add(CONTACTS, contact);
|
DataObject link = add(CONTACTS, contact);
|
||||||
|
|
||||||
|
|
@ -156,8 +156,8 @@ public class HealthCareFacility extends GenericOrganization {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove a contect for this health care facility
|
// Remove a contect for this health care facility
|
||||||
public void removeContactEntry(com.arsdigita.cms.basetypes.Contact contact) {
|
public void removeContactEntry(com.arsdigita.cms.contenttypes.GenericContact contact) {
|
||||||
Assert.exists(contact, com.arsdigita.cms.basetypes.Contact.class);
|
Assert.exists(contact, com.arsdigita.cms.contenttypes.GenericContact.class);
|
||||||
remove(CONTACTS, contact);
|
remove(CONTACTS, contact);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@ public class HealthCareFacilityContactCollection extends DomainCollection {
|
||||||
// getContact().set(CONTACT_ORDER, String.valueOf(contactOrder));
|
// getContact().set(CONTACT_ORDER, String.valueOf(contactOrder));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public com.arsdigita.cms.basetypes.Contact getContact() {
|
public com.arsdigita.cms.contenttypes.GenericContact getContact() {
|
||||||
return new com.arsdigita.cms.basetypes.Contact(m_dataCollection.getDataObject());
|
return new com.arsdigita.cms.contenttypes.GenericContact(m_dataCollection.getDataObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.contenttypes.util.HealthCareFacilityGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.HealthCareFacilityGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
|
|
||||||
|
|
@ -75,28 +75,28 @@ public class HealthCareFacilityAddressPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||||
|
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.address").localize(), "address." + com.arsdigita.cms.basetypes.Address.ADDRESS);
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize(), "address." + com.arsdigita.cms.contenttypes.GenericAddress.ADDRESS);
|
||||||
if (!HealthCareFacility.getConfig().getHideAddressPostalCode()) {
|
if (!HealthCareFacility.getConfig().getHideAddressPostalCode()) {
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.postal_code").localize(), "address." + com.arsdigita.cms.basetypes.Address.POSTAL_CODE);
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize(), "address." + com.arsdigita.cms.contenttypes.GenericAddress.POSTAL_CODE);
|
||||||
}
|
}
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.city").localize(), "address." + com.arsdigita.cms.basetypes.Address.CITY);
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize(), "address." + com.arsdigita.cms.contenttypes.GenericAddress.CITY);
|
||||||
if (!HealthCareFacility.getConfig().getHideAddressState()) {
|
if (!HealthCareFacility.getConfig().getHideAddressState()) {
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.state").localize(), "address." + com.arsdigita.cms.basetypes.Address.STATE);
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize(), "address." + com.arsdigita.cms.contenttypes.GenericAddress.STATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!HealthCareFacility.getConfig().getHideAddressCountry()) {
|
if (!HealthCareFacility.getConfig().getHideAddressCountry()) {
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.iso_country_code").localize(),
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize(),
|
||||||
"address." + com.arsdigita.cms.basetypes.Address.ISO_COUNTRY_CODE,
|
"address." + com.arsdigita.cms.contenttypes.GenericAddress.ISO_COUNTRY_CODE,
|
||||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||||
|
|
||||||
public String format(DomainObject item,
|
public String format(DomainObject item,
|
||||||
String attribute,
|
String attribute,
|
||||||
PageState state) {
|
PageState state) {
|
||||||
com.arsdigita.cms.basetypes.Address address = ((HealthCareFacility) item).getAddress();
|
com.arsdigita.cms.contenttypes.GenericAddress address = ((HealthCareFacility) item).getAddress();
|
||||||
if (address != null && address.getIsoCountryCode() != null) {
|
if (address != null && address.getIsoCountryCode() != null) {
|
||||||
return com.arsdigita.cms.basetypes.Address.getCountryNameFromIsoCode(address.getIsoCountryCode());
|
return com.arsdigita.cms.contenttypes.GenericAddress.getCountryNameFromIsoCode(address.getIsoCountryCode());
|
||||||
} else {
|
} else {
|
||||||
return (String) BasetypesGlobalizationUtil.globalize("cms.ui.unknown").localize();
|
return (String) ContenttypesGlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ public class HealthCareFacilityAttachAddressPropertyForm extends BasicPageForm i
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
add(new Label((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address").localize()));
|
add(new Label((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address").localize()));
|
||||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.basetypes.Address"));
|
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericAddress"));
|
||||||
add(this.m_itemSearch);
|
add(this.m_itemSearch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,7 +97,7 @@ public class HealthCareFacilityAttachAddressPropertyForm extends BasicPageForm i
|
||||||
HealthCareFacility healthCareFacility = (HealthCareFacility) getItemSelectionModel().getSelectedObject(state);
|
HealthCareFacility healthCareFacility = (HealthCareFacility) getItemSelectionModel().getSelectedObject(state);
|
||||||
|
|
||||||
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
||||||
healthCareFacility.setAddress((com.arsdigita.cms.basetypes.Address) data.get(ITEM_SEARCH));
|
healthCareFacility.setAddress((com.arsdigita.cms.contenttypes.GenericAddress) data.get(ITEM_SEARCH));
|
||||||
}
|
}
|
||||||
init(fse);
|
init(fse);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import com.arsdigita.bebop.form.SingleSelect;
|
||||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
|
|
@ -68,17 +68,17 @@ public class HealthCareFacilityContactAddForm extends BasicItemForm {
|
||||||
@Override
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
// Attach a Contact object
|
// Attach a GenericContact object
|
||||||
add(new Label((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_contact").localize()));
|
add(new Label((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_contact").localize()));
|
||||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.Contact"));
|
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericContact"));
|
||||||
add(this.m_itemSearch);
|
add(this.m_itemSearch);
|
||||||
|
|
||||||
// Contact type field
|
// GenericContact type field
|
||||||
add(new Label(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contact.type")));
|
add(new Label(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contact.type")));
|
||||||
ParameterModel contactTypeParam = new StringParameter(HealthCareFacilityContactCollection.CONTACT_TYPE);
|
ParameterModel contactTypeParam = new StringParameter(HealthCareFacilityContactCollection.CONTACT_TYPE);
|
||||||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||||
contactType.addValidationListener(new NotNullValidationListener());
|
contactType.addValidationListener(new NotNullValidationListener());
|
||||||
contactType.addOption(new Option("", new Label((String) BasetypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
contactType.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||||
|
|
||||||
// Add the Options to the SingleSelect widget
|
// Add the Options to the SingleSelect widget
|
||||||
StringTokenizer keyList = HealthCareFacility.getConfig().getContactTypeKeys();
|
StringTokenizer keyList = HealthCareFacility.getConfig().getContactTypeKeys();
|
||||||
|
|
@ -105,7 +105,7 @@ public class HealthCareFacilityContactAddForm extends BasicItemForm {
|
||||||
|
|
||||||
//
|
//
|
||||||
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
||||||
healthCareFacility.addContact((com.arsdigita.cms.basetypes.Contact) data.get(ITEM_SEARCH),
|
healthCareFacility.addContact((com.arsdigita.cms.contenttypes.GenericContact) data.get(ITEM_SEARCH),
|
||||||
(String) data.get(HealthCareFacilityContactCollection.CONTACT_TYPE));
|
(String) data.get(HealthCareFacilityContactCollection.CONTACT_TYPE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ public class HealthCareFacilityContactTable extends Table implements TableAction
|
||||||
final private int MAX_DESC_LENGTH = 25;
|
final private int MAX_DESC_LENGTH = 25;
|
||||||
private Table m_table;
|
private Table m_table;
|
||||||
private HealthCareFacilityContactCollection m_contactCollection;
|
private HealthCareFacilityContactCollection m_contactCollection;
|
||||||
private com.arsdigita.cms.basetypes.Contact m_contact;
|
private com.arsdigita.cms.contenttypes.GenericContact m_contact;
|
||||||
|
|
||||||
private HealthCareFacilityTableModel(Table t, PageState ps, HealthCareFacility healthCareFacility) {
|
private HealthCareFacilityTableModel(Table t, PageState ps, HealthCareFacility healthCareFacility) {
|
||||||
m_table = t;
|
m_table = t;
|
||||||
|
|
@ -228,9 +228,9 @@ public class HealthCareFacilityContactTable extends Table implements TableAction
|
||||||
|
|
||||||
PageState state = evt.getPageState();
|
PageState state = evt.getPageState();
|
||||||
|
|
||||||
// Get selected Contact
|
// Get selected GenericContact
|
||||||
com.arsdigita.cms.basetypes.Contact contact =
|
com.arsdigita.cms.contenttypes.GenericContact contact =
|
||||||
new com.arsdigita.cms.basetypes.Contact(new BigDecimal(evt.getRowKey().toString()));
|
new com.arsdigita.cms.contenttypes.GenericContact(new BigDecimal(evt.getRowKey().toString()));
|
||||||
|
|
||||||
// Get HealthCareFacility
|
// Get HealthCareFacility
|
||||||
HealthCareFacility healthCareFacility = (HealthCareFacility) m_itemModel.getSelectedObject(state);
|
HealthCareFacility healthCareFacility = (HealthCareFacility) m_itemModel.getSelectedObject(state);
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
@ -44,11 +44,11 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(HealthCareFacilityPropertyForm.class);
|
private static final Logger logger = Logger.getLogger(HealthCareFacilityPropertyForm.class);
|
||||||
private HealthCareFacilityAddressPropertiesStep m_step;
|
private HealthCareFacilityAddressPropertiesStep m_step;
|
||||||
public static final String ADDRESS = com.arsdigita.cms.basetypes.Address.ADDRESS;
|
public static final String ADDRESS = com.arsdigita.cms.contenttypes.GenericAddress.ADDRESS;
|
||||||
public static final String POSTAL_CODE = com.arsdigita.cms.basetypes.Address.POSTAL_CODE;
|
public static final String POSTAL_CODE = com.arsdigita.cms.contenttypes.GenericAddress.POSTAL_CODE;
|
||||||
public static final String CITY = com.arsdigita.cms.basetypes.Address.CITY;
|
public static final String CITY = com.arsdigita.cms.contenttypes.GenericAddress.CITY;
|
||||||
public static final String STATE = com.arsdigita.cms.basetypes.Address.STATE;
|
public static final String STATE = com.arsdigita.cms.contenttypes.GenericAddress.STATE;
|
||||||
public static final String ISO_COUNTRY_CODE = com.arsdigita.cms.basetypes.Address.ISO_COUNTRY_CODE;
|
public static final String ISO_COUNTRY_CODE = com.arsdigita.cms.contenttypes.GenericAddress.ISO_COUNTRY_CODE;
|
||||||
/**
|
/**
|
||||||
* ID of the form
|
* ID of the form
|
||||||
*/
|
*/
|
||||||
|
|
@ -77,7 +77,7 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.address").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize()));
|
||||||
ParameterModel addressParam = new StringParameter(ADDRESS);
|
ParameterModel addressParam = new StringParameter(ADDRESS);
|
||||||
addressParam.addParameterListener(new NotNullValidationListener());
|
addressParam.addParameterListener(new NotNullValidationListener());
|
||||||
addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
|
|
@ -87,35 +87,35 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp
|
||||||
add(address);
|
add(address);
|
||||||
|
|
||||||
if (!HealthCareFacility.getConfig().getHideAddressPostalCode()) {
|
if (!HealthCareFacility.getConfig().getHideAddressPostalCode()) {
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.postal_code").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize()));
|
||||||
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
||||||
TextField postalCode = new TextField(postalCodeParam);
|
TextField postalCode = new TextField(postalCodeParam);
|
||||||
/* XXX NumberListener ?*/
|
/* XXX NumberListener ?*/
|
||||||
add(postalCode);
|
add(postalCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.city").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize()));
|
||||||
ParameterModel cityParam = new StringParameter(CITY);
|
ParameterModel cityParam = new StringParameter(CITY);
|
||||||
TextField city = new TextField(cityParam);
|
TextField city = new TextField(cityParam);
|
||||||
add(city);
|
add(city);
|
||||||
|
|
||||||
if (!HealthCareFacility.getConfig().getHideAddressState()) {
|
if (!HealthCareFacility.getConfig().getHideAddressState()) {
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.state").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize()));
|
||||||
ParameterModel stateParam = new StringParameter(STATE);
|
ParameterModel stateParam = new StringParameter(STATE);
|
||||||
TextField state = new TextField(stateParam);
|
TextField state = new TextField(stateParam);
|
||||||
add(state);
|
add(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!HealthCareFacility.getConfig().getHideAddressCountry()) {
|
if (!HealthCareFacility.getConfig().getHideAddressCountry()) {
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.iso_country_code").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize()));
|
||||||
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
||||||
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
||||||
|
|
||||||
SingleSelect country = new SingleSelect(countryParam);
|
SingleSelect country = new SingleSelect(countryParam);
|
||||||
|
|
||||||
country.addOption(new Option("", new Label((String) BasetypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
country.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||||
|
|
||||||
Iterator countries = com.arsdigita.cms.basetypes.Address.getSortedListOfCountries(null).entrySet().iterator();
|
Iterator countries = com.arsdigita.cms.contenttypes.GenericAddress.getSortedListOfCountries(null).entrySet().iterator();
|
||||||
while (countries.hasNext()) {
|
while (countries.hasNext()) {
|
||||||
Map.Entry<String, String> elem = (Map.Entry<String, String>) countries.next();
|
Map.Entry<String, String> elem = (Map.Entry<String, String>) countries.next();
|
||||||
country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString()));
|
country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString()));
|
||||||
|
|
@ -128,7 +128,7 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp
|
||||||
ParameterData data = e.getParameterData();
|
ParameterData data = e.getParameterData();
|
||||||
String isoCode = (String) data.getValue();
|
String isoCode = (String) data.getValue();
|
||||||
if (isoCode == null || isoCode.length() == 0) {
|
if (isoCode == null || isoCode.length() == 0) {
|
||||||
data.addError((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.error_iso_country").localize());
|
data.addError((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.error_iso_country").localize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -148,7 +148,7 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp
|
||||||
data.put(POSTAL_CODE, healthCareFacility.getAddress().getPostalCode());
|
data.put(POSTAL_CODE, healthCareFacility.getAddress().getPostalCode());
|
||||||
data.put(CITY, healthCareFacility.getAddress().getCity());
|
data.put(CITY, healthCareFacility.getAddress().getCity());
|
||||||
data.put(STATE, healthCareFacility.getAddress().getState());
|
data.put(STATE, healthCareFacility.getAddress().getState());
|
||||||
if (!com.arsdigita.cms.basetypes.Address.getConfig().getHideCountryCodeSelection()) {
|
if (!com.arsdigita.cms.contenttypes.GenericAddress.getConfig().getHideCountryCodeSelection()) {
|
||||||
data.put(ISO_COUNTRY_CODE, healthCareFacility.getAddress().getIsoCountryCode());
|
data.put(ISO_COUNTRY_CODE, healthCareFacility.getAddress().getIsoCountryCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,12 @@
|
||||||
|
|
||||||
model com.arsdigita.cms.contenttypes;
|
model com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.basetypes.*;
|
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
|
|
||||||
object type Member extends Person {
|
object type Member extends GenericPerson {
|
||||||
|
|
||||||
// Address address [0..1] = join Address ct_members.address_id
|
// GenericContact contact [0..1] = join ct_members.contact_id
|
||||||
// to cms_addresses.address_id;
|
// to cms_contacts.contact_id;
|
||||||
|
|
||||||
reference key (ct_members.member_id);
|
reference key (ct_members.member_id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@
|
||||||
|
|
||||||
<ctd:authoring-step
|
<ctd:authoring-step
|
||||||
labelKey="member.authoring.basic_properties.title"
|
labelKey="member.authoring.basic_properties.title"
|
||||||
labelBundle="com.arsdigita.cms.basetypes.BasetypesResources"
|
labelBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
||||||
descriptionKey="member.authoring.basic_properties.description"
|
descriptionKey="member.authoring.basic_properties.description"
|
||||||
descriptionBundle="com.arsdigita.cms.basetypes.BasetypesResources"
|
descriptionBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
||||||
component="com.arsdigita.cms.contenttypes.ui.MemberPropertiesStep"
|
component="com.arsdigita.cms.contenttypes.ui.MemberPropertiesStep"
|
||||||
ordering="1"/>
|
ordering="1"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@
|
||||||
package com.arsdigita.cms.contenttypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
import com.arsdigita.persistence.OID;
|
import com.arsdigita.persistence.OID;
|
||||||
|
|
@ -31,7 +30,7 @@ import java.math.BigDecimal;
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class Member extends Person {
|
public class Member extends GenericPerson {
|
||||||
|
|
||||||
/** Data object type for this domain object */
|
/** Data object type for this domain object */
|
||||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Member";
|
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Member";
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,11 @@ package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
|
||||||
import com.arsdigita.cms.basetypes.ui.PersonPropertiesStep;
|
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
|
|
||||||
public class MemberPropertiesStep extends PersonPropertiesStep {
|
public class MemberPropertiesStep extends GenericPersonPropertiesStep {
|
||||||
|
|
||||||
public static final String EDIT_SHEET_NAME = "edit";
|
public static final String EDIT_SHEET_NAME = "edit";
|
||||||
|
|
||||||
|
|
@ -41,7 +39,7 @@ public class MemberPropertiesStep extends PersonPropertiesStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Component getMemberPropertySheet(ItemSelectionModel itemModel) {
|
public static Component getMemberPropertySheet(ItemSelectionModel itemModel) {
|
||||||
Component sheet = PersonPropertiesStep.getPersonPropertySheet(itemModel);
|
Component sheet = GenericPersonPropertiesStep.getPersonPropertySheet(itemModel);
|
||||||
|
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ import com.arsdigita.bebop.form.TextField;
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.ui.PersonPropertyForm;
|
|
||||||
import com.arsdigita.cms.contenttypes.Member;
|
import com.arsdigita.cms.contenttypes.Member;
|
||||||
import com.arsdigita.cms.contenttypes.util.MemberGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.MemberGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
|
|
@ -39,7 +38,7 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* @author: Jens Pelzetter
|
* @author: Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class MemberPropertyForm extends PersonPropertyForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
public class MemberPropertyForm extends GenericPersonPropertyForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(MemberPropertyForm.class);
|
private static final Logger s_log = Logger.getLogger(MemberPropertyForm.class);
|
||||||
private MemberPropertiesStep m_step;
|
private MemberPropertiesStep m_step;
|
||||||
|
|
@ -72,4 +71,4 @@ public class MemberPropertyForm extends PersonPropertyForm implements FormProces
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,9 @@
|
||||||
// $DateTime: 2004/08/17 23:15:09 $
|
// $DateTime: 2004/08/17 23:15:09 $
|
||||||
model com.arsdigita.cms.contenttypes;
|
model com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.basetypes.*;
|
|
||||||
|
|
||||||
// object type to hold extended attributes of news content type
|
// object type to hold extended attributes of news content type
|
||||||
|
|
||||||
object type NewsItem extends com.arsdigita.cms.basetypes.Article {
|
object type NewsItem extends GenericArticle {
|
||||||
// The tease/lead paragraph for the news item
|
// The tease/lead paragraph for the news item
|
||||||
String [0..1] lead = ct_news.tease_lead VARCHAR(4000);
|
String [0..1] lead = ct_news.tease_lead VARCHAR(4000);
|
||||||
// The date for the news item
|
// The date for the news item
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<!-- First off the adapters for ContentItemPanel -->
|
<!-- First off the adapters for ContentItemPanel -->
|
||||||
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator">
|
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator">
|
||||||
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.NewsItem"
|
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.NewsItem"
|
||||||
extends="com.arsdigita.cms.basetypes.Article"
|
extends="com.arsdigita.cms.contenttypes.GenericArticle"
|
||||||
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
|
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
|
||||||
<xrd:formatter property="/object/newsDate"
|
<xrd:formatter property="/object/newsDate"
|
||||||
class="com.arsdigita.xml.formatters.DateFormatter"/>
|
class="com.arsdigita.xml.formatters.DateFormatter"/>
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ import java.util.Date;
|
||||||
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
|
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
|
||||||
* @version $Revision: #7 $ $Date: 2004/08/17 $
|
* @version $Revision: #7 $ $Date: 2004/08/17 $
|
||||||
**/
|
**/
|
||||||
public class NewsItem extends com.arsdigita.cms.basetypes.Article {
|
public class NewsItem extends GenericArticle {
|
||||||
|
|
||||||
/** PDL property name for lead */
|
/** PDL property name for lead */
|
||||||
public static final String LEAD = "lead";
|
public static final String LEAD = "lead";
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,13 @@ model com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.kernel.ACSObject;
|
import com.arsdigita.kernel.ACSObject;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
|
|
||||||
object type Membership extends ACSObject {
|
object type Membership extends ACSObject {
|
||||||
MembershipStatus[1..1] status = join ct_memberships.status_id to ct_membershipstatus.status_id;
|
MembershipStatus[1..1] status = join ct_memberships.status_id to ct_membershipstatus.status_id;
|
||||||
Date[0..1] memberFrom = ct_memberships.member_from DATE;
|
Date[0..1] memberFrom = ct_memberships.member_from DATE;
|
||||||
Date[0..1] memberTo = ct_memberships.member_to DATE;
|
Date[0..1] memberTo = ct_memberships.member_to DATE;
|
||||||
Person[0..1] targetItem = join ct_memberships.target_item_id to cms_persons.person_id;
|
GenericPerson[0..1] targetItem = join ct_memberships.target_item_id to cms_persons.person_id;
|
||||||
|
|
||||||
reference key(ct_memberships.membership_id);
|
reference key(ct_memberships.membership_id);
|
||||||
aggressive load (membershipOwner.id);
|
aggressive load (membershipOwner.id);
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ model com.arsdigita.cms.contenttypes;
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.DomainObject;
|
import com.arsdigita.cms.DomainObject;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
|
|
||||||
object type OrganizationalUnit extends ContentPage {
|
object type OrganizationalUnit extends ContentPage {
|
||||||
String[0..1] organizationalunitName = ct_organizationalunits.organizationalunit_name VARCHAR(512);
|
String[0..1] organizationalunitName = ct_organizationalunits.organizationalunit_name VARCHAR(512);
|
||||||
|
|
@ -38,12 +38,12 @@ object type OrganizationalUnit extends ContentPage {
|
||||||
|
|
||||||
|
|
||||||
association {
|
association {
|
||||||
Person[0..1] direction = join ct_organizationalunits.direction_id to cms_persons.person_id;
|
GenericPerson[0..1] direction = join ct_organizationalunits.direction_id to cms_persons.person_id;
|
||||||
OrganizationalUnit[0..n] directedUnit = join cms_persons.person_id to ct_organizationalunits.direction_id;
|
OrganizationalUnit[0..n] directedUnit = join cms_persons.person_id to ct_organizationalunits.direction_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
association {
|
association {
|
||||||
Person[0..1] assistentDirection = join ct_organizationalunits.assistantDirection_id to cms_persons.person_id;
|
GenericPerson[0..1] assistentDirection = join ct_organizationalunits.assistantDirection_id to cms_persons.person_id;
|
||||||
OrganizationalUnit[0..n] assistenedDirectedUnit = join cms_persons.person_id to ct_organizationalunits.assistantDirection_id;
|
OrganizationalUnit[0..n] assistenedDirectedUnit = join cms_persons.person_id to ct_organizationalunits.assistantDirection_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
import com.arsdigita.cms.dispatcher.ItemResolver;
|
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.kernel.ACSObject;
|
import com.arsdigita.kernel.ACSObject;
|
||||||
|
|
@ -121,18 +121,18 @@ public class Membership extends ACSObject {
|
||||||
setAssociation(MEMBERSHIP_OWNER, ou);
|
setAssociation(MEMBERSHIP_OWNER, ou);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Person getTargetItem() {
|
public GenericPerson getTargetItem() {
|
||||||
DataObject obj = (DataObject) get(TARGET_ITEM);
|
DataObject obj = (DataObject) get(TARGET_ITEM);
|
||||||
return (Person) DomainObjectFactory.newInstance(obj);
|
return (GenericPerson) DomainObjectFactory.newInstance(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTargetItem(Person person) {
|
public void setTargetItem(GenericPerson person) {
|
||||||
Assert.exists(person, Person.class);
|
Assert.exists(person, GenericPerson.class);
|
||||||
setAssociation(TARGET_ITEM, person);
|
setAssociation(TARGET_ITEM, person);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getURI(PageState state) {
|
public String getURI(PageState state) {
|
||||||
Person person = this.getTargetItem();
|
GenericPerson person = this.getTargetItem();
|
||||||
|
|
||||||
if (person == null) {
|
if (person == null) {
|
||||||
logger.error(getOID() + " is a link between a OrganizationalUnit and a Person, but the associated Person is null");
|
logger.error(getOID() + " is a link between a OrganizationalUnit and a Person, but the associated Person is null");
|
||||||
|
|
@ -146,7 +146,7 @@ public class Membership extends ACSObject {
|
||||||
return URL.there(state.getRequest(), url).toString();
|
return URL.there(state.getRequest(), url).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DataCollection getReferingPersons(Person person) {
|
public static DataCollection getReferingPersons(GenericPerson person) {
|
||||||
Session session = SessionManager.getSession();
|
Session session = SessionManager.getSession();
|
||||||
DataCollection memberships = session.retrieve(BASE_DATA_OBJECT_TYPE);
|
DataCollection memberships = session.retrieve(BASE_DATA_OBJECT_TYPE);
|
||||||
Filter filter = memberships.addInSubqueryFilter("id", "com.arsdigita.cms.contenttypes.getReferingPersons");
|
Filter filter = memberships.addInSubqueryFilter("id", "com.arsdigita.cms.contenttypes.getReferingPersons");
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
package com.arsdigita.cms.contenttypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.persistence.DataCollection;
|
import com.arsdigita.persistence.DataCollection;
|
||||||
|
|
@ -84,32 +84,32 @@ public class OrganizationalUnit extends ContentPage{
|
||||||
set(ORGANIZATIONALUNIT_DESCRIPTION, description);
|
set(ORGANIZATIONALUNIT_DESCRIPTION, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Person getDirection() {
|
public GenericPerson getDirection() {
|
||||||
DataObject dobj = (DataObject) get(DIRECTION);
|
DataObject dobj = (DataObject) get(DIRECTION);
|
||||||
if (dobj != null) {
|
if (dobj != null) {
|
||||||
return (Person) DomainObjectFactory.newInstance(dobj);
|
return (GenericPerson) DomainObjectFactory.newInstance(dobj);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDirection(Person person) {
|
public void setDirection(GenericPerson person) {
|
||||||
logger.debug("Setting direction...");
|
logger.debug("Setting direction...");
|
||||||
Assert.exists(person, Person.class);
|
Assert.exists(person, GenericPerson.class);
|
||||||
setAssociation(DIRECTION, person);
|
setAssociation(DIRECTION, person);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Person getAssistentDirection() {
|
public GenericPerson getAssistentDirection() {
|
||||||
DataObject dobj = (DataObject) get(ASSISTENT_DIRECTION);
|
DataObject dobj = (DataObject) get(ASSISTENT_DIRECTION);
|
||||||
if (dobj != null) {
|
if (dobj != null) {
|
||||||
return (Person) DomainObjectFactory.newInstance(dobj);
|
return (GenericPerson) DomainObjectFactory.newInstance(dobj);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAssistentDirection(Person person) {
|
public void setAssistentDirection(GenericPerson person) {
|
||||||
Assert.exists(person, Person.class);
|
Assert.exists(person, GenericPerson.class);
|
||||||
setAssociation(ASSISTENT_DIRECTION, person);
|
setAssociation(ASSISTENT_DIRECTION, person);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.bebop.util.GlobalizationUtil;
|
import com.arsdigita.bebop.util.GlobalizationUtil;
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
import com.arsdigita.cms.contenttypes.Membership;
|
import com.arsdigita.cms.contenttypes.Membership;
|
||||||
import com.arsdigita.cms.contenttypes.MembershipStatus;
|
import com.arsdigita.cms.contenttypes.MembershipStatus;
|
||||||
import com.arsdigita.cms.contenttypes.OrganizationalUnit;
|
import com.arsdigita.cms.contenttypes.OrganizationalUnit;
|
||||||
|
|
@ -77,7 +77,7 @@ public class MembershipPropertyForm extends FormSection implements FormInitListe
|
||||||
logger.debug("adding widgets...");
|
logger.debug("adding widgets...");
|
||||||
|
|
||||||
add(new Label(OrganizationalUnitGlobalizationUtil.globalize("cms.contenttypes.ui.orgnizationalunit.membership.Person")));
|
add(new Label(OrganizationalUnitGlobalizationUtil.globalize("cms.contenttypes.ui.orgnizationalunit.membership.Person")));
|
||||||
this.m_personSearch = new ItemSearchWidget(PERSON_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.basetypes.Person"));
|
this.m_personSearch = new ItemSearchWidget(PERSON_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericPerson"));
|
||||||
add(this.m_personSearch);
|
add(this.m_personSearch);
|
||||||
|
|
||||||
add(new Label(OrganizationalUnitGlobalizationUtil.globalize("cms.contenttypes.ui.orgnizationalunit.membership.Status")));
|
add(new Label(OrganizationalUnitGlobalizationUtil.globalize("cms.contenttypes.ui.orgnizationalunit.membership.Status")));
|
||||||
|
|
@ -166,7 +166,7 @@ public class MembershipPropertyForm extends FormSection implements FormInitListe
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
|
|
||||||
membership.setTargetItem((Person) data.get(PERSON_SEARCH));
|
membership.setTargetItem((GenericPerson) data.get(PERSON_SEARCH));
|
||||||
|
|
||||||
MembershipStatus status = new MembershipStatus(new BigDecimal((String) this.m_status.getValue(state)));
|
MembershipStatus status = new MembershipStatus(new BigDecimal((String) this.m_status.getValue(state)));
|
||||||
logger.debug("this.m_status.getValues() = " + this.m_status.getValue(state));
|
logger.debug("this.m_status.getValues() = " + this.m_status.getValue(state));
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
import com.arsdigita.cms.contenttypes.Membership;
|
import com.arsdigita.cms.contenttypes.Membership;
|
||||||
import com.arsdigita.cms.contenttypes.MembershipStatus;
|
import com.arsdigita.cms.contenttypes.MembershipStatus;
|
||||||
import com.arsdigita.cms.contenttypes.OrganizationalUnitGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.OrganizationalUnitGlobalizationUtil;
|
||||||
|
|
@ -96,7 +96,7 @@ public class MembershipTable extends Table {
|
||||||
|
|
||||||
String url = membership.getURI(state);
|
String url = membership.getURI(state);
|
||||||
if (column == m_personCol.getModelIndex()) {
|
if (column == m_personCol.getModelIndex()) {
|
||||||
Person person = membership.getTargetItem();
|
GenericPerson person = membership.getTargetItem();
|
||||||
StringBuilder fullNameBuilder = new StringBuilder();
|
StringBuilder fullNameBuilder = new StringBuilder();
|
||||||
|
|
||||||
if(person.getTitlePre() != null) {
|
if(person.getTitlePre() != null) {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
import com.arsdigita.cms.contenttypes.OrganizationalUnit;
|
import com.arsdigita.cms.contenttypes.OrganizationalUnit;
|
||||||
import com.arsdigita.cms.contenttypes.OrganizationalUnitGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.OrganizationalUnitGlobalizationUtil;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
|
|
@ -78,7 +78,7 @@ public class OrganizationalUnitChooseAssistentDirectorTable extends Table implem
|
||||||
|
|
||||||
public TableModel makeModel(Table t, PageState s) {
|
public TableModel makeModel(Table t, PageState s) {
|
||||||
t.getRowSelectionModel().clearSelection(s);
|
t.getRowSelectionModel().clearSelection(s);
|
||||||
DataCollection m_persons = SessionManager.getSession().retrieve(Person.BASE_DATA_OBJECT_TYPE);
|
DataCollection m_persons = SessionManager.getSession().retrieve(GenericPerson.BASE_DATA_OBJECT_TYPE);
|
||||||
m_persons.addEqualsFilter(ContentItem.VERSION, ContentItem.DRAFT);
|
m_persons.addEqualsFilter(ContentItem.VERSION, ContentItem.DRAFT);
|
||||||
return new OrganizationalUnitChooseAssistentDirectorTableModel(t, m_persons);
|
return new OrganizationalUnitChooseAssistentDirectorTableModel(t, m_persons);
|
||||||
}
|
}
|
||||||
|
|
@ -88,7 +88,7 @@ public class OrganizationalUnitChooseAssistentDirectorTable extends Table implem
|
||||||
|
|
||||||
private Table m_table;
|
private Table m_table;
|
||||||
private DataCollection m_persons;
|
private DataCollection m_persons;
|
||||||
private Person m_person;
|
private GenericPerson m_person;
|
||||||
|
|
||||||
private OrganizationalUnitChooseAssistentDirectorTableModel(Table t, DataCollection persons) {
|
private OrganizationalUnitChooseAssistentDirectorTableModel(Table t, DataCollection persons) {
|
||||||
m_table = t;
|
m_table = t;
|
||||||
|
|
@ -101,7 +101,7 @@ public class OrganizationalUnitChooseAssistentDirectorTable extends Table implem
|
||||||
|
|
||||||
public boolean nextRow() {
|
public boolean nextRow() {
|
||||||
if (m_persons.next()) {
|
if (m_persons.next()) {
|
||||||
m_person = (Person) DomainObjectFactory.newInstance(m_persons.getDataObject());
|
m_person = (GenericPerson) DomainObjectFactory.newInstance(m_persons.getDataObject());
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -163,7 +163,7 @@ public class OrganizationalUnitChooseAssistentDirectorTable extends Table implem
|
||||||
m_parent.showDisplayPane(state);
|
m_parent.showDisplayPane(state);
|
||||||
BigDecimal personID = new BigDecimal (e.getRowKey().toString());
|
BigDecimal personID = new BigDecimal (e.getRowKey().toString());
|
||||||
OrganizationalUnit orgaunit = (OrganizationalUnit) this.m_selOrgaUnit.getSelectedObject(state);
|
OrganizationalUnit orgaunit = (OrganizationalUnit) this.m_selOrgaUnit.getSelectedObject(state);
|
||||||
Person person = (Person) DomainObjectFactory.newInstance(new OID(Person.BASE_DATA_OBJECT_TYPE, personID));
|
GenericPerson person = (GenericPerson) DomainObjectFactory.newInstance(new OID(GenericPerson.BASE_DATA_OBJECT_TYPE, personID));
|
||||||
orgaunit.setAssistentDirection(person);
|
orgaunit.setAssistentDirection(person);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
import com.arsdigita.cms.contenttypes.OrganizationalUnit;
|
import com.arsdigita.cms.contenttypes.OrganizationalUnit;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.persistence.DataCollection;
|
import com.arsdigita.persistence.DataCollection;
|
||||||
|
|
@ -79,7 +79,7 @@ public class OrganizationalUnitChooseDirectorTable extends Table implements Tabl
|
||||||
|
|
||||||
public TableModel makeModel(Table t, PageState s) {
|
public TableModel makeModel(Table t, PageState s) {
|
||||||
t.getRowSelectionModel().clearSelection(s);
|
t.getRowSelectionModel().clearSelection(s);
|
||||||
DataCollection m_persons = SessionManager.getSession().retrieve(Person.BASE_DATA_OBJECT_TYPE);
|
DataCollection m_persons = SessionManager.getSession().retrieve(GenericPerson.BASE_DATA_OBJECT_TYPE);
|
||||||
m_persons.addEqualsFilter(ContentItem.VERSION, ContentItem.DRAFT);
|
m_persons.addEqualsFilter(ContentItem.VERSION, ContentItem.DRAFT);
|
||||||
return new OrganizationalUnitChooseDirectorTableModel(t, m_persons);
|
return new OrganizationalUnitChooseDirectorTableModel(t, m_persons);
|
||||||
}
|
}
|
||||||
|
|
@ -89,7 +89,7 @@ public class OrganizationalUnitChooseDirectorTable extends Table implements Tabl
|
||||||
|
|
||||||
private Table m_table;
|
private Table m_table;
|
||||||
private DataCollection m_persons;
|
private DataCollection m_persons;
|
||||||
private Person m_person;
|
private GenericPerson m_person;
|
||||||
|
|
||||||
private OrganizationalUnitChooseDirectorTableModel(Table t, DataCollection persons) {
|
private OrganizationalUnitChooseDirectorTableModel(Table t, DataCollection persons) {
|
||||||
m_table = t;
|
m_table = t;
|
||||||
|
|
@ -102,7 +102,7 @@ public class OrganizationalUnitChooseDirectorTable extends Table implements Tabl
|
||||||
|
|
||||||
public boolean nextRow() {
|
public boolean nextRow() {
|
||||||
if (m_persons.next()) {
|
if (m_persons.next()) {
|
||||||
m_person = (Person) DomainObjectFactory.newInstance(m_persons.getDataObject());
|
m_person = (GenericPerson) DomainObjectFactory.newInstance(m_persons.getDataObject());
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -167,7 +167,7 @@ public class OrganizationalUnitChooseDirectorTable extends Table implements Tabl
|
||||||
m_parent.showDisplayPane(state);
|
m_parent.showDisplayPane(state);
|
||||||
BigDecimal personID = new BigDecimal (e.getRowKey().toString());
|
BigDecimal personID = new BigDecimal (e.getRowKey().toString());
|
||||||
OrganizationalUnit orgaunit = (OrganizationalUnit) this.m_selOrgaUnit.getSelectedObject(state);
|
OrganizationalUnit orgaunit = (OrganizationalUnit) this.m_selOrgaUnit.getSelectedObject(state);
|
||||||
Person person = (Person) DomainObjectFactory.newInstance(new OID(Person.BASE_DATA_OBJECT_TYPE, personID));
|
GenericPerson person = (GenericPerson) DomainObjectFactory.newInstance(new OID(GenericPerson.BASE_DATA_OBJECT_TYPE, personID));
|
||||||
orgaunit.setDirection(person);
|
orgaunit.setDirection(person);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
model com.arsdigita.cms.basetypes;
|
model com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
|
|
||||||
// Address object
|
// Address object
|
||||||
object type Address extends ContentPage {
|
object type GenericAddress extends ContentPage {
|
||||||
|
|
||||||
String [0..1] address = cms_addresses.address VARCHAR(1000);
|
String [0..1] address = cms_addresses.address VARCHAR(1000);
|
||||||
String [0..1] postalCode = cms_addresses.postalCode VARCHAR(20);
|
String [0..1] postalCode = cms_addresses.postalCode VARCHAR(20);
|
||||||
|
|
@ -17,12 +17,12 @@
|
||||||
//
|
//
|
||||||
// $Id: Article.pdl 287 2005-02-22 00:29:02Z sskracic $
|
// $Id: Article.pdl 287 2005-02-22 00:29:02Z sskracic $
|
||||||
// $DateTime: 2004/08/17 23:15:09 $
|
// $DateTime: 2004/08/17 23:15:09 $
|
||||||
model com.arsdigita.cms.basetypes;
|
model com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.*;
|
import com.arsdigita.cms.*;
|
||||||
import com.arsdigita.kernel.*;
|
import com.arsdigita.kernel.*;
|
||||||
|
|
||||||
object type Article extends TextPage {
|
object type GenericArticle extends TextPage {
|
||||||
|
|
||||||
reference key (cms_articles.article_id);
|
reference key (cms_articles.article_id);
|
||||||
|
|
||||||
|
|
@ -30,14 +30,14 @@ object type Article extends TextPage {
|
||||||
|
|
||||||
association {
|
association {
|
||||||
|
|
||||||
component ArticleImageAssociation[0..n] imageCaptions = join cms_articles.article_id
|
component GenericArticleImageAssociation[0..n] imageCaptions = join cms_articles.article_id
|
||||||
to cms_article_image_map.article_id;
|
to cms_article_image_map.article_id;
|
||||||
|
|
||||||
Article[1..1] captionArticle = join cms_article_image_map.article_id to cms_articles.article_id;
|
GenericArticle[1..1] captionArticle = join cms_article_image_map.article_id to cms_articles.article_id;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
object type ArticleImageAssociation extends ContentItem {
|
object type GenericArticleImageAssociation extends ContentItem {
|
||||||
String[0..1] caption = cms_article_image_map.caption VARCHAR(4000);
|
String[0..1] caption = cms_article_image_map.caption VARCHAR(4000);
|
||||||
|
|
||||||
// Only including these ID attributes for legacy purposes
|
// Only including these ID attributes for legacy purposes
|
||||||
|
|
@ -1,24 +1,24 @@
|
||||||
model com.arsdigita.cms.basetypes;
|
model com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.kernel.ACSObject;
|
import com.arsdigita.kernel.ACSObject;
|
||||||
import com.arsdigita.cms.*;
|
import com.arsdigita.cms.*;
|
||||||
|
|
||||||
// Contact Object
|
// Contact Object
|
||||||
object type Contact extends ContentPage {
|
object type GenericContact extends ContentPage {
|
||||||
|
|
||||||
Person [0..1] person = join cms_contacts.person_id
|
GenericPerson [0..1] person = join cms_contacts.person_id
|
||||||
to cms_persons.person_id;
|
to cms_persons.person_id;
|
||||||
|
|
||||||
Address [0..1] address = join cms_contacts.address_id
|
GenericAddress [0..1] address = join cms_contacts.address_id
|
||||||
to cms_addresses.address_id;
|
to cms_addresses.address_id;
|
||||||
|
|
||||||
component ContactEntry [0..n] contactentries = join cms_contacts.contact_id
|
component GenericContactEntry [0..n] contactentries = join cms_contacts.contact_id
|
||||||
to cms_contactEntries.contact_id;
|
to cms_contactEntries.contact_id;
|
||||||
|
|
||||||
reference key ( cms_contacts.contact_id );
|
reference key ( cms_contacts.contact_id );
|
||||||
}
|
}
|
||||||
|
|
||||||
object type ContactEntry extends ContentItem {
|
object type GenericContactEntry extends ContentItem {
|
||||||
|
|
||||||
String [1..1] key = cms_contactEntries.key VARCHAR(100);
|
String [1..1] key = cms_contactEntries.key VARCHAR(100);
|
||||||
String [0..1] description = cms_contactEntries.description VARCHAR(100);
|
String [0..1] description = cms_contactEntries.description VARCHAR(100);
|
||||||
|
|
@ -17,11 +17,11 @@
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
model com.arsdigita.cms.basetypes;
|
model com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
|
|
||||||
object type Person extends ContentPage {
|
object type GenericPerson extends ContentPage {
|
||||||
String[0..1] surname = cms_persons.surname VARCHAR(512);
|
String[0..1] surname = cms_persons.surname VARCHAR(512);
|
||||||
String[0..1] givenname = cms_persons.givenname VARCHAR(512);
|
String[0..1] givenname = cms_persons.givenname VARCHAR(512);
|
||||||
String[0..1] titlepre = cms_persons.titlepre VARCHAR(256);
|
String[0..1] titlepre = cms_persons.titlepre VARCHAR(256);
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
|
||||||
|
|
||||||
<ctd:content-type
|
|
||||||
label="Person"
|
|
||||||
description="A basic Person type"
|
|
||||||
objectType="com.arsdigita.cms.basetypes.Person"
|
|
||||||
classname="com.arsdigita.cms.basetypes.Person"
|
|
||||||
isInternal="yes">
|
|
||||||
|
|
||||||
<ctd:authoring-kit
|
|
||||||
createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
|
||||||
|
|
||||||
<ctd:authoring-step
|
|
||||||
labelKey="cms.contenttypes.shared.basic_properties.title"
|
|
||||||
labelBundle="com.arsdigita.cms.ui.CMSResources"
|
|
||||||
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
|
||||||
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
|
||||||
component="com.arsdigita.cms.basetypes.ui.PersonPropertiesStep"
|
|
||||||
ordering="1"/>
|
|
||||||
|
|
||||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
|
||||||
</ctd:authoring-kit>
|
|
||||||
|
|
||||||
</ctd:content-type>
|
|
||||||
</ctd:content-types>
|
|
||||||
|
|
@ -5,10 +5,10 @@
|
||||||
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
||||||
|
|
||||||
<ctd:content-type
|
<ctd:content-type
|
||||||
label="Contact"
|
label="GenericAddress"
|
||||||
description="A basic Contact type"
|
description="A generic address type"
|
||||||
objectType="com.arsdigita.cms.basetypes.Contact"
|
objectType="com.arsdigita.cms.contenttypes.GenericAddress"
|
||||||
classname="com.arsdigita.cms.basetypes.Contact"
|
classname="com.arsdigita.cms.contenttypes.GenericAddress"
|
||||||
isInternal="yes">
|
isInternal="yes">
|
||||||
|
|
||||||
<ctd:authoring-kit
|
<ctd:authoring-kit
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
labelBundle="com.arsdigita.cms.ui.CMSResources"
|
labelBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
||||||
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
component="com.arsdigita.cms.basetypes.ui.ContactPropertiesStep"
|
component="com.arsdigita.cms.contenttypes.ui.GenericAddressPropertiesStep"
|
||||||
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"/>
|
||||||
|
|
@ -5,10 +5,10 @@
|
||||||
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
||||||
|
|
||||||
<ctd:content-type
|
<ctd:content-type
|
||||||
label="Article"
|
label="GenericArticle"
|
||||||
description="A basic article type"
|
description="A generic article type"
|
||||||
objectType="com.arsdigita.cms.basetypes.Article"
|
objectType="com.arsdigita.cms.contenttypes.GenericArticle"
|
||||||
classname="com.arsdigita.cms.basetypes.Article"
|
classname="com.arsdigita.cms.contenttypes.GenericArticle"
|
||||||
isInternal="yes">
|
isInternal="yes">
|
||||||
|
|
||||||
</ctd:content-type>
|
</ctd:content-type>
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
||||||
|
|
||||||
|
<ctd:content-type
|
||||||
|
label="GenericContact"
|
||||||
|
description="A generic Contact type"
|
||||||
|
objectType="com.arsdigita.cms.contenttypes.GenericContact"
|
||||||
|
classname="com.arsdigita.cms.contenttypes.GenericContact"
|
||||||
|
isInternal="yes">
|
||||||
|
|
||||||
|
<ctd:authoring-kit
|
||||||
|
createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
||||||
|
|
||||||
|
<ctd:authoring-step
|
||||||
|
labelKey="cms.contenttypes.shared.basic_properties.title"
|
||||||
|
labelBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
|
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
||||||
|
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
|
component="com.arsdigita.cms.contenttypes.ui.GenericContactPropertiesStep"
|
||||||
|
ordering="1"/>
|
||||||
|
|
||||||
|
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||||
|
</ctd:authoring-kit>
|
||||||
|
|
||||||
|
</ctd:content-type>
|
||||||
|
</ctd:content-types>
|
||||||
|
|
@ -5,10 +5,10 @@
|
||||||
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
||||||
|
|
||||||
<ctd:content-type
|
<ctd:content-type
|
||||||
label="Address"
|
label="GenericPerson"
|
||||||
description="A basic address type"
|
description="A generic Person type"
|
||||||
objectType="com.arsdigita.cms.basetypes.Address"
|
objectType="com.arsdigita.cms.contenttypes.GenericPerson"
|
||||||
classname="com.arsdigita.cms.basetypes.Address"
|
classname="com.arsdigita.cms.contenttypes.GenericPerson"
|
||||||
isInternal="yes">
|
isInternal="yes">
|
||||||
|
|
||||||
<ctd:authoring-kit
|
<ctd:authoring-kit
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
labelBundle="com.arsdigita.cms.ui.CMSResources"
|
labelBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
||||||
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
component="com.arsdigita.cms.basetypes.ui.AddressPropertiesStep"
|
component="com.arsdigita.cms.contenttypes.ui.GenericPersonPropertiesStep"
|
||||||
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"/>
|
||||||
|
|
@ -85,7 +85,7 @@
|
||||||
</xrd:adapter>
|
</xrd:adapter>
|
||||||
|
|
||||||
<!-- Adds several image assets -->
|
<!-- Adds several image assets -->
|
||||||
<xrd:adapter objectType="com.arsdigita.cms.basetypes.Article" extends="com.arsdigita.cms.TextPage" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
|
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle" extends="com.arsdigita.cms.TextPage" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
|
||||||
<xrd:attributes rule="exclude">
|
<xrd:attributes rule="exclude">
|
||||||
<xrd:property name="/object/imageCaptions/id"/>
|
<xrd:property name="/object/imageCaptions/id"/>
|
||||||
<xrd:property name="/object/imageCaptions/defaultDomainClass"/>
|
<xrd:property name="/object/imageCaptions/defaultDomainClass"/>
|
||||||
|
|
@ -166,7 +166,7 @@
|
||||||
</xrd:adapter>
|
</xrd:adapter>
|
||||||
|
|
||||||
<!-- Adds several image assets -->
|
<!-- Adds several image assets -->
|
||||||
<xrd:adapter objectType="com.arsdigita.cms.basetypes.Article" extends="com.arsdigita.cms.TextPage" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
|
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle" extends="com.arsdigita.cms.TextPage" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
|
||||||
<xrd:attributes rule="exclude">
|
<xrd:attributes rule="exclude">
|
||||||
<xrd:property name="/object/imageCaptions/id"/>
|
<xrd:property name="/object/imageCaptions/id"/>
|
||||||
<xrd:property name="/object/imageCaptions/defaultDomainClass"/>
|
<xrd:property name="/object/imageCaptions/defaultDomainClass"/>
|
||||||
|
|
@ -232,4 +232,4 @@
|
||||||
</xrd:associations>
|
</xrd:associations>
|
||||||
</xrd:adapter>
|
</xrd:adapter>
|
||||||
</xrd:context>
|
</xrd:context>
|
||||||
</xrd:adapters>
|
</xrd:adapters>
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
storage="ccm-cms/lifecycle.properties"/>
|
storage="ccm-cms/lifecycle.properties"/>
|
||||||
<config class="com.arsdigita.cms.publishToFile.PublishToFileConfig"
|
<config class="com.arsdigita.cms.publishToFile.PublishToFileConfig"
|
||||||
storage="ccm-cms/publishToFile.properties"/>
|
storage="ccm-cms/publishToFile.properties"/>
|
||||||
<config class="com.arsdigita.cms.basetypes.AddressConfig"
|
<config class="com.arsdigita.cms.contenttypes.GenericAddressConfig"
|
||||||
storage="ccm-cms/basetypes.properties"/>
|
storage="ccm-cms/contenttypes.properties"/>
|
||||||
<config class="com.arsdigita.cms.basetypes.ContactConfig"
|
<config class="com.arsdigita.cms.contenttypes.GenericContactConfig"
|
||||||
storage="ccm-cms/basetypes.properties"/>
|
storage="ccm-cms/contenttypes.properties"/>
|
||||||
</registry>
|
</registry>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
com.arsdigita.cms.basetypes.address.hide_country_code_selection.title=Hide ISO Country Code
|
|
||||||
com.arsdigita.cms.basetypes.address.hide_country_code_selection.purpose=Hide the ISO country code selection box
|
|
||||||
com.arsdigita.cms.basetypes.address.hide_country_code_selection.example=false
|
|
||||||
com.arsdigita.cms.basetypes.address.hide_country_code_selection.format=[boolean]
|
|
||||||
|
|
||||||
com.arsdigita.cms.basetypes.address.hide_postal_code.title=Hide Postal Code
|
|
||||||
com.arsdigita.cms.basetypes.address.hide_postal_code.purpose=Hide the the postal code entry field
|
|
||||||
com.arsdigita.cms.basetypes.address.hide_postal_code.example=false
|
|
||||||
com.arsdigita.cms.basetypes.address.hide_postal_code.format=[boolean]
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
cms.basetypes.ui.address.address=Address
|
|
||||||
cms.basetypes.ui.address.postal_code=Postal Code
|
|
||||||
cms.basetypes.ui.address.city=City
|
|
||||||
cms.basetypes.ui.address.state=State
|
|
||||||
cms.basetypes.ui.address.iso_country_code=Country
|
|
||||||
cms.basetypes.ui.address.error_iso_country=You must select a country
|
|
||||||
|
|
||||||
cms.basetypes.ui.person.surname=Surname
|
|
||||||
cms.basetypes.ui.person.givenname=Given name
|
|
||||||
cms.basetypes.ui.person.titlepre=Title
|
|
||||||
cms.basetypes.ui.person.titlepost=Name appendix
|
|
||||||
|
|
||||||
address.authoring.basic_properties.title=Basic Properties
|
|
||||||
|
|
||||||
cms.basetypes.ui.contact.basic_properties=Basic Properties
|
|
||||||
cms.basetypes.ui.contact.edit_basic_properties=Edit Basic Properties
|
|
||||||
cms.basetypes.ui.contact.edit_basic_properties.description=Description
|
|
||||||
cms.basetypes.ui.contact.confirm_delete=Sure?
|
|
||||||
cms.basetypes.ui.contact.person=Person
|
|
||||||
cms.basetypes.ui.contact.address=Address
|
|
||||||
|
|
||||||
cms.basetypes.ui.contact.attach_address=Attach Address
|
|
||||||
cms.basetypes.ui.contact.edit_address=Edit Address
|
|
||||||
cms.basetypes.ui.contact.reattach_address=Reattach Address
|
|
||||||
cms.basetypes.ui.contact.delete_address=Delete Address
|
|
||||||
cms.basetypes.ui.contact.emptyAddress=There is no Address attached
|
|
||||||
cms.basetypes.ui.contact.select_address=Please select a contact content type
|
|
||||||
cms.basetypes.ui.contact.select_address.add=Add
|
|
||||||
cms.basetypes.ui.contact.select_address.change=Change
|
|
||||||
cms.basetypes.ui.contact.select_address.wrong_type=BaseAddress selection is required
|
|
||||||
cms.basetypes.ui.contact.select_address.cancelled=cancelled
|
|
||||||
cms.basetypes.ui.contact.delete_address.label=Do you want to delete the link to the contact content type?
|
|
||||||
cms.basetypes.ui.contact.delete_address.button_label=Delete
|
|
||||||
|
|
||||||
cms.basetypes.ui.contact.attach_person=Attach Person
|
|
||||||
cms.basetypes.ui.contact.edit_person=Edit Person
|
|
||||||
cms.basetypes.ui.contact.reattach_person=Reattach Person
|
|
||||||
cms.basetypes.ui.contact.delete_person=Delete Person
|
|
||||||
cms.basetypes.ui.contact.emptyPerson=There is no Address attached
|
|
||||||
cms.basetypes.ui.contact.select_person=Please select a Person content type
|
|
||||||
cms.basetypes.ui.contact.select_person.add=Add
|
|
||||||
cms.basetypes.ui.contact.select_person.change=Change
|
|
||||||
cms.basetypes.ui.contact.select_person.wrong_type=Person selection is required
|
|
||||||
cms.basetypes.ui.contact.select_person.cancelled=cancelled
|
|
||||||
cms.basetypes.ui.contact.delete_person.label=Do you want to delete the link to the Person content type?
|
|
||||||
cms.basetypes.ui.contact.delete_person.button_label=Delete
|
|
||||||
|
|
||||||
cms.basetypes.ui.contact.add_contactEntry=Add Contact Entry
|
|
||||||
cms.basetypes.ui.contact.contactEntry=Contact Entries
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key=Type
|
|
||||||
cms.basetypes.ui.contact.contactEntry.value=Value
|
|
||||||
cms.basetypes.ui.contact.contactEntry.description=Description (internal use only)
|
|
||||||
cms.basetypes.ui.contact.contactEntry.action=Action
|
|
||||||
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.contact_type=Type of Contact
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.office_hours=Office Hours
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.phone_office=Phone (office)
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.phone_private=Phone (private)
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.phone_mobile=Phone (mobile)
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.email=eMail
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.fax=Fax
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.im=Instant Messenger
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.www=Homepage
|
|
||||||
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
cms.basetypes.ui.address.address=Anschrift
|
|
||||||
cms.basetypes.ui.address.postal_code=Postleitzahl
|
|
||||||
cms.basetypes.ui.address.city=Stadt
|
|
||||||
cms.basetypes.ui.address.state=Bundesland
|
|
||||||
cms.basetypes.ui.address.iso_country_code=Land
|
|
||||||
cms.basetypes.ui.address.error_iso_country=Bitte w\u00E4hlen Sie ein Land aus
|
|
||||||
|
|
||||||
cms.basetypes.ui.person.surname=Nachname
|
|
||||||
cms.basetypes.ui.person.givenname=Vorname
|
|
||||||
cms.basetypes.ui.person.titlepre=Titel
|
|
||||||
cms.basetypes.ui.person.titlepost=Namesanhang
|
|
||||||
|
|
||||||
address.authoring.basic_properties.title=Eigenschaften von Adresse
|
|
||||||
|
|
||||||
cms.basetypes.ui.contact.basic_properties=Eigenschaften von Contact
|
|
||||||
cms.basetypes.ui.contact.edit_basic_properties=Bearbeiten
|
|
||||||
cms.basetypes.ui.contact.edit_basic_properties.description=Description
|
|
||||||
cms.basetypes.ui.contact.confirm_delete=Sind Sie sicher?
|
|
||||||
cms.basetypes.ui.contact.person=Person
|
|
||||||
cms.basetypes.ui.contact.address=Adresse
|
|
||||||
|
|
||||||
cms.basetypes.ui.contact.attach_address=Adresse verkn\u00FCpfen
|
|
||||||
cms.basetypes.ui.contact.edit_address=Adresse bearbeiten
|
|
||||||
cms.basetypes.ui.contact.reattach_address=Adresse neu verkn\u00FCpfen
|
|
||||||
cms.basetypes.ui.contact.delete_address=Adresse l\u00F6schen
|
|
||||||
cms.basetypes.ui.contact.emptyAddress=Zur Zeit ist keine Adresse verkn\u00FCpft
|
|
||||||
cms.basetypes.ui.contact.select_address=Bitte w\u00E4hlen Sie eine Eintrag vom Typ BaseAddress
|
|
||||||
cms.basetypes.ui.contact.select_address.add=Verkn\u00FCpfen
|
|
||||||
cms.basetypes.ui.contact.select_address.change=Ver\u00E4ndern
|
|
||||||
cms.basetypes.ui.contact.select_address.wrong_type=Der gew\u00E4hlte Eintrag ist nicht vom Typ BaseAddress
|
|
||||||
cms.basetypes.ui.contact.select_address.cancelled=Abbruch
|
|
||||||
cms.basetypes.ui.contact.delete_address.label=Wollen Sie die Verkn\u00FCpfung zur Adresse entfernen?
|
|
||||||
cms.basetypes.ui.contact.delete_address.button_label=L\u00F6schen
|
|
||||||
|
|
||||||
cms.basetypes.ui.contact.attach_person=Person verkn\u00FCpfen
|
|
||||||
cms.basetypes.ui.contact.edit_person=Person bearbeiten
|
|
||||||
cms.basetypes.ui.contact.reattach_person=Person neu verkn\u00FCpfen
|
|
||||||
cms.basetypes.ui.contact.delete_person=Person l\u00F6schen
|
|
||||||
cms.basetypes.ui.contact.emptyPerson=Zur Zeit ist keine Person verkn\u00FCft
|
|
||||||
cms.basetypes.ui.contact.select_person=Bitte w\u00E4hlen Sie einen Eintrag vom Typ Person
|
|
||||||
cms.basetypes.ui.contact.select_person.add=Verkn\u00FCpfen
|
|
||||||
cms.basetypes.ui.contact.select_person.change=Ver\u00E4ndern
|
|
||||||
cms.basetypes.ui.contact.select_person.wrong_type=Der gew\u00E4hlte Eintrag ist nicht vom Typ Person
|
|
||||||
cms.basetypes.ui.contact.select_person.cancelled=Abbruch
|
|
||||||
cms.basetypes.ui.contact.delete_person.label=WollenSie die Verkn\u00FCfung zur Person entfernen?
|
|
||||||
cms.basetypes.ui.contact.delete_person.button_label=L\u00F6schen
|
|
||||||
|
|
||||||
cms.basetypes.ui.contact.add_contactEntry=Kontaktinformation hinzuf\u00FCgen
|
|
||||||
cms.basetypes.ui.contact.contactEntry=Kontaktinformationen
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key=Art der Information
|
|
||||||
cms.basetypes.ui.contact.contactEntry.value=Inhalt
|
|
||||||
cms.basetypes.ui.contact.contactEntry.description=Beschreibung (wird nicht \u00F6ffentlich angezeigt)
|
|
||||||
cms.basetypes.ui.contact.contactEntry.action=Aktionen
|
|
||||||
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.contact_type=Kontaktart
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.office_hours=\u00D6ffnungszeiten
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.phone_office=Telefon (B\u00FCro)
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.phone_private=Telefon (Privat)
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.phone_mobile=Telefon (Mobil)
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.email=E-Mail
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.fax=Fax
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.im=Instant Messenger
|
|
||||||
cms.basetypes.ui.contact.contactEntry.key.www=Homepage
|
|
||||||
|
|
||||||
|
|
||||||
cms.basetypes.ui.contact.contactEntry.none=Zur Zeit sind keine Kontaktinformatioonen vorhanden
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
com.arsdigita.cms.basetypes.contact.hide_person.title=Hide person attachment
|
|
||||||
com.arsdigita.cms.basetypes.contact.hide_person.purpose=Hide the part to attach a person CT
|
|
||||||
com.arsdigita.cms.basetypes.contact.hide_person.example=false
|
|
||||||
com.arsdigita.cms.basetypes.contact.hide_person.format=[boolean]
|
|
||||||
|
|
||||||
com.arsdigita.cms.basetypes.contact.hide_address.title=Hide address attachment
|
|
||||||
com.arsdigita.cms.basetypes.contact.hide_address.purpose=Hide the part to attach a baseAddress CT
|
|
||||||
com.arsdigita.cms.basetypes.contact.hide_address.example=false
|
|
||||||
com.arsdigita.cms.basetypes.contact.hide_address.format=[boolean]
|
|
||||||
|
|
||||||
com.arsdigita.cms.basetypes.contact.address.hide_postal_code.title=Hide postal code for attached adress
|
|
||||||
com.arsdigita.cms.basetypes.contact.address.hide_postal_code.purpose=Hide the postal code entry field for the attached baseAddress
|
|
||||||
com.arsdigita.cms.basetypes.contact.address.hide_postal_code.example=false
|
|
||||||
com.arsdigita.cms.basetypes.contact.address.hide_postal_code.format=[boolean]
|
|
||||||
|
|
||||||
com.arsdigita.cms.basetypes.contact.address.hide_state.title=Hide state for attached adress
|
|
||||||
com.arsdigita.cms.basetypes.contact.address.hide_state.purpose=Hide the state entry field for the attached baseAddress
|
|
||||||
com.arsdigita.cms.basetypes.contact.address.hide_state.example=false
|
|
||||||
com.arsdigita.cms.basetypes.contact.address.hide_state.format=[boolean]
|
|
||||||
|
|
||||||
com.arsdigita.cms.basetypes.contact.address.hide_country.title=Hide country for attached address
|
|
||||||
com.arsdigita.cms.basetypes.contact.address.hide_country.purpose=Hide the country selection box for the attached baseAddress
|
|
||||||
com.arsdigita.cms.basetypes.contact.address.hide_country.example=false
|
|
||||||
com.arsdigita.cms.basetypes.contact.address.hide_country.format=[boolean]
|
|
||||||
|
|
||||||
com.arsdigita.cms.basetypes.contact.contact_entry_keys.title=Select available contact entry types
|
|
||||||
com.arsdigita.cms.basetypes.contact.contact_entry_keys.purpose=Select available contact entry types and define display order
|
|
||||||
com.arsdigita.cms.basetypes.contact.contact_entry_keys.example=contact_type,office_hours,phone_office,phone_private,phone_mobile,email,fax,im,www
|
|
||||||
com.arsdigita.cms.basetypes.contact.contact_entry_keys.format=[string]
|
|
||||||
|
|
@ -1,110 +0,0 @@
|
||||||
/*
|
|
||||||
* ContactAddressPropertiesStep.java
|
|
||||||
*
|
|
||||||
* Created on 4. Juli 2009, 15:15
|
|
||||||
*
|
|
||||||
* To change this template, choose Tools | Template Manager
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.PageState;
|
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
|
||||||
import com.arsdigita.domain.DomainObject;
|
|
||||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
|
||||||
import com.arsdigita.bebop.Component;
|
|
||||||
import com.arsdigita.bebop.Label;
|
|
||||||
import com.arsdigita.cms.basetypes.Address;
|
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author quasi
|
|
||||||
*/
|
|
||||||
public class ContactAddressPropertiesStep extends SimpleEditStep {
|
|
||||||
|
|
||||||
public static final String ADD_ADDRESS_SHEET_NAME = "addAddress";
|
|
||||||
public static final String EDIT_ADDRESS_SHEET_NAME = "editAddress";
|
|
||||||
public static final String CHANGE_ADDRESS_SHEET_NAME = "changeAddress";
|
|
||||||
public static final String DELETE_ADDRESS_SHEET_NAME = "deleteAddress";
|
|
||||||
|
|
||||||
/** Creates a new instance of ContactAddressPropertiesStep */
|
|
||||||
public ContactAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
|
||||||
this(itemModel, parent, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
public ContactAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
|
|
||||||
super(itemModel, parent, prefix);
|
|
||||||
|
|
||||||
// Contact contact = (Contact)itemModel.getSelectedObject(state);
|
|
||||||
|
|
||||||
//XXX
|
|
||||||
// if(/*contact.getAddress() == null*/ true) {
|
|
||||||
BasicPageForm attachAddressSheet = new ContactAttachAddressPropertyForm(itemModel, this);
|
|
||||||
add(ADD_ADDRESS_SHEET_NAME, (String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.attach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton());
|
|
||||||
|
|
||||||
/* Set the displayComponent for this step */
|
|
||||||
// setDisplayComponent(getEmptyBaseAddressPropertySheet(itemModel));
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
|
|
||||||
// editAddress
|
|
||||||
BasicPageForm editAddressSheet = new ContactEditAddressPropertyForm(itemModel, this);
|
|
||||||
add(EDIT_ADDRESS_SHEET_NAME, (String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.edit_address").localize(), new WorkflowLockedComponentAccess(editAddressSheet, itemModel), editAddressSheet.getSaveCancelSection().getCancelButton());
|
|
||||||
|
|
||||||
// BasicPageForm attachAddressSheet = new ContactAttachAddressPropertyForm(itemModel, this);
|
|
||||||
// add(CHANGE_ADDRESS_SHEET_NAME, (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.reattach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton());
|
|
||||||
|
|
||||||
BasicPageForm deleteAddressSheet = new ContactDeleteAddressForm(itemModel, this);
|
|
||||||
add(DELETE_ADDRESS_SHEET_NAME, (String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.delete_address").localize(), new WorkflowLockedComponentAccess(deleteAddressSheet, itemModel), deleteAddressSheet.getSaveCancelSection().getCancelButton());
|
|
||||||
|
|
||||||
/* Set the displayComponent for this step */
|
|
||||||
setDisplayComponent(getAddressPropertySheet(itemModel));
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Component getAddressPropertySheet(ItemSelectionModel itemModel) {
|
|
||||||
|
|
||||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
|
||||||
|
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.address").localize(), "address." + Address.ADDRESS);
|
|
||||||
if (!Contact.getConfig().getHideAddressPostalCode()) {
|
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.postal_code").localize(), "address." + Address.POSTAL_CODE);
|
|
||||||
}
|
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.city").localize(), "address." + Address.CITY);
|
|
||||||
if (!Contact.getConfig().getHideAddressState()) {
|
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.state").localize(), "address." + Address.STATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Contact.getConfig().getHideAddressCountry()) {
|
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.iso_country_code").localize(),
|
|
||||||
"address." + Address.ISO_COUNTRY_CODE,
|
|
||||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
|
||||||
|
|
||||||
public String format(DomainObject item,
|
|
||||||
String attribute,
|
|
||||||
PageState state) {
|
|
||||||
Address Address = ((Contact) item).getAddress();
|
|
||||||
if (Address != null && Address.getIsoCountryCode() != null) {
|
|
||||||
return Address.getCountryNameFromIsoCode(Address.getIsoCountryCode());
|
|
||||||
} else {
|
|
||||||
return (String) BasetypesGlobalizationUtil.globalize("cms.ui.unknown").localize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return sheet;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Component getEmptyBaseAddressPropertySheet(ItemSelectionModel itemModel) {
|
|
||||||
return new Label(((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.emptyAddress").localize()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
/*
|
|
||||||
* ContactPersonPropertiesStep.java
|
|
||||||
*
|
|
||||||
* Created on 4. Juli 2009, 15:12
|
|
||||||
*
|
|
||||||
* To change this template, choose Tools | Template Manager
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
|
||||||
|
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
|
||||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
|
||||||
import com.arsdigita.bebop.Component;
|
|
||||||
import com.arsdigita.bebop.Label;
|
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author quasi
|
|
||||||
*/
|
|
||||||
public class ContactPersonPropertiesStep extends SimpleEditStep {
|
|
||||||
|
|
||||||
public static final String ADD_PERSON_SHEET_NAME = "addPerson";
|
|
||||||
public static final String EDIT_PERSON_SHEET_NAME = "editPerson";
|
|
||||||
public static final String CHANGE_PERSON_SHEET_NAME = "changePerson";
|
|
||||||
public static final String DELETE_PERSON_SHEET_NAME = "deletePerson";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new instance of ContactPersonPropertiesStep
|
|
||||||
*/
|
|
||||||
public ContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
|
||||||
this(itemModel, parent, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
public ContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
|
|
||||||
super(itemModel, parent, prefix);
|
|
||||||
|
|
||||||
//XXX
|
|
||||||
// if(false/*EMPTY*/) {
|
|
||||||
|
|
||||||
BasicPageForm addPersonSheet = new ContactAttachPersonPropertyForm(itemModel, this);
|
|
||||||
add(ADD_PERSON_SHEET_NAME, (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.attach_person").localize(), new WorkflowLockedComponentAccess(addPersonSheet, itemModel), addPersonSheet.getSaveCancelSection().getCancelButton());
|
|
||||||
|
|
||||||
/* Set the displayComponent for this step */
|
|
||||||
// setDisplayComponent(getEmptyPersonPropertySheet(itemModel));
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
|
|
||||||
BasicPageForm editPersonSheet = new ContactEditPersonPropertyForm(itemModel, this);
|
|
||||||
add(EDIT_PERSON_SHEET_NAME, (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.edit_person").localize(), new WorkflowLockedComponentAccess(editPersonSheet, itemModel), editPersonSheet.getSaveCancelSection().getCancelButton());
|
|
||||||
|
|
||||||
// BasicPageForm changePersonSheet = new ContactEditPersonPropertyForm(itemModel, this);
|
|
||||||
// add(CHANGE_PERSON_SHEET_NAME, (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.reattach_person").localize(), new WorkflowLockedComponentAccess(changePersonSheet, itemModel), changePersonSheet.getSaveCancelSection().getCancelButton());
|
|
||||||
|
|
||||||
BasicPageForm deletePersonSheet = new ContactDeletePersonForm(itemModel, this);
|
|
||||||
add(DELETE_PERSON_SHEET_NAME, (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.delete_person").localize(), new WorkflowLockedComponentAccess(deletePersonSheet, itemModel), deletePersonSheet.getSaveCancelSection().getCancelButton());
|
|
||||||
|
|
||||||
/* Set the displayComponent for this step */
|
|
||||||
setDisplayComponent(getPersonPropertySheet(itemModel));
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Component getPersonPropertySheet(ItemSelectionModel itemModel) {
|
|
||||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
|
||||||
|
|
||||||
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.surname").localize(), "person." + Person.SURNAME);
|
|
||||||
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.givenname").localize(), "person." + Person.GIVENNAME);
|
|
||||||
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepre").localize(), "person." + Person.TITLEPRE);
|
|
||||||
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepost").localize(), "person." + Person.TITLEPOST);
|
|
||||||
|
|
||||||
return sheet;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Component getEmptyPersonPropertySheet(ItemSelectionModel itemModel) {
|
|
||||||
return new Label(((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.emptyPerson").localize()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
cms.contenttypes.ui.address.address=Address
|
||||||
|
cms.contenttypes.ui.address.postal_code=Postal Code
|
||||||
|
cms.contenttypes.ui.address.city=City
|
||||||
|
cms.contenttypes.ui.address.state=State
|
||||||
|
cms.contenttypes.ui.address.iso_country_code=Country
|
||||||
|
cms.contenttypes.ui.address.error_iso_country=You must select a country
|
||||||
|
|
||||||
|
cms.contenttypes.ui.person.surname=Surname
|
||||||
|
cms.contenttypes.ui.person.givenname=Given name
|
||||||
|
cms.contenttypes.ui.person.titlepre=Title
|
||||||
|
cms.contenttypes.ui.person.titlepost=Name appendix
|
||||||
|
|
||||||
|
address.authoring.basic_properties.title=Basic Properties
|
||||||
|
|
||||||
|
cms.contenttypes.ui.contact.basic_properties=Basic Properties
|
||||||
|
cms.contenttypes.ui.contact.edit_basic_properties=Edit Basic Properties
|
||||||
|
cms.contenttypes.ui.contact.edit_basic_properties.description=Description
|
||||||
|
cms.contenttypes.ui.contact.confirm_delete=Sure?
|
||||||
|
cms.contenttypes.ui.contact.person=Person
|
||||||
|
cms.contenttypes.ui.contact.address=Address
|
||||||
|
|
||||||
|
cms.contenttypes.ui.contact.attach_address=Attach Address
|
||||||
|
cms.contenttypes.ui.contact.edit_address=Edit Address
|
||||||
|
cms.contenttypes.ui.contact.reattach_address=Reattach Address
|
||||||
|
cms.contenttypes.ui.contact.delete_address=Delete Address
|
||||||
|
cms.contenttypes.ui.contact.emptyAddress=There is no Address attached
|
||||||
|
cms.contenttypes.ui.contact.select_address=Please select a contact content type
|
||||||
|
cms.contenttypes.ui.contact.select_address.add=Add
|
||||||
|
cms.contenttypes.ui.contact.select_address.change=Change
|
||||||
|
cms.contenttypes.ui.contact.select_address.wrong_type=BaseAddress selection is required
|
||||||
|
cms.contenttypes.ui.contact.select_address.cancelled=cancelled
|
||||||
|
cms.contenttypes.ui.contact.delete_address.label=Do you want to delete the link to the contact content type?
|
||||||
|
cms.contenttypes.ui.contact.delete_address.button_label=Delete
|
||||||
|
|
||||||
|
cms.contenttypes.ui.contact.attach_person=Attach Person
|
||||||
|
cms.contenttypes.ui.contact.edit_person=Edit Person
|
||||||
|
cms.contenttypes.ui.contact.reattach_person=Reattach Person
|
||||||
|
cms.contenttypes.ui.contact.delete_person=Delete Person
|
||||||
|
cms.contenttypes.ui.contact.emptyPerson=There is no Address attached
|
||||||
|
cms.contenttypes.ui.contact.select_person=Please select a Person content type
|
||||||
|
cms.contenttypes.ui.contact.select_person.add=Add
|
||||||
|
cms.contenttypes.ui.contact.select_person.change=Change
|
||||||
|
cms.contenttypes.ui.contact.select_person.wrong_type=Person selection is required
|
||||||
|
cms.contenttypes.ui.contact.select_person.cancelled=cancelled
|
||||||
|
cms.contenttypes.ui.contact.delete_person.label=Do you want to delete the link to the Person content type?
|
||||||
|
cms.contenttypes.ui.contact.delete_person.button_label=Delete
|
||||||
|
|
||||||
|
cms.contenttypes.ui.contact.add_contactEntry=Add Contact Entry
|
||||||
|
cms.contenttypes.ui.contact.contactEntry=Contact Entries
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key=Type
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.value=Value
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.description=Description (internal use only)
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.action=Action
|
||||||
|
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.contact_type=Type of Contact
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.office_hours=Office Hours
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.phone_office=Phone (office)
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.phone_private=Phone (private)
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.phone_mobile=Phone (mobile)
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.email=eMail
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.fax=Fax
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.im=Instant Messenger
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.www=Homepage
|
||||||
|
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
cms.contenttypes.ui.address.address=Anschrift
|
||||||
|
cms.contenttypes.ui.address.postal_code=Postleitzahl
|
||||||
|
cms.contenttypes.ui.address.city=Stadt
|
||||||
|
cms.contenttypes.ui.address.state=Bundesland
|
||||||
|
cms.contenttypes.ui.address.iso_country_code=Land
|
||||||
|
cms.contenttypes.ui.address.error_iso_country=Bitte w\u00E4hlen Sie ein Land aus
|
||||||
|
|
||||||
|
cms.contenttypes.ui.person.surname=Nachname
|
||||||
|
cms.contenttypes.ui.person.givenname=Vorname
|
||||||
|
cms.contenttypes.ui.person.titlepre=Titel
|
||||||
|
cms.contenttypes.ui.person.titlepost=Namesanhang
|
||||||
|
|
||||||
|
address.authoring.basic_properties.title=Eigenschaften von Adresse
|
||||||
|
|
||||||
|
cms.contenttypes.ui.contact.basic_properties=Eigenschaften von Contact
|
||||||
|
cms.contenttypes.ui.contact.edit_basic_properties=Bearbeiten
|
||||||
|
cms.contenttypes.ui.contact.edit_basic_properties.description=Description
|
||||||
|
cms.contenttypes.ui.contact.confirm_delete=Sind Sie sicher?
|
||||||
|
cms.contenttypes.ui.contact.person=Person
|
||||||
|
cms.contenttypes.ui.contact.address=Adresse
|
||||||
|
|
||||||
|
cms.contenttypes.ui.contact.attach_address=Adresse verkn\u00FCpfen
|
||||||
|
cms.contenttypes.ui.contact.edit_address=Adresse bearbeiten
|
||||||
|
cms.contenttypes.ui.contact.reattach_address=Adresse neu verkn\u00FCpfen
|
||||||
|
cms.contenttypes.ui.contact.delete_address=Adresse l\u00F6schen
|
||||||
|
cms.contenttypes.ui.contact.emptyAddress=Zur Zeit ist keine Adresse verkn\u00FCpft
|
||||||
|
cms.contenttypes.ui.contact.select_address=Bitte w\u00E4hlen Sie eine Eintrag vom Typ BaseAddress
|
||||||
|
cms.contenttypes.ui.contact.select_address.add=Verkn\u00FCpfen
|
||||||
|
cms.contenttypes.ui.contact.select_address.change=Ver\u00E4ndern
|
||||||
|
cms.contenttypes.ui.contact.select_address.wrong_type=Der gew\u00E4hlte Eintrag ist nicht vom Typ BaseAddress
|
||||||
|
cms.contenttypes.ui.contact.select_address.cancelled=Abbruch
|
||||||
|
cms.contenttypes.ui.contact.delete_address.label=Wollen Sie die Verkn\u00FCpfung zur Adresse entfernen?
|
||||||
|
cms.contenttypes.ui.contact.delete_address.button_label=L\u00F6schen
|
||||||
|
|
||||||
|
cms.contenttypes.ui.contact.attach_person=Person verkn\u00FCpfen
|
||||||
|
cms.contenttypes.ui.contact.edit_person=Person bearbeiten
|
||||||
|
cms.contenttypes.ui.contact.reattach_person=Person neu verkn\u00FCpfen
|
||||||
|
cms.contenttypes.ui.contact.delete_person=Person l\u00F6schen
|
||||||
|
cms.contenttypes.ui.contact.emptyPerson=Zur Zeit ist keine Person verkn\u00FCft
|
||||||
|
cms.contenttypes.ui.contact.select_person=Bitte w\u00E4hlen Sie einen Eintrag vom Typ Person
|
||||||
|
cms.contenttypes.ui.contact.select_person.add=Verkn\u00FCpfen
|
||||||
|
cms.contenttypes.ui.contact.select_person.change=Ver\u00E4ndern
|
||||||
|
cms.contenttypes.ui.contact.select_person.wrong_type=Der gew\u00E4hlte Eintrag ist nicht vom Typ Person
|
||||||
|
cms.contenttypes.ui.contact.select_person.cancelled=Abbruch
|
||||||
|
cms.contenttypes.ui.contact.delete_person.label=WollenSie die Verkn\u00FCfung zur Person entfernen?
|
||||||
|
cms.contenttypes.ui.contact.delete_person.button_label=L\u00F6schen
|
||||||
|
|
||||||
|
cms.contenttypes.ui.contact.add_contactEntry=Kontaktinformation hinzuf\u00FCgen
|
||||||
|
cms.contenttypes.ui.contact.contactEntry=Kontaktinformationen
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key=Art der Information
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.value=Inhalt
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.description=Beschreibung (wird nicht \u00F6ffentlich angezeigt)
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.action=Aktionen
|
||||||
|
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.contact_type=Kontaktart
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.office_hours=\u00D6ffnungszeiten
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.phone_office=Telefon (B\u00FCro)
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.phone_private=Telefon (Privat)
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.phone_mobile=Telefon (Mobil)
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.email=E-Mail
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.fax=Fax
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.im=Instant Messenger
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.key.www=Homepage
|
||||||
|
|
||||||
|
|
||||||
|
cms.contenttypes.ui.contact.contactEntry.none=Zur Zeit sind keine Kontaktinformatioonen vorhanden
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.globalization.LocaleNegotiator;
|
import com.arsdigita.globalization.LocaleNegotiator;
|
||||||
|
|
@ -42,7 +42,7 @@ import java.util.TreeMap;
|
||||||
*
|
*
|
||||||
* @author Sören Bernstein
|
* @author Sören Bernstein
|
||||||
**/
|
**/
|
||||||
public class Address extends ContentPage {
|
public class GenericAddress extends ContentPage {
|
||||||
|
|
||||||
/** PDL property name for address */
|
/** PDL property name for address */
|
||||||
public static final String ADDRESS = "address";
|
public static final String ADDRESS = "address";
|
||||||
|
|
@ -57,21 +57,21 @@ public class Address extends ContentPage {
|
||||||
|
|
||||||
/** Data object type for this domain object */
|
/** Data object type for this domain object */
|
||||||
public static final String BASE_DATA_OBJECT_TYPE
|
public static final String BASE_DATA_OBJECT_TYPE
|
||||||
= "com.arsdigita.cms.basetypes.Address";
|
= "com.arsdigita.cms.contenttypes.GenericAddress";
|
||||||
|
|
||||||
private static AddressConfig s_config = new AddressConfig();
|
private static GenericAddressConfig s_config = new GenericAddressConfig();
|
||||||
static {
|
static {
|
||||||
s_config.load();
|
s_config.load();
|
||||||
}
|
}
|
||||||
public static AddressConfig getConfig()
|
public static GenericAddressConfig getConfig()
|
||||||
{
|
{
|
||||||
return s_config;
|
return s_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor. This creates a new (empty) Address.
|
* Default constructor. This creates a new (empty) GenericAddress.
|
||||||
**/
|
**/
|
||||||
public Address() {
|
public GenericAddress() {
|
||||||
this(BASE_DATA_OBJECT_TYPE);
|
this(BASE_DATA_OBJECT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,12 +79,12 @@ public class Address extends ContentPage {
|
||||||
* Constructor. The contained <code>DataObject</code> is retrieved
|
* Constructor. The contained <code>DataObject</code> is retrieved
|
||||||
* from the persistent storage mechanism with an <code>OID</code>
|
* from the persistent storage mechanism with an <code>OID</code>
|
||||||
* specified by <i>id</i> and
|
* specified by <i>id</i> and
|
||||||
* <code>Address.BASE_DATA_OBJECT_TYPE</code>.
|
* <code>GenericAddress.BASE_DATA_OBJECT_TYPE</code>.
|
||||||
*
|
*
|
||||||
* @param id The <code>id</code> for the retrieved
|
* @param id The <code>id</code> for the retrieved
|
||||||
* <code>DataObject</code>.
|
* <code>DataObject</code>.
|
||||||
**/
|
**/
|
||||||
public Address(BigDecimal id) throws DataObjectNotFoundException {
|
public GenericAddress(BigDecimal id) throws DataObjectNotFoundException {
|
||||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ public class Address extends ContentPage {
|
||||||
* @param id The <code>OID</code> for the retrieved
|
* @param id The <code>OID</code> for the retrieved
|
||||||
* <code>DataObject</code>.
|
* <code>DataObject</code>.
|
||||||
**/
|
**/
|
||||||
public Address(OID id) throws DataObjectNotFoundException {
|
public GenericAddress(OID id) throws DataObjectNotFoundException {
|
||||||
super(id);
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ public class Address extends ContentPage {
|
||||||
* @param obj The <code>DataObject</code> with which to create or
|
* @param obj The <code>DataObject</code> with which to create or
|
||||||
* load a content item
|
* load a content item
|
||||||
*/
|
*/
|
||||||
public Address(DataObject obj) {
|
public GenericAddress(DataObject obj) {
|
||||||
super(obj);
|
super(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -118,7 +118,7 @@ public class Address extends ContentPage {
|
||||||
* @param type The <code>String</code> data object type of the
|
* @param type The <code>String</code> data object type of the
|
||||||
* item to create
|
* item to create
|
||||||
*/
|
*/
|
||||||
public Address(String type) {
|
public GenericAddress(String type) {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -16,25 +16,25 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
import com.arsdigita.util.parameter.Parameter;
|
import com.arsdigita.util.parameter.Parameter;
|
||||||
import com.arsdigita.util.parameter.BooleanParameter;
|
import com.arsdigita.util.parameter.BooleanParameter;
|
||||||
|
|
||||||
public class AddressConfig extends AbstractConfig {
|
public class GenericAddressConfig extends AbstractConfig {
|
||||||
|
|
||||||
private final Parameter m_hideCountryCodeSelection;
|
private final Parameter m_hideCountryCodeSelection;
|
||||||
private final Parameter m_hidePostalCode;
|
private final Parameter m_hidePostalCode;
|
||||||
|
|
||||||
public AddressConfig() {
|
public GenericAddressConfig() {
|
||||||
m_hideCountryCodeSelection = new BooleanParameter(
|
m_hideCountryCodeSelection = new BooleanParameter(
|
||||||
"com.arsdigita.cms.basetypes.ddress.hide_country_code_selection",
|
"com.arsdigita.cms.contenttypes.generic_address.hide_country_code_selection",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
new Boolean(false));
|
new Boolean(false));
|
||||||
|
|
||||||
m_hidePostalCode = new BooleanParameter(
|
m_hidePostalCode = new BooleanParameter(
|
||||||
"com.arsdigita.cms.basetypes.address.hide_postal_code",
|
"com.arsdigita.cms.contenttypes.generic_address.hide_postal_code",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
new Boolean(false));
|
new Boolean(false));
|
||||||
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
com.arsdigita.cms.contenttypes.generic_address.hide_country_code_selection.title=Hide ISO Country Code
|
||||||
|
com.arsdigita.cms.contenttypes.generic_address.hide_country_code_selection.purpose=Hide the ISO country code selection box
|
||||||
|
com.arsdigita.cms.contenttypes.generic_address.hide_country_code_selection.example=false
|
||||||
|
com.arsdigita.cms.contenttypes.generic_address.hide_country_code_selection.format=[boolean]
|
||||||
|
|
||||||
|
com.arsdigita.cms.contenttypes.generic_address.hide_postal_code.title=Hide Postal Code
|
||||||
|
com.arsdigita.cms.contenttypes.generic_address.hide_postal_code.purpose=Hide the the postal code entry field
|
||||||
|
com.arsdigita.cms.contenttypes.generic_address.hide_postal_code.example=false
|
||||||
|
com.arsdigita.cms.contenttypes.generic_address.hide_postal_code.format=[boolean]
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
import com.arsdigita.cms.ImageAssetCollection;
|
import com.arsdigita.cms.ImageAssetCollection;
|
||||||
|
|
@ -38,22 +38,22 @@ import java.math.BigDecimal;
|
||||||
* @version $Revision: #28 $ $Date: 2004/08/17 $
|
* @version $Revision: #28 $ $Date: 2004/08/17 $
|
||||||
* @version $Id: Article.java 2070 2010-01-28 08:47:41Z pboy $
|
* @version $Id: Article.java 2070 2010-01-28 08:47:41Z pboy $
|
||||||
*/
|
*/
|
||||||
public class Article extends TextPage {
|
public class GenericArticle extends TextPage {
|
||||||
|
|
||||||
public static final String BASE_DATA_OBJECT_TYPE =
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
"com.arsdigita.cms.basetypes.Article";
|
"com.arsdigita.cms.contenttypes.GenericArticle";
|
||||||
|
|
||||||
protected static final String IMAGES = "imageAssets";
|
protected static final String IMAGES = "imageAssets";
|
||||||
|
|
||||||
private static final String IMAGE_CAPTIONS = "imageCaptions";
|
private static final String IMAGE_CAPTIONS = "imageCaptions";
|
||||||
|
|
||||||
private static org.apache.log4j.Logger s_log =
|
private static org.apache.log4j.Logger s_log =
|
||||||
org.apache.log4j.Logger.getLogger(Article.class);
|
org.apache.log4j.Logger.getLogger(GenericArticle.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor. This creates a new article.
|
* Default constructor. This creates a new article.
|
||||||
**/
|
**/
|
||||||
public Article() {
|
public GenericArticle() {
|
||||||
super(BASE_DATA_OBJECT_TYPE);
|
super(BASE_DATA_OBJECT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -65,11 +65,11 @@ public class Article extends TextPage {
|
||||||
* @param oid The <code>OID</code> for the retrieved
|
* @param oid The <code>OID</code> for the retrieved
|
||||||
* <code>DataObject</code>.
|
* <code>DataObject</code>.
|
||||||
**/
|
**/
|
||||||
public Article(OID oid) throws DataObjectNotFoundException {
|
public GenericArticle(OID oid) throws DataObjectNotFoundException {
|
||||||
super(oid);
|
super(oid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Article(String type) {
|
public GenericArticle(String type) {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -82,11 +82,11 @@ public class Article extends TextPage {
|
||||||
* @param id The <code>id</code> for the retrieved
|
* @param id The <code>id</code> for the retrieved
|
||||||
* <code>DataObject</code>.
|
* <code>DataObject</code>.
|
||||||
**/
|
**/
|
||||||
public Article(BigDecimal id) throws DataObjectNotFoundException {
|
public GenericArticle(BigDecimal id) throws DataObjectNotFoundException {
|
||||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Article(DataObject obj) {
|
public GenericArticle(DataObject obj) {
|
||||||
super(obj);
|
super(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,14 +109,14 @@ public class Article extends TextPage {
|
||||||
*/
|
*/
|
||||||
public boolean addImage(ImageAsset image, String caption) {
|
public boolean addImage(ImageAsset image, String caption) {
|
||||||
ImageAssetCollection col = getImages();
|
ImageAssetCollection col = getImages();
|
||||||
col.addEqualsFilter(ArticleImageAssociation.IMAGE_ID,image.getID());
|
col.addEqualsFilter(GenericArticleImageAssociation.IMAGE_ID,image.getID());
|
||||||
boolean toReturn = false;
|
boolean toReturn = false;
|
||||||
ArticleImageAssociation assn = null;
|
GenericArticleImageAssociation assn = null;
|
||||||
if (col.next()) {
|
if (col.next()) {
|
||||||
assn = (ArticleImageAssociation)(col.getDomainObject());
|
assn = (GenericArticleImageAssociation)(col.getDomainObject());
|
||||||
col.close();
|
col.close();
|
||||||
} else {
|
} else {
|
||||||
assn = new ArticleImageAssociation();
|
assn = new GenericArticleImageAssociation();
|
||||||
String name = this.getName();
|
String name = this.getName();
|
||||||
Assert.exists(name, String.class);
|
Assert.exists(name, String.class);
|
||||||
String imgName = image.getName();
|
String imgName = image.getName();
|
||||||
|
|
@ -136,8 +136,8 @@ public class Article extends TextPage {
|
||||||
* Get the caption of the image
|
* Get the caption of the image
|
||||||
* @deprecated Do not use this method, it will always return the
|
* @deprecated Do not use this method, it will always return the
|
||||||
* first available caption regardless of what image is in use. Use
|
* first available caption regardless of what image is in use. Use
|
||||||
* ArticleImageAssnCollection.getCaption() or
|
* GenericArticleImageAssnCollection.getCaption() or
|
||||||
* ArticleImageAssociation.getCaption().
|
* GenericArticleImageAssociation.getCaption().
|
||||||
* @return the caption, or null if the image is not associated to this
|
* @return the caption, or null if the image is not associated to this
|
||||||
* article
|
* article
|
||||||
*/
|
*/
|
||||||
|
|
@ -156,7 +156,7 @@ public class Article extends TextPage {
|
||||||
* @return true is the image is removed, false otherwise.
|
* @return true is the image is removed, false otherwise.
|
||||||
*/
|
*/
|
||||||
public boolean removeImage(ImageAsset image) {
|
public boolean removeImage(ImageAsset image) {
|
||||||
ArticleImageAssociation assn = ArticleImageAssociation
|
GenericArticleImageAssociation assn = GenericArticleImageAssociation
|
||||||
.retrieveAssociation(getID(), image.getID());
|
.retrieveAssociation(getID(), image.getID());
|
||||||
if (assn != null) {
|
if (assn != null) {
|
||||||
assn.delete();
|
assn.delete();
|
||||||
|
|
@ -171,7 +171,7 @@ public class Article extends TextPage {
|
||||||
*/
|
*/
|
||||||
public ImageAssetCollection getImages() {
|
public ImageAssetCollection getImages() {
|
||||||
DataAssociationCursor dac = ((DataAssociation) get(IMAGE_CAPTIONS)).cursor();
|
DataAssociationCursor dac = ((DataAssociation) get(IMAGE_CAPTIONS)).cursor();
|
||||||
ImageAssetCollection images = new ArticleImageAssnCollection(dac);
|
ImageAssetCollection images = new GenericArticleImageAssnCollection(dac);
|
||||||
return images;
|
return images;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,7 +190,7 @@ public class Article extends TextPage {
|
||||||
super.propagateMaster(master);
|
super.propagateMaster(master);
|
||||||
ImageAssetCollection collection = getImages();
|
ImageAssetCollection collection = getImages();
|
||||||
while (collection.next()) {
|
while (collection.next()) {
|
||||||
ArticleImageAssociation assn = (ArticleImageAssociation)(collection.getDomainObject());
|
GenericArticleImageAssociation assn = (GenericArticleImageAssociation)(collection.getDomainObject());
|
||||||
assn.setMaster(master);
|
assn.setMaster(master);
|
||||||
assn.save();
|
assn.save();
|
||||||
}
|
}
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
import com.arsdigita.cms.ImageAssetCollection;
|
import com.arsdigita.cms.ImageAssetCollection;
|
||||||
|
|
@ -37,26 +37,26 @@ import com.arsdigita.persistence.Filter;
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author Hugh Brock .
|
* @author Hugh Brock .
|
||||||
* @version $Id: ArticleImageAssnCollection.java 287 2005-02-22 00:29:02Z sskracic $
|
* @version $Id: GenericArticleImageAssnCollection.java 287 2005-02-22 00:29:02Z sskracic $
|
||||||
*/
|
*/
|
||||||
public class ArticleImageAssnCollection extends ImageAssetCollection {
|
public class GenericArticleImageAssnCollection extends ImageAssetCollection {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. Should only be called from Article.getImages()
|
* Constructor. Should only be called from Article.getImages()
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
protected ArticleImageAssnCollection(DataCollection dataCollection) {
|
protected GenericArticleImageAssnCollection(DataCollection dataCollection) {
|
||||||
super(dataCollection);
|
super(dataCollection);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a <code>DomainObject</code> (the
|
* Returns a <code>DomainObject</code> (the
|
||||||
* ArticleImageAssociation for the current position in the
|
* GenericArticleImageAssociation for the current position in the
|
||||||
* collection.
|
* collection.
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
public DomainObject getDomainObject() {
|
public DomainObject getDomainObject() {
|
||||||
return new ArticleImageAssociation
|
return new GenericArticleImageAssociation
|
||||||
(m_dataCollection.getDataObject());
|
(m_dataCollection.getDataObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,11 +66,11 @@ public class ArticleImageAssnCollection extends ImageAssetCollection {
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
public ImageAsset getImage() {
|
public ImageAsset getImage() {
|
||||||
return ((ArticleImageAssociation)getDomainObject()).getImage();
|
return ((GenericArticleImageAssociation)getDomainObject()).getImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCaption() {
|
public String getCaption() {
|
||||||
return ((ArticleImageAssociation)getDomainObject()).getCaption();
|
return ((GenericArticleImageAssociation)getDomainObject()).getCaption();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exposed methods
|
// Exposed methods
|
||||||
|
|
@ -16,14 +16,13 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.cms.CustomCopy;
|
import com.arsdigita.cms.CustomCopy;
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
import com.arsdigita.cms.ItemCollection;
|
import com.arsdigita.cms.ItemCollection;
|
||||||
import com.arsdigita.cms.ItemCopier;
|
import com.arsdigita.cms.ItemCopier;
|
||||||
import com.arsdigita.cms.basetypes.Article;
|
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.persistence.DataCollection;
|
import com.arsdigita.persistence.DataCollection;
|
||||||
|
|
@ -37,17 +36,17 @@ import com.arsdigita.versioning.VersionedACSObject;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class associates an Article and an Image with a particular
|
* This class associates an GenericArticle and an Image with a particular
|
||||||
* caption.
|
* caption.
|
||||||
*
|
*
|
||||||
* @author Jack Chung (flattop@arsdigita.com)
|
* @author Jack Chung (flattop@arsdigita.com)
|
||||||
* @version $Revision: #17 $ $Date: 2004/08/17 $
|
* @version $Revision: #17 $ $Date: 2004/08/17 $
|
||||||
* @version $Id: ArticleImageAssociation.java 287 2005-02-22 00:29:02Z sskracic $
|
* @version $Id: GenericArticleImageAssociation.java 287 2005-02-22 00:29:02Z sskracic $
|
||||||
*/
|
*/
|
||||||
public class ArticleImageAssociation extends ContentItem {
|
public class GenericArticleImageAssociation extends ContentItem {
|
||||||
|
|
||||||
public static final String BASE_DATA_OBJECT_TYPE =
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
"com.arsdigita.cms.ArticleImageAssociation";
|
"com.arsdigita.cms.GenericArticleImageAssociation";
|
||||||
|
|
||||||
protected static final String ARTICLE = "captionArticle";
|
protected static final String ARTICLE = "captionArticle";
|
||||||
protected static final String IMAGE = "imageAsset";
|
protected static final String IMAGE = "imageAsset";
|
||||||
|
|
@ -59,7 +58,7 @@ public class ArticleImageAssociation extends ContentItem {
|
||||||
/**
|
/**
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
**/
|
**/
|
||||||
public ArticleImageAssociation() {
|
public GenericArticleImageAssociation() {
|
||||||
super(BASE_DATA_OBJECT_TYPE);
|
super(BASE_DATA_OBJECT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,15 +70,15 @@ public class ArticleImageAssociation extends ContentItem {
|
||||||
* @param oid The <code>OID</code> for the retrieved
|
* @param oid The <code>OID</code> for the retrieved
|
||||||
* <code>DataObject</code>.
|
* <code>DataObject</code>.
|
||||||
**/
|
**/
|
||||||
public ArticleImageAssociation(OID oid) throws DataObjectNotFoundException {
|
public GenericArticleImageAssociation(OID oid) throws DataObjectNotFoundException {
|
||||||
super(oid);
|
super(oid);
|
||||||
}
|
}
|
||||||
public ArticleImageAssociation(DataObject obj) {
|
public GenericArticleImageAssociation(DataObject obj) {
|
||||||
super(obj);
|
super(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ArticleImageAssociation(String type) {
|
public GenericArticleImageAssociation(String type) {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -87,7 +86,7 @@ public class ArticleImageAssociation extends ContentItem {
|
||||||
* This returns the association object that is specified by
|
* This returns the association object that is specified by
|
||||||
* the passed in IDs or it returns null if no such association exists
|
* the passed in IDs or it returns null if no such association exists
|
||||||
*/
|
*/
|
||||||
public static ArticleImageAssociation retrieveAssociation
|
public static GenericArticleImageAssociation retrieveAssociation
|
||||||
(BigDecimal articleID, BigDecimal imageID) {
|
(BigDecimal articleID, BigDecimal imageID) {
|
||||||
DataCollection collection = SessionManager.getSession().retrieve
|
DataCollection collection = SessionManager.getSession().retrieve
|
||||||
(BASE_DATA_OBJECT_TYPE);
|
(BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
@ -96,8 +95,8 @@ public class ArticleImageAssociation extends ContentItem {
|
||||||
// no deleted associations, please
|
// no deleted associations, please
|
||||||
collection.addEqualsFilter(VersionedACSObject.IS_DELETED, new BigDecimal(0));
|
collection.addEqualsFilter(VersionedACSObject.IS_DELETED, new BigDecimal(0));
|
||||||
if (collection.next()) {
|
if (collection.next()) {
|
||||||
ArticleImageAssociation association =
|
GenericArticleImageAssociation association =
|
||||||
new ArticleImageAssociation(collection.getDataObject());
|
new GenericArticleImageAssociation(collection.getDataObject());
|
||||||
collection.close();
|
collection.close();
|
||||||
return association;
|
return association;
|
||||||
}
|
}
|
||||||
|
|
@ -146,8 +145,9 @@ public class ArticleImageAssociation extends ContentItem {
|
||||||
if (!returnValue) {
|
if (!returnValue) {
|
||||||
if (!image.getVersion().equals(ContentItem.DRAFT)) {
|
if (!image.getVersion().equals(ContentItem.DRAFT)) {
|
||||||
ContentItem item = image.getWorkingVersion();
|
ContentItem item = image.getWorkingVersion();
|
||||||
if (item != null)
|
if (item != null) {
|
||||||
returnValue = imageHasDirectAssociation(item.getID());
|
returnValue = imageHasDirectAssociation(item.getID());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!returnValue) {
|
if (!returnValue) {
|
||||||
|
|
@ -162,8 +162,9 @@ public class ArticleImageAssociation extends ContentItem {
|
||||||
if (!returnValue) {
|
if (!returnValue) {
|
||||||
if (!image.getVersion().equals(ContentItem.LIVE)) {
|
if (!image.getVersion().equals(ContentItem.LIVE)) {
|
||||||
ContentItem item = image.getLiveVersion();
|
ContentItem item = image.getLiveVersion();
|
||||||
if (item != null)
|
if (item != null) {
|
||||||
returnValue = imageHasDirectAssociation(item.getID());
|
returnValue = imageHasDirectAssociation(item.getID());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -183,17 +184,17 @@ public class ArticleImageAssociation extends ContentItem {
|
||||||
return (BigDecimal) get(ARTICLE_ID);
|
return (BigDecimal) get(ARTICLE_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Article getArticle() {
|
public GenericArticle getArticle() {
|
||||||
DataCollection col = SessionManager.getSession().retrieve(ARTICLE);
|
DataCollection col = SessionManager.getSession().retrieve(ARTICLE);
|
||||||
if (col.next()) {
|
if (col.next()) {
|
||||||
Article art = new Article(col.getDataObject());
|
GenericArticle art = new GenericArticle(col.getDataObject());
|
||||||
col.close();
|
col.close();
|
||||||
return art;
|
return art;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setArticle(Article article) {
|
public void setArticle(GenericArticle article) {
|
||||||
setAssociation(ARTICLE, article);
|
setAssociation(ARTICLE, article);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -229,6 +230,7 @@ public class ArticleImageAssociation extends ContentItem {
|
||||||
* that regular metadata-driven methods should be used
|
* that regular metadata-driven methods should be used
|
||||||
* to copy the property.
|
* to copy the property.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean copyProperty(final CustomCopy source,
|
public boolean copyProperty(final CustomCopy source,
|
||||||
final Property property,
|
final Property property,
|
||||||
final ItemCopier copier) {
|
final ItemCopier copier) {
|
||||||
|
|
@ -240,7 +242,7 @@ public class ArticleImageAssociation extends ContentItem {
|
||||||
|
|
||||||
if (copier.getCopyType() == ItemCopier.VERSION_COPY
|
if (copier.getCopyType() == ItemCopier.VERSION_COPY
|
||||||
&& IMAGE.equals(attribute)) {
|
&& IMAGE.equals(attribute)) {
|
||||||
ImageAsset image = ((ArticleImageAssociation)source).getImage();
|
ImageAsset image = ((GenericArticleImageAssociation)source).getImage();
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
ImageAsset liveImage = (ImageAsset) image.getLiveVersion();
|
ImageAsset liveImage = (ImageAsset) image.getLiveVersion();
|
||||||
if (liveImage == null) {
|
if (liveImage == null) {
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.persistence.OID;
|
import com.arsdigita.persistence.OID;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
|
@ -33,7 +33,7 @@ import java.math.BigDecimal;
|
||||||
* This content type represents an basic contact
|
* This content type represents an basic contact
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Contact extends ContentPage {
|
public class GenericContact extends ContentPage {
|
||||||
|
|
||||||
/** PDL property names */
|
/** PDL property names */
|
||||||
public static final String PERSON = "person";
|
public static final String PERSON = "person";
|
||||||
|
|
@ -41,34 +41,34 @@ public class Contact extends ContentPage {
|
||||||
public static final String CONTACT_ENTRIES = "contactentries";
|
public static final String CONTACT_ENTRIES = "contactentries";
|
||||||
|
|
||||||
// Config
|
// Config
|
||||||
private static final ContactConfig s_config = new ContactConfig();
|
private static final GenericContactConfig s_config = new GenericContactConfig();
|
||||||
static {
|
static {
|
||||||
s_config.load();
|
s_config.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Data object type for tihs domain object */
|
/** Data object type for tihs domain object */
|
||||||
public static final String BASE_DATA_OBJECT_TYPE
|
public static final String BASE_DATA_OBJECT_TYPE
|
||||||
= "com.arsdigita.cms.basetypes.Contact";
|
= "com.arsdigita.cms.contenttypes.GenericContact";
|
||||||
|
|
||||||
public Contact() {
|
public GenericContact() {
|
||||||
super(BASE_DATA_OBJECT_TYPE);
|
super(BASE_DATA_OBJECT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Contact(BigDecimal id)
|
public GenericContact(BigDecimal id)
|
||||||
throws DataObjectNotFoundException {
|
throws DataObjectNotFoundException {
|
||||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Contact(OID id)
|
public GenericContact(OID id)
|
||||||
throws DataObjectNotFoundException {
|
throws DataObjectNotFoundException {
|
||||||
super(id);
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Contact(DataObject obj) {
|
public GenericContact(DataObject obj) {
|
||||||
super(obj);
|
super(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Contact(String type) {
|
public GenericContact(String type) {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -82,7 +82,7 @@ public class Contact extends ContentPage {
|
||||||
/**
|
/**
|
||||||
* Retrieves the current configuration
|
* Retrieves the current configuration
|
||||||
*/
|
*/
|
||||||
public static final ContactConfig getConfig() {
|
public static final GenericContactConfig getConfig() {
|
||||||
return s_config;
|
return s_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -91,12 +91,12 @@ public class Contact extends ContentPage {
|
||||||
// accessors
|
// accessors
|
||||||
|
|
||||||
// Get the person for this contact
|
// Get the person for this contact
|
||||||
public Person getPerson() {
|
public GenericPerson getPerson() {
|
||||||
return (Person) DomainObjectFactory.newInstance((DataObject)get(PERSON));
|
return (GenericPerson) DomainObjectFactory.newInstance((DataObject)get(PERSON));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the person for this contact
|
// Set the person for this contact
|
||||||
public void setPerson(Person person) {
|
public void setPerson(GenericPerson person) {
|
||||||
set(PERSON, person);
|
set(PERSON, person);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,12 +106,12 @@ public class Contact extends ContentPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the address for this contact
|
// Get the address for this contact
|
||||||
public Address getAddress() {
|
public GenericAddress getAddress() {
|
||||||
return (Address)DomainObjectFactory.newInstance((DataObject)get(ADDRESS));
|
return (GenericAddress)DomainObjectFactory.newInstance((DataObject)get(ADDRESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the address for this contact
|
// Set the address for this contact
|
||||||
public void setAddress(Address address) {
|
public void setAddress(GenericAddress address) {
|
||||||
set(ADDRESS, address);
|
set(ADDRESS, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -121,19 +121,19 @@ public class Contact extends ContentPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get all contact entries for this contact, p. ex. phone number, type of contact etc.
|
// Get all contact entries for this contact, p. ex. phone number, type of contact etc.
|
||||||
public ContactEntryCollection getContactEntries() {
|
public GenericContactEntryCollection getContactEntries() {
|
||||||
return new ContactEntryCollection ((DataCollection) get(CONTACT_ENTRIES));
|
return new GenericContactEntryCollection ((DataCollection) get(CONTACT_ENTRIES));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a contact entry for this contact
|
// Add a contact entry for this contact
|
||||||
public void addContactEntry(ContactEntry contactEntry) {
|
public void addContactEntry(GenericContactEntry contactEntry) {
|
||||||
Assert.exists(contactEntry, ContactEntry.class);
|
Assert.exists(contactEntry, GenericContactEntry.class);
|
||||||
add(CONTACT_ENTRIES, contactEntry);
|
add(CONTACT_ENTRIES, contactEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove a contect entry for this contact
|
// Remove a contect entry for this contact
|
||||||
public void removeContactEntry(ContactEntry contactEntry) {
|
public void removeContactEntry(GenericContactEntry contactEntry) {
|
||||||
Assert.exists(contactEntry, ContactEntry.class);
|
Assert.exists(contactEntry, GenericContactEntry.class);
|
||||||
remove(CONTACT_ENTRIES, contactEntry);
|
remove(CONTACT_ENTRIES, contactEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
package com.arsdigita.cms.basetypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
import com.arsdigita.util.parameter.Parameter;
|
import com.arsdigita.util.parameter.Parameter;
|
||||||
|
|
@ -9,13 +9,13 @@ import java.util.StringTokenizer;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores the configuration record for the contact.
|
* Stores the configuration record for the generic contact.
|
||||||
*
|
*
|
||||||
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
|
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
|
||||||
*/
|
*/
|
||||||
public final class ContactConfig extends AbstractConfig {
|
public final class GenericContactConfig extends AbstractConfig {
|
||||||
|
|
||||||
private static Logger s_log = Logger.getLogger(ContactConfig.class);
|
private static Logger s_log = Logger.getLogger(GenericContactConfig.class);
|
||||||
|
|
||||||
private final Parameter m_hidePerson;
|
private final Parameter m_hidePerson;
|
||||||
private final Parameter m_hideAddress;
|
private final Parameter m_hideAddress;
|
||||||
|
|
@ -27,13 +27,13 @@ public final class ContactConfig extends AbstractConfig {
|
||||||
/**
|
/**
|
||||||
* Public Constructor
|
* Public Constructor
|
||||||
*/
|
*/
|
||||||
public ContactConfig() {
|
public GenericContactConfig() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If set to true disables the possibility to attach a person ct
|
* If set to true disables the possibility to attach a person ct
|
||||||
*/
|
*/
|
||||||
m_hidePerson = new BooleanParameter
|
m_hidePerson = new BooleanParameter
|
||||||
("com.arsdigita.cms.basetypes.contact.hide_person",
|
("com.arsdigita.cms.contenttypes.generic_contact.hide_person",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
new Boolean(false));
|
new Boolean(false));
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@ public final class ContactConfig extends AbstractConfig {
|
||||||
* If set to true disables the possibility to attach a baseAddress ct
|
* If set to true disables the possibility to attach a baseAddress ct
|
||||||
*/
|
*/
|
||||||
m_hideAddress = new BooleanParameter
|
m_hideAddress = new BooleanParameter
|
||||||
("com.arsdigita.cms.basetypes.contact.hide_address",
|
("com.arsdigita.cms.contenttypes.generic_contact.hide_address",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
new Boolean(false));
|
new Boolean(false));
|
||||||
|
|
||||||
|
|
@ -49,7 +49,7 @@ public final class ContactConfig extends AbstractConfig {
|
||||||
* If set to true hides the postal code entry field for the attached address ct
|
* If set to true hides the postal code entry field for the attached address ct
|
||||||
*/
|
*/
|
||||||
m_hideAddressPostalCode = new BooleanParameter
|
m_hideAddressPostalCode = new BooleanParameter
|
||||||
("com.arsdigita.cms.basetypes.contact.address.hide_postal_code",
|
("com.arsdigita.cms.contenttypes.generic_contact.address.hide_postal_code",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
new Boolean(false));
|
new Boolean(false));
|
||||||
|
|
||||||
|
|
@ -57,7 +57,7 @@ public final class ContactConfig extends AbstractConfig {
|
||||||
* If set to true hides the state entry field for the attached address ct
|
* If set to true hides the state entry field for the attached address ct
|
||||||
*/
|
*/
|
||||||
m_hideAddressState = new BooleanParameter
|
m_hideAddressState = new BooleanParameter
|
||||||
("com.arsdigita.cms.basetypes.contact.address.hide_state",
|
("com.arsdigita.cms.contenttypes.generic_contact.address.hide_state",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
new Boolean(false));
|
new Boolean(false));
|
||||||
|
|
||||||
|
|
@ -65,14 +65,14 @@ public final class ContactConfig extends AbstractConfig {
|
||||||
* If set to true hides the country selection for the attaches address ct
|
* If set to true hides the country selection for the attaches address ct
|
||||||
*/
|
*/
|
||||||
m_hideAddressCountry = new BooleanParameter
|
m_hideAddressCountry = new BooleanParameter
|
||||||
("com.arsdigita.cms.basetypes.contact.address.hide_country",
|
("com.arsdigita.cms.contenttypes.generic_contact.address.hide_country",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
new Boolean(false));
|
new Boolean(false));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
m_contactEntryKeys = new StringParameter
|
m_contactEntryKeys = new StringParameter
|
||||||
("com.arsdigita.cms.basetypes.contact.contact_entry_keys",
|
("com.arsdigita.cms.contenttypes.generic_contact.contact_entry_keys",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
"contact_type,office_hours,phone_office,phone_private,phone_mobile,email,fax,im,www");
|
"contact_type,office_hours,phone_office,phone_private,phone_mobile,email,fax,im,www");
|
||||||
|
|
||||||
|
|
@ -117,7 +117,7 @@ public final class ContactConfig extends AbstractConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contactEntryKeys as StringTokenizer.
|
* Returns the generic_contactEntryKeys as StringTokenizer.
|
||||||
*/
|
*/
|
||||||
public final StringTokenizer getContactEntryKeys() {
|
public final StringTokenizer getContactEntryKeys() {
|
||||||
return new StringTokenizer((((String) get(m_contactEntryKeys)).replace(" ","")), ",", false);
|
return new StringTokenizer((((String) get(m_contactEntryKeys)).replace(" ","")), ",", false);
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.hide_person.title=Hide person attachment
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.hide_person.purpose=Hide the part to attach a person CT
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.hide_person.example=false
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.hide_person.format=[boolean]
|
||||||
|
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.hide_address.title=Hide address attachment
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.hide_address.purpose=Hide the part to attach a baseAddress CT
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.hide_address.example=false
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.hide_address.format=[boolean]
|
||||||
|
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.address.hide_postal_code.title=Hide postal code for attached adress
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.address.hide_postal_code.purpose=Hide the postal code entry field for the attached baseAddress
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.address.hide_postal_code.example=false
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.address.hide_postal_code.format=[boolean]
|
||||||
|
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.address.hide_state.title=Hide state for attached adress
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.address.hide_state.purpose=Hide the state entry field for the attached baseAddress
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.address.hide_state.example=false
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.address.hide_state.format=[boolean]
|
||||||
|
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.address.hide_country.title=Hide country for attached address
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.address.hide_country.purpose=Hide the country selection box for the attached baseAddress
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.address.hide_country.example=false
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.address.hide_country.format=[boolean]
|
||||||
|
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.contact_entry_keys.title=Select available contact entry types
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.contact_entry_keys.purpose=Select available contact entry types and define display order
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.contact_entry_keys.example=contact_type,office_hours,phone_office,phone_private,phone_mobile,email,fax,im,www
|
||||||
|
com.arsdigita.cms.contenttypes.generic_contact.contact_entry_keys.format=[string]
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
* office phone: 1234 / 123456
|
* office phone: 1234 / 123456
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.cms.basetypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
|
|
@ -31,12 +31,12 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* @author quasi
|
* @author quasi
|
||||||
*/
|
*/
|
||||||
public class ContactEntry extends ContentItem {
|
public class GenericContactEntry extends ContentItem {
|
||||||
|
|
||||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.basetypes.ContactEntry";
|
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.ContactEntry";
|
||||||
private static final String BASE_DATA_OBJECT_PACKAGE = "com.arsdigita.cms.basetypes";
|
private static final String BASE_DATA_OBJECT_PACKAGE = "com.arsdigita.cms.contenttypes";
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(ContactEntry.class);
|
private static final Logger s_log = Logger.getLogger(GenericContactEntry.class);
|
||||||
|
|
||||||
/** PDL property names */
|
/** PDL property names */
|
||||||
public static final String KEY = "key";
|
public static final String KEY = "key";
|
||||||
|
|
@ -45,21 +45,21 @@ public class ContactEntry extends ContentItem {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of ContactEntry
|
* Creates a new instance of GenericContactEntry
|
||||||
*/
|
*/
|
||||||
public ContactEntry() {
|
public GenericContactEntry() {
|
||||||
this(BASE_DATA_OBJECT_TYPE);
|
this(BASE_DATA_OBJECT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContactEntry(String typeName) {
|
public GenericContactEntry(String typeName) {
|
||||||
super(typeName);
|
super(typeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContactEntry(OID oid) {
|
public GenericContactEntry(OID oid) {
|
||||||
super(oid);
|
super(oid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContactEntry(DataObject object) {
|
public GenericContactEntry(DataObject object) {
|
||||||
super(object);
|
super(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -67,11 +67,11 @@ public class ContactEntry extends ContentItem {
|
||||||
* Constructor. Retrieves an object instance with the given id.
|
* Constructor. Retrieves an object instance with the given id.
|
||||||
* @param id the id of the object to retrieve
|
* @param id the id of the object to retrieve
|
||||||
*/
|
*/
|
||||||
public ContactEntry(BigDecimal id) throws DataObjectNotFoundException {
|
public GenericContactEntry(BigDecimal id) throws DataObjectNotFoundException {
|
||||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContactEntry(Contact contact, String key, String value, String description) {
|
public GenericContactEntry(GenericContact contact, String key, String value, String description) {
|
||||||
this();
|
this();
|
||||||
setName(key + " for " + contact.getName() + "(" + contact.getID() + ")");
|
setName(key + " for " + contact.getName() + "(" + contact.getID() + ")");
|
||||||
setKey(key);
|
setKey(key);
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
/*
|
/*
|
||||||
* ContactEntryCollection.java
|
* GenericContactEntryCollection.java
|
||||||
*
|
*
|
||||||
* Created on 13. Mai 2009, 12:32
|
* Created on 13. Mai 2009, 12:32
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
|
import com.arsdigita.cms.contenttypes.GenericContactEntry;
|
||||||
import com.arsdigita.domain.DomainCollection;
|
import com.arsdigita.domain.DomainCollection;
|
||||||
import com.arsdigita.persistence.DataCollection;
|
import com.arsdigita.persistence.DataCollection;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
|
@ -17,21 +19,21 @@ import java.util.TreeSet;
|
||||||
*
|
*
|
||||||
* @author quasi
|
* @author quasi
|
||||||
*/
|
*/
|
||||||
public class ContactEntryCollection extends DomainCollection {
|
public class GenericContactEntryCollection extends DomainCollection {
|
||||||
|
|
||||||
private TreeSet m_sortedCollection = new TreeSet(new ContactEntryComparator());
|
private TreeSet m_sortedCollection = new TreeSet(new ContactEntryComparator());
|
||||||
private Iterator m_iterator;
|
private Iterator m_iterator;
|
||||||
private boolean m_firstElem;
|
private boolean m_firstElem;
|
||||||
private ContactEntry m_currentContactEntry;
|
private GenericContactEntry m_currentContactEntry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of ContactEntryCollection
|
* Creates a new instance of GenericContactEntryCollection
|
||||||
*/
|
*/
|
||||||
public ContactEntryCollection(Contact contact) {
|
public GenericContactEntryCollection(GenericContact contact) {
|
||||||
this((DataCollection) contact.getContactEntries());
|
this((DataCollection) contact.getContactEntries());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContactEntryCollection(DataCollection dataCollection) {
|
public GenericContactEntryCollection(DataCollection dataCollection) {
|
||||||
super(dataCollection);
|
super(dataCollection);
|
||||||
|
|
||||||
// Now copy all objects from m_dataCollection to the sorting TreeSet
|
// Now copy all objects from m_dataCollection to the sorting TreeSet
|
||||||
|
|
@ -42,7 +44,7 @@ public class ContactEntryCollection extends DomainCollection {
|
||||||
public boolean next() {
|
public boolean next() {
|
||||||
boolean retVal = m_iterator.hasNext();
|
boolean retVal = m_iterator.hasNext();
|
||||||
if (retVal) {
|
if (retVal) {
|
||||||
m_currentContactEntry = (ContactEntry) m_iterator.next();
|
m_currentContactEntry = (GenericContactEntry) m_iterator.next();
|
||||||
m_firstElem = false;
|
m_firstElem = false;
|
||||||
}
|
}
|
||||||
return retVal;
|
return retVal;
|
||||||
|
|
@ -104,8 +106,8 @@ public class ContactEntryCollection extends DomainCollection {
|
||||||
return (String) getContactEntry().getValue();
|
return (String) getContactEntry().getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContactEntry getContactEntry() {
|
public GenericContactEntry getContactEntry() {
|
||||||
// return new ContactEntry(m_dataCollection.getDataObject());
|
// return new GenericContactEntry(m_dataCollection.getDataObject());
|
||||||
return m_currentContactEntry;
|
return m_currentContactEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,7 +116,7 @@ public class ContactEntryCollection extends DomainCollection {
|
||||||
m_dataCollection.rewind();
|
m_dataCollection.rewind();
|
||||||
|
|
||||||
while (m_dataCollection.next()) {
|
while (m_dataCollection.next()) {
|
||||||
m_sortedCollection.add(new ContactEntry(m_dataCollection.getDataObject()));
|
m_sortedCollection.add(new GenericContactEntry(m_dataCollection.getDataObject()));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_iterator = m_sortedCollection.iterator();
|
m_iterator = m_sortedCollection.iterator();
|
||||||
|
|
@ -125,11 +127,11 @@ public class ContactEntryCollection extends DomainCollection {
|
||||||
|
|
||||||
public int compare(Object o1, Object o2) {
|
public int compare(Object o1, Object o2) {
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
if (o1 instanceof ContactEntry && o2 instanceof ContactEntry) {
|
if (o1 instanceof GenericContactEntry && o2 instanceof GenericContactEntry) {
|
||||||
ContactEntry bc1 = (ContactEntry) o1;
|
GenericContactEntry bc1 = (GenericContactEntry) o1;
|
||||||
ContactEntry bc2 = (ContactEntry) o2;
|
GenericContactEntry bc2 = (GenericContactEntry) o2;
|
||||||
retVal = Contact.getConfig().getKeyIndex(bc1.getKey())
|
retVal = GenericContact.getConfig().getKeyIndex(bc1.getKey())
|
||||||
- Contact.getConfig().getKeyIndex(bc2.getKey());
|
- GenericContact.getConfig().getKeyIndex(bc2.getKey());
|
||||||
if (retVal == 0) {
|
if (retVal == 0) {
|
||||||
retVal = -1;
|
retVal = -1;
|
||||||
}
|
}
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.cms.basetypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.cms.contenttypes.*;
|
import com.arsdigita.cms.contenttypes.*;
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
|
|
@ -29,11 +29,11 @@ import com.arsdigita.util.Assert;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic Person Contenttype for OpenCCM.
|
* Basic GenericPerson Contenttype for OpenCCM.
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class Person extends ContentPage {
|
public class GenericPerson extends ContentPage {
|
||||||
|
|
||||||
public static final String PERSON = "person";
|
public static final String PERSON = "person";
|
||||||
public static final String SURNAME = "surname";
|
public static final String SURNAME = "surname";
|
||||||
|
|
@ -41,29 +41,29 @@ public class Person extends ContentPage {
|
||||||
public static final String TITLEPRE = "titlepre";
|
public static final String TITLEPRE = "titlepre";
|
||||||
public static final String TITLEPOST = "titlepost";
|
public static final String TITLEPOST = "titlepost";
|
||||||
/** Data object type for this domain object */
|
/** Data object type for this domain object */
|
||||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.basetypes.Person";
|
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.GenericPerson";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor. This creates a new (empty) Person.
|
* Default constructor. This creates a new (empty) GenericPerson.
|
||||||
**/
|
**/
|
||||||
public Person() {
|
public GenericPerson() {
|
||||||
this(BASE_DATA_OBJECT_TYPE);
|
this(BASE_DATA_OBJECT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Person(BigDecimal id) throws DataObjectNotFoundException {
|
public GenericPerson(BigDecimal id) throws DataObjectNotFoundException {
|
||||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Person(OID id) throws DataObjectNotFoundException {
|
public GenericPerson(OID id) throws DataObjectNotFoundException {
|
||||||
super(id);
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Person(DataObject obj) {
|
public GenericPerson(DataObject obj) {
|
||||||
super(obj);
|
super(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Person(String type) {
|
public GenericPerson(String type) {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -16,30 +16,30 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.Address;
|
import com.arsdigita.cms.contenttypes.GenericAddress;
|
||||||
import com.arsdigita.domain.DomainObject;
|
import com.arsdigita.domain.DomainObject;
|
||||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
|
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
|
|
||||||
public class AddressPropertiesStep extends SimpleEditStep {
|
public class GenericAddressPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
public static final String EDIT_SHEET_NAME = "edit";
|
public static final String EDIT_SHEET_NAME = "edit";
|
||||||
|
|
||||||
public AddressPropertiesStep(ItemSelectionModel itemModel,
|
public GenericAddressPropertiesStep(ItemSelectionModel itemModel,
|
||||||
AuthoringKitWizard parent) {
|
AuthoringKitWizard parent) {
|
||||||
super(itemModel, parent);
|
super(itemModel, parent);
|
||||||
|
|
||||||
|
|
@ -51,30 +51,30 @@ public class AddressPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
protected void createEditSheet(ItemSelectionModel itemModel) {
|
protected void createEditSheet(ItemSelectionModel itemModel) {
|
||||||
BasicPageForm editSheet;
|
BasicPageForm editSheet;
|
||||||
editSheet = new AddressPropertyForm(itemModel, this);
|
editSheet = new GenericAddressPropertyForm(itemModel, this);
|
||||||
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton());
|
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Component getAddressPropertySheet(ItemSelectionModel itemModel) {
|
public static Component getAddressPropertySheet(ItemSelectionModel itemModel) {
|
||||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||||
|
|
||||||
sheet.add((String) GlobalizationUtil.globalize("cms.contenttypes.ui.name").localize(), Address.NAME);
|
sheet.add((String) GlobalizationUtil.globalize("cms.contenttypes.ui.name").localize(), GenericAddress.NAME);
|
||||||
sheet.add((String) GlobalizationUtil.globalize("cms.contenttypes.ui.title").localize(), Address.TITLE);
|
sheet.add((String) GlobalizationUtil.globalize("cms.contenttypes.ui.title").localize(), GenericAddress.TITLE);
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.address").localize(), Address.ADDRESS);
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize(), GenericAddress.ADDRESS);
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.postal_code").localize(), Address.POSTAL_CODE);
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize(), GenericAddress.POSTAL_CODE);
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.city").localize(), Address.CITY);
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize(), GenericAddress.CITY);
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.state").localize(), Address.STATE);
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize(), GenericAddress.STATE);
|
||||||
|
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.iso_country_code").localize(),
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize(),
|
||||||
Address.ISO_COUNTRY_CODE,
|
GenericAddress.ISO_COUNTRY_CODE,
|
||||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||||
|
|
||||||
public String format(DomainObject item,
|
public String format(DomainObject item,
|
||||||
String attribute,
|
String attribute,
|
||||||
PageState state) {
|
PageState state) {
|
||||||
Address address = (Address) item;
|
GenericAddress address = (GenericAddress) item;
|
||||||
if (address != null && address.getIsoCountryCode() != null) {
|
if (address != null && address.getIsoCountryCode() != null) {
|
||||||
return Address.getCountryNameFromIsoCode(address.getIsoCountryCode());
|
return GenericAddress.getCountryNameFromIsoCode(address.getIsoCountryCode());
|
||||||
} else {
|
} else {
|
||||||
return (String) GlobalizationUtil.globalize("cms.ui.unknown").localize();
|
return (String) GlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||||
}
|
}
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
|
|
@ -37,8 +37,8 @@ import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.bebop.parameters.ParameterData;
|
import com.arsdigita.bebop.parameters.ParameterData;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.Address;
|
import com.arsdigita.cms.contenttypes.GenericAddress;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -50,22 +50,22 @@ import org.apache.log4j.Logger;
|
||||||
* @author: Jens Pelzetter
|
* @author: Jens Pelzetter
|
||||||
* @author: Sören Bernstein
|
* @author: Sören Bernstein
|
||||||
*/
|
*/
|
||||||
public class AddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
public class GenericAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(AddressPropertyForm.class);
|
private static final Logger s_log = Logger.getLogger(GenericAddressPropertyForm.class);
|
||||||
private AddressPropertiesStep m_step;
|
private GenericAddressPropertiesStep m_step;
|
||||||
public static final String ADDRESS = Address.ADDRESS;
|
public static final String ADDRESS = GenericAddress.ADDRESS;
|
||||||
public static final String POSTAL_CODE = Address.POSTAL_CODE;
|
public static final String POSTAL_CODE = GenericAddress.POSTAL_CODE;
|
||||||
public static final String CITY = Address.CITY;
|
public static final String CITY = GenericAddress.CITY;
|
||||||
public static final String STATE = Address.STATE;
|
public static final String STATE = GenericAddress.STATE;
|
||||||
public static final String ISO_COUNTRY_CODE = Address.ISO_COUNTRY_CODE;
|
public static final String ISO_COUNTRY_CODE = GenericAddress.ISO_COUNTRY_CODE;
|
||||||
public static final String ID = "Address_edit";
|
public static final String ID = "Address_edit";
|
||||||
|
|
||||||
public AddressPropertyForm(ItemSelectionModel itemModel) {
|
public GenericAddressPropertyForm(ItemSelectionModel itemModel) {
|
||||||
this(itemModel, null);
|
this(itemModel, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddressPropertyForm(ItemSelectionModel itemModel, AddressPropertiesStep step) {
|
public GenericAddressPropertyForm(ItemSelectionModel itemModel, GenericAddressPropertiesStep step) {
|
||||||
super(ID, itemModel);
|
super(ID, itemModel);
|
||||||
m_step = step;
|
m_step = step;
|
||||||
addSubmissionListener(this);
|
addSubmissionListener(this);
|
||||||
|
|
@ -75,7 +75,7 @@ public class AddressPropertyForm extends BasicPageForm implements FormProcessLis
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.address").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize()));
|
||||||
ParameterModel addressParam = new StringParameter(ADDRESS);
|
ParameterModel addressParam = new StringParameter(ADDRESS);
|
||||||
addressParam.addParameterListener(new NotNullValidationListener());
|
addressParam.addParameterListener(new NotNullValidationListener());
|
||||||
addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
|
|
@ -84,32 +84,32 @@ public class AddressPropertyForm extends BasicPageForm implements FormProcessLis
|
||||||
address.setCols(30);
|
address.setCols(30);
|
||||||
add(address);
|
add(address);
|
||||||
|
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.postal_code").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize()));
|
||||||
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
||||||
TextField postalCode = new TextField(postalCodeParam);
|
TextField postalCode = new TextField(postalCodeParam);
|
||||||
/* XXX NumberListener ?*/
|
/* XXX NumberListener ?*/
|
||||||
add(postalCode);
|
add(postalCode);
|
||||||
|
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.city").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize()));
|
||||||
ParameterModel cityParam = new StringParameter(CITY);
|
ParameterModel cityParam = new StringParameter(CITY);
|
||||||
TextField city = new TextField(cityParam);
|
TextField city = new TextField(cityParam);
|
||||||
add(city);
|
add(city);
|
||||||
|
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.state").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize()));
|
||||||
ParameterModel stateParam = new StringParameter(STATE);
|
ParameterModel stateParam = new StringParameter(STATE);
|
||||||
TextField state = new TextField(stateParam);
|
TextField state = new TextField(stateParam);
|
||||||
add(state);
|
add(state);
|
||||||
|
|
||||||
if (!Address.getConfig().getHideCountryCodeSelection()) {
|
if (!GenericAddress.getConfig().getHideCountryCodeSelection()) {
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.iso_country_code").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize()));
|
||||||
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
||||||
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
||||||
|
|
||||||
SingleSelect country = new SingleSelect(countryParam);
|
SingleSelect country = new SingleSelect(countryParam);
|
||||||
|
|
||||||
country.addOption(new Option("", new Label((String) BasetypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
country.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||||
|
|
||||||
Iterator countries = Address.getSortedListOfCountries(null).entrySet().iterator();
|
Iterator countries = GenericAddress.getSortedListOfCountries(null).entrySet().iterator();
|
||||||
while (countries.hasNext()) {
|
while (countries.hasNext()) {
|
||||||
Map.Entry<String, String> elem = (Map.Entry<String, String>) countries.next();
|
Map.Entry<String, String> elem = (Map.Entry<String, String>) countries.next();
|
||||||
country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString()));
|
country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString()));
|
||||||
|
|
@ -123,7 +123,7 @@ public class AddressPropertyForm extends BasicPageForm implements FormProcessLis
|
||||||
String isoCode = (String) data.getValue();
|
String isoCode = (String) data.getValue();
|
||||||
s_log.debug("ISO code is : " + isoCode);
|
s_log.debug("ISO code is : " + isoCode);
|
||||||
if (isoCode == null || isoCode.length() == 0) {
|
if (isoCode == null || isoCode.length() == 0) {
|
||||||
data.addError((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.error_iso_country").localize());
|
data.addError((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.error_iso_country").localize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -135,13 +135,13 @@ public class AddressPropertyForm extends BasicPageForm implements FormProcessLis
|
||||||
|
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
Address address = (Address) super.initBasicWidgets(fse);
|
GenericAddress address = (GenericAddress) super.initBasicWidgets(fse);
|
||||||
|
|
||||||
data.put(ADDRESS, address.getAddress());
|
data.put(ADDRESS, address.getAddress());
|
||||||
data.put(POSTAL_CODE, address.getPostalCode());
|
data.put(POSTAL_CODE, address.getPostalCode());
|
||||||
data.put(CITY, address.getCity());
|
data.put(CITY, address.getCity());
|
||||||
data.put(STATE, address.getState());
|
data.put(STATE, address.getState());
|
||||||
if (!Address.getConfig().getHideCountryCodeSelection()) {
|
if (!GenericAddress.getConfig().getHideCountryCodeSelection()) {
|
||||||
data.put(ISO_COUNTRY_CODE, address.getIsoCountryCode());
|
data.put(ISO_COUNTRY_CODE, address.getIsoCountryCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -156,7 +156,7 @@ public class AddressPropertyForm extends BasicPageForm implements FormProcessLis
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
Address address = (Address) super.processBasicWidgets(fse);
|
GenericAddress address = (GenericAddress) super.processBasicWidgets(fse);
|
||||||
|
|
||||||
if (address != null
|
if (address != null
|
||||||
&& getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
&& getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||||
|
|
@ -0,0 +1,110 @@
|
||||||
|
/*
|
||||||
|
* GenericContactAddressPropertiesStep.java
|
||||||
|
*
|
||||||
|
* Created on 4. Juli 2009, 15:15
|
||||||
|
*
|
||||||
|
* To change this template, choose Tools | Template Manager
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.PageState;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
|
import com.arsdigita.domain.DomainObject;
|
||||||
|
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||||
|
import com.arsdigita.bebop.Component;
|
||||||
|
import com.arsdigita.bebop.Label;
|
||||||
|
import com.arsdigita.cms.contenttypes.GenericAddress;
|
||||||
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author quasi
|
||||||
|
*/
|
||||||
|
public class GenericContactAddressPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
|
public static final String ADD_ADDRESS_SHEET_NAME = "addAddress";
|
||||||
|
public static final String EDIT_ADDRESS_SHEET_NAME = "editAddress";
|
||||||
|
public static final String CHANGE_ADDRESS_SHEET_NAME = "changeAddress";
|
||||||
|
public static final String DELETE_ADDRESS_SHEET_NAME = "deleteAddress";
|
||||||
|
|
||||||
|
/** Creates a new instance of GenericContactAddressPropertiesStep */
|
||||||
|
public GenericContactAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||||
|
this(itemModel, parent, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public GenericContactAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
|
||||||
|
super(itemModel, parent, prefix);
|
||||||
|
|
||||||
|
// GenericContact contact = (GenericContact)itemModel.getSelectedObject(state);
|
||||||
|
|
||||||
|
//XXX
|
||||||
|
// if(/*contact.getAddress() == null*/ true) {
|
||||||
|
BasicPageForm attachAddressSheet = new GenericContactAttachAddressPropertyForm(itemModel, this);
|
||||||
|
add(ADD_ADDRESS_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.attach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
/* Set the displayComponent for this step */
|
||||||
|
// setDisplayComponent(getEmptyBaseAddressPropertySheet(itemModel));
|
||||||
|
|
||||||
|
// } else {
|
||||||
|
|
||||||
|
// editAddress
|
||||||
|
BasicPageForm editAddressSheet = new GenericContactEditAddressPropertyForm(itemModel, this);
|
||||||
|
add(EDIT_ADDRESS_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.edit_address").localize(), new WorkflowLockedComponentAccess(editAddressSheet, itemModel), editAddressSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
// BasicPageForm attachAddressSheet = new GenericContactAttachAddressPropertyForm(itemModel, this);
|
||||||
|
// add(CHANGE_ADDRESS_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.reattach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
BasicPageForm deleteAddressSheet = new GenericContactDeleteAddressForm(itemModel, this);
|
||||||
|
add(DELETE_ADDRESS_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_address").localize(), new WorkflowLockedComponentAccess(deleteAddressSheet, itemModel), deleteAddressSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
/* Set the displayComponent for this step */
|
||||||
|
setDisplayComponent(getAddressPropertySheet(itemModel));
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Component getAddressPropertySheet(ItemSelectionModel itemModel) {
|
||||||
|
|
||||||
|
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||||
|
|
||||||
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize(), "address." + GenericAddress.ADDRESS);
|
||||||
|
if (!GenericContact.getConfig().getHideAddressPostalCode()) {
|
||||||
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize(), "address." + GenericAddress.POSTAL_CODE);
|
||||||
|
}
|
||||||
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize(), "address." + GenericAddress.CITY);
|
||||||
|
if (!GenericContact.getConfig().getHideAddressState()) {
|
||||||
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize(), "address." + GenericAddress.STATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!GenericContact.getConfig().getHideAddressCountry()) {
|
||||||
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize(),
|
||||||
|
"address." + GenericAddress.ISO_COUNTRY_CODE,
|
||||||
|
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||||
|
|
||||||
|
public String format(DomainObject item,
|
||||||
|
String attribute,
|
||||||
|
PageState state) {
|
||||||
|
GenericAddress Address = ((GenericContact) item).getAddress();
|
||||||
|
if (Address != null && Address.getIsoCountryCode() != null) {
|
||||||
|
return Address.getCountryNameFromIsoCode(Address.getIsoCountryCode());
|
||||||
|
} else {
|
||||||
|
return (String) ContenttypesGlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return sheet;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Component getEmptyBaseAddressPropertySheet(ItemSelectionModel itemModel) {
|
||||||
|
return new Label(((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.emptyAddress").localize()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
|
|
@ -23,11 +23,11 @@ import com.arsdigita.bebop.event.PrintListener;
|
||||||
import com.arsdigita.bebop.form.Submit;
|
import com.arsdigita.bebop.form.Submit;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.basetypes.Address;
|
import com.arsdigita.cms.contenttypes.GenericAddress;
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
@ -36,11 +36,11 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* @author quasi
|
* @author quasi
|
||||||
*/
|
*/
|
||||||
public class ContactAttachAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
public class GenericContactAttachAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(ContactPropertyForm.class);
|
private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class);
|
||||||
|
|
||||||
private ContactAddressPropertiesStep m_step;
|
private GenericContactAddressPropertiesStep m_step;
|
||||||
private ItemSearchWidget m_itemSearch;
|
private ItemSearchWidget m_itemSearch;
|
||||||
private SaveCancelSection m_saveCancelSection;
|
private SaveCancelSection m_saveCancelSection;
|
||||||
private final String ITEM_SEARCH = "contactAddress";
|
private final String ITEM_SEARCH = "contactAddress";
|
||||||
|
|
@ -55,7 +55,7 @@ public class ContactAttachAddressPropertyForm extends BasicPageForm implements F
|
||||||
*
|
*
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
*/
|
*/
|
||||||
public ContactAttachAddressPropertyForm(ItemSelectionModel itemModel) {
|
public GenericContactAttachAddressPropertyForm(ItemSelectionModel itemModel) {
|
||||||
this(itemModel, null);
|
this(itemModel, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -65,7 +65,7 @@ public class ContactAttachAddressPropertyForm extends BasicPageForm implements F
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
* @param step
|
* @param step
|
||||||
*/
|
*/
|
||||||
public ContactAttachAddressPropertyForm(ItemSelectionModel itemModel, ContactAddressPropertiesStep step) {
|
public GenericContactAttachAddressPropertyForm(ItemSelectionModel itemModel, GenericContactAddressPropertiesStep step) {
|
||||||
super(ID, itemModel);
|
super(ID, itemModel);
|
||||||
addSubmissionListener(this);
|
addSubmissionListener(this);
|
||||||
|
|
||||||
|
|
@ -78,15 +78,15 @@ public class ContactAttachAddressPropertyForm extends BasicPageForm implements F
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_address").localize()));
|
add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address").localize()));
|
||||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.basetypes.Address"));
|
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericAddress"));
|
||||||
add(this.m_itemSearch);
|
add(this.m_itemSearch);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
Contact contact = (Contact)getItemSelectionModel().getSelectedObject(state);
|
GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state);
|
||||||
|
|
||||||
setVisible(state, true);
|
setVisible(state, true);
|
||||||
|
|
||||||
|
|
@ -98,10 +98,10 @@ public class ContactAttachAddressPropertyForm extends BasicPageForm implements F
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
Contact contact = (Contact)getItemSelectionModel().getSelectedObject(state);
|
GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state);
|
||||||
|
|
||||||
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
||||||
contact.setAddress((Address)data.get(ITEM_SEARCH));
|
contact.setAddress((GenericAddress)data.get(ITEM_SEARCH));
|
||||||
}
|
}
|
||||||
init(fse);
|
init(fse);
|
||||||
}
|
}
|
||||||
|
|
@ -116,13 +116,13 @@ public class ContactAttachAddressPropertyForm extends BasicPageForm implements F
|
||||||
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
||||||
|
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
Contact contact = (Contact)getItemSelectionModel().getSelectedObject(e.getPageState());
|
GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(e.getPageState());
|
||||||
Submit target = (Submit) e.getTarget();
|
Submit target = (Submit) e.getTarget();
|
||||||
|
|
||||||
if (contact.getAddress() != null) {
|
if (contact.getAddress() != null) {
|
||||||
target.setButtonLabel((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_address.change").localize());
|
target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address.change").localize());
|
||||||
} else {
|
} else {
|
||||||
target.setButtonLabel((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_address.add").localize());
|
target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address.add").localize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -134,14 +134,14 @@ public class ContactAttachAddressPropertyForm extends BasicPageForm implements F
|
||||||
@Override
|
@Override
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
if (e.getFormData().get(ITEM_SEARCH) == null) {
|
if (e.getFormData().get(ITEM_SEARCH) == null) {
|
||||||
throw new FormProcessException((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_address.wrong_type").localize());
|
throw new FormProcessException((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address.wrong_type").localize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||||
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
||||||
init(e);
|
init(e);
|
||||||
throw new FormProcessException((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_address.cancelled").localize());
|
throw new FormProcessException((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address.cancelled").localize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
|
|
@ -23,11 +23,11 @@ import com.arsdigita.bebop.event.PrintListener;
|
||||||
import com.arsdigita.bebop.form.Submit;
|
import com.arsdigita.bebop.form.Submit;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
@ -36,11 +36,11 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* @author quasi
|
* @author quasi
|
||||||
*/
|
*/
|
||||||
public class ContactAttachPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
public class GenericContactAttachPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(ContactPropertyForm.class);
|
private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class);
|
||||||
|
|
||||||
private ContactPersonPropertiesStep m_step;
|
private GenericContactPersonPropertiesStep m_step;
|
||||||
private ItemSearchWidget m_itemSearch;
|
private ItemSearchWidget m_itemSearch;
|
||||||
private SaveCancelSection m_saveCancelSection;
|
private SaveCancelSection m_saveCancelSection;
|
||||||
private final String ITEM_SEARCH = "contactPerson";
|
private final String ITEM_SEARCH = "contactPerson";
|
||||||
|
|
@ -55,7 +55,7 @@ public class ContactAttachPersonPropertyForm extends BasicPageForm implements Fo
|
||||||
*
|
*
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
*/
|
*/
|
||||||
public ContactAttachPersonPropertyForm(ItemSelectionModel itemModel) {
|
public GenericContactAttachPersonPropertyForm(ItemSelectionModel itemModel) {
|
||||||
this(itemModel, null);
|
this(itemModel, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -65,7 +65,7 @@ public class ContactAttachPersonPropertyForm extends BasicPageForm implements Fo
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
* @param step
|
* @param step
|
||||||
*/
|
*/
|
||||||
public ContactAttachPersonPropertyForm(ItemSelectionModel itemModel, ContactPersonPropertiesStep step) {
|
public GenericContactAttachPersonPropertyForm(ItemSelectionModel itemModel, GenericContactPersonPropertiesStep step) {
|
||||||
super(ID, itemModel);
|
super(ID, itemModel);
|
||||||
addSubmissionListener(this);
|
addSubmissionListener(this);
|
||||||
|
|
||||||
|
|
@ -78,15 +78,15 @@ public class ContactAttachPersonPropertyForm extends BasicPageForm implements Fo
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_person").localize()));
|
add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person").localize()));
|
||||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.basetypes.Person"));
|
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericPerson"));
|
||||||
add(this.m_itemSearch);
|
add(this.m_itemSearch);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
Contact contact = (Contact)getItemSelectionModel().getSelectedObject(state);
|
GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state);
|
||||||
|
|
||||||
setVisible(state, true);
|
setVisible(state, true);
|
||||||
|
|
||||||
|
|
@ -98,10 +98,10 @@ public class ContactAttachPersonPropertyForm extends BasicPageForm implements Fo
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
Contact contact = (Contact)getItemSelectionModel().getSelectedObject(state);
|
GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state);
|
||||||
|
|
||||||
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
||||||
contact.setPerson((Person)data.get(ITEM_SEARCH));
|
contact.setPerson((GenericPerson)data.get(ITEM_SEARCH));
|
||||||
}
|
}
|
||||||
init(fse);
|
init(fse);
|
||||||
}
|
}
|
||||||
|
|
@ -116,13 +116,13 @@ public class ContactAttachPersonPropertyForm extends BasicPageForm implements Fo
|
||||||
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
||||||
|
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
Contact contact = (Contact)getItemSelectionModel().getSelectedObject(e.getPageState());
|
GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(e.getPageState());
|
||||||
Submit target = (Submit) e.getTarget();
|
Submit target = (Submit) e.getTarget();
|
||||||
|
|
||||||
if (contact.getPerson() != null) {
|
if (contact.getPerson() != null) {
|
||||||
target.setButtonLabel((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_person.change").localize());
|
target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person.change").localize());
|
||||||
} else {
|
} else {
|
||||||
target.setButtonLabel((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_person.add").localize());
|
target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person.add").localize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -134,14 +134,14 @@ public class ContactAttachPersonPropertyForm extends BasicPageForm implements Fo
|
||||||
@Override
|
@Override
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
if (e.getFormData().get(ITEM_SEARCH) == null) {
|
if (e.getFormData().get(ITEM_SEARCH) == null) {
|
||||||
throw new FormProcessException((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_person.wrong_type").localize());
|
throw new FormProcessException((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person.wrong_type").localize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||||
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
||||||
init(e);
|
init(e);
|
||||||
throw new FormProcessException((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.select_person.cancelled").localize());
|
throw new FormProcessException((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person.cancelled").localize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* ContactDeleteAddressForm.java
|
* GenericContactDeleteAddressForm.java
|
||||||
*
|
*
|
||||||
* Created on 17. Juli 2009, 10:10
|
* Created on 17. Juli 2009, 10:10
|
||||||
*
|
*
|
||||||
* To change this template, choose Tools | Template Manager
|
* To change this template, choose Tools | Template Manager
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
|
|
@ -17,8 +17,8 @@ import com.arsdigita.bebop.event.PrintEvent;
|
||||||
import com.arsdigita.bebop.event.PrintListener;
|
import com.arsdigita.bebop.event.PrintListener;
|
||||||
import com.arsdigita.bebop.form.Submit;
|
import com.arsdigita.bebop.form.Submit;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
||||||
|
|
@ -26,14 +26,14 @@ import com.arsdigita.util.UncheckedWrapperException;
|
||||||
*
|
*
|
||||||
* @author quasi
|
* @author quasi
|
||||||
*/
|
*/
|
||||||
public class ContactDeleteAddressForm extends BasicPageForm implements FormProcessListener {
|
public class GenericContactDeleteAddressForm extends BasicPageForm implements FormProcessListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the form
|
* ID of the form
|
||||||
*/
|
*/
|
||||||
public static final String ID = "BaseContactDeleteAddress";
|
public static final String ID = "BaseContactDeleteAddress";
|
||||||
|
|
||||||
ContactDeleteAddressForm(ItemSelectionModel itemModel, ContactAddressPropertiesStep step) {
|
GenericContactDeleteAddressForm(ItemSelectionModel itemModel, GenericContactAddressPropertiesStep step) {
|
||||||
super(ID, itemModel);
|
super(ID, itemModel);
|
||||||
addSaveCancelSection();
|
addSaveCancelSection();
|
||||||
}
|
}
|
||||||
|
|
@ -43,7 +43,7 @@ public class ContactDeleteAddressForm extends BasicPageForm implements FormProce
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.delete_address.label").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_address.label").localize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -55,9 +55,9 @@ public class ContactDeleteAddressForm extends BasicPageForm implements FormProce
|
||||||
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
||||||
|
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
Contact contact = (Contact) getItemSelectionModel().getSelectedObject(e.getPageState());
|
GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(e.getPageState());
|
||||||
Submit target = (Submit) e.getTarget();
|
Submit target = (Submit) e.getTarget();
|
||||||
target.setButtonLabel((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.delete_address.button_label").localize());
|
target.setButtonLabel((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_address.button_label").localize());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
@ -68,7 +68,7 @@ public class ContactDeleteAddressForm extends BasicPageForm implements FormProce
|
||||||
public final void process(final FormSectionEvent fse) throws FormProcessException {
|
public final void process(final FormSectionEvent fse) throws FormProcessException {
|
||||||
|
|
||||||
final PageState state = fse.getPageState();
|
final PageState state = fse.getPageState();
|
||||||
final Contact contact = (Contact) getItemSelectionModel().getSelectedObject(state);
|
final GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state);
|
||||||
|
|
||||||
if (contact != null && contact.getAddress() != null) {
|
if (contact != null && contact.getAddress() != null) {
|
||||||
contact.unsetAddress();
|
contact.unsetAddress();
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* ContactDeletePersonForm.java
|
* GenericContactDeletePersonForm.java
|
||||||
*
|
*
|
||||||
* Created on 17. Juli 2009, 10:10
|
* Created on 17. Juli 2009, 10:10
|
||||||
*
|
*
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
|
|
@ -18,8 +18,8 @@ import com.arsdigita.bebop.event.PrintEvent;
|
||||||
import com.arsdigita.bebop.event.PrintListener;
|
import com.arsdigita.bebop.event.PrintListener;
|
||||||
import com.arsdigita.bebop.form.Submit;
|
import com.arsdigita.bebop.form.Submit;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
||||||
|
|
@ -27,14 +27,14 @@ import com.arsdigita.util.UncheckedWrapperException;
|
||||||
*
|
*
|
||||||
* @author quasi
|
* @author quasi
|
||||||
*/
|
*/
|
||||||
public class ContactDeletePersonForm extends BasicPageForm implements FormProcessListener {
|
public class GenericContactDeletePersonForm extends BasicPageForm implements FormProcessListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the form
|
* ID of the form
|
||||||
*/
|
*/
|
||||||
public static final String ID = "ContactDeletePerson";
|
public static final String ID = "ContactDeletePerson";
|
||||||
|
|
||||||
ContactDeletePersonForm(ItemSelectionModel itemModel, ContactPersonPropertiesStep step) {
|
GenericContactDeletePersonForm(ItemSelectionModel itemModel, GenericContactPersonPropertiesStep step) {
|
||||||
super(ID, itemModel);
|
super(ID, itemModel);
|
||||||
addSaveCancelSection();
|
addSaveCancelSection();
|
||||||
}
|
}
|
||||||
|
|
@ -45,7 +45,7 @@ public class ContactDeletePersonForm extends BasicPageForm implements FormProces
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.delete_person.label").localize()));
|
add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_person.label").localize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -57,9 +57,9 @@ public class ContactDeletePersonForm extends BasicPageForm implements FormProces
|
||||||
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
||||||
|
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
Contact contact = (Contact)getItemSelectionModel().getSelectedObject(e.getPageState());
|
GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(e.getPageState());
|
||||||
Submit target = (Submit) e.getTarget();
|
Submit target = (Submit) e.getTarget();
|
||||||
target.setButtonLabel((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.delete_person").localize());
|
target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_person").localize());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
@ -70,7 +70,7 @@ public class ContactDeletePersonForm extends BasicPageForm implements FormProces
|
||||||
public final void process(final FormSectionEvent fse) throws FormProcessException {
|
public final void process(final FormSectionEvent fse) throws FormProcessException {
|
||||||
|
|
||||||
final PageState state = fse.getPageState();
|
final PageState state = fse.getPageState();
|
||||||
final Contact contact = (Contact)getItemSelectionModel().getSelectedObject(state);
|
final GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state);
|
||||||
|
|
||||||
if (contact != null && contact.getPerson() != null) {
|
if (contact != null && contact.getPerson() != null) {
|
||||||
contact.unsetPerson();
|
contact.unsetPerson();
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* ContactEditAddressPropertyForm.java
|
* GenericContactEditAddressPropertyForm.java
|
||||||
*
|
*
|
||||||
* Created on 8. Juli 2009, 10:27
|
* Created on 8. Juli 2009, 10:27
|
||||||
*
|
*
|
||||||
* To change this template, choose Tools | Template Manager
|
* To change this template, choose Tools | Template Manager
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
|
|
@ -31,9 +31,9 @@ import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import com.arsdigita.cms.basetypes.Address;
|
import com.arsdigita.cms.contenttypes.GenericAddress;
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
@ -41,15 +41,15 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* @author quasi
|
* @author quasi
|
||||||
*/
|
*/
|
||||||
public class ContactEditAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
public class GenericContactEditAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(ContactPropertyForm.class);
|
private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class);
|
||||||
private ContactAddressPropertiesStep m_step;
|
private GenericContactAddressPropertiesStep m_step;
|
||||||
public static final String ADDRESS = Address.ADDRESS;
|
public static final String ADDRESS = GenericAddress.ADDRESS;
|
||||||
public static final String POSTAL_CODE = Address.POSTAL_CODE;
|
public static final String POSTAL_CODE = GenericAddress.POSTAL_CODE;
|
||||||
public static final String CITY = Address.CITY;
|
public static final String CITY = GenericAddress.CITY;
|
||||||
public static final String STATE = Address.STATE;
|
public static final String STATE = GenericAddress.STATE;
|
||||||
public static final String ISO_COUNTRY_CODE = Address.ISO_COUNTRY_CODE;
|
public static final String ISO_COUNTRY_CODE = GenericAddress.ISO_COUNTRY_CODE;
|
||||||
/**
|
/**
|
||||||
* ID of the form
|
* ID of the form
|
||||||
*/
|
*/
|
||||||
|
|
@ -60,7 +60,7 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For
|
||||||
*
|
*
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
*/
|
*/
|
||||||
public ContactEditAddressPropertyForm(ItemSelectionModel itemModel) {
|
public GenericContactEditAddressPropertyForm(ItemSelectionModel itemModel) {
|
||||||
this(itemModel, null);
|
this(itemModel, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,7 +70,7 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
* @param step
|
* @param step
|
||||||
*/
|
*/
|
||||||
public ContactEditAddressPropertyForm(ItemSelectionModel itemModel, ContactAddressPropertiesStep step) {
|
public GenericContactEditAddressPropertyForm(ItemSelectionModel itemModel, GenericContactAddressPropertiesStep step) {
|
||||||
super(ID, itemModel);
|
super(ID, itemModel);
|
||||||
m_step = step;
|
m_step = step;
|
||||||
addSubmissionListener(this);
|
addSubmissionListener(this);
|
||||||
|
|
@ -78,7 +78,7 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.baseAddress.address").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.address").localize()));
|
||||||
ParameterModel addressParam = new StringParameter(ADDRESS);
|
ParameterModel addressParam = new StringParameter(ADDRESS);
|
||||||
addressParam.addParameterListener(new NotNullValidationListener());
|
addressParam.addParameterListener(new NotNullValidationListener());
|
||||||
addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
|
|
@ -87,36 +87,36 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For
|
||||||
address.setCols(30);
|
address.setCols(30);
|
||||||
add(address);
|
add(address);
|
||||||
|
|
||||||
if (!Contact.getConfig().getHideAddressPostalCode()) {
|
if (!GenericContact.getConfig().getHideAddressPostalCode()) {
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.baseAddress.postal_code").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.postal_code").localize()));
|
||||||
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
||||||
TextField postalCode = new TextField(postalCodeParam);
|
TextField postalCode = new TextField(postalCodeParam);
|
||||||
/* XXX NumberListener ?*/
|
/* XXX NumberListener ?*/
|
||||||
add(postalCode);
|
add(postalCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.baseAddress.city").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.city").localize()));
|
||||||
ParameterModel cityParam = new StringParameter(CITY);
|
ParameterModel cityParam = new StringParameter(CITY);
|
||||||
TextField city = new TextField(cityParam);
|
TextField city = new TextField(cityParam);
|
||||||
add(city);
|
add(city);
|
||||||
|
|
||||||
if (!Contact.getConfig().getHideAddressState()) {
|
if (!GenericContact.getConfig().getHideAddressState()) {
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.baseAddress.state").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.state").localize()));
|
||||||
ParameterModel stateParam = new StringParameter(STATE);
|
ParameterModel stateParam = new StringParameter(STATE);
|
||||||
TextField state = new TextField(stateParam);
|
TextField state = new TextField(stateParam);
|
||||||
add(state);
|
add(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Contact.getConfig().getHideAddressCountry()) {
|
if (!GenericContact.getConfig().getHideAddressCountry()) {
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.baseAddress.iso_country_code").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.iso_country_code").localize()));
|
||||||
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
||||||
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
||||||
|
|
||||||
SingleSelect country = new SingleSelect(countryParam);
|
SingleSelect country = new SingleSelect(countryParam);
|
||||||
|
|
||||||
country.addOption(new Option("", new Label((String) BasetypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
country.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||||
|
|
||||||
Iterator countries = Address.getSortedListOfCountries(null).entrySet().iterator();
|
Iterator countries = GenericAddress.getSortedListOfCountries(null).entrySet().iterator();
|
||||||
while (countries.hasNext()) {
|
while (countries.hasNext()) {
|
||||||
Map.Entry<String, String> elem = (Map.Entry<String, String>) countries.next();
|
Map.Entry<String, String> elem = (Map.Entry<String, String>) countries.next();
|
||||||
country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString()));
|
country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString()));
|
||||||
|
|
@ -129,7 +129,7 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For
|
||||||
ParameterData data = e.getParameterData();
|
ParameterData data = e.getParameterData();
|
||||||
String isoCode = (String) data.getValue();
|
String isoCode = (String) data.getValue();
|
||||||
if (isoCode == null || isoCode.length() == 0) {
|
if (isoCode == null || isoCode.length() == 0) {
|
||||||
data.addError((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.error_iso_country").localize());
|
data.addError((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.error_iso_country").localize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -142,14 +142,14 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
Contact contact = (Contact) getItemSelectionModel().getSelectedObject(state);
|
GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state);
|
||||||
|
|
||||||
if (contact.getAddress() != null) {
|
if (contact.getAddress() != null) {
|
||||||
data.put(ADDRESS, contact.getAddress().getAddress());
|
data.put(ADDRESS, contact.getAddress().getAddress());
|
||||||
data.put(POSTAL_CODE, contact.getAddress().getPostalCode());
|
data.put(POSTAL_CODE, contact.getAddress().getPostalCode());
|
||||||
data.put(CITY, contact.getAddress().getCity());
|
data.put(CITY, contact.getAddress().getCity());
|
||||||
data.put(STATE, contact.getAddress().getState());
|
data.put(STATE, contact.getAddress().getState());
|
||||||
if (!Address.getConfig().getHideCountryCodeSelection()) {
|
if (!GenericAddress.getConfig().getHideCountryCodeSelection()) {
|
||||||
data.put(ISO_COUNTRY_CODE, contact.getAddress().getIsoCountryCode());
|
data.put(ISO_COUNTRY_CODE, contact.getAddress().getIsoCountryCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -165,11 +165,11 @@ public class ContactEditAddressPropertyForm extends BasicPageForm implements For
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
Contact contact = (Contact) getItemSelectionModel().getSelectedObject(state);
|
GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state);
|
||||||
|
|
||||||
if (getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
if (getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||||
if (contact.getAddress() == null) {
|
if (contact.getAddress() == null) {
|
||||||
contact.setAddress(new Address());
|
contact.setAddress(new GenericAddress());
|
||||||
contact.getAddress().setName("Address for " + contact.getName() + "(" + contact.getID() + ")");
|
contact.getAddress().setName("Address for " + contact.getName() + "(" + contact.getID() + ")");
|
||||||
contact.getAddress().setTitle("Address for " + contact.getName() + "(" + contact.getID() + ")");
|
contact.getAddress().setTitle("Address for " + contact.getName() + "(" + contact.getID() + ")");
|
||||||
}
|
}
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* ContactEditPersonPropertyForm.java
|
* GenericContactEditPersonPropertyForm.java
|
||||||
*
|
*
|
||||||
* Created on 8. Juli 2009, 10:27
|
* Created on 8. Juli 2009, 10:27
|
||||||
*
|
*
|
||||||
* To change this template, choose Tools | Template Manager
|
* To change this template, choose Tools | Template Manager
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
|
|
@ -22,9 +22,9 @@ import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
@ -32,14 +32,14 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* @author quasi
|
* @author quasi
|
||||||
*/
|
*/
|
||||||
public class ContactEditPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
public class GenericContactEditPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(ContactPropertyForm.class);
|
private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class);
|
||||||
private ContactPersonPropertiesStep m_step;
|
private GenericContactPersonPropertiesStep m_step;
|
||||||
public static final String SURNAME = Person.SURNAME;
|
public static final String SURNAME = GenericPerson.SURNAME;
|
||||||
public static final String GIVENNAME = Person.GIVENNAME;
|
public static final String GIVENNAME = GenericPerson.GIVENNAME;
|
||||||
public static final String TITLEPRE = Person.TITLEPRE;
|
public static final String TITLEPRE = GenericPerson.TITLEPRE;
|
||||||
public static final String TITLEPOST = Person.TITLEPOST;
|
public static final String TITLEPOST = GenericPerson.TITLEPOST;
|
||||||
/**
|
/**
|
||||||
* ID of the form
|
* ID of the form
|
||||||
*/
|
*/
|
||||||
|
|
@ -50,7 +50,7 @@ public class ContactEditPersonPropertyForm extends BasicPageForm implements Form
|
||||||
*
|
*
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
*/
|
*/
|
||||||
public ContactEditPersonPropertyForm(ItemSelectionModel itemModel) {
|
public GenericContactEditPersonPropertyForm(ItemSelectionModel itemModel) {
|
||||||
this(itemModel, null);
|
this(itemModel, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -60,7 +60,7 @@ public class ContactEditPersonPropertyForm extends BasicPageForm implements Form
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
* @param step
|
* @param step
|
||||||
*/
|
*/
|
||||||
public ContactEditPersonPropertyForm(ItemSelectionModel itemModel, ContactPersonPropertiesStep step) {
|
public GenericContactEditPersonPropertyForm(ItemSelectionModel itemModel, GenericContactPersonPropertiesStep step) {
|
||||||
super(ID, itemModel);
|
super(ID, itemModel);
|
||||||
m_step = step;
|
m_step = step;
|
||||||
addSubmissionListener(this);
|
addSubmissionListener(this);
|
||||||
|
|
@ -68,27 +68,27 @@ public class ContactEditPersonPropertyForm extends BasicPageForm implements Form
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.surname").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize()));
|
||||||
ParameterModel surnameParam = new StringParameter(SURNAME);
|
ParameterModel surnameParam = new StringParameter(SURNAME);
|
||||||
surnameParam.addParameterListener(new NotNullValidationListener());
|
surnameParam.addParameterListener(new NotNullValidationListener());
|
||||||
surnameParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
surnameParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
TextField surname = new TextField(surnameParam);
|
TextField surname = new TextField(surnameParam);
|
||||||
add(surname);
|
add(surname);
|
||||||
|
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.givenname").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize()));
|
||||||
ParameterModel givennameParam = new StringParameter(GIVENNAME);
|
ParameterModel givennameParam = new StringParameter(GIVENNAME);
|
||||||
givennameParam.addParameterListener(new NotNullValidationListener());
|
givennameParam.addParameterListener(new NotNullValidationListener());
|
||||||
givennameParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
givennameParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
TextField givenname = new TextField(givennameParam);
|
TextField givenname = new TextField(givennameParam);
|
||||||
add(givenname);
|
add(givenname);
|
||||||
|
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepre").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize()));
|
||||||
ParameterModel titlepreParam = new StringParameter(TITLEPRE);
|
ParameterModel titlepreParam = new StringParameter(TITLEPRE);
|
||||||
titlepreParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
titlepreParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
TextField titlepre = new TextField(titlepreParam);
|
TextField titlepre = new TextField(titlepreParam);
|
||||||
add(titlepre);
|
add(titlepre);
|
||||||
|
|
||||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepost").localize()));
|
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize()));
|
||||||
ParameterModel titlepostParam = new StringParameter(TITLEPOST);
|
ParameterModel titlepostParam = new StringParameter(TITLEPOST);
|
||||||
titlepostParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
titlepostParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
TextField titlepost = new TextField(titlepostParam);
|
TextField titlepost = new TextField(titlepostParam);
|
||||||
|
|
@ -98,7 +98,7 @@ public class ContactEditPersonPropertyForm extends BasicPageForm implements Form
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
Contact contact = (Contact) getItemSelectionModel().getSelectedObject(state);
|
GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state);
|
||||||
|
|
||||||
if (contact.getPerson() != null) {
|
if (contact.getPerson() != null) {
|
||||||
data.put(SURNAME, contact.getPerson().getSurname());
|
data.put(SURNAME, contact.getPerson().getSurname());
|
||||||
|
|
@ -118,12 +118,12 @@ public class ContactEditPersonPropertyForm extends BasicPageForm implements Form
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
Contact contact = (Contact) getItemSelectionModel().getSelectedObject(state);
|
GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state);
|
||||||
|
|
||||||
if (getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
if (getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||||
|
|
||||||
if (contact.getPerson() == null) {
|
if (contact.getPerson() == null) {
|
||||||
contact.setPerson(new Person());
|
contact.setPerson(new GenericPerson());
|
||||||
contact.getPerson().setName("Person for " + contact.getName() + "(" + contact.getID() + ")");
|
contact.getPerson().setName("Person for " + contact.getName() + "(" + contact.getID() + ")");
|
||||||
contact.getPerson().setTitle("Person for " + contact.getName() + "(" + contact.getID() + ")");
|
contact.getPerson().setTitle("Person for " + contact.getName() + "(" + contact.getID() + ")");
|
||||||
}
|
}
|
||||||
|
|
@ -16,10 +16,10 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
|
|
@ -33,22 +33,22 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
|
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
|
||||||
* @version $Id: PhoBaseContactEntriesPropertiesStepva 287 2005-02-22 00:29:02Z sskracic $
|
* @version $Id: PhoBaseContactEntriesPropertiesStepva 287 2005-02-22 00:29:02Z sskracic $
|
||||||
*/
|
*/
|
||||||
public class ContactEntriesPropertiesStep extends SimpleEditStep {
|
public class GenericContactEntriesPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
/** The name of the editing sheet added to this step */
|
/** The name of the editing sheet added to this step */
|
||||||
private static String ADD_CONTACT_ENTRY_SHEET_NAME = "addContactEntry";
|
private static String ADD_CONTACT_ENTRY_SHEET_NAME = "addContactEntry";
|
||||||
|
|
||||||
public ContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
public GenericContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||||
this(itemModel, parent, null);
|
this(itemModel, parent, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
|
public GenericContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
|
||||||
super(itemModel, parent, prefix);
|
super(itemModel, parent, prefix);
|
||||||
|
|
||||||
BasicItemForm addContactEntrySheet = new ContactEntryAddForm(itemModel);
|
BasicItemForm addContactEntrySheet = new GenericContactEntryAddForm(itemModel);
|
||||||
add(ADD_CONTACT_ENTRY_SHEET_NAME, (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.add_contactEntry").localize(), new WorkflowLockedComponentAccess(addContactEntrySheet, itemModel), addContactEntrySheet.getSaveCancelSection().getCancelButton());
|
add(ADD_CONTACT_ENTRY_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.add_contactEntry").localize(), new WorkflowLockedComponentAccess(addContactEntrySheet, itemModel), addContactEntrySheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
ContactEntriesTable contactEntriesTable = new ContactEntriesTable(itemModel);
|
GenericContactEntriesTable contactEntriesTable = new GenericContactEntriesTable(itemModel);
|
||||||
setDisplayComponent(contactEntriesTable);
|
setDisplayComponent(contactEntriesTable);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.ControlLink;
|
import com.arsdigita.bebop.ControlLink;
|
||||||
|
|
@ -32,10 +32,10 @@ import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import com.arsdigita.cms.basetypes.ContactEntry;
|
import com.arsdigita.cms.contenttypes.GenericContactEntry;
|
||||||
import com.arsdigita.cms.basetypes.ContactEntryCollection;
|
import com.arsdigita.cms.contenttypes.GenericContactEntryCollection;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
|
|
@ -46,7 +46,7 @@ import java.math.BigDecimal;
|
||||||
*
|
*
|
||||||
* @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de
|
* @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de
|
||||||
*/
|
*/
|
||||||
public class ContactEntriesTable extends Table implements TableActionListener{
|
public class GenericContactEntriesTable extends Table implements TableActionListener{
|
||||||
|
|
||||||
|
|
||||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||||
|
|
@ -55,22 +55,22 @@ public class ContactEntriesTable extends Table implements TableActionListener{
|
||||||
private ItemSelectionModel m_itemModel;
|
private ItemSelectionModel m_itemModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of ContactEntriesTable
|
* Creates a new instance of GenericContactEntriesTable
|
||||||
*/
|
*/
|
||||||
public ContactEntriesTable(final ItemSelectionModel itemModel) {
|
public GenericContactEntriesTable(final ItemSelectionModel itemModel) {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
this.m_itemModel = itemModel;
|
this.m_itemModel = itemModel;
|
||||||
|
|
||||||
// if table is empty:
|
// if table is empty:
|
||||||
setEmptyView(new Label(BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.none")));
|
setEmptyView(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.none")));
|
||||||
TableColumnModel tab_model = getColumnModel();
|
TableColumnModel tab_model = getColumnModel();
|
||||||
|
|
||||||
// define columns
|
// define columns
|
||||||
tab_model.add(new TableColumn(0, BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.key").localize(), TABLE_COL_EDIT));
|
tab_model.add(new TableColumn(0, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key").localize(), TABLE_COL_EDIT));
|
||||||
tab_model.add(new TableColumn(1, BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.value").localize()));
|
tab_model.add(new TableColumn(1, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.value").localize()));
|
||||||
tab_model.add(new TableColumn(2, BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.description").localize()));
|
tab_model.add(new TableColumn(2, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.description").localize()));
|
||||||
tab_model.add(new TableColumn(3, BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.action").localize(), TABLE_COL_DEL));
|
tab_model.add(new TableColumn(3, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.action").localize(), TABLE_COL_DEL));
|
||||||
|
|
||||||
setModelBuilder(new ContactTableModelBuilder(itemModel));
|
setModelBuilder(new ContactTableModelBuilder(itemModel));
|
||||||
|
|
||||||
|
|
@ -97,7 +97,7 @@ public class ContactEntriesTable extends Table implements TableActionListener{
|
||||||
|
|
||||||
table.getRowSelectionModel().clearSelection(state);
|
table.getRowSelectionModel().clearSelection(state);
|
||||||
|
|
||||||
Contact contact = (Contact) m_itemModel.getSelectedObject(state);
|
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state);
|
||||||
|
|
||||||
// if (contact != null && contact.hasContactEntries()) {
|
// if (contact != null && contact.hasContactEntries()) {
|
||||||
return new ContactTableModel(table, state, contact);
|
return new ContactTableModel(table, state, contact);
|
||||||
|
|
@ -116,10 +116,10 @@ public class ContactEntriesTable extends Table implements TableActionListener{
|
||||||
final private int MAX_DESC_LENGTH = 25;
|
final private int MAX_DESC_LENGTH = 25;
|
||||||
|
|
||||||
private Table m_table;
|
private Table m_table;
|
||||||
private ContactEntryCollection m_contactEntryCollection;
|
private GenericContactEntryCollection m_contactEntryCollection;
|
||||||
private ContactEntry m_contactEntry;
|
private GenericContactEntry m_contactEntry;
|
||||||
|
|
||||||
private ContactTableModel(Table t, PageState ps, Contact contact) {
|
private ContactTableModel(Table t, PageState ps, GenericContact contact) {
|
||||||
m_table = t;
|
m_table = t;
|
||||||
m_contactEntryCollection = contact.getContactEntries();
|
m_contactEntryCollection = contact.getContactEntries();
|
||||||
}
|
}
|
||||||
|
|
@ -131,7 +131,7 @@ public class ContactEntriesTable extends Table implements TableActionListener{
|
||||||
/**
|
/**
|
||||||
* Check collection for the existence of another row.
|
* Check collection for the existence of another row.
|
||||||
*
|
*
|
||||||
* If exists, fetch the value of current ContactEntryCollection object
|
* If exists, fetch the value of current GenericContactEntryCollection object
|
||||||
* into m_contactEntry class variable.
|
* into m_contactEntry class variable.
|
||||||
*/
|
*/
|
||||||
public boolean nextRow() {
|
public boolean nextRow() {
|
||||||
|
|
@ -154,7 +154,7 @@ public class ContactEntriesTable extends Table implements TableActionListener{
|
||||||
public Object getElementAt(int columnIndex) {
|
public Object getElementAt(int columnIndex) {
|
||||||
switch (columnIndex){
|
switch (columnIndex){
|
||||||
case 0:
|
case 0:
|
||||||
return (String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.key." + m_contactEntry.getKey()).localize();
|
return (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key." + m_contactEntry.getKey()).localize();
|
||||||
case 1:
|
case 1:
|
||||||
return m_contactEntry.getValue();
|
return m_contactEntry.getValue();
|
||||||
case 2:
|
case 2:
|
||||||
|
|
@ -189,7 +189,7 @@ public class ContactEntriesTable extends Table implements TableActionListener{
|
||||||
int row, int column) {
|
int row, int column) {
|
||||||
|
|
||||||
SecurityManager sm = Utilities.getSecurityManager(state);
|
SecurityManager sm = Utilities.getSecurityManager(state);
|
||||||
Contact contact = (Contact) m_itemModel.getSelectedObject(state);
|
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state);
|
||||||
|
|
||||||
boolean canEdit = sm.canAccess(state.getRequest(),
|
boolean canEdit = sm.canAccess(state.getRequest(),
|
||||||
SecurityManager.EDIT_ITEM,
|
SecurityManager.EDIT_ITEM,
|
||||||
|
|
@ -214,14 +214,14 @@ public class ContactEntriesTable extends Table implements TableActionListener{
|
||||||
int row, int column) {
|
int row, int column) {
|
||||||
|
|
||||||
SecurityManager sm = Utilities.getSecurityManager(state);
|
SecurityManager sm = Utilities.getSecurityManager(state);
|
||||||
Contact contact = (Contact) m_itemModel.getSelectedObject(state);
|
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state);
|
||||||
|
|
||||||
boolean canDelete = sm.canAccess(state.getRequest(),
|
boolean canDelete = sm.canAccess(state.getRequest(),
|
||||||
SecurityManager.DELETE_ITEM,
|
SecurityManager.DELETE_ITEM,
|
||||||
contact);
|
contact);
|
||||||
if(canDelete) {
|
if(canDelete) {
|
||||||
ControlLink link = new ControlLink(value.toString());
|
ControlLink link = new ControlLink(value.toString());
|
||||||
link.setConfirmation((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.confirm_delete").localize());
|
link.setConfirmation((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.confirm_delete").localize());
|
||||||
return link;
|
return link;
|
||||||
} else {
|
} else {
|
||||||
return new Label(value.toString());
|
return new Label(value.toString());
|
||||||
|
|
@ -238,12 +238,12 @@ public class ContactEntriesTable extends Table implements TableActionListener{
|
||||||
|
|
||||||
PageState state = evt.getPageState();
|
PageState state = evt.getPageState();
|
||||||
|
|
||||||
// Get selected ContactEntry
|
// Get selected GenericContactEntry
|
||||||
ContactEntry contactEntry =
|
GenericContactEntry contactEntry =
|
||||||
new ContactEntry(new BigDecimal(evt.getRowKey().toString()));
|
new GenericContactEntry(new BigDecimal(evt.getRowKey().toString()));
|
||||||
|
|
||||||
// Get Contact
|
// Get GenericContact
|
||||||
Contact contact = (Contact) m_itemModel.getSelectedObject(state);
|
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state);
|
||||||
|
|
||||||
// Get selected column
|
// Get selected column
|
||||||
TableColumn col = getColumnModel().get(evt.getColumn().intValue());
|
TableColumn col = getColumnModel().get(evt.getColumn().intValue());
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
|
|
@ -27,9 +27,9 @@ import com.arsdigita.bebop.form.TextField;
|
||||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import com.arsdigita.cms.basetypes.ContactEntry;
|
import com.arsdigita.cms.contenttypes.GenericContactEntry;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
@ -39,13 +39,13 @@ import org.apache.log4j.Logger;
|
||||||
/**
|
/**
|
||||||
* @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de
|
* @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de
|
||||||
*/
|
*/
|
||||||
public class ContactEntryAddForm extends BasicItemForm {
|
public class GenericContactEntryAddForm extends BasicItemForm {
|
||||||
private static final Logger s_log = Logger.getLogger(ContactEntryAddForm.class);
|
private static final Logger s_log = Logger.getLogger(GenericContactEntryAddForm.class);
|
||||||
|
|
||||||
private ItemSelectionModel m_itemModel;
|
private ItemSelectionModel m_itemModel;
|
||||||
|
|
||||||
/** Creates a new instance of CategoryLocalizationAddForm */
|
/** Creates a new instance of CategoryLocalizationAddForm */
|
||||||
public ContactEntryAddForm(ItemSelectionModel itemModel) {
|
public GenericContactEntryAddForm(ItemSelectionModel itemModel) {
|
||||||
|
|
||||||
super("ContactEntryAddForm",itemModel);
|
super("ContactEntryAddForm",itemModel);
|
||||||
m_itemModel = itemModel;
|
m_itemModel = itemModel;
|
||||||
|
|
@ -56,31 +56,31 @@ public class ContactEntryAddForm extends BasicItemForm {
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
// Key field
|
// Key field
|
||||||
add(new Label(BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.key")));
|
add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key")));
|
||||||
ParameterModel contactEntryKeyParam = new StringParameter(ContactEntry.KEY);
|
ParameterModel contactEntryKeyParam = new StringParameter(GenericContactEntry.KEY);
|
||||||
SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam);
|
SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam);
|
||||||
contactEntryKey.addValidationListener(new NotNullValidationListener());
|
contactEntryKey.addValidationListener(new NotNullValidationListener());
|
||||||
contactEntryKey.addOption(new Option("", new Label((String)BasetypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
contactEntryKey.addOption(new Option("", new Label((String)ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||||
|
|
||||||
// Add the Options to the SingleSelect widget
|
// Add the Options to the SingleSelect widget
|
||||||
StringTokenizer keyList = Contact.getConfig().getContactEntryKeys();
|
StringTokenizer keyList = GenericContact.getConfig().getContactEntryKeys();
|
||||||
while(keyList.hasMoreElements()) {
|
while(keyList.hasMoreElements()) {
|
||||||
String currentKey = keyList.nextToken();
|
String currentKey = keyList.nextToken();
|
||||||
contactEntryKey.addOption(new Option(currentKey, ((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.key." + currentKey).localize())));
|
contactEntryKey.addOption(new Option(currentKey, ((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key." + currentKey).localize())));
|
||||||
}
|
}
|
||||||
|
|
||||||
add(contactEntryKey);
|
add(contactEntryKey);
|
||||||
|
|
||||||
// Value field
|
// Value field
|
||||||
add(new Label(BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.value")));
|
add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.value")));
|
||||||
ParameterModel contactEntryValueParam = new StringParameter(ContactEntry.VALUE);
|
ParameterModel contactEntryValueParam = new StringParameter(GenericContactEntry.VALUE);
|
||||||
TextField contactEntryValue = new TextField(contactEntryValueParam);
|
TextField contactEntryValue = new TextField(contactEntryValueParam);
|
||||||
contactEntryValue.addValidationListener(new NotNullValidationListener());
|
contactEntryValue.addValidationListener(new NotNullValidationListener());
|
||||||
add(contactEntryValue);
|
add(contactEntryValue);
|
||||||
|
|
||||||
// Description field, only for internal usage
|
// Description field, only for internal usage
|
||||||
add(new Label(BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry.description")));
|
add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.description")));
|
||||||
ParameterModel contactEntryDescriptionParam = new StringParameter(ContactEntry.DESCRIPTION);
|
ParameterModel contactEntryDescriptionParam = new StringParameter(GenericContactEntry.DESCRIPTION);
|
||||||
TextField contactEntryDescription = new TextField(contactEntryDescriptionParam);
|
TextField contactEntryDescription = new TextField(contactEntryDescriptionParam);
|
||||||
add(contactEntryDescription);
|
add(contactEntryDescription);
|
||||||
|
|
||||||
|
|
@ -92,16 +92,16 @@ public class ContactEntryAddForm extends BasicItemForm {
|
||||||
|
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
Contact contact = (Contact)m_itemModel.getSelectedObject(fse.getPageState());
|
GenericContact contact = (GenericContact)m_itemModel.getSelectedObject(fse.getPageState());
|
||||||
|
|
||||||
// save only if save button was pressed
|
// save only if save button was pressed
|
||||||
if (contact != null
|
if (contact != null
|
||||||
&& getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
&& getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||||
|
|
||||||
ContactEntry contactEntry = new ContactEntry(contact,
|
GenericContactEntry contactEntry = new GenericContactEntry(contact,
|
||||||
(String)data.get(ContactEntry.KEY),
|
(String)data.get(GenericContactEntry.KEY),
|
||||||
(String)data.get(ContactEntry.VALUE),
|
(String)data.get(GenericContactEntry.VALUE),
|
||||||
(String)data.get(ContactEntry.DESCRIPTION));
|
(String)data.get(GenericContactEntry.DESCRIPTION));
|
||||||
|
|
||||||
contact.addContactEntry(contactEntry);
|
contact.addContactEntry(contactEntry);
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
/*
|
||||||
|
* GenericContactPersonPropertiesStep.java
|
||||||
|
*
|
||||||
|
* Created on 4. Juli 2009, 15:12
|
||||||
|
*
|
||||||
|
* To change this template, choose Tools | Template Manager
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
|
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||||
|
import com.arsdigita.bebop.Component;
|
||||||
|
import com.arsdigita.bebop.Label;
|
||||||
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author quasi
|
||||||
|
*/
|
||||||
|
public class GenericContactPersonPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
|
public static final String ADD_PERSON_SHEET_NAME = "addPerson";
|
||||||
|
public static final String EDIT_PERSON_SHEET_NAME = "editPerson";
|
||||||
|
public static final String CHANGE_PERSON_SHEET_NAME = "changePerson";
|
||||||
|
public static final String DELETE_PERSON_SHEET_NAME = "deletePerson";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of GenericContactPersonPropertiesStep
|
||||||
|
*/
|
||||||
|
public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||||
|
this(itemModel, parent, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
|
||||||
|
super(itemModel, parent, prefix);
|
||||||
|
|
||||||
|
//XXX
|
||||||
|
// if(false/*EMPTY*/) {
|
||||||
|
|
||||||
|
BasicPageForm addPersonSheet = new GenericContactAttachPersonPropertyForm(itemModel, this);
|
||||||
|
add(ADD_PERSON_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.attach_person").localize(), new WorkflowLockedComponentAccess(addPersonSheet, itemModel), addPersonSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
/* Set the displayComponent for this step */
|
||||||
|
// setDisplayComponent(getEmptyPersonPropertySheet(itemModel));
|
||||||
|
|
||||||
|
// } else {
|
||||||
|
|
||||||
|
BasicPageForm editPersonSheet = new GenericContactEditPersonPropertyForm(itemModel, this);
|
||||||
|
add(EDIT_PERSON_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.edit_person").localize(), new WorkflowLockedComponentAccess(editPersonSheet, itemModel), editPersonSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
// BasicPageForm changePersonSheet = new GenericContactEditPersonPropertyForm(itemModel, this);
|
||||||
|
// add(CHANGE_PERSON_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.reattach_person").localize(), new WorkflowLockedComponentAccess(changePersonSheet, itemModel), changePersonSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
BasicPageForm deletePersonSheet = new GenericContactDeletePersonForm(itemModel, this);
|
||||||
|
add(DELETE_PERSON_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_person").localize(), new WorkflowLockedComponentAccess(deletePersonSheet, itemModel), deletePersonSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
/* Set the displayComponent for this step */
|
||||||
|
setDisplayComponent(getPersonPropertySheet(itemModel));
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Component getPersonPropertySheet(ItemSelectionModel itemModel) {
|
||||||
|
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||||
|
|
||||||
|
sheet.add((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize(), "person." + GenericPerson.SURNAME);
|
||||||
|
sheet.add((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize(), "person." + GenericPerson.GIVENNAME);
|
||||||
|
sheet.add((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize(), "person." + GenericPerson.TITLEPRE);
|
||||||
|
sheet.add((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize(), "person." + GenericPerson.TITLEPOST);
|
||||||
|
|
||||||
|
return sheet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Component getEmptyPersonPropertySheet(ItemSelectionModel itemModel) {
|
||||||
|
return new Label(((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.emptyPerson").localize()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
|
|
@ -14,8 +14,8 @@ import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
import com.arsdigita.bebop.SegmentedPanel;
|
import com.arsdigita.bebop.SegmentedPanel;
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
|
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
@ -23,9 +23,9 @@ import org.apache.log4j.Logger;
|
||||||
/**
|
/**
|
||||||
* AuthoringStep for the basic properties of a basic contact
|
* AuthoringStep for the basic properties of a basic contact
|
||||||
*/
|
*/
|
||||||
public class ContactPropertiesStep extends SimpleEditStep {
|
public class GenericContactPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(ContactPropertiesStep.class);
|
private static final Logger logger = Logger.getLogger(GenericContactPropertiesStep.class);
|
||||||
/**
|
/**
|
||||||
* Name of the this edit sheet (Don't know if this this really needed.
|
* Name of the this edit sheet (Don't know if this this really needed.
|
||||||
* It has the same value in almost all PropertiesStep classes)
|
* It has the same value in almost all PropertiesStep classes)
|
||||||
|
|
@ -38,7 +38,7 @@ public class ContactPropertiesStep extends SimpleEditStep {
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
* @param parent
|
* @param parent
|
||||||
*/
|
*/
|
||||||
public ContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
public GenericContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||||
super(itemModel, parent);
|
super(itemModel, parent);
|
||||||
|
|
||||||
setDefaultEditKey(EDIT_BASIC_SHEET_NAME);
|
setDefaultEditKey(EDIT_BASIC_SHEET_NAME);
|
||||||
|
|
@ -58,39 +58,39 @@ public class ContactPropertiesStep extends SimpleEditStep {
|
||||||
SimpleEditStep basicProperties = new SimpleEditStep(itemModel, parent, EDIT_BASIC_SHEET_NAME);
|
SimpleEditStep basicProperties = new SimpleEditStep(itemModel, parent, EDIT_BASIC_SHEET_NAME);
|
||||||
|
|
||||||
/* Create the edit component for this SimpleEditStep and the corresponding link */
|
/* Create the edit component for this SimpleEditStep and the corresponding link */
|
||||||
BasicPageForm editBasicSheet = new ContactPropertyForm(itemModel, this);
|
BasicPageForm editBasicSheet = new GenericContactPropertyForm(itemModel, this);
|
||||||
basicProperties.add(EDIT_BASIC_SHEET_NAME, (String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.edit_basic_properties").localize(), new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton());
|
basicProperties.add(EDIT_BASIC_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.edit_basic_properties").localize(), new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
/* Set the displayComponent for this step */
|
/* Set the displayComponent for this step */
|
||||||
basicProperties.setDisplayComponent(getContactPropertySheet(itemModel));
|
basicProperties.setDisplayComponent(getContactPropertySheet(itemModel));
|
||||||
|
|
||||||
/* Add the SimpleEditStep to the segmented panel */
|
/* Add the SimpleEditStep to the segmented panel */
|
||||||
segmentedPanel.addSegment(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.basic_properties").localize()), basicProperties);
|
segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.basic_properties").localize()), basicProperties);
|
||||||
|
|
||||||
// If not disabled via registry, add the ui for attaching a person
|
// If not disabled via registry, add the ui for attaching a person
|
||||||
if (!Contact.getConfig().getHidePerson()) {
|
if (!GenericContact.getConfig().getHidePerson()) {
|
||||||
|
|
||||||
ContactPersonPropertiesStep personProperties = new ContactPersonPropertiesStep(itemModel, parent);
|
GenericContactPersonPropertiesStep personProperties = new GenericContactPersonPropertiesStep(itemModel, parent);
|
||||||
segmentedPanel.addSegment(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.person").localize()), personProperties);
|
segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.person").localize()), personProperties);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Contact.getConfig().getHideAddress()) {
|
if (!GenericContact.getConfig().getHideAddress()) {
|
||||||
|
|
||||||
ContactAddressPropertiesStep addressProperties = new ContactAddressPropertiesStep(itemModel, parent);
|
GenericContactAddressPropertiesStep addressProperties = new GenericContactAddressPropertiesStep(itemModel, parent);
|
||||||
segmentedPanel.addSegment(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.address").localize()), addressProperties);
|
segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.address").localize()), addressProperties);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ContactEntriesPropertiesStep contactEntries = new ContactEntriesPropertiesStep(itemModel, parent);
|
GenericContactEntriesPropertiesStep contactEntries = new GenericContactEntriesPropertiesStep(itemModel, parent);
|
||||||
segmentedPanel.addSegment(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.contact.contactEntry").localize()), contactEntries);
|
segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry").localize()), contactEntries);
|
||||||
|
|
||||||
return segmentedPanel;
|
return segmentedPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and returns the sheet for editing the basic properties
|
* Creates and returns the sheet for editing the basic properties
|
||||||
* of a contact. (@see ContactPropertyForm).
|
* of a contact. (@see GenericContactPropertyForm).
|
||||||
*
|
*
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
* @return The sheet for editing the properties of the contact.
|
* @return The sheet for editing the properties of the contact.
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
|
|
@ -8,22 +8,22 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.cms.basetypes.Contact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form for editing the basic properties of a basic contact.
|
* Form for editing the basic properties of a basic contact.
|
||||||
*/
|
*/
|
||||||
public class ContactPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
public class GenericContactPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(ContactPropertyForm.class);
|
private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class);
|
||||||
|
|
||||||
private ContactPropertiesStep m_step;
|
private GenericContactPropertiesStep m_step;
|
||||||
|
|
||||||
public static final String PERSON = Contact.PERSON;
|
public static final String PERSON = GenericContact.PERSON;
|
||||||
public static final String ADRESS = Contact.ADDRESS;
|
public static final String ADRESS = GenericContact.ADDRESS;
|
||||||
public static final String CONTACT_ENTRIES= Contact.CONTACT_ENTRIES;
|
public static final String CONTACT_ENTRIES= GenericContact.CONTACT_ENTRIES;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the form
|
* ID of the form
|
||||||
|
|
@ -35,7 +35,7 @@ public class ContactPropertyForm extends BasicPageForm implements FormProcessLis
|
||||||
*
|
*
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
*/
|
*/
|
||||||
public ContactPropertyForm(ItemSelectionModel itemModel) {
|
public GenericContactPropertyForm(ItemSelectionModel itemModel) {
|
||||||
this(itemModel, null);
|
this(itemModel, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class ContactPropertyForm extends BasicPageForm implements FormProcessLis
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
* @param step
|
* @param step
|
||||||
*/
|
*/
|
||||||
public ContactPropertyForm(ItemSelectionModel itemModel, ContactPropertiesStep step) {
|
public GenericContactPropertyForm(ItemSelectionModel itemModel, GenericContactPropertiesStep step) {
|
||||||
super(ID, itemModel);
|
super(ID, itemModel);
|
||||||
m_step = step;
|
m_step = step;
|
||||||
addSubmissionListener(this);
|
addSubmissionListener(this);
|
||||||
|
|
@ -56,7 +56,7 @@ public class ContactPropertyForm extends BasicPageForm implements FormProcessLis
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.basetypes.ui.contact.basic_properties.description").localize())));
|
add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.contact.basic_properties.description").localize())));
|
||||||
TextArea description = new TextArea(DESCRIPTION);
|
TextArea description = new TextArea(DESCRIPTION);
|
||||||
description.setRows(5);
|
description.setRows(5);
|
||||||
description.setCols(30);
|
description.setCols(30);
|
||||||
|
|
@ -67,7 +67,7 @@ public class ContactPropertyForm extends BasicPageForm implements FormProcessLis
|
||||||
@Override
|
@Override
|
||||||
public void init(FormSectionEvent e) throws FormProcessException {
|
public void init(FormSectionEvent e) throws FormProcessException {
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
Contact contact = (Contact)super.initBasicWidgets(e);
|
GenericContact contact = (GenericContact)super.initBasicWidgets(e);
|
||||||
|
|
||||||
// data.put(DESCRIPTION, contact.getDescription());
|
// data.put(DESCRIPTION, contact.getDescription());
|
||||||
}
|
}
|
||||||
|
|
@ -76,7 +76,7 @@ public class ContactPropertyForm extends BasicPageForm implements FormProcessLis
|
||||||
public void process(FormSectionEvent e) throws FormProcessException {
|
public void process(FormSectionEvent e) throws FormProcessException {
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
|
|
||||||
Contact contact = (Contact)super.processBasicWidgets(e);
|
GenericContact contact = (GenericContact)super.processBasicWidgets(e);
|
||||||
|
|
||||||
if((contact != null) && (getSaveCancelSection().getSaveButton().isSelected(e.getPageState()))) {
|
if((contact != null) && (getSaveCancelSection().getSaveButton().isSelected(e.getPageState()))) {
|
||||||
// contact.setDescription((String)data.get(DESCRIPTION));
|
// contact.setDescription((String)data.get(DESCRIPTION));
|
||||||
|
|
@ -16,14 +16,14 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
import com.arsdigita.domain.DomainObject;
|
import com.arsdigita.domain.DomainObject;
|
||||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
|
|
@ -31,14 +31,14 @@ import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
|
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
|
|
||||||
public class PersonPropertiesStep extends SimpleEditStep {
|
public class GenericPersonPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
public static final String EDIT_SHEET_NAME = "edit";
|
public static final String EDIT_SHEET_NAME = "edit";
|
||||||
|
|
||||||
public PersonPropertiesStep(ItemSelectionModel itemModel,
|
public GenericPersonPropertiesStep(ItemSelectionModel itemModel,
|
||||||
AuthoringKitWizard parent) {
|
AuthoringKitWizard parent) {
|
||||||
super(itemModel, parent);
|
super(itemModel, parent);
|
||||||
|
|
||||||
|
|
@ -50,20 +50,20 @@ public class PersonPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
protected void createEditSheet(ItemSelectionModel itemModel) {
|
protected void createEditSheet(ItemSelectionModel itemModel) {
|
||||||
BasicPageForm editSheet;
|
BasicPageForm editSheet;
|
||||||
editSheet = new PersonPropertyForm(itemModel, this);
|
editSheet = new GenericPersonPropertyForm(itemModel, this);
|
||||||
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton());
|
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Component getPersonPropertySheet(ItemSelectionModel itemModel) {
|
public static Component getPersonPropertySheet(ItemSelectionModel itemModel) {
|
||||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||||
|
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.surname").localize(), Person.SURNAME);
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize(), GenericPerson.SURNAME);
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.givenname").localize(), Person.GIVENNAME);
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize(), GenericPerson.GIVENNAME);
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepre").localize(), Person.TITLEPRE);
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize(), GenericPerson.TITLEPRE);
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepost").localize(), Person.TITLEPOST);
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize(), GenericPerson.TITLEPOST);
|
||||||
|
|
||||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(),
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(),
|
||||||
ContentPage.LAUNCH_DATE,
|
ContentPage.LAUNCH_DATE,
|
||||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||||
|
|
||||||
|
|
@ -74,7 +74,7 @@ public class PersonPropertiesStep extends SimpleEditStep {
|
||||||
if (page.getLaunchDate() != null) {
|
if (page.getLaunchDate() != null) {
|
||||||
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
|
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
|
||||||
} else {
|
} else {
|
||||||
return (String) BasetypesGlobalizationUtil.globalize("cms.ui.unknown").localize();
|
return (String) ContenttypesGlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.cms.basetypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
|
|
@ -29,8 +29,8 @@ import com.arsdigita.bebop.form.TextField;
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.basetypes.Person;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
@ -39,24 +39,24 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* @author: Jens Pelzetter
|
* @author: Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class PersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
public class GenericPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||||
private static final Logger s_log = Logger.getLogger(PersonPropertyForm.class);
|
private static final Logger s_log = Logger.getLogger(GenericPersonPropertyForm.class);
|
||||||
|
|
||||||
private PersonPropertiesStep m_step;
|
private GenericPersonPropertiesStep m_step;
|
||||||
|
|
||||||
public static final String PERSON = Person.PERSON;
|
public static final String PERSON = GenericPerson.PERSON;
|
||||||
public static final String SURNAME = Person.SURNAME;
|
public static final String SURNAME = GenericPerson.SURNAME;
|
||||||
public static final String GIVENNAME = Person.GIVENNAME;
|
public static final String GIVENNAME = GenericPerson.GIVENNAME;
|
||||||
public static final String TITLEPRE = Person.TITLEPRE;
|
public static final String TITLEPRE = GenericPerson.TITLEPRE;
|
||||||
public static final String TITLEPOST = Person.TITLEPOST;
|
public static final String TITLEPOST = GenericPerson.TITLEPOST;
|
||||||
|
|
||||||
public static final String ID = "Person_edit";
|
public static final String ID = "Person_edit";
|
||||||
|
|
||||||
public PersonPropertyForm(ItemSelectionModel itemModel) {
|
public GenericPersonPropertyForm(ItemSelectionModel itemModel) {
|
||||||
this(itemModel,null);
|
this(itemModel,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PersonPropertyForm(ItemSelectionModel itemModel, PersonPropertiesStep step) {
|
public GenericPersonPropertyForm(ItemSelectionModel itemModel, GenericPersonPropertiesStep step) {
|
||||||
super(ID, itemModel);
|
super(ID, itemModel);
|
||||||
m_step = step;
|
m_step = step;
|
||||||
addSubmissionListener (this);
|
addSubmissionListener (this);
|
||||||
|
|
@ -66,22 +66,22 @@ public class PersonPropertyForm extends BasicPageForm implements FormProcessList
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets ();
|
super.addWidgets ();
|
||||||
|
|
||||||
add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.surname").localize()));
|
add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize()));
|
||||||
ParameterModel surnameParam = new StringParameter(SURNAME);
|
ParameterModel surnameParam = new StringParameter(SURNAME);
|
||||||
TextField surname = new TextField (surnameParam);
|
TextField surname = new TextField (surnameParam);
|
||||||
add(surname);
|
add(surname);
|
||||||
|
|
||||||
add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.givenname").localize()));
|
add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize()));
|
||||||
ParameterModel givennameParam = new StringParameter(GIVENNAME);
|
ParameterModel givennameParam = new StringParameter(GIVENNAME);
|
||||||
TextField givenname = new TextField (givennameParam);
|
TextField givenname = new TextField (givennameParam);
|
||||||
add(givenname);
|
add(givenname);
|
||||||
|
|
||||||
add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepre").localize()));
|
add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize()));
|
||||||
ParameterModel titlepreParam = new StringParameter(TITLEPRE);
|
ParameterModel titlepreParam = new StringParameter(TITLEPRE);
|
||||||
TextField titlepre = new TextField (titlepreParam);
|
TextField titlepre = new TextField (titlepreParam);
|
||||||
add(titlepre);
|
add(titlepre);
|
||||||
|
|
||||||
add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepost").localize()));
|
add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize()));
|
||||||
ParameterModel titlepostParam = new StringParameter(TITLEPOST);
|
ParameterModel titlepostParam = new StringParameter(TITLEPOST);
|
||||||
TextField titlepost = new TextField (titlepostParam);
|
TextField titlepost = new TextField (titlepostParam);
|
||||||
add(titlepost);
|
add(titlepost);
|
||||||
|
|
@ -89,7 +89,7 @@ public class PersonPropertyForm extends BasicPageForm implements FormProcessList
|
||||||
|
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
Person person = (Person)super.initBasicWidgets(fse);
|
GenericPerson person = (GenericPerson)super.initBasicWidgets(fse);
|
||||||
|
|
||||||
data.put(SURNAME,person.getSurname());
|
data.put(SURNAME,person.getSurname());
|
||||||
data.put(GIVENNAME, person.getGivenName());
|
data.put(GIVENNAME, person.getGivenName());
|
||||||
|
|
@ -107,7 +107,7 @@ public class PersonPropertyForm extends BasicPageForm implements FormProcessList
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
Person person = (Person)super.processBasicWidgets(fse);
|
GenericPerson person = (GenericPerson)super.processBasicWidgets(fse);
|
||||||
|
|
||||||
if (person != null &&
|
if (person != null &&
|
||||||
getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||||
|
|
@ -17,13 +17,13 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.cms.basetypes.util;
|
package com.arsdigita.cms.contenttypes.util;
|
||||||
|
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
public class BasetypesGlobalizationUtil {
|
public class ContenttypesGlobalizationUtil {
|
||||||
final public static String BUNDLE_NAME =
|
final public static String BUNDLE_NAME =
|
||||||
"com.arsdigita.cms.basetypes.util.BasetypesResourceBundle";
|
"com.arsdigita.cms.contenttypes.util.BasetypesResourceBundle";
|
||||||
|
|
||||||
public static GlobalizedMessage globalize (String key) {
|
public static GlobalizedMessage globalize (String key) {
|
||||||
return new GlobalizedMessage(key, BUNDLE_NAME);
|
return new GlobalizedMessage(key, BUNDLE_NAME);
|
||||||
|
|
@ -17,17 +17,17 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.cms.basetypes.util;
|
package com.arsdigita.cms.contenttypes.util;
|
||||||
|
|
||||||
import java.util.PropertyResourceBundle;
|
import java.util.PropertyResourceBundle;
|
||||||
import com.arsdigita.globalization.ChainedResourceBundle;
|
import com.arsdigita.globalization.ChainedResourceBundle;
|
||||||
import com.arsdigita.cms.CMSGlobalized;
|
import com.arsdigita.cms.CMSGlobalized;
|
||||||
|
|
||||||
public class BasetypesResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
|
public class ContenttypesResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
|
||||||
public static final String MEMBER_BUNDLE_NAME =
|
public static final String MEMBER_BUNDLE_NAME =
|
||||||
"com.arsdigita.cms.basetypes.BasetypesResources";
|
"com.arsdigita.cms.contenttypes.BasetypesResources";
|
||||||
|
|
||||||
public BasetypesResourceBundle() {
|
public ContenttypesResourceBundle() {
|
||||||
super();
|
super();
|
||||||
addBundle((PropertyResourceBundle)getBundle(MEMBER_BUNDLE_NAME));
|
addBundle((PropertyResourceBundle)getBundle(MEMBER_BUNDLE_NAME));
|
||||||
addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
|
addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
package com.arsdigita.cms.dispatcher;
|
package com.arsdigita.cms.dispatcher;
|
||||||
|
|
||||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||||
import com.arsdigita.cms.basetypes.Article;
|
import com.arsdigita.cms.contenttypes.GenericArticle;
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
import com.arsdigita.cms.ImageAssetCollection;
|
import com.arsdigita.cms.ImageAssetCollection;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
|
|
@ -121,7 +121,7 @@ public class StreamImage extends ResourceHandlerImpl {
|
||||||
oid = new OID(ImageAsset.BASE_DATA_OBJECT_TYPE, imageId);
|
oid = new OID(ImageAsset.BASE_DATA_OBJECT_TYPE, imageId);
|
||||||
}
|
}
|
||||||
Transaction transaction = null;
|
Transaction transaction = null;
|
||||||
Article article = null;
|
GenericArticle article = null;
|
||||||
// XXX: add back rollback
|
// XXX: add back rollback
|
||||||
/*if (transactionID != null) {
|
/*if (transactionID != null) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -129,7 +129,7 @@ public class StreamImage extends ResourceHandlerImpl {
|
||||||
new Transaction(transactionID);
|
new Transaction(transactionID);
|
||||||
// we have a transaction so let's see if we have an article
|
// we have a transaction so let's see if we have an article
|
||||||
if (objectID != null) {
|
if (objectID != null) {
|
||||||
article = new Article(objectID);
|
article = new GenericArticle(objectID);
|
||||||
article.rollBackTo(transaction);
|
article.rollBackTo(transaction);
|
||||||
}
|
}
|
||||||
} catch (DataObjectNotFoundException e) {
|
} catch (DataObjectNotFoundException e) {
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ init com.arsdigita.cms.installer.Initializer {
|
||||||
|
|
||||||
init com.arsdigita.cms.installer.xml.ContentTypeInitializer {
|
init com.arsdigita.cms.installer.xml.ContentTypeInitializer {
|
||||||
contentTypes = {
|
contentTypes = {
|
||||||
"/WEB-INF/basetypes/Address.xml",
|
"/WEB-INF/content-types/GenericAddress.xml",
|
||||||
"/WEB-INF/basetypes/Article.xml",
|
"/WEB-INF/content-types/GenericArticle.xml",
|
||||||
"/WEB-INF/basetypes/Contact.xml",
|
"/WEB-INF/content-types/GenericContact.xml",
|
||||||
"/WEB-INF/basetypes/Person.xml",
|
"/WEB-INF/content-types/GenericPerson.xml",
|
||||||
"/WEB-INF/content-types/Template.xml"
|
"/WEB-INF/content-types/Template.xml"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
package com.arsdigita.cms.ui;
|
package com.arsdigita.cms.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.cms.basetypes.Article;
|
import com.arsdigita.cms.contenttypes.GenericArticle;
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
|
|
@ -28,7 +28,7 @@ import com.arsdigita.xml.Element;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extends {@link ImageDisplay} to display the first
|
* Extends {@link ImageDisplay} to display the first
|
||||||
* (according to the order attribute) image associated with an {@link Article}
|
* (according to the order attribute) image associated with an {@link GenericArticle}
|
||||||
* The typical usage for this component is
|
* The typical usage for this component is
|
||||||
* <blockquote><pre><code>ArticleImageDisplay d = new ArticleImageDisplay(myItemSelectionModel, false);</code></pre></blockquote>
|
* <blockquote><pre><code>ArticleImageDisplay d = new ArticleImageDisplay(myItemSelectionModel, false);</code></pre></blockquote>
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -47,7 +47,7 @@ public class ArticleImageDisplay extends ImageDisplay {
|
||||||
* Construct a new <code>ArticleImageDisplay</code>
|
* Construct a new <code>ArticleImageDisplay</code>
|
||||||
*
|
*
|
||||||
* @param article the {@link ItemSelectionModel} which
|
* @param article the {@link ItemSelectionModel} which
|
||||||
* supplies the {@link Article}
|
* supplies the {@link GenericArticle}
|
||||||
*
|
*
|
||||||
* @param assets the {@link ItemSelectionModel} which
|
* @param assets the {@link ItemSelectionModel} which
|
||||||
* supplies the {@link ImageAsset} for the article; it is
|
* supplies the {@link ImageAsset} for the article; it is
|
||||||
|
|
@ -74,9 +74,9 @@ public class ArticleImageDisplay extends ImageDisplay {
|
||||||
* @return the currently selected article
|
* @return the currently selected article
|
||||||
* @post ( return != null )
|
* @post ( return != null )
|
||||||
*/
|
*/
|
||||||
protected Article getArticle(PageState state) {
|
protected GenericArticle getArticle(PageState state) {
|
||||||
Article article = (Article) m_article.getSelectedObject(state);
|
GenericArticle article = (GenericArticle) m_article.getSelectedObject(state);
|
||||||
Assert.exists(article, "Article");
|
Assert.exists(article, "GenericArticle");
|
||||||
return article;
|
return article;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -89,7 +89,7 @@ public class ArticleImageDisplay extends ImageDisplay {
|
||||||
|
|
||||||
super.generateImagePropertiesXML(image, state, element);
|
super.generateImagePropertiesXML(image, state, element);
|
||||||
|
|
||||||
Article article = getArticle(state);
|
GenericArticle article = getArticle(state);
|
||||||
String caption = article.getCaption(image);
|
String caption = article.getCaption(image);
|
||||||
if ( caption != null ) {
|
if ( caption != null ) {
|
||||||
element.addAttribute("caption", caption);
|
element.addAttribute("caption", caption);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ import com.arsdigita.bebop.table.DefaultTableCellRenderer;
|
||||||
import com.arsdigita.bebop.table.TableCellRenderer;
|
import com.arsdigita.bebop.table.TableCellRenderer;
|
||||||
import com.arsdigita.bebop.table.TableModel;
|
import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
import com.arsdigita.cms.basetypes.ArticleImageAssociation;
|
import com.arsdigita.cms.contenttypes.GenericArticleImageAssociation;
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
|
|
@ -208,7 +208,7 @@ public class ImageBrowser extends Table {
|
||||||
try {
|
try {
|
||||||
ImageAsset asset = (ImageAsset) DomainObjectFactory.newInstance
|
ImageAsset asset = (ImageAsset) DomainObjectFactory.newInstance
|
||||||
(new OID(ImageAsset.BASE_DATA_OBJECT_TYPE,(BigDecimal) key));
|
(new OID(ImageAsset.BASE_DATA_OBJECT_TYPE,(BigDecimal) key));
|
||||||
if (!ArticleImageAssociation.imageHasAssociation(asset)) {
|
if (!GenericArticleImageAssociation.imageHasAssociation(asset)) {
|
||||||
canDelete = true;
|
canDelete = true;
|
||||||
}
|
}
|
||||||
} catch (DataObjectNotFoundException e) {
|
} catch (DataObjectNotFoundException e) {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
||||||
import com.arsdigita.bebop.SingleSelectionModel;
|
import com.arsdigita.bebop.SingleSelectionModel;
|
||||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||||
import com.arsdigita.cms.basetypes.Article;
|
import com.arsdigita.cms.contenttypes.GenericArticle;
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
import com.arsdigita.cms.ImageAssetCollection;
|
import com.arsdigita.cms.ImageAssetCollection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
|
@ -120,10 +120,10 @@ public class SingleImageSelectionModel extends ItemSelectionModel {
|
||||||
// Load the object from the item.
|
// Load the object from the item.
|
||||||
com.arsdigita.cms.ContentItem temp =
|
com.arsdigita.cms.ContentItem temp =
|
||||||
(com.arsdigita.cms.ContentItem)m_articleModel.getSelectedObject(state);
|
(com.arsdigita.cms.ContentItem)m_articleModel.getSelectedObject(state);
|
||||||
Article item = null;
|
GenericArticle item = null;
|
||||||
if ( temp != null ) {
|
if ( temp != null ) {
|
||||||
item =
|
item =
|
||||||
(Article) com.arsdigita.cms.ACSObjectFactory.castContentItem(temp);
|
(GenericArticle) com.arsdigita.cms.ACSObjectFactory.castContentItem(temp);
|
||||||
}
|
}
|
||||||
if ( item != null ) {
|
if ( item != null ) {
|
||||||
ImageAssetCollection images = item.getImages();
|
ImageAssetCollection images = item.getImages();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.basetypes.Article;
|
import com.arsdigita.cms.contenttypes.GenericArticle;
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
import com.arsdigita.cms.ImageAssetCollection;
|
import com.arsdigita.cms.ImageAssetCollection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
|
@ -180,7 +180,7 @@ public class ArticleImage extends SimpleContainer implements AuthoringStepCompon
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
// get the image fresh from the db each time this component displays;
|
// get the image fresh from the db each time this component displays;
|
||||||
// otherwise rollback doesn't appear to work on this pane
|
// otherwise rollback doesn't appear to work on this pane
|
||||||
Article art = (Article)(m_article.getSelectedObject(state));
|
GenericArticle art = (GenericArticle)(m_article.getSelectedObject(state));
|
||||||
ImageAssetCollection col = art.getImages();
|
ImageAssetCollection col = art.getImages();
|
||||||
ImageAsset img = null;
|
ImageAsset img = null;
|
||||||
if (col.next()) {
|
if (col.next()) {
|
||||||
|
|
@ -366,7 +366,7 @@ public class ArticleImage extends SimpleContainer implements AuthoringStepCompon
|
||||||
public void actionPerformed(ActionEvent event) {
|
public void actionPerformed(ActionEvent event) {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
ImageAsset img = getImageAsset(state);
|
ImageAsset img = getImageAsset(state);
|
||||||
Article articleTarget = getArticle(state);
|
GenericArticle articleTarget = getArticle(state);
|
||||||
articleTarget.removeImage(img);
|
articleTarget.removeImage(img);
|
||||||
articleTarget.save();
|
articleTarget.save();
|
||||||
m_assetsWithImage.setSelectedObject(state, null);
|
m_assetsWithImage.setSelectedObject(state, null);
|
||||||
|
|
@ -419,9 +419,9 @@ public class ArticleImage extends SimpleContainer implements AuthoringStepCompon
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Article getArticle(PageState state) {
|
private GenericArticle getArticle(PageState state) {
|
||||||
Article article = (Article) m_articleWithImage.getSelectedObject(state);
|
GenericArticle article = (GenericArticle) m_articleWithImage.getSelectedObject(state);
|
||||||
Assert.exists(article, "Article");
|
Assert.exists(article, "GenericArticle");
|
||||||
return article;
|
return article;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||||
import com.arsdigita.cms.basetypes.ArticleImageAssociation;
|
import com.arsdigita.cms.contenttypes.GenericArticleImageAssociation;
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
|
|
@ -172,7 +172,7 @@ public class ArticleImageChooser extends SimpleContainer {
|
||||||
try {
|
try {
|
||||||
ImageAsset asset = (ImageAsset) DomainObjectFactory.newInstance
|
ImageAsset asset = (ImageAsset) DomainObjectFactory.newInstance
|
||||||
(new OID(ImageAsset.BASE_DATA_OBJECT_TYPE,imageId));
|
(new OID(ImageAsset.BASE_DATA_OBJECT_TYPE,imageId));
|
||||||
if (!ArticleImageAssociation.imageHasAssociation(asset)) {
|
if (!GenericArticleImageAssociation.imageHasAssociation(asset)) {
|
||||||
asset.setLive(null);
|
asset.setLive(null);
|
||||||
ItemCollection pendingVersions = asset.getPendingVersions();
|
ItemCollection pendingVersions = asset.getPendingVersions();
|
||||||
while(pendingVersions.next()) {
|
while(pendingVersions.next()) {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.form.TextField;
|
import com.arsdigita.bebop.form.TextField;
|
||||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.basetypes.Article;
|
import com.arsdigita.cms.contenttypes.GenericArticle;
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
|
|
@ -125,7 +125,7 @@ public abstract class BasicImageForm extends Form
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
|
|
||||||
Article item = getArticle(state);
|
GenericArticle item = getArticle(state);
|
||||||
ImageAsset asset = getImageAsset(state);
|
ImageAsset asset = getImageAsset(state);
|
||||||
|
|
||||||
if(item != null && asset != null) {
|
if(item != null && asset != null) {
|
||||||
|
|
@ -145,7 +145,7 @@ public abstract class BasicImageForm extends Form
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
|
|
||||||
Article item = getArticle(state);
|
GenericArticle item = getArticle(state);
|
||||||
ImageAsset asset = getImageAsset(state);
|
ImageAsset asset = getImageAsset(state);
|
||||||
|
|
||||||
if(item != null && asset != null) {
|
if(item != null && asset != null) {
|
||||||
|
|
@ -178,8 +178,8 @@ public abstract class BasicImageForm extends Form
|
||||||
* @param state The page state
|
* @param state The page state
|
||||||
* @return the currently selected item
|
* @return the currently selected item
|
||||||
*/
|
*/
|
||||||
public Article getArticle(PageState state) {
|
public GenericArticle getArticle(PageState state) {
|
||||||
return (Article)m_itemModel.getSelectedObject(state);
|
return (GenericArticle)m_itemModel.getSelectedObject(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.cms.basetypes.Article;
|
import com.arsdigita.cms.contenttypes.GenericArticle;
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
|
|
@ -56,7 +56,7 @@ public class ImagePropertiesForm extends BasicImageForm {
|
||||||
public void init(FormSectionEvent e) throws FormProcessException {
|
public void init(FormSectionEvent e) throws FormProcessException {
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
Article item = this.getArticle(state);
|
GenericArticle item = this.getArticle(state);
|
||||||
ImageAsset asset = this.getImageAsset(state);
|
ImageAsset asset = this.getImageAsset(state);
|
||||||
|
|
||||||
if ( asset == null ) {
|
if ( asset == null ) {
|
||||||
|
|
@ -70,7 +70,7 @@ public class ImagePropertiesForm extends BasicImageForm {
|
||||||
public void process(FormSectionEvent e) throws FormProcessException {
|
public void process(FormSectionEvent e) throws FormProcessException {
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
Article item = this.getArticle(state);
|
GenericArticle item = this.getArticle(state);
|
||||||
ImageAsset asset = this.getImageAsset(state);
|
ImageAsset asset = this.getImageAsset(state);
|
||||||
|
|
||||||
if ( asset == null ) {
|
if ( asset == null ) {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.cms.basetypes.Article;
|
import com.arsdigita.cms.contenttypes.GenericArticle;
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.ImageDisplay;
|
import com.arsdigita.cms.ui.ImageDisplay;
|
||||||
|
|
@ -73,7 +73,7 @@ public class ImageSelectionForm extends BasicImageForm {
|
||||||
s_log.debug("Selecting Image");
|
s_log.debug("Selecting Image");
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
Article item = this.getArticle(state);
|
GenericArticle item = this.getArticle(state);
|
||||||
ImageAsset a = this.getImageAsset(state);
|
ImageAsset a = this.getImageAsset(state);
|
||||||
|
|
||||||
if(a != null) {
|
if(a != null) {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||||
import com.arsdigita.cms.basetypes.Article;
|
import com.arsdigita.cms.contenttypes.GenericArticle;
|
||||||
import com.arsdigita.cms.ImageAsset;
|
import com.arsdigita.cms.ImageAsset;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ReusableImageAsset;
|
import com.arsdigita.cms.ReusableImageAsset;
|
||||||
|
|
@ -117,7 +117,7 @@ public class ImageUploadForm extends BasicImageForm implements FormSubmissionLis
|
||||||
|
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
Article item = this.getArticle(state);
|
GenericArticle item = this.getArticle(state);
|
||||||
ImageAsset a = null;
|
ImageAsset a = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ class CompoundFilterImpl extends FilterImpl implements CompoundFilter {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a filter that will AND together all filters passed in to it
|
* Creates a filter that will OR together all filters passed in to it
|
||||||
* For instance, if developers want to combine two filters in to one,
|
* For instance, if developers want to combine two filters in to one,
|
||||||
* they can write
|
* they can write
|
||||||
* <pre><code>
|
* <pre><code>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue