HealthCareFacility
Erste Version fertig. UI fertig bis auf: * Edit von Kontakten * Kein Traversal-Adapter * XSL fehlt * Sortieren der Kontakte noch nicht implementiert git-svn-id: https://svn.libreccm.org/ccm/trunk@223 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
c958a0138b
commit
f55e82c6f6
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0"?>
|
||||
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||
name="ccm-cms-types-healthCareFacility"
|
||||
prettyName="Red Hat CCM Content Types"
|
||||
version="6.6.0"
|
||||
release="1"
|
||||
webapp="ROOT">
|
||||
<ccm:dependencies>
|
||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-cms-types-genericorganization" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-cms-types-baseAddress" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-cms-types-baseContact" version="6.6.0" relation="ge"/>
|
||||
</ccm:dependencies>
|
||||
<ccm:directories>
|
||||
<ccm:directory name="pdl"/>
|
||||
<ccm:directory name="sql"/>
|
||||
<ccm:directory name="src"/>
|
||||
</ccm:directories>
|
||||
<ccm:contacts>
|
||||
<ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/>
|
||||
<ccm:contact uri="mailto:rhea@redhat.com" type="support"/>
|
||||
</ccm:contacts>
|
||||
<ccm:description>
|
||||
This is a collection of content types for managing / storing / rating health care organizations.
|
||||
</ccm:description>
|
||||
</ccm:application>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
model com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.contenttypes.GenricOrganization;
|
||||
import com.arsdigita.cms.contenttypes.BaseAddress;
|
||||
import com.arsdigita.cms.contenttypes.BaseContact;
|
||||
//import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
||||
import com.arsdigita.kernel.ACSObject;
|
||||
import com.arsdigita.cms.*;
|
||||
|
||||
// HealthCareFacility Object
|
||||
object type HealthCareFacility extends GenericOrganization {
|
||||
|
||||
BaseAddress[0..1] address = join ct_healthCareFacilities.address_id
|
||||
to ct_baseAddresses.address_id;
|
||||
|
||||
reference key ( ct_healthCareFacilities.hcf_id );
|
||||
}
|
||||
|
||||
association {
|
||||
|
||||
BaseContact[0..n] contacts = join ct_healthCareFacilities.hcf_id
|
||||
to ct_healthCareFacility_baseContact_map.hcf_id,
|
||||
join ct_healthCareFacility_baseContact_map.contact_id
|
||||
to ct_baseContacts.contact_id;
|
||||
|
||||
HealthCareFacility[0..n] healthCareFacilities = join ct_baseContacts.contact_id
|
||||
to ct_healthCareFacility_baseContact_map.contact_id,
|
||||
join ct_healthCareFacility_baseContact_map.hcf_id
|
||||
to ct_healthCareFacilities.hcf_id;
|
||||
|
||||
// Link Attribute
|
||||
String contact_type = ct_healthCareFacility_baseContact_map.contact_type VARCHAR(100);
|
||||
BigDecimal contact_order = ct_healthCareFacility_baseContact_map.contact_order INTEGER;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
--
|
||||
-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or
|
||||
-- modify it under the terms of the GNU Lesser General Public License
|
||||
-- as published by the Free Software Foundation; either version 2.1 of
|
||||
-- the License, or (at your option) any later version.
|
||||
--
|
||||
-- This library is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
-- Lesser General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU Lesser General Public
|
||||
-- License along with this library; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
--
|
||||
-- $Id: oracle-se-create.sql 287 2005-02-22 00:29:02Z sskracic $
|
||||
-- $DateTime: 2004/08/17 23:15:09 $
|
||||
@ ddl/oracle-se/create.sql
|
||||
|
||||
@ ddl/oracle-se/deferred.sql
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
--
|
||||
-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or
|
||||
-- modify it under the terms of the GNU Lesser General Public License
|
||||
-- as published by the Free Software Foundation; either version 2.1 of
|
||||
-- the License, or (at your option) any later version.
|
||||
--
|
||||
-- This library is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
-- Lesser General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU Lesser General Public
|
||||
-- License along with this library; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
--
|
||||
-- $Id: postgres-create.sql 287 2005-02-22 00:29:02Z sskracic $
|
||||
-- $DateTime: 2004/08/17 23:15:09 $
|
||||
begin;
|
||||
\i ddl/postgres/create.sql
|
||||
\i ddl/postgres/deferred.sql
|
||||
end;
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?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="HealthCareFacility"
|
||||
description="A content type to store a health care facility. Only to derive from"
|
||||
objectType="com.arsdigita.cms.contenttypes.HealthCareFacility"
|
||||
classname="com.arsdigita.cms.contenttypes.HealthCareFacility">
|
||||
|
||||
<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.HealthCareFacilityPropertiesStep"
|
||||
ordering="1"/>
|
||||
|
||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||
</ctd:authoring-kit>
|
||||
|
||||
</ctd:content-type>
|
||||
</ctd:content-types>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<registry>
|
||||
<config class="com.arsdigita.cms.contenttypes.HealthCareFacilityConfig" storage="ccm-cms-types-healthCareFacility/healthCareFacility.properties"/>
|
||||
</registry>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<load>
|
||||
<requires>
|
||||
<table name="inits"/>
|
||||
<table name="acs_objects"/>
|
||||
<table name="cms_items"/>
|
||||
<table name="ct_genericorganizations"/>
|
||||
<table name="ct_baseAddresses"/>
|
||||
<table name="ct_baseContacts"/>
|
||||
<initializer class="com.arsdigita.cms.Initializer"/>
|
||||
</requires>
|
||||
<provides>
|
||||
<table name="ct_healtCareFacilities"/>
|
||||
<!-- <table name="ct_healtCareFacility_baseContact_map"/> -->
|
||||
<initializer class="com.arsdigita.cms.contenttypes.HealthCareFacilityInitializer"/>
|
||||
</provides>
|
||||
<scripts>
|
||||
<schema directory="ccm-cms-types-healthCareFacility"/>
|
||||
<data class="com.arsdigita.cms.contenttypes.HealthCareFacilityLoader"/>
|
||||
</scripts>
|
||||
</load>
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* BaseContactCollection.java
|
||||
*
|
||||
* Created on 26. Juli 2009, 15:30
|
||||
*
|
||||
* To change this template, choose Tools | Template Manager
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.domain.DomainCollection;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author quasi
|
||||
*/
|
||||
public class BaseContactCollection extends DomainCollection {
|
||||
|
||||
public static final String ORDER = "link.contact_order asc";
|
||||
public static final String CONTACT_TYPE = "link.contact_type";
|
||||
public static final String CONTACT_ORDER = "link.contact_order";
|
||||
|
||||
/**
|
||||
* Creates a new instance of BaseContactCollection
|
||||
*/
|
||||
public BaseContactCollection(DataCollection dataCollection) {
|
||||
super(dataCollection);
|
||||
|
||||
m_dataCollection.addOrder(ORDER);
|
||||
}
|
||||
|
||||
// Get the contact type of the link
|
||||
public String getContactType() {
|
||||
return (String) m_dataCollection.get(CONTACT_TYPE);
|
||||
}
|
||||
|
||||
// Set the contact type of the link
|
||||
// public void setContactType(String contactType) {
|
||||
// getBaseContact().set(CONTACT_TYPE, contactType);
|
||||
// }
|
||||
|
||||
// Get the contact order of the link
|
||||
public String getContactOrder() {
|
||||
String retVal = ((BigDecimal) m_dataCollection.get(CONTACT_ORDER)).toString();
|
||||
|
||||
if(retVal == null || retVal.isEmpty()) {
|
||||
retVal = String.valueOf(this.getPosition());
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
// Set the contact order of the link
|
||||
// public void setContactOrder(long contactOrder) {
|
||||
// getBaseContact().set(CONTACT_ORDER, String.valueOf(contactOrder));
|
||||
// }
|
||||
|
||||
public BaseContact getBaseContact() {
|
||||
return new BaseContact(m_dataCollection.getDataObject());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Sören Bernstein, for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* This represents an organization. It is designed to be suitable
|
||||
* for most organizations. Currently, it offers the following properties:
|
||||
* - name of the organization
|
||||
* - an addendum for the name
|
||||
* - a short description of the organization.
|
||||
*
|
||||
* It is also possible to add roles to the organization, e.g. CEO, mayor or others.
|
||||
* The following features are planned to implement in one of the next commits:
|
||||
* - Adding OrganizationUnits
|
||||
*
|
||||
* The current version of this contenttype is modeled on base of the MultipartArticle
|
||||
* contenttype.
|
||||
*
|
||||
* @author Sören Bernstein
|
||||
*/
|
||||
public class HealthCareFacility extends GenericOrganization {
|
||||
|
||||
//private static final HealthCareFacilityConfig s_config = new HealthCareFacilityConfig();
|
||||
private static final Logger s_log = Logger.getLogger(HealthCareFacility.class);
|
||||
|
||||
private static final HealthCareFacilityConfig s_config = new HealthCareFacilityConfig();
|
||||
|
||||
public static final String ADDRESS = "address";
|
||||
public static final String CONTACTS = "contacts";
|
||||
public static final String CONTACT_TYPE = "contact_type";
|
||||
public static final String CONTACT_ORDER = "contact_order";
|
||||
|
||||
public static String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.HealthCareFacility";
|
||||
|
||||
/**
|
||||
* Called when the class is loaded by the Java class loader.
|
||||
*/
|
||||
static {
|
||||
s_config.load();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a possibly existing configuration object for the class.
|
||||
*
|
||||
* @return config object
|
||||
*/
|
||||
public static final HealthCareFacilityConfig getConfig() {
|
||||
return s_config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default constructor. This creates a new (empty) health care facility
|
||||
*/
|
||||
public HealthCareFacility() {
|
||||
this(BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trys to find an health care facility in the database by its id.
|
||||
*
|
||||
* @param id ID of the object to (re-)create
|
||||
* @throws DataObjectNotFoundException if no object with the given id is found in the database.
|
||||
*/
|
||||
public HealthCareFacility(BigDecimal id) throws DataObjectNotFoundException {
|
||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Trys to find an health care facility in the database by its OID.
|
||||
*
|
||||
* @param id ID of the object to (re-)create
|
||||
* @throws DataObjectNotFoundException if no object with the given OID is found in the database.
|
||||
*/
|
||||
public HealthCareFacility(OID id) throws DataObjectNotFoundException {
|
||||
super(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an new HealthCareFacility object from a DataObject
|
||||
*
|
||||
* @param obj The data object
|
||||
*/
|
||||
public HealthCareFacility(DataObject obj) {
|
||||
super(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Not sure for what this constructor is.
|
||||
*
|
||||
* @param type The type of the object to create (?)
|
||||
*/
|
||||
public HealthCareFacility(String type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
|
||||
/* accessors *************************************************/
|
||||
|
||||
// Get the address for this contact
|
||||
public BaseAddress getAddress() {
|
||||
return (BaseAddress)DomainObjectFactory.newInstance((DataObject)get(ADDRESS));
|
||||
}
|
||||
|
||||
// Set the address for this contact
|
||||
public void setAddress(BaseAddress address) {
|
||||
set(ADDRESS, address);
|
||||
}
|
||||
|
||||
// Unset the address for this contact
|
||||
public void unsetAddress() {
|
||||
set(ADDRESS, null);
|
||||
}
|
||||
|
||||
// Get all contacts for this health care facility
|
||||
public BaseContactCollection getContacts() {
|
||||
return new BaseContactCollection((DataCollection) get(CONTACTS));
|
||||
}
|
||||
|
||||
// Add a contact for this health care facility
|
||||
public void addContact(BaseContact contact, String contactType) {
|
||||
Assert.exists(contact, BaseContact.class);
|
||||
|
||||
DataObject link = add(CONTACTS, contact);
|
||||
|
||||
link.set(CONTACT_TYPE, contactType);
|
||||
link.set(CONTACT_ORDER, BigDecimal.valueOf(getContacts().size()));
|
||||
// this.save();
|
||||
|
||||
// add(CONTACTS, contact);
|
||||
}
|
||||
|
||||
// Remove a contect for this health care facility
|
||||
public void removeContactEntry(BaseContact contact) {
|
||||
Assert.exists(contact, BaseContact.class);
|
||||
remove(CONTACTS, contact);
|
||||
}
|
||||
|
||||
public boolean hasContacts() {
|
||||
return !this.getContacts().isEmpty();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.runtime.AbstractConfig;
|
||||
import com.arsdigita.util.parameter.Parameter;
|
||||
import com.arsdigita.util.parameter.BooleanParameter;
|
||||
import com.arsdigita.util.parameter.StringParameter;
|
||||
import java.util.StringTokenizer;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Stores the configuration record for the healthCareFacility.
|
||||
*
|
||||
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
|
||||
*/
|
||||
public final class HealthCareFacilityConfig extends AbstractConfig {
|
||||
|
||||
private static Logger s_log = Logger.getLogger(HealthCareFacilityConfig.class);
|
||||
|
||||
private final Parameter m_hideAddress;
|
||||
private final Parameter m_hideAddressPostalCode;
|
||||
private final Parameter m_hideAddressState;
|
||||
private final Parameter m_hideAddressCountry;
|
||||
private final Parameter m_contactTypeKeys;
|
||||
|
||||
/**
|
||||
* Public Constructor
|
||||
*/
|
||||
public HealthCareFacilityConfig() {
|
||||
|
||||
/**
|
||||
* If set to true disables the possibility to attach a baseAddress ct
|
||||
*/
|
||||
m_hideAddress = new BooleanParameter
|
||||
("com.arsdigita.cms.contenttypes.healthCareFacility.hide_address",
|
||||
Parameter.REQUIRED,
|
||||
new Boolean(false));
|
||||
|
||||
/**
|
||||
* If set to true hides the postal code entry field for the attached address ct
|
||||
*/
|
||||
m_hideAddressPostalCode = new BooleanParameter
|
||||
("com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_postal_code",
|
||||
Parameter.REQUIRED,
|
||||
new Boolean(false));
|
||||
|
||||
/**
|
||||
* If set to true hides the state entry field for the attached address ct
|
||||
*/
|
||||
m_hideAddressState = new BooleanParameter
|
||||
("com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_state",
|
||||
Parameter.REQUIRED,
|
||||
new Boolean(false));
|
||||
|
||||
/**
|
||||
* If set to true hides the country selection for the attaches address ct
|
||||
*/
|
||||
m_hideAddressCountry = new BooleanParameter
|
||||
("com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_country",
|
||||
Parameter.REQUIRED,
|
||||
new Boolean(false));
|
||||
|
||||
/**
|
||||
*/
|
||||
m_contactTypeKeys = new StringParameter
|
||||
("com.arsdigita.cms.contenttypes.healthCareFacility.contact_type_keys",
|
||||
Parameter.REQUIRED,
|
||||
"verwaltung,pflegeleitung,medLeitung");
|
||||
|
||||
register(m_hideAddress);
|
||||
register(m_hideAddressPostalCode);
|
||||
register(m_hideAddressState);
|
||||
register(m_hideAddressCountry);
|
||||
register(m_contactTypeKeys);
|
||||
|
||||
loadInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public final boolean getHideAddress() {
|
||||
return ((Boolean) get(m_hideAddress)).booleanValue();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public final boolean getHideAddressPostalCode() {
|
||||
return ((Boolean) get(m_hideAddressPostalCode)).booleanValue();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public final boolean getHideAddressState() {
|
||||
return ((Boolean) get(m_hideAddressState)).booleanValue();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public final boolean getHideAddressCountry() {
|
||||
return ((Boolean) get(m_hideAddressCountry)).booleanValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the contactEntryKeys as StringTokenizer.
|
||||
*/
|
||||
public final StringTokenizer getContactTypeKeys() {
|
||||
return new StringTokenizer((((String) get(m_contactTypeKeys)).replace(" ","")), ",", false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true, if language lang is part of supported langs
|
||||
*/
|
||||
public final boolean hasKey(String key) {
|
||||
return ((String) get(m_contactTypeKeys)).contains(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the index value for given key
|
||||
*/
|
||||
public final int getKeyIndex(String key) {
|
||||
int index = -1;
|
||||
|
||||
if(hasKey(key)) {
|
||||
StringTokenizer keys = getContactTypeKeys();
|
||||
while(keys.hasMoreElements()) {
|
||||
index++;
|
||||
if(keys.nextToken().equals(key)) break;
|
||||
}
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
com.arsdigita.cms.contenttypes.healthCareFacility.hide_address.title=Hide address attachment
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.hide_address.purpose=Hide the part to attach a baseAddress CT
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.hide_address.example=false
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.hide_address.format=[boolean]
|
||||
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_postal_code.title=Hide postal code for attached adress
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_postal_code.purpose=Hide the postal code entry field for the attached baseAddress
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_postal_code.example=false
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_postal_code.format=[boolean]
|
||||
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_state.title=Hide state for attached adress
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_state.purpose=Hide the state entry field for the attached baseAddress
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_state.example=false
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_state.format=[boolean]
|
||||
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_country.title=Hide country for attached address
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_country.purpose=Hide the country selection box for the attached baseAddress
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_country.example=false
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.address.hide_country.format=[boolean]
|
||||
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.contact_type_keys.title=Select available contact types
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.contact_type_keys.purpose=Select available contact types and define display order
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.contact_type_keys.example=verwaltung,pflegeleitung
|
||||
com.arsdigita.cms.contenttypes.healthCareFacility.contact_type_keys.format=[string]
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Sören Bernstein, for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.contenttypes.*;
|
||||
import org.apache.log4j.Logger;
|
||||
import com.arsdigita.runtime.LegacyInitEvent;
|
||||
|
||||
/**
|
||||
* Initializer of the HealthCareFacility content type.
|
||||
*
|
||||
* @author Sören Bernstein
|
||||
*/
|
||||
public class HealthCareFacilityInitializer extends ContentTypeInitializer {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(HealthCareFacilityInitializer.class);
|
||||
|
||||
/**
|
||||
* Constructor. calls only the constructor of the parent class with name of
|
||||
* the pdl.mf file of the content type an the BASIC_DATA_OBJECT_TYPE.
|
||||
*/
|
||||
public HealthCareFacilityInitializer() {
|
||||
super("ccm-cms-types-healthCareFacility.pdl.mf",
|
||||
HealthCareFacility.BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return path of the XSL stylesheet file. The stylesheet is very generic, because this
|
||||
* contenttype will be used with the new mandalay theme only.
|
||||
*/
|
||||
public String getStylesheet() {
|
||||
return "static/content-types/com/arsdigita/cms/contenttypes/HealthCareFacility.xsl";
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the init method of the parent class.
|
||||
*
|
||||
* @param evt The init event. LegacyInitEvent is marked deprecated. What should be used insted?
|
||||
*/
|
||||
@Override
|
||||
public void init(LegacyInitEvent evt) {
|
||||
super.init(evt);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Sören Bernstein, for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.contenttypes.*;
|
||||
import com.arsdigita.util.parameter.ResourceParameter;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Loader for the HealthCareFacility content type.
|
||||
*
|
||||
* @author Sören Bernstein
|
||||
*/
|
||||
public class HealthCareFacilityLoader extends AbstractContentTypeLoader {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(HealthCareFacilityLoader.class);
|
||||
private static final String[] TYPES = {
|
||||
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/HealthCareFacility.xml"
|
||||
};
|
||||
private ResourceParameter m_template;
|
||||
|
||||
/**
|
||||
* Returns the value of the type string.
|
||||
*
|
||||
* @return The type string.
|
||||
*/
|
||||
public String[] getTypes() {
|
||||
return TYPES;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public HealthCareFacilityLoader() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
cms.contenttypes.ui.healthCareFacility.basic_properties=Eigenschaften von Pflegeeinrichtung
|
||||
cms.contenttypes.ui.healthCareFacility.address=Adresse
|
||||
cms.contenttypes.ui.healthCareFacility.contact=Kontakte
|
||||
cms.contenttypes.ui.healthCareFacility.edit_basic_properties=Bearbeiten
|
||||
|
||||
cms.contenttypes.ui.healthCareFacility.attach_address=Adresse verknüpfen
|
||||
cms.contenttypes.ui.healthCareFacility.edit_address=Adresse bearbeiten
|
||||
cms.contenttypes.ui.healthCareFacility.delete_address=Adresse löschen
|
||||
cms.contenttypes.ui.healthCareFacility.emptyAddress=Zur Zeit ist keine Adresse verknüpft
|
||||
|
||||
cms.contenttypes.ui.healthCareFacility.select_address=Bitte wählen Sie eine Eintrag vom Typ BaseAddress
|
||||
cms.contenttypes.ui.healthCareFacility.select_address.change=Verändern
|
||||
cms.contenttypes.ui.healthCareFacility.select_address.add=Verknüpfen
|
||||
cms.contenttypes.ui.healthCareFacility.select_address.wrong_type=Der gewählte Eintrag ist nicht vom Typ BaseAddress
|
||||
cms.contenttypes.ui.healthCareFacility.select_address.cancelled=Abbruch
|
||||
cms.contenttypes.ui.healthCareFacility.delete_address.label=Wollen Sie die Verknüpfung zur Adresse entfernen?
|
||||
cms.contenttypes.ui.healthCareFacility.delete_address.button_label=Löschen
|
||||
|
||||
cms.contenttypes.ui.healthCareFacility.select_contact=Bitte wählen Sie eine Eintrag vom Typ BaseContact
|
||||
cms.contenttypes.ui.healthCareFacility.add_contact=Kontakt verknüpfen
|
||||
|
||||
cms.contenttypes.ui.healthCareFacility.contacts.none=Zur Zeit sind keine Kontaktinformationen verknüpft
|
||||
cms.contenttypes.ui.healthCareFacility.contact.order=Pos
|
||||
cms.contenttypes.ui.healthCareFacility.contact.type=Kontaktart
|
||||
cms.contenttypes.ui.healthCareFacility.contact.title=Titel
|
||||
cms.contenttypes.ui.healthCareFacility.contact.action=Aktionen
|
||||
|
||||
cms.contenttypes.ui.healthCareFacility.confirm_delete=Sind sie sicher?
|
||||
|
||||
cms.contenttypes.ui.healthCareFacility.contactType.key.verwaltung=Verwaltung
|
||||
cms.contenttypes.ui.healthCareFacility.contactType.key.pflegeleitung=Pflegeleitung
|
||||
cms.contenttypes.ui.healthCareFacility.contactType.key.medLeitung=Med. Leitung
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
* HealthCareFacilityAddressPropertiesStep.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.BaseAddress;
|
||||
import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
||||
import com.arsdigita.cms.contenttypes.util.BaseAddressGlobalizationUtil;
|
||||
import com.arsdigita.cms.contenttypes.util.HealthCareFacilityGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author quasi
|
||||
*/
|
||||
public class HealthCareFacilityAddressPropertiesStep 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 HealthCareFacilityAddressPropertiesStep
|
||||
*/
|
||||
public HealthCareFacilityAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
this(itemModel, parent, "");
|
||||
}
|
||||
|
||||
public HealthCareFacilityAddressPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
// HealthCareFacility healthCareFacility = (HealthCareFacility)itemModel.getSelectedObject(state);
|
||||
|
||||
//XXX
|
||||
// if(/*healthCareFacility.getAddress() == null*/ true) {
|
||||
BasicPageForm attachAddressSheet = new HealthCareFacilityAttachAddressPropertyForm(itemModel, this);
|
||||
add(ADD_ADDRESS_SHEET_NAME, (String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.attach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
/* Set the displayComponent for this step */
|
||||
// setDisplayComponent(getEmptyBaseAddressPropertySheet(itemModel));
|
||||
|
||||
// } else {
|
||||
|
||||
// editAddress
|
||||
BasicPageForm editAddressSheet = new HealthCareFacilityEditAddressPropertyForm(itemModel, this);
|
||||
add(EDIT_ADDRESS_SHEET_NAME, (String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.edit_address").localize(), new WorkflowLockedComponentAccess(editAddressSheet, itemModel), editAddressSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
// BasicPageForm attachAddressSheet = new HealthCareFacilityAttachAddressPropertyForm(itemModel, this);
|
||||
// add(CHANGE_ADDRESS_SHEET_NAME, (String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.reattach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
BasicPageForm deleteAddressSheet = new HealthCareFacilityDeleteAddressForm(itemModel, this);
|
||||
add(DELETE_ADDRESS_SHEET_NAME, (String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.delete_address").localize(), new WorkflowLockedComponentAccess(deleteAddressSheet, itemModel), deleteAddressSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
/* Set the displayComponent for this step */
|
||||
setDisplayComponent(getBaseAddressPropertySheet(itemModel));
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
public static Component getBaseAddressPropertySheet(ItemSelectionModel itemModel) {
|
||||
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.address").localize(), "address." + BaseAddress.ADDRESS);
|
||||
if(!HealthCareFacility.getConfig().getHideAddressPostalCode())
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.postal_code").localize(), "address." + BaseAddress.POSTAL_CODE);
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.city").localize(), "address." + BaseAddress.CITY);
|
||||
if(!HealthCareFacility.getConfig().getHideAddressState())
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.state").localize(), "address." + BaseAddress.STATE);
|
||||
|
||||
if(!HealthCareFacility.getConfig().getHideAddressCountry()) {
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.iso_country_code").localize(),
|
||||
"address." + BaseAddress.ISO_COUNTRY_CODE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
public String format(DomainObject item,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
BaseAddress baseAddress = ((HealthCareFacility)item).getAddress();
|
||||
if(baseAddress != null && baseAddress.getIsoCountryCode() != null) {
|
||||
return BaseAddress.getCountryNameFromIsoCode(baseAddress.getIsoCountryCode());
|
||||
} else {
|
||||
return (String)BaseAddressGlobalizationUtil.globalize
|
||||
("cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return sheet;
|
||||
|
||||
}
|
||||
|
||||
public static Component getEmptyBaseAddressPropertySheet(ItemSelectionModel itemModel) {
|
||||
return new Label(((String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.emptyAddress").localize()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
* HealthCareFacilityEditAddressPropertyForm.java
|
||||
*
|
||||
* Created on 8. Juli 2009, 10:27
|
||||
*
|
||||
* 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.FormData;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SaveCancelSection;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.event.PrintEvent;
|
||||
import com.arsdigita.bebop.event.PrintListener;
|
||||
import com.arsdigita.bebop.form.Submit;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.contenttypes.BaseAddress;
|
||||
import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.contenttypes.util.HealthCareFacilityGlobalizationUtil;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author quasi
|
||||
*/
|
||||
public class HealthCareFacilityAttachAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(HealthCareFacilityPropertyForm.class);
|
||||
|
||||
private HealthCareFacilityAddressPropertiesStep m_step;
|
||||
private ItemSearchWidget m_itemSearch;
|
||||
private SaveCancelSection m_saveCancelSection;
|
||||
private final String ITEM_SEARCH = "healthCareFacilityAddress";
|
||||
|
||||
/**
|
||||
* ID of the form
|
||||
*/
|
||||
public static final String ID = "HealthCareFacilityAttachAddress";
|
||||
|
||||
/**
|
||||
* Constrctor taking an ItemSelectionModel
|
||||
*
|
||||
* @param itemModel
|
||||
*/
|
||||
public HealthCareFacilityAttachAddressPropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constrctor taking an ItemSelectionModel and an instance of HealthCareFacilityPropertiesStep.
|
||||
*
|
||||
* @param itemModel
|
||||
* @param step
|
||||
*/
|
||||
public HealthCareFacilityAttachAddressPropertyForm(ItemSelectionModel itemModel, HealthCareFacilityAddressPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
addSubmissionListener(this);
|
||||
|
||||
addSaveCancelSection();
|
||||
|
||||
addInitListener(this);
|
||||
addSubmissionListener(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
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.contenttypes.BaseAddress"));
|
||||
add(this.m_itemSearch);
|
||||
}
|
||||
|
||||
public void init(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility)getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
setVisible(state, true);
|
||||
|
||||
if (healthCareFacility != null) {
|
||||
data.put(ITEM_SEARCH, healthCareFacility.getAddress());
|
||||
}
|
||||
}
|
||||
|
||||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility)getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
||||
healthCareFacility.setAddress((BaseAddress)data.get(ITEM_SEARCH));
|
||||
}
|
||||
init(fse);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates the section with the save and the cancel button.
|
||||
*/
|
||||
public void addSaveCancelSection() {
|
||||
try {
|
||||
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
||||
|
||||
public void prepare(PrintEvent e) {
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility)getItemSelectionModel().getSelectedObject(e.getPageState());
|
||||
Submit target = (Submit) e.getTarget();
|
||||
|
||||
if (healthCareFacility.getAddress() != null) {
|
||||
target.setButtonLabel((String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.change").localize());
|
||||
} else {
|
||||
target.setButtonLabel((String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.add").localize());
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
throw new UncheckedWrapperException("this cannot happen", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||
if (e.getFormData().get(ITEM_SEARCH) == null) {
|
||||
throw new FormProcessException((String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.wrong_type").localize());
|
||||
}
|
||||
}
|
||||
|
||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
||||
init(e);
|
||||
throw new FormProcessException((String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.cancelled").localize());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
* Copyright (C) 2008 Sören Bernstein All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SaveCancelSection;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.form.SingleSelect;
|
||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.BaseContact;
|
||||
import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.contenttypes.BaseContactCollection;
|
||||
import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
||||
import com.arsdigita.cms.contenttypes.util.HealthCareFacilityGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Generates a form for creating new localisations for the given category.
|
||||
*
|
||||
* This class is part of the admin GUI of CCM and extends the standard form
|
||||
* in order to present forms for managing the multi-language categories.
|
||||
*
|
||||
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
|
||||
*/
|
||||
public class HealthCareFacilityBaseContactAddForm extends BasicItemForm {
|
||||
private static final Logger s_log = Logger.getLogger(HealthCareFacilityBaseContactAddForm.class);
|
||||
|
||||
private HealthCareFacilityAddressPropertiesStep m_step;
|
||||
private ItemSearchWidget m_itemSearch;
|
||||
private SaveCancelSection m_saveCancelSection;
|
||||
private final String ITEM_SEARCH = "healthCareFacilityAddress";
|
||||
|
||||
private ItemSelectionModel m_itemModel;
|
||||
|
||||
/** Creates a new instance of CategoryLocalizationAddForm */
|
||||
public HealthCareFacilityBaseContactAddForm(ItemSelectionModel itemModel) {
|
||||
|
||||
super("BaseContactEntryAddForm",itemModel);
|
||||
m_itemModel = itemModel;
|
||||
|
||||
}
|
||||
|
||||
protected void addWidgets() {
|
||||
|
||||
// Attach a Contact object
|
||||
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.BaseContact"));
|
||||
add(this.m_itemSearch);
|
||||
|
||||
// Contact type field
|
||||
add(new Label(BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contact.type")));
|
||||
ParameterModel contactTypeParam = new StringParameter(BaseContactCollection.CONTACT_TYPE);
|
||||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||
contactType.addValidationListener(new NotNullValidationListener());
|
||||
contactType.addOption(new Option("", new Label((String)BaseContactGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||
|
||||
// Add the Options to the SingleSelect widget
|
||||
StringTokenizer keyList = HealthCareFacility.getConfig().getContactTypeKeys();
|
||||
while(keyList.hasMoreElements()) {
|
||||
String currentKey = keyList.nextToken();
|
||||
contactType.addOption(new Option(currentKey, ((String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contactType.key." + currentKey).localize())));
|
||||
}
|
||||
|
||||
add(contactType);
|
||||
}
|
||||
|
||||
public void init(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility)getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
setVisible(state, true);
|
||||
}
|
||||
|
||||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility)getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
//
|
||||
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
||||
healthCareFacility.addContact((BaseContact)data.get(ITEM_SEARCH),
|
||||
(String)data.get(BaseContactCollection.CONTACT_TYPE));
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.util.HealthCareFacilityGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
|
||||
/**
|
||||
* A UI step to manipulate <code>Phones </code> for the Contact object
|
||||
* which is retrieved from the ItemSelectionModel.
|
||||
*
|
||||
*
|
||||
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
|
||||
* @version $Id: PhoBaseContactEntriesPropertiesStepva 287 2005-02-22 00:29:02Z sskracic $
|
||||
*/
|
||||
public class HealthCareFacilityBaseContactPropertiesStep extends SimpleEditStep {
|
||||
|
||||
/** The name of the editing sheet added to this step */
|
||||
private static String ADD_CONTACT_SHEET_NAME = "addContact";
|
||||
|
||||
public HealthCareFacilityBaseContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
this(itemModel, parent, null);
|
||||
}
|
||||
|
||||
public HealthCareFacilityBaseContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm addContactSheet = new HealthCareFacilityBaseContactAddForm(itemModel);
|
||||
add(ADD_CONTACT_SHEET_NAME,
|
||||
(String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.add_contact").localize(),
|
||||
new WorkflowLockedComponentAccess(addContactSheet, itemModel),
|
||||
addContactSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
HealthCareFacilityBaseContactTable contactsTable = new HealthCareFacilityBaseContactTable(itemModel);
|
||||
setDisplayComponent(contactsTable);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,267 @@
|
|||
/*
|
||||
* Copyright (C) 2008 Sören Bernstein All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.ControlLink;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.Table;
|
||||
import com.arsdigita.bebop.event.TableActionEvent;
|
||||
import com.arsdigita.bebop.event.TableActionListener;
|
||||
import com.arsdigita.bebop.table.TableCellRenderer;
|
||||
import com.arsdigita.bebop.table.TableColumn;
|
||||
import com.arsdigita.bebop.table.TableColumnModel;
|
||||
import com.arsdigita.bebop.table.TableModel;
|
||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.SecurityManager;
|
||||
import com.arsdigita.cms.contenttypes.BaseContact;
|
||||
import com.arsdigita.cms.contenttypes.BaseContactCollection;
|
||||
import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
||||
import com.arsdigita.cms.contenttypes.util.HealthCareFacilityGlobalizationUtil;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* Lists all existing contact entries for a selected contact.
|
||||
*
|
||||
* @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de
|
||||
*/
|
||||
public class HealthCareFacilityBaseContactTable extends Table implements TableActionListener{
|
||||
|
||||
|
||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||
private final String TABLE_COL_DEL = "table_col_del";
|
||||
|
||||
private ItemSelectionModel m_itemModel;
|
||||
|
||||
/**
|
||||
* Creates a new instance of HealthCareFacilityHealthCareFacilityTable
|
||||
*/
|
||||
public HealthCareFacilityBaseContactTable(final ItemSelectionModel itemModel) {
|
||||
|
||||
super();
|
||||
this.m_itemModel = itemModel;
|
||||
|
||||
// if table is empty:
|
||||
setEmptyView(new Label(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contacts.none")));
|
||||
TableColumnModel tab_model = getColumnModel();
|
||||
|
||||
// define columns
|
||||
tab_model.add(new TableColumn(0, HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contact.order").localize(), TABLE_COL_EDIT));
|
||||
tab_model.add(new TableColumn(1, HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contact.type").localize()));
|
||||
tab_model.add(new TableColumn(2, HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contact.title").localize()));
|
||||
tab_model.add(new TableColumn(3, HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contact.action").localize(), TABLE_COL_DEL));
|
||||
|
||||
setModelBuilder(new HealthCareFacilityTableModelBuilder(itemModel));
|
||||
|
||||
tab_model.get(0).setCellRenderer(new EditCellRenderer());
|
||||
tab_model.get(3).setCellRenderer(new DeleteCellRenderer());
|
||||
|
||||
addTableActionListener(this);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* XXXX
|
||||
*
|
||||
*/
|
||||
private class HealthCareFacilityTableModelBuilder extends LockableImpl implements TableModelBuilder {
|
||||
|
||||
private ItemSelectionModel m_itemModel;
|
||||
|
||||
public HealthCareFacilityTableModelBuilder(ItemSelectionModel itemModel) {
|
||||
m_itemModel = itemModel;
|
||||
}
|
||||
|
||||
public TableModel makeModel(Table table, PageState state) {
|
||||
table.getRowSelectionModel().clearSelection(state);
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility) m_itemModel.getSelectedObject(state);
|
||||
return new HealthCareFacilityTableModel(table, state, healthCareFacility);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XXX
|
||||
*
|
||||
*/
|
||||
private class HealthCareFacilityTableModel implements TableModel {
|
||||
|
||||
final private int MAX_DESC_LENGTH = 25;
|
||||
|
||||
private Table m_table;
|
||||
private BaseContactCollection m_baseContactCollection;
|
||||
private BaseContact m_baseContact;
|
||||
|
||||
private HealthCareFacilityTableModel(Table t, PageState ps, HealthCareFacility healthCareFacility) {
|
||||
m_table = t;
|
||||
m_baseContactCollection = healthCareFacility.getContacts();
|
||||
}
|
||||
|
||||
public int getColumnCount() {
|
||||
return m_table.getColumnModel().size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check collection for the existence of another row.
|
||||
*
|
||||
* If exists, fetch the value of current HealthCareFacilityEntryCollection object
|
||||
* into m_healthCareFacilityEntry class variable.
|
||||
*/
|
||||
public boolean nextRow() {
|
||||
|
||||
if(m_baseContactCollection != null && m_baseContactCollection.next()){
|
||||
m_baseContact = m_baseContactCollection.getBaseContact();
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the
|
||||
* @see com.arsdigita.bebop.table.TableModel#getElementAt(int)
|
||||
*/
|
||||
public Object getElementAt(int columnIndex) {
|
||||
switch (columnIndex){
|
||||
case 0:
|
||||
return m_baseContactCollection.getContactOrder();
|
||||
case 1:
|
||||
return (String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contactType.key." + m_baseContactCollection.getContactType()).localize();
|
||||
case 2:
|
||||
return m_baseContact.getTitle();
|
||||
// case 2:
|
||||
// return (m_healthCareFacilityEntry.getDescription() != null && m_healthCareFacilityEntry.getDescription().length() > MAX_DESC_LENGTH)
|
||||
// ? m_healthCareFacilityEntry.getDescription().substring(0, MAX_DESC_LENGTH)
|
||||
// : m_healthCareFacilityEntry.getDescription();
|
||||
case 3:
|
||||
return GlobalizationUtil.globalize("cms.ui.delete").localize();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see com.arsdigita.bebop.table.TableModel#getKeyAt(int)
|
||||
*/
|
||||
public Object getKeyAt(int columnIndex) {
|
||||
return m_baseContact.getID();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for the permissions to edit item and put either a Label or
|
||||
* a ControlLink accordingly.
|
||||
*/
|
||||
private class EditCellRenderer extends LockableImpl implements TableCellRenderer {
|
||||
|
||||
public Component getComponent(Table table, PageState state, Object value,
|
||||
boolean isSelected, Object key,
|
||||
int row, int column) {
|
||||
|
||||
SecurityManager sm = Utilities.getSecurityManager(state);
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility) m_itemModel.getSelectedObject(state);
|
||||
|
||||
boolean canEdit = sm.canAccess(state.getRequest(),
|
||||
SecurityManager.EDIT_ITEM,
|
||||
healthCareFacility);
|
||||
if(canEdit) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
return link;
|
||||
} else {
|
||||
return new Label(value.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for the permissions to delete item and put either a Label or
|
||||
* a ControlLink accordingly.
|
||||
*/
|
||||
private class DeleteCellRenderer extends LockableImpl implements TableCellRenderer {
|
||||
|
||||
public Component getComponent(Table table, PageState state, Object value,
|
||||
boolean isSelected, Object key,
|
||||
int row, int column) {
|
||||
|
||||
SecurityManager sm = Utilities.getSecurityManager(state);
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility) m_itemModel.getSelectedObject(state);
|
||||
|
||||
boolean canDelete = sm.canAccess(state.getRequest(),
|
||||
SecurityManager.DELETE_ITEM,
|
||||
healthCareFacility);
|
||||
if(canDelete) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
link.setConfirmation((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.confirm_delete").localize());
|
||||
return link;
|
||||
} else {
|
||||
return new Label(value.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide implementation to TableActionListener method.
|
||||
* Code that comes into picture when a link on the table is clicked.
|
||||
* Handles edit and delete event.
|
||||
*/
|
||||
public void cellSelected(TableActionEvent evt) {
|
||||
|
||||
PageState state = evt.getPageState();
|
||||
|
||||
// Get selected BaseContact
|
||||
BaseContact baseContact =
|
||||
new BaseContact(new BigDecimal(evt.getRowKey().toString()));
|
||||
|
||||
// Get HealthCareFacility
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility) m_itemModel.getSelectedObject(state);
|
||||
|
||||
// Get selected column
|
||||
TableColumn col = getColumnModel().get(evt.getColumn().intValue());
|
||||
|
||||
// Edit
|
||||
if(col.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
|
||||
|
||||
}
|
||||
|
||||
// Delete
|
||||
if(col.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
|
||||
healthCareFacility.removeContactEntry(baseContact);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* provide Implementation to TableActionListener method.
|
||||
* Does nothing in our case.
|
||||
*/
|
||||
public void headSelected(TableActionEvent e) {
|
||||
throw new UnsupportedOperationException("Not Implemented");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
* HealthCareFacilityDeleteAddressForm.java
|
||||
*
|
||||
* Created on 17. Juli 2009, 10:10
|
||||
*
|
||||
* 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.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.PrintEvent;
|
||||
import com.arsdigita.bebop.event.PrintListener;
|
||||
import com.arsdigita.bebop.form.Submit;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
||||
import com.arsdigita.cms.contenttypes.util.HealthCareFacilityGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author quasi
|
||||
*/
|
||||
public class HealthCareFacilityDeleteAddressForm extends BasicPageForm implements FormProcessListener {
|
||||
|
||||
/**
|
||||
* ID of the form
|
||||
*/
|
||||
public static final String ID = "HealthCareFacilityDeleteAddress";
|
||||
|
||||
HealthCareFacilityDeleteAddressForm(ItemSelectionModel itemModel, HealthCareFacilityAddressPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
addSaveCancelSection();
|
||||
}
|
||||
|
||||
public void init(FormSectionEvent fse) {
|
||||
|
||||
}
|
||||
|
||||
public void addWidgets() {
|
||||
add(new Label((String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.delete_address.label").localize()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the section with the save and the cancel button.
|
||||
*/
|
||||
public void addSaveCancelSection() {
|
||||
try {
|
||||
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
||||
|
||||
public void prepare(PrintEvent e) {
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility)getItemSelectionModel().getSelectedObject(e.getPageState());
|
||||
Submit target = (Submit) e.getTarget();
|
||||
target.setButtonLabel((String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.delete_address.button_label").localize());
|
||||
}
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
throw new UncheckedWrapperException("this cannot happen", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public final void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
|
||||
final PageState state = fse.getPageState();
|
||||
final HealthCareFacility healthCareFacility = (HealthCareFacility)getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
if (healthCareFacility != null && healthCareFacility.getAddress() != null) {
|
||||
healthCareFacility.unsetAddress();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
/*
|
||||
* HealthCareFacilityEditAddressPropertyForm.java
|
||||
*
|
||||
* Created on 8. Juli 2009, 10:27
|
||||
*
|
||||
* 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.FormData;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.event.ParameterEvent;
|
||||
import com.arsdigita.bebop.event.ParameterListener;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.form.SingleSelect;
|
||||
import com.arsdigita.bebop.form.TextArea;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||
import com.arsdigita.bebop.parameters.StringInRangeValidationListener;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.bebop.parameters.ParameterData;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import com.arsdigita.cms.contenttypes.BaseAddress;
|
||||
import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
||||
import com.arsdigita.cms.contenttypes.util.BaseAddressGlobalizationUtil;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author quasi
|
||||
*/
|
||||
public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(HealthCareFacilityPropertyForm.class);
|
||||
|
||||
private HealthCareFacilityAddressPropertiesStep m_step;
|
||||
|
||||
public static final String ADDRESS = BaseAddress.ADDRESS;
|
||||
public static final String POSTAL_CODE = BaseAddress.POSTAL_CODE;
|
||||
public static final String CITY = BaseAddress.CITY;
|
||||
public static final String STATE = BaseAddress.STATE;
|
||||
public static final String ISO_COUNTRY_CODE = BaseAddress.ISO_COUNTRY_CODE;
|
||||
|
||||
/**
|
||||
* ID of the form
|
||||
*/
|
||||
public static final String ID = "HealthCareFacilityEditAddress";
|
||||
|
||||
/**
|
||||
* Constrctor taking an ItemSelectionModel
|
||||
*
|
||||
* @param itemModel
|
||||
*/
|
||||
public HealthCareFacilityEditAddressPropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constrctor taking an ItemSelectionModel and an instance of HealthCareFacilityPropertiesStep.
|
||||
*
|
||||
* @param itemModel
|
||||
* @param step
|
||||
*/
|
||||
public HealthCareFacilityEditAddressPropertyForm(ItemSelectionModel itemModel, HealthCareFacilityAddressPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.address").localize()));
|
||||
ParameterModel addressParam = new StringParameter(ADDRESS);
|
||||
addressParam.addParameterListener( new NotNullValidationListener( ) );
|
||||
addressParam.addParameterListener( new StringInRangeValidationListener(0, 1000) );
|
||||
TextArea address = new TextArea(addressParam);
|
||||
address.setRows(5);
|
||||
address.setCols(30);
|
||||
add(address);
|
||||
|
||||
if(!HealthCareFacility.getConfig().getHideAddressPostalCode()) {
|
||||
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.postal_code").localize()));
|
||||
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
||||
TextField postalCode = new TextField(postalCodeParam);
|
||||
/* XXX NumberListener ?*/
|
||||
add(postalCode);
|
||||
}
|
||||
|
||||
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.city").localize()));
|
||||
ParameterModel cityParam = new StringParameter(CITY);
|
||||
TextField city = new TextField(cityParam);
|
||||
add(city);
|
||||
|
||||
if(!HealthCareFacility.getConfig().getHideAddressState()) {
|
||||
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.state").localize()));
|
||||
ParameterModel stateParam = new StringParameter(STATE);
|
||||
TextField state = new TextField(stateParam);
|
||||
add(state);
|
||||
}
|
||||
|
||||
if (!HealthCareFacility.getConfig().getHideAddressCountry()) {
|
||||
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.iso_country_code").localize()));
|
||||
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
||||
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
||||
|
||||
SingleSelect country = new SingleSelect(countryParam);
|
||||
|
||||
country.addOption(new Option("", new Label((String)BaseAddressGlobalizationUtil.globalize("cms.ui.select_one" ).localize())));
|
||||
|
||||
Iterator countries = BaseAddress.getSortedListOfCountries(null).entrySet().iterator();
|
||||
while(countries.hasNext()) {
|
||||
Map.Entry<String,String> elem = (Map.Entry<String,String>)countries.next();
|
||||
country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString()));
|
||||
}
|
||||
|
||||
country.addValidationListener(
|
||||
new ParameterListener() {
|
||||
public void validate(ParameterEvent e) throws FormProcessException {
|
||||
ParameterData data = e.getParameterData();
|
||||
String isoCode = (String) data.getValue() ;
|
||||
if (isoCode == null || isoCode.length() == 0) {
|
||||
data.addError((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.error_iso_country").localize());
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
add(country);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void init(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility)getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
if(healthCareFacility.getAddress() != null) {
|
||||
data.put(ADDRESS, healthCareFacility.getAddress().getAddress());
|
||||
data.put(POSTAL_CODE, healthCareFacility.getAddress().getPostalCode());
|
||||
data.put(CITY, healthCareFacility.getAddress().getCity());
|
||||
data.put(STATE, healthCareFacility.getAddress().getState());
|
||||
if(!BaseAddress.getConfig().getHideCountryCodeSelection()) {
|
||||
data.put(ISO_COUNTRY_CODE, healthCareFacility.getAddress().getIsoCountryCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void submitted(FormSectionEvent fse) {
|
||||
if (m_step != null &&
|
||||
getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) {
|
||||
m_step.cancelStreamlinedCreation(fse.getPageState());
|
||||
}
|
||||
}
|
||||
|
||||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility)getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
if (healthCareFacility.getAddress() != null &&
|
||||
getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||
healthCareFacility.getAddress().setAddress((String)data.get(ADDRESS));
|
||||
healthCareFacility.getAddress().setPostalCode((String)data.get(POSTAL_CODE));
|
||||
healthCareFacility.getAddress().setCity((String)data.get(CITY));
|
||||
healthCareFacility.getAddress().setState((String)data.get(STATE));
|
||||
healthCareFacility.getAddress().setIsoCountryCode((String)data.get(ISO_COUNTRY_CODE));
|
||||
|
||||
healthCareFacility.getAddress().save();
|
||||
}
|
||||
|
||||
if (m_step != null) {
|
||||
m_step.maybeForwardToNextStep(fse.getPageState());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.ContentSection;
|
||||
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.domain.DomainObject;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.SegmentedPanel;
|
||||
import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
||||
import com.arsdigita.cms.contenttypes.util.HealthCareFacilityGlobalizationUtil;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* AuthoringStep for the basic properties of a basic contact
|
||||
*/
|
||||
public class HealthCareFacilityPropertiesStep extends SimpleEditStep {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(HealthCareFacilityPropertiesStep.class);
|
||||
|
||||
/**
|
||||
* Name of the this edit sheet (Don't know if this this really needed.
|
||||
* It has the same value in almost all PropertiesStep classes)
|
||||
*/
|
||||
public static final String EDIT_BASIC_SHEET_NAME = "editBasic";
|
||||
|
||||
/**
|
||||
* Constructor for the PropertiesStep.
|
||||
*
|
||||
* @param itemModel
|
||||
* @param parent
|
||||
*/
|
||||
public HealthCareFacilityPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
super(itemModel, parent);
|
||||
|
||||
/* Use a Segmented Panel for the multiple parts of data */
|
||||
SegmentedPanel segmentedPanel = new SegmentedPanel();
|
||||
|
||||
setDefaultEditKey(EDIT_BASIC_SHEET_NAME);
|
||||
|
||||
/* The different parts of information are displayed in seperated segments each containing a SimpleEditStep */
|
||||
/* Well, not so simple anymore... */
|
||||
|
||||
/* A new SimpleEditStep */
|
||||
SimpleEditStep basicProperties = new SimpleEditStep(itemModel, parent, EDIT_BASIC_SHEET_NAME);
|
||||
|
||||
/* Create the edit component for this SimpleEditStep and the corresponding link */
|
||||
BasicPageForm editBasicSheet = new HealthCareFacilityPropertyForm(itemModel, this);
|
||||
basicProperties.add(EDIT_BASIC_SHEET_NAME, (String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.edit_basic_properties").localize(), new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
/* Set the displayComponent for this step */
|
||||
basicProperties.setDisplayComponent(getHealthCareFacilityPropertySheet(itemModel));
|
||||
|
||||
/* Add the SimpleEditStep to the segmented panel */
|
||||
segmentedPanel.addSegment(new Label((String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.basic_properties").localize()), basicProperties);
|
||||
|
||||
// If not disabled via registry, add the ui for attaching a baseAddress
|
||||
if(!HealthCareFacility.getConfig().getHideAddress()) {
|
||||
HealthCareFacilityAddressPropertiesStep addressProperties = new HealthCareFacilityAddressPropertiesStep(itemModel, parent);
|
||||
segmentedPanel.addSegment(new Label((String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.address").localize()), addressProperties);
|
||||
}
|
||||
|
||||
HealthCareFacilityBaseContactPropertiesStep baseContacts = new HealthCareFacilityBaseContactPropertiesStep(itemModel, parent);
|
||||
segmentedPanel.addSegment(new Label((String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contact").localize()), baseContacts);
|
||||
|
||||
/* Sets the composed segmentedPanel as display component */
|
||||
setDisplayComponent(segmentedPanel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns the sheet for editing the basic properties
|
||||
* of an organization. (@see HealthCareFacilityPropertyForm).
|
||||
*
|
||||
*
|
||||
* @param itemModel
|
||||
* @return The sheet for editing the properties of the organization.
|
||||
*/
|
||||
public static Component getHealthCareFacilityPropertySheet(ItemSelectionModel itemModel) {
|
||||
|
||||
|
||||
/* The DisplayComponent for the Basic Properties */
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"),"name");
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"),"title");
|
||||
|
||||
if(!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date"), ContentPage.LAUNCH_DATE, new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject obj, String attribute, PageState state) {
|
||||
ContentPage page = (ContentPage)obj;
|
||||
if(page.getLaunchDate() != null) {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
|
||||
}
|
||||
else {
|
||||
return (String)GlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.cms.contenttypes.HealthCareFacility;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Form for editing the basic properties of a basic contact.
|
||||
*/
|
||||
public class HealthCareFacilityPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(HealthCareFacilityPropertyForm.class);
|
||||
|
||||
private HealthCareFacilityPropertiesStep m_step;
|
||||
|
||||
public static final String ADRESS = HealthCareFacility.ADDRESS;
|
||||
public static final String CONTACTS= HealthCareFacility.CONTACTS;
|
||||
|
||||
/**
|
||||
* ID of the form
|
||||
*/
|
||||
public static final String ID = "HealthCareFacility_edit";
|
||||
|
||||
/**
|
||||
* Constrctor taking an ItemSelectionModel
|
||||
*
|
||||
* @param itemModel
|
||||
*/
|
||||
public HealthCareFacilityPropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constrctor taking an ItemSelectionModel and an instance of HealthCareFacilityPropertiesStep.
|
||||
*
|
||||
*
|
||||
* @param itemModel
|
||||
* @param step
|
||||
*/
|
||||
public HealthCareFacilityPropertyForm(ItemSelectionModel itemModel, HealthCareFacilityPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
/*
|
||||
add(new Label((String)HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.basic_properties.description").localize())));
|
||||
TextArea description = new TextArea(DESCRIPTION);
|
||||
description.setRows(5);
|
||||
description.setCols(30);
|
||||
add(description);
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FormSectionEvent e) throws FormProcessException {
|
||||
FormData data = e.getFormData();
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility)super.initBasicWidgets(e);
|
||||
|
||||
// data.put(DESCRIPTION, healthCareFacility.getDescription());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(FormSectionEvent e) throws FormProcessException {
|
||||
FormData data = e.getFormData();
|
||||
|
||||
HealthCareFacility healthCareFacility = (HealthCareFacility)super.processBasicWidgets(e);
|
||||
|
||||
if((healthCareFacility != null) && (getSaveCancelSection().getSaveButton().isSelected(e.getPageState()))) {
|
||||
// healthCareFacility.setDescription((String)data.get(DESCRIPTION));
|
||||
|
||||
healthCareFacility.save();
|
||||
}
|
||||
|
||||
if(m_step != null) {
|
||||
m_step.maybeForwardToNextStep(e.getPageState());
|
||||
}
|
||||
}
|
||||
|
||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||
if((m_step != null) && (getSaveCancelSection().getCancelButton().isSelected(e.getPageState()))) {
|
||||
m_step.cancelStreamlinedCreation(e.getPageState());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.util;
|
||||
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* .
|
||||
* Contains methods to simplify globalizing keys
|
||||
* </p>
|
||||
*
|
||||
* @author <a href="mailto:randyg@arsdigita.com">randyg@arsdigita.com</a>
|
||||
* @version $Revision: #4 $ $Date: 2004/08/17 $
|
||||
*/
|
||||
|
||||
public class HealthCareFacilityGlobalizationUtil {
|
||||
|
||||
final public static String BUNDLE_NAME =
|
||||
"com.arsdigita.cms.contenttypes.util.HealthCareFacilityResourceBundle";
|
||||
|
||||
/**
|
||||
* This returns a globalized message using the type specific bundle,
|
||||
* BUNDLE_NAME
|
||||
*/
|
||||
public static GlobalizedMessage globalize(String key) {
|
||||
return new GlobalizedMessage(key, BUNDLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns a globalized message using the type specific bundle,
|
||||
* BUNDLE_NAME
|
||||
*/
|
||||
public static GlobalizedMessage globalize(String key, Object[] args) {
|
||||
return new GlobalizedMessage(key, BUNDLE_NAME, args);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.util;
|
||||
|
||||
import java.util.PropertyResourceBundle;
|
||||
import com.arsdigita.globalization.ChainedResourceBundle;
|
||||
import com.arsdigita.cms.CMSGlobalized;
|
||||
|
||||
/**
|
||||
* Form to edit the basic properties of an event. This form can be extended to
|
||||
* create forms for Event subclasses.
|
||||
**/
|
||||
public class HealthCareFacilityResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
|
||||
|
||||
public final static String HEALTH_CARE_FACILITY_BUNDLE_NAME =
|
||||
"com.arsdigita.cms.contenttypes.HealthCareFacilityResources";
|
||||
|
||||
public HealthCareFacilityResourceBundle() {
|
||||
super();
|
||||
addBundle((PropertyResourceBundle)getBundle(HEALTH_CARE_FACILITY_BUNDLE_NAME));
|
||||
addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE stylesheet [
|
||||
<!ENTITY nbsp " " ><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
|
||||
]>
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||
version="1.0">
|
||||
|
||||
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.HealthCareOrganization']" mode="cms:CT_graphics"
|
||||
name="cms:CT_graphics_com_arsdigita_cms_contenttypes_BaseContact">
|
||||
<table width="435" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="contentTitle" align="left" valign="top">
|
||||
<xsl:value-of select="./title"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<xsl:if test="./address">
|
||||
<tr>
|
||||
<th>Address:</th>
|
||||
<td class="contentText" valign="top" align="left"><xsl:value-of select="./address"/></td>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.HealthCareOrganization']" mode="cms:CT_text"
|
||||
name="cms:CT_text_com_arsdigita_cms_contenttypes_BaseContact">
|
||||
<h1 class="title"><xsl:value-of select="./title"/></h1>
|
||||
<xsl:if test="./address">
|
||||
<span class="subtitle">Address</span>
|
||||
<span class="text"><xsl:value-of select="./address"/></span><br/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
Loading…
Reference in New Issue