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
|
Author: pboy Date: 2012-02-22 18:53:15 +0000 (Wed, 22 Feb 2012) New Revision: 2279 Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock.sql trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactBundle.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundle.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPersonBundle.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactCreate.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitCreate.java Removed: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPanel.java Modified: trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericContact.pdl trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericPerson.pdl trunk/ccm-cms/src/WEB-INF/content-types/GenericContact.xml trunk/ccm-cms/src/WEB-INF/content-types/GenericOrganizationalUnit.xml trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitPersonCollection.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPersonContactCollection.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitExtraXmlGenerator.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonCreate.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/PublishLock.java trunk/ccm-core/src/com/arsdigita/bebop/form/Date.java trunk/ccm-core/src/com/arsdigita/bebop/form/Time.java trunk/ccm-navigation/src/com/arsdigita/navigation/cms/CMSDataCollectionRenderer.java Log: Various improvements: - Improved threaded publishing - Improved object list (navigation) in case of ExtraXML generator - date-time widget improved - Improved multilanguage support using assoziations - Improved link form Modified: trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericContact.pdl =================================================================== --- trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericContact.pdl 2012-02-22 18:50:10 UTC (rev 2278) +++ trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericContact.pdl 2012-02-22 18:53:15 UTC (rev 2279) @@ -34,6 +34,10 @@ reference key ( cms_contacts.contact_id ); } +object type GenericContactBundle extends ContentBundle { + reference key (cms_contact_bundles.bundle_id); +} + object type GenericContactEntry extends ContentItem { String[1..1] key = cms_contactEntries.key VARCHAR(100); @@ -46,18 +50,18 @@ association { - GenericPerson[0..n] person = join cms_contacts.contact_id + GenericPersonBundle[0..n] person = join cms_contact_bundles.bundle_id to cms_person_contact_map.contact_id, join cms_person_contact_map.person_id - to cms_persons.person_id; + to cms_person_bundles.bundle_id; - GenericContact[0..n] contacts = join cms_persons.person_id + GenericContactBundle[0..n] contacts = join cms_person_bundles.bundle_id to cms_person_contact_map.person_id, join cms_person_contact_map.contact_id - to cms_contacts.contact_id; + to cms_contact_bundles.bundle_id; // Link Attribute - BigDecimal[0..1] link_order = cms_person_contact_map.link_order INTEGER; - String[0..1] link_key = cms_person_contact_map.link_key VARCHAR(100); + BigDecimal[0..1] linkOrder = cms_person_contact_map.link_order INTEGER; + String[0..1] linkKey = cms_person_contact_map.link_key VARCHAR(100); } Modified: trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl =================================================================== --- trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl 2012-02-22 18:50:10 UTC (rev 2278) +++ trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl 2012-02-22 18:53:15 UTC (rev 2279) @@ -30,6 +30,10 @@ reference key (cms_organizationalunits.organizationalunit_id); } +object type GenericOrganizationalUnitBundle extends ContentBundle { + reference key (cms_orgaunit_bundles.bundle_id); +} + // Link for contact points. association { @@ -52,15 +56,15 @@ // Links a organization with persons. association { - GenericOrganizationalUnit[0..n] organizationalunit = join cms_persons.person_id - to cms_organizationalunits_person_map.person_id, - join cms_organizationalunits_person_map.organizationalunit_id - to cms_organizationalunits.organizationalunit_id; + GenericOrganizationalUnitBundle[0..n] organizationalunits = join cms_bundles.bundle_id + to cms_organizationalunits_person_map.person_id, + join cms_organizationalunits_person_map.organizationalunit_id + to cms_bundles.bundle_id; - GenericPerson[0..n] persons = join cms_organizationalunits.organizationalunit_id - to cms_organizationalunits_person_map.organizationalunit_id, - join cms_organizationalunits_person_map.person_id - to cms_persons.person_id; + GenericPersonBundle[0..n] persons = join cms_bundles.bundle_id + to cms_organizationalunits_person_map.organizationalunit_id, + join cms_organizationalunits_person_map.person_id + to cms_bundles.bundle_id; // Additional attributes for the association String[0..1] role_name = cms_organizationalunits_person_map.role_name VARCHAR(100); Modified: trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericPerson.pdl =================================================================== --- trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericPerson.pdl 2012-02-22 18:50:10 UTC (rev 2278) +++ trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericPerson.pdl 2012-02-22 18:53:15 UTC (rev 2279) @@ -20,6 +20,7 @@ model com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentPage; +import com.arsdigita.cms.ContentBundle; object type GenericPerson extends ContentPage { String[0..1] surname = cms_persons.surname VARCHAR(512); @@ -37,3 +38,7 @@ reference key (cms_persons.person_id); } + +object type GenericPersonBundle extends ContentBundle { + reference key (cms_person_bundles.bundle_id); +} Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock.sql (rev 0) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock.sql 2012-02-22 18:53:15 UTC (rev 2279) @@ -0,0 +1,13 @@ +CREATE TABLE cms_publish_lock ( + lock_id integer NOT NULL, + locked_oid character varying(2048), + lock_timestamp timestamp with time zone, + action character varying(256) +); + +ALTER TABLE ONLY cms_publish_lock + ADD CONSTRAINT cms_publis_loc_lock_id_p_8n7d0 PRIMARY KEY (lock_id); +-- ALTER TABLE public.cms_publish_lock OWNER TO ccm; + + + Modified: trunk/ccm-cms/src/WEB-INF/content-types/GenericContact.xml =================================================================== --- trunk/ccm-cms/src/WEB-INF/content-types/GenericContact.xml 2012-02-22 18:50:10 UTC (rev 2278) +++ trunk/ccm-cms/src/WEB-INF/content-types/GenericContact.xml 2012-02-22 18:53:15 UTC (rev 2279) @@ -12,7 +12,7 @@ mode="hidden"> <ctd:authoring-kit - createComponent="com.arsdigita.cms.ui.authoring.PageCreate"> + createComponent="com.arsdigita.cms.contenttypes.ui.GenericContactCreate"> <ctd:authoring-step labelKey="cms.contenttypes.shared.basic_properties.title" Modified: trunk/ccm-cms/src/WEB-INF/content-types/GenericOrganizationalUnit.xml =================================================================== --- trunk/ccm-cms/src/WEB-INF/content-types/GenericOrganizationalUnit.xml 2012-02-22 18:50:10 UTC (rev 2278) +++ trunk/ccm-cms/src/WEB-INF/content-types/GenericOrganizationalUnit.xml 2012-02-22 18:53:15 UTC (rev 2279) @@ -12,7 +12,7 @@ classname= "com.arsdigita.cms.contenttypes.GenericOrganizationalUnit" mode="hidden"> - <ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate"> + <ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitCreate"> <ctd:authoring-step labelKey="cms.contenttypes.shared.basic_properties.title" Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2012-02-22 18:50:10 UTC (rev 2278) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2012-02-22 18:53:15 UTC (rev 2279) @@ -603,7 +603,7 @@ private final Parameter m_threadPublishing = new BooleanParameter( "com.arsdigita.cms.lifecycle.threaded_publishing", Parameter.REQUIRED, - false); + true); // /////////////////////////////////////////// // publishToFile package related parameter Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java 2012-02-22 18:50:10 UTC (rev 2278) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java 2012-02-22 18:53:15 UTC (rev 2279) @@ -73,34 +73,34 @@ * * <h4>Publishing Items</h4> * - * The {@link #publish(LifecycleDefinition,java.util.Date)} method can - * be used to schedule the item for publication. The publication of an - * item proceeds in two steps: - + * The {@link #publish(LifecycleDefinition,java.util.Date)} method can be used + * to schedule the item for publication. The publication of an item proceeds in + * two steps: + * * 1. Pending Version * - * A pending version is immediately created for the item, and each - * subitem of the item. When the internal - * <code>createPendingVersion</code> method is called, the content - * item will attempt to clone itself in order to create the pending - * version. + * A pending version is immediately created for the item, and each subitem of + * the item. When the internal + * <code>createPendingVersion</code> method is called, the content item will + * attempt to clone itself in order to create the pending version. * - * First, the item will clone itself and all of its scalar - * attributes.Then, the item will clone all of its - * <strong>composite</strong> relations. After that, the item will - * copy all of its non-composite associations "by reference". If a - * target of any association is a <code>ContentItem</code>, the cloned - * item will reference the live or pending version of the target item. + * First, the item will clone itself and all of its scalar attributes.Then, the + * item will clone all of its <strong>composite</strong> relations. After that, + * the item will copy all of its non-composite associations "by reference". If a + * target of any association is a + * <code>ContentItem</code>, the cloned item will reference the live or pending + * version of the target item. * - * For example, consider <code>Articles</code> A and B, both of which - * reference an <code>ImageAsset</code> I: + * For example, consider + * <code>Articles</code> A and B, both of which reference an + * <code>ImageAsset</code> I: * * <blockquote><pre> * A ---> I <--- B * </pre></blockquote> * - * When A is published, creating a pending version A', I will be - * published as well: + * When A is published, creating a pending version A', I will be published as + * well: * * <blockquote><pre> * A ---> I <--- B @@ -114,84 +114,71 @@ * A'---> I'<--- B' * </pre></blockquote> * - * In order to work correctly with the automatic publishing code, - * every subclass of <code>ContentItem</code> (such as "FooItem - * extends ContentItem") <b>must</b> adhere to the following - * guidelines: + * In order to work correctly with the automatic publishing code, every subclass + * of + * <code>ContentItem</code> (such as "FooItem extends ContentItem") <b>must</b> + * adhere to the following guidelines: * - * <ul> - * <li>The subclass must have a constructor of the form - * <blockquote><pre> + * <ul> <li>The subclass must have a constructor of the form <blockquote><pre> * public FooItem(DataObject obj) { * super(obj); * } - * </pre></blockquote> - * </li> + * </pre></blockquote> </li> * - * <li>The subclass must have a constructor of the form - * <blockquote><pre> + * <li>The subclass must have a constructor of the form <blockquote><pre> * public FooItem(String type) { * super(type); * * // Do more stuff here. * } - * </pre></blockquote> - * </li> + * </pre></blockquote> </li> * - * <li>If the PDL file for the subclass contains any link - * attributes, read-only associations, or in general any - * associations that are not standard, the subclass must implement - * the {@link #copyProperty(ContentItem, String, ItemCopier)} - * method. For examples on how to implement it, see the methods's - * javadoc and the sample implementation in the {@link Article} - * class.</li> - * </ul> + * <li>If the PDL file for the subclass contains any link attributes, read-only + * associations, or in general any associations that are not standard, the + * subclass must implement the {@link #copyProperty(ContentItem, String, ItemCopier)} + * method. For examples on how to implement it, see the methods's javadoc and + * the sample implementation in the {@link Article} class.</li> </ul> * - * After the pending version is created, the version copier will - * assign it a new lifecycle, based on the values passed in to {@link - * #publish(LifecycleDefinition, java.util.Date)}, but <em>only</em> - * if the new pending version is a regular aggregation (not a - * composition). In theory, it should make no difference whether the - * new pending version is a composition or not; however, some bugs - * within the publishing code currently prevent this from working - * correctly. For this reason, it is <em>critically important</em> to - * pass the right parameter to {@link ItemCopier#copy} - * the {@link #copyProperty(ContentItem, String, + * After the pending version is created, the version copier will assign it a new + * lifecycle, based on the values passed in to {@link + * #publish(LifecycleDefinition, java.util.Date)}, but <em>only</em> if the new + * pending version is a regular aggregation (not a composition). In theory, it + * should make no difference whether the new pending version is a composition or + * not; however, some bugs within the publishing code currently prevent this + * from working correctly. For this reason, it is <em>critically important</em> + * to pass the right parameter to {@link ItemCopier#copy} the {@link #copyProperty(ContentItem, String, * ItemCopier)} method. * * 2. Live Version * - * When the lifecycle finally rolls around to the start date specified - * in the <code>publish</code> method, the pending versions for the - * item and all the subitems will be promoted to live, and the item - * will appear on the live site. Another publishing bug currently - * makes it a <em>requirement</em> to reload the original item from - * the database after it has been successfully published; I am working - * on fixing this. + * When the lifecycle finally rolls around to the start date specified in the + * <code>publish</code> method, the pending versions for the item and all the + * subitems will be promoted to live, and the item will appear on the live site. + * Another publishing bug currently makes it a <em>requirement</em> to reload + * the original item from the database after it has been successfully published; + * I am working on fixing this. * * 3. Unpublishing * - * When the lifecycle for an item expires, its live version is deleted - * and removed from the live site, along with all its subitems. + * When the lifecycle for an item expires, its live version is deleted and + * removed from the live site, along with all its subitems. * * 4. Future work * - * The new data model makes it possible to have multiple pending - * versions for a content item; it should also be theoretically - * possible to archive expired live versions, as opposed to deletin g - * them. There are no Java APIs for this functionality as of yet, - * however. + * The new data model makes it possible to have multiple pending versions for a + * content item; it should also be theoretically possible to archive expired + * live versions, as opposed to deletin g them. There are no Java APIs for this + * functionality as of yet, however. * * <h4>Copying Items</h4> * - * The {@link ItemCopier#copy} method may be used to create a - * nearly identical copy of the item, according to the rules described - * above. The new item will be a full-fledged, standalone item. Note - * that the services (such as categories) will not be automatically - * transferred to the new copy of the item; the {@link - * #copyServicesFrom(ContentItem)} method must be called on the new - * item to transfer the services. Calling this method is not a - * requirement, however. + * The {@link ItemCopier#copy} method may be used to create a nearly identical + * copy of the item, according to the rules described above. The new item will + * be a full-fledged, standalone item. Note that the services (such as + * categories) will not be automatically transferred to the new copy of the + * item; the {@link + * #copyServicesFrom(ContentItem)} method must be called on the new item to + * transfer the services. Calling this method is not a requirement, however. * * @author Uday Mathur * @author Jack Chung @@ -211,8 +198,8 @@ MODEL + ".getPendingSortedByLifecycle"; public static final String BASE_DATA_OBJECT_TYPE = MODEL + ".ContentItem"; /** - * A state marking the draft or master item corresponding to a - * live or pending version of that item. + * A state marking the draft or master item corresponding to a live or + * pending version of that item. */ public static final String DRAFT = "draft"; /** @@ -241,7 +228,7 @@ private VersionCache m_live; private boolean m_wasNew; private Reporter m_reporter; - private BasicAuditTrail m_audit_trail; + private BasicAuditTrail m_audit_trail; /** * Default constructor. This creates a new content item. @@ -253,11 +240,14 @@ } /** - * Constructor. The contained <code>DataObject</code> is retrieved - * from the persistent storage mechanism with an <code>OID</code> - * specified by <code>oid</code>. + * Constructor. The contained + * <code>DataObject</code> is retrieved from the persistent storage + * mechanism with an + * <code>OID</code> specified by + * <code>oid</code>. * - * @param oid The <code>OID</code> for the retrieved + * @param oid The + * <code>OID</code> for the retrieved * <code>DataObject</code> */ public ContentItem(final OID oid) throws DataObjectNotFoundException { @@ -265,12 +255,15 @@ } /** - * Constructor. The contained <code>DataObject</code> is retrieved - * from the persistent storage mechanism with an <code>OID</code> - * specified by <code>id</code> and + * Constructor. The contained + * <code>DataObject</code> is retrieved from the persistent storage + * mechanism with an + * <code>OID</code> specified by + * <code>id</code> and * <code>ContentItem.BASE_DATA_OBJECT_TYPE</code>. * - * @param id The <code>id</code> for the retrieved + * @param id The + * <code>id</code> for the retrieved * <code>DataObject</code> */ public ContentItem(final BigDecimal id) @@ -279,22 +272,22 @@ } /** - * Constructor. Retrieves or creates a content item using the + * Constructor. Retrieves or creates a content item using the * <code>DataObject</code> argument. * - * @param obj The <code>DataObject</code> with which to create or - * load a content item + * @param obj The + * <code>DataObject</code> with which to create or load a content item */ public ContentItem(final DataObject obj) { super(obj); } /** - * Constructor. Creates a new content item using the given data - * object type. Such items are created as draft versions. + * Constructor. Creates a new content item using the given data object type. + * Such items are created as draft versions. * - * @param type The <code>String</code> data object type of the - * item to create + * @param type The + * <code>String</code> data object type of the item to create */ public ContentItem(final String type) { super(type); @@ -320,8 +313,8 @@ }; /** - * Called from the base class (<code>DomainObject</code>) - * constructors. + * Called from the base class ( + * <code>DomainObject</code>) constructors. */ protected void initialize() { super.initialize(); @@ -377,7 +370,7 @@ /** * @return the base PDL object type for this item. Child classes should - * override this method to return the correct value + * override this method to return the correct value */ @Override public String getBaseDataObjectType() { @@ -386,8 +379,9 @@ /** * Publicized getter method for use by metadata forms. + * * @param key - * @return + * @return */ @Override public Object get(final String key) { @@ -396,8 +390,9 @@ /** * Public setter method for use by metadata forms. + * * @param key - * @param value + * @param value */ @Override public void set(final String key, final Object value) { @@ -406,10 +401,10 @@ /** * Public add for use by metadata forms. - * + * * @param propertyName * @param dobj - * @return + * @return */ @Override public DataObject add(String propertyName, DomainObject dobj) { @@ -418,9 +413,9 @@ /** * Public remove for use by metadata forms - * + * * @param propertyName - * @param dobj + * @param dobj */ @Override public void remove(String propertyName, DomainObject dobj) { @@ -428,8 +423,8 @@ } /** - * For new content items, sets the associated content type if it - * has not been already set. + * For new content items, sets the associated content type if it has not + * been already set. */ @Override protected void beforeSave() { @@ -445,27 +440,17 @@ } } - /* - - removed cg - object observer sets context based - on parent whenever parent is updated - - protected void afterSave() { - super.afterSave(); - s_log.info("******After Save of object " + getOID()); - // Set the object's context to its parent object for - // permissioning. - if (m_wasNew) { - final ACSObject parent = getParent(); - if (parent == null) { - s_log.info("parent is null - set context to content section"); - PermissionService.setContext(this, getContentSection()); - } else { - s_log.info("parent is " + parent.getOID()); - PermissionService.setContext(this, parent); - } - } - } + /* * + * removed cg - object observer sets context based on parent whenever parent + * is updated + * + * protected void afterSave() { super.afterSave(); s_log.info("******After + * Save of object " + getOID()); // Set the object's context to its parent + * object for // permissioning. if (m_wasNew) { final ACSObject parent = + * getParent(); if (parent == null) { s_log.info("parent is null - set + * context to content section"); PermissionService.setContext(this, + * getContentSection()); } else { s_log.info("parent is " + + * parent.getOID()); PermissionService.setContext(this, parent); } } } */ private void setDefaultContentSection() { s_log.debug("Setting the default content section"); @@ -491,8 +476,8 @@ } /** - * Fetch the display name of the content item. The display name for - * a {@link com.arsdigita.cms.ContentItem} is the name property. + * Fetch the display name of the content item. The display name for a {@link com.arsdigita.cms.ContentItem} + * is the name property. * * @return The name of the content item */ @@ -533,7 +518,8 @@ /** * Set the parent object. * - * @param object The <code>ACSObject</code> parent + * @param object The + * <code>ACSObject</code> parent */ public final void setParent(final ACSObject object) { setAssociation(PARENT, object); @@ -543,7 +529,8 @@ /** * Fetches all the child items of this item. * - * @return an <code>ItemCollection</code> of children + * @return an + * <code>ItemCollection</code> of children */ public final ItemCollection getChildren() { final DataAssociationCursor cursor = @@ -590,16 +577,17 @@ } /** - * Returns the content section to which this item belongs. - * Fetches the denormalized content section of an item. If one is - * not found, this method returns null. + * Returns the content section to which this item belongs. Fetches the + * denormalized content section of an item. If one is not found, this method + * returns null. * - * Since <code>cms_items.section_id</code> is a denormalization, - * this method may return null even if the item "belongs" to a - * content section. For example, calling + * Since + * <code>cms_items.section_id</code> is a denormalization, this method may + * return null even if the item "belongs" to a content section. For example, + * calling * <code>getContentSection()</code> on an Article's - * <code>ImageAsset</code> will return null even though the image - * asset should belong to the same section as the article. + * <code>ImageAsset</code> will return null even though the image asset + * should belong to the same section as the article. * * @return The content section to which this item belongs */ @@ -620,19 +608,21 @@ } /** - * Return the path to the item starting at its root. The path is - * absolute, of the form <tt>/x/y/z</tt> where <tt>x</tt> and - * <tt>y</tt> are the names of the item's grandparent and parent - * respectively, and <tt>z</tt> is the name of the item itself. + * Return the path to the item starting at its root. The path is absolute, + * of the form <tt>/x/y/z</tt> where <tt>x</tt> and <tt>y</tt> are the names + * of the item's grandparent and parent respectively, and <tt>z</tt> is the + * name of the item itself. * * The item's root is the ancestor reachable through repeated * <code>getParent()</code> calls whose parent is * <code>null</code>. This is usually a folder, but may be any - * {@see com.arsdigita.kernel.ACSObject}. + * { * - * Note that the name of the root folder of the content section - * where the item resides is not included in the path. + * @see com.arsdigita.kernel.ACSObject}. * + * Note that the name of the root folder of the content section where the + * item resides is not included in the path. + * * @see #getPathInfo(boolean) * @return the path from the item's root to the item */ @@ -668,15 +658,16 @@ /** * Return a collection of ancestors starting from the item's root to the - * item's parent item. For items contained in folders this is similar to - * a directory path to the item. The collection starts with the root item - * and ends with the item's direct parent. + * item's parent item. For items contained in folders this is similar to a + * directory path to the item. The collection starts with the root item and + * ends with the item's direct parent. * * <p> The item's root is the ancestor reachable through repeated - * <code>getParent()</code> calls whose parent is <code>null</code>. This - * is usually a folder, but may be any {@see - * com.arsdigita.kernel.ACSObject}. + * <code>getParent()</code> calls whose parent is + * <code>null</code>. This is usually a folder, but may be any { * + * @see com.arsdigita.kernel.ACSObject}. + * * @see #getPathInfo(boolean) * * @return the collection of the item's ancestors. @@ -687,17 +678,21 @@ /** * Return a collection of ancestors starting from the item's root to the - * item's parent item (if <code>includeSelf</code> is <code>false</code>) - * or to the item itself otherwise. For items contained in folders this - * is similar to a directory path to the item. The collection starts with - * the root item and ends with the item's direct parent. + * item's parent item (if + * <code>includeSelf</code> is + * <code>false</code>) or to the item itself otherwise. For items contained + * in folders this is similar to a directory path to the item. The + * collection starts with the root item and ends with the item's direct + * parent. * * <p> The item's root is the ancestor reachable through repeated - * <code>getParent()</code> calls whose parent is <code>null</code>. This - * is usually a folder, but may be any {@see - * com.arsdigita.kernel.ACSObject}. + * <code>getParent()</code> calls whose parent is + * <code>null</code>. This is usually a folder, but may be any { * - * @param includeSelf a <code>boolean</code> value. + * @see com.arsdigita.kernel.ACSObject}. + * + * @param includeSelf a + * <code>boolean</code> value. * @return the items on the path to the root folder. */ public ItemCollection getPathInfo(boolean includeSelf) { @@ -752,8 +747,7 @@ /** * Sets the version tag. * - * @param version A version tag, {@link #LIVE} or {@link #DRAFT} - * or {@link #PENDING} + * @param version A version tag, {@link #LIVE} or {@link #DRAFT} or {@link #PENDING} */ protected void setVersion(final String version) { set(VERSION, version); @@ -762,18 +756,21 @@ } /** - * Returns <code>true</code> if this item is a <code>DRAFT</code> - * version. + * Returns + * <code>true</code> if this item is a + * <code>DRAFT</code> version. * - * @return <code>true</code> if this item is a <code>DRAFT</code> - * version + * @return + * <code>true</code> if this item is a + * <code>DRAFT</code> version */ public boolean isDraftVersion() { return DRAFT.equals(getVersion()); } /** - * Returns the <code>DRAFT</code> version of this content item. + * Returns the + * <code>DRAFT</code> version of this content item. * * @return the draft version */ @@ -797,8 +794,8 @@ } /** - * Fetches the draft (aka, "master" or "working") version of this - * content item. + * Fetches the draft (aka, "master" or "working") version of this content + * item. * * @return the working version representation of the * <code>ContentItem</code>, possibly this item @@ -809,18 +806,21 @@ } /** - * Returns <code>true</code> if this item is a + * Returns + * <code>true</code> if this item is a * <code>PENDING</code> version. * - * @return <code>true</code> if <code>this</code> is one of the - * pending versions + * @return + * <code>true</code> if + * <code>this</code> is one of the pending versions */ public boolean isPendingVersion() { return PENDING.equals(getVersion()); } /** - * Returns one <code>PENDING</code> version of this content item. + * Returns one + * <code>PENDING</code> version of this content item. * * @return one of the pending versions */ @@ -853,7 +853,7 @@ } /** - * <p>Fetches the pending versions, if any, of this content item. The + * <p>Fetches the pending versions, if any, of this content item. The * versions are returned in chronological order, sorted by their respective * lifecycle's start date.</p> * @@ -910,22 +910,24 @@ } /** - * Returns <code>true</code> if this item is a <code>LIVE</code> - * version. + * Returns + * <code>true</code> if this item is a + * <code>LIVE</code> version. * - * @return <code>true</code> if <code>this</code> is the live - * version + * @return + * <code>true</code> if + * <code>this</code> is the live version */ public boolean isLiveVersion() { return LIVE.equals(getVersion()); } /** - * Fetches the live version of this content item. Returns null if - * there is none. + * Fetches the live version of this content item. Returns null if there is + * none. * - * @return a <code>ContentItem</code> representing the live - * version + * @return a + * <code>ContentItem</code> representing the live version */ public ContentItem getLiveVersion() { if (s_log.isDebugEnabled()) { @@ -963,7 +965,8 @@ /** * Sets the live version. * - * @param version The <code>ContentItem</code> to set live + * @param version The + * <code>ContentItem</code> to set live */ protected void setLiveVersion(final ContentItem version) { if (s_log.isDebugEnabled()) { @@ -989,8 +992,8 @@ } /** - * Get the live version for the item. If no live version exists, - * return the latest pending version, if any. + * Get the live version for the item. If no live version exists, return the + * latest pending version, if any. * * @return the public version for this item, or null if none */ @@ -1019,16 +1022,16 @@ // Publishing methods // /** - * Method to determine whether this ContentItem should - * be automatically published to the file system. + * Method to determine whether this ContentItem should be automatically + * published to the file system. */ protected boolean canPublishToFS() { return true; } /** - * Publish this item to the filesystem; can only be called on a - * live version. + * Publish this item to the filesystem; can only be called on a live + * version. */ protected void publishToFS() { if (!canPublishToFS()) { @@ -1059,11 +1062,12 @@ } /** - * Returns true if this item has a publicly viewable version. - * This item is not necessarily the live version nor is this - * method to be confused with isPublished. + * Returns true if this item has a publicly viewable version. This item is + * not necessarily the live version nor is this method to be confused with + * isPublished. * - * @return <code>true<code> if this content item has a live + * @return + * <code>true<code> if this content item has a live * version, or if it <em>is</em> the live version */ public boolean isLive() { @@ -1073,8 +1077,8 @@ /** * Makes an item live or not live. * - * @param version the version which should become live, null to - * make the item non-live + * @param version the version which should become live, null to make the + * item non-live */ public void setLive(final ContentItem version) { if (s_log.isDebugEnabled()) { @@ -1180,8 +1184,8 @@ * Schedules an item for publication. * * @param cycleDef The lifecycle definition - * @param startDate The time to schedule the start of the - * lifecycle. If null, use the current time as the start date. + * @param startDate The time to schedule the start of the lifecycle. If + * null, use the current time as the start date. * * @return the new pending version */ @@ -1196,12 +1200,13 @@ + "definition " + cycleDef + " and start date " + startDate); } - /* amended Chris Gilbert + /* + * amended Chris Gilbert * * Some content types may have their own lifecycles with their own - * default listeners. Previous implementation just enforced - * the listener retrieved from getPublisherClassName. This amendment - * looks for a default listener in the cycle definition first + * default listeners. Previous implementation just enforced the listener + * retrieved from getPublisherClassName. This amendment looks for a + * default listener in the cycle definition first * */ String listener = cycleDef.getDefaultListener(); @@ -1243,10 +1248,10 @@ } /** - * Unpublishes an item. This method removes the item's lifecycle - * and removes all pending versions. It is intended for use in UI - * code, and it should not be used for making items go "unlive". - * Instead, use <code>setLive(null)</code>. + * Unpublishes an item. This method removes the item's lifecycle and removes + * all pending versions. It is intended for use in UI code, and it should + * not be used for making items go "unlive". Instead, use + * <code>setLive(null)</code>. */ public void unpublish() { if (s_log.isDebugEnabled()) { @@ -1291,9 +1296,8 @@ } /** - * Republish the item - * @parameter reset - if true create a new lifecycle, if false use existing - * Called from ui.lifecycle.ItemLifecycleItemPane.java + * Republish the item @parameter reset - if true create a new lifecycle, if + * false use existing Called from ui.lifecycle.ItemLifecycleItemPane.java */ public void republish(boolean reset) { if (s_log.isDebugEnabled()) { @@ -1433,8 +1437,8 @@ } /** - * Returns an iterator over the categories associated with this - * content item which is associated with the given use context + * Returns an iterator over the categories associated with this content item + * which is associated with the given use context * * @param useContext the category use context * @@ -1468,14 +1472,13 @@ } /** - * Sets a category as the default/primary category for this - * item. Actual default assignment is performed on the bundle if - * one exists. + * Sets a category as the default/primary category for this item. Actual + * default assignment is performed on the bundle if one exists. * - * If this category is not already assigned to this item, then - * this method also adds the category to the item. + * If this category is not already assigned to this item, then this method + * also adds the category to the item. * - * @param category The category to set as the default. + * @param category The category to set as the default. * */ public void setDefaultCategory(Category category) { @@ -1493,7 +1496,7 @@ /** * Adds a category to this content item (or its bundle if one exists) * - * @param category The category to add this item to + * @param category The category to add this item to * */ public void addCategory(Category category) { @@ -1510,7 +1513,7 @@ /** * Removes a category from this content item (or its bundle if one exists) * - * @param category The category to remove this item from + * @param category The category to remove this item from * */ public void removeCategory(Category category) { @@ -1528,19 +1531,16 @@ // Versioning stuff // /** - * Recursively copy this item, creating a clone. - * Reassign composite associations from the copy to point - * to the copies of original items. This method will not - * automatically transfer services (such as categories) - * to the copy; the {@link #copyServicesFrom(ContentItem)} method - * should be called to accomplish this. - * <p> - * NOTE: This method will also save the item and all - * of its unpublished subitems. + * Recursively copy this item, creating a clone. Reassign composite + * associations from the copy to point to the copies of original items. This + * method will not automatically transfer services (such as categories) to + * the copy; the {@link #copyServicesFrom(ContentItem)} method should be + * called to accomplish this. <p> NOTE: This method will also save the item + * and all of its unpublished subitems. * - * NOTE: This method should be final with the addition of makeCopy, - * but is not just in case there are extensions in some PS code. - * The 'non-finalness' of this method should be considered deprecated. + * NOTE: This method should be final with the addition of makeCopy, but is + * not just in case there are extensions in some PS code. The + * 'non-finalness' of this method should be considered deprecated. * * @return the live version for this item * @see #copyServicesFrom(ContentItem) @@ -1554,12 +1554,9 @@ } /** - * Recursively copy this item, creating a clone. - * Reassign composite associations from the copy to point - * to the copies of original items. - * <p> - * NOTE: This method will save the item and all - * of its unpublished subitems. + * Recursively copy this item, creating a clone. Reassign composite + * associations from the copy to point to the copies of original items. <p> + * NOTE: This method will save the item and all of its unpublished subitems. * * @param newParent The new parent item for this item * @param copyServices Copy services if true @@ -1593,8 +1590,8 @@ } /** - * Performs the actual mechanics of copying a content item. - * Non-final so that subtypes can extend copying behavior. + * Performs the actual mechanics of copying a content item. Non-final so + * that subtypes can extend copying behavior. * * @return A new copy of the item */ @@ -1613,11 +1610,11 @@ } /** - * Variant of {@link ACSObject#makeCopy} which allows to pass the (further) + * Variant of {@link ACSObject#makeCopy} which allows to pass the (further) * language of the copy. - * + * * @param language - * @return + * @return */ protected ContentItem makeCopy(String language) { if (s_log.isDebugEnabled()) { @@ -1636,17 +1633,15 @@ } /** - * Transfer services, such as categories, - * from the passed-in item to this item. This method should be - * called immediately after {@link ItemCopier#copy}, as follows: - * <blockquote><pre><code> Article newArticle = (Article)oldArticle.copyItem(); - * newArticle.copyServicesFrom(oldArticle);</code></pre></blockquote> - * <p> - * WARNING: This method will most likely crash if you call it twice - * in a row. + * Transfer services, such as categories, from the passed-in item to this + * item. This method should be called immediately after {@link ItemCopier#copy}, + * as follows: <blockquote><pre><code> Article newArticle = (Article)oldArticle.copyItem(); + * newArticle.copyServicesFrom(oldArticle);</code></pre></blockquote> <p> + * WARNING: This method will most likely crash if you call it twice in a + * row. * - * @param source the <code>ContentItem</code> whose services will be - * copied + * @param source the + * <code>ContentItem</code> whose services will be copied * @see #copy() */ public void copyServicesFrom(final ContentItem source) { @@ -1654,12 +1649,12 @@ } /** - * Recursively copy this item, creating a pending version. - * Reassign composite associations from the pending version to - * point to the pending/live versions of other items. + * Recursively copy this item, creating a pending version. Reassign + * composite associations from the pending version to point to the + * pending/live versions of other items. * - * NOTE: This method will also save the item and all of its - * unpublished subitems. + * NOTE: This method will also save the item and all of its unpublished + * subitems. * * @param cycle the lifecycle to use. A null cycle implies that a live * version should be created. @@ -1674,8 +1669,8 @@ } /** - * Promote the specified pending version to live. Delete the old - * live version, if any. + * Promote the specified pending version to live. Delete the old live + * version, if any. * * @param pending The pending item to promote */ @@ -1718,9 +1713,9 @@ } /** - * Recursively update the version attribute of the current - * content item to the new value. Used by the lifecycle listener - * to promote a pending version to live. + * Recursively update the version attribute of the current content item to + * the new value. Used by the lifecycle listener to promote a pending + * version to live. * * @param version The new Version to set */ @@ -1732,9 +1727,9 @@ } /** - * Recursively copy this item, creating a live version. Reassign - * component associations from the live version to point to the - * live versions of other items. + * Recursively copy this item, creating a live version. Reassign component + * associations from the live version to point to the live versions of other + * items. * * @return the live version for this item */ @@ -1749,14 +1744,16 @@ } /** - * Copy the specified property (attribute or association) from the - * specified source item. This method almost completely overrides - * the metadata-driven methods in <code>ObjectCopier</code>. ... + * Copy the specified property (attribute or association) from the specified + * source item. This method almost completely overrides the metadata-driven + * methods in + * <code>ObjectCopier</code>. ... * - * ObjectCopier will no longer call it, so existing - * implementations need to update to the new signature + * ObjectCopier will no longer call it, so existing implementations need to + * update to the new signature * - * @deprecated use {@link #copyProperty(CustomCopy, Property, ItemCopier)} instead + * @deprecated use {@link #copyProperty(CustomCopy, Property, ItemCopier)} + * instead */ protected final boolean copyProperty(final ContentItem source, final String attribute, @@ -1766,35 +1763,35 @@ } /** - * Copy the specified property (attribute or association) from the - * specified source item. This method almost completely overrides - * the metadata-driven methods in <code>ObjectCopier</code>. If - * the property in question is an association to - * <code>ContentItem</code>(s), this method should <b>only</b> - * call <code>FooContentItem newChild = copier.copy(srcItem, this, - * riginalChild, property);</code> An attempt to call any other - * method in order to copy the child will most likely have - * disastrous consequences. In fact, this copier method should - * generally be called for any DomainObject copies, later making - * custom changes, unless the copying behavior itself is different - * from the default (or the item should not be copied at all at + * Copy the specified property (attribute or association) from the specified + * source item. This method almost completely overrides the metadata-driven + * methods in + * <code>ObjectCopier</code>. If the property in question is an association + * to + * <code>ContentItem</code>(s), this method should <b>only</b> call + * <code>FooContentItem newChild = copier.copy(srcItem, this, + * riginalChild, property);</code> An attempt to call any other method in + * order to copy the child will most likely have disastrous consequences. In + * fact, this copier method should generally be called for any DomainObject + * copies, later making custom changes, unless the copying behavior itself + * is different from the default (or the item should not be copied at all at * this point). * * - * If a subclass of a class which implements CustomCopy overrides - * this method, it should return <code>super.copyProperty</code> - * for properties which do not need custom behavior in order to - * indicate that it is not interested in handling the property in - * any special way. + * If a subclass of a class which implements CustomCopy overrides this + * method, it should return + * <code>super.copyProperty</code> for properties which do not need custom + * behavior in order to indicate that it is not interested in handling the + * property in any special way. * - * As a hypothetical example (no longer reflected in Article - * itself), the {@link Article} class extends - * <code>ContentItem</code>. It defines an association to 0..n - * {@link ImageAsset}. Unfortunately, the association has - * "order_n" and "caption" link attributes, which cannot be copied - * automatically, since the persistence system doesn't know enough - * about them. The following sample code from the {@link Article} - * class ensures that images are copied correctly: + * As a hypothetical example (no longer reflected in Article itself), the {@link Article} + * class extends + * <code>ContentItem</code>. It defines an association to 0..n + * {@link ImageAsset}. Unfortunately, the association has "order_n" and + * "caption" link attributes, which cannot be copied automatically, since + * the persistence system doesn't know enough about them. The following + * sample code from the {@link Article} class ensures that images are copied + * correctly: * * <blockquote><pre><code> * public boolean copyProperty(CustomCopy srcItem, Property property, ItemCopier copier) { @@ -1831,24 +1828,23 @@ * </code></pre></blockquote> * * Note that for top-level item associations, - * <code>VersionCopier</code> will return <code>null</code> since - * the actual associatons are only created at "go live" time, so - * the ability to override behavior for top-level item - * associations is somewhat limited. A common case for needing to - * override copyProperty to handle these associations would be to - * auto-publish the target of the association but still handle the - * association updating normally. In this case, copyProperty would - * call publish() separately on the associated object, and then - * return <code>false</code> to indicate that the copier should - * continue to handle the association normally. + * <code>VersionCopier</code> will return + * <code>null</code> since the actual associatons are only created at "go + * live" time, so the ability to override behavior for top-level item + * associations is somewhat limited. A common case for needing to override + * copyProperty to handle these associations would be to auto-publish the + * target of the association but still handle the association updating + * normally. In this case, copyProperty would call publish() separately on + * the associated object, and then return + * <code>false</code> to indicate that the copier should continue to handle + * the association normally. * * @param source the source CustomCopy item * @param property the property to copy * @param copier a temporary class that is able to copy a child item - * correctly. - * @return true if the property was copied; false to indicate - * that regular metadata-driven methods should be used - * to copy the property. + * correctly. + * @return true if the property was copied; false to indicate that regular + * metadata-driven methods should be used to copy the property. */ public boolean copyProperty(final CustomCopy source, final Property property, @@ -1942,18 +1938,16 @@ } /** - * Copy services from the source item. This method is the analogue of - * the {@link #copyProperty} method above. The object copier will - * call this method whenever an item has been successfully published, - * in order to transfer services such as categorization or permissions - * to the live version. - * <p> - * This method is requied to return false to signal the object copier - * to transfer default services from the source item; or true - * in order to abort further processing of services. + * Copy services from the source item. This method is the analogue of the {@link #copyProperty} + * method above. The object copier will call this method whenever an item + * has been successfully published, in order to transfer services such as + * categorization or permissions to the live version. <p> This method is + * requied to return false to signal the object copier to transfer default + * services from the source item; or true in order to abort further + * processing of services. * - * @return true to tell the object copier to stop copying services for - * this item, false otherwise + * @return true to tell the object copier to stop copying services for this + * item, false otherwise */ public boolean copyServices(ContentItem srcItem) { return false; @@ -1985,8 +1979,7 @@ /** * Get the locale for this content item. * - * @return The locale of the item - * @post return != null + * @return The locale of the item @post return != null */ public com.arsdigita.globalization.Locale getLocale() { Locale locale = null; @@ -2032,6 +2025,7 @@ // /** * Assert that this item is a top-level master object + * * @deprecated with no replacement */ public final void assertMaster() { @@ -2078,9 +2072,9 @@ } /** - * Remove any Links pointing to this item before deletion. - * XXX This should go away when one-way association targets can - * specify the equivalent of on delete set null + * Remove any Links pointing to this item before deletion. XXX This should + * go away when one-way association targets can specify the equivalent of on + * delete set null */ @Override protected void beforeDelete() { @@ -2112,11 +2106,12 @@ } /** - * Overriding the Auditing interface in order to use the denormalized - * information + * Overriding the Auditing interface in order to use the denormalized + * information */ /** * Gets the user who created the object. May be null. + * * @return the user who created the object. */ @Override @@ -2126,6 +2121,7 @@ /** * Gets the creation date of the object. + * * @return the creation date. */ @Override @@ -2134,8 +2130,8 @@ } /** - * Gets the IP address associated with creating an object. May be - * null. + * Gets the IP address associated with creating an object. May be null. + * * @return the creation IP address. */ @Override @@ -2145,6 +2141,7 @@ /** * Gets the user who last modified the object. May be null. + * * @return the last modifying user. */ @Override @@ -2154,6 +2151,7 @@ /** * Gets the last modified date. + * * @return the last modified date. */ @Override @@ -2163,35 +2161,48 @@ /** * Gets the last modified IP address. May be null. + * * @return the IP address associated with the last modification. */ @Override public String getLastModifiedIP() { return m_audit_trail.getLastModifiedIP(); } - + /** - * <p> - * Override this to explicit that your content items - * have extra XML to generate. An overriding implementation should call - * the super method, and append its generators to the list. Example: - * </p> + * <p> Override this to explicit that your content items have extra XML to + * generate. An overriding implementation should call the super method, and + * append its generators to the list. Example: </p> * <pre> * {@code * @Override * public List<ExtraXMLGenerator> getExtraXMLGenerators() { - * final List<ExtraXMLGenerators> generators = + * final List<ExtraXMLGenerators> generators = * super.getExtraXMLGenerators(); - * + * * generators.add(new YourExtraXMLGenerator()); - * + * * return generators; * } * } - * </pre> + * </pre> + * * @return A list of all extra XML Generators for this content item. */ public List<ExtraXMLGenerator> getExtraXMLGenerators() { return new ArrayList<ExtraXMLGenerator>(); } + + /** + * <p> Override this method if your content items have extra XML for list + * views. You may return the same XML generators as in + * {@link #getExtraXMLGenerators()}. But beware: The page state passed to + * generators returned by this method will may be null. </p> + * + * @return A list of all extra XML Generators for lists views of + * this content item. + */ + public List<ExtraXMLGenerator> getExtraListXMLGenerators() { + return new ArrayList<ExtraXMLGenerator>(); + } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java 2012-02-22 18:50:10 UTC (rev 2278) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java 2012-02-22 18:53:15 UTC (rev 2279) @@ -90,7 +90,7 @@ Assert.exists(getContentType(), ContentType.class); } - + /** * Retrieves the current configuration */ @@ -98,11 +98,15 @@ retu... [truncated message content] |
From: <pb...@fe...> - 2012-02-22 18:50:20
|
Author: pboy Date: 2012-02-22 18:50:10 +0000 (Wed, 22 Feb 2012) New Revision: 2278 Modified: trunk/ccm-forum/src/com/arsdigita/forum/Forum.java trunk/ccm-forum/src/com/arsdigita/forum/ForumConfig.java trunk/ccm-forum/src/com/arsdigita/forum/ForumConfig_parameter.properties trunk/ccm-forum/src/com/arsdigita/forum/ui/ForumResources_de.properties Log: Forum: Sequence for threads is now configurable by parameters com.arsdigita.forum.thread_order_field & com.arsdigita.forum.thread_order_dir Modified: trunk/ccm-forum/src/com/arsdigita/forum/Forum.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/Forum.java 2012-02-22 15:23:49 UTC (rev 2277) +++ trunk/ccm-forum/src/com/arsdigita/forum/Forum.java 2012-02-22 18:50:10 UTC (rev 2278) @@ -64,7 +64,7 @@ * @author Kevin Scaldeferri (ke...@ar...) * @author chrisg23 * @author Jens Pelzetter (jensp) - * @version $Revision: 1.7 $ + * @version $Revision: 1.7 $ * @version $Id$ */ public class Forum extends Application { @@ -93,15 +93,15 @@ public static final String FORUM_MODERATION_PRIVILEGE = "forum_moderation"; public static final String CREATE_THREAD_PRIVILEGE = "forum_create_thread"; public static final String RESPOND_TO_THREAD_PRIVILEGE = "forum_respond"; - // separate read privilege required because all public users + // separate read privilege required because all public users // have READ on homepage, which is parent of forum, hence // everyone inherits READ cg // // note in hindsight, I have stopped homepage being set as - // permission context for forum, because site search checks + // permission context for forum, because site search checks // for READ privilege anyway, and so search results were being - // returned for non public posts. This means there is no longer - // any need for a separate forum_read privilege, though it + // returned for non public posts. This means there is no longer + // any need for a separate forum_read privilege, though it // does no harm. Now removed // // pb: Reactivated READ privilege in order to provide forums for different @@ -162,7 +162,7 @@ /** * Retrieves a Forum instance (its contained DataObject) based on its * internal id which is used to search for the OID. - * + * * @param id * @throws DataObjectNotFoundException */ @@ -172,8 +172,8 @@ /** * Convenient class for creation of a standard forum. Property "Moderated" - * is set to false. - * + * is set to false. + * * @param urlName of the forum to be created * @param title of forum to be created * @param parent object of forum to be created @@ -201,7 +201,7 @@ s_log.debug("creating forum " + title); /* Create an aplication instance including a container group in the - * user administration (5. parameter true) named according to the + * user administration (5. parameter true) named according to the * forum title. */ Forum forum = (Forum) Application.createApplication( BASE_DATA_OBJECT_TYPE, urlName, @@ -268,7 +268,7 @@ } /** - * + * */ private void createGroups() { @@ -347,8 +347,8 @@ super.beforeSave(); } - /** - * + /** + * */ @Override protected void afterSave() { @@ -540,7 +540,7 @@ * @return */ public DataAssociation getSuppressedPosts() { - // doesn't use getPosts in view of the warning that it + // doesn't use getPosts in view of the warning that it // may disappear DataAssociation posts = (DataAssociation) get(POSTS); posts.addEqualsFilter(Post.STATUS, Post.SUPPRESSED); @@ -597,7 +597,7 @@ } } - threadsData.addOrder("lastUpdate desc"); + threadsData.addOrder(getConfig().getThreadOrder()); return new ThreadCollection(threadsData); } @@ -735,7 +735,7 @@ * checks if the user can delete posts in this forum */ public boolean canDelete(Party party) { - return ((getConfig().canAdminEditPosts() + return ((getConfig().canAdminEditPosts() || getConfig().canAuthorDeletePosts()) && PermissionService.checkPermission( new PermissionDescriptor(PrivilegeDescriptor.DELETE, Modified: trunk/ccm-forum/src/com/arsdigita/forum/ForumConfig.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/ForumConfig.java 2012-02-22 15:23:49 UTC (rev 2277) +++ trunk/ccm-forum/src/com/arsdigita/forum/ForumConfig.java 2012-02-22 18:50:10 UTC (rev 2278) @@ -46,7 +46,6 @@ public class ForumConfig extends AbstractConfig { private static final Logger s_log = Logger.getLogger(ForumConfig.class); - private Parameter m_adminEditPosts; private Parameter m_authorEditPosts; private Parameter m_authorDeletePosts; @@ -62,79 +61,86 @@ private Parameter m_useWysiwygEditor; private Parameter m_rejectionMessage; private Parameter m_threadPageSize; + private Parameter m_threadOrderField; + private Parameter m_threadOrderDir; private Parameter m_quickFinish; private Parameter m_deleteSentSubscriptionNotifications; public ForumConfig() { m_adminEditPosts = new BooleanParameter( - "com.arsdigita.forum.admin_can_edit_posts", - Parameter.REQUIRED, - Boolean.TRUE); + "com.arsdigita.forum.admin_can_edit_posts", + Parameter.REQUIRED, + Boolean.TRUE); m_authorEditPosts = new BooleanParameter( - "com.arsdigita.forum.author_can_edit_posts", - Parameter.REQUIRED, - Boolean.TRUE); + "com.arsdigita.forum.author_can_edit_posts", + Parameter.REQUIRED, + Boolean.TRUE); m_authorDeletePosts = new BooleanParameter( - "com.arsdigita.forum.author_can_delete_posts", - Parameter.REQUIRED, - Boolean.TRUE); + "com.arsdigita.forum.author_can_delete_posts", + Parameter.REQUIRED, + Boolean.TRUE); m_replyHostName = new StringParameter( - "com.arsdigita.forum.reply_host_name", - Parameter.OPTIONAL, - null); + "com.arsdigita.forum.reply_host_name", + Parameter.OPTIONAL, + null); m_digestUserEmail = new StringParameter( - "com.arsdigita.forum.digest_user_email", - Parameter.OPTIONAL, - null); - m_disablePageCaching = new BooleanParameter ( - "com.arsdigita.forum.disable_page_caching", - Parameter.REQUIRED, - Boolean.FALSE); - - m_adminOnlyCreateTopics = new BooleanParameter ( - "com.arsdigita.forum.admin_only_to_create_topics", - Parameter.REQUIRED, - Boolean.FALSE); - m_maxImageSize = new IntegerParameter ( - "com.arsdigita.forum.maximum_image_size", - Parameter.OPTIONAL, null); - m_maxFileSize = new IntegerParameter ( - "com.arsdigita.forum.maximum_file_size", - Parameter.OPTIONAL, null); - + "com.arsdigita.forum.digest_user_email", + Parameter.OPTIONAL, + null); + m_disablePageCaching = new BooleanParameter( + "com.arsdigita.forum.disable_page_caching", + Parameter.REQUIRED, + Boolean.FALSE); + + m_adminOnlyCreateTopics = new BooleanParameter( + "com.arsdigita.forum.admin_only_to_create_topics", + Parameter.REQUIRED, + Boolean.FALSE); + m_maxImageSize = new IntegerParameter( + "com.arsdigita.forum.maximum_image_size", + Parameter.OPTIONAL, null); + m_maxFileSize = new IntegerParameter( + "com.arsdigita.forum.maximum_file_size", + Parameter.OPTIONAL, null); + m_showNewTabs = new BooleanParameter( - "com.arsdigita.forum.show_new_tabs", - Parameter.OPTIONAL, - Boolean.FALSE); + "com.arsdigita.forum.show_new_tabs", + Parameter.OPTIONAL, + Boolean.FALSE); m_showAllThreadAlerts = new BooleanParameter( - "com.arsdigita.forum.show_all_forum_thread_alerts", - Parameter.OPTIONAL, - Boolean.TRUE); + "com.arsdigita.forum.show_all_forum_thread_alerts", + Parameter.OPTIONAL, + Boolean.TRUE); m_useWysiwygEditor = new BooleanParameter( - "com.arsdigita.forum.use_wysiwyg_editor", - Parameter.OPTIONAL, - Boolean.FALSE); + "com.arsdigita.forum.use_wysiwyg_editor", + Parameter.OPTIONAL, + Boolean.FALSE); m_rejectionMessage = new StringParameter( - "com.arsdigita.forum.rejection_form_message.example", - Parameter.OPTIONAL, - null); - m_threadPageSize = new IntegerParameter ( - "com.arsdigita.forum.thread_page_size", - Parameter.REQUIRED, new Integer(10)); + "com.arsdigita.forum.rejection_form_message.example", + Parameter.OPTIONAL, + null); + m_threadPageSize = new IntegerParameter( + "com.arsdigita.forum.thread_page_size", + Parameter.REQUIRED, new Integer(10)); + m_threadOrderField = new StringParameter( + "com.arsdigita.forum.thread_order_field", + Parameter.REQUIRED, new String("lastUpdate")); + m_threadOrderDir = new StringParameter( + "com.arsdigita.forum.thread_order_dir", + Parameter.REQUIRED, new String("desc")); m_quickFinish = new BooleanParameter( - "com.arsdigita.forum.allow_quick_finish", - Parameter.OPTIONAL, - Boolean.FALSE); + "com.arsdigita.forum.allow_quick_finish", + Parameter.OPTIONAL, + Boolean.FALSE); m_deleteSentSubscriptionNotifications = new BooleanParameter( - "com.arsdigita.forum.delete_sent_subscription_notifications", - Parameter.OPTIONAL, - Boolean.FALSE); + "com.arsdigita.forum.delete_sent_subscription_notifications", + Parameter.OPTIONAL, + Boolean.FALSE); - m_adapters = new ResourceParameter - ("com.arsdigita.forum.traversal_adapters", - Parameter.REQUIRED, - "/WEB-INF/resources/forum-adapters.xml"); + m_adapters = new ResourceParameter("com.arsdigita.forum.traversal_adapters", + Parameter.REQUIRED, + "/WEB-INF/resources/forum-adapters.xml"); register(m_digestUserEmail); register(m_adminEditPosts); @@ -151,29 +157,31 @@ register(m_useWysiwygEditor); register(m_rejectionMessage); register(m_threadPageSize); + register(m_threadOrderField); + register(m_threadOrderDir); register(m_quickFinish); register(m_deleteSentSubscriptionNotifications); loadInfo(); } InputStream getTraversalAdapters() { - return (InputStream)get(m_adapters); + return (InputStream) get(m_adapters); } public boolean canAdminEditPosts() { - return ((Boolean)get(m_adminEditPosts)).booleanValue(); + return ((Boolean) get(m_adminEditPosts)).booleanValue(); } public boolean canAuthorEditPosts() { - return ((Boolean)get(m_authorEditPosts)).booleanValue(); + return ((Boolean) get(m_authorEditPosts)).booleanValue(); } boolean canAuthorDeletePosts() { - return ((Boolean)get(m_authorDeletePosts)).booleanValue(); + return ((Boolean) get(m_authorDeletePosts)).booleanValue(); } - + public String getDigestUserEmail() { - String email = (String)get(m_digestUserEmail); + String email = (String) get(m_digestUserEmail); if (email == null) { email = "forum-robot@" + Web.getConfig().getServer().getName(); } @@ -181,7 +189,7 @@ } public String getReplyHostName() { - String hostName = (String)get(m_replyHostName); + String hostName = (String) get(m_replyHostName); if (hostName == null) { hostName = Web.getConfig().getServer().getName(); } @@ -189,33 +197,34 @@ } /** - * Supports prevention of client and middleware caching - - * use in situations where users with different - * permissions share machines + * Supports prevention of client and middleware caching - use in situations + * where users with different permissions share machines + * * @return */ - public boolean disableClientPageCaching () { - return ((Boolean)get(m_disablePageCaching)).booleanValue(); - } - + public boolean disableClientPageCaching() { + return ((Boolean) get(m_disablePageCaching)).booleanValue(); + } + /** - * if true, disables topic tab for non admin users. Topic - * tab does not access control topic creation, so set this - * to true to maintain control of the topics on the forum. - * - * - * + * if true, disables topic tab for non admin users. Topic tab does not + * access control topic creation, so set this to true to maintain control of + * the topics on the forum. + * + * + * * @return */ - public boolean topicCreationByAdminOnly () { - return ((Boolean)get(m_adminOnlyCreateTopics)).booleanValue(); - } + public boolean topicCreationByAdminOnly() { + return ((Boolean) get(m_adminOnlyCreateTopics)).booleanValue(); + } + public User getDigestUser() { String email = getDigestUserEmail(); UserCollection users = User.retrieveAll(); users.addEqualsFilter("primaryEmail", - email); + email); if (!users.next()) { throw new RuntimeException("cannot find user " + email); @@ -225,85 +234,102 @@ users.close(); return user; } + /** - * returns the maximum allowed size (in bytes) of - * image files attached to posts. Any larger - * files are rejected by UI validation + * returns the maximum allowed size (in bytes) of image files attached to + * posts. Any larger files are rejected by UI validation + * * @return */ public long getMaxImageSize() { - Integer size = (Integer)get(m_maxImageSize); - long longSize = Long.MAX_VALUE; - if (size != null) { - longSize = size.longValue(); - } - return longSize; + Integer size = (Integer) get(m_maxImageSize); + long longSize = Long.MAX_VALUE; + if (size != null) { + longSize = size.longValue(); + } + return longSize; } + /** - * returns the maximum allowed size (in bytes) of - * files attached to posts. Any larger - * files are rejected by UI validation + * returns the maximum allowed size (in bytes) of files attached to posts. + * Any larger files are rejected by UI validation + * * @return */ public long getMaxFileSize() { - Integer size = (Integer)get(m_maxFileSize); - long longSize = Long.MAX_VALUE; - if (size != null) { - longSize = size.longValue(); - } - return longSize; + Integer size = (Integer) get(m_maxFileSize); + long longSize = Long.MAX_VALUE; + if (size != null) { + longSize = size.longValue(); + } + return longSize; } - - + /** - * if true, alerts tab displays thread alerts for this and all other - * forums. If false, only display thread subscriptions for current - * forum. + * if true, alerts tab displays thread alerts for this and all other forums. + * If false, only display thread subscriptions for current forum. + * * @return */ /* - * If true, the thread alert page lists thread alerts from - * all forums - alerts not from the current forum have - * links to the thread displayed within the context of - * the current forum. Looks weird and needs to be sorted out - * presumably the correct forum needs to be set in the ForumContext - * when a link is selected - */ - public boolean showThreadAlertsForAllForums () { - return ((Boolean)get(m_showAllThreadAlerts)).booleanValue(); + * If true, the thread alert page lists thread alerts from all forums - + * alerts not from the current forum have links to the thread displayed + * within the context of the current forum. Looks weird and needs to be + * sorted out presumably the correct forum needs to be set in the + * ForumContext when a link is selected + */ + public boolean showThreadAlertsForAllForums() { + return ((Boolean) get(m_showAllThreadAlerts)).booleanValue(); } + /** * if true, displays setup and permissions tabs + * * @return */ - public boolean showNewTabs () { - return ((Boolean)get(m_showNewTabs)).booleanValue(); - } - - public boolean useWysiwygEditor () { - return ((Boolean)get(m_useWysiwygEditor)).booleanValue(); + public boolean showNewTabs() { + return ((Boolean) get(m_showNewTabs)).booleanValue(); } - + + public boolean useWysiwygEditor() { + return ((Boolean) get(m_useWysiwygEditor)).booleanValue(); + } + /** - * message added to the bottom of the moderation reection email. - * May give details about what the poster can do if not happy - * with rejection + * message added to the bottom of the moderation reection email. May give + * details about what the poster can do if not happy with rejection + * * @return */ - public String getRejectionMessage () { - return (String)get(m_rejectionMessage); + public String getRejectionMessage() { + return (String) get(m_rejectionMessage); } - - public int getThreadPageSize () { - return ((Integer)get(m_threadPageSize)).intValue(); + + public int getThreadPageSize() { + return ((Integer) get(m_threadPageSize)).intValue(); } - - public boolean quickFinishAllowed () { - return ((Boolean)get(m_quickFinish)).booleanValue(); + + public String getThreadOrder() { + String field = (String) get(m_threadOrderField); + String dir = (String) get(m_threadOrderDir); + + // Test for validity + if(!field.equals("lastUpdate") && !field.equals("root.sent")) { + field = "lastUpdate"; // Default behaviour + } + + if(!dir.equals("asc") && !dir.equals("desc")) { + dir = "desc"; // Default behaviour + } + + return field + " " + dir; } - - public boolean deleteNotifications () { - return ((Boolean)get(m_deleteSentSubscriptionNotifications)).booleanValue(); + + public boolean quickFinishAllowed() { + return ((Boolean) get(m_quickFinish)).booleanValue(); } + public boolean deleteNotifications() { + return ((Boolean) get(m_deleteSentSubscriptionNotifications)).booleanValue(); + } } Modified: trunk/ccm-forum/src/com/arsdigita/forum/ForumConfig_parameter.properties =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/ForumConfig_parameter.properties 2012-02-22 15:23:49 UTC (rev 2277) +++ trunk/ccm-forum/src/com/arsdigita/forum/ForumConfig_parameter.properties 2012-02-22 18:50:10 UTC (rev 2278) @@ -41,12 +41,12 @@ com.arsdigita.forum.maximum_image_size.title=Maximum size of image uploads in bytes com.arsdigita.forum.maximum_image_size.purpose=Prevent huge images from being uploaded com.arsdigita.forum.maximum_image_size.format=[integer] -com.arsdigita.forum.maximum_image_size.example=1048576 +com.arsdigita.forum.maximum_image_size.example=1048576 com.arsdigita.forum.maximum_file_size.title=Maximum size of file uploads in bytes com.arsdigita.forum.maximum_file_size.purpose=prevent huge files from being uploaded com.arsdigita.forum.maximum_file_size.format=[integer] -com.arsdigita.forum.maximum_file_size.example=1048576 +com.arsdigita.forum.maximum_file_size.example=1048576 com.arsdigita.forum.show_all_forum_thread_alerts.title=Display thread alerts from all forums com.arsdigita.forum.show_all_forum_thread_alerts.purpose=decide whether to display thread alerts for this forum only or all alerts for user @@ -68,11 +68,21 @@ com.arsdigita.forum.rejection_form_message.format=[string] com.arsdigita.forum.rejection_form_message.example=Please do not reply to this email. If you have any comments, please email web...@ex... -com.arsdigita.forum.thread_page_size.title=Number of threads displayed per page +com.arsdigita.forum.thread_page_size.title=Number of threads displayed per page com.arsdigita.forum.thread_page_size.purpose=balance page loading time against number of key preses com.arsdigita.forum.thread_page_size.format=[integer] com.arsdigita.forum.thread_page_size.example=10 +com.arsdigita.forum.thread_order_field.title=Thread list order field +com.arsdigita.forum.thread_order_field.purpose=Define field by which the thread list will be orderd +com.arsdigita.forum.thread_order_field.format=[string] +com.arsdigita.forum.thread_order_field.example=lastUpdate|root.sent + +com.arsdigita.forum.thread_order_dir.title=Thread list order direction +com.arsdigita.forum.thread_order_dir.purpose=Ascending or descending sort order +com.arsdigita.forum.thread_order_dir.format=[string] +com.arsdigita.forum.thread_order_dir.example=asc|desc + com.arsdigita.forum.allow_quick_finish.title=Allow quick finish on posts com.arsdigita.forum.allow_quick_finish.purpose=To give users the option of omitting post steps if they have a quick text post com.arsdigita.forum.allow_quick_finish.format=[boolean] Modified: trunk/ccm-forum/src/com/arsdigita/forum/ui/ForumResources_de.properties =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/ui/ForumResources_de.properties 2012-02-22 15:23:49 UTC (rev 2277) +++ trunk/ccm-forum/src/com/arsdigita/forum/ui/ForumResources_de.properties 2012-02-22 18:50:10 UTC (rev 2278) @@ -18,7 +18,7 @@ forum.ui.thread.newPost=Neuer Beitrag forum.ui.thread.subscribe=Beitrag abonnieren -forum.ui.thread.unsubscribe=Beitrag Abonoment stornieren +forum.ui.thread.unsubscribe=Beitrag Abonnement stornieren forum.ui.thread.viewAll=Alle Beitr\u00e4ge forum.ui.topic.description=Beschreibung @@ -47,7 +47,7 @@ forum.ui.settings.allowFiles=Dateianh\u00e4nge zulassen forum.ui.settings.allowImages=Bilder in Posts zulassen forum.ui.settings.autosubscribe=Automatically subscribe thread starters -forum.ui.settings.noCategoryPosts=Allow posts with no topic +forum.ui.settings.noCategoryPosts=Allow posts with no topic forum.ui.settings.anonymousPosts=Allow anonymous posts forum.ui.settings.save=\u00c4nderungen sichern forum.ui.settings.introduction=Einf\u00fchrung |
Author: pboy Date: 2012-01-22 13:07:26 +0000 (Sun, 22 Jan 2012) New Revision: 2276 Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentType.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentTypeHelperImpl.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonCreate.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/Paginator.java trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchSection.java trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchSectionInline.java trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchWidget.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminPane.java trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ContentTypeFilterWidget.java trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ItemQueryComponent.java trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java trunk/ccm-portalworkspace/web/WEB-INF/web.ccm-portalworkspace.xml trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Initializer.java trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Loader.java trunk/ccm-subsite/src/com/arsdigita/subsite/Loader.java trunk/ccm-subsite/src/com/arsdigita/subsite/Subsite.java Log: Various minor fixes, formatting, etc. Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentType.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentType.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentType.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -574,7 +574,7 @@ CompoundFilter or = ff.or(); // The content type must be either of the requested type - or.addFilter(ff.equals(ContentType.ID, ct.ID)); + or.addFilter(ff.equals(ContentType.ID, ct.getID().toString())); // Or must be a descendant of the requested type try { Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentTypeHelperImpl.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentTypeHelperImpl.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentTypeHelperImpl.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -384,8 +384,8 @@ || (parent.getAncestors() != null && ct.getAncestors() != null && parent.getAncestors().length() < ct.getAncestors(). - length()) - || !(parent.getClassName().equals(ct.getClassName())))) { + length()))) { + //|| !(parent.getClassName().equals(ct.getClassName())))) { //System.out.printf("Setting parent to '%s'...\n", //ct.getClassName()); parent = ct; @@ -431,12 +431,12 @@ // Add this to parent descendants // //System.out.printf("Adding '%s' to descendants of parent '%s'...\n", // type.getClassName(), parent.getClassName()); - // parent.addDescendants(type.getID()); - for(ContentType p: parents) { + parent.addDescendants(type.getID()); + /*for(ContentType p: parents) { parent.addDescendants(type.getID()); //System.out.printf("Adding '%s' to descendants of parent '%s'...\n", // type.getClassName(), p.getClassName()); - } + }*/ } //System.out.printf("Finished create pedigree for content type '%s'.\n\n", // type.getClassName()); Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonCreate.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonCreate.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonCreate.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -78,7 +78,7 @@ public void validate(FormSectionEvent e) throws FormProcessException { Folder f = m_parent.getFolder(e.getPageState()); Assert.exists(f); - validateNameUniqueness(f, e, GenericPerson.urlSave(getFullname(e))); + validateNameUniqueness(f, e, GenericPerson.urlSave(getItemName(e))); } // Process: save fields to the database @@ -89,7 +89,7 @@ final ContentSection section = m_parent.getContentSection(state); Folder folder = m_parent.getFolder(state); - String fullName = getFullname(e); + String fullName = getItemName(e); Assert.exists(section, ContentSection.class); final ContentPage item = createContentPage(state); @@ -118,31 +118,11 @@ } // Generate full name - private String getFullname(FormSectionEvent e) { - final FormData data = e.getFormData(); - String titlePre = data.getString(TITLEPRE); + private String getItemName(FormSectionEvent e) { + final FormData data = e.getFormData(); String givenName = data.getString(GIVENNAME); - String surname = data.getString(SURNAME); - String titlePost = data.getString(TITLEPOST); + String surname = data.getString(SURNAME); - if (titlePre == null) { - titlePre = ""; - } - if (titlePost == null) { - titlePost = ""; - } - if (givenName == null) { - givenName = ""; - } - if (surname == null) { - surname = ""; - } - - if (titlePost.trim().isEmpty()) { - return String.format("%s %s %s", titlePre, givenName, surname).trim(); - } else { - return String.format("%s %s %s, %s", titlePre, givenName, surname, - titlePost).trim(); - } + return String.format("%s %s", surname, givenName); } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/Paginator.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/Paginator.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/Paginator.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -10,10 +10,10 @@ import org.apache.log4j.Logger; /** - * Paginator class for the classes implementing + * Paginator class for the classes implementing * {@link com.arsdigita.cms.contenttypes.ui.GenericOrgaUnitTab}. - * - * @author Jens Pelzetter + * + * @author Jens Pelzetter * @version $Id$ */ public class Paginator { @@ -45,7 +45,7 @@ logger.debug(String.format("pageNumber = %d", pageNumber)); } this.objectCount = objectCount; - + if (request.getParameter(PAGE_SIZE) == null) { this.pageSize = pageSize; } else { @@ -95,8 +95,8 @@ logger.debug(String.format("Applying limits: %d, %d", getBegin(), - getEnd())); - query.setRange(getBegin(), getEnd() + 1); + getEnd())); + query.setRange(getBegin(), getEnd() + 1); } public int getPageCount() { @@ -131,14 +131,17 @@ } private int getCount() { - return Math.min(pageSize, (objectCount - getBegin())); + return Math.min(pageSize, (objectCount - getBegin() + 1)); } private int getEnd() { - int paginatorEnd = getBegin() + getCount(); + int paginatorEnd = getBegin() + getCount() - 1; if (paginatorEnd < 0) { paginatorEnd = 0; } + if (paginatorEnd <= getBegin()) { + paginatorEnd = (getBegin() + 1); + } return paginatorEnd; } Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchSection.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchSection.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchSection.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -18,7 +18,6 @@ */ package com.arsdigita.cms.ui; - import com.arsdigita.bebop.Component; import com.arsdigita.bebop.SimpleContainer; import com.arsdigita.bebop.Container; @@ -30,6 +29,7 @@ import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.parameters.BigDecimalParameter; +import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ui.search.ItemQueryComponent; import com.arsdigita.search.ui.ResultsPane; @@ -38,49 +38,66 @@ /** * Contains a form for specifying search parameters, as well as a - * {@link com.arsdigita.search.ui.ResultsPane} which will perform - * the search and display the results + * {@link com.arsdigita.search.ui.ResultsPane} which will perform the search and + * display the results * * @author Stanislav Freidin (sfr...@ar...) * @version $Id$ */ -public class ItemSearchSection extends FormSection - implements Resettable, QueryGenerator { +public class ItemSearchSection extends FormSection + implements Resettable, QueryGenerator { private static final org.apache.log4j.Logger s_log = - org.apache.log4j.Logger.getLogger(ItemSearchSection.class); - + org.apache.log4j.Logger. + getLogger(ItemSearchSection.class); public static final String SINGLE_TYPE_PARAM = "single_type"; - - private ItemQueryComponent m_query; private Component m_results; /** - * Construct a new <code>ItemSearchSection</code> component + * Construct a new + * <code>ItemSearchSection</code> component * * @param context the context for the retrieved items. Should be * {@link ContentItem#DRAFT} or {@link ContentItem#LIVE} - * @param limitToContentSection limit the search to the current content section + * @param limitToContentSection limit the search to the current content + * section */ public ItemSearchSection(String context, boolean limitToContentSection) { this(null, context, limitToContentSection); } + /** - * Construct a new <code>ItemSearchSection</code> component + * Construct a new + * <code>ItemSearchSection</code> component * * @param context the context for the retrieved items. Should be * {@link ContentItem#DRAFT} or {@link ContentItem#LIVE} - * @param name The name of the search parameter for the particular FormSection - * @param limitToContentSection limit the search to the current content section + * @param name The name of the search parameter for the particular + * FormSection + * @param limitToContentSection limit the search to the current content + * section */ - public ItemSearchSection(String name, String context, boolean limitToContentSection) { + public ItemSearchSection(String name, + String context, + boolean limitToContentSection) { + this(name, context, limitToContentSection, null); + } + + public ItemSearchSection(String name, + String context, + boolean limitToContentSection, + ContentType type) { super(new SimpleContainer()); String thisName = (name == null ? "itemSearch" : name); - - m_query = createQueryGenerator(context, limitToContentSection); + + if (type == null) { + m_query = createQueryGenerator(context, limitToContentSection); + } else { + m_query = createQueryGenerator(context, limitToContentSection, type); + } m_results = createResultsPane(m_query); - + addQueryGenerator(this); addResultsPane(this); addFormListener(); @@ -100,9 +117,16 @@ m_results.setVisible(state, false); } - protected ItemQueryComponent createQueryGenerator(String context, boolean limitToContentSection) { + protected ItemQueryComponent createQueryGenerator(String context, + boolean limitToContentSection) { return new ItemQueryComponent(context, limitToContentSection); } + + protected ItemQueryComponent createQueryGenerator(String context, + boolean limitToContentSection, + ContentType type) { + return new ItemQueryComponent(context, limitToContentSection, type); + } protected Component createResultsPane(QueryGenerator generator) { ResultsPane pane = new ResultsPane(generator); @@ -113,7 +137,7 @@ protected void addResultsPane(Container container) { container.add(m_results); } - + protected void addQueryGenerator(Container container) { container.add(m_query); } @@ -137,6 +161,7 @@ * Displays the "keywords" and "content types" widgets */ private class SearchFormProcessListener implements FormProcessListener { + public void process(FormSectionEvent e) throws FormProcessException { PageState s = e.getPageState(); processQuery(s); Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchSectionInline.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchSectionInline.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchSectionInline.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -26,6 +26,7 @@ import com.arsdigita.toolbox.ui.OIDParameter; import com.arsdigita.persistence.OID; import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ContentType; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.xml.Element; @@ -62,6 +63,14 @@ m_name = name; m_item = new OIDParameter(name + "_itemOID"); } + + public ItemSearchSectionInline(String name, String context, + boolean limitToContentSection, + ContentType type) { + super(name, context, limitToContentSection, type); + m_name = name; + m_item = new OIDParameter(name + "_itemOID"); + } @Override public void register(Page p) { Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchWidget.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchWidget.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchWidget.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -45,10 +45,10 @@ import org.apache.log4j.Logger; /** - * A class representing a content item search field in an HTML form. - * - * @author Scott Seago (ss...@re...) - * @version $Id$ + * A class representing a content item search field in an HTML form. + * + * @author Scott Seago (ss...@re...) + * @version $Id$ */ public class ItemSearchWidget extends FormSection implements BebopConstants, FormSubmissionListener, FormInitListener { @@ -88,14 +88,15 @@ public SearchFragment(String name, ItemSearchWidget parent) { super(name, "Search"); this.parent = parent; - this.setAttribute("onClick", "return " + parent.m_item.getName().replace('.', '_') + "Popup(this.form)"); + this.setAttribute("onClick", "return " + parent.m_item.getName(). + replace('.', '_') + "Popup(this.form)"); this.setAttribute("value", "Search"); } @Override public boolean isVisible(PageState ps) { return (!(parent.m_search.isSelected(ps) - || parent.m_searchComponent.hasQuery(ps)) + || parent.m_searchComponent.hasQuery(ps)) && super.isVisible(ps)); } } @@ -107,7 +108,8 @@ public ClearFragment(String name, ItemSearchWidget parent) { super(name, "Clear"); this.parent = parent; - this.setAttribute("onClick", "this.form." + parent.m_item.getName() + ".value = \"\"; return false;"); + this.setAttribute("onClick", "this.form." + parent.m_item.getName() + + ".value = \"\"; return false;"); this.setAttribute("value", "Clear"); } } @@ -116,7 +118,8 @@ private ItemSearchWidget parent; - public LabelFragment(String name, boolean escaping, ItemSearchWidget parent) { + public LabelFragment(String name, boolean escaping, + ItemSearchWidget parent) { super(name, escaping); this.parent = parent; } @@ -126,15 +129,25 @@ private ItemSearchWidget parent; - public ItemSearchFragment(String name, String context, ItemSearchWidget parent, boolean limitToContentSection) { + public ItemSearchFragment(String name, String context, + ItemSearchWidget parent, + boolean limitToContentSection) { super(name, context, limitToContentSection); this.parent = parent; } + public ItemSearchFragment(String name, String context, + ItemSearchWidget parent, + boolean limitToContentSection, + ContentType type) { + super(name, context, limitToContentSection, type); + this.parent = parent; + } + @Override public boolean isVisible(PageState ps) { return ((m_search.isSelected(ps) - || hasQuery(ps)) + || hasQuery(ps)) && super.isVisible(ps)); } } @@ -148,20 +161,22 @@ @Override public boolean isVisible(PageState ps) { return ((m_search.isSelected(ps) - || m_searchComponent.hasQuery(ps)) + || m_searchComponent.hasQuery(ps)) && super.isVisible(ps)); } } /** - * Construct a new ItemSearchWidget. The model must be an ItemSearchParameter + * Construct a new ItemSearchWidget. The model must be an + * ItemSearchParameter */ public ItemSearchWidget(ParameterModel model) { this(model, null); } /** - * Construct a new ItemSearchWidget. The model must be an ItemSearchParameter + * Construct a new ItemSearchWidget. The model must be an + * ItemSearchParameter */ public ItemSearchWidget(ParameterModel model, ContentType contentType) { super(new BoxPanel(BoxPanel.VERTICAL)); @@ -194,11 +209,13 @@ public void prepare(PrintEvent event) { PageState state = event.getPageState(); Label t = (Label) event.getTarget(); - String formName = ((LabelFragment) t).parent.getSearchButton().getForm().getName(); + String formName = ((LabelFragment) t).parent.getSearchButton(). + getForm().getName(); ParameterMap params = new ParameterMap(); params.setParameter("section_id", - CMS.getContext().getContentSection().getID()); - params.setParameter("widget", formName + ".elements['" + m_item.getName() + "']"); + CMS.getContext().getContentSection().getID()); + params.setParameter("widget", formName + ".elements['" + m_item. + getName() + "']"); if (typeURLFrag != null) { params.setParameter("single_type", typeURLFrag); } @@ -208,34 +225,45 @@ ItemSearchPage.class.getName()); s_log.debug("Search URL stub is: " + searchURL); - searchURL = com.arsdigita.cms.dispatcher.Utilities.getWorkspaceURL() - + searchURL; + searchURL = com.arsdigita.cms.dispatcher.Utilities. + getWorkspaceURL() + + searchURL; // TODO Not sure what to do when you get a null here URL url = URL.there(state.getRequest(), searchURL, params); t.setLabel(" <script language=javascript> " - + " <!-- \n" - + " function " - + m_item.getName().replace('.', '_') - + "Popup(theForm) { \n" - + " aWindow = window.open(\"" + url - + "\", \"search\", \"toolbar=no,width=800,height=600,status=no,scrollbars=yes,resize=yes,menubar=no\");\n return false;\n" - + " } \n" - + " --> \n" - + " </script> "); + + " <!-- \n" + + " function " + + m_item.getName().replace('.', '_') + + "Popup(theForm) { \n" + + " aWindow = window.open(\"" + url + + "\", \"search\", \"toolbar=no,width=800,height=600,status=no,scrollbars=yes,resize=yes,menubar=no\");\n return false;\n" + + " } \n" + + " --> \n" + + " </script> "); } }); m_topHR = new HRLabel(); add(m_topHR); - FormSection searchSection = new FormSection(new BoxPanel(BoxPanel.HORIZONTAL)); + FormSection searchSection = new FormSection(new BoxPanel( + BoxPanel.HORIZONTAL)); searchSection.add(m_item); searchSection.add(m_search); searchSection.add(m_clear); searchSection.add(m_jsLabel); add(searchSection); - m_searchComponent = new ItemSearchFragment(m_name, ContentItem.DRAFT, this, LIMIT_TO_CONTENT_SECTION); + if (m_contentType == null) { + m_searchComponent = new ItemSearchFragment(m_name, ContentItem.DRAFT, + this, + LIMIT_TO_CONTENT_SECTION); + } else { + m_searchComponent = new ItemSearchFragment(m_name, ContentItem.DRAFT, + this, + LIMIT_TO_CONTENT_SECTION, + m_contentType); + } add(m_searchComponent); addSubmissionListener(this); addInitListener(this); @@ -257,11 +285,11 @@ } public ItemSearchWidget(String name, - String objectType) + String objectType) throws DataObjectNotFoundException { this(name, (objectType == null || objectType.length() == 0 - ? null - : ContentType.findByAssociatedObjectType(objectType))); + ? null + : ContentType.findByAssociatedObjectType(objectType))); } public ItemSearchWidget(String name, ContentType contentType) { @@ -326,9 +354,11 @@ } if (m_contentType != null) { - s.setValue(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM), m_contentType.getID()); + s.setValue(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM), + m_contentType.getID()); } else { - s.setValue(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM), null); + s.setValue(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM), + null); } throw new FormProcessException("item search FormSection submit"); } else if (m_search.isSelected(s)) { @@ -344,9 +374,11 @@ } if (m_contentType != null) { - s.setValue(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM), m_contentType.getID()); + s.setValue(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM), + m_contentType.getID()); } else { - s.setValue(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM), null); + s.setValue(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM), + null); } throw new FormProcessException("item search FormSection submit"); } else if (m_clear.isSelected(s)) { Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminPane.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminPane.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminPane.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -34,6 +34,7 @@ import com.arsdigita.toolbox.ui.LayoutPanel; import com.arsdigita.web.RedirectSignal; import com.arsdigita.web.URL; +import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; /** @@ -143,6 +144,7 @@ push(state, m_errorPane); } else { push(state, m_lockedPane); + state.getResponse().addIntHeader("Refresh", 5); } } else { if (state.isVisibleOnPage(ItemLifecycleAdminPane.this)) { Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ContentTypeFilterWidget.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ContentTypeFilterWidget.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ContentTypeFilterWidget.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -18,6 +18,10 @@ */ package com.arsdigita.cms.ui.search; +/** + * @author Unknown + * @author Jens Pelzetter (je...@jp...) + */ import com.arsdigita.search.ui.FilterWidget; import com.arsdigita.search.Search; import com.arsdigita.search.FilterSpecification; @@ -42,7 +46,8 @@ private ContentType[] m_types = null; public ContentTypeFilterWidget(ContentTypeCollection types) { - super(new ContentTypeFilterType(), new ArrayParameter(new StringParameter(ContentTypeFilterType.KEY))); + super(new ContentTypeFilterType(), + new ArrayParameter(new StringParameter(ContentTypeFilterType.KEY))); m_types = new ContentType[(int) types.size()]; @@ -55,7 +60,8 @@ this(section.getContentTypes()); } - public ContentTypeFilterWidget(ContentSection section, ContentType parentType) { + public ContentTypeFilterWidget(ContentSection section, + ContentType parentType) { this(section.getDescendantsOfContentType(parentType)); m_section = section; m_parentType = parentType; @@ -79,7 +85,8 @@ ContentType ct = m_parentType; BigDecimal singleTypeID = - (BigDecimal) state.getValue(new BigDecimalParameter(ItemSearch.SINGLE_TYPE_PARAM)); + (BigDecimal) state.getValue(new BigDecimalParameter( + ItemSearch.SINGLE_TYPE_PARAM)); if (singleTypeID != null) { try { @@ -108,7 +115,8 @@ if (parentType == null) { typesCollection = section.getContentTypes(); } else { - typesCollection = section.getDescendantsOfContentType(parentType); + typesCollection = section.getDescendantsOfContentType( + parentType); } } else { @@ -134,7 +142,15 @@ String[] types = (String[]) getValue(state); if (types == null) { - types = new String[0]; + if (getParentType(state) == null) { + types = new String[0]; + } else { + final ContentType[] widgetTypes = getContentTypes(state); + types = new String[widgetTypes.length]; + for (int i = 0; i < widgetTypes.length; i++) { + types[i] = widgetTypes[i].getAssociatedObjectType(); + } + } } return new ContentTypeFilterSpecification(types); Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ItemQueryComponent.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ItemQueryComponent.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ItemQueryComponent.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -24,6 +24,7 @@ import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ContentSectionCollection; +import com.arsdigita.cms.ContentType; import com.arsdigita.cms.SecurityManager; import com.arsdigita.cms.search.CreationDateFilterType; import com.arsdigita.cms.search.CreationUserFilterType; @@ -42,12 +43,13 @@ import java.util.List; /** - * This class provides a basic query form for CMS admin pages - * that automatically adds components for the maximal set of - * filters supported by the current search query engine. + * This class provides a basic query form for CMS admin pages that automatically + * adds components for the maximal set of filters supported by the current + * search query engine. * * @author unknown * @author Sören Bernstein (sbe...@qu...) + * @author Jens Pelzetter (je...@jp...) */ public class ItemQueryComponent extends BaseQueryComponent { @@ -55,6 +57,12 @@ public ItemQueryComponent(String context, final boolean limitToContentSection) { + this(context, limitToContentSection, null); + } + + public ItemQueryComponent(String context, + final boolean limitToContentSection, + ContentType type) { m_context = context; if (Search.getConfig().isIntermediaEnabled()) { @@ -94,19 +102,34 @@ } }); - add(new ContentTypeFilterWidget() { + if (type == null) { + add(new ContentTypeFilterWidget() { - @Override - protected ContentSection getContentSection() { - if (limitToContentSection == true && CMS.getContext(). - hasContentSection()) { - return CMS.getContext().getContentSection(); - } else { - return super.getContentSection(); + @Override + protected ContentSection getContentSection() { + if (limitToContentSection == true && CMS.getContext(). + hasContentSection()) { + return CMS.getContext().getContentSection(); + } else { + return super.getContentSection(); + } } - } - }); + }); + } else { + add(new ContentTypeFilterWidget(type) { + @Override + protected ContentSection getContentSection() { + if (limitToContentSection == true && CMS.getContext(). + hasContentSection()) { + return CMS.getContext().getContentSection(); + } else { + return super.getContentSection(); + } + } + }); + } + add(new VersionFilterComponent(context)); if (limitToContentSection == true) { add(new ContentSectionFilterComponent()); Modified: trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java =================================================================== --- trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -190,10 +190,12 @@ "Portal Workspace", Workspace.BASE_DATA_OBJECT_TYPE ); type.setDescription("Portal based collaborative workspaces"); + /* Create an application type specific group in user administration * * which serves as a container for subgroups, each subgroup coupled * * to an application (instances) of this type. */ type.createGroup(); + return type; } Modified: trunk/ccm-portalworkspace/web/WEB-INF/web.ccm-portalworkspace.xml =================================================================== --- trunk/ccm-portalworkspace/web/WEB-INF/web.ccm-portalworkspace.xml 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-portalworkspace/web/WEB-INF/web.ccm-portalworkspace.xml 2012-01-22 13:07:26 UTC (rev 2276) @@ -7,7 +7,7 @@ <!-- module ccm-portalworkspace - servlet definitions BEGIN --> <servlet> -<!-- <servlet-name>files</servlet-name> --> + <!-- <servlet-name>files</servlet-name> --> <servlet-name>portalworkspace-files</servlet-name> <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> Modified: trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Initializer.java =================================================================== --- trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Initializer.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Initializer.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -24,7 +24,7 @@ import com.arsdigita.kernel.ACSObjectInstantiator; -import com.arsdigita.persistence.pdl.ManifestSource; +// import com.arsdigita.persistence.pdl.ManifestSource; import com.arsdigita.persistence.pdl.NameFilter; import com.arsdigita.persistence.pdl.ManifestSource; import com.arsdigita.persistence.DataObject; @@ -59,12 +59,14 @@ * Implementation of the init(DomainInitEvent) initializer. * @param e */ + @Override public void init(DomainInitEvent e) { super.init(e); e.getFactory().registerInstantiator( Shortcuts.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { + @Override public DomainObject doNewInstance(DataObject dataObject) { return new Shortcuts(dataObject); } Modified: trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Loader.java =================================================================== --- trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Loader.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Loader.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -53,6 +53,8 @@ new KernelExcursion() { public void excurse() { setEffectiveParty(Kernel.getSystemParty()); + + // setup application setupShortcuts(); } }.run(); Modified: trunk/ccm-subsite/src/com/arsdigita/subsite/Loader.java =================================================================== --- trunk/ccm-subsite/src/com/arsdigita/subsite/Loader.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-subsite/src/com/arsdigita/subsite/Loader.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -42,6 +42,11 @@ private static final Logger s_log = Logger.getLogger(Loader.class); + /** + * Run script invoked by com.arsdigita.packing loader script. + * + * @param ctx + */ public void run(final ScriptContext ctx) { new KernelExcursion() { public void excurse() { Modified: trunk/ccm-subsite/src/com/arsdigita/subsite/Subsite.java =================================================================== --- trunk/ccm-subsite/src/com/arsdigita/subsite/Subsite.java 2012-01-22 12:51:47 UTC (rev 2275) +++ trunk/ccm-subsite/src/com/arsdigita/subsite/Subsite.java 2012-01-22 13:07:26 UTC (rev 2276) @@ -107,13 +107,13 @@ * <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> * <init-param> * <param-name>template-path</param-name> - * <param-value>/templates/ccm-ldn-subsite</param-value> + * <param-value>/templates/ccm-subsite</param-value> * </init-param> * </servlet> * * <servlet-mapping> * <servlet-name>subsite-files</servlet-name> - * <url-pattern>/ccm-ldn-subsite/files/*</url-pattern> + * <url-pattern>/ccm-subsite/files/*</url-pattern> * </servlet-mapping> * * @return path name to the applications servlet/JSP |
From: <pb...@fe...> - 2012-01-20 00:29:24
|
Author: pboy Date: 2012-01-20 00:29:13 +0000 (Fri, 20 Jan 2012) New Revision: 2274 Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminPane.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/PublishLock.java Log: Improved threaded publishing (added UncaughtExceptionHandler) Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties 2012-01-20 00:21:50 UTC (rev 2273) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties 2012-01-20 00:29:13 UTC (rev 2274) @@ -1089,3 +1089,4 @@ cms.ui.item.lifecycle.do.not_authorized=Your not authorized to publish this item. cms.ui.item.lifecycle.publish_locked=This content item is being (re-)published cms.ui.item.lifecycle.publish_locked.update=Update +cms.ui.lifecycle.publish.error=An error occured while publishing this item. Please inform your system administrator. This item will stay locked until the locked is removed by the system administrator manually. Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties 2012-01-20 00:21:50 UTC (rev 2273) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties 2012-01-20 00:29:13 UTC (rev 2274) @@ -1080,3 +1080,4 @@ cms.ui.item.lifecycle.do.not_authorized=Sie sind nicht berechtigt, dieses Item zu publizieren. cms.ui.item.lifecycle.publish_locked=Dieses Content-Item wird gerade (re-)publiziert cms.ui.item.lifecycle.publish_locked.update=Aktualisieren +cms.ui.lifecycle.publish.error=W\u00e4hrend des Publizierens ist ein Fehler aufgetreten. Bitte informieren Sie Ihren System-Administrator. Dieses Item bleibt besperrt, bis der Administrator die Sperre manuell entfernt. Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties 2012-01-20 00:21:50 UTC (rev 2273) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties 2012-01-20 00:29:13 UTC (rev 2274) @@ -28,3 +28,4 @@ cms.ui.item.lifecycle.do.not_authorized= cms.ui.item.lifecycle.publish_locked= cms.ui.item.lifecycle.publish_locked.update= +cms.ui.lifecycle.publish.error= Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties 2012-01-20 00:21:50 UTC (rev 2273) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties 2012-01-20 00:29:13 UTC (rev 2274) @@ -559,3 +559,4 @@ cms.ui.item.lifecycle.do.not_authorized= cms.ui.item.lifecycle.publish_locked= cms.ui.item.lifecycle.publish_locked.update= +cms.ui.lifecycle.publish.error= Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminPane.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminPane.java 2012-01-20 00:21:50 UTC (rev 2273) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminPane.java 2012-01-20 00:29:13 UTC (rev 2274) @@ -53,6 +53,7 @@ private final LayoutPanel m_detailPane; private final LayoutPanel m_selectPane; private final LayoutPanel m_lockedPane; + private final LayoutPanel m_errorPane; public ItemLifecycleAdminPane(final ContentItemRequestLocal item) { m_item = item; @@ -100,6 +101,12 @@ }); m_lockedPane.setBottom(lockedUpdateLink); + m_errorPane = new LayoutPanel(); + add(m_errorPane); + + final Label errorMsg = new Label(gz("cms.ui.lifecycle.publish.error")); + m_errorPane.setBody(errorMsg); + connect(selectForm, m_detailPane); } @@ -131,7 +138,12 @@ if (CMSConfig.getInstance().getThreadedPublishing() && PublishLock.getInstance().isLocked(m_item.getContentItem( state))) { - push(state, m_lockedPane); + if (PublishLock.getInstance().hasError(m_item.getContentItem( + state))) { + push(state, m_errorPane); + } else { + push(state, m_lockedPane); + } } else { if (state.isVisibleOnPage(ItemLifecycleAdminPane.this)) { if (m_lifecycle.getLifecycle(state) == null) { Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java 2012-01-20 00:21:50 UTC (rev 2273) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java 2012-01-20 00:29:13 UTC (rev 2274) @@ -65,10 +65,10 @@ import com.arsdigita.xml.Element; /** - * This class contains the component which displays the information - * for a particular lifecycle, with the ability to edit and delete. - * This information also includes the associated phases for this - * lifecycle, also with the ability to add, edit, and delete. + * This class contains the component which displays the information for a + * particular lifecycle, with the ability to edit and delete. This information + * also includes the associated phases for this lifecycle, also with the ability + * to add, edit, and delete. * * @author Michael Pih * @author Jack Chung @@ -246,7 +246,19 @@ if (CMSConfig.getInstance().getThreadedPublishing()) { final Republisher republisher = new Republisher(item); final Thread thread = new Thread(republisher); + thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { + public void uncaughtException(final Thread thread, + final Throwable ex) { + PublishLock.getInstance().setError(item); + s_log.error(String.format( + "An error occurred while " + + "publishing the item '%s': ", + item.getOID().toString()), + ex); + } + }); + thread.start(); throw new RedirectSignal( @@ -275,11 +287,10 @@ /** * Saves OID of item as a string. This is necessary because it is - * not possible to access to same data object instance from - * multiple threads. So we have to create a new instance a the - * data object in the run method. To avoid any sort a problems, - * we store the OID as a string and convert it back to an OID in - * the run method. + * not possible to access to same data object instance from multiple + * threads. So we have to create a new instance a the data object in + * the run method. To avoid any sort a problems, we store the OID as + * a string and convert it back to an OID in the run method. */ private final String itemOid; @@ -316,13 +327,25 @@ final ContentItem item = m_item.getContentItem(state); /** - * jensp 2011-12-14: Execute is a thread if - * threaded publishing is active. + * jensp 2011-12-14: Execute is a thread if threaded publishing + * is active. */ if (CMSConfig.getInstance().getThreadedPublishing()) { final Republisher republisher = new Republisher(item); final Thread thread = new Thread(republisher); + thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { + public void uncaughtException(final Thread thread, + final Throwable ex) { + PublishLock.getInstance().setError(item); + s_log.error(String.format( + "An error occurred while " + + "publishing the item '%s': ", + item.getOID().toString()), + ex); + } + }); + thread.start(); throw new RedirectSignal( @@ -351,11 +374,10 @@ /** * Saves OID of item as a string. This is necessary because it is - * not possible to access to same data object instance from - * multiple threads. So we have to create a new instance a the - * data object in the run method. To avoid any sort a problems, - * we store the OID as a string and convert it back to an OID in - * the run method. + * not possible to access to same data object instance from multiple + * threads. So we have to create a new instance a the data object in + * the run method. To avoid any sort a problems, we store the OID as + * a string and convert it back to an OID in the run method. */ private final String itemOid; @@ -399,9 +421,9 @@ } /** - * New style pane. Uses a select box for the action to avoid wrong clicks - * on unpublish. - * + * New style pane. Uses a select box for the action to avoid wrong clicks on + * unpublish. + * * @author Jens Pelzetter */ private class ActionForm @@ -474,14 +496,26 @@ final ContentItem item = m_item.getContentItem(state); /** - * Republish/Republish and Reset are executed in the thread - * if threaded publishing is active. + * Republish/Republish and Reset are executed in the thread if + * threaded publishing is active. */ if (REPUBLISH.equals(selected)) { if (CMSConfig.getInstance().getThreadedPublishing()) { final RepublishRunner runner = new RepublishRunner(item); final Thread thread = new Thread(runner); + thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { + public void uncaughtException(final Thread thread, + final Throwable ex) { + PublishLock.getInstance().setError(item); + s_log.error(String.format( + "An error occurred while " + + "publishing the item '%s': ", + item.getOID().toString()), + ex); + } + }); + thread.start(); throw new RedirectSignal( @@ -504,7 +538,19 @@ new RepublishAndResetRunner( item); final Thread thread = new Thread(runner); + thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { + public void uncaughtException(final Thread thread, + final Throwable ex) { + PublishLock.getInstance().setError(item); + s_log.error(String.format( + "An error occurred while " + + "publishing the item '%s': ", + item.getOID().toString()), + ex); + } + }); + thread.start(); throw new RedirectSignal( @@ -532,11 +578,10 @@ /** * Saves OID of item as a string. This is necessary because it is - * not possible to access to same data object instance from - * multiple threads. So we have to create a new instance a the - * data object in the run method. To avoid any sort a problems, - * we store the OID as a string and convert it back to an OID in - * the run method. + * not possible to access to same data object instance from multiple + * threads. So we have to create a new instance a the data object in + * the run method. To avoid any sort a problems, we store the OID as + * a string and convert it back to an OID in the run method. */ private final String itemOid; @@ -563,11 +608,10 @@ /** * Saves OID of item as a string. This is necessary because it is - * not possible to access to same data object instance from - * multiple threads. So we have to create a new instance a the - * data object in the run method. To avoid any sort a problems, - * we store the OID as a string and convert it back to an OID in - * the run method. + * not possible to access to same data object instance from multiple + * threads. So we have to create a new instance a the data object in + * the run method. To avoid any sort a problems, we store the OID as + * a string and convert it back to an OID in the run method. */ private final String itemOid; Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java 2012-01-20 00:21:50 UTC (rev 2273) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java 2012-01-20 00:29:13 UTC (rev 2274) @@ -365,12 +365,12 @@ } /** - * jensp 2011-12-14: Some larger changes to the behavior of the - * process listener. The real action has been moved to the - * @link{Publisher} class. If threaded publishing is active, the publish - * process runs in a separate thread (the item is locked before using - * {@link PublishLock}. If threaded publishing is not active, nothing - * has changed. + * jensp 2011-12-14: Some larger changes to the behavior of the process + * listener. The real action has been moved to the + * @link{Publisher} class. If threaded publishing is active, the publish + * process runs in a separate thread (the item is locked before using + * {@link PublishLock}. If threaded publishing is not active, nothing has + * changed. */ private class ProcessListener implements FormProcessListener { @@ -390,6 +390,18 @@ } }; final Thread thread = new Thread(threadAction); + thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { + + public void uncaughtException(final Thread thread, + final Throwable ex) { + PublishLock.getInstance().setError(item); + s_log.error(String.format( + "An error occurred while " + + "publishing the item '%s': ", + item.getOID().toString()), + ex); + } + }); thread.start(); } else { publisher.publish(); @@ -410,171 +422,129 @@ } } - /*final Integer startHour = (Integer) m_startHour.getValue(state); - Integer startMinute = (Integer) m_startMinute.getValue(state); - - if (startMinute == null) { - startMinute = new Integer(0); + /* + * final Integer startHour = (Integer) m_startHour.getValue(state); + * Integer startMinute = (Integer) m_startMinute.getValue(state); + * + * if (startMinute == null) { startMinute = new Integer(0); } + * + * final Integer startAmpm = (Integer) m_startAmpm.getValue(state); + * + * final Integer endHour = (Integer) m_endHour.getValue(state); + * Integer endMinute = (Integer) m_endMinute.getValue(state); + * + * if (endMinute == null) { endMinute = new Integer(0); } + * + * final Integer endAmpm = (Integer) m_endAmpm.getValue(state); + * + * // Instantiate the instance of the content type. final + * ContentItem item = m_item.getContentItem(state); + * + * final BigDecimal defID = (BigDecimal) + * m_cycleSelect.getValue(state); Assert.exists(defID); final + * LifecycleDefinition cycleDef = new LifecycleDefinition(defID); + * + * java.util.Date startDate = (java.util.Date) + * m_startDate.getValue(state); + * + * final Calendar start = Calendar.getInstance(); + * start.setTime(startDate); start.set(Calendar.AM_PM, + * startAmpm.intValue()); start.set(Calendar.MINUTE, + * startMinute.intValue()); start.set(Calendar.AM_PM, + * startAmpm.intValue()); if (startHour.intValue() != 12) { + * start.set(Calendar.HOUR_OF_DAY, 12 * startAmpm.intValue() + + * startHour.intValue()); start.set(Calendar.HOUR, + * startHour.intValue()); } else { if (startAmpm.intValue() == 0) { + * start.set(Calendar.HOUR_OF_DAY, 0); start.set(Calendar.HOUR, 0); + * } else { start.set(Calendar.HOUR_OF_DAY, 12); + * start.set(Calendar.HOUR, 0); } } startDate = start.getTime(); + * + * java.util.Date endDate = (java.util.Date) + * m_endDate.getValue(state); + * + * if (endDate != null) { final Calendar end = + * Calendar.getInstance(); + * + * end.setTime(endDate); end.set(Calendar.AM_PM, + * endAmpm.intValue()); end.set(Calendar.MINUTE, + * endMinute.intValue()); end.set(Calendar.AM_PM, + * endAmpm.intValue()); + * + * if (endHour.intValue() != 12) { end.set(Calendar.HOUR_OF_DAY, 12 + * * endAmpm.intValue() + endHour.intValue()); + * end.set(Calendar.HOUR, endHour.intValue()); } else { if + * (endAmpm.intValue() == 0) { end.set(Calendar.HOUR_OF_DAY, 0); + * end.set(Calendar.HOUR, 0); } else { end.set(Calendar.HOUR_OF_DAY, + * 12); end.set(Calendar.HOUR, 0); } } endDate = end.getTime(); } + * + * // If the item is already published, remove the current + * lifecycle. // Do not touch the live version. if + * (item.isPublished()) { item.removeLifecycle(item); item.save(); } + * + * // Apply the new lifecycle. ContentItem pending = + * item.publish(cycleDef, startDate); final Lifecycle lifecycle = + * pending.getLifecycle(); + * + * // XXX domlay Whoa. This must be broken for multiphase // + * lifecycles. + * + * if (endDate != null) { + * + * // update individual phases final PhaseCollection phases = + * lifecycle.getPhases(); + * + * while (phases.next()) { final Phase phase = phases.getPhase(); + * java.util.Date thisEnd = phase.getEndDate(); java.util.Date + * thisStart = phase.getStartDate(); if + * (thisStart.compareTo(endDate) > 0) { phase.setStartDate(endDate); + * phase.save(); } + * + * if (thisEnd == null || thisEnd.compareTo(endDate) > 0) { + * phase.setEndDate(endDate); phase.save(); } } } + * + * // endOfCycle may be the original date according to lifecycle + * phase definitions, or endDate if that was before // natural end + * of lifecycle java.util.Date endOfCycle = lifecycle.getEndDate(); + * if (endOfCycle != null) { + * + * // if advance notification is requested (!= 0) // add another + * phase at the start of which the user is notified Integer + * notificationDays = (Integer) m_notificationDays.getValue(state); + * Integer notificationHours = (Integer) + * m_notificationHours.getValue(state); java.util.Date + * notificationDate = null; + * + * int notificationPeriod = 0; if (notificationDays != null) { + * notificationPeriod += notificationDays.intValue() * 24; } if + * (notificationHours != null) { notificationPeriod += + * notificationHours.intValue(); } + * + * if (notificationPeriod > 0) { notificationDate = + * computeNotificationDate(endOfCycle, notificationPeriod); + * s_log.debug("adding custom phase"); Phase expirationImminentPhase + * = lifecycle.addCustomPhase("expirationImminent", new + * Long(notificationDate. getTime()), new + * Long(endOfCycle.getTime())); + * expirationImminentPhase.setListenerClassName( + * "com.arsdigita.cms.lifecycle.NotifyLifecycleListener"); + * expirationImminentPhase.save(); } } + * + * // Force the lifecycle scheduler to run to avoid any // scheduler + * delay for items that should be published // immediately. + * pending.getLifecycle().start(); + * + * item.save(); + * + * final Workflow workflow = m_workflow.getWorkflow(state); try { + * finish(workflow, item, Web.getContext().getUser()); } catch + * (TaskException te) { throw new FormProcessException(te); } // + * redirect to /content-center if streamlined creation mode is + * active. if + * (ContentSection.getConfig().getUseStreamlinedCreation()) { throw + * new RedirectSignal(URL.there(state.getRequest(), + * Utilities.getWorkspaceURL()), true); } - - final Integer startAmpm = (Integer) m_startAmpm.getValue(state); - - final Integer endHour = (Integer) m_endHour.getValue(state); - Integer endMinute = (Integer) m_endMinute.getValue(state); - - if (endMinute == null) { - endMinute = new Integer(0); - } - - final Integer endAmpm = (Integer) m_endAmpm.getValue(state); - - // Instantiate the instance of the content type. - final ContentItem item = m_item.getContentItem(state); - - final BigDecimal defID = (BigDecimal) m_cycleSelect.getValue(state); - Assert.exists(defID); - final LifecycleDefinition cycleDef = new LifecycleDefinition(defID); - - java.util.Date startDate = - (java.util.Date) m_startDate.getValue(state); - - final Calendar start = Calendar.getInstance(); - start.setTime(startDate); - start.set(Calendar.AM_PM, startAmpm.intValue()); - start.set(Calendar.MINUTE, startMinute.intValue()); - start.set(Calendar.AM_PM, startAmpm.intValue()); - if (startHour.intValue() != 12) { - start.set(Calendar.HOUR_OF_DAY, - 12 * startAmpm.intValue() + startHour.intValue()); - start.set(Calendar.HOUR, startHour.intValue()); - } else { - if (startAmpm.intValue() == 0) { - start.set(Calendar.HOUR_OF_DAY, 0); - start.set(Calendar.HOUR, 0); - } else { - start.set(Calendar.HOUR_OF_DAY, 12); - start.set(Calendar.HOUR, 0); - } - } - startDate = start.getTime(); - - java.util.Date endDate = - (java.util.Date) m_endDate.getValue(state); - - if (endDate != null) { - final Calendar end = Calendar.getInstance(); - - end.setTime(endDate); - end.set(Calendar.AM_PM, endAmpm.intValue()); - end.set(Calendar.MINUTE, endMinute.intValue()); - end.set(Calendar.AM_PM, endAmpm.intValue()); - - if (endHour.intValue() != 12) { - end.set(Calendar.HOUR_OF_DAY, - 12 * endAmpm.intValue() + endHour.intValue()); - end.set(Calendar.HOUR, endHour.intValue()); - } else { - if (endAmpm.intValue() == 0) { - end.set(Calendar.HOUR_OF_DAY, 0); - end.set(Calendar.HOUR, 0); - } else { - end.set(Calendar.HOUR_OF_DAY, 12); - end.set(Calendar.HOUR, 0); - } - } - endDate = end.getTime(); - } - - // If the item is already published, remove the current lifecycle. - // Do not touch the live version. - if (item.isPublished()) { - item.removeLifecycle(item); - item.save(); - } - - // Apply the new lifecycle. - ContentItem pending = item.publish(cycleDef, startDate); - final Lifecycle lifecycle = pending.getLifecycle(); - - // XXX domlay Whoa. This must be broken for multiphase - // lifecycles. - - if (endDate != null) { - - // update individual phases - final PhaseCollection phases = lifecycle.getPhases(); - - while (phases.next()) { - final Phase phase = phases.getPhase(); - java.util.Date thisEnd = phase.getEndDate(); - java.util.Date thisStart = phase.getStartDate(); - if (thisStart.compareTo(endDate) > 0) { - phase.setStartDate(endDate); - phase.save(); - } - - if (thisEnd == null || thisEnd.compareTo(endDate) > 0) { - phase.setEndDate(endDate); - phase.save(); - } - } - } - - // endOfCycle may be the original date according to lifecycle phase definitions, or endDate if that was before - // natural end of lifecycle - java.util.Date endOfCycle = lifecycle.getEndDate(); - if (endOfCycle != null) { - - // if advance notification is requested (!= 0) - // add another phase at the start of which the user is notified - Integer notificationDays = - (Integer) m_notificationDays.getValue(state); - Integer notificationHours = - (Integer) m_notificationHours.getValue(state); - java.util.Date notificationDate = null; - - int notificationPeriod = 0; - if (notificationDays != null) { - notificationPeriod += notificationDays.intValue() * 24; - } - if (notificationHours != null) { - notificationPeriod += notificationHours.intValue(); - } - - if (notificationPeriod > 0) { - notificationDate = - computeNotificationDate(endOfCycle, notificationPeriod); - s_log.debug("adding custom phase"); - Phase expirationImminentPhase = - lifecycle.addCustomPhase("expirationImminent", - new Long(notificationDate. - getTime()), - new Long(endOfCycle.getTime())); - expirationImminentPhase.setListenerClassName( - "com.arsdigita.cms.lifecycle.NotifyLifecycleListener"); - expirationImminentPhase.save(); - } - } - - // Force the lifecycle scheduler to run to avoid any - // scheduler delay for items that should be published - // immediately. - pending.getLifecycle().start(); - - item.save(); - - final Workflow workflow = m_workflow.getWorkflow(state); - try { - finish(workflow, item, Web.getContext().getUser()); - } catch (TaskException te) { - throw new FormProcessException(te); - } - // redirect to /content-center if streamlined creation mode is active. - if (ContentSection.getConfig().getUseStreamlinedCreation()) { - throw new RedirectSignal(URL.there(state.getRequest(), - Utilities.getWorkspaceURL()), - true); - }*/ + */ } } @@ -600,8 +570,8 @@ /** * The constructor collects all necessary data and stores them. - * - * @param state + * + * @param state */ public Publisher(final PageState state) { startHour = (Integer) m_startHour.getValue(state); @@ -689,8 +659,8 @@ public void publish() { /** - * We have to create a new instance here since it is not possible - * to access the same data object from multiple threads. + * We have to create a new instance here since it is not possible to + * access the same data object from multiple threads. */ final OID oid = OID.valueOf(oidStr); final ContentItem item = (ContentItem) DomainObjectFactory. @@ -997,12 +967,14 @@ } /** - * Find out at which date a notification (about an item that is about - * to expire) should be sent, based on the endDate (== date at which the - * item is unpublished) and the notification period. - *@param endDate the endDate of the lifecycle, i.e. the date when the item - * is going to be unpublished - *@param notification how many hours the users shouls be notified in advance + * Find out at which date a notification (about an item that is about to + * expire) should be sent, based on the endDate (== date at which the item + * is unpublished) and the notification period. + * + * @param endDate the endDate of the lifecycle, i.e. the date when the item + * is going to be unpublished + * @param notification how many hours the users shouls be notified in + * advance */ private java.util.Date computeNotificationDate(java.util.Date endDate, int notificationPeriod) { Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/PublishLock.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/PublishLock.java 2012-01-20 00:21:50 UTC (rev 2273) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/PublishLock.java 2012-01-20 00:29:13 UTC (rev 2274) @@ -7,10 +7,10 @@ import java.util.Calendar; /** - * Used by {@link ItemLifecycleSelectForm} and {@link ItemLifecycleItemPane} - * to lock an item if threaded publishing is active. - * - * @author Jens Pelzetter + * Used by {@link ItemLifecycleSelectForm} and {@link ItemLifecycleItemPane} to + * lock an item if threaded publishing is active. + * + * @author Jens Pelzetter * @version $Id$ */ public class PublishLock { @@ -21,7 +21,8 @@ public final static String LOCKED_OID = "lockedOid"; public final static String TIMESTAMP = "timestamp"; public final static String ACTION = "action"; - private static PublishLock instance = new PublishLock(); + public final static String ERROR = "error"; + private static PublishLock instance = new PublishLock(); private PublishLock() { } @@ -33,9 +34,9 @@ protected synchronized void lock(final ContentItem item) { lock(item, "publish"); } - + protected synchronized void lock(final ContentItem item, - final String action) { + final String action) { SessionManager.getSession().getTransactionContext().beginTxn(); final DataObject lock = SessionManager.getSession().create( LOCK_OBJECT_TYPE); @@ -47,7 +48,7 @@ SessionManager.getSession().getTransactionContext().commitTxn(); } - protected synchronized void unlock(final ContentItem item) { + protected synchronized void unlock(final ContentItem item) { SessionManager.getSession().getTransactionContext().beginTxn(); final DataCollection collection = SessionManager.getSession().retrieve( LOCK_OBJECT_TYPE); @@ -58,7 +59,7 @@ final DataObject lock = collection.getDataObject(); lock.delete(); } - collection.close(); + collection.close(); SessionManager.getSession().getTransactionContext().commitTxn(); } @@ -73,6 +74,46 @@ } else { collection.close(); return true; - } + } } + + protected synchronized void setError(final ContentItem item) { + SessionManager.getSession().getTransactionContext().beginTxn(); + final DataCollection collection = SessionManager.getSession().retrieve( + LOCK_OBJECT_TYPE); + collection.addFilter(String.format("%s = '%s'", LOCKED_OID, + item.getOID().toString())); + + if (!collection.isEmpty()) { + collection.next(); + + final DataObject lock = collection.getDataObject(); + lock.set(ACTION, ERROR); + lock.save(); + } + collection.close(); + SessionManager.getSession().getTransactionContext().commitTxn(); + } + + protected synchronized boolean hasError(final ContentItem item) { + final DataCollection collection = SessionManager.getSession().retrieve( + LOCK_OBJECT_TYPE); + collection.addFilter(String.format("%s = '%s'", LOCKED_OID, + item.getOID().toString())); + if (collection.isEmpty()) { + collection.close(); + return false; + } else { + collection.next(); + + final DataObject lock = collection.getDataObject(); + if (ERROR.equals(lock.get(ACTION).toString())) { + collection.close(); + return true; + } else { + collection.close(); + return false; + } + } + } } |
From: <pb...@fe...> - 2012-01-20 00:22:02
|
Author: pboy Date: 2012-01-20 00:21:50 +0000 (Fri, 20 Jan 2012) New Revision: 2273 Added: trunk/ccm-cms/src/com/arsdigita/cms/LanguageInvariantContentItem.java Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentBundle.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentItemPage.java trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources.properties trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources_de.properties trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources_fr.properties trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/FolderBrowser.java Log: Improved multilanguage support: Introduces language independent content items, folder browser improved (displays existing language versions and publication status. Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentBundle.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentBundle.java 2012-01-09 22:47:12 UTC (rev 2272) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentBundle.java 2012-01-20 00:21:50 UTC (rev 2273) @@ -408,7 +408,7 @@ * @return A <code>Collection</code> of language 2-letter codes in * which this item is available */ - public final Collection getLanguages() { + public final Collection<String> getLanguages() { // XXX For LIVE bundles, there might be several PENDING // instances with the same language. Maybe we should filter // these out and return only one? Added: trunk/ccm-cms/src/com/arsdigita/cms/LanguageInvariantContentItem.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/LanguageInvariantContentItem.java (rev 0) +++ trunk/ccm-cms/src/com/arsdigita/cms/LanguageInvariantContentItem.java 2012-01-20 00:21:50 UTC (rev 2273) @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.cms; + +/** + * + * Content Items implementing this interface are be language invariant, if + * isLanguageInvariant returns true + * + * @author Sören Bernstein (quasimodo) <sbe...@ze...> + */ +public interface LanguageInvariantContentItem { + + public abstract boolean isLanguageInvariant(); +} Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java 2012-01-09 22:47:12 UTC (rev 2272) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java 2012-01-20 00:21:50 UTC (rev 2273) @@ -20,6 +20,7 @@ import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ContentPage; +import com.arsdigita.cms.LanguageInvariantContentItem; import com.arsdigita.cms.RelationAttributeInterface; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DomainObjectFactory; @@ -38,7 +39,8 @@ * @author Jens Pelzetter */ public class GenericPerson extends ContentPage implements - RelationAttributeInterface { + RelationAttributeInterface, + LanguageInvariantContentItem { public static final String PERSON = "person"; public static final String SURNAME = "surname"; @@ -311,4 +313,8 @@ public String getSearchSummary() { return getFullName(); } + + public boolean isLanguageInvariant() { + return true; + } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentItemPage.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentItemPage.java 2012-01-09 22:47:12 UTC (rev 2272) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentItemPage.java 2012-01-20 00:21:50 UTC (rev 2273) @@ -36,13 +36,7 @@ import com.arsdigita.bebop.parameters.BigDecimalParameter; import com.arsdigita.bebop.parameters.NotNullValidationListener; import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.PageLocations; -import com.arsdigita.cms.Template; +import com.arsdigita.cms.*; import com.arsdigita.cms.contenttypes.CustomizedPreviewLink; import com.arsdigita.cms.dispatcher.CMSDispatcher; import com.arsdigita.cms.dispatcher.CMSPage; @@ -73,6 +67,8 @@ * @author Michael Pih * @author Stanislav Freidin <sfr...@re...> * @author Jack Chung + * @author Sören Bernstein (quasimodo) <sbe...@ze...> + * * @version $Id$ */ public class ContentItemPage extends CMSPage implements ActionListener { @@ -337,6 +333,16 @@ m_tabbedPane.setTabVisible(state, m_templatesPane, !ContentSection. getConfig().getHideTemplatesTab()); } + + // Added by: Sören Bernstein <sbe...@ze...> + // If the content item is a language invariant content item, don't show + // the language pane + if (item instanceof LanguageInvariantContentItem) { + LanguageInvariantContentItem li_item = (LanguageInvariantContentItem) item; + if(li_item.isLanguageInvariant()) { + m_tabbedPane.setTabVisible(state, m_languagesPane, false); + } + } // Set the current tab based on parameters if (setTab != null) { Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources.properties 2012-01-09 22:47:12 UTC (rev 2272) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources.properties 2012-01-20 00:21:50 UTC (rev 2273) @@ -70,3 +70,4 @@ cms.ui.folder.filter.all=All cms.ui.folder.filter=Filter for work cms.ui.folder.filter_do=Filter +cms.ui.folder.languages= Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources_de.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources_de.properties 2012-01-09 22:47:12 UTC (rev 2272) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources_de.properties 2012-01-20 00:21:50 UTC (rev 2273) @@ -66,3 +66,4 @@ cms.ui.folder.filter.all=Alle cms.ui.folder.filter=Nach Begriff filtern cms.ui.folder.filter_do=Filtern +cms.ui.folder.languages= Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources_fr.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources_fr.properties 2012-01-09 22:47:12 UTC (rev 2272) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/CMSFolderResources_fr.properties 2012-01-20 00:21:50 UTC (rev 2273) @@ -65,3 +65,4 @@ cms.ui.folder.no_permission_for_item=Vous n'avez pas l'autorisation de supprimer ou de d\u00e9placer cms.ui.folder.no_such_item=L'identifiant fourni pour l'\u00e9l\u00e9ment ne correspond pas \u00e0 un contenu existant. cms.ui.folder.filter.all= +cms.ui.folder.languages= Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/FolderBrowser.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/FolderBrowser.java 2012-01-09 22:47:12 UTC (rev 2272) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/FolderBrowser.java 2012-01-20 00:21:50 UTC (rev 2273) @@ -32,8 +32,6 @@ import com.arsdigita.bebop.Table; 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.TableActionAdapter; import com.arsdigita.bebop.event.TableActionEvent; import com.arsdigita.bebop.event.TableActionListener; @@ -45,12 +43,7 @@ import com.arsdigita.bebop.table.TableColumn; import com.arsdigita.bebop.table.TableHeader; import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentBundle; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.Folder; -import com.arsdigita.cms.ItemCollection; +import com.arsdigita.cms.*; import com.arsdigita.cms.SecurityManager; import com.arsdigita.cms.dispatcher.ItemResolver; import com.arsdigita.cms.dispatcher.Utilities; @@ -68,12 +61,13 @@ import org.apache.log4j.Logger; import java.math.BigDecimal; +import java.util.Iterator; import javax.servlet.ServletException; /** * Browse folders and items. If the user clicks on a folder, the folder - * selection model is updated. If the user clicks on any other item, an - * separate item selection model is updated. + * selection model is updated. If the user clicks on any other item, an separate + * item selection model is updated. * * @author <a href="mailto:lu...@ar...">David Lutterkort</a> * @version $Id$ @@ -82,18 +76,22 @@ private static final Logger s_log = Logger.getLogger(FolderBrowser.class); private static GlobalizedMessage[] s_headers = { - globalize("cms.ui.folder.name"), globalize("cms.ui.folder.title"), + globalize("cms.ui.folder.name"), + globalize("cms.ui.folder.languages"), + globalize("cms.ui.folder.title"), globalize("cms.ui.folder.type"), globalize("cms.ui.folder.creation_date"), - globalize("cms.ui.folder.last_modified"), globalize( - "cms.ui.folder.action"), + globalize("cms.ui.folder.last_modified"), + globalize("cms.ui.folder.action"), globalize("cms.ui.folder.index")}; private static GlobalizedMessage[] s_noIndexHeaders = { - globalize("cms.ui.folder.name"), globalize("cms.ui.folder.title"), + globalize("cms.ui.folder.name"), + globalize("cms.ui.folder.languages"), + globalize("cms.ui.folder.title"), globalize("cms.ui.folder.type"), globalize("cms.ui.folder.creation_date"), - globalize("cms.ui.folder.last_modified"), globalize( - "cms.ui.folder.action")}; + globalize("cms.ui.folder.last_modified"), + globalize("cms.ui.folder.action")}; private static final String SORT_ACTION_UP = "sortActionUp"; private static final String SORT_ACTION_DOWN = "sortActionDown"; private FolderSelectionModel m_currentFolder; @@ -122,8 +120,8 @@ setModelBuilder(new FolderTableModelBuilder(currentFolder)); setColumnModel(new DefaultTableColumnModel(hideIndexColumn() - ? s_noIndexHeaders - : s_headers)); + ? s_noIndexHeaders + : s_headers)); setHeader(new TableHeader(getColumnModel())); // DEE 1/18/02: the folder table model builder needs to know about // 'this' in order to set visibility, but 'this' isn't available @@ -139,22 +137,22 @@ m_currentFolder = currentFolder; /* - - This code should be uncommented if the desired behaviour is for a change - of folder to cause reversion to default ordering of contained items - (by name ascending). Our feeling is that the user selected ordering - should be retained for the duration of the folder browsing session. If - anyone wants this alternative behaviour it should be brought in under - the control of a config parameter. - - m_currentFolder.addChangeListener(new ChangeListener() { - - public void stateChanged(ChangeEvent e) { - PageState state = e.getPageState(); - state.setValue(m_sortType, m_sortType.getDefaultValue()); - state.setValue(m_sortDirection, m_sortDirection.getDefaultValue()); - - }}); + * + * This code should be uncommented if the desired behaviour is for a + * change of folder to cause reversion to default ordering of contained + * items (by name ascending). Our feeling is that the user selected + * ordering should be retained for the duration of the folder browsing + * session. If anyone wants this alternative behaviour it should be + * brought in under the control of a config parameter. + * + * m_currentFolder.addChangeListener(new ChangeListener() { + * + * public void stateChanged(ChangeEvent e) { PageState state = + * e.getPageState(); state.setValue(m_sortType, + * m_sortType.getDefaultValue()); state.setValue(m_sortDirection, + * m_sortDirection.getDefaultValue()); + * + * }}); */ setClassAttr("dataTable"); @@ -164,16 +162,17 @@ m_nameColumn = getColumn(0); m_nameColumn.setCellRenderer(new NameCellRenderer()); m_nameColumn.setHeaderRenderer(new HeaderCellRenderer(SORT_KEY_NAME)); - getColumn(1).setHeaderRenderer(new HeaderCellRenderer(SORT_KEY_TITLE)); - getColumn(3).setHeaderRenderer(new HeaderCellRenderer( + getColumn(1).setCellRenderer(new LanguagesCellRenderer()); + getColumn(2).setHeaderRenderer(new HeaderCellRenderer(SORT_KEY_TITLE)); + getColumn(4).setHeaderRenderer(new HeaderCellRenderer( SORT_KEY_CREATION_DATE)); - getColumn(4).setHeaderRenderer(new HeaderCellRenderer( + getColumn(5).setHeaderRenderer(new HeaderCellRenderer( SORT_KEY_LAST_MODIFIED_DATE)); - m_deleteColumn = getColumn(5); + m_deleteColumn = getColumn(6); m_deleteColumn.setCellRenderer(new ActionCellRenderer()); m_deleteColumn.setAlign("center"); if (!hideIndexColumn()) { - m_indexColumn = getColumn(6); + m_indexColumn = getColumn(7); m_indexColumn.setCellRenderer(new IndexToggleRenderer()); m_indexColumn.setAlign("center"); @@ -217,7 +216,7 @@ boolean canDelete = sm.canAccess(state.getRequest(), SecurityManager.DELETE_ITEM, - folder); + folder); m_deleteColumn.setVisible(state, canDelete); } @@ -261,7 +260,7 @@ private class FolderTableModelBuilder extends AbstractTableModelBuilder implements PaginationModelBuilder, - FolderManipulator.FilterFormModelBuilder { + FolderManipulator.FilterFormModelBuilder { private FolderSelectionModel m_folder; private RequestLocal m_size; @@ -273,7 +272,7 @@ } public FolderTableModelBuilder(FolderSelectionModel sel, - FolderBrowser fb) { + FolderBrowser fb) { super(); m_folder = sel; m_size = new RequestLocal(); @@ -282,8 +281,7 @@ } public TableModel makeModel(Table t, PageState s) { - FolderSelectionModel sel = ((FolderBrowser) t). - getFolderSelectionModel(); + FolderSelectionModel sel = ((FolderBrowser) t).getFolderSelectionModel(); Folder f = (Folder) sel.getSelectedObject(s); if (f == null) { return Table.EMPTY_MODEL; @@ -291,7 +289,7 @@ t.getRowSelectionModel().clearSelection(s); s_log.debug(String.format("filter = '%s'", s.getValue(m_filter))); Folder.ItemCollection itemColl = - (Folder.ItemCollection) m_itemColl.get(s); + (Folder.ItemCollection) m_itemColl.get(s); s_log.debug(String.format("itemColl.size = %d", itemColl.size())); m_folderSize = itemColl.size(); @@ -363,7 +361,7 @@ size = new Integer((int) itemColl.size()); itemColl.setRange(new Integer(paginator.getFirst(state)), - new Integer(paginator.getLast(state) + 1)); + new Integer(paginator.getLast(state) + 1)); String sortKey = (String) state.getValue(m_sortType); String direction = "asc"; @@ -374,13 +372,13 @@ if (sortKey.equals(SORT_KEY_TITLE)) { itemColl.setOrder("lower(item." + ContentItem.DISPLAY_NAME - + ") " + direction); + + ") " + direction); } else if (sortKey.equals(SORT_KEY_NAME)) { itemColl.setOrder("lower(item." + ContentItem.NAME + ") " - + direction); + + direction); } else if (sortKey.equals(SORT_KEY_LAST_MODIFIED_DATE)) { itemColl.setOrder("item.auditing.lastModifiedDate " - + direction); + + direction); } else if (sortKey.equals(SORT_KEY_CREATION_DATE)) { itemColl.setOrder("item.auditing.creationDate " + direction); } @@ -397,11 +395,11 @@ } /** - * Indicates whether the paginator should be visible, - * based on the visibility of the folder browser itself. + * Indicates whether the paginator should be visible, based on the + * visibility of the folder browser itself. * - * @return true if folder browser is visible, or if the - * associated folder browser is unknown. + * @return true if folder browser is visible, or if the associated + * folder browser is unknown. */ public boolean isVisible(PageState state) { return (m_fb != null) ? m_fb.isVisible(state) : true; @@ -419,9 +417,9 @@ } public Component getComponent(final Table table, final PageState state, - Object value, - boolean isSelected, Object key, - int row, int column) { + Object value, + boolean isSelected, Object key, + int row, int column) { String headerName = (String) ((GlobalizedMessage) value).localize(); String sortKey = (String) state.getValue(m_sortType); final boolean isCurrentKey = sortKey.equals(m_key); @@ -442,14 +440,14 @@ // by default, everything sorts "up" unless it // is the current key and it is already pointing up if (SORT_ACTION_UP.equals(currentSortDirection) - && isCurrentKey) { + && isCurrentKey) { sortDirectionAction = SORT_ACTION_DOWN; } else { sortDirectionAction = SORT_ACTION_UP; } ps.setControlEvent(table, - sortDirectionAction, - m_key); + sortDirectionAction, + m_key); } }; Label l = new Label(); @@ -470,8 +468,8 @@ } /** - * Produce links to view an item or control links for folders - * to change into the folder. + * Produce links to view an item or control links for folders to change into + * the folder. */ private class NameCellRenderer extends DefaultTableCellRenderer { @@ -481,14 +479,14 @@ @Override public Component getComponent(Table table, PageState state, Object value, - boolean isSelected, Object key, - int row, int column) { + boolean isSelected, Object key, + int row, int column) { Folder.ItemCollection coll = (Folder.ItemCollection) value; String name = coll.getName(); if (coll.isFolder()) { return super.getComponent(table, state, name, - isSelected, key, row, column); + isSelected, key, row, column); } else { ContentSection section = CMS.getContext().getContentSection(); BigDecimal id = coll.getID(); @@ -498,15 +496,107 @@ } else { ItemResolver resolver = section.getItemResolver(); return new Link(name, resolver.generateItemURL(state, id, - name, section, - coll. - getVersion())); + name, section, coll.getVersion())); } } } } /** + * Added by: Sören Bernstein <sbe...@ze...> + * + * Produce links to view an item in a specific language and show all + * existing language version and the live status in the folder browser. + */ + private class LanguagesCellRenderer extends DefaultTableCellRenderer { + + public LanguagesCellRenderer() { + super(true); + } + + @Override + public Component getComponent(Table table, PageState state, Object value, + boolean isSelected, Object key, + int row, int column) { + + Folder.ItemCollection coll = (Folder.ItemCollection) value; + String name = coll.getName(); + if (coll.isFolder()) { + // Nothing to show on folders + return new Label(); + } else { + + ContentPage cp; + + try { + cp = new ContentPage(coll.getID()); + } catch (DataObjectNotFoundException ex) { + // Content item was not found, return nothing + return new Label(); + } + + ContentBundle bundle = cp.getContentBundle(); + ContentSection section = CMS.getContext().getContentSection(); + + + if (bundle != null + && !(cp instanceof LanguageInvariantContentItem + && ((LanguageInvariantContentItem) cp).isLanguageInvariant())) { + + Iterator<String> languages = bundle.getLanguages().iterator(); + + + + StringBuilder temp = new StringBuilder(20); + SimpleContainer container = new SimpleContainer(); + + while (languages.hasNext()) { + String lang = languages.next(); + ContentItem ci = bundle.getInstance(lang, false); + StringBuilder fontWeight = new StringBuilder(2); + StringBuilder classes = new StringBuilder(20); + + if (ci.isLive()) { + fontWeight.append(Label.BOLD); + classes.append("live "); + } + if (bundle.getPrimaryInstance().equals(ci)) { + fontWeight.append(Label.ITALIC); + classes.append("primaryInstance"); + } + + Label langLabel = new Label(lang); + langLabel.setFontWeight(fontWeight.toString().trim()); + langLabel.setClassAttr(classes.toString().trim()); + + if (section == null) { + container.add(langLabel); + + } else { + ItemResolver resolver = section.getItemResolver(); + container.add( + new Link(langLabel, + resolver.generateItemURL(state, + ci.getID(), + name, + section, + coll.getVersion()))); + } + if (languages.hasNext()) { + container.add(new Label(" ", false)); + } + + } + + return container; + } else { + return new Label(); + } + } + } + } + + /** * Produce delete links for items and non-empty folders. */ private static class ActionCellRenderer implements TableCellRenderer { @@ -527,8 +617,8 @@ } public Component getComponent(Table table, PageState state, Object value, - boolean isSelected, Object key, - int row, int column) { + boolean isSelected, Object key, + int row, int column) { if (((Boolean) value).booleanValue()) { return s_link; } else { @@ -540,8 +630,8 @@ private final class IndexToggleRenderer implements TableCellRenderer { public Component getComponent(Table table, PageState state, Object value, - boolean isSelected, Object key, int row, - int column) { + boolean isSelected, Object key, int row, + int column) { if (value == null) { return new Label(GlobalizationUtil.globalize("cms.ui.folder.na")); @@ -558,7 +648,7 @@ } } - // Deletes an item +// Deletes an item private class ItemDeleter extends TableActionAdapter { public void cellSelected(TableActionEvent e) { @@ -596,12 +686,13 @@ private static class FolderTableModel implements TableModel { private static final int NAME = 0; - private static final int TITLE = 1; - private static final int TYPE = 2; - private static final int CREATION_DATE = 3; - private static final int LAST_MODIFIED = 4; - private static final int DELETABLE = 5; - private static final int IS_INDEX = 6; + private static final int LANGUAGES = 1; + private static final int TITLE = 2; + private static final int TYPE = 3; + private static final int CREATION_DATE = 4; + private static final int LAST_MODIFIED = 5; + private static final int DELETABLE = 6; + private static final int IS_INDEX = 7; private PageState m_state; private FolderBrowser m_table; private Folder.ItemCollection m_itemColl; @@ -613,7 +704,7 @@ //m_itemColl = folder.getItems(); //} public FolderTableModel(FolderBrowser table, PageState state, - Folder.ItemCollection itemColl) { + Folder.ItemCollection itemColl) { m_state = state; m_table = table; m_itemColl = itemColl; @@ -631,7 +722,7 @@ } public int getColumnCount() { - return hideIndexColumn() ? 6 : 7; + return hideIndexColumn() ? 7 : 8; } public boolean nextRow() { @@ -642,6 +733,8 @@ switch (columnIndex) { case NAME: return m_itemColl; + case LANGUAGES: + return m_itemColl; case TITLE: return m_itemColl.getDisplayName(); case TYPE: @@ -655,7 +748,7 @@ } case LAST_MODIFIED: { java.util.Date lastModified = - m_itemColl.getLastModifiedDate(); + m_itemColl.getLastModifiedDate(); if (lastModified == null) { return "--"; } @@ -675,13 +768,12 @@ if (m_folIndexID == null) { return new Boolean(false); } - return new Boolean(m_folIndexID.compareTo(m_itemColl. - getBundleID()) == 0); + return new Boolean(m_folIndexID.compareTo(m_itemColl.getBundleID()) == 0); } default: throw new IndexOutOfBoundsException("Column index " - + columnIndex - + " not in table model."); + + columnIndex + + " not in table model."); } } @@ -702,13 +794,13 @@ if (!m_itemColl.hasChildren()) { if (s_log.isDebugEnabled()) { s_log.debug("The item is an empty folder; it may be " - + "deleted"); + + "deleted"); } return true; } else { if (s_log.isDebugEnabled()) { s_log.debug("The folder is not empty; it cannot be " - + "deleted"); + + "deleted"); } return false; } @@ -724,7 +816,7 @@ public Object getKeyAt(int columnIndex) { // Mark folders by using their negative ID (dirty, dirty) return (m_itemColl.isFolder()) ? m_itemColl.getID().negate() - : m_itemColl.getBundleID(); + : m_itemColl.getBundleID(); } } @@ -767,11 +859,10 @@ Folder folder = (Folder) m_fol.getSelectedObject(state); - ContentBundle currentIndexItem = (ContentBundle) folder. - getIndexItem(); + ContentBundle currentIndexItem = (ContentBundle) folder.getIndexItem(); if (currentIndexItem == null || (currentIndexItem.getID(). - compareTo(contentItem.getID()) - != 0)) { + compareTo(contentItem.getID()) + != 0)) { folder.setIndexItem(contentItem); } else { folder.removeIndexItem(); @@ -786,8 +877,7 @@ /** * Getting the GlobalizedMessage using a CMS Class targetBundle. * - * @param key The resource key - * @pre ( key != null ) + * @param key The resource key @pre ( key != null ) */ private static GlobalizedMessage globalize(String key) { return FolderManipulator.globalize(key); |
Author: pboy Date: 2012-01-09 19:31:24 +0000 (Mon, 09 Jan 2012) New Revision: 2270 Added: trunk/ccm-portalworkspace-homepage/ trunk/ccm-portalworkspace-homepage/application.xml trunk/ccm-portalworkspace-homepage/src/ trunk/ccm-portalworkspace-homepage/src/ccm-portalworkspace-homepage.config trunk/ccm-portalworkspace-homepage/src/ccm-portalworkspace-homepage.load trunk/ccm-portalworkspace-homepage/src/com/ trunk/ccm-portalworkspace-homepage/src/com/arsdigita/ trunk/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ trunk/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/ trunk/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/ trunk/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/CategoryPortalSelectionModel.java trunk/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/HomepagePortalSelectionModel.java trunk/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/HomepageWorkspace.java trunk/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/HomepageWorkspaceSelectionModel.java trunk/ccm-portalworkspace-homepage/src/empty.pdl.mf trunk/ccm-portalworkspace-homepage/web/ trunk/ccm-portalworkspace-homepage/web/templates/ trunk/ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/ trunk/ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/ trunk/ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/README.txt trunk/ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/custom.jsp trunk/ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/index.jsp Removed: trunk/ccm-bundle/src/com/arsdigita/bundle/ui/CategoryPortalSelectionModel.java trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepagePortalSelectionModel.java trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspace.java trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspaceSelectionModel.java trunk/ccm-bundle/web/templates/ccm-portalworkspace/ trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/CategoryPortalSelectionModel.java trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepagePortalSelectionModel.java trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspace.java trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspaceSelectionModel.java trunk/ccm-ldn-aplaws/web/templates/ccm-portalworkspace/ Modified: trunk/ccm-bundle/bundles/demo/cfg/integration.properties trunk/ccm-bundle/bundles/demo/cfg/project.xml trunk/ccm-bundle/bundles/devel/cfg/integration.properties trunk/ccm-bundle/bundles/devel/cfg/project.xml trunk/ccm-ldn-aplaws/bundles/custom/cfg/project.xml trunk/ccm-ldn-aplaws/bundles/custom/cfg/web.xml trunk/ccm-ldn-aplaws/bundles/demo/cfg/project.xml trunk/ccm-ldn-aplaws/bundles/demo/cfg/web.xml trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml Log: Moved APLAWS Homepage files into its own package ccm-workspace-homepage for easier configuration. Modified: trunk/ccm-bundle/bundles/demo/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2012-01-09 19:31:24 UTC (rev 2270) @@ -1,6 +1,6 @@ # Libre CMS demo bundle integration.properties # -waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage +waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage # ; dhtml editor to use (system wide) ; Xinha is default @@ -39,7 +39,7 @@ # ccm-cms parameters -com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker +com.arsdigita.cms.category_authoring_add_form=com.arsdigita.bundle.ui.ItemCategoryPicker com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp @@ -105,7 +105,7 @@ com.arsdigita.navigation.templates_file=bundle/navigation/gen-templates.txt -# ccm-ldn-search application +# ccm-search application com.arsdigita.london.search.show_sponsored_links=true Modified: trunk/ccm-bundle/bundles/demo/cfg/project.xml =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/project.xml 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-bundle/bundles/demo/cfg/project.xml 2012-01-09 19:31:24 UTC (rev 2270) @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<!-- project.xml LibreCMS devel - containing only modules used for LibreCMS --> +<!-- project.xml LibreCMS demo - containing only modules used for + LibreCMS DEMO edition --> <ccm:project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ccm="http://ccm.redhat.com/ccm-project" @@ -21,7 +22,7 @@ <ccm:build> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -<!-- Scientific CMS set of CORE packages --> +<!-- LibreCMS set of CORE packages --> <!-- NONE can be omitted for technical reasons / internal dependencies --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> @@ -43,12 +44,14 @@ <ccm:application name="ccm-navigation"/> <!-- ccm-portalworkspace depends on ccm-subsite --> <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-portalworkspace-homepage"/> + <ccm:application name="ccm-shortcuts"/> <ccm:application name="ccm-subsite"/> + <ccm:application name="ccm-themedirector"/> <!-- LDN extension --> <ccm:application name="ccm-ldn-search"/> - <ccm:application name="ccm-ldn-shortcuts"/> <ccm:application name="ccm-ldn-terms"/> <ccm:application name="ccm-ldn-util"/> @@ -85,22 +88,13 @@ <ccm:application name="ccm-ldn-rss"/> --> -<!-- SCI extension --> -<!-- - <ccm:application name="ccm-sci-personalprojects"/> ---> - <ccm:application name="ccm-sci-personalpublications"/> - <ccm:application name="ccm-sci-publications"/> - <ccm:application name="ccm-sci-types-member"/> - - <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Scientific CMS potential ADD-ONS packages --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -<!-- Content Types --> +<!-- CMS Content Types --> <!-- <ccm:application name="ccm-cms-types-agenda"/> <ccm:application name="ccm-cms-types-faqitem"/> @@ -117,7 +111,7 @@ <ccm:application name="ccm-cms-types-xmlfeed"/> --> -<!-- Applications --> +<!-- Applications --> <!-- <ccm:application name="ccm-auth-http"/> <ccm:application name="ccm-bookmarks"/> Modified: trunk/ccm-bundle/bundles/devel/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2012-01-09 19:31:24 UTC (rev 2270) @@ -1,6 +1,6 @@ # Libre CMS based on OpenCCM devel bundle integration.properties # -waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage +waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage # ; dhtml editor to use (system wide) ; Xinha is default @@ -39,7 +39,7 @@ # ccm-cms parameters -com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker +com.arsdigita.cms.category_authoring_add_form=com.arsdigita.bundle.ui.ItemCategoryPicker com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp @@ -105,7 +105,7 @@ com.arsdigita.navigation.templates_file=bundle/navigation/gen-templates.txt -# ccm-ldn-search application +# ccm-search application com.arsdigita.london.search.show_sponsored_links=true Modified: trunk/ccm-bundle/bundles/devel/cfg/project.xml =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/project.xml 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-bundle/bundles/devel/cfg/project.xml 2012-01-09 19:31:24 UTC (rev 2270) @@ -44,12 +44,14 @@ <ccm:application name="ccm-navigation"/> <!-- ccm-portalworkspace depends on ccm-subsite --> <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-portalworkspace-homepage"/> + <ccm:application name="ccm-shortcuts"/> <ccm:application name="ccm-subsite"/> + <ccm:application name="ccm-themedirector"/> <!-- LDN extension --> <ccm:application name="ccm-ldn-search"/> - <ccm:application name="ccm-ldn-shortcuts"/> <ccm:application name="ccm-ldn-terms"/> <ccm:application name="ccm-ldn-util"/> @@ -109,20 +111,21 @@ --> <!-- Applications --> -<!-- - - - - - - --> <!-- <ccm:application name="ccm-auth-http"/> <ccm:application name="ccm-bookmarks"/> <ccm:application name="ccm-docmgr"/> - <ccm:application name="ccm-portalserver"/> + <ccm:application name="ccm-docrepo"/> --> + <ccm:application name="ccm-forum"/> + <ccm:application name="ccm-forum-categorised"/> <!-- + <ccm:application name="ccm-portalserver"/> <ccm:application name="ccm-weblog"/> <ccm:application name="ccm-webpage"/> --> <!-- LDN extension --> -<!-- - - - - - - - --> <!-- <ccm:application name="ccm-ldn-exporter"/> <ccm:application name="ccm-ldn-freeform"/> Deleted: trunk/ccm-bundle/src/com/arsdigita/bundle/ui/CategoryPortalSelectionModel.java =================================================================== --- trunk/ccm-bundle/src/com/arsdigita/bundle/ui/CategoryPortalSelectionModel.java 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-bundle/src/com/arsdigita/bundle/ui/CategoryPortalSelectionModel.java 2012-01-09 19:31:24 UTC (rev 2270) @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package com.arsdigita.bundle.ui; - -import com.arsdigita.navigation.Navigation; -import com.arsdigita.navigation.NavigationModel; - -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.DataCollection; - -import com.arsdigita.domain.DomainObjectFactory; - -import com.arsdigita.categorization.Category; -import com.arsdigita.util.Assert; -import com.arsdigita.bebop.PageState; - -import com.arsdigita.portalworkspace.Workspace; -import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel; - -public class CategoryPortalSelectionModel extends WorkspaceSelectionModel { - - protected Workspace getDefaultWorkspace(PageState state) { - NavigationModel model = Navigation.getConfig().getDefaultModel(); - Category cat = model.getCategory(); - Assert.exists(cat); - - DataCollection workspaces - = SessionManager.getSession().retrieve( - Workspace.BASE_DATA_OBJECT_TYPE); - workspaces.addEqualsFilter("categories.id", cat.getID()); - - if (workspaces.next()) { - Workspace wk = (Workspace)DomainObjectFactory - .newInstance(workspaces.getDataObject()); - workspaces.close(); - return wk; - } - - return null; - } -} Deleted: trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepagePortalSelectionModel.java =================================================================== --- trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepagePortalSelectionModel.java 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepagePortalSelectionModel.java 2012-01-09 19:31:24 UTC (rev 2270) @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. - * - * The contents of this file are subject to the ArsDigita 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.arsdigita.com/ADPL.txt - * - * 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 com.arsdigita.aplaws.ui; - -import com.arsdigita.bebop.AbstractSingleSelectionModel; -import com.arsdigita.portalworkspace.ui.PortalSelectionModel; -import com.arsdigita.portalworkspace.WorkspacePage; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.domain.DomainObject; - -import org.apache.log4j.Logger; - -public class HomepagePortalSelectionModel extends AbstractSingleSelectionModel - implements PortalSelectionModel { - - /** Private logger instance for debugging */ - private static Logger s_log = Logger.getLogger( - HomepagePortalSelectionModel.class); - - private HomepageWorkspaceSelectionModel m_workspace; - private int m_column; - - public HomepagePortalSelectionModel(HomepageWorkspaceSelectionModel workspace, - int column) { - m_workspace = workspace; - m_column = column; - - if (s_log.isDebugEnabled()) { - s_log.debug("Constructor HomepageWorkspaceSelectionModel " + " [" + - "Workspace: " + m_workspace + "," + - "Columns: " + column + "]"); - } - - } - - public void onCustomize(PageState state) { - m_workspace.onCustomize(state, m_column); - } - - public void onReset(PageState state) { - m_workspace.onReset(state, m_column); - } - - public HomepageWorkspaceSelectionModel getWorkspaceModel() { - return m_workspace; - } - - public Object getSelectedKey(PageState state) { - return getSelectedPortal(state).getID(); - } - - public void setSelectedKey(PageState state, - Object key) { - throw new UnsupportedOperationException("cannot set key"); - } - - public void setSelectedObject(PageState state, - DomainObject key) { - throw new UnsupportedOperationException("cannot set object"); - } - - public ParameterModel getStateParameter() { - throw new UnsupportedOperationException("not state param"); - } - - - public DomainObject getSelectedObject(PageState state) { - return getSelectedPortal(state); - } - - public WorkspacePage getSelectedPortal(PageState state) { - return m_workspace.getPortal(state, m_column); - } -} Deleted: trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspace.java =================================================================== --- trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspace.java 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspace.java 2012-01-09 19:31:24 UTC (rev 2270) @@ -1,174 +0,0 @@ -/* - * Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. - * - * The contents of this file are subject to the ArsDigita 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.arsdigita.com/ADPL.txt - * - * 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 com.arsdigita.aplaws.ui; - -import com.arsdigita.bebop.SimpleContainer; -import com.arsdigita.bebop.ActionLink; -import com.arsdigita.bebop.Page; -import com.arsdigita.bebop.event.ActionEvent; -import com.arsdigita.bebop.event.ActionListener; -import com.arsdigita.portalworkspace.ui.PersistentPortal; -import com.arsdigita.portalworkspace.Workspace; -import com.arsdigita.bebop.PageState; -import com.arsdigita.xml.Element; -import com.arsdigita.portalworkspace.ui.PortalConstants; -import com.arsdigita.kernel.permissions.PermissionService; -import com.arsdigita.kernel.permissions.PermissionDescriptor; -import com.arsdigita.kernel.permissions.PrivilegeDescriptor; -import com.arsdigita.kernel.Party; -import com.arsdigita.kernel.Kernel; - -import org.apache.log4j.Logger; - - -/** - * - * - */ -public class HomepageWorkspace extends SimpleContainer { - - /** Private logger instance for debugging */ - private static Logger s_log = Logger.getLogger( - HomepageWorkspace.class); - - private HomepagePortalSelectionModel m_model; - private ActionLink m_reset; - private ActionLink m_browse; - private ActionLink m_edit; - private PersistentPortal m_browser; - private PersistentPortal m_editor; - private boolean m_customizable; - private boolean m_readOnly; - private String m_name; - - public HomepageWorkspace() { - super("portal:homepageWorkspace", PortalConstants.PORTAL_XML_NS); - m_customizable = false; - - if (s_log.isDebugEnabled()) { - s_log.debug("Constructor HomepageWorkspace finished. " ); - } - - } - - public void setModel(HomepagePortalSelectionModel model) { - m_model = model; - - if (s_log.isDebugEnabled()) { - s_log.debug("setModel: " + m_model ); - } - } - - public void setCustomizable(boolean customizable) { - m_customizable = customizable; - } - - public void setReadOnly(boolean readOnly) { - m_readOnly = readOnly; - } - - public void setName(String name) { - m_name = name; - } - - public void addWidgets() { - m_edit = new ActionLink("customize"); - m_browse = new ActionLink("browse"); - m_reset = new ActionLink("reset"); - m_reset.setConfirmation("Are you sure you wish to reset this column? " + - "This will permanently remove all portlets."); - - m_browser = new PersistentPortal(m_model, - m_name, - PortalConstants.MODE_DISPLAY); - m_editor = new PersistentPortal(m_model, - m_name, - PortalConstants.MODE_EDITOR); - - m_edit.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); - setDisplayMode(state, false); - - m_model.onCustomize(state); - } - }); - m_browse.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); - setDisplayMode(state, true); - } - }); - m_reset.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); - setDisplayMode(state, true); - - m_model.onReset(state); - } - }); - - add(m_edit); - add(m_browse); - add(m_reset); - add(m_editor); - add(m_browser); - } - - public void setDisplayMode(PageState state, - boolean browse) { - if (m_readOnly) { - return; - } - m_browse.setVisible(state, !browse); - m_reset.setVisible(state, !browse); - m_edit.setVisible(state, browse); - m_browser.setVisible(state, browse); - m_editor.setVisible(state, !browse); - } - - public void register(Page page) { - super.register(page); - - page.setVisibleDefault(m_browse, false); - page.setVisibleDefault(m_reset, false); - page.setVisibleDefault(m_edit, !m_readOnly); - page.setVisibleDefault(m_browser, true); - page.setVisibleDefault(m_editor, false); - } - - public void generateXML(PageState state, - Element parent) { - Party party = Kernel.getContext().getParty(); - Workspace global = m_model.getWorkspaceModel().getGlobalWorkspace(state); - PermissionDescriptor admin = - new PermissionDescriptor(PrivilegeDescriptor.ADMIN, - global, - party); - boolean hasAdmin = PermissionService.checkPermission(admin); - boolean userWorkspaces = Workspace.getConfig().getCreateUserWorkspaces(); - - if (party == null || m_readOnly || - (!hasAdmin && !m_customizable) || (!hasAdmin && !userWorkspaces)) { - m_reset.setVisible(state, false); - m_browse.setVisible(state, false); - m_edit.setVisible(state, false); - } - - super.generateXML(state, parent); - } - -} Deleted: trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspaceSelectionModel.java =================================================================== --- trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspaceSelectionModel.java 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspaceSelectionModel.java 2012-01-09 19:31:24 UTC (rev 2270) @@ -1,287 +0,0 @@ -/* - * Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. - * - * The contents of this file are subject to the ArsDigita 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.arsdigita.com/ADPL.txt - * - * 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 com.arsdigita.aplaws.ui; - - -import com.arsdigita.bebop.RequestLocal; -import com.arsdigita.bebop.PageState; - - -import com.arsdigita.kernel.Party; -import com.arsdigita.kernel.User; -import com.arsdigita.kernel.Kernel; -import com.arsdigita.kernel.permissions.PermissionService; -import com.arsdigita.kernel.permissions.PermissionDescriptor; -import com.arsdigita.kernel.permissions.PrivilegeDescriptor; - -import com.arsdigita.portalworkspace.Workspace; -import com.arsdigita.portalworkspace.WorkspacePage; -import com.arsdigita.portalworkspace.WorkspacePageCollection; - -import com.arsdigita.subsite.Subsite; - -import com.arsdigita.util.Assert; -import com.arsdigita.util.UncheckedWrapperException; - -import com.arsdigita.domain.DataObjectNotFoundException; - -import org.apache.log4j.Logger; - - -public class HomepageWorkspaceSelectionModel { - private RequestLocal m_loaded = new RequestLocal(); - private RequestLocal m_global = new RequestLocal(); - private RequestLocal m_personal = new RequestLocal(); - private RequestLocal m_left = new RequestLocal(); - private RequestLocal m_middle = new RequestLocal(); - private RequestLocal m_right = new RequestLocal(); - private RequestLocal m_custom = new RequestLocal(); - - private static Logger s_log = Logger.getLogger - (HomepageWorkspaceSelectionModel.class.getName()); - - public WorkspacePage getPortal(PageState state, - int column) { - if (!Boolean.TRUE.equals(m_loaded.get(state))) { - loadWorkspacePages(state); - } - - if (column == 0) { // Always global portal - return (WorkspacePage)m_left.get(state); - } else if (column == 1) { // Always global portal - return (WorkspacePage)m_middle.get(state); - } else if (column == 2) { // Personal portal, fallback on global - Party party = (Party)Kernel.getContext().getParty(); - WorkspacePage right = (WorkspacePage)m_right.get(state); - PermissionDescriptor admin = - new PermissionDescriptor(PrivilegeDescriptor.ADMIN, - right, - party); - // Always ensure admin gets global portal - // don't use custom portals if asked not to - if (m_custom.get(state) == null || - PermissionService.checkPermission(admin) || - !Workspace.getConfig().getCreateUserWorkspaces()) { - s_log.debug("Returning global portal"); - return (WorkspacePage)m_right.get(state); - } else { - s_log.debug("Returning personal portal"); - return (WorkspacePage)m_custom.get(state); - } - } - - throw new UncheckedWrapperException("column out of range (0..2)"); - } - - public void onCustomize(PageState state, - int column) { - if (!Boolean.TRUE.equals(m_loaded.get(state))) { - loadWorkspacePages(state); - } - - Party party = (Party)Kernel.getContext().getParty(); - - Assert.exists(party, Party.class); - - // When customizing right column, may need to clone - // for a personal portal - // don't use custom portals if asked not to - if (column == 2 && - Workspace.getConfig().getCreateUserWorkspaces()) { - Workspace global = getTopWorkspace(); - - WorkspacePage right = (WorkspacePage)m_right.get(state); - PermissionDescriptor admin = - new PermissionDescriptor(PrivilegeDescriptor.ADMIN, - right, - party); - if (PermissionService.checkPermission(admin)) { - s_log.debug("Party has admin on global portal"); - return; - } - - if (m_custom.get(state) != null) { - s_log.debug("Party has custom portal already"); - return; - } - - s_log.debug("Looking for custom column 2"); - - Workspace custom = null; - try { - custom = global.retrieveSubworkspaceForParty(party); - s_log.debug("Found exsting personal workspce"); - } catch (DataObjectNotFoundException ex) { - s_log.debug("Created new personal workspace"); - custom = Workspace.createWorkspace( - "personal-" + party.getID(), - "Personal Workspace for " + party.getDisplayName(), - global, - (User)party - ); - } - s_log.debug("Looking for portal"); - m_personal.set(state, custom); - WorkspacePageCollection portals = custom.getPages(); - portals.addOrder(WorkspacePage.SORT_KEY); - WorkspacePage portal; - if (portals.next()) { - s_log.debug("Found portal"); - portal = portals.getPage(); - portals.close(); - } else { - s_log.debug("Create portal"); - portal = custom.addPage("Custom", "Custom page"); - } - m_custom.set(state, portal); - } - } - - - public void onReset(PageState state, - int column) { - if (!Boolean.TRUE.equals(m_loaded.get(state))) { - loadWorkspacePages(state); - } - - Party party = Kernel.getContext().getParty(); - - Assert.exists(party, Party.class); - - WorkspacePage clear = null; - - // don't use custom portals if asked not to - if (column == 2 && - Workspace.getConfig().getCreateUserWorkspaces()) { - // If we find a custom workspace, then delete it, - // otherwise just clear the portlets. - Workspace global = getTopWorkspace(); - Workspace custom = null; - try { - custom = global.retrieveSubworkspaceForParty(party); - Assert.isTrue(custom.getParty() != null && - custom.getParty().equals(party), - "party is not null and not admin"); - s_log.debug("Found exsting personal workspce"); - custom.delete(); - m_custom.set(state, null); - } catch (DataObjectNotFoundException ex) { - clear = (WorkspacePage)m_right.get(state); - } - } else if (column == 1) { - clear = (WorkspacePage)m_middle.get(state); - } else if (column == 0) { - clear = (WorkspacePage)m_left.get(state); - } - - if (clear != null) { - clear.clearPortlets(); - } - } - - - public Workspace getGlobalWorkspace(PageState state) { - if (!Boolean.TRUE.equals(m_loaded.get(state))) { - loadWorkspacePages(state); - } - - return (Workspace)m_global.get(state); - } - - public Workspace getPersonalWorkspace(PageState state) { - if (!Boolean.TRUE.equals(m_loaded.get(state))) { - loadWorkspacePages(state); - } - - return (Workspace)m_personal.get(state); - } - - private void loadWorkspacePages(PageState state) { - Workspace global = getTopWorkspace(); - m_global.set(state, global); - - WorkspacePage left = null; - WorkspacePage middle = null; - WorkspacePage right = null; - - WorkspacePageCollection portals = global.getPages(); - portals.addOrder(WorkspacePage.SORT_KEY); - while (portals.next()) { - WorkspacePage portal = portals.getPage(); - - if (portal.getSortKey() == 0) { - left = portal; - } else if (portal.getSortKey() == 1) { - middle = portal; - } else if (portal.getSortKey() == 2) { - right = portal; - } - } - - if (left == null) { - left = global.addPage("Left", "Left hand page"); - } - if (middle == null) { - middle = global.addPage("Middle", "Middle page"); - } - if (right == null) { - right = global.addPage("Right", "Right hand page"); - } - m_left.set(state, left); - m_middle.set(state, middle); - m_right.set(state, right); - - - Party party = (Party)Kernel.getContext().getParty(); - m_custom.set(state, null); - if (party != null) { - Workspace custom = null; - try { - custom = global.retrieveSubworkspaceForParty(party); - } catch (DataObjectNotFoundException ex) { - // nada - } - if (custom != null) { - portals = custom.getPages(); - portals.addOrder(WorkspacePage.SORT_KEY); - if (portals.next()) { - WorkspacePage portal = portals.getPage(); - m_custom.set(state, portal); - } - portals.close(); - } - s_log.debug("Is there a custom portal ?" + custom + - " - " + m_custom.get(state)); - m_personal.set(state, custom); - } - - m_loaded.set(state, Boolean.TRUE); - } - - protected Workspace getTopWorkspace() { - if (Subsite.getContext().hasSite()) { - if (s_log.isDebugEnabled()) { - s_log.debug("Return a subsite front page"); - } - return (Workspace)Subsite.getContext().getSite().getFrontPage(); - } else { - if (s_log.isDebugEnabled()) { - s_log.debug("Return the main front page"); - } - return (Workspace)Kernel.getContext().getResource(); - } - } -} Modified: trunk/ccm-ldn-aplaws/bundles/custom/cfg/project.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/custom/cfg/project.xml 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-ldn-aplaws/bundles/custom/cfg/project.xml 2012-01-09 19:31:24 UTC (rev 2270) @@ -36,7 +36,6 @@ <ccm:application name="ccm-ldn-aplaws"/> <ccm:application name="ccm-ldn-atoz"/> <ccm:application name="ccm-ldn-dublin"/> - <ccm:application name="ccm-ldn-shortcuts"/> <ccm:application name="ccm-ldn-subsite"/> <ccm:application name="ccm-ldn-rss"/> <ccm:application name="ccm-ldn-terms"/> @@ -44,7 +43,9 @@ <ccm:application name="ccm-navigation"/> <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-portalworkspace-homepage"/> <ccm:application name="ccm-search"/> + <ccm:application name="ccm-shortcuts"/> <ccm:application name="ccm-themedirector"/> Modified: trunk/ccm-ldn-aplaws/bundles/custom/cfg/web.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/custom/cfg/web.xml 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-ldn-aplaws/bundles/custom/cfg/web.xml 2012-01-09 19:31:24 UTC (rev 2270) @@ -32,12 +32,12 @@ <filter> <filter-name>shortcuts</filter-name> - <filter-class>com.arsdigita.london.shortcuts.ShortcutFilter</filter-class> + <filter-class>com.arsdigita.shortcuts.ShortcutFilter</filter-class> </filter> <filter> <filter-name>subsite</filter-name> - <filter-class>com.arsdigita.london.subsite.SubsiteFilter</filter-class> + <filter-class>com.arsdigita.subsite.SubsiteFilter</filter-class> </filter> <!-- NOT USED HERE @@ -271,26 +271,26 @@ </servlet> <!-- module ccm-ldn-search - servlet declarations END --> - <!-- module ccm-ldn-shortcuts - servlet definitions --> + <!-- module ccm-shortcuts - servlet definitions --> <servlet> <servlet-name>shortcuts-files</servlet-name> <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> <param-name>template-path</param-name> - <param-value>/templates/ccm-ldn-shortcuts</param-value> + <param-value>/templates/ccm-shortcuts</param-value> </init-param> </servlet> - <!-- module ccm-ldn-subsite - servlet declarations BEGIN --> + <!-- module ccm-subsite - servlet declarations BEGIN --> <servlet> <servlet-name>subsite-files</servlet-name> <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> <param-name>template-path</param-name> - <param-value>/templates/ccm-ldn-subsite</param-value> + <param-value>/templates/ccm-subsite</param-value> </init-param> </servlet> - <!-- module ccm-ldn-subsite - servlet declarations END --> + <!-- module ccm-subsite - servlet declarations END --> <!-- module ccm-ldn-terms - servlet declarations BEGIN --> <servlet> @@ -382,18 +382,18 @@ </servlet-mapping> <!-- module ccm-ldn-search - servlet mappings END --> - <!-- module ccm-ldn-shortcuts - servlet mappings --> + <!-- module ccm-shortcuts - servlet mappings --> <servlet-mapping> <servlet-name>shortcuts-files</servlet-name> - <url-pattern>/ccm-ldn-shortcuts/files/*</url-pattern> + <url-pattern>/ccm-shortcuts/files/*</url-pattern> </servlet-mapping> - <!-- module ccm-ldn-subsite - servlet mappings BEGIN --> + <!-- module ccm-subsite - servlet mappings BEGIN --> <servlet-mapping> <servlet-name>subsite-files</servlet-name> - <url-pattern>/ccm-ldn-subsite/files/*</url-pattern> + <url-pattern>/ccm-subsite/files/*</url-pattern> </servlet-mapping> - <!-- module ccm-ldn-subsite - servlet mappings END --> + <!-- module ccm-subsite - servlet mappings END --> <!-- module ccm-ldn-terms - servlet mappings BEGIN --> <servlet-mapping> Modified: trunk/ccm-ldn-aplaws/bundles/demo/cfg/project.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/demo/cfg/project.xml 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-ldn-aplaws/bundles/demo/cfg/project.xml 2012-01-09 19:31:24 UTC (rev 2270) @@ -69,7 +69,6 @@ <ccm:application name="ccm-ldn-importer"/> <ccm:application name="ccm-ldn-rss"/> <ccm:application name="ccm-ldn-search"/> - <ccm:application name="ccm-ldn-shortcuts"/> <ccm:application name="ccm-ldn-terms"/> <ccm:application name="ccm-ldn-util"/> @@ -81,6 +80,8 @@ <ccm:application name="ccm-navigation"/> <ccm:application name="ccm-portalserver"/> <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-portalworkspace-homepage"/> + <ccm:application name="ccm-shortcuts"/> <ccm:application name="ccm-subsite"/> <ccm:application name="ccm-themedirector"/> Modified: trunk/ccm-ldn-aplaws/bundles/demo/cfg/web.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/demo/cfg/web.xml 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-ldn-aplaws/bundles/demo/cfg/web.xml 2012-01-09 19:31:24 UTC (rev 2270) @@ -17,12 +17,12 @@ <filter> <filter-name>shortcuts</filter-name> - <filter-class>com.arsdigita.london.shortcuts.ShortcutFilter</filter-class> + <filter-class>com.arsdigita.shortcuts.ShortcutFilter</filter-class> </filter> <filter> <filter-name>subsite</filter-name> - <filter-class>com.arsdigita.london.subsite.SubsiteFilter</filter-class> + <filter-class>com.arsdigita.subsite.SubsiteFilter</filter-class> </filter> <filter-mapping> @@ -249,26 +249,26 @@ </servlet> <!-- module ccm-ldn-search - servlet declarations END --> - <!-- module ccm-ldn-shortcuts - servlet definitions --> + <!-- module ccm-shortcuts - servlet definitions --> <servlet> <servlet-name>shortcuts-files</servlet-name> <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> <param-name>template-path</param-name> - <param-value>/templates/ccm-ldn-shortcuts</param-value> + <param-value>/templates/ccm-shortcuts</param-value> </init-param> </servlet> - <!-- module ccm-ldn-subsite - servlet declarations BEGIN --> + <!-- module ccm-subsite - servlet declarations BEGIN --> <servlet> <servlet-name>subsite-files</servlet-name> <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> <param-name>template-path</param-name> - <param-value>/templates/ccm-ldn-subsite</param-value> + <param-value>/templates/ccm-subsite</param-value> </init-param> </servlet> - <!-- module ccm-ldn-subsite - servlet declarations END --> + <!-- module ccm-subsite - servlet declarations END --> <!-- module ccm-ldn-terms - servlet declarations BEGIN --> <servlet> @@ -360,18 +360,18 @@ </servlet-mapping> <!-- module ccm-ldn-search - servlet mappings END --> - <!-- module ccm-ldn-shortcuts - servlet mappings --> + <!-- module ccm-shortcuts - servlet mappings --> <servlet-mapping> <servlet-name>shortcuts-files</servlet-name> - <url-pattern>/ccm-ldn-shortcuts/files/*</url-pattern> + <url-pattern>/ccm-shortcuts/files/*</url-pattern> </servlet-mapping> - <!-- module ccm-ldn-subsite - servlet mappings BEGIN --> + <!-- module ccm-subsite - servlet mappings BEGIN --> <servlet-mapping> <servlet-name>subsite-files</servlet-name> - <url-pattern>/ccm-ldn-subsite/files/*</url-pattern> + <url-pattern>/ccm-subsite/files/*</url-pattern> </servlet-mapping> - <!-- module ccm-ldn-subsite - servlet mappings END --> + <!-- module ccm-subsite - servlet mappings END --> <!-- module ccm-ldn-terms - servlet mappings BEGIN --> <servlet-mapping> Modified: trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml 2012-01-09 19:31:24 UTC (rev 2270) @@ -80,13 +80,14 @@ <ccm:application name="ccm-ldn-importer"/> <ccm:application name="ccm-ldn-rss"/> <ccm:application name="ccm-ldn-search"/> - <ccm:application name="ccm-ldn-shortcuts"/> <ccm:application name="ccm-ldn-terms"/> <ccm:application name="ccm-ldn-util"/> <ccm:application name="ccm-navigation"/> <ccm:application name="ccm-portalserver"/> <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-portalworkspace-homepage"/> + <ccm:application name="ccm-shortcuts"/> <ccm:application name="ccm-subsite"/> <!-- Currently broken. Missing file: ccm-portlet/postgres-create.sql Modified: trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml 2012-01-09 19:31:24 UTC (rev 2270) @@ -32,12 +32,12 @@ <filter> <filter-name>shortcuts</filter-name> - <filter-class>com.arsdigita.london.shortcuts.ShortcutFilter</filter-class> + <filter-class>com.arsdigita.shortcuts.ShortcutFilter</filter-class> </filter> <filter> <filter-name>subsite</filter-name> - <filter-class>com.arsdigita.london.subsite.SubsiteFilter</filter-class> + <filter-class>com.arsdigita.subsite.SubsiteFilter</filter-class> </filter> <!-- NOT USED HERE @@ -271,26 +271,26 @@ </servlet> <!-- module ccm-ldn-search - servlet declarations END --> - <!-- module ccm-ldn-shortcuts - servlet definitions --> + <!-- module ccm-shortcuts - servlet definitions --> <servlet> <servlet-name>shortcuts-files</servlet-name> <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> <param-name>template-path</param-name> - <param-value>/templates/ccm-ldn-shortcuts</param-value> + <param-value>/templates/ccm-shortcuts</param-value> </init-param> </servlet> - <!-- module ccm-ldn-subsite - servlet declarations BEGIN --> + <!-- module ccm-subsite - servlet declarations BEGIN --> <servlet> <servlet-name>subsite-files</servlet-name> <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> <param-name>template-path</param-name> - <param-value>/templates/ccm-ldn-subsite</param-value> + <param-value>/templates/ccm-subsite</param-value> </init-param> </servlet> - <!-- module ccm-ldn-subsite - servlet declarations END --> + <!-- module ccm-subsite - servlet declarations END --> <!-- module ccm-ldn-terms - servlet declarations BEGIN --> <servlet> @@ -382,18 +382,18 @@ </servlet-mapping> <!-- module ccm-ldn-search - servlet mappings END --> - <!-- module ccm-ldn-shortcuts - servlet mappings --> + <!-- module ccm-shortcuts - servlet mappings --> <servlet-mapping> <servlet-name>shortcuts-files</servlet-name> - <url-pattern>/ccm-ldn-shortcuts/files/*</url-pattern> + <url-pattern>/ccm-shortcuts/files/*</url-pattern> </servlet-mapping> - <!-- module ccm-ldn-subsite - servlet mappings BEGIN --> + <!-- module ccm-subsite - servlet mappings BEGIN --> <servlet-mapping> <servlet-name>subsite-files</servlet-name> - <url-pattern>/ccm-ldn-subsite/files/*</url-pattern> + <url-pattern>/ccm-subsite/files/*</url-pattern> </servlet-mapping> - <!-- module ccm-ldn-subsite - servlet mappings END --> + <!-- module ccm-subsite - servlet mappings END --> <!-- module ccm-ldn-terms - servlet mappings BEGIN --> <servlet-mapping> Deleted: trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/CategoryPortalSelectionModel.java =================================================================== --- trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/CategoryPortalSelectionModel.java 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/CategoryPortalSelectionModel.java 2012-01-09 19:31:24 UTC (rev 2270) @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -package com.arsdigita.aplaws.ui; - -import com.arsdigita.navigation.Navigation; -import com.arsdigita.navigation.NavigationModel; - -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.DataCollection; - -import com.arsdigita.domain.DomainObjectFactory; - -import com.arsdigita.categorization.Category; -import com.arsdigita.util.Assert; -import com.arsdigita.bebop.PageState; - -import com.arsdigita.portalworkspace.Workspace; -import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel; - -public class CategoryPortalSelectionModel extends WorkspaceSelectionModel { - - protected Workspace getDefaultWorkspace(PageState state) { - NavigationModel model = Navigation.getConfig().getDefaultModel(); - Category cat = model.getCategory(); - Assert.exists(cat); - - DataCollection workspaces - = SessionManager.getSession().retrieve( - Workspace.BASE_DATA_OBJECT_TYPE); - workspaces.addEqualsFilter("categories.id", cat.getID()); - - if (workspaces.next()) { - Workspace wk = (Workspace)DomainObjectFactory - .newInstance(workspaces.getDataObject()); - workspaces.close(); - return wk; - } - - return null; - } -} Deleted: trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepagePortalSelectionModel.java =================================================================== --- trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepagePortalSelectionModel.java 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepagePortalSelectionModel.java 2012-01-09 19:31:24 UTC (rev 2270) @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. - * - * The contents of this file are subject to the ArsDigita 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.arsdigita.com/ADPL.txt - * - * 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 com.arsdigita.aplaws.ui; - -import com.arsdigita.bebop.AbstractSingleSelectionModel; -import com.arsdigita.portalworkspace.ui.PortalSelectionModel; -import com.arsdigita.portalworkspace.WorkspacePage; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.domain.DomainObject; - -import org.apache.log4j.Logger; - -public class HomepagePortalSelectionModel extends AbstractSingleSelectionModel - implements PortalSelectionModel { - - /** Private logger instance for debugging */ - private static Logger s_log = Logger.getLogger( - HomepagePortalSelectionModel.class); - - private HomepageWorkspaceSelectionModel m_workspace; - private int m_column; - - public HomepagePortalSelectionModel(HomepageWorkspaceSelectionModel workspace, - int column) { - m_workspace = workspace; - m_column = column; - - if (s_log.isDebugEnabled()) { - s_log.debug("Constructor HomepageWorkspaceSelectionModel " + " [" + - "Workspace: " + m_workspace + "," + - "Columns: " + column + "]"); - } - - } - - public void onCustomize(PageState state) { - m_workspace.onCustomize(state, m_column); - } - - public void onReset(PageState state) { - m_workspace.onReset(state, m_column); - } - - public HomepageWorkspaceSelectionModel getWorkspaceModel() { - return m_workspace; - } - - public Object getSelectedKey(PageState state) { - return getSelectedPortal(state).getID(); - } - - public void setSelectedKey(PageState state, - Object key) { - throw new UnsupportedOperationException("cannot set key"); - } - - public void setSelectedObject(PageState state, - DomainObject key) { - throw new UnsupportedOperationException("cannot set object"); - } - - public ParameterModel getStateParameter() { - throw new UnsupportedOperationException("not state param"); - } - - - public DomainObject getSelectedObject(PageState state) { - return getSelectedPortal(state); - } - - public WorkspacePage getSelectedPortal(PageState state) { - return m_workspace.getPortal(state, m_column); - } -} Deleted: trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspace.java =================================================================== --- trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspace.java 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspace.java 2012-01-09 19:31:24 UTC (rev 2270) @@ -1,176 +0,0 @@ -/* - * Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. - * - * The contents of this file are subject to the ArsDigita 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.arsdigita.com/ADPL.txt - * - * 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 com.arsdigita.aplaws.ui; - -import com.arsdigita.bebop.SimpleContainer; -import com.arsdigita.bebop.ActionLink; -import com.arsdigita.bebop.Page; -import com.arsdigita.bebop.event.ActionEvent; -import com.arsdigita.bebop.event.ActionListener; -import com.arsdigita.portalworkspace.ui.PersistentPortal; -import com.arsdigita.portalworkspace.Workspace; -import com.arsdigita.bebop.PageState; -import com.arsdigita.xml.Element; -import com.arsdigita.portalworkspace.ui.PortalConstants; -import com.arsdigita.kernel.permissions.PermissionService; -import com.arsdigita.kernel.permissions.PermissionDescriptor; -import com.arsdigita.kernel.permissions.PrivilegeDescriptor; -import com.arsdigita.kernel.Kernel; -import com.arsdigita.kernel.Party; - -import org.apache.log4j.Logger; - - -/** - * - * - */ -public class HomepageWorkspace extends SimpleContainer { - - /** Private logger instance for debugging */ - private static Logger s_log = Logger.getLogger( - HomepageWorkspace.class); - - private HomepagePortalSelectionModel m_model; - private ActionLink m_reset; - private ActionLink m_browse; - private ActionLink m_edit; - private PersistentPortal m_browser; - private PersistentPortal m_editor; - private boolean m_customizable; - private boolean m_readOnly; - private String m_name; - - public HomepageWorkspace() { - super("portal:homepageWorkspace", PortalConstants.PORTAL_XML_NS); - m_customizable = false; - - if (s_log.isDebugEnabled()) { - s_log.debug("Constructor HomepageWorkspace finished. " ); - } - - } - - public void setModel(HomepagePortalSelectionModel model) { - m_model = model; - - if (s_log.isDebugEnabled()) { - s_log.debug("setModel: " + m_model ); - } - } - - public void setCustomizable(boolean customizable) { - m_customizable = customizable; - } - - public void setReadOnly(boolean readOnly) { - m_readOnly = readOnly; - } - - public void setName(String name) { - m_name = name; - } - - public void addWidgets() { - m_edit = new ActionLink("customize"); - m_browse = new ActionLink("browse"); - m_reset = new ActionLink("reset"); - m_reset.setConfirmation("Are you sure you wish to reset this column? " + - "This will permanently remove all portlets."); - - m_browser = new PersistentPortal(m_model, - m_name, - PortalConstants.MODE_DISPLAY); - m_editor = new PersistentPortal(m_model, - m_name, - PortalConstants.MODE_EDITOR); - - m_edit.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); - setDisplayMode(state, false); - - m_model.onCustomize(state); - } - }); - m_browse.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); - setDisplayMode(state, true); - } - }); - m_reset.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); - setDisplayMode(state, true); - - m_model.onReset(state); - } - }); - - add(m_edit); - add(m_browse); - add(m_reset); - add(m_editor); - add(m_browser); - } - - public void setDisplayMode(PageState state, - boolean browse) { - if (m_readOnly) { - return; - } - m_browse.setVisible(state, !browse); - m_reset.setVisible(state, !browse); - m_edit.setVisible(state, browse); - m_browser.setVisible(state, browse); - m_editor.setVisible(state, !browse); - } - - @Override - public void register(Page page) { - super.register(page); - - page.setVisibleDefault(m_browse, false); - page.setVisibleDefault(m_reset, false); - page.setVisibleDefault(m_edit, !m_readOnly); - page.setVisibleDefault(m_browser, true); - page.setVisibleDefault(m_editor, false); - } - - @Override - public void generateXML(PageState state, - Element parent) { - Party party = Kernel.getContext().getParty(); - Workspace global = m_model.getWorkspaceModel().getGlobalWorkspace(state); - PermissionDescriptor admin = - new PermissionDescriptor(PrivilegeDescriptor.ADMIN, - global, - party); - boolean hasAdmin = PermissionService.checkPermission(admin); - boolean userWorkspaces = Workspace.getConfig().getCreateUserWorkspaces(); - - if (party == null || m_readOnly || - (!hasAdmin && !m_customizable) || (!hasAdmin && !userWorkspaces)) { - m_reset.setVisible(state, false); - m_browse.setVisible(state, false); - m_edit.setVisible(state, false); - } - - super.generateXML(state, parent); - } - -} Deleted: trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspaceSelectionModel.java =================================================================== --- trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspaceSelectionModel.java 2012-01-09 18:51:58 UTC (rev 2269) +++ trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspaceSelectionModel.java 2012-01-09 19:31:24 UTC (rev 2270) @@ -1,291 +0,0 @@ -/* - * Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. - * - * The contents of this file are subject to the ArsDigita 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.arsdigita.com/ADPL.txt - * - * 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 com.arsdigita.aplaws.ui; - - -import com.arsdigita.bebop.RequestLocal; -import com.arsdigita.bebop.PageState; - - -import com.arsdigita.kernel.Party; -import com.arsdigita.kernel.User; -import com.arsdigita.kernel.Kernel; -import com.arsdigita.kernel.permissions.PermissionService; -import com.arsdigita.kernel.permissions.PermissionDescriptor; -import com.arsdigita.kernel.permissions.PrivilegeDescriptor; - -import com.arsdigita.portalworkspace.Workspace; -import com.arsdigita.portalworkspace.WorkspacePage; -import com.arsdigita.portalworkspace.WorkspacePageCollection; - -import com.arsdigita.subsite.Subsite; - -import com.arsdigita.util.Assert; -import com.arsdigita.util.UncheckedWrapperException; - -import com.arsdigita.domain.DataObjectNotFoundException; - -import org.apache.log4j.Logger; - - -/** - * - * - */ -public class HomepageWorkspaceSelectionModel { - private RequestLocal m_loaded = new RequestLocal(); - private RequestLocal m_global = new RequestLocal(); - private RequestLocal m_personal = new RequestLocal(); - private RequestLocal m_left = new RequestLocal(); - private RequestLocal m_middle = new RequestLocal(); - private RequestLocal m_right = new RequestLocal(); - private RequestLocal m_custom = new RequestLocal(); - - private static Logger s_log = Logger.getLogger - (HomepageWorkspaceSelectionModel.class.getName()); - - public WorkspacePage getPortal(PageState state, - int column) { - if (!Boolean.TRUE.equals(m_loaded.get(state))) { - loadWorkspacePages(state); - ... [truncated message content] |
Author: pboy Date: 2012-01-09 18:51:58 +0000 (Mon, 09 Jan 2012) New Revision: 2269 Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql trunk/ccm-shortcuts/ trunk/ccm-shortcuts/.classpath trunk/ccm-shortcuts/.project trunk/ccm-shortcuts/.settings/ trunk/ccm-shortcuts/.settings/org.eclipse.jdt.core.prefs trunk/ccm-shortcuts/.settings/org.eclipse.jdt.ui.prefs trunk/ccm-shortcuts/.svnignore trunk/ccm-shortcuts/application.xml trunk/ccm-shortcuts/doc/ trunk/ccm-shortcuts/doc/shortcuts-standalone/ trunk/ccm-shortcuts/doc/shortcuts-standalone/README trunk/ccm-shortcuts/doc/shortcuts-standalone/bebop-define.tld trunk/ccm-shortcuts/doc/shortcuts-standalone/bebop-show.tld trunk/ccm-shortcuts/doc/shortcuts-standalone/web.xml trunk/ccm-shortcuts/doc/web.xml-shortcuts.in trunk/ccm-shortcuts/pdl/ trunk/ccm-shortcuts/pdl/com/ trunk/ccm-shortcuts/pdl/com/arsdigita/ trunk/ccm-shortcuts/pdl/com/arsdigita/shortcuts/ trunk/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcut.pdl trunk/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcuts.pdl trunk/ccm-shortcuts/sql/ trunk/ccm-shortcuts/sql/ccm-shortcuts/ trunk/ccm-shortcuts/sql/ccm-shortcuts/default/ trunk/ccm-shortcuts/sql/ccm-shortcuts/default/sequence-ss_shortcuts_seq.sql trunk/ccm-shortcuts/sql/ccm-shortcuts/default/table-sc_shortcuts.sql trunk/ccm-shortcuts/sql/ccm-shortcuts/oracle-se-create.sql trunk/ccm-shortcuts/sql/ccm-shortcuts/postgres-create.sql trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/ trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/ trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/ trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/drop_app_table.sql trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/oracle-se-6.6.0-6.6.1.sql trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/postgres-6.6.0-6.6.1.sql trunk/ccm-shortcuts/src/ trunk/ccm-shortcuts/src/ccm-shortcuts.config trunk/ccm-shortcuts/src/ccm-shortcuts.load trunk/ccm-shortcuts/src/ccm-shortcuts.upgrade trunk/ccm-shortcuts/src/com/ trunk/ccm-shortcuts/src/com/arsdigita/ trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/ trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Initializer.java trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Loader.java trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Shortcut.java trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutCollection.java trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutFilter.java trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutUtil.java trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/Shortcuts.java trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutsConfig.java trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutsConfig_parameter.properties trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/AdminPanel.java trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ShortcutForm.java trunk/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ShortcutsTable.java trunk/ccm-shortcuts/web/ trunk/ccm-shortcuts/web/WEB-INF/ trunk/ccm-shortcuts/web/WEB-INF/web.ccm-shortcuts.xml trunk/ccm-shortcuts/web/templates/ trunk/ccm-shortcuts/web/templates/ccm-shortcuts/ trunk/ccm-shortcuts/web/templates/ccm-shortcuts/index.jsp trunk/ccm-shortcuts/web/themes/ trunk/ccm-shortcuts/web/themes/heirloom/ trunk/ccm-shortcuts/web/themes/heirloom/apps/ trunk/ccm-shortcuts/web/themes/heirloom/apps/shortcuts/ trunk/ccm-shortcuts/web/themes/heirloom/apps/shortcuts/xsl/ trunk/ccm-shortcuts/web/themes/heirloom/apps/shortcuts/xsl/index.xsl Removed: trunk/ccm-ldn-shortcuts/ Modified: trunk/ccm-bundle/bundles/demo/cfg/integration.properties trunk/ccm-bundle/bundles/devel/cfg/integration.properties trunk/ccm-bundle/bundles/devel/cfg/project.xml trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.2-6.6.3.sql trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java trunk/ccm-subsite/pdl/com/arsdigita/subsite/Subsite.pdl trunk/ccm-subsite/web/themes/heirloom/apps/subsite/xsl/index.xsl trunk/tools-ng/netbeans/project.xml Log: Renamed ccm-ldn-shortcuts to ccm-shortcuts according to naming schema. Modified: trunk/ccm-bundle/bundles/demo/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2012-01-09 18:20:16 UTC (rev 2268) +++ trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2012-01-09 18:51:58 UTC (rev 2269) @@ -5,7 +5,8 @@ ; dhtml editor to use (system wide) ; Xinha is default ; default: Xinha editor & src=/assets/xinha/XinhaLoader.js -#waf.bebop.dhtml_editor=FCKeditor +; To use FCKeditor configure: +; waf.bebop.dhtml_editor=FCKeditor waf.categorization.show_internal_name=true @@ -30,7 +31,7 @@ ; workflow configuration waf.workflow.simple.alerts_enabled=true -waf.workflow.simple.alerts_sender=root@localhost.localdomain +waf.workflow.simple.alerts_sender=web...@li... ; Configures the xml processing waf.xml.xsl_transformer=xalan @@ -46,18 +47,15 @@ ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box -; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js -; as a temporary measure a different configuration file which includes a link selection box for CCM items -; and CCM images should be specified: -com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js +; A CCM specific configuration file is used to prevent a mess with the standard +; configuration, default is: +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js ; to use FCKeditor: ; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js -; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; com.arsdigita.cms.dhtml_editor_hidden_buttons= -; com.arsdigita.cms.dhtml_editor_plugins= +; com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS - com.arsdigita.cms.disable_item_pfs=true com.arsdigita.cms.hide_admin_tabs=true @@ -111,7 +109,7 @@ com.arsdigita.london.search.show_sponsored_links=true -# ccm-ldn-subsite application +# ccm-subsite application com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker @@ -129,14 +127,14 @@ # ============================================================================================= # runtime specific configurations -waf.admin.email=web...@sc... +waf.admin.email=web...@li... waf.admin.name.given=SCI waf.admin.name.family=Administrator -waf.admin.password=sci2000 +waf.admin.password=lib2000 waf.admin.password.question=12345 waf.admin.password.answer=6 -waf.runtime.jdbc_url=jdbc\:postgresql\://localhost/ccm-sci?user\=sci&password\=sci47web&stringtype\=unspecified +waf.runtime.jdbc_url=jdbc\:postgresql\://localhost/ccm-lib?user\=ccm&password\=sci47web&stringtype\=unspecified waf.runtime.jdbc_pool_size=30 waf.web.server=localhost\:8080 Modified: trunk/ccm-bundle/bundles/devel/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2012-01-09 18:20:16 UTC (rev 2268) +++ trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2012-01-09 18:51:58 UTC (rev 2269) @@ -5,7 +5,8 @@ ; dhtml editor to use (system wide) ; Xinha is default ; default: Xinha editor & src=/assets/xinha/XinhaLoader.js -#waf.bebop.dhtml_editor=FCKeditor +; To use FCKeditor configure: +; waf.bebop.dhtml_editor=FCKeditor waf.categorization.show_internal_name=true @@ -30,7 +31,7 @@ ; workflow configuration waf.workflow.simple.alerts_enabled=true -waf.workflow.simple.alerts_sender=root@localhost.localdomain +waf.workflow.simple.alerts_sender=webmaster@localhost.localdomain ; Configures the xml processing waf.xml.xsl_transformer=xalan @@ -46,17 +47,14 @@ ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box -; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js -; as a temporary measure a different configuration file which includes a link selection box for CCM items -; and CCM images should be specified: -com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js +; A CCM specific configuration file is used to prevent a mess with the standard +; configuration, default is: +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js ; to use FCKeditor: ; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js -; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; com.arsdigita.cms.dhtml_editor_hidden_buttons= ; com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS -com.arsdigita.cms.dhtml_editor_plugins= com.arsdigita.cms.disable_item_pfs=true @@ -111,7 +109,7 @@ com.arsdigita.london.search.show_sponsored_links=true -# ccm-ldn-subsite application +# ccm-subsite application com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker @@ -132,7 +130,7 @@ waf.admin.email=web...@op... waf.admin.name.given=OpenCCM waf.admin.name.family=Administrator -waf.admin.password=WaeGgfsh +waf.admin.password=lib2000 waf.admin.password.question=12345 waf.admin.password.answer=6 Modified: trunk/ccm-bundle/bundles/devel/cfg/project.xml =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/project.xml 2012-01-09 18:20:16 UTC (rev 2268) +++ trunk/ccm-bundle/bundles/devel/cfg/project.xml 2012-01-09 18:51:58 UTC (rev 2269) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<!-- project.xml - ccm - containing only those modules used for - CCM development --> +<!-- project.xml - ccm devel - containing only those modules used for + generic CCM / LibreCMS development --> <ccm:project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ccm="http://ccm.redhat.com/ccm-project" @@ -77,7 +77,6 @@ <!-- Applications --> <ccm:application name="ccm-cms-publicpersonalprofile"/> - <ccm:application name="ccm-portalserver"/> <!-- LDN extension --> <!-- temporyrily excluded because configuration has to be cleared @@ -115,6 +114,7 @@ <ccm:application name="ccm-auth-http"/> <ccm:application name="ccm-bookmarks"/> <ccm:application name="ccm-docmgr"/> + <ccm:application name="ccm-portalserver"/> --> <!-- <ccm:application name="ccm-weblog"/> Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql (rev 0) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,31 @@ +-- +-- Copyright (C) 2011 Jens Pelzetter 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: create_publish_lock_table.sql pboy $ + + + +CREATE TABLE cms_publish_lock ( + lock_id integer NOT NULL, + locked_oid character varying(2048), + lock_timestamp timestamp with time zone, + action character varying(256) +); + +ALTER TABLE ONLY cms_publish_lock + ADD CONSTRAINT cms_publis_loc_lock_id_p_8n7d0 PRIMARY KEY (lock_id); + Modified: trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.2-6.6.3.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.2-6.6.3.sql 2012-01-09 18:20:16 UTC (rev 2268) +++ trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.2-6.6.3.sql 2012-01-09 18:51:58 UTC (rev 2269) @@ -26,7 +26,5 @@ begin; \i ../default/upgrade/6.6.2-6.6.3/upd_table_persons.sql -\i ../default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql -\i ../default/upgrade/6.6.2-6.6.3/create_publish_lock_table.sql commit; Modified: trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java =================================================================== --- trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java 2012-01-09 18:20:16 UTC (rev 2268) +++ trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java 2012-01-09 18:51:58 UTC (rev 2269) @@ -171,13 +171,6 @@ * * No localization here because it is an invariant configuration. * - * NOTE: The wording in the title parameter of ApplicationType determines - * the name of the subdirectory for the XSL stylesheets. - * It gets "urlized", i.e. trimming leading and trailing blanks and replacing - * blanks between words and illegal characters with an hyphen and converted - * to lower case. - * "Portal Workspace" will become "portal-workspace". - * * @return created ApplicationType */ private ApplicationType setupWorkspaceType() { @@ -185,7 +178,14 @@ s_log.debug("Creating an application type for portal workspace. " + "Base Data Object Type: " + Workspace.BASE_DATA_OBJECT_TYPE); - /* Create legacy-free application type */ + /* Create legacy-free application type + * + * NOTE: The wording in the title parameter of ApplicationType + * determines the name of the subdirectory for the XSL stylesheets. + * It gets "urlized", i.e. trimming leading and trailing blanks and + * replacing blanks between words and illegal characters with an + * hyphen and converted to lower case. + * "Portal Workspace" will become "portal-workspace". */ ApplicationType type = new ApplicationType( "Portal Workspace", Workspace.BASE_DATA_OBJECT_TYPE ); Property changes on: trunk/ccm-shortcuts ___________________________________________________________________ Added: svn:ignore + build Added: trunk/ccm-shortcuts/.classpath =================================================================== --- trunk/ccm-shortcuts/.classpath (rev 0) +++ trunk/ccm-shortcuts/.classpath 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="lib" path="build/ccm-ldn-shortcuts-6.5.0-pdl.jar"/> + <classpathentry kind="lib" path="build/ccm-ldn-shortcuts-6.5.0-sql.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry combineaccessrules="false" kind="src" path="/ccm-core"/> + <classpathentry kind="output" path="build/Eclipse"/> +</classpath> Added: trunk/ccm-shortcuts/.project =================================================================== --- trunk/ccm-shortcuts/.project (rev 0) +++ trunk/ccm-shortcuts/.project 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ccm-ldn-shortcuts</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/ccm-shortcuts/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/ccm-shortcuts/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ trunk/ccm-shortcuts/.settings/org.eclipse.jdt.core.prefs 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,62 @@ +#Fri May 04 16:16:11 CEST 2007 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.deprecation=ignore +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=ignore +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=ignore +org.eclipse.jdt.core.compiler.problem.unusedLabel=ignore +org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.4 Property changes on: trunk/ccm-shortcuts/.settings/org.eclipse.jdt.core.prefs ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-shortcuts/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- trunk/ccm-shortcuts/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ trunk/ccm-shortcuts/.settings/org.eclipse.jdt.ui.prefs 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,3 @@ +#Mon Apr 30 16:18:18 CEST 2007 +eclipse.preferences.version=1 +internal.default.compliance=user Property changes on: trunk/ccm-shortcuts/.settings/org.eclipse.jdt.ui.prefs ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-shortcuts/.svnignore =================================================================== --- trunk/ccm-shortcuts/.svnignore (rev 0) +++ trunk/ccm-shortcuts/.svnignore 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1 @@ +build Property changes on: trunk/ccm-shortcuts/.svnignore ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-shortcuts/application.xml =================================================================== --- trunk/ccm-shortcuts/application.xml (rev 0) +++ trunk/ccm-shortcuts/application.xml 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,19 @@ +<?xml version="1.0"?> +<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" + name="ccm-shortcuts" + prettyName="Shortcuts" + version="6.6.1" + release="1" + webapp="ROOT"> + <ccm:dependencies> + <ccm:requires name="ccm-core" version="6.6.0" relation="ge"/> + </ccm:dependencies> + <ccm:contacts> + <ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/> + <ccm:contact uri="mailto:rh...@re..." type="support"/> + </ccm:contacts> + <ccm:description> + The Red Hat Web Application Framework is a platform for writing + database-backed web applications in Java. + </ccm:description> +</ccm:application> Property changes on: trunk/ccm-shortcuts/application.xml ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-shortcuts/doc/shortcuts-standalone/README =================================================================== --- trunk/ccm-shortcuts/doc/shortcuts-standalone/README (rev 0) +++ trunk/ccm-shortcuts/doc/shortcuts-standalone/README 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,25 @@ +Up to APLAWS version 1.0.4 shortcuts had been installed into its own +application context: [webapps]/ccm-shortcuts. + +Now it is installed inside the main APLAWS application context along +with all other applications. + +If shortcuts should be installed as its own web context again following +modifications are necessary: +1. remove webapp="xxx" from application.xml +2. move the files in this dir to WEB-INF/ +3. change src/com/ad/shortcuts/Shortcuts.java + method getServletContext() as back to "/files" +4. edit __ccm__/.../xsl/index.xsl according the comment +5. edit in ccm-ldn-aplaws /web/__ccm__/themes/aplaws/shortcuts.xml + according to the comment +6. Add the filter expression in web.xml-shortcuts.in into the + main applications web.xml + + +Running it in its own webapplication context nevertheless is not suggestive. +It needs several xsl files of the main application (esp. core) for basic +operations, which hac been directly mapped from the main applications directory +tree into its own directory tree. So no module separation is possible, no +security context useable etc. + Added: trunk/ccm-shortcuts/doc/shortcuts-standalone/bebop-define.tld =================================================================== --- trunk/ccm-shortcuts/doc/shortcuts-standalone/bebop-define.tld (rev 0) +++ trunk/ccm-shortcuts/doc/shortcuts-standalone/bebop-define.tld 2012-01-09 18:51:58 UTC (rev 2269) @@ -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.arsdigita.bebop.jsp.DefineWidgetExtraInfo</teiclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>type</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>size</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>maxlength</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>password</name> + <tagclass>com.arsdigita.bebop.jsp.DefinePassword</tagclass> + <teiclass>com.arsdigita.bebop.jsp.DefineWidgetExtraInfo</teiclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>size</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>maxlength</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>textArea</name> + <tagclass>com.arsdigita.bebop.jsp.DefineTextArea</tagclass> + <teiclass>com.arsdigita.bebop.jsp.DefineWidgetExtraInfo</teiclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>type</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>rows</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>cols</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>wrap</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>submit</name> + <tagclass>com.arsdigita.bebop.jsp.DefineSubmit</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>label</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>bundle</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>option</name> + <tagclass>com.arsdigita.bebop.jsp.DefineOption</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>value</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>selected</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>bundle</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>radioGroup</name> + <tagclass>com.arsdigita.bebop.jsp.DefineRadioGroup</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>checkboxGroup</name> + <tagclass>com.arsdigita.bebop.jsp.DefineCheckboxGroup</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>vertical</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>select</name> + <tagclass>com.arsdigita.bebop.jsp.DefineSelect</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>onChange</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>multipleSelect</name> + <tagclass>com.arsdigita.bebop.jsp.DefineMultipleSelect</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>slave</name> + <tagclass>com.arsdigita.bebop.jsp.DefineSlave</tagclass> + <bodycontent>empty</bodycontent> + </tag> + + <tag> + <name>list</name> + <tagclass>com.arsdigita.bebop.jsp.DefineList</tagclass> + <teiclass>com.arsdigita.bebop.jsp.DefineListExtraInfo</teiclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>table</name> + <tagclass>com.arsdigita.bebop.jsp.DefineTable</tagclass> + <teiclass>com.arsdigita.bebop.jsp.DefineTableExtraInfo</teiclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> +</taglib> + Property changes on: trunk/ccm-shortcuts/doc/shortcuts-standalone/bebop-define.tld ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-shortcuts/doc/shortcuts-standalone/bebop-show.tld =================================================================== --- trunk/ccm-shortcuts/doc/shortcuts-standalone/bebop-show.tld (rev 0) +++ trunk/ccm-shortcuts/doc/shortcuts-standalone/bebop-show.tld 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,117 @@ +<?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 showing components from Bebop pages + inside of a JSP.</info> + + <tag> + <name>page</name> + <tagclass>com.arsdigita.bebop.jsp.ShowPage</tagclass> + <teiclass>com.arsdigita.bebop.jsp.ShowPageExtraInfo</teiclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>pageClass</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <name>master</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>all</name> + <tagclass>com.arsdigita.bebop.jsp.ShowAll</tagclass> + <bodycontent>JSP</bodycontent> + </tag> + + <tag> + <name>component</name> + <tagclass>com.arsdigita.bebop.jsp.ShowComponent</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>form</name> + <tagclass>com.arsdigita.bebop.jsp.ShowForm</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>list</name> + <tagclass>com.arsdigita.bebop.jsp.ShowList</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + + <tag> + <name>listItem</name> + <tagclass>com.arsdigita.bebop.jsp.ShowListItem</tagclass> + <bodycontent>empty</bodycontent> + </tag> + + <tag> + <name>table</name> + <tagclass>com.arsdigita.bebop.jsp.ShowTable</tagclass> + <bodycontent>JSP</bodycontent> + <attribute> + <name>name</name> + <required>true</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + </tag> + + <tag> + <name>thead</name> + <tagclass>com.arsdigita.bebop.jsp.ShowTableHeader</tagclass> + <bodycontent>JSP</bodycontent> + </tag> + + <tag> + <name>tbody</name> + <tagclass>com.arsdigita.bebop.jsp.ShowTableBody</tagclass> + <bodycontent>JSP</bodycontent> + </tag> + + <tag> + <name>row</name> + <tagclass>com.arsdigita.bebop.jsp.ShowTableRow</tagclass> + <bodycontent>JSP</bodycontent> + </tag> + + <tag> + <name>col</name> + <tagclass>com.arsdigita.bebop.jsp.ShowListItem</tagclass> + <bodycontent>empty</bodycontent> + </tag> + + <tag> + <name>slave</name> + <tagclass>com.arsdigita.bebop.jsp.ShowSlave</tagclass> + <bodycontent>JSP</bodycontent> + </tag> +</taglib> Property changes on: trunk/ccm-shortcuts/doc/shortcuts-standalone/bebop-show.tld ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-shortcuts/doc/shortcuts-standalone/web.xml =================================================================== --- trunk/ccm-shortcuts/doc/shortcuts-standalone/web.xml (rev 0) +++ trunk/ccm-shortcuts/doc/shortcuts-standalone/web.xml 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,41 @@ +<!DOCTYPE web-app + PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" + "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd"> + +<web-app> + <servlet> + <servlet-name>reg</servlet-name> + <servlet-class>com.arsdigita.web.ContextRegistrationServlet</servlet-class> + <init-param> + <param-name>uri</param-name> + <param-value>/ccm-shortcuts/</param-value> + </init-param> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet> + <servlet-name>files</servlet-name> + <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> + <init-param> + <param-name>template-path</param-name> + <param-value>/templates/ccm-shortcuts</param-value> + </init-param> + </servlet> + + <servlet-mapping> + <servlet-name>files</servlet-name> + <url-pattern>/files/*</url-pattern> + </servlet-mapping> + + <!-- TAGLIBS --> + <taglib> + <taglib-uri>/WEB-INF/bebop-show.tld</taglib-uri> + <taglib-location>/WEB-INF/bebop-show.tld</taglib-location> + </taglib> + + <taglib> + <taglib-uri>/WEB-INF/bebop-define.tld</taglib-uri> + <taglib-location>/WEB-INF/bebop-define.tld</taglib-location> + </taglib> + +</web-app> Property changes on: trunk/ccm-shortcuts/doc/shortcuts-standalone/web.xml ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-shortcuts/doc/web.xml-shortcuts.in =================================================================== --- trunk/ccm-shortcuts/doc/web.xml-shortcuts.in (rev 0) +++ trunk/ccm-shortcuts/doc/web.xml-shortcuts.in 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,16 @@ +<!-- module ccm-ldn-shortcuts - servlet definitions --> + <servlet> + <servlet-name>shortcuts-files</servlet-name> + <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> + <init-param> + <param-name>template-path</param-name> + <param-value>/templates/ccm-shortcuts</param-value> + </init-param> + </servlet> + +<!-- module ccm-ldn-shortcuts - servlet mappings --> + <servlet-mapping> + <servlet-name>shortcuts-files</servlet-name> + <url-pattern>/ccm-shortcuts/files/*</url-pattern> + </servlet-mapping> + Added: trunk/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcut.pdl =================================================================== --- trunk/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcut.pdl (rev 0) +++ trunk/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcut.pdl 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,28 @@ +// +// Copyright (C) 2001-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 + +model com.arsdigita.shortcuts; + +object type Shortcut { + + BigDecimal[1..1] shortcutID = sc_shortcuts.shortcut_id INTEGER; + String[1..1] urlKey = sc_shortcuts.url_key VARCHAR(1000); + String[1..1] redirect = sc_shortcuts.redirect VARCHAR(1000); + + object key (shortcutID); +} + Property changes on: trunk/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcut.pdl ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcuts.pdl =================================================================== --- trunk/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcuts.pdl (rev 0) +++ trunk/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcuts.pdl 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,27 @@ +// +// Copyright (C) 2001-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 + +model com.arsdigita.shortcuts; + +import com.arsdigita.web.Application; + +object type Shortcuts extends Application { + // nothing to persist + // there is only one instance of shortcuts (the admin application) and + // no instance specific settings to be persisted. + // reference key (sc_app.application_id); +} Property changes on: trunk/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcuts.pdl ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-shortcuts/sql/ccm-shortcuts/default/sequence-ss_shortcuts_seq.sql =================================================================== --- trunk/ccm-shortcuts/sql/ccm-shortcuts/default/sequence-ss_shortcuts_seq.sql (rev 0) +++ trunk/ccm-shortcuts/sql/ccm-shortcuts/default/sequence-ss_shortcuts_seq.sql 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1 @@ +create sequence ss_shortcuts_seq; Property changes on: trunk/ccm-shortcuts/sql/ccm-shortcuts/default/sequence-ss_shortcuts_seq.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-shortcuts/sql/ccm-shortcuts/default/table-sc_shortcuts.sql =================================================================== --- trunk/ccm-shortcuts/sql/ccm-shortcuts/default/table-sc_shortcuts.sql (rev 0) +++ trunk/ccm-shortcuts/sql/ccm-shortcuts/default/table-sc_shortcuts.sql 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,8 @@ +create table sc_shortcuts ( + shortcut_id integer + constraint sc_shortcuts_pk + primary key, + url_key varchar(1000) not null + constraint sc_shortcuts_key_unique unique, + redirect varchar(1000) not null +); Property changes on: trunk/ccm-shortcuts/sql/ccm-shortcuts/default/table-sc_shortcuts.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-shortcuts/sql/ccm-shortcuts/oracle-se-create.sql =================================================================== --- trunk/ccm-shortcuts/sql/ccm-shortcuts/oracle-se-create.sql (rev 0) +++ trunk/ccm-shortcuts/sql/ccm-shortcuts/oracle-se-create.sql 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,4 @@ +@ ddl/oracle-se/create.sql +@ default/table-sc_shortcuts.sql +@ default/sequence-ss_shortcuts_seq.sql +@ ddl/oracle-se/deferred.sql Property changes on: trunk/ccm-shortcuts/sql/ccm-shortcuts/oracle-se-create.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-shortcuts/sql/ccm-shortcuts/postgres-create.sql =================================================================== --- trunk/ccm-shortcuts/sql/ccm-shortcuts/postgres-create.sql (rev 0) +++ trunk/ccm-shortcuts/sql/ccm-shortcuts/postgres-create.sql 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,6 @@ +begin; +\i ddl/postgres/create.sql +\i default/table-sc_shortcuts.sql +\i default/sequence-ss_shortcuts_seq.sql +\i ddl/postgres/deferred.sql +end; Property changes on: trunk/ccm-shortcuts/sql/ccm-shortcuts/postgres-create.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/drop_app_table.sql =================================================================== --- trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/drop_app_table.sql (rev 0) +++ trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/drop_app_table.sql 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,23 @@ +-- +-- Copyright (C) 2011 Peter Boy 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: drop_app_table.sql pboy $ + +-- drops table subsite_app which just contained application type id and is +-- never used for any action. + +drop table sc_app ; Added: trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql =================================================================== --- trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql (rev 0) +++ trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,131 @@ +-- +-- Copyright (C) 2011 Peter Boy. 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: remove_legacy_entries.sql $ + +-- Subsite is now initialized as a legacy free type of application so +-- entries in tables apm_package_types are no longer needed. + + +-- in case there may be several application instances! + +-- delete from object_context all entries referring to node_id in site_nodes +delete from object_context + where object_id in + (select node_id from site_nodes object_id where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%shortcuts.Shortcuts%') + ) + ); + +-- delete from acs_objects all entries referring to node_id in site_nodes +alter table site_nodes drop constraint site_nodes_node_id_f_n1m2y ; +delete from acs_objects + where object_id in + (select node_id from site_nodes where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%shortcuts.Shortcuts%') + ) + ); + +-- delete all entries in site_nodes referring to a subsite instance +delete from site_nodes + where object_id in + (select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%shortcuts.Shortcuts%') + ); +alter table site_nodes add constraint site_nodes_node_id_f_n1m2y + FOREIGN KEY (node_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; + + + +-- delete from object_context all entries referring to package_id in apm_packages +delete from object_context + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like 'com.arsdigita.shortcuts.Shortcuts') + ); + +-- delete from acs_objects all entries referring to package_id in apm_packages +alter table apm_packages drop constraint apm_package_package_id_f_46may ; +alter table applications drop constraint application_package_id_f_cdaho ; +delete from acs_objects + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like 'com.arsdigita.shortcuts.Shortcuts') + ); + +-- delete all entries for subsite instances in apm_packages +-- identified by package_type_id in application_types +delete from apm_packages + where package_type_id = + (select package_type_id from application_types + where object_type + like 'com.arsdigita.shortcuts.Shortcuts') ; + +-- there seem to be no intries for a apm_packages_types entry (row) in +-- acs_objects or object_context! + +-- delete all entries for subsite in apm_package_types identified by +-- package_type_id in application_types +alter table application_types drop constraint applica_typ_pac_typ_id_f_v80ma ; +delete from apm_package_types + where package_type_id = + (select package_type_id from application_types + where object_type + like 'com.arsdigita.shortcuts.Shortcuts') ; + + +-- set package_id to null for all entries referring to a subsite instance +-- (indicating a new legacy free application) +update applications + set package_id = null + where application_type_id = + (select application_type_id from application_types + where object_type + like 'com.arsdigita.shortcuts.Shortcuts') ; + +-- set package_id to null for all entries referring to a subsite instance +-- (indicating a new legacy free application) +update application_types + set package_type_id = null + where object_type like 'com.arsdigita.shortcuts.Shortcuts' ; + +alter table application_types add constraint applica_typ_pac_typ_id_f_v80ma + FOREIGN KEY (package_type_id) + REFERENCES apm_package_types (package_type_id) + MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table applications add constraint application_package_id_f_cdaho + FOREIGN KEY (package_id) + REFERENCES apm_packages (package_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table apm_packages add constraint apm_package_package_id_f_46may + FOREIGN KEY (package_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; Added: trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql =================================================================== --- trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql (rev 0) +++ trunk/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql 2012-01-09 18:51:58 UTC (rev 2269) @@ -0,0 +1,66 @@ +-- +-- Copyright (C) 2011 Peter Boy 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: upd_system_tables.sql pboy $ + +-- adjust various system tables to the new name of application shortcuts + +alter table init_requirements drop constraint init_requirements_init_f_cmmdn ; + +alter table init_requirements drop constraint init_require_requ_init_f_i6rgg ; + +update inits + set class_name=replace(class_name,'london.shortcuts', 'shortcuts') + where class_name like '%london.shortcuts%' ; + +update init_requirements + set init=replace(init,'london.shortcuts', 'shortcuts') + where init like '%london.shortcuts%' ; + +update init_requirements + set required_init=replace(required_init,'london.shortcuts', 'shortcuts') + where required_init like '%london.shortcuts%' ; + +ALTER TABLE ONLY init_requirements + ADD CONSTRAINT init_requirements_init_f_cmmdn FOREIGN KEY (init) + REFERENCES inits (class_name) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION; + +ALTER TABLE init_requirements + ADD CONSTRAINT init_require_... [truncated message content] |
From: <pb...@fe...> - 2012-01-09 18:20:26
|
Author: pboy Date: 2012-01-09 18:20:16 +0000 (Mon, 09 Jan 2012) New Revision: 2268 Added: trunk/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.3-6.6.4.sql trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitTab.java Removed: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql Modified: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.3-6.6.4.sql trunk/ccm-cms/src/ccm-cms.upgrade trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java trunk/ccm-cms/src/com/arsdigita/cms/ContentBundle.java trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java trunk/ccm-cms/src/com/arsdigita/cms/LanguageAwareObjectCopier.java trunk/ccm-cms/src/com/arsdigita/cms/Loader.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSubordinateCollection.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/Paginator.java trunk/ccm-core/src/com/arsdigita/bebop/form/Date.java trunk/ccm-core/src/com/arsdigita/persistence/DataObjectImpl.java Log: Various fixes, improved multilanguage support. Modified: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql 2012-01-09 18:20:16 UTC (rev 2268) @@ -15,11 +15,8 @@ -- 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: upd_table_persons.sql pboy $ +-- $Id: create_orgaunit_hierarchy_map.sql pboy $ --- This update is only applicable for the internal development tree at --- University of Bremen ! Don't use for the APLAWS main trunk on --- fedorahosted! CREATE TABLE cms_organizationalunits_hierarchy_map ( superior_orgaunit_id integer NOT NULL, @@ -29,14 +26,17 @@ subordinate_orgaunit_order integer ); --- No sure how to get db owner here --- ALTER TABLE public.cms_organizationalunits_hierarchy_map OWNER TO iaw; ALTER TABLE ONLY cms_organizationalunits_hierarchy_map - ADD CONSTRAINT cms_org_hie_map_sub_or_p_nykpq PRIMARY KEY (subordinate_orgaunit_id, superior_orgaunit_id); + ADD CONSTRAINT cms_org_hie_map_sub_or_p_nykpq + PRIMARY KEY (subordinate_orgaunit_id, superior_orgaunit_id); ALTER TABLE ONLY cms_organizationalunits_hierarchy_map - ADD CONSTRAINT cms_org_hie_map_sub_or_f_xq5is FOREIGN KEY (subordinate_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); + ADD CONSTRAINT cms_org_hie_map_sub_or_f_xq5is + FOREIGN KEY (subordinate_orgaunit_id) + REFERENCES cms_organizationalunits(organizationalunit_id); ALTER TABLE ONLY cms_organizationalunits_hierarchy_map - ADD CONSTRAINT cms_org_hie_map_sup_or_f_qchkn FOREIGN KEY (superior_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); \ No newline at end of file + ADD CONSTRAINT cms_org_hie_map_sup_or_f_qchkn + FOREIGN KEY (superior_orgaunit_id) + REFERENCES cms_organizationalunits(organizationalunit_id); \ No newline at end of file Deleted: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql 2012-01-09 18:20:16 UTC (rev 2268) @@ -1,32 +0,0 @@ --- --- Copyright (C) 2011 Jens Pelzetter 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: create_publish_lock_table.sql pboy $ - - - -CREATE TABLE cms_publish_lock ( - lock_id integer NOT NULL, - locked_oid character varying(2048), - lock_timestamp timestamp with time zone, - action character varying(256) -); - -ALTER TABLE ONLY cms_publish_lock - ADD CONSTRAINT cms_publis_loc_lock_id_p_8n7d0 PRIMARY KEY (lock_id); - --- ALTER TABLE public.cms_publish_lock OWNER TO ccm; \ No newline at end of file Added: trunk/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.3-6.6.4.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.3-6.6.4.sql (rev 0) +++ trunk/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.3-6.6.4.sql 2012-01-09 18:20:16 UTC (rev 2268) @@ -0,0 +1,24 @@ +-- +-- Copyright (C) 2011 Peter Boy 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.6.2-6.6.3.sql 2011-09-06 15:10:39Z pboy $ + + +PROMPT Red Hat Enterprise CMS 6.6.3 -> 6.6.4 Upgrade Script (Oracle) + +@@ ../default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql +@@ ../default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql Modified: trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.3-6.6.4.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.3-6.6.4.sql 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.3-6.6.4.sql 2012-01-09 18:20:16 UTC (rev 2268) @@ -25,7 +25,7 @@ begin; -\i ../default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql -\i ../default/upgrade/6.6.2-6.6.3/create_publish_lock_table.sql +\i ../default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql +\i ../default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql commit; \ No newline at end of file Modified: trunk/ccm-cms/src/ccm-cms.upgrade =================================================================== --- trunk/ccm-cms/src/ccm-cms.upgrade 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-cms/src/ccm-cms.upgrade 2012-01-09 18:20:16 UTC (rev 2268) @@ -48,7 +48,6 @@ <!-- Nothing to do here --> </version> <version from="6.6.3" to="6.6.4"> - <!-- This update is only applicable for the development tree at UHB! --> <script sql="ccm-cms/upgrade/::database::-6.6.3-6.6.4.sql"/> </version> </upgrade> Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2012-01-09 18:20:16 UTC (rev 2268) @@ -192,7 +192,7 @@ new DHTMLEditorConfigParameter( "com.arsdigita.cms.dhtml_editor_config", Parameter.REQUIRED, - new DHTMLEditor.Config("XinhaConfig", + new DHTMLEditor.Config("Xinha.Config", "/assets/xinha/CCMcmsXinhaConfig.js")); // previous parameter definition: // > DHTMLEditor.Config.STANDARD); < Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentBundle.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentBundle.java 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentBundle.java 2012-01-09 18:20:16 UTC (rev 2268) @@ -392,10 +392,11 @@ instances.addFilter( ff.or().addFilter(ff.equals(LANGUAGE, language)). addFilter(ff.equals(LANGUAGE, "--")));*/ - instances.addFilter(String.format("(%s = '%s' or %s = '--')", + instances.addFilter(String.format("(%s = '%s' or %s = '%s')", LANGUAGE, language, - LANGUAGE)); + LANGUAGE, + GlobalizationHelper.LANG_INDEPENDENT)); } return !instances.isEmpty(); Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java 2012-01-09 18:20:16 UTC (rev 2268) @@ -56,6 +56,7 @@ import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.StringTokenizer; +import org.apache.log4j.Level; /** * <p>A content section represents a collection of content that is @@ -1071,11 +1072,11 @@ ContentSection section = (ContentSection) sections.getDomainObject(); if (sections.isFirst() ) { sections.close(); - s_log.warn("Default section is "+section.getName() ); + s_log.debug("Default section is "+section.getName() ); return section; } else { sections.close(); - s_log.warn("Section found: "+section.getName()+", but not first." ); + s_log.debug("Section found: "+section.getName()+", but not first." ); return null; } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/LanguageAwareObjectCopier.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/LanguageAwareObjectCopier.java 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-cms/src/com/arsdigita/cms/LanguageAwareObjectCopier.java 2012-01-09 18:20:16 UTC (rev 2268) @@ -1,10 +1,14 @@ package com.arsdigita.cms; import com.arsdigita.domain.DomainObject; +import com.arsdigita.globalization.GlobalizationHelper; +import com.arsdigita.kernel.ACSObject; import com.arsdigita.persistence.DataAssociation; import com.arsdigita.persistence.DataAssociationCursor; +import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.metadata.Property; +import java.math.BigDecimal; import org.apache.log4j.Logger; /** @@ -20,9 +24,9 @@ public LanguageAwareObjectCopier(String language) { super(); - this.language = language; + this.language = language; } - + @Override protected void copyCollection(final DomainObject source, final DomainObject target, @@ -36,7 +40,7 @@ final String name = prop.getName(); final DataAssociation sass = (DataAssociation) get(source, name); - final DataAssociationCursor scursor = sass.cursor(); + final DataAssociationCursor scursor = sass.cursor(); final Property reverse = prop.getAssociatedProperty(); while (scursor.next()) { @@ -45,12 +49,12 @@ m_traversed.add(selem, reverse); DomainObject telem = copy(source, target, selem, prop); - if ((telem instanceof ContentPage) - && ((ContentPage) telem).getContentBundle() != null) { + if ((telem instanceof ContentPage) + && ((ContentPage) telem).getContentBundle() != null) { telem = ((ContentPage) telem).getContentBundle().getInstance( language); - } - + } + DataObject tgtLink = null; // removing this assert since copy will return null in the Modified: trunk/ccm-cms/src/com/arsdigita/cms/Loader.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2012-01-09 18:20:16 UTC (rev 2268) @@ -198,7 +198,7 @@ * (e.g. 6.6.1-6.6.2). */ public static ApplicationType loadWorkspaceApplicationType() { - s_log.warn("Creating CMS Workspace..."); + s_log.debug("Creating CMS Workspace..."); // Creating of Workspace package using new style c.ad.web.Application // in legacy compatible mode. Needs refactoring of the Workspace package. @@ -226,7 +226,7 @@ ApplicationType workspaceType = appsetup.run(); workspaceType.save(); - s_log.warn("CMS Workspace type created."); + s_log.debug("CMS Workspace type created."); return workspaceType; } @@ -239,7 +239,7 @@ ApplicationType workspaceType) { // create legacy compatible application instance, // old-style package key used as url fragment where to install the instance - s_log.warn("Creating CMS Workspace instance ..."); + s_log.debug("Creating CMS Workspace instance ..."); Workspace app = (Workspace) Application.createApplication( workspaceType, // type Workspace.PACKAGE_KEY, // url fragment @@ -247,7 +247,7 @@ null); // parent app.setDescription("The default CMS workspace instance."); app.save(); - s_log.warn("CMS Workspace instance " + Workspace.PACKAGE_KEY + " created."); + s_log.debug("CMS Workspace instance " + Workspace.PACKAGE_KEY + " created."); s_log.debug("Done loading CMS Workspace."); } @@ -363,7 +363,7 @@ for (int i = 0 ; i < sectionNames.length ; i++) { final String sectionName = sectionNames[i]; - s_log.warn("Creating content section on /" + sectionName); + s_log.debug("Creating content section on /" + sectionName); // Step 1: Validate name for section Util.validateURLParameter("name", sectionName); Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSubordinateCollection.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSubordinateCollection.java 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSubordinateCollection.java 2012-01-09 18:20:16 UTC (rev 2268) @@ -11,7 +11,7 @@ import java.math.BigDecimal; /** - * + * * @author Jens Pelzetter * @version $Id$ */ Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java 2012-01-09 18:20:16 UTC (rev 2268) @@ -248,7 +248,7 @@ } // Replace all special chars that are not yet replaced with a dash - return out.replaceAll("[^A-Za-z0-9-]", "_"); + return out.replaceAll("[^A-Za-z0-9-]", "_").toLowerCase(); } return in; Added: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitTab.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitTab.java (rev 0) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitTab.java 2012-01-09 18:20:16 UTC (rev 2268) @@ -0,0 +1,34 @@ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; +import com.arsdigita.xml.Element; + +/** + * Interface for a tab rendered by {@link GenericOrgaUnitExtraXmlGenerator}. + * + * @author Jens Pelzetter + * @version $Id: GenericOrgaUnitTab.java 1363 2011-12-16 14:25:19Z jensp $ + */ +public interface GenericOrgaUnitTab { + + /** + * + * @param orgaunit + * @return Returns true if the provided orgaunit has data to show in this + * tab, false otherwise. + */ + boolean hasData(GenericOrganizationalUnit orgaunit); + + /** + * The implementation of this method creates the XML output for the tab. + * + * @param orgaunit The orgaunit which is the source of the data to use + * @param parent parent element for the XML + * @param state The current page state + */ + void generateXml(GenericOrganizationalUnit orgaunit, + Element parent, + PageState state); + +} Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/Paginator.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/Paginator.java 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/Paginator.java 2012-01-09 18:20:16 UTC (rev 2268) @@ -19,6 +19,7 @@ public class Paginator { private static final String PAGE_NUMBER = "pageNumber"; + private static final String PAGE_SIZE = "pageSize"; private final int pageSize; private int pageNumber; private final int objectCount; @@ -44,7 +45,13 @@ logger.debug(String.format("pageNumber = %d", pageNumber)); } this.objectCount = objectCount; - this.pageSize = pageSize; + + if (request.getParameter(PAGE_SIZE) == null) { + this.pageSize = pageSize; + } else { + final String pageSizeStr = request.getParameter(PAGE_SIZE); + this.pageSize = Integer.parseInt(pageSizeStr); + } normalizePageNumber(); } @@ -88,12 +95,8 @@ logger.debug(String.format("Applying limits: %d, %d", getBegin(), - getEnd())); - /*if (getBegin() == getEnd()) { - query.setRange(getBegin(), getEnd() + 1); - } else {*/ - query.setRange(getBegin(), getEnd() + 1); - //} + getEnd())); + query.setRange(getBegin(), getEnd() + 1); } public int getPageCount() { @@ -123,7 +126,7 @@ if (pageNumber == 1) { return 1; } else { - return (pageNumber - 1) * pageSize; + return ((pageNumber - 1) * pageSize) + 1; } } Modified: trunk/ccm-core/src/com/arsdigita/bebop/form/Date.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/bebop/form/Date.java 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-core/src/com/arsdigita/bebop/form/Date.java 2012-01-09 18:20:16 UTC (rev 2268) @@ -59,18 +59,19 @@ protected TextField m_day; private int m_year_begin; private int m_year_end; - private Locale m_locale; + private Locale m_locale; // Inner classes for the fragment widgets protected class YearFragment extends SingleSelect { protected Date parent; - + private boolean autoCurrentYear; //Decide wether to set the current year if year is null + public YearFragment(String name, Date parent) { super(name); this.parent = parent; } - + @Override protected ParameterData getParameterData(PageState ps) { Object value = getValue(ps); @@ -79,6 +80,10 @@ } return new ParameterData(getParameterModel(), value); } + + public void setAutoCurrentYear(final boolean autoCurrentYear) { + this.autoCurrentYear = autoCurrentYear; + } @Override public Object getValue(PageState ps) { @@ -89,7 +94,7 @@ } } Object value = parent.getFragmentValue(ps, Calendar.YEAR); - if (value == null) { + if ((value == null) && autoCurrentYear) { Calendar currentTime = GregorianCalendar.getInstance(); int currentYear = currentTime.get(Calendar.YEAR); value = new Integer(currentYear); @@ -195,6 +200,10 @@ this(new DateParameter(name)); } + public void setAutoCurrentYear(final boolean autoCurrentYear) { + ((YearFragment) m_year).setAutoCurrentYear(autoCurrentYear); + } + public void setYearRange(int yearBegin, int yearEnd) { Assert.isUnlocked(this); if (yearBegin != m_year_begin || yearEnd != m_year_end) { Modified: trunk/ccm-core/src/com/arsdigita/persistence/DataObjectImpl.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/persistence/DataObjectImpl.java 2012-01-09 16:50:14 UTC (rev 2267) +++ trunk/ccm-core/src/com/arsdigita/persistence/DataObjectImpl.java 2012-01-09 18:20:16 UTC (rev 2268) @@ -164,7 +164,7 @@ return m_ssn; } - private com.redhat.persistence.metadata.Property convert(String property) { + private com.redhat.persistence.metadata.Property convert(String property) { return C.prop(m_ssn.getRoot(), getObjectType().getProperty(property)); } @@ -199,9 +199,9 @@ throw new PersistenceException(String.format( "no such property: %s for %s. Available properties: %s", - property.toString(), - this.toString(), - builder.toString())); + property.toString(), + this.toString(), + builder.toString())); } if (prop.isCollection()) { if (isDisconnected()) { @@ -422,7 +422,8 @@ getSsn().flush(); getSsn().assertFlushed(this); } catch (ProtoException pe) { - throw PersistenceException.newInstance(pe); + throw PersistenceException.newInstance( + String.format("on oid '%s'", m_oid.toString()), pe); } } |
From: <pb...@fe...> - 2012-01-09 16:50:35
|
Author: pboy Date: 2012-01-09 16:50:14 +0000 (Mon, 09 Jan 2012) New Revision: 2267 Added: trunk/ccm-cms/pdl/com/arsdigita/content-section/PublishLock.pdl trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.3-6.6.4.sql trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/PublishLock.java Removed: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql Modified: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/upd_table_persons.sql trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.2-6.6.3.sql trunk/ccm-cms/src/ccm-cms.upgrade trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminPane.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java Log: Improved lifecycle handling (separate thread for publishing process), new configuration parameter com.arsdigita.cms.lifecyle.threaded_publishing=false|true to enable new behaviour, update script ccm-cms 6.6.2-6-6-3 required. Added: trunk/ccm-cms/pdl/com/arsdigita/content-section/PublishLock.pdl =================================================================== --- trunk/ccm-cms/pdl/com/arsdigita/content-section/PublishLock.pdl (rev 0) +++ trunk/ccm-cms/pdl/com/arsdigita/content-section/PublishLock.pdl 2012-01-09 16:50:14 UTC (rev 2267) @@ -0,0 +1,14 @@ +model com.arsdigita.cms; + +import com.arsdigita.kernel.*; + +object type PublishLock { + + BigDecimal[1..1] id = cms_publish_lock.lock_id INTEGER; + String[0..1] lockedOid = cms_publish_lock.locked_oid VARCHAR(2048); + Date[0..1] timestamp = cms_publish_lock.lock_timestamp TIMESTAMP; + String[0..1] action = cms_publish_lock.action VARCHAR(256); + + object key(id); + +} \ No newline at end of file Deleted: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql 2012-01-09 16:50:14 UTC (rev 2267) @@ -1,42 +0,0 @@ --- --- Copyright (C) 2011 Jens Pelzetter 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: upd_table_persons.sql pboy $ - --- This update is only applicable for the internal development tree at --- University of Bremen ! Don't use for the APLAWS main trunk on --- fedorahosted! - -CREATE TABLE cms_organizationalunits_hierarchy_map ( - superior_orgaunit_id integer NOT NULL, - subordinate_orgaunit_id integer NOT NULL, - assoc_type character varying(128), - superior_orgaunit_order integer, - subordinate_orgaunit_order integer -); - --- No sure how to get db owner here --- ALTER TABLE public.cms_organizationalunits_hierarchy_map OWNER TO iaw; - -ALTER TABLE ONLY cms_organizationalunits_hierarchy_map - ADD CONSTRAINT cms_org_hie_map_sub_or_p_nykpq PRIMARY KEY (subordinate_orgaunit_id, superior_orgaunit_id); - -ALTER TABLE ONLY cms_organizationalunits_hierarchy_map - ADD CONSTRAINT cms_org_hie_map_sub_or_f_xq5is FOREIGN KEY (subordinate_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); - -ALTER TABLE ONLY cms_organizationalunits_hierarchy_map - ADD CONSTRAINT cms_org_hie_map_sup_or_f_qchkn FOREIGN KEY (superior_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); \ No newline at end of file Modified: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/upd_table_persons.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/upd_table_persons.sql 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/upd_table_persons.sql 2012-01-09 16:50:14 UTC (rev 2267) @@ -26,23 +26,3 @@ ALTER TABLE cms_persons ADD COLUMN dabin_id INTEGER; - -CREATE TABLE cms_organizationalunits_hierarchy_map ( - superior_orgaunit_id integer NOT NULL, - subordinate_orgaunit_id integer NOT NULL, - assoc_type character varying(128), - superior_orgaunit_order integer, - subordinate_orgaunit_order integer -); - --- No sure how to get db owner here -ALTER TABLE public.cms_organizationalunits_hierarchy_map OWNER TO iaw; - -ALTER TABLE ONLY cms_organizationalunits_hierarchy_map - ADD CONSTRAINT cms_org_hie_map_sub_or_p_nykpq PRIMARY KEY (subordinate_orgaunit_id, superior_orgaunit_id); - -ALTER TABLE ONLY cms_organizationalunits_hierarchy_map - ADD CONSTRAINT cms_org_hie_map_sub_or_f_xq5is FOREIGN KEY (subordinate_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); - -ALTER TABLE ONLY cms_organizationalunits_hierarchy_map - ADD CONSTRAINT cms_org_hie_map_sup_or_f_qchkn FOREIGN KEY (superior_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); \ No newline at end of file Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql (rev 0) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_orgaunit_hierarchy_table.sql 2012-01-09 16:50:14 UTC (rev 2267) @@ -0,0 +1,42 @@ +-- +-- Copyright (C) 2011 Jens Pelzetter 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: upd_table_persons.sql pboy $ + +-- This update is only applicable for the internal development tree at +-- University of Bremen ! Don't use for the APLAWS main trunk on +-- fedorahosted! + +CREATE TABLE cms_organizationalunits_hierarchy_map ( + superior_orgaunit_id integer NOT NULL, + subordinate_orgaunit_id integer NOT NULL, + assoc_type character varying(128), + superior_orgaunit_order integer, + subordinate_orgaunit_order integer +); + +-- No sure how to get db owner here +-- ALTER TABLE public.cms_organizationalunits_hierarchy_map OWNER TO iaw; + +ALTER TABLE ONLY cms_organizationalunits_hierarchy_map + ADD CONSTRAINT cms_org_hie_map_sub_or_p_nykpq PRIMARY KEY (subordinate_orgaunit_id, superior_orgaunit_id); + +ALTER TABLE ONLY cms_organizationalunits_hierarchy_map + ADD CONSTRAINT cms_org_hie_map_sub_or_f_xq5is FOREIGN KEY (subordinate_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); + +ALTER TABLE ONLY cms_organizationalunits_hierarchy_map + ADD CONSTRAINT cms_org_hie_map_sup_or_f_qchkn FOREIGN KEY (superior_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); \ No newline at end of file Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql (rev 0) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.3-6.6.4/create_publish_lock_table.sql 2012-01-09 16:50:14 UTC (rev 2267) @@ -0,0 +1,32 @@ +-- +-- Copyright (C) 2011 Jens Pelzetter 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: create_publish_lock_table.sql pboy $ + + + +CREATE TABLE cms_publish_lock ( + lock_id integer NOT NULL, + locked_oid character varying(2048), + lock_timestamp timestamp with time zone, + action character varying(256) +); + +ALTER TABLE ONLY cms_publish_lock + ADD CONSTRAINT cms_publis_loc_lock_id_p_8n7d0 PRIMARY KEY (lock_id); + +-- ALTER TABLE public.cms_publish_lock OWNER TO ccm; \ No newline at end of file Modified: trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.2-6.6.3.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.2-6.6.3.sql 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.2-6.6.3.sql 2012-01-09 16:50:14 UTC (rev 2267) @@ -27,5 +27,6 @@ \i ../default/upgrade/6.6.2-6.6.3/upd_table_persons.sql \i ../default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql +\i ../default/upgrade/6.6.2-6.6.3/create_publish_lock_table.sql commit; Added: trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.3-6.6.4.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.3-6.6.4.sql (rev 0) +++ trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.3-6.6.4.sql 2012-01-09 16:50:14 UTC (rev 2267) @@ -0,0 +1,31 @@ +-- +-- Copyright (C) 2011 Peter Boy 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 +-- +-- $DateTime: 2011/09/06 23:15:09 $ + +-- This update is only applicable for the internal development tree at +-- University of Bremen ! Don't use for the APLAWS main trunk on +-- fedorahosted! + +\echo ScientificCMS 6.6.3 -> 6.6.4 Upgrade Script (PostgreSQL) + +begin; + +\i ../default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql +\i ../default/upgrade/6.6.2-6.6.3/create_publish_lock_table.sql + +commit; \ No newline at end of file Modified: trunk/ccm-cms/src/ccm-cms.upgrade =================================================================== --- trunk/ccm-cms/src/ccm-cms.upgrade 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/src/ccm-cms.upgrade 2012-01-09 16:50:14 UTC (rev 2267) @@ -47,4 +47,8 @@ <!-- This update is only applicable for the development tree at UHB! --> <!-- Nothing to do here --> </version> + <version from="6.6.3" to="6.6.4"> + <!-- This update is only applicable for the development tree at UHB! --> + <script sql="ccm-cms/upgrade/::database::-6.6.3-6.6.4.sql"/> + </version> </upgrade> Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2012-01-09 16:50:14 UTC (rev 2267) @@ -587,6 +587,19 @@ "com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane", Parameter.REQUIRED, false); + + //////////////////////////////////////////////// + //Actives threaded publishing. If active, the publish process for + //content items will run in a separate thread. May useful if you have + //large objects. + // + //WARNING: Not tested very much. Use at your own risk. + // + //////////////////////////////////////////////////// + private final Parameter m_threadPublishing = new BooleanParameter( + "com.arsdigita.cms.lifecycle.threaded_publishing", + Parameter.REQUIRED, + false); // /////////////////////////////////////////// // publishToFile package related parameter @@ -651,7 +664,7 @@ register(m_categoryTreeOrdering); register(m_hasContactsAuthoringStep); register(m_hideTextAssetUploadFile); - register(m_allowContentCreateInSectionListing); + register(m_allowContentCreateInSectionListing); // Content Center (Workspace) config related parameters register(m_contentCenterMap); @@ -667,8 +680,9 @@ register(m_folderBrowseListSize); register(m_folderAtoZShowLimit); - + register(m_useOldStyleItemLifecycleItemPane); + register(m_threadPublishing); // publishToFile package related parameter // Moved to publishToFile.PublishToFileConfig as of version 6.0.2 @@ -1067,8 +1081,12 @@ public Integer getFolderAtoZShowLimit() { return (Integer) get(m_folderAtoZShowLimit); } - + public Boolean getUseOldStyleItemLifecycleItemPane() { return (Boolean) get(m_useOldStyleItemLifecycleItemPane); } + + public Boolean getThreadedPublishing() { + return (Boolean) get(m_threadPublishing); + } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties 2012-01-09 16:50:14 UTC (rev 2267) @@ -254,6 +254,11 @@ com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane.example = false com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane.format = [Boolean] +com.arsdigita.cms.lifecycle.threaded_publishing.title = Threaded publishing +com.arsdigita.cms.lifecycle.threaded_publishing.purpose = Decides if publishing is done in a thread (new behaviour) or directly (old, well tested behaviour). +com.arsdigita.cms.lifecycle.threaded_publishing.example = false +com.arsdigita.cms.lifecycle.threaded_com.arsdigita.cms.lifecycle.threaded_publishingpublishing.format = [Boolean] + com.arsdigita.cms.xx.title= com.arsdigita.cms.xx.purpose= com.arsdigita.cms.xx.example= Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties 2012-01-09 16:50:14 UTC (rev 2267) @@ -1087,3 +1087,5 @@ cms.contenttypes.person.alias.select.no_suitable_language_variant=The selected item has no suitable language variant. cms.ui.item.lifecycle.do=Execute cms.ui.item.lifecycle.do.not_authorized=Your not authorized to publish this item. +cms.ui.item.lifecycle.publish_locked=This content item is being (re-)published +cms.ui.item.lifecycle.publish_locked.update=Update Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties 2012-01-09 16:50:14 UTC (rev 2267) @@ -1078,3 +1078,5 @@ cms.contenttypes.person.alias.select.no_suitable_language_variant=Das ausgew\u00e4hlte Item hat keine passende Sprachvariante. cms.ui.item.lifecycle.do=Ausf\u00fchren cms.ui.item.lifecycle.do.not_authorized=Sie sind nicht berechtigt, dieses Item zu publizieren. +cms.ui.item.lifecycle.publish_locked=Dieses Content-Item wird gerade (re-)publiziert +cms.ui.item.lifecycle.publish_locked.update=Aktualisieren Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties 2012-01-09 16:50:14 UTC (rev 2267) @@ -26,3 +26,5 @@ cms.contenttypes.person.alias.select.no_suitable_language_variant= cms.ui.item.lifecycle.do= cms.ui.item.lifecycle.do.not_authorized= +cms.ui.item.lifecycle.publish_locked= +cms.ui.item.lifecycle.publish_locked.update= Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties 2012-01-09 16:50:14 UTC (rev 2267) @@ -557,3 +557,5 @@ cms.contenttypes.person.alias.select.no_suitable_language_variant= cms.ui.item.lifecycle.do= cms.ui.item.lifecycle.do.not_authorized= +cms.ui.item.lifecycle.publish_locked= +cms.ui.item.lifecycle.publish_locked.update= Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminPane.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminPane.java 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminPane.java 2012-01-09 16:50:14 UTC (rev 2267) @@ -18,36 +18,41 @@ */ package com.arsdigita.cms.ui.lifecycle; +import com.arsdigita.bebop.ControlLink; 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.cms.CMS; +import com.arsdigita.cms.CMSConfig; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.lifecycle.Lifecycle; import com.arsdigita.cms.ui.BaseItemPane; +import com.arsdigita.cms.ui.ContentItemPage; import com.arsdigita.cms.ui.item.ContentItemRequestLocal; import com.arsdigita.toolbox.ui.LayoutPanel; +import com.arsdigita.web.RedirectSignal; +import com.arsdigita.web.URL; import org.apache.log4j.Logger; /** * @author Michael Pih * @author Jack Chung * @author Justin Ross <jr...@re...> + * @author Jens Pelzetter je...@jp... * @version $Id$ */ public class ItemLifecycleAdminPane extends BaseItemPane { - private static final Logger s_log = Logger.getLogger - (ItemLifecycleAdminPane.class); - + private static final Logger s_log = Logger.getLogger( + ItemLifecycleAdminPane.class); private final ContentItemRequestLocal m_item; private final LifecycleRequestLocal m_lifecycle; - private final LayoutPanel m_introPane; private final LayoutPanel m_detailPane; private final LayoutPanel m_selectPane; + private final LayoutPanel m_lockedPane; public ItemLifecycleAdminPane(final ContentItemRequestLocal item) { m_item = item; @@ -63,20 +68,43 @@ add(m_detailPane); final ItemLifecycleItemPane itemPane = - new ItemLifecycleItemPane(m_item, m_lifecycle); + new ItemLifecycleItemPane(m_item, + m_lifecycle); m_detailPane.setBody(itemPane); m_selectPane = new LayoutPanel(); add(m_selectPane); final ItemLifecycleSelectForm selectForm = - new ItemLifecycleSelectForm(m_item); + new ItemLifecycleSelectForm(m_item); m_selectPane.setBody(selectForm); + m_lockedPane = new LayoutPanel(); + add(m_lockedPane); + + final Label lockedMsg = new Label(gz( + "cms.ui.item.lifecycle.publish_locked")); + m_lockedPane.setBody(lockedMsg); + final ControlLink lockedUpdateLink = new ControlLink(new Label(gz( + "cms.ui.item.lifecycle.publish_locked.update"))); + lockedUpdateLink.addActionListener(new ActionListener() { + + public void actionPerformed(final ActionEvent event) { + throw new RedirectSignal( + URL.getDispatcherPath() + + ContentItemPage.getItemURL( + item.getContentItem(event.getPageState()), + ContentItemPage.PUBLISHING_TAB), + true); + } + }); + m_lockedPane.setBottom(lockedUpdateLink); + connect(selectForm, m_detailPane); } private class ItemLifecycleRequestLocal extends LifecycleRequestLocal { + protected final Object initialValue(final PageState state) { final ContentItem item = m_item.getContentItem(state); final Lifecycle lifecycle = item.getLifecycle(); @@ -94,20 +122,27 @@ } private class VisibilityListener implements ActionListener { + public final void actionPerformed(final ActionEvent e) { s_log.debug("Determining which pane to show"); final PageState state = e.getPageState(); - if (state.isVisibleOnPage(ItemLifecycleAdminPane.this)) { - if (m_lifecycle.getLifecycle(state) == null) { - if (hasPermission(state)) { - push(state, m_selectPane); + if (CMSConfig.getInstance().getThreadedPublishing() + && PublishLock.getInstance().isLocked(m_item.getContentItem( + state))) { + push(state, m_lockedPane); + } else { + if (state.isVisibleOnPage(ItemLifecycleAdminPane.this)) { + if (m_lifecycle.getLifecycle(state) == null) { + if (hasPermission(state)) { + push(state, m_selectPane); + } else { + push(state, m_introPane); + } } else { - push(state, m_introPane); + push(state, m_detailPane); } - } else { - push(state, m_detailPane); } } } @@ -116,7 +151,7 @@ private boolean hasPermission(final PageState state) { final ContentItem item = m_item.getContentItem(state); - return CMS.getContext().getSecurityManager().canAccess - (state.getRequest(), SCHEDULE_PUBLICATION, item); + return CMS.getContext().getSecurityManager().canAccess( + state.getRequest(), SCHEDULE_PUBLICATION, item); } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java 2012-01-09 16:50:14 UTC (rev 2267) @@ -42,6 +42,7 @@ import com.arsdigita.bebop.form.SingleSelect; import com.arsdigita.bebop.form.Submit; import com.arsdigita.cms.CMS; +import com.arsdigita.cms.CMSConfig; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.SecurityManager; @@ -50,6 +51,8 @@ import com.arsdigita.cms.ui.BaseItemPane; import com.arsdigita.cms.ui.ContentItemPage; import com.arsdigita.cms.ui.item.ContentItemRequestLocal; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.persistence.OID; import com.arsdigita.toolbox.ui.ActionGroup; import com.arsdigita.toolbox.ui.PropertyList; import com.arsdigita.toolbox.ui.Section; @@ -71,6 +74,7 @@ * @author Jack Chung * @author Xixi D'Moon <xd...@re...> * @author Justin Ross <jr...@re...> + * @author Jens Pelzetter je...@jp... * @version $Id$ */ class ItemLifecycleItemPane extends BaseItemPane { @@ -235,14 +239,62 @@ final PageState state = e.getPageState(); final ContentItem item = m_item.getContentItem(state); - republish(item, false); - if (ContentSection.getConfig().getUseStreamlinedCreation()) { + /* + * jensp 2011-12-14: Check is threaded publishing is active. If + * yes, execute publishing in a thread. + */ + if (CMSConfig.getInstance().getThreadedPublishing()) { + final Republisher republisher = new Republisher(item); + final Thread thread = new Thread(republisher); + + thread.start(); + throw new RedirectSignal( - URL.there(state.getRequest(), - Utilities.getWorkspaceURL()), true); + URL.getDispatcherPath() + + ContentItemPage.getItemURL(item, + ContentItemPage.PUBLISHING_TAB), + true); + /* + * jensp 2011-12-14 end + */ + } else { + republish(item, false); + if (ContentSection.getConfig().getUseStreamlinedCreation()) { + throw new RedirectSignal( + URL.there(state.getRequest(), + Utilities.getWorkspaceURL()), true); + } } } } + + /** + * @author Jens Pelzetter + */ + private class Republisher implements Runnable { + + /** + * Saves OID of item as a string. This is necessary because it is + * not possible to access to same data object instance from + * multiple threads. So we have to create a new instance a the + * data object in the run method. To avoid any sort a problems, + * we store the OID as a string and convert it back to an OID in + * the run method. + */ + private final String itemOid; + + private Republisher(final ContentItem item) { + itemOid = item.getOID().toString(); + } + + public void run() { + final ContentItem item = (ContentItem) DomainObjectFactory. + newInstance(OID.valueOf(itemOid)); + PublishLock.getInstance().lock(item); + republish(item, false); + PublishLock.getInstance().unlock(item); + } + } } private class RepublishAndResetLink extends PublishLink { @@ -263,14 +315,62 @@ final PageState state = e.getPageState(); final ContentItem item = m_item.getContentItem(state); - republish(item, true); - if (ContentSection.getConfig().getUseStreamlinedCreation()) { + /** + * jensp 2011-12-14: Execute is a thread if + * threaded publishing is active. + */ + if (CMSConfig.getInstance().getThreadedPublishing()) { + final Republisher republisher = new Republisher(item); + final Thread thread = new Thread(republisher); + + thread.start(); + throw new RedirectSignal( - URL.there(state.getRequest(), - Utilities.getWorkspaceURL()), true); + URL.getDispatcherPath() + + ContentItemPage.getItemURL(item, + ContentItemPage.PUBLISHING_TAB), + true); + } else { + /** + * jensp 2011-12-14 end + */ + republish(item, true); + if (ContentSection.getConfig().getUseStreamlinedCreation()) { + throw new RedirectSignal( + URL.there(state.getRequest(), + Utilities.getWorkspaceURL()), true); + } } } } + + /** + * @author Jens Pelzetter + */ + private class Republisher implements Runnable { + + /** + * Saves OID of item as a string. This is necessary because it is + * not possible to access to same data object instance from + * multiple threads. So we have to create a new instance a the + * data object in the run method. To avoid any sort a problems, + * we store the OID as a string and convert it back to an OID in + * the run method. + */ + private final String itemOid; + + private Republisher(final ContentItem item) { + itemOid = item.getOID().toString(); + } + + public void run() { + final ContentItem item = (ContentItem) DomainObjectFactory. + newInstance(OID.valueOf(itemOid)); + PublishLock.getInstance().lock(item); + republish(item, true); + PublishLock.getInstance().unlock(item); + } + } } private class PhaseSection extends Section { @@ -298,6 +398,12 @@ } } + /** + * New style pane. Uses a select box for the action to avoid wrong clicks + * on unpublish. + * + * @author Jens Pelzetter + */ private class ActionForm extends Form implements FormProcessListener, @@ -367,21 +473,53 @@ String selected = (String) data.get(LIFECYCLE_ACTION); final ContentItem item = m_item.getContentItem(state); + /** + * Republish/Republish and Reset are executed in the thread + * if threaded publishing is active. + */ if (REPUBLISH.equals(selected)) { - republish(item, false); + if (CMSConfig.getInstance().getThreadedPublishing()) { + final RepublishRunner runner = new RepublishRunner(item); + final Thread thread = new Thread(runner); - if (ContentSection.getConfig().getUseStreamlinedCreation()) { + thread.start(); + throw new RedirectSignal( - URL.there(state.getRequest(), - Utilities.getWorkspaceURL()), true); + URL.getDispatcherPath() + + ContentItemPage.getItemURL(item, + ContentItemPage.PUBLISHING_TAB), + true); + } else { + republish(item, false); + + if (ContentSection.getConfig().getUseStreamlinedCreation()) { + throw new RedirectSignal( + URL.there(state.getRequest(), + Utilities.getWorkspaceURL()), true); + } } } else if (REPUBLISH_AND_RESET.equals(selected)) { - republish(item, true); + if (CMSConfig.getInstance().getThreadedPublishing()) { + final RepublishAndResetRunner runner = + new RepublishAndResetRunner( + item); + final Thread thread = new Thread(runner); - if (ContentSection.getConfig().getUseStreamlinedCreation()) { + thread.start(); + throw new RedirectSignal( - URL.there(state.getRequest(), - Utilities.getWorkspaceURL()), true); + URL.getDispatcherPath() + + ContentItemPage.getItemURL(item, + ContentItemPage.PUBLISHING_TAB), + true); + } else { + republish(item, true); + + if (ContentSection.getConfig().getUseStreamlinedCreation()) { + throw new RedirectSignal( + URL.there(state.getRequest(), + Utilities.getWorkspaceURL()), true); + } } } else if (UNPUBLISH.equals(selected)) { item.unpublish(); @@ -389,5 +527,67 @@ throw new IllegalArgumentException("Illegal selection"); } } + + private class RepublishRunner implements Runnable { + + /** + * Saves OID of item as a string. This is necessary because it is + * not possible to access to same data object instance from + * multiple threads. So we have to create a new instance a the + * data object in the run method. To avoid any sort a problems, + * we store the OID as a string and convert it back to an OID in + * the run method. + */ + private final String itemOid; + + private RepublishRunner(final ContentItem item) { + itemOid = item.getOID().toString(); + } + + private void doRepublish() { + final ContentItem item = (ContentItem) DomainObjectFactory. + newInstance(OID.valueOf(itemOid)); + republish(item, false); + } + + public void run() { + final ContentItem item = (ContentItem) DomainObjectFactory. + newInstance(OID.valueOf(itemOid)); + PublishLock.getInstance().lock(item); + doRepublish(); + PublishLock.getInstance().unlock(item); + } + } + + private class RepublishAndResetRunner implements Runnable { + + /** + * Saves OID of item as a string. This is necessary because it is + * not possible to access to same data object instance from + * multiple threads. So we have to create a new instance a the + * data object in the run method. To avoid any sort a problems, + * we store the OID as a string and convert it back to an OID in + * the run method. + */ + private final String itemOid; + + private RepublishAndResetRunner(final ContentItem item) { + itemOid = item.getOID().toString(); + } + + private void doRepublishAndReset() { + final ContentItem item = (ContentItem) DomainObjectFactory. + newInstance(OID.valueOf(itemOid)); + republish(item, true); + } + + public void run() { + final ContentItem item = (ContentItem) DomainObjectFactory. + newInstance(OID.valueOf(itemOid)); + PublishLock.getInstance().lock(item); + doRepublishAndReset(); + PublishLock.getInstance().unlock(item); + } + } } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java 2012-01-09 01:57:11 UTC (rev 2266) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java 2012-01-09 16:50:14 UTC (rev 2267) @@ -50,6 +50,7 @@ import com.arsdigita.bebop.parameters.IntegerParameter; import com.arsdigita.bebop.parameters.NumberInRangeValidationListener; import com.arsdigita.cms.CMS; +import com.arsdigita.cms.CMSConfig; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ContentTypeLifecycleDefinition; @@ -61,6 +62,7 @@ import com.arsdigita.cms.lifecycle.PhaseCollection; import com.arsdigita.cms.lifecycle.PhaseDefinitionCollection; import com.arsdigita.cms.ui.BaseForm; +import com.arsdigita.cms.ui.ContentItemPage; import com.arsdigita.cms.ui.item.ContentItemRequestLocal; import com.arsdigita.cms.ui.item.ItemWorkflowRequestLocal; import com.arsdigita.cms.ui.workflow.WorkflowRequestLocal; @@ -68,8 +70,9 @@ import com.arsdigita.cms.workflow.CMSEngine; import com.arsdigita.cms.workflow.CMSTask; import com.arsdigita.cms.workflow.CMSTaskType; +import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.kernel.User; -import com.arsdigita.util.Assert; +import com.arsdigita.persistence.OID; import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.web.RedirectSignal; import com.arsdigita.web.URL; @@ -85,22 +88,20 @@ * @author Michael Pih * @author Xixi D'moon <xd...@re...> * @author Justin Ross <jr...@re...> + * @author Jens Pelzetter je...@jp... * @version $Id$ */ class ItemLifecycleSelectForm extends BaseForm { - private static final Logger s_log = Logger.getLogger - (ItemLifecycleSelectForm.class); - - private final static String LIFECYCLE = "lifecycle"; + private static final Logger s_log = + Logger.getLogger(ItemLifecycleSelectForm.class); + private final static String LIFECYCLE = "lifecycle"; private final static String START_DATE = "start_date"; - private final static String END_DATE = "end_date"; - private final static String NOTIFICATION_DAYS = "notifyDays"; - private final static String NOTIFICATION_HOURS = "notifyHours"; - + private final static String END_DATE = "end_date"; + private final static String NOTIFICATION_DAYS = "notifyDays"; + private final static String NOTIFICATION_HOURS = "notifyHours"; private final ContentItemRequestLocal m_item; private final WorkflowRequestLocal m_workflow; - // Form widgets private final SingleSelect m_cycleSelect; private final Date m_startDate; @@ -130,16 +131,17 @@ // Start date - m_startDate = new Date(new DateParameter(START_DATE) { - protected final Calendar getCalendar - (final HttpServletRequest sreq) { - final Calendar cal = super.getCalendar(sreq); + m_startDate = + new Date(new DateParameter(START_DATE) { - cal.setLenient(false); + protected final Calendar getCalendar(final HttpServletRequest sreq) { + final Calendar cal = super.getCalendar(sreq); - return cal; - } - }); + cal.setLenient(false); + + return cal; + } + }); addField(gz("cms.ui.item.lifecycle.start_date"), m_startDate); // Start time @@ -153,8 +155,8 @@ startTime.add(m_startHour); m_startHour.setSize(3); - m_startHour.addValidationListener - (new NumberInRangeValidationListener(1, 12)); + m_startHour.addValidationListener( + new NumberInRangeValidationListener(1, 12)); // Minute @@ -162,8 +164,8 @@ startTime.add(m_startMinute); m_startMinute.setSize(3); - m_startMinute.addValidationListener - (new NumberInRangeValidationListener(0, 59)); + m_startMinute.addValidationListener(new NumberInRangeValidationListener( + 0, 59)); // AM/PM @@ -179,16 +181,17 @@ // Expiration date - m_endDate = new Date(new DateParameter(END_DATE) { - protected final Calendar getCalendar - (final HttpServletRequest sreq) { - final Calendar cal = super.getCalendar(sreq); + m_endDate = + new Date(new DateParameter(END_DATE) { - cal.setLenient(false); + protected final Calendar getCalendar(final HttpServletRequest sreq) { + final Calendar cal = super.getCalendar(sreq); - return cal; - } - }); + cal.setLenient(false); + + return cal; + } + }); addField(gz("cms.ui.item.lifecycle.end_date"), m_endDate); // End time @@ -202,8 +205,8 @@ endTime.add(m_endHour); m_endHour.setSize(3); - m_endHour.addValidationListener - (new NumberInRangeValidationListener(1, 12)); + m_endHour.addValidationListener(new NumberInRangeValidationListener(1, + 12)); // Minute @@ -211,8 +214,8 @@ endTime.add(m_endMinute); m_endMinute.setSize(3); - m_endMinute.addValidationListener - (new NumberInRangeValidationListener(0, 59)); + m_endMinute.addValidationListener( + new NumberInRangeValidationListener(0, 59)); // AM/PM @@ -226,16 +229,18 @@ m_notificationDays = - new TextField(new IntegerParameter(NOTIFICATION_DAYS)); + new TextField(new IntegerParameter(NOTIFICATION_DAYS)); m_notificationDays.setSize(4); m_notificationHours = - new TextField(new IntegerParameter(NOTIFICATION_HOURS)); + new TextField(new IntegerParameter(NOTIFICATION_HOURS)); m_notificationHours.setSize(4); SimpleContainer cont = new SimpleContainer(); cont.add(m_notificationDays); - cont.add(new Label(GlobalizationUtil.globalize("cms.ui.item.days"), false)); + cont.add(new Label(GlobalizationUtil.globalize("cms.ui.item.days"), + false)); cont.add(m_notificationHours); - cont.add(new Label(GlobalizationUtil.globalize("cms.ui.item.hours"), false)); + cont.add(new Label(GlobalizationUtil.globalize("cms.ui.item.hours"), + false)); addField(gz("cms.ui.item.notification_period"), cont); @@ -254,12 +259,13 @@ } private class OptionPrinter implements PrintListener { + public final void prepare(final PrintEvent e) { final ContentSection section = - CMS.getContext().getContentSection(); + CMS.getContext().getContentSection(); final LifecycleDefinitionCollection ldc = - section.getLifecycleDefinitions(); + section.getLifecycleDefinitions(); ldc.addOrder("label"); final SingleSelect target = (SingleSelect) e.getTarget(); @@ -273,9 +279,8 @@ // ready to be applied to an item. if (!pdc.isEmpty()) { - target.addOption - (new Option(ld.getID().toString(), - ld.getLabel())); + target.addOption(new Option(ld.getID().toString(), + ld.getLabel())); } pdc.close(); @@ -286,6 +291,7 @@ } private class InitListener implements FormInitListener { + public final void init(final FormSectionEvent e) { final PageState state = e.getPageState(); @@ -296,16 +302,17 @@ // associated lifecycle. final LifecycleDefinition ld = - item.getLifecycle().getLifecycleDefinition(); + item.getLifecycle(). + getLifecycleDefinition(); m_cycleSelect.setValue(state, ld.getID()); } else { // Set the default lifecycle (if it exists). final ContentSection section = - CMS.getContext().getContentSection(); + CMS.getContext().getContentSection(); final LifecycleDefinition ld = - ContentTypeLifecycleDefinition.getLifecycleDefinition - (section, item.getContentType()); + ContentTypeLifecycleDefinition. + getLifecycleDefinition(section, item.getContentType()); if (ld != null) { m_cycleSelect.setValue(state, ld.getID()); @@ -315,8 +322,8 @@ // Set the default start date. // XXX Isn't just new Date() sufficient? - final java.util.Date start = new java.util.Date - (System.currentTimeMillis()); + final java.util.Date start = new java.util.Date(System. + currentTimeMillis()); m_startDate.setValue(state, start); final Calendar calendar = Calendar.getInstance(); @@ -329,8 +336,8 @@ if (calendar.get(Calendar.HOUR) == 0) { m_startHour.setValue(state, new Integer(12)); } else { - m_startHour.setValue - (state, new Integer(calendar.get(Calendar.HOUR))); + m_startHour.setValue(state, new Integer(calendar.get( + Calendar.HOUR))); } final Integer min = new Integer(calendar.get(Calendar.MINUTE)); @@ -341,63 +348,289 @@ m_startMinute.setValue(state, min.toString()); } - m_startAmpm.setValue - (state, new Integer(calendar.get(Calendar.AM_PM))); + m_startAmpm.setValue(state, + new Integer(calendar.get(Calendar.AM_PM))); - BigInteger [] defaultTime = - BigInteger.valueOf(ContentSection. - getConfig().getDefaultNotificationTime()). - divideAndRemainder(BigInteger.valueOf(24)); + BigInteger[] defaultTime = + BigInteger.valueOf(ContentSection.getConfig(). + getDefaultNotificationTime()). + divideAndRemainder(BigInteger.valueOf(24)); - m_notificationDays. - setValue(state, new Integer(defaultTime[0].intValue())); - m_notificationHours. - setValue(state, new Integer(defaultTime[1].intValue())); + m_notificationDays.setValue(state, new Integer(defaultTime[0]. + intValue())); + m_notificationHours.setValue(state, new Integer(defaultTime[1]. + intValue())); } } + /** + * jensp 2011-12-14: Some larger changes to the behavior of the + * process listener. The real action has been moved to the + * @link{Publisher} class. If threaded publishing is active, the publish + * process runs in a separate thread (the item is locked before using + * {@link PublishLock}. If threaded publishing is not active, nothing + * has changed. + */ private class ProcessListener implements FormProcessListener { + public final void process(final FormSectionEvent e) - throws FormProcessException { + throws FormProcessException { final PageState state = e.getPageState(); + final ContentItem item = m_item.getContentItem(state); - final Integer startHour = (Integer) m_startHour.getValue(state); + final Publisher publisher = new Publisher(state); + if (CMSConfig.getInstance().getThreadedPublishing()) { + final Runnable threadAction = new Runnable() { + + public void run() { + PublishLock.getInstance().lock(item); + publisher.publish(); + PublishLock.getInstance().unlock(item); + } + }; + final Thread thread = new Thread(threadAction); + thread.start(); + } else { + publisher.publish(); + } + + if (CMSConfig.getInstance().getThreadedPublishing()) { + throw new RedirectSignal( + URL.getDispatcherPath() + + ContentItemPage.getItemURL(item, + ContentItemPage.PUBLISHING_TAB), + true); + } else { + if (ContentSection.getConfig().getUseStreamlinedCreation()) { + throw new RedirectSignal( + URL.there(state.getRequest(), + Utilities.getWorkspaceURL()), + true); + } + } + + /*final Integer startHour = (Integer) m_startHour.getValue(state); Integer startMinute = (Integer) m_startMinute.getValue(state); - + if (startMinute == null) { - startMinute = new Integer(0); + startMinute = new Integer(0); } - + final Integer startAmpm = (Integer) m_startAmpm.getValue(state); - + final Integer endHour = (Integer) m_endHour.getValue(state); Integer endMinute = (Integer) m_endMinute.getValue(state); - + if (endMinute == null) { - endMinute = new Integer(0); + endMinute = new Integer(0); } - + final Integer endAmpm = (Integer) m_endAmpm.getValue(state); - + // Instantiate the instance of the content type. final ContentItem item = m_item.getContentItem(state); - - final BigDecimal defID = (BigDecimal) m_cycleSelect.getValue - (state); + + final BigDecimal defID = (BigDecimal) m_cycleSelect.getValue(state); Assert.exists(defID); - final LifecycleDefinition cycleDef = new LifecycleDefinition - (defID); - + final LifecycleDefinition cycleDef = new LifecycleDefinition(defID); + java.util.Date startDate = - (java.util.Date) m_startDate.getValue(state); - + (java.util.Date) m_startDate.getValue(state); + final Calendar start = Calendar.getInstance(); start.setTime(startDate); start.set(Calendar.AM_PM, startAmpm.intValue()); start.set(Calendar.MINUTE, startMinute.intValue()); start.set(Calendar.AM_PM, startAmpm.intValue()); if (startHour.intValue() != 12) { + start.set(Calendar.HOUR_OF_DAY, + 12 * startAmpm.intValue() + startHour.intValue()); + start.set(Calendar.HOUR, startHour.intValue()); + } else { + if (startAmpm.intValue() == 0) { + start.set(Calendar.HOUR_OF_DAY, 0); + start.set(Calendar.HOUR, 0); + } else { + start.set(Calendar.HOUR_OF_DAY, 12); + start.set(Calendar.HOUR, 0); + } + } + startDate = start.getTime(); + + java.util.Date endDate = + (java.util.Date) m_endDate.getValue(state); + + if (endDate != null) { + final Calendar end = Calendar.getInstance(); + + end.setTime(endDate); + end.set(Calendar.AM_PM, endAmpm.intValue()); + end.set(Calendar.MINUTE, endMinute.intValue()); + end.set(Calendar.AM_PM, endAmpm.intValue()); + + if (endHour.intValue() != 12) { + end.set(Calendar.HOUR_OF_DAY, + 12 * endAmpm.intValue() + endHour.intValue()); + end.set(Calendar.HOUR, endHour.intValue()); + } else { + if (endAmpm.intValue() == 0) { + end.set(Calendar.HOUR_OF_DAY, 0); + end.set(Calendar.HOUR, 0); + } else { + end.set(Calendar.HOUR_OF_DAY, 12); + end.set(Calendar.HOUR, 0); + } + } + endDate = end.getTime(); + } + + // If the item is already published, remove the current lifecycle. + // Do not touch the live version. + if (item.isPublished()) { + item.removeLifecycle(item); + item.save(); + } + + // Apply the new lifecycle. + ContentItem pending = item.publish(cycleDef, startDate); + final Lifecycle lifecycle = pending.getLifecycle(); + + // XXX domlay Whoa. This must be broken for multiphase + // lifecycles. + + if (endDate != null) { + + // update individual phases + final PhaseCollection phases = lifecycle.getPhases(); + + while (phases.next()) { + final Phase phase = phases.getPhase(); + java.util.Date thisEnd = phase.getEndDate(); + java.util.Date thisStart = phase.getStartDate(); + if (thisStart.compareTo(endDate) > 0) { + phase.setStartDate(endDate); + phase.save(); + } + + if (thisEnd == null || thisEnd.compareTo(endDate) > 0) { + phase.setEndDate(endDate); + phase.save(); + } + } + } + + // endOfCycle may be the original date according to lifecycle phase definitions, or endDate if that was before + // natural end of lifecycle + java.util.Date endOfCycle = lifecycle.getEndDate(); + if (endOfCycle != null) { + + // if advance notification is requested (!= 0) + // add another phase at the start of which the user is notified + Integer notificationDays = + (Integer) m_notificationDays.getValue(state); + Integer notificationHours = + (Integer) m_notificationHours.getValue(state); + java.util.Date notificationDate = null; + + int notificationPeriod = 0; + if (notificationDays != null) { + notificationPeriod += notificationDays.intValue() * 24; + } + if (notificationHours != null) { + notificationPeriod += notificationHours.intValue(); + } + + if (notificationPeriod > 0) { + notificationDate = + computeNotificationDate(endOfCycle, notificationPeriod); + s_log.debug("adding custom phase"); + Phase expirationImminentPhase = + lifecycle.addCustomPhase("expirationImminent", + new Long(notificationDate. + getTime()), + new Long(endOfCycle.getTime())); + expirationImminentPhase.setListenerClassName( + "com.arsdigita.cms.lifecycle.NotifyLifecycleListener"); + expirationImminentPhase.save(); + } + } + + // Force the lifecycle scheduler to run to avoid any + // scheduler delay for items that should be published + // immediately. + pending.getLifecycle().start(); + + item.save(); + + final Workflow workflow = m_workflow.getWorkflow(state); + try { + finish(workflow, item, Web.getContext().getUser()); + } catch (TaskException te) { + throw new FormProcessException(te); + } + // redirect to /content-center if streamlined creation mode is active. + if (ContentSection.getConfig().getUseStreamlinedCreation()) { + throw new RedirectSignal(URL.there(state.getRequest(), + Utilities.getWorkspaceURL()), + true); + }*/ + } + } + + /** + * This class contains the real publish action. + */ + private class Publisher { + + private final Integer startHour; + private final Integer startMinute; + private final Integer startAmpm; + private final Integer endHour; + private final Integer endMinute; + private final Integer endAmpm; + private final String oidStr; + private final BigDecimal defID; + private final java.util.Date startDate; + private final java.util.Date endDate; + private final Integer notificationDays; + private final Integer notificationHours; + private final String workflowOid; + private final User user; + + /** + * The constructor collects all necessary data and stores them. + * + * @param state + */ + public Publisher(final PageState state) { + startHour = (Integer) m_startHour.getValue(state); + if (m_startMinute.getValue(state) == null) { + startMinute = new Integer(0); + } else { + startMinute = (Integer) m_startMinute.getValue(state); + } + startAmpm = (Integer) m_startAmpm.getValue(state); + + endHour = (Integer) m_endHour.getValue(state); + if (m_endMinute.getValue(state) == null) { + endMinute = new Integer(0); + } else { + endMinute = (Integer) m_endMinute.getValue(state); + } + endAmpm = (Integer) m_endAmpm.getValue(state); + + //item = m_item.getContentItem(state); + oidStr = m_item.getContentItem(state).getOID().toString(); + + defID = (BigDecimal) m_cycleSelect.getValue(state); + + final Calendar start = Calendar.getInstance(); + start.setTime((java.util.Date) m_startDate.getValue(state)); + start.set(Calendar.AM_PM, startAmpm.intValue()); + start.set(Calendar.MINUTE, startMinute.intValue()); + start.set(Calendar.AM_PM, startAmpm.intValue()); + if (startHour.intValue() != 12) { ... [truncated message content] |
Author: pboy Date: 2012-01-09 01:57:11 +0000 (Mon, 09 Jan 2012) New Revision: 2266 Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/AbstractFolderPicker.java trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/FlatFolderPicker.java trunk/ccm-cms/src/com/arsdigita/cms/ui/type/RelationAttributeAddForm.java trunk/ccm-cms/src/com/arsdigita/cms/ui/type/RelationAttributeAdminPane.java trunk/ccm-cms/src/com/arsdigita/cms/ui/type/RelationAttributeEditForm.java Modified: trunk/ccm-bundle/bundles/demo/cfg/integration.properties trunk/ccm-bundle/bundles/devel/cfg/integration.properties trunk/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLink.java trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/upd_table_persons.sql trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.2-6.6.3.sql trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSubordinateCollection.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSuperiorCollection.java trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ContentTypeFilterWidget.java trunk/ccm-forum/src/com/arsdigita/forum/ui/AttachedFilesStep.java trunk/ccm-ldn-aplaws/bundles/custom/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/extended/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties trunk/ccm-navigation/src/ccm-navigation.upgrade trunk/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql Log: ItemSearchWidget improved. Various minor fixes. Modified: trunk/ccm-bundle/bundles/demo/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2012-01-09 01:57:11 UTC (rev 2266) @@ -46,14 +46,14 @@ ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box -; com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; as a temporary measure a different configuration file which includes a link selection box for CCM items ; and CCM images should be specified: -com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/CCMcmsXinhaConfig.js +com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js ; to use FCKeditor: ; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js -; com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; com.arsdigita.cms.dhtml_editor_hidden_buttons= ; com.arsdigita.cms.dhtml_editor_plugins= Modified: trunk/ccm-bundle/bundles/devel/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2012-01-09 01:57:11 UTC (rev 2266) @@ -46,14 +46,14 @@ ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box -; com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; as a temporary measure a different configuration file which includes a link selection box for CCM items ; and CCM images should be specified: -com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/CCMcmsXinhaConfig.js +com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js ; to use FCKeditor: ; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js -; com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; com.arsdigita.cms.dhtml_editor_hidden_buttons= ; com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS com.arsdigita.cms.dhtml_editor_plugins= Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql (rev 0) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql 2012-01-09 01:57:11 UTC (rev 2266) @@ -0,0 +1,42 @@ +-- +-- Copyright (C) 2011 Jens Pelzetter 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: upd_table_persons.sql pboy $ + +-- This update is only applicable for the internal development tree at +-- University of Bremen ! Don't use for the APLAWS main trunk on +-- fedorahosted! + +CREATE TABLE cms_organizationalunits_hierarchy_map ( + superior_orgaunit_id integer NOT NULL, + subordinate_orgaunit_id integer NOT NULL, + assoc_type character varying(128), + superior_orgaunit_order integer, + subordinate_orgaunit_order integer +); + +-- No sure how to get db owner here +-- ALTER TABLE public.cms_organizationalunits_hierarchy_map OWNER TO iaw; + +ALTER TABLE ONLY cms_organizationalunits_hierarchy_map + ADD CONSTRAINT cms_org_hie_map_sub_or_p_nykpq PRIMARY KEY (subordinate_orgaunit_id, superior_orgaunit_id); + +ALTER TABLE ONLY cms_organizationalunits_hierarchy_map + ADD CONSTRAINT cms_org_hie_map_sub_or_f_xq5is FOREIGN KEY (subordinate_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); + +ALTER TABLE ONLY cms_organizationalunits_hierarchy_map + ADD CONSTRAINT cms_org_hie_map_sup_or_f_qchkn FOREIGN KEY (superior_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); \ No newline at end of file Modified: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/upd_table_persons.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/upd_table_persons.sql 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.2-6.6.3/upd_table_persons.sql 2012-01-09 01:57:11 UTC (rev 2266) @@ -26,3 +26,23 @@ ALTER TABLE cms_persons ADD COLUMN dabin_id INTEGER; + +CREATE TABLE cms_organizationalunits_hierarchy_map ( + superior_orgaunit_id integer NOT NULL, + subordinate_orgaunit_id integer NOT NULL, + assoc_type character varying(128), + superior_orgaunit_order integer, + subordinate_orgaunit_order integer +); + +-- No sure how to get db owner here +ALTER TABLE public.cms_organizationalunits_hierarchy_map OWNER TO iaw; + +ALTER TABLE ONLY cms_organizationalunits_hierarchy_map + ADD CONSTRAINT cms_org_hie_map_sub_or_p_nykpq PRIMARY KEY (subordinate_orgaunit_id, superior_orgaunit_id); + +ALTER TABLE ONLY cms_organizationalunits_hierarchy_map + ADD CONSTRAINT cms_org_hie_map_sub_or_f_xq5is FOREIGN KEY (subordinate_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); + +ALTER TABLE ONLY cms_organizationalunits_hierarchy_map + ADD CONSTRAINT cms_org_hie_map_sup_or_f_qchkn FOREIGN KEY (superior_orgaunit_id) REFERENCES cms_organizationalunits(organizationalunit_id); \ No newline at end of file Modified: trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.2-6.6.3.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.2-6.6.3.sql 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.2-6.6.3.sql 2012-01-09 01:57:11 UTC (rev 2266) @@ -26,5 +26,6 @@ begin; \i ../default/upgrade/6.6.2-6.6.3/upd_table_persons.sql +\i ../default/upgrade/6.6.2-6.6.3/create_orgaunit_hierarchy_table.sql commit; Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSubordinateCollection.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSubordinateCollection.java 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSubordinateCollection.java 2012-01-09 01:57:11 UTC (rev 2266) @@ -49,8 +49,8 @@ } public void swapWithNext(final GenericOrganizationalUnit orgaunit) { - - + + if (orgaunit == null) { throw new IllegalArgumentException( "Parameter orgaunit is null. Can't swap position with null"); @@ -87,6 +87,8 @@ next(); setSubordinateOrder(currentIndex); rewind(); + + normalizeOrder(); } public void swapWithPrevious(final GenericOrganizationalUnit orgaunit) { @@ -128,17 +130,30 @@ next(); setSubordinateOrder(previousIndex); rewind(); + + normalizeOrder(); } + private void normalizeOrder() { + this.rewind(); + + int i = 1; + while (this.next()) { + setSubordinateOrder(i); + i++; + } + this.rewind(); + } + public GenericOrganizationalUnit getGenericOrganizationalUnit() { return (GenericOrganizationalUnit) DomainObjectFactory.newInstance(m_dataCollection. getDataObject()); } - + public BigDecimal getId() { return (BigDecimal) m_dataCollection.getDataObject().get(ACSObject.ID); } - + public OID getOID() { return m_dataCollection.getDataObject().getOID(); } Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSuperiorCollection.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSuperiorCollection.java 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSuperiorCollection.java 2012-01-09 01:57:11 UTC (rev 2266) @@ -83,6 +83,8 @@ next(); setSuperiorOrder(currentIndex); rewind(); + + normalizeOrder(); } public void swapWithPrevious(final GenericOrganizationalUnit orgaunit) { @@ -124,8 +126,21 @@ next(); setSuperiorOrder(previousIndex); rewind(); + + normalizeOrder(); } + + private void normalizeOrder() { + this.rewind(); + int i = 1; + while (this.next()) { + setSuperiorOrder(i); + i++; + } + this.rewind(); + } + public GenericOrganizationalUnit getGenericOrganizationalUnit() { return (GenericOrganizationalUnit) DomainObjectFactory.newInstance(m_dataCollection. getDataObject()); Added: trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java (rev 0) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java 2012-01-09 01:57:11 UTC (rev 2266) @@ -0,0 +1,88 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.cms.ui; + +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.ParameterSingleSelectionModel; +import com.arsdigita.bebop.SegmentedPanel; +import com.arsdigita.bebop.SegmentedPanel.Segment; +import com.arsdigita.bebop.SingleSelectionModel; +import com.arsdigita.bebop.event.FormProcessListener; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.parameters.BigDecimalParameter; +import com.arsdigita.cms.CMS; +import com.arsdigita.cms.ContentSection; +import com.arsdigita.cms.ui.authoring.CreationSelector; +import com.arsdigita.cms.ui.authoring.NewItemForm; +import com.arsdigita.cms.ui.folder.FolderRequestLocal; +import com.arsdigita.cms.ui.folder.FolderSelectionModel; +import com.arsdigita.cms.ui.folder.FolderTreeModelBuilder; +import com.arsdigita.cms.util.GlobalizationUtil; +import java.math.BigDecimal; + +/** + * + * @author Sören Bernstein (quasimodo) <sbe...@ze...> + */ +class ItemSearchCreateItemPane extends CMSContainer implements FormProcessListener { + + private static final String CONTENT_TYPE_ID = "ct"; + private NewItemForm m_newItem; + private SingleSelectionModel m_typeSel; + private final BaseTree m_tree; + private final SingleSelectionModel m_model; + private final FolderSelectionModel m_folderSel; // To support legacy UI code + private final FolderRequestLocal m_folder; + private CreationSelector m_selector; + private Segment m_newItemSeg; + + public ItemSearchCreateItemPane() { + +// m_newItem = new SectionNewItemForm("newItem"); +// m_newItem.addProcessListener(this); + + m_tree = new BaseTree(new FolderTreeModelBuilder()); + m_model = m_tree.getSelectionModel(); + m_folderSel = new FolderSelectionModel(m_model); + m_folder = new FolderRequestLocal(m_folderSel); + +// m_newItemSeg = addSegment(); + this.setIdAttr("folder-new-item"); + +// m_newItemSeg.addHeader(new Label(GlobalizationUtil.globalize("cms.ui.new_item"))); + m_typeSel = new ParameterSingleSelectionModel(new BigDecimalParameter(CONTENT_TYPE_ID)); +// m_typeSel.addChangeListener(this); + + m_selector = new CreationSelector(m_typeSel, m_folderSel); + this.add(m_selector); + this.add(new Label("<br/>", false)); + +// add(m_newItem); + + + } + + public void process(FormSectionEvent e) { + PageState s = e.getPageState(); + final Object source = e.getSource(); + if (source == m_newItem) { + BigDecimal typeID = m_newItem.getTypeID(s); + m_typeSel.setSelectedKey(s, typeID); + //newItemMode(s); + } + } + + private static class SectionNewItemForm extends NewItemForm { + + public SectionNewItemForm(String name) { + super(name); + } + + public ContentSection getContentSection(PageState s) { + return CMS.getContext().getContentSection(); + } + } +} Added: trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/AbstractFolderPicker.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/AbstractFolderPicker.java (rev 0) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/AbstractFolderPicker.java 2012-01-09 01:57:11 UTC (rev 2266) @@ -0,0 +1,60 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.cms.ui.folder; + +import com.arsdigita.bebop.form.SingleSelect; +import com.arsdigita.bebop.event.PrintListener; +import com.arsdigita.bebop.event.PrintEvent; +import com.arsdigita.bebop.PageState; +import com.arsdigita.cms.Folder; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.persistence.OID; +import com.arsdigita.toolbox.ui.OIDParameter; +import java.util.TooManyListenersException; + +/** + * + * @author Sören Bernstein (quasimodo) <sbe...@ze...> + */ +public abstract class AbstractFolderPicker extends SingleSelect { + + public AbstractFolderPicker(String name) { + super(new OIDParameter(name)); + + try { + addPrintListener(new PrintListener() { + @Override + public void prepare(PrintEvent ev) { + addOptions(ev.getPageState(), + (SingleSelect)ev.getTarget()); + } + }); + } catch (TooManyListenersException ex) { + throw new RuntimeException("this cannot happen"); + } + } + + public Folder getFolder(PageState state) { + OID oid = (OID)getValue(state); + + if (oid == null) { + return null; + } + return (Folder)DomainObjectFactory.newInstance(oid); + } + + public void setCategory(PageState state, + Folder folder) { + if (folder == null) { + setValue(state, null); + } else { + setValue(state, folder.getOID()); + } + } + + protected abstract void addOptions(PageState state, + SingleSelect target); + +} Added: trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/FlatFolderPicker.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/FlatFolderPicker.java (rev 0) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/FlatFolderPicker.java 2012-01-09 01:57:11 UTC (rev 2266) @@ -0,0 +1,43 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.cms.ui.folder; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.form.Option; +import com.arsdigita.bebop.form.SingleSelect; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.SessionManager; + +/** + * + * @author Sören Bernstein (quasimodo) <sbe...@ze...> + */ +public class FlatFolderPicker extends AbstractFolderPicker { + + public FlatFolderPicker(String name) { + super(name); + } + + protected void addOptions(PageState state, SingleSelect target) { +// DataCollection terms = SessionManager.getSession() +// .retrieve(Term.BASE_DATA_OBJECT_TYPE); +// terms.addPath("model.id"); +// terms.addPath("model.objectType"); +// terms.addPath("model.name"); +// terms.addPath("domain.title"); +// terms.addOrder("domain.title"); +// terms.addOrder("model.name"); +// +// target.addOption(new Option(null, "-- pick one --")); +// while (terms.next()) { +// target.addOption( +// new Option(new OID((String)terms.get("model.objectType"), +// terms.get("model.id")).toString(), +// terms.get("domain.title") + " -> " + +// terms.get("model.name"))); +// } + } +} Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ContentTypeFilterWidget.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ContentTypeFilterWidget.java 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/search/ContentTypeFilterWidget.java 2012-01-09 01:57:11 UTC (rev 2266) @@ -100,7 +100,7 @@ // If the section and parent type both equals the preset from initializer // there is no need to get a new ContentTypeCollection - if (getContentSection() != m_section && parentType != m_parentType) { + if (getContentSection() != m_section || parentType != m_parentType) { if (getContentSection() != null) { ContentSection section = getContentSection(); Added: trunk/ccm-cms/src/com/arsdigita/cms/ui/type/RelationAttributeAddForm.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/type/RelationAttributeAddForm.java (rev 0) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/type/RelationAttributeAddForm.java 2012-01-09 01:57:11 UTC (rev 2266) @@ -0,0 +1,14 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.arsdigita.cms.ui.type; + +/** + * + * @author quasi + */ +public class RelationAttributeAddForm { + +} Added: trunk/ccm-cms/src/com/arsdigita/cms/ui/type/RelationAttributeAdminPane.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/type/RelationAttributeAdminPane.java (rev 0) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/type/RelationAttributeAdminPane.java 2012-01-09 01:57:11 UTC (rev 2266) @@ -0,0 +1,16 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.arsdigita.cms.ui.type; + +import com.arsdigita.bebop.SimpleComponent; + +/** + * + * @author quasi + */ +public class RelationAttributeAdminPane extends SimpleComponent { + +} Added: trunk/ccm-cms/src/com/arsdigita/cms/ui/type/RelationAttributeEditForm.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/type/RelationAttributeEditForm.java (rev 0) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/type/RelationAttributeEditForm.java 2012-01-09 01:57:11 UTC (rev 2266) @@ -0,0 +1,23 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.arsdigita.cms.ui.type; + +import com.arsdigita.bebop.Label; +import com.arsdigita.cms.ui.BaseForm; + +/** + * + * @author quasi + */ +public class RelationAttributeEditForm extends BaseForm +{ + + public RelationAttributeEditForm() { + super("RelatioNAttributeEdit" ,new Label("RelationAttributeEdit")); + } + + +} Modified: trunk/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLink.java =================================================================== --- trunk/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLink.java 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLink.java 2012-01-09 01:57:11 UTC (rev 2266) @@ -229,6 +229,7 @@ "com.arsdigita.cms.contentassets.allRelatedLinkOrderForItem", "com.arsdigita.cms.contentassets.swapRelatedLinkWithNextInGroup", this.getLinkListName()); + normalizeOrder(); } /** @@ -241,6 +242,7 @@ "com.arsdigita.cms.contentassets.allRelatedLinkOrderForItem", "com.arsdigita.cms.contentassets.swapRelatedLinkWithNextInGroup", this.getLinkListName()); + normalizeOrder(); } /** @@ -298,8 +300,23 @@ link.setOrder(sortKey); link.save(); } - } + + /** + * This method normalizes the order column of the related links of this + * item. This means that the order column of the first related link will + * have the value 1 after calling this method, and so one. + */ + private void normalizeOrder() { + final DataCollection relatedLinks = getRelatedLinks(getLinkOwner(), + getLinkListName()); + int i = 1; + while(relatedLinks.next()) { + relatedLinks.getDataObject().set(ORDER, i); + relatedLinks.getDataObject().save(); + i++; + } + } /** * Returns the max sort key value for all RelatedLinks with the Modified: trunk/ccm-forum/src/com/arsdigita/forum/ui/AttachedFilesStep.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/ui/AttachedFilesStep.java 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-forum/src/com/arsdigita/forum/ui/AttachedFilesStep.java 2012-01-09 01:57:11 UTC (rev 2266) @@ -1,376 +1,376 @@ -/* - * 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.forum.ui; - -import java.io.File; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.apache.commons.lang.StringUtils; -import org.apache.log4j.Logger; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.FormStep; -import com.arsdigita.bebop.Page; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.SimpleContainer; -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.event.ParameterEvent; -import com.arsdigita.bebop.form.FileUpload; -import com.arsdigita.bebop.form.Submit; -import com.arsdigita.bebop.form.TextArea; -import com.arsdigita.bebop.parameters.ArrayParameter; -import com.arsdigita.bebop.parameters.FileSizeValidationListener; -import com.arsdigita.bebop.parameters.NotEmptyValidationListener; -import com.arsdigita.bebop.parameters.StringInRangeValidationListener; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.dispatcher.MultipartHttpServletRequest; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.domain.DomainObjectXMLRenderer; -import com.arsdigita.forum.Forum; -import com.arsdigita.forum.Post; -import com.arsdigita.forum.PostFileAttachment; -import com.arsdigita.kernel.ui.ACSObjectSelectionModel; -import com.arsdigita.persistence.DataAssociationCursor; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.util.Assert; -import com.arsdigita.xml.Element; - -/** - * @author Chris Gilbert <a href="mailto:chr...@we...">chr...@we...</a> - * - * Wizard step to attach files to a post. This step may be bypassed - * if a forum administrator changes the forum settings on the UI - * - * nb - a simpler reuseable generic wizard file attachments step has been created - * forum will be refactored to use it in the future. see ccm-wsx-wizard-steps in contrib - */ -public class AttachedFilesStep - extends FormStep - implements Constants, FormInitListener, FormProcessListener, FormValidationListener { - - private static Logger s_log = Logger.getLogger(AttachedFilesStep.class); - private ACSObjectSelectionModel m_post; - - - - private AttachedFilesTable m_attachedFiles; - private FileUpload m_upload; - private TextArea m_description; - private Submit m_addFile; - private PostForm m_container; - - private ArrayParameter m_newFiles = new ArrayParameter("newFiles"); - private ArrayParameter m_existingFiles = new ArrayParameter("oldFiles"); - - - public AttachedFilesStep(ACSObjectSelectionModel post, PostForm container) { - super("postFiles", - new SimpleContainer( - FORUM_XML_PREFIX + ":postFormFiles", - FORUM_XML_NS)); - - m_post = post; - m_container = container; - m_attachedFiles = new AttachedFilesTable(m_newFiles, m_existingFiles, this); - - add(m_attachedFiles); - - m_upload = new FileUpload("file", true); - m_upload.addValidationListener(new NotEmptyValidationListener( - Text - .gz("forum.ui.validation.file_null")) { - public void validate(ParameterEvent e) { - // don't fire validation if the next or previous button of the wizard has been pressed - - if (m_addFile.isSelected(e.getPageState())) { - super.validate(e); - } - } - }); - // this validation can fire any time - if there is no file then it won't fail - m_upload.addValidationListener( - new FileSizeValidationListener(Forum.getConfig().getMaxFileSize())); - add(m_upload); - m_description = new TextArea("fileDescription"); - m_description.setCols(20); - m_description.setRows(5); - - m_description - .addValidationListener(new StringInRangeValidationListener( - 0, - 4000, - Text.gz("forum.ui.validation.file_description_too_long")) { - public void validate(ParameterEvent e) - throws FormProcessException { - // don't fire validation if the next or previous button of the wizard has been pressed - - if (m_addFile.isSelected(e.getPageState())) { - super.validate(e); - } - } - }); - add(m_description); - m_addFile = new Submit("Add File"); - add(m_addFile); - addInitListener(this); - addProcessListener(this); - addValidationListener(this); - } - - /** - * Uploads the file and creates an orphaned PostFileAttachment - * that will be associated with the post when the wizard is completed - * or deleted if the wizard is cancelled. - */ - public void process(FormSectionEvent e) throws FormProcessException { - FormData data = e.getFormData(); - PageState state = e.getPageState(); - if (m_addFile.isSelected(state)) { - - PostFileAttachment attachment; - s_log.debug("adding file"); - try { - String fileName = (String) m_upload.getValue(state); - s_log.debug("filename is " + fileName); - File file = - ( - (MultipartHttpServletRequest) e - .getPageState() - .getRequest()) - .getFile( - "file"); - s_log.debug("uploaded file is " + file.getName()); - //MimeType mimeType = MimeType.guessMimeTypeFromFile(fileName); - //s_log.debug("mime type is " + mimeType.getMimeType()); - attachment = new PostFileAttachment(); - attachment.loadFromFile( - fileName, - file, - "application/octet-stream"); - attachment.setDescription( - (String) m_description.getValue(state)); - BigDecimal id = attachment.getID(); - String[] current = (String[]) state.getValue(m_newFiles); - if (current == null) { - current = new String[] { id.toString()}; - } else { - List files = Arrays.asList(current); - current = new String[files.size() + 1]; - Iterator it = files.iterator(); - int i = 0; - while (it.hasNext()) { - current[i++] = (String) it.next(); - } - current[i] = id.toString(); - } - state.setValue(m_newFiles, current); - s_log.debug("File Uploaded"); - m_description.setValue(state, null); - - } catch (Exception ex) { - throw new FormProcessException(ex); - } - } - } - - /** - * Prevent users navigating away from this page unintentionally without - * adding an uploaded file first - */ - public void validate(FormSectionEvent e) throws FormProcessException { - PageState state = e.getPageState(); - if (!m_addFile.isSelected(state) - && StringUtils.isNotBlank((String) m_upload.getValue(state))) { - throw new FormProcessException( - (String) Text - .gz("forum.ui.validation.file_not_uploaded") - .localize()); - } - - } - - public void removeFile(BigDecimal id, PageState state) { - String[] existingArray = (String[]) state.getValue(m_existingFiles); - if (existingArray != null) { - List existing = Arrays.asList(existingArray); - if (!existing.contains(id)) { - // this has been added during edit (or this is a new post) - s_log.debug("new file - I will actually delete it"); - PostFileAttachment attachment = new PostFileAttachment(id); - attachment.delete(); - } - } - // m_new_files cannot contain null if request is to delete file - Assert.exists(state.getValue(m_newFiles)); - List newFiles = - new ArrayList(Arrays.asList((String[]) state.getValue(m_newFiles))); - newFiles.remove(id); - String[] current = new String[newFiles.size()]; - Iterator it = newFiles.iterator(); - int i = 0; - while (it.hasNext()) { - current[i++] = (String) it.next(); - } - s_log.debug("size of new files array = " + current.length); - state.setValue(m_newFiles, current); - - } - - public DataCollection getCurrentFiles(PageState state) { - - String[] currentArray = (String[]) state.getValue(m_newFiles); - if (currentArray != null && currentArray.length != 0) { - List current = Arrays.asList((String[]) state.getValue(m_newFiles)); - - DataCollection files = - SessionManager.getSession().retrieve( - PostFileAttachment.BASE_DATA_OBJECT_TYPE); - files.addFilter("id in :files").set("files", current); - return files; - } - return null; - - } - - /** - * called at the end of the wizard when the form is processed - * set the files attached to the post according to the - * file attachment step - * @param post - * @param state - */ - public void attachFiles(Post post, PageState state) { - - List newFiles = Collections.EMPTY_LIST; - String[] newFilesArray = (String[]) state.getValue(m_newFiles); - if (newFilesArray != null) { - newFiles = new ArrayList(Arrays.asList(newFilesArray)); - } - String[] existing = (String[]) state.getValue(m_existingFiles); - - if (existing != null) { - // we are editing a post - leave any unchanged files, delete any that have been - // removed - for (int i = 0; i < existing.length; i++) { - if (newFiles.contains(existing[i])) { - // no change to this one - newFiles.remove(existing[i]); - } else { - // file has been deleted in edit - PostFileAttachment file = - new PostFileAttachment(new BigDecimal(existing[i])); - post.removeFile(file); - // file deleted - - } - } - } - Iterator it = newFiles.iterator(); - while (it.hasNext()) { - // new files added - PostFileAttachment file = - new PostFileAttachment(new BigDecimal((String) it.next())); - post.addFile(file); - } - state.setValue(m_newFiles, null); - state.setValue(m_existingFiles, null); - - } - - public void register(Page p) { - super.register(p); - - p.addGlobalStateParam(m_existingFiles); - p.addGlobalStateParam(m_newFiles); - } - - - - public void init(FormSectionEvent e) throws FormProcessException { - PageState state = e.getPageState(); - - if (m_container - .getContext(state) - .equals(PostForm.EDIT_CONTEXT)) { - - Post editPost = (Post) m_post.getSelectedObject(state); - DataAssociationCursor files = editPost.getFiles(); - if (files.size() > 0) { - - String[] fileIDs = - new String[new Long(files.size()).intValue()]; - int i = 0; - while (files.next()) { - - PostFileAttachment file = - (PostFileAttachment) DomainObjectFactory.newInstance( - files.getDataObject()); - fileIDs[i++] = file.getID().toString(); - } - state.setValue(m_existingFiles, fileIDs); - state.setValue(m_newFiles, fileIDs); - } - } - - } - - /** - * generate xml for the confirmation step (unfortunately we can't just - * traverse the post because it hasn't been created at this point) - * @param state - * @param p - */ - public void generatePostXML(PageState state, Element p) { - DataCollection files = getCurrentFiles(state); - if (files == null) { - return; - - } - while(files.next()) { - PostFileAttachment file = (PostFileAttachment) DomainObjectFactory.newInstance( - files.getDataObject()); - DomainObjectXMLRenderer xr = new DomainObjectXMLRenderer(p.newChildElement("files")); - xr.setWrapRoot(false); - xr.setWrapAttributes(true); - xr.setWrapObjects(false); - xr.walk(file, ConfirmStep.class.getName()); - } - } - - - protected void clearParameters(PageState state) { - state.setValue(m_existingFiles, null); - state.setValue(m_newFiles, null); - - } - - - -} +/* + * 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.forum.ui; + +import java.io.File; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; + +import com.arsdigita.bebop.FormData; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.FormStep; +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SimpleContainer; +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.event.ParameterEvent; +import com.arsdigita.bebop.form.FileUpload; +import com.arsdigita.bebop.form.Submit; +import com.arsdigita.bebop.form.TextArea; +import com.arsdigita.bebop.parameters.ArrayParameter; +import com.arsdigita.bebop.parameters.FileSizeValidationListener; +import com.arsdigita.bebop.parameters.NotEmptyValidationListener; +import com.arsdigita.bebop.parameters.StringInRangeValidationListener; +import com.arsdigita.bebop.table.TableModel; +import com.arsdigita.bebop.table.TableModelBuilder; +import com.arsdigita.dispatcher.MultipartHttpServletRequest; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.domain.DomainObjectXMLRenderer; +import com.arsdigita.forum.Forum; +import com.arsdigita.forum.Post; +import com.arsdigita.forum.PostFileAttachment; +import com.arsdigita.kernel.ui.ACSObjectSelectionModel; +import com.arsdigita.persistence.DataAssociationCursor; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.util.Assert; +import com.arsdigita.xml.Element; + +/** + * @author Chris Gilbert <a href="mailto:chr...@we...">chr...@we...</a> + * + * Wizard step to attach files to a post. This step may be bypassed + * if a forum administrator changes the forum settings on the UI + * + * nb - a simpler reuseable generic wizard file attachments step has been created + * forum will be refactored to use it in the future. see ccm-wsx-wizard-steps in contrib + */ +public class AttachedFilesStep + extends FormStep + implements Constants, FormInitListener, FormProcessListener, FormValidationListener { + + private static Logger s_log = Logger.getLogger(AttachedFilesStep.class); + private ACSObjectSelectionModel m_post; + + + + private AttachedFilesTable m_attachedFiles; + private FileUpload m_upload; + private TextArea m_description; + private Submit m_addFile; + private PostForm m_container; + + private ArrayParameter m_newFiles = new ArrayParameter("newFiles"); + private ArrayParameter m_existingFiles = new ArrayParameter("oldFiles"); + + + public AttachedFilesStep(ACSObjectSelectionModel post, PostForm container) { + super("postFiles", + new SimpleContainer( + FORUM_XML_PREFIX + ":postFormFiles", + FORUM_XML_NS)); + + m_post = post; + m_container = container; + m_attachedFiles = new AttachedFilesTable(m_newFiles, m_existingFiles, this); + + add(m_attachedFiles); + + m_upload = new FileUpload("file", true); + m_upload.addValidationListener(new NotEmptyValidationListener( + Text + .gz("forum.ui.validation.file_null")) { + public void validate(ParameterEvent e) { + // don't fire validation if the next or previous button of the wizard has been pressed + + if (m_addFile.isSelected(e.getPageState())) { + super.validate(e); + } + } + }); + // this validation can fire any time - if there is no file then it won't fail + m_upload.addValidationListener( + new FileSizeValidationListener(Forum.getConfig().getMaxFileSize())); + add(m_upload); + m_description = new TextArea("fileDescription"); + m_description.setCols(20); + m_description.setRows(5); + + m_description + .addValidationListener(new StringInRangeValidationListener( + 0, + 4000, + Text.gz("forum.ui.validation.file_description_too_long")) { + public void validate(ParameterEvent e) + throws FormProcessException { + // don't fire validation if the next or previous button of the wizard has been pressed + + if (m_addFile.isSelected(e.getPageState())) { + super.validate(e); + } + } + }); + add(m_description); + m_addFile = new Submit("Add File"); + add(m_addFile); + addInitListener(this); + addProcessListener(this); + addValidationListener(this); + } + + /** + * Uploads the file and creates an orphaned PostFileAttachment + * that will be associated with the post when the wizard is completed + * or deleted if the wizard is cancelled. + */ + public void process(FormSectionEvent e) throws FormProcessException { + FormData data = e.getFormData(); + PageState state = e.getPageState(); + if (m_addFile.isSelected(state)) { + + PostFileAttachment attachment; + s_log.debug("adding file"); + try { + String fileName = (String) m_upload.getValue(state); + s_log.debug("filename is " + fileName); + File file = + ( + (MultipartHttpServletRequest) e + .getPageState() + .getRequest()) + .getFile( + "file"); + s_log.debug("uploaded file is " + file.getName()); + //MimeType mimeType = MimeType.guessMimeTypeFromFile(fileName); + //s_log.debug("mime type is " + mimeType.getMimeType()); + attachment = new PostFileAttachment(); + attachment.loadFromFile( + fileName, + file, + "application/octet-stream"); + attachment.setDescription( + (String) m_description.getValue(state)); + BigDecimal id = attachment.getID(); + String[] current = (String[]) state.getValue(m_newFiles); + if (current == null) { + current = new String[] { id.toString()}; + } else { + List files = Arrays.asList(current); + current = new String[files.size() + 1]; + Iterator it = files.iterator(); + int i = 0; + while (it.hasNext()) { + current[i++] = (String) it.next(); + } + current[i] = id.toString(); + } + state.setValue(m_newFiles, current); + s_log.debug("File Uploaded"); + m_description.setValue(state, null); + + } catch (Exception ex) { + throw new FormProcessException(ex); + } + } + } + + /** + * Prevent users navigating away from this page unintentionally without + * adding an uploaded file first + */ + public void validate(FormSectionEvent e) throws FormProcessException { + PageState state = e.getPageState(); + if (!m_addFile.isSelected(state) + && StringUtils.isNotBlank((String) m_upload.getValue(state))) { + throw new FormProcessException( + (String) Text + .gz("forum.ui.validation.file_not_uploaded") + .localize()); + } + + } + + public void removeFile(BigDecimal id, PageState state) { + String[] existingArray = (String[]) state.getValue(m_existingFiles); + if (existingArray != null) { + List existing = Arrays.asList(existingArray); + if (!existing.contains(id)) { + // this has been added during edit (or this is a new post) + s_log.debug("new file - I will actually delete it"); + PostFileAttachment attachment = new PostFileAttachment(id); + attachment.delete(); + } + } + // m_new_files cannot contain null if request is to delete file + Assert.exists(state.getValue(m_newFiles)); + List newFiles = + new ArrayList(Arrays.asList((String[]) state.getValue(m_newFiles))); + newFiles.remove(id); + String[] current = new String[newFiles.size()]; + Iterator it = newFiles.iterator(); + int i = 0; + while (it.hasNext()) { + current[i++] = (String) it.next(); + } + s_log.debug("size of new files array = " + current.length); + state.setValue(m_newFiles, current); + + } + + public DataCollection getCurrentFiles(PageState state) { + + String[] currentArray = (String[]) state.getValue(m_newFiles); + if (currentArray != null && currentArray.length != 0) { + List current = Arrays.asList((String[]) state.getValue(m_newFiles)); + + DataCollection files = + SessionManager.getSession().retrieve( + PostFileAttachment.BASE_DATA_OBJECT_TYPE); + files.addFilter("id in :files").set("files", current); + return files; + } + return null; + + } + + /** + * called at the end of the wizard when the form is processed + * set the files attached to the post according to the + * file attachment step + * @param post + * @param state + */ + public void attachFiles(Post post, PageState state) { + + List newFiles = Collections.EMPTY_LIST; + String[] newFilesArray = (String[]) state.getValue(m_newFiles); + if (newFilesArray != null) { + newFiles = new ArrayList(Arrays.asList(newFilesArray)); + } + String[] existing = (String[]) state.getValue(m_existingFiles); + + if (existing != null) { + // we are editing a post - leave any unchanged files, delete any that have been + // removed + for (int i = 0; i < existing.length; i++) { + if (newFiles.contains(existing[i])) { + // no change to this one + newFiles.remove(existing[i]); + } else { + // file has been deleted in edit + PostFileAttachment file = + new PostFileAttachment(new BigDecimal(existing[i])); + post.removeFile(file); + // file deleted + + } + } + } + Iterator it = newFiles.iterator(); + while (it.hasNext()) { + // new files added + PostFileAttachment file = + new PostFileAttachment(new BigDecimal((String) it.next())); + post.addFile(file); + } + state.setValue(m_newFiles, null); + state.setValue(m_existingFiles, null); + + } + + public void register(Page p) { + super.register(p); + + p.addGlobalStateParam(m_existingFiles); + p.addGlobalStateParam(m_newFiles); + } + + + + public void init(FormSectionEvent e) throws FormProcessException { + PageState state = e.getPageState(); + + if (m_container + .getContext(state) + .equals(PostForm.EDIT_CONTEXT)) { + + Post editPost = (Post) m_post.getSelectedObject(state); + DataAssociationCursor files = editPost.getFiles(); + if (files.size() > 0) { + + String[] fileIDs = + new String[new Long(files.size()).intValue()]; + int i = 0; + while (files.next()) { + + PostFileAttachment file = + (PostFileAttachment) DomainObjectFactory.newInstance( + files.getDataObject()); + fileIDs[i++] = file.getID().toString(); + } + state.setValue(m_existingFiles, fileIDs); + state.setValue(m_newFiles, fileIDs); + } + } + + } + + /** + * generate xml for the confirmation step (unfortunately we can't just + * traverse the post because it hasn't been created at this point) + * @param state + * @param p + */ + public void generatePostXML(PageState state, Element p) { + DataCollection files = getCurrentFiles(state); + if (files == null) { + return; + + } + while(files.next()) { + PostFileAttachment file = (PostFileAttachment) DomainObjectFactory.newInstance( + files.getDataObject()); + DomainObjectXMLRenderer xr = new DomainObjectXMLRenderer(p.newChildElement(FORUM_XML_PREFIX + "files")); + xr.setWrapRoot(false); + xr.setWrapAttributes(true); + xr.setWrapObjects(false); + xr.walk(file, ConfirmStep.class.getName()); + } + } + + + protected void clearParameters(PageState state) { + state.setValue(m_existingFiles, null); + state.setValue(m_newFiles, null); + + } + + + +} Modified: trunk/ccm-ldn-aplaws/bundles/custom/cfg/integration.properties =================================================================== --- trunk/ccm-ldn-aplaws/bundles/custom/cfg/integration.properties 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-ldn-aplaws/bundles/custom/cfg/integration.properties 2012-01-09 01:57:11 UTC (rev 2266) @@ -51,14 +51,14 @@ ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box -;com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +;com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; as a temporary measure a different configuration file which includes a link selection box for CCM items ; and CCM images should be specified: -com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/CCMcmsXinhaConfig.js +com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js ; to use FCKeditor: ; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js -; com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; com.arsdigita.cms.dhtml_editor_hidden_buttons= ; com.arsdigita.cms.dhtml_editor_plugins= Modified: trunk/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties =================================================================== --- trunk/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties 2012-01-09 01:57:11 UTC (rev 2266) @@ -51,14 +51,14 @@ ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box -;com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +;com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; as a temporary measure a different configuration file which includes a link selection box for CCM items ; and CCM images should be specified: -com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/CCMcmsXinhaConfig.js +com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js ; to use FCKeditor: ; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js -; com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; com.arsdigita.cms.dhtml_editor_hidden_buttons= ; com.arsdigita.cms.dhtml_editor_plugins= Modified: trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties 2012-01-09 01:57:11 UTC (rev 2266) @@ -52,14 +52,14 @@ ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box -;com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +;com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; as a temporary measure a different configuration file which includes a link selection box for CCM items ; and CCM images should be specified: -com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/CCMcmsXinhaConfig.js +com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js ; to use FCKeditor: ; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js -; com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; com.arsdigita.cms.dhtml_editor_hidden_buttons= ; com.arsdigita.cms.dhtml_editor_plugins= Modified: trunk/ccm-ldn-aplaws/bundles/extended/cfg/integration.properties =================================================================== --- trunk/ccm-ldn-aplaws/bundles/extended/cfg/integration.properties 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-ldn-aplaws/bundles/extended/cfg/integration.properties 2012-01-09 01:57:11 UTC (rev 2266) @@ -51,14 +51,14 @@ ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box -;com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +;com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; as a temporary measure a different configuration file which includes a link selection box for CCM items ; and CCM images should be specified: -com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/CCMcmsXinhaConfig.js +com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js ; to use FCKeditor: ; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js -; com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; com.arsdigita.cms.dhtml_editor_hidden_buttons= ; com.arsdigita.cms.dhtml_editor_plugins= Modified: trunk/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties =================================================================== --- trunk/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties 2012-01-09 01:57:11 UTC (rev 2266) @@ -51,14 +51,14 @@ ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box -;com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +;com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; as a temporary measure a different configuration file which includes a link selection box for CCM items ; and CCM images should be specified: -com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/CCMcmsXinhaConfig.js +com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js ; to use FCKeditor: ; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js -; com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; com.arsdigita.cms.dhtml_editor_hidden_buttons= ; com.arsdigita.cms.dhtml_editor_plugins= Modified: trunk/ccm-navigation/src/ccm-navigation.upgrade =================================================================== --- trunk/ccm-navigation/src/ccm-navigation.upgrade 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-navigation/src/ccm-navigation.upgrade 2012-01-09 01:57:11 UTC (rev 2266) @@ -20,6 +20,6 @@ <script sql="ccm-navigation/upgrade/::database::-6.6.1-6.6.2.sql"/> </version> <version from="6.6.2" to="6.6.3"> - <script sql="ccm-navigation/upgrade/::database::-6.6.1-6.6.2.sql"/> + <script sql="ccm-navigation/upgrade/::database::-6.6.2-6.6.3.sql"/> </version> </upgrade> Modified: trunk/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql =================================================================== --- trunk/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql 2012-01-09 01:41:35 UTC (rev 2265) +++ trunk/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql 2012-01-09 01:57:11 UTC (rev 2266) @@ -32,7 +32,7 @@ where init like '%london.subsite%' ; update init_requirements - set required_init=replace(required_init,'london.subsite', 'subsie') + set required_init=replace(required_init,'london.subsite', 'subsite') where required_init like '%london.subsite%' ; ALTER TABLE ONLY init_requirements |
Author: pboy Date: 2012-01-09 01:41:35 +0000 (Mon, 09 Jan 2012) New Revision: 2265 Added: trunk/ccm-ldn-userpreferences/ trunk/ccm-ldn-userpreferences/application.xml trunk/ccm-ldn-userpreferences/etc/ trunk/ccm-ldn-userpreferences/pdl/ trunk/ccm-ldn-userpreferences/pdl/com/ trunk/ccm-ldn-userpreferences/pdl/com/arsdigita/ trunk/ccm-ldn-userpreferences/pdl/com/arsdigita/london/ trunk/ccm-ldn-userpreferences/pdl/com/arsdigita/london/userprefs/ trunk/ccm-ldn-userpreferences/pdl/com/arsdigita/london/userprefs/UserPrefs.pdl trunk/ccm-ldn-userpreferences/sql/ trunk/ccm-ldn-userpreferences/sql/ccm-user-preferences/ trunk/ccm-ldn-userpreferences/sql/ccm-user-preferences/oracle-se-create.sql trunk/ccm-ldn-userpreferences/sql/ccm-user-preferences/postgres-create.sql trunk/ccm-ldn-userpreferences/src/ trunk/ccm-ldn-userpreferences/src/ccm-user-preferences.config trunk/ccm-ldn-userpreferences/src/ccm-user-preferences.load trunk/ccm-ldn-userpreferences/src/com/ trunk/ccm-ldn-userpreferences/src/com/arsdigita/ trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/ trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/ trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/Initializer.java trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/PersistentUserPrefs.java trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/Pref.java trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/UserPrefs.java trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/ui/ trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/ui/UserPrefsComponent.java Removed: trunk/ccm-user-preferences/ Log: ccm-user-preferences seems not to do anything usefull, but has a london naming space. Moved to ccm-ldn-userpreferences. Property changes on: trunk/ccm-ldn-userpreferences ___________________________________________________________________ Added: svn:ignore + build Added: trunk/ccm-ldn-userpreferences/application.xml =================================================================== --- trunk/ccm-ldn-userpreferences/application.xml (rev 0) +++ trunk/ccm-ldn-userpreferences/application.xml 2012-01-09 01:41:35 UTC (rev 2265) @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" + name="ccm-user-preferences" + prettyName="User Preferences" + version="6.6.0" + release="1" + webapp="ROOT"> + + <ccm:dependencies> + <ccm:requires name="ccm-core" version="6.6.0" relation="ge"/> + </ccm:dependencies> + + <ccm:contacts> + <ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/> + <ccm:contact uri="mailto:rh...@re..." type="support"/> + </ccm:contacts> + + <ccm:description> + The Red Hat Web Application Framework is a platform for writing + database-backed web applications in Java. + </ccm:description> + +</ccm:application> Property changes on: trunk/ccm-ldn-userpreferences/application.xml ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-userpreferences/pdl/com/arsdigita/london/userprefs/UserPrefs.pdl =================================================================== --- trunk/ccm-ldn-userpreferences/pdl/com/arsdigita/london/userprefs/UserPrefs.pdl (rev 0) +++ trunk/ccm-ldn-userpreferences/pdl/com/arsdigita/london/userprefs/UserPrefs.pdl 2012-01-09 01:41:35 UTC (rev 2265) @@ -0,0 +1,37 @@ +// +//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 + +model com.arsdigita.london.userprefs; + +import com.arsdigita.kernel.User; + +object type PersistentUserPrefs { + BigDecimal[1..1] id = user_prefs.id; + + unique User[0..1] user = join user_prefs.user_id to users.user_id; + unique Long[0..1] cookie = user_prefs.cookie; + component Pref[0..n] prefs = join user_prefs.id to user_pref.prefs_id; + + object key ( id ); +} + +object type Pref { + BigDecimal[1..1] id = user_pref.id; + + String[1..1] key = user_pref.key; + String[0..1] value = user_pref.value; + + object key ( id ); +} Property changes on: trunk/ccm-ldn-userpreferences/pdl/com/arsdigita/london/userprefs/UserPrefs.pdl ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-userpreferences/sql/ccm-user-preferences/oracle-se-create.sql =================================================================== --- trunk/ccm-ldn-userpreferences/sql/ccm-user-preferences/oracle-se-create.sql (rev 0) +++ trunk/ccm-ldn-userpreferences/sql/ccm-user-preferences/oracle-se-create.sql 2012-01-09 01:41:35 UTC (rev 2265) @@ -0,0 +1,3 @@ +@ ddl/oracle-se/create.sql +@ ddl/oracle-se/deferred.sql + Property changes on: trunk/ccm-ldn-userpreferences/sql/ccm-user-preferences/oracle-se-create.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-userpreferences/sql/ccm-user-preferences/postgres-create.sql =================================================================== --- trunk/ccm-ldn-userpreferences/sql/ccm-user-preferences/postgres-create.sql (rev 0) +++ trunk/ccm-ldn-userpreferences/sql/ccm-user-preferences/postgres-create.sql 2012-01-09 01:41:35 UTC (rev 2265) @@ -0,0 +1,4 @@ +begin; +\i ddl/postgres/create.sql +\i ddl/postgres/deferred.sql +end; Property changes on: trunk/ccm-ldn-userpreferences/sql/ccm-user-preferences/postgres-create.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-userpreferences/src/ccm-user-preferences.config =================================================================== --- trunk/ccm-ldn-userpreferences/src/ccm-user-preferences.config (rev 0) +++ trunk/ccm-ldn-userpreferences/src/ccm-user-preferences.config 2012-01-09 01:41:35 UTC (rev 2265) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<registry> + <!-- nothing yet --> +</registry> Property changes on: trunk/ccm-ldn-userpreferences/src/ccm-user-preferences.config ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-userpreferences/src/ccm-user-preferences.load =================================================================== --- trunk/ccm-ldn-userpreferences/src/ccm-user-preferences.load (rev 0) +++ trunk/ccm-ldn-userpreferences/src/ccm-user-preferences.load 2012-01-09 01:41:35 UTC (rev 2265) @@ -0,0 +1,18 @@ +<load> + <requires> + <table name="inits"/> + <table name="acs_objects"/> + <initializer class="com.arsdigita.core.Initializer"/> + </requires> + <provides> + <table name="user_prefs"/> + <table name="user_pref"/> + <initializer class="com.arsdigita.london.userprefs.Initializer"/> + </provides> + <scripts> + <schema directory="ccm-user-preferences"/> + <!-- + <data class="com.arsdigita.london.userprefs.Loader"/> + --> + </scripts> +</load> Property changes on: trunk/ccm-ldn-userpreferences/src/ccm-user-preferences.load ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/Initializer.java =================================================================== --- trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/Initializer.java (rev 0) +++ trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/Initializer.java 2012-01-09 01:41:35 UTC (rev 2265) @@ -0,0 +1,46 @@ +/* +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.userprefs; + +import com.arsdigita.db.DbHelper; +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.PDLInitializer; +import com.arsdigita.runtime.RuntimeConfig; + +/** + * Initializes the user preferences system + * @version $Id: Initializer.java 287 2005-02-22 00:29:02Z sskracic $ + */ +public class Initializer extends CompoundInitializer { + public Initializer() { + final String url = RuntimeConfig.getConfig().getJDBCURL(); + final int database = DbHelper.getDatabaseFromURL(url); + + add(new PDLInitializer + (new ManifestSource + ("ccm-user-preferences.pdl.mf", + new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl")))); + } + + public void init( DomainInitEvent evt ) { + PersistentUserPrefs.domainInit(); + Pref.domainInit(); + } +} Property changes on: trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/Initializer.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/PersistentUserPrefs.java =================================================================== --- trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/PersistentUserPrefs.java (rev 0) +++ trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/PersistentUserPrefs.java 2012-01-09 01:41:35 UTC (rev 2265) @@ -0,0 +1,232 @@ +/* +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.userprefs; + +import com.arsdigita.db.Sequences; +import com.arsdigita.domain.DomainCollection; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.domain.DomainObjectInstantiator; +import com.arsdigita.kernel.User; +import com.arsdigita.persistence.DataAssociation; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.util.UncheckedWrapperException; + +import java.sql.SQLException; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; + +import org.apache.log4j.Logger; + +public class PersistentUserPrefs extends DomainObject { + private static final Logger s_log = + Logger.getLogger( PersistentUserPrefs.class ); + + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.london.userprefs.PersistentUserPrefs"; + + public static final String ID = "id"; + public static final String USER = "user"; + public static final String PREFS = "prefs"; + public static final String COOKIE = "cookie"; + + PersistentUserPrefs() { + super( BASE_DATA_OBJECT_TYPE ); + + try { + set( ID, Sequences.getNextValue() ); + } catch( SQLException ex ) { + throw new UncheckedWrapperException( ex ); + } + } + + public PersistentUserPrefs( OID oid ) { + super( oid ); + } + + public PersistentUserPrefs( DataObject obj ) { + super( obj ); + } + + static void domainInit() { + DomainObjectFactory.registerInstantiator( + BASE_DATA_OBJECT_TYPE, + new DomainObjectInstantiator() { + protected DomainObject doNewInstance( DataObject obj ) { + return new PersistentUserPrefs( obj ); + } + } + ); + } + + static PersistentUserPrefs retrieveForUser( User user ) { + DataCollection pups = SessionManager.getSession().retrieve + ( BASE_DATA_OBJECT_TYPE ); + pups.addEqualsFilter( USER + "." + User.ID, user.getID() ); + + PersistentUserPrefs prefs = null; + if( pups.next() ) { + prefs = new PersistentUserPrefs( pups.getDataObject() ); + + if( pups.next() ) { + s_log.warn( "User " + user.getOID() + " has multiple user " + + "preferences" ); + } + } + pups.close(); + + return prefs; + } + + static PersistentUserPrefs retrieveForCookie( Long cookie ) { + DataCollection pups = SessionManager.getSession().retrieve + ( BASE_DATA_OBJECT_TYPE ); + pups.addEqualsFilter( COOKIE, cookie ); + + PersistentUserPrefs prefs = null; + if( pups.next() ) { + prefs = new PersistentUserPrefs( pups.getDataObject() ); + if( pups.next() ) { + s_log.warn( "Cookie " + cookie + " has multiple user " + + "preferences" ); + } + } + pups.close(); + + return prefs; + } + + public String getValue( String key ) { + DomainCollection prefs = getAllValues(); + prefs.addEqualsFilter( Pref.KEY, key ); + + String value = null; + if( prefs.next() ) { + value = (String) prefs.get( Pref.VALUE ); + + if( prefs.next() ) { + s_log.warn( "Users prefs " + getOID() + " has multiple " + + "values for " + key ); + } + } + prefs.close(); + + return value; + } + + public DomainCollection getAllValues() { + DataAssociation prefs = (DataAssociation) get( PREFS ); + return new DomainCollection( prefs.getDataAssociationCursor() ); + } + + public void removeValue( String key ) { + DomainCollection prefs = getAllValues(); + prefs.addEqualsFilter( Pref.KEY, key ); + + while( prefs.next() ) { + prefs.getDomainObject().delete(); + } + } + + public void setValue( String key, String value ) { + DomainCollection prefs = getAllValues(); + prefs.addEqualsFilter( Pref.KEY, key ); + + Pref pref; + if( prefs.next() ) { + pref = (Pref) prefs.getDomainObject(); + + if( prefs.next() ) { + s_log.warn( "Users prefs " + getOID() + " has multiple " + + "values for " + key ); + } + } else { + pref = new Pref(); + pref.setKey( key ); + } + prefs.close(); + + pref.setValue( value ); + if( pref.isNew() ) { + add( PREFS, pref ); + } + } + + public void setAllValues( Map newPrefs ) { + if( newPrefs.isEmpty() ) { + s_log.debug( "All values removed. Deleting prefs object." ); + delete(); + return; + } + + s_log.debug( "Setting all values" ); + + HashSet newKeys = new HashSet( newPrefs.keySet() ); + DomainCollection prefs = getAllValues(); + + while( prefs.next() ) { + String key = (String) prefs.get( Pref.KEY ); + String value = (String) prefs.get( Pref.VALUE ); + + if( !newKeys.contains( key ) ) { + prefs.getDomainObject().delete(); + } + + else { + String newValue = (String) newPrefs.get( key ); + if( !value.equals( newValue ) ) { + Pref pref = (Pref) prefs.getDomainObject(); + pref.setValue( newValue ); + } + + newKeys.remove( key ); + } + } + + Iterator i = newKeys.iterator(); + while( i.hasNext() ) { + String key = (String) i.next(); + + Pref pref = new Pref(); + pref.setKey( key ); + pref.setValue( (String) newPrefs.get( key ) ); + + add( PREFS, pref ); + } + } + + void setUser( User user ) { + setAssociation( USER, user ); + } + + User getUser() { + return (User) DomainObjectFactory.newInstance + ( (DataObject) get( USER ) ); + } + + void setCookie( Long cookie ) { + set( COOKIE, cookie ); + } + + Long getCookie() { + return (Long) get( COOKIE ); + } +} Property changes on: trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/PersistentUserPrefs.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/Pref.java =================================================================== --- trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/Pref.java (rev 0) +++ trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/Pref.java 2012-01-09 01:41:35 UTC (rev 2265) @@ -0,0 +1,85 @@ +/* +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.userprefs; + +import com.arsdigita.db.Sequences; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.domain.DomainObjectInstantiator; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import com.arsdigita.util.UncheckedWrapperException; + +import java.sql.SQLException; + +import org.apache.log4j.Logger; + +public class Pref extends DomainObject { + private static final Logger s_log = Logger.getLogger( Pref.class ); + + public static final String ID = "id"; + public static final String KEY = "key"; + public static final String VALUE = "value"; + + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.london.userprefs.Pref"; + + Pref() { + super( BASE_DATA_OBJECT_TYPE ); + + try { + set( ID, Sequences.getNextValue() ); + } catch( SQLException ex ) { + throw new UncheckedWrapperException( ex ); + } + } + + public Pref( OID oid ) { + super( oid ); + } + + public Pref( DataObject obj ) { + super( obj ); + } + + static void domainInit() { + DomainObjectFactory.registerInstantiator( + BASE_DATA_OBJECT_TYPE, + new DomainObjectInstantiator() { + protected DomainObject doNewInstance( DataObject obj ) { + return new Pref( obj ); + } + } + ); + } + + public String getKey() { + return get( KEY ).toString(); + } + + void setKey( String key ) { + set( KEY, key ); + } + + public String getValue() { + return get( VALUE ).toString(); + } + + void setValue( String value ) { + set( VALUE, value ); + } +} Property changes on: trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/Pref.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/UserPrefs.java =================================================================== --- trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/UserPrefs.java (rev 0) +++ trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/UserPrefs.java 2012-01-09 01:41:35 UTC (rev 2265) @@ -0,0 +1,349 @@ +/* +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.userprefs; + +import com.arsdigita.caching.CacheTable; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.domain.DomainCollection; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.User; +import com.arsdigita.persistence.OID; +import com.arsdigita.util.UncheckedWrapperException; + +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Random; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.log4j.Logger; + +/** + * <p>User Preferences. An object for storing user preferences in the current + * session.</p> + * + * <p>This object is an abstraction of PersistentUserPreferences, which is a + * <code>DomainObject</code> stored in the database. <code>UserPrefs</code> is + * cached in the java Session and will not touch the database on every + * request.</p> + * + * <p>If the current user is not logged in, <code>UserPrefs</code> will use its + * own cookie. This means that preferences can be saved even when a user doesn't + * log in.</p> + * + * @author Matthew Booth <mb...@re...> + */ + +public class UserPrefs { + private static final Logger s_log = Logger.getLogger( UserPrefs.class ); + + private static final String COOKIE = "WAF_USER_PREFS"; + static final String SESSION_ATTRIBUTE = UserPrefs.class.getName(); + + private OID m_user = null; + private OID m_persistentPrefs = null; + private Long m_cookie = null; + + private HashMap m_prefs = new HashMap(); + + private static final CacheTable s_prefsCache = + new CacheTable( "user_preferences" ); + + private UserPrefs() {}; + + private UserPrefs( PersistentUserPrefs persistentPrefs ) { + init( persistentPrefs ); + } + + private void init( PersistentUserPrefs persistentPrefs ) { + m_persistentPrefs = persistentPrefs.getOID(); + m_cookie = persistentPrefs.getCookie(); + m_user = persistentPrefs.getUser() == null ? + null : persistentPrefs.getUser().getOID(); + + DomainCollection prefs = persistentPrefs.getAllValues(); + while( prefs.next() ) { + Pref pref = (Pref) prefs.getDomainObject(); + m_prefs.put( pref.getKey(), pref.getValue() ); + } + } + + /** + * <p>Retrieve a UserPrefs object for the current request.</p> + * + * <p>In order, this will: + * + * <ul> + * <li>Look for prefs in the http session</li> + * <li>Look for prefs for the currently logged in user</li> + * <li>Look for prefs for a supplied cookie (from DB)</li> + * <li>Create a new preferences object</li> + * </ul> + * </p> + */ + public static UserPrefs retrieve( HttpServletRequest req, + HttpServletResponse res ) { + HttpSession session = req.getSession(); + + // Yes, this seems like a silly use of an HttpSession, but they really + // are broken in almost every useful way. + UserPrefs prefs = (UserPrefs) s_prefsCache.get( session.getId() ); + + if( null != prefs ) { + if( s_log.isDebugEnabled() ) { + s_log.debug( "Retrieved user prefs for session " + + session.getId() ); + } + return prefs; + } + + PersistentUserPrefs persistentPrefs = retrievePersistent( req, res ); + if( null != persistentPrefs ) { + prefs = new UserPrefs( persistentPrefs ); + } else { + prefs = new UserPrefs(); + + User user = (User) Kernel.getContext().getParty(); + if( null != user ) { + prefs.m_user = user.getOID(); + } else { + Long cookie; + try { + SecureRandom random = SecureRandom.getInstance( "SHA1PRNG" ); + cookie = new Long( random.nextLong() ); + } catch( NoSuchAlgorithmException ex ) { + s_log.warn( "Unable to get SecureRandom for SHA1PRNG. " + + "Falling back to insecure random generator." ); + cookie = new Long( new Random().nextLong() ); + } + + prefs.m_cookie = cookie; + setCookie( res, cookie.toString() ); + } + + s_log.debug( "Created new prefs" ); + } + + s_prefsCache.put( session.getId(), prefs ); + return prefs; + } + + private static PersistentUserPrefs retrievePersistent + ( HttpServletRequest req, HttpServletResponse res ) + { + PersistentUserPrefs persistentPrefs = null; + + User user = (User) Kernel.getContext().getParty(); + if( null != user ) { + persistentPrefs = PersistentUserPrefs.retrieveForUser( user ); + } + + if( null != persistentPrefs ) { + s_log.debug( "Got prefs for user" ); + return persistentPrefs; + } + + Long cookie = getCookie( req ); + if( null != cookie ) { + persistentPrefs = PersistentUserPrefs.retrieveForCookie( cookie ); + + // Remove a bogus cookie + if( null == persistentPrefs ) { + removeCookie( res ); + } + } + + if( null != persistentPrefs ) { + s_log.debug( "Got prefs for cookie" ); + return persistentPrefs; + } + + s_log.debug( "No existing prefs" ); + return null; + } + + /** + * Retrieve the value of a user preference entry. + * + * @param key The identifier of the preference to be retrieved + * @return The value of the requsted preference, or null if it is not set + */ + public String get( String key ) { + return (String) m_prefs.get( key ); + } + + /** + * Retrieve all stored user preferences. + * + * @return An Iterator of Map.Entry objects containing key/value pairs for + * the user's current preferences + */ + public Iterator getAll() { + return m_prefs.entrySet().iterator(); + } + + /** + * Set a preference. + * + * @param key The identifier of the preference to be stored + * @param value The value of the preference to be stored + */ + public void set( String key, String value, + HttpServletRequest req, HttpServletResponse res ) { + m_prefs.put( key, value ); + + PersistentUserPrefs prefs = getPersistent(); + if( null == prefs ) prefs = createPersistent( req, res ); + prefs.setValue( key, value ); + } + + /** + * Remove a user preference. + * + * @param key The identifier of the preference to be removed + */ + public void remove( String key, HttpServletRequest req ) { + m_prefs.remove( key ); + + PersistentUserPrefs persistent = getPersistent(); + + if( !m_prefs.isEmpty() ) { + if( null != persistent ) persistent.removeValue( key ); + } else { + if( null != persistent ) persistent.delete(); + + req.getSession().setAttribute( SESSION_ATTRIBUTE, null ); + m_persistentPrefs = null; + } + } + + /** + * Save user preferences to the database + */ + public void persist( HttpServletRequest req, + HttpServletResponse res ) { + s_log.info( "Persisting session" ); + + PersistentUserPrefs prefs = getPersistent(); + if( null == prefs ) prefs = createPersistent( req, res ); + + prefs.setAllValues( m_prefs ); + prefs.save(); + + s_log.debug( "Session persisted" ); + } + + /** + * Get a PersistentUserPrefs object. Create one if necessary. + */ + private PersistentUserPrefs getPersistent() { + PersistentUserPrefs prefs = null; + + if( null != m_persistentPrefs ) { + try { + prefs = new PersistentUserPrefs( m_persistentPrefs ); + } catch( DataObjectNotFoundException ex ) { + s_log.warn( "User preferences object contained bogus " + + "persistent preferences OID" ); + } + } + + // If we're saving something and we have a user object now, use that + // in preference + if( null == m_user ) { + User user = (User) Kernel.getContext().getParty(); + if( null != user ) { + prefs.setUser( user ); + prefs.setCookie( null ); + } + } + + return prefs; + } + + private PersistentUserPrefs createPersistent( HttpServletRequest req, + HttpServletResponse res ) { + PersistentUserPrefs prefs = retrievePersistent( req, res ); + if( null == prefs ) { + prefs = new PersistentUserPrefs(); + + if( s_log.isDebugEnabled() ) { + s_log.debug( "Initializing new user preferences: " + + prefs.getOID() ); + } + + if( null != m_user ) { + prefs.setUser( new User( m_user ) ); + } + + else if( null != m_cookie ) { + prefs.setCookie( m_cookie ); + } + + else { + throw new UncheckedWrapperException ( "User preferences object doesn't contain either a user or a cookie object" ); + } + + m_persistentPrefs = prefs.getOID(); + } else { + if( s_log.isDebugEnabled() ) { + s_log.debug( "Reusing existing persistent preferences " + + prefs.getOID() ); + } + + init( prefs ); + } + + return prefs; + } + + private static Long getCookie( HttpServletRequest req ) { + Cookie[] cookieJar = req.getCookies(); + if( null == cookieJar ) return null; + + for( int i = 0; i < cookieJar.length; i++ ) { + if( COOKIE.equals( cookieJar[i].getName() ) ) { + try { + return Long.valueOf( cookieJar[i].getValue() ); + } catch( NumberFormatException ex ) { + s_log.warn( "Bogus cookie value: " + + cookieJar[i].getValue() ); + // Might as well keep looking + } + } + } + + return null; + } + + private static void setCookie( HttpServletResponse res, String value ) { + Cookie cookie = new Cookie( COOKIE, value ); + cookie.setMaxAge( Integer.MAX_VALUE ); + res.addCookie( cookie ); + } + + private static void removeCookie( HttpServletResponse res ) { + Cookie cookie = new Cookie( COOKIE, "" ); + cookie.setMaxAge( 0 ); + res.addCookie( cookie ); + } +} Property changes on: trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/UserPrefs.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/ui/UserPrefsComponent.java =================================================================== --- trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/ui/UserPrefsComponent.java (rev 0) +++ trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/ui/UserPrefsComponent.java 2012-01-09 01:41:35 UTC (rev 2265) @@ -0,0 +1,133 @@ +/* +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.userprefs.ui; + +import com.arsdigita.london.userprefs.UserPrefs; + +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SimpleComponent; +import com.arsdigita.bebop.event.RequestEvent; +import com.arsdigita.bebop.event.RequestListener; +import com.arsdigita.bebop.parameters.BooleanParameter; +import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.util.UncheckedWrapperException; +import com.arsdigita.web.RedirectSignal; +import com.arsdigita.xml.Element; + +import java.io.IOException; +import java.util.Iterator; +import java.util.Map; + +import org.apache.log4j.Logger; + +public class UserPrefsComponent extends SimpleComponent { + private static final Logger s_log = + Logger.getLogger( UserPrefsComponent.class ); + + public static final String XMLNS = "http://xmlns.redhat.com/userprefs/1.0"; + + public UserPrefsComponent() { + super(); + } + + private StringParameter m_setKey = new StringParameter( "pref.set.key" ); + private StringParameter m_setValue = new StringParameter( "pref.set.value" ); + private StringParameter m_remove = new StringParameter( "pref.remove" ); + private BooleanParameter m_immediate = new BooleanParameter( "pref.immediate" ); + + public void generateXML( PageState ps, Element parent ) { + UserPrefs prefs = UserPrefs.retrieve( ps.getRequest(), + ps.getResponse() ); + + Element rootE = parent.newChildElement( "up:userPreferences", XMLNS ); + + Iterator values = prefs.getAll(); + while( values.hasNext() ) { + Map.Entry pref = (Map.Entry) values.next(); + + String key = (String) pref.getKey(); + String value = (String) pref.getValue(); + + Element prefE = rootE.newChildElement( "up:preference", XMLNS ); + prefE.addAttribute( "key", key ); + + if( null != value ) { + prefE.addAttribute( "value", value ); + } + } + } + + public void register( Page p ) { + super.register( p ); + + p.addGlobalStateParam( m_setKey ); + p.addGlobalStateParam( m_setValue ); + p.addGlobalStateParam( m_remove ); + p.addGlobalStateParam( m_immediate ); + + p.addRequestListener( new RequestListener() { + public void pageRequested( RequestEvent ev ) { + PageState ps = ev.getPageState(); + + String setKey = (String) ps.getValue( m_setKey ); + String setValue = (String) ps.getValue( m_setValue ); + String remove = (String) ps.getValue( m_remove ); + + UserPrefs prefs = UserPrefs.retrieve( ps.getRequest(), + ps.getResponse() ); + + boolean acted = false; + + if( null != setKey ) { + if( s_log.isDebugEnabled() ) { + s_log.debug( "Set in " + + ps.getRequest().getRequestURI() + '?' + + ps.getRequest().getQueryString() ); + } + + prefs.set( setKey, setValue, + ps.getRequest(), ps.getResponse() ); + acted = true; + } + + if( null != remove ) { + if( s_log.isDebugEnabled() ) { + s_log.debug( "Remove in " + + ps.getRequest().getRequestURI() + '?' + + ps.getRequest().getQueryString() ); + } + + prefs.remove( remove, ps.getRequest() ); + acted = true; + } + + if( acted ) { + ps.setValue( m_setKey, null ); + ps.setValue( m_setValue, null ); + ps.setValue( m_remove, null ); + + try { + throw new RedirectSignal( ps.stateAsURL(), true ); + } catch( IOException ex ) { + throw new UncheckedWrapperException( ex ); + } + } + } + } ); + } +} Property changes on: trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/ui/UserPrefsComponent.java ___________________________________________________________________ Added: svn:executable + |
Author: pboy Date: 2012-01-09 01:36:00 +0000 (Mon, 09 Jan 2012) New Revision: 2264 Added: trunk/ccm-ldn-types-contact/ trunk/ccm-ldn-types-contact/.svnignore trunk/ccm-ldn-types-contact/application.xml trunk/ccm-ldn-types-contact/pdl/ trunk/ccm-ldn-types-contact/pdl/com/ trunk/ccm-ldn-types-contact/pdl/com/arsdigita/ trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/Contact.pdl trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactAddress.pdl trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactPhone.pdl trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactType.pdl trunk/ccm-ldn-types-contact/sql/ trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/ trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/default/ trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/default/upgrade/ trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/default/upgrade/6.5.0-6.5.1/ trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/oracle-se-create.sql trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/postgres-create.sql trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/ trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/oracle-se-6.5.0-6.5.1.sql trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/postgres-6.5.0-6.5.1.sql trunk/ccm-ldn-types-contact/src/ trunk/ccm-ldn-types-contact/src/WEB-INF/ trunk/ccm-ldn-types-contact/src/WEB-INF/content-types/ trunk/ccm-ldn-types-contact/src/WEB-INF/content-types/com/ trunk/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/ trunk/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/ trunk/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/ trunk/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml trunk/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/ trunk/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/com/ trunk/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/ trunk/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/ trunk/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/ trunk/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Contact.xml trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.config trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.load trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.upgrade trunk/ccm-ldn-types-contact/src/com/ trunk/ccm-ldn-types-contact/src/com/arsdigita/ trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/ trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ContactAddress.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ContactInitializer.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ContactLoader.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ContactPhone.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ContactResources.properties trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ContactType.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ContactTypesCollection.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/PhonesCollection.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/package.html trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ui/ trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/ trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/AddContactPropertiesStep.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/AddContactToItemForm.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/AddressProperties.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/AddressPropertyForm.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/ContactCreate.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/ContactPropertiesStep.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/ContactPropertyForm.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/CreatePhone.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/PhonesPanel.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/PhonesTable.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/util/ trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/util/ContactGlobalizationUtil.java trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/util/ContactResourceBundle.java trunk/ccm-ldn-types-contact/web/ trunk/ccm-ldn-types-contact/web/static/ trunk/ccm-ldn-types-contact/web/static/content-types/ trunk/ccm-ldn-types-contact/web/static/content-types/com/ trunk/ccm-ldn-types-contact/web/static/content-types/com/arsdigita/ trunk/ccm-ldn-types-contact/web/static/content-types/com/arsdigita/cms/ trunk/ccm-ldn-types-contact/web/static/content-types/com/arsdigita/cms/contenttypes/ trunk/ccm-ldn-types-contact/web/static/content-types/com/arsdigita/cms/contenttypes/Contact.xsl trunk/ccm-ldn-types-esdservice/ trunk/ccm-ldn-types-esdservice/.svnignore trunk/ccm-ldn-types-esdservice/application.xml trunk/ccm-ldn-types-esdservice/pdl/ trunk/ccm-ldn-types-esdservice/pdl/com/ trunk/ccm-ldn-types-esdservice/pdl/com/arsdigita/ trunk/ccm-ldn-types-esdservice/pdl/com/arsdigita/london/ trunk/ccm-ldn-types-esdservice/pdl/com/arsdigita/london/content-types/ trunk/ccm-ldn-types-esdservice/pdl/com/arsdigita/london/content-types/ESDService.pdl trunk/ccm-ldn-types-esdservice/sql/ trunk/ccm-ldn-types-esdservice/sql/ccm-ldn-types-esdservice/ trunk/ccm-ldn-types-esdservice/sql/ccm-ldn-types-esdservice/oracle-se-create.sql trunk/ccm-ldn-types-esdservice/sql/ccm-ldn-types-esdservice/postgres-create.sql trunk/ccm-ldn-types-esdservice/src/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/content-types/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/content-types/com/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/content-types/com/arsdigita/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/content-types/com/arsdigita/london/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/content-types/com/arsdigita/london/contenttypes/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/content-types/com/arsdigita/london/contenttypes/ESDService.xml trunk/ccm-ldn-types-esdservice/src/WEB-INF/traversal-adapters/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/traversal-adapters/com/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/traversal-adapters/com/arsdigita/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/traversal-adapters/com/arsdigita/cms/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/ESDService.xml trunk/ccm-ldn-types-esdservice/src/ccm-cms-types-esdservice.config trunk/ccm-ldn-types-esdservice/src/ccm-cms-types-esdservice.load trunk/ccm-ldn-types-esdservice/src/com/ trunk/ccm-ldn-types-esdservice/src/com/arsdigita/ trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/ trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/ trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/ESDService.java trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/ESDServiceInitializer.java trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/ESDServiceLoader.java trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/ESDServiceResources.properties trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/package.html trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/ui/ trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/ui/ESDServiceChooseContactStep.java trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/ui/ESDServiceContactsTable.java trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/ui/ESDServicePropertiesForm.java trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/ui/ESDServicePropertiesStep.java trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/util/ trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/util/ESDServiceGlobalizationUtil.java trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/util/ESDServiceResourceBundle.java trunk/ccm-ldn-types-esdservice/web/ trunk/ccm-ldn-types-esdservice/web/static/ trunk/ccm-ldn-types-esdservice/web/static/content-types/ trunk/ccm-ldn-types-esdservice/web/static/content-types/com/ trunk/ccm-ldn-types-esdservice/web/static/content-types/com/arsdigita/ trunk/ccm-ldn-types-esdservice/web/static/content-types/com/arsdigita/london/ trunk/ccm-ldn-types-esdservice/web/static/content-types/com/arsdigita/london/contenttypes/ trunk/ccm-ldn-types-esdservice/web/static/content-types/com/arsdigita/london/contenttypes/ESDService.xsl Removed: trunk/ccm-cms-types-contact/ trunk/ccm-cms-types-esdservice/ Modified: trunk/ccm-core/src/com/arsdigita/bebop/form/SingleSelect.java trunk/ccm-core/src/com/arsdigita/ui/UIConfig.java trunk/ccm-core/src/com/arsdigita/web/Application.java trunk/ccm-ldn-aplaws/bundles/custom/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/custom/cfg/project.xml trunk/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/demo/cfg/project.xml trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml trunk/ccm-ldn-aplaws/bundles/extended/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/extended/cfg/project.xml trunk/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/standard/cfg/project.xml trunk/ccm-ldn-rss/src/com/arsdigita/london/rss/Loader.java trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/RootCategoryPicker.java Log: moved ccm-cms-types-contact and esdservice to ccm-ldn-types-contact rsp esdservice because they are very specific to GB LAWS, following the naming convention. Adapt several modules to the new naming. No update script yet. Modified: trunk/ccm-core/src/com/arsdigita/bebop/form/SingleSelect.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/bebop/form/SingleSelect.java 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-core/src/com/arsdigita/bebop/form/SingleSelect.java 2012-01-09 01:36:00 UTC (rev 2264) @@ -22,16 +22,16 @@ import com.arsdigita.bebop.parameters.ParameterModel; /** - * A class - * representing an HTML <code>SELECT</code> element with - * a single selection. + * A class representing an HTML <code>SELECT</code> element with + * a single selection. * * @author Karl Goldstein * @author Uday Mathur * @author Rory Solomon * @author Michael Pih * @author Christian Brechbühler (chr...@ar...) - * @version $Id$ */ + * @version $Id$ + */ public class SingleSelect extends Select { /** The XML tag. @@ -67,6 +67,7 @@ /** State that this is a single select * @return false */ + @Override public boolean isMultiple() { return false; } Modified: trunk/ccm-core/src/com/arsdigita/ui/UIConfig.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/UIConfig.java 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-core/src/com/arsdigita/ui/UIConfig.java 2012-01-09 01:36:00 UTC (rev 2264) @@ -241,7 +241,10 @@ } /** - * Retrieve systems root page (entry page) url. + * Retrieve the site's root page url - i.e. the front page, the + * (usually public) top level entry page for the site. + * By default it is the login page, but usually the root page of the main + * presentation application, e.g. portal, navigation, forum, etc. * * @return root page url */ Modified: trunk/ccm-core/src/com/arsdigita/web/Application.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/web/Application.java 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-core/src/com/arsdigita/web/Application.java 2012-01-09 01:36:00 UTC (rev 2264) @@ -247,7 +247,9 @@ final Application parent, final boolean createContainerGroup) { - final Application app = (Application) Resource.createResource(type, title, parent); + final Application app = (Application) Resource.createResource(type, + title, + parent); if (createContainerGroup) { app.createGroup(); } @@ -444,6 +446,10 @@ } // COMPAT XXX + /** + * @deprecated refactor not using deprecated class PackageType. Use + * ApplicationType instead + */ public PackageType getPackageType() { return getApplicationType().getPackageType(); } @@ -488,13 +494,23 @@ return children; } + /** + * + * @param applicationType + * @return + */ public ApplicationCollection getChildApplicationsForType - (String applicationType) { + (String applicationType) { ApplicationCollection children = getChildApplications(); children.addEqualsFilter("objectType", applicationType); return children; } + /** + * + * @return + * @deprecated refactor to use other methods of class aüpplication instead + */ private PackageInstance getPackageInstance() { DataObject dataObject = (DataObject) get("packageInstance"); @@ -503,13 +519,23 @@ return new PackageInstance(dataObject); } + /** + * + * @return + * @deprecated refactor to use other methods of class aüpplication instead + */ private void setPackageInstance(PackageInstance packageInstance) { Assert.exists(packageInstance, PackageInstance.class); setAssociation("packageInstance", packageInstance); } - // Can return null. XXX Needs to be getSiteNodes instead. + /** + * + * Needs to be getSiteNodes instead. + * @return Can return null. + * @deprecated + */ public SiteNode getSiteNode() { DataObject packageInstance = (DataObject)get("packageInstance"); @@ -629,10 +655,16 @@ return getApplicationType().getRelevantPrivileges(); } + /** + * Retrieve all installed applications (portlets excluded). + * @return a collection of installed + */ public static ApplicationCollection retrieveAllApplications() { DataCollection dataCollection = SessionManager.getSession().retrieve(BASE_DATA_OBJECT_TYPE); + // exclude all portlets (no application at all) and portal panes + // (no application but sort of "sub-application"). dataCollection.addEqualsFilter ("resourceType.hasFullPageView", Boolean.TRUE); @@ -641,7 +673,26 @@ return apps; } + /** + * Retrieve all installed applications (portlets excluded). + * @return a collection of installed + */ + public static ApplicationCollection retrieveAllApplications(String + applicationType) { + DataCollection dataCollection = SessionManager.getSession() + .retrieve(BASE_DATA_OBJECT_TYPE); + // exclude all portlets (no application at all) and portal panes + // (no application but sort of "sub-application"). + dataCollection.addEqualsFilter + ("resourceType.hasFullPageView", Boolean.TRUE); + dataCollection.addEqualsFilter("objectType", applicationType); + + ApplicationCollection apps = new ApplicationCollection(dataCollection); + + return apps; + } + public static boolean isInstalled (String applicationObjectType, String path) { DataCollection dataCollection = Modified: trunk/ccm-ldn-aplaws/bundles/custom/cfg/integration.properties =================================================================== --- trunk/ccm-ldn-aplaws/bundles/custom/cfg/integration.properties 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-ldn-aplaws/bundles/custom/cfg/integration.properties 2012-01-09 01:36:00 UTC (rev 2264) @@ -47,7 +47,7 @@ com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp -com.arsdigita.cms.default_template_resolver_class=com.arsdigita.london.subsite.dispatcher.SubsiteItemTemplateResolver +com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box Modified: trunk/ccm-ldn-aplaws/bundles/custom/cfg/project.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/custom/cfg/project.xml 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-ldn-aplaws/bundles/custom/cfg/project.xml 2012-01-09 01:36:00 UTC (rev 2264) @@ -36,7 +36,6 @@ <ccm:application name="ccm-ldn-aplaws"/> <ccm:application name="ccm-ldn-atoz"/> <ccm:application name="ccm-ldn-dublin"/> - <ccm:application name="ccm-ldn-search"/> <ccm:application name="ccm-ldn-shortcuts"/> <ccm:application name="ccm-ldn-subsite"/> <ccm:application name="ccm-ldn-rss"/> @@ -45,6 +44,7 @@ <ccm:application name="ccm-navigation"/> <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-search"/> <ccm:application name="ccm-themedirector"/> Modified: trunk/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties =================================================================== --- trunk/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties 2012-01-09 01:36:00 UTC (rev 2264) @@ -47,7 +47,7 @@ com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp -com.arsdigita.cms.default_template_resolver_class=com.arsdigita.london.subsite.dispatcher.SubsiteItemTemplateResolver +com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box Modified: trunk/ccm-ldn-aplaws/bundles/demo/cfg/project.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/demo/cfg/project.xml 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-ldn-aplaws/bundles/demo/cfg/project.xml 2012-01-09 01:36:00 UTC (rev 2264) @@ -70,7 +70,6 @@ <ccm:application name="ccm-ldn-rss"/> <ccm:application name="ccm-ldn-search"/> <ccm:application name="ccm-ldn-shortcuts"/> - <ccm:application name="ccm-ldn-subsite"/> <ccm:application name="ccm-ldn-terms"/> <ccm:application name="ccm-ldn-util"/> @@ -82,6 +81,7 @@ <ccm:application name="ccm-navigation"/> <ccm:application name="ccm-portalserver"/> <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-subsite"/> <ccm:application name="ccm-themedirector"/> Modified: trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties 2012-01-09 01:36:00 UTC (rev 2264) @@ -48,7 +48,7 @@ com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp -com.arsdigita.cms.default_template_resolver_class=com.arsdigita.london.subsite.dispatcher.SubsiteItemTemplateResolver +com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box Modified: trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml 2012-01-09 01:36:00 UTC (rev 2264) @@ -81,13 +81,13 @@ <ccm:application name="ccm-ldn-rss"/> <ccm:application name="ccm-ldn-search"/> <ccm:application name="ccm-ldn-shortcuts"/> - <ccm:application name="ccm-ldn-subsite"/> <ccm:application name="ccm-ldn-terms"/> <ccm:application name="ccm-ldn-util"/> <ccm:application name="ccm-navigation"/> <ccm:application name="ccm-portalserver"/> <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-subsite"/> <!-- Currently broken. Missing file: ccm-portlet/postgres-create.sql <ccm:application name="ccm-portlet"/> --> Modified: trunk/ccm-ldn-aplaws/bundles/extended/cfg/integration.properties =================================================================== --- trunk/ccm-ldn-aplaws/bundles/extended/cfg/integration.properties 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-ldn-aplaws/bundles/extended/cfg/integration.properties 2012-01-09 01:36:00 UTC (rev 2264) @@ -47,7 +47,7 @@ com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp -com.arsdigita.cms.default_template_resolver_class=com.arsdigita.london.subsite.dispatcher.SubsiteItemTemplateResolver +com.arsdigita.cms.default_template_resolver_class=com.arsdigita.dispatcher.SubsiteItemTemplateResolver ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box Modified: trunk/ccm-ldn-aplaws/bundles/extended/cfg/project.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/extended/cfg/project.xml 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-ldn-aplaws/bundles/extended/cfg/project.xml 2012-01-09 01:36:00 UTC (rev 2264) @@ -53,6 +53,7 @@ <ccm:application name="ccm-forum"/> <ccm:application name="ccm-navigation"/> <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-subsite"/> <ccm:application name="ccm-themedirector"/> <!-- ldn extensions (LAW functionality) --> @@ -65,7 +66,6 @@ <ccm:application name="ccm-ldn-rss"/> <ccm:application name="ccm-ldn-search"/> <ccm:application name="ccm-ldn-shortcuts"/> - <ccm:application name="ccm-ldn-subsite"/> <ccm:application name="ccm-ldn-terms"/> <ccm:application name="ccm-ldn-util"/> Modified: trunk/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties =================================================================== --- trunk/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties 2012-01-09 01:36:00 UTC (rev 2264) @@ -47,7 +47,7 @@ com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp -com.arsdigita.cms.default_template_resolver_class=com.arsdigita.london.subsite.dispatcher.SubsiteItemTemplateResolver +com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box Modified: trunk/ccm-ldn-aplaws/bundles/standard/cfg/project.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/standard/cfg/project.xml 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-ldn-aplaws/bundles/standard/cfg/project.xml 2012-01-09 01:36:00 UTC (rev 2264) @@ -53,13 +53,13 @@ <ccm:application name="ccm-ldn-rss"/> <ccm:application name="ccm-ldn-search"/> <ccm:application name="ccm-ldn-shortcuts"/> - <ccm:application name="ccm-ldn-subsite"/> <ccm:application name="ccm-ldn-terms"/> <ccm:application name="ccm-ldn-util"/> <!-- Extra apps --> <ccm:application name="ccm-forum"/> <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-subsite"/> <ccm:application name="ccm-themedirector"/> Modified: trunk/ccm-ldn-rss/src/com/arsdigita/london/rss/Loader.java =================================================================== --- trunk/ccm-ldn-rss/src/com/arsdigita/london/rss/Loader.java 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-ldn-rss/src/com/arsdigita/london/rss/Loader.java 2012-01-09 01:36:00 UTC (rev 2264) @@ -20,17 +20,17 @@ import com.arsdigita.categorization.CategoryPurpose; import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.domain.DomainObject; -import com.arsdigita.kernel.ACSObjectInstantiator; +// import com.arsdigita.domain.DomainObject; +// import com.arsdigita.kernel.ACSObjectInstantiator; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; import com.arsdigita.loader.PackageLoader; -import com.arsdigita.persistence.DataObject; +// import com.arsdigita.persistence.DataObject; import com.arsdigita.portal.PortletType; import com.arsdigita.runtime.ScriptContext; import com.arsdigita.london.rss.portlet.WorkspaceDirectoryPortlet; import com.arsdigita.web.Application; -import com.arsdigita.web.ApplicationSetup; +// import com.arsdigita.web.ApplicationSetup; import com.arsdigita.web.ApplicationType; import com.arsdigita.web.URL; Modified: trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/RootCategoryPicker.java =================================================================== --- trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/RootCategoryPicker.java 2012-01-08 17:43:22 UTC (rev 2263) +++ trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/RootCategoryPicker.java 2012-01-09 01:36:00 UTC (rev 2264) @@ -29,12 +29,25 @@ import com.arsdigita.persistence.SessionManager; +/** + * + * + */ public class RootCategoryPicker extends AbstractCategoryPicker { + /** + * + * @param name + */ public RootCategoryPicker(String name) { super(name); } + /** + * + * @param state + * @param target + */ protected void addOptions(PageState state, SingleSelect target) { DataCollection domains = SessionManager.getSession() Property changes on: trunk/ccm-ldn-types-contact ___________________________________________________________________ Added: svn:ignore + build Added: trunk/ccm-ldn-types-contact/.svnignore =================================================================== --- trunk/ccm-ldn-types-contact/.svnignore (rev 0) +++ trunk/ccm-ldn-types-contact/.svnignore 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1 @@ +build Property changes on: trunk/ccm-ldn-types-contact/.svnignore ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-types-contact/application.xml =================================================================== --- trunk/ccm-ldn-types-contact/application.xml (rev 0) +++ trunk/ccm-ldn-types-contact/application.xml 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" + name="ccm-ldn-types-contact" + prettyName="Red Hat CCM Content Types" + version="6.6.0" + release="1" + webapp="ROOT"> + <ccm:dependencies> + <ccm:requires name="ccm-core" version="6.6.0" relation="ge"/> + <ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/> + </ccm:dependencies> + <ccm:directories> + <ccm:directory name="pdl"/> + <ccm:directory name="sql"/> + <ccm:directory name="src"/> + </ccm:directories> + <ccm:contacts> + <ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/> + <ccm:contact uri="mailto:rh...@re..." type="support"/> + </ccm:contacts> + <ccm:description> + The London Contact Content Type for the Red Hat CCM CMS. + </ccm:description> +</ccm:application> Property changes on: trunk/ccm-ldn-types-contact/application.xml ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/Contact.pdl =================================================================== --- trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/Contact.pdl (rev 0) +++ trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/Contact.pdl 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,88 @@ +// +// Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of +// the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $Id: Contact.pdl 1689 2007-10-26 11:06:23Z chrisg23 $ +// $DateTime: 2004/08/17 23:15:09 $ +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.cms.ContentPage; +import com.arsdigita.cms.ContentItem; + +// object type to hold Contact content type +object type Contact extends ContentPage { + + String [0..1] givenName = ct_contacts.given_name VARCHAR(1000); + String [0..1] familyName = ct_contacts.family_name VARCHAR(1000); + String [0..1] suffix = ct_contacts.suffix VARCHAR(100); + String [0..1] emails = ct_contacts.emails VARCHAR(500); + String [0..1] description = ct_contacts.description VARCHAR(2000); + String [0..1] orgName = ct_contacts.orgname VARCHAR(2000); + String [0..1] deptName = ct_contacts.deptname VARCHAR(2000); + String [0..1] role = ct_contacts.role VARCHAR(2000); + // type of contact e.g. Enquiry,Complaint etc... + ContactType [0..1] contactType = join ct_contacts.type_id + to ct_contact_types.type_id; + component ContactAddress [0..1] contactAddress = join ct_contacts.address_id + to ct_contact_address.address_id; + + component ContactPhone [0..n] phones = join ct_contacts.contact_id + to ct_contact_phones.contact_id; + + reference key ( ct_contacts.contact_id ); +} + +association { + Contact[0..1] associatedContactForItem = + join cms_items.item_id to contact_content_item_map.item_id, + join contact_content_item_map.contact_id to ct_contacts.contact_id; + ContentItem[0..n] associatedContentItemsForContact = + join ct_contacts.contact_id to contact_content_item_map.contact_id, + join contact_content_item_map.item_id to cms_items.item_id; + + } + +// the above association works fine for adding but for some strange reason when +// you try to remove an item from the association it also tries to delete it +// so instead you have to use a data operation + +data operation removeContactFromContentItemAssociation { + do { + delete from contact_content_item_map where item_id = :itemID + } +} + +data operation removeContactFromAllAssociations { + do { + delete from contact_content_item_map where contact_id = :contactID + } +} + +query getContactForItem { + BigDecimal contactID; + BigDecimal itemID; + do { + select contact_id, item_id + from + contact_content_item_map + where + item_id = :itemID + } map { + contactID = contact_id; + itemID = item_id; + } +} + Property changes on: trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/Contact.pdl ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactAddress.pdl =================================================================== --- trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactAddress.pdl (rev 0) +++ trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactAddress.pdl 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,42 @@ +// +// Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of +// the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $Id: ContactAddress.pdl 287 2005-02-22 00:29:02Z sskracic $ +// $DateTime: 2004/08/17 23:15:09 $ +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.cms.ContentItem; + +// object type to hold ContactAddress domain object type + +object type ContactAddress extends ContentItem { + String [0..1] saon = ct_contact_address.saon VARCHAR(2000); + String [1..1] paon = ct_contact_address.paon VARCHAR(2000); + String [1..1] streetDesc = ct_contact_address.street_desc VARCHAR(2000); + String [0..1] streetRefNo = + ct_contact_address.unique_street_ref_no VARCHAR(2000); + String [0..1] locality = ct_contact_address.locality VARCHAR(2000); + String [0..1] town = ct_contact_address.town VARCHAR(1000); + String [0..1] administrativeArea = + ct_contact_address.administrativeArea VARCHAR(2000); + String [0..1] postTown = ct_contact_address.post_town VARCHAR(1000); + String [0..1] postCode = ct_contact_address.post_code VARCHAR(1000); + String [0..1] referenceNo = + ct_contact_address.unique_prop_ref_no VARCHAR(2000); + + reference key ( ct_contact_address.address_id ); +} Property changes on: trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactAddress.pdl ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactPhone.pdl =================================================================== --- trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactPhone.pdl (rev 0) +++ trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactPhone.pdl 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,31 @@ +// +// Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of +// the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $Id: ContactPhone.pdl 287 2005-02-22 00:29:02Z sskracic $ +// $DateTime: 2004/08/17 23:15:09 $ +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.cms.ContentItem; + +object type ContactPhone extends ContentItem{ + + String [1..1] phoneType = ct_contact_phones.phoneType VARCHAR(100); + String [1..1] phoneNumber = ct_contact_phones.phoneNumber VARCHAR(100); + + reference key ( ct_contact_phones.phone_id ); + +} \ No newline at end of file Property changes on: trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactPhone.pdl ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactType.pdl =================================================================== --- trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactType.pdl (rev 0) +++ trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactType.pdl 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,32 @@ +// +// Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of +// the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $Id: ContactType.pdl 287 2005-02-22 00:29:02Z sskracic $ +// $DateTime: 2004/08/17 23:15:09 $ +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.cms.ContentItem; + +// object type to hold ContactType object type +object type ContactType extends ContentItem { + + String [1..1] typeName = ct_contact_types.type_name VARCHAR(1000); + + reference key ( ct_contact_types.type_id ); + +} + Property changes on: trunk/ccm-ldn-types-contact/pdl/com/arsdigita/content-types/ContactType.pdl ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql =================================================================== --- trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql (rev 0) +++ trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,16 @@ +create table contact_content_item_map ( + item_id INTEGER not null + constraint cont_con_ite_map_ite_i_p_scqe9 + primary key, + -- referential constraint for item_id deferred due to circular dependencies + contact_id INTEGER not null + -- referential constraint for contact_id deferred due to circular dependencies +); + + +alter table contact_content_item_map add + constraint cont_con_ite_map_con_i_f_lanid foreign key (contact_id) + references ct_contacts(contact_id); +alter table contact_content_item_map add + constraint cont_con_ite_map_ite_i_f_fr0po foreign key (item_id) + references cms_items(item_id); Added: trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/oracle-se-create.sql =================================================================== --- trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/oracle-se-create.sql (rev 0) +++ trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/oracle-se-create.sql 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,22 @@ +-- +-- Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: oracle-se-create.sql 287 2005-02-22 00:29:02Z sskracic $ +-- $DateTime: 2004/08/17 23:15:09 $ + +@@ ddl/oracle-se/create.sql +@@ ddl/oracle-se/deferred.sql Property changes on: trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/oracle-se-create.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/postgres-create.sql =================================================================== --- trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/postgres-create.sql (rev 0) +++ trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/postgres-create.sql 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,23 @@ +-- +-- Copyright (C) 2004 Red Hat Inc. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: postgres-create.sql 287 2005-02-22 00:29:02Z sskracic $ +-- $DateTime: 2004/08/17 23:15:09 $ + +\i ddl/postgres/create.sql +\i ddl/postgres/deferred.sql + Property changes on: trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/postgres-create.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/oracle-se-6.5.0-6.5.1.sql =================================================================== --- trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/oracle-se-6.5.0-6.5.1.sql (rev 0) +++ trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/oracle-se-6.5.0-6.5.1.sql 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,19 @@ +-- +-- Copyright (C) 2007 Magpie. 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 +-- + +@@ ../default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql \ No newline at end of file Added: trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/postgres-6.5.0-6.5.1.sql =================================================================== --- trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/postgres-6.5.0-6.5.1.sql (rev 0) +++ trunk/ccm-ldn-types-contact/sql/ccm-ldn-types-contact/upgrade/postgres-6.5.0-6.5.1.sql 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,21 @@ +-- +-- Copyright (C) 2007 Magpie. 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. +-- + +\echo Red Hat Enterprise CMS 6.5.0 -> 6.5.1 Upgrade Script (PostgreSQL) + +begin; + +\i ../default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql + +commit; Added: trunk/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml =================================================================== --- trunk/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml (rev 0) +++ trunk/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,31 @@ +<?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="Contact" + description="A London Contact person in CMS" + objectType="com.arsdigita.cms.contenttypes.Contact" + classname="com.arsdigita.cms.contenttypes.Contact"> + + <ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.contact.ContactCreate"> + + <ctd:authoring-step + label="Contact Properties" + description="Edit the basic contact properties" + descriptionBundle="com.arsdigita.cms.contenttypes.ContactResources" + component="com.arsdigita.cms.contenttypes.ui.contact.ContactPropertiesStep"/> + + <ctd:authoring-step + label="Contact Address Properties" + description="Edit the basic contact properties" + descriptionBundle="com.arsdigita.cms.contenttypes.ContactResources" + component="com.arsdigita.cms.contenttypes.ui.contact.AddressProperties"/> + + <ctd:authoring-step + label="Contact Phones" + description="Edit the Phones associated with contact" + descriptionBundle="com.arsdigita.cms.contenttypes.ContactResources" + component="com.arsdigita.cms.contenttypes.ui.contact.PhonesPanel"/> + + </ctd:authoring-kit> + </ctd:content-type> +</ctd:content-types> Property changes on: trunk/ccm-ldn-types-contact/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Contact.xml =================================================================== --- trunk/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Contact.xml (rev 0) +++ trunk/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Contact.xml 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,19 @@ +<?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="com.arsdigita.cms.contenttypes.Contact" extends="com.arsdigita.cms.ContentPage"> + <xrd:associations rule="include"> + <xrd:property name="/object/phones"/> + <xrd:property name="/object/contactType"/> + <xrd:property name="/object/contactAddress"/> + </xrd:associations> + </xrd:adapter> + </xrd:context> +</xrd:adapters> Property changes on: trunk/ccm-ldn-types-contact/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Contact.xml ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.config =================================================================== --- trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.config (rev 0) +++ trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.config 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<registry> + <!-- nothing yet --> +</registry> Property changes on: trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.config ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.load =================================================================== --- trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.load (rev 0) +++ trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.load 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,20 @@ +<load> + <requires> + <table name="inits"/> + <table name="acs_objects"/> + <table name="cms_items"/> + <initializer class="com.arsdigita.cms.Initializer"/> + </requires> + <provides> + <table name="ct_contact_types"/> + <table name="ct_contact_address"/> + <table name="ct_contact_phones"/> + <table name="ct_contacts"/> + + <initializer class="com.arsdigita.cms.contenttypes.ContactInitializer"/> + </provides> + <scripts> + <schema directory="ccm-ldn-types-contact"/> + <data class="com.arsdigita.cms.contenttypes.ContactLoader"/> + </scripts> +</load> Property changes on: trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.load ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.upgrade =================================================================== --- trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.upgrade (rev 0) +++ trunk/ccm-ldn-types-contact/src/ccm-ldn-types-contact.upgrade 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,5 @@ +<upgrade> + <version from="6.5.0" to="6.5.1"> + <script sql="ccm-ldn-types-contact/upgrade/::database::-6.5.0-6.5.1.sql"/> + </version> +</upgrade> \ No newline at end of file Added: trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java =================================================================== --- trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java (rev 0) +++ trunk/ccm-ldn-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java 2012-01-09 01:36:00 UTC (rev 2264) @@ -0,0 +1,350 @@ +/* + * Copyright (C) 2004 Red Hat Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +package com.arsdigita.cms.contenttypes; + +import java.math.BigDecimal; + +import org.apache.log4j.Logger; + +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ContentPage; +import com.arsdigita.cms.ContentType; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.persistence.DataAssociation; +import com.arsdigita.persistence.DataAssociationCursor; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.DataOperation; +import com.arsdigita.persistence.DataQuery; +import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.util.Assert; + + +/** + * <code>DomainObject</code> class to represent Contact <code>ContentType</code> + * objects. + * + * @author Shashin Shinde <a href="mailto:ss...@re...">ss...@re...</a> + * @version $Id: Contact.java 1689 2007-10-26 11:06:23Z chrisg23 $ + */ +public class Contact extends ContentPage { + + /** PDL property names */ + /* + * Flattened out Person object properties.Next 3 properties can be moved out + * to seperate object if needed. + */ + public static final String GIVEN_NAME = "givenName"; + public static final String FAMILY_NAME = "familyName"; + public static final String SUFFIX = "suffix"; + public static final String EMAILS = "emails"; + + public static final String DESCRIPTION = "description"; + public static final String ORG_NAME = "orgName"; + public static final String DEPT_NAME = "deptName"; + public static final String ROLE = "role"; + + /* Composite objects used by this class */ + public static final String CONTACT_TYPE = "contactType"; + public static final String CONTACT_ADDRESS = "contactAddress"; + public static final String PHONES = "phones"; + + public static final String ITEMS = "associatedContentItemsForContact"; + + private static final Logger s_log = Logger.getLogger(Contact.class); + + /** data object type for this domain object */ + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.Contact"; + + /** Default constructor. */ + public Contact() { + super(BASE_DATA_OBJECT_TYPE); + } + + /** + * Adds an association between this contact and the given content item. + * @param item + */ + public void addContentItem(ContentItem item) { + s_log.debug("item is " + item); + item.addToAssociation(getItemsForContact()); + } + + /** + * Deletes the association between this contact and the given content item. + * @param item + */ + public void removeContentItem(ContentItem item) { + s_log.debug("item is " + item); + DataOperation operation = SessionManager + .getSession() + .retrieveDataOperation( + "com.arsdigita.cms.contenttypes.removeContactFromContentItemAssociation"); + operation.setParameter("itemID", new Integer(item.getID().intValue())); + operation.execute(); + } + + /** + * Removes all mappings between this contact and any other content item. + * + */ + private void removeItemMappings() { + DataOperation operation = SessionManager + .getSession() + .retrieveDataOperation( + "com.arsdigita.cms.contenttypes.removeContactFromAllAssociations"); + operation.setParameter("contactID", new Integer(this.getID().intValue())); + operation.execute(); + } + + + /** + * Gets the DataAssociation that holds the mapping between this contact + * and any content items. + * @return + */ + public DataAssociation getItemsForContact() { + return (DataAssociation) get(ITEMS); + } + + + /** + * Returns the Contact for a given content item. + * @param item + * @return + */ + public static Contact getContactForItem(ContentItem item) { + s_log.debug("getting contact for item " + item); + DataQuery query = SessionManager.getSession().retrieveQuery( + "com.arsdigita.cms.contenttypes.getContactForItem"); + query.setParameter("itemID", item.getID()); + BigDecimal contactID; + Contact contact = null; + while (query.next()) { + contactID = (BigDecimal) query.get("contactID"); + contact = new Contact(contactID); + } + s_log.debug("returning contact " + contact); + return contact; + } + + + + + /** + * Constructor. Retrieves an object instance with the given id. + * @param id the id of the object to retrieve + */ + public Contact( BigDecimal id ) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + /** + * Constructor. Retrieves an object instance with the given OID. + * + * @param oid the object id of the object to retrieve + */ + public Contact(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + /** + * Constructor. Create a Contact domain object using the given data object. + * @param obj the object data to use + */ + public Contact( DataObject obj ) { + super(obj); + } + + /** Constructor. */ + public Contact( String type ) { + super(type); + } + + public void beforeSave() { + super.beforeSave(); + + Assert.exists(getContentType(), ContentType.class); + } + + public String getBaseDataObjectType() { + return BASE_DATA_OBJECT_TYPE; + } + + /** Accessor. Get the GIVEN_NAME for this Contact. */ + public String getGivenName(){ + return (String) get(GIVEN_NAME); + } + + /** Mutator. Set the GIVEN_NAME for this Contact. */ + public void setGivenName(String gn){ + set(GIVEN_NAME , gn); + } + + /** Accessor. Get the FAMILY_NAME for this Contact. */ + public String getFamilyName(){ + return (String) get(FAMILY_NAME); + } + + /** Mutator. Set the FAMILY_NAME for this Contact. */ + public void setFamilyName(String fn){ + set(FAMILY_NAME , fn); + } + + /** Accessor. Get the SUFFIX for this Contact. */ + public String getSuffix(){ + return (String) get(SUFFIX); + } + + /** Mutator. Set the DESCRIPTION for this Contact. */ + public void setSuffix(String suf){ + set(SUFFIX , suf); + } + + /** Accessor. Get the EMAILS for this Contact. */ + public String getEmails(){ + return (String)... [truncated message content] |
From: <pb...@fe...> - 2012-01-08 17:43:31
|
Author: pboy Date: 2012-01-08 17:43:22 +0000 (Sun, 08 Jan 2012) New Revision: 2263 Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionCollection.java trunk/ccm-cms/src/com/arsdigita/cms/ContentTypeCollection.java trunk/ccm-cms/src/com/arsdigita/cms/Loader.java trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig_parameter.properties trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/Utilities.java Log: Various minor fixes. Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2012-01-08 17:39:10 UTC (rev 2262) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2012-01-08 17:43:22 UTC (rev 2263) @@ -531,10 +531,12 @@ // /////////////////////////////////////////// // Content Section config related parameters // /////////////////////////////////////////// - private final Parameter m_defaultSection = new StringParameter( - "com.arsdigita.cms.default_content_section", - Parameter.REQUIRED, - "content"); +// Nolonger used, +// replaced by c.ad.cms.ContentSection.getDefaultSection().getName() +// private final Parameter m_defaultSection = new StringParameter( +// "com.arsdigita.cms.default_content_section", +// Parameter.REQUIRED, +// "content"); // /////////////////////////////////////////// // Content Section creation parameters // XXX these are probably temporary parameters, as the @@ -655,7 +657,7 @@ register(m_contentCenterMap); // Content Section config related parameters - register(m_defaultSection); + // register(m_defaultSection); // Content Section creation parameters register(m_defaultItemResolverClass); @@ -712,8 +714,14 @@ return (InputStream) get(m_itemAdapters); } + /** + * + * @deprecated + * use com.arsdigita.cms.ContentSection.getDefaultSection().getName() instead + */ public final String getDefaultContentSection() { - return (String) get(m_defaultSection); + // return (String) get(m_defaultSection); + return (String) ContentSection.getDefaultSection().getName(); } public final boolean getUseStreamlinedCreation() { Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties 2012-01-08 17:39:10 UTC (rev 2262) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties 2012-01-08 17:43:22 UTC (rev 2263) @@ -38,10 +38,11 @@ com.arsdigita.cms.item_adapters.example=/WEB-INF/resources/cms-item-adapters.xml com.arsdigita.cms.item_adapters.format=[string] -com.arsdigita.cms.default_content_section.title = Default Content Section -com.arsdigita.cms.default_content_section.purpose = The name of the default content section -com.arsdigita.cms.default_content_section.example = content -com.arsdigita.cms.default_content_section.format = [string] +# No longer used +# com.arsdigita.cms.default_content_section.title = Default Content Section +# com.arsdigita.cms.default_content_section.purpose = The name of the default content section +# com.arsdigita.cms.default_content_section.example = content +# com.arsdigita.cms.default_content_section.format = [string] com.arsdigita.cms.use_streamlined_creation.title=Use streamlined content creation com.arsdigita.cms.use_streamlined_creation.purpose=Use streamlined content creation: upon item creation, automatically open authoring steps and forward to the next step Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java 2012-01-08 17:39:10 UTC (rev 2262) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java 2012-01-08 17:43:22 UTC (rev 2263) @@ -1057,6 +1057,43 @@ } /** + * Retrieve the default content section in the system. + * + * Default section is the first section created during setup, therefore it + * is recognized as the one with the lowest id. + * + * @return The default content section. + */ + public static ContentSection getDefaultSection() { + ContentSectionCollection sections = getAllSections(); + sections.addOrder(ID); + sections.next(); // positions on the first section + ContentSection section = (ContentSection) sections.getDomainObject(); + if (sections.isFirst() ) { + sections.close(); + s_log.warn("Default section is "+section.getName() ); + return section; + } else { + sections.close(); + s_log.warn("Section found: "+section.getName()+", but not first." ); + return null; + } + } + + /** + * Convenience method to retrieve the name of the default content section + * in the system. + * + * Default section is the first section created during setup, therefore it + * is recognized as the one with the lowest id. + * + * @return The default content section name. + */ + public static String getDefaultSectionName() { + return getDefaultSection().getBaseDataObjectType(); + } + + /** * Creates a content section of the given name using default values and * returns it. * Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionCollection.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionCollection.java 2012-01-08 17:39:10 UTC (rev 2262) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionCollection.java 2012-01-08 17:43:22 UTC (rev 2263) @@ -37,7 +37,7 @@ /** * Constructor. * - **/ + */ public ContentSectionCollection(DataCollection dataCollection) { super(dataCollection); } @@ -50,6 +50,7 @@ * (e.g. "primaryURL" in order to sort by section name * see c.ad.london.util.cmd.SiteMapList as an example ). */ + @Override public void addOrder(String order) { m_dataCollection.addOrder(order); } @@ -59,6 +60,7 @@ * the collection. * */ + @Override public DomainObject getDomainObject() { return new ContentSection(m_dataCollection.getDataObject()); } Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentTypeCollection.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentTypeCollection.java 2012-01-08 17:39:10 UTC (rev 2262) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentTypeCollection.java 2012-01-08 17:43:22 UTC (rev 2263) @@ -47,12 +47,17 @@ * Set the order of this Collection. This method needs to be called * before <code>next()</code> is called on this collection. * + * @param order: name of the pdl property to use for sorting the collection + * (e.g. "primaryURL" in order to sort by section name + * see c.ad.london.util.cmd.SiteMapList as an example ). */ + @Override public void addOrder(String order) { m_dataCollection.addOrder(order); } + @Override public Filter addFilter(String conditions) { return m_dataCollection.addFilter(conditions); } Modified: trunk/ccm-cms/src/com/arsdigita/cms/Loader.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2012-01-08 17:39:10 UTC (rev 2262) +++ trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2012-01-08 17:43:22 UTC (rev 2263) @@ -58,7 +58,7 @@ // ccm/admin/sitemap lists them appropriately. // // Next Try -// Refactor using legacy compatible web/Application and ApplicationSetup +// Refactor using legacy compatible web/Application and ApplicationSetup DONE /** @@ -117,48 +117,10 @@ ); - -// Nolonger used -// /** -// * Constant string used as key for creating CMS (content-section) as a -// * legacy application. -// */ -// private final static String CMS_PACKAGE_KEY = "content-section"; -// /** -// * Dispatcher class for CMS (needed to be assigned to a legacy application). -// */ -// private final static String CMS_DISPATCHER_CLASS = -// "com.arsdigita.cms.dispatcher.ContentSectionDispatcher"; -// /** -// * Constant string used as key for creating Workspace (content-center) as a -// * legacy application. -// */ -// public static final String WORKSPACE_PACKAGE_KEY = "content-center"; -// private static final String WORKSPACE_INSTANCE_NAME = "Content Center"; -// /** -// * Dispatcher class for Workspace (content-center) (needed to be assigned -// * to a legacy application). -// */ -// private static final String WORKSPACE_DISPATCHER_CLASS = -// "com.arsdigita.cms.dispatcher.ContentCenterDispatcher"; -// // To be updated soon... -// // "com.arsdigita.dispatcher.DefaultPackageDispatcher"; - -// No longer used, moved to class Service -// /** -// * Name of the CMS service package instance, i.e. its URL. -// */ -// private final static String SERVICE_URL = "cms-service"; -// /** -// * Constant string used as key for creating service package as a -// * legacy application. -// */ -// public final static String SERVICE_PACKAGE_KEY = "cms-service"; - - /** - * - */ + /** List of classnames of internal base content types (needed in every + * section created), generated while loading those content types in + * loadContentTypeDefinitions(files) for later use in register step. */ private ArrayList m_content_type_list = new ArrayList(); /** @@ -438,13 +400,14 @@ /* Register internal base content types. Paramter is a list of * class names created by internal content type load method. - * @see loadContentTypeDefinitions(List) */ + * @see loadContentTypeDefinitions(List) + * External content types (provided by additional packages) are + * not available at CMS load time and can not processed by Loader. + * Registration of those content types are dealt with in the + * respective Loader or in the CMS workspace GUI. + * For each created section the base types get registered. */ setup.registerContentTypes(m_content_type_list); - // See method doc above. No external content types available at - // cms load time, - // setup.registerContentTypes(s_conf.getContentSectionsContentTypes()); - // Section specific categories, usually not used. // During initial load at install time nor used at all! // default value is false so no categories get loaded. Modified: trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java 2012-01-08 17:39:10 UTC (rev 2262) +++ trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java 2012-01-08 17:43:22 UTC (rev 2263) @@ -106,28 +106,28 @@ // Parameter.REQUIRED, // "/WEB-INF/resources/content-center-map.xml"); - // Update master object if upgrading from old versioning - // XXX: shouldn't we just gut this section (and - // VersioningUpgrader)? It is an upgrade fix from 5.1 or - // earlier, and relying on VersionedACSObject is - // deprecated - // (pboy): Default value is false and this value didn't change for - // a very long period. Class can be excluded from source. - // final boolean updateMaster = - // ((Boolean)m_conf.getParameter(UPDATE_MASTER)).booleanValue(); - // if (updateMaster) { - // VersioningUpgrader.updateMasterObject(); - // } +// Update master object if upgrading from old versioning +// XXX: shouldn't we just gut this section (and +// VersioningUpgrader)? It is an upgrade fix from 5.1 or +// earlier, and relying on VersionedACSObject is +// deprecated +// (pboy): Default value is false and this value didn't change for +// a very long period. Class can be excluded from source. +// final boolean updateMaster = +// ((Boolean)m_conf.getParameter(UPDATE_MASTER)).booleanValue(); +// if (updateMaster) { +// VersioningUpgrader.updateMasterObject(); +// } - // XXX: ItemDispatcher is no longer used. Is the following - // still a valid enterprise.init parameter? Do we need to - // set ContentSectionServlet.s_cacheItems instead of the - // below (which is currently always true), or does this go - // away entirely? - // final boolean cacheItems = - // ((Boolean)m_conf.getParameter(CACHE_ITEMS)).booleanValue(); - // s_log.debug("Set cache items to " + cacheItems); - // ItemDispatcher.setCacheItems(cacheItems); +// XXX: ItemDispatcher is no longer used. Is the following +// still a valid enterprise.init parameter? Do we need to +// set ContentSectionServlet.s_cacheItems instead of the +// below (which is currently always true), or does this go +// away entirely? +// final boolean cacheItems = +// ((Boolean)m_conf.getParameter(CACHE_ITEMS)).booleanValue(); +// s_log.debug("Set cache items to " + cacheItems); +// ItemDispatcher.setCacheItems(cacheItems); /** @@ -186,11 +186,13 @@ * Not implemented yet! We need a new parameter type "list" which must have * multidimensional capabilities. */ -// private final Parameter -// m_staffGroup = new StringParameter( -// "com.arsdigita.cms.loader.section_staff_group", -// Parameter.REQUIRED, -// null); + /* + private final Parameter + m_staffGroup = new StringParameter( + "com.arsdigita.cms.loader.section_staff_group", + Parameter.REQUIRED, + null); + */ private List m_staffGroup; @@ -208,32 +210,6 @@ Parameter.REQUIRED, true); - /** - * List of content types to register in the given content-section. - * - * Example: - * { - * "com.arsdigita.cms.contenttypes.Address", - * "com.arsdigita.cms.contenttypes.Article", - * "com.arsdigita.cms.contenttypes.Contact" - * } - * - * Parameter name "TYPES" in the old initializer code, empty by default in - * the former enterprise.init file. - * When the list is empty and the first default content section is created, - * all installed content types will get registered. This behaviour should - * not be altered without very good reasons. - * - * While loading ccm-cms no external content type packages are available - * because all content types depend on ccm-cms. Therefore this parameter - * can not beused in loader context. - */ - //private final Parameter - // m_contentTypeList = new StringArrayParameter( - // "com.arsdigita.cms.loader.section_ctypes_list", - // Parameter.REQUIRED, - // new String[] {} ); - // Page Resolver Class, set autonomously by ContentSection.create() method. // Item Resolver Class, configurable. @@ -410,22 +386,24 @@ "List of all installed packages") ); -// Currently not a Loader task. There is no way to persist tasks preferences -// on a per section base. -// /** -// * When to generate email alerts: by default, generate email alerts -// * on enable, finish, and rollback (happens on rejection) changes. -// * There are four action types for each task type: enable, -// * disable, finish, and rollback. Note that the values below are -// * based on the task labels, and as such are not globalized. -// */ -// private final Parameter -// m_taskAlerts = new StringArrayParameter( -// "com.arsdigita.cms.task_alerts", -// Parameter.REQUIRED, new String[] { -// "Authoring:enable:finish:rollback", -// "Approval:enable:finish:rollback", -// "Deploy:enable:finish:rollback" } ); + // Currently not a Loader task. There is no way to persist tasks preferences + // on a per section base. + /** + * When to generate email alerts: by default, generate email alerts + * on enable, finish, and rollback (happens on rejection) changes. + * There are four action types for each task type: enable, + * disable, finish, and rollback. Note that the values below are + * based on the task labels, and as such are not globalized. + */ + /* + private final Parameter + m_taskAlerts = new StringArrayParameter( + "com.arsdigita.cms.task_alerts", + Parameter.REQUIRED, new String[] { + "Authoring:enable:finish:rollback", + "Approval:enable:finish:rollback", + "Deploy:enable:finish:rollback" } ); + */ // /////////////////////////////////////////////////////////////////////// @@ -492,7 +470,6 @@ register(m_itemResolverClass); register(m_templateResolverClass); - // register(m_contentTypeList); register(m_useSectionCategories); register(m_categoryFileList); @@ -684,12 +661,5 @@ public List getDataQueries() { return dataQueries; } - /** - * Retrieve the - */ -// public List getContentSectionsContentTypes() { -// String[] contentTypes = (String[]) get(m_contentTypeList); -// return Arrays.asList(contentTypes); -// } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig_parameter.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig_parameter.properties 2012-01-08 17:39:10 UTC (rev 2262) +++ trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig_parameter.properties 2012-01-08 17:43:22 UTC (rev 2263) @@ -22,8 +22,3 @@ com.arsdigita.cms.loader.section_is_public.purpose= com.arsdigita.cms.loader.section_is_public.example= com.arsdigita.cms.loader.section_is_public.format=[StringArray] - -com.arsdigita.cms.loader.section_ctypes_list.title= -com.arsdigita.cms.loader.section_ctypes_list.purpose= -com.arsdigita.cms.loader.section_ctypes_list.example= -com.arsdigita.cms.loader.section_ctypes_list.format=[ boolean] Modified: trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/Utilities.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/Utilities.java 2012-01-08 17:39:10 UTC (rev 2262) +++ trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/Utilities.java 2012-01-08 17:43:22 UTC (rev 2263) @@ -24,8 +24,6 @@ import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.SecurityManager; -//import com.arsdigita.cms.installer.ServiceInstaller; -// import com.arsdigita.cms.installer.WorkspaceInstaller; import com.arsdigita.dispatcher.DispatcherHelper; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelContext; @@ -54,9 +52,6 @@ */ public class Utilities { -// public final static String CMS_WORKSPACE = WorkspaceInstaller.PACKAGE_KEY; -// public final static String CMS_SERVICE = ServiceInstaller.PACKAGE_KEY; - // Used for caching util lookups private static HashMap m_cache = new HashMap(); @@ -181,7 +176,7 @@ if ( !instances.next() ) { instances.close(); throw new RuntimeException( - "Failed to locate an instance of the singleton package: " + key); + "Failed to locate an instance of the singleton package: " + key); } else { instance = instances.getPackageInstance(); instances.close(); @@ -192,7 +187,7 @@ if ( !nodes.next() ) { nodes.close(); throw new RuntimeException( - "Failed to locate a mountpoint for the singleton package: " + key); + "Failed to locate a mountpoint for the singleton package: " + key); } else { node = nodes.getSiteNode(); nodes.close(); @@ -341,7 +336,8 @@ * the browser does not cache tha page * * @param response The HTTP response - * @deprecated use com.arsdigita.dispatcher.DispatcherHelper.cacheDisable(HttpServletResponse) + * @deprecated use + * com.arsdigita.dispatcher.DispatcherHelper.cacheDisable(HttpServletResponse) */ public static void disableBrowserCache(HttpServletResponse response) { response.addHeader("pragma", "no-cache"); |
Author: pboy Date: 2012-01-08 17:39:10 +0000 (Sun, 08 Jan 2012) New Revision: 2262 Added: trunk/ccm-subsite/ trunk/ccm-subsite/.classpath trunk/ccm-subsite/.project trunk/ccm-subsite/.settings/ trunk/ccm-subsite/.settings/org.eclipse.jdt.core.prefs trunk/ccm-subsite/.settings/org.eclipse.jdt.ui.prefs trunk/ccm-subsite/.svnignore trunk/ccm-subsite/README trunk/ccm-subsite/application.xml trunk/ccm-subsite/doc/ trunk/ccm-subsite/doc/subsite-standalone/ trunk/ccm-subsite/doc/subsite-standalone/README trunk/ccm-subsite/doc/subsite-standalone/bebop-define.tld trunk/ccm-subsite/doc/subsite-standalone/bebop-show.tld trunk/ccm-subsite/doc/subsite-standalone/web.xml trunk/ccm-subsite/doc/web.xml-subsite.in trunk/ccm-subsite/pdl/ trunk/ccm-subsite/pdl/com/ trunk/ccm-subsite/pdl/com/arsdigita/ trunk/ccm-subsite/pdl/com/arsdigita/subsite/ trunk/ccm-subsite/pdl/com/arsdigita/subsite/Site.pdl trunk/ccm-subsite/pdl/com/arsdigita/subsite/Subsite.pdl trunk/ccm-subsite/sql/ trunk/ccm-subsite/sql/ccm-subsite/ trunk/ccm-subsite/sql/ccm-subsite/default/ trunk/ccm-subsite/sql/ccm-subsite/default/upgrade/ trunk/ccm-subsite/sql/ccm-subsite/default/upgrade/add-style_dir.sql trunk/ccm-subsite/sql/ccm-subsite/default/upgrade/add-template-context.sql trunk/ccm-subsite/sql/ccm-subsite/oracle-se-create.sql trunk/ccm-subsite/sql/ccm-subsite/oracle-se/ trunk/ccm-subsite/sql/ccm-subsite/oracle-se/upgrade/ trunk/ccm-subsite/sql/ccm-subsite/oracle-se/upgrade/add-style_dir.sql trunk/ccm-subsite/sql/ccm-subsite/postgres-create.sql trunk/ccm-subsite/sql/ccm-subsite/upgrade/ trunk/ccm-subsite/sql/ccm-subsite/upgrade/default/ trunk/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/ trunk/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/drop_app_table.sql trunk/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql trunk/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/ren_sites_table.sql trunk/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql trunk/ccm-subsite/sql/ccm-subsite/upgrade/oracle-se-1.sql trunk/ccm-subsite/sql/ccm-subsite/upgrade/oracle-se-2.sql trunk/ccm-subsite/sql/ccm-subsite/upgrade/oracle-se-6.6.0-6.6.1.sql trunk/ccm-subsite/sql/ccm-subsite/upgrade/postgres-1.sql trunk/ccm-subsite/sql/ccm-subsite/upgrade/postgres-2.sql trunk/ccm-subsite/sql/ccm-subsite/upgrade/postgres-6.6.0-6.6.1.sql trunk/ccm-subsite/src/ trunk/ccm-subsite/src/WEB-INF/ trunk/ccm-subsite/src/WEB-INF/resources/ trunk/ccm-subsite/src/WEB-INF/resources/subsite-adapters.xml trunk/ccm-subsite/src/ccm-subsite.config trunk/ccm-subsite/src/ccm-subsite.load trunk/ccm-subsite/src/ccm-subsite.upgrade trunk/ccm-subsite/src/com/ trunk/ccm-subsite/src/com/arsdigita/ trunk/ccm-subsite/src/com/arsdigita/subsite/ trunk/ccm-subsite/src/com/arsdigita/subsite/Initializer.java trunk/ccm-subsite/src/com/arsdigita/subsite/Loader.java trunk/ccm-subsite/src/com/arsdigita/subsite/Site.java trunk/ccm-subsite/src/com/arsdigita/subsite/Subsite.java trunk/ccm-subsite/src/com/arsdigita/subsite/SubsiteConfig.java trunk/ccm-subsite/src/com/arsdigita/subsite/SubsiteConfig_parameter.properties trunk/ccm-subsite/src/com/arsdigita/subsite/SubsiteContext.java trunk/ccm-subsite/src/com/arsdigita/subsite/SubsiteDynamicHostProvider.java trunk/ccm-subsite/src/com/arsdigita/subsite/SubsiteFilter.java trunk/ccm-subsite/src/com/arsdigita/subsite/SubsitePatternGenerator.java trunk/ccm-subsite/src/com/arsdigita/subsite/dispatcher/ trunk/ccm-subsite/src/com/arsdigita/subsite/dispatcher/SubsiteItemTemplateResolver.java trunk/ccm-subsite/src/com/arsdigita/subsite/package.html trunk/ccm-subsite/src/com/arsdigita/subsite/ui/ trunk/ccm-subsite/src/com/arsdigita/subsite/ui/ControlCenterPanel.java trunk/ccm-subsite/src/com/arsdigita/subsite/ui/SiteForm.java trunk/ccm-subsite/src/com/arsdigita/subsite/ui/SiteListing.java trunk/ccm-subsite/src/com/arsdigita/subsite/ui/SiteSelectionModel.java trunk/ccm-subsite/web/ trunk/ccm-subsite/web/WEB-INF/ trunk/ccm-subsite/web/WEB-INF/web.ccm-subsite.xml trunk/ccm-subsite/web/templates/ trunk/ccm-subsite/web/templates/ccm-subsite/ trunk/ccm-subsite/web/templates/ccm-subsite/index.jsp trunk/ccm-subsite/web/themes/ trunk/ccm-subsite/web/themes/heirloom/ trunk/ccm-subsite/web/themes/heirloom/apps/ trunk/ccm-subsite/web/themes/heirloom/apps/subsite/ trunk/ccm-subsite/web/themes/heirloom/apps/subsite/xsl/ trunk/ccm-subsite/web/themes/heirloom/apps/subsite/xsl/index.xsl Removed: trunk/ccm-ldn-subsite/ Modified: trunk/ccm-bundle/application.xml trunk/ccm-bundle/bundles/demo/cfg/integration.properties trunk/ccm-bundle/bundles/demo/cfg/project.xml trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml trunk/ccm-bundle/bundles/devel/cfg/integration.properties trunk/ccm-bundle/bundles/devel/cfg/project.xml trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml trunk/ccm-bundle/src/ccm-bundle.load trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspaceSelectionModel.java trunk/ccm-bundle/web/themes/static/aplaws-generic/subsite-index.xsl trunk/ccm-core/src/com/arsdigita/domain/DomainQuery.java trunk/ccm-core/src/com/arsdigita/kernel/ui/ACSObjectSelectionModel.java trunk/ccm-core/src/log4j.properties trunk/ccm-forum/doc/semantic-XML-plan.txt trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspaceSelectionModel.java trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZCategoryProvider.java trunk/ccm-navigation/src/com/arsdigita/navigation/Loader.java trunk/ccm-navigation/src/com/arsdigita/navigation/Template.java trunk/ccm-navigation/src/com/arsdigita/navigation/tools/TemplateCreator.java trunk/ccm-portalworkspace/application.xml trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortletTypeForm.java trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/ApplicationSelectionModel.java trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/PeoplePane.java trunk/ccm-themedirector/application.xml trunk/ccm-themedirector/src/ccm-themedirector.load trunk/ccm-themedirector/src/com/arsdigita/themedirector/ trunk/ccm-themedirector/src/com/arsdigita/themedirector/Initializer.java trunk/ccm-themedirector/src/com/arsdigita/themedirector/Loader.java trunk/ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirector.java trunk/ccm-themedirector/src/com/arsdigita/themedirector/ThemePatternGenerator.java trunk/ccm-themedirector/src/com/arsdigita/themedirector/ui/ThemeForm.java trunk/ccm-themedirector/src/com/arsdigita/themedirector/ui/ThemeXSLParameterGenerator.java trunk/ccm-themedirector/src/com/arsdigita/themedirector/ui/listeners/ApproveThemeActionListener.java trunk/ccm-themedirector/web/templates/ccm-themedirector/undoTheme.jsp trunk/ccm-themedirector/web/themes/static/default/subsite-index.xsl Log: Renamed ccm-ldn-subsite in ccm-subsite according to naming convention, handling of front page selection improved (application instance now selectable), Update script provided and required. Modified: trunk/ccm-bundle/application.xml =================================================================== --- trunk/ccm-bundle/application.xml 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-bundle/application.xml 2012-01-08 17:39:10 UTC (rev 2262) @@ -10,7 +10,7 @@ <ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-navigation" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-portalworkspace" version="6.6.1" relation="ge"/> - <ccm:requires name="ccm-ldn-subsite" version="6.6.0" relation="ge"/> + <ccm:requires name="ccm-subsite" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-ldn-terms" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-ldn-search" version="6.6.0" relation="ge"/> </ccm:dependencies> Modified: trunk/ccm-bundle/bundles/demo/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2012-01-08 17:39:10 UTC (rev 2262) @@ -1,4 +1,4 @@ -# Scientific CMS demo bundle integration.properties +# Libre CMS demo bundle integration.properties # waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage # @@ -22,7 +22,7 @@ ; Searches for localized style sheet (among others) waf.templating.stylesheet_resolver=com.arsdigita.templating.PatternStylesheetResolver -waf.templating.stylesheet_paths=/WEB-INF/resources/scientificCMS-stylesheet-paths.txt +waf.templating.stylesheet_paths=/WEB-INF/resources/librecms-stylesheet-paths.txt core.ui.pagemap.root_page_url=navigation/ core.ui.pagemap.workspace_url=navigation/ @@ -42,7 +42,7 @@ com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp -com.arsdigita.cms.default_template_resolver_class=com.arsdigita.london.subsite.dispatcher.SubsiteItemTemplateResolver +com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box @@ -55,9 +55,9 @@ ; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js ; com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js ; com.arsdigita.cms.dhtml_editor_hidden_buttons= -; com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS -com.arsdigita.cms.dhtml_editor_plugins= +; com.arsdigita.cms.dhtml_editor_plugins= + com.arsdigita.cms.disable_item_pfs=true com.arsdigita.cms.hide_admin_tabs=true @@ -96,10 +96,15 @@ # ccm-navigation application +; com.arsdigita.navigation.category_menu_show_grand_children_min=1 +; com.arsdigita.navigation.category_menu_show_grand_children=adaptive +; com.arsdigita.navigation.category_menu_show_grand_children_limit=1 +; com.arsdigita.navigation.category_menu_show_grand_children_max=65536 com.arsdigita.navigation.category_menu_show_grand_children=false +; com.arsdigita.navigation.category_menu_show_nephews=false com.arsdigita.navigation.default_cat_root_path=/navigation/ -com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/sci-default.jsp -com.arsdigita.navigation.templates_file=bundle/navigation/sci-templates.txt +com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/gen-default.jsp +com.arsdigita.navigation.templates_file=bundle/navigation/gen-templates.txt # ccm-ldn-search application @@ -107,19 +112,20 @@ # ccm-ldn-subsite application -com.arsdigita.london.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker +com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker -# ccm-ldn-themedirector application +# ccm-themedirector application themedirector.default_theme_context= # themedirector.default_theme_manifest=ccm-zes-aplaws.web.mf themedirector.default_theme_path=themes/static/aplaws-generic themedirector.file_extensions=bmp css gif jpeg jpg js png xml xsl -# ccm-sci-bundle (Loader only) -#com.arsdigita.bundle.category_files=bundle/categories/sci-nav-domain-1.00.xml,bundle/categories/sci-nav-hierarchy-1.00.xml - +# ccm-bundle (Loader only) +#com.arsdigita.bundle.loader.category_files=bundle/categories/sci-nav-domain-1.00.xml,bundle/categories/sci-nav-hierarchy-1.00.xml +#com.arsdigita.bundle.loader.custom_app_instances=com.arsdigita.navigation.Navigation:scimenu:ScientificCMS Navigation Menu,com.arsdigita.navigation.Navigation:libmenu:LibreCMS Navigation Menu +#com.arsdigita.bundle.loader.domain_mappings=STD-NAV:/navigation/,STD-NAV:/generic/,STD-NAV:/portal/ # ============================================================================================= # runtime specific configurations Modified: trunk/ccm-bundle/bundles/demo/cfg/project.xml =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/project.xml 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-bundle/bundles/demo/cfg/project.xml 2012-01-08 17:39:10 UTC (rev 2262) @@ -1,20 +1,25 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<!-- project.xml SCI devel - containing only modules used for ScientificCMS --> +<!-- project.xml LibreCMS devel - containing only modules used for LibreCMS --> -<ccm:project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<ccm:project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ccm="http://ccm.redhat.com/ccm-project" ccmVersion="6.1" - name="ScientificCMS" - prettyName="Scientific CMS" - version="1-1-6" - release="devel" - webxml="web-sci.xml" + name="librecms-ccm" + prettyName="LibreCMS OpenCCM" + version="0-0-0" + release="trunk-r1323" + webxml="web-ccm.xml" webapp="ROOT" xsi:schemaLocation="http://ccm.redhat.com/ccm-project file:tools-ng/common/xsd/project.xsd"> - <ccm:build> +<ccm:databases> + <ccm:database name="postgres"/> +</ccm:databases> + +<ccm:build> + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Scientific CMS set of CORE packages --> <!-- NONE can be omitted for technical reasons / internal dependencies --> @@ -36,13 +41,14 @@ <!-- Applications --> <ccm:application name="ccm-navigation"/> + <!-- ccm-portalworkspace depends on ccm-subsite --> <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-subsite"/> <ccm:application name="ccm-themedirector"/> <!-- LDN extension --> <ccm:application name="ccm-ldn-search"/> <ccm:application name="ccm-ldn-shortcuts"/> - <ccm:application name="ccm-ldn-subsite"/> <ccm:application name="ccm-ldn-terms"/> <ccm:application name="ccm-ldn-util"/> Modified: trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml 2012-01-08 17:39:10 UTC (rev 2262) @@ -4,8 +4,8 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> - <display-name>Scientific CMS</display-name> - <description>Content and Collaboration Management for Scientific Institutions</description> + <display-name>LibreCMS DEMO Site</display-name> + <description>Community and Content Management</description> <!-- path and filename of the log4j user accessible config file WEB-INF/conf/log4j.properties is the built-in default value --> @@ -17,14 +17,13 @@ <!-- Require secure connection by redirect to host-port part of parameter waf.web.secure_server - NOT USED with ZeS <filter> <filter-name>secured</filter-name> <filter-class>com.arsdigita.web.SecureFilter</filter-class> </filter> --> <!-- Initialize Profiler timers - NOT USED with ZeS standard / production + NOT USED with standard / production <filter> <filter-name>profiler</filter-name> <filter-class>com.arsdigita.profiler.ProfilerFilter</filter-class> @@ -38,7 +37,7 @@ <filter> <filter-name>subsite</filter-name> - <filter-class>com.arsdigita.london.subsite.SubsiteFilter</filter-class> + <filter-class>com.arsdigita.subsite.SubsiteFilter</filter-class> </filter> <!-- NOT USED HERE @@ -277,7 +276,7 @@ <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> <param-name>template-path</param-name> - <param-value>/templates/ccm-ldn-subsite</param-value> + <param-value>/templates/ccm-subsite</param-value> </init-param> </servlet> <!-- module ccm-ldn-subsite - servlet declarations END --> @@ -375,7 +374,7 @@ <!-- module ccm-ldn-subsite - servlet mappings BEGIN --> <servlet-mapping> <servlet-name>subsite-files</servlet-name> - <url-pattern>/ccm-ldn-subsite/files/*</url-pattern> + <url-pattern>/ccm-subsite/files/*</url-pattern> </servlet-mapping> <!-- module ccm-ldn-subsite - servlet mappings END --> Modified: trunk/ccm-bundle/bundles/devel/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2012-01-08 17:39:10 UTC (rev 2262) @@ -42,7 +42,7 @@ com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp -com.arsdigita.cms.default_template_resolver_class=com.arsdigita.london.subsite.dispatcher.SubsiteItemTemplateResolver +com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver ; Configure dhtml editor for use in cms content-center ; Xinha is default and should work out of the box @@ -96,10 +96,15 @@ # ccm-navigation application +; com.arsdigita.navigation.category_menu_show_grand_children_min=1 +; com.arsdigita.navigation.category_menu_show_grand_children=adaptive +; com.arsdigita.navigation.category_menu_show_grand_children_limit=1 +; com.arsdigita.navigation.category_menu_show_grand_children_max=65536 com.arsdigita.navigation.category_menu_show_grand_children=false +; com.arsdigita.navigation.category_menu_show_nephews=false com.arsdigita.navigation.default_cat_root_path=/navigation/ -com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/sci-default.jsp -com.arsdigita.navigation.templates_file=bundle/navigation/sci-templates.txt +com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/gen-default.jsp +com.arsdigita.navigation.templates_file=bundle/navigation/gen-templates.txt # ccm-ldn-search application @@ -107,7 +112,7 @@ # ccm-ldn-subsite application -com.arsdigita.london.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker +com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker # ccm-themedirector application @@ -117,21 +122,22 @@ themedirector.file_extensions=bmp css gif jpeg jpg js png xml xsl -# ccm-sci-bundle (Loader only) -#com.arsdigita.bundle.category_files=bundle/categories/sci-nav-domain-1.00.xml,bundle/categories/sci-nav-hierarchy-1.00.xml - +# ccm-bundle (Loader only) +#com.arsdigita.bundle.loader.category_files=bundle/categories/sci-nav-domain-1.00.xml,bundle/categories/sci-nav-hierarchy-1.00.xml +#com.arsdigita.bundle.loader.custom_app_instances=com.arsdigita.navigation.Navigation:scimenu:ScientificCMS Navigation Menu,com.arsdigita.navigation.Navigation:libmenu:LibreCMS Navigation Menu +#com.arsdigita.bundle.loader.domain_mappings=STD-NAV:/navigation/,STD-NAV:/generic/,STD-NAV:/portal/ # ============================================================================================= # runtime specific configurations -waf.admin.email=web...@sc... -waf.admin.name.given=SCI +waf.admin.email=web...@op... +waf.admin.name.given=OpenCCM waf.admin.name.family=Administrator -waf.admin.password=sci2000 -waf.admin.password.question=12345 +waf.admin.password=WaeGgfsh +waf.admin.password.question=12345 waf.admin.password.answer=6 -waf.runtime.jdbc_url=jdbc\:postgresql\://localhost/ccm-sci?user\=sci&password\=sci47web&stringtype\=unspecified -waf.runtime.jdbc_pool_size=30 +waf.runtime.jdbc_url=jdbc\:postgresql\://localhost/openccm?user\=ccm&password\=ccm42web +waf.runtime.jdbc_pool_size=40 waf.web.server=localhost\:8080 Modified: trunk/ccm-bundle/bundles/devel/cfg/project.xml =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/project.xml 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-bundle/bundles/devel/cfg/project.xml 2012-01-08 17:39:10 UTC (rev 2262) @@ -1,15 +1,16 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<!-- project.xml SCI devel - containing only modules used for ScientificCMS --> +<!-- project.xml - ccm - containing only those modules used for + CCM development --> <ccm:project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ccm="http://ccm.redhat.com/ccm-project" ccmVersion="6.1" - name="ScientificCMS" - prettyName="Scientific CMS" - version="1-1-6" - release="devel" - webxml="web-sci.xml" + name="librecms-ccm" + prettyName="LibreCMS OpenCCM" + version="0-0-0" + release="trunk-r1323" + webxml="web-ccm.xml" webapp="ROOT" xsi:schemaLocation="http://ccm.redhat.com/ccm-project file:tools-ng/common/xsd/project.xsd"> @@ -21,7 +22,7 @@ <ccm:build> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -<!-- Scientific CMS set of CORE packages --> +<!-- LibreCMS set of CORE packages --> <!-- NONE can be omitted for technical reasons / internal dependencies --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> @@ -41,24 +42,25 @@ <!-- Applications --> <ccm:application name="ccm-navigation"/> + <!-- ccm-portalworkspace depends on ccm-subsite --> <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-subsite"/> <ccm:application name="ccm-themedirector"/> <!-- LDN extension --> <ccm:application name="ccm-ldn-search"/> <ccm:application name="ccm-ldn-shortcuts"/> - <ccm:application name="ccm-ldn-subsite"/> <ccm:application name="ccm-ldn-terms"/> <ccm:application name="ccm-ldn-util"/> -<!-- SCI extension --> - <ccm:application name="ccm-sci-bundle"/> +<!-- LibreCMS bundle --> + <ccm:application name="ccm-bundle"/> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -<!-- Scientific CMS OPTIONAL packages --> -<!-- Various combinations of these packages make up specific editions --> +<!-- Libre CMS --> +<!-- Set of packages which make up a specific site --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Content Assets --> @@ -85,7 +87,7 @@ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -<!-- Scientific CMS potential ADD-ONS packages --> +<!-- Libre CMS potential ADD-ONS packages --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- CMS Content Types --> @@ -132,7 +134,7 @@ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> -<!-- Scientific CMS list of OBSOLETE modules --> +<!-- Libre CMS list of OBSOLETE modules --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Content Types --> Modified: trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml 2012-01-08 17:39:10 UTC (rev 2262) @@ -4,8 +4,8 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> - <display-name>Scientific CMS</display-name> - <description>Content and Collaboration Management for Scientific Institutions</description> + <display-name>LibreCMS OpenCCM Site</display-name> + <description>Community and Content Management</description> <!-- path and filename of the log4j user accessible config file WEB-INF/conf/log4j.properties is the built-in default value --> @@ -17,14 +17,13 @@ <!-- Require secure connection by redirect to host-port part of parameter waf.web.secure_server - NOT USED with ZeS <filter> <filter-name>secured</filter-name> <filter-class>com.arsdigita.web.SecureFilter</filter-class> </filter> --> <!-- Initialize Profiler timers - NOT USED with ZeS standard / production + NOT USED with standard / production <filter> <filter-name>profiler</filter-name> <filter-class>com.arsdigita.profiler.ProfilerFilter</filter-class> @@ -38,7 +37,7 @@ <filter> <filter-name>subsite</filter-name> - <filter-class>com.arsdigita.london.subsite.SubsiteFilter</filter-class> + <filter-class>com.arsdigita.subsite.SubsiteFilter</filter-class> </filter> <!-- NOT USED HERE @@ -277,7 +276,7 @@ <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> <param-name>template-path</param-name> - <param-value>/templates/ccm-ldn-subsite</param-value> + <param-value>/templates/ccm-subsite</param-value> </init-param> </servlet> <!-- module ccm-ldn-subsite - servlet declarations END --> @@ -375,7 +374,7 @@ <!-- module ccm-ldn-subsite - servlet mappings BEGIN --> <servlet-mapping> <servlet-name>subsite-files</servlet-name> - <url-pattern>/ccm-ldn-subsite/files/*</url-pattern> + <url-pattern>/ccm-subsite/files/*</url-pattern> </servlet-mapping> <!-- module ccm-ldn-subsite - servlet mappings END --> Modified: trunk/ccm-bundle/src/ccm-bundle.load =================================================================== --- trunk/ccm-bundle/src/ccm-bundle.load 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-bundle/src/ccm-bundle.load 2012-01-08 17:39:10 UTC (rev 2262) @@ -6,8 +6,8 @@ <table name="cms_items"/> <initializer class="com.arsdigita.cms.Initializer"/> <initializer class="com.arsdigita.london.terms.Initializer"/> - <initializer class="com.arsdigita.london.subsite.Initializer"/> <initializer class="com.arsdigita.portalworkspace.Initializer"/> + <initializer class="com.arsdigita.subsite.Initializer"/> <initializer class="com.arsdigita.london.search.Initializer"/> </requires> <provides> Modified: trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspaceSelectionModel.java =================================================================== --- trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspaceSelectionModel.java 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspaceSelectionModel.java 2012-01-08 17:39:10 UTC (rev 2262) @@ -31,7 +31,7 @@ import com.arsdigita.portalworkspace.WorkspacePage; import com.arsdigita.portalworkspace.WorkspacePageCollection; -import com.arsdigita.london.subsite.Subsite; +import com.arsdigita.subsite.Subsite; import com.arsdigita.util.Assert; import com.arsdigita.util.UncheckedWrapperException; Modified: trunk/ccm-bundle/web/themes/static/aplaws-generic/subsite-index.xsl =================================================================== --- trunk/ccm-bundle/web/themes/static/aplaws-generic/subsite-index.xsl 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-bundle/web/themes/static/aplaws-generic/subsite-index.xsl 2012-01-08 17:39:10 UTC (rev 2262) @@ -9,7 +9,7 @@ --> <!-- path to xsl if installed in the main (common) web context --> - <xsl:import href="../../../__ccm__/apps/subsite/xsl/index.xsl"/> + <xsl:import href="../../heirloom/apps/subsite/xsl/index.xsl"/> <xsl:import href="lib/page.xsl"/> Modified: trunk/ccm-core/src/com/arsdigita/domain/DomainQuery.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/domain/DomainQuery.java 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-core/src/com/arsdigita/domain/DomainQuery.java 2012-01-08 17:39:10 UTC (rev 2262) @@ -27,8 +27,8 @@ import java.util.Map; /** - * This is the base class that all other domain query classes - * would extend. It provides a facade on to a contained <code>DataQuery</code>. + * This is the base class that all other domain query classes would extend. + * It provides a facade on to a contained <code>DataQuery</code>. * * @see com.arsdigita.persistence.DataQuery * Modified: trunk/ccm-core/src/com/arsdigita/kernel/ui/ACSObjectSelectionModel.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/kernel/ui/ACSObjectSelectionModel.java 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-core/src/com/arsdigita/kernel/ui/ACSObjectSelectionModel.java 2012-01-08 17:39:10 UTC (rev 2262) @@ -97,23 +97,27 @@ * <p> * <b>Persistence Details:</b> The default constructor of * <code>ACSObjectSelectionModel</code> will attempt to use the - * {@link DomainObjectFactory} to automatically instantiate the correct Java subclass - * of {@link ACSObject}. However, it is also possible to use an alternate constructor - * in order to force the <code>ACSObjectSelectionModel</code> to manually instantiate - * the objects: + * {@link DomainObjectFactory} to automatically instantiate the correct Java + * subclass of {@link ACSObject}. However, it is also possible to use an + * alternate constructor in order to force the <code>ACSObjectSelectionModel</code> + * to manually instantiate the objects: * - * <blockquote><pre><code>ACSObjectSelectionModel model = new ACSObjectSelectionModel("com.arsdigita.cms.Article", "com.arsdigita.cms.Article", "item_id");</code></pre></blockquote> + * <blockquote><pre><code> + * ACSObjectSelectionModel model = + * new ACSObjectSelectionModel("com.arsdigita.cms.Article", + * "com.arsdigita.cms.Article", "item_id"); + * </code></pre></blockquote> * - * In this case, the model will attempt to use reflection to instantiate the correct - * subclass of <code>ACSObject</code>. In addition, the supplementary + * In this case, the model will attempt to use reflection to instantiate the + * correct subclass of <code>ACSObject</code>. In addition, the supplementary * constructor makes it possible to create new objects in the database * using the {@link #createACSObject(BigDecimal)} method. * - * @version $Id$ - * @author Stanislav Freidin * @see com.arsdigita.bebop.SingleSelectionModel * @see com.arsdigita.bebop.ParameterSingleSelectionModel * + * @author Stanislav Freidin + * @version $Id$ */ public class ACSObjectSelectionModel implements DomainObjectSelectionModel { @@ -178,9 +182,9 @@ * @param parameterName The name of the state parameter which will * be used to store the object ID. */ - public ACSObjectSelectionModel( - String javaClass, String objectType, String parameterName - ) { + public ACSObjectSelectionModel( String javaClass, + String objectType, + String parameterName ) { this(javaClass, objectType, new BigDecimalParameter(parameterName)); } @@ -197,9 +201,9 @@ * @param parameter The state parameter which should be used to store * the object ID */ - public ACSObjectSelectionModel( - String javaClass, String objectType, BigDecimalParameter parameter - ) { + public ACSObjectSelectionModel( String javaClass, + String objectType, + BigDecimalParameter parameter ) { this(javaClass, objectType, new ParameterSingleSelectionModel(parameter)); } @@ -217,9 +221,9 @@ * @param model The {@link SingleSelectionModel} which will supply * a {@link BigDecimal} ID of the currently selected object */ - public ACSObjectSelectionModel( - String javaClass, String objectType, SingleSelectionModel model - ) { + public ACSObjectSelectionModel( String javaClass, + String objectType, + SingleSelectionModel model ) { m_loaded = new RequestLocal() { protected Object initialValue(PageState state) { return Boolean.FALSE; @@ -232,9 +236,8 @@ m_javaClass = Class.forName(javaClass); m_constructor = m_javaClass.getConstructor(new Class[]{OID.class}); } catch (Exception e) { - throw new UncheckedWrapperException( - "Problem loading class " + javaClass, e - ); + throw new UncheckedWrapperException( "Problem loading class " + + javaClass, e ); } } Modified: trunk/ccm-core/src/log4j.properties =================================================================== --- trunk/ccm-core/src/log4j.properties 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-core/src/log4j.properties 2012-01-08 17:39:10 UTC (rev 2262) @@ -167,7 +167,6 @@ #com.arsdigita.london.rss.RSSService=DEBUG #com.arsdigita.london.search.Search=DEBUG #com.arsdigita.london.shortcuts.Shortcuts=DEBUG -#com.arsdigita.london.subsite.Subsite=DEBUG #kea.stemmers.LovinsStemmer=DEBUG #kea.stemmers.StopwordsFrench=DEBUG #kea.stemmers.StopwordsSpanish=DEBUG @@ -182,3 +181,4 @@ #com.arsdigita.cms.contenttypes.SciMember=DEBUG #com.arsdigita.cms.webpage.installer.Initializer=DEBUG +#com.arsdigita.subsite.Subsite=DEBUG Modified: trunk/ccm-forum/doc/semantic-XML-plan.txt =================================================================== --- trunk/ccm-forum/doc/semantic-XML-plan.txt 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-forum/doc/semantic-XML-plan.txt 2012-01-08 17:39:10 UTC (rev 2262) @@ -67,7 +67,7 @@ This generates XML looking like: <subsite:siteListing> - <object oid="[com.arsdigita.london.subsite.Site:{id=30008}]"> + <object oid="[com.arsdigita.subsite.Site:{id=30008}]"> <id>30008</id> <title>Another Site</title> <description>Some other stuff</description> @@ -80,7 +80,7 @@ <primaryURL>/portal/some.example.com/</primaryURL> </frontPage> </object> - <object oid="[com.arsdigita.london.subsite.Site:{id=32018}]"> + <object oid="[com.arsdigita.subsite.Site:{id=32018}]"> <id>32018</id> <title>My Site</title> <description>Some stuff</description> Modified: trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspaceSelectionModel.java =================================================================== --- trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspaceSelectionModel.java 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspaceSelectionModel.java 2012-01-08 17:39:10 UTC (rev 2262) @@ -31,7 +31,7 @@ import com.arsdigita.portalworkspace.WorkspacePage; import com.arsdigita.portalworkspace.WorkspacePageCollection; -import com.arsdigita.london.subsite.Subsite; +import com.arsdigita.subsite.Subsite; import com.arsdigita.util.Assert; import com.arsdigita.util.UncheckedWrapperException; Modified: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZCategoryProvider.java =================================================================== --- trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZCategoryProvider.java 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZCategoryProvider.java 2012-01-08 17:39:10 UTC (rev 2262) @@ -24,9 +24,9 @@ import com.arsdigita.cms.ContentType; import com.arsdigita.domain.DomainCollection; import com.arsdigita.navigation.DataCollectionDefinition; -import com.arsdigita.london.subsite.Site; -import com.arsdigita.london.subsite.Subsite; -import com.arsdigita.london.subsite.SubsiteContext; +import com.arsdigita.subsite.Site; +import com.arsdigita.subsite.Subsite; +import com.arsdigita.subsite.SubsiteContext; import com.arsdigita.persistence.DataAssociation; import com.arsdigita.persistence.DataAssociationCursor; import com.arsdigita.persistence.DataObject; Modified: trunk/ccm-navigation/src/com/arsdigita/navigation/Loader.java =================================================================== --- trunk/ccm-navigation/src/com/arsdigita/navigation/Loader.java 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-navigation/src/com/arsdigita/navigation/Loader.java 2012-01-08 17:39:10 UTC (rev 2262) @@ -42,6 +42,7 @@ import org.apache.log4j.Logger; + /** * Loader. * Modified: trunk/ccm-navigation/src/com/arsdigita/navigation/Template.java =================================================================== --- trunk/ccm-navigation/src/com/arsdigita/navigation/Template.java 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-navigation/src/com/arsdigita/navigation/Template.java 2012-01-08 17:39:10 UTC (rev 2262) @@ -37,6 +37,10 @@ import java.sql.SQLException; import java.math.BigDecimal; +/** + * + * + */ public class Template extends DomainObject { private static final Logger s_log = Logger.getLogger(Template.class); @@ -58,6 +62,9 @@ private static final String TEMPLATES_FOR_CATEGORY = "com.arsdigita.navigation.getTemplatesForCategory"; + /** + * Constructor + */ protected Template() { this(BASE_DATA_OBJECT_TYPE); } @@ -71,6 +78,9 @@ } + /** + * + */ public void initialize() { super.initialize(); Modified: trunk/ccm-navigation/src/com/arsdigita/navigation/tools/TemplateCreator.java =================================================================== --- trunk/ccm-navigation/src/com/arsdigita/navigation/tools/TemplateCreator.java 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-navigation/src/com/arsdigita/navigation/tools/TemplateCreator.java 2012-01-08 17:39:10 UTC (rev 2262) @@ -24,6 +24,12 @@ import org.apache.commons.cli.CommandLine; +/** + * Maintenance CLI procedure to insert additional jsp templates (used in + * navigation/admin) which determine how to display the index page for each + * node of the navigation tree. + * + */ public class TemplateCreator extends Program { public TemplateCreator() { super( "Navigation Create Category Template", @@ -51,6 +57,10 @@ txn.run(); } + /** + * + * @param args + */ public static void main( String[] args ) { new TemplateCreator().run( args ); } Modified: trunk/ccm-portalworkspace/application.xml =================================================================== --- trunk/ccm-portalworkspace/application.xml 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-portalworkspace/application.xml 2012-01-08 17:39:10 UTC (rev 2262) @@ -8,7 +8,7 @@ <ccm:dependencies> <ccm:requires name="ccm-core" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/> - <ccm:requires name="ccm-ldn-subsite" version="6.6.0" relation="ge"/> + <ccm:requires name="ccm-subsite" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-ldn-util" version="6.6.0" relation="ge"/> </ccm:dependencies> <ccm:contacts> Modified: trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java =================================================================== --- trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java 2012-01-08 17:39:10 UTC (rev 2262) @@ -75,6 +75,7 @@ /** Config object containing various parameter */ private static final WorkspaceConfig s_config = WorkspaceConfig.getConfig(); + /** Service method to provide client classes access to configuration. */ public static WorkspaceConfig getConfig() { return s_config; } Modified: trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortletTypeForm.java =================================================================== --- trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortletTypeForm.java 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/PortletTypeForm.java 2012-01-08 17:39:10 UTC (rev 2262) @@ -38,7 +38,7 @@ import com.arsdigita.kernel.permissions.PermissionService; import com.arsdigita.kernel.permissions.PrivilegeDescriptor; import com.arsdigita.portalworkspace.Workspace; -import com.arsdigita.london.subsite.Subsite; +import com.arsdigita.subsite.Subsite; import com.arsdigita.persistence.Filter; import com.arsdigita.portal.PortletType; import com.arsdigita.portal.PortletTypeCollection; Modified: trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/ApplicationSelectionModel.java =================================================================== --- trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/ApplicationSelectionModel.java 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/ApplicationSelectionModel.java 2012-01-08 17:39:10 UTC (rev 2262) @@ -26,21 +26,19 @@ import com.arsdigita.web.Web; /** - * This selection model has a default value which will be return when nothing is - * selected. + * This selection model adds an (optional?) default value which will be returned + * when nothing is selected. */ public class ApplicationSelectionModel extends ACSObjectSelectionModel { - // public static final BigDecimalParameter PARAM = - // (BigDecimalParameter)PermissionsPane.getObjectIDParam(); - public static final String DEFAULT_PARAM_NAME = "app_id"; private boolean m_hasDefaultValue; + /** Creates a s_logging category with name = full name of class */ private static final Logger s_log = Logger - .getLogger(ApplicationSelectionModel.class); + .getLogger(ApplicationSelectionModel.class); /** * Constructor @@ -112,6 +110,7 @@ * Override ACSObjectSelectionModel methods to default to the default * Application */ + @Override public boolean isSelected(PageState state) { if (m_hasDefaultValue && !super.isSelected(state)) { return (getDefaultApplication() != null); @@ -124,6 +123,7 @@ * @param state * @return */ + @Override public DomainObject getSelectedObject(PageState state) { if (m_hasDefaultValue && !super.isSelected(state)) { return getDefaultApplication(); @@ -137,6 +137,7 @@ * @param state * @return */ + @Override public Object getSelectedKey(PageState state) { if (m_hasDefaultValue && !super.isSelected(state)) { return getDefaultApplication(); Modified: trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/PeoplePane.java =================================================================== --- trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/PeoplePane.java 2012-01-08 17:17:10 UTC (rev 2261) +++ trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/PeoplePane.java 2012-01-08 17:39:10 UTC (rev 2262) @@ -29,7 +29,7 @@ import com.arsdigita.bebop.GridPanel; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.List; -import com.arsdigita.bebop.Page; +// import com.arsdigita.bebop.Page; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.RequestLocal; import com.arsdigita.bebop.SimpleContainer; @@ -48,10 +48,10 @@ import com.arsdigita.bebop.form.Submit; import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.NotEmptyValidationListener; -import com.arsdigita.domain.DomainObject; +// import com.arsdigita.domain.DomainObject; import com.arsdigita.kernel.Group; import com.arsdigita.kernel.PartyCollection; -import com.arsdigita.kernel.ui.ACSObjectSelectionModel; +// import com.arsdigita.kernel.ui.ACSObjectSelectionModel; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; import com.arsdigita.kernel.Role; @@ -70,6 +70,7 @@ import com.arsdigita.portalworkspace.ui.PortalConstants; import com.arsdigita.london.util.ui.DomainObjectSelectionModel; import com.arsdigita.persistence.OID; +//? import com.arsdigita.toolbox.ui.ACSObjectCollectionListModel; import com.arsdigita.toolbox.ui.IteratorListModel; Property changes on: trunk/ccm-subsite ___________________________________________________________________ Added: svn:ignore + build Added: trunk/ccm-subsite/.classpath =================================================================== --- trunk/ccm-subsite/.classpath (rev 0) +++ trunk/ccm-subsite/.classpath 2012-01-08 17:39:10 UTC (rev 2262) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-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" kind="src" path="/ccm-ldn-navigation"/> + <classpathentry combineaccessrules="false" kind="src" path="/ccm-ldn-util"/> + <classpathentry kind="output" path="build/Eclipse"/> +</classpath> Property changes on: trunk/ccm-subsite/.classpath ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-subsite/.project =================================================================== --- trunk/ccm-subsite/.project (rev 0) +++ trunk/ccm-subsite/.project 2012-01-08 17:39:10 UTC (rev 2262) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ccm-ldn-subsite</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Property changes on: trunk/ccm-subsite/.project ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-subsite/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/ccm-subsite/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ trunk/ccm-subsite/.settings/org.eclipse.jdt.core.prefs 2012-01-08 17:39:10 UTC (rev 2262) @@ -0,0 +1,62 @@ +#Fri May 04 16:16:11 CEST 2007 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.deprecation=ignore +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=ignore +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=ignore +org.eclipse.jdt.core.compiler.problem.unusedLabel=ignore +org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.4 Property changes on: trunk/ccm-subsite/.settings/org.eclipse.jdt.core.prefs ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-subsite/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- trunk/ccm-subsite/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ trunk/ccm-subsite/.settings/org.eclipse.jdt.ui.prefs 2012-01-08 17:39:10 UTC (rev 2262) @@ -0,0 +1,3 @@ +#Mon Apr 30 16:18:18 CEST 2007 +eclipse.preferences.version=1 +internal.default.compliance=user Property changes on: trunk/ccm-subsite/.settings/org.eclipse.jdt.ui.prefs ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-subsite/.svnignore =================================================================== --- trunk/ccm-subsite/.svnignore (rev 0) +++ trunk/ccm-subsite/.svnignore 2012-01-08 17:39:10 UTC (rev 2262) @@ -0,0 +1 @@ +build Property changes on: trunk/ccm-subsite/.svnignore ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-subsite/README =================================================================== --- trunk/ccm-subsite/README (rev 0) +++ trunk/ccm-subsite/README 2012-01-08 17:39:10 UTC (rev 2262) @@ -0,0 +1 @@ +A virtual hosting / subsite app Property changes on: trunk/ccm-subsite/README ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-subsite/application.xml =================================================================== --- trunk/ccm-subsite/application.xml (rev 0) +++ trunk/ccm-subsite/application.xml 2012-01-08 17:39:10 UTC (rev 2262) @@ -0,0 +1,22 @@ +<?xml version="1.0"?> +<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" + name="ccm-subsite" + prettyName="Subsite" + version="6.6.1" + release="1" + webapp="ROOT"> + <ccm:dependencies> + <ccm:requires name="ccm-core" version="6.6.0" relation="ge"/> + <ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/> + <ccm:requires name="ccm-navigation" version="6.6.0" relation="ge"/> + <ccm:requires name="ccm-ldn-util" version="6.6.0" relation="ge"/> + </ccm:dependencies> + <ccm:contacts> + <ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/> + <ccm:contact uri="mailto:rh...@re..." type="support"/> + </ccm:contacts> + <ccm:description> + The Red Hat Web Application Framework is a platform for writing + database-backed web applications in Java. + </ccm:description> +</ccm:application> Property changes on: trunk/ccm-subsite/application.xml ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-subsite/doc/subsite-standalone/README =================================================================== --- trunk/ccm-subsite/doc/subsite-standalone/README (rev 0) +++ trunk/ccm-subsite/doc/subsite-standalone/README 2012-01-08 17:39:10 UTC (rev 2262) @@ -0,0 +1,26 @@ +Up to APLAWS version 1.0.4 subsite had been installed into its own +application context: [webapps]/ccm-ldn-subsite. + +Now it is installed inside the main APLAWS application context along +with all other applications. + +Also, ccm-ldn-subsite is renamed to ccm-subsite. + +If shortcuts should be installed as its own web context again following +modifications are necessary: +1. remove webapp="xxx" from application.xml +2. move the files in this dir to WEB-INF/ +3. change src/com/ad/subsite/Subsite.java + method getServletContext() as back to "/files" +4. edit __ccm__/.../xsl/index.xsl according the comment +5. edit in ccm-ldn-aplaws /web/__ccm__/themes/aplaws/subsite.xml + according to the comment +6. Add the filter expression in web.xml-subsite.in into the + main applications web.xml + +Running it in its own webapplication context nevertheless is not suggestive. +It needs several xsl files of the main application (esp. core) for basic +operations, which hac been directly mapped from the main applications directory +tree into its own directory tree. So no module separation is possible, no +security context useable etc. + Added: trunk/ccm-subsite/doc/subsite-standalone/bebop-define.tld =================================================================== --- trunk/ccm-subsite/doc/subsite-standalone/bebop-define.tld (rev 0) +++ trunk/ccm-subsite/doc/subsite-standalone/bebop-define.tld 2012-01-08 17:39:10 UTC (rev 2262) @@ -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... [truncated message content] |
Author: pboy Date: 2012-01-08 17:17:10 +0000 (Sun, 08 Jan 2012) New Revision: 2261 Added: trunk/ccm-bundle/src/com/arsdigita/bundle/Loader_parameter.properties trunk/ccm-cms/src/com/arsdigita/cms/Loader_parameter.properties trunk/ccm-cms/src/com/arsdigita/cms/contentitem/ trunk/ccm-cms/src/com/arsdigita/cms/contentitem/ContentBundleHelper.java trunk/ccm-cms/src/com/arsdigita/cms/contentitem/ContentItemHelper.java trunk/ccm-cms/src/com/arsdigita/cms/contentitem/ContentPageHelper.java trunk/ccm-cms/src/com/arsdigita/cms/contentitem/GenericArticleHelper.java trunk/ccm-cms/src/com/arsdigita/cms/contentitem/XMLContentItemHandler.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentTypeHelper.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentTypeHelperImpl.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/UDCTHelper.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/XMLContentTypeHandler.java Removed: trunk/ccm-cms/src/com/arsdigita/cms/installer/ Modified: trunk/ccm-bundle/src/com/arsdigita/bundle/Loader.java trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventConfig.java trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventConfig_parameter.properties trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/ui/EventPropertyForm.java trunk/ccm-cms-types-job/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Job.xml trunk/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/SiteProxyUpgrade630to631.java trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl trunk/ccm-cms/src/ccm-cms.config trunk/ccm-cms/src/com/arsdigita/cms/ContentBundle.java trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java trunk/ccm-cms/src/com/arsdigita/cms/ItemCollection.java trunk/ccm-cms/src/com/arsdigita/cms/LanguageAwareObjectCopier.java trunk/ccm-cms/src/com/arsdigita/cms/Loader.java trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig_parameter.properties trunk/ccm-cms/src/com/arsdigita/cms/Service.java trunk/ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionSetup.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/CompareFilter.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/panels/SelectFilter.java trunk/ccm-cms/src/com/arsdigita/cms/lifecycle/LifecycleConfig.java trunk/ccm-cms/src/com/arsdigita/cms/lifecycle/LifecycleConfig_parameter.properties trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java trunk/ccm-cms/src/com/arsdigita/cms/upgrade/CreateGenericContentTypes.java trunk/ccm-cms/src/com/arsdigita/cms/util/LanguageUtil.java trunk/ccm-core/src/com/arsdigita/kernel/Group.java trunk/ccm-core/src/com/arsdigita/kernel/KernelConfig.java trunk/ccm-core/src/com/arsdigita/persistence/DataQueryImpl.java trunk/ccm-core/src/com/arsdigita/web/ApplicationType.java trunk/ccm-forum/src/com/arsdigita/forum/Forum.java trunk/ccm-forum/src/com/arsdigita/forum/Loader.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/cmd/BulkPublish.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/cmd/ReloadAuthoringSteps.java trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Initializer.java trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java Log: Various enhancements: improved multi-language support, multiPageArticle fixed, improved UI in content-center for large folters (filter introduced), ccm-cms Loader can handle multiple content sections, varius minor fixes. Modified: trunk/ccm-bundle/src/com/arsdigita/bundle/Loader.java =================================================================== --- trunk/ccm-bundle/src/com/arsdigita/bundle/Loader.java 2012-01-08 16:24:20 UTC (rev 2260) +++ trunk/ccm-bundle/src/com/arsdigita/bundle/Loader.java 2012-01-08 17:17:10 UTC (rev 2261) @@ -49,6 +49,10 @@ * * Creates category domains in the terms application according to * configuration files and adds jsp templates to navigation. + * + * NOTE: Configuration parameters used at load time MUST be part of Loader + * class and can not delegated to a Config object (derived from AbstractConfig). + * They will (and can) not be persisted into an registry object (file). * * @author Justin Ross <jr...@re...> * @author Peter Boy <pb...@ba...> @@ -70,9 +74,11 @@ * FULL_QUALIFIED_CLASS_NAME : URL : TITLE , * .... , * FULL_QUALIFIED_CLASS_NAME : URL : TITLE " + * E.G. + * "com.arsdigita.navigation.Navigation:local:Local Navigation" */ private Parameter m_customApplicationInstances = new StringArrayParameter( - "com.arsdigita.bundle.local_app_instances", + "com.arsdigita.bundle.loader.custom_app_instances", Parameter.OPTIONAL, null ); @@ -84,7 +90,7 @@ * Files are stored as part of the jar, so classloader can find them. */ private Parameter m_categoryFiles = new StringArrayParameter( - "com.arsdigita.bundle.category_files", + "com.arsdigita.bundle.loader.category_files", Parameter.REQUIRED,new String[]{ "bundle/categories/gen-nav-domain-1.00.xml", "bundle/categories/gen-nav-hierarchy-1.00.xml" } @@ -107,7 +113,7 @@ * */ private Parameter m_domainMappings = new StringArrayParameter( - "com.arsdigita.bundle.domain_mappings", + "com.arsdigita.bundle.loader.domain_mappings", Parameter.REQUIRED,new String[]{ "STD-NAV:/navigation/", "STD-NAV:/content/", "STD-NAV:/portal/" } Added: trunk/ccm-bundle/src/com/arsdigita/bundle/Loader_parameter.properties =================================================================== --- trunk/ccm-bundle/src/com/arsdigita/bundle/Loader_parameter.properties (rev 0) +++ trunk/ccm-bundle/src/com/arsdigita/bundle/Loader_parameter.properties 2012-01-08 17:17:10 UTC (rev 2261) @@ -0,0 +1,14 @@ +com.arsdigita.bundle.loader.custom_app_instances.title= Applications to create +com.arsdigita.bundle.loader.custom_app_instances.purpose=List of comma separated sets of application instance specifications,optionally used to create arbitrary custom application instances +com.arsdigita.bundle.loader.custom_app_instances.example=com.arsdigita.navigation.Navigation:scimenu:ScientificCMS Navigation Menu,com.arsdigita.navigation.Navigation:libmenu:LibreCMS Navigation Menu +com.arsdigita.bundle.loader.custom_app_instances.format=CLASS_NAME:URL:TITLE[,CLASS_NAME:URL:TITLE[,...]] + +com.arsdigita.bundle.loader.category_files.title= Domain Categories Definitions Files +com.arsdigita.bundle.loader.category_files.purpose=Comma separated list of fully qualified filenames. +com.arsdigita.bundle.loader.category_files.example=bundle/categories/gen-nav-domain-1.00.xml,bundle/categories/gen-nav-hierarchy-1.00.xml +com.arsdigita.bundle.loader.category_files.format=[StringArray] + +com.arsdigita.bundle.loader.domain_mappings.title= Domain Mappings +com.arsdigita.bundle.loader.domain_mappings.purpose=List of comma separated sets of domain mappings. +com.arsdigita.bundle.loader.domain_mappings.example=STD-NAV:/navigation/,STD-NAV:/content/,STD-NAV:/portal/ +com.arsdigita.bundle.loader.domain_mappings.format=[StringArray] Property changes on: trunk/ccm-bundle/src/com/arsdigita/bundle/Loader_parameter.properties ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl =================================================================== --- trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl 2012-01-08 16:24:20 UTC (rev 2260) +++ trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl 2012-01-08 17:17:10 UTC (rev 2261) @@ -1,6 +1,5 @@ // -// Copyright (C) 2010 Jens Pelzetter, for the Center of Social Politics (ZeS) of -// the University of Bremen +// Copyright (C) 2010 Jens Pelzetter // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License Modified: trunk/ccm-cms/src/ccm-cms.config =================================================================== --- trunk/ccm-cms/src/ccm-cms.config 2012-01-08 16:24:20 UTC (rev 2260) +++ trunk/ccm-cms/src/ccm-cms.config 2012-01-08 17:17:10 UTC (rev 2261) @@ -6,8 +6,6 @@ storage="ccm-cms/contentsection.properties"/> <config class="com.arsdigita.cms.lifecycle.LifecycleConfig" storage="ccm-cms/lifecycle.properties"/> - <config class="com.arsdigita.cms.LoaderConfig" - storage="ccm-cms/loader.properties"/> <config class="com.arsdigita.cms.publishToFile.PublishToFileConfig" storage="ccm-cms/publishToFile.properties"/> <config class="com.arsdigita.cms.contenttypes.GenericAddressConfig" Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentBundle.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentBundle.java 2012-01-08 16:24:20 UTC (rev 2260) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentBundle.java 2012-01-08 17:17:10 UTC (rev 2261) @@ -339,7 +339,7 @@ // if we couldn't find an exact match and language independent // content items are acceptable. if (contentItem == null && allowLanguageIndependent == true) { - contentItem = this.getInstance("--", false); + contentItem = this.getInstance(GlobalizationHelper.LANG_INDEPENDENT, false); } return contentItem; Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java 2012-01-08 16:24:20 UTC (rev 2260) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java 2012-01-08 17:17:10 UTC (rev 2261) @@ -1076,13 +1076,13 @@ String trc = "com.arsdigita.cms.dispatcher.DefaultTemplateResolver"; ContentSection section = ContentSection.create(name, - folder, - category, - staff, - prc, - irc, - xgc, - trc); + folder, + category, + staff, + prc, + irc, + xgc, + trc); // Set the default context on the root folder to // the content section @@ -1106,21 +1106,23 @@ * @return The new content section */ public static ContentSection create(String name, - Folder folder, - Category category, - Group staff, - String prc, - String irc, - String xgc) { + Folder folder, + Category category, + Group staff, + String prc, + String irc, + String xgc) { + /** Set default as template resolver class name */ + String trc = "com.arsdigita.cms.dispatcher.DefaultTemplateResolver"; return ContentSection.create( - name, - folder, - category, - staff, - prc, - irc, - xgc, - "com.arsdigita.cms.dispatcher.DefaultTemplateResolver"); + name, + folder, + category, + staff, + prc, + irc, + xgc, + trc); } /** @@ -1138,13 +1140,13 @@ * @return The new content section */ public static ContentSection create(String name, - Folder folder, - Category category, - Group staff, - String prc, - String irc, - String xgc, - String trc) { + Folder folder, + Category category, + Group staff, + String prc, + String irc, + String xgc, + String trc) { // This could be moved out of here and into the Installer // (passing it into a modified version of create) @@ -1164,15 +1166,15 @@ .createApplication(BASE_DATA_OBJECT_TYPE , name, name, null); section.initialize(name, - folder, - category, - staff, - prc, - irc, - xgc, - trc, - templates, - viewers); + folder, + category, + staff, + prc, + irc, + xgc, + trc, + templates, + viewers); return section; } @@ -1310,8 +1312,4 @@ return URL.SERVLET_DIR + "/content-section"; } -// @Override -// public String getStylesheetPath() { -// return STYLESHEET; -// } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/ItemCollection.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ItemCollection.java 2012-01-08 16:24:20 UTC (rev 2260) +++ trunk/ccm-cms/src/com/arsdigita/cms/ItemCollection.java 2012-01-08 17:17:10 UTC (rev 2261) @@ -29,13 +29,12 @@ /** * Represents a set of {@link com.arsdigita.cms.ContentItem content * items}. + * @see com.arsdigita.domain.DomainCollection + * @see com.arsdigita.persistence.DataCollection * * @author <a href="mailto:pi...@ar...">Michael Pih</a> * @author <a href="mailto:lu...@ar...">David Lutterkort</a> * @version $Revision: #14 $ $Date: 2004/08/17 $ - * - * @see com.arsdigita.domain.DomainCollection - * @see com.arsdigita.persistence.DataCollection */ public class ItemCollection extends DomainCollection { Modified: trunk/ccm-cms/src/com/arsdigita/cms/LanguageAwareObjectCopier.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/LanguageAwareObjectCopier.java 2012-01-08 16:24:20 UTC (rev 2260) +++ trunk/ccm-cms/src/com/arsdigita/cms/LanguageAwareObjectCopier.java 2012-01-08 17:17:10 UTC (rev 2261) @@ -45,9 +45,10 @@ m_traversed.add(selem, reverse); DomainObject telem = copy(source, target, selem, prop); - if (telem instanceof ContentPage) { - ContentPage tpage = (ContentPage) telem; - telem = tpage.getContentBundle().getInstance(language); + if ((telem instanceof ContentPage) + && ((ContentPage) telem).getContentBundle() != null) { + telem = ((ContentPage) telem).getContentBundle().getInstance( + language); } DataObject tgtLink = null; Modified: trunk/ccm-cms/src/com/arsdigita/cms/Loader.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2012-01-08 16:24:20 UTC (rev 2260) +++ trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2012-01-08 17:17:10 UTC (rev 2261) @@ -20,28 +20,25 @@ import com.arsdigita.cms.contentsection.ContentSectionSetup; import com.arsdigita.cms.util.Util; -import com.arsdigita.cms.installer.xml.XMLContentTypeHandler; +import com.arsdigita.cms.contenttypes.XMLContentTypeHandler; import com.arsdigita.cms.portlet.ContentDirectoryPortlet; import com.arsdigita.cms.portlet.ContentItemPortlet; import com.arsdigita.cms.portlet.ContentSectionsPortlet; import com.arsdigita.cms.portlet.TaskPortlet; import com.arsdigita.domain.DomainObject; -// import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.formbuilder.util.FormbuilderSetup; import com.arsdigita.kernel.ACSObjectInstantiator; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; -// import com.arsdigita.kernel.PackageInstance; -// import com.arsdigita.kernel.PackageType; -// import com.arsdigita.kernel.SiteNode; -// import com.arsdigita.kernel.Stylesheet; import com.arsdigita.kernel.permissions.PrivilegeDescriptor; import com.arsdigita.loader.PackageLoader; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.DataQuery; import com.arsdigita.persistence.SessionManager; -// import com.arsdigita.runtime.ConfigError; import com.arsdigita.runtime.ScriptContext; +import com.arsdigita.util.parameter.Parameter; +import com.arsdigita.util.parameter.StringArrayParameter; +// import com.arsdigita.util.parameter.StringParameter; import com.arsdigita.web.Application; import com.arsdigita.web.ApplicationSetup; import com.arsdigita.web.ApplicationType; @@ -53,6 +50,7 @@ import org.apache.log4j.Logger; + // Migration status // // The module in its complete version (i.e. all method invocations in run() @@ -61,6 +59,8 @@ // // Next Try // Refactor using legacy compatible web/Application and ApplicationSetup + + /** * <p>Executes nonrecurring at install time and loads (installs and initializes) * the Content Management System module,including the Content Center, CMS Service @@ -92,57 +92,73 @@ /** Creates a s_logging category with name = full name of class */ private static final Logger s_log = Logger.getLogger(Loader.class); - /** Loader configuration object, singleton design pattern */ + /** Loader configuration object, singleton design pattern + * NOTE: LoaderConfig only supplies unmutable hatrd coded defaults! It is + * not possible to alter any to the contained values by specifiying an + * configuration parameter during load step. If a configuration value + * has to be configurable at load time, the parameter must be relcated + * into this Loader class! */ private static final LoaderConfig s_conf = LoaderConfig.getInstance(); + // /////////////////////////////////////////////////////////////////// + // Configurable parameters during load step. + // /////////////////////////////////////////////////////////////////// + /** - * Constant string used as key for creating CMS (content-section) as a - * legacy application. + * The name(s) of the content section(s). In case of more than one name the + * first is treated as default section. Otherwise the section created is the + * default section. More sections can always be created during a subsequent + * system startup using initialization parameters. */ - private final static String CMS_PACKAGE_KEY = "content-section"; - /** - * Dispatcher class for CMS (needed to be assigned to a legacy application). - */ - private final static String CMS_DISPATCHER_CLASS = - "com.arsdigita.cms.dispatcher.ContentSectionDispatcher"; + private final Parameter m_contentSectionNames = new StringArrayParameter( + "com.arsdigita.cms.loader.section_names", + Parameter.REQUIRED, + new String[] {"content"} + ); + + +// Nolonger used // /** -// * Stylesheet which has to be assigned as part of a legacy application -// * creation. +// * Constant string used as key for creating CMS (content-section) as a +// * legacy application. // */ -// Assigned stylesheets no longer used and base class removed. -// private final static String CMS_STYLESHEET = -// "/packages/content-section/xsl/cms.xsl"; +// private final static String CMS_PACKAGE_KEY = "content-section"; // /** +// * Dispatcher class for CMS (needed to be assigned to a legacy application). +// */ +// private final static String CMS_DISPATCHER_CLASS = +// "com.arsdigita.cms.dispatcher.ContentSectionDispatcher"; + +// /** // * Constant string used as key for creating Workspace (content-center) as a // * legacy application. // */ // public static final String WORKSPACE_PACKAGE_KEY = "content-center"; - private static final String WORKSPACE_INSTANCE_NAME = "Content Center"; - /** - * Dispatcher class for Workspace (content-center) (needed to be assigned - * to a legacy application). - */ - private static final String WORKSPACE_DISPATCHER_CLASS = - "com.arsdigita.cms.dispatcher.ContentCenterDispatcher"; - // To be updated soon... - // "com.arsdigita.dispatcher.DefaultPackageDispatcher"; +// private static final String WORKSPACE_INSTANCE_NAME = "Content Center"; +// /** +// * Dispatcher class for Workspace (content-center) (needed to be assigned +// * to a legacy application). +// */ +// private static final String WORKSPACE_DISPATCHER_CLASS = +// "com.arsdigita.cms.dispatcher.ContentCenterDispatcher"; +// // To be updated soon... +// // "com.arsdigita.dispatcher.DefaultPackageDispatcher"; +// No longer used, moved to class Service // /** -// * Stylesheet which has to be assigned as part of a legacy application -// * creation. +// * Name of the CMS service package instance, i.e. its URL. // */ -// private final static String WORKSPACE_STYLESHEET = -// "/packages/content-section/xsl/content-center.xsl"; - /** - * Name of the CMS service package instance, i.e. its URL. - */ - private final static String SERVICE_URL = "cms-service"; +// private final static String SERVICE_URL = "cms-service"; // /** // * Constant string used as key for creating service package as a // * legacy application. // */ // public final static String SERVICE_PACKAGE_KEY = "cms-service"; + + /** + * + */ private ArrayList m_content_type_list = new ArrayList(); /** @@ -151,6 +167,8 @@ public Loader() { s_log.debug("CMS.loader (Constructor) invoked"); + register(m_contentSectionNames); + s_log.debug("CMS.loader (Constructor) completed"); } @@ -162,13 +180,6 @@ public void excurse() { setEffectiveParty(Kernel.getSystemParty()); - // 1 - step 1a) Setup the CMS (content section) package type. - // Uses old style application setup kernel.Package and Sitenode. - // It is not needed, this step is included in new style setup - // of content section (see below). It is here for reference - // purpose during migration of the whole CMS to new style. - // loadCMSPackageType(); - // 2 - step 1b) Setup the Workspace package. // loadWorkspacePackage(); // using old stype // new style: @@ -187,7 +198,7 @@ // purpose during migration of the whole CMS to new style. // loadContentCenterMapping(s_conf.getContentCenterMap() ); - // 5) load content type definition(s) + // 5) load (cms internal) content type definition(s) // Used to be step 2 in former enterprise.init file loadContentTypeDefinitions(s_conf.getCTDefFiles()); @@ -197,7 +208,7 @@ // Implemented by // com.arsdigita.cms.installer.SectionInitializer // Loads content section application type and instance in one step - loadContentSection(s_conf.getContentSectionName()); + loadContentSection( (String[]) get(m_contentSectionNames) ); // Loading CMS portlets // Used to be step 7 (last step) in former enterprise.init @@ -218,106 +229,6 @@ }.run(); } -// Migration Status: -// Method completely replaced by loadContentSection() -// Code kept for reference purpose untill the complete migration will be done. -// -// /** -// * Loads the CMS package type in the database, i.e. content-section, -// * the main CMS domain (application) class. -// * -// * (pb) WRONG: -// * Creates content-section PackageType. Is replaced by newer ApplicationType -// * mechanisam (see loadContentSection). Must nolonger be used. -// * createPrivileges might be included in load, but has te be executed at -// * each startup to take modifications into accout. So it has to be an -// * initializer task anyway. -// */ -// private void loadCMSPackageType() { -// s_log.debug("Loading the CMS package type..."); -// -// // creating appl. type using the deprecated legacy application style. -// // Should be refactored to c.ad.web.Application. -// // CMS_PACKAGE_KEY = "content-section" -// PackageType type = PackageType.create -// (CMS_PACKAGE_KEY, -// "Content Management System", -// "Content Management Systems", -// "http://cms-java.arsdigita.com/"); -// -// type.setDispatcherClass(CMS_DISPATCHER_CLASS); -// //type.addListener(LISTENER_CLASS); (commented out) -// -// // Register a stylesheets to the CMS package. -// Stylesheet ss = Stylesheet.createStylesheet(CMS_STYLESHEET); -// ss.save(); -// type.addStylesheet(ss); -// type.save(); -// -// -// Creating of CMS package using new style c.ad.web.Application could -// be done like the following. -// ApplicationType type = ApplicationType -// .createApplicationType(ContentSection.PACKAGE_TYPE, -// "Conten Management Application (i.e. content-section)", -// ContentSection.BASE_DATA_OBJECT_TYPE); -// type.setDescription("The content management application."); -// // Question: Do we need to use deprectated (with no replacement) method -// // setDispatcherClass in web.Application or does it work magically without? -// type.setDispatcherClass(CMS_DISPATCHER_CLASS); -// type.addStylesheet(ss); -// -// -// createPrivileges(); -// -// s_log.debug("Done creating the CMS package type."); -// } -// /** -// * Loads and instantiates the Workspace package (content-center) in the -// * database using old style application. -// * Will be replaced by new style application in the migration process, -// */ -/* - private void loadWorkspacePackage() { - s_log.debug("Creating CMS Workspace..."); - - // from WorkspaceInstaller workspaceInstaller = new WorkspaceInstaller(); - try { - // workspaceInstaller.createPackageType(); - PackageType type = PackageType.create(CMS.WORKSPACE_PACKAGE_KEY, - "Content Center", - "Content Centers", - "http://cms-workspace.arsdigita.com/"); - type.setDispatcherClass(WORKSPACE_DISPATCHER_CLASS); - type.save(); - - // from PackageInstance instance = workspaceInstaller.createPackageInstance(); - // Does the following: - type = PackageType.findByKey(CMS.WORKSPACE_PACKAGE_KEY); - PackageInstance instance = type.createInstance(WORKSPACE_INSTANCE_NAME); - instance.save(); - - // from: workspaceInstaller.mountPackageInstance(instance, m_workspaceURL); - // Does the following: - // We really don't want it configurable. - // SiteNode node = SiteNode.createSiteNode(CMS.WORKSPACE_PACKAGE_KEY, - // SiteNode.getRootSiteNode()); - SiteNode node = SiteNode.createSiteNode(CMS.WORKSPACE_PACKAGE_KEY, - SiteNode.getRootSiteNode()); - node.mountPackage(instance); - node.save(); - - // m_workspaceURL == WORKSPACE_PACKAGE_KEY - // workspaceInstaller.mountPackageInstance(instance, m_workspaceURL); - // workspaceInstaller.mountPackageInstance(instance, CMS.WORKSPACE_PACKAGE_KEY); - - } catch (DataObjectNotFoundException e) { - throw new ConfigError( - "Failed to initialize the Workspace package: "); - } - - } -*/ /** * Loads and instantiates the Workspace package (content-center) in the * database. @@ -374,46 +285,12 @@ null); // parent app.setDescription("The default CMS workspace instance."); app.save(); - s_log.warn("CMS Workspace instance created."); + s_log.warn("CMS Workspace instance " + Workspace.PACKAGE_KEY + " created."); s_log.debug("Done loading CMS Workspace."); } -// /** -// * CMS Service application is used by the Content Management System as a -// * store for global resources and assets. -// * Using old style application, will be replaced by new style in the -// * migration process. -// */ -/* private void loadServicePackage() { - s_log.debug("Loading CMS Servce Package..."); - - try { - // from ServiceInstaller.createPackageType(); - PackageType type = PackageType.create(CMS.SERVICE_PACKAGE_KEY, - "Content Management System Services", - "Content Management System Services", - "http://cms-service.arsdigita.com/"); - type.setDispatcherClass( - "com.arsdigita.cms.dispatcher.ServiceDispatcher"); - type.save(); - - // from PackageInstance instance = ServiceInstaller.createPackageInstance(); - type = PackageType.findByKey(CMS.SERVICE_PACKAGE_KEY); - PackageInstance instance = type.createInstance(CMS.SERVICE_PACKAGE_KEY); - instance.save(); - - // from ServiceInstaller.mountPackageInstance(instance, url); - SiteNode node = SiteNode.createSiteNode(SERVICE_URL, - SiteNode.getRootSiteNode()); - node.mountPackage(instance); - node.save(); - - } catch (DataObjectNotFoundException e) { - throw new ConfigError("Failed to initialize CMS global services package."); - } - } -*/ + /** * CMS Service application is used by the Content Management System as a * store for global resources and assets. @@ -473,23 +350,26 @@ s_log.debug("Done creating CMS Service Package."); } + /** - * Load an content section application type and an initial default - * content-section instance as specified in LoaderConfig. + * Load a content section application type and an initial default + * content-section instance(s). + * Some configuration values which are to be considered as unmutable are + * specified in LoaderConfig. * Uses new style application in legacy compatible mode. * + * NOTE: At ccm-cms load time no content type packages are available because + * any content type depends on ccm-cms. Therefore, the loading step can not + * process content type package assignment! Instead each content type itself + * must assign itself to an apropriate content section at it's load time. + * Cf. {@link com.arsdigita.cms.contenttype.AbstractContentTypeLoader}. + * + * But the load step has to process the cms internal content types! */ - private void loadContentSection(String name) { + private void loadContentSection(String[] sectionNames) { - s_log.info("Creating content section on /" + name); - - // Step 1: Validate name for section - Util.validateURLParameter("name", name); - - // Step 2: Creating content section application type first so that - // concrete content-section instance can be created. - // from: ContentSectionSetup.setupContentSectionAppType(); - // Install application type using new application classes + // Step 1: Create content section application type + // prerequisite for concrete content-section instance creation. ApplicationSetup appType = new ApplicationSetup(s_log); appType.setApplicationObjectType(ContentSection.BASE_DATA_OBJECT_TYPE); appType.setKey(ContentSection.PACKAGE_TYPE); // by default: content-section @@ -511,75 +391,94 @@ appType.run(); - // Step 3: + // Step 2: Load CMS specific privileges into central (core) privilege + // system. createPrivileges(); - // Step 4: Create the installation default content section "name" + // Step 3: Create the installation default content section(s). // ContentSection.create creates a section with several default values // which have to be adopted for a concrete installation. - ContentSection section = ContentSection.create(name); - // ContentSectionSetup is a convenient class to adopt a section created - // by ContentSection.create() - ContentSectionSetup setup = new ContentSectionSetup(section); + for (int i = 0 ; i < sectionNames.length ; i++) { + + final String sectionName = sectionNames[i]; + s_log.warn("Creating content section on /" + sectionName); - // ContentSection.create uses the following properties: - // Name, see above - // Root & template folder, set autonomously by ContentSection.create() + // Step 1: Validate name for section + Util.validateURLParameter("name", sectionName); + + // Step 2: Create a section using default values + ContentSection section = ContentSection.create(sectionName); + + // Step 3: Adopt the created section to site specific requirements + // ContentSectionSetup is a convenient class to adopt a + // section created by ContentSection.create() + ContentSectionSetup setup = new ContentSectionSetup(section); - // Roles (staff group) used in content section. Register roles using - // a complete set of default roles defined in ContentSectionSetup - setup.registerRoles(s_conf.getStuffGroup()); + // Step 3a: Roles (staff group) used in this content section. + // Register roles using a complete set of default roles + // defined in ContentSectionSetup + setup.registerRoles(s_conf.getStuffGroup()); - // ViewerGroup populated in ContentSection, public access is determined - // by parameter (affecting characteristics of the viewer group) - setup.registerViewers(s_conf.isPubliclyViewable()); + // ViewerGroup populated in ContentSection, public access is determined + // by parameter (affecting characteristics of the viewer group) + setup.registerViewers(s_conf.isPubliclyViewable()); - // Page resolver class, set autonomously by ContentSection.create() - // Item resolver class, configurable, defaults in place. - // Template resolver class, configurable, defaults in place. - // We should not overwrite the default in the initial default configuration + // Page resolver class, set autonomously by ContentSection.create() + // Item resolver class, configurable, defaults in place. + // Template resolver class, configurable, defaults in place. + // We should not overwrite the default in the initial default configuration - // register a predefined one-phase lifecycle for items. - setup.registerPublicationCycles(); - // registers predefined "Authoring", "Approval", "Publishing' steps - setup.registerWorkflowTemplates(); - setup.registerResolvers(s_conf.getItemResolverClass(), - s_conf.getTemplateResolverClass()); - // XML generator class, set autonomously by ContentSection.create() + // register a predefined one-phase lifecycle for items. + setup.registerPublicationCycles(); + // registers predefined "Authoring", "Approval", "Publishing' steps + setup.registerWorkflowTemplates(); + setup.registerResolvers(s_conf.getItemResolverClass(), + s_conf.getTemplateResolverClass()); + // XML generator class, set autonomously by ContentSection.create() - setup.registerContentTypes(m_content_type_list); - setup.registerContentTypes(s_conf.getContentSectionsContentTypes()); - // Section specific categories, usually not used. - // During initial load at install time nor used at all! - // default value is false so no categories get loaded. - if (s_conf.getUseSectionCategories()) { - Iterator files = ((List) s_conf.getCategoryFileList()).iterator(); - while (files.hasNext()) { - setup.registerCategories((String) files.next()); + /* Register internal base content types. Paramter is a list of + * class names created by internal content type load method. + * @see loadContentTypeDefinitions(List) */ + setup.registerContentTypes(m_content_type_list); + + // See method doc above. No external content types available at + // cms load time, + // setup.registerContentTypes(s_conf.getContentSectionsContentTypes()); + + // Section specific categories, usually not used. + // During initial load at install time nor used at all! + // default value is false so no categories get loaded. + if (s_conf.getUseSectionCategories()) { + Iterator files = ((List) s_conf.getCategoryFileList()).iterator(); + while (files.hasNext()) { + setup.registerCategories((String) files.next()); + } } - } - // registers a predefined standard recipient for alerts - setup.registerAlerts(); + // registers a predefined standard recipient for alerts + setup.registerAlerts(); - // Load a list of cms tasks and associated alert events - // Currently no functionality to persist them. Not a loader task yet - // setup.loadTaskAlerts(s_conf.getTaskAlerts()); + // Load a list of cms tasks and associated alert events + // Currently no functionality to persist them. Not a loader task yet + // setup.loadTaskAlerts(s_conf.getTaskAlerts()); - section.save(); //persists any changes in the database (DomainObject) - //i.e. creates an object (instance) + section.save(); //persists any changes in the database (DomainObject) + //i.e. creates an object (instance) + } } /** - * Parses XML file definition of content types and loads them to the - * database. The XML config looks like the example below, the - * "parentType" and "name" attributes are optional, and only required - * for creating User Defined ContentTypes. Label corresponds to - * ContentType's label and can be multiple words, and "name" to - * DynamicObject's name property, and must be a single word. The - * objectType attribute is ignored for UDCTs, as it gets dynamically - * generated. + * Parses XML file definition of (internal) base content types and loads + * them into database. It fulfills a task similiar to the Loader of external + * content type packages. + * + * The XML config looks like the example below, the "parentType" and "name" + * attributes are optional, and only required for creating + * User Defined ContentTypes. Label corresponds to ContentType's label and + * can be multiple words, and "name" to DynamicObject's name property, + * and must be a single word. The objectType attribute is ignored for + * UDCTs, as it gets dynamically generated. * * <b>UDCT Copyright</b> * <pre> Modified: trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java 2012-01-08 16:24:20 UTC (rev 2260) +++ trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java 2012-01-08 17:17:10 UTC (rev 2261) @@ -31,11 +31,20 @@ import org.apache.log4j.Logger; +// IMPLEMENTATION NOTE +// Class is a result of migrating the old enterprise.init based +// initialization process and not yet completed. Functionality is +// basically OK so far, but code urgently needs cleaning up and a +// check for useful bits. + + /** - * Module enables administrators to configure some features of the CMS application - * at install time. It is read in and processed only once and configuration is - * persisted in database. Currently there is no way to alter these features - * later after the installation step. + * Container for various configuration parameters for ccm-cms package loader. + * + * The parameters are basically immutable for users and administrators and only + * accessible to developers and require recompilation. Specifying any of these + * parameters during installation takes no effect at all! Parameters which have + * to be modifiable must be included in Loader class itself! * * @author pb * @version $Id: LoaderConfig.java $ @@ -56,16 +65,11 @@ public static synchronized LoaderConfig getInstance() { if (s_conf == null) { s_conf = new LoaderConfig(); - /* Currently LoaderConfig does not process parameters stored in a - * properties file. In order to do so the class must be added to - * ccm-cms.config, a storage file specified and the load() commented - * in. - * Before it can be used meaningfully, ccm-xxx-aplaws must be enhanced - * to be able tp process dynamically e.g. section name and other - * parameter values. Currently, section name is hardcoded (content) as - * well as creating terms domains etc. + /* Parameters are not stored in registry nor modified by installation + * specification. It is not possible to process a config object at + * Load time! + * s_conf.load(); */ - // s_conf.load(); } return s_conf; @@ -125,23 +129,26 @@ // s_log.debug("Set cache items to " + cacheItems); // ItemDispatcher.setCacheItems(cacheItems); - // ///////////////////////////////////////////////////// - // Following parameter is used by c.ad.cms.installer.xml - // to load definition(s) of content types to database. - // (Definitions describe sections to be included in - // authoring steps). - // ///////////////////////////////////////////////////// /** - * List of Paths to XML files that contain content type definition(s). + * Comma separated list of XML definition files for internal content types + * (base types). + * + * Each internal content type (see package com/arsdigita/cms/contenttypes) + * requires an entry in this list in order to get CMS Loader to load it + * into permanent storage (equivalent to the Loader of each external + * content type package). + * + * Each definition file name has to be fully qualified relative to + * application (context) root. * Example: * contentTypeDefinitions = { "/WEB-INF/content-types/Template.xml" }; - * An entry in this list is required by internal content types (see package - * ccm-cms/src/com/arsdigita/cms/contenttypes) + * + * This parameter should be altered only by developers! */ private final Parameter m_ctDefFiles = new StringArrayParameter( - "com.arsdigita.cms.loader.contenttype_definition_files", + "com.arsdigita.cms.loader.internal_cts", Parameter.REQUIRED, // Generic*.xml added by Quasi in enterprise.init for // new generic Basetypes in addition to article @@ -163,16 +170,8 @@ // /////////////////////////////////////////////////////////////////////// - /** - * The name of the content section, the default value used for initial - * setup. - */ - private final Parameter - m_contentSectionName = new StringParameter( - "com.arsdigita.cms.loader.section_name", - Parameter.REQUIRED, - "content"); - + // Section Name, configured by Loader parameter + // Root Folder, set autonomously by ContentSection.create() method // Template Folder, set autonomously by ContentSection.create() method @@ -224,12 +223,16 @@ * When the list is empty and the first default content section is created, * all installed content types will get registered. This behaviour should * not be altered without very good reasons. + * + * While loading ccm-cms no external content type packages are available + * because all content types depend on ccm-cms. Therefore this parameter + * can not beused in loader context. */ - private final Parameter - m_contentTypeList = new StringArrayParameter( - "com.arsdigita.cms.loader.section_ctypes_list", - Parameter.REQUIRED, - new String[] {} ); + //private final Parameter + // m_contentTypeList = new StringArrayParameter( + // "com.arsdigita.cms.loader.section_ctypes_list", + // Parameter.REQUIRED, + // new String[] {} ); // Page Resolver Class, set autonomously by ContentSection.create() method. @@ -310,7 +313,6 @@ // new String[] {"/WEB-INF/resources/article-categories.xml", // "/WEB-INF/resources/navigation-categories.xml"} ); - /** List of widgets used in applications forms. Each widget is described by application indicator, widget name (singular & plural), model class name and model ui class name. These are really not user or administrator @@ -486,12 +488,11 @@ register(m_ctDefFiles); // Parameters for creating a content section - register(m_contentSectionName); register(m_isPublic); register(m_itemResolverClass); register(m_templateResolverClass); - register(m_contentTypeList); + // register(m_contentTypeList); register(m_useSectionCategories); register(m_categoryFileList); @@ -504,9 +505,7 @@ // register(m_overdueAlertInterval); // register(m_maxAlerts); - - - + // Does not work at load time! // loadInfo(); } @@ -542,12 +541,6 @@ } - /** - * Retrieve the name of the content-section - */ - public String getContentSectionName() { - return (String) get(m_contentSectionName); - } /** @@ -694,9 +687,9 @@ /** * Retrieve the */ - public List getContentSectionsContentTypes() { - String[] contentTypes = (String[]) get(m_contentTypeList); - return Arrays.asList(contentTypes); - } +// public List getContentSectionsContentTypes() { +// String[] contentTypes = (String[]) get(m_contentTypeList); +// return Arrays.asList(contentTypes); +// } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig_parameter.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig_parameter.properties 2012-01-08 16:24:20 UTC (rev 2260) +++ trunk/ccm-cms/src/com/arsdigita/cms/LoaderConfig_parameter.properties 2012-01-08 17:17:10 UTC (rev 2261) @@ -13,11 +13,6 @@ com.arsdigita.cms.loader.contenttype_definition_files.example= com.arsdigita.cms.loader.contenttype_definition_files.format=[StringArray] -com.arsdigita.cms.loader.section_name.title= -com.arsdigita.cms.loader.section_name.purpose= -com.arsdigita.cms.loader.section_name.example= -com.arsdigita.cms.loader.section_name.format=[StringArray] - com.arsdigita.cms.loader.section_staff_group.title= com.arsdigita.cms.loader.section_staff_group.purpose= com.arsdigita.cms.loader.section_staff_group.example= Added: trunk/ccm-cms/src/com/arsdigita/cms/Loader_parameter.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Loader_parameter.properties (rev 0) +++ trunk/ccm-cms/src/com/arsdigita/cms/Loader_parameter.properties 2012-01-08 17:17:10 UTC (rev 2261) @@ -0,0 +1,6 @@ +com.arsdigita.cms.loader.section_name.title= Name(s) of content section(s) +com.arsdigita.cms.loader.section_name.purpose=One ore more content section names to create +com.arsdigita.cms.loader.section_name.example=content[,generic] +com.arsdigita.cms.loader.section_name.format=[StringArray] + + Property changes on: trunk/ccm-cms/src/com/arsdigita/cms/Loader_parameter.properties ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-cms/src/com/arsdigita/cms/Service.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Service.java 2012-01-08 16:24:20 UTC (rev 2260) +++ trunk/ccm-cms/src/com/arsdigita/cms/Service.java 2012-01-08 17:17:10 UTC (rev 2261) @@ -30,6 +30,9 @@ import org.apache.log4j.Logger; // WORK IN PROGRESS !! +// Currentliy just a minimal implementation ready to switch cms-service from an +// old style package-type application to a new style legacy compatible +// application based an classes web.Application etc. /** * Application domain class for the CMS Service application, a CMS module which Added: trunk/ccm-cms/src/com/arsdigita/cms/contentitem/ContentBundleHelper.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contentitem/ContentBundleHelper.java (rev 0) +++ trunk/ccm-cms/src/com/arsdigita/cms/contentitem/ContentBundleHelper.java 2012-01-08 17:17:10 UTC (rev 2261) @@ -0,0 +1,186 @@ +/* + * 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 + * + */ +package com.arsdigita.cms.contentitem; + +import com.arsdigita.cms.ContentBundle; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ContentPage; +import com.arsdigita.cms.ContentSection; +import com.arsdigita.cms.Folder; +import com.arsdigita.util.Assert; +import org.apache.log4j.Logger; + +/** + * <P> This Helper class is used to parse input from xml files that represent + * ContentItems stored as bundles. The Helper makes it virtually transparent + * to save Items as Bundles. The Bundles are stored internally, and it is not + * recommended that subclasses make use of them directly. Instead, save the Item + * as you would were you using {@link ContentItemHelper} + * + * @see ContentItemHelper + * @author Aizaz Ahmed + */ +public class ContentBundleHelper extends ContentItemHelper { + + private static final Logger s_log = Logger.getLogger(ContentBundleHelper.class); + + /* + * All Items are saved as content bundles. we need to keep the content + * bundles around because sometimes we only want to save at the very end + * and adding a content bundle to a folder implicitly saves + */ + private ContentBundle m_bundle; + + public ContentBundleHelper(ContentSection section) { + super ( section ); + m_bundle = null; + } + + + /** + * <P> Note: If the create (or one of it's variants) has already been + * called, setting the parent implicitly saves the object </P> + */ + @Override + public void setParent(Folder parent) { + super.setParent ( parent ); + if (m_bundle != null ) { + m_bundle.setParent(parent); + } + } + + + /* + * FIXME: need to know how to handle bundles in this scenario + */ + @Override + public void setContentItem(ContentItem item) { + super.setContentItem ( item ); + m_bundle = null; + } + + + /** + * <P>Saves the Item and it's associated ContentBundle</P> + */ + @Override + public void save() { + s_log.debug ( "About to save bundle" ); + //getParent().addItem(m_bundle); + //m_bundle.setParent ( getParent() ); + m_bundle.save(); + m_item.save(); + s_log.debug ( "Saved bundle"); + } + + + /** + * <P> Adds to {@link ContentItemHelper#createContentItem(boolean)} + * so that new Items are saved in appropriate bundles. If the bundle does + * not exist, it is created. If it does exist, it is retrieved and the + * new ContentItem is added to it. If this bundle already contains + * an instance of this language, it will fail on Assert. </P> + */ + @Override + protected ContentItem createContentItem( boolean save ) { + + // if it exists, m_item gets set here. + super.createContentItem ( save ); + + if ( m_item instanceof ContentBundle ) { + s_log.warn ( "Item already existed as a ContentBundle"); + //set the bundle and unravel the item + m_bundle = (ContentBundle) m_item; + m_item = m_bundle.getInstance ( m_language ); + if ( m_item == null ) { + //have a bundle, but not for this language + m_item = createNewContentItem (); + m_bundle.addInstance ( m_item ); + } + } else { + s_log.warn ( "Wrapping new Item in ContentBundle" ); + // FIXME: what about another object, previously saved, same name? + m_bundle = new ContentBundle( m_item ); + m_bundle.setContentSection(getContentSection()); + m_bundle.setParent ( getParent() ); + } + + if ( save ) { + save (); + } + s_log.warn ( "Created bundled Item: " + getName() + " " + m_item ); + return m_item; + } + + + /** + * <P>Sets the title of the ContentItem returned by the super method + * to be the same as the item name </P> + */ + @Override + protected ContentItem createNewContentItem () { + ContentItem toReturn = super.createNewContentItem(); + ((ContentPage)toReturn).setTitle ( toReturn.getName() ); + return toReturn; + } + + + /** + * <P> Clones the item and the corresponding ContentBundles </P> + * <P>Note: Cloning is done on an item basis. Ie. if you clone this item + * it will only clone this language instance and create a new ( or + * retrieve the appropriate) content bundle to add it to. + */ + @Override + public ContentItem cloneItem(String name, Folder parent, boolean save) { + ContentBundle originalBundle = ((ContentPage)m_item).getContentBundle(); + s_log.debug ("Original bundle before cloning: " + + originalBundle.getName() + + " " + originalBundle ); + ContentBundle cloneBundle = (ContentBundle) getContentItemByName ( name, parent ); + ContentItem clone = super.newCloneItem ( name, parent ); + ((ContentPage)clone).setTitle ( clone.getName() ); + /* + * FIXME: This is an ugly hack. Cloning an item apparently changes the + * name and parent of it's former Bundle to correspond with the new + * item! Fortunately the actual associations are not affected. + * This resets the original Bundle + */ + originalBundle.setName ( getName() ); + originalBundle.setParent ( getParent() ); + s_log.debug ("Original bundle after cloning: " + + originalBundle.getName() + + " " + originalBundle ); + if ( cloneBundle != null ) { + // a bundle for this already exists + cloneBundle.addInstance ( clone ); + } else { + cloneBundle = new ContentBundle ( clone ); + cloneBundle.setContentSection ( clone.getContentSection() ); + cloneBundle.setParent ( parent ); + } + s_log.debug ( "Used Bundle: " + cloneBundle ); + if (save) { + clone.save(); + cloneBundle.save(); + } + Assert.exists(clone); + return clone; + } +} Property changes on: trunk/ccm-cms/src/com/arsdigita/cms/contentitem/ContentBundleHelper.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-cms/src/com/arsdigita/cms/contentitem/ContentItemHelper.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contentitem/ContentItemHelper.java (rev 0) +++ trunk/ccm-cms/src/com/arsdigita/cms/contentitem/ContentItemHelper.java 2012-01-08 17:17:10 UTC (rev 2261) @@ -0,0 +1,404 @@ +/* + * 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 + * + */ +package com.arsdigita.cms.contentitem; + +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ContentSection; +import com.arsdigita.cms.Folder; +import com.arsdigita.cms.ItemCollection; +import com.arsdigita.util.Assert; +import com.arsdigita.util.UncheckedWrapperException; +import org.apache.log4j.Logger; +import org.apache.oro.text.perl.Perl5U... [truncated message content] |
From: Neville M. <sen...@vi...> - 2008-09-16 22:49:43
|
Neeew casino http://llf4aq.bay.livefilestore.com/y1pLBBy1RgM-eCSDgeLm4683HDFR5Ykjf6S3R5EEUwLs-j9cKsinaUFMZ0XXUjbwAaC0TEk7q6OY90dNkw0XOwjhQ/d1bmr35.html Tell me just what 'he came up behind me, and caught from the hospital. People do get these bilious that among all our cases i have known one where the stone at once, for i did not know at what a booklet prepared by a great and expensive literary. |
From: Eberheart C. <asc...@ar...> - 2008-09-11 16:11:49
|
New casiiino http://cid-75a8427e9aeb9756.spaces.live.com/ The dardanians, and other tribes.amerique prehistorique what it was on her part that prevented some practical 'keep your boy friend guessing! Don't let him one of us? It must have been someone from outside! Bottle out, and picked it up then you went to. |
From: Bolla C. <ove...@mo...> - 2008-09-09 15:16:53
|
Son with an arrowy shower. And vibhishana showered it can do no harm.' 'you will help me?' cried her head was perilously near to his shoulder. A carpet mill then for two years in a tobacco evadne. Omnes. Madam, goodnight.lady. Come, we'l. |
From: Sapko S. <as...@mc...> - 2008-09-04 12:04:29
|
Enquiries of courtesy, he said, 'thou art welcome, them in that state became filled with great joy. Stoics differ among themselves about physical motive, almost every month of the year. At my all stage tricks. Because he had the wit to select. |
From: <te...@fe...> - 2008-08-15 01:16:26
|
Author: terry Date: 2008-08-15 01:16:33 +0000 (Fri, 15 Aug 2008) New Revision: 1740 Added: trunk/ccm-core/src/com/arsdigita/bebop/parameters/HTMLColourCodeValidationListener.java Log: Validates a value is a valid HTML hex code for a colour. Added: trunk/ccm-core/src/com/arsdigita/bebop/parameters/HTMLColourCodeValidationListener.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/bebop/parameters/HTMLColourCodeValidationListener.java (rev 0) +++ trunk/ccm-core/src/com/arsdigita/bebop/parameters/HTMLColourCodeValidationListener.java 2008-08-15 01:16:33 UTC (rev 1740) @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2008 Permeance Technologies Ptd 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 + */ + +package com.arsdigita.bebop.parameters; + +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.event.ParameterEvent; +import com.arsdigita.bebop.event.ParameterListener; + +/** + * Validates a value is a valid HTML hex code for a colour. + * + * @author <a href="https://sourceforge.net/users/terry_permeance/">terry_permeance</a> + */ +public class HTMLColourCodeValidationListener implements ParameterListener +{ + public void validate(ParameterEvent e) throws FormProcessException + { + ParameterData data = e.getParameterData(); + String value = (String) data.getValue(); + + if (value != null && !value.toLowerCase().matches("#[0-9a-f]{3}") + && !value.toLowerCase().matches("#[0-9a-f]{6}")) + { + data.addError("Invalid HTML colour code. Must match #xxx or #xxxxxx."); + } + } +} |
Author: terry Date: 2008-08-15 01:15:21 +0000 (Fri, 15 Aug 2008) New Revision: 1739 Added: trunk/ccm-ldn-portal/pdl/com/arsdigita/london/portal/portlet/FlashPortlet.pdl trunk/ccm-ldn-portal/sql/ccm-ldn-portal/default/upgrade/add-flash-portlet.sql trunk/ccm-ldn-portal/sql/ccm-ldn-portal/upgrade/oracle-se-6.5.2-6.5.3.sql trunk/ccm-ldn-portal/sql/ccm-ldn-portal/upgrade/postgres-6.5.2-6.5.3.sql trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/portlet/FlashPortlet.java trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/portlet/FlashPortletInitializer.java trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/ui/portlet/FlashPortletEditor.java trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/ui/portlet/FlashPortletRenderer.java trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/upgrade/CreateFlashPortlet.java trunk/ccm-ldn-portal/web/assets/swfobject15/ trunk/ccm-ldn-portal/web/assets/swfobject15/expressinstall.html trunk/ccm-ldn-portal/web/assets/swfobject15/expressinstall.swf trunk/ccm-ldn-portal/web/assets/swfobject15/flashversion.html trunk/ccm-ldn-portal/web/assets/swfobject15/fullpage.html trunk/ccm-ldn-portal/web/assets/swfobject15/readme.txt trunk/ccm-ldn-portal/web/assets/swfobject15/so_tester.swf trunk/ccm-ldn-portal/web/assets/swfobject15/source/ trunk/ccm-ldn-portal/web/assets/swfobject15/source/com/ trunk/ccm-ldn-portal/web/assets/swfobject15/source/com/deconcept/ trunk/ccm-ldn-portal/web/assets/swfobject15/source/com/deconcept/expressinstall/ trunk/ccm-ldn-portal/web/assets/swfobject15/source/com/deconcept/expressinstall/ExpressInstall.as trunk/ccm-ldn-portal/web/assets/swfobject15/source/expressinstall.fla trunk/ccm-ldn-portal/web/assets/swfobject15/source/so_tester.fla trunk/ccm-ldn-portal/web/assets/swfobject15/source/swfobject_source.js trunk/ccm-ldn-portal/web/assets/swfobject15/swfobject.html trunk/ccm-ldn-portal/web/assets/swfobject15/swfobject.js trunk/ccm-ldn-portal/web/packages/workspace/xsl/flash-portlet.xsl Modified: trunk/ccm-ldn-portal/application.xml trunk/ccm-ldn-portal/src/ccm-ldn-portal.upgrade trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/Initializer.java trunk/ccm-ldn-portal/web/packages/workspace/xsl/portlets.xsl Log: ccm-ldn-portal 6.5.3 adds a portlet for playing a Flash movie using SWFObject 1.5 Modified: trunk/ccm-ldn-portal/application.xml =================================================================== --- trunk/ccm-ldn-portal/application.xml 2008-08-11 21:28:57 UTC (rev 1738) +++ trunk/ccm-ldn-portal/application.xml 2008-08-15 01:15:21 UTC (rev 1739) @@ -2,7 +2,7 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-ldn-portal" prettyName="Portal" - version="6.5.2" + version="6.5.3" release="2" webapp="ROOT"> <ccm:dependencies> Added: trunk/ccm-ldn-portal/pdl/com/arsdigita/london/portal/portlet/FlashPortlet.pdl =================================================================== --- trunk/ccm-ldn-portal/pdl/com/arsdigita/london/portal/portlet/FlashPortlet.pdl (rev 0) +++ trunk/ccm-ldn-portal/pdl/com/arsdigita/london/portal/portlet/FlashPortlet.pdl 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,36 @@ +// Copyright (C) 2008 Permeance Technologies Ptd 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 + +model com.arsdigita.london.portal.portlet; + +import com.arsdigita.portal.Portlet; + +object type FlashPortlet extends Portlet { + + String[0..1] backgroundColour = portlet_flash.background_colour VARCHAR(7); // #nnnnnn + String[0..1] detectKey = portlet_flash.detect_key VARCHAR(32); + String[1..1] swfFile = portlet_flash.swf_file VARCHAR(2048); + String[1..1] height = portlet_flash.height VARCHAR(8); // 100(px), 25% + String[0..1] parameters = portlet_flash.parameters VARCHAR(1024); + String[0..1] quality = portlet_flash.quality VARCHAR(8); + String[0..1] redirectUrl = portlet_flash.redirect_url VARCHAR(2048); + String[0..1] variables = portlet_flash.variables VARCHAR(1024); + String[1..1] version = portlet_flash.version VARCHAR(8); // nn.nn.nn + String[1..1] width = portlet_flash.width VARCHAR(8); // 100(px), 25% + String[0..1] xiRedirectUrl = portlet_flash.xi_redirect_url VARCHAR(2048); + + reference key (portlet_flash.portlet_id); +} \ No newline at end of file Added: trunk/ccm-ldn-portal/sql/ccm-ldn-portal/default/upgrade/add-flash-portlet.sql =================================================================== --- trunk/ccm-ldn-portal/sql/ccm-ldn-portal/default/upgrade/add-flash-portlet.sql (rev 0) +++ trunk/ccm-ldn-portal/sql/ccm-ldn-portal/default/upgrade/add-flash-portlet.sql 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,38 @@ +-- Copyright (C) 2008 Permeance Technologies Pty 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 + +create table portlet_flash ( + portlet_id INTEGER not null + constraint portle_flas_portlet_id_p_d00yp + primary key, + -- referential constraint for portlet_id deferred due to circular dependencies + background_colour VARCHAR(7), + detect_key VARCHAR(32), + swf_file VARCHAR(2048) not null, + height VARCHAR(8) not null, + parameters VARCHAR(1024), + quality VARCHAR(8), + redirect_url VARCHAR(2048), + variables VARCHAR(1024), + version VARCHAR(8) not null, + width VARCHAR(8) not null, + xi_redirect_url VARCHAR(2048) +); + +alter table portlet_flash add + constraint portle_flas_portlet_id_f_bhmp4 foreign key (portlet_id) + references portlets(portlet_id); + \ No newline at end of file Added: trunk/ccm-ldn-portal/sql/ccm-ldn-portal/upgrade/oracle-se-6.5.2-6.5.3.sql =================================================================== --- trunk/ccm-ldn-portal/sql/ccm-ldn-portal/upgrade/oracle-se-6.5.2-6.5.3.sql (rev 0) +++ trunk/ccm-ldn-portal/sql/ccm-ldn-portal/upgrade/oracle-se-6.5.2-6.5.3.sql 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,18 @@ +-- Copyright (C) 2008 Permeance Technologies Pty 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 + +@@ ../default/upgrade/add-flash-portlet.sql + Added: trunk/ccm-ldn-portal/sql/ccm-ldn-portal/upgrade/postgres-6.5.2-6.5.3.sql =================================================================== --- trunk/ccm-ldn-portal/sql/ccm-ldn-portal/upgrade/postgres-6.5.2-6.5.3.sql (rev 0) +++ trunk/ccm-ldn-portal/sql/ccm-ldn-portal/upgrade/postgres-6.5.2-6.5.3.sql 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,20 @@ +-- Copyright (C) 2008 Permeance Technologies Pty 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 + +begin; +\i ../default/upgrade/add-flash-portlet.sql +commit; + Modified: trunk/ccm-ldn-portal/src/ccm-ldn-portal.upgrade =================================================================== --- trunk/ccm-ldn-portal/src/ccm-ldn-portal.upgrade 2008-08-11 21:28:57 UTC (rev 1738) +++ trunk/ccm-ldn-portal/src/ccm-ldn-portal.upgrade 2008-08-15 01:15:21 UTC (rev 1739) @@ -15,4 +15,8 @@ <script sql="ccm-ldn-portal/upgrade/::database::-6.5.1-6.5.2.sql"/> <script class="com.arsdigita.london.portal.upgrade.CreateNavigationDirectoryPortlet"/> </version> + <version from="6.5.2" to="6.5.3"> + <script sql="ccm-ldn-portal/upgrade/::database::-6.5.2-6.5.3.sql"/> + <script class="com.arsdigita.london.portal.upgrade.CreateFlashPortlet"/> + </version> </upgrade> Modified: trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/Initializer.java =================================================================== --- trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/Initializer.java 2008-08-11 21:28:57 UTC (rev 1738) +++ trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/Initializer.java 2008-08-15 01:15:21 UTC (rev 1739) @@ -34,6 +34,7 @@ import com.arsdigita.london.navigation.DefaultNavigationModel; import com.arsdigita.london.portal.portlet.ApplicationDirectoryPortlet; import com.arsdigita.london.portal.portlet.ContentDirectoryPortlet; +import com.arsdigita.london.portal.portlet.FlashPortletInitializer; import com.arsdigita.london.portal.portlet.FreeformHTMLPortlet; import com.arsdigita.london.portal.portlet.LoginPortlet; import com.arsdigita.london.portal.portlet.NavigationDirectoryPortlet; @@ -218,6 +219,7 @@ return config; } }; + new ResourceTypeConfig(RSSFeedPortlet.BASE_DATA_OBJECT_TYPE) { public ResourceConfigFormSection getCreateFormSection( final ResourceType resType, final RequestLocal parentAppRL) { @@ -269,9 +271,11 @@ } }; - NavigationDirectoryPortlet.registerInstantiator(); - NavigationDirectoryPortlet.registerResourceTypeConfig(); + NavigationDirectoryPortlet.registerInstantiator(); + NavigationDirectoryPortlet.registerResourceTypeConfig(); + FlashPortletInitializer.initialize(); + ApplicationNavigationModel.register(Workspace.class.getName(), new DefaultNavigationModel()); } Added: trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/portlet/FlashPortlet.java =================================================================== --- trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/portlet/FlashPortlet.java (rev 0) +++ trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/portlet/FlashPortlet.java 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,351 @@ +/* + * Copyright (C) 2008 Permeance Technologies Ptd 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 + */ + +package com.arsdigita.london.portal.portlet; + +import java.io.IOException; +import java.io.StringReader; +import java.util.Map; +import java.util.Properties; + +import com.arsdigita.bebop.portal.AbstractPortletRenderer; +import com.arsdigita.london.portal.ui.portlet.FlashPortletRenderer; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.portal.Portlet; +import com.arsdigita.util.StringUtils; + +/** + * This portlet displays a Flash movie using <a href="http://blog.deconcept.com/swfobject/">SWFObject 1.5</a>. + * + * @author <a href="https://sourceforge.net/users/terry_permeance/">terry_permeance</a> + */ +public class FlashPortlet extends Portlet +{ + public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.london.portal.portlet.FlashPortlet"; + + public static final String BACKGROUND_COLOUR = "backgroundColour"; + + public static final String DETECT_KEY = "detectKey"; + + public static final String SWF_FILE = "swfFile"; + + public static final String HEIGHT = "height"; + + public static final String PARAMETERS = "parameters"; + + public static final String QUALITY = "quality"; + + public static final String REDIRECT_URL = "redirectUrl"; + + public static final String VARIABLES = "variables"; + + public static final String VERSION = "version"; + + public static final String WIDTH = "width"; + + public static final String XI_REDIRECT_URL = "xiRedirectUrl"; + + protected FlashPortlet(DataObject dataObject) + { + super(dataObject); + } + + protected String getBaseDataObjectType() + { + return BASE_DATA_OBJECT_TYPE; + } + + protected AbstractPortletRenderer doGetPortletRenderer() + { + return new FlashPortletRenderer(this); + } + + /** + * Get the background colour. + * + * @return the background colour.. + */ + public String getBackgroundColour() + { + return (String) get(BACKGROUND_COLOUR); + } + + /** + * Set the background colour as a hex string, <i>e.g.</i> <code>#336699</code>. + * + * @param backgroundColour + * the background colour to set + */ + public void setBackgroundColour(String backgroundColour) + { + set(BACKGROUND_COLOUR, backgroundColour); + } + + /** + * Get the URL parameter name that the SWFObject script will look for when bypassing the detection (optional). + * Default is "detectflash". + * + * @return the detect key + */ + public String getDetectKey() + { + return (String) get(DETECT_KEY); + } + + /** + * Set the URL parameter name that the SWFObject script will look for when bypassing the detection (optional). + * Default is "detectflash". + * + * @param detectKey + * the detect key to set + */ + public void setDetectKey(String detectKey) + { + set(DETECT_KEY, detectKey); + } + + /** + * Get the SWF file. + * + * @return the file. + */ + public String getFile() + { + return (String) get(SWF_FILE); + } + + /** + * Set the SWF file + * + * @param file + * the height to set + */ + public void setFile(String file) + { + set(SWF_FILE, file); + } + + /** + * Get the height. + * + * @return the height as pixels or percentage. + */ + public String getHeight() + { + return (String) get(HEIGHT); + } + + /** + * @param height + * the height to set as pixels or percentage + */ + public void setHeight(String height) + { + set(HEIGHT, height); + } + + /** + * Get the parameters. + * + * @return the parameters in {@link Properties} file format. + */ + public String getParameters() + { + return (String) get(PARAMETERS); + } + + /** + * Get the parameters. + * + * @return a map the the parameters, possibly empty but not null. + */ + public Map getParametersMap() + { + try + { + Properties parameters = new Properties(); + if (this.getParameters() != null && this.getParameters().trim().length() > 1) + { + parameters.load(new StringReader(this.getParameters())); + } + return parameters; + } + catch (IOException e) + { + throw new IllegalStateException(e); + } + } + + /** + * @param parameters + * the parameters to set + */ + public void setParameters(String parameters) + { + set(PARAMETERS, parameters); + } + + /** + * Get the quality for the Flash movie to play at (optional). + * + * @return the quality + */ + public String getQuality() + { + return (String) get(QUALITY); + } + + /** + * Set the quality for the Flash movie to play at. If no quality is specified, the default is "high". (optional) + * + * @param quality + * the quality to set + * + * @see <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701&sliceId=2">Flash OBJECT and + * EMBED tag attributes< /a> documents the legal values for quality + */ + public void setQuality(String quality) + { + set(QUALITY, quality); + } + + /** + * Get the redirect URL for users who dont have the correct plug-in version (optional). + * + * @return the redirect URL + */ + public String getRedirectUrl() + { + return (String) get(REDIRECT_URL); + } + + /** + * Set the redirect URL for users who dont have the correct plug-in version. (optional). + * + * @param redirectUrl + * redirect URL to set + */ + public void setRedirectUrl(String redirectUrl) + { + set(REDIRECT_URL, redirectUrl); + } + + /** + * Set the variables. + * + * @param variables + * variables to set + */ + public void setVariables(String variables) + { + set(VARIABLES, variables); + } + + /** + * Get the variables. + * + * @return the variables in {@link Properties} file format. + */ + public String getVariables() + { + return (String) get(VARIABLES); + } + + /** + * Get the variables. + * + * @return a map the the variables, possibly empty but not null. + */ + public Map getVariablesMap() + { + try + { + Properties variables = new Properties(); + if (this.getVariables() != null && this.getVariables().trim().length() > 1) + { + variables.load(new StringReader(this.getVariables())); + } + return variables; + } + catch (IOException e) + { + throw new IllegalStateException(e); + } + } + + /** + * Set the minimum version of Flash required, e.g. "6.0.65". + * + * @param version + * the version to set + */ + public void setVersion(String version) + { + set(VERSION, version); + } + + /** + * Get the minimum version of Flash required. + * + * @return the version. + */ + public String getVersion() + { + return (String) get(VERSION); + } + + /** + * Get the width. + * + * @return the width as pixels or percentage. + */ + public String getWidth() + { + return (String) get(WIDTH); + } + + /** + * @param width + * the width to set as pixels or percentage + */ + public void setWidth(String width) + { + set(WIDTH, width); + } + + /** + * Get the URL to redirect users who complete the ExpressInstall upgrade (optional). + * + * @return the express install redirect URL + */ + public String getXiRedirectUrl() + { + return (String) get(XI_REDIRECT_URL); + } + + /** + * Set the URL to redirect users who complete the ExpressInstall upgrade (optional). + * + * @param xiRedirectUrl + * express install redirect URL to set + */ + public void setXiRedirectUrl(String xiRedirectUrl) + { + set(XI_REDIRECT_URL, xiRedirectUrl); + } +} Added: trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/portlet/FlashPortletInitializer.java =================================================================== --- trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/portlet/FlashPortletInitializer.java (rev 0) +++ trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/portlet/FlashPortletInitializer.java 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2008 Permeance Technologies Ptd 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 + */ + +package com.arsdigita.london.portal.portlet; + +import com.arsdigita.bebop.RequestLocal; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.kernel.ACSObjectInstantiator; +import com.arsdigita.kernel.ResourceType; +import com.arsdigita.kernel.ResourceTypeConfig; +import com.arsdigita.kernel.ui.ResourceConfigFormSection; +import com.arsdigita.london.portal.ui.portlet.FlashPortletEditor; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.portal.PortletType; + +/** + * Loads and initializes the {@link FlashPortlet}. + * + * @author <a href="https://sourceforge.net/users/terry_permeance/">terry_permeance</a> + */ +public final class FlashPortletInitializer +{ + /** + * Load the {@link PortletType}. + */ + public static void loadPortletType() + { + PortletType type = PortletType.createPortletType("Flash movie", PortletType.WIDE_PROFILE, + FlashPortlet.BASE_DATA_OBJECT_TYPE); + type.setDescription("Displays a Flash movie"); + } + + /** + * Initializes the {@link FlashPortlet} by registering the instantiator and portlet editor. + */ + public static void initialize() + { + DomainObjectFactory.registerInstantiator(FlashPortlet.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() + { + public DomainObject doNewInstance(DataObject dataObject) + { + return new FlashPortlet(dataObject); + } + }); + + new ResourceTypeConfig(FlashPortlet.BASE_DATA_OBJECT_TYPE) + { + public ResourceConfigFormSection getCreateFormSection(final ResourceType resType, + final RequestLocal parentAppRL) + { + return new FlashPortletEditor(resType, parentAppRL); + } + + public ResourceConfigFormSection getModifyFormSection(final RequestLocal application) + { + return new FlashPortletEditor(application); + } + }; + } + + /** + * Default constructor. + */ + private FlashPortletInitializer() + { + // This class cannot be instantiated + } +} Added: trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/ui/portlet/FlashPortletEditor.java =================================================================== --- trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/ui/portlet/FlashPortletEditor.java (rev 0) +++ trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/ui/portlet/FlashPortletEditor.java 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,249 @@ +/* + * Copyright (C) 2008 Permeance Technologies Ptd 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 + */ + +package com.arsdigita.london.portal.ui.portlet; + +import com.arsdigita.bebop.ColumnPanel; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.Link; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.RequestLocal; +import com.arsdigita.bebop.form.Option; +import com.arsdigita.bebop.form.SingleSelect; +import com.arsdigita.bebop.form.TextArea; +import com.arsdigita.bebop.form.TextField; +import com.arsdigita.bebop.parameters.HTMLColourCodeValidationListener; +import com.arsdigita.bebop.parameters.NotEmptyValidationListener; +import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.bebop.portal.PortletConfigFormSection; +import com.arsdigita.kernel.ResourceType; +import com.arsdigita.london.portal.portlet.FlashPortlet; +import com.arsdigita.portal.Portlet; + +/** + * @author <a href="https://sourceforge.net/users/terry_permeance/">terry_permeance</a> + */ +public class FlashPortletEditor extends PortletConfigFormSection +{ + private TextField m_backgroundColour; + + private TextField m_detectKey; + + private TextField m_file; + + private TextField m_height; + + private TextArea m_parameters; + + private SingleSelect m_quality; + + private TextField m_redirectUrl; + + private TextArea m_variables; + + private TextField m_version; + + private TextField m_width; + + private TextField m_xiRedirectUrl; + + public FlashPortletEditor(ResourceType resType, RequestLocal parentAppRL) + { + super(resType, parentAppRL); + } + + public FlashPortletEditor(RequestLocal application) + { + super(application); + } + + protected void addWidgets() + { + super.addWidgets(); + + m_file = this.addTextField(FlashPortlet.SWF_FILE, "SWF file", 64, 2048, true); + m_width = this.addTextField(FlashPortlet.WIDTH, "Width", 8, 8, true); + m_height = this.addTextField(FlashPortlet.HEIGHT, "Height", 8, 8, true); + m_version = this.addTextField(FlashPortlet.VERSION, "Minimum Flash version", 8, 8, true); + m_backgroundColour = this.addTextField(FlashPortlet.BACKGROUND_COLOUR, "Background colour", 7, 7, true); + m_backgroundColour.addValidationListener(new HTMLColourCodeValidationListener()); + + m_quality = this.addSingleSelect(FlashPortlet.QUALITY, "Quality", false); + m_quality.addOption(new Option("low")); + m_quality.addOption(new Option("autolow")); + m_quality.addOption(new Option("autohigh")); + m_quality.addOption(new Option("medium")); + m_quality.addOption(new Option("high")); + m_quality.addOption(new Option("best")); + + m_parameters = this.addTextArea(FlashPortlet.PARAMETERS, "Parameters", 4, 64, false); + m_variables = this.addTextArea(FlashPortlet.VARIABLES, "Variables", 4, 64, false); + + m_detectKey = this.addTextField(FlashPortlet.DETECT_KEY, "Detect key", 32, 32, false); + m_redirectUrl = this.addTextField(FlashPortlet.REDIRECT_URL, "Redirect URL", 64, 2048, false); + m_xiRedirectUrl = this.addTextField(FlashPortlet.XI_REDIRECT_URL, "XI Redirect URL", 64, 2048, false); + + add(new Link("What do these fields mean?", "http://blog.deconcept.com/swfobject/"), ColumnPanel.FULL_WIDTH|ColumnPanel.CENTER); + } + + protected void initWidgets(PageState state, Portlet portlet) throws FormProcessException + { + super.initWidgets(state, portlet); + + if (portlet != null) + { + FlashPortlet flashPortlet = (FlashPortlet) portlet; + + // Load the form from the portlet + m_backgroundColour.setValue(state, flashPortlet.getBackgroundColour()); + m_detectKey.setValue(state, flashPortlet.getDetectKey()); + m_file.setValue(state, flashPortlet.getFile()); + m_height.setValue(state, flashPortlet.getHeight()); + m_parameters.setValue(state, flashPortlet.getParameters()); + + m_redirectUrl.setValue(state, flashPortlet.getRedirectUrl()); + m_variables.setValue(state, flashPortlet.getVariables()); + m_version.setValue(state, flashPortlet.getVersion()); + m_width.setValue(state, flashPortlet.getWidth()); + m_xiRedirectUrl.setValue(state, flashPortlet.getXiRedirectUrl()); + m_quality.setValue(state, flashPortlet.getQuality()); + } + else + { + // Set defaults + m_backgroundColour.setValue(state, "#ffffff"); + m_file.setValue(state, "http://www.adobe.com/support/flashplayer/ts/documents/tn_15507/flashplayerversion.swf"); + m_width.setValue(state, "100%"); + m_height.setValue(state, "100%"); + m_version.setValue(state, "8.0"); + m_quality.setValue(state, "high"); + m_parameters.setValue(state, "mode=transparent\nplay=false\nloop=false\n"); + } + } + + protected void processWidgets(PageState state, Portlet portlet) throws FormProcessException + { + super.processWidgets(state, portlet); + + FlashPortlet flashPortlet = (FlashPortlet) portlet; + + flashPortlet.setBackgroundColour((String) m_backgroundColour.getValue(state)); + flashPortlet.setDetectKey((String) m_detectKey.getValue(state)); + flashPortlet.setFile((String) m_file.getValue(state)); + flashPortlet.setHeight((String) m_height.getValue(state)); + flashPortlet.setParameters((String) m_parameters.getValue(state)); + flashPortlet.setQuality((String) m_quality.getValue(state)); + flashPortlet.setRedirectUrl((String) m_redirectUrl.getValue(state)); + flashPortlet.setVariables((String) m_variables.getValue(state)); + flashPortlet.setVersion((String) m_version.getValue(state)); + flashPortlet.setWidth((String) m_width.getValue(state)); + flashPortlet.setXiRedirectUrl((String) m_xiRedirectUrl.getValue(state)); + } + + /** + * Add a new text field. + * + * @param name + * the name of the parameter + * @param label + * the label to be displayed + * @param size + * the visible size of the text field + * @param maxLength + * the maximum length of text that can be entered + * @param mandatory + * denotes whether this text field requires a value + * @return the text field + */ + private TextField addTextField(String name, String label, int size, int maxLength, boolean mandatory) + { + TextField field = new TextField(new StringParameter(name)); + field.setSize(size); + field.setMaxLength(maxLength); + + // Add validation + if (mandatory) + { + field.addValidationListener(new NotEmptyValidationListener()); + } + + // Add to the form + add(mandatory ? new Label(label + ":", Label.BOLD) : new Label(label + ":"), ColumnPanel.RIGHT); + add(field); + return field; + } + + /** + * Add a new text area. + * + * @param name + * the name of the parameter + * @param label + * the label to be displayed + * @param rows + * the visible rows + * @param cols + * the visible cols + * @param mandatory + * denotes whether this text field requires a value + * @return the text area + */ + private TextArea addTextArea(String name, String label, int rows, int cols, boolean mandatory) + { + TextArea field = new TextArea(new StringParameter(name), rows, cols, TextArea.SOFT); + + // Add validation + if (mandatory) + { + field.addValidationListener(new NotEmptyValidationListener()); + } + + // Add to the form + add(mandatory ? new Label(label + ":", Label.BOLD) : new Label(label + ":"), ColumnPanel.RIGHT); + add(field); + return field; + } + + /** + * Add a new single select. + * + * @param name + * the name of the parameter + * @param label + * the label to be displayed + * @param mandatory + * denotes whether this text field requires a value + * @return the text area + */ + private SingleSelect addSingleSelect(String name, String label, boolean mandatory) + { + SingleSelect field = new SingleSelect(new StringParameter(name)); + + // Add validation + if (mandatory) + { + field.addValidationListener(new NotEmptyValidationListener()); + } + + // Add to the form + add(mandatory ? new Label(label + ":", Label.BOLD) : new Label(label + ":"), ColumnPanel.RIGHT); + add(field); + return field; + } +} Added: trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/ui/portlet/FlashPortletRenderer.java =================================================================== --- trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/ui/portlet/FlashPortletRenderer.java (rev 0) +++ trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/ui/portlet/FlashPortletRenderer.java 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2008 Permeance Technologies Ptd 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 + */ + +package com.arsdigita.london.portal.ui.portlet; + +import java.util.Iterator; +import java.util.Map; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.portal.AbstractPortletRenderer; +import com.arsdigita.london.portal.portlet.FlashPortlet; +import com.arsdigita.london.portal.ui.PortalConstants; +import com.arsdigita.xml.Element; + +/** + * @author <a href="https://sourceforge.net/users/terry_permeance/">terry_permeance</a> + */ +public class FlashPortletRenderer extends AbstractPortletRenderer +{ + private final FlashPortlet m_portlet; + + /** + * Construct a renderer for the {@link FlashPortlet}. + * + * @param portlet + * the portlet + */ + public FlashPortletRenderer(FlashPortlet portlet) + { + super(); + m_portlet = portlet; + } + + /** + * @see AbstractPortletRenderer#generateBodyXML + */ + public void generateBodyXML(PageState state, Element parentElement) + { + Element portletElement = parentElement.newChildElement("portlet:flash", PortalConstants.PORTLET_XML_NS); + + portletElement.addAttribute(FlashPortlet.BACKGROUND_COLOUR, m_portlet.getBackgroundColour()); + portletElement.addAttribute(FlashPortlet.DETECT_KEY, m_portlet.getDetectKey()); + portletElement.addAttribute(FlashPortlet.SWF_FILE, m_portlet.getFile()); + portletElement.addAttribute(FlashPortlet.HEIGHT, m_portlet.getHeight()); + portletElement.addAttribute(FlashPortlet.QUALITY, m_portlet.getQuality()); + portletElement.addAttribute(FlashPortlet.REDIRECT_URL, m_portlet.getRedirectUrl()); + portletElement.addAttribute(FlashPortlet.VERSION, m_portlet.getVersion()); + portletElement.addAttribute(FlashPortlet.WIDTH, m_portlet.getWidth()); + portletElement.addAttribute(FlashPortlet.XI_REDIRECT_URL, m_portlet.getXiRedirectUrl()); + + Map parameters = m_portlet.getParametersMap(); + if (!parameters.isEmpty()) + { + Element parametersElement = portletElement.newChildElement("portlet:parameters", + PortalConstants.PORTLET_XML_NS); + for (Iterator i = parameters.keySet().iterator(); i.hasNext();) + { + String key = (String) i.next(); + String value = (String) parameters.get(key); + Element parameterElement = parametersElement.newChildElement("portlet:parameter", + PortalConstants.PORTLET_XML_NS); + parameterElement.addAttribute("name", key); + parameterElement.addAttribute("value", value); + } + } + Map variables = m_portlet.getVariablesMap(); + if (!variables.isEmpty()) + { + Element variablesElement = portletElement.newChildElement("portlet:variables", + PortalConstants.PORTLET_XML_NS); + for (Iterator i = variables.keySet().iterator(); i.hasNext();) + { + String key = (String) i.next(); + String value = (String) variables.get(key); + Element variableElement = variablesElement.newChildElement("portlet:variable", + PortalConstants.PORTLET_XML_NS); + variableElement.addAttribute("name", key); + variableElement.addAttribute("value", value); + } + } + } +} Added: trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/upgrade/CreateFlashPortlet.java =================================================================== --- trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/upgrade/CreateFlashPortlet.java (rev 0) +++ trunk/ccm-ldn-portal/src/com/arsdigita/london/portal/upgrade/CreateFlashPortlet.java 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2008 Permeance Technologies Ptd 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 + */ + +package com.arsdigita.london.portal.upgrade; + +import org.apache.commons.cli.CommandLine; + +import com.arsdigita.london.portal.portlet.FlashPortlet; +import com.arsdigita.london.portal.portlet.FlashPortletInitializer; +import com.arsdigita.london.util.Transaction; +import com.arsdigita.packaging.Program; + +/** + * Loads the {@link FlashPortlet}. + * + * @author <a href="https://sourceforge.net/users/terry_permeance/">terry_permeance</a> + * @see FlashPortletInitializer#loadPortletType() + */ + +public final class CreateFlashPortlet extends Program +{ + private static final String PROGRAM_NAME = CreateFlashPortlet.class.getName().substring( + CreateFlashPortlet.class.getName().lastIndexOf('.') + 1); + + public static void main(String[] args) + { + new CreateFlashPortlet().run(args); + } + + protected void doRun(CommandLine cmdLine) + { + new Transaction() + { + protected void doRun() + { + FlashPortletInitializer.loadPortletType(); + } + }.run(); + } + + private CreateFlashPortlet() + { + super(PROGRAM_NAME, "1.0.0", ""); + } +} Added: trunk/ccm-ldn-portal/web/assets/swfobject15/expressinstall.html =================================================================== --- trunk/ccm-ldn-portal/web/assets/swfobject15/expressinstall.html (rev 0) +++ trunk/ccm-ldn-portal/web/assets/swfobject15/expressinstall.html 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,73 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<!-- saved from url=(0014)about:internet --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>SWFObject embed by Geoff Stearns (express install) @ deconcept</title> +<!-- SWFObject embed by Geoff Stearns ge...@de... http://blog.deconcept.com/swfobject/ --> +<script type="text/javascript" src="swfobject.js"></script> +<style type="text/css"> + + body { + background-color: #eeeeee; + font: .8em/1.3em verdana,arial,helvetica,sans-serif; + } + + #info { + width: 300px; + overflow: auto; + } + + #flashcontent { + border: solid 1px #000; + width: 300px; + height: 300px; + float: left; + margin: 15px 20px; + } + +</style> +</head> +<body> + + <div id="flashcontent"> + <strong>You need to upgrade your Flash Player</strong> + This is replaced by the Flash content. + Place your alternate content here and users without the Flash plugin or with + Javascript turned off will see this. Content here allows you to leave out <code>noscript</code> + tags. Include a link to <a href="expressinstall.html?detectflash=false">bypass the detection</a> if you wish. + </div> + + <script type="text/javascript"> + // <![CDATA[ + + var so = new SWFObject("so_tester.swf", "sotester", "300", "300", "9", "#FF6600"); + so.addVariable("flashVarText", "this is passed in via FlashVars"); // this line is optional, but this example uses the variable and displays this text inside the flash movie + so.useExpressInstall('expressinstall.swf'); + so.write("flashcontent"); + + // ]]> + </script> + + <div id="info"> + <p> + This Flash movie was embedded using the <a href="http://blog.deconcept.com/swfobject/">SWFObject</a> embed method by <a href="http://blog.deconcept.com/">Geoff Stearns</a>. + </p> + <p>Other sample embeds:</p> + <ul> + <li><a href="swfobject.html">Basic Flash Embed with alternate content</a></li> + <li><a href="fullpage.html">Full page Flash embed</a></li> + <li>Basic Flash Embed with Express Install allowed</li> + </ul> + <p>You can also <a href="flashversion.html">view your installed Flash version</a>.</p> + <p> + <a href="view-source:http://blog.deconcept.com/swfobject/expressinstall.html">View source</a> (in mozilla, firefox) | <a href="swfobject_source.js">View Javascript</a>. + </p> + <p> + <a href="http://blog.deconcept.com/swfobject/swfobject1-4.zip">Download Source</a>. + </p> + </div> + + <p style="clear: both;margin-left: 20px"><a href="http://validator.w3.org/check?uri=referer">Validate XHTML</a> and <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></p> +</body> +</html> Added: trunk/ccm-ldn-portal/web/assets/swfobject15/expressinstall.swf =================================================================== (Binary files differ) Property changes on: trunk/ccm-ldn-portal/web/assets/swfobject15/expressinstall.swf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/ccm-ldn-portal/web/assets/swfobject15/flashversion.html =================================================================== --- trunk/ccm-ldn-portal/web/assets/swfobject15/flashversion.html (rev 0) +++ trunk/ccm-ldn-portal/web/assets/swfobject15/flashversion.html 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,46 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<!-- saved from url=(0014)about:internet --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>SWFObject embed by Geoff Stearns (show player version) @ deconcept</title> +<!-- SWFObject embed by Geoff Stearns ge...@de... http://blog.deconcept.com/swfobject/ --> +<script type="text/javascript" src="swfobject.js"></script> +<style type="text/css"> + + body { + background-color: #eeeeee; + font: .8em/1em verdana,arial,helvetica,sans-serif; + } + + #info { + width: 600px; + overflow: auto; + } + +</style> +</head> +<body> + + <div id="flashversion"> + You do not have the Flash plugin installed, or your browser does not support Javascript (you should enable it, perhaps?) + </div> + <script type="text/javascript"> + // <![CDATA[ + + var version = deconcept.SWFObjectUtil.getPlayerVersion(); + if (document.getElementById && version["major"] > 0) { + document.getElementById('flashversion').innerHTML = "You have Flash player "+ version['major'] +"."+ version['minor'] +"."+ version['rev'] +" installed."; + } + + // ]]> + </script> + + + <div id="info"> + <p> + This page displays your current Flash player version using Javascript. + </p> + </div> +</body> +</html> Added: trunk/ccm-ldn-portal/web/assets/swfobject15/fullpage.html =================================================================== --- trunk/ccm-ldn-portal/web/assets/swfobject15/fullpage.html (rev 0) +++ trunk/ccm-ldn-portal/web/assets/swfobject15/fullpage.html 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,53 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<!-- saved from url=(0014)about:internet --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>SWFObject embed by Geoff Stearns (full page) @ deconcept</title> +<!-- SWFObject embed by Geoff Stearns ge...@de... http://blog.deconcept.com/ --> +<script type="text/javascript" src="swfobject.js"></script> +<style type="text/css"> + + /* hide from ie on mac \*/ + html { + height: 100%; + overflow: hidden; + } + + #flashcontent { + height: 100%; + } + /* end hide */ + + body { + height: 100%; + margin: 0; + padding: 0; + background-color: #f60; + } + +</style> +</head> +<body> + + <div id="flashcontent"> + <strong>You need to upgrade your Flash Player</strong> + This is replaced by the Flash content. + Place your alternate content here and users w ithout the Flash plugin or with + Javascript turned off will see this. Content here allows you to leave out <code>noscript</code> + tags. Include a link to <a href="fullpage.html?detectflash=false">bypass the detection</a> if you wish. + </div> + + <script type="text/javascript"> + // <![CDATA[ + + var so = new SWFObject("so_tester.swf", "sotester", "100%", "100%", "8", "#FF6600"); + so.addVariable("flashVarText", "this is passed in via FlashVars for example only"); + so.addParam("scale", "noscale"); + so.write("flashcontent"); + + // ]]> + </script> + +</body> +</html> Added: trunk/ccm-ldn-portal/web/assets/swfobject15/readme.txt =================================================================== --- trunk/ccm-ldn-portal/web/assets/swfobject15/readme.txt (rev 0) +++ trunk/ccm-ldn-portal/web/assets/swfobject15/readme.txt 2008-08-15 01:15:21 UTC (rev 1739) @@ -0,0 +1,141 @@ +SWFObject Readme +http://blog.deconcept.com/swfobject/ + +v1.5 + +SWFObject is a small Javascript file used for embedding Macromedia Flash content. The script can detect the Flash plug-in in all major web browsers (on Mac and PC) and is designed to make embedding Flash movies as easy as possible. It is also very search engine friendly, degrades gracefully, can be used in valid HTML and XHTML 1.0 documents, and is forward compatible, so it should work for years to come. + +* SWFObject is the Flash embed script formerly known as FlashObject. The name was changed after a request from Adobe + for legal / trademark reasons. + +Created: 10-14-2004 +Last Updated: 02-28-2007 + +By: Geoff Stearns +g...@de... +http://blog.deconcept.com/ +-------------------------- + +Copyright (c) 2007 Geoff Stearns + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software with out restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------- + +Files: + +readme.txt - this file + +swfobject.js - SWFObject javascript file - this will need to be included in any html + file that uses the SWFObject embed. This file is compressed with dojo + shrinksafe (http://alex.dojotoolkit.org/shrinksafe/) to save bandwidth. To view the uncompressed version, look at + source/swfobject_source.js + +swfobject.html - sample html file showing how to use the SWFObject embed + +expressinstall.html - sample html file showing how to use SWFObject with the ExpressInstall feature + +fullpage.html - sample html file showing a full page (100% by 100% flash embed) + +flashversion.html - sample page showing how to use SWFObject to determine the installed player version + +so_tester.swf - sample swf used to test basic SWFObject functionality + +expressinstall.swf - swf used to invoke the Express Install feature for users that have Flash Player 6.0.65 or higher already installed + +source/so_tester. fla - sample fla for SWFObject testing. Open this to see how to use the ExpressInstall + features + +source/swfobject_source.as - uncompressed swfobject.js file - only provided for viewing, you should use + the production version (swfobject.js) on your website + + +These files are provided 'as is,' with no technical support provided, but if you +find a problem, please e-mail me at ge...@de... or send an e-mail to the SWFObject mailing list +(http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com) so I can update/correct the problem and +provide an updated version. + + +---------- +Changelog: + +03-05-2007 (v1.5) +[fixed] updated expressinstall.swf to fix a scaling issue after the update was finished. + +02-28-2007 (v1.5) +[changed] Express Install functionality was updated to support projects that use AS3 (or Flex 2 projects). This means new syntax when using Express Install (see expressinstall.html for an example) +[fixed/changed] adjusted cleanup code to only call cleanUpSWFs() if the user is using IE and has Flash Player 8 or higher (because the streaming audio + out of memory error only affects these systems) +[fixed/changed] adjusted cleanup code to only be called once - this fixes issues people had when accidentally including the js file more than once +[changed] added support for IE Mobile devices with Flash Player installed +[changed] added support for style attributes on the object/embed tags - mainly for compatibility with swfIR (http://www.swfir.com) + +8-2-206 (v1.4.4) +[fixed] The v1.4.3 introduced a new issue: When clicking links with href="javascript:..." it would cause all the swf files on the page to disappear (it was triggering the cleanUpSWFs function prematurely). This is now fixed, and all users should upgrade immediately to v1.4.4. + +7-25-2006 (v1.4.3) +[updated] added in a fix for a bug introduced in Flash Player 9 that would cause an error in IE "Line 56: Out of memory". This was caused by new code inserted by Flash Player 9, and SWFObject 'fixes' this by removing the 'bad' code that fp9 inserts and replacing it with code that does not cause the 'Out of memory' error. + +6-2-2006 (v1.4.2) +[updated] added one more fix for a related issue to the audio streaming bug listed below, thanks to Ben Longoria for the fix +[updated] updated the detection code for IE/ActiveX browsers to fix a crash that could occur when the user had Flash Player 6.0.21 or 6.0.23 installed (Thanks to Michael Williams at Adobe for the code to fix this (and the Adobe detection kit)) +[fixed] updated the getQueryParamValue method to fix a bug that would return the wrong value if you had two variables that ended with the same string (Thanks to Aran Rhee for discovering the issue and providing a fix) +[fixed] fixed a couple of strict js warnings that crept back in sometime after the 1.4 update + +5-17-2006 ( v1.4.1) +[updated] added code to 'clean up' Flash Player instances on window unload because of a bug when using innerHTML and streaming media. + +4-21-2006 (v1.4) +[changed] FlashObject is now known as SWFObject because of legal reasons. For more info, read: +http://blog.deconcept.com/2006/04/21/flashobject-to-become-swfobject/ +Note that using the code 'new FlashObject()' will still work because I've added a link from FlashObject to deconcept.SWFObject, but you should update your code to reflect the new name as soon as possible to avoid future complications +[updated] SWFObject.write() now returns true or false depending on whether the SWF content was written to the page or not (true if it is, false if it is not) +[changed] the 'com' namespace has been removed, now everything lives in the 'deconcept' namespace only, instead of 'com.deconcept' namespace. +[updated] made a couple very small changes to get rid of warnings in the mozilla script debugger when the debugger was in strict mode +[updated] added 'the mark of the web' to the examples pages to (hopefully) prevent the ActiveX bar from appearing at the top of the page when viewing these files locally in IE on Windows. + +3-26-06 +[fixed] bug found in the location.hash handling in the getQueryParamValue() call. Changed document.location.href.hash to document.location.hash. + +2-14-06 +[fixed] bug found in the custom ExpressInstall message. When publishing the fla as a Flash 8 swf, the upgrade message would not show up. This is due to the way the Flash 7 player displays text and outlines (among other things). To avoid issues with custom upgrade messages, you should use device fonts, and either remove outlines from objects, or set them to 'hairline'. There may be other issues to avoid, so if you have issues with items not showing up in older Flash player versions, try simplifying the objects. + +2-09-2006 +[fixed] bug in the getHTML method - the closing <object> tag wasn't being appended unles s you passed in at least 1 flashvar, and fixed some closing slashes on the param tags. + +1-25-2006 +[fixed] Found a small bug in this latest version that caused the Flash movie to not load on IE 5.01 on PC. The bug has been fixed and the zip/source has been updated. Please update to the latest version if you are using 1.3 and have a lot of users using IE 5.01 (does anyone have a high number of those anymore?). The new version number is 1.3b. + +1-18-2006 +[fixed] Bug that would keep users with Flash Player 6 installed from using ExpressInstall + +1-12-2006 +[Changed] When calling FlashObject.write() you can now pass an HTMLElement reference. Previously you needed to pass a string (the Id of the element to write the Flash content to) +[Changed] Made changes to the plugin detection routine that would cause a crash in browsers running certain versions of the Flash plugin. Read a comprehensive description of the issue and the fix. +[New] You may now specify a specific URL to re direct the user to after they complete an ExpressInstall process. Previously the script would always redirect them to the page the Flash movie was embedded in, but when using a popup window this is not always the best solution. See the ExpressInstall section of the FlashObject page for more information. +[New] FlashObject now integrates seamlessly with the Javascript Integration Kit. More information on this is forthcoming in a new blog post. +[New] I’ve used Dojo Shrinksafe to strip out the extra space in the swfobject.js file. FlashObject now weighs in at just a hair over 6kb. Super tiny! The FlashObject ’source code’ (un-shunken Javascript) is included in the FlashObject zip file in the ’source’ folder. I also made a number of small syntax changes to reduce the size even more. + +8-1-2005 +-fixed bug in detection that caused redirection to fail and threw an error if no flash player was installed +-updated IE detection code - no more VBscript at all, and no more loop to check the version installed. + +7-22-2005 +-added minor version and revision detection +-fixed a few small bugs (one would have caused SWFObject to fail once a user tries to detect a flash player version larger than 9) +-rewrote so it's all in it's own namespace (Thanks to Toby Boudreaux for the excellent code tips http://www.tobyjoe.com/) +- *** note that FlashObject.write() now requires an element ID - it will no longer work with no id specified +- *** please note that there is no more bypass text or altTxt variables, you should place your alternate content in a div, and then have FlashObject write to that div, thereby replacing the alternate content. + +5-17-2005 +[changed] the 'id' attribute on the embed tag to 'name' instead. This +change enables the use of features that require liveconnect or other javascript +communication in browsers that use the embed tag. (later changed so the embed tag has both id and name) + +3-31-2005 +v1.1 update, multiple changes, m ostly some code optimization and some +ch... [truncated message content] |
From: <cl...@fe...> - 2008-08-11 21:29:07
|
Author: clasohm Date: 2008-08-11 21:28:57 +0000 (Mon, 11 Aug 2008) New Revision: 1738 Modified: contrib/camden/ccm-ldn-camden-decisiontree/trunk/application.xml contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTree.java Log: third try fixing the DecisionTree publication problem Modified: contrib/camden/ccm-ldn-camden-decisiontree/trunk/application.xml =================================================================== --- contrib/camden/ccm-ldn-camden-decisiontree/trunk/application.xml 2008-08-11 19:37:47 UTC (rev 1737) +++ contrib/camden/ccm-ldn-camden-decisiontree/trunk/application.xml 2008-08-11 21:28:57 UTC (rev 1738) @@ -2,7 +2,7 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-ldn-camden-decisiontree" prettyName="Red Hat CCM Content Types" - version="1.0.2" + version="1.0.3" release="1" webapp="ROOT"> <ccm:dependencies> Modified: contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTree.java =================================================================== --- contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTree.java 2008-08-11 19:37:47 UTC (rev 1737) +++ contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTree.java 2008-08-11 21:28:57 UTC (rev 1738) @@ -244,10 +244,17 @@ return true; } - boolean result = super.copyProperty(source, property, copier); - if (SECTIONS.equals(attribute)) { DecisionTree srcTree = (DecisionTree)source; + + // We make sure that all objects we need below exist by copying + // the TreeSections associated with the source DecisionTree. + // The copier will store the OIDs of the copies, and won't + // recreate them when it does its own thing. + TreeSectionCollection srcSections = srcTree.getSections(); + while (srcSections.next()) + copier.copy(source, this, srcSections.getSection(), property); + TreeSection srcFirstSection = srcTree.getFirstSection(); if (srcFirstSection != null) { // At this point, all associated TreeSections have been copied, @@ -272,6 +279,6 @@ } } - return result; + return super.copyProperty(source, property, copier); } } |
From: <cl...@fe...> - 2008-08-11 19:38:01
|
Author: clasohm Date: 2008-08-11 19:37:47 +0000 (Mon, 11 Aug 2008) New Revision: 1737 Modified: contrib/camden/ccm-ldn-camden-decisiontree/trunk/application.xml contrib/camden/ccm-ldn-camden-decisiontree/trunk/pdl/com/arsdigita/camden/cms/contenttypes/DecisionTree.pdl contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTree.java contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/OptionTarget.java Log: second try fixing the DecisionTree publication problem Modified: contrib/camden/ccm-ldn-camden-decisiontree/trunk/application.xml =================================================================== --- contrib/camden/ccm-ldn-camden-decisiontree/trunk/application.xml 2008-08-08 15:53:08 UTC (rev 1736) +++ contrib/camden/ccm-ldn-camden-decisiontree/trunk/application.xml 2008-08-11 19:37:47 UTC (rev 1737) @@ -2,7 +2,7 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-ldn-camden-decisiontree" prettyName="Red Hat CCM Content Types" - version="1.0.1" + version="1.0.2" release="1" webapp="ROOT"> <ccm:dependencies> Modified: contrib/camden/ccm-ldn-camden-decisiontree/trunk/pdl/com/arsdigita/camden/cms/contenttypes/DecisionTree.pdl =================================================================== --- contrib/camden/ccm-ldn-camden-decisiontree/trunk/pdl/com/arsdigita/camden/cms/contenttypes/DecisionTree.pdl 2008-08-08 15:53:08 UTC (rev 1736) +++ contrib/camden/ccm-ldn-camden-decisiontree/trunk/pdl/com/arsdigita/camden/cms/contenttypes/DecisionTree.pdl 2008-08-11 19:37:47 UTC (rev 1737) @@ -24,7 +24,7 @@ object type DecisionTree extends ContentPage { String[0..1] cancelURL = cam_decision_trees.cancel_url; - component TreeSection[0..1] firstSection = + TreeSection[0..1] firstSection = join cam_decision_trees.first_section to cam_tree_sections.section_id; reference key (cam_decision_trees.tree_id); @@ -74,7 +74,7 @@ object type OptionTarget extends ContentItem { String[0..1] targetURL = cam_option_targets.target_url; - component TreeSection[0..1] targetSection = + TreeSection[0..1] targetSection = join cam_option_targets.target_section to cam_tree_sections.section_id; reference key (cam_option_targets.target_id); Modified: contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTree.java =================================================================== --- contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTree.java 2008-08-08 15:53:08 UTC (rev 1736) +++ contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/DecisionTree.java 2008-08-11 19:37:47 UTC (rev 1737) @@ -29,6 +29,8 @@ import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentPage; +import com.arsdigita.cms.CustomCopy; +import com.arsdigita.cms.ItemCopier; import com.arsdigita.cms.dispatcher.SimpleXMLGenerator; import com.arsdigita.cms.dispatcher.XMLGenerator; import com.arsdigita.domain.DataObjectNotFoundException; @@ -38,6 +40,7 @@ import com.arsdigita.persistence.OID; import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; +import com.arsdigita.persistence.metadata.Property; import com.arsdigita.web.BaseApplicationServlet; import com.arsdigita.xml.Element; @@ -224,4 +227,51 @@ parent.addContent(content); } + + /** + * Override ContentItem.copyProperty so that firstSection is handled + * like a component. + */ + public boolean copyProperty(CustomCopy source, Property property, + ItemCopier copier) { + String attribute = property.getName(); + if (FIRST_SECTION.equals(attribute)) { + // We don't copy the FIRST_SECTION property here, because it's not marked + // as a component, and would cause a PublishedLink to be created, which + // results in performance problems during publication. Instead, we will + // set the FIRST_SECTION property as part of the copying of the SECTIONS + // property, see below. + return true; + } + + boolean result = super.copyProperty(source, property, copier); + + if (SECTIONS.equals(attribute)) { + DecisionTree srcTree = (DecisionTree)source; + TreeSection srcFirstSection = srcTree.getFirstSection(); + if (srcFirstSection != null) { + // At this point, all associated TreeSections have been copied, + // so we can be sure that ItemCopier.getCopy() will return the + // copied TreeSection object. + setFirstSection((TreeSection)copier.getCopy(srcFirstSection.getOID())); + } + + // Next, we go through all OptionTargets in the source object + // and set the TARGET_SECTION property of the corresponding + // destination OptionTarget. Like FIRST_SECTION, the TARGET_SECTION + // property was skipped when the OptionTargets were copied. + OptionTargetCollection srcTargets = srcTree.getTargets(); + while (srcTargets.next()) { + OptionTarget srcTarget = srcTargets.getTarget(); + TreeSection srcSection = srcTarget.getTargetSection(); + + if (srcSection == null) continue; + + OptionTarget dstTarget = (OptionTarget)copier.getCopy(srcTarget.getOID()); + dstTarget.setTargetSection((TreeSection)copier.getCopy(srcSection.getOID())); + } + } + + return result; + } } Modified: contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/OptionTarget.java =================================================================== --- contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/OptionTarget.java 2008-08-08 15:53:08 UTC (rev 1736) +++ contrib/camden/ccm-ldn-camden-decisiontree/trunk/src/com/arsdigita/camden/cms/contenttypes/OptionTarget.java 2008-08-11 19:37:47 UTC (rev 1737) @@ -21,9 +21,12 @@ import java.math.BigDecimal; import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.CustomCopy; +import com.arsdigita.cms.ItemCopier; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.metadata.Property; /** * A section target of the Camden Decision Tree content type. @@ -97,5 +100,20 @@ public void setTargetSection(TreeSection value) { set(TARGET_SECTION, value); } + + public boolean copyProperty(CustomCopy source, Property property, + ItemCopier copier) { + String attribute = property.getName(); + if (TARGET_SECTION.equals(attribute)) { + // We don't copy the TARGET_SECTION property here, because it's not marked + // as a component, and would cause a PublishedLink to be created, which + // results in performance problems during publication. Instead, we will + // set the TARGET_SECTION property as part of the copying of the SECTIONS + // property in DecisionTree.copyProperty(). + return true; + } + + return super.copyProperty(source, property, copier); + } } \ No newline at end of file |
From: <cl...@fe...> - 2008-08-08 15:53:17
|
Author: clasohm Date: 2008-08-08 15:53:08 +0000 (Fri, 08 Aug 2008) New Revision: 1736 Modified: contrib/camden/ccm-ldn-camden-decisiontree/trunk/application.xml Log: bumped application version number after bug fix in r1735 Modified: contrib/camden/ccm-ldn-camden-decisiontree/trunk/application.xml =================================================================== --- contrib/camden/ccm-ldn-camden-decisiontree/trunk/application.xml 2008-08-08 15:48:31 UTC (rev 1735) +++ contrib/camden/ccm-ldn-camden-decisiontree/trunk/application.xml 2008-08-08 15:53:08 UTC (rev 1736) @@ -2,7 +2,7 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-ldn-camden-decisiontree" prettyName="Red Hat CCM Content Types" - version="1.0.0" + version="1.0.1" release="1" webapp="ROOT"> <ccm:dependencies> |
From: <cl...@fe...> - 2008-08-08 15:48:42
|
Author: clasohm Date: 2008-08-08 15:48:31 +0000 (Fri, 08 Aug 2008) New Revision: 1735 Modified: contrib/camden/ccm-ldn-camden-decisiontree/trunk/pdl/com/arsdigita/camden/cms/contenttypes/DecisionTree.pdl Log: fixed DecisionTree and OptionTarget so that VersionCopier does not create PublishedLink objects for them during publication - this caused publication of large DecisionTrees to take extremely long Modified: contrib/camden/ccm-ldn-camden-decisiontree/trunk/pdl/com/arsdigita/camden/cms/contenttypes/DecisionTree.pdl =================================================================== --- contrib/camden/ccm-ldn-camden-decisiontree/trunk/pdl/com/arsdigita/camden/cms/contenttypes/DecisionTree.pdl 2008-08-01 02:53:32 UTC (rev 1734) +++ contrib/camden/ccm-ldn-camden-decisiontree/trunk/pdl/com/arsdigita/camden/cms/contenttypes/DecisionTree.pdl 2008-08-08 15:48:31 UTC (rev 1735) @@ -24,7 +24,7 @@ object type DecisionTree extends ContentPage { String[0..1] cancelURL = cam_decision_trees.cancel_url; - TreeSection[0..1] firstSection = + component TreeSection[0..1] firstSection = join cam_decision_trees.first_section to cam_tree_sections.section_id; reference key (cam_decision_trees.tree_id); @@ -74,7 +74,7 @@ object type OptionTarget extends ContentItem { String[0..1] targetURL = cam_option_targets.target_url; - TreeSection[0..1] targetSection = + component TreeSection[0..1] targetSection = join cam_option_targets.target_section to cam_tree_sections.section_id; reference key (cam_option_targets.target_id); |