You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(48) |
Dec
(31) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(22) |
Feb
(68) |
Mar
(185) |
Apr
(11) |
May
(21) |
Jun
(23) |
Jul
(46) |
Aug
(69) |
Sep
(211) |
Oct
(26) |
Nov
(51) |
Dec
(52) |
2006 |
Jan
(13) |
Feb
(13) |
Mar
(8) |
Apr
(21) |
May
(17) |
Jun
(100) |
Jul
(34) |
Aug
(23) |
Sep
(26) |
Oct
(16) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(66) |
Oct
(10) |
Nov
(1) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(3) |
May
(8) |
Jun
(5) |
Jul
(31) |
Aug
(8) |
Sep
(11) |
Oct
(6) |
Nov
|
Dec
|
2012 |
Jan
(13) |
Feb
(2) |
Mar
(9) |
Apr
(6) |
May
(24) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(120) |
2013 |
Jan
(6) |
Feb
(35) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fa...@vh...> - 2005-07-14 12:20:18
|
Author: fabrice Date: 2005-07-14 14:13:36 +0200 (Thu, 14 Jul 2005) New Revision: 641 Modified: ccm-cms/trunk/src/com/arsdigita/cms/Initializer.java Log: fix to content section filter Modified: ccm-cms/trunk/src/com/arsdigita/cms/Initializer.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/Initializer.java 2005-07-14 12:13:20 UTC (rev 640) +++ ccm-cms/trunk/src/com/arsdigita/cms/Initializer.java 2005-07-14 12:13:36 UTC (rev 641) @@ -87,7 +87,7 @@ public final static String versionId = "$Id$" + "$Author$" + - "$DateTime: 2004/08/17 23:15:09 $"; + "$DateTime: $"; public Initializer() { final String url = RuntimeConfig.getConfig().getJDBCURL(); @@ -289,13 +289,15 @@ }, new LuceneQueryEngine()); - QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, - new FilterType[] { - new PermissionFilterType(), - new VersionFilterType(), + QueryEngineRegistry.registerEngine(IndexerType.LUCENE, + new FilterType[] { + new VersionFilterType(), + new ContentTypeFilterType(), new ContentSectionFilterType() - }, - new IntermediaQueryEngine()); + }, + new LuceneQueryEngine()); + + } private void registerIntermediaEngines() { @@ -314,6 +316,34 @@ }, new IntermediaQueryEngine()); + QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, + new FilterType[] { + new ObjectTypeFilterType(), + new ContentSectionFilterType() + }, + new BaseQueryEngine()); + + QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, + new FilterType[] { + new VersionFilterType(), + new ContentSectionFilterType() + }, + new IntermediaQueryEngine()); + QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, + new FilterType[] { + new VersionFilterType(), + new ContentSectionFilterType(), + new ObjectTypeFilterType() + }, + new IntermediaQueryEngine()); + QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, + new FilterType[] { + new VersionFilterType(), + new ContentTypeFilterType(), + new ContentSectionFilterType() + }, + new IntermediaQueryEngine()); + QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, new FilterType[] { new PermissionFilterType(), |
From: <fa...@vh...> - 2005-07-14 12:20:08
|
Author: fabrice Date: 2005-07-14 14:13:20 +0200 (Thu, 14 Jul 2005) New Revision: 640 Modified: ccm-cms/trunk/src/com/arsdigita/cms/ContentItem.java ccm-cms/trunk/src/com/arsdigita/cms/ContentSectionConfig.java ccm-cms/trunk/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties Log: option to specify a publish listener class Modified: ccm-cms/trunk/src/com/arsdigita/cms/ContentItem.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/ContentItem.java 2005-07-14 12:12:56 UTC (rev 639) +++ ccm-cms/trunk/src/com/arsdigita/cms/ContentItem.java 2005-07-14 12:13:20 UTC (rev 640) @@ -203,7 +203,7 @@ public static final String versionId = "$Id$" + "$Author$" + - "$DateTime: 2004/08/17 23:15:09 $"; + "$DateTime: $"; private static final Logger s_log = Logger.getLogger(ContentItem.class); private static final Logger s_logDenorm = Logger.getLogger(ContentItem.class.getName() + ".Denorm"); @@ -1169,7 +1169,7 @@ } final Lifecycle cycle = cycleDef.createFullLifecycle - (startDate, PUBLISH_LISTENER_CLASS); + (startDate, getPublishListenerClassName()); if (s_log.isDebugEnabled()) { s_log.debug("Instantiated lifecycle " + cycle); @@ -1192,6 +1192,15 @@ return pending; } + public String getPublishListenerClassName() { + String className = ContentSection.getConfig().getPublishLifecycleListenerClass(); + if (className != null && !"".equals(className)) { + return className; + } else { + return PUBLISH_LISTENER_CLASS; + } + } + /** * Unpublishes an item. This method removes the item's lifecycle * and removes all pending versions. It is intended for use in UI Modified: ccm-cms/trunk/src/com/arsdigita/cms/ContentSectionConfig.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/ContentSectionConfig.java 2005-07-14 12:12:56 UTC (rev 639) +++ ccm-cms/trunk/src/com/arsdigita/cms/ContentSectionConfig.java 2005-07-14 12:13:20 UTC (rev 640) @@ -24,6 +24,7 @@ import com.arsdigita.cms.dispatcher.ItemResolver; import com.arsdigita.cms.dispatcher.MultilingualItemResolver; import com.arsdigita.cms.dispatcher.TemplateResolver; +import com.arsdigita.cms.lifecycle.PublishLifecycleListener; import com.arsdigita.cms.publishToFile.PublishToFile; import com.arsdigita.cms.publishToFile.PublishToFileListener; import com.arsdigita.cms.ui.authoring.ItemCategoryForm; @@ -61,7 +62,7 @@ public static final String versionId = "$Id$" + "$Author$" + - "$DateTime: 2004/08/17 23:15:09 $"; + "$DateTime: $"; private static final Logger s_log = Logger.getLogger(ContentSectionConfig.class); @@ -87,7 +88,9 @@ private final Parameter m_hideUDCTUI; private final Parameter m_hideFolderIndexCheckbox; private final Parameter m_defaultNotificationTime; + private final Parameter m_publishLifecycleListenerClass; private final Parameter m_notifyAuthorOnLifecycle; + private final Parameter m_saveTextCleansWordTags; /** * Do not instantiate this class directly. @@ -203,10 +206,18 @@ ("com.arsdigita.cms.default_notification_time", Parameter.REQUIRED, new Integer(0)); + m_publishLifecycleListenerClass = new StringParameter + ("com.arsdigita.cms.publish_lifecycle_listener_class", + Parameter.OPTIONAL, PublishLifecycleListener.class.getName()); + m_notifyAuthorOnLifecycle = new BooleanParameter ("com.arsdigita.cms.notify_author_on_lifecycle", Parameter.OPTIONAL, new Boolean(true)); + m_saveTextCleansWordTags = new BooleanParameter + ("com.arsdigita.cms.save_text_cleans_word_tags", + Parameter.OPTIONAL, new Boolean(false)); + register(m_templateRootPath); register(m_defaultItemTemplatePath); register(m_defaultFolderTemplatePath); @@ -229,7 +240,9 @@ register(m_hideUDCTUI); register(m_hideFolderIndexCheckbox); register(m_defaultNotificationTime); + register(m_publishLifecycleListenerClass); register(m_notifyAuthorOnLifecycle); + register(m_saveTextCleansWordTags); loadInfo(); } @@ -326,10 +339,18 @@ return ((Integer) get(m_defaultNotificationTime)).intValue(); } + public final String getPublishLifecycleListenerClass() { + return (String) get(m_publishLifecycleListenerClass); + } + public final boolean getNotifyAuthorOnLifecycle() { return ((Boolean) get(m_notifyAuthorOnLifecycle)).booleanValue(); } + public final boolean getSaveTextCleansWordTags() { + return ((Boolean) get(m_saveTextCleansWordTags)).booleanValue(); + } + private class SpecificClassParameter extends ClassParameter { private Class m_requiredClass; Modified: ccm-cms/trunk/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties 2005-07-14 12:12:56 UTC (rev 639) +++ ccm-cms/trunk/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties 2005-07-14 12:13:20 UTC (rev 640) @@ -108,7 +108,17 @@ com.arsdigita.cms.default_notification_time.example=0 com.arsdigita.cms.default_notification_time.format=[integer] +com.arsdigita.cms.publish_lifecycle_listener_class.title=PublishLifecycleListener class name +com.arsdigita.cms.publish_lifecycle_listener_class.purpose=Specifies which class to use as a PublishLifecycleListener +com.arsdigita.cms.publish_lifecycle_listener_class.example=com.arsdigita.cms.lifecycle.PublishLifecycleListener +com.arsdigita.cms.publish_lifecycle_listener_class.format=[string] + com.arsdigita.cms.notify_author_on_lifecycle.title=LifecycleListener should notify the author com.arsdigita.cms.notify_author_on_lifecycle.purpose=Wether a content item's author should be notified by the item's LifecycleListener; defaults to true com.arsdigita.cms.notify_author_on_lifecycle.example=true com.arsdigita.cms.notify_author_on_lifecycle.format=[boolean] + +com.arsdigita.cms.save_text_cleans_word_tags.title=Saving the body text does clean MSWord tags +com.arsdigita.cms.save_text_cleans_word_tags.purpose=Wether the Wysiwyg editor should clear the text of MSWord tags, everytime the user clicks on 'Save' +com.arsdigita.cms.save_text_cleans_word_tags.example=false +com.arsdigita.cms.save_text_cleans_word_tags.format=[boolean] |
From: <fa...@vh...> - 2005-07-14 12:19:38
|
Author: fabrice Date: 2005-07-14 14:12:56 +0200 (Thu, 14 Jul 2005) New Revision: 639 Modified: ccm-cms/trunk/src/com/arsdigita/cms/ContentBundle.java Log: item atoz aliases Modified: ccm-cms/trunk/src/com/arsdigita/cms/ContentBundle.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/ContentBundle.java 2005-07-14 12:12:39 UTC (rev 638) +++ ccm-cms/trunk/src/com/arsdigita/cms/ContentBundle.java 2005-07-14 12:12:56 UTC (rev 639) @@ -57,7 +57,7 @@ public static final String versionId = "$Id$" + "$Author$" + - "$DateTime: 2004/08/17 23:15:09 $"; + "$DateTime: $"; private static final Logger s_log = Logger.getLogger(ContentBundle.class); @@ -73,6 +73,11 @@ public static final String INSTANCES = "instances"; /** + * The association to AtoZ aliases + */ + public static final String ATOZ_ALIASING_PROVIDERS = "atozAliasingProviders"; + + /** * The default language property */ public static final String DEFAULT_LANGUAGE = "defaultLanguage"; @@ -558,9 +563,12 @@ public boolean copyProperty(final CustomCopy source, final Property property, final ItemCopier copier) { - if (copier.getCopyType() == ItemCopier.VERSION_COPY - && INSTANCES.equals(property.getName())) { - return true; + if (copier.getCopyType() == ItemCopier.VERSION_COPY) { + if (INSTANCES.equals(property.getName())) { + return true; + } else if (ATOZ_ALIASING_PROVIDERS.equals(property.getName())) { + return true; + } } return super.copyProperty(source, property, copier); @@ -573,7 +581,6 @@ } // Copy categories - CategoryCollection categories = source.getCategoryCollection(); while (categories.next() ) { final Category category = categories.getCategory(); |
From: <fa...@vh...> - 2005-07-14 12:19:27
|
Author: fabrice Date: 2005-07-14 14:12:39 +0200 (Thu, 14 Jul 2005) New Revision: 638 Modified: ccm-cms/trunk/src/com/arsdigita/cms/ui/FlatItemList.java Log: switching between folders used to keep showing the permission pane in the same perm mode (direct or inherited) Modified: ccm-cms/trunk/src/com/arsdigita/cms/ui/FlatItemList.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/ui/FlatItemList.java 2005-07-14 12:11:53 UTC (rev 637) +++ ccm-cms/trunk/src/com/arsdigita/cms/ui/FlatItemList.java 2005-07-14 12:12:39 UTC (rev 638) @@ -82,7 +82,7 @@ * item listing. Also contains a new item form. * * @author <a href="mailto:sfr...@ar...">Stanislav Freidin</a> - * @version $Revision: #18 $ $DateTime: 2004/08/17 23:15:09 $ + * @version $Revision: $ $DateTime: $ */ public class FlatItemList extends SegmentedPanel implements FormProcessListener, ChangeListener, FormSubmissionListener, @@ -90,7 +90,7 @@ public static final String versionId = "$Id$" + "$Author$" + - "$DateTime: 2004/08/17 23:15:09 $"; + "$DateTime: $"; private static final String CONTENT_TYPE_ID = "ct"; private static final String CMS_PRIVILEGES = "com.arsdigita.cms.getPrivileges"; @@ -525,6 +525,10 @@ public void reset(PageState s) { browseMode(s); m_folderManip.reset(s); + // switching between folders used to keep showing the permission pane + // in the same perm mode (direct or inherited) regardless + // of the folder status + m_permPane.reset(s); } public final FolderManipulator getManipulator() { |
From: <fa...@vh...> - 2005-07-14 12:18:37
|
Author: fabrice Date: 2005-07-14 14:11:53 +0200 (Thu, 14 Jul 2005) New Revision: 637 Modified: ccm-cms/trunk/src/com/arsdigita/cms/ui/CMSResources.properties ccm-cms/trunk/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java Log: check if the end date is prior to the start date Modified: ccm-cms/trunk/src/com/arsdigita/cms/ui/CMSResources.properties =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/ui/CMSResources.properties 2005-07-14 12:11:31 UTC (rev 636) +++ ccm-cms/trunk/src/com/arsdigita/cms/ui/CMSResources.properties 2005-07-14 12:11:53 UTC (rev 637) @@ -148,6 +148,7 @@ cms.lifecycle.could_not_fetch_lifecycle=Could not fetch lifecycle: cms.lifecycle.could_not_fetch_phase=Could not fetch phase: cms.ui.item.lifecycle.start_date_in_past=The start date must not be in the past +cms.ui.item.lifecycle.end_date_before_start_date=The end date must not be before the start date cms.nosuchmethodexception=NoSuchMethodException: cms.publishToFile.cannot_find_file=cannot find file cms.publishToFile.cannot_find_item_class=cannot find item class @@ -815,4 +816,3 @@ If you have any questions, please contact the system adminstrator at {4}.\n\ Thank you for using {3}.\n cms.contentassets.ui.description=Description -cms.contentassets.ui.description=Description: Modified: ccm-cms/trunk/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java 2005-07-14 12:11:31 UTC (rev 636) +++ ccm-cms/trunk/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java 2005-07-14 12:11:53 UTC (rev 637) @@ -86,7 +86,7 @@ public static final String versionId = "$Id$" + "$Author$" + - "$DateTime: 2004/08/17 23:15:09 $"; + "$DateTime: $"; private static final Logger s_log = Logger.getLogger (ItemLifecycleSelectForm.class); @@ -663,6 +663,12 @@ cEnd.set(Calendar.SECOND, cNow.get(Calendar.SECOND)); cEnd.set(Calendar.MILLISECOND, cNow.get(Calendar.MILLISECOND)); + //check if the end date is prior to the start date + if(cStart.after(cEnd)) { + throw new FormProcessException + (lz("cms.ui.item.lifecycle.end_date_before_start_date")); + } + Integer notificationDays = (Integer)m_notificationDays.getValue(state); Integer notificationHours = |
From: <fa...@vh...> - 2005-07-14 12:18:15
|
Author: fabrice Date: 2005-07-14 14:11:31 +0200 (Thu, 14 Jul 2005) New Revision: 636 Modified: ccm-cms/trunk/src/com/arsdigita/cms/ui/authoring/TextAssetBody.java Log: optionally, we clear the text of MSWord tags every time the text is submitted/saved Modified: ccm-cms/trunk/src/com/arsdigita/cms/ui/authoring/TextAssetBody.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/ui/authoring/TextAssetBody.java 2005-07-14 12:10:51 UTC (rev 635) +++ ccm-cms/trunk/src/com/arsdigita/cms/ui/authoring/TextAssetBody.java 2005-07-14 12:11:31 UTC (rev 636) @@ -43,6 +43,7 @@ import com.arsdigita.bebop.parameters.NotNullValidationListener; import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.cms.Asset; +import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.TextAsset; import com.arsdigita.cms.ui.CMSDHTMLEditor; @@ -88,7 +89,7 @@ public abstract class TextAssetBody extends SecurityPropertyEditor implements Resettable, AuthoringStepComponent, RequestListener { - public static final String versionId = "$Id$ by $Author$, $DateTime: 2004/08/17 23:15:09 $"; + public static final String versionId = "$Id$ by $Author$, $DateTime: $"; private static Logger s_log = Logger.getLogger(TextAssetBody.class); @@ -647,6 +648,12 @@ c.m_saveCancelSection = new SaveCancelSection(); c.add(c.m_saveCancelSection, ColumnPanel.FULL_WIDTH); + // optionally, we clear the text of MSWord tags every time + // the text is submitted/saved + if (ContentSection.getConfig().getSaveTextCleansWordTags()) { + c.m_saveCancelSection.getSaveButton().setOnClick("wordClean_"+PageTextForm.TEXT_ENTRY+"();"); + } + c.addInitListener(c); c.addProcessListener(c); |
From: <fa...@vh...> - 2005-07-14 12:17:37
|
Author: fabrice Date: 2005-07-14 14:10:51 +0200 (Thu, 14 Jul 2005) New Revision: 635 Modified: ccm-cms/trunk/src/WEB-INF/resources/cms-item-adapters.xml Log: show file attachements, useful Modified: ccm-cms/trunk/src/WEB-INF/resources/cms-item-adapters.xml =================================================================== --- ccm-cms/trunk/src/WEB-INF/resources/cms-item-adapters.xml 2005-07-14 11:59:43 UTC (rev 634) +++ ccm-cms/trunk/src/WEB-INF/resources/cms-item-adapters.xml 2005-07-14 12:10:51 UTC (rev 635) @@ -112,6 +112,7 @@ <xrd:associations rule="include"> <xrd:property name="/object/locale"/> <xrd:property name="/object/type"/> + <xrd:property name="/object/fileAttachments"/> </xrd:associations> </xrd:adapter> |
From: <fa...@vh...> - 2005-07-14 12:06:39
|
Author: fabrice Date: 2005-07-14 13:59:43 +0200 (Thu, 14 Jul 2005) New Revision: 634 Modified: ccm-cms-types-agenda/trunk/sql/ccm-cms-types-agenda/upgrade/oracle-se-6.1.0-6.1.1.sql Log: pretty up upgrade script Modified: ccm-cms-types-agenda/trunk/sql/ccm-cms-types-agenda/upgrade/oracle-se-6.1.0-6.1.1.sql =================================================================== --- ccm-cms-types-agenda/trunk/sql/ccm-cms-types-agenda/upgrade/oracle-se-6.1.0-6.1.1.sql 2005-07-14 11:57:46 UTC (rev 633) +++ ccm-cms-types-agenda/trunk/sql/ccm-cms-types-agenda/upgrade/oracle-se-6.1.0-6.1.1.sql 2005-07-14 11:59:43 UTC (rev 634) @@ -18,6 +18,10 @@ -- $Id$ -- $DateTime: 2004/08/16 18:10:38 $ +\echo Agenda content-type 6.1.0 -> 6.1.1 Upgrade Script (Oracle SE) + +begin; + alter table ct_agendas rename column agenda_date to agenda_date_old; alter table ct_agendas add agenda_date TIMESTAMP; @@ -25,3 +29,5 @@ update ct_agendas set agenda_date = agenda_date_old; alter table ct_agendas drop column agenda_date_old; + +commit; |
From: <fa...@vh...> - 2005-07-14 12:04:37
|
Author: fabrice Date: 2005-07-14 13:57:46 +0200 (Thu, 14 Jul 2005) New Revision: 633 Modified: ccm-core/trunk/src/com/arsdigita/categorization/Category.java Log: fix isMemberOfSubtree query Modified: ccm-core/trunk/src/com/arsdigita/categorization/Category.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/categorization/Category.java 2005-07-14 11:57:00 UTC (rev 632) +++ ccm-core/trunk/src/com/arsdigita/categorization/Category.java 2005-07-14 11:57:46 UTC (rev 633) @@ -84,7 +84,7 @@ * </ul> * * @author Randy Graebner - * @version $Revision: #75 $ $DateTime: 2004/08/16 18:10:38 $ + * @version $Revision: $ $DateTime: $ */ public class Category extends ACSObject { private static final Logger s_log = Logger.getLogger(Category.class); @@ -1513,7 +1513,7 @@ // This means it is an ACSObject DataQuery query = getSession().retrieveQuery ("com.arsdigita.categorization.objectsInSubtree"); - query.setParameter(ID, getID()); + query.setParameter(CATEGORY_ID, getID()); query.addEqualsFilter("object.id", acsObject.getID()); return (query.size() > 0); } |
From: <fa...@vh...> - 2005-07-14 12:03:51
|
Author: fabrice Date: 2005-07-14 13:57:00 +0200 (Thu, 14 Jul 2005) New Revision: 632 Modified: ccm-core/trunk/src/com/arsdigita/ui/login/RecoverPasswordPanel.java Log: use default from email address Modified: ccm-core/trunk/src/com/arsdigita/ui/login/RecoverPasswordPanel.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/ui/login/RecoverPasswordPanel.java 2005-07-14 11:56:42 UTC (rev 631) +++ ccm-core/trunk/src/com/arsdigita/ui/login/RecoverPasswordPanel.java 2005-07-14 11:57:00 UTC (rev 632) @@ -73,7 +73,7 @@ implements LoginConstants { - public static final String versionId = "$Id$ by $Author$, $DateTime: 2004/08/16 18:10:38 $"; + public static final String versionId = "$Id$ by $Author$, $DateTime: $"; private static final Logger s_log = Logger.getLogger(RecoverPasswordPanel.class.getName()); @@ -283,7 +283,9 @@ String to = user.getPrimaryEmail().toString(); String from = - KernelHelper.getSystemAdministratorEmailAddress(); + Mail.getConfig().getDefaultFrom(); + // AFAICT this value below is hard coded to "" ! + //KernelHelper.getSystemAdministratorEmailAddress(); String subject = LoginHelper.localize("login.recoverPassword.mailSubject", req); String body = |
From: <fa...@vh...> - 2005-07-14 12:03:32
|
Author: fabrice Date: 2005-07-14 13:56:42 +0200 (Thu, 14 Jul 2005) New Revision: 631 Modified: ccm-core/trunk/src/com/arsdigita/formbuilder/util/FormBuilderConfig.java ccm-core/trunk/src/com/arsdigita/formbuilder/util/FormBuilderConfig_parameter.properties Log: fix parameter names Modified: ccm-core/trunk/src/com/arsdigita/formbuilder/util/FormBuilderConfig.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/formbuilder/util/FormBuilderConfig.java 2005-07-14 11:56:16 UTC (rev 630) +++ ccm-core/trunk/src/com/arsdigita/formbuilder/util/FormBuilderConfig.java 2005-07-14 11:56:42 UTC (rev 631) @@ -36,7 +36,7 @@ public static final String versionId = "$Id$" + "$Author$" + - "$DateTime: 2004/08/16 18:10:38 $"; + "$DateTime: $"; private static final Logger s_log = Logger.getLogger(FormBuilderConfig.class); @@ -45,10 +45,10 @@ public FormBuilderConfig() { m_actionsHelp = new StringParameter - ("waf.formbulider.actions_help_url", Parameter.REQUIRED, ""); + ("waf.formbuilder.actions_help_url", Parameter.REQUIRED, ""); m_controlsHelp = new StringParameter - ("waf.formbulider.controls_help_url", Parameter.REQUIRED, ""); + ("waf.formbuilder.controls_help_url", Parameter.REQUIRED, ""); register(m_actionsHelp); Modified: ccm-core/trunk/src/com/arsdigita/formbuilder/util/FormBuilderConfig_parameter.properties =================================================================== --- ccm-core/trunk/src/com/arsdigita/formbuilder/util/FormBuilderConfig_parameter.properties 2005-07-14 11:56:16 UTC (rev 630) +++ ccm-core/trunk/src/com/arsdigita/formbuilder/util/FormBuilderConfig_parameter.properties 2005-07-14 11:56:42 UTC (rev 631) @@ -1,11 +1,11 @@ -waf.formbulider.controls_help_url.title=Help link for creating FormBuilder controls -waf.formbulider.controls_help_url.purpose=This is a string that can be used to create the URL to point to the help page that explains how to create controls within the formbuilder. If it starts with "/" then it is assumed to be located on this server. If it starts with anything else, it is assumed to be a link to a foreign site. -waf.formbulider.controls_help_url.example=/help/formbuilder/creations-controls.jsp -waf.formbulider.controls_help_url.format=[string] -waf.formbulider.actions_help_url.title=Help link for creating FormBuilder actions -waf.formbulider.actions_help_url.purpose=This is a string that can be used to create the URL to point to the help page that explains how to create actions within the formbuilder. If it starts with "/" then it is assumed to be located on this server. If it starts with anything else, it is assumed to be a link to a foreign site. -waf.formbulider.actions_help_url.example=/help/formbuilder/creations-actions.jsp -waf.formbulider.actions_help_url.format=[string] +waf.formbuilder.controls_help_url.title=Help link for creating FormBuilder controls +waf.formbuilder.controls_help_url.purpose=This is a string that can be used to create the URL to point to the help page that explains how to create controls within the formbuilder. If it starts with "/" then it is assumed to be located on this server. If it starts with anything else, it is assumed to be a link to a foreign site. +waf.formbuilder.controls_help_url.example=/help/formbuilder/creations-controls.jsp +waf.formbuilder.controls_help_url.format=[string] +waf.formbuilder.actions_help_url.title=Help link for creating FormBuilder actions +waf.formbuilder.actions_help_url.purpose=This is a string that can be used to create the URL to point to the help page that explains how to create actions within the formbuilder. If it starts with "/" then it is assumed to be located on this server. If it starts with anything else, it is assumed to be a link to a foreign site. +waf.formbuilder.actions_help_url.example=/help/formbuilder/creations-actions.jsp +waf.formbuilder.actions_help_url.format=[string] |
From: <fa...@vh...> - 2005-07-14 12:03:11
|
Author: fabrice Date: 2005-07-14 13:56:16 +0200 (Thu, 14 Jul 2005) New Revision: 630 Modified: ccm-core/trunk/src/com/arsdigita/formbuilder/actions/TemplateEmailListener.java Log: add logger Modified: ccm-core/trunk/src/com/arsdigita/formbuilder/actions/TemplateEmailListener.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/formbuilder/actions/TemplateEmailListener.java 2005-07-14 11:55:59 UTC (rev 629) +++ ccm-core/trunk/src/com/arsdigita/formbuilder/actions/TemplateEmailListener.java 2005-07-14 11:56:16 UTC (rev 630) @@ -38,6 +38,8 @@ import javax.mail.MessagingException; +import org.apache.log4j.Logger; + public class TemplateEmailListener extends PersistentProcessListener { public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.formbuilder.actions.TemplateEmailListener"; @@ -137,6 +139,8 @@ } private class TemplateEmailProcessListener implements FormProcessListener { + + private Logger i_log = Logger.getLogger(TemplateEmailProcessListener.class); String m_to; String m_subject; String m_body; |
From: <fa...@vh...> - 2005-07-14 12:02:51
|
Author: fabrice Date: 2005-07-14 13:55:59 +0200 (Thu, 14 Jul 2005) New Revision: 629 Modified: ccm-core/trunk/src/com/arsdigita/domain/SimpleDomainObjectTraversalAdapter.java Log: fix debug statement Modified: ccm-core/trunk/src/com/arsdigita/domain/SimpleDomainObjectTraversalAdapter.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/domain/SimpleDomainObjectTraversalAdapter.java 2005-07-14 11:55:44 UTC (rev 628) +++ ccm-core/trunk/src/com/arsdigita/domain/SimpleDomainObjectTraversalAdapter.java 2005-07-14 11:55:59 UTC (rev 629) @@ -145,7 +145,7 @@ boolean result = m_assoc.contains(path); if (s_log.isDebugEnabled()) { s_log.debug("Check assoc " + path + " contains " + - result + " " + m_attrRule); + result + " " + m_assocRule); } if (!result && m_parent != null) { if (s_log.isDebugEnabled()) { |
From: <fa...@vh...> - 2005-07-14 12:02:31
|
Author: fabrice Date: 2005-07-14 13:55:44 +0200 (Thu, 14 Jul 2005) New Revision: 628 Modified: ccm-core/trunk/src/com/arsdigita/bebop/parameters/EmailValidationListener.java ccm-core/trunk/src/com/arsdigita/bebop/parameters/FloatValidationListener.java ccm-core/trunk/src/com/arsdigita/bebop/parameters/IntegerValidationListener.java ccm-core/trunk/src/com/arsdigita/bebop/parameters/URLValidationListener.java Log: don't make all widgets compulsory... Modified: ccm-core/trunk/src/com/arsdigita/bebop/parameters/EmailValidationListener.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/bebop/parameters/EmailValidationListener.java 2005-07-14 11:55:08 UTC (rev 627) +++ ccm-core/trunk/src/com/arsdigita/bebop/parameters/EmailValidationListener.java 2005-07-14 11:55:44 UTC (rev 628) @@ -36,7 +36,7 @@ String value = (String)d.getValue(); Perl5Util re = new Perl5Util(); - if (!re.match("/^[^@<>\"\\t ]+@[^@<>\".\\t]+([.][^@<>\".\\n ]+)+$/", value)) { + if (!value.equals("") && !re.match("/^[^@<>\"\\t ]+@[^@<>\".\\t]+([.][^@<>\".\\n ]+)+$/", value)) { d.invalidate(); d.addError("Please enter an email address"); } Modified: ccm-core/trunk/src/com/arsdigita/bebop/parameters/FloatValidationListener.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/bebop/parameters/FloatValidationListener.java 2005-07-14 11:55:08 UTC (rev 627) +++ ccm-core/trunk/src/com/arsdigita/bebop/parameters/FloatValidationListener.java 2005-07-14 11:55:44 UTC (rev 628) @@ -32,6 +32,7 @@ ParameterData d = e.getParameterData(); String value = (String)d.getValue(); + if (!value.equals("")) { try { new Float(value); } catch (NumberFormatException ex) { @@ -40,3 +41,4 @@ } } } +} Modified: ccm-core/trunk/src/com/arsdigita/bebop/parameters/IntegerValidationListener.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/bebop/parameters/IntegerValidationListener.java 2005-07-14 11:55:08 UTC (rev 627) +++ ccm-core/trunk/src/com/arsdigita/bebop/parameters/IntegerValidationListener.java 2005-07-14 11:55:44 UTC (rev 628) @@ -32,6 +32,7 @@ ParameterData d = e.getParameterData(); String value = (String)d.getValue(); + if (!value.equals("")) { try { new Integer(value); } catch (NumberFormatException ex) { @@ -40,3 +41,4 @@ } } } +} Modified: ccm-core/trunk/src/com/arsdigita/bebop/parameters/URLValidationListener.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/bebop/parameters/URLValidationListener.java 2005-07-14 11:55:08 UTC (rev 627) +++ ccm-core/trunk/src/com/arsdigita/bebop/parameters/URLValidationListener.java 2005-07-14 11:55:44 UTC (rev 628) @@ -35,6 +35,7 @@ ParameterData d = e.getParameterData(); String value = (String)d.getValue(); + if (!value.equals("")) { try { new URL(value); } catch (MalformedURLException ex) { @@ -43,3 +44,4 @@ } } } +} |
From: <fa...@vh...> - 2005-07-14 12:01:53
|
Author: fabrice Date: 2005-07-14 13:55:08 +0200 (Thu, 14 Jul 2005) New Revision: 627 Modified: ccm-core/trunk/src/com/arsdigita/bebop/parameters/BitSetParameter.java Log: byline patch Modified: ccm-core/trunk/src/com/arsdigita/bebop/parameters/BitSetParameter.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/bebop/parameters/BitSetParameter.java 2005-07-14 11:54:49 UTC (rev 626) +++ ccm-core/trunk/src/com/arsdigita/bebop/parameters/BitSetParameter.java 2005-07-14 11:55:08 UTC (rev 627) @@ -49,7 +49,7 @@ */ public class BitSetParameter extends ParameterModel { - public static final String versionId = "$Id$ by $Author$, $DateTime: 2004/08/16 18:10:38 $"; + public static final String versionId = "$Id$ by $Author$, $DateTime: $"; /** * The radix used to encode/decode the bitset into a BigInteger @@ -173,9 +173,10 @@ boolean state = ("0".equals(bits[0]) ? false : true); int current = 0; - if (state) { - result.set(1); - } + // byline patch +// if (state) { +// result.set(1); +// } for (int i = 1 ; i < bits.length ; i++) { BigInteger n = null; try { |
From: <fa...@vh...> - 2005-07-14 12:01:39
|
Author: fabrice Date: 2005-07-14 13:54:49 +0200 (Thu, 14 Jul 2005) New Revision: 626 Modified: ccm-core/trunk/src/com/arsdigita/bebop/form/Submit.java Log: optional onclick attribute Modified: ccm-core/trunk/src/com/arsdigita/bebop/form/Submit.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/bebop/form/Submit.java 2005-07-14 11:39:56 UTC (rev 625) +++ ccm-core/trunk/src/com/arsdigita/bebop/form/Submit.java 2005-07-14 11:54:49 UTC (rev 626) @@ -43,7 +43,7 @@ */ public class Submit extends Widget { - public static final String versionId = "$Id$ by $Author$, $DateTime: 2004/08/16 18:10:38 $"; + public static final String versionId = "$Id$ by $Author$, $DateTime: $"; private boolean m_noDoubleClick = true; private GlobalizedMessage m_buttonLabel; @@ -215,11 +215,15 @@ public void lock() { if ( m_noDoubleClick ) { - setAttribute( - ON_CLICK, - "if(this.value == '" + getAttribute("value") + - "') { this.value = 'Please Wait'; this.form.submit(); } " - ); + StringBuffer sb = new StringBuffer(); + if (getOnClick() != null) { + sb.append(getOnClick()) + .append(" "); + } + sb.append("if(this.value == '") + .append(getAttribute("value")) + .append("') { this.value = 'Please Wait'; this.form.submit(); } "); + setOnClick(sb.toString()); } super.lock(); } @@ -234,6 +238,22 @@ } /** + * Set the onclick parameter. lock() will append to that String. + * + * @param command The JavaScript to execute when the button is clicked. + */ + public void setOnClick(String command) { + setAttribute(ON_CLICK, command); + } + + /** + * Get the onclick parameter. + */ + public String getOnClick() { + return getAttribute(ON_CLICK); + } + + /** * Registers getName()+".x" and getName()+".y" so that html image * submits will work too */ |
From: <fa...@vh...> - 2005-07-14 11:46:49
|
Author: fabrice Date: 2005-07-14 13:39:56 +0200 (Thu, 14 Jul 2005) New Revision: 625 Added: ccm-ldn-atoz/trunk/pdl/com/arsdigita/london/atoz/AtoZItemAlias.pdl ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/oracle-se/upgrade/add-item_provider_alias.sql ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/postgres/upgrade/add-item_provider_alias.sql ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/upgrade/oracle-se-1.0.2-1.0.3.sql ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/upgrade/postgres-1.0.2-1.0.3.sql ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/AtoZItemAlias.java ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ItemProviderAliasForm.java ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ItemProviderAliasList.java Modified: ccm-ldn-atoz/trunk/pdl/com/arsdigita/london/atoz/AtoZItemProvider.pdl ccm-ldn-atoz/trunk/src/WEB-INF/resources/atoz-adapters.xml ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/AtoZItemGenerator.java ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/AtoZItemProvider.java ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ItemProviderAdmin.java ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ProviderForm.java ccm-ldn-atoz/trunk/web/__ccm__/apps/atoz/xsl/index.xsl Log: atoz item aliases Added: ccm-ldn-atoz/trunk/pdl/com/arsdigita/london/atoz/AtoZItemAlias.pdl =================================================================== --- ccm-ldn-atoz/trunk/pdl/com/arsdigita/london/atoz/AtoZItemAlias.pdl 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/pdl/com/arsdigita/london/atoz/AtoZItemAlias.pdl 2005-07-14 11:39:56 UTC (rev 625) @@ -0,0 +1,34 @@ +// +// Copyright (C) 2005 Runtime Collective Ltd. All Rights Reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of +// the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +model com.arsdigita.london.atoz; + +import com.arsdigita.cms.ContentItem; +import com.arsdigita.kernel.ACSObject; + +object type AtoZItemAlias extends ACSObject { + AtoZItemProvider[1..1] atozItemProvider = join atoz_item_aliases.provider_id + to atoz_item_provider.provider_id; + ContentItem[1..1] contentItem = join atoz_item_aliases.item_id + to cms_items.item_id; + + String[1..1] title = atoz_item_aliases.title VARCHAR(200); + String[1..1] letter = atoz_item_aliases.letter CHAR(1); + + reference key (atoz_item_aliases.alias_id); +} + Modified: ccm-ldn-atoz/trunk/pdl/com/arsdigita/london/atoz/AtoZItemProvider.pdl =================================================================== --- ccm-ldn-atoz/trunk/pdl/com/arsdigita/london/atoz/AtoZItemProvider.pdl 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/pdl/com/arsdigita/london/atoz/AtoZItemProvider.pdl 2005-07-14 11:39:56 UTC (rev 625) @@ -26,3 +26,44 @@ reference key (atoz_item_provider.provider_id); } + +query getAtomicItemEntries { + BigDecimal[1..1] id; + String[1..1] objectType; + String[1..1] aliasTitle; + String[1..1] sortKey; + + do { + select i.item_id as id, + o.object_type as object_type, + '' as alias_title, + lower(cp.title) as sort_key + from cms_items i, + acs_objects o, + cat_object_category_map m, + cms_pages cp, + atoz_item_provider p + where i.version = 'live' + and i.item_id = o.object_id + and o.object_id = m.object_id + and m.category_id = p.category_id + and o.object_id = cp.item_id + and p.provider_id = :providerID + union + select i.item_id as id, + o.object_type as object_type, + a.title as alias_title, + lower(a.letter) as sort_key + from cms_items i, + acs_objects o, + atoz_item_aliases a + where i.item_id = a.item_id + and i.item_id = o.object_id + and a.provider_id = :providerID + } map { + id = id; + objectType = object_type; + aliasTitle = alias_title; + sortKey = sort_key; + } +} Added: ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/oracle-se/upgrade/add-item_provider_alias.sql =================================================================== --- ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/oracle-se/upgrade/add-item_provider_alias.sql 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/oracle-se/upgrade/add-item_provider_alias.sql 2005-07-14 11:39:56 UTC (rev 625) @@ -0,0 +1,26 @@ + +create table atoz_item_aliases ( + alias_id INTEGER not null + constraint atoz_ite_alias_alia_id_p_7yshg + primary key, + -- referential constraint for alias_id deferred due to circular dependencies + provider_id INTEGER not null, + -- referential constraint for provider_id deferred due to circular dependencies + item_id INTEGER not null, + -- referential constraint for item_id deferred due to circular dependencies + title VARCHAR(200) not null, + letter CHAR(1) not null +); + +alter table atoz_item_aliases add + constraint atoz_ite_alia_provi_id_f_si8tg foreign key (provider_id) + references atoz_item_provider(provider_id); +alter table atoz_item_aliases add + constraint atoz_ite_alias_alia_id_f_spljy foreign key (alias_id) + references acs_objects(object_id); +alter table atoz_item_aliases add + constraint atoz_ite_aliase_ite_id_f__bqlu foreign key (item_id) + references cms_items(item_id); + + + Added: ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/postgres/upgrade/add-item_provider_alias.sql =================================================================== --- ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/postgres/upgrade/add-item_provider_alias.sql 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/postgres/upgrade/add-item_provider_alias.sql 2005-07-14 11:39:56 UTC (rev 625) @@ -0,0 +1,24 @@ + +create table atoz_item_aliases ( + alias_id INTEGER not null + constraint atoz_ite_alias_alia_id_p_7yshg + primary key, + -- referential constraint for alias_id deferred due to circular dependencies + provider_id INTEGER not null, + -- referential constraint for provider_id deferred due to circular dependencies + item_id INTEGER not null, + -- referential constraint for item_id deferred due to circular dependencies + title VARCHAR(200) not null, + letter CHAR(1) not null +); + +alter table atoz_item_aliases add + constraint atoz_ite_alia_provi_id_f_si8tg foreign key (provider_id) + references atoz_item_provider(provider_id); +alter table atoz_item_aliases add + constraint atoz_ite_alias_alia_id_f_spljy foreign key (alias_id) + references acs_objects(object_id); +alter table atoz_item_aliases add + constraint atoz_ite_aliase_ite_id_f__bqlu foreign key (item_id) + references cms_items(item_id); + Added: ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/upgrade/oracle-se-1.0.2-1.0.3.sql =================================================================== --- ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/upgrade/oracle-se-1.0.2-1.0.3.sql 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/upgrade/oracle-se-1.0.2-1.0.3.sql 2005-07-14 11:39:56 UTC (rev 625) @@ -0,0 +1 @@ +@@ ../oracle-se/upgrade/add-item_provider_alias.sql Added: ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/upgrade/postgres-1.0.2-1.0.3.sql =================================================================== --- ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/upgrade/postgres-1.0.2-1.0.3.sql 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/sql/ccm-ldn-atoz/upgrade/postgres-1.0.2-1.0.3.sql 2005-07-14 11:39:56 UTC (rev 625) @@ -0,0 +1,3 @@ +begin; +\i ../postgres/upgrade/add-item_provider_alias.sql +commit; Modified: ccm-ldn-atoz/trunk/src/WEB-INF/resources/atoz-adapters.xml =================================================================== --- ccm-ldn-atoz/trunk/src/WEB-INF/resources/atoz-adapters.xml 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/src/WEB-INF/resources/atoz-adapters.xml 2005-07-14 11:39:56 UTC (rev 625) @@ -81,4 +81,27 @@ </xrd:adapter> </xrd:context> + <xrd:context name="com.arsdigita.london.atoz.ui.admin.ItemProviderAliasList"> + <xrd:adapter objectType="com.arsdigita.cms.ContentItem"> + <xrd:attributes rule="exclude"> + <!-- + <xrd:property name="/object/id"/> + <xrd:property name="/object/objectType"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + --> + </xrd:attributes> + </xrd:adapter> + <xrd:adapter objectType="com.arsdigita.london.atoz.AtoZItemAlias"> + <xrd:attributes rule="exclude"> + <!-- + <xrd:property name="/object/id"/> + <xrd:property name="/object/objectType"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + --> + </xrd:attributes> + </xrd:adapter> + </xrd:context> + </xrd:adapters> Added: ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/AtoZItemAlias.java =================================================================== --- ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/AtoZItemAlias.java 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/AtoZItemAlias.java 2005-07-14 11:39:56 UTC (rev 625) @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2005 Runtime Collective Ltd. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package com.arsdigita.london.atoz; + +import com.arsdigita.cms.ContentItem; +import com.arsdigita.kernel.ACSObject; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.OID; +import com.arsdigita.util.Assert; + +import org.apache.log4j.Logger; + + +public class AtoZItemAlias extends ACSObject { + + private static final Logger s_log = Logger.getLogger(AtoZItemAlias.class); + + public static final String BASE_DATA_OBJECT_TYPE = AtoZItemAlias.class.getName(); + + public static final String TITLE = "title"; + public static final String LETTER = "letter"; + public static final String ATOZ_ITEM_PROVIDER = "atozItemProvider"; + public static final String CONTENT_ITEM = "contentItem"; + + public AtoZItemAlias() { + this(BASE_DATA_OBJECT_TYPE); + } + + public AtoZItemAlias(String type) { + super(type); + } + + public AtoZItemAlias(DataObject obj) { + super(obj); + } + + public AtoZItemAlias(OID oid) { + super(oid); + } + + protected void setup(String title, + String letter, + AtoZItemProvider atozItemProvider, + ContentItem contentItem) { + setTitle(title); + setLetter(letter); + setAtoZItemProvider(atozItemProvider); + setContentItem(contentItem); + } + + public String getTitle() { + return (String) get(TITLE); + } + + public void setTitle(String title) { + Assert.exists(title, String.class); + set(TITLE, title); + } + + public String getLetter() { + return (String) get(LETTER); + } + + public void setLetter(String letter) { + set(LETTER, letter); + } + + public void setAtoZItemProvider(AtoZItemProvider atozItemProvider) { + Assert.exists(atozItemProvider, AtoZItemProvider.class); + set(ATOZ_ITEM_PROVIDER, atozItemProvider ); + } + + public AtoZItemProvider getAtoZItemProvider() { + if (get(ATOZ_ITEM_PROVIDER) == null) { + return null; + } else { + return new AtoZItemProvider((DataObject) get(ATOZ_ITEM_PROVIDER)); + } + } + + public void setContentItem(ContentItem contentItem) { + Assert.exists(contentItem, ContentItem.class); + set(CONTENT_ITEM, contentItem); + } + + public ContentItem getContentItem() { + if (get(CONTENT_ITEM) == null) { + return null; + } else { + return new ContentItem((DataObject) get(CONTENT_ITEM)); + } + } +} Modified: ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/AtoZItemGenerator.java =================================================================== --- ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/AtoZItemGenerator.java 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/AtoZItemGenerator.java 2005-07-14 11:39:56 UTC (rev 625) @@ -19,13 +19,17 @@ package com.arsdigita.london.atoz; import com.arsdigita.categorization.Category; +import com.arsdigita.cms.ContentBundle; +import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentPage; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.DataQuery; import com.arsdigita.persistence.Filter; import com.arsdigita.persistence.OID; import com.arsdigita.persistence.SessionManager; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; @@ -39,38 +43,45 @@ public AtoZEntry[] getEntries(String letter) { AtoZItemProvider provider = (AtoZItemProvider)getProvider(); - DataCollection items = SessionManager.getSession().retrieve - ( ContentPage.BASE_DATA_OBJECT_TYPE ); - items.addEqualsFilter( ContentPage.VERSION, ContentPage.LIVE ); + DataQuery entries = provider.getAtomicEntries(); + Filter f = entries.addFilter("sortKey like :sortKey"); + f.set("sortKey", letter.toLowerCase() + "%"); + entries.addOrder("sortKey"); + + List l = new ArrayList(); + ContentBundle bundle; + ContentItem item; + ContentItem live; + String description; + String title; - String loadPaths = provider.getLoadPaths(); - if( null != loadPaths ) { - StringTokenizer tok = new StringTokenizer( loadPaths, "," ); - while( tok.hasMoreTokens() ) { - items.addPath( tok.nextToken() ); - } + while (entries.next()) { + bundle = new ContentBundle(new BigDecimal(entries.get("id").toString())); + if (bundle != null) { + item = bundle.getPrimaryInstance(); + if (item != null) { + // this is necessary because aliases refer to the non-live version, + // while straight items refer to the live-version (to avoid duplicates) + live = item.getLiveVersion(); + if (live != null) { + // should always be a ContentPage + description = (live instanceof ContentPage) ? + ((ContentPage) live).getSearchSummary() : live.getName(); + title = ""; + if (entries.get("aliasTitle") != null) { + title = entries.get("aliasTitle").toString(); + } + if (title.equals("")) { + title = live.getDisplayName(); + } + l.add(new AtoZItemAtomicEntry(live.getOID(), + title, + description)); + } + } + } } - Filter f = items.addFilter("lower(title) like :letter"); - f.set("letter", letter.toLowerCase() + "%"); - items.addOrder("lower(title)"); - - Filter c = items.addInSubqueryFilter("parent.categories", - "categorySubtree.id", - "com.arsdigita.categorization.categorySubtree"); - c.set("id", provider.getCategory().getID()); - - List l = new ArrayList(); - while (items.next()) { - ContentPage item = (ContentPage) DomainObjectFactory.newInstance - ( items.getDataObject() ); - l.add(new AtoZItemAtomicEntry( - item.getOID(), - item.getTitle(), - item.getSearchSummary() - )); - } - return (AtoZEntry[])l.toArray(new AtoZEntry[l.size()]); } Modified: ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/AtoZItemProvider.java =================================================================== --- ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/AtoZItemProvider.java 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/AtoZItemProvider.java 2005-07-14 11:39:56 UTC (rev 625) @@ -18,8 +18,13 @@ package com.arsdigita.london.atoz; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.domain.DomainCollection; +import com.arsdigita.persistence.DataAssociation; import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.DataQuery; import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.SessionManager; import com.arsdigita.util.Assert; import com.arsdigita.categorization.Category; @@ -33,6 +38,8 @@ public static final String CATEGORY = "category"; public static final String LOAD_PATHS = "loadPaths"; + public static final String ATOMIC_ENTRIES = "com.arsdigita.london.atoz.getAtomicItemEntries"; + public AtoZItemProvider() { this(BASE_DATA_OBJECT_TYPE); } @@ -57,6 +64,12 @@ return provider; } + public DataQuery getAtomicEntries() { + DataQuery items = SessionManager.getSession().retrieveQuery(ATOMIC_ENTRIES); + items.setParameter("providerID", getID()); + return items; + } + protected void setup(String title, String description, Category category) { super.setup(title, description); setCategory(category); @@ -75,6 +88,13 @@ } } + public DomainCollection getAliases() { + DomainCollection aliases = new DomainCollection(SessionManager.getSession().retrieve(AtoZItemAlias.BASE_DATA_OBJECT_TYPE)); + aliases.addFilter("atozItemProvider = :providerId").set("providerId", getID()); + aliases.addOrder("title"); + return aliases; + } + public void setLoadPaths( String loadPaths ) { set( LOAD_PATHS, loadPaths ); } Modified: ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ItemProviderAdmin.java =================================================================== --- ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ItemProviderAdmin.java 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ItemProviderAdmin.java 2005-07-14 11:39:56 UTC (rev 625) @@ -32,6 +32,10 @@ private ActionLink m_editDetails; private ProviderDetails m_details; + private ItemProviderAliasList m_aliasList; + private ItemProviderAliasForm m_aliasForm; + private ActionLink m_addAlias; + public ItemProviderAdmin(ACSObjectSelectionModel provider) { super("categoryProviderAdmin", provider); @@ -44,14 +48,27 @@ add(m_detailsForm); add(m_editDetails); + m_aliasList = new ItemProviderAliasList(provider); + m_aliasForm = new ItemProviderAliasForm(provider); + m_addAlias = new ActionLink("Add item alias"); + m_addAlias.setIdAttr("addAlias"); + + add(m_aliasList); + add(m_aliasForm); + add(m_addAlias); + m_editDetails.addActionListener(new ItemProviderEditStart()); m_detailsForm.addCompletionListener(new ItemProviderEditComplete()); + + m_addAlias.addActionListener(new ItemAliasStart()); + m_aliasForm.addCompletionListener(new ItemAliasComplete()); } public void register(Page p) { super.register(p); p.setVisibleDefault(m_detailsForm, false); + p.setVisibleDefault(m_aliasForm, false); } private void switchMode(PageState state, @@ -61,6 +78,9 @@ m_details.setVisible(state, !active); m_editDetails.setVisible(state, !active); + + m_aliasList.setVisible(state, !active); + m_addAlias.setVisible(state, !active); } private class ItemProviderEditStart implements ActionListener { @@ -78,4 +98,20 @@ switchMode(state, m_detailsForm, false); } } + + private class ItemAliasStart implements ActionListener { + public void actionPerformed(ActionEvent e) { + PageState state = e.getPageState(); + + switchMode(state, m_aliasForm, true); + } + } + + private class ItemAliasComplete implements ActionListener { + public void actionPerformed(ActionEvent e) { + PageState state = e.getPageState(); + + switchMode(state, m_aliasForm, false); + } + } } Added: ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ItemProviderAliasForm.java =================================================================== --- ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ItemProviderAliasForm.java 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ItemProviderAliasForm.java 2005-07-14 11:39:56 UTC (rev 625) @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2005 Runtime Collective Ltd. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package com.arsdigita.london.atoz.ui.admin; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SaveCancelSection; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.bebop.Form; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.event.ActionListener; +import com.arsdigita.bebop.event.ActionEvent; +import com.arsdigita.bebop.event.FormProcessListener; +import com.arsdigita.bebop.event.FormSubmissionListener; +import com.arsdigita.bebop.event.FormInitListener; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.event.PrintEvent; +import com.arsdigita.bebop.event.PrintListener; +import com.arsdigita.bebop.form.Option; +import com.arsdigita.bebop.form.OptionGroup; +import com.arsdigita.bebop.form.SingleSelect; +import com.arsdigita.bebop.form.TextField; +import com.arsdigita.bebop.parameters.NotNullValidationListener; +import com.arsdigita.bebop.parameters.StringInRangeValidationListener; +import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.categorization.Category; +import com.arsdigita.categorization.CategorizedCollection; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.kernel.ACSObject; +import com.arsdigita.kernel.ui.ACSObjectSelectionModel; +import com.arsdigita.london.atoz.AtoZProvider; +import com.arsdigita.london.atoz.AtoZItemAlias; +import com.arsdigita.london.atoz.AtoZItemProvider; +import com.arsdigita.util.Classes; +import com.arsdigita.util.UncheckedWrapperException; + +import java.math.BigDecimal; +import java.util.TooManyListenersException; + +public class ItemProviderAliasForm extends Form { + + private ACSObjectSelectionModel m_provider; + + private TextField m_title; + private SingleSelect m_letter; + private OptionGroup m_item; + private SaveCancelSection m_buttons; + + public ItemProviderAliasForm(ACSObjectSelectionModel provider) { + super("itemAliasForm", new SimpleContainer()); + setRedirecting(true); + + m_provider = provider; + + m_title = new TextField("title"); + m_title.addValidationListener(new StringInRangeValidationListener(1, 200)); + m_title.addValidationListener(new NotNullValidationListener()); + m_title.setSize(80); + + m_letter = new SingleSelect("letter"); + m_letter.addValidationListener(new NotNullValidationListener()); + m_letter.addOption(new Option(null, "--Select one--")); + for (int i = 0 ; i < 26 ; i++) { + String letter = new String(new char[]{(char)((int)'a' + i)}); + m_letter.addOption(new Option(letter, letter.toUpperCase())); + } + + m_item = new SingleSelect(new StringParameter("item")); + try { + m_item.addPrintListener(new PrintListener() { + public void prepare(PrintEvent event) { + OptionGroup group = (SingleSelect) event.getTarget(); + PageState state = event.getPageState(); + boolean valueSet = false; + + Category category = ((AtoZItemProvider) m_provider.getSelectedObject(state)) + .getCategory(); + + CategorizedCollection children = category.getObjects(ContentItem.BASE_DATA_OBJECT_TYPE); + children.addOrder("name"); + + while (children.next()) { + ACSObject item = (ACSObject) children.getDomainObject(); + + if ((item instanceof ContentItem) && + ((ContentItem) item).getVersion().equals(ContentItem.DRAFT)) { + + group.addOption(new Option(item.getID().toString(), + ((ContentItem)item).getName())); + } + } + } + }); + } catch (TooManyListenersException e) { + //s_log.error("Error adding init listener to Radio Group", e); + throw new UncheckedWrapperException(e); + } + + add(m_title); + add(m_letter); + add(m_item); + + m_buttons = new SaveCancelSection(new SimpleContainer()); + add(m_buttons); + + addProcessListener(new ProviderProcessListener()); + addSubmissionListener(new ProviderSubmissionListener()); + } + + private class ProviderSubmissionListener implements FormSubmissionListener { + public void submitted(FormSectionEvent e) + throws FormProcessException { + PageState state = e.getPageState(); + + if (m_buttons.getCancelButton().isSelected(state)) { + fireCompletionEvent(state); + throw new FormProcessException("cancel hit"); + } + } + } + + private class ProviderProcessListener implements FormProcessListener { + public void process(FormSectionEvent e) + throws FormProcessException { + PageState state = e.getPageState(); + + AtoZItemProvider provider = (AtoZItemProvider) m_provider + .getSelectedObject(state); + + BigDecimal itemId = new BigDecimal(m_item.getValue(state).toString()); + ContentItem item = new ContentItem(itemId); + + String letter = (String)m_letter.getValue(state); + String title = (String)m_title.getValue(state); + + //provider.addAlias(item, letter, title); + + AtoZItemAlias alias = (AtoZItemAlias) Classes.newInstance(AtoZItemAlias.class); + alias.setTitle(title); + alias.setLetter(letter); + alias.setContentItem(item); + alias.setAtoZItemProvider(provider); + alias.save(); + + fireCompletionEvent(state); + } + } +} Added: ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ItemProviderAliasList.java =================================================================== --- ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ItemProviderAliasList.java 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ItemProviderAliasList.java 2005-07-14 11:39:56 UTC (rev 625) @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2005 Runtime Collective Ltd. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package com.arsdigita.london.atoz.ui.admin; + +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.bebop.PageState; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.domain.DomainObjectXMLRenderer; +import com.arsdigita.domain.DomainCollection; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.kernel.ui.ACSObjectSelectionModel; +import com.arsdigita.london.atoz.AtoZ; +import com.arsdigita.london.atoz.AtoZProvider; +import com.arsdigita.london.atoz.AtoZItemAlias; +import com.arsdigita.london.atoz.AtoZItemProvider; +import com.arsdigita.persistence.OID; +import com.arsdigita.util.UncheckedWrapperException; +import com.arsdigita.xml.Element; +import com.arsdigita.xml.XML; + +import java.io.IOException; + +public class ItemProviderAliasList extends SimpleContainer { + + private ACSObjectSelectionModel m_provider; + private static final String DELETE = "delete"; + + public ItemProviderAliasList(ACSObjectSelectionModel provider) { + m_provider = provider; + } + + public void respond(PageState state) { + String key = state.getControlEventName(); + String value = state.getControlEventValue(); + + if (DELETE.equals(key)) { + AtoZItemAlias alias = (AtoZItemAlias) DomainObjectFactory + .newInstance(OID.valueOf(value)); + alias.delete(); + } + } + + public void generateXML(PageState state, + Element parent) { + Element content = AtoZ.newElement("itemProviderAliasList"); + exportAttributes(content); + + AtoZItemProvider provider = (AtoZItemProvider) + m_provider.getSelectedObject(state); + + DomainCollection entries = provider.getAliases(); + while (entries.next()) { + AtoZItemAlias alias = (AtoZItemAlias) entries.getDomainObject(); + + Element el = AtoZ.newElement("itemProviderAlias"); + el.addAttribute("letter", XML.format(entries.get("letter"))); + el.addAttribute("title", XML.format(entries.get("title"))); + el.addAttribute("itemName", XML.format(alias.getContentItem().getDisplayName())); + + try { + state.setControlEvent(this, DELETE, alias.getOID().toString()); + el.addAttribute("deleteURL", state.stateAsURL()); + state.clearControlEvent(); + } catch (IOException ex) { + throw new UncheckedWrapperException("Could not add delete link.", ex); + } + + DomainObjectXMLRenderer xr = new DomainObjectXMLRenderer(el); + xr.setWrapRoot(false); + xr.setWrapAttributes(true); + xr.setWrapObjects(false); + + xr.walk(entries.getDomainObject(), + ItemProviderAliasList.class.getName()); + + content.addContent(el); + } + + parent.addContent(content); + } +} Modified: ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ProviderForm.java =================================================================== --- ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ProviderForm.java 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/src/com/arsdigita/london/atoz/ui/admin/ProviderForm.java 2005-07-14 11:39:56 UTC (rev 625) @@ -153,6 +153,7 @@ fireCompletionEvent(state); } } + private class ProviderInitListener implements FormInitListener { public void init(FormSectionEvent e) throws FormProcessException { Modified: ccm-ldn-atoz/trunk/web/__ccm__/apps/atoz/xsl/index.xsl =================================================================== --- ccm-ldn-atoz/trunk/web/__ccm__/apps/atoz/xsl/index.xsl 2005-07-14 10:50:14 UTC (rev 624) +++ ccm-ldn-atoz/trunk/web/__ccm__/apps/atoz/xsl/index.xsl 2005-07-14 11:39:56 UTC (rev 625) @@ -251,6 +251,49 @@ </form> </xsl:template> + <xsl:template match="bebop:form" mode="atoz:itemAliasForm"> + <form action="{@action}" name="{@name}"> + <xsl:apply-templates select="bebop:formWidget[@type='hidden']"/> + <xsl:apply-templates select="bebop:pageState"/> + <table class="property"> + <thead> + <tr> + <th colspan="2">Add item alias</th> + </tr> + </thead> + <tbody> + <tr class="odd"> + <th>Title:</th> + <td> + <xsl:apply-templates select="bebop:formWidget[@name='title']"/> + <xsl:apply-templates select="bebop:formErrors[@id='title']"/> + </td> + </tr> + <tr class="even"> + <th>Letter:</th> + <td> + <xsl:apply-templates select="bebop:select[@name='letter']"/> + <xsl:apply-templates select="bebop:formErrors[@id='letter']"/> + </td> + </tr> + <tr class="odd"> + <th>Item:</th> + <td> + <xsl:apply-templates select="bebop:select[@name='item']"/> + <xsl:apply-templates select="bebop:formErrors[@id='item']"/> + </td> + </tr> + </tbody> + <tfoot> + <tr class="odd"> + <td></td> + <td><xsl:apply-templates select="bebop:formWidget[@type='submit']"/></td> + </tr> + </tfoot> + </table> + </form> + </xsl:template> + <xsl:template match="bebop:form" mode="atoz:categoryBlockForm"> <form action="{@action}" name="{@name}"> <xsl:apply-templates select="bebop:formWidget[@type='hidden']"/> @@ -288,8 +331,12 @@ <xsl:apply-templates select="bebop:form[@name='itemProvider']"/> <xsl:apply-templates select="bebop:link[@id='edit']"/> + <xsl:apply-templates select="atoz:itemProviderAliasList"/> + <xsl:apply-templates select="bebop:form[@name='itemAliasForm']" mode="atoz:itemAliasForm"/> + <xsl:apply-templates select="atoz:categoryProviderAliasList"/> <xsl:apply-templates select="bebop:form[@name='categoryAliasForm']" mode="atoz:categoryAliasForm"/> + <xsl:apply-templates select="bebop:link[@id='addAlias']"/> <xsl:apply-templates select="atoz:categoryProviderBlackList"/> @@ -363,6 +410,41 @@ </table> </xsl:template> + <xsl:template match="atoz:itemProviderAliasList"> + <h3>Item Aliases</h3> + + <table class="data"> + <thead> + <tr> + <th>Item</th> + <th>Letter</th> + <th>Alias</th> + <th>Action</th> + </tr> + </thead> + <tbody> + + <xsl:if test="count(atoz:itemProviderAlias) = 0"> + <tr><td colspan="4"><em>There are no item aliases</em></td></tr> + </xsl:if> + <xsl:for-each select="atoz:itemProviderAlias"> + <tr> + <td><xsl:value-of select="@itemName"/></td> + <td><xsl:value-of select="@letter"/></td> + <td><xsl:value-of select="@title"/></td> + <td> + <xsl:call-template name="atoz:link"> + <xsl:with-param name="url" select="@deleteURL"/> + <xsl:with-param name="body" select="'Delete'"/> + <xsl:with-param name="type" select="'delete'"/> + </xsl:call-template> + </td> + </tr> + </xsl:for-each> + </tbody> + </table> + </xsl:template> + <xsl:template match="atoz:providerDetails"> <xsl:choose> <xsl:when test="objectType = 'com.arsdigita.london.atoz.AtoZCategoryProvider'"> |
From: <fa...@vh...> - 2005-07-14 10:57:05
|
Author: fabrice Date: 2005-07-14 12:50:14 +0200 (Thu, 14 Jul 2005) New Revision: 624 Modified: ccm-ldn-dublin/trunk/pdl/com/arsdigita/london/cms/dublin/DublinCoreItem.pdl ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/DublinCoreConfig.java ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/DublinCoreConfig_parameter.properties ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/DublinCoreItem.java ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/ui/DublinCoreForm.java ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/ui/DublinCoreSummary.java Log: new optional portalInstance metadata tag, and option to set a default creator/owner contact Modified: ccm-ldn-dublin/trunk/pdl/com/arsdigita/london/cms/dublin/DublinCoreItem.pdl =================================================================== --- ccm-ldn-dublin/trunk/pdl/com/arsdigita/london/cms/dublin/DublinCoreItem.pdl 2005-07-14 10:38:30 UTC (rev 623) +++ ccm-ldn-dublin/trunk/pdl/com/arsdigita/london/cms/dublin/DublinCoreItem.pdl 2005-07-14 10:50:14 UTC (rev 624) @@ -43,6 +43,7 @@ String dcRelation = ldn_dublin_core_items.relation VARCHAR(4000); String dcRights = ldn_dublin_core_items.rights VARCHAR(4000); String dcSource = ldn_dublin_core_items.source VARCHAR(4000); + String dcCcnPortalInstance = ldn_dublin_core_items.ccn_portal_instance VARCHAR(200); String dcKeywords = ldn_dublin_core_items.keywords VARCHAR(4000); Modified: ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/DublinCoreConfig.java =================================================================== --- ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/DublinCoreConfig.java 2005-07-14 10:38:30 UTC (rev 623) +++ ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/DublinCoreConfig.java 2005-07-14 10:50:14 UTC (rev 624) @@ -21,16 +21,18 @@ import com.arsdigita.runtime.AbstractConfig; import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.StringParameter; +import com.arsdigita.util.parameter.BooleanParameter; public class DublinCoreConfig extends AbstractConfig { private Parameter m_audience; private Parameter m_coverageSpatial; private Parameter m_coverageUnit; - private Parameter m_owner; + private Parameter m_owner_contact; private Parameter m_rights; private Parameter m_publisher; + private Parameter m_use_ccn_portal; private Parameter m_relatedItemsSubjectDomain; @@ -61,18 +63,30 @@ Parameter.OPTIONAL, null); + m_use_ccn_portal = new BooleanParameter( + "com.arsdigita.london.cms.dublin.use_ccn_portal_default", + Parameter.OPTIONAL, + Boolean.FALSE); + m_relatedItemsSubjectDomain = new StringParameter( "com.arsdigita.london.cms.dublin.related_items_subject_domain", Parameter.REQUIRED, "LGCL"); + m_owner_contact = new StringParameter( + "com.arsdigita.london.cms.dublin.owner_contact_default", + Parameter.OPTIONAL, + null); + register(m_audience); register(m_coverageSpatial); register(m_coverageUnit); register(m_owner); + register(m_owner_contact); register(m_rights); register(m_publisher); + register(m_use_ccn_portal); register(m_relatedItemsSubjectDomain); @@ -91,21 +105,30 @@ return (String)get(m_coverageUnit); } - public String getOwnerDefault() { return (String)get(m_owner); } + public String getRightsDefault() { return (String)get(m_rights); } + public String getPublisherDefault() { return (String)get(m_publisher); } + public boolean getUseCCNPortalMetadata() { + return ((Boolean)get(m_use_ccn_portal)).booleanValue(); + } + public String getRelatedItemsSubjectDomain() { return (String)get(m_relatedItemsSubjectDomain); } + public String getOwnerContactDefault() { + return (String)get(m_owner_contact); + } + // Only for test suites void setRelatedItemsSubjectDomain(String domain) { set(m_relatedItemsSubjectDomain, domain); Modified: ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/DublinCoreConfig_parameter.properties =================================================================== --- ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/DublinCoreConfig_parameter.properties 2005-07-14 10:38:30 UTC (rev 623) +++ ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/DublinCoreConfig_parameter.properties 2005-07-14 10:50:14 UTC (rev 624) @@ -18,6 +18,11 @@ com.arsdigita.london.cms.dublin.owner_default.example=Example Corp com.arsdigita.london.cms.dublin.owner_default.format=[string] +com.arsdigita.london.cms.dublin.owner_contact_default.title=Default Owner Contact +com.arsdigita.london.cms.dublin.owner_contact_default.purpose=Default Owner Contact +com.arsdigita.london.cms.dublin.owner_contact_default.example=Example Corp +com.arsdigita.london.cms.dublin.owner_contact_default.format=[string] + com.arsdigita.london.cms.dublin.rights_default.title=Default Rights com.arsdigita.london.cms.dublin.rights_default.purpose=Default Rights com.arsdigita.london.cms.dublin.rights_default.example=Example Corp @@ -28,6 +33,11 @@ com.arsdigita.london.cms.dublin.publisher_default.example=Example Corp com.arsdigita.london.cms.dublin.publisher_default.format=[string] +com.arsdigita.london.cms.dublin.use_ccn_portal_default.title=Use CCN.PortalInclude +com.arsdigita.london.cms.dublin.use_ccn_portal_default.purpose=Whether the content metadata should include CCN.PortalInclude +com.arsdigita.london.cms.dublin.use_ccn_portal_default.example=false +com.arsdigita.london.cms.dublin.use_ccn_portal_default.format=[boolean] + com.arsdigita.london.cms.dublin.related_items_subject_domain.title=Related items subject domain com.arsdigita.london.cms.dublin.related_items_subject_domain.purpose=Related items subject domain com.arsdigita.london.cms.dublin.related_items_subject_domain.example=LGCL Modified: ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/DublinCoreItem.java =================================================================== --- ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/DublinCoreItem.java 2005-07-14 10:38:30 UTC (rev 623) +++ ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/DublinCoreItem.java 2005-07-14 10:50:14 UTC (rev 624) @@ -100,6 +100,8 @@ public static final String DC_RIGHTS = "dcRights"; public static final String DC_SOURCE = "dcSource"; + public static final String DC_CCN_PORTAL_INSTANCE = "dcCcnPortalInstance"; + public static final String DC_DATE_VALID = "dcDateValid"; public static final String DC_DISPOSAL_REVIEW = "dcDisposalReview"; public static final String DC_LANGUAGE = "dcLanguage"; @@ -336,7 +338,16 @@ set(DC_PUBLISHER, publisher); } + /*CCN Portal Instance */ + public String getCcnPortalInstance() { + return (String)get(DC_CCN_PORTAL_INSTANCE); + } + public void setCcnPortalInstance(String ccnPortalInstance) { + set(DC_CCN_PORTAL_INSTANCE, ccnPortalInstance); + } + + /*Relation*/ public String getRelation() { return (String)get(DC_RELATION); Modified: ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/ui/DublinCoreForm.java =================================================================== --- ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/ui/DublinCoreForm.java 2005-07-14 10:38:30 UTC (rev 623) +++ ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/ui/DublinCoreForm.java 2005-07-14 10:50:14 UTC (rev 624) @@ -56,6 +56,7 @@ private static final Logger s_log = Logger.getLogger(DublinCoreForm.class); private Widget m_audience; + private Widget m_ccn_portal_instance; //private TextField m_contributor; private Widget m_coverageSpatial; private TextField m_coveragePostcode; @@ -97,7 +98,14 @@ "coverageUnit", DublinCoreItem.getConfig().getCoverageUnitDomain()); + if (DublinCoreItem.getConfig().getUseCCNPortalMetadata()) { + SingleSelect ss = new SingleSelect("ccnPortalInstance"); + ss.addOption(new Option("", "(none)")); + ss.addOption(new Option("browse", "Browse")); + m_ccn_portal_instance = ss; + } + m_coveragePostcode = new TextField( new StringParameter("coveragePostcode")); m_coveragePostcode.addValidationListener( @@ -231,6 +239,12 @@ ColumnPanel.RIGHT); add(m_keywords); + if (DublinCoreItem.getConfig().getUseCCNPortalMetadata()) { + add(new Label("Include page in portal:", Label.BOLD), + ColumnPanel.RIGHT); + add(m_ccn_portal_instance); + } + add(m_buttons, ColumnPanel.FULL_WIDTH); addProcessListener(new DublinProcessListener()); @@ -288,7 +302,7 @@ Party party = Kernel.getContext().getParty(); m_creatorContact.setValue( state, - party.getPrimaryEmail().toString()); + getDefaultCreatorContact(party)); m_publisher.setValue( state, DublinCoreItem.getConfig().getPublisherDefault()); @@ -317,7 +331,7 @@ Party party = Kernel.getContext().getParty(); m_creatorContact.setValue(state, dcItem.getCreatorContact() == null ? - party.getPrimaryEmail().toString() : + getDefaultCreatorContact(party) : dcItem.getCreatorContact()); m_publisher.setValue(state, dcItem.getPublisher() == null ? @@ -327,9 +341,25 @@ DublinCoreItem.getConfig().getRightsDefault() : dcItem.getRights()); m_keywords.setValue(state, dcItem.getKeywords()); + + if (DublinCoreItem.getConfig().getUseCCNPortalMetadata()) { + m_ccn_portal_instance.setValue(state, dcItem.getCcnPortalInstance()); } } + } + /** Checks to see if a default has been configured using + * <code>com.arsdigita.london.cms.dublin.owner_contact_default<code> + * if not uses the email of the logged in party. + **/ + private String getDefaultCreatorContact(Party party) { + if (DublinCoreItem.getConfig().getOwnerContactDefault() != null) { + return DublinCoreItem.getConfig().getOwnerContactDefault(); + } else { + return party.getPrimaryEmail().toString(); + } + } + private class DublinProcessListener implements FormProcessListener { public void process(FormSectionEvent fse) throws FormProcessException { @@ -365,6 +395,10 @@ dcItem.setKeywords((String)m_keywords.getValue(state)); + if (DublinCoreItem.getConfig().getUseCCNPortalMetadata()) { + dcItem.setCcnPortalInstance((String)m_ccn_portal_instance.getValue(state)); + } + dcItem.save(); } } Modified: ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/ui/DublinCoreSummary.java =================================================================== --- ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/ui/DublinCoreSummary.java 2005-07-14 10:38:30 UTC (rev 623) +++ ccm-ldn-dublin/trunk/src/com/arsdigita/london/cms/dublin/ui/DublinCoreSummary.java 2005-07-14 10:50:14 UTC (rev 624) @@ -70,6 +70,7 @@ private List m_categories; private List m_interaction; private Label m_keywords; + private Label m_ccn_portal_instance; private ItemSelectionModel m_itemModel; @@ -120,6 +121,10 @@ "interaction")); m_interaction.setCellRenderer(simpleCellRenderer); + if (DublinCoreItem.getConfig().getUseCCNPortalMetadata()) { + m_ccn_portal_instance = new Label(); + } + add(new Label("Title:", Label.BOLD), ColumnPanel.RIGHT); add(m_title); @@ -211,6 +216,12 @@ add(new Label("Interaction:", Label.BOLD), ColumnPanel.RIGHT | ColumnPanel.TOP); add(m_interaction); + + if (DublinCoreItem.getConfig().getUseCCNPortalMetadata()) { + add(new Label("Include page in portal:", Label.BOLD), + ColumnPanel.RIGHT); + add(m_ccn_portal_instance); + } } public void generateXML(PageState state, @@ -226,6 +237,9 @@ m_coverage_postcode.setLabel(dcItem.getCoveragePostcode(), state); m_coverageSpatialRef.setLabel(dcItem.getCoverageSpatialRef(), state); m_coverage_unit.setLabel(dcItem.getCoverageUnit(), state); + if (DublinCoreItem.getConfig().getUseCCNPortalMetadata()) { + m_ccn_portal_instance.setLabel(dcItem.getCcnPortalInstance(), state); + } } DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM); |
From: <fa...@vh...> - 2005-07-14 10:45:18
|
Author: fabrice Date: 2005-07-14 12:38:30 +0200 (Thu, 14 Jul 2005) New Revision: 623 Added: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/cms/CategoryDataCollectionDefinition.java Modified: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/DataCollectionDefinition.java Log: definition to show content of a specified category Modified: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/DataCollectionDefinition.java =================================================================== --- ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/DataCollectionDefinition.java 2005-07-14 10:37:16 UTC (rev 622) +++ ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/DataCollectionDefinition.java 2005-07-14 10:38:30 UTC (rev 623) @@ -149,6 +149,11 @@ return objects; } + /** Can be overridden to extract differently the category to inspect. */ + protected Category getCategory(NavigationModel model) { + return model.getCategory(); + } + protected void applyFilters(DataCollection objects, NavigationModel model) { if (m_specificObjectType != null) { @@ -162,8 +167,7 @@ excludedType + "'" ); } - - Category cat = model.getCategory(); + Category cat = getCategory(model); if (m_filterCategory && cat != null) { if (m_descendCategories) { Filter children = objects.addInSubqueryFilter( Added: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/cms/CategoryDataCollectionDefinition.java =================================================================== --- ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/cms/CategoryDataCollectionDefinition.java 2005-07-14 10:37:16 UTC (rev 622) +++ ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/cms/CategoryDataCollectionDefinition.java 2005-07-14 10:38:30 UTC (rev 623) @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2005 Runtime Collective Ltd. All Rights Reserved. + * + * The contents of this file are subject to the CCM Public + * License (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of + * the License at http://www.redhat.com/licenses/ccmpl.html + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + */ + +package com.arsdigita.london.navigation.cms; + +import com.arsdigita.london.navigation.NavigationModel; +import com.arsdigita.categorization.Category; +import com.arsdigita.london.terms.Domain; +import com.arsdigita.london.terms.Term; + +/** + * Use this to display the items in one specific category, + * bypassing the navigation model. + */ +public class CategoryDataCollectionDefinition extends CMSDataCollectionDefinition { + + private Category m_category = null; + + public void setCategoryByPID(String pid, String domain) { + setCategoryByPID(Integer.parseInt(pid), domain); + } + + public void setCategoryByPID(int pid, String domain) { + setCategoryByPID(new Integer(pid), domain); + } + + public void setCategoryByPID(Integer pid, String domain) { + Domain dom = Domain.retrieve(domain); + Term term = dom.getTerm(pid); + Category cat = term.getModel(); + setCategory(cat); + } + + public void setCategory(Category category) { + m_category = category; + } + + /** Use the specified category if any; otherwise use the model. */ + protected Category getCategory(NavigationModel model) { + return (m_category != null) ? m_category : model.getCategory(); + } +} |
From: <fa...@vh...> - 2005-07-14 10:43:59
|
Author: fabrice Date: 2005-07-14 12:37:16 +0200 (Thu, 14 Jul 2005) New Revision: 622 Modified: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/NavigationConfig.java ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/NavigationConfig_parameter.properties ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/category/Menu.java Log: option to show nephew or grandchildren categories Modified: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/NavigationConfig.java =================================================================== --- ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/NavigationConfig.java 2005-07-14 10:36:29 UTC (rev 621) +++ ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/NavigationConfig.java 2005-07-14 10:37:16 UTC (rev 622) @@ -54,8 +54,9 @@ private final Parameter m_defaultModelClass; private final Parameter m_defaultCatRootPath; private final Parameter m_relatedItemsFactory; - private final Parameter m_traversalAdapters; + private final Parameter m_categoryMenuShowNephews; + private final Parameter m_categoryMenuShowGrandChildren; private Category m_defaultCategoryRoot = null; @@ -95,6 +96,12 @@ } catch (MalformedURLException ex) { throw new UncheckedWrapperException("Cannot parse URL", ex); } + m_categoryMenuShowNephews = new BooleanParameter + ("com.arsdigita.london.navigation.category_menu_show_nephews", + Parameter.OPTIONAL, new Boolean(false)); + m_categoryMenuShowGrandChildren = new BooleanParameter + ("com.arsdigita.london.navigation.category_menu_show_grand_children", + Parameter.OPTIONAL, new Boolean(false)); register(m_indexPageCacheLifetime); register(m_generateItemURL); @@ -105,6 +112,8 @@ register(m_defaultCatRootPath); register(m_relatedItemsFactory); register(m_traversalAdapters); + register(m_categoryMenuShowNephews); + register(m_categoryMenuShowGrandChildren); loadInfo(); } @@ -180,6 +189,11 @@ } } + public final boolean getCategoryMenuShowNephews() { + return ((Boolean)get(m_categoryMenuShowNephews)).booleanValue(); + } - + public final boolean getCategoryMenuShowGrandChildren() { + return ((Boolean)get(m_categoryMenuShowGrandChildren)).booleanValue(); + } } Modified: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/NavigationConfig_parameter.properties =================================================================== --- ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/NavigationConfig_parameter.properties 2005-07-14 10:36:29 UTC (rev 621) +++ ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/NavigationConfig_parameter.properties 2005-07-14 10:37:16 UTC (rev 622) @@ -42,3 +42,13 @@ com.arsdigita.london.navigation.traversal_adapters.purpose=Rules for configuring information in generated XML com.arsdigita.london.navigation.traversal_adapters.format=[filename] com.arsdigita.london.navigation.traversal_adapters.example=/WEB-INF/resources/navigation-traversal-adapters.xml + +com.arsdigita.london.navigation.category_menu_show_nephews.title=Show nephew categories in CategoryMenu +com.arsdigita.london.navigation.category_menu_show_nephews.purpose=Whether CategoryMenu should display the categories who are nephews to the current category +com.arsdigita.london.navigation.category_menu_show_nephews.example=false +com.arsdigita.london.navigation.category_menu_show_nephews.format=[boolean] + +com.arsdigita.london.navigation.category_menu_show_grand_children.title=Show grqnd children categories in CategoryMenu +com.arsdigita.london.navigation.category_menu_show_grand_children.purpose=Whether CategoryMenu should display the categories which are grand children to the current category +com.arsdigita.london.navigation.category_menu_show_grand_children.example=false +com.arsdigita.london.navigation.category_menu_show_grand_children.format=[boolean] Modified: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/category/Menu.java =================================================================== --- ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/category/Menu.java 2005-07-14 10:36:29 UTC (rev 621) +++ ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/category/Menu.java 2005-07-14 10:37:16 UTC (rev 622) @@ -20,13 +20,14 @@ import com.arsdigita.categorization.Category; import com.arsdigita.categorization.CategoryCollection; -import com.arsdigita.persistence.Session; -import com.arsdigita.persistence.SessionManager; +import com.arsdigita.persistence.CompoundFilter; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.Filter; -import com.arsdigita.persistence.CompoundFilter; import com.arsdigita.persistence.FilterFactory; +import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.Session; +import com.arsdigita.persistence.SessionManager; import com.arsdigita.xml.Element; import com.arsdigita.london.navigation.Navigation; @@ -57,7 +58,6 @@ return null; } - List catIDs = new ArrayList(); Set selectedIDs = new HashSet(); for (int i = 0 ; i < path.length ; i++) { @@ -65,6 +65,24 @@ selectedIDs.add(path[i].getID()); } + if (Navigation.getConfig().getCategoryMenuShowGrandChildren()) { + // should add the children categories as potential parents + if (path.length > 0) { + BigDecimal categoryID = path[path.length-1].getID(); + addChildrenOfToList(catIDs, categoryID, categoryID); + + } + } + + if (Navigation.getConfig().getCategoryMenuShowNephews()) { + // should add the sibling categories as potential parents + if (path.length > 1) { + BigDecimal categoryID = path[path.length-1].getID(); + BigDecimal parentID = path[path.length-2].getID(); + addChildrenOfToList(catIDs, categoryID, parentID); + } + } + DataCollection treeCats = SessionManager.getSession() .retrieve(Category.BASE_DATA_OBJECT_TYPE); // Filter to all children of :ids @@ -76,7 +94,6 @@ treeCats.addPath("parents.link.sortKey"); treeCats.addPath("parents.id"); - Element content = Navigation.newElement("categoryMenu"); exportAttributes(content); @@ -92,4 +109,20 @@ return content; } + protected void addChildrenOfToList(List catIDs, BigDecimal categoryID, BigDecimal parentID) { + BigDecimal childID; + DataCollection childCats = SessionManager.getSession() + .retrieve(Category.BASE_DATA_OBJECT_TYPE); + childCats.addFilter("parents.id = :id") + .set("id", parentID); + childCats.addEqualsFilter("parents.link.relationType", + Category.CHILD); + while (childCats.next()) { + childID = (new Category(childCats.getDataObject())).getID(); + // don't add the category a second time + if (!childID.equals(categoryID)) { + catIDs.add(childID); + } + } + } } |
From: <fa...@vh...> - 2005-07-14 10:43:18
|
Author: fabrice Date: 2005-07-14 12:36:29 +0200 (Thu, 14 Jul 2005) New Revision: 621 Modified: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/ContentList.java Log: adding a sortKey Modified: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/ContentList.java =================================================================== --- ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/ContentList.java 2005-07-14 10:35:53 UTC (rev 620) +++ ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/ContentList.java 2005-07-14 10:36:29 UTC (rev 621) @@ -32,10 +32,12 @@ import com.arsdigita.kernel.ACSObject; import com.arsdigita.london.navigation.Navigation; import com.arsdigita.london.navigation.ui.AbstractComponent; +import com.arsdigita.london.navigation.cms.CMSDataCollectionDefinition; import com.arsdigita.persistence.DataQuery; import com.arsdigita.persistence.OID; import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; +import com.arsdigita.persistence.DataCollection; import com.arsdigita.util.Assert; import com.arsdigita.xml.Element; @@ -76,7 +78,7 @@ * <xsl:include href="../../navigation/xsl/content-lists.xsl" /> * </ul> * - * @version $Revision: 1.2 $ $Date: 2005/01/07 19:05:12 $ + * @version $Revision: $ $Date: $ */ public class ContentList extends AbstractComponent { // extends SimpleComponent @@ -119,6 +121,7 @@ // check if we are currently displaying an item HashMap items = new HashMap(); + HashMap sortKeys = new HashMap(); ContentItem currentItem = null; try { currentItem = CMS.getContext().getContentItem(); @@ -138,7 +141,7 @@ log.debug("ContentList: looking at the first category of the item : "+category.getName()); // only navigation categories (not sure this was truely necessary in fact) // if (getNavigationRootCategory().isMemberOfSubtree(category)) { - processCategory(category, currentItemClassName, currentItemIdString, items); + processCategory(category, currentItemClassName, currentItemIdString, items, sortKeys); // } // now that we look at only one category, also mark the indexItem as such @@ -164,7 +167,7 @@ if (category != null) { - processCategory(category, null, null, items); + processCategory(category, null, null, items, sortKeys); // process the index item, just in case it isn't in the lists // above (ie inherited from parent category) @@ -212,6 +215,9 @@ itemElement.addAttribute(TAG_ITEM_ISINDEX, TAG_ITEM_ISINDEX_VALUE); } + itemElement.addAttribute("sortKey", ""+sortKeys.get(item.getID().toString())); + + renderer = new DomainObjectXMLRenderer(itemElement); // not sure these are necessary renderer.setWrapAttributes(true); @@ -225,12 +231,19 @@ return parent; } - public void processCategory(Category category, String currentItemClassName, String currentItemIdString, HashMap items) { + public void processCategory(Category category, String currentItemClassName, String currentItemIdString, HashMap items, HashMap sortKeys) { log.debug("ContentList: processing category : "+category.getName()); // items don't come out properly ordered... adding "parent" as optional parameter gives back nothing CategorizedCollection catcol = category.getObjects(CONTENTITEM_CLASS_NAME); + // DataCollection os = SessionManager.getSession().retrieve(CONTENTITEM_CLASS_NAME); +// os.addOrder("parent.categories.link.sortKey"); + +// CategorizedCollection catcol = new CategorizedCollection(os); + // catcol. + catcol.sort(true); ContentItem item; + int sortKey = 0; while (catcol.next()) { item = (ContentItem) catcol.getDomainObject(); @@ -245,6 +258,14 @@ processItem(item, currentItemClassName, currentItemIdString, items); } } + log.debug("adding sortKey " + sortKey + " to item " + item); + // This item can be null, so check first... + if (item != null) { + sortKeys.put(item.getID().toString(), ""+sortKey); + sortKey++; + } else { + log.warn("ContentList: Item " + sortKey + " in category \"" + category.getName() + "\" was null. Ignoring."); + } } } |
From: <fa...@vh...> - 2005-07-14 10:42:42
|
Author: fabrice Date: 2005-07-14 12:35:53 +0200 (Thu, 14 Jul 2005) New Revision: 620 Modified: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/object/SimpleObjectList.java Log: adding a customisable name Modified: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/object/SimpleObjectList.java =================================================================== --- ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/object/SimpleObjectList.java 2005-07-14 10:24:14 UTC (rev 619) +++ ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/object/SimpleObjectList.java 2005-07-14 10:35:53 UTC (rev 620) @@ -48,10 +48,25 @@ */ public class SimpleObjectList extends AbstractObjectList { + public static final String CUSTOM_NAME = "customName"; + protected String m_customName = null; + + public void setCustomName(String name) { + m_customName = name; + } + + public String getCustomName() { + return m_customName; + } + public Element generateXML(HttpServletRequest request, HttpServletResponse response) { Element content = Navigation.newElement("simpleObjectList"); + if (m_customName != null) { + content.addAttribute(CUSTOM_NAME, m_customName); + } + content.addContent(generateObjectListXML(request, response)); |
From: <fa...@vh...> - 2005-07-14 10:31:12
|
Author: fabrice Date: 2005-07-14 12:24:14 +0200 (Thu, 14 Jul 2005) New Revision: 619 Added: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/NavigationRootIndexItem.java Log: Component to display the XML of the index item of the root navigation category Added: ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/NavigationRootIndexItem.java =================================================================== --- ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/NavigationRootIndexItem.java 2005-07-08 14:05:56 UTC (rev 618) +++ ccm-ldn-navigation/trunk/src/com/arsdigita/london/navigation/ui/NavigationRootIndexItem.java 2005-07-14 10:24:14 UTC (rev 619) @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2002-2005 Runtime Collective Ltd. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package com.arsdigita.london.navigation.ui; + +import com.arsdigita.cms.CMS; +import com.arsdigita.cms.ContentBundle; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.dispatcher.SimpleXMLGenerator; +import com.arsdigita.domain.DomainObjectXMLRenderer; +import com.arsdigita.london.navigation.Navigation; +import com.arsdigita.london.navigation.ui.AbstractComponent; +import com.arsdigita.xml.Element; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + +/** + * This generates the XML of the Index item of the Root of the Navigation category tree. + * <br /> + * To set it up in one of your JSP, simply add the following: + * <define:component name="navRootIndex" classname="com.arsdigita.navigation.ui.NavigationRootIndexItem" /> + * + * @version $Revision: $ $Date: $ + */ +public class NavigationRootIndexItem extends AbstractComponent { + + public static final String versionId = "$Id: $"; + + private static Logger log = Logger.getLogger(NavigationRootIndexItem.class);; + + private static final String TAG_PARENT = "navrootindex"; + private static final String TAG_ITEM = "cms:item"; + + public NavigationRootIndexItem() { + super(); + } + + /** + * Generates the XML. + * + * @param state The page state + * @param parent The parent DOM element + */ + public Element generateXML(HttpServletRequest request, HttpServletResponse response) { + + Element parentElement = Navigation.newElement(TAG_PARENT); + + try { + ContentItem indexItem = ((ContentBundle) Navigation.getConfig().getDefaultCategoryRoot().getIndexObject()).getPrimaryInstance().getLiveVersion(); + Element itemElement = parentElement.newChildElement(TAG_ITEM, CMS.CMS_XML_NS); + DomainObjectXMLRenderer renderer = new DomainObjectXMLRenderer(itemElement); + // not sure these are necessary + renderer.setWrapAttributes(true); + renderer.setWrapRoot(false); + renderer.setWrapObjects(false); + renderer.walk(indexItem, SimpleXMLGenerator.ADAPTER_CONTEXT); + } catch (Exception e) { + log.warn("Could not get index ContentItem of the root navigation category.", e); + } + + return parentElement; + } +} |
From: <ap...@vh...> - 2005-07-08 14:12:40
|
Author: apevec Date: 2005-07-08 16:05:56 +0200 (Fri, 08 Jul 2005) New Revision: 618 Added: ccm-core/trunk/lib/jakarta-oro-2.0.8.jar Removed: ccm-cms/trunk/lib/jakarta-oro-2.0.4.jar ccm-core/trunk/lib/jakarta-oro-2.0.7.jar Log: Jakarta ORO upgrade Deleted: ccm-cms/trunk/lib/jakarta-oro-2.0.4.jar Deleted: ccm-core/trunk/lib/jakarta-oro-2.0.7.jar Added: ccm-core/trunk/lib/jakarta-oro-2.0.8.jar =================================================================== (Binary files differ) Property changes on: ccm-core/trunk/lib/jakarta-oro-2.0.8.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <ss...@vh...> - 2005-06-28 14:58:49
|
Author: sshinde Date: 2005-06-28 16:52:37 +0200 (Tue, 28 Jun 2005) New Revision: 617 Modified: releases/1.0.2/ccm-cms/application.xml releases/1.0.2/ccm-core/sql/ccm-core/fixes/formbuilder/delete-bogus-form-widgets.sql releases/1.0.2/ccm-ldn-aplaws/application.xml Log: Bump release versions for revision 615 and 616 changes. They basically fix issues with URL encoding when linking Content Items. Modified: releases/1.0.2/ccm-cms/application.xml =================================================================== --- releases/1.0.2/ccm-cms/application.xml 2005-06-28 14:36:35 UTC (rev 616) +++ releases/1.0.2/ccm-cms/application.xml 2005-06-28 14:52:37 UTC (rev 617) @@ -3,7 +3,7 @@ name="ccm-cms" prettyName="Red Hat CCM Content Management System" version="6.1.1" - release="7" + release="8" webapp="ROOT"> <ccm:dependencies> <ccm:requires name="ccm-core" version="6.1.1" relation="ge"/> Modified: releases/1.0.2/ccm-core/sql/ccm-core/fixes/formbuilder/delete-bogus-form-widgets.sql =================================================================== --- releases/1.0.2/ccm-core/sql/ccm-core/fixes/formbuilder/delete-bogus-form-widgets.sql 2005-06-28 14:36:35 UTC (rev 616) +++ releases/1.0.2/ccm-core/sql/ccm-core/fixes/formbuilder/delete-bogus-form-widgets.sql 2005-06-28 14:52:37 UTC (rev 617) @@ -12,6 +12,11 @@ where h2.component_id = bebop_component_hierarchy.container_id ); +delete from forms_dd_select + where not exists( select 1 from bebop_component_hierarchy h + where h.component_id = forms_dd_select.widget_id + or h.container_id = forms_dd_select.widget_id); + delete from bebop_widgets where not exists( select 1 from bebop_component_hierarchy h where h.component_id = bebop_widgets.widget_id Modified: releases/1.0.2/ccm-ldn-aplaws/application.xml =================================================================== --- releases/1.0.2/ccm-ldn-aplaws/application.xml 2005-06-28 14:36:35 UTC (rev 616) +++ releases/1.0.2/ccm-ldn-aplaws/application.xml 2005-06-28 14:52:37 UTC (rev 617) @@ -3,7 +3,7 @@ name="ccm-ldn-aplaws" prettyName="APLAWS" version="1.9.1" - release="10" + release="11" webapp="ROOT"> <ccm:dependencies> <ccm:requires name="ccm-core" version="6.1.1"/> |