You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(48) |
Dec
(31) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(22) |
Feb
(68) |
Mar
(185) |
Apr
(11) |
May
(21) |
Jun
(23) |
Jul
(46) |
Aug
(69) |
Sep
(211) |
Oct
(26) |
Nov
(51) |
Dec
(52) |
2006 |
Jan
(13) |
Feb
(13) |
Mar
(8) |
Apr
(21) |
May
(17) |
Jun
(100) |
Jul
(34) |
Aug
(23) |
Sep
(26) |
Oct
(16) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(66) |
Oct
(10) |
Nov
(1) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(3) |
May
(8) |
Jun
(5) |
Jul
(31) |
Aug
(8) |
Sep
(11) |
Oct
(6) |
Nov
|
Dec
|
2012 |
Jan
(13) |
Feb
(2) |
Mar
(9) |
Apr
(6) |
May
(24) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(120) |
2013 |
Jan
(6) |
Feb
(35) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <chr...@fe...> - 2007-10-26 10:00:14
|
Author: chrisg23 Date: 2007-10-26 12:00:07 +0200 (Fri, 26 Oct 2007) New Revision: 1688 Modified: aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/Loader.java Log: Bugfix - need to set the application type's group during load Modified: aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/Loader.java =================================================================== --- aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/Loader.java 2007-10-23 14:16:50 UTC (rev 1687) +++ aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/Loader.java 2007-10-26 10:00:07 UTC (rev 1688) @@ -116,6 +116,7 @@ // set up the portal node Workspace workspace = Workspace.createWorkspace(name, title, parent, Boolean.TRUE.equals(isPublic)); + } } @@ -124,6 +125,7 @@ "workspace", "Portal Workspace", Workspace.BASE_DATA_OBJECT_TYPE); type.setDescription("Portal based collaborative workspaces"); + type.createGroup(); return type; } |
From: <chr...@fe...> - 2007-10-23 15:00:15
|
Author: chrisg23 Date: 2007-10-23 17:00:06 +0200 (Tue, 23 Oct 2007) New Revision: 1686 Modified: aplaws/trunk/ccm-core/sql/ccm-core/default/upgrade/6.5.3-6.5.4/insert-application-container-group-columns.sql Log: Change sql to a version that both Oracle and Postgres understand Modified: aplaws/trunk/ccm-core/sql/ccm-core/default/upgrade/6.5.3-6.5.4/insert-application-container-group-columns.sql =================================================================== --- aplaws/trunk/ccm-core/sql/ccm-core/default/upgrade/6.5.3-6.5.4/insert-application-container-group-columns.sql 2007-10-15 07:57:47 UTC (rev 1685) +++ aplaws/trunk/ccm-core/sql/ccm-core/default/upgrade/6.5.3-6.5.4/insert-application-container-group-columns.sql 2007-10-23 15:00:06 UTC (rev 1686) @@ -14,10 +14,10 @@ -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- alter table application_types -add (container_group_id NUMBER); +add container_group_id integer; alter table applications -add (container_group_id NUMBER); +add container_group_id integer; alter table application_types add constraint applic_typ_cont_gro_id_f_lszuh foreign key (container_group_id) |
From: <chr...@fe...> - 2007-10-23 15:00:12
|
Author: chrisg23 Date: 2007-10-23 17:00:08 +0200 (Tue, 23 Oct 2007) New Revision: 1687 Added: aplaws/trunk/ccm-core/src/com/arsdigita/domain/Domain.java aplaws/trunk/ccm-core/src/com/arsdigita/domain/DomainConfig.java aplaws/trunk/ccm-core/src/com/arsdigita/domain/DomainConfig_parameter.properties Modified: aplaws/trunk/ccm-core/src/ccm-core.config aplaws/trunk/ccm-core/src/com/arsdigita/domain/DomainObjectTraversal.java Log: sourceforge patch [1803373] - don't stream out blob data until it's actually needed. Note this is configurable so that by default there is no behaviour change, but really it would be unusual to actively want the overhead of the additional streamout. Credit to matt at magpie for this one Modified: aplaws/trunk/ccm-core/src/ccm-core.config =================================================================== --- aplaws/trunk/ccm-core/src/ccm-core.config 2007-10-23 14:11:16 UTC (rev 1686) +++ aplaws/trunk/ccm-core/src/ccm-core.config 2007-10-23 15:00:08 UTC (rev 1687) @@ -34,4 +34,6 @@ storage="ccm-core/core-xml.properties"/> <config class="com.arsdigita.xml.formatters.DateFormatterConfig" storage="ccm-core/date-formatter.properties"/> + <config class="com.arsdigita.domain.DomainConfig" + storage="ccm-core/domain.properties"/> </registry> Added: aplaws/trunk/ccm-core/src/com/arsdigita/domain/Domain.java =================================================================== --- aplaws/trunk/ccm-core/src/com/arsdigita/domain/Domain.java (rev 0) +++ aplaws/trunk/ccm-core/src/com/arsdigita/domain/Domain.java 2007-10-23 15:00:08 UTC (rev 1687) @@ -0,0 +1,21 @@ +package com.arsdigita.domain; + + +public class Domain { + + + private static DomainConfig s_config; + + /** + * Gets the <code>DomainConfig</code> object. + */ + public static final DomainConfig getConfig() { + if (s_config == null) { + s_config = new DomainConfig(); + s_config.load("ccm-core/domain.properties"); + } + return s_config; + + } + +} Added: aplaws/trunk/ccm-core/src/com/arsdigita/domain/DomainConfig.java =================================================================== --- aplaws/trunk/ccm-core/src/com/arsdigita/domain/DomainConfig.java (rev 0) +++ aplaws/trunk/ccm-core/src/com/arsdigita/domain/DomainConfig.java 2007-10-23 15:00:08 UTC (rev 1687) @@ -0,0 +1,25 @@ +package com.arsdigita.domain; + +import com.arsdigita.runtime.AbstractConfig; +import com.arsdigita.util.parameter.BooleanParameter; +import com.arsdigita.util.parameter.Parameter; + +public final class DomainConfig extends AbstractConfig { + + private final BooleanParameter m_queryBlobContent; + + public DomainConfig() { + + m_queryBlobContent = new BooleanParameter( + "waf.domain.query_file_attachment_blob", Parameter.OPTIONAL, + Boolean.TRUE); + + register(m_queryBlobContent); + loadInfo(); + } + + public boolean queryBlobContentForFileAttachments() { + return ((Boolean) get(m_queryBlobContent)).booleanValue(); + } + +} Added: aplaws/trunk/ccm-core/src/com/arsdigita/domain/DomainConfig_parameter.properties =================================================================== --- aplaws/trunk/ccm-core/src/com/arsdigita/domain/DomainConfig_parameter.properties (rev 0) +++ aplaws/trunk/ccm-core/src/com/arsdigita/domain/DomainConfig_parameter.properties 2007-10-23 15:00:08 UTC (rev 1687) @@ -0,0 +1,4 @@ +waf.domain.query_file_attachment_blob.title=Unnecessarily Query Blobs? +waf.domain.query_file_attachment_blob.purpose=Allows you to prevent an unnecessary and expensive query on cms_files.content. For legacy reasons the defualt is true - go on set it to false.. (assuming that you have ccm-cms-assets-fileattachment loaded) +waf.domain.query_file_attachment_blob.example=true|false +waf.domain.query_file_attachment_blob.format=[boolean] \ No newline at end of file Modified: aplaws/trunk/ccm-core/src/com/arsdigita/domain/DomainObjectTraversal.java =================================================================== --- aplaws/trunk/ccm-core/src/com/arsdigita/domain/DomainObjectTraversal.java 2007-10-23 14:11:16 UTC (rev 1686) +++ aplaws/trunk/ccm-core/src/com/arsdigita/domain/DomainObjectTraversal.java 2007-10-23 15:00:08 UTC (rev 1687) @@ -22,9 +22,12 @@ import com.arsdigita.persistence.metadata.ObjectType; import com.arsdigita.persistence.metadata.Property; +import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.DataAssociation; import com.arsdigita.persistence.DataAssociationCursor; +import com.arsdigita.persistence.DataQuery; +import com.arsdigita.persistence.DataQueryDataCollectionAdapter; import com.arsdigita.persistence.OID; import com.arsdigita.persistence.SessionManager; @@ -323,15 +326,38 @@ endRole(obj, path, prop); } else if (propValue instanceof DataAssociation) { + + + // see #25808 - this hack prevents the content field of cms_files + // (which is a blob) from being queried when all we need is a list + // of the files on an item.. + if (prop.getName().equals("fileAttachments") && !Domain.getConfig().queryBlobContentForFileAttachments()) { // make true a config + DataQuery fileAttachmentsQuery = SessionManager.getSession().retrieveQuery("com.arsdigita.cms.contentassets.fileAttachmentsQuery"); + + fileAttachmentsQuery.setParameter("item_id", obj.getOID().get("id")); + + DataCollection files = new DataQueryDataCollectionAdapter(fileAttachmentsQuery, "file"); + + while(files.next()) { + DataObject file = files.getDataObject(); + walk(adapter, + DomainObjectFactory.newInstance + (file), + appendToPath(path, propName), + context, + null); + } + + } else { + if( s_log.isDebugEnabled() ) { s_log.debug( prop.getName() + " is a DataAssociation" ); } - beginAssociation(obj, path, prop); - + DataAssociationCursor daCursor = ((DataAssociation)propValue).getDataAssociationCursor(); - + while (daCursor.next()) { DataObject link = daCursor.getLink(); DomainObject linkObj = null; @@ -345,8 +371,8 @@ context, linkObj); } - endAssociation(obj, path, prop); + } } else { // Unknown property value type - do nothing } |
From: <fra...@fe...> - 2007-10-15 08:00:58
|
Author: francois Date: 2007-10-15 10:00:11 +0200 (Mon, 15 Oct 2007) New Revision: 1685 Modified: aplaws/trunk/ccm-ldn-atoz/.classpath aplaws/trunk/ccm-ldn-atoz/application.xml aplaws/trunk/ccm-ldn-atoz/pdl/com/arsdigita/london/atoz/AtoZCategoryProvider.pdl aplaws/trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZCategoryProvider.java aplaws/trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig.java aplaws/trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig_parameter.properties Log: Add pdl quieries to return a category list containing only category with published content. Preserve default behaviour of a list containing all categories with an optional boolean ccm configuration parameter "com.arsdigita.london.atoz.filterCategoryProviders". Set to TRUE will return the filtered list. Modified: aplaws/trunk/ccm-ldn-atoz/.classpath =================================================================== --- aplaws/trunk/ccm-ldn-atoz/.classpath 2007-10-12 10:49:41 UTC (rev 1684) +++ aplaws/trunk/ccm-ldn-atoz/.classpath 2007-10-15 08:00:11 UTC (rev 1685) @@ -2,8 +2,8 @@ <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry combineaccessrules="false" kind="src" path="/ccm-cms"/> - <classpathentry combineaccessrules="false" kind="src" path="/ccm-core"/> + <classpathentry combineaccessrules="false" exported="true" kind="src" path="/ccm-cms"/> + <classpathentry combineaccessrules="false" exported="true" kind="src" path="/ccm-core"/> <classpathentry combineaccessrules="false" kind="src" path="/ccm-ldn-navigation"/> <classpathentry combineaccessrules="false" kind="src" path="/ccm-ldn-subsite"/> <classpathentry combineaccessrules="false" kind="src" path="/ccm-ldn-terms"/> Modified: aplaws/trunk/ccm-ldn-atoz/application.xml =================================================================== --- aplaws/trunk/ccm-ldn-atoz/application.xml 2007-10-12 10:49:41 UTC (rev 1684) +++ aplaws/trunk/ccm-ldn-atoz/application.xml 2007-10-15 08:00:11 UTC (rev 1685) @@ -3,7 +3,7 @@ name="ccm-ldn-atoz" prettyName="A-Z" version="6.5.0" - release="1"> + release="2"> <ccm:dependencies> <ccm:requires name="ccm-core" version="6.2.0" relation="ge"/> <ccm:requires name="ccm-cms" version="6.2.0" relation="ge"/> Modified: aplaws/trunk/ccm-ldn-atoz/pdl/com/arsdigita/london/atoz/AtoZCategoryProvider.pdl =================================================================== --- aplaws/trunk/ccm-ldn-atoz/pdl/com/arsdigita/london/atoz/AtoZCategoryProvider.pdl 2007-10-12 10:49:41 UTC (rev 1684) +++ aplaws/trunk/ccm-ldn-atoz/pdl/com/arsdigita/london/atoz/AtoZCategoryProvider.pdl 2007-10-15 08:00:11 UTC (rev 1685) @@ -217,3 +217,168 @@ sortKey = sort_key; } } + + +query getAtomicFilteredCategoryEntries { + BigDecimal[1..1] id; + String[1..1] objectType; + String[1..1] title; + String[1..1] description; + String[1..1] sortKey; + + do { + select c.category_id as id, + a.object_type as object_type, + c.name as title, + c.description as description, + lower(c.name) as sort_key + from cat_categories c, + acs_objects a, + cat_cat_subcat_trans_index i, + cat_root_cat_object_map m + where c.category_id = a.object_id + and c.enabled_p = '1' + and c.category_id = i.subcategory_id + and i.category_id = m.category_id + and m.object_id = :providerID + and not exists ( + select 1 + from cat_cat_subcat_trans_index i2 + where i2.category_id in ( + select c2.category_id + from cat_categories c2 + where c2.enabled_p = '0' + ) + and i2.subcategory_id = c.category_id + ) + and not exists ( + select 1 + from atoz_cat_blacklist_map b + where b.category_id = c.category_id + and b.provider_id = :providerID + ) + and not exists ( + select 1 + from atoz_cat_alias_map b + where b.category_id = c.category_id + and b.provider_id = :providerID + ) + and not exists ( + select 1 + from atoz_cat_ct_blacklist_map b, cat_object_category_map m, + cms_bundles cb, cms_items ci + where b.type_id = ci.type_id + and ci.parent_id = cb.bundle_id + and ci.language = cb.default_language + and cb.bundle_id = m.object_id + and m.category_id = c.category_id + and m.index_p = '1' + and b.provider_id = :providerID + ) + AND EXISTS ( + select 1 + from cat_object_category_map cocm + where cocm.category_id = c.category_id + ) + union + select c.category_id as id, + a.object_type as object_type, + m.title as title, + c.description as description, + lower(m.letter) as sort_key + from cat_categories c, + acs_objects a, + atoz_cat_alias_map m + where c.category_id = m.category_id + and c.category_id = a.object_id + and c.enabled_p = '1' + and m.provider_id = :providerID + } map { + id = id; + objectType = object_type; + title = title; + description = description; + sortKey = sort_key; + } +} + +query getAtomicFilteredCategoryEntriesForRootCategory { + BigDecimal[1..1] id; + String[1..1] objectType; + String[1..1] title; + String[1..1] description; + String[1..1] sortKey; + + do { + select c.category_id as id, + a.object_type as object_type, + c.name as title, + c.description as description, + lower(c.name) as sort_key + from cat_categories c, + acs_objects a, + cat_cat_subcat_trans_index i + where c.category_id = a.object_id + and c.category_id = i.subcategory_id + and c.enabled_p = '1' + and i.category_id = :rootCategoryID + and not exists ( + select 1 + from atoz_cat_blacklist_map b + where b.category_id = c.category_id + and b.provider_id = :providerID + ) + and not exists ( + select 1 + from cat_cat_subcat_trans_index i2 + where i2.category_id in ( + select c2.category_id + from cat_categories c2 + where c2.enabled_p = '0' + ) + and i2.subcategory_id = c.category_id + ) + and not exists ( + select 1 + from atoz_cat_alias_map b + where b.category_id = c.category_id + and b.provider_id = :providerID + ) + and not exists ( + select 1 + from atoz_cat_ct_blacklist_map b, cat_object_category_map m, + cms_bundles cb, cms_items ci + where b.type_id = ci.type_id + and ci.parent_id = cb.bundle_id + and ci.language = cb.default_language + and cb.bundle_id = m.object_id + and m.category_id = c.category_id + and m.index_p = '1' + and b.provider_id = :providerID + ) + AND EXISTS ( + select 1 + from cat_object_category_map cocm + where cocm.category_id = c.category_id + ) + union + select c.category_id as id, + a.object_type as object_type, + m.title as title, + c.description as description, + lower(m.letter) as sort_key + from cat_categories c, + acs_objects a, + atoz_cat_alias_map m + where c.category_id = m.category_id + and c.category_id = a.object_id + and c.enabled_p = '1' + and m.provider_id = :providerID + } map { + id = id; + objectType = object_type; + title = title; + description = description; + sortKey = sort_key; + } +} Modified: aplaws/trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZCategoryProvider.java =================================================================== --- aplaws/trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZCategoryProvider.java 2007-10-12 10:49:41 UTC (rev 1684) +++ aplaws/trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZCategoryProvider.java 2007-10-15 08:00:11 UTC (rev 1685) @@ -56,6 +56,10 @@ public static final String COMPOUND_ENTRIES = "com.arsdigita.london.atoz.getCompoundCategoryEntries"; + public static final String FILTERED_ATOMIC_ENTRIES = "com.arsdigita.london.atoz.getAtomicFilteredCategoryEntries"; + + public static final String FILTERED_ATOMIC_ENTRIES_FOR_ROOT_CATEGORY = "com.arsdigita.london.atoz.getAtomicFilteredCategoryEntriesForRootCategory"; + public AtoZCategoryProvider() { this(BASE_DATA_OBJECT_TYPE); } @@ -138,15 +142,26 @@ .useSubsiteSpecificNavigationCategory(); // configured using // ccm set boolean hasSite = subsiteContext.hasSite(); + boolean filterCats = AtoZ.getConfig().filterCategoryProviders(); + if (hasSite && useSubsiteSpecificNavigationCategory) { Site site = subsiteContext.getSite(); Category root = site.getRootCategory(); + if(filterCats){ cats = SessionManager.getSession().retrieveQuery( - ATOMIC_ENTRIES_FOR_ROOT_CATEGORY); + FILTERED_ATOMIC_ENTRIES_FOR_ROOT_CATEGORY); + }else{ + cats = SessionManager.getSession().retrieveQuery( + ATOMIC_ENTRIES_FOR_ROOT_CATEGORY); + } cats.setParameter("providerID", getID()); cats.setParameter("rootCategoryID", root.getID()); } else { - cats = SessionManager.getSession().retrieveQuery(ATOMIC_ENTRIES); + if(filterCats){ + cats = SessionManager.getSession().retrieveQuery(FILTERED_ATOMIC_ENTRIES); + }else{ + cats = SessionManager.getSession().retrieveQuery(ATOMIC_ENTRIES); + } cats.setParameter("providerID", getID()); } return cats; Modified: aplaws/trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig.java =================================================================== --- aplaws/trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig.java 2007-10-12 10:49:41 UTC (rev 1684) +++ aplaws/trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig.java 2007-10-15 08:00:11 UTC (rev 1685) @@ -45,6 +45,7 @@ private Parameter m_adapters; private Parameter m_rootCategoryPicker; private BooleanParameter m_useSubsiteSpecificNavigationCategory; + private BooleanParameter m_filterCategoryProdiver; public AtoZConfig() { m_types = new HashSet(); @@ -67,10 +68,16 @@ ("com.arsdigita.london.atoz.use_subsite_specific_navigation_category", Parameter.OPTIONAL, Boolean.FALSE); + + m_filterCategoryProdiver = new BooleanParameter ( + "com.arsdigita.london.atoz.filterCategoryProviders", + Parameter.OPTIONAL, + Boolean.FALSE); register(m_adapters); register(m_rootCategoryPicker); - register(m_useSubsiteSpecificNavigationCategory); + register(m_useSubsiteSpecificNavigationCategory); + register(m_filterCategoryProdiver); loadInfo(); } @@ -100,4 +107,8 @@ public boolean useSubsiteSpecificNavigationCategory() { return ((Boolean) get(m_useSubsiteSpecificNavigationCategory)).booleanValue(); } + + public boolean filterCategoryProviders () { + return ((Boolean) get(m_filterCategoryProdiver)).booleanValue(); + } } Modified: aplaws/trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig_parameter.properties =================================================================== --- aplaws/trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig_parameter.properties 2007-10-12 10:49:41 UTC (rev 1684) +++ aplaws/trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig_parameter.properties 2007-10-15 08:00:11 UTC (rev 1685) @@ -10,3 +10,7 @@ com.arsdigita.london.atoz.use_subsite_specific_navigation_category.purpose=Set this to yes, and the AtoZ will use the subsite-specific navigation categories if you define *any* CategoryProvider com.arsdigita.london.atoz.use_subsite_specific_navigation_category.format=[boolean] com.arsdigita.london.atoz.use_subsite_specific_navigation_category.example=true +com.arsdigita.london.atoz.filterCategoryProviders.title=To filter out category without published items +com.arsdigita.london.atoz.filterCategoryProviders.purpose=if TRUE, the AtoZ category providers will only return Categories with published items +com.arsdigita.london.atoz.filterCategoryProviders.format=[boolean] +com.arsdigita.london.atoz.filterCategoryProviders.example=false \ No newline at end of file |
From: <fra...@fe...> - 2007-10-12 11:00:18
|
Author: francois Date: 2007-10-12 13:00:11 +0200 (Fri, 12 Oct 2007) New Revision: 1684 Modified: aplaws/contrib/camden/ccm-ldn-content-check/trunk/application.xml Log: change version/release number to be in-line with best practice. Release number update is enough here as there are no Data Model changes. Modified: aplaws/contrib/camden/ccm-ldn-content-check/trunk/application.xml =================================================================== --- aplaws/contrib/camden/ccm-ldn-content-check/trunk/application.xml 2007-10-12 07:52:59 UTC (rev 1683) +++ aplaws/contrib/camden/ccm-ldn-content-check/trunk/application.xml 2007-10-12 11:00:11 UTC (rev 1684) @@ -2,8 +2,8 @@ <ccm:application name="ccm-ldn-content-check" prettyName="Content Check Alerts" - version="1.0.1" - release="1" + version="1.0.0" + release="4" xmlns:ccm="http://ccm.redhat.com/ccm-project"> <ccm:dependencies> |
From: <fra...@fe...> - 2007-10-12 08:00:18
|
Author: francois Date: 2007-10-12 10:00:11 +0200 (Fri, 12 Oct 2007) New Revision: 1683 Modified: aplaws/contrib/camden/ccm-ldn-content-check/trunk/application.xml aplaws/contrib/camden/ccm-ldn-content-check/trunk/pdl/com/arsdigita/london/cms/check/ContentCheck.pdl aplaws/contrib/camden/ccm-ldn-content-check/trunk/pdl/com/arsdigita/london/cms/check/operation-updateContentCheck.ora.pdl aplaws/contrib/camden/ccm-ldn-content-check/trunk/pdl/com/arsdigita/london/cms/check/operation-updateContentCheck.pg.pdl aplaws/contrib/camden/ccm-ldn-content-check/trunk/src/com/arsdigita/london/cms/check/ContentCheckAlert.java Log: content_checks now uses master_id instead of item_id. This is that a content checks is valid accross item lifecycle and a not marked has not checked after republishing (same master_id but different item_id) Modified: aplaws/contrib/camden/ccm-ldn-content-check/trunk/application.xml =================================================================== --- aplaws/contrib/camden/ccm-ldn-content-check/trunk/application.xml 2007-10-04 12:06:20 UTC (rev 1682) +++ aplaws/contrib/camden/ccm-ldn-content-check/trunk/application.xml 2007-10-12 08:00:11 UTC (rev 1683) @@ -2,8 +2,8 @@ <ccm:application name="ccm-ldn-content-check" prettyName="Content Check Alerts" - version="1.0.0" - release="3" + version="1.0.1" + release="1" xmlns:ccm="http://ccm.redhat.com/ccm-project"> <ccm:dependencies> Modified: aplaws/contrib/camden/ccm-ldn-content-check/trunk/pdl/com/arsdigita/london/cms/check/ContentCheck.pdl =================================================================== --- aplaws/contrib/camden/ccm-ldn-content-check/trunk/pdl/com/arsdigita/london/cms/check/ContentCheck.pdl 2007-10-04 12:06:20 UTC (rev 1682) +++ aplaws/contrib/camden/ccm-ldn-content-check/trunk/pdl/com/arsdigita/london/cms/check/ContentCheck.pdl 2007-10-12 08:00:11 UTC (rev 1683) @@ -6,11 +6,11 @@ String creatorContact; do { - select ci.item_id, ct.object_type, dc.creator_contact + select ci.master_id, ct.object_type, dc.creator_contact from acs_object_lifecycle_map lcm, lifecycles lc, ldn_dublin_core_items dc, content_types ct, cms_items ci left outer join cms_content_checks cc - on ( ci.item_id = cc.item_id ) + on ( ci.master_id = cc.item_id ) where ci.type_id IN :contentTypes and ci.version = 'live' and ci.type_id = ct.type_id @@ -19,7 +19,7 @@ and dc.creator_contact is not null and nvl(cc.last_alert, lc.start_date_time) < current_date - :intervalDays } map { - itemID = ci.item_id; + itemID = ci.master_id; objectType = ct.object_type; creatorContact = dc.creator_contact; } Modified: aplaws/contrib/camden/ccm-ldn-content-check/trunk/pdl/com/arsdigita/london/cms/check/operation-updateContentCheck.ora.pdl =================================================================== --- aplaws/contrib/camden/ccm-ldn-content-check/trunk/pdl/com/arsdigita/london/cms/check/operation-updateContentCheck.ora.pdl 2007-10-04 12:06:20 UTC (rev 1682) +++ aplaws/contrib/camden/ccm-ldn-content-check/trunk/pdl/com/arsdigita/london/cms/check/operation-updateContentCheck.ora.pdl 2007-10-12 08:00:11 UTC (rev 1683) @@ -4,8 +4,8 @@ do { begin insert into cms_content_checks(item_id) - select item_id from cms_items - where item_id = :itemID + select master_id from cms_items + where master_id = :itemID and not exists (select 1 from cms_content_checks where item_id = :itemID); update cms_content_checks set last_alert = sysdate Modified: aplaws/contrib/camden/ccm-ldn-content-check/trunk/pdl/com/arsdigita/london/cms/check/operation-updateContentCheck.pg.pdl =================================================================== --- aplaws/contrib/camden/ccm-ldn-content-check/trunk/pdl/com/arsdigita/london/cms/check/operation-updateContentCheck.pg.pdl 2007-10-04 12:06:20 UTC (rev 1682) +++ aplaws/contrib/camden/ccm-ldn-content-check/trunk/pdl/com/arsdigita/london/cms/check/operation-updateContentCheck.pg.pdl 2007-10-12 08:00:11 UTC (rev 1683) @@ -3,8 +3,8 @@ data operation updateContentCheck { do { insert into cms_content_checks(item_id) - select item_id from cms_items - where item_id = :itemID + select master_id from cms_items + where master_id = :itemID and not exists (select 1 from cms_content_checks where item_id = :itemID); update cms_content_checks set last_alert = current_timestamp Modified: aplaws/contrib/camden/ccm-ldn-content-check/trunk/src/com/arsdigita/london/cms/check/ContentCheckAlert.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-content-check/trunk/src/com/arsdigita/london/cms/check/ContentCheckAlert.java 2007-10-04 12:06:20 UTC (rev 1682) +++ aplaws/contrib/camden/ccm-ldn-content-check/trunk/src/com/arsdigita/london/cms/check/ContentCheckAlert.java 2007-10-12 08:00:11 UTC (rev 1683) @@ -158,7 +158,6 @@ itemURLs.append(++i).append(". ").append(serverURL) .append("redirect?oid=") .append(URLEncoder.encode("["+objectType+":{id="+itemID+"}]")) - .append("&context=").append(ContentItem.LIVE) .append(StringUtils.NEW_LINE).append(StringUtils.NEW_LINE); } while (msgCountDown != 0 && outdated.next()); if (msgCountDown != 0) { |
From: <chr...@fe...> - 2007-10-04 13:00:18
|
Author: chrisg23 Date: 2007-10-04 15:00:10 +0200 (Thu, 04 Oct 2007) New Revision: 1682 Modified: aplaws/trunk/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql Log: the previous sql only works in Postgres 8.x - this version is ok for 7,x too Modified: aplaws/trunk/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql =================================================================== --- aplaws/trunk/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql 2007-10-03 15:04:55 UTC (rev 1681) +++ aplaws/trunk/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql 2007-10-04 13:00:10 UTC (rev 1682) @@ -13,4 +13,27 @@ -- License along with this library; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -alter table messages alter body type text; +-- NOTE - easier version: alter table messages alter column body type text; +-- only works for Postgres 8.x + + + + +alter table messages add large_body text; + +update messages set large_body = body; + +alter table messages drop column body; + +alter table messages rename column large_body to body; + +commit; + +-- reclaim disk space from old column + +UPDATE messages SET body = body; + +VACUUM FULL messages; + +commit; + |
From: <chr...@fe...> - 2007-10-03 16:00:21
|
Author: chrisg23 Date: 2007-10-03 18:00:10 +0200 (Wed, 03 Oct 2007) New Revision: 1681 Modified: aplaws/trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties Log: Parameter example wasn't a good example as it had content type names wrong Modified: aplaws/trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties =================================================================== --- aplaws/trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties 2007-09-21 08:58:51 UTC (rev 1680) +++ aplaws/trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties 2007-10-03 16:00:10 UTC (rev 1681) @@ -200,7 +200,7 @@ com.arsdigita.cms.skip_asset_steps.title=Asset steps to skip com.arsdigita.cms.skip_asset_steps.purpose=Specify asset steps that are not relevant for specific content types -com.arsdigita.cms.skip_asset_steps.example=com.arsdigita.cms.MultiPartArticle:com.arsdigita.cms.contenttypes.ui.ImageStep,com.arsdigita.cms.InlineSite:com.arsdigita.cms.contenttypes.ui.ImageStep,com.arsdigita.cms.InlineSite:om.arsdigita.cms.contentassets.ui.FileAttachmentsStep +com.arsdigita.cms.skip_asset_steps.example=com.arsdigita.cms.contenttypes.MultiPartArticle:com.arsdigita.cms.contenttypes.ui.ImageStep,com.arsdigita.cms.contenttypes.InlineSite:com.arsdigita.cms.contenttypes.ui.ImageStep,com.arsdigita.cms.InlineSite:om.arsdigita.cms.contentassets.ui.FileAttachmentsStep com.arsdigita.cms.skip_asset_steps.format=[string,string,string] com.arsdigita.cms.mandatory_descriptions.title=Mandatory Descriptions |
From: <cl...@fe...> - 2007-09-21 09:00:10
|
Author: clasohm Date: 2007-09-21 11:00:12 +0200 (Fri, 21 Sep 2007) New Revision: 1680 Added: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/ParameterNameValidationListener.java Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeResources.properties aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/SectionEditForm.java Log: changed validation of section Parameter Name field Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeResources.properties =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeResources.properties 2007-09-21 08:58:06 UTC (rev 1679) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeResources.properties 2007-09-21 09:00:12 UTC (rev 1680) @@ -1,3 +1,4 @@ +error.parameter_name_characters=This parameter can only contain letters, digits, or "-_" form.none=-- none -- form.please_select=-- please select -- form_label.cancel_url=Cancel URL Added: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/ParameterNameValidationListener.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/ParameterNameValidationListener.java (rev 0) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/ParameterNameValidationListener.java 2007-09-21 09:00:12 UTC (rev 1680) @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2007 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.camden.cms.contenttypes.ui; + +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.event.ParameterEvent; +import com.arsdigita.bebop.parameters.GlobalizedParameterListener; +import com.arsdigita.bebop.parameters.ParameterData; +import com.arsdigita.camden.cms.contenttypes.DecisionTreeUtil; +import com.arsdigita.globalization.GlobalizedMessage; + +/** + * Verifies that the + * parameter's value contains only letters, digits, "-" and "_". + * + * @author Carsten Clasohm + * @version $Id$ + **/ + +public class ParameterNameValidationListener extends GlobalizedParameterListener { + + public static final String versionId = "$Id$"; + + public ParameterNameValidationListener() { + setError(DecisionTreeUtil.globalize("error.parameter_name_characters")); + } + + public ParameterNameValidationListener(GlobalizedMessage error) { + setError(error); + } + + public void validate (ParameterEvent e) throws FormProcessException { + ParameterData data = e.getParameterData(); + Object obj = data.getValue(); + + if (obj == null) { + return; + } + + String value; + try { + value = (String) obj; + } catch (ClassCastException cce) { + throw new FormProcessException (cce.getMessage()); + } + + for (int i = 0; i < value.length(); i++) { + char c = value.charAt(i); + if (!Character.isLetterOrDigit(c) && c != '-' && c != '_') { + data.addError(getError()); + return; + } + } + } +} Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/SectionEditForm.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/SectionEditForm.java 2007-09-21 08:58:06 UTC (rev 1679) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/SectionEditForm.java 2007-09-21 09:00:12 UTC (rev 1680) @@ -153,7 +153,7 @@ add(new Label(DecisionTreeUtil.globalize("form_label.parameter_name"))); TextField parameterWidget = new TextField(new TrimmedStringParameter(PARAMETER_NAME)); parameterWidget.addValidationListener(new NotEmptyValidationListener()); - parameterWidget.addValidationListener(new StringIsLettersOrDigitsValidationListener()); + parameterWidget.addValidationListener(new ParameterNameValidationListener()); add(parameterWidget); add(new Label(DecisionTreeUtil.globalize("form_label.instructions")), |
From: <cl...@fe...> - 2007-09-21 09:00:09
|
Author: clasohm Date: 2007-09-21 11:00:11 +0200 (Fri, 21 Sep 2007) New Revision: 1679 Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/web/static/content-types/com/arsdigita/camden/cms/contenttypes/DecisionTree.xsl Log: fixed the XSL template so it works on the Camden Web site; changed form validation so the Cancel button can be used without selecting an option Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/web/static/content-types/com/arsdigita/camden/cms/contenttypes/DecisionTree.xsl =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/web/static/content-types/com/arsdigita/camden/cms/contenttypes/DecisionTree.xsl 2007-09-21 07:41:42 UTC (rev 1678) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/web/static/content-types/com/arsdigita/camden/cms/contenttypes/DecisionTree.xsl 2007-09-21 09:00:11 UTC (rev 1679) @@ -8,15 +8,15 @@ <xsl:template match="cms:item[objectType='com.arsdigita.camden.cms.contenttypes.DecisionTree']" mode="cms:CT_graphics" name="cms:CT_graphics_com_arsdigita_camden_cms_contenttypes_DecisionTree"> - <script type="text/javascript" src="/decisiontree/forms.js"></script> + <script type="text/javascript" src="/decisiontree/forms.js"> + // Placeholder to prevent the Camden templates from breaking this tag. + </script> - <h1><xsl:value-of select="./title"/></h1> - <h2><xsl:value-of select="./sections/title"/></h2> <div><xsl:value-of select="./sections/instructions/content" disable-output-escaping="yes"/></div> - <form action="/decisiontree/form-handler.jsp" method="GET" onsubmit="return validate(this)"> + <form action="/decisiontree/form-handler.jsp" method="GET"> <input type="hidden" name="section_oid"> <xsl:attribute name="value"> <xsl:value-of select="./sections[title]/@oid"/> @@ -64,7 +64,7 @@ </xsl:for-each> <input type="submit" name="cancel" value="Cancel"/> - <input type="submit" name="next" value="Next >"/> + <input type="submit" name="next" value="Next >" onclick="return validate(this.form)"/> </form> </xsl:template> |
From: <cl...@fe...> - 2007-09-21 08:00:12
|
Author: clasohm Date: 2007-09-21 10:00:10 +0200 (Fri, 21 Sep 2007) New Revision: 1678 Added: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/ccm-ldn-camden-decisiontree.config Removed: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/ccm-ldn-camden-decisiontree.conf Log: fixed config filename Deleted: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/ccm-ldn-camden-decisiontree.conf Copied: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/ccm-ldn-camden-decisiontree.config (from rev 1677, aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/ccm-ldn-camden-decisiontree.conf) =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/ccm-ldn-camden-decisiontree.config (rev 0) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/ccm-ldn-camden-decisiontree.config 2007-09-21 08:00:10 UTC (rev 1678) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<registry> + <!-- nothing yet --> +</registry> + \ No newline at end of file |
From: <cl...@fe...> - 2007-09-20 18:00:14
|
Author: clasohm Date: 2007-09-20 20:00:11 +0200 (Thu, 20 Sep 2007) New Revision: 1677 Added: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/ccm-ldn-camden-decisiontree.conf Log: added empty .conf file to make hostinit work Added: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/ccm-ldn-camden-decisiontree.conf =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/ccm-ldn-camden-decisiontree.conf (rev 0) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/ccm-ldn-camden-decisiontree.conf 2007-09-20 18:00:11 UTC (rev 1677) @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="utf-8"?> +<registry> +</registry> |
Author: clasohm Date: 2007-09-20 16:00:11 +0200 (Thu, 20 Sep 2007) New Revision: 1676 Added: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/OptionTarget.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/OptionTargetCollection.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/web/decisiontree/forms.js Removed: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/SectionTarget.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/SectionTargetCollection.java Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/pdl/com/arsdigita/camden/cms/contenttypes/DecisionTree.pdl aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/WEB-INF/content-types/com/arsdigita/camden/cms/contenttypes/DecisionTree.xml aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/DecisionTree.xml aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTree.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeInitializer.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeResources.properties aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeTraversalAdapter.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/SectionOption.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/TreeSection.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/DecisionTreeViewOptions.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/DecisionTreeViewTargets.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/OptionEditForm.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/OptionTable.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/SectionEditForm.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/TargetDeleteForm.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/TargetEditForm.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/TargetTable.java aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/web/decisiontree/form-handler.jsp aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/web/static/content-types/com/arsdigita/camden/cms/contenttypes/DecisionTree.xsl Log: worked on data model, authoring UI, and content display Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/pdl/com/arsdigita/camden/cms/contenttypes/DecisionTree.pdl =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/pdl/com/arsdigita/camden/cms/contenttypes/DecisionTree.pdl 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/pdl/com/arsdigita/camden/cms/contenttypes/DecisionTree.pdl 2007-09-20 14:00:11 UTC (rev 1676) @@ -23,7 +23,7 @@ object type DecisionTree extends ContentPage { - String[0..1] cancelURL = cam_decision_trees.cancel_url; + String[0..1] cancelURL = cam_decision_trees.cancel_url; TreeSection[0..1] firstSection = join cam_decision_trees.first_section to cam_tree_sections.section_id; @@ -33,6 +33,7 @@ object type TreeSection extends ContentPage { + String[1..1] parameterName = cam_tree_sections.parameter_name; component TextAsset[0..1] instructions = join cam_tree_sections.instructions to cms_text.text_id; @@ -52,6 +53,7 @@ object type SectionOption extends ContentItem { + Integer[1..1] rank = cam_section_options.rank; String[1..1] label = cam_section_options.label; String[1..1] value = cam_section_options.value; @@ -69,13 +71,13 @@ } -object type SectionTarget extends ContentItem { +object type OptionTarget extends ContentItem { - String[0..1] targetURL = cam_section_targets.target_url; + String[0..1] targetURL = cam_option_targets.target_url; TreeSection[0..1] targetSection = - join cam_section_targets.target_section to cam_tree_sections.section_id; + join cam_option_targets.target_section to cam_tree_sections.section_id; - reference key (cam_section_targets.target_id); + reference key (cam_option_targets.target_id); } @@ -83,8 +85,8 @@ // Association between an option and its target composite SectionOption[1..1] matchOption = - join cam_section_targets.match_option to cam_section_options.option_id; - component SectionTarget[0..1] optionTarget = - join cam_section_options.option_id to cam_section_targets.match_option; + join cam_option_targets.match_option to cam_section_options.option_id; + component OptionTarget[0..1] optionTarget = + join cam_section_options.option_id to cam_option_targets.match_option; } Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/WEB-INF/content-types/com/arsdigita/camden/cms/contenttypes/DecisionTree.xml =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/WEB-INF/content-types/com/arsdigita/camden/cms/contenttypes/DecisionTree.xml 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/WEB-INF/content-types/com/arsdigita/camden/cms/contenttypes/DecisionTree.xml 2007-09-20 14:00:11 UTC (rev 1676) @@ -23,7 +23,7 @@ descriptionBundle="com.arsdigita.camden.cms.contenttypes.DecisionTreeResources" component="com.arsdigita.camden.cms.contenttypes.ui.DecisionTreeViewOptions"/> - <ctd:authoring-step labelKey="section_targets.title" labelBundle="com.arsdigita.camden.cms.contenttypes.DecisionTreeResources" descriptionKey="section_targets.description" descriptionBundle="com.arsdigita.camden.cms.contenttypes.DecisionTreeResources" component="com.arsdigita.camden.cms.contenttypes.ui.DecisionTreeViewTargets" /><ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/> + <ctd:authoring-step labelKey="option_targets.title" labelBundle="com.arsdigita.camden.cms.contenttypes.DecisionTreeResources" descriptionKey="option_targets.description" descriptionBundle="com.arsdigita.camden.cms.contenttypes.DecisionTreeResources" component="com.arsdigita.camden.cms.contenttypes.ui.DecisionTreeViewTargets" /><ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/> </ctd:authoring-kit> </ctd:content-type> </ctd:content-types> Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/DecisionTree.xml =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/DecisionTree.xml 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/DecisionTree.xml 2007-09-20 14:00:11 UTC (rev 1676) @@ -62,10 +62,16 @@ </xrd:adapter> </xrd:context> - <xrd:context name="com.arsdigita.camden.cms.contenttypes.DecisionTreeMetadataProvider"> + <xrd:context name="com.arsdigita.cms.search.ContentPageMetadataProvider"> <xrd:adapter objectType="com.arsdigita.camden.cms.contenttypes.DecisionTree" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter"> + <xrd:associations rule="include"> + <xrd:property name="/object/sections"></xrd:property> + <xrd:property name="/object/sections/instructions"></xrd:property> + <xrd:property name="/object/sections/sectionOptions"></xrd:property> + <xrd:property name="/object/sections/sectionOptions/optionTarget"></xrd:property> + </xrd:associations> <xrd:attributes rule="exclude"> <xrd:property name="/object/version"/> <xrd:property name="/object/name"/> @@ -111,8 +117,6 @@ <xrd:property name="/object/sections/sectionOptions/optionTarget/displayName"/> <xrd:property name="/object/sections/sectionOptions/optionTarget/defaultDomainClass"/> </xrd:attributes> - <xrd:attributes rule="include"> - <xrd:property name="/object/sections"></xrd:property></xrd:attributes> </xrd:adapter> </xrd:context> </xrd:adapters> Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTree.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTree.java 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTree.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -19,14 +19,16 @@ package com.arsdigita.camden.cms.contenttypes; import java.math.BigDecimal; +import java.util.Enumeration; import javax.servlet.http.HttpServletRequest; +import org.apache.log4j.Logger; + import com.arsdigita.bebop.PageState; import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentPage; -import com.arsdigita.cms.dispatcher.CMSPage; import com.arsdigita.cms.dispatcher.SimpleXMLGenerator; import com.arsdigita.cms.dispatcher.XMLGenerator; import com.arsdigita.domain.DataObjectNotFoundException; @@ -36,6 +38,7 @@ import com.arsdigita.persistence.OID; import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; +import com.arsdigita.web.BaseApplicationServlet; import com.arsdigita.xml.Element; /** @@ -45,6 +48,7 @@ * @version $Id$ */ public class DecisionTree extends ContentPage implements XMLGenerator { + public static final Logger s_log = Logger.getLogger(DecisionTree.class); public static final String versionId = "$Id$"; @@ -53,9 +57,14 @@ public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.camden.cms.contenttypes.DecisionTree"; - public static final String CANCEL_URL = "cancelURL"; - public static final String FIRST_SECTION = "firstSection"; - public static final String SECTIONS = "sections"; + public static final String CANCEL_URL = "cancelURL"; + public static final String PARAM_RETURN_URL = "return_url"; + public static final String FIRST_SECTION = "firstSection"; + public static final String SECTIONS = "sections"; + public static final String PARAM_SECTION_ID = "section_id"; + public static final String PARAM_SECTION_OID = "section_oid"; + public static final String BUTTON_CANCEL = "cancel"; + public static final String BUTTON_NEXT = "next"; public DecisionTree() { this(BASE_DATA_OBJECT_TYPE); @@ -139,44 +148,70 @@ SectionOptionCollection options = new SectionOptionCollection(collection); options.addEqualsFilter("treeSection.tree.id", getID()); - options.addOrder("treeSection.title, label"); + options.addOrder("treeSection.title, rank, label"); return options; } - public SectionTargetCollection getTargets() { + public OptionTargetCollection getTargets() { Session ssn = SessionManager.getSession(); - DataCollection collection = ssn.retrieve(SectionTarget.BASE_DATA_OBJECT_TYPE); + DataCollection collection = ssn.retrieve(OptionTarget.BASE_DATA_OBJECT_TYPE); - SectionTargetCollection options = new SectionTargetCollection(collection); + OptionTargetCollection options = new OptionTargetCollection(collection); options.addEqualsFilter("matchOption.treeSection.tree.id", getID()); - options.addOrder("matchOption.treeSection.title, matchOption.label"); + options.addOrder("matchOption.treeSection.title, matchOption.rank, matchOption.label"); return options; } /** + * Given a URL parameter name, determine if that parameter should be included + * in the HTTP request for the next section. + * + * @param parameterName the name of the URL parameter to check + * @return true if the parameter is to be included in the next section request + */ + public static boolean preserveParameter(String parameterName) { + return (!PARAM_SECTION_ID.equals(parameterName) && + !PARAM_SECTION_OID.equals(parameterName) && + !PARAM_RETURN_URL.equals(parameterName) && + !BUTTON_CANCEL.equals(parameterName) && + !BUTTON_NEXT.equals(parameterName) && + !BaseApplicationServlet.APPLICATION_ID_PARAMETER.equals(parameterName)); + } + + /** * Generate the XML for a DecisionTree. In addition to what SimpleXMLGenerator does, * this also stores information about the current request in an XML element. */ public void generateXML(PageState state, Element parent, String useContext) { - ContentItem item; - if (CMS.getContext().hasContentItem()) { - item = CMS.getContext().getContentItem(); - } else { - CMSPage page = (CMSPage) state.getPage(); - item = page.getContentItem(state); - } + ContentItem item = CMS.getContext().getContentItem(); Element content = new Element("cms:item", CMS.CMS_XML_NS); if (useContext != null) content.addAttribute("useContext", useContext); - // TODO: determine the current URL from the original HTTP request. - // Or use some OID redirector? + Element customInfo = new Element("customInfo"); + customInfo.addAttribute("currentURL", state.getRequestURI()); + content.addContent(customInfo); + + // Add the URL parameters to the XML output, so we can include + // them has hidden form fields. HttpServletRequest request = state.getRequest(); - Element currentURL = new Element("customInfo"); - currentURL.addAttribute("currentURL", request.getPathInfo()); - content.addContent(currentURL); - + Enumeration parameterNames = request.getParameterNames(); + while (parameterNames.hasMoreElements()) { + String name = (String) parameterNames.nextElement(); + + // Don't include the section_id parameter - that's + // not to be passed from section to section. + if (!preserveParameter(name)) + continue; + + Element parameters = new Element("parameters"); + parameters.addAttribute("name", name); + parameters.addAttribute("value", request.getParameter(name)); + + content.addContent(parameters); + } + DomainObjectXMLRenderer renderer = new DomainObjectXMLRenderer(content); Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeInitializer.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeInitializer.java 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeInitializer.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -57,9 +57,9 @@ } }); - f.registerInstantiator(SectionTarget.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() { + f.registerInstantiator(OptionTarget.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() { protected DomainObject doNewInstance(DataObject dataObject) { - return new SectionTarget(dataObject); + return new OptionTarget(dataObject); } }); } Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeResources.properties =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeResources.properties 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeResources.properties 2007-09-20 14:00:11 UTC (rev 1676) @@ -5,6 +5,7 @@ form_label.instructions=Instructions form_label.label=Label form_label.match_value=Value to Match +form_label.parameter_name=Parameter Name form_label.section=Section form_label.target_section=Target Section form_label.target_url=Target URL @@ -18,17 +19,19 @@ section_options.delete_option=Delete option section_options.description=The options that belong to this decision tree's sections. section_options.edit_option=Edit Option +section_options.move_option_name=Move option +section_options.move_to_beginning=Move to beginning section_options.no_options_yet=No options yet section_options.title=Section Options section_options.view_all_options=View all options -section_targets.add_new_target=Add new target -section_targets.add_target=Add Target -section_targets.delete_target=Delete target -section_targets.description=The targets that belong to this decision tree's sections. -section_targets.edit_target=Edit Target -section_targets.no_targets_yet=No targets yet -section_targets.title=Section Targets -section_targets.view_all_targets=View all targets +option_targets.add_new_target=Add new target +option_targets.add_target=Add Target +option_targets.delete_target=Delete target +option_targets.description=The targets that belong to this decision treeS. +option_targets.edit_target=Edit Target +option_targets.no_targets_yet=No targets yet +option_targets.title=Option Targets +option_targets.view_all_targets=View all targets tree_section.submission_cancelled=Submission cancelled tree_sections.add_new_section=Add new section tree_sections.add_section=Add Section Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeTraversalAdapter.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeTraversalAdapter.java 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTreeTraversalAdapter.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -44,8 +44,6 @@ public boolean processProperty(DomainObject obj, String path, Property prop, String context) { - // TODO Auto-generated method stub - HttpServletRequest request = DispatcherHelper.getRequest(); if ("/object/sections/title".equals(path) || Copied: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/OptionTarget.java (from rev 1628, aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/SectionTarget.java) =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/OptionTarget.java (rev 0) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/OptionTarget.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2007 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.camden.cms.contenttypes; + +import java.math.BigDecimal; + +import com.arsdigita.cms.ContentItem; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; + +/** + * A section target of the Camden Decision Tree content type. + * + * @author Carsten Clasohm + * @version $Id$ + */ +public class OptionTarget extends ContentItem { + + public static final String versionId = "$Id$"; + + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.camden.cms.contenttypes.OptionTarget"; + + public static final String MATCH_OPTION = "matchOption"; + public static final String TARGET_URL = "targetURL"; + public static final String TARGET_SECTION = "targetSection"; + + public OptionTarget() { + this(BASE_DATA_OBJECT_TYPE); + } + + public OptionTarget(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public OptionTarget(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public OptionTarget(DataObject obj) { + super(obj); + } + + public OptionTarget(String type) { + super(type); + } + + /** + * @return the base PDL object type for this item. Child classes + * should override this method to return the correct value. + */ + public String getBaseDataObjectType() { + return BASE_DATA_OBJECT_TYPE; + } + + public SectionOption getMatchOption() { + DataObject dataObject = (DataObject) get(MATCH_OPTION); + if (dataObject == null) { return null; } + return new SectionOption(dataObject); + } + + public void setMatchOption(SectionOption value) { + setAssociation(MATCH_OPTION, value); + } + + public String getTargetURL() { + return (String) get(TARGET_URL); + } + + public void setTargetURL(String value) { + set(TARGET_URL, value); + } + + public TreeSection getTargetSection() { + DataObject dataObject = (DataObject) get(TARGET_SECTION); + if (dataObject == null) { return null; } + return new TreeSection(dataObject); + } + + public void setTargetSection(TreeSection value) { + set(TARGET_SECTION, value); + } + +} \ No newline at end of file Copied: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/OptionTargetCollection.java (from rev 1646, aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/SectionTargetCollection.java) =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/OptionTargetCollection.java (rev 0) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/OptionTargetCollection.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2007 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.camden.cms.contenttypes; + +import com.arsdigita.domain.DomainCollection; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.persistence.DataCollection; + +/** + * This class contains a collection of TreeSection objects. + * + * @author Carsten Clasohm + * @version $Id$ + */ +public class OptionTargetCollection extends DomainCollection { + + public static final String versionId = "$Id$"; + + /** + * Constructor. + * + **/ + public OptionTargetCollection(DataCollection dataCollection) { + super(dataCollection); + } + + /** + * Set the order of this Collection. This method needs to be called + * before <code>next()</code> is called on this collection. + * + */ + public void addOrder(String order) { + m_dataCollection.addOrder(order); + } + + /** + * Returns a <code>DomainObject</code> for the current position in + * the collection. + * + **/ + public DomainObject getDomainObject() { + return new OptionTarget(m_dataCollection.getDataObject()); + } + + /** + * Returns a <code>Image</code> for the current position in + * the collection. + * + **/ + public OptionTarget getTarget() { + return (OptionTarget) getDomainObject(); + } + +} Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/SectionOption.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/SectionOption.java 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/SectionOption.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -42,8 +42,9 @@ "com.arsdigita.camden.cms.contenttypes.SectionOption"; public static final String TREE_SECTION = "treeSection"; - public static final String LABEL = "label"; - public static final String VALUE = "value"; + public static final String RANK = "rank"; + public static final String LABEL = "label"; + public static final String VALUE = "value"; public SectionOption() { this(BASE_DATA_OBJECT_TYPE); @@ -83,6 +84,14 @@ setAssociation(TREE_SECTION, value); } + public Integer getRank() { + return (Integer) get(RANK); + } + + public void setRank(Integer value) { + set(RANK, value); + } + public String getLabel() { return (String) get(LABEL); } Deleted: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/SectionTarget.java Deleted: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/SectionTargetCollection.java Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/TreeSection.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/TreeSection.java 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/TreeSection.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -20,6 +20,8 @@ import java.math.BigDecimal; +import org.apache.log4j.Logger; + import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.TextAsset; import com.arsdigita.domain.DataObjectNotFoundException; @@ -34,16 +36,17 @@ * @version $Id$ */ public class TreeSection extends ContentPage { + public static final Logger s_log = Logger.getLogger(TreeSection.class); public static final String versionId = "$Id$"; public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.camden.cms.contenttypes.TreeSection"; - public static final String INSTRUCTIONS = "instructions"; - public static final String SECTION_OPTIONS = "sectionOptions"; - public static final String SECTION_TARGETS = "sectionTargets"; - public static final String TREE = "tree"; + public static final String PARAMETER_NAME = "parameterName"; + public static final String INSTRUCTIONS = "instructions"; + public static final String SECTION_OPTIONS = "sectionOptions"; + public static final String TREE = "tree"; public TreeSection() { this(BASE_DATA_OBJECT_TYPE); @@ -65,10 +68,6 @@ super(type); } - /** - * @return the base PDL object type for this item. Child classes - * should override this method to return the correct value. - */ public String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; } @@ -76,11 +75,28 @@ protected void beforeDelete() { super.beforeDelete(); + // Clear the DecisionTree's firstSection field if it points to + // this TreeSection. DecisionTree tree = getTree(); if (this.equals(tree.getFirstSection())) { tree.setFirstSection(null); } + + // Delete all OptionTargets which have this TreeSection as their target. + OptionTargetCollection targets = tree.getTargets(); + targets.addEqualsFilter("targetSection.id", getID()); + while (targets.next()) { + targets.getTarget().delete(); + } } + + public String getParameterName() { + return (String) get(PARAMETER_NAME); + } + + public void setParameterName(String value) { + set(PARAMETER_NAME, value); + } public TextAsset getInstructions() { DataObject dataObject = (DataObject)get(INSTRUCTIONS); @@ -93,19 +109,75 @@ } public SectionOptionCollection getOptions() { - return new SectionOptionCollection((DataCollection)get(SECTION_OPTIONS)); + return new SectionOptionCollection((DataCollection) get(SECTION_OPTIONS)); } - public void addTarget(SectionTarget target) { - add(SECTION_TARGETS, target); + public DecisionTree getTree() { + return new DecisionTree((DataObject) get(TREE)); } - - public void removeTarget(SectionTarget target) { - target.delete(); - } - public DecisionTree getTree() { - return new DecisionTree((DataObject)get(TREE)); + public int getMaxOptionRank() { + SectionOptionCollection options = getOptions(); + options.addOrder(SectionOption.RANK + " desc"); + + int maxRank = 0; + if (options.next()) + maxRank = options.getOption().getRank().intValue(); + options.close(); + + return maxRank; } + /** + * Change the rank of the option with the given id within this object. + * Sets the option rank to that given, and moves all other option ranks + * as appropriate. If the new rank is greater than the current rank, + * options in between will be moved to a numerically lower rank. If the + * new rank is less than the current rank than options in between will be + * moved to a higher rank. + * + * @param source the option to reorder + * @param rank the new rank for the option. This must be between 1 and + * the max section rank inclusively. + */ + public void changeOptionRank(SectionOption source, int destRank) { + Integer r = source.getRank(); + if (r == null) { + throw new IllegalStateException(source + " has null rank"); + } + + int curRank = r.intValue(); + + if (s_log.isDebugEnabled()) { + s_log.debug("*** changeSectionRank, section ID = " + source.getID() + + ", curRank = " + curRank + + ", destRank = " + destRank); + } + + SectionOptionCollection coll = getOptions(); + coll.addOrder(SectionOption.RANK); + if (curRank > destRank) { + coll.setRange(new Integer(destRank), new Integer(curRank)); + int rank = destRank; + while (coll.next()) { + SectionOption cur = coll.getOption(); + cur.setRank(new Integer(rank + 1)); + cur.save(); + rank++; + } + source.setRank(new Integer(destRank)); + } else if (curRank < destRank) { + coll.setRange(new Integer(curRank + 1), new Integer(destRank + 1)); + int rank = curRank + 1; + while (coll.next()) { + SectionOption cur = coll.getOption(); + cur.setRank(new Integer(rank - 1)); + cur.save(); + rank++; + } + source.setRank(new Integer(destRank)); + } + coll.close(); + } + } \ No newline at end of file Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/DecisionTreeViewOptions.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/DecisionTreeViewOptions.java 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/DecisionTreeViewOptions.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -19,22 +19,29 @@ package com.arsdigita.camden.cms.contenttypes.ui; +import java.math.BigDecimal; + import com.arsdigita.bebop.ActionLink; import com.arsdigita.bebop.ColumnPanel; import com.arsdigita.bebop.Container; import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.Page; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.event.ActionEvent; import com.arsdigita.bebop.event.ActionListener; +import com.arsdigita.bebop.event.ChangeEvent; +import com.arsdigita.bebop.event.ChangeListener; 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.event.TableActionEvent; import com.arsdigita.bebop.event.TableActionListener; +import com.arsdigita.bebop.parameters.BigDecimalParameter; import com.arsdigita.bebop.table.TableColumn; import com.arsdigita.camden.cms.contenttypes.DecisionTree; import com.arsdigita.camden.cms.contenttypes.DecisionTreeUtil; +import com.arsdigita.camden.cms.contenttypes.SectionOption; import com.arsdigita.camden.cms.contenttypes.TreeSection; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ItemSelectionModel; @@ -68,12 +75,17 @@ protected AuthoringKitWizard m_wizard; protected ItemSelectionModel m_selTree; protected ItemSelectionModel m_selOption; + protected ItemSelectionModel m_moveOption; + protected BigDecimalParameter m_moveParameter; /** visual components that do the 'real work' */ protected OptionTable m_optionTable; protected OptionEditForm m_optionEdit; protected OptionDeleteForm m_optionDelete; + protected ActionLink m_beginLink; + private Label m_moveOptionLabel; + private String m_typeIDStr; public DecisionTreeViewOptions (ItemSelectionModel selTree, AuthoringKitWizard wizard) { @@ -90,28 +102,70 @@ } /** - * Builds a container to hold a SectionTable and a link - * to add a new section. + * Builds a container to hold an OptionTable and a link + * to add a new option. */ protected Container buildOptionTable () { ColumnPanel c = new ColumnPanel(1); c.setKey(OPTION_TABLE+m_typeIDStr); c.setBorderColor("#FFFFFF"); c.setPadColor("#FFFFFF"); + + m_moveParameter = new BigDecimalParameter("moveOption"); + m_moveOption = new ItemSelectionModel(SectionOption.class.getName(), + SectionOption.BASE_DATA_OBJECT_TYPE, + m_moveParameter); - m_optionTable = new OptionTable(m_selTree); + m_optionTable = new OptionTable(m_selTree, m_moveOption); m_optionTable.setClassAttr(DATA_TABLE); - // selected section is based on the selection in the SectionTable - m_selOption = new ItemSelectionModel(TreeSection.class.getName(), - TreeSection.BASE_DATA_OBJECT_TYPE, + // selected option is based on the selection in the OptionTable + m_selOption = new ItemSelectionModel(SectionOption.class.getName(), + SectionOption.BASE_DATA_OBJECT_TYPE, m_optionTable.getRowSelectionModel()); + m_optionTable.setOptionModel(m_selOption); - m_optionTable.setSectionModel(m_selOption); - Label emptyView = new Label(DecisionTreeUtil.globalize("section_options.no_options_yet")); m_optionTable.setEmptyView(emptyView); + m_moveOptionLabel = new Label ("Option Name"); + c.add(m_moveOptionLabel, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); + + m_beginLink = new ActionLink((String) DecisionTreeUtil.globalize("section_options.move_to_beginning").localize()); + c.add(m_beginLink); + + m_beginLink.addActionListener ( new ActionListener() { + public void actionPerformed ( ActionEvent event ) { + PageState state = event.getPageState(); + SectionOption option = new SectionOption((BigDecimal) m_moveOption.getSelectedKey(state)); + + option.getSection().changeOptionRank(option, 1); + option.save(); + m_moveOption.setSelectedKey(state, null); + } + }); + + m_moveOption.addChangeListener ( new ChangeListener () { + public void stateChanged ( ChangeEvent e ) { + PageState state = e.getPageState(); + if ( m_moveOption.getSelectedKey(state) == null ) { + m_beginLink.setVisible(state, false); + m_moveOptionLabel.setVisible(state, false); + } else { + m_beginLink.setVisible(state, true); + m_moveOptionLabel.setVisible(state, true); + + SectionOption option = (SectionOption) m_moveOption.getSelectedObject(state); + String optionName = option.getSection().getTitle() + " - " + + option.getLabel(); + + m_moveOptionLabel.setLabel + ((String) DecisionTreeUtil.globalize("section_options.move_option_name").localize() + + " \"" + optionName + "\"", state); + } + } + }); + // handle clicks to preview or delete a Section m_optionTable.addTableActionListener (new TableActionListener () { public void cellSelected (TableActionEvent event) { @@ -121,15 +175,10 @@ .get(event.getColumn().intValue()); String colName = (String)col.getHeaderValue(); - if (SectionTable.COL_DEL.equals(colName)) { + if (OptionTable.COL_DEL.equals(colName)) { onlyShowComponent(state, OPTION_DEL+m_typeIDStr); - } else if (SectionTable.COL_EDIT.equals(colName)) { + } else if (OptionTable.COL_EDIT.equals(colName)) { onlyShowComponent(state, OPTION_EDIT+m_typeIDStr); - } else if (SectionTable.COL_FIRST.equals(colName)) { - DecisionTree tree = (DecisionTree)m_selTree.getSelectedObject(state); - TreeSection section = (TreeSection)m_selOption.getSelectedItem(state); - tree.setFirstSection(section); - tree.save(); } } @@ -245,6 +294,13 @@ return addLink; } + public void register ( Page p ) { + super.register(p); + p.addGlobalStateParam(m_moveParameter); + p.setVisibleDefault(m_beginLink, false); + p.setVisibleDefault(m_moveOptionLabel, false); + } + public String getTypeIDStr() { return m_typeIDStr; } Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/DecisionTreeViewTargets.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/DecisionTreeViewTargets.java 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/DecisionTreeViewTargets.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -109,7 +109,7 @@ m_targetTable.setSectionModel(m_selTarget); - Label emptyView = new Label(DecisionTreeUtil.globalize("section_targets.no_targets_yet")); + Label emptyView = new Label(DecisionTreeUtil.globalize("option_targets.no_targets_yet")); m_targetTable.setEmptyView(emptyView); // handle clicks to preview or delete a Section @@ -160,9 +160,9 @@ Label label = (Label)event.getTarget(); if (m_selTarget.getSelectedKey(state) == null) { - label.setLabel((String)DecisionTreeUtil.globalize("section_targets.add_target").localize()); + label.setLabel((String)DecisionTreeUtil.globalize("option_targets.add_target").localize()); } else { - label.setLabel((String)DecisionTreeUtil.globalize("section_targets.edit_target").localize()); + label.setLabel((String)DecisionTreeUtil.globalize("option_targets.edit_target").localize()); } } })); @@ -188,7 +188,7 @@ c.setBorderColor("#FFFFFF"); c.setPadColor("#FFFFFF"); - c.add(new Label(DecisionTreeUtil.globalize("section_targets.delete_target"))); + c.add(new Label(DecisionTreeUtil.globalize("option_targets.delete_target"))); m_targetDelete = new TargetDeleteForm(m_selTree, m_selTarget); m_targetDelete.addSubmissionListener ( new FormSubmissionListener () { public void submitted ( FormSectionEvent e ) { @@ -207,7 +207,7 @@ * Utility method to create a link to display the section list. */ protected ActionLink buildViewAllLink () { - ActionLink viewAllLink = new ActionLink( (String) DecisionTreeUtil.globalize("section_targets.view_all_targets").localize()); + ActionLink viewAllLink = new ActionLink( (String) DecisionTreeUtil.globalize("option_targets.view_all_targets").localize()); viewAllLink.setClassAttr(ACTION_LINK); viewAllLink.addActionListener( new ActionListener() { public void actionPerformed ( ActionEvent event ) { @@ -222,7 +222,7 @@ * Utility method to create a link to display the section list. */ protected ActionLink buildAddLink () { - ActionLink addLink = new ActionLink( (String) DecisionTreeUtil.globalize("section_targets.add_new_target").localize()) { + ActionLink addLink = new ActionLink( (String) DecisionTreeUtil.globalize("option_targets.add_new_target").localize()) { public boolean isVisible(PageState state) { SecurityManager sm = Utilities.getSecurityManager(state); ContentItem item = (ContentItem)m_selTree.getSelectedObject(state); Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/OptionEditForm.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/OptionEditForm.java 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/OptionEditForm.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -249,6 +249,8 @@ } else { option = new SectionOption(); option.setName("SectionOption " + option.getID()); + int rank = section.getMaxOptionRank() + 1; + option.setRank(Integer.valueOf(rank)); } String label = (String)data.get(LABEL); Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/OptionTable.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/OptionTable.java 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/OptionTable.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -18,6 +18,7 @@ */ package com.arsdigita.camden.cms.contenttypes.ui; +import java.math.BigDecimal; import org.apache.log4j.Logger; @@ -26,6 +27,8 @@ 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; @@ -34,13 +37,13 @@ import com.arsdigita.camden.cms.contenttypes.DecisionTree; import com.arsdigita.camden.cms.contenttypes.SectionOption; import com.arsdigita.camden.cms.contenttypes.SectionOptionCollection; +import com.arsdigita.camden.cms.contenttypes.TreeSection; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.SecurityManager; import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.util.LockableImpl; - /** * A table that displays the options for the currently * selected DecisionTree. @@ -54,38 +57,87 @@ public static final String COL_SECTION = "Section"; public static final String COL_OPTION = "Option"; public static final String COL_EDIT = "Edit"; + public static final String COL_MOVE = "Move"; public static final String COL_DEL = "Delete"; private ItemSelectionModel m_selTree; + private ItemSelectionModel m_selOption; + private ItemSelectionModel m_moveOption; private static final Logger s_log = Logger.getLogger(OptionTable.class); /** * Constructor. * - * @param selArticle a selection model that returns the MultiPartArticle + * @param selTree a selection model that returns the MultiPartArticle * which holds the sections to display. */ - public OptionTable(ItemSelectionModel selArticle) { + public OptionTable(ItemSelectionModel selTree, ItemSelectionModel moveOption) { super(); - m_selTree = selArticle; + m_selTree = selTree; + m_moveOption = moveOption; TableColumnModel model = getColumnModel(); model.add(new TableColumn(0, COL_SECTION)); model.add(new TableColumn(1, COL_OPTION)); model.add(new TableColumn(2, COL_EDIT)); - model.add(new TableColumn(3, COL_DEL)); + model.add(new TableColumn(3, COL_MOVE)); + model.add(new TableColumn(4, COL_DEL)); model.get(2).setCellRenderer(new SectionTableCellRenderer(true)); model.get(3).setCellRenderer(new SectionTableCellRenderer(true)); + model.get(4).setCellRenderer(new SectionTableCellRenderer(true)); - setModelBuilder(new OptionTableModelBuilder(m_selTree)); + setModelBuilder(new OptionTableModelBuilder(m_selTree, m_moveOption)); + + addTableActionListener ( new TableActionListener () { + public void cellSelected ( TableActionEvent event ) { + PageState state = event.getPageState(); + + TableColumn col = getColumnModel() + .get(event.getColumn().intValue()); + String colName = (String)col.getHeaderValue(); + + if ( COL_MOVE.equals(colName) ) { + if ( m_moveOption.getSelectedKey(state) == null ) { + m_moveOption.setSelectedKey(state, m_selOption.getSelectedKey(state)); + } else { + BigDecimal id = (BigDecimal) m_moveOption.getSelectedKey(state); + SectionOption option = new SectionOption(id); + + BigDecimal dest = new BigDecimal((String) event.getRowKey()); + SectionOption destOption = new SectionOption(dest); + + TreeSection section = option.getSection(); + + if (section.equals(destOption.getSection())) { + // if option is lower in rank than the dest + // then move below is default behavior + int rank = destOption.getRank().intValue(); + if (option.getRank().intValue() > rank) { + // otherwise, add one to get "move below" + rank++; + } + + section.changeOptionRank(option, rank); + option.save(); + } + m_moveOption.setSelectedKey(state, null); + } + } + } + + public void headSelected ( TableActionEvent event ) { + // do nothing + } + }); } - public void setSectionModel(ItemSelectionModel selSection) { - if (selSection == null) { + public void setOptionModel(ItemSelectionModel selOption) { + if (selOption == null) { s_log.warn("null item model"); } + m_selOption = selOption; } /** @@ -95,28 +147,34 @@ implements TableModelBuilder { protected ItemSelectionModel m_selTree; + protected ItemSelectionModel m_moveOption; - public OptionTableModelBuilder(ItemSelectionModel selTree) { + public OptionTableModelBuilder(ItemSelectionModel selTree, ItemSelectionModel moveOption) { m_selTree = selTree; + m_moveOption = moveOption; } public TableModel makeModel(Table table, PageState state) { table.getRowSelectionModel().clearSelection(state); DecisionTree tree = (DecisionTree)m_selTree.getSelectedObject(state); - return new OptionTableModel(table, state, tree); + return new OptionTableModel(table, state, tree, m_moveOption); } } protected class OptionTableModel implements TableModel { private TableColumnModel m_colModel; + private PageState m_state; private SectionOptionCollection m_options; + private ItemSelectionModel m_moveOption; private SectionOption m_option; /** Constructor. */ - public OptionTableModel(Table table, PageState state, DecisionTree tree) { + public OptionTableModel(Table table, PageState state, DecisionTree tree, ItemSelectionModel moveOption) { m_colModel = table.getColumnModel(); + m_state = state; m_options = tree.getOptions(); + m_moveOption = moveOption; } /** Return the number of columsn this TableModel has. */ @@ -149,6 +207,16 @@ return m_option.getLabel(); } else if (COL_EDIT.equals(colName)) { return "edit"; + } else if (COL_MOVE.equals(colName)) { + if ( m_moveOption.getSelectedKey(m_state) == null ) { + return "move"; + } else { + SectionOption src = new SectionOption(new BigDecimal((String) m_moveOption.getSelectedKey(m_state))); + if (m_option.getSection().equals(src.getSection())) + return "move below here"; + else + return ""; + } } else if (COL_DEL.equals(colName)) { return "delete"; } Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/SectionEditForm.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/SectionEditForm.java 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/SectionEditForm.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -37,7 +37,8 @@ import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.parameters.BigDecimalParameter; -import com.arsdigita.bebop.parameters.NotNullValidationListener; +import com.arsdigita.bebop.parameters.NotEmptyValidationListener; +import com.arsdigita.bebop.parameters.StringIsLettersOrDigitsValidationListener; import com.arsdigita.bebop.parameters.TrimmedStringParameter; import com.arsdigita.camden.cms.contenttypes.DecisionTree; import com.arsdigita.camden.cms.contenttypes.DecisionTreeUtil; @@ -68,10 +69,10 @@ private SaveCancelSection m_saveCancelSection; + public static final String TITLE = "title"; + public static final String PARAMETER_NAME = "parameterName"; + public static final String INSTRUCTIONS = "instructions"; - public static final String TITLE = "title"; - public static final String INSTRUCTIONS = "instructions"; - private static final String INSTRUCTIONS_PARAM = "instructionsParam"; /** @@ -144,15 +145,18 @@ * Add form widgets for a Section. */ protected void addWidgets() { - add(new Label(DecisionTreeUtil - .globalize("form_label.title"))); - TextField titleWidget = new TextField( - new TrimmedStringParameter(TITLE)); - titleWidget.addValidationListener(new NotNullValidationListener()); + add(new Label(DecisionTreeUtil.globalize("form_label.title"))); + TextField titleWidget = new TextField(new TrimmedStringParameter(TITLE)); + titleWidget.addValidationListener(new NotEmptyValidationListener()); add(titleWidget); - add(new Label(DecisionTreeUtil - .globalize("form_label.instructions")), + add(new Label(DecisionTreeUtil.globalize("form_label.parameter_name"))); + TextField parameterWidget = new TextField(new TrimmedStringParameter(PARAMETER_NAME)); + parameterWidget.addValidationListener(new NotEmptyValidationListener()); + parameterWidget.addValidationListener(new StringIsLettersOrDigitsValidationListener()); + add(parameterWidget); + + add(new Label(DecisionTreeUtil.globalize("form_label.instructions")), ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH); CMSDHTMLEditor textWidget = new CMSDHTMLEditor(new TrimmedStringParameter(INSTRUCTIONS)); @@ -174,7 +178,6 @@ FormData data = event.getFormData(); m_selInstructions.setSelectedObject(state,null); - if ( m_selSection.getSelectedKey(state) != null ) { BigDecimal id = new BigDecimal(m_selSection .getSelectedKey(state).toString()); @@ -183,6 +186,7 @@ TreeSection section = new TreeSection(id); data.put(TITLE, section.getTitle()); + data.put(PARAMETER_NAME, section.getParameterName()); TextAsset t = section.getInstructions(); if ( t != null ) { @@ -245,7 +249,8 @@ tree.addSection(section); } - section.setTitle((String)data.get(TITLE)); + section.setTitle((String) data.get(TITLE)); + section.setParameterName((String) data.get(PARAMETER_NAME)); // get the text asset TextAsset textAsset = (TextAsset)m_selInstructions.getSelectedObject(state); Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/TargetDeleteForm.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/TargetDeleteForm.java 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/TargetDeleteForm.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -33,7 +33,7 @@ import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.camden.cms.contenttypes.DecisionTreeUtil; -import com.arsdigita.camden.cms.contenttypes.SectionTarget; +import com.arsdigita.camden.cms.contenttypes.OptionTarget; import com.arsdigita.cms.ItemSelectionModel; /** @@ -85,7 +85,7 @@ BigDecimal id = new BigDecimal(m_selTarget .getSelectedKey(state).toString()); - SectionTarget target = new SectionTarget(id); + OptionTarget target = new OptionTarget(id); m_targetMatchValue.setLabel(target.getMatchOption().getLabel(), state); } @@ -103,7 +103,7 @@ BigDecimal id = new BigDecimal(m_selTarget .getSelectedKey(state).toString()); - SectionTarget target = new SectionTarget(id); + OptionTarget target = new OptionTarget(id); target.delete(); } Modified: aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/TargetEditForm.java =================================================================== --- aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/TargetEditForm.java 2007-09-20 10:15:05 UTC (rev 1675) +++ aplaws/contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/TargetEditForm.java 2007-09-20 14:00:11 UTC (rev 1676) @@ -46,13 +46,13 @@ import com.arsdigita.camden.cms.contenttypes.DecisionTreeUtil; import com.arsdigita.camden.cms.contenttypes.SectionOption; import com.arsdigita.camden.cms.contenttypes.SectionOptionCollection; -import com.arsdigita.camden.cms.contenttypes.SectionTarget; +import com.arsdigita.camden.cms.contenttypes.OptionTarget; import com.arsdigita.camden.cms.contenttypes.TreeSection; import com.arsdigita.camden.cms.contenttypes.TreeSectionCollection; import com.arsdigita.cms.ItemSelectionModel; /** - * Form to edit a SectionTarget for a DecisionTree. + * Form to edit an OptionTarget for a DecisionTree. * * @author Carsten Clasohm * @version $Id$ @@ -75,6 +75,7 @@ public static final String MATCH_OPTION = "matchOption"; public static final String TARGET_URL = "targetURL"; public static final String TARGET_SECTION = "targetSection"; + /** * Constructor. * @@ -209,8 +210,7 @@ if (m_selTarget.getSelectedKey(state) != null) { BigDecimal id = new BigDecimal(m_selTarget.getSelectedKey(state).toString()); - // retrieve the selected SectionTarget from the persistence layer - SectionTarget target = new SectionTarget(id); + OptionTarget target = new OptionTarget(id); data.put(MATCH_OPTION, target.getMatchOption().getID()); data.put(TARGET_URL, target.getTargetURL()); @@ -304,7 +304,7 @@ } /** - * Called after form has been validated. Create the new SectionTarget and + * Called after form has been validated. Create the new OptionTarget and * assign it to the current DecisionTree. */ public void process(FormSectionEvent event) throws FormProcessException { @@ -319,14 +319,14 @@ targetSection = new TreeSection(new BigDecimal(sectionID));... [truncated message content] |
Author: chrisg23 Date: 2007-09-20 13:00:11 +0200 (Thu, 20 Sep 2007) New Revision: 1675 Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/application.xml aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/pdl/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/pdl/uk/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/pdl/uk/gov/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/pdl/uk/gov/westsussex/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/pdl/uk/gov/westsussex/portlet/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/pdl/uk/gov/westsussex/portlet/BookmarksPortlet.pdl aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/oracle-se-create.sql aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/postgres-create.sql aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/upgrade/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/upgrade/oracle-se-1.0.1-1.0.2.sql aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/ccm-wsx-bookmarks-portlet.config aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/ccm-wsx-bookmarks-portlet.load aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Bookmark.java aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarkConstants.java aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarksPortlet.java aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarksPortletConfig.java aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarksPortletConfig_parameter.properties aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Initializer.java aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Loader.java aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Loader_parameter.properties aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarkResources.properties aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarkSelectionModel.java aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksPortletAdder.java aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksPortletEditor.java aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksPortletRenderer.java aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksTable.java aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksTableModelBuilder.java aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/web/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/web/STATIC/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/web/STATIC/portlet/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/web/STATIC/portlet/arrow_bullet.gif aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/web/STATIC/portlet/spacer.gif aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/web/packages/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/web/packages/westsussex-portlets/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/web/packages/westsussex-portlets/xsl/ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/web/packages/westsussex-portlets/xsl/bookmarks-portlet.xsl Log: Bookmarks portlet - display links to content items & external sites Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/application.xml =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/application.xml (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/application.xml 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<ccm:application name="ccm-wsx-bookmarks-portlet" + prettyName="Bookmarks Portlet" + version="1.0.2" + release="1" + webapp="ROOT" + xmlns:ccm="http://ccm.redhat.com/ccm-project"> + + <ccm:dependencies> + <ccm:requires name="ccm-ldn-portal" version="1.4.2"/> + + + </ccm:dependencies> + + + <ccm:contacts> + <ccm:contact uri="http://wsgfl.westsussex.gov.uk" type="website"/> + <ccm:contact uri="mailto:chr...@we..." type="support"/> + </ccm:contacts> + + <ccm:description> + Portlet that allows users to store internal and external links + </ccm:description> +</ccm:application> Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/pdl/uk/gov/westsussex/portlet/BookmarksPortlet.pdl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/pdl/uk/gov/westsussex/portlet/BookmarksPortlet.pdl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/pdl/uk/gov/westsussex/portlet/BookmarksPortlet.pdl 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,81 @@ +// author chris gilbert +// model for a portlet that holds a list of bookmark links + +model uk.gov.westsussex.portlet; + +import com.arsdigita.portal.Portlet; +import com.arsdigita.cms.contenttypes.Link; + +object type BookmarksPortlet extends Portlet { + +} + + +object type Bookmark extends Link { + +} + + +association { + + + component Bookmark[0..n] bookmarks = join portlets.portlet_id to portlet_bookmarks.portlet_id, + join portlet_bookmarks.target_id to cms_links.link_id; + BookmarksPortlet[0..1] portlet = join cms_links.link_id to portlet_bookmarks.target_id, + join portlet_bookmarks.portlet_id to portlets.portlet_id; + + + +} + +data operation swapRelatedLinkWithNextInGroup { + do { + update cms_links + set link_order = CASE WHEN (link_order = :linkOrder) THEN + (:nextLinkOrder) + ELSE + (:linkOrder) + END + where (link_order = :linkOrder or link_order = :nextLinkOrder) + and (select portlet_id from portlet_bookmarks where target_id=link_id) = :ownerID + and 2 = (select count(*) from cms_links l, portlet_bookmarks b + where l.link_id=b.target_id + and (link_order = :linkOrder or link_order = :nextLinkOrder) + and portlet_id = :ownerID) + } +} + +query minRelatedLinkOrderForPortlet { + Integer linkOrder; + + options { + WRAP_QUERIES = false; + } + + do { + select min(link_order) as link_order from cms_links l, portlet_bookmarks b + where b.portlet_id = :ownerID and l.link_id = b.target_id + } map { + linkOrder = link_order; + } +} + +query maxRelatedLinkOrderForPortlet { + Integer linkOrder; + + options { + WRAP_QUERIES = false; + } + + do { + select max(link_order) as link_order from cms_links l, portlet_bookmarks b + where b.portlet_id = :ownerID and l.link_id = b.target_id + } map { + linkOrder = link_order; + } +} + + + + + Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/oracle-se-create.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/oracle-se-create.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/oracle-se-create.sql 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,2 @@ +@ ddl/oracle-se/create.sql +@ ddl/oracle-se/deferred.sql Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/postgres-create.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/postgres-create.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/postgres-create.sql 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,4 @@ +begin; +\i ddl/postgres/create.sql +\i ddl/postgres/deferred.sql +end; Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/upgrade/oracle-se-1.0.1-1.0.2.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/upgrade/oracle-se-1.0.1-1.0.2.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/sql/ccm-wsx-bookmarks-portlet/upgrade/oracle-se-1.0.1-1.0.2.sql 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,14 @@ +update cms_links x +set link_order = nvl((select sort_key + from portlet_bookmarks y + where y.target_id = x.link_id), x.link_order); +commit; + +alter table portlet_bookmarks +drop column sort_key; + +update acs_objects +set object_type = 'uk.gov.westsussex.portlet.Bookmark', + default_domain_class = 'uk.gov.westsussex.portlet.bookmarks.Bookmark' +where object_id in (select target_id + from portlet_bookmarks); \ No newline at end of file Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/ccm-wsx-bookmarks-portlet.config =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/ccm-wsx-bookmarks-portlet.config (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/ccm-wsx-bookmarks-portlet.config 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<registry> + <config class="uk.gov.westsussex.portlet.bookmarks.BookmarksPortletConfig" + storage="ccm-wsx-bookmarks-portlet/bookmarksportlet.properties"/> +</registry> Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/ccm-wsx-bookmarks-portlet.load =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/ccm-wsx-bookmarks-portlet.load (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/ccm-wsx-bookmarks-portlet.load 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,15 @@ +<load> + <requires> + <table name="inits"/> + <table name="acs_objects"/> + <initializer class="com.arsdigita.core.Initializer"/> + </requires> + <provides> + <table name="portlet_bookmarks"/> + <initializer class="uk.gov.westsussex.portlet.bookmarks.Initializer"/> + </provides> + <scripts> + <schema directory="ccm-wsx-bookmarks-portlet"/> + <data class="uk.gov.westsussex.portlet.bookmarks.Loader"/> + </scripts> +</load> Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Bookmark.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Bookmark.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Bookmark.java 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,142 @@ +/* + * Created on 08-Jun-05 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package uk.gov.westsussex.portlet.bookmarks; + +import java.math.BigDecimal; + +import org.apache.log4j.Logger; + +import com.arsdigita.cms.contenttypes.Link; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.DataOperation; +import com.arsdigita.persistence.DataQuery; +import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.Session; +import com.arsdigita.persistence.SessionManager; + +/** + * @author cgyg9330 + * + * Extends link, but has no additional data. Extension is to enable overriding + * of swap methods which don't work in Link - if you delete a link in the middle + * you cannot move links past the resulting gap + * + * + * + */ +public class Bookmark extends Link implements BookmarkConstants{ + + public static String BASE_DATA_OBJECT_TYPE = + "uk.gov.westsussex.portlet.Bookmark"; + private static Logger s_log = Logger.getLogger(Bookmark.class); + + public Bookmark() { + super(BASE_DATA_OBJECT_TYPE); + + } + + public Bookmark(DataObject data) { + super(data); + } + + public Bookmark( OID id ) + throws DataObjectNotFoundException { + super( id ); + } + + public Bookmark( BigDecimal id ) + throws DataObjectNotFoundException { + this( new OID( BASE_DATA_OBJECT_TYPE, id ) ); + } + /** + * Swaps this <code>Bookmark</code> with the next one, + * according to the linkOrder + */ + public void swapWithNext() { + s_log.debug("Start - swapWithNext"); + swapWithNext( + "uk.gov.westsussex.portlet.minRelatedLinkOrderForPortlet", + "uk.gov.westsussex.portlet.swapRelatedLinkWithNextInGroup"); + } + + /** + * Swaps this <code>Bookmark</code> with the previous one, + * according to the linkOrder + */ + public void swapWithPrevious() { + s_log.debug("Start - swapWithPrevious"); + swapWithPrevious( + "uk.gov.westsussex.portlet.maxRelatedLinkOrderForPortlet", + "uk.gov.westsussex.portlet.swapRelatedLinkWithNextInGroup"); + } + + /** + * Given a dataquery name, returns the (possibly filtered) + * DataQuery for use in swapKeys. This implementation filters + * on the <code>portlet</code> property, so that only + * Bookmarks which belong to the same <code>BookmarksPortlet</code> + * will be swapped. + * + * @param queryName name of the DataQuery to use + * @return the DataQuery + */ + protected DataQuery getSwapQuery(String queryName) { + DataQuery query = super.getSwapQuery(queryName); + BigDecimal portletID = + BookmarksPortlet.getPortletForBookmark(this).getID(); + s_log.debug("setting owner in swapquerie as " + portletID); + query.setParameter("ownerID", portletID); + return query; + } + + /** + * Given a data operation name, returns the + * DataOperation for use in swapKeys. This implementation sets the + * portlet parameter, in addition to what is set by + * super.getSwapOperation + * + * @param operationName the Name of the DataOperation to use + * + * @return the DataOperation used to swap the sort keys. + */ + protected DataOperation getSwapOperation(String operationName) { + DataOperation operation = super.getSwapOperation(operationName); + BigDecimal portletID = + BookmarksPortlet.getPortletForBookmark(this).getID(); + s_log.debug("setting owner in swapoperation as " + portletID); + + operation.setParameter("ownerID", portletID); + return operation; + } + + /** + * This method is only used for setting initial sort keys for + * links which exist without them. This is called by swapKeys + * instead of attempting to swap if the key found is + * null. This implementation sorts all Bookmarks owned by this + * Bookmark's portlet by title. + */ + protected void alphabetize() { + Session session = SessionManager.getSession(); + DataCollection links = session.retrieve(BASE_DATA_OBJECT_TYPE); + links.addEqualsFilter( PORTLET + ".id", BookmarksPortlet.getPortletForBookmark(this).getID()); + links.addOrder(TITLE); + int sortKey = 0; + while (links.next()) { + sortKey++; + Link link = new Bookmark(links.getDataObject()); + link.setOrder(sortKey); + link.save(); + } + + } + + + +} Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarkConstants.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarkConstants.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarkConstants.java 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,63 @@ +/* + * Created on 10-Sep-04 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package uk.gov.westsussex.portlet.bookmarks; + +import com.arsdigita.bebop.Label; +import com.arsdigita.globalization.GlobalizedMessage; + +/** + * @author cgyg9330 + * + * Constants used by classes in the bookmarksportlet application. + * + */ + +public interface BookmarkConstants { + + public static final String BUNDLE_NAME = "uk.gov.westsussex.portlet.bookmarks.ui.BookmarkResources"; + + + // bookmark portlet attributes + public static final String BOOKMARKS = "bookmarks"; + public static final String PORTLET = "portlet"; + public static final String SORT_KEY = "sortKey"; + + // bookmark attribute values (nb target types defined in com.arsdigita.cms.contenttypes.Link used + + public static final String NEW_WINDOW_YES = "_blank"; + public static final String NEW_WINDOW_NO = null; + + + // rendering + + public static final String XML_BOOKMARK_NS = "http://wsgfl.westsussex.gov.uk/portlet/bookmarks/1.0"; + public static final String MAIN_BOOKMARK_PORTLET_ELEMENT = "portlet:bookmarks"; + public static final String BOOKMARK_ELEMENT = "bookmark-portlet:bookmark"; + public static final String TITLE_ATTRIBUTE = "title"; + public static final String URL_ATTRIBUTE = "url"; + public static final String WINDOW_ATTRIBUTE = "target-window"; + + + // editing + + public static final String NO_BOOKMARKS_YET = (String)new GlobalizedMessage("bookmarks.header.no-bookmarks", BUNDLE_NAME).localize(); + public static final String EXISTING_BOOKMARKS = (String)new GlobalizedMessage("bookmarks.header.existing-bookmarks", BUNDLE_NAME).localize(); + public static final String NEW_WINDOW = (String)new GlobalizedMessage("bookmarks.new-window", BUNDLE_NAME).localize(); + public static final Label ADD_NEW_BOOKMARK_LABEL = new Label((String)new GlobalizedMessage("bookmarks.add", BUNDLE_NAME).localize(), Label.BOLD); + public static final Label TITLE_LABEL = new Label((String)new GlobalizedMessage("bookmarks.title", BUNDLE_NAME).localize(), Label.BOLD); + public static final Label DESCRIPTION_LABEL = new Label((String)new GlobalizedMessage("bookmarks.description", BUNDLE_NAME).localize(), Label.BOLD); + public static final Label URL_LABEL = new Label((String)new GlobalizedMessage("bookmarks.url", BUNDLE_NAME).localize(), Label.BOLD); + + // errors + + public static final String NO_URL = (String)new GlobalizedMessage("bookmarks.error.no-url", BUNDLE_NAME).localize(); + public static final String NO_TITLE = (String)new GlobalizedMessage("bookmarks.error.no-title", BUNDLE_NAME).localize(); + public static final String CONTENT_ITEM_NOT_FOUND = (String)new GlobalizedMessage("bookmarks.error.content-item-not-found", BUNDLE_NAME).localize(); + public static final String CONTENT_ITEM_NOT_AVAILABLE = (String)new GlobalizedMessage("bookmarks.warning.item-not-available", BUNDLE_NAME).localize(); + + +} Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarksPortlet.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarksPortlet.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarksPortlet.java 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,204 @@ +/* + * Created on 30-Sep-03 + * + * + */ +package uk.gov.westsussex.portlet.bookmarks; + +import org.apache.log4j.Logger; + +import uk.gov.westsussex.portlet.bookmarks.ui.BookmarksPortletRenderer; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.portal.AbstractPortletRenderer; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.SecurityManager; +import com.arsdigita.cms.contenttypes.Link; +import com.arsdigita.cms.dispatcher.ItemResolver; +import com.arsdigita.cms.dispatcher.MultilingualItemResolver; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.Party; +import com.arsdigita.kernel.permissions.PermissionService; +import com.arsdigita.kernel.permissions.PrivilegeDescriptor; +import com.arsdigita.persistence.DataAssociation; +import com.arsdigita.persistence.DataAssociationCursor; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.Filter; +import com.arsdigita.persistence.FilterFactory; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.portal.Portlet; +import com.arsdigita.web.URL; + +/** + * @author cgyg9330 + * + * displays a collection of links, that may be internal or external + * + */ +public class BookmarksPortlet extends Portlet implements BookmarkConstants { + + public static final Logger s_log = Logger.getLogger(BookmarksPortlet.class); + + public static final String BASE_DATA_OBJECT_TYPE = + "uk.gov.westsussex.portlet.BookmarksPortlet"; + + private static BookmarksPortletConfig s_config = + new BookmarksPortletConfig(); + + static { + s_config.load(); + } + + public static BookmarksPortletConfig getConfig() { + return s_config; + } + + public BookmarksPortlet(DataObject dataObject) { + super(dataObject); + } + + protected String getBaseDataObjectType() { + return BASE_DATA_OBJECT_TYPE; + } + + protected AbstractPortletRenderer doGetPortletRenderer() { + return new BookmarksPortletRenderer(this); + + } + /** + * associate a Bookmark with this portlet and place it after existing Bookmarks + * @param bookmark + */ + public void addBookmark(Bookmark bookmark) { + DataAssociationCursor bookmarks = + ((DataAssociation) get(BOOKMARKS)).cursor(); + bookmarks.addOrder(Link.ORDER + " desc"); + int key = 1; + if (bookmarks.next()) { + key = ((Integer) bookmarks.get(Link.ORDER)).intValue() + 1; + + } + bookmarks.close(); + bookmark.setOrder(key); + add(BOOKMARKS, bookmark); + + } + + /** + * return a url for an internal or external link - used for displaying the link in edit view + * (we don't want to just display an item id when the link is internal as that doesn't + * mean anything to non authors) + * @param link + * @param state + * @return + */ + public static String getURIForBookmark(Bookmark bookmark, PageState state) { + String url = null; + + if (bookmark.getTargetType().equals(Link.EXTERNAL_LINK)) { + url = bookmark.getTargetURI(); + } else { + + ItemResolver resolver = new MultilingualItemResolver(); + ContentItem item = bookmark.getTargetItem(); + if (item != null) { + item = item.getLiveVersion(); + if (item != null) { + + url = + resolver.generateItemURL( + state, + item, + item.getContentSection(), + ContentItem.LIVE); + url = URL.there(state.getRequest(), url).toString(); + } + + } + + } + return url; + } + + /** + * Retrieve the bookmarks for this portlet in their correct order + * @return + */ + public DataCollection getBookmarks() { + + DataAssociationCursor cursor = + ((DataAssociation) get(BOOKMARKS)).cursor(); + cursor.addOrder(Link.ORDER); + if (getConfig().checkPermissions()) { + + Party party = Kernel.getContext().getParty(); + if (party == null) { + party = Kernel.getPublicUser(); + } + + FilterFactory factory = cursor.getFilterFactory(); + /* cursor.addFilter(PermissionService.getFilterQuery(factory, "targetItem", + PrivilegeDescriptor.get(SecurityManager.CMS_READ_ITEM), + party.getOID()));*/ + + // need to or it here so that we don't exclude external links + Filter filter = + factory.or().addFilter( + factory.equals("targetItem", null)).addFilter( + PermissionService.getFilterQuery( + factory, + "targetItem", + PrivilegeDescriptor.get(SecurityManager.CMS_READ_ITEM), + party.getOID())); + // this extra and 1=1 is a fiddle to ensure the query is bracketed properly. + // I needed it to be + // 'get links for this portlet and ((link is not a content item) or (user has access to item))' + // but just adding the or filter produced + // 'get links for this portlet and (link is not a content item) or (user has access to item)' + // with the result that all content item links were returned regardless of which portlet they belonged to + cursor.addFilter(factory.and().addFilter(filter).addFilter("1=1")); + + } + + return cursor; + } + + /** + * + * Return the owner of the given bookmark + * + * @param bookmark + * @return + */ + public static BookmarksPortlet getPortletForBookmark(Bookmark bookmark) { + // what the hell's this????? bookmark <-> portlet is a two way association + // so we should be using the association programatically to get the portlet + // Never mind, I'm sure it boils down to the same sql anyway + DataCollection portlets = + SessionManager.getSession().retrieve( + BookmarksPortlet.BASE_DATA_OBJECT_TYPE); + portlets.addEqualsFilter(BOOKMARKS, bookmark.getID()); + BookmarksPortlet portlet = null; + while (portlets.next()) { + portlet = new BookmarksPortlet(portlets.getDataObject()); + } + return portlet; + + } + + public void renumberBookmarks() { + DataCollection bookmarks = getBookmarks(); + bookmarks.addOrder(Link.ORDER); + int sortKey = 0; + while (bookmarks.next()) { + sortKey++; + Bookmark link = new Bookmark(bookmarks.getDataObject()); + link.setOrder(sortKey); + + } + + } +} + + Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarksPortletConfig.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarksPortletConfig.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarksPortletConfig.java 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM Public + * License (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of + * the License at http://www.redhat.com/licenses/ccmpl.html + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + */ + +package uk.gov.westsussex.portlet.bookmarks; + +import com.arsdigita.runtime.AbstractConfig; +import com.arsdigita.util.parameter.BooleanParameter; +import com.arsdigita.util.parameter.Parameter; + +/** + * Configuration allows links to be access controlled (so homepage admin can add + * links that only selected users can see). + * + * + * @author Chris Gilbert <chr...@we...> + * @version $Id: BookmarksPortletConfig.java,v 1.2 2007/08/08 09:28:26 cgyg9330 + * Exp $ + */ +public class BookmarksPortletConfig extends AbstractConfig { + public final static String versionId = "$Id: BookmarksPortletConfig.java,v 1.2 2007/08/08 09:28:26 cgyg9330 Exp $" + + "$Author: cgyg9330 $" + "$DateTime: 2004/03/18 11:10:20 $"; + + private BooleanParameter checkPermissions = new BooleanParameter( + "uk.gov.westsussex.portlet.bookmarks.checkPermissions", + Parameter.REQUIRED, new Boolean(false)); + + public BookmarksPortletConfig() { + + register(checkPermissions); + loadInfo(); + } + + public boolean checkPermissions() { + return ((Boolean) get(checkPermissions)).booleanValue(); + } + +} Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarksPortletConfig_parameter.properties =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarksPortletConfig_parameter.properties (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/BookmarksPortletConfig_parameter.properties 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,4 @@ +uk.gov.westsussex.portlet.bookmarks.checkPermissions.title=Check for access to bookmarks +uk.gov.westsussex.portlet.bookmarks.checkPermissions.purpose=allow home page admin to create links which only certain users can see +uk.gov.westsussex.portlet.bookmarks.checkPermissions.example=false +uk.gov.westsussex.portlet.bookmarks.checkPermissions.format=[boolean] Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Initializer.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Initializer.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Initializer.java 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,92 @@ +package uk.gov.westsussex.portlet.bookmarks; + +import uk.gov.westsussex.portlet.bookmarks.ui.BookmarksPortletAdder; +import uk.gov.westsussex.portlet.bookmarks.ui.BookmarksPortletEditor; + +import com.arsdigita.bebop.RequestLocal; +import com.arsdigita.db.DbHelper; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.kernel.ACSObjectInstantiator; +import com.arsdigita.kernel.ResourceType; +import com.arsdigita.kernel.ResourceTypeConfig; +import com.arsdigita.kernel.ui.ResourceConfigFormSection; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.pdl.ManifestSource; +import com.arsdigita.persistence.pdl.NameFilter; +import com.arsdigita.portal.PortletType; +import com.arsdigita.runtime.CompoundInitializer; +import com.arsdigita.runtime.DomainInitEvent; +import com.arsdigita.runtime.PDLInitializer; +import com.arsdigita.runtime.RuntimeConfig; + +/** + * based on com.arsdigita.london.portal.installer.portlet + */ +public class Initializer extends CompoundInitializer { + public final static String versionId = + "$Id: Initializer.java,v 1.3 2005/06/08 14:45:43 cgyg9330 Exp $" + + "$Author: cgyg9330 $" + + "$DateTime: 2004/03/02 06:33:42 $"; + + + public Initializer() { + final String url = RuntimeConfig.getConfig().getJDBCURL(); + final int database = DbHelper.getDatabaseFromURL(url); + + add( + new PDLInitializer( + new ManifestSource( + "ccm-wsx-bookmarks-portlet.pdl.mf", + new NameFilter( + DbHelper.getDatabaseSuffix(database), + "pdl")))); + } + + public void init(DomainInitEvent e) { + super.init(e); + + e + .getFactory() + .registerInstantiator( + BookmarksPortlet.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + public DomainObject doNewInstance(DataObject dataObject) { + return new BookmarksPortlet(dataObject); + } + }); + + e.getFactory().registerInstantiator( + Bookmark.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + public DomainObject doNewInstance(DataObject dataObject) { + return new Bookmark(dataObject); + } + }); + + new ResourceTypeConfig(BookmarksPortlet.BASE_DATA_OBJECT_TYPE) { + public ResourceConfigFormSection getCreateFormSection( + final ResourceType resType, + final RequestLocal parentAppRL) { + + final ResourceConfigFormSection config = + new BookmarksPortletAdder(resType, parentAppRL); + + return config; + } + + public ResourceConfigFormSection getModifyFormSection(final RequestLocal application) { + final BookmarksPortletEditor config = + new BookmarksPortletEditor(application); + + return config; + } + }; + + + /** + * implementation of framework that allows portlets to be bundled up as discrete applications + */ + PortletType.registerXSLFile(BookmarksPortlet.BASE_DATA_OBJECT_TYPE, "/packages/westsussex-portlets/xsl/bookmarks-portlet.xsl"); + + } +} \ No newline at end of file Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Loader.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Loader.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Loader.java 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,49 @@ +package uk.gov.westsussex.portlet.bookmarks; + +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelExcursion; +import com.arsdigita.loader.PackageLoader; +import com.arsdigita.portal.PortletType; +import com.arsdigita.runtime.ScriptContext; +import com.arsdigita.util.parameter.Parameter; +import com.arsdigita.util.parameter.StringParameter; + + +/** + * Just create the portlet type - includes Load parameter (that can be + * set via interactive load) for the type name, though this can be + * changed in the DB later if required in application_types table + * + * @author cgyg9330 + * + */ +public class Loader extends PackageLoader { + public final static String versionId = + "$Id: Loader.java,v 1.1 2005/02/25 08:41:56 cgyg9330 Exp $" + + "$Author: cgyg9330 $" + + "$DateTime: 2004/03/02 06:33:42 $"; + + + private StringParameter typeName = new StringParameter + ("uk.gov.westsussex.portlet.bookmarks.name", + Parameter.REQUIRED, "My Links"); + + public Loader() { + register(typeName); + + } + public void run(final ScriptContext ctx) { + new KernelExcursion() { + public void excurse() { + setEffectiveParty(Kernel.getSystemParty()); + PortletType type = PortletType + .createPortletType((String)get(typeName), + PortletType.WIDE_PROFILE, + BookmarksPortlet.BASE_DATA_OBJECT_TYPE); + type.setDescription("Allows users to maintain a list of internal and external links"); + } + }.run(); + } + + +} Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Loader_parameter.properties =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Loader_parameter.properties (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/Loader_parameter.properties 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,5 @@ +uk.gov.westsussex.portlet.bookmarks.name.title=Portlet Type Name +uk.gov.westsussex.portlet.bookmarks.name.purpose=The name of the portlet type that appears in the drop down list of portlet types +uk.gov.westsussex.portlet.bookmarks.name.example=Bookmarks +uk.gov.westsussex.portlet.bookmarks.name.format=[string] + Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarkResources.properties =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarkResources.properties (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarkResources.properties 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,12 @@ +bookmarks.header.no-bookmarks=No links defined yet +bookmarks.header.existing-bookmarks=Existing links (check to delete) +bookmarks.new-window=open in a new window +bookmarks.add=Specify the full address (starting http://) - you can cut and paste addresses from this site: +bookmarks.description=Description: +bookmarks.title=Title: +bookmarks.url=URL: +bookmarks.error.no-url=Please enter a url +bookmarks.error.no-title=Please enter a title for the link +bookmarks.error.content-item-not-found=Page could not be found on this site +bookmarks.warning.item-not-available=Page not currently available on this site + Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarkSelectionModel.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarkSelectionModel.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarkSelectionModel.java 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM Public + * License (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the + * License at http://www.redhat.com/licenses/ccmpl.html. + * + * Software distributed under the License is distributed on an + * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express + * or implied. See the License for the specific language + * governing rights and limitations under the License. + * + */ +package uk.gov.westsussex.portlet.bookmarks.ui; + +import uk.gov.westsussex.portlet.bookmarks.Bookmark; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.parameters.BigDecimalParameter; +import com.arsdigita.kernel.ui.ACSObjectSelectionModel; +/** + * SelectionModel to track the current Bookmark object for view/edit purposes. - copied from authoring ui + * Bit pointless really - it just saves a bit of casting. Just as easy to use ACSObjectSelectionModel direct + */ +public class BookmarkSelectionModel extends ACSObjectSelectionModel { + + public BookmarkSelectionModel(BigDecimalParameter param) { + super(Bookmark.class.getName(), + Bookmark.BASE_DATA_OBJECT_TYPE, + param); + } + + /** + * Construct a new <code>BookmarkSelectionModel</code> + * + * @param itemClass The name of the Java class which represents + * the content item. Must be a subclass of Link. In + * addition, the class must have a constructor with a single + * OID parameter. + * @param objectType The name of the persistence metadata object type + * which represents the content item. In practice, will often be + * the same as the itemClass. + * @param parameter The state parameter which should be used by this item + */ + public BookmarkSelectionModel(String itemClass, String objectType, + BigDecimalParameter parameter) { + super(itemClass, objectType, parameter); + } + + /** + * Returns the currently-selected Bookmark + * + * @param state the PageState for the current request. + * @return The current Bookmark + */ + public Bookmark getSelectedLink(PageState state) { + return (Bookmark)getSelectedObject(state); + } +} Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksPortletAdder.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksPortletAdder.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksPortletAdder.java 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,60 @@ +/* + * Created on 10-Sep-04 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package uk.gov.westsussex.portlet.bookmarks.ui; + +import uk.gov.westsussex.portlet.bookmarks.BookmarkConstants; + +import com.arsdigita.bebop.ColumnPanel; +import com.arsdigita.bebop.HorizontalLine; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.RequestLocal; +import com.arsdigita.bebop.portal.PortletConfigFormSection; +import com.arsdigita.kernel.ResourceType; + +/** + * @author cgyg9330 + * + * Adder creates a new bookmarks portlet without any bookmarks + * + * Note this is the only portlet I have seen where a different form is registered for adding and editing. + * + * It is necessary here because we need to create a persistent portlet instance before we can + * associate links with it. + */ +public class BookmarksPortletAdder + extends PortletConfigFormSection + implements BookmarkConstants { + + + public BookmarksPortletAdder( + ResourceType resType, + RequestLocal parentAppRL) { + super(resType, parentAppRL); + } + + + protected void addWidgets() { + + /*add( + new Label( + "Create links to your favourite websites or pages on this site. Specify the full address (starting http://) - you can cut and paste addresses from this site.", + Label.BOLD), + ColumnPanel.FULL_WIDTH);*/ + super.addWidgets(); + add(new HorizontalLine(), ColumnPanel.FULL_WIDTH); + + add( + new Label( + "Give the portlet a title and save it now, then edit it to add bookmarks.", + Label.BOLD), + ColumnPanel.FULL_WIDTH); + add(new HorizontalLine(), ColumnPanel.FULL_WIDTH); + + + } + +} Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksPortletEditor.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksPortletEditor.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksPortletEditor.java 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,339 @@ +/* + * Created on 10-Sep-04 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package uk.gov.westsussex.portlet.bookmarks.ui; + +import java.net.MalformedURLException; +import java.util.StringTokenizer; +import java.util.TooManyListenersException; + +import org.apache.log4j.Logger; + +import uk.gov.westsussex.portlet.bookmarks.Bookmark; +import uk.gov.westsussex.portlet.bookmarks.BookmarkConstants; +import uk.gov.westsussex.portlet.bookmarks.BookmarksPortlet; + +import com.arsdigita.bebop.ColumnPanel; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.HorizontalLine; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.RequestLocal; +import com.arsdigita.bebop.event.PrintEvent; +import com.arsdigita.bebop.event.PrintListener; +import com.arsdigita.bebop.form.CheckboxGroup; +import com.arsdigita.bebop.form.Option; +import com.arsdigita.bebop.form.TextField; +import com.arsdigita.bebop.parameters.BigDecimalParameter; +import com.arsdigita.bebop.parameters.NotNullValidationListener; +import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.bebop.portal.PortletConfigFormSection; +import com.arsdigita.bebop.portal.PortletSelectionModel; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ContentSection; +import com.arsdigita.cms.ContentSectionCollection; +import com.arsdigita.cms.SecurityManager; +import com.arsdigita.cms.contenttypes.Link; +import com.arsdigita.cms.dispatcher.CMSDispatcher; +import com.arsdigita.cms.dispatcher.ItemResolver; +import com.arsdigita.portal.Portlet; +import com.arsdigita.util.UncheckedWrapperException; +import com.arsdigita.web.Application; +import com.arsdigita.web.URL; +import com.arsdigita.web.Web; + +/** + * @author cgyg9330 + * + * Allows definition of new bookmarks to add to the portlet, and edit, move, deletion of existing bookmarks + */ +public class BookmarksPortletEditor + extends PortletConfigFormSection + implements BookmarkConstants { + + private TextField m_title; + private TextField m_description; + private TextField m_url; + private CheckboxGroup m_newWindow; + + private BookmarksTable m_existingBookmarks; + private BigDecimalParameter m_selectedBookmark; + private BookmarkSelectionModel m_bookmarkSelectionModel; + private BigDecimalParameter m_selectedPortlet; + private PortletSelectionModel m_portletSelectionModel; + + + /** + * store item in requestlocal for access by various methods + * + * code copied from content item portlet - > may be problems when items + * unpublished - check + */ + private RequestLocal contentItem = new RequestLocal() { + protected Object initialValue(PageState ps) { + String userURL = (String) m_url.getValue(ps); + java.net.URL contextURL; + try { + contextURL = + new java.net.URL( + Web.getRequest().getRequestURL().toString()); + } catch (MalformedURLException ex) { + throw new UncheckedWrapperException(ex); + } + + java.net.URL url; + try { + url = new java.net.URL(contextURL, userURL); + } catch (MalformedURLException ex) { + s_log.info("Malformed URL " + userURL); + return null; + } + + String dp = URL.getDispatcherPath(); + String path = url.getPath(); + if (path.startsWith(dp)) { + path = path.substring(dp.length()); + } + + StringTokenizer tok = new StringTokenizer(path, "/"); + if (!tok.hasMoreTokens()) { + s_log.info( + "Couldn't find a content section for " + + path + + " in " + + userURL); + return null; + } + + String sectionPath = '/' + tok.nextToken() + '/'; + + String context = ContentItem.LIVE; + if (tok.hasMoreTokens() + && CMSDispatcher.PREVIEW.equals(tok.nextToken())) { + + context = CMSDispatcher.PREVIEW; + } + + ContentSectionCollection sections = ContentSection.getAllSections(); + sections.addEqualsFilter(Application.PRIMARY_URL, sectionPath); + + ContentSection section; + if (sections.next()) { + section = sections.getContentSection(); + sections.close(); + } else { + s_log.info( + "Content section " + + sectionPath + + " in " + + userURL + + " doesn't exist."); + return null; + } + + ItemResolver resolver = section.getItemResolver(); + + path = path.substring(sectionPath.length()); + + if (path.endsWith(".jsp")) { + path = path.substring(0, path.length() - 4); + } + + ContentItem item = resolver.getItem(section, path, context); + if (item == null) { + s_log.debug("Couldn't resolve item " + path); + return null; + } + + SecurityManager sm = new SecurityManager(item.getContentSection()); + + boolean canRead = + sm.canAccess( + ps.getRequest(), + SecurityManager.PUBLIC_PAGES, + item); + if (!canRead) { + s_log.debug("User not allowed access to item"); + return null; + + } + + return item.getDraftVersion(); + } + }; + + private static final Logger s_log = + Logger.getLogger(BookmarksPortletEditor.class); + + + public BookmarksPortletEditor(RequestLocal application) { + super(application); + } + + + /** + * register the parameter that records the current selected bookmark + */ + public void register (Page p) { + super.register(p); + p.addComponentStateParam(this, m_selectedBookmark); + p.addComponentStateParam(this, m_selectedPortlet); + } + + protected void addWidgets() { + // create widgets + m_url = new TextField(new StringParameter(Link.TARGET_URI)); + m_url.addValidationListener(new NotNullValidationListener()); + + m_title = new TextField(new StringParameter(Link.DISPLAY_NAME)); + m_title.addValidationListener(new NotNullValidationListener()); + + m_description = new TextField(new StringParameter(Link.DESCRIPTION)); + + m_newWindow = new CheckboxGroup(Link.TARGET_WINDOW); + m_newWindow.addOption(new Option(NEW_WINDOW_YES, NEW_WINDOW)); + + try { + m_newWindow.addPrintListener(new PrintListener() { + + public void prepare(PrintEvent e) { + PageState state = e.getPageState(); + CheckboxGroup newWindow = (CheckboxGroup)e.getTarget(); + if (m_bookmarkSelectionModel.isSelected(state)) { + Link link = m_bookmarkSelectionModel.getSelectedLink(state); + newWindow.setValue(state, link.getTargetWindow()); + + } + + } + }); + } catch (IllegalArgumentException e) { + s_log.warn("exception when trying to set checkbox value", e); + } catch (TooManyListenersException e) { + s_log.warn("exception when trying to set checkbox value", e); + } + + + m_selectedPortlet = new BigDecimalParameter("bookmark_portlet"); + m_portletSelectionModel = new PortletSelectionModel(m_selectedPortlet); + m_selectedBookmark = new BigDecimalParameter("bookmark"); + m_bookmarkSelectionModel = new BookmarkSelectionModel("uk.gov.westsussex.portlet.bookmarks.Bookmark", Bookmark.BASE_DATA_OBJECT_TYPE, m_selectedBookmark); + m_existingBookmarks = new BookmarksTable(m_bookmarkSelectionModel, m_portletSelectionModel); + + super.addWidgets(); + + add(new HorizontalLine(), ColumnPanel.FULL_WIDTH); + + + add(m_existingBookmarks, ColumnPanel.FULL_WIDTH); + add(new HorizontalLine(), ColumnPanel.FULL_WIDTH); + + add(ADD_NEW_BOOKMARK_LABEL, ColumnPanel.FULL_WIDTH); + add(TITLE_LABEL, ColumnPanel.RIGHT); + add(m_title); + add(DESCRIPTION_LABEL, ColumnPanel.RIGHT); + add(m_description); + + + add(URL_LABEL, ColumnPanel.RIGHT); + add(m_url); + add(new Label("")); // fill up the left hand column + add(m_newWindow); + + } + + /** + * specify current portlet for reference by table + * + * fill in values if user has selected edit on an existing bookmark + */ + protected void initWidgets(PageState state, Portlet portlet) + throws FormProcessException { + s_log.debug("init widgets - set selected portlet to " + portlet.getOID()); + // set cached version as dirty here rather than during process in case an action link is pressed (eg to move links up/down) + portlet.getPortletRenderer().invalidateCachedVersion(state); + m_portletSelectionModel.setSelectedObject(state, portlet); + super.initWidgets(state, portlet); + if (m_bookmarkSelectionModel.isSelected(state)) { + Bookmark link = m_bookmarkSelectionModel.getSelectedLink(state); + m_url.setValue(state, BookmarksPortlet.getURIForBookmark(link, state)); + m_description.setValue(state, link.getDescription()); + m_title.setValue(state, link.getTitle()); + + } + } + + /** + * Validates url if it looks like it is trying to be a content item but is failing + */ + public void validateWidgets(PageState state, Portlet portlet) + throws FormProcessException { + // m_selectedPortlet.set(state, portlet); + super.validateWidgets(state, portlet); + + String fullUrl = (String) m_url.getValue(state); + s_log.debug("fullURL = " + fullUrl); + + Object item = contentItem.get(state); + URL here = URL.here(state.getRequest(), null); + String thisSite = here.getServerURI(); + s_log.debug("This site is " + thisSite); + if (item == null && fullUrl.indexOf(thisSite) != -1&& fullUrl.indexOf("/ccm/") != -1 && fullUrl.indexOf("/content/") != -1 ) { + // not watertight, but is reasonable check that user is trying to specify a content item on this site + throw new FormProcessException(CONTENT_ITEM_NOT_FOUND); + } + + } + /** + * add new bookmark to portlet, or amend existing one if we are editing a selected bookmark + */ + protected void processWidgets(PageState state, Portlet portlet) + throws FormProcessException { + s_log.debug("START processWidgets"); + super.processWidgets(state, portlet); + + + BookmarksPortlet myportlet = (BookmarksPortlet) portlet; + + String titleText = (String) m_title.getValue(state); + String urlText = (String) m_url.getValue(state); + String descriptionText = (String)m_description.getValue(state); + + ContentItem item = (ContentItem) contentItem.get(state); + String[] newWindowValue = (String[]) m_newWindow.getValue(state); + String newWindow = + newWindowValue == null ? NEW_WINDOW_NO : NEW_WINDOW_YES; + + Bookmark newBookmark; + + if (m_bookmarkSelectionModel.isSelected(state)) { + newBookmark = m_bookmarkSelectionModel.getSelectedLink(state); + + } else { + newBookmark = new Bookmark(); + myportlet.addBookmark(newBookmark); + + } + newBookmark.setTitle(titleText); + newBookmark.setDescription(descriptionText); + newBookmark.setTargetWindow(newWindow); + if (item == null) { + newBookmark.setTargetType(Link.EXTERNAL_LINK); + newBookmark.setTargetURI(urlText); + + } else { + newBookmark.setTargetType(Link.INTERNAL_LINK); + newBookmark.setTargetItem(item); + } + + + m_bookmarkSelectionModel.clearSelection(state); + s_log.debug("END processWidgets"); + } + + +} Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksPortletRenderer.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksPortletRenderer.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksPortletRenderer.java 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,98 @@ +/* + * Created on 10-Sep-04 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package uk.gov.westsussex.portlet.bookmarks.ui; + +import org.apache.log4j.Logger; + +import uk.gov.westsussex.portlet.bookmarks.Bookmark; +import uk.gov.westsussex.portlet.bookmarks.BookmarkConstants; +import uk.gov.westsussex.portlet.bookmarks.BookmarksPortlet; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.portal.AbstractPortletRenderer; +import com.arsdigita.london.portal.ui.PortalConstants; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.xml.Element; + +/** + * @author cgyg9330 + * + * + */ +public class BookmarksPortletRenderer + extends AbstractPortletRenderer + implements BookmarkConstants { + + private BookmarksPortlet portlet; + private static Logger s_log = + Logger.getLogger(BookmarksPortletRenderer.class); + /** + * @param portlet + */ + public BookmarksPortletRenderer(BookmarksPortlet portlet) { + this.portlet = portlet; + + } + + /* (non-Javadoc) + * @see com.arsdigita.bebop.portal.AbstractPortletRenderer#generateBodyXML(com.arsdigita.bebop.PageState, com.arsdigita.xml.Element) + */ + protected void generateBodyXML(PageState state, Element document) { + s_log.debug("START generateBodyXML"); + Element main = + document.newChildElement( + MAIN_BOOKMARK_PORTLET_ELEMENT, + PortalConstants.PORTLET_XML_NS); + DataCollection links = portlet.getBookmarks(); + + while (links.next()) { + Bookmark link = new Bookmark (links.getDataObject()); + String url = BookmarksPortlet.getURIForBookmark(link, state); + if (url != null) { + Element linkElement = createLink(link, state); + main.addContent(linkElement); + } + } + + s_log.debug("END generateBodyXML"); + } + + private Element createLink(Bookmark bookmark, PageState state) { + String url = BookmarksPortlet.getURIForBookmark(bookmark, state); + Element link = new Element(BOOKMARK_ELEMENT, XML_BOOKMARK_NS); + link.addAttribute(TITLE_ATTRIBUTE, bookmark.getTitle()); + link.addAttribute( + URL_ATTRIBUTE, + url); + link.addAttribute(WINDOW_ATTRIBUTE, bookmark.getTargetWindow()); + + return link; + } + /** + * cache key is portlet id + */ + public String getCacheKey(PageState state) { + return portlet.getID().toString(); + + } + + /** + * if we are checking permissions, don't use cache, otherwise refresh when portlet has been edited + */ + public boolean isDirty(PageState state) { + if (!BookmarksPortlet.getConfig().checkPermissions()){ +// if cached version exists then it isn't dirty + // because cached version is dropped whenever the portlet is edited + // (see init method in editor class) + return false; + } else { + return true; + + } + + } +} Added: aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksTable.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksTable.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-bookmarks-portlet/src/uk/gov/westsussex/portlet/bookmarks/ui/BookmarksTable.java 2007-09-20 11:00:11 UTC (rev 1675) @@ -0,0 +1,251 @@ +/* + * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM Public + * License (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the + * License at http://www.redhat.com/licenses/ccmpl.html. + * + * Software distributed under the License is distributed on an + * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express + * or implied. See the License for the specific language + * governing rights and limitations under the License. + * + */ +package uk.gov.westsussex.portlet.bookmarks.ui; + +import java.math.BigDecimal; + +import org.apache.log4j.Logger; + +import uk.gov.westsussex.portlet.bookmarks.Bookmark; +import uk.gov.westsussex.portlet.bookmarks.BookmarksPortlet; + +import com.arsdigita.bebop.Component; +import com.arsdigita.bebop.ControlLink; +import com.arsdigita.bebop.ExternalLink; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.RequestLocal; +import com.arsdigita.bebop.Table; +import com.arsdigita.bebop.event.TableActionEvent; +import com.arsdigita.bebop.event.TableActionListener; +import com.arsdigita.bebop.portal.PortletSelectionModel; +import com.arsdigita.bebop.table.TableCellRenderer; +import com.arsdigita.bebop.table.TableColumn; +import com.arsdigita.bebop.table.TableColumnModel; +import com.arsdigita.cms.contenttypes.ui.LinkTableModelBuilder; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.PersistenceException; +import com.arsdigita.util.Assert; +import com.arsdigita.util.UncheckedWrapperException; + +/** + * Bebop table copied from authoring ui + * + * @version $Revision: 1.2 $ $Date: 2007/08/08 09:28:26 $ + * @author Chris Gilbert + */ + +public class BookmarksTable extends Table { + + private static final Logger s_log = Logger.getLogger(BookmarksTable.class); + private BookmarkSelectionModel m_linkModel; + // private ItemSelectionModel m_itemModel; + private TableColumn m_titleCol; + private TableColumn m_descCol; + private TableColumn m_moveUpCol; + private TableColumn m_moveDownCol; + private TableColumn m_editCol; + private TableColumn m_delCol; + + private RequestLocal m_size; + private PortletSelectionModel m_portlet; + + + protected static final String EDIT_EVENT = "Edit"; + protected static final String DELETE_EVENT = "Delete"; + protected static final String UP_EVENT = "up"; + protected static final String DOWN_EVENT = "down"; + + /** + * Constructor. Creates a <code>BookmarksTable</code> given a + * <code>PortletSelectionModel</code> and a + * <code>BookmarkSelectionModel</code>, which track the current portlet + * and link. + * + * @param item The <code>ItemSelectionModel</code> for the current page. + * @param link The <code>LinkSelectionModel</code> to track the + * current link + */ + public BookmarksTable(BookmarkSelectionModel link, PortletSelectionModel portlet) { + super(); + m_portlet = portlet; + setModelBuilder(new BookmarksTableModelBuilder(portlet)); + + m_linkModel = link; + addColumns(); + + m_size = new RequestLocal(); + + Label empty = new Label("There are no links defined yet"); + setEmptyView(empty); + addTableActionListener(new LinkTableActionListener()); + setRowSelectionModel(m_linkModel); + setDefaultCellRenderer(new LinkTableRenderer());... [truncated message content] |
Author: chrisg23 Date: 2007-09-19 18:00:12 +0200 (Wed, 19 Sep 2007) New Revision: 1673 Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/application.xml aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/pdl/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/pdl/uk/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/pdl/uk/gov/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/pdl/uk/gov/westsussex/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/pdl/uk/gov/westsussex/content-types/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/pdl/uk/gov/westsussex/content-types/Correspondence.pdl aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/add-multiple-contacts.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/remove-contact-column.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/set-contact-ids.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.2-1.0.3/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.2-1.0.3/add-priority-column.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.2-1.0.3/add-priority-table.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/oracle-se-create.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/postgres-create.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.1-1.0.2.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.2-1.0.2a.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.2-1.0.3.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.2a-1.0.2b.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.1-1.0.2.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.2-1.0.2a.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.2-1.0.3.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.2a-1.0.2b.sql aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/content-types/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/content-types/uk/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/content-types/uk/gov/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/content-types/uk/gov/westsussex/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/content-types/uk/gov/westsussex/contenttypes/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/content-types/uk/gov/westsussex/contenttypes/Correspondence.xml aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/traversal-adapters/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/traversal-adapters/uk/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/traversal-adapters/uk/gov/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/traversal-adapters/uk/gov/westsussex/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/traversal-adapters/uk/gov/westsussex/contenttypes/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/traversal-adapters/uk/gov/westsussex/contenttypes/Correspondence.xml aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ccm-wsx-types-school-correspondence.config aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ccm-wsx-types-school-correspondence.load aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ccm-wsx-types-school-correspondence.upgrade aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceConfig.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceConfig_parameter.properties aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceConstants.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceContact.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceInitializer.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceLoader.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondencePriority.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceRecipient.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ManualNotificationSender.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/NotificationSender.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/NotificationSender.java.old2 aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/RetryNotificationSender.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/Scheduler.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/SchedulerTask.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/SchoolCorrespondence.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/SetContacts.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/formatters/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/formatters/ContactFormatter.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/formatters/DateFormatter.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/listeners/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/listeners/CorrespondenceArchiveListener.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/listeners/CorrespondencePublishAndSetDatesListener.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/search/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/search/CorrespondenceMetadataProvider.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ui/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ui/correspondence/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ui/correspondence/ContactPanel.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ui/correspondence/ContactProperties.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ui/correspondence/ContactSearchForm.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ui/correspondence/ContactTableModel.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ui/correspondence/CorrespondenceLabels.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ui/correspondence/CorrespondencePropertiesStep.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ui/correspondence/CorrespondencePropertyForm.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ui/correspondence/CorrespondenceResources.properties aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ui/correspondence/JavascriptOptionsPrintListener.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/ui/correspondence/SelectedContactsTableModel.java aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/web/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/web/static/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/web/static/content-types/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/web/static/content-types/uk/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/web/static/content-types/uk/gov/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/web/static/content-types/uk/gov/westsussex/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/web/static/content-types/uk/gov/westsussex/contenttypes/ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/web/static/content-types/uk/gov/westsussex/contenttypes/Correspondence.xsl Log: Content type for articles that are automatically assigned to navigation according to basic properties, and have an archive phase where they are moved to an archive navigation area. Also weekly email is sent out to selected addresses informing them of the latest articles (we use this for a weekly school correspondence cycle, but it is not specific to schools) Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/application.xml =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/application.xml (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/application.xml 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<ccm:application name="ccm-wsx-types-school-correspondence" + prettyName="Red Hat CCM Content Types" + version="1.0.3" + release="1" + webapp="ROOT" + xmlns:ccm="http://ccm.redhat.com/ccm-project"> + + <ccm:dependencies> + <ccm:requires name="ccm-wsx-ldap" version="1.0.2"/> + <ccm:requires name="ccm-ldn-terms" version="1.0.1"/> + <ccm:requires name="ccm-wsx-custom" version="1.0.2"/> + <ccm:requires name="ccm-wsx-wsgfl-custom" version="1.0.2"/> + + + </ccm:dependencies> + + + + <ccm:contacts> + <ccm:contact uri="http://wsgfl.westsussex.gov.uk" type="website"/> + <ccm:contact uri="mailto:chr...@we..." type="support"/> + </ccm:contacts> + + <ccm:description> + The School Correspondence Content Type for West Sussex Schools + + Version 1.0.2 - added multiple contacts + </ccm:description> + +</ccm:application> Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/pdl/uk/gov/westsussex/content-types/Correspondence.pdl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/pdl/uk/gov/westsussex/content-types/Correspondence.pdl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/pdl/uk/gov/westsussex/content-types/Correspondence.pdl 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,70 @@ +// +// Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +// +// The contents of this file are subject to the CCM Public +// License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the +// License at http://www.redhat.com/licenses/ccmpl.html. +// +// Software distributed under the License is distributed on an +// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express +// or implied. See the License for the specific language governing +// rights and limitations under the License. +// +// $Id: Contact.pdl,v 1.1 2004/12/17 15:55:03 awux7820 Exp $ +// $DateTime: 2004/04/07 16:07:11 $ +model uk.gov.westsussex.contenttypes; + + +import com.arsdigita.cms.ContentPage; +import com.arsdigita.london.terms.Term; +import com.arsdigita.kernel.ACSObject; + +object type SchoolCorrespondence extends ContentPage { + + // add these here as well as assigning object to category so that the values can be retrieved for the properties sheet + Term [0..1] serviceArea = join ct_correspondence.service_area_term to trm_terms.term_id; + Term [0..1] teamArea = join ct_correspondence.team_area_term to trm_terms.term_id; + component CorrespondenceContact [0..n] contacts = join ct_correspondence.item_id to ct_correspondence_contacts.item_id; + Date [0..1] archiveDate = ct_correspondence.archive_date TIMESTAMP; + Date [0..1] deleteDate = ct_correspondence.delete_date TIMESTAMP; + CorrespondencePriority [0..1] priority = join ct_correspondence.priority to ct_correspondence_priority.priority_level; + reference key ( ct_correspondence.item_id ); +} + +object type CorrespondenceContact extends ACSObject { + // should be 1..1, but during upgrade needed to create records without network ids + String [0..1] networkID = ct_correspondence_contacts.network_id VARCHAR(255); + + reference key ( ct_correspondence_contacts.contact_id ); +} + +object type CorrespondencePriority { + + Integer level = ct_correspondence_priority.priority_level INTEGER; + String name = ct_correspondence_priority.priority_name VARCHAR(255); + object key (level); +} + +association { + + CorrespondenceRecipient [0..n] recipients = join ct_correspondence.item_id to ct_corr_recipient_map.item_id, + join ct_corr_recipient_map.recipient to ct_correspondence_recipients.recipient_id; + SchoolCorrespondence [0..n] items = join ct_correspondence_recipients.recipient_id to ct_corr_recipient_map.recipient, + join ct_corr_recipient_map.item_id to ct_correspondence.item_id; + } + +object type CorrespondenceRecipient extends ACSObject { + + String [1..1] mailbookGroupName = ct_correspondence_recipients.mailbook_group VARCHAR(1000); + String [1..1] listName = ct_correspondence_recipients.display_name VARCHAR(1000); + String [0..1] prettyName = ct_correspondence_recipients.pretty_name VARCHAR(1000); + + reference key (ct_correspondence_recipients.recipient_id); + +} + + + + + Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/add-multiple-contacts.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/add-multiple-contacts.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/add-multiple-contacts.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,7 @@ +CREATE TABLE ct_correspondence_contacts + (contact_id NUMBER, + item_id NUMBER, + network_id VARCHAR2(255)); + + + Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/remove-contact-column.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/remove-contact-column.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/remove-contact-column.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,3 @@ +-- run this after restarting first box +alter table ct_correspondence +drop column contact; \ No newline at end of file Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/set-contact-ids.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/set-contact-ids.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.1-1.0.2/set-contact-ids.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,18 @@ +-- run this after program to insert contact records +update ct_correspondence_contacts a +set network_id = (select contact from ct_correspondence b + where b.item_id = a.item_id); + + +delete from object_context where object_id in (select contact_id + from ct_correspondence_contacts + where network_id is null); + +delete from acs_objects where object_id in (select contact_id + from ct_correspondence_contacts + where network_id is null); + +delete from ct_correspondence_contacts +where network_id is null; + + Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.2-1.0.3/add-priority-column.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.2-1.0.3/add-priority-column.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.2-1.0.3/add-priority-column.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,9 @@ +alter table ct_correspondence +add (priority INTEGER); + +alter table ct_correspondence add + constraint ct_correspond_priority_f_tkiyh foreign key (priority) + references ct_correspondence_priority(priority_level); + + + Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.2-1.0.3/add-priority-table.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.2-1.0.3/add-priority-table.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/default/upgrade/1.0.2-1.0.3/add-priority-table.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,15 @@ +create table ct_correspondence_priority ( + priority_level INTEGER not null + constraint ct_corre_pri_pri_level_p_c73o6 + primary key, + priority_name VARCHAR(255) +); + +insert into ct_correspondence_priority (priority_level, priority_name) +values (10, 'urgent'); + +insert into ct_correspondence_priority (priority_level, priority_name) +values (20, 'for action'); + +insert into ct_correspondence_priority (priority_level, priority_name) +values (30, 'for information'); Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/oracle-se-create.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/oracle-se-create.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/oracle-se-create.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,18 @@ +-- +-- Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +-- +-- The contents of this file are subject to the CCM Public +-- License (the "License"); you may not use this file except in +-- compliance with the License. You may obtain a copy of the +-- License at http://www.redhat.com/licenses/ccmpl.html. +-- +-- Software distributed under the License is distributed on an +-- "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express +-- or implied. See the License for the specific language governing +-- rights and limitations under the License. +-- +-- $Id: oracle-se-create.sql,v 1.1 2004/12/17 15:55:02 awux7820 Exp $ +-- $DateTime: 2004/04/07 16:07:11 $ + +@@ ddl/oracle-se/create.sql +@@ ddl/oracle-se/deferred.sql Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/postgres-create.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/postgres-create.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/postgres-create.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,19 @@ +-- +-- Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +-- +-- The contents of this file are subject to the CCM Public +-- License (the "License"); you may not use this file except in +-- compliance with the License. You may obtain a copy of the +-- License at http://www.redhat.com/licenses/ccmpl.html. +-- +-- Software distributed under the License is distributed on an +-- "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express +-- or implied. See the License for the specific language governing +-- rights and limitations under the License. +-- +-- $Id: postgres-create.sql,v 1.1 2004/12/17 15:55:02 awux7820 Exp $ +-- $DateTime: 2004/04/07 16:07:11 $ + +\i ddl/postgres/create.sql +\i ddl/postgres/deferred.sql + Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.1-1.0.2.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.1-1.0.2.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.1-1.0.2.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,24 @@ +-- +-- Copyright (C) 2005 Runtime Collective Ltd. 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-6.3.1-6.3.2.sql 293 2005-02-22 15:10:39Z cgilbert $ +-- $DateTime: 2004/08/16 18:10:38 $ + +PROMPT Red Hat Enterprise ccm-wsx-types-school-correspondence 1.0.1 -> 1.0.2 Upgrade Script (Oracle) + +@@ ../default/upgrade/1.0.1-1.0.2/add-multiple-contacts.sql + Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.2-1.0.2a.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.2-1.0.2a.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.2-1.0.2a.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,24 @@ +-- +-- Copyright (C) 2005 Runtime Collective Ltd. 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-6.3.1-6.3.2.sql 293 2005-02-22 15:10:39Z cgilbert $ +-- $DateTime: 2004/08/16 18:10:38 $ + +PROMPT Red Hat Enterprise ccm-wsx-types-school-correspondence 1.0.1 -> 1.0.2 Upgrade Script (Oracle) + +@@ ../default/upgrade/1.0.1-1.0.2/set-contact-ids.sql + Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.2-1.0.3.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.2-1.0.3.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.2-1.0.3.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,25 @@ +-- +-- Copyright (C) 2005 Runtime Collective Ltd. 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-6.3.1-6.3.2.sql 293 2005-02-22 15:10:39Z cgilbert $ +-- $DateTime: 2004/08/16 18:10:38 $ + +PROMPT Red Hat Enterprise ccm-wsx-types-school-correspondence 1.0.2 -> 1.0.3 Upgrade Script (Oracle) + +@@ ../default/upgrade/1.0.2-1.0.3/add-priority-table.sql +@@ ../default/upgrade/1.0.2-1.0.3/add-priority-column.sql + Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.2a-1.0.2b.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.2a-1.0.2b.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/oracle-se-1.0.2a-1.0.2b.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,24 @@ +-- +-- Copyright (C) 2005 Runtime Collective Ltd. 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-6.3.1-6.3.2.sql 293 2005-02-22 15:10:39Z cgilbert $ +-- $DateTime: 2004/08/16 18:10:38 $ + +PROMPT Red Hat Enterprise ccm-wsx-types-school-correspondence 1.0.1 -> 1.0.2 Upgrade Script (Oracle) + +@@ ../default/upgrade/1.0.1-1.0.2/remove-contact-column.sql + Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.1-1.0.2.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.1-1.0.2.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.1-1.0.2.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,29 @@ +-- +-- 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-6.3.0-6.3.1.sql,v 1.1.2.1 2005/10/04 12:09:52 cgyg9330 Exp $ +-- $DateTime: 2004/08/17 23:15:09 $ + + +\echo Red Hat Enterprise ccm-wsx-types-school-correspondence 1.0.1 -> 1.0.2 Upgrade Script (PostgreSQL) + +begin; + +\i ../default/upgrade/1.0.1-1.0.2/add-multiple-contacts.sql + + +commit; Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.2-1.0.2a.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.2-1.0.2a.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.2-1.0.2a.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,29 @@ +-- +-- 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-6.3.0-6.3.1.sql,v 1.1.2.1 2005/10/04 12:09:52 cgyg9330 Exp $ +-- $DateTime: 2004/08/17 23:15:09 $ + + +\echo Red Hat Enterprise ccm-wsx-types-school-correspondence 1.0.1 -> 1.0.2 Upgrade Script (PostgreSQL) + +begin; + +\i ../default/upgrade/1.0.1-1.0.2/set-contact-ids.sql + + +commit; Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.2-1.0.3.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.2-1.0.3.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.2-1.0.3.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,30 @@ +-- +-- 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-6.3.0-6.3.1.sql,v 1.1.2.1 2005/10/04 12:09:52 cgyg9330 Exp $ +-- $DateTime: 2004/08/17 23:15:09 $ + + +\echo Red Hat Enterprise ccm-wsx-types-school-correspondence 1.0.1 -> 1.0.2 Upgrade Script (PostgreSQL) + +begin; + +\i ../default/upgrade/1.0.2-1.0.3/add-priority-table.sql +\i ../default/upgrade/1.0.2-1.0.3/add-priority-column.sql + + +commit; Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.2a-1.0.2b.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.2a-1.0.2b.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/sql/ccm-wsx-types-school-correspondence/upgrade/postgres-1.0.2a-1.0.2b.sql 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,29 @@ +-- +-- 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-6.3.0-6.3.1.sql,v 1.1.2.1 2005/10/04 12:09:52 cgyg9330 Exp $ +-- $DateTime: 2004/08/17 23:15:09 $ + + +\echo Red Hat Enterprise ccm-wsx-types-school-correspondence 1.0.1 -> 1.0.2 Upgrade Script (PostgreSQL) + +begin; + +\i ../default/upgrade/1.0.1-1.0.2/remove-contact-column.sql + + +commit; Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/content-types/uk/gov/westsussex/contenttypes/Correspondence.xml =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/content-types/uk/gov/westsussex/contenttypes/Correspondence.xml (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/content-types/uk/gov/westsussex/contenttypes/Correspondence.xml 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,33 @@ +<?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="School Correspondence" + description="An item of correspondence for schools" + objectType="uk.gov.westsussex.contenttypes.SchoolCorrespondence" + classname="uk.gov.westsussex.contenttypes.SchoolCorrespondence"> + + <ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate"> + + <ctd:authoring-step + label="Basic Properties" + description="Edit the basic correspondence properties" + descriptionBundle="uk.gov.westsussex.contenttypes.ui.correspondence.CorrespondenceResources" + component="uk.gov.westsussex.contenttypes.ui.correspondence.CorrespondencePropertiesStep" + ordering="1"/> + + <ctd:authoring-step + label="Correspondence Contact" + description="Add the contact" + descriptionBundle="uk.gov.westsussex.contenttypes.ui.correspondence.CorrespondenceResources" + component="uk.gov.westsussex.contenttypes.ui.correspondence.ContactProperties" + ordering="2"/> + + <ctd:authoring-step label="Assign categories" + description="Assign categories" + component="com.arsdigita.cms.ui.authoring.ItemCategoryStep" + ordering="3"/> + + + </ctd:authoring-kit> + </ctd:content-type> +</ctd:content-types> Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/traversal-adapters/uk/gov/westsussex/contenttypes/Correspondence.xml =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/traversal-adapters/uk/gov/westsussex/contenttypes/Correspondence.xml (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/WEB-INF/traversal-adapters/uk/gov/westsussex/contenttypes/Correspondence.xml 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8"?> +<xrd:adapters + xmlns:xrd="http://xmlns.redhat.com/schemas/waf/xml-renderer-rules" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd"> + <!-- + Extend adapter for ContentItemPanel to also output the associated objects. + The default properties for Contact are left as is and are inherited from ContentPage + --> + <xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator"> + <xrd:adapter objectType="uk.gov.westsussex.contenttypes.SchoolCorrespondence" extends="com.arsdigita.cms.ContentPage"> + + <xrd:formatter property="/object/launchDate" + class="uk.gov.westsussex.contenttypes.formatters.DateFormatter"/> + <xrd:formatter property="/object/archiveDate" + class="uk.gov.westsussex.contenttypes.formatters.DateFormatter"/> + <xrd:formatter property="/object/deleteDate" + class="uk.gov.westsussex.contenttypes.formatters.DateFormatter"/> + <xrd:formatter property="/object/contacts/networkID" + class="uk.gov.westsussex.contenttypes.formatters.ContactFormatter"/> + + <xrd:associations rule="include"> + <xrd:property name="/object/recipients"/> + <xrd:property name="/object/serviceArea"/> + <xrd:property name="/object/serviceArea/model"/> + <xrd:property name="/object/teamArea"/> + <xrd:property name="/object/teamArea/model"/> + <xrd:property name="/object/contacts"/> + + </xrd:associations> + </xrd:adapter> + </xrd:context> + + <xrd:context name="uk.gov.westsussex.contenttypes.search.CorrespondenceMetadataProvider"> + <xrd:adapter objectType="uk.gov.westsussex.contenttypes.SchoolCorrespondence"> + + <xrd:attributes rule="exclude"> + <xrd:property name="/object/id"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + <xrd:property name="/object/ancestors"/> + <xrd:property name="/object/version"/> + <xrd:property name="/object/isDeleted"/> + <xrd:property name="/object/type/id"/> + <xrd:property name="/object/type/defaultDomainClass"/> + <xrd:property name="/object/type/objectType"/> + <xrd:property name="/object/type/displayName"/> + <xrd:property name="/object/type/associatedObjectType"/> + <xrd:property name="/object/type/className"/> + <xrd:property name="/object/type/isInternal"/> + <xrd:property name="/object/type/itemFormID"/> + <xrd:property name="/object/textAsset/id"/> + <xrd:property name="/object/textAsset/defaultDomainClass"/> + <xrd:property name="/object/textAsset/objectType"/> + <xrd:property name="/object/textAsset/displayName"/> + <xrd:property name="/object/textAsset/ancestors"/> + <xrd:property name="/object/textAsset/version"/> + <xrd:property name="/object/textAsset/name"/> + <xrd:property name="/object/textAsset/language"/> + <xrd:property name="/object/textAsset/isDeleted"/> + <xrd:property name="/object/dublinCore/id"/> + <xrd:property name="/object/dublinCore/defaultDomainClass"/> + <xrd:property name="/object/dublinCore/objectType"/> + <xrd:property name="/object/dublinCore/displayName"/> + <xrd:property name="/object/dublinCore/isDeleted"/> + <xrd:property name="/object/dublinCore/ancestors"/> + <xrd:property name="/object/dublinCore/version"/> + </xrd:attributes> + <xrd:associations rule="include"> + <xrd:property name="/object/locale"/> + <xrd:property name="/object/type"/> + <xrd:property name="/object/textAsset"/> + <xrd:property name="/object/dublinCore"/> + + </xrd:associations> + </xrd:adapter> + + </xrd:context> + + +</xrd:adapters> Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ccm-wsx-types-school-correspondence.config =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ccm-wsx-types-school-correspondence.config (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ccm-wsx-types-school-correspondence.config 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<registry> + <config class="uk.gov.westsussex.contenttypes.CorrespondenceConfig" + storage="ccm-wsx-types-school-correspondence/correspondence.properties"/> +</registry> Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ccm-wsx-types-school-correspondence.load =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ccm-wsx-types-school-correspondence.load (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ccm-wsx-types-school-correspondence.load 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,19 @@ +<load> + <requires> + <table name="inits"/> + <table name="acs_objects"/> + <table name="cms_items"/> + <initializer class="com.arsdigita.cms.Initializer"/> + </requires> + <provides> + <table name="ct_correspondence"/> + <table name="ct_correspondence_recipients"/> + <table name="ct_correspondence_archive_map"/> + + <initializer class="uk.gov.westsussex.contenttypes.CorrespondenceInitializer"/> + </provides> + <scripts> + <schema directory="ccm-wsx-types-school-correspondence"/> + <data class="uk.gov.westsussex.contenttypes.CorrespondenceLoader"/> + </scripts> +</load> Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ccm-wsx-types-school-correspondence.upgrade =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ccm-wsx-types-school-correspondence.upgrade (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/ccm-wsx-types-school-correspondence.upgrade 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,14 @@ +<upgrade> + <version from="1.0.1" to="1.0.2"> + <script sql="ccm-wsx-types-school-correspondence/upgrade/::database::-1.0.1-1.0.2.sql"/> + </version> + <version from="1.0.2" to="1.0.2a"> + <script sql="ccm-wsx-types-school-correspondence/upgrade/::database::-1.0.2-1.0.2a.sql"/> + </version> + <version from="1.0.2a" to="1.0.2b"> + <script sql="ccm-wsx-types-school-correspondence/upgrade/::database::-1.0.2a-1.0.2b.sql"/> + </version> + <version from="1.0.2" to="1.0.3"> + <script sql="ccm-wsx-types-school-correspondence/upgrade/::database::-1.0.2-1.0.3.sql"/> + </version> +</upgrade> Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceConfig.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceConfig.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceConfig.java 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,182 @@ +/* + * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM Public + * License (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of + * the License at http://www.redhat.com/licenses/ccmpl.html + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + */ + +package uk.gov.westsussex.contenttypes; + +import javax.naming.NamingException; + +import org.apache.log4j.Logger; + +import uk.gov.westsussex.Util; +import uk.gov.westsussex.ldap.LDAPDirectory; +import uk.gov.westsussex.ldap.LDAPUser; + +import com.arsdigita.kernel.security.AccountNotFoundException; +import com.arsdigita.london.terms.Term; +import com.arsdigita.runtime.AbstractConfig; +import com.arsdigita.util.parameter.IntegerParameter; +import com.arsdigita.util.parameter.Parameter; +import com.arsdigita.util.parameter.StringArrayParameter; +import com.arsdigita.util.parameter.StringParameter; + +/** + * Specification of configuration parameters + * + * @author Chris Gilbert <a href="mailto:chr...@we...">chr...@we...</a> + * @version $Id: CorrespondenceConfig.java,v 1.4 2006/01/18 08:39:11 cgyg9330 Exp $ + */ +public class CorrespondenceConfig extends AbstractConfig { + public final static String versionId = + "$Id: CorrespondenceConfig.java,v 1.4 2006/01/18 08:39:11 cgyg9330 Exp $" + + "$Author: cgyg9330 $" + + "$DateTime: 2004/03/18 11:10:20 $"; + + private static final Logger s_log = + Logger.getLogger(CorrespondenceConfig.class); + private static Term navigationTerm = null; + + /** + * groups that appear in the drop down list, and then get used as navigatoin categories. + * + * In the future, may want to make this a : separated list of pairs - + * mail group name and pretty name - use the pretty name for navigation categories + * + */ + private StringArrayParameter mailGroups = + new StringArrayParameter( + "uk.gov.westsussex.contenttypes.correspondence.mailgroups", + Parameter.REQUIRED, + new String[] { "Sch All", "Secondary Sch All", "Special Sch All" }); + + /** + * + * Navigation category called Correspondence that contains by date, archive etc + * + * + */ + private IntegerParameter mainNavTerm = + new IntegerParameter( + "uk.gov.westsussex.contenttypes.correspondence.parent-term", + Parameter.REQUIRED, + null); + /** + * mail addresses to be cc'ed into the mail to schools + */ + private StringArrayParameter ccList = + new StringArrayParameter( + "uk.gov.westsussex.contenttypes.correpondence.cc-list", + Parameter.OPTIONAL, + null); + /** + * network id - user details are looked up in county directory and used + * as signature on email + */ + private StringParameter mailSignatory = + new StringParameter( + "uk.gov.westsussex.contenttypes.correpondence.mail-signatory", + Parameter.OPTIONAL, + null); + // these 4 should be required, but they cannot be present during loading + // as the terms havent been created yet + private IntegerParameter byDate = + new IntegerParameter( + "uk.gov.westsussex.contenttypes.correpondence.by_date_term_id", + Parameter.OPTIONAL, + null); + private IntegerParameter byRecipient = + new IntegerParameter( + "uk.gov.westsussex.contenttypes.correpondence.by_recipient_term_id", + Parameter.OPTIONAL, + null); + private IntegerParameter byContact = + new IntegerParameter( + "uk.gov.westsussex.contenttypes.correpondence.by_contact_term_id", + Parameter.OPTIONAL, + null); + private IntegerParameter archive = + new IntegerParameter( + "uk.gov.westsussex.contenttypes.correpondence.archive_term_id", + Parameter.OPTIONAL, + null); + private IntegerParameter byServiceArea = + new IntegerParameter( + "uk.gov.westsussex.contenttypes.correpondence.by_service_area_term_id", + Parameter.OPTIONAL, + null); + + + public CorrespondenceConfig() { + + register(mailGroups); + register(mainNavTerm); + register(ccList); + register(mailSignatory); + register(byDate); + register(byRecipient); + register(byContact); + register(archive); + register(byServiceArea); + loadInfo(); + } + + public final String[] getMailGroups() { + return (String[]) get(mailGroups); + } + + public final String[] getCCList() { + return (String[]) get(ccList); + } + + public LDAPUser getMailSignatory() { + LDAPUser user = null; + try { + user = + LDAPDirectory.retrieve().getUser((String) get(mailSignatory)); + } catch (AccountNotFoundException e) { + s_log.warn("LDAP User" + get(mailSignatory) + " couldn't be found"); + } catch (NamingException e) { + s_log.warn("Cannot access LDAP Directory"); + + } + + return user; + } + + public final Term getByDateTerm() { + return Util.getNavigationDomain().getTerm((Integer) get(byDate)); + } + public final Term getByRecipientTerm() { + return Util.getNavigationDomain().getTerm((Integer) get(byRecipient)); + } + public final Term getByContactTerm() { + return Util.getNavigationDomain().getTerm((Integer) get(byContact)); + } + public final Term getArchiveTerm() { + return Util.getNavigationDomain().getTerm((Integer) get(archive)); + } + public final Term getByServiceAreaTerm() { + return Util.getNavigationDomain().getTerm((Integer) get(byServiceArea)); + } + + public final Term getMainNavigationTerm() { + if (navigationTerm == null) { + navigationTerm = + Util.getNavigationDomain().getTerm((Integer) get(mainNavTerm)); + } + + return navigationTerm; + } + +} Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceConfig_parameter.properties =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceConfig_parameter.properties (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceConfig_parameter.properties 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,44 @@ +uk.gov.westsussex.contenttypes.correspondence.mailgroups.title=School Mail Groups +uk.gov.westsussex.contenttypes.correspondence.mailgroups.purpose=Mail groups available for correspondence to be sent to +uk.gov.westsussex.contenttypes.correspondence.mailgroups.example=secondary sch all, school all +uk.gov.westsussex.contenttypes.correspondence.mailgroups.format=[string,string,string] + +uk.gov.westsussex.contenttypes.correspondence.parent-term.title=unique Id for correspondence term +uk.gov.westsussex.contenttypes.correspondence.parent-term.purpose=Identify top level navigation term +uk.gov.westsussex.contenttypes.correspondence.parent-term.example=12345 +uk.gov.westsussex.contenttypes.correspondence.parent-term.format=integer + +uk.gov.westsussex.contenttypes.correpondence.mail-signatory.title=UID of mail signatory +uk.gov.westsussex.contenttypes.correpondence.mail-signatory.purpose=Lookup id for email sender +uk.gov.westsussex.contenttypes.correpondence.mail-signatory.example=kfyn6250 +uk.gov.westsussex.contenttypes.correpondence.mail-signatory.format=string + +uk.gov.westsussex.contenttypes.correpondence.cc-list.title=users/groups to copy in +uk.gov.westsussex.contenttypes.correpondence.cc-list.purpose=list of mail addreses to copy school mail to +uk.gov.westsussex.contenttypes.correpondence.cc-list.example=CYP Directorate +uk.gov.westsussex.contenttypes.correpondence.cc-list.format=[string,string,string] + +uk.gov.westsussex.contenttypes.correpondence.by_date_term_id.title=Term ID for by date +uk.gov.westsussex.contenttypes.correpondence.by_date_term_id.purpose=ID to be referred to in app +uk.gov.westsussex.contenttypes.correpondence.by_date_term_id.example=12345 +uk.gov.westsussex.contenttypes.correpondence.by_date_term_id.format=[integer] + +uk.gov.westsussex.contenttypes.correpondence.by_recipient_term_id.title=Term ID for by recipient +uk.gov.westsussex.contenttypes.correpondence.by_recipient_term_id.purpose=ID to be referred to in app +uk.gov.westsussex.contenttypes.correpondence.by_recipient_term_id.example=12345 +uk.gov.westsussex.contenttypes.correpondence.by_recipient_term_id.format=[integer] + +uk.gov.westsussex.contenttypes.correpondence.by_contact_term_id.title=Term ID for by contact +uk.gov.westsussex.contenttypes.correpondence.by_contact_term_id.purpose=ID to be referred to in app +uk.gov.westsussex.contenttypes.correpondence.by_contact_term_id.example=12345 +uk.gov.westsussex.contenttypes.correpondence.by_contact_term_id.format=[integer] + +uk.gov.westsussex.contenttypes.correpondence.by_service_area_term_id.title=Term ID for by service area +uk.gov.westsussex.contenttypes.correpondence.by_service_area_term_id.purpose=ID to be referred to in app +uk.gov.westsussex.contenttypes.correpondence.by_service_area_term_id.example=12345 +uk.gov.westsussex.contenttypes.correpondence.by_service_area_term_id.format=[integer] + +uk.gov.westsussex.contenttypes.correpondence.archive_term_id.title=Term ID for archive +uk.gov.westsussex.contenttypes.correpondence.archive_term_id.purpose=ID to be referred to in app +uk.gov.westsussex.contenttypes.correpondence.archive_term_id.example=12345 +uk.gov.westsussex.contenttypes.correpondence.archive_term_id.format=[integer] Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceConstants.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceConstants.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceConstants.java 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,29 @@ +/* + * Created on 27-Jun-05 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package uk.gov.westsussex.contenttypes; + +import java.math.BigDecimal; + +/** + * + * @author Chris Gilbert <a href="mailto:chr...@we...">chr...@we...</a> + * + */ +public interface CorrespondenceConstants { + + + + public static final String XML_NS = "http://wsgfl.westsussex.gov.uk/correspondence/1.0"; + public static final String XML_PREFIX = "correspondence"; + + +///////////// lifecycle phases + public static final String LIVE_PHASE = "Published Phase"; + public static final String ARCHIVE_PHASE = "Archived Phase"; + + +} Added: aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceContact.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceContact.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-types-school-correspondence/src/uk/gov/westsussex/contenttypes/CorrespondenceContact.java 2007-09-19 16:00:12 UTC (rev 1673) @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2004 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM Public + * License (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the + * License at http://www.redhat.com/licenses/ccmpl.html. + * + * Software distributed under the License is distributed on an + * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express + * or implied. See the License for the specific language + * governing rights and limitations under the License. + * + */ +package uk.gov.westsussex.contenttypes; + +import java.math.BigDecimal; +import java.util.Date; + +import javax.naming.NamingException; + +import org.apache.log4j.Logger; + +import uk.gov.westsussex.ldap.LDAPDirectory; +import uk.gov.westsussex.ldap.LDAPUser; + +import com.arsdigita.cms.ContentPage; +import com.arsdigita.cms.ContentType; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.kernel.ACSObject; +import com.arsdigita.kernel.security.AccountNotFoundException; +import com.arsdigita.london.terms.Term; +import com.arsdigita.persistence.DataAssociation; +import com.arsdigita.persistence.DataAssociationCursor; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.util.Assert; +import com.arsdigita.util.StringUtils; +/** + * + * <code>DomainObject</code> class to represent Mapping of a School Correspondence Content Item to a User in the LDAP Directory + * + * @author Chris Gilbert <a href="mailto:chr...@we...">chr...@we...</a> + * + * @version $Id: CorrespondenceContact.java,v 1.1 2006/01/04 16:41:00 cgyg9330 Exp $ + * + */ +public class CorrespondenceContact + extends ACSObject + { + + private static Logger s_log = Logger.getLogger(CorrespondenceContact.class); + + /** data object type for this domain object */ + public static final String BASE_DATA_OBJECT_TYPE = + "uk.gov.westsussex.contenttypes.CorrespondenceContact"; + + public static final String NETWORK_ID = "networkID"; + ///////// indirect attributes + public static final String CONTACT_FIRST_NAME = "contactFirstName"; + public static final String CONTACT_LAST_NAME = "contactLastName"; + + /** Default constructor. */ + public CorrespondenceContact(SchoolCorrespondence item, String networkID) { + super(BASE_DATA_OBJECT_TYPE); + + set(NETWORK_ID, networkID); + DataAssociation association = (DataAssociation) item.get(SchoolCorrespondence.CONTACTS); + this.addToAssociation(association); + } + + public CorrespondenceContact(D... [truncated message content] |
From: <chr...@fe...> - 2007-09-19 16:00:11
|
Author: chrisg23 Date: 2007-09-19 18:00:13 +0200 (Wed, 19 Sep 2007) New Revision: 1674 Modified: aplaws/trunk/ccm-ldn-util/src/com/arsdigita/london/util/ui/AbstractDomainObjectDetails.java aplaws/trunk/ccm-ldn-util/src/com/arsdigita/london/util/ui/AbstractDomainObjectList.java Log: Refactor - extract permission checks on action links so that concrete implementations may override the check if required Modified: aplaws/trunk/ccm-ldn-util/src/com/arsdigita/london/util/ui/AbstractDomainObjectDetails.java =================================================================== --- aplaws/trunk/ccm-ldn-util/src/com/arsdigita/london/util/ui/AbstractDomainObjectDetails.java 2007-09-19 15:06:45 UTC (rev 1673) +++ aplaws/trunk/ccm-ldn-util/src/com/arsdigita/london/util/ui/AbstractDomainObjectDetails.java 2007-09-19 16:00:13 UTC (rev 1674) @@ -78,26 +78,39 @@ Iterator actions = getDomainObjectActions(); while (actions.hasNext()) { String action = (String)actions.next(); - boolean actionVisible = true; - PrivilegeDescriptor privilege = getDomainObjectActionPrivilege(action); - if (privilege != null) { - Party party = Kernel.getContext().getParty(); - if (party == null) { - party = Kernel.getPublicUser(); - } - Assert.truth(dobj.getObjectType().isSubtypeOf(ACSObject.BASE_DATA_OBJECT_TYPE), - "I can only check permissions on ACS Objects - this domain Object is not a subtype of ACSObject "); + if (isActionVisible(action, dobj, state)) { + Element actionEl = parent.newChildElement(m_prefix + ":action", + getNamespace()); + actionEl.addAttribute("name", action); + actionEl.addAttribute("url", getDomainObjectActionLink(state, + dobj, action)); + } + } + } - PermissionDescriptor permission = new PermissionDescriptor(privilege,(ACSObject) dobj,party); - actionVisible = PermissionService.checkPermission(permission); - } - if (actionVisible) { - Element actionEl = parent.newChildElement(m_prefix + ":action", - getNamespace()); - actionEl.addAttribute("name", action); - actionEl.addAttribute("url", - getDomainObjectActionLink(state, dobj, action)); - } + /** + * determine whether this action should be rendered. Default + * implementation returns true unless a privilege has been + * specified for the action in which case a permission check + * is carried out for the current user. + * @param action + * @param dobj + * @param state + * @return + */ + protected boolean isActionVisible (String action, DomainObject dobj, PageState state) { + boolean actionVisible = true; + PrivilegeDescriptor privilege = getDomainObjectActionPrivilege(action); + if (privilege != null) { + Party party = Kernel.getContext().getParty(); + if (party == null) { + party = Kernel.getPublicUser(); + } + Assert.truth(dobj.getObjectType().isSubtypeOf(ACSObject.BASE_DATA_OBJECT_TYPE), + "I can only check permissions on ACS Objects - this domain Object is not a subtype of ACSObject "); + PermissionDescriptor permission = new PermissionDescriptor(privilege,(ACSObject) dobj,party); + actionVisible = PermissionService.checkPermission(permission); + } + return actionVisible; } } -} Modified: aplaws/trunk/ccm-ldn-util/src/com/arsdigita/london/util/ui/AbstractDomainObjectList.java =================================================================== --- aplaws/trunk/ccm-ldn-util/src/com/arsdigita/london/util/ui/AbstractDomainObjectList.java 2007-09-19 15:06:45 UTC (rev 1673) +++ aplaws/trunk/ccm-ldn-util/src/com/arsdigita/london/util/ui/AbstractDomainObjectList.java 2007-09-19 16:00:13 UTC (rev 1674) @@ -25,8 +25,15 @@ import com.arsdigita.domain.DomainObject; import com.arsdigita.domain.DomainCollection; import com.arsdigita.domain.DomainObjectXMLRenderer; +import com.arsdigita.kernel.ACSObject; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.Party; +import com.arsdigita.kernel.permissions.PermissionDescriptor; +import com.arsdigita.kernel.permissions.PermissionService; +import com.arsdigita.kernel.permissions.PrivilegeDescriptor; import com.arsdigita.xml.Element; +import com.arsdigita.util.Assert; import com.arsdigita.web.URL; import com.arsdigita.web.ParameterMap; import com.arsdigita.web.Web; @@ -95,12 +102,51 @@ Iterator actions = getDomainObjectActions(); while (actions.hasNext()) { String action = (String)actions.next(); + + if (isActionVisible(action, dobj, state)) { Element el = generateActionXML(state, dobj, action); objEl.addContent(el); } + } + + + + return objEl; } + /** + * determine whether this action should be rendered. Default + * implementation returns true unless a privilege has been + * specified for the action in which case a permission check + * is carried out for the current user. + * @param action + * @param dobj + * @param state + * @return + */ + protected boolean isActionVisible (String action, DomainObject dobj, PageState state) { + boolean actionVisible = true; + PrivilegeDescriptor privilege = getDomainObjectActionPrivilege(action); + if (privilege != null) { + Party party = Kernel.getContext().getParty(); + if (party == null) { + party = Kernel.getPublicUser(); + } + Assert + .truth( + dobj.getObjectType().isSubtypeOf( + ACSObject.BASE_DATA_OBJECT_TYPE), + "I can only check permissions on ACS Objects - this domain Object is not a subtype of ACSObject "); + + PermissionDescriptor permission = new PermissionDescriptor( + privilege, (ACSObject) dobj, party); + actionVisible = PermissionService.checkPermission(permission); + } + return actionVisible; + } + + protected Element generatePaginatorXML(PageState state, DomainCollection objs) { Integer pageNumberVal = (Integer)state.getValue(m_pageNumber); |
Author: chrisg23 Date: 2007-09-19 17:00:11 +0200 (Wed, 19 Sep 2007) New Revision: 1672 Modified: aplaws/trunk/ccm-core/src/com/arsdigita/search/ui/filters/SimpleCategoryFilterWidget.java aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/RemoteSearcher.java aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/SOAPHandler.java aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/SearchConfig.java aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/SearchConfig_parameter.properties aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/ui/AdvancedQueryComponent.java Log: Sourceforge patch 1797953 - remote search changes. No effect by default(though I think we are the only people using remote search anyway) Modified: aplaws/trunk/ccm-core/src/com/arsdigita/search/ui/filters/SimpleCategoryFilterWidget.java =================================================================== --- aplaws/trunk/ccm-core/src/com/arsdigita/search/ui/filters/SimpleCategoryFilterWidget.java 2007-09-19 13:48:47 UTC (rev 1671) +++ aplaws/trunk/ccm-core/src/com/arsdigita/search/ui/filters/SimpleCategoryFilterWidget.java 2007-09-19 15:00:11 UTC (rev 1672) @@ -43,7 +43,7 @@ /** * Creates a new category filter */ - protected SimpleCategoryFilterWidget() { + public SimpleCategoryFilterWidget() { m_roots = new Category[0]; } Modified: aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/RemoteSearcher.java =================================================================== --- aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/RemoteSearcher.java 2007-09-19 13:48:47 UTC (rev 1671) +++ aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/RemoteSearcher.java 2007-09-19 15:00:11 UTC (rev 1672) @@ -120,6 +120,10 @@ if (results != null && !results.isEmpty()) { s_log.debug("about to add results to the searchgroup"); job.getGroup().addResults( results ); + } else { + // Need to add empty results to register completion + // of one servers search. + job.getGroup().addResults(Collections.EMPTY_LIST); } } catch( RemoteException ex ) { s_log.error( "Failure making SOAP call to " + url + ": " + Modified: aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/SOAPHandler.java =================================================================== --- aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/SOAPHandler.java 2007-09-19 13:48:47 UTC (rev 1671) +++ aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/SOAPHandler.java 2007-09-19 15:00:11 UTC (rev 1672) @@ -19,6 +19,7 @@ import com.arsdigita.search.ResultSet; import com.arsdigita.search.Document; import com.arsdigita.search.filters.PermissionFilterSpecification; +import com.arsdigita.search.filters.ContentSectionFilterSpecification; import com.arsdigita.london.util.Transaction; import com.arsdigita.cms.search.VersionFilterSpecification; import com.arsdigita.cms.ContentItem; @@ -59,13 +60,22 @@ if (com.arsdigita.search.Search.getConfig().isIntermediaEnabled()) { spec.addFilter(new PermissionFilterSpecification()); } + + String[] sections = Search.getConfig().getRemoteSearchContentSections(); + if (sections != null) { + spec.addFilter(new ContentSectionFilterSpecification(sections)); + } + spec.addFilter(new VersionFilterSpecification(ContentItem.LIVE)); ResultSet resultSet = com.arsdigita.search.Search.processInternal( spec, com.arsdigita.search.Search.getConfig().getIndexer()); - Iterator docs = resultSet.getDocuments(0, 50); + // Get max. number of remote results as specified in config. param. + Iterator docs = resultSet.getDocuments(0, + Search.getConfig().getMaxRemoteResults().longValue()); + s_log.debug("About to return results for query: " + terms); while (docs.hasNext()) { Modified: aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/SearchConfig.java =================================================================== --- aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/SearchConfig.java 2007-09-19 13:48:47 UTC (rev 1671) +++ aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/SearchConfig.java 2007-09-19 15:00:11 UTC (rev 1672) @@ -22,6 +22,7 @@ import com.arsdigita.util.parameter.BooleanParameter; import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.IntegerParameter; +import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.StringParameter; import java.util.StringTokenizer; @@ -43,6 +44,8 @@ private final Parameter m_numThreads; private final Parameter m_searchTimeout; private final Parameter m_showSponsoredLinks; + private final Parameter m_maxRemoteResults; + private final Parameter m_remoteSearchContentSections; private final Parameter m_simpleRestrictTo; private String[] simpleRestrictToArray; @@ -57,6 +60,12 @@ m_showSponsoredLinks = new BooleanParameter ("com.arsdigita.london.search.show_sponsored_links", Parameter.REQUIRED, Boolean.FALSE); + m_maxRemoteResults = new IntegerParameter + ("com.arsdigita.london.search.max_remote_results", + Parameter.REQUIRED, new Integer(50)); + m_remoteSearchContentSections = new StringArrayParameter + ("com.arsdigita.london.search.remote_search_content_sections", + Parameter.OPTIONAL, null); m_simpleRestrictTo = new StringParameter ("com.arsdigita.london.search.simple_restrict_to", Parameter.OPTIONAL, ""); @@ -64,6 +73,8 @@ register(m_numThreads); register(m_searchTimeout); register(m_showSponsoredLinks); + register(m_maxRemoteResults); + register(m_remoteSearchContentSections); register(m_simpleRestrictTo); loadInfo(); } @@ -82,10 +93,27 @@ return (Boolean) get(m_showSponsoredLinks); } + public final Integer getMaxRemoteResults() { + return (Integer) get(m_maxRemoteResults); + } + public final String getSimpleRestrictTo() { return (String) get(m_simpleRestrictTo); } + /** + * When this server is the target of a remote search, this + * parameter enables us to filter by content section - so for + * example, we can prevent results from subsites being + * available externally is we specify the main site content + * section. If parameter is unset, then all content sections + * are searched + * @return + */ + public final String[] getRemoteSearchContentSections() { + return (String[])get(m_remoteSearchContentSections); + } + public final String[] getSimpleRestrictToArray() { if (simpleRestrictToArray == null) { loadSimpleRestrictToArray(); Modified: aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/SearchConfig_parameter.properties =================================================================== --- aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/SearchConfig_parameter.properties 2007-09-19 13:48:47 UTC (rev 1671) +++ aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/SearchConfig_parameter.properties 2007-09-19 15:00:11 UTC (rev 1672) @@ -11,3 +11,14 @@ com.arsdigita.london.search.show_sponsored_links.purpose=Whether or not to display Sponsored Links in addition to search results com.arsdigita.london.search.show_sponsored_links.example=false com.arsdigita.london.search.show_sponsored_links.format=[boolean] + +com.arsdigita.london.search.max_remote_results.title=Number of Remote Search Results to Return +com.arsdigita.london.search.max_remote_results.purpose=What is the maximum number of remote search results this server should return +com.arsdigita.london.search.max_remote_results.example=50 +com.arsdigita.london.search.max_remote_results.format=[integer] + +com.arsdigita.london.search.remote_search_content_sections.title=Content Sections for Remote Search +com.arsdigita.london.search.remote_search_content_sections.purpose=When this host is a target for remote search, filter results to specified content sections +com.arsdigita.london.search.remote_search_content_sections.example=content,forms +com.arsdigita.london.search.remote_search_content_sections.format=[string,string,string] + Modified: aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/ui/AdvancedQueryComponent.java =================================================================== --- aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/ui/AdvancedQueryComponent.java 2007-09-19 13:48:47 UTC (rev 1671) +++ aplaws/trunk/ccm-ldn-search/src/com/arsdigita/london/search/ui/AdvancedQueryComponent.java 2007-09-19 15:00:11 UTC (rev 1672) @@ -62,8 +62,15 @@ Application app = Web.getContext().getApplication(); Category root = Category.getRootForObject(app); - add(new SimpleCategoryFilterWidget(root)); + // cg - if no default domain mapped to search application, don't + // display widget. Also, allows implementations that use advanced search + // without the advanced search UI to work without default mapping + if (root != null) { + add(new SimpleCategoryFilterWidget(root)); + } else { + add(new SimpleCategoryFilterWidget()); + } add(new ContentTypeFilterWidget()); add(new VersionFilterComponent(context)); } |
Author: chrisg23 Date: 2007-09-19 16:00:30 +0200 (Wed, 19 Sep 2007) New Revision: 1670 Added: aplaws/trunk/ccm-ldn-portal/web/assets/ aplaws/trunk/ccm-ldn-portal/web/assets/fckeditor/ aplaws/trunk/ccm-ldn-portal/web/assets/fckeditor/config/ aplaws/trunk/ccm-ldn-portal/web/assets/fckeditor/config/fckconfig_portlet.js Modified: aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig.java aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig_parameter.properties aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/ui/portlet/FreeformHTMLPortletEditor.java Log: Sourceforge patch 1569884 - option to use your selected html editor for the freeform html portlet - switch it on with ccm set com.arsdigita.london.portal.portlet.freeform_html.wysiwyg_editor=true - by default there is no change. If you use fckeditor, the included config prevents access to back end file system or content centre via the link dialog (on our site non-authors customise their homepages). Modified: aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig.java =================================================================== --- aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig.java 2007-09-19 13:10:46 UTC (rev 1669) +++ aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig.java 2007-09-19 14:00:30 UTC (rev 1670) @@ -50,6 +50,8 @@ private Parameter m_adminPortletTypes; + private BooleanParameter m_htmlPortletWysiwygEditor; + private StringParameter m_workspacePartyPrivilege; private BooleanParameter m_checkWorkspaceReadPermissions; @@ -81,6 +83,11 @@ "com.arsdigita.london.portal.admin_only_portlet_types", Parameter.OPTIONAL, new String[0]); + m_htmlPortletWysiwygEditor = new BooleanParameter( + "com.arsdigita.london.portal.portlet.freeform_html.wysiwyg_editor", + Parameter.REQUIRED, + Boolean.FALSE); + m_workspacePartyPrivilege = new StringParameter( "com.arsdigita.london.portal.workspacePartyPrivilege", Parameter.OPTIONAL, "read"); @@ -94,6 +101,7 @@ register(m_createUserWorkspaces); register(m_excludedPortletTypes); register(m_adminPortletTypes); + register(m_htmlPortletWysiwygEditor); register(m_workspacePartyPrivilege); register(m_checkWorkspaceReadPermissions); @@ -126,6 +134,10 @@ return Arrays.asList(adminTypes); } + public boolean useWysiwygEditor() { + return ((Boolean) get(m_htmlPortletWysiwygEditor)).booleanValue(); + } + private PrivilegeDescriptor workspacePartyPrivilegeDescriptor = null; private void initWorkspacePartyPrivilegeDescriptor() { Modified: aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig_parameter.properties =================================================================== --- aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig_parameter.properties 2007-09-19 13:10:46 UTC (rev 1669) +++ aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig_parameter.properties 2007-09-19 14:00:30 UTC (rev 1670) @@ -23,6 +23,11 @@ com.arsdigita.london.portal.admin_only_portlet_types.format=[string,string,string] com.arsdigita.london.portal.admin_only_portlet_types.example=com.arsdigita.london.portal.portlet.ApplicationDirectoryPortlet,com.arsdigita.london.portal.portlet.TimeOfDayPortlet +com.arsdigita.london.portal.portlet.freeform_html.wysiwyg_editor.title=use wysiwyg editor for freeform html portlet +com.arsdigita.london.portal.portlet.freeform_html.wysiwyg_editor.purpose=If true, use editor specified by waf.bebop.dhtml_editor when user edits freeform html portlet +com.arsdigita.london.portal.portlet.freeform_html.wysiwyg_editor.format=[boolean] +com.arsdigita.london.portal.portlet.freeform_html.wysiwyg_editor.example=false + com.arsdigita.london.portal.workspacePartyPrivilege.title=Privilege granted to the workspace party com.arsdigita.london.portal.workspacePartyPrivilege.purpose=Specify which privilege is granted to the workspace party. Should be "read" or "edit". com.arsdigita.london.portal.workspacePartyPrivilege.format=[string] Modified: aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/ui/portlet/FreeformHTMLPortletEditor.java =================================================================== --- aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/ui/portlet/FreeformHTMLPortletEditor.java 2007-09-19 13:10:46 UTC (rev 1669) +++ aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/ui/portlet/FreeformHTMLPortletEditor.java 2007-09-19 14:00:30 UTC (rev 1670) @@ -15,22 +15,33 @@ package com.arsdigita.london.portal.ui.portlet; +import org.apache.log4j.Logger; + +import com.arsdigita.bebop.Bebop; import com.arsdigita.bebop.ColumnPanel; import com.arsdigita.bebop.FormProcessException; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.RequestLocal; +import com.arsdigita.bebop.form.DHTMLEditor; import com.arsdigita.bebop.form.TextArea; import com.arsdigita.bebop.parameters.NotNullValidationListener; -import com.arsdigita.bebop.parameters.StringInRangeValidationListener; import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.bebop.util.BebopConstants; +import com.arsdigita.cms.ui.CMSDHTMLEditor; +import com.arsdigita.cms.ui.authoring.TextAssetBody.PageTextForm; import com.arsdigita.kernel.ResourceType; +import com.arsdigita.london.portal.Workspace; import com.arsdigita.london.portal.portlet.FreeformHTMLPortlet; import com.arsdigita.london.portal.ui.PortletConfigFormSection; import com.arsdigita.portal.Portlet; public class FreeformHTMLPortletEditor extends PortletConfigFormSection { + private Logger s_log = Logger.getLogger(FreeformHTMLPortletEditor.class); + + private static final String FCK_PORTLET_CONFIG = "/assets/fckeditor/config/fckconfig_portlet.js"; + private TextArea m_content; public FreeformHTMLPortletEditor(ResourceType resType, @@ -45,7 +56,20 @@ protected void addWidgets() { super.addWidgets(); + if (Workspace.getConfig().useWysiwygEditor()) { + m_content = new CMSDHTMLEditor(PageTextForm.TEXT_ENTRY); + m_content.setWrap(CMSDHTMLEditor.SOFT); + if (Bebop.getConfig().getDHTMLEditor().equals(BebopConstants.BEBOP_FCKEDITOR)) { + ((DHTMLEditor)m_content).setConfig(new DHTMLEditor.Config("portlet-fck", FCK_PORTLET_CONFIG)); + m_content.setMetaDataAttribute("height", "300"); + } else { + // remove this so end users cannot browse through back end folder system + ((DHTMLEditor)m_content).hideButton("insertlink"); + } + } else { m_content = new TextArea(new StringParameter("content")); + } + m_content.setRows(10); m_content.setCols(35); m_content.addValidationListener(new NotNullValidationListener()); Added: aplaws/trunk/ccm-ldn-portal/web/assets/fckeditor/config/fckconfig_portlet.js =================================================================== --- aplaws/trunk/ccm-ldn-portal/web/assets/fckeditor/config/fckconfig_portlet.js (rev 0) +++ aplaws/trunk/ccm-ldn-portal/web/assets/fckeditor/config/fckconfig_portlet.js 2007-09-19 14:00:30 UTC (rev 1670) @@ -0,0 +1,30 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2005 Frederico Caldeira Knabben + * + * Custom amendments for freeform html portlet + */ + +FCKConfig.FillEmptyBlocks = true ; + +FCKConfig.ToolbarSets["Basic"] = [ + ['Source','-','Preview','-'], + ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'], + ['Cut','Copy','Paste','PasteText','PasteWord','-','Print'], + ['OrderedList','UnorderedList','-','Outdent','Indent'], + ['Link','Unlink'], + ['Undo','Redo','-','SelectAll'], + ['TextColor','BGColor'], + ['Rule','SpecialChar'], + ['FontFormat','FontName'], + ['FontSize'] +] ; + +//only licenced for personal use +//FCKConfig.SpellChecker = 'ieSpell' ; // 'ieSpell' | 'SpellerPages' +//FCKConfig.IeSpellDownloadUrl = 'http://www.iespell.com/rel/ieSpellSetup211325.exe' ; + +FCKConfig.LinkBrowser = false ; +FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ; + +FCKConfig.SmileyImages = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ; |
From: <chr...@fe...> - 2007-09-19 14:00:39
|
Author: chrisg23 Date: 2007-09-19 16:00:29 +0200 (Wed, 19 Sep 2007) New Revision: 1669 Added: aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/upgrade/ aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/upgrade/CreateContainerGroups.java Modified: aplaws/trunk/ccm-ldn-portal/application.xml aplaws/trunk/ccm-ldn-portal/src/ccm-ldn-portal.upgrade aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/Workspace.java Log: Sourceforge patch 1797770 - put all those portal workspaces into one tidy group instead of having them clutter up the top level of the group admin tree. execute ccm upgrade --from-version 6.5.0 --to-version 6.5.1 in order to create top level group and move existing groups Modified: aplaws/trunk/ccm-ldn-portal/application.xml =================================================================== --- aplaws/trunk/ccm-ldn-portal/application.xml 2007-09-19 10:53:08 UTC (rev 1668) +++ aplaws/trunk/ccm-ldn-portal/application.xml 2007-09-19 14:00:29 UTC (rev 1669) @@ -2,7 +2,7 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-ldn-portal" prettyName="Portal" - version="6.5.0" + version="6.5.1" release="2" webapp="ROOT"> <ccm:dependencies> Modified: aplaws/trunk/ccm-ldn-portal/src/ccm-ldn-portal.upgrade =================================================================== --- aplaws/trunk/ccm-ldn-portal/src/ccm-ldn-portal.upgrade 2007-09-19 10:53:08 UTC (rev 1668) +++ aplaws/trunk/ccm-ldn-portal/src/ccm-ldn-portal.upgrade 2007-09-19 14:00:29 UTC (rev 1669) @@ -8,4 +8,7 @@ <version from="6.3.1" to="6.3.2"> <script sql="ccm-ldn-portal/upgrade/::database::-6.3.1-6.3.2.sql"/> </version> + <version from="6.5.0" to="6.5.1"> + <script class="com.arsdigita.london.portal.upgrade.CreateContainerGroups"/> + </version> </upgrade> Modified: aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/Workspace.java =================================================================== --- aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/Workspace.java 2007-09-19 10:53:08 UTC (rev 1668) +++ aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/Workspace.java 2007-09-19 14:00:29 UTC (rev 1669) @@ -249,6 +249,14 @@ Group members = new Group(); members.setName(title); members.save(); + // set this group as subgroup of workspace application type + // although workspace applications can be nested, place all + // member groups directly under main container (rather than reflecting + // hierarchical structure) because (a) workspace already manages its + // own groups so doesn't need a hierarchy and (b) hierarchy would + // mean for a given workspace, role would be on the same level + // as member groups of sub workspaces - messy & confusing + getApplicationType().getGroup().addSubgroup(members); Role admins = members.createRole("Administrators"); admins.save(); Added: aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/upgrade/CreateContainerGroups.java =================================================================== --- aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/upgrade/CreateContainerGroups.java (rev 0) +++ aplaws/trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/upgrade/CreateContainerGroups.java 2007-09-19 14:00:29 UTC (rev 1669) @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2007 Chris Gilbert 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.london.portal.upgrade; + +import org.apache.commons.cli.CommandLine; +import org.apache.log4j.Logger; + +import com.arsdigita.kernel.Group; +import com.arsdigita.kernel.GroupCollection; +import com.arsdigita.kernel.Party; +import com.arsdigita.london.portal.Workspace; +import com.arsdigita.london.portal.WorkspaceCollection; +import com.arsdigita.london.util.Program; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.persistence.TransactionContext; +import com.arsdigita.web.ApplicationType; + +/** + * @author chris gilbert (chr...@we...) + * + * Tidy up portal groups so they are not all at root level + * + * + */ +public class CreateContainerGroups extends Program { + + public CreateContainerGroups() { + super("CreateGroups", "1.0.0", ""); + } + + private static Logger s_log = Logger.getLogger(CreateContainerGroups.class); + + public void doRun(CommandLine cmdLine) { + try { + + final TransactionContext tc = SessionManager.getSession().getTransactionContext(); + + tc.beginTxn(); + + WorkspaceCollection existingWorkSpaces = Workspace.retrieveAll(); + Group parentGroup = null; + while (existingWorkSpaces.next()) { + + Workspace workspace = existingWorkSpaces.getWorkspace(); + // do this inside the loop because we get the workspace application + // type from an instance of a workspace + if (parentGroup == null) { + s_log.info("Creating group for workspace application type"); + System.out.println("Creating group for workspace application type"); + ApplicationType workspaceType = workspace.getApplicationType(); + if (workspaceType.getGroup() == null) { + workspaceType.createGroup(); + } + parentGroup = workspaceType.getGroup(); + } + Group workspaceGroup = null; + Party party = workspace.getParty(); + if (party instanceof Group) { + workspaceGroup = (Group)party; + } else { + GroupCollection groups = Group.retrieveAll(); + groups.addEqualsFilter("name", workspace.getTitle()); + if (groups.next()) { + workspaceGroup = groups.getGroup(); + } + groups.close(); + groups.reset(); + } + + if (workspaceGroup != null) { + GroupCollection supergroups = workspaceGroup.getSupergroups(); + supergroups.addEqualsFilter(Group.ID, parentGroup.getID()); + if (supergroups.size() == 0) { + s_log.info("moving group for " + workspace.getTitle()); + System.out.println("moving group for " + workspace.getTitle()); + parentGroup.addSubgroup(workspaceGroup); + } else { + s_log.info("group for " + workspace.getTitle() + " is already child of workspace type group"); + System.out.println("group for " + workspace.getTitle() + " is already child of workspace type group"); + } + } else { + s_log.info("can't find group for " + workspace.getTitle()); + System.out.println("can't find group for " + workspace.getTitle()); + } + + } + tc.commitTxn(); + + } catch (Throwable e) { + s_log.error("error occured", e); + System.out.println("error occured. Check logs for details"); + } + } + + public static final void main(final String[] args) { + new CreateContainerGroups().run(args); + } + +} |
From: <chr...@fe...> - 2007-09-19 14:00:32
|
Author: chrisg23 Date: 2007-09-19 16:00:31 +0200 (Wed, 19 Sep 2007) New Revision: 1671 Modified: aplaws/trunk/ccm-ldn-portal/web/packages/workspace/xsl/admin.xsl Log: Sourceforge patch 1797923 - move individual application details above application list at ccm/portal/admin/sitemap.jsp Modified: aplaws/trunk/ccm-ldn-portal/web/packages/workspace/xsl/admin.xsl =================================================================== --- aplaws/trunk/ccm-ldn-portal/web/packages/workspace/xsl/admin.xsl 2007-09-19 13:21:20 UTC (rev 1670) +++ aplaws/trunk/ccm-ldn-portal/web/packages/workspace/xsl/admin.xsl 2007-09-19 14:00:31 UTC (rev 1671) @@ -26,9 +26,9 @@ </xsl:template> <xsl:template match="portal:sitemap"> - <h3>Applications</h3> + <xsl:apply-templates select="portal:applicationPane"/> + <h3>All Applications</h3> <xsl:apply-templates select="portal:applicationList"/> - <xsl:apply-templates select="portal:applicationPane"/> </xsl:template> <xsl:template match="portal:workspaceDelete"> |
From: <chr...@fe...> - 2007-09-19 11:01:19
|
Author: chrisg23 Date: 2007-09-19 13:01:00 +0200 (Wed, 19 Sep 2007) New Revision: 1665 Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/acs-subsite-register.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/admin-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/admin-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-admin.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-admin.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar-print.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-confirm.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-contacts.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-details.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-files.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-links.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-locations.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-note.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/lib.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/main-panel.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/view-event.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/view-month.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/view-period.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/content-center-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/content-section-admin.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/content-section-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/content.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/county-directory-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/county-directory-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/acs-master.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/acs-master.css.060607 aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/atoz.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/content.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/custom-app.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/date.js aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/iframe-resize.js aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/main.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/portal.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/print.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/search.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/shell-oflow.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/shell.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/sitemap.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/css/wysiwyg.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/emergency-contacts-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/emergency-contacts-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/emergency-contacts-print.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/error-handler-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/forum-categories.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/forum-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/forum-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/Birthday-5-image.jpg aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/BlackArrowLogin.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/Learn-Conn.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/Learn-Conn.jpg aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/Learn-Connections_02.jpg aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/Montage.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/Montage.jpg aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/Montage_08.jpg aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/NGL-Logo_10.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/RedArrowPaleBluBG.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/RedArrowWhiteBG.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/Thumbs.db aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/WSCC-Red_05.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/WSCC-WSGfL.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/WSGfL-logo.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/WSGfL-logo_04.jpg aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/aplaws-logo-small.png aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/aplaws-logo.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/aplawsplus.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/arrowSitemap.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/arrow_bullet.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/arrow_bullet_old.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/background-check.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/blue_arrow_3.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/calendar/ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/calendar/calendar.jpeg aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/calendar/file.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/copy.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/directgov2.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/eteach-ad_11.jpg aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/excellent.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/forum/ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/forum/archived-16x16.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/forum/back-to-16x16.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/forum/delete-16x16.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/forum/edit-16x16.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/forum/info-16x16.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/forum/post-16x16.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/forum/read.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/forum/reply-16x16.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/forum/watch-16x16.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/image1.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/image1.jpg aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/image1.png aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/image2.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/image2.jpg aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/image2.png aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/image3.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/image3.jpg aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/image3.png aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/lock.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/logo-ws_black.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/logo-wsgfl.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/new-mail_15.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/news_arrow.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/red_arrow_1.png aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/sb-bg.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/sb-bg.png aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/spacer.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/speaker.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/tlcArrow-s.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/tlcArrow.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/untitled.bmp aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/w3c-css.bmp aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/w3c-css.png aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/w3c-xhtml.bmp aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/w3c-xhtml.png aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/images/yellow_arrow_1.gif aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/body.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/content.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/head.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/header.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/home.xml aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/leftNav-master.txt aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/leftNav.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/lib.old.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/lib.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/page.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/shell.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lib/user-banner.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lmdu-contact.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lmdu-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/lmdu-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/localities-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/localities.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/message-of-the-day-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/message-of-the-day-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/navigation-admin-links.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/navigation-admin-links.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/navigation-admin.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/navigation-admin.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/navigation-directory.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/navigation-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/navigation-services.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/navigation-sitemap.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/navigation-summary.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/ping-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/ping-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/application-directory-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/bookmarks-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/content-item-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/content-sections-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/county-directory-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/directory-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/forum-postings-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/freeform-html-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/image-link-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/inbox-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/lib.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/login-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/message-of-the-day-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/nav-page-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/news-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/personalised-links-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/portlets.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/property-call-logging-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/rss-feed-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/tasklist-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/time-of-day-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/portal/workspace-directory-portlet.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/school-visits-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/school-visits-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/search-admin.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/search-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/shortcuts-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/shortcuts-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/subsite-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/subsite-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/terms-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/terms-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/theme-index.css aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/theme-index.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/Address.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/Agenda.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/Article.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/ContentTypes.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/Correspondence.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/Establishment.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/Event.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/FileStorageItem.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/InlineSite.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/Job.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/LegalNotice.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/Minutes.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/MultiPartArticle.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/NewsItem.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/PressRelease.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/Service.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/types/SiteProxy.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/workspace-admin.xsl aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/workspace-index.xsl Log: Added theme files Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/acs-subsite-register.xsl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/acs-subsite-register.xsl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/acs-subsite-register.xsl 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,150 @@ +<?xml version="1.0"?> + +<!DOCTYPE stylesheet [ +<!ENTITY nbsp " " > +<!ENTITY copy "©" > +]> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:subsite="http://www.arsdigita.com/subsite/1.0" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:ui="http://www.arsdigita.com/ui/1.0"> + + <!-- <xsl:import href="../../bebop/xsl/bebop.xsl"/> + <xsl:import href="../../ui/xsl/ui.xsl"/> --> +<xsl:import href="../../../../ROOT/packages/bebop/xsl/bebop.xsl"/> + +<xsl:import href="lib/header.xsl"/> +<xsl:import href="lib/lib.xsl"/> +<xsl:import href="lib/leftNav.xsl"/> +<xsl:import href="../../../../ROOT/packages/bebop/xsl/dcp.xsl"/> + + <xsl:param name="context-prefix"/> + <xsl:param name="theme-prefix"/> + + + <xsl:param name="dispatcher-prefix"/> + + <!-- new version of login page --> + <xsl:template match="bebop:page[@application='login']"> + <!-- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" --> + <html> + <head> + <title>Log in</title> + + <link rel="stylesheet" href="{$theme-prefix}/css/main.css" type="text/css" media="screen"/> + <link rel="stylesheet" href="{$theme-prefix}/css/custom-app.css" type="text/css" media="screen"/> + + <link rel="stylesheet" href="{$theme-prefix}/css/print.css" type="text/css" media="print"/> + + <script type="text/javascript" src="{$theme-prefix}/css/date.js"></script> + <xsl:call-template name="bebop:dcpJavascript"/> + </head> + + <body onload="document.userLogin.email.focus();"> + + + <!--HEADER --> + <xsl:call-template name="header"/> + + + <!--<xsl:comment>channelBanner</xsl:comment> + <div id="banner"> + <div id="banner-l"> + <a href="http://www.westsussex.gov.uk/"><img id="ws-sheild" height="53" alt="Click here to visit the West Sussex County Council website" src="{$theme-prefix}/images/WSCC-Red_05.gif" width="85" /></a> + <span class="hide">|</span> + <img id="learning-connections" height="54" alt="" src="{$theme-prefix}/images/Learn-Connections_02.jpg" width="368" /> + </div> + + <div id="banner-r"> + <img id="montage" class="montage" src="{$theme-prefix}/images/Montage_08.jpg" width="185" height="53" alt="" /> + <a href="/"><img id="wsgfl-logo" class="wsgfl-logo" src="{$theme-prefix}/images/WSGfL-logo_04.jpg" width="137" height="54" alt="Click here to return to the WSGfL Homepage" /></a> + </div> + + <div class="clear"><img class="invisibleSpacer" src="{$theme-prefix}/images/spacer.gif" width="1" height="1" border="0" alt="" /></div> + </div>--> + + <div class="loginForm"> + + <xsl:apply-templates select="bebop:form"/> + </div> + + <xsl:apply-templates select="ui:debugPanel"/> + <xsl:if test ="subsite:explainLoginExpired"> + <div class="loginForm"> + <xsl:apply-templates/> + </div> + </xsl:if> + + <xsl:call-template name="footer"/> + + + </body> + </html> + </xsl:template> + + <xsl:template match="bebop:gridPanel"> + <b>Please enter your user ID and password below.</b> + <br/> + <br/> + + <xsl:apply-templates select="bebop:formWidget[@type='hidden'] | bebop:panelRow/bebop:cell/bebop:label | bebop:panelRow/bebop:cell/bebop:formWidget | bebop:panelRow/bebop:cell/bebop:solidLine" /> + <br/> + <br/> + + </xsl:template> + + <xsl:template match="bebop:label"> + <p> + <xsl:value-of select="."/> + </p> + </xsl:template> + + <xsl:template match="bebop:formWidget[not(@type='hidden') and not(@type='submit')]"> + <p> + <input type="{@type}" name="{@name}" size="20"/> + </p> + </xsl:template> + + <!--<xsl:template match="bebop:formWidget[@type='submit']"> + <br/> + <br/> + <div class="linkButton"> + <input type="submit" value="Submit" onclick="{@onclick}" name="{@name}"/> + </div> + <br/> + </xsl:template> --> + + + <xsl:template match="subsite:promptToEnableCookiesMsg"> + <br /> + <div class="app"> + <b>Note:</b> Our personalised web services require that your browser be enabled for JavaScript and cookies. + </div> + </xsl:template> + + + + + <xsl:template match="subsite:contentCenters"> + <h4>My Control Centers</h4> + <ul> + <xsl:for-each select="subsite:center"> + <li> + <a> + <xsl:attribute name="href"> + <xsl:for-each select="subsite:url"> + <xsl:if test="position()=1"> + <xsl:value-of select="node()|text()" /> + </xsl:if> + </xsl:for-each> + </xsl:attribute> + <xsl:value-of select="@name" /> + </a> + </li> + </xsl:for-each> + </ul> + </xsl:template> + +</xsl:stylesheet> Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/admin-index.css =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/admin-index.css (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/admin-index.css 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,2 @@ +@import url(css/acs-master.css); + Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/admin-index.xsl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/admin-index.xsl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/admin-index.xsl 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:aplaws="http://www.arsdigita.com/aplaws/1.0" + version="1.0"> + + <xsl:import href="../../../../ROOT/__ccm__/apps/admin/xsl/index.xsl"/> + <xsl:import href="lib/page.xsl"/> + + <xsl:param name="theme-prefix"/> + + <xsl:template name="aplaws:headerStyleSheets"> + <link rel="stylesheet" href="{$theme-prefix}/admin-index.css" type="text/css" media="screen"/> + </xsl:template> + +</xsl:stylesheet> Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-admin.css =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-admin.css (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-admin.css 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,2 @@ +@import url("/css/acs-master.css"); +@import url("/__ccm__/static/atoz/atoz.css"); Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-admin.xsl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-admin.xsl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-admin.xsl 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:aplaws="http://www.arsdigita.com/aplaws/1.0" + version="1.0"> + + <xsl:import href="../../../../ccm-ldn-atoz/__ccm__/apps/atoz/xsl/index.xsl"/> + <xsl:import href="lib/page.xsl"/> + + <xsl:param name="theme-prefix"/> + + <xsl:template name="aplaws:headerStyleSheets"> + <link rel="stylesheet" href="{$theme-prefix}/atoz-index.css" type="text/css" media="screen"/> + </xsl:template> + +</xsl:stylesheet> Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-index.css =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-index.css (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-index.css 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,2 @@ +@import url("/css/acs-master.css"); +@import url("/__ccm__/static/atoz/atoz.css"); Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-index.xsl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-index.xsl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/atoz-index.xsl 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,178 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:aplaws="http://www.arsdigita.com/aplaws/1.0" + xmlns:ui="http://www.arsdigita.com/ui/1.0" + xmlns:cms="http://www.arsdigita.com/cms/1.0" + xmlns:nav="http://ccm.redhat.com/london/navigation" + xmlns:search="http://rhea.redhat.com/search/1.0" + xmlns:atoz="http://xmlns.redhat.com/atoz/1.0" + exclude-result-prefixes="xsl bebop aplaws ui cms nav search atoz" + version="1.0"> + +<xsl:import href="../../../../ROOT/__ccm__/apps/content-section/xsl/index.xsl"/> + +<xsl:import href="lib/header.xsl"/> +<xsl:import href="lib/lib.xsl"/> +<xsl:import href="lib/leftNav.xsl"/> + + +<xsl:param name="context-prefix"></xsl:param> +<xsl:param name="dispatcher-prefix" /> +<xsl:param name="theme-prefix" /> + +<xsl:output + method="html" + doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" + doctype-system="http://www.w3.org/TR/html4/loose.dtd" + indent="yes" +/> + + + +<xsl:template match="bebop:page[@application='atoz']"> +<html lang="en"> + <head> + <title>West Sussex Grid for Learning: A to Z Index</title> + <link rel="stylesheet" href="{$theme-prefix}/css/main.css" type="text/css" media="screen"/> + <link rel="stylesheet" href="{$theme-prefix}/css/atoz.css" type="text/css" media="screen"/> + <script type="text/javascript" src="{$theme-prefix}/css/date.js"></script> + <xsl:call-template name="bebop:dcpJavascript"/> + </head> + + <body> + <a class="navHide" href="#startcontent" title="Go directly to main content" accesskey="S">Skip over navigation</a> + <span class="hide">|</span> + <xsl:call-template name="header"/> + <xsl:call-template name="azBody"/> + </body> +</html> +</xsl:template> + + + + + + + + + + +<xsl:template name="azBody"> + +<table id="mainLayout" border="0" cellspacing="0" cellpadding="0" summary="navigation and a to z content"> +<tr> + <td><img class="lSpacer" src="{$theme-prefix}/images/spacer.gif" alt="" /></td> + <td><img class="rSpacer" src="{$theme-prefix}/images/spacer.gif" alt="" /></td> +</tr> +<tr> +<td id="leftNav" align="left" valign="top"> +<!--LHS NAVIGATION --> + + <xsl:call-template name="leftNav" /> + +</td> + +<td id="content" valign="top"> + <span class="hide">|</span> + +<!--CONTENT --> + + <a id="startcontent" class="navHide" title="Start of content">start of content</a> + <span class="hide">|</span> + + <div class="pageTitle"> + <h1>A to Z Index</h1> + </div> + <xsl:call-template name="azMain" /> + + +</td> +</tr> +</table> + +<xsl:call-template name="footer"/> + +</xsl:template> + + + + + + + + +<xsl:template name="azMain"> +<a class="navHide" href="#startAZResults" title="Go directly to A-Z results">Skip to A-Z results</a> + +<xsl:for-each select="atoz:atoz"> + +<div id="azArea"> + + <xsl:for-each select="atoz:letter"> + <a> + <xsl:attribute name="href">?letter=<xsl:value-of select="." /></xsl:attribute> + <xsl:value-of select="." /></a> + <xsl:if test="position()!='last'"> | </xsl:if> + </xsl:for-each> + +</div> +<xsl:choose> +<xsl:when test="atoz:provider"> + +<h2 class="pageSubTitle"> + +<xsl:value-of select="atoz:letter[@isSelected]" /><xsl:text disable-output-escaping="yes">&</xsl:text>nbsp;</h2> + +<a id="startAZResults" title="Start of A-Z results"> </a> + +<xsl:call-template name="azResults" /> + + + +</xsl:when> +<xsl:otherwise> +<h2 class="pageSubTitle"> +A to Z of Services and Information +</h2> +<div id="atozExplanation"> +<br/><br/> +Where you can browse for items alphabetically <br/><br/> + + Click on the letters above to find the subjects covered on this site <br/><br/> + + If you cannot find what you are looking for then please try our site search <br/> + If you still cannot find what you are looking for please contact us on 01243 777795 or use our feedback link above. +</div> +</xsl:otherwise> +</xsl:choose> +</xsl:for-each> + +</xsl:template> + + + + + + +<xsl:template name="azResults"> + + +<div id="azList"> + <xsl:apply-templates select="atoz:provider/atoz:atomicEntry[not(preceding-sibling::atoz:atomicEntry/@title=./@title)]"> + <xsl:sort select="./@title" order="ascending" /> + </xsl:apply-templates> +</div> +</xsl:template> + + + + +<xsl:template match = "atoz:atomicEntry"> +<a href="{@url}" title="{@description}"><xsl:value-of select="@title" /></a><span class="hide">|</span> +</xsl:template> + + + +</xsl:stylesheet> Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-confirm.xsl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-confirm.xsl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-confirm.xsl 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:calendar="http://wsgfl.westsussex.gov.uk/calendar/1.0" + exclude-result-prefixes="xsl bebop calendar" version="1.0"> + + <xsl:template match="calendar:confirm"> + + <div id="appTitle">Calendar Event - Confirm </div> + <div id="app"> + + <div class="section"> + + <p> When published, the event will appear as below. To make any changes, click one + of the following links: </p> + <xsl:apply-templates select="bebop:link"/> + + <xsl:if test="not(calendar:publisher)"> + <p> + Your event will not appear on the site until it has been approved and published. Gatekeepers have + been notified by email of your new event, and you will be notified by email when it has been published. + </p> + + </xsl:if> + + </div> + </div> + <xsl:apply-templates select="calendar:object"/> + + + + + </xsl:template> + + <xsl:template match="bebop:link[ancestor::calendar:confirm]"> + <a class="optionList" href="{@href}"><xsl:value-of select="@id"/></a> + + </xsl:template> + + + +</xsl:stylesheet> Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-contacts.xsl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-contacts.xsl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-contacts.xsl 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,389 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:calendar="http://wsgfl.westsussex.gov.uk/calendar/1.0" + exclude-result-prefixes="xsl bebop calendar" version="1.0"> + + + <!-- STEP 2 - select/maintain contacts --> + + <xsl:template match="calendar:eventContactsStep"> + + <div id="appTitle">Calendar Event - Add Contact Details</div> + <div id="app"> + <div class="section"> + + <p> + Please specify the people who should be contacted about this event. + </p> + <p> + Search for county staff and staff from other organisations below. Once you have searched, if there is no record for a non-county contact you can add them and also edit their details. Any changes will apply to all visit reports. + </p> + <p> + If you cannot find a member of county staff, or if their details are incorrect, please email: <a href="mailto:cou...@we...">cou...@we...</a> + </p> + </div> + + <xsl:apply-templates select ="calendar:*"/> + </div> + </xsl:template> + + + <xsl:template match="calendar:eventContactsSearch"> + <div class="section"> + <fieldset> + <legend>Contact Search</legend> + + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='firstNameSrch']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='firstNameSrch']" /> + + </div> + </div> + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='lastNameSrch']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='lastNameSrch']" /> + + </div> + </div> + <div class="sectionEnd"/> + <div class="label"> + <xsl:text disable-output-escaping="yes">&</xsl:text>nbsp; + </div> + <div id="buttons"> + <xsl:apply-templates select="bebop:formWidget[@type='submit']" /> + </div> + </fieldset> + + + </div> + + + </xsl:template> + + <xsl:template match="calendar:eventContactsSelected"> + + <div class="section"> + <fieldset> + <legend>Selected Contacts</legend> + <xsl:choose> + + <xsl:when test="not(calendar:eventContacts)"> + <p> + No contacts selected yet + </p> + </xsl:when> + <xsl:otherwise> + <table> + <tr> + <td id="contactLastName">Last Name</td> + <td id="contactFirstName">First Name</td> + <td id="contactEmail">email Address</td> + <td></td> + <td></td> + </tr> + <xsl:for-each select="calendar:eventContacts"> + <xsl:variable name="class"> + <xsl:choose> + <xsl:when test="position() mod 2"> + <xsl:text>rowOdd</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>rowEven</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <tr class="{$class}"> + <td><xsl:value-of select="@lastName" /></td> + <td><xsl:value-of select="@firstName" /></td> + <td><xsl:value-of select="@email" /></td> + <td><a href="{@view-url}">View</a></td> + <td><a href="{@delete-url}">Remove</a></td> + </tr> + </xsl:for-each> + </table> + </xsl:otherwise> + </xsl:choose> + + + </fieldset> + </div> + </xsl:template> + + <xsl:template match="calendar:eventContactsSearchResults"> + + <div class="section"> + <fieldset> + <legend>Search Results</legend> + <xsl:choose> + <xsl:when test="calendar:tooManyResults"> + <div class="fieldError"> + <xsl:text>There are too many results to display, please try to be more specific.</xsl:text> + </div> + </xsl:when> + <xsl:when test="calendar:ldapProblem"> + <div class="fieldError"> + <xsl:text>Sorry, the County Directory is unavailable at the moment. The WSGfL administrators have been informed. Please try again later or ring Children & Young People's Services on 0845 0751007</xsl:text> + </div> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="not(calendar:eventContacts)"> + + <div class="fieldError"> + <xsl:text>Sorry - no contacts found</xsl:text> + </div> + </xsl:when> + <xsl:otherwise> + <table> + <tr> + <td id="contactLastName">Last Name</td> + <td id="contactFirstName">First Name</td> + <td id="contactEmail">email Address</td> + <td></td> + <td></td> + </tr> + <xsl:for-each select="calendar:eventContacts"> + <xsl:variable name="class"> + <xsl:choose> + <xsl:when test="position() mod 2"> + <xsl:text>rowOdd</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>rowEven</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <tr class="{$class}"> + <td><xsl:value-of select="@lastName" /></td> + <td><xsl:value-of select="@firstName" /></td> + <td><xsl:value-of select="@email" /></td> + <td><a href="{@view-url}">View</a></td> + <td><a href="{@select-url}">Select</a></td> + </tr> + </xsl:for-each> + </table> + </xsl:otherwise> + </xsl:choose> + + <div class="section"> + <a class="linkButton" href="{../bebop:link/@href}" onclick="dcp_disable_link_button(this);"><xsl:value-of select="../bebop:link/bebop:label"/></a> + </div> + </xsl:otherwise> + </xsl:choose> + + + </fieldset> + </div> + + </xsl:template> + + + <xsl:template match="calendar:eventContactsEdit"> + + <div class="section"> + <fieldset> + <legend>Add/Edit Contact</legend> + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='contactFirstName']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='contactFirstName']" /> + <xsl:for-each select="bebop:formErrors[@id='contactFirstName']"> + <xsl:if test="position()=1"> + <br /> + <xsl:apply-templates select="." /> + </xsl:if> + </xsl:for-each> + + </div> + </div> + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='contactLastName']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='contactLastName']" /> + <xsl:for-each select="bebop:formErrors[@id='contactLastName']"> + <xsl:if test="position()=1"> + <br /> + <xsl:apply-templates select="." /> + </xsl:if> + </xsl:for-each> + + </div> + </div> + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='contactPhone']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='contactPhone']" /> + <xsl:for-each select="bebop:formErrors[@id='contactPhone']"> + <xsl:if test="position()=1"> + <br /> + <xsl:apply-templates select="." /> + </xsl:if> + </xsl:for-each> + + </div> + </div> + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='contactEmail']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='contactEmail']" /> + <xsl:for-each select="bebop:formErrors[@id='contactEmail']"> + <xsl:if test="position()=1"> + <br /> + <xsl:apply-templates select="." /> + </xsl:if> + </xsl:for-each> + + </div> + </div> + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='contactService']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='contactService']" /> + <xsl:for-each select="bebop:formErrors[@id='contactService']"> + <xsl:if test="position()=1"> + <br /> + <xsl:apply-templates select="." /> + </xsl:if> + </xsl:for-each> + + </div> + </div> + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='contactRole']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='contactRole']" /> + <xsl:for-each select="bebop:formErrors[@id='contactRole']"> + <xsl:if test="position()=1"> + <br /> + <xsl:apply-templates select="." /> + </xsl:if> + </xsl:for-each> + + </div> + </div> + <div class="section"> + <div id="buttons"> + <xsl:apply-templates select="bebop:formWidget[@type='submit']" /> + </div> + + <div class="sectionEnd"/> + </div> + </fieldset> + + </div> + + + + </xsl:template> + + <xsl:template match="calendar:eventContactsDetails"> + + <div class="section"> + <fieldset> + <legend>Contact Details</legend> + + <div class="input"> + + <div class="label"> + Full Name: + + </div> + <div class="field"> + + <xsl:value-of select="@firstName"/> + <xsl:text disable-output-escaping="yes">&</xsl:text>nbsp; + <xsl:value-of select="@lastName"/> + </div> + </div> + + + + <div class="input"> + <div class="label"> + Phone Number: + </div> + <div class="field"> + <xsl:value-of select="@phone"/> + </div> + </div> + + + <div class="input"> + <div class="label"> + Email Address: + </div> + <div class="field"> + <xsl:value-of select="@email"/> + </div> + </div> + + <div class="input"> + <div class="label"> + Service: + </div> + <div class="field"> + <xsl:value-of select="@service"/> + </div> + </div> + + <div class="input"> + <div class="label"> + Role: + </div> + <div class="field"> + <xsl:value-of select="@role"/> + </div> + </div> + <div class="section"> + <xsl:apply-templates select="bebop:link"/> + + </div> + + </fieldset> + + </div> + + + + </xsl:template> + + + + + +</xsl:stylesheet> Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-details.xsl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-details.xsl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-details.xsl 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,164 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:calendar="http://wsgfl.westsussex.gov.uk/calendar/1.0" + exclude-result-prefixes="xsl bebop calendar" version="1.0"> + + <xsl:template match="calendar:editDetails"> + + <div id="appTitle">Calendar Event - Basic Details </div> + <div id="app"> + <div class="section"> + <p> After completing these details, you can press finish to create a simple event or + use the 'next' button to add additional information - locations, contact + details, file attachments or links </p> + + + </div> + + <div class="section"> + + + + + <xsl:if test="bebop:radioGroup[@name='folder']"> + <div class="input"> + <div class="label"> + <xsl:value-of select="bebop:radioGroup[@name='folder']/@metadata.label" + /> + </div> + <div class="checkBox"> + <xsl:apply-templates select="bebop:radioGroup[@name='folder']"/> + </div> + </div> + </xsl:if> + + <div class="input"> + <div class="label"> + <xsl:value-of select="bebop:radioGroup[@name='type']/@metadata.label"/> + </div> + <div class="checkBox"> + <xsl:apply-templates select="bebop:radioGroup[@name='type']"/> + </div> + </div> + + <div class="input"> + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='name']/@metadata.label"/> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='name']"/> + <xsl:for-each select="bebop:formErrors[@id='name']"> + <br/> + <xsl:apply-templates select="."/> + </xsl:for-each> + </div> + </div> + + + + + <div class="input"> + + + <div id="startTimeLabel" class="label"> + <xsl:value-of select="bebop:datetime[@name='start']/@metadata.label"/> + </div> + <div class="dateTimeField"> + <xsl:apply-templates select="bebop:datetime[@name='start']"/> + <xsl:for-each select="bebop:formErrors[@id='start']"> + <br/> + <xsl:apply-templates select="."/> + </xsl:for-each> + </div> + </div> + <div class="input" id="endTime"> + + <div id="endTimeLabel" class="label"> + <xsl:value-of select="bebop:datetime[@name='end']/@metadata.label"/> + </div> + <div class="dateTimeField"> + <xsl:apply-templates select="bebop:datetime[@name='end']"/> + <xsl:for-each select="bebop:formErrors[@id='end']"> + <br/> + <xsl:apply-templates select="."/> + </xsl:for-each> + + </div> + </div> + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:textarea[@name='description']/@metadata.label"/> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:textarea[@name='description']"/> + <xsl:for-each select="bebop:formErrors[@id='description']"> + <br/> + <xsl:apply-templates select="."/> + + </xsl:for-each> + + </div> + </div> + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:fckeditor[@name='details']/@metadata.label"/> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:fckeditor[@name='details']"/> + + + </div> + </div> + + </div> + </div> + + </xsl:template> + + + <xsl:template match="bebop:datetime[@name='end']"> + <xsl:for-each select="*"> + + <xsl:if test="position()=4"> + <a href="#" + onClick="cal2.showCalendar('anchor2',getDateString(document.getElementById('endyear'),document.getElementById('endmonth'),document.getElementById('endday'))); return false;" + name="anchor2" id="anchor2"> + <img src="/assets/calendar.jpeg" alt="Choose a date"/> + </a> + <br/> + </xsl:if> + <xsl:if test="position()=5"> : </xsl:if> + <xsl:if test="position()=6 and last()=7"> : </xsl:if> + + <xsl:apply-templates select="."/> + </xsl:for-each> + </xsl:template> + + <xsl:template match="bebop:datetime[@name='start']"> + <xsl:for-each select="*[position() < 4]"> + <xsl:apply-templates select="."/> + </xsl:for-each> + <a href="#" + onClick="cal1.showCalendar('anchor1',getDateString(document.getElementById('startyear'),document.getElementById('startmonth'),document.getElementById('startday'))); return false;" + name="anchor1" id="anchor1"> + <img src="/assets/calendar.jpeg" alt="Choose a date"/> + </a> + <br/> + <div id="startTime"> + <xsl:apply-templates select="*[position() = 4]"/> : <xsl:apply-templates + select="*[position() > 4]"/> + </div> + + + </xsl:template> + + + + + +</xsl:stylesheet> Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-files.xsl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-files.xsl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-files.xsl 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:calendar="http://wsgfl.westsussex.gov.uk/calendar/1.0" + exclude-result-prefixes="xsl bebop calendar" version="1.0"> + + + <!-- Step 3 Attach Files --> + + <xsl:template match="calendar:fileStep"> + + <div id="appTitle">Calendar Event - Load Files</div> + <div id="app"> + <div class="section"> + + <p> + Browse to upload files from your PC or network. You can add as many documents as appropriate. Remember to click on save file before pressing ‘Next’. + + </p> + </div> + <xsl:apply-templates select ="calendar:attachedFiles" /> + <div class="section"> + <fieldset> + <legend>Attach New File</legend> + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='file']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='file']" /> + <xsl:for-each select="bebop:formErrors[@id='file']"> + <xsl:if test="position()=1"> + <br /> + <xsl:apply-templates select="." /> + </xsl:if> + </xsl:for-each> + + </div> + </div> + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:textarea[@name='fileDescription']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:textarea[@name='fileDescription']" /> + <xsl:for-each select="bebop:formErrors[@id='fileDescription']"> + <xsl:if test="position()=1"> + <br /> + <xsl:apply-templates select="." /> + </xsl:if> + </xsl:for-each> + + </div> + </div> + <div class="sectionEnd"/> + <div class="label"> + <xsl:text disable-output-escaping="yes">&</xsl:text>nbsp; + </div> + <div id="buttons"> + <xsl:apply-templates select="bebop:formWidget[@type='submit']" /> + </div> + </fieldset> + + + </div> + + + </div> + </xsl:template> + + + <xsl:template match="calendar:attachedFiles"> + <div class="section"> + <fieldset> + <legend>Attached Files</legend> + <xsl:choose> + + <xsl:when test="not(calendar:file)"> + <p> + No files attached to this Event + </p> + </xsl:when> + <xsl:otherwise> + <table> + <tr> + <td id="fileName">File</td> + <td id="fileDescription">Description</td> + <td></td> + </tr> + <xsl:for-each select="calendar:file"> + <xsl:sort select="@name"/> + <xsl:variable name="class"> + <xsl:choose> + <xsl:when test="position() mod 2"> + <xsl:text>rowOdd</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>rowEven</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <tr class="{$class}"> + + <td> + <xsl:variable name="encodedFileName"> + <xsl:call-template name="url-encode"> + <xsl:with-param name="str" select="@name"/> + </xsl:call-template> + </xsl:variable> + + <a href="{$dispatcher-prefix}{@url}&file=/{$encodedFileName}" target = "_blank"><xsl:value-of select="@name"/></a></td> + <td> + <xsl:if test="not(contains(@description, 'nbsp'))"> + <xsl:value-of select="@description"/> + </xsl:if> + </td> + <td><a href="{@deleteLink}">Remove</a></td> + + </tr> + </xsl:for-each> + </table> + </xsl:otherwise> + </xsl:choose> + + + </fieldset> + </div> + </xsl:template> + + + + +</xsl:stylesheet> Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-links.xsl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-links.xsl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-links.xsl 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:calendar="http://wsgfl.westsussex.gov.uk/calendar/1.0" + exclude-result-prefixes="xsl bebop calendar" version="1.0"> + + + <!-- Step 3 Attach Files --> + + <xsl:template match="calendar:editLinks"> + + <div id="appTitle">Calendar Event - Add Links</div> + <div id="app"> + <div class="section"> + + <p> + If required, add links to pages on this site or others. For pages on this site, locate the required page by browsing the site <a href='{$dispatcher-prefix}/portal' target='_blank'>here</a> then copy the address from the address bar + and paste it into the space below. If the page is moved or updated, the link will still work + </p> + </div> + <xsl:apply-templates select ="calendar:linksSelected" /> + <div class="section"> + <fieldset> + <legend>Add a new link</legend> + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='displayName']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='displayName']" /> + <xsl:for-each select="bebop:formErrors[@id='displayName']"> + <xsl:if test="position()=1"> + <br /> + <xsl:apply-templates select="." /> + </xsl:if> + </xsl:for-each> + + </div> + </div> + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='targetURI']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='targetURI']" /> + <xsl:for-each select="bebop:formErrors[@id='targetURI']"> + <xsl:if test="position()=1"> + <br /> + <xsl:apply-templates select="." /> + </xsl:if> + </xsl:for-each> + + </div> + </div> + + <div class="input"> + + <div class="label"> + <xsl:value-of select="bebop:formWidget[@name='linkDescription']/@metadata.label" /> + </div> + <div class="field"> + <xsl:apply-templates select="bebop:formWidget[@name='linkDescription']" /> + + + </div> + </div> + + <div class="input"> + + <div class="label"> + + </div> + <div class="checkBox"> + <xsl:apply-templates select="bebop:checkboxGroup[@name='targetWindow']" /> + + + </div> + </div> + <div class="input"> + <xsl:apply-templates select="bebop:formWidget[@type='submit']" /> + </div> + </fieldset> + + + </div> + + + </div> + </xsl:template> + + + <xsl:template match="calendar:linksSelected"> + <div class="section"> + <fieldset> + <legend>Current Links</legend> + <xsl:choose> + + <xsl:when test="not(calendar:link)"> + <p> + No links associated with this event + </p> + </xsl:when> + <xsl:otherwise> + <table> + <tr> + <td id="fileName">Link</td> + <td></td> + <td></td> + <td></td> + <td></td> + </tr> + <xsl:for-each select="calendar:link"> + <xsl:variable name="class"> + <xsl:choose> + <xsl:when test="position() mod 2"> + <xsl:text>rowOdd</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>rowEven</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <tr class="{$class}"> + + <td> + <a href="{@url}" title="{@description}"> + <xsl:if test="window='_blank'"> + <xsl:attribute name="target_window"> + <xsl:value-of select="@window"/> + </xsl:attribute> + </xsl:if> + <xsl:value-of select="@title"/> + </a> + </td> + <td><a href="{@delete-url}">Remove</a></td> + <td><a href="{@edit-url}">Edit</a></td> + <td><xsl:if test="@move-up"><a href="{@move-up}"><img src="/STATIC/portal/moveUp.gif" alt="Move Up"/></a></xsl:if></td> + <td><xsl:if test="@move-down"><a href="{@move-down}"><img src="/STATIC/portal/moveDown.gif" alt="Move Down"/></a></xsl:if></td> + + </tr> + </xsl:for-each> + </table> + </xsl:otherwise> + </xsl:choose> + + + </fieldset> + </div> + </xsl:template> + + + + +</xsl:stylesheet> Added: aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-locations.xsl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-locations.xsl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-wsgfl-custom/web/__ccm__/theme/wsgfl/calendar/edit-event-locations.xsl 2007-09-19 11:01:00 UTC (rev 1665) @@ -0,0 +1,266 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:calendar="http://wsgfl.westsussex.gov.uk/calendar/1.0" + exclude-result-prefixes="xsl bebop calendar" version="1.0"> + + + <!-- STEP 2 - select/maintain contacts --> + + <xsl:template match="calendar:eventLocationsStep"> + + <div id="appTitle">Calendar Event - Add Location(s)</div> + <div id="app"> + <div class="section"> + + <p> + Please specify the location(s) for the event + </p> + <p> + ... [truncated message content] |
Author: chrisg23 Date: 2007-09-19 13:00:32 +0200 (Wed, 19 Sep 2007) New Revision: 1664 Added: aplaws/contrib/wsx/ccm-wsx-county-directory/ aplaws/contrib/wsx/ccm-wsx-county-directory/application.xml aplaws/contrib/wsx/ccm-wsx-county-directory/pdl/ aplaws/contrib/wsx/ccm-wsx-county-directory/pdl/uk/ aplaws/contrib/wsx/ccm-wsx-county-directory/pdl/uk/gov/ aplaws/contrib/wsx/ccm-wsx-county-directory/pdl/uk/gov/westsussex/ aplaws/contrib/wsx/ccm-wsx-county-directory/pdl/uk/gov/westsussex/countydirectory/ aplaws/contrib/wsx/ccm-wsx-county-directory/pdl/uk/gov/westsussex/countydirectory/Directory.pdl aplaws/contrib/wsx/ccm-wsx-county-directory/sql/ aplaws/contrib/wsx/ccm-wsx-county-directory/sql/ccm-wsx-county-directory/ aplaws/contrib/wsx/ccm-wsx-county-directory/sql/ccm-wsx-county-directory/oracle-se-create.sql aplaws/contrib/wsx/ccm-wsx-county-directory/sql/ccm-wsx-county-directory/postgres-create.sql aplaws/contrib/wsx/ccm-wsx-county-directory/src/ aplaws/contrib/wsx/ccm-wsx-county-directory/src/ccm-wsx-county-directory.config aplaws/contrib/wsx/ccm-wsx-county-directory/src/ccm-wsx-county-directory.load aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/Directory.java aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryApplicationURLFinder.java aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryConfig.java aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryConfig_parameter.properties aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryConstants.java aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/Initializer.java aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/Loader.java aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/LookupForm.java aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/MainPanel.java aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/ResultList.java aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/UserDetails.java aplaws/contrib/wsx/ccm-wsx-county-directory/web/ aplaws/contrib/wsx/ccm-wsx-county-directory/web/WEB-INF/ aplaws/contrib/wsx/ccm-wsx-county-directory/web/WEB-INF/bebop-define.tld aplaws/contrib/wsx/ccm-wsx-county-directory/web/WEB-INF/bebop-show.tld aplaws/contrib/wsx/ccm-wsx-county-directory/web/WEB-INF/web.xml aplaws/contrib/wsx/ccm-wsx-county-directory/web/__ccm__/ aplaws/contrib/wsx/ccm-wsx-county-directory/web/__ccm__/apps/ aplaws/contrib/wsx/ccm-wsx-county-directory/web/__ccm__/apps/county-directory/ aplaws/contrib/wsx/ccm-wsx-county-directory/web/__ccm__/apps/county-directory/lib/ aplaws/contrib/wsx/ccm-wsx-county-directory/web/__ccm__/apps/county-directory/lib/directory-form.xsl aplaws/contrib/wsx/ccm-wsx-county-directory/web/__ccm__/apps/county-directory/lib/directory-list.xsl aplaws/contrib/wsx/ccm-wsx-county-directory/web/__ccm__/apps/county-directory/lib/main-panel.xsl aplaws/contrib/wsx/ccm-wsx-county-directory/web/__ccm__/apps/county-directory/lib/user-details.xsl aplaws/contrib/wsx/ccm-wsx-county-directory/web/__ccm__/apps/county-directory/xsl/ aplaws/contrib/wsx/ccm-wsx-county-directory/web/__ccm__/apps/county-directory/xsl/index.css aplaws/contrib/wsx/ccm-wsx-county-directory/web/__ccm__/apps/county-directory/xsl/index.xsl aplaws/contrib/wsx/ccm-wsx-county-directory/web/templates/ aplaws/contrib/wsx/ccm-wsx-county-directory/web/templates/ccm-wsx-county-directory/ aplaws/contrib/wsx/ccm-wsx-county-directory/web/templates/ccm-wsx-county-directory/index.jsp Log: Online directory application (the name county directory is historical - there is nothing county specific about the module) - interface to the LDAP directory managed by ccm-wsx-ldap module. Includes application screen with various search options - form can be embedded on the portal homepage as a component - only visible to users with read access to the directory application. See portal/index.jsp in ccm-wsx-wsgfl-custom for example use Added: aplaws/contrib/wsx/ccm-wsx-county-directory/application.xml =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/application.xml (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/application.xml 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<ccm:application name="ccm-wsx-county-directory" prettyName="LDAP Lookup for Schools" version="1.0.1" release="1" xmlns:ccm="http://ccm.redhat.com/ccm-project"> + + <ccm:dependencies> + <ccm:requires name="ccm-ldn-terms" version="1.0.1" /> + <ccm:requires name="ccm-wsx-ldap" version="1.0.2" /> + + </ccm:dependencies> + + + <ccm:contacts> + <ccm:contact uri="http://wsgfl.westsussex.gov.uk" type="website" /> + <ccm:contact uri="mailto:chr...@we..." type="support" /> + </ccm:contacts> + + <ccm:description>LDAP Lookup for Schools</ccm:description> + +</ccm:application> Added: aplaws/contrib/wsx/ccm-wsx-county-directory/pdl/uk/gov/westsussex/countydirectory/Directory.pdl =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/pdl/uk/gov/westsussex/countydirectory/Directory.pdl (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/pdl/uk/gov/westsussex/countydirectory/Directory.pdl 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,16 @@ +model uk.gov.westsussex.countydirectory; + +import com.arsdigita.web.Application; + +// nothing persistent at all for this application, so +// just need to make acs_objects aware of the fact that +// the Directory Application is a domain object +object type Directory extends Application { + + +} + + + + + Added: aplaws/contrib/wsx/ccm-wsx-county-directory/sql/ccm-wsx-county-directory/oracle-se-create.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/sql/ccm-wsx-county-directory/oracle-se-create.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/sql/ccm-wsx-county-directory/oracle-se-create.sql 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1 @@ +@ ddl/oracle-se/create.sql Added: aplaws/contrib/wsx/ccm-wsx-county-directory/sql/ccm-wsx-county-directory/postgres-create.sql =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/sql/ccm-wsx-county-directory/postgres-create.sql (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/sql/ccm-wsx-county-directory/postgres-create.sql 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,3 @@ +begin; +\i ddl/postgres/create.sql +end; Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/ccm-wsx-county-directory.config =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/ccm-wsx-county-directory.config (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/ccm-wsx-county-directory.config 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<registry> + <config class="uk.gov.westsussex.countydirectory.DirectoryConfig" + storage="ccm-wsx-county-directory/directory.properties"/> +</registry> Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/ccm-wsx-county-directory.load =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/ccm-wsx-county-directory.load (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/ccm-wsx-county-directory.load 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,15 @@ +<load> + <requires> + <table name="inits"/> + <table name="acs_objects"/> + <initializer class="com.arsdigita.core.Initializer"/> + + </requires> + <provides> + <initializer class="uk.gov.westsussex.countydirectory.Initializer"/> + </provides> + <scripts> + <schema directory="ccm-wsx-county-directory"/> + <data class="uk.gov.westsussex.countydirectory.Loader"/> + </scripts> +</load> Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/Directory.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/Directory.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/Directory.java 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,54 @@ +/* + * Created on 27-Jun-05 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package uk.gov.westsussex.countydirectory; + +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import com.arsdigita.web.Application; + +/** + * @author cgyg9330 + * + * Boilerplate application stuff + */ +public class Directory extends Application { + + private static DirectoryConfig s_config = new DirectoryConfig(); + + static { + s_config.load(); + } + + public static DirectoryConfig getConfig() { + return s_config; + } + + public static Directory getApplication() { + return (Directory) Application.retrieveApplicationForPath( + "/county-directory/"); + } + + public static final String BASE_DATA_OBJECT_TYPE = + "uk.gov.westsussex.countydirectory.Directory"; + + public Directory(DataObject obj) { + super(obj); + } + + public Directory(OID oid) { + super(oid); + } + + public String getContextPath() { + return "/ccm-wsx-county-directory"; + } + + public String getServletPath() { + return "/files"; + } + +} Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryApplicationURLFinder.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryApplicationURLFinder.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryApplicationURLFinder.java 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM Public + * License (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the + * License at http://www.redhat.com/licenses/ccmpl.html. + * + * Software distributed under the License is distributed on an + * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express + * or implied. See the License for the specific language + * governing rights and limitations under the License. + * + */ +package uk.gov.westsussex.countydirectory; + +import org.apache.log4j.Logger; + +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.NoValidURLException; +import com.arsdigita.kernel.URLFinder; +import com.arsdigita.persistence.OID; +import com.arsdigita.web.Application; +import com.arsdigita.web.URL; + +public class DirectoryApplicationURLFinder implements URLFinder { + + private static final Logger s_log = Logger.getLogger(DirectoryApplicationURLFinder.class); + + public String find(OID oid,String context) throws NoValidURLException { + + return find(oid); + + } + + /* (non-Javadoc) + * @see com.arsdigita.kernel.URLFinder#find(com.arsdigita.persistence.OID) + */ + public String find(OID oid) throws NoValidURLException { + Application directory; + + try { + directory = (Application)DomainObjectFactory.newInstance(oid); + + } catch (DataObjectNotFoundException ex) { + throw new NoValidURLException( + "cannot instantiate application " + oid + + " message: " + ex.getMessage() + ); + } + + return URL.getDispatcherPath() + directory.getPath(); + } + + +} Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryConfig.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryConfig.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryConfig.java 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM Public + * License (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of + * the License at http://www.redhat.com/licenses/ccmpl.html + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + */ + +package uk.gov.westsussex.countydirectory; + +import java.util.Collection; +import java.util.HashSet; + +import com.arsdigita.london.terms.Domain; +import com.arsdigita.london.terms.Term; +import com.arsdigita.london.terms.Util; +import com.arsdigita.runtime.AbstractConfig; +import com.arsdigita.util.parameter.Parameter; +import com.arsdigita.util.parameter.StringArrayParameter; +import com.arsdigita.util.parameter.StringParameter; +import com.arsdigita.web.Application; + +/** + * Specification of configuration parameters - navigation categories + * and people to be notified of problems with the directory + * + * Note - in an ideal world application could be assigned to navigation + * categories in ccm/portal/admin/sitemap.jsp but unfortunately that + * page is used by sites that don't have ccm-ldn-navigation or + * ccm-ldn-terms installed + * + * @author Chris Gilbert <chr...@we...> + * @version $Id: DirectoryConfig.java,v 1.4 2007/09/04 10:22:26 cgyg9330 Exp $ + */ +public class DirectoryConfig extends AbstractConfig { + public final static String versionId = + "$Id: DirectoryConfig.java,v 1.4 2007/09/04 10:22:26 cgyg9330 Exp $" + + "$Author: cgyg9330 $" + + "$DateTime: 2004/03/18 11:10:20 $"; + + private static Collection cachedNavTerms = null; + + private StringArrayParameter navTerms = + new StringArrayParameter( + "uk.gov.westsussex.countydirectory.navigation_terms", + Parameter.OPTIONAL, + null); + + private StringParameter notificationRecipients = new StringParameter + ("uk.gov.westsussex.countydirectory.directory_broken_notification_recipients", Parameter.REQUIRED, "ws...@we..."); + public DirectoryConfig() { + + register(navTerms); + register(notificationRecipients); + loadInfo(); + } + + public final Collection getNavigationTerms() { + if (cachedNavTerms == null) { + cachedNavTerms = new HashSet(); + + Domain navigation = + Util.getApplicationDomain( + Application.retrieveApplicationForPath("/navigation/")); + String[] termIDs = (String[]) get(navTerms); + + if (termIDs != null) { + + for (int i = 0; i < termIDs.length; i++) { + Term navTerm = navigation.getTerm(new Integer(termIDs[i])); + cachedNavTerms.add(navTerm); + } + } + } + return cachedNavTerms; + } + + public String getDirectoryBrokenNotificationRecipients() { + return (String)get(notificationRecipients); + + } +} Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryConfig_parameter.properties =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryConfig_parameter.properties (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryConfig_parameter.properties 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,9 @@ +uk.gov.westsussex.countydirectory.navigation_terms.title=Navigation Terms +uk.gov.westsussex.countydirectory.navigation_terms.purpose=Terms under which this application is categorised +uk.gov.westsussex.countydirectory.navigation_terms.example=123,345 +uk.gov.westsussex.countydirectory.navigation_terms.format=[string,string,string] + +uk.gov.westsussex.countydirectory.directory_broken_notification_recipients.title=Directory Broken Notification Recipients +uk.gov.westsussex.countydirectory.directory_broken_notification_recipients.purpose=Comma delimited list of mail addresses to notify when directory unavailable +uk.gov.westsussex.countydirectory.directory_broken_notification_recipients.example=te...@ex...,te...@ex... +uk.gov.westsussex.countydirectory.directory_broken_notification_recipients.format=[string] Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryConstants.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryConstants.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/DirectoryConstants.java 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,37 @@ +/* + * Created on 27-Jun-05 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package uk.gov.westsussex.countydirectory; + +/** + * @author cgyg9330 + * + */ +public interface DirectoryConstants { + + public static final String XML_NS = + "http://wsgfl.westsussex.gov.uk/county-directory/1.0"; + public static final String XML_PREFIX = "county-directory"; + + public static final String APPLICATION_KEY = "county-directory"; + + //form field names used by main application form and portlet + public static final String FIRST_NAME_FIELD = "firstName"; + public static final String LAST_NAME_FIELD = "lastName"; + public static final String PHONE_FIELD = "phone"; + public static final String TEAM_FIELD = "team"; + public static final String UNIT_FIELD = "unit"; + public static final String GROUP_FIELD = "group"; + public static final String ALL_FIELD = "all"; + + public static final String LOOKUP_FORM_NAME = "lookupForm"; + + + + + + +} Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/Initializer.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/Initializer.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/Initializer.java 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,98 @@ +/* + * Created on 28-Jun-05 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package uk.gov.westsussex.countydirectory; + +import java.util.Iterator; + +import com.arsdigita.db.DbHelper; +import com.arsdigita.domain.DomainCollection; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.kernel.ACSObjectInstantiator; +import com.arsdigita.london.terms.Term; +import com.arsdigita.london.terms.Util; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.pdl.ManifestSource; +import com.arsdigita.persistence.pdl.NameFilter; +import com.arsdigita.runtime.CompoundInitializer; +import com.arsdigita.runtime.DomainInitEvent; +import com.arsdigita.runtime.LegacyInitEvent; +import com.arsdigita.runtime.PDLInitializer; +import com.arsdigita.runtime.RuntimeConfig; +import com.arsdigita.web.Application; + +/** + * @author cgyg9330 + * + * Register domain object instantiators and also make sure + * application is assigned to the navigation categories + * currently specified in configuration + */ +public class Initializer + extends CompoundInitializer + implements DirectoryConstants { + + public Initializer() { + final String url = RuntimeConfig.getConfig().getJDBCURL(); + final int database = DbHelper.getDatabaseFromURL(url); + + add( + new PDLInitializer( + new ManifestSource( + "ccm-wsx-county-directory.pdl.mf", + new NameFilter( + DbHelper.getDatabaseSuffix(database), + "pdl")))); + } + + public void init(DomainInitEvent e) { + super.init(e); + + e + .getFactory() + .registerInstantiator( + Directory.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + public DomainObject doNewInstance(DataObject dataObject) { + return new Directory(dataObject); + } + }); + + + } + + public final void init(final LegacyInitEvent e) { + super.init(e); + + // assign application to the correct navigation terms by + // just removing it from any existing nav terms and then + // adding it to the ones specified in config. + // + // This does mean a bit of unneccessary deleting and inserting on + // server restart but that's life + Application directory = Directory.getApplication(); + if (directory != null) { + + DomainCollection currentTerms = + Util + .getApplicationDomain( + Application.retrieveApplicationForPath("/navigation/")) + .getDirectTerms(directory); + while (currentTerms.next()) { + Term term = (Term) currentTerms.getDomainObject(); + term.removeObject(directory); + } + + // add new mappings + Iterator it = Directory.getConfig().getNavigationTerms().iterator(); + while (it.hasNext()) { + Term navTerm = (Term) it.next(); + navTerm.addObject(directory); + } + } + + } +} \ No newline at end of file Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/Loader.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/Loader.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/Loader.java 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2004 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM Public + * License (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of + * the License at http://www.redhat.com/licenses/ccmpl.html + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + */ +package uk.gov.westsussex.countydirectory; + +import org.apache.log4j.Logger; + +import com.arsdigita.domain.DomainObject; +import com.arsdigita.kernel.ACSObjectInstantiator; +import com.arsdigita.kernel.Group; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelExcursion; +import com.arsdigita.kernel.permissions.PermissionDescriptor; +import com.arsdigita.kernel.permissions.PermissionService; +import com.arsdigita.kernel.permissions.PrivilegeDescriptor; +import com.arsdigita.loader.PackageLoader; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.runtime.ScriptContext; +import com.arsdigita.web.Application; +import com.arsdigita.web.ApplicationSetup; +import com.arsdigita.web.ApplicationType; + +/** + * Loader - Create the application type and instance (we only ever need + * one) and create access group and assign permission to the group. + * + * Note the portlet is only visible to logged in users who are members + * of the group (directly or indirectly) + * + * @author Chris Gilbert + * @version $Id: Loader.java,v 1.5 2007/09/04 10:22:26 cgyg9330 Exp $ + */ +public class Loader extends PackageLoader implements DirectoryConstants { + public final static String versionId = + "$Id: Loader.java,v 1.5 2007/09/04 10:22:26 cgyg9330 Exp $" + + "$Author: cgyg9330 $" + + "$DateTime: 2004/03/17 08:31:10 $"; + + private static final Logger s_log = Logger.getLogger(Loader.class); + + public void run(final ScriptContext ctx) { + new KernelExcursion() { + public void excurse() { + setEffectiveParty(Kernel.getSystemParty()); + Directory directory = setupApplication(); + createGroupsAndPermissions(directory); + } + } + .run(); + } + + /** + * + */ + protected void createGroupsAndPermissions(Directory directory) { + Group group = new Group(); + group.setName("County Directory Viewers"); + + PermissionDescriptor readDirectory = + new PermissionDescriptor( + PrivilegeDescriptor.READ, + directory, + group); + PermissionService.grantPermission(readDirectory); + + } + + private Directory setupApplication() { + s_log.debug("start - setUpApplication"); + System.out.println("setting up application"); + ApplicationSetup setup = new ApplicationSetup(s_log); + + setup.setApplicationObjectType(Directory.BASE_DATA_OBJECT_TYPE); + setup.setKey(APPLICATION_KEY); + setup.setTitle("Online Directory of WSCC Staff"); + setup.setDescription( + "Allow school users to find details of county staff"); + setup.setSingleton(true); + setup.setInstantiator(new ACSObjectInstantiator() { + public DomainObject doNewInstance(DataObject dataObject) { + return new Directory(dataObject); + } + }); + s_log.debug("set up the application setup - now to run it"); + ApplicationType type = setup.run(); + type.save(); + + s_log.debug( + "app type created - now lets create an application instance"); + Directory app = + (Directory) Application.createApplication( + type, + APPLICATION_KEY, + "LDAP Lookup for Schools", + null); + app.save(); + System.out.println("finished creating application"); + return app; + } + + +} Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/LookupForm.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/LookupForm.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/LookupForm.java 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,306 @@ +/* + * Created on 29-Mar-06 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package uk.gov.westsussex.countydirectory.ui; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; + +import uk.gov.westsussex.countydirectory.Directory; +import uk.gov.westsussex.countydirectory.DirectoryConstants; + +import com.arsdigita.bebop.ActionLink; +import com.arsdigita.bebop.Form; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.bebop.event.ActionEvent; +import com.arsdigita.bebop.event.ActionListener; +import com.arsdigita.bebop.event.FormInitListener; +import com.arsdigita.bebop.event.FormProcessListener; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.event.FormValidationListener; +import com.arsdigita.bebop.form.Submit; +import com.arsdigita.bebop.form.TextField; +import com.arsdigita.bebop.parameters.BooleanParameter; +import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.Party; +import com.arsdigita.kernel.permissions.PermissionDescriptor; +import com.arsdigita.kernel.permissions.PermissionService; +import com.arsdigita.kernel.permissions.PrivilegeDescriptor; +import com.arsdigita.xml.Element; + +/** + * @author cdeg9850 + * + * This form is usually a single component in the application panel + * but it has also been designed so that it can exist independently of its + * panel so that it can be added to the homepage as a component - the xml generated + * independently is sufficient to display a simple lookup form that directs to + * the main application page when submitted. + * + */ +public class LookupForm + extends Form + implements FormProcessListener, FormValidationListener, FormInitListener { + + private MainPanel parent; + + // StringParameters are used here so we can pass the information around + // between different components - eg search results. It looks like a load of + // duplication but the parameters underlying the form fields are local to the form + // and so cannot be viewed by other components. Should have been possible to + // create a bean and put it in a RequestLocal, but isn't - see comments in + // MainPanel + private StringParameter firstNameParam; + private StringParameter lastNameParam; + private StringParameter phoneParam; + private StringParameter teamParam; + private StringParameter unitParam; + private StringParameter groupParam; + private StringParameter allParam; + + private BooleanParameter fromHome = new BooleanParameter("home"); + + private TextField firstName; + private TextField lastName; + private TextField phone; + private TextField team; + private TextField unit; + private TextField group; + private TextField all; + + // two modes for searching + private ActionLink advanced; + private ActionLink basic; + + private Logger s_log = Logger.getLogger(LookupForm.class); + + /** + * Used by the homepage component to create a spoof form. Action points to the real form in this application + * + * reviewing the code it looks like there should be a nullpointer exception when we + * get to the process method. But there isn't because when the form is submitted from the homepage the + * MainPanel is instantiated with a different instance of LookupForm that has been properly + * constructed with real parameters. It is the other lookupform which actually handles the form submission. + * The homepage dummy form is for display and gathering form values only. It doesn't exist in the context + * of the directory application and so it is not found when the action points to /ccm/county-directory... + * + */ + public LookupForm() { + this(null,null, null, null, null, null, null, null); + + } + + /** + * @param name + * @param panel + */ + public LookupForm( + MainPanel parent, + StringParameter firstName, + StringParameter lastName, + StringParameter phone, + StringParameter team, + StringParameter unit, + StringParameter group, + StringParameter all) { + super( + DirectoryConstants.LOOKUP_FORM_NAME, + new SimpleContainer( + DirectoryConstants.XML_PREFIX + ":lookup", + DirectoryConstants.XML_NS)); + + setRedirecting(true); + setMethod(Form.POST); + this.parent = parent; + firstNameParam = firstName; + lastNameParam = lastName; + phoneParam = phone; + teamParam = team; + unitParam = unit; + groupParam = group; + allParam = all; + + addWidgets(); + addProcessListener(this); + addValidationListener(this); + addInitListener(this); + } + + private void addWidgets() { + firstName = new TextField(DirectoryConstants.FIRST_NAME_FIELD); + firstName.setMetaDataAttribute("label", "First Name"); + firstName.setHint( + "Enter the whole or part of the first name - if you are not sure of the spelling, replace any part of the name with *"); + lastName = new TextField(DirectoryConstants.LAST_NAME_FIELD); + lastName.setMetaDataAttribute("label", "Last Name"); + lastName.setHint( + "Enter the whole or part of the last name - if you are not sure of the spelling, replace any part of the name with *"); + phone = new TextField(DirectoryConstants.PHONE_FIELD); + phone.setMetaDataAttribute("label", "Phone"); + phone.setHint("Enter part of the phone number."); + + team = new TextField(DirectoryConstants.TEAM_FIELD); + team.setMetaDataAttribute("label", "Team"); + team.setHint("Enter the whole or part of the team name - if you are not sure of the spelling, replace any part of the name with *"); + unit = new TextField(DirectoryConstants.UNIT_FIELD); + unit.setMetaDataAttribute("label", "Unit"); + unit.setHint("Enter the whole or part of the unit name - if you are not sure of the spelling, replace any part of the name with *"); + group = new TextField(DirectoryConstants.GROUP_FIELD); + group.setMetaDataAttribute("label", "Group"); + group.setHint("Enter the whole or part of the group name - if you are not sure of the spelling, replace any part of the name with *"); + all = new TextField(DirectoryConstants.ALL_FIELD); + all.setMetaDataAttribute("label", "Search All Fields"); + all.setHint("Enter text here and we will search for a match in any of the information we hold for staff - if you are not sure of the spelling, replace any part of the text with *"); + + advanced = new ActionLink("Advanced Options"); + advanced.setClassAttr("linkButton"); + advanced.addActionListener(new ActionListener() { + //reveal the optional fields + public void actionPerformed(ActionEvent e) { + PageState state = e.getPageState(); + phone.setVisible(state, true); + team.setVisible(state, true); + unit.setVisible(state, true); + group.setVisible(state, true); + all.setVisible(state, true); + basic.setVisible(state, true); + advanced.setVisible(state, false); + parent.hideResults(state); + + } + }); + basic = new ActionLink("Basic Options"); + basic.setClassAttr("linkButton"); + basic.addActionListener(new ActionListener() { + // hide the additional fields and clear values from them + public void actionPerformed(ActionEvent e) { + PageState state = e.getPageState(); + phone.setVisible(state, false); + team.setVisible(state, false); + unit.setVisible(state, false); + group.setVisible(state, false); + all.setVisible(state, false); + basic.setVisible(state, false); + advanced.setVisible(state, true); + parent.hideResults(state); + state.setValue(phoneParam, null); + state.setValue(teamParam, null); + state.setValue(unitParam, null); + state.setValue(groupParam, null); + + } + }); + Submit submit = new Submit("Search"); + submit.setClassAttr("linkButton"); + add(firstName); + add(lastName); + add(phone); + add(team); + add(unit); + add(group); + add(all); + add(submit); + add(advanced); + add(basic); + } + + /* (non-Javadoc) + * @see com.arsdigita.bebop.event.FormInitListener#init(com.arsdigita.bebop.event.FormSectionEvent) + */ + public void init(FormSectionEvent e) throws FormProcessException { + + s_log.debug("form init"); + PageState state = e.getPageState(); + if (state.getValue(fromHome) != null) { + // if init is called when we are coming from home then + // we must have pressed the advance options link - the + // only other possibility from home is pressing submit + // and that request goes direct to process + s_log.debug("setting advanced options visible"); + phone.setVisible(state, true); + team.setVisible(state, true); + unit.setVisible(state, true); + group.setVisible(state, true); + all.setVisible(state, true); + basic.setVisible(state, true); + advanced.setVisible(state, false); + state.setValue(fromHome, null); + } + + } + + /* (non-Javadoc) + * populate the parameters that are accessed by other components + */ + public void process(FormSectionEvent e) throws FormProcessException { + PageState state = e.getPageState(); + state.setValue(firstNameParam, StringUtils.strip((String)firstName.getValue(state))); + state.setValue(lastNameParam, StringUtils.strip((String)lastName.getValue(state))); + state.setValue(phoneParam, StringUtils.strip((String)phone.getValue(state))); + state.setValue(teamParam, StringUtils.strip((String)team.getValue(state))); + state.setValue(unitParam, StringUtils.strip((String)unit.getValue(state))); + state.setValue(groupParam, StringUtils.strip((String)group.getValue(state))); + state.setValue(allParam, StringUtils.strip((String)all.getValue(state))); + + fireCompletionEvent(state); + } + + /* + * Don't let users search for all members of the directory as this brings back too many results + */ + public void validate(FormSectionEvent e) throws FormProcessException { + PageState state = e.getPageState(); + + // if not from home + if (StringUtils.isBlank((String) firstName.getValue(state)) + && StringUtils.isBlank((String) lastName.getValue(state)) + && StringUtils.isBlank((String) phone.getValue(state)) + && StringUtils.isBlank((String) team.getValue(state)) + && StringUtils.isBlank((String) unit.getValue(state)) + && StringUtils.isBlank((String) group.getValue(state)) + && StringUtils.isBlank((String) all.getValue(state))) { + + parent.hideResults(state); + throw new FormProcessException("Please enter some details in one or more search fields"); + } + } + + //should use security container but there are problems with adding + //widgets to the form hence quick security check here + public void generateXML(PageState state, Element p) { + Party party = Kernel.getContext().getParty(); + if (party == null) { + party = Kernel.getPublicUser(); + } + PermissionDescriptor read = + new PermissionDescriptor( + PrivilegeDescriptor.READ, + Directory.getApplication(), + party); + if (PermissionService.checkPermission(read)) { + super.generateXML(state, p); + } + } + + public void register(Page p) { + super.register(p); + // could be component state param, but then the request parameter + // name is not predictable enough to use on the portlet + p.addGlobalStateParam(fromHome); + p.setVisibleDefault(phone, false); + p.setVisibleDefault(team, false); + p.setVisibleDefault(unit, false); + p.setVisibleDefault(group, false); + p.setVisibleDefault(basic, false); + p.setVisibleDefault(all, false); + + } + +} Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/MainPanel.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/MainPanel.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/MainPanel.java 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2004 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM Public + * License (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of + * the License at http://www.redhat.com/licenses/ccmpl.html + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + */ + +package uk.gov.westsussex.countydirectory.ui; + +import org.apache.log4j.Logger; + +import uk.gov.westsussex.countydirectory.DirectoryConstants; + +import com.arsdigita.bebop.Component; +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.event.ActionEvent; +import com.arsdigita.bebop.event.ActionListener; +import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.london.util.ui.ModalContainer; + +public class MainPanel extends ModalContainer { + + private LookupForm lookupForm; + private ResultList resultList; + private UserDetails userDetails; + // string parameters used to store information entered by user + // so that it can be accessed by all components thoughout the + // handling of requests + private StringParameter firstName = new StringParameter("firstNameP"); + private StringParameter lastName = new StringParameter("lastNameP"); + private StringParameter phone = new StringParameter("phoneP"); + private StringParameter team = new StringParameter("teamP"); + private StringParameter unit = new StringParameter("unitP"); + private StringParameter group = new StringParameter("groupP"); + private StringParameter all = new StringParameter("allP"); + + + + private StringParameter uid = new StringParameter("uid"); + private static Logger s_log = Logger.getLogger(MainPanel.class); + + public static final String MODE_FORM_ONLY = "form"; + public static final String MODE_LIST_RESULTS = "list"; + public static final String MODE_DISPLAY_USER = "display"; + + public MainPanel() { + + super( + DirectoryConstants.XML_PREFIX + ":main-panel", + DirectoryConstants.XML_NS); + + lookupForm = new LookupForm(this, firstName, lastName, phone, team, unit, group, all); + resultList = new ResultList(uid, firstName, lastName, phone, team, unit, group, all); + userDetails = new UserDetails(uid); + // resultlist completes when details link is selected for a specific user + resultList.addCompletionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + setMode(e.getPageState(), MODE_DISPLAY_USER); + } + }); + // lookupform completes when sumbission is processed + lookupForm.addCompletionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + s_log.debug("form completed"); + setMode(e.getPageState(), MODE_LIST_RESULTS); + } + }); + + add(userDetails); + add(lookupForm); + add(resultList); + + // lookup form is visible in all modes so another search can be carried + // out at any time + registerMode( + MODE_LIST_RESULTS, + new Component[] { lookupForm, resultList }); + registerMode(MODE_DISPLAY_USER, new Component[] { lookupForm, userDetails }); + + registerMode(MODE_FORM_ONLY, new Component[] {lookupForm}); + + setDefaultMode(MODE_FORM_ONLY); + + } + + public void hideResults (PageState state) { + setMode(state, MODE_FORM_ONLY); + } + public void register(Page p) { + super.register(p); + // this should have been possible with RequestLocals rather than + // global parameters, as info is only passed between components + // during the processing of a single request. However, for some + // reason I couldn't fathom, the request ID changes when a completion + // event is fired and so the mode changes + p.addGlobalStateParam(firstName); + p.addGlobalStateParam(lastName); + p.addGlobalStateParam(phone); + p.addGlobalStateParam(team); + p.addGlobalStateParam(unit); + p.addGlobalStateParam(group); + p.addGlobalStateParam(uid); + p.addGlobalStateParam(all); + } + + +} Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/ResultList.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/ResultList.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/ResultList.java 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,224 @@ +/* + * Created on 29-Mar-06 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package uk.gov.westsussex.countydirectory.ui; + +import java.io.IOException; +import java.text.DateFormat; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import javax.mail.MessagingException; +import javax.mail.SendFailedException; +import javax.naming.NamingException; +import javax.naming.SizeLimitExceededException; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; + +import uk.gov.westsussex.countydirectory.Directory; +import uk.gov.westsussex.countydirectory.DirectoryConstants; +import uk.gov.westsussex.ldap.LDAPConstants; +import uk.gov.westsussex.ldap.LDAPDirectory; +import uk.gov.westsussex.ldap.LDAPUser; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SimpleComponent; +import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.mail.Mail; +import com.arsdigita.util.UncheckedWrapperException; +import com.arsdigita.xml.Element; + +/** + * @author cdeg9850 + * + * Display a list of users that match the search criteria. + */ +public class ResultList extends SimpleComponent { + + // search criteria are held in these parameters that are + // populated by the lookup form when it is processed + private StringParameter firstName; + private StringParameter lastName; + private StringParameter phone; + private StringParameter team; + private StringParameter unit; + private StringParameter group; + private StringParameter all; + + private StringParameter uid; + private static Logger s_log = Logger.getLogger(ResultList.class); + private static boolean notify = true; + + public ResultList( + StringParameter uid, + StringParameter firstName, + StringParameter lastName, + StringParameter phone, + StringParameter team, + StringParameter unit, + StringParameter group, + StringParameter all) { + super(); + this.uid = uid; + this.firstName = firstName; + this.lastName = lastName; + this.phone = phone; + this.team = team; + this.unit = unit; + this.group = group; + this.all = all; + + } + + public void generateXML(PageState state, Element p) { + Element main = + p.newChildElement( + DirectoryConstants.XML_PREFIX + ":resultList", + DirectoryConstants.XML_NS); + + if (StringUtils.isBlank((String) state.getValue(firstName)) + && StringUtils.isBlank((String) state.getValue(lastName)) + && StringUtils.isBlank((String) state.getValue(phone)) + && StringUtils.isBlank((String) state.getValue(team)) + && StringUtils.isBlank((String) state.getValue(unit)) + && StringUtils.isBlank((String) state.getValue(group)) + && StringUtils.isBlank((String) state.getValue(all))) { + + //a form validation error occurred in the lookup form + // so don't display anything + return; + } + + try { + Collection results = getResults(state); + Iterator resultsIterator = results.iterator(); + Element resultElement = null; + if (results.isEmpty()) { + main.newChildElement( + DirectoryConstants.XML_PREFIX + ":noResults", + DirectoryConstants.XML_NS); + } else { + resultElement = + main.newChildElement( + DirectoryConstants.XML_PREFIX + ":results", + DirectoryConstants.XML_NS); + } + + while (resultsIterator.hasNext()) { + LDAPUser user = (LDAPUser) resultsIterator.next(); + Element userElement = + resultElement.newChildElement( + DirectoryConstants.XML_PREFIX + ":user", + DirectoryConstants.XML_NS); + userElement.addAttribute("given-name", user.getGivenName()); + userElement.addAttribute("family-name", user.getSN()); + userElement.addAttribute( + "email", + (String) user.getMail().get(0)); + userElement.addAttribute("url", getURL(user.getUID(), state)); + userElement.addAttribute("telephone", user.getPhone()); + } + notify = true; + } catch (SizeLimitExceededException sle) { + main.newChildElement( + DirectoryConstants.XML_PREFIX + ":tooManyResults", + DirectoryConstants.XML_NS); + } catch (Exception e) { + // send out an email to alert someone to problems + // on LDAP directory - notify instance variable + // ensures only one email is sent - rather than one for every time + // another user encounters the same problem. variable is reset + // once a successful search is carried out + main.newChildElement( + DirectoryConstants.XML_PREFIX + ":directoryBroken", + DirectoryConstants.XML_NS); + s_log.error("LDAP Problem", e); + if (notify) { + notify = false; + Mail mail = new Mail(); + mail.setBody( + "There are problems with the WSGfL County Directory Lookup. \n\n" + + "The LDAP Directory is not available. \n\n Please submit a helpcall to the IT help desk and tell them that the date and time of the error was " + + DateFormat.getInstance().format(new Date()) + + "."); + mail.setFrom("wsg...@we..."); + mail.setTo( + Directory + .getConfig() + .getDirectoryBrokenNotificationRecipients()); + mail.setSubject("County Directory Error"); + try { + mail.send(); + } catch (SendFailedException e1) { + s_log.error( + "Failed to send notification of LDAP problem.", + e1); + } catch (MessagingException e1) { + s_log.error( + "Failed to send notification of LDAP problem.", + e1); + } + } + } + + } + + /** + * request results via ccm-wsx-ldap + * @param state + * @return + * @throws NamingException + */ + private Collection getResults(PageState state) throws NamingException { + String enteredFirstName = (String) state.getValue(firstName); + String enteredLastName = (String) state.getValue(lastName); + String enteredPhone = (String) state.getValue(phone); + String enteredTeam = (String) state.getValue(team); + String enteredUnit = (String) state.getValue(unit); + String enteredGroup = (String) state.getValue(group); + String enteredAll = (String) state.getValue(all); + + s_log.debug("retrieved given name : " + enteredFirstName); + s_log.debug("retrieved family name : " + enteredLastName); + s_log.debug("request id is " + state.getRequest()); + + Map criteria = new HashMap(); + criteria.put(LDAPConstants.FIRST_NAME, enteredFirstName); + criteria.put(LDAPConstants.LAST_NAME, enteredLastName); + criteria.put(LDAPConstants.FULL_PHONE, enteredPhone); + criteria.put(LDAPConstants.TEAM, enteredTeam); + criteria.put(LDAPConstants.UNIT, enteredUnit); + criteria.put(LDAPConstants.GROUP, enteredGroup); + String[] attributes = new String[]{LDAPConstants.FIRST_NAME, LDAPConstants.LAST_NAME, LDAPConstants.FULL_PHONE, LDAPConstants.MOBILE, LDAPConstants.EMAIL, LDAPConstants.JOB_TITLE, LDAPConstants.TEAM, LDAPConstants.UNIT, LDAPConstants.GROUP, LDAPConstants.LOCATION, LDAPConstants.BUILDING, LDAPConstants.TOWN}; + return LDAPDirectory.retrieve().getMatches(criteria, enteredAll, + attributes); + + } + + private String getURL(String uid, PageState state) { + state.setControlEvent(this, "uid", uid); + + String url = null; + try { + url = state.stateAsURL(); + } catch (IOException ex) { + throw new UncheckedWrapperException("cannot create url", ex); + } + state.clearControlEvent(); + return url; + } + + public void respond(PageState state) + throws javax.servlet.ServletException { + state.setValue(uid, state.getControlEventValue()); + fireCompletionEvent(state); + } + +} \ No newline at end of file Added: aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/UserDetails.java =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/UserDetails.java (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/src/uk/gov/westsussex/countydirectory/ui/UserDetails.java 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,83 @@ +/* + * Created on 30-Mar-06 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package uk.gov.westsussex.countydirectory.ui; + +import uk.gov.westsussex.countydirectory.DirectoryConstants; +import uk.gov.westsussex.ldap.LDAPDirectory; +import uk.gov.westsussex.ldap.LDAPUser; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SimpleComponent; +import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.xml.Element; + +/** + * @author cdeg9850 + * + * Display details for an individual user as + * held in LDAP directory + */ +public class UserDetails extends SimpleComponent { + + StringParameter uid; + + public UserDetails(StringParameter uid) { + super(); + this.uid = uid; + } + + public void generateXML(PageState state, Element p) { + + if (state.getValue(uid) == null){ + return; + } + + Element main = + p.newChildElement( + DirectoryConstants.XML_PREFIX + ":displayUser", + DirectoryConstants.XML_NS); + try { + + LDAPUser user = + LDAPDirectory.retrieve().getUser((String)state.getValue(uid)); + + Element userElement = main.newChildElement("personalTitle"); + userElement.setText(user.getPersonalTitle()); + userElement = main.newChildElement("firstName"); + userElement.setText(user.getGivenName()); + userElement = main.newChildElement("lastName"); + userElement.setText(user.getSN()); + userElement = main.newChildElement("phoneNumber"); + userElement.setText(user.getPhone()); + userElement = main.newChildElement("mobilePhone"); + userElement.setText(user.getMobilePhone()); + userElement = main.newChildElement("emailAddress"); + userElement.setText((String)user.getMail().get(0)); + userElement = main.newChildElement("jobTitle"); + userElement.setText(user.getJobTitle()); + userElement = main.newChildElement("team"); + userElement.setText(user.getTeam()); + userElement = main.newChildElement("unit"); + userElement.setText(user.getUnit()); + userElement = main.newChildElement("group"); + userElement.setText(user.getGroup()); + userElement = main.newChildElement("location"); + userElement.setText(user.getLocation()); + userElement = main.newChildElement("building"); + userElement.setText(user.getBuilding()); + userElement = main.newChildElement("town"); + userElement.setText(user.getTown()); + + } catch (Exception e) { + main.newChildElement( + DirectoryConstants.XML_PREFIX + ":directoryBroken", + DirectoryConstants.XML_NS); + } + + } + +} Added: aplaws/contrib/wsx/ccm-wsx-county-directory/web/WEB-INF/bebop-define.tld =================================================================== --- aplaws/contrib/wsx/ccm-wsx-county-directory/web/WEB-INF/bebop-define.tld (rev 0) +++ aplaws/contrib/wsx/ccm-wsx-county-directory/web/WEB-INF/bebop-define.tld 2007-09-19 11:00:32 UTC (rev 1664) @@ -0,0 +1,395 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"> + +<taglib> + <tlibversion>1.0</tlibversion> + <jspversion>1.1</jspversion> + <shortname>bebop-define</shortname> + <uri>http://www.arsdigita.com/bebop-define/tld/1.0</uri> + + <info>this is a tag library for defining Bebop pages via JSP.</info> + + <tag> + <name>page</name> + <tagclass>com.arsdigita.bebop.jsp.DefinePage</tagclass> + <teiclass>com.arsdigita.bebop.jsp.DefinePageExtraInfo</teiclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>title</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>application</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>master</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>pageClass</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>cache</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>component</name> + <tagclass>com.arsdigita.bebop.jsp.DefineComponentImpl</tagclass> + <teiclass>com.arsdigita.bebop.jsp.DefineComponentExtraInfo</teiclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>classname</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>form</name> + <tagclass>com.arsdigita.bebop.jsp.DefineForm</tagclass> + <teiclass>com.arsdigita.bebop.jsp.DefineFormExtraInfo</teiclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>encType</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>method</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>action</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>onSubmit</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>onReset</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>link</name> + <tagclass>com.arsdigita.bebop.jsp.DefineLink</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>url</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>name</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>image</name> + <tagclass>com.arsdigita.bebop.jsp.DefineImage</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>src</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>alt</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>width</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>height</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>border</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>name</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>tabbedPane</name> + <tagclass>com.arsdigita.bebop.jsp.DefineTabbedPane</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>tab</name> + <tagclass>com.arsdigita.bebop.jsp.DefineTab</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>label</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>text</name> + <tagclass>com.arsdigita.bebop.jsp.DefineText</tagclass> + <teiclass>com.... [truncated message content] |
From: <chr...@fe...> - 2007-09-19 11:01:16
|
Author: chrisg23 Date: 2007-09-19 13:01:08 +0200 (Wed, 19 Sep 2007) New Revision: 1667 Modified: aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/GreetingItem.java Log: Continuation of changes in r1651 - output publisher flag on index pages too Modified: aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/GreetingItem.java =================================================================== --- aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/GreetingItem.java 2007-09-19 10:40:53 UTC (rev 1666) +++ aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/GreetingItem.java 2007-09-19 11:01:08 UTC (rev 1667) @@ -79,6 +79,10 @@ if (PermissionService.checkPermission(edit)) { content.addAttribute("canEdit", "true"); } + PermissionDescriptor publish = new PermissionDescriptor(PrivilegeDescriptor.get(SecurityManager.CMS_PUBLISH), item, currentParty); + if (PermissionService.checkPermission(publish)) { + content.addAttribute("canPublish", "true"); + } ContentBundle bundle = (ContentBundle)item; ContentItem baseItem = bundle.getPrimaryInstance(); |
From: <chr...@fe...> - 2007-09-19 11:01:16
|
Author: chrisg23 Date: 2007-09-19 13:01:09 +0200 (Wed, 19 Sep 2007) New Revision: 1668 Modified: aplaws/trunk/ccm-ldn-navigation/web/__ccm__/apps/navigation/lib/object-list.xsl Log: See r1661 - ensure that this version of object-list.xsl caters for all listed objects, not just content pages, by referring to displayName (defined in ACSObject and now output on all object lists in default navigation jsp page Modified: aplaws/trunk/ccm-ldn-navigation/web/__ccm__/apps/navigation/lib/object-list.xsl =================================================================== --- aplaws/trunk/ccm-ldn-navigation/web/__ccm__/apps/navigation/lib/object-list.xsl 2007-09-19 10:48:36 UTC (rev 1667) +++ aplaws/trunk/ccm-ldn-navigation/web/__ccm__/apps/navigation/lib/object-list.xsl 2007-09-19 11:01:09 UTC (rev 1668) @@ -12,8 +12,8 @@ <xsl:for-each select="nav:item"> <a> <xsl:attribute name="href"><xsl:value-of select="nav:path" /></xsl:attribute> - <xsl:attribute name="title"><xsl:value-of select="nav:attribute[@name='title']" /></xsl:attribute> - <xsl:value-of select="nav:attribute[@name='title']" /> + <xsl:attribute name="title"><xsl:value-of select="nav:attribute[@name='displayName']" /></xsl:attribute> + <xsl:value-of select="nav:attribute[@name='displayName']" /> </a> <span class="hide">|</span> </xsl:for-each> |
From: <chr...@fe...> - 2007-09-19 11:01:15
|
Author: chrisg23 Date: 2007-09-19 13:01:06 +0200 (Wed, 19 Sep 2007) New Revision: 1666 Modified: aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/DataCollectionDefinition.java aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/DataCollectionRenderer.java aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/NavigationConfig.java aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/AbstractObjectList.java aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/DateOrderedCategoryComponent.java Log: Currently date order categories work fine unless you have more than one page of objects - as the ordering is only done in xsl, when you have pagination, the java side returns a subset of objects ordered according to order set in jsp page (eg alphabetical) and then that subset is date ordered, but that means that as you page back and forth the date ordering is completely wrong. This change fixes that by enforcing date ordering in the java code if the current category is date ordered. Different object types have different attribute names for date - and only the renderer knows which attributes are available. I have added a method to the definition that gives the definition a reference to the renderer - the renderer now returns a list of attributes which the definition looks through and finds the first attribute that is of type date and uses that as the basis for date ordering if the current category is date ordered.If there is more than one date ordered attribute output in the ! list, then ensure the one used for ordering in xsl is the first one specified in jsp. I could have just made a setDateOrderAttribute method that takes a string attribute name argument and called that from the jsp page - it would have made the code quite a bit simpler. I chose this route to ensure that the date attribute specified for ordering in java was present in the datacollection, and so that there is no need to edit existing jsp pages. That is probably being overcautious though. Never mind, this works fine anyway - maybe one day I will refactor it to use the simpler approach Modified: aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/DataCollectionDefinition.java =================================================================== --- aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/DataCollectionDefinition.java 2007-09-19 10:28:21 UTC (rev 1665) +++ aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/DataCollectionDefinition.java 2007-09-19 11:01:06 UTC (rev 1666) @@ -18,6 +18,7 @@ package com.arsdigita.london.navigation; +import com.arsdigita.bebop.PageState; import com.arsdigita.categorization.Category; @@ -33,13 +34,17 @@ import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.metadata.ObjectType; +import com.arsdigita.persistence.metadata.Property; import com.arsdigita.util.Assert; import com.arsdigita.util.LockableImpl; import java.util.ArrayList; +import java.util.Date; import java.util.Iterator; +import org.apache.log4j.Logger; + /** * A class for building up a definition of parameters to * later use for a DataCollection of ACSObjects. @@ -58,6 +63,8 @@ private ArrayList m_excludedTypes = new ArrayList(); private ArrayList m_properties = new ArrayList(); + private String m_dateAttribute = null; + public final void setObjectType(String objectType) { Assert.unlocked(this); validateObjectType(objectType); @@ -79,6 +86,39 @@ m_excludedTypes.add( specificObjectType ); } + private static Logger s_log = Logger.getLogger(DataCollectionDefinition.class); + + public void setDateAttribute (DataCollectionRenderer renderer) { + ObjectType type = SessionManager.getMetadataRoot().getObjectType(m_objectType); + s_log.debug("set date attribute for collection of " + type.getQualifiedName()); + if (s_log.isDebugEnabled()) { + Iterator properties = type.getProperties(); + while (properties.hasNext()) { + Property prop = (Property)properties.next(); + s_log.debug("object has property " + prop.getName() + " of class " + prop.getJavaClass().getName()); + } + } + Iterator it = (renderer.getAttributes().iterator()); + while (it.hasNext()) { + String attribute = (String)it.next(); + s_log.debug("renderer is rendering attribute: " + attribute); + Property property = type.getProperty(attribute); + s_log.debug("property of object: " + property); + if (property != null) { + s_log.debug("Property class is " + property.getJavaClass().getName()); + } + if (property != null && property.getJavaClass().getName().equals(Date.class.getName())) { + m_dateAttribute = attribute; + // if more than one date attribute is specified for the type included in this + // definition, then we cannot determine in the code which is to be used as the + // basis for ordering in XSL - therefore return the first encountered date. + // User can control which of the dates is used as basis for sorting by specifying + // that date attribute first in the navigation jsp + break; + } + } + } + private final void validateObjectType(String objectType) { ObjectType type = SessionManager.getMetadataRoot().getObjectType(objectType); Assert.exists(type, ObjectType.class); @@ -134,6 +174,17 @@ property.addProperty( objects ); } + // for date ordered categories, if pagination occurs, we need to ensure + // that primary ordering is the date attribute included in the renderer + // if there is one + s_log.debug("Category is " + model.getCategory().getID() + ": " + model.getCategory().getName()); + s_log.debug("getting data collection. Is category date ordered? " + + Navigation.getConfig().isDateOrderedCategory(model.getCategory(), PageState.getPageState()) + + " date attribute has been set to " + m_dateAttribute); + if (Navigation.getConfig().isDateOrderedCategory(model.getCategory(), PageState.getPageState()) && m_dateAttribute != null) { + objects.addOrder(m_dateAttribute + " desc"); + } + if (m_ordering.size() > 0) { Iterator orders = m_ordering.iterator(); while (orders.hasNext()) { Modified: aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/DataCollectionRenderer.java =================================================================== --- aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/DataCollectionRenderer.java 2007-09-19 10:28:21 UTC (rev 1665) +++ aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/DataCollectionRenderer.java 2007-09-19 11:01:06 UTC (rev 1666) @@ -41,6 +41,7 @@ import java.util.Calendar; import java.util.Date; import java.util.Iterator; +import java.util.List; import org.apache.log4j.Logger; @@ -96,6 +97,10 @@ m_wrapAttributes = wrapAttributes; } + public List getAttributes () { + return m_attributes; + } + /** * @pageNumber current page, starting from 1 */ Modified: aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/NavigationConfig.java =================================================================== --- aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/NavigationConfig.java 2007-09-19 10:28:21 UTC (rev 1665) +++ aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/NavigationConfig.java 2007-09-19 11:01:06 UTC (rev 1666) @@ -18,6 +18,8 @@ package com.arsdigita.london.navigation; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.RequestLocal; import com.arsdigita.categorization.Category; import com.arsdigita.categorization.CategoryCollection; import com.arsdigita.domain.DataObjectNotFoundException; @@ -81,6 +83,13 @@ private Category m_defaultCategoryRoot = null; + // maybe 2 lookups in a single request so prevent double overhead + private RequestLocal m_allDateOrderCategories = new RequestLocal () { + public Object initialValue (PageState state) { + return getCurrentDateOrderCategories(); + } + }; + private NavigationModel m_defaultModel = null; private TreeCatProvider m_treeCatProvider = null; @@ -287,7 +296,21 @@ * in config * @return */ - public final Collection getDateOrderedCategories() { + public Collection getDateOrderedCategories(PageState state) { + Collection categories = null; + if (state == null) { + categories = getCurrentDateOrderCategories(); + } else { + categories = (Collection)m_allDateOrderCategories.get(state); + } + return categories; + } + + public boolean isDateOrderedCategory (Category cat, PageState state) { + return getDateOrderedCategories(state).contains(cat.getID().toString()); + } + + private Collection getCurrentDateOrderCategories () { if (s_fixedDateOrderCats == null) { populateFixedDateOrderCats(); } Modified: aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/AbstractObjectList.java =================================================================== --- aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/AbstractObjectList.java 2007-09-19 10:28:21 UTC (rev 1665) +++ aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/AbstractObjectList.java 2007-09-19 11:01:06 UTC (rev 1666) @@ -58,6 +58,11 @@ protected DataCollection getObjects(HttpServletRequest request, HttpServletResponse response) { + // definition needs to know if the renderer is rendering a date + // attribute so that it can decide whether to order by date for + // a date order category + m_definition.setDateAttribute(m_renderer); + return m_definition.getDataCollection(getModel()); } Modified: aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/DateOrderedCategoryComponent.java =================================================================== --- aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/DateOrderedCategoryComponent.java 2007-09-19 10:28:21 UTC (rev 1665) +++ aplaws/trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/DateOrderedCategoryComponent.java 2007-09-19 11:01:06 UTC (rev 1666) @@ -40,7 +40,7 @@ public void generateXML(PageState state, Element p) { Element content = Navigation.newElement("dateOrderCategories"); exportAttributes(content); - Iterator it = Navigation.getConfig().getDateOrderedCategories().iterator(); + Iterator it = Navigation.getConfig().getDateOrderedCategories(state).iterator(); while(it.hasNext()) { Element categoryElement = content.newChildElement(Navigation.newElement("category")); String[] category = StringUtils.split((String)it.next(), ':'); |