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: <ap...@vh...> - 2006-04-24 01:37:13
|
Author: apevec Date: 2006-04-24 03:34:37 +0200 (Mon, 24 Apr 2006) New Revision: 1117 Modified: trunk/ccm-ldn-navigation/application.xml trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/portlet/ItemListPortletEditor.java trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/portlet/ObjectListPortletEditor.java trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/portlet/ObjectListPortletRenderer.java Log: simplify extension of Object Type selection widgets Modified: trunk/ccm-ldn-navigation/application.xml =================================================================== --- trunk/ccm-ldn-navigation/application.xml 2006-04-22 18:49:16 UTC (rev 1116) +++ trunk/ccm-ldn-navigation/application.xml 2006-04-24 01:34:37 UTC (rev 1117) @@ -3,7 +3,7 @@ name="ccm-ldn-navigation" prettyName="Navigation" version="6.3.0" - release="5" + release="6" webapp="ROOT"> <ccm:dependencies> <ccm:requires name="ccm-core" version="6.2.0" relation="ge"/> Modified: trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/portlet/ItemListPortletEditor.java =================================================================== --- trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/portlet/ItemListPortletEditor.java 2006-04-22 18:49:16 UTC (rev 1116) +++ trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/portlet/ItemListPortletEditor.java 2006-04-24 01:34:37 UTC (rev 1117) @@ -96,28 +96,16 @@ ItemListPortlet myportlet = (ItemListPortlet)portlet; myportlet.setVersion((String)m_version.getValue(state)); } - - protected Widget buildBaseObjectTypeWidget(ParameterModel param) { - SingleSelect widget = new SingleSelect(param); - try { - widget.addPrintListener(new ItemTypePrintListener(true)); - } catch (TooManyListenersException ex) { - throw new UncheckedWrapperException("this cannot happen", ex); - } - return widget; + + protected PrintListener getBaseObjectTypes() { + return new ItemTypePrintListener(true); } - protected Widget buildRestrictedObjectTypeWidget(ParameterModel param) { - SingleSelect widget = new SingleSelect(param); - try { - widget.addPrintListener(new ItemTypePrintListener(false)); - } catch (TooManyListenersException ex) { - throw new UncheckedWrapperException("this cannot happen", ex); - } - return widget; + protected PrintListener getRestrictedObjectTypes() { + return new ItemTypePrintListener(false); } - private class ItemTypePrintListener implements PrintListener { + public static class ItemTypePrintListener implements PrintListener { private boolean m_all; Modified: trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/portlet/ObjectListPortletEditor.java =================================================================== --- trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/portlet/ObjectListPortletEditor.java 2006-04-22 18:49:16 UTC (rev 1116) +++ trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/portlet/ObjectListPortletEditor.java 2006-04-24 01:34:37 UTC (rev 1117) @@ -149,20 +149,28 @@ add( m_properties ); } - protected Widget buildBaseObjectTypeWidget(ParameterModel param) { + protected PrintListener getBaseObjectTypes() { + return new ObjectTypePrintListener(); + } + + private Widget buildBaseObjectTypeWidget(ParameterModel param) { SingleSelect widget = new SingleSelect(param); try { - widget.addPrintListener(new ObjectTypePrintListener()); + widget.addPrintListener(getBaseObjectTypes()); } catch (TooManyListenersException ex) { throw new UncheckedWrapperException("this cannot happen", ex); } return widget; } - protected Widget buildRestrictedObjectTypeWidget(ParameterModel param) { + protected PrintListener getRestrictedObjectTypes() { + return new ObjectTypePrintListener(); + } + + private Widget buildRestrictedObjectTypeWidget(ParameterModel param) { SingleSelect widget = new SingleSelect(param); try { - widget.addPrintListener(new ObjectTypePrintListener()); + widget.addPrintListener(getRestrictedObjectTypes()); } catch (TooManyListenersException ex) { throw new UncheckedWrapperException("this cannot happen", ex); } Modified: trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/portlet/ObjectListPortletRenderer.java =================================================================== --- trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/portlet/ObjectListPortletRenderer.java 2006-04-22 18:49:16 UTC (rev 1116) +++ trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/ui/portlet/ObjectListPortletRenderer.java 2006-04-24 01:34:37 UTC (rev 1117) @@ -18,10 +18,17 @@ package com.arsdigita.london.navigation.ui.portlet; +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.Date; + import com.arsdigita.bebop.PageState; import com.arsdigita.xml.Element; import com.arsdigita.bebop.portal.AbstractPortletRenderer; import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.SessionManager; import com.arsdigita.util.StringUtils; import com.arsdigita.london.navigation.DataCollectionRenderer; @@ -63,8 +70,18 @@ DataCollection objects = m_portlet.getDataCollection(); - Element content = renderer.generateXML(objects, 1); - + Element content = renderer.generateXML(objects, getPageNumber()); parent.addContent(content); + + generateFooter(parent); } + + protected int getPageNumber() { + return 1; + } + + protected void generateFooter(Element parent) { + // override to generate additional XML output + } + } |
From: <ap...@vh...> - 2006-04-22 18:51:47
|
Author: apevec Date: 2006-04-22 20:49:16 +0200 (Sat, 22 Apr 2006) New Revision: 1116 Modified: trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/DataCollectionRenderer.java Log: Experimental: locale-independent Date output (see r1099) adds Date elements year, month, day, hour, minute and second as attributes Modified: trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/DataCollectionRenderer.java =================================================================== --- trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/DataCollectionRenderer.java 2006-04-20 23:41:01 UTC (rev 1115) +++ trunk/ccm-ldn-navigation/src/com/arsdigita/london/navigation/DataCollectionRenderer.java 2006-04-22 18:49:16 UTC (rev 1116) @@ -32,6 +32,8 @@ import com.arsdigita.xml.Element; import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; import java.util.Iterator; import org.apache.log4j.Logger; @@ -203,6 +205,17 @@ Element attribute = Navigation.newElement("attribute"); attribute.addAttribute("name", name); attribute.setText(value.toString()); + if (value instanceof Date) { + Date date = (Date) value; + Calendar calDate = Calendar.getInstance(); + calDate.setTime(date); + attribute.addAttribute("year", Integer.toString(calDate.get(Calendar.YEAR))); + attribute.addAttribute("month", Integer.toString(calDate.get(Calendar.MONTH)+1)); + attribute.addAttribute("day", Integer.toString(calDate.get(Calendar.DAY_OF_MONTH))); + attribute.addAttribute("hour", Integer.toString(calDate.get(Calendar.HOUR_OF_DAY))); + attribute.addAttribute("minute", Integer.toString(calDate.get(Calendar.MINUTE))); + attribute.addAttribute("second", Integer.toString(calDate.get(Calendar.SECOND))); + } item.addContent(attribute); } |
From: <ap...@vh...> - 2006-04-20 23:43:20
|
Author: apevec Date: 2006-04-21 01:41:01 +0200 (Fri, 21 Apr 2006) New Revision: 1115 Removed: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/default/upgrade-6.3.0-6.3.1.sql Modified: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/oracle-se-6.3.0-6.3.1.sql trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/postgres-6.3.0-6.3.1.sql Log: separate upgrade script for PostgreSQL Deleted: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/default/upgrade-6.3.0-6.3.1.sql Modified: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/oracle-se-6.3.0-6.3.1.sql =================================================================== --- trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/oracle-se-6.3.0-6.3.1.sql 2006-04-20 13:55:17 UTC (rev 1114) +++ trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/oracle-se-6.3.0-6.3.1.sql 2006-04-20 23:41:01 UTC (rev 1115) @@ -1 +1,7 @@ -@@ ../default/upgrade-6.3.0-6.3.1.sql +alter table ldn_dublin_core_items add + (item_id integer constraint ldn_dub_cor_ite_ite_id_f_f7q6_ references cms_items(item_id)); +update ldn_dublin_core_items dc + set item_id + = (select dcm.item_id from LDN_DUBLIN_CORE_ITEM_MAP dcm where dcm.dublin_id=dc.dublin_id); + +-- drop table ldn_dublin_core_item_map; Modified: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/postgres-6.3.0-6.3.1.sql =================================================================== --- trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/postgres-6.3.0-6.3.1.sql 2006-04-20 13:55:17 UTC (rev 1114) +++ trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/postgres-6.3.0-6.3.1.sql 2006-04-20 23:41:01 UTC (rev 1115) @@ -1 +1,8 @@ -\i ../default/upgrade-6.3.0-6.3.1.sql +alter table ldn_dublin_core_items add + item_id integer constraint ldn_dub_cor_ite_ite_id_f_f7q6_ references cms_items(item_id); +update ldn_dublin_core_items + set item_id = dcm.item_id + from LDN_DUBLIN_CORE_ITEM_MAP dcm + where dcm.dublin_id=ldn_dublin_core_items.dublin_id; + +-- drop table ldn_dublin_core_item_map; |
From: <ap...@vh...> - 2006-04-20 13:57:43
|
Author: apevec Date: 2006-04-20 15:55:17 +0200 (Thu, 20 Apr 2006) New Revision: 1114 Modified: trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsStep.java Log: remove leftover imports Modified: trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsStep.java =================================================================== --- trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsStep.java 2006-04-20 13:43:43 UTC (rev 1113) +++ trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsStep.java 2006-04-20 13:55:17 UTC (rev 1114) @@ -46,8 +46,6 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedContainer; import com.arsdigita.cms.util.GlobalizationUtil; -import com.arsdigita.london.cms.dublin.ui.DublinCoreForm; -import com.arsdigita.london.cms.dublin.ui.DublinCoreFormSection; import com.arsdigita.persistence.DataCollection; import com.arsdigita.util.Classes; |
From: <ap...@vh...> - 2006-04-20 13:46:04
|
Author: apevec Date: 2006-04-20 15:43:43 +0200 (Thu, 20 Apr 2006) New Revision: 1113 Removed: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/default/index-ldn_dc_map_item_id_idx.sql Modified: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/oracle-se-create.sql trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/postgres-create.sql Log: ldn_dublin_core_item_map is gone Deleted: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/default/index-ldn_dc_map_item_id_idx.sql Modified: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/oracle-se-create.sql =================================================================== --- trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/oracle-se-create.sql 2006-04-19 21:24:07 UTC (rev 1112) +++ trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/oracle-se-create.sql 2006-04-20 13:43:43 UTC (rev 1113) @@ -1,3 +1,2 @@ @@ ddl/oracle-se/create.sql @@ ddl/oracle-se/deferred.sql -@@ default/index-ldn_dc_map_item_id_idx.sql Modified: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/postgres-create.sql =================================================================== --- trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/postgres-create.sql 2006-04-19 21:24:07 UTC (rev 1112) +++ trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/postgres-create.sql 2006-04-20 13:43:43 UTC (rev 1113) @@ -1,5 +1,4 @@ begin; \i ddl/postgres/create.sql \i ddl/postgres/deferred.sql -\i default/index-ldn_dc_map_item_id_idx.sql end; |
From: <ap...@vh...> - 2006-04-19 21:26:42
|
Author: apevec Date: 2006-04-19 23:24:07 +0200 (Wed, 19 Apr 2006) New Revision: 1112 Modified: trunk/ccm-core/src/com/arsdigita/bebop/parameters/TimeParameter.java Log: avoid 'For input string: ""' validation errors Modified: trunk/ccm-core/src/com/arsdigita/bebop/parameters/TimeParameter.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/bebop/parameters/TimeParameter.java 2006-04-19 11:02:05 UTC (rev 1111) +++ trunk/ccm-core/src/com/arsdigita/bebop/parameters/TimeParameter.java 2006-04-19 21:24:07 UTC (rev 1112) @@ -19,6 +19,8 @@ package com.arsdigita.bebop.parameters; import com.arsdigita.globalization.Globalization; +import com.arsdigita.util.StringUtils; + import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; @@ -74,20 +76,26 @@ String minute = Globalization.decodeParameter(request, getName()+".minute"); String second = Globalization.decodeParameter(request, getName()+".second"); String amOrPm = Globalization.decodeParameter(request, getName()+".amOrPm"); + + if (StringUtils.emptyString(hour) && + StringUtils.emptyString(minute) && + StringUtils.emptyString(second)) { + return transformSingleValue(request); + } - if ( hour != null ) { - int hourInt = Integer.parseInt(hour); - if (hourInt == 12) { - hourInt = 0; - } + if (!StringUtils.emptyString(hour)) { + int hourInt = Integer.parseInt(hour); + if (hourInt == 12) { + hourInt = 0; + } c.set(Calendar.HOUR, hourInt); } - if ( minute != null ) { + if (!StringUtils.emptyString(minute)) { c.set(Calendar.MINUTE, Integer.parseInt(minute)); } - if ( second != null ) { + if (!StringUtils.emptyString(second)) { c.set(Calendar.SECOND, Integer.parseInt(second)); } |
From: <ss...@vh...> - 2006-04-19 11:04:50
|
Author: sshinde Date: 2006-04-19 13:02:05 +0200 (Wed, 19 Apr 2006) New Revision: 1111 Added: trunk/ccm-core/lib/commons-codec-1.3.jar Removed: trunk/ccm-core/lib/commons-codec-1.2.jar Log: Updated the commons-codec jar file to new version. Deleted: trunk/ccm-core/lib/commons-codec-1.2.jar Added: trunk/ccm-core/lib/commons-codec-1.3.jar =================================================================== (Binary files differ) Property changes on: trunk/ccm-core/lib/commons-codec-1.3.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <ap...@vh...> - 2006-04-18 14:04:29
|
Author: apevec Date: 2006-04-18 16:02:10 +0200 (Tue, 18 Apr 2006) New Revision: 1110 Added: trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentConfig.java trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentConfig_parameter.properties trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileDescriptionForm.java Modified: trunk/ccm-cms-assets-fileattachment/application.xml trunk/ccm-cms-assets-fileattachment/src/ccm-cms-assets-fileattachment.config trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachment.java trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsStep.java trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsTable.java Log: make File edit form pluggable: new configuration parameter com.arsdigita.cms.contentassets.file_edit_form default is existing com.arsdigita.cms.contentassets.ui.FileDescriptionForm which edits just Asset.description property Modified: trunk/ccm-cms-assets-fileattachment/application.xml =================================================================== --- trunk/ccm-cms-assets-fileattachment/application.xml 2006-04-18 13:57:35 UTC (rev 1109) +++ trunk/ccm-cms-assets-fileattachment/application.xml 2006-04-18 14:02:10 UTC (rev 1110) @@ -2,8 +2,8 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-cms-assets-fileattachment" prettyName="Red Hat CMS Content Asset File Attachment" - version="6.3.0" - release="3" + version="6.3.1" + release="1" webapp="ROOT"> <ccm:dependencies> <ccm:requires name="ccm-core" version="6.2.0" relation="ge"/> @@ -19,6 +19,6 @@ <ccm:contact uri="mailto:cc...@re..." type="support"/> </ccm:contacts> <ccm:description> - The Related Link Asset for the Red Hat CMS. + The Content Asset File Attachment for the Red Hat CMS. </ccm:description> </ccm:application> Modified: trunk/ccm-cms-assets-fileattachment/src/ccm-cms-assets-fileattachment.config =================================================================== --- trunk/ccm-cms-assets-fileattachment/src/ccm-cms-assets-fileattachment.config 2006-04-18 13:57:35 UTC (rev 1109) +++ trunk/ccm-cms-assets-fileattachment/src/ccm-cms-assets-fileattachment.config 2006-04-18 14:02:10 UTC (rev 1110) @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <registry> - <!-- nothing yet --> + <config class="com.arsdigita.cms.contentassets.FileAttachmentConfig" + storage="ccm-cms-assets-fileattachment/fa.properties"/> </registry> Modified: trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachment.java =================================================================== --- trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachment.java 2006-04-18 13:57:35 UTC (rev 1109) +++ trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachment.java 2006-04-18 14:02:10 UTC (rev 1110) @@ -48,9 +48,13 @@ public static final String FILE_ATTACHMENTS = "fileAttachments"; public static final String FILE_ORDER = "fileOrder"; - /** - * Default constructor. This creates a new ProjectSupportBaseItem; - **/ + private static final FileAttachmentConfig s_config = new FileAttachmentConfig(); + + static { + s_config.load(); + } + + public FileAttachment() { super(BASE_DATA_OBJECT_TYPE); } @@ -284,4 +288,9 @@ if( null != fileOwner ) PermissionService.setContext( this, fileOwner ); } + + public static FileAttachmentConfig getConfig() { + return s_config; + } + } Added: trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentConfig.java =================================================================== --- trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentConfig.java 2006-04-18 13:57:35 UTC (rev 1109) +++ trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentConfig.java 2006-04-18 14:02:10 UTC (rev 1110) @@ -0,0 +1,28 @@ +package com.arsdigita.cms.contentassets; + +import com.arsdigita.cms.contentassets.ui.FileDescriptionForm; +import com.arsdigita.runtime.AbstractConfig; +import com.arsdigita.util.parameter.ClassParameter; +import com.arsdigita.util.parameter.Parameter; + +public class FileAttachmentConfig extends AbstractConfig { + + Parameter editFormClass; + + public FileAttachmentConfig() { + editFormClass = new ClassParameter ("com.arsdigita.cms.contentassets.file_edit_form", + Parameter.REQUIRED, + FileDescriptionForm.class + // TODO move *private* class ContentSectionConfig.SpecificClassParameter to c.a.util.parameter + // so we can use it here. + // , FormSection.class + ); + register(editFormClass); + loadInfo(); + } + + public Class getEditFormClass() { + return (Class) get(editFormClass); + } + +} Added: trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentConfig_parameter.properties =================================================================== --- trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentConfig_parameter.properties 2006-04-18 13:57:35 UTC (rev 1109) +++ trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentConfig_parameter.properties 2006-04-18 14:02:10 UTC (rev 1110) @@ -0,0 +1,4 @@ +com.arsdigita.cms.contentassets.file_edit_form.title=File asset edit form +com.arsdigita.cms.contentassets.file_edit_form.purpose=A form for editing file asset properties. Default implementation edits Assets.description property. +com.arsdigita.cms.contentassets.file_edit_form.example=com.arsdigita.cms.contentassets.ui.FileDescriptionForm +com.arsdigita.cms.contentassets.file_edit_form.format=[class] Modified: trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsStep.java =================================================================== --- trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsStep.java 2006-04-18 13:57:35 UTC (rev 1109) +++ trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsStep.java 2006-04-18 14:02:10 UTC (rev 1110) @@ -22,6 +22,7 @@ import com.arsdigita.bebop.Label; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.SaveCancelSection; +import com.arsdigita.bebop.SimpleComponent; import com.arsdigita.bebop.event.ActionEvent; import com.arsdigita.bebop.event.ActionListener; import com.arsdigita.bebop.event.FormInitListener; @@ -31,9 +32,12 @@ import com.arsdigita.bebop.event.FormValidationListener; import com.arsdigita.bebop.event.PrintEvent; import com.arsdigita.bebop.event.PrintListener; +import com.arsdigita.bebop.form.Submit; import com.arsdigita.bebop.form.TextArea; import com.arsdigita.bebop.parameters.BigDecimalParameter; +import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contentassets.FileAttachment; import com.arsdigita.cms.ui.CMSContainer; @@ -42,7 +46,10 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedContainer; import com.arsdigita.cms.util.GlobalizationUtil; +import com.arsdigita.london.cms.dublin.ui.DublinCoreForm; +import com.arsdigita.london.cms.dublin.ui.DublinCoreFormSection; import com.arsdigita.persistence.DataCollection; +import com.arsdigita.util.Classes; /** * Authoring step for file attachments @@ -62,9 +69,10 @@ private BigDecimalParameter m_fileParam = new BigDecimalParameter("fa"); private FileAttachmentSelectionModel m_fileModel = new FileAttachmentSelectionModel(m_fileParam); + private Submit m_cancel; + private Form m_dcForm; public FileAttachmentsStep(ItemSelectionModel itemModel,AuthoringKitWizard parent) { - super(); m_parent = parent; m_item = itemModel; @@ -91,14 +99,21 @@ m_display.add(mainLabel); m_display.add(m_fileList); setDisplayComponent(m_display); + // The upload form. m_uploadForm = new FileAttachmentUpload(m_item); add("upload", "Upload a new file", new WorkflowLockedComponentAccess(m_uploadForm, m_item), m_uploadForm.getSaveCancelSection().getCancelButton()); - Form form = new Form("descriptionEdit"); - form.add(new FileDescriptionForm(m_item, m_fileModel)); + // File asset metadata form. + Form form = new Form("faEdit"); + Class editFormClass = FileAttachment.getConfig().getEditFormClass(); + FormSection editForm = (FormSection) + Classes.newInstance(editFormClass, + new Class[] { FileAttachmentSelectionModel.class }, + new Object[] { m_fileModel }); + form.add(editForm); WorkflowLockedContainer edit = new WorkflowLockedContainer(m_item); edit.add(form); @@ -127,123 +142,4 @@ return m_item; } - /** - * Form to edit the description of a file attachment. - */ - private class FileDescriptionForm extends FormSection - implements FormInitListener, FormProcessListener, FormValidationListener, FormSubmissionListener { - - private TextArea m_description; - private ItemSelectionModel m_itemModel; - private FileAttachmentSelectionModel m_fileModel; - private SaveCancelSection m_saveCancelSection; - - /** - * Creates a new form to edit the FileAttachment description - * by the item selection model passed in. - * @param itemModel The ItemSelectionModel to use to obtain the - * ContentItem to which this file is attached - * @param file The FileAttachmentSelectionModel to use to obtain the - * FileAttachment to work on - */ - public FileDescriptionForm(ItemSelectionModel itemModel, - FileAttachmentSelectionModel file ) { - super(new ColumnPanel(2)); - m_fileModel = file; - m_itemModel = itemModel; - - addWidgets(); - m_saveCancelSection = new SaveCancelSection(); - add(m_saveCancelSection, ColumnPanel.FULL_WIDTH); - - addInitListener(this); - addValidationListener(this); - addProcessListener(this); - addSubmissionListener(this); - } - - /** - * Adds widgets to the form. - */ - protected void addWidgets() { - m_description = new TextArea("description"); - m_description.setCols(40); - m_description.setRows(5); - add(new Label(GlobalizationUtil. - globalize("cms.contenttypes.ui.description"))); - - add(m_description); - } - - /** - * Submission listener. Handles cancel events. - * - * @param e the FormSectionEvent - */ - public void submitted(FormSectionEvent e) - throws FormProcessException { - if (m_saveCancelSection.getCancelButton().isSelected(e.getPageState())) { - m_fileModel.clearSelection(e.getPageState()); - init(e); - throw new FormProcessException("cancelled"); - } - } - - /** - * Validation listener. - * - * @param event the FormSectionEvent - */ - public void validate(FormSectionEvent event) - throws FormProcessException { - PageState state = event.getPageState(); - FormData data = event.getFormData(); - - String description = (String)m_description.getValue(state); - // not performing any check - } - - - /** - * Init listener. - * - * @param fse the FormSectionEvent - */ - public void init( FormSectionEvent fse ) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - if (m_fileModel.isSelected(state)) { - setVisible(state, true); - FileAttachment file = m_fileModel.getSelectedFileAttachment(state); - m_description.setValue(state, file.getDescription()); - } else { - setVisible(state, false); - } - } - - - /** - * Process listener. Edits the file description. - * - * @param fse the FormSectionEvent - */ - public void process( FormSectionEvent fse ) throws FormProcessException { - PageState state = fse.getPageState(); - - // save only if save button was pressed - if ( m_saveCancelSection.getCancelButton().isSelected(state) ) { - // cancel button is selected - m_fileModel.clearSelection(state); - } else { - if (m_fileModel.isSelected(state)) { - FileAttachment file = m_fileModel.getSelectedFileAttachment(state); - file.setDescription( (String) m_description.getValue(state)); - } - } - m_fileModel.clearSelection(state); - init(fse); - } - - } - } Modified: trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsTable.java =================================================================== --- trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsTable.java 2006-04-18 13:57:35 UTC (rev 1109) +++ trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentsTable.java 2006-04-18 14:02:10 UTC (rev 1110) @@ -251,15 +251,11 @@ Object key, int row, int column) { - SimpleContainer filesc = new SimpleContainer(); final String downloadKey = (String)key; FileAttachment attachment = new FileAttachment(new BigDecimal(downloadKey)); - Link downloadLink = new Link(attachment.getDisplayName(), - Utilities.getAssetURL(attachment)); - filesc.add(downloadLink); - - return filesc; + return new Link(attachment.getDisplayName(), + Utilities.getAssetURL(attachment)); } } } Added: trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileDescriptionForm.java =================================================================== --- trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileDescriptionForm.java 2006-04-18 13:57:35 UTC (rev 1109) +++ trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileDescriptionForm.java 2006-04-18 14:02:10 UTC (rev 1110) @@ -0,0 +1,141 @@ +package com.arsdigita.cms.contentassets.ui; + +import com.arsdigita.bebop.ColumnPanel; +import com.arsdigita.bebop.FormData; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.FormSection; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SaveCancelSection; +import com.arsdigita.bebop.event.FormInitListener; +import com.arsdigita.bebop.event.FormProcessListener; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.event.FormSubmissionListener; +import com.arsdigita.bebop.event.FormValidationListener; +import com.arsdigita.bebop.form.Submit; +import com.arsdigita.bebop.form.TextArea; +import com.arsdigita.cms.contentassets.FileAttachment; +import com.arsdigita.cms.util.GlobalizationUtil; + +/** + * Form to edit the description of a file attachment. File description edit + * form, default class for <code>com.arsdigita.cms.contentassets.file_edit_form</code> + * configuration parameter. Edits property Asset.description + */ +public class FileDescriptionForm extends FormSection implements + FormInitListener, FormProcessListener, FormValidationListener, + FormSubmissionListener { + + private TextArea m_description; + + private FileAttachmentSelectionModel m_fileModel; + + private Submit m_cancel; + + /** + * Creates a new form to edit the FileAttachment description by the item + * selection model passed in. + * + * @param file + * The FileAttachmentSelectionModel to use to obtain the + * FileAttachment to work on + */ + public FileDescriptionForm(FileAttachmentSelectionModel file) { + super(new ColumnPanel(2)); + m_fileModel = file; + + addWidgets(); + SaveCancelSection saveCancel = new SaveCancelSection(); + m_cancel = saveCancel.getCancelButton(); + add(saveCancel, ColumnPanel.FULL_WIDTH); + + addInitListener(this); + addSubmissionListener(this); + addValidationListener(this); + addProcessListener(this); + } + + /** + * Adds widgets to the form. + */ + protected void addWidgets() { + m_description = new TextArea("description"); + m_description.setCols(40); + m_description.setRows(5); + add(new Label(GlobalizationUtil + .globalize("cms.contenttypes.ui.description"))); + + add(m_description); + } + + /** + * Submission listener. Handles cancel events. + * + * @param e + * the FormSectionEvent + */ + public void submitted(FormSectionEvent e) throws FormProcessException { + if (m_cancel.isSelected(e.getPageState())) { + m_fileModel.clearSelection(e.getPageState()); + init(e); + throw new FormProcessException("cancelled"); + } + } + + /** + * Validation listener. + * + * @param event + * the FormSectionEvent + */ + public void validate(FormSectionEvent event) throws FormProcessException { + PageState state = event.getPageState(); + FormData data = event.getFormData(); + + String description = (String) m_description.getValue(state); + // not performing any check + } + + /** + * Init listener. + * + * @param fse + * the FormSectionEvent + */ + public void init(FormSectionEvent fse) throws FormProcessException { + FormData data = fse.getFormData(); + PageState state = fse.getPageState(); + if (m_fileModel.isSelected(state)) { + setVisible(state, true); + FileAttachment file = m_fileModel.getSelectedFileAttachment(state); + m_description.setValue(state, file.getDescription()); + } else { + setVisible(state, false); + } + } + + /** + * Process listener. Edits the file description. + * + * @param fse + * the FormSectionEvent + */ + public void process(FormSectionEvent fse) throws FormProcessException { + PageState state = fse.getPageState(); + + // save only if save button was pressed + if (m_cancel.isSelected(state)) { + // cancel button is selected + m_fileModel.clearSelection(state); + } else { + if (m_fileModel.isSelected(state)) { + FileAttachment file = m_fileModel + .getSelectedFileAttachment(state); + file.setDescription((String) m_description.getValue(state)); + } + } + m_fileModel.clearSelection(state); + init(fse); + } + +} |
Author: apevec Date: 2006-04-18 15:57:35 +0200 (Tue, 18 Apr 2006) New Revision: 1109 Added: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/default/upgrade-6.3.0-6.3.1.sql trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/oracle-se-6.3.0-6.3.1.sql trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/postgres-6.3.0-6.3.1.sql trunk/ccm-ldn-dublin/src/com/arsdigita/london/cms/dublin/ui/DublinCoreFormSection.java Modified: trunk/ccm-ldn-dublin/application.xml trunk/ccm-ldn-dublin/pdl/com/arsdigita/london/cms/dublin/DublinCoreItem.pdl trunk/ccm-ldn-dublin/src/ccm-ldn-dublin.upgrade trunk/ccm-ldn-dublin/src/com/arsdigita/london/cms/dublin/DublinCoreItem.java trunk/ccm-ldn-dublin/src/com/arsdigita/london/cms/dublin/ui/DublinCoreForm.java Log: generalise DublinCore association, now it can be associated with any ContentItem (used to implement File attachment metadata) NOTE: data model upgrade 6.3.0 -> 6.3.1: removes ldn_dublin_core_item_map, DublinCore:Item is 0:1 Modified: trunk/ccm-ldn-dublin/application.xml =================================================================== --- trunk/ccm-ldn-dublin/application.xml 2006-04-10 10:15:35 UTC (rev 1108) +++ trunk/ccm-ldn-dublin/application.xml 2006-04-18 13:57:35 UTC (rev 1109) @@ -2,8 +2,8 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-ldn-dublin" prettyName="Dublin Core" - version="6.3.0" - release="3" + version="6.3.1" + release="1" webapp="ROOT"> <ccm:dependencies> <ccm:requires name="ccm-core" version="6.2.0" relation="ge"/> Modified: trunk/ccm-ldn-dublin/pdl/com/arsdigita/london/cms/dublin/DublinCoreItem.pdl =================================================================== --- trunk/ccm-ldn-dublin/pdl/com/arsdigita/london/cms/dublin/DublinCoreItem.pdl 2006-04-10 10:15:35 UTC (rev 1108) +++ trunk/ccm-ldn-dublin/pdl/com/arsdigita/london/cms/dublin/DublinCoreItem.pdl 2006-04-18 13:57:35 UTC (rev 1109) @@ -52,14 +52,10 @@ } association { - composite ContentPage[1..1] dcOwner = join ldn_dublin_core_items.dublin_id - to ldn_dublin_core_item_map.dublin_id, - join ldn_dublin_core_item_map.item_id - to cms_pages.item_id; - component DublinCoreItem[0..1] dublinCore = join cms_pages.item_id - to ldn_dublin_core_item_map.item_id, - join ldn_dublin_core_item_map.dublin_id - to ldn_dublin_core_items.dublin_id; + composite ContentItem[1..1] dcOwner = join ldn_dublin_core_items.item_id + to cms_items.item_id; + component DublinCoreItem[0..1] dublinCore = join cms_items.item_id + to ldn_dublin_core_items.item_id; } Added: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/default/upgrade-6.3.0-6.3.1.sql =================================================================== --- trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/default/upgrade-6.3.0-6.3.1.sql 2006-04-10 10:15:35 UTC (rev 1108) +++ trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/default/upgrade-6.3.0-6.3.1.sql 2006-04-18 13:57:35 UTC (rev 1109) @@ -0,0 +1,8 @@ +alter table ldn_dublin_core_items add + (item_id number constraint ldn_dub_cor_ite_ite_id_f_f7q6_ references cms_items(item_id)); +update ldn_dublin_core_items dc + set item_id + = (select dcm.item_id from LDN_DUBLIN_CORE_ITEM_MAP dcm where dcm.dublin_id=dc.dublin_id); + +-- drop table ldn_dublin_core_item_map; + Added: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/oracle-se-6.3.0-6.3.1.sql =================================================================== --- trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/oracle-se-6.3.0-6.3.1.sql 2006-04-10 10:15:35 UTC (rev 1108) +++ trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/oracle-se-6.3.0-6.3.1.sql 2006-04-18 13:57:35 UTC (rev 1109) @@ -0,0 +1 @@ +@@ ../default/upgrade-6.3.0-6.3.1.sql Added: trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/postgres-6.3.0-6.3.1.sql =================================================================== --- trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/postgres-6.3.0-6.3.1.sql 2006-04-10 10:15:35 UTC (rev 1108) +++ trunk/ccm-ldn-dublin/sql/ccm-ldn-dublin/upgrade/postgres-6.3.0-6.3.1.sql 2006-04-18 13:57:35 UTC (rev 1109) @@ -0,0 +1 @@ +\i ../default/upgrade-6.3.0-6.3.1.sql Modified: trunk/ccm-ldn-dublin/src/ccm-ldn-dublin.upgrade =================================================================== --- trunk/ccm-ldn-dublin/src/ccm-ldn-dublin.upgrade 2006-04-10 10:15:35 UTC (rev 1108) +++ trunk/ccm-ldn-dublin/src/ccm-ldn-dublin.upgrade 2006-04-18 13:57:35 UTC (rev 1109) @@ -2,4 +2,7 @@ <version from="1.4.2" to="1.4.3"> <script sql="ccm-ldn-dublin/upgrade/::database::-1.4.2-1.4.3.sql"/> </version> + <version from="6.3.0" to="6.3.1"> + <script sql="ccm-ldn-dublin/upgrade/::database::-6.3.0-6.3.1.sql"/> + </version> </upgrade> Modified: trunk/ccm-ldn-dublin/src/com/arsdigita/london/cms/dublin/DublinCoreItem.java =================================================================== --- trunk/ccm-ldn-dublin/src/com/arsdigita/london/cms/dublin/DublinCoreItem.java 2006-04-10 10:15:35 UTC (rev 1108) +++ trunk/ccm-ldn-dublin/src/com/arsdigita/london/cms/dublin/DublinCoreItem.java 2006-04-18 13:57:35 UTC (rev 1109) @@ -16,7 +16,6 @@ package com.arsdigita.london.cms.dublin; import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.ContentPage; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.OID; @@ -137,7 +136,7 @@ } - public static DublinCoreItem create(ContentPage owner) { + public static DublinCoreItem create(ContentItem owner) { DublinCoreItem item = new DublinCoreItem(); item.setOwner(owner); item.setName(owner.getName() + "-dublin-metadata"); @@ -145,7 +144,7 @@ } - public static DublinCoreItem findByOwner(ContentPage owner) { + public static DublinCoreItem findByOwner(ContentItem owner) { DataCollection items = SessionManager.getSession() .retrieve(BASE_DATA_OBJECT_TYPE); items.addEqualsFilter(DC_OWNER + "." + ACSObject.ID, @@ -159,14 +158,14 @@ return null; } - protected void setOwner(ContentPage owner) { + protected void setOwner(ContentItem owner) { setAssociation(DC_OWNER, owner); } - public ContentPage getOwner() { + public ContentItem getOwner() { DataObject dobj = (DataObject)get(DC_OWNER); Assert.exists(dobj, DataObject.class); - return (ContentPage)DomainObjectFactory.newInstance(dobj); + return (ContentItem)DomainObjectFactory.newInstance(dobj); } /* Audience */ Modified: trunk/ccm-ldn-dublin/src/com/arsdigita/london/cms/dublin/ui/DublinCoreForm.java =================================================================== --- trunk/ccm-ldn-dublin/src/com/arsdigita/london/cms/dublin/ui/DublinCoreForm.java 2006-04-10 10:15:35 UTC (rev 1108) +++ trunk/ccm-ldn-dublin/src/com/arsdigita/london/cms/dublin/ui/DublinCoreForm.java 2006-04-18 13:57:35 UTC (rev 1109) @@ -16,8 +16,10 @@ package com.arsdigita.london.cms.dublin.ui; import com.arsdigita.london.cms.dublin.DublinCoreItem; +import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentPage; import com.arsdigita.bebop.form.SingleSelect; +import com.arsdigita.bebop.FormSection; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.form.DateTime; @@ -49,353 +51,31 @@ public class DublinCoreForm extends Form { - private static final Logger s_log = Logger.getLogger(DublinCoreForm.class); + private static final Logger s_log = Logger.getLogger(DublinCoreFormSection.class); + + private ItemSelectionModel m_itemModel; - private Widget m_audience; - private Widget m_ccn_portal_instance; - //private TextField m_contributor; - private Widget m_coverageSpatial; - private TextField m_coveragePostcode; - private Widget m_coverageUnit; - private DateTime m_temporalBegin; - private DateTime m_temporalEnd; - private TextArea m_creatorOwner; - private TextField m_creatorContact; - private TextArea m_description; - //private TextField m_identifier; - //private TextField m_location; - //private TextField m_preservation; - private TextArea m_publisher; - //private TextField m_relation; - private TextArea m_rights; - //private TextField m_source; - private TextField m_coverageSpatialRef; - private TextField m_dateValid; - private TextField m_disposalReview; - private TextField m_keywords; + private DublinCoreFormSection m_section; - private SaveCancelSection m_buttons; - private ItemSelectionModel m_itemModel; - public DublinCoreForm(ItemSelectionModel itemModel) { super("dublin"); - m_itemModel = itemModel; - - m_audience = createControlledList( - "audience", - DublinCoreItem.getConfig().getAudienceDomain()); - m_coverageSpatial = createControlledList( - "coverageSpatial", - DublinCoreItem.getConfig().getCoverageSpatialDomain()); - m_coverageUnit = createControlledList( - "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( - new StringLengthValidationListener(20)); - m_coveragePostcode.setSize(10); - - m_coverageSpatialRef = new TextField( - new StringParameter("coverageSpatialRef")); - m_coverageSpatialRef.addValidationListener( - new StringLengthValidationListener(20)); - m_coverageSpatialRef.setSize(10); - - m_temporalBegin = new DateTime( - new DateTimeParameter("temporalBegin")); - m_temporalEnd = new DateTime( - new DateTimeParameter("temporalEnd")); - - m_dateValid = new TextField( - new StringParameter("dateValid")); - m_dateValid.addValidationListener( - new StringLengthValidationListener(100)); - - m_disposalReview = new TextField( - new StringParameter("disposalReview")); - m_disposalReview.addValidationListener( - new StringLengthValidationListener(100)); - - m_creatorOwner = new TextArea( - new StringParameter("creatorOwner")); - m_creatorOwner.addValidationListener( - new StringLengthValidationListener(300)); - m_creatorOwner.setCols(50); - m_creatorOwner.setRows(3); - - m_creatorContact = new TextField( - new StringParameter("creatorContact")); - m_creatorContact.addValidationListener( - new StringLengthValidationListener(120)); - m_creatorContact.setSize(50); - - m_description = new TextArea( - new StringParameter("description")); - m_description.addValidationListener( - new StringLengthValidationListener(4000)); - m_description.setCols(50); - m_description.setRows(10); - m_description.setReadOnly(); - - m_publisher = new TextArea( - new StringParameter("publisher")); - m_publisher.addValidationListener( - new StringLengthValidationListener(4000)); - m_publisher.setCols(50); - m_publisher.setRows(5); - - m_rights = new TextArea( - new StringParameter("rights")); - m_rights.addValidationListener( - new StringLengthValidationListener(4000)); - m_rights.setCols(50); - m_rights.setRows(10); - - m_keywords = new TextField( - new TrimmedStringParameter("keywords")); - m_keywords.addValidationListener( - new StringLengthValidationListener(4000)); - m_keywords.addValidationListener( - new KeywordsValidationListener()); - m_keywords.setHint("Enter a list of keywords, separated with commas"); - m_keywords.setSize(50); - - m_buttons = new SaveCancelSection(); - - add(new Label("Audience:", Label.BOLD), - ColumnPanel.RIGHT); - add(m_audience); - - add(new Label("Coverage:", Label.BOLD), - ColumnPanel.RIGHT); - add(m_coverageSpatial); - - add(new Label("Coverage (postcode):", Label.BOLD), - ColumnPanel.RIGHT); - add(m_coveragePostcode); - - add(new Label("Coverage (spatial reference number):", Label.BOLD), - ColumnPanel.RIGHT); - add(m_coverageSpatialRef); - - add(new Label("Coverage (unit):", Label.BOLD), - ColumnPanel.RIGHT); - add(m_coverageUnit); - - add(new Label("Coverage (temporal begin):", Label.BOLD), - ColumnPanel.RIGHT); - add(m_temporalBegin); - - add(new Label("Coverage (temporal end):", Label.BOLD), - ColumnPanel.RIGHT); - add(m_temporalEnd); - - add(new Label("Date (valid):", Label.BOLD), - ColumnPanel.RIGHT); - add(m_dateValid); - - add(new Label("Disposal Review", Label.BOLD), - ColumnPanel.RIGHT); - add(m_disposalReview); - - add(new Label("Creator (owner):", Label.BOLD), - ColumnPanel.RIGHT); - add(m_creatorOwner); - - add(new Label("Creator (contact):", Label.BOLD), - ColumnPanel.RIGHT); - add(m_creatorContact); - - add(new Label("Description:", Label.BOLD), - ColumnPanel.RIGHT); - add(m_description); - - add(new Label("Publisher:", Label.BOLD), - ColumnPanel.RIGHT); - add(m_publisher); - - add(new Label("Rights:", Label.BOLD), - ColumnPanel.RIGHT); - add(m_rights); - - add(new Label("Keywords:", Label.BOLD), - 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()); - addInitListener(new DublinInitListener()); - } - - public Submit getCancelButton() { - return m_buttons.getCancelButton(); - } - - public Submit getSaveButton() { - return m_buttons.getSaveButton(); - } - - protected Widget createControlledList(String name, - String key) { - if (s_log.isDebugEnabled()) { - s_log.debug("Creating controlled list with " + name + " key " + key); - } - Domain domain = null; - if (key != null) { - try { - domain = Domain.retrieve(key); - } catch (DataObjectNotFoundException ex) { - s_log.warn("Cannot find controlled list key " + key + - " for field " + name); - // nada + m_section = new DublinCoreFormSection(false) { + protected String getInitialDescription(ContentItem item) { + return ((ContentPage) item).getSearchSummary(); } - } - if (domain == null) { - TextField widget = new TextField(name); - widget.setSize(40); - return widget; - } else { - ControlledList widget = new ControlledList(name, - domain); - return widget; - } - } - - private class DublinInitListener implements FormInitListener { - public void init(FormSectionEvent fse) - throws FormProcessException { - - PageState state = fse.getPageState(); - ContentPage item = (ContentPage)m_itemModel.getSelectedObject(state); - m_description.setValue(state, item.getSearchSummary()); - - DublinCoreItem dcItem = DublinCoreItem.findByOwner(item); - if (dcItem == null) { - m_creatorOwner.setValue( - state, - DublinCoreItem.getConfig().getOwnerDefault()); - Party party = Kernel.getContext().getParty(); - m_creatorContact.setValue( - state, - getDefaultCreatorContact(party)); - m_publisher.setValue( - state, - DublinCoreItem.getConfig().getPublisherDefault()); - m_rights.setValue( - state, - DublinCoreItem.getConfig().getRightsDefault()); - return; + protected ContentItem getSelectedItem(PageState state) { + return m_itemModel.getSelectedItem(state); } - - m_audience.setValue(state, dcItem.getAudience()); - - m_coverageSpatial.setValue(state, dcItem.getCoverage()); - m_coveragePostcode.setValue(state, dcItem.getCoveragePostcode()); - m_coverageSpatialRef.setValue(state, dcItem.getCoverageSpatialRef()); - m_coverageUnit.setValue(state, dcItem.getCoverageUnit()); - - m_temporalBegin.setValue(state, dcItem.getTemporalBegin()); - m_temporalEnd.setValue(state, dcItem.getTemporalEnd()); - - m_dateValid.setValue(state, dcItem.getDateValid()); - m_disposalReview.setValue(state, dcItem.getDisposalReview()); - - m_creatorOwner.setValue(state, dcItem.getCreatorOwner() == null ? - DublinCoreItem.getConfig().getOwnerDefault() : - dcItem.getCreatorOwner()); - - Party party = Kernel.getContext().getParty(); - m_creatorContact.setValue(state, dcItem.getCreatorContact() == null ? - getDefaultCreatorContact(party) : - dcItem.getCreatorContact()); - - m_publisher.setValue(state, dcItem.getPublisher() == null ? - DublinCoreItem.getConfig().getPublisherDefault() : - dcItem.getPublisher()); - m_rights.setValue(state, dcItem.getRights() == null ? - DublinCoreItem.getConfig().getRightsDefault() : - dcItem.getRights()); - m_keywords.setValue(state, dcItem.getKeywords()); - - if (DublinCoreItem.getConfig().getUseCCNPortalMetadata()) { - m_ccn_portal_instance.setValue(state, dcItem.getCcnPortalInstance()); - } + }; + add(m_section, ColumnPanel.FULL_WIDTH); } - } - /** 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 { - - PageState state = fse.getPageState(); - ContentPage item = (ContentPage)m_itemModel.getSelectedObject(state); - DublinCoreItem dcItem = DublinCoreItem.findByOwner(item); - if (dcItem == null) { - dcItem = DublinCoreItem.create(item); - } - - dcItem.setAudience((String)m_audience.getValue(state)); - - dcItem.setCoverage((String)m_coverageSpatial.getValue(state)); - dcItem.setCoveragePostcode( - (String)m_coveragePostcode.getValue(state)); - dcItem.setCoverageSpatialRef( - (String)m_coverageSpatialRef.getValue(state)); - dcItem.setCoverageUnit((String)m_coverageUnit.getValue(state)); - - dcItem.setTemporalBegin((Date)m_temporalBegin.getValue(state)); - dcItem.setTemporalEnd((Date)m_temporalEnd.getValue(state)); - dcItem.setDateValid((String)m_dateValid.getValue(state)); - - dcItem.setDisposalReview((String)m_disposalReview.getValue(state)); - - dcItem.setCreatorOwner((String)m_creatorOwner.getValue(state)); - dcItem.setCreatorContact((String)m_creatorContact.getValue(state)); - - //dcItem.setDescription((String)m_description.getValue(state)); - dcItem.setPublisher((String)m_publisher.getValue(state)); - dcItem.setRights((String)m_rights.getValue(state)); - - dcItem.setKeywords((String)m_keywords.getValue(state)); - - if (DublinCoreItem.getConfig().getUseCCNPortalMetadata()) { - dcItem.setCcnPortalInstance((String)m_ccn_portal_instance.getValue(state)); - } - - dcItem.save(); - } + public Submit getCancelButton() { + return m_section.getCancelButton(); } + } Added: trunk/ccm-ldn-dublin/src/com/arsdigita/london/cms/dublin/ui/DublinCoreFormSection.java =================================================================== --- trunk/ccm-ldn-dublin/src/com/arsdigita/london/cms/dublin/ui/DublinCoreFormSection.java 2006-04-10 10:15:35 UTC (rev 1108) +++ trunk/ccm-ldn-dublin/src/com/arsdigita/london/cms/dublin/ui/DublinCoreFormSection.java 2006-04-18 13:57:35 UTC (rev 1109) @@ -0,0 +1,386 @@ +package com.arsdigita.london.cms.dublin.ui; + +import java.util.Date; + +import org.apache.log4j.Logger; + +import com.arsdigita.bebop.ColumnPanel; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.FormSection; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SaveCancelSection; +import com.arsdigita.bebop.event.FormInitListener; +import com.arsdigita.bebop.event.FormProcessListener; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.form.DateTime; +import com.arsdigita.bebop.form.Option; +import com.arsdigita.bebop.form.SingleSelect; +import com.arsdigita.bebop.form.Submit; +import com.arsdigita.bebop.form.TextArea; +import com.arsdigita.bebop.form.TextField; +import com.arsdigita.bebop.form.Widget; +import com.arsdigita.bebop.parameters.DateTimeParameter; +import com.arsdigita.bebop.parameters.StringLengthValidationListener; +import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.bebop.parameters.TrimmedStringParameter; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ContentPage; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.Party; +import com.arsdigita.london.cms.dublin.DublinCoreItem; +import com.arsdigita.london.terms.Domain; + +public abstract class DublinCoreFormSection extends FormSection + implements FormInitListener, FormProcessListener { + + private static final Logger s_log = Logger.getLogger(DublinCoreFormSection.class); + + private Widget m_audience; + + private Widget m_ccn_portal_instance; + + // private TextField m_contributor; + private Widget m_coverageSpatial; + + private TextField m_coveragePostcode; + + private Widget m_coverageUnit; + + private DateTime m_temporalBegin; + + private DateTime m_temporalEnd; + + private TextArea m_creatorOwner; + + private TextField m_creatorContact; + + private TextArea m_description; + + // private TextField m_identifier; + // private TextField m_location; + // private TextField m_preservation; + private TextArea m_publisher; + + // private TextField m_relation; + private TextArea m_rights; + + // private TextField m_source; + private TextField m_coverageSpatialRef; + + private TextField m_dateValid; + + private TextField m_disposalReview; + + private TextField m_keywords; + + private boolean editableDescription; + + private Submit m_cancel; + + + public DublinCoreFormSection(boolean editableDescription) { + this.editableDescription = editableDescription; + m_audience = createControlledList("audience", DublinCoreItem + .getConfig().getAudienceDomain()); + + m_coverageSpatial = createControlledList("coverageSpatial", + DublinCoreItem.getConfig().getCoverageSpatialDomain()); + m_coverageUnit = createControlledList("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(new StringLengthValidationListener(20)); + m_coveragePostcode.setSize(10); + + m_coverageSpatialRef = new TextField(new StringParameter( + "coverageSpatialRef")); + m_coverageSpatialRef + .addValidationListener(new StringLengthValidationListener(20)); + m_coverageSpatialRef.setSize(10); + + m_temporalBegin = new DateTime(new DateTimeParameter("temporalBegin")); + m_temporalEnd = new DateTime(new DateTimeParameter("temporalEnd")); + + m_dateValid = new TextField(new StringParameter("dateValid")); + m_dateValid.addValidationListener(new StringLengthValidationListener( + 100)); + + m_disposalReview = new TextField(new StringParameter("disposalReview")); + m_disposalReview + .addValidationListener(new StringLengthValidationListener(100)); + + m_creatorOwner = new TextArea(new StringParameter("creatorOwner")); + m_creatorOwner + .addValidationListener(new StringLengthValidationListener(300)); + m_creatorOwner.setCols(50); + m_creatorOwner.setRows(3); + + m_creatorContact = new TextField(new StringParameter("creatorContact")); + m_creatorContact + .addValidationListener(new StringLengthValidationListener(120)); + m_creatorContact.setSize(50); + + m_description = new TextArea(new StringParameter("description")); + if (editableDescription) { + m_description.addValidationListener(new StringLengthValidationListener( + 4000)); + m_description.setCols(50); + m_description.setRows(10); + + } else { + m_description.setReadOnly(); + } + + m_publisher = new TextArea(new StringParameter("publisher")); + m_publisher.addValidationListener(new StringLengthValidationListener( + 4000)); + m_publisher.setCols(50); + m_publisher.setRows(5); + + m_rights = new TextArea(new StringParameter("rights")); + m_rights + .addValidationListener(new StringLengthValidationListener(4000)); + m_rights.setCols(50); + m_rights.setRows(10); + + m_keywords = new TextField(new TrimmedStringParameter("keywords")); + m_keywords.addValidationListener(new StringLengthValidationListener( + 4000)); + m_keywords.addValidationListener(new KeywordsValidationListener()); + m_keywords.setHint("Enter a list of keywords, separated with commas"); + m_keywords.setSize(50); + + add(new Label("Audience:", Label.BOLD), ColumnPanel.RIGHT); + add(m_audience); + + add(new Label("Coverage:", Label.BOLD), ColumnPanel.RIGHT); + add(m_coverageSpatial); + + add(new Label("Coverage (postcode):", Label.BOLD), ColumnPanel.RIGHT); + add(m_coveragePostcode); + + add(new Label("Coverage (spatial reference number):", Label.BOLD), + ColumnPanel.RIGHT); + add(m_coverageSpatialRef); + + add(new Label("Coverage (unit):", Label.BOLD), ColumnPanel.RIGHT); + add(m_coverageUnit); + + add(new Label("Coverage (temporal begin):", Label.BOLD), + ColumnPanel.RIGHT); + add(m_temporalBegin); + + add(new Label("Coverage (temporal end):", Label.BOLD), + ColumnPanel.RIGHT); + add(m_temporalEnd); + + add(new Label("Date (valid):", Label.BOLD), ColumnPanel.RIGHT); + add(m_dateValid); + + add(new Label("Disposal Review", Label.BOLD), ColumnPanel.RIGHT); + add(m_disposalReview); + + add(new Label("Creator (owner):", Label.BOLD), ColumnPanel.RIGHT); + add(m_creatorOwner); + + add(new Label("Creator (contact):", Label.BOLD), ColumnPanel.RIGHT); + add(m_creatorContact); + + add(new Label("Description:", Label.BOLD), ColumnPanel.RIGHT); + add(m_description); + + add(new Label("Publisher:", Label.BOLD), ColumnPanel.RIGHT); + add(m_publisher); + + add(new Label("Rights:", Label.BOLD), ColumnPanel.RIGHT); + add(m_rights); + + add(new Label("Keywords:", Label.BOLD), 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); + } + + SaveCancelSection saveCancel = new SaveCancelSection(); + m_cancel = saveCancel.getCancelButton(); + add(saveCancel, ColumnPanel.FULL_WIDTH); + + addInitListener(this); + addProcessListener(this); + } + + public Submit getCancelButton() { + return m_cancel; + } + + protected Widget createControlledList(String name, String key) { + if (s_log.isDebugEnabled()) { + s_log + .debug("Creating controlled list with " + name + " key " + + key); + } + Domain domain = null; + if (key != null) { + try { + domain = Domain.retrieve(key); + } catch (DataObjectNotFoundException ex) { + s_log.warn("Cannot find controlled list key " + key + + " for field " + name); + // nada + } + } + + if (domain == null) { + TextField widget = new TextField(name); + widget.setSize(40); + return widget; + } else { + ControlledList widget = new ControlledList(name, domain); + return widget; + } + } + + /** + * 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(); + } + } + + public void init(FormSectionEvent fse) throws FormProcessException { + + PageState state = fse.getPageState(); + ContentItem item = getSelectedItem(state); + if (item == null) { + return; + } + DublinCoreItem dcItem = DublinCoreItem.findByOwner(item); + if (dcItem == null) { + m_creatorOwner.setValue(state, DublinCoreItem.getConfig() + .getOwnerDefault()); + Party party = Kernel.getContext().getParty(); + m_creatorContact.setValue(state, getDefaultCreatorContact(party)); + m_publisher.setValue(state, DublinCoreItem.getConfig() + .getPublisherDefault()); + m_rights.setValue(state, DublinCoreItem.getConfig() + .getRightsDefault()); + m_description.setValue(state, getInitialDescription(item)); + return; + } + + m_audience.setValue(state, dcItem.getAudience()); + + m_coverageSpatial.setValue(state, dcItem.getCoverage()); + m_coveragePostcode.setValue(state, dcItem.getCoveragePostcode()); + m_coverageSpatialRef.setValue(state, dcItem.getCoverageSpatialRef()); + m_coverageUnit.setValue(state, dcItem.getCoverageUnit()); + + m_temporalBegin.setValue(state, dcItem.getTemporalBegin()); + m_temporalEnd.setValue(state, dcItem.getTemporalEnd()); + + m_dateValid.setValue(state, dcItem.getDateValid()); + m_disposalReview.setValue(state, dcItem.getDisposalReview()); + + m_creatorOwner.setValue(state, + dcItem.getCreatorOwner() == null ? DublinCoreItem.getConfig() + .getOwnerDefault() : dcItem.getCreatorOwner()); + + Party party = Kernel.getContext().getParty(); + m_creatorContact + .setValue( + state, + dcItem.getCreatorContact() == null ? getDefaultCreatorContact(party) + : dcItem.getCreatorContact()); + + m_publisher.setValue(state, + dcItem.getPublisher() == null ? DublinCoreItem.getConfig() + .getPublisherDefault() : dcItem.getPublisher()); + m_rights.setValue(state, dcItem.getRights() == null ? DublinCoreItem + .getConfig().getRightsDefault() : dcItem.getRights()); + m_keywords.setValue(state, dcItem.getKeywords()); + if (editableDescription) { + m_description.setValue(state, dcItem.getDescription()); + } else { + m_description.setValue(state, getInitialDescription(item)); + } + if (DublinCoreItem.getConfig().getUseCCNPortalMetadata()) { + m_ccn_portal_instance + .setValue(state, dcItem.getCcnPortalInstance()); + } + } + + public void process(FormSectionEvent fse) throws FormProcessException { + + PageState state = fse.getPageState(); + ContentItem item = getSelectedItem(state); + if (item == null) { + return; + } + DublinCoreItem dcItem = DublinCoreItem.findByOwner(item); + if (dcItem == null) { + dcItem = DublinCoreItem.create(item); + } + + dcItem.setAudience((String) m_audience.getValue(state)); + + dcItem.setCoverage((String) m_coverageSpatial.getValue(state)); + dcItem.setCoveragePostcode((String) m_coveragePostcode.getValue(state)); + dcItem.setCoverageSpatialRef((String) m_coverageSpatialRef + .getValue(state)); + dcItem.setCoverageUnit((String) m_coverageUnit.getValue(state)); + + dcItem.setTemporalBegin((Date) m_temporalBegin.getValue(state)); + dcItem.setTemporalEnd((Date) m_temporalEnd.getValue(state)); + dcItem.setDateValid((String) m_dateValid.getValue(state)); + + dcItem.setDisposalReview((String) m_disposalReview.getValue(state)); + + dcItem.setCreatorOwner((String) m_creatorOwner.getValue(state)); + dcItem.setCreatorContact((String) m_creatorContact.getValue(state)); + + dcItem.setPublisher((String) m_publisher.getValue(state)); + dcItem.setRights((String) m_rights.getValue(state)); + + dcItem.setKeywords((String) m_keywords.getValue(state)); + if (editableDescription) { + saveDescription((String) m_description.getValue(state), item, dcItem); + } + + if (DublinCoreItem.getConfig().getUseCCNPortalMetadata()) { + dcItem.setCcnPortalInstance((String) m_ccn_portal_instance + .getValue(state)); + } + dcItem.save(); + } + + protected abstract ContentItem getSelectedItem(PageState state); + + protected String getInitialDescription(ContentItem item) { + return ""; + } + + protected void saveDescription(String description, ContentItem item, DublinCoreItem dcItem ) { + dcItem.setDescription(description); + } + +} |
From: <ssk...@vh...> - 2006-04-10 10:17:37
|
Author: sskracic Date: 2006-04-10 12:15:35 +0200 (Mon, 10 Apr 2006) New Revision: 1108 Modified: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZSiteProxyGenerator.java Log: JDK 1.5 (or is it Java 5?) compile fix. Modified: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZSiteProxyGenerator.java =================================================================== --- trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZSiteProxyGenerator.java 2006-03-29 14:40:02 UTC (rev 1107) +++ trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZSiteProxyGenerator.java 2006-04-10 10:15:35 UTC (rev 1108) @@ -157,7 +157,7 @@ AtoZCategoriesCompoundEntry compoundEntry = null; while (entries.next()) { /* on category change add previous compoundEntry and create new one */ - if (previousCatId.compareTo(entries.get("categoryId")) != 0) { + if (previousCatId.compareTo( (BigDecimal) entries.get("categoryId")) != 0) { if ((compoundEntry != null) && (compoundEntry.entries.size() > 0)) list.add(compoundEntry); |
From: <ap...@vh...> - 2006-03-29 14:41:35
|
Author: apevec Date: 2006-03-29 16:40:02 +0200 (Wed, 29 Mar 2006) New Revision: 1107 Modified: trunk/ccm-cms/src/com/arsdigita/cms/workflow/CMSTask.java Log: use history instead of audit trail to find the author which should get the workflow notification Modified: trunk/ccm-cms/src/com/arsdigita/cms/workflow/CMSTask.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/workflow/CMSTask.java 2006-03-28 17:16:20 UTC (rev 1106) +++ trunk/ccm-cms/src/com/arsdigita/cms/workflow/CMSTask.java 2006-03-29 14:40:02 UTC (rev 1107) @@ -43,6 +43,10 @@ import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.metadata.ObjectType; import com.arsdigita.util.Assert; +import com.arsdigita.versioning.TagCollection; +import com.arsdigita.versioning.Transaction; +import com.arsdigita.versioning.TransactionCollection; +import com.arsdigita.versioning.Versions; import com.arsdigita.web.URL; import com.arsdigita.workflow.simple.TaskComment; import com.arsdigita.workflow.simple.TaskException; @@ -459,7 +463,24 @@ protected void sendMessageToAssignees(Message msg) { if (m_authorOnly) { ContentItem item = getItem(); - User author = item.getLastModifiedUser(); + User author = null; + // XXX lastModifiedUser in audit trail is overwritten on each save + // author = item.getLastModifiedUser(); + // workaround: use the latest history record with 'Authored' tag + TransactionCollection hist = Versions.getTaggedTransactions(item.getOID()); + while (author == null && hist.next()) { + Transaction txn = hist.getTransaction(); + TagCollection tags = txn.getTags(); + while (tags.next()) { + String tag = tags.getTag().getDescription(); + if ("Authored".equals(tag)) { + author = txn.getUser(); + if (s_log.isDebugEnabled()) { + s_log.debug("author from hist="+author+" at "+txn.getTimestamp()); + } + } + } + } if (author == null) { // fallback: creator is always available in audit trail author = item.getCreationUser(); |
From: <ss...@vh...> - 2006-03-28 17:17:50
|
Author: sshinde Date: 2006-03-28 19:16:20 +0200 (Tue, 28 Mar 2006) New Revision: 1106 Modified: trunk/tools/tools/lib/CCM/Runtime.pm Log: Make it work on Fedora Core 5. For that matter it is a generic change and by default now looks for servlet.jar file under /usr/share/java/ Modified: trunk/tools/tools/lib/CCM/Runtime.pm =================================================================== --- trunk/tools/tools/lib/CCM/Runtime.pm 2006-03-28 16:31:43 UTC (rev 1105) +++ trunk/tools/tools/lib/CCM/Runtime.pm 2006-03-28 17:16:20 UTC (rev 1106) @@ -195,7 +195,8 @@ $ROOT = defined $ENV{'CCM_ZIP_ROOT'} ? $ENV{'CCM_ZIP_ROOT'} : "c:\\ccm\\"; } if ($version eq "2.3") { - foreach (File::Spec->catfile(${ROOT}, "usr", "share", "java", "servlet-2.3.jar"), + foreach (File::Spec->catfile(${ROOT}, "usr", "share", "java", "servlet.jar"), + File::Spec->catfile(${ROOT}, "usr", "share", "java", "servlet-2.3.jar"), File::Spec->catfile(${ROOT}, "usr", "share", "java", "servletapi4.jar"), File::Spec->catfile(${ROOT}, "usr", "share", "java", "servletapi4-4.0.4.jar")) { if (-f $_ || -l $_) { |
From: <ss...@vh...> - 2006-03-28 16:33:13
|
Author: sshinde Date: 2006-03-28 18:31:43 +0200 (Tue, 28 Mar 2006) New Revision: 1105 Modified: trunk/ccm-core/src/com/arsdigita/dispatcher/MultipartHttpServletRequest.java trunk/ccm-core/src/com/arsdigita/web/ServletRequestWrapper.java Log: Make these classes compatible with new servlet api which comes on Fedora Core 5.Harmless changes otherwise. Modified: trunk/ccm-core/src/com/arsdigita/dispatcher/MultipartHttpServletRequest.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/dispatcher/MultipartHttpServletRequest.java 2006-03-27 23:08:36 UTC (rev 1104) +++ trunk/ccm-core/src/com/arsdigita/dispatcher/MultipartHttpServletRequest.java 2006-03-28 16:31:43 UTC (rev 1105) @@ -508,4 +508,24 @@ } } + public String getLocalAddr() { + // TODO Auto-generated method stub + return null; + } + + public String getLocalName() { + // TODO Auto-generated method stub + return null; + } + + public int getLocalPort() { + // TODO Auto-generated method stub + return 0; + } + + public int getRemotePort() { + // TODO Auto-generated method stub + return 0; + } + } Modified: trunk/ccm-core/src/com/arsdigita/web/ServletRequestWrapper.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/web/ServletRequestWrapper.java 2006-03-27 23:08:36 UTC (rev 1104) +++ trunk/ccm-core/src/com/arsdigita/web/ServletRequestWrapper.java 2006-03-28 16:31:43 UTC (rev 1105) @@ -137,4 +137,24 @@ throw new UnsupportedOperationException ("This is a Servlet 2.3 feature that we do not currently support"); } + + public String getLocalAddr() { + // TODO Auto-generated method stub + return null; + } + + public String getLocalName() { + // TODO Auto-generated method stub + return null; + } + + public int getLocalPort() { + // TODO Auto-generated method stub + return 0; + } + + public int getRemotePort() { + // TODO Auto-generated method stub + return 0; + } } |
From: <ap...@vh...> - 2006-03-27 23:10:07
|
Author: apevec Date: 2006-03-28 01:08:36 +0200 (Tue, 28 Mar 2006) New Revision: 1104 Modified: trunk/ccm-core/src/com/arsdigita/kernel/security/Initializer.java Log: remove obsolete and wrong checks for jaas.jar since JDK 1.4 is now required for some time already Modified: trunk/ccm-core/src/com/arsdigita/kernel/security/Initializer.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/kernel/security/Initializer.java 2006-03-24 18:41:09 UTC (rev 1103) +++ trunk/ccm-core/src/com/arsdigita/kernel/security/Initializer.java 2006-03-27 23:08:36 UTC (rev 1104) @@ -347,36 +347,12 @@ } private void loadLoginConfig() throws InitializationException { - checkLibrary(); - javax.security.auth.login.Configuration.setConfiguration (getLoginConfig()); checkLoginConfig(); } - private void checkLibrary() throws InitializationException { - // check that JAAS is available - // TODO: this check should not be needed in JDK 1.4, since JAAS will - // be integrated into the JDK. Also, JAAS classes will no longer be - // required to be loaded by the system classloader as in JDK 1.3. - // We should also be able to use JAAS's LoginContext instead of our - // own version of LoginContext. - try { - ClassLoader.getSystemClassLoader().loadClass - ("javax.security.auth.Subject"); - ClassLoader.getSystemClassLoader().loadClass - ("javax.security.auth.login.Configuration"); - ClassLoader.getSystemClassLoader().loadClass - ("com.sun.security.auth.login.ConfigFile"); - s_log.info("Security Initializer: JAAS lib found"); - } catch (ClassNotFoundException e) { - reportMissingLibrary - ("Java Authentication and Authorization Service (JAAS)", - "jaas.jar"); - } - } - private javax.security.auth.login.Configuration getLoginConfig() throws InitializationException { SecurityConfig conf = Kernel.getSecurityConfig(); @@ -403,23 +379,6 @@ } } - /** - * Report a missing library during initialization. Package-visible. - * - * @throws InitializationException with a detail message describing how - * to install the named library. - **/ - static void reportMissingLibrary(String libraryName, - String libraryJar) - throws InitializationException { - throw new InitializationException - ("Could not find the "+libraryName+". " - +"This library ("+libraryJar+") " - +"must be on your CLASSPATH or " - +"in your extensions directory " - +"($JAVA_HOME/jre/lib/ext/)."); - } - public void shutdown() throws InitializationException { // do nothing } |
From: <ssk...@vh...> - 2006-03-24 18:42:39
|
Author: sskracic Date: 2006-03-24 19:41:09 +0100 (Fri, 24 Mar 2006) New Revision: 1103 Modified: trunk/tools/misc/build-all.sh Log: coreutils in FC5 seem to be more rigid in parsing the command line arguments. Modified: trunk/tools/misc/build-all.sh =================================================================== --- trunk/tools/misc/build-all.sh 2006-03-16 13:29:08 UTC (rev 1102) +++ trunk/tools/misc/build-all.sh 2006-03-24 18:41:09 UTC (rev 1103) @@ -148,7 +148,7 @@ case $app_relation in eq) match=$(echo "$output" | grep -F -x "$app_version") ;; le|lt) match=$(echo "$sortedoutput" | grep -B1 -F -x "$app_tagged_version" | head --lines=-1) ;; - ge|gt) match=$(echo "$sortedoutput" | grep -A1 -F -x "$app_tagged_version" | tail +2) ;; + ge|gt) match=$(echo "$sortedoutput" | grep -A1 -F -x "$app_tagged_version" | tail --lines=+2) ;; esac if [ "$(echo "$match" | sed 's/ //g')" = "" ] |
From: <ap...@vh...> - 2006-03-16 13:30:12
|
Author: apevec Date: 2006-03-16 14:29:08 +0100 (Thu, 16 Mar 2006) New Revision: 1102 Modified: trunk/tools/tools/etc/init.d/ccm Log: Change to CCM_HOME otherwise permission error occurs when starting/stopping from a directory unaccessible by the 'servlet' user Modified: trunk/tools/tools/etc/init.d/ccm =================================================================== --- trunk/tools/tools/etc/init.d/ccm 2006-03-10 16:58:59 UTC (rev 1101) +++ trunk/tools/tools/etc/init.d/ccm 2006-03-16 13:29:08 UTC (rev 1102) @@ -24,6 +24,8 @@ start() { echo -n $"Starting $prog: " + cd $CCM_HOME + if [ -x /etc/rc.d/init.d/functions ]; then daemon $LAUNCH_SCRIPT start else @@ -41,6 +43,8 @@ stop() { echo -n $"Stopping $prog: " + cd $CCM_HOME + if [ -x /etc/rc.d/init.d/functions ]; then daemon $LAUNCH_SCRIPT stop else |
From: <ssk...@vh...> - 2006-03-10 16:59:47
|
Author: sskracic Date: 2006-03-10 17:58:59 +0100 (Fri, 10 Mar 2006) New Revision: 1101 Modified: users/sskracic/bin/make-build-release-area.sh Log: Allow RELEASE to be specified outside of the script. Modified: users/sskracic/bin/make-build-release-area.sh =================================================================== --- users/sskracic/bin/make-build-release-area.sh 2006-03-03 14:23:41 UTC (rev 1100) +++ users/sskracic/bin/make-build-release-area.sh 2006-03-10 16:58:59 UTC (rev 1101) @@ -4,7 +4,7 @@ set -e -RELEASE=1.0.3 +RELEASE=${RELEASE:-1.0.3} DIRLIST=$(cd ~/svn/releases/$RELEASE ; echo ccm*) for dir in $DIRLIST |
From: <ap...@vh...> - 2006-03-03 14:24:16
|
Author: apevec Date: 2006-03-03 15:23:41 +0100 (Fri, 03 Mar 2006) New Revision: 1100 Modified: trunk/ccm-core/src/com/arsdigita/domain/DomainObjectXMLRenderer.java Log: +1 at the correct place Modified: trunk/ccm-core/src/com/arsdigita/domain/DomainObjectXMLRenderer.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/domain/DomainObjectXMLRenderer.java 2006-02-28 12:08:54 UTC (rev 1099) +++ trunk/ccm-core/src/com/arsdigita/domain/DomainObjectXMLRenderer.java 2006-03-03 14:23:41 UTC (rev 1100) @@ -347,7 +347,7 @@ Calendar calDate = Calendar.getInstance(); calDate.setTime(date); element.addAttribute("year", Integer.toString(calDate.get(Calendar.YEAR))); - element.addAttribute("month", Integer.toString(calDate.get(1+Calendar.MONTH))); + element.addAttribute("month", Integer.toString(calDate.get(Calendar.MONTH)+1)); element.addAttribute("day", Integer.toString(calDate.get(Calendar.DAY_OF_MONTH))); element.addAttribute("hour", Integer.toString(calDate.get(Calendar.HOUR_OF_DAY))); element.addAttribute("minute", Integer.toString(calDate.get(Calendar.MINUTE))); |
From: <ap...@vh...> - 2006-02-28 12:09:15
|
Author: apevec Date: 2006-02-28 13:08:54 +0100 (Tue, 28 Feb 2006) New Revision: 1099 Modified: trunk/ccm-core/src/com/arsdigita/domain/DomainObjectXMLRenderer.java Log: Experimental: locale-independent Date output adds Date elements year, month, day, hour, minute and second as attributes of the date XML element This is backward compatible with existing XSL templates, new attributes are ignored and human-readable XML text is still there. Of course, styling needs to be modified to take advantage of new attributes. Modified: trunk/ccm-core/src/com/arsdigita/domain/DomainObjectXMLRenderer.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/domain/DomainObjectXMLRenderer.java 2006-02-28 12:00:22 UTC (rev 1098) +++ trunk/ccm-core/src/com/arsdigita/domain/DomainObjectXMLRenderer.java 2006-02-28 12:08:54 UTC (rev 1099) @@ -22,6 +22,9 @@ import com.arsdigita.persistence.metadata.ObjectType; import com.arsdigita.persistence.metadata.MetadataRoot; import com.arsdigita.xml.Element; + +import java.util.Calendar; +import java.util.Date; import java.util.HashMap; import java.util.Map; import com.arsdigita.xml.XML; @@ -338,6 +341,18 @@ if (m_wrapAttributes) { Element element = newElement(m_element, name); element.setText(format(obj, path, property, value)); + // locale-independent date output + if (value instanceof Date) { + Date date = (Date) value; + Calendar calDate = Calendar.getInstance(); + calDate.setTime(date); + element.addAttribute("year", Integer.toString(calDate.get(Calendar.YEAR))); + element.addAttribute("month", Integer.toString(calDate.get(1+Calendar.MONTH))); + element.addAttribute("day", Integer.toString(calDate.get(Calendar.DAY_OF_MONTH))); + element.addAttribute("hour", Integer.toString(calDate.get(Calendar.HOUR_OF_DAY))); + element.addAttribute("minute", Integer.toString(calDate.get(Calendar.MINUTE))); + element.addAttribute("second", Integer.toString(calDate.get(Calendar.SECOND))); + } } else { m_element.addAttribute(property.getName(), format(obj, path, property, value)); |
From: <ap...@vh...> - 2006-02-28 12:00:41
|
Author: apevec Date: 2006-02-28 13:00:22 +0100 (Tue, 28 Feb 2006) New Revision: 1098 Modified: trunk/ccm-cms/src/WEB-INF/resources/cms-item-adapters.xml Log: remove experimental application on FullDateFormatter in auditing info output Modified: trunk/ccm-cms/src/WEB-INF/resources/cms-item-adapters.xml =================================================================== --- trunk/ccm-cms/src/WEB-INF/resources/cms-item-adapters.xml 2006-02-27 14:48:13 UTC (rev 1097) +++ trunk/ccm-cms/src/WEB-INF/resources/cms-item-adapters.xml 2006-02-28 12:00:22 UTC (rev 1098) @@ -38,10 +38,6 @@ <xrd:associations rule="include"> <xrd:property name="/object/auditing"/> </xrd:associations> - <xrd:formatter property="/object/auditing/creationDate" - class="com.arsdigita.xml.formatters.FullDateFormatter"/> - <xrd:formatter property="/object/auditing/lastModifiedDate" - class="com.arsdigita.xml.formatters.FullDateFormatter"/> </xrd:adapter> <!-- Adds a text asset --> |
From: <ap...@vh...> - 2006-02-27 14:48:32
|
Author: apevec Date: 2006-02-27 15:48:13 +0100 (Mon, 27 Feb 2006) New Revision: 1097 Modified: trunk/ccm-ldn-theme/web/__ccm__/apps/theme/xsl/index.xsl Log: add remove confirmation Modified: trunk/ccm-ldn-theme/web/__ccm__/apps/theme/xsl/index.xsl =================================================================== --- trunk/ccm-ldn-theme/web/__ccm__/apps/theme/xsl/index.xsl 2006-02-24 17:59:15 UTC (rev 1096) +++ trunk/ccm-ldn-theme/web/__ccm__/apps/theme/xsl/index.xsl 2006-02-27 14:48:13 UTC (rev 1097) @@ -56,6 +56,7 @@ <xsl:attribute name="href"> <xsl:value-of select="@removeURL"/> </xsl:attribute> + <xsl:attribute name="onclick">return confirm('Are you sure?')</xsl:attribute> Remove </a> </xsl:if> |
From: <ssk...@vh...> - 2006-02-24 17:59:35
|
Author: sskracic Date: 2006-02-24 18:59:15 +0100 (Fri, 24 Feb 2006) New Revision: 1096 Modified: trunk/ccm-ldn-theme/application.xml trunk/ccm-ldn-theme/src/com/arsdigita/london/theme/util/ThemeFileUtil.java Log: In empty directory, listfiles() will return null instead of empty list. Modified: trunk/ccm-ldn-theme/application.xml =================================================================== --- trunk/ccm-ldn-theme/application.xml 2006-02-24 14:17:45 UTC (rev 1095) +++ trunk/ccm-ldn-theme/application.xml 2006-02-24 17:59:15 UTC (rev 1096) @@ -3,7 +3,7 @@ name="ccm-ldn-theme" prettyName="Theme" version="6.3.1" - release="2"> + release="3"> <ccm:dependencies> <ccm:requires name="ccm-core" version="6.2.0" relation="ge"/> <ccm:requires name="ccm-ldn-subsite" version="6.2.0" relation="ge"/> Modified: trunk/ccm-ldn-theme/src/com/arsdigita/london/theme/util/ThemeFileUtil.java =================================================================== --- trunk/ccm-ldn-theme/src/com/arsdigita/london/theme/util/ThemeFileUtil.java 2006-02-24 14:17:45 UTC (rev 1095) +++ trunk/ccm-ldn-theme/src/com/arsdigita/london/theme/util/ThemeFileUtil.java 2006-02-24 17:59:15 UTC (rev 1096) @@ -119,10 +119,12 @@ String fileType) { if (currentFile.isDirectory()) { File[] files = currentFile.listFiles(new WhiteListFilenameFilter()); - for (int i = 0; i < files.length; i++) { - updateDatabaseFiles(files[i], currentTheme, - serverSpecificPath, themeFiles, - overwriteNewerFiles, fileType); + if (files != null) { + for (int i = 0; i < files.length; i++) { + updateDatabaseFiles(files[i], currentTheme, + serverSpecificPath, themeFiles, + overwriteNewerFiles, fileType); + } } } else { if (currentFile.exists()) { |
From: <ssk...@vh...> - 2006-02-24 14:23:27
|
Author: sskracic Date: 2006-02-24 15:17:45 +0100 (Fri, 24 Feb 2006) New Revision: 1095 Modified: trunk/ccm-ldn-theme/application.xml trunk/ccm-ldn-theme/src/com/arsdigita/london/theme/util/ThemeFileManager.java Log: A workaround to the problem where some JDBC drivers are throwing an Error where an Excetion should actually have been thrown. Background thread must not die, it must re-try over and over again. Modified: trunk/ccm-ldn-theme/application.xml =================================================================== --- trunk/ccm-ldn-theme/application.xml 2006-02-24 08:52:48 UTC (rev 1094) +++ trunk/ccm-ldn-theme/application.xml 2006-02-24 14:17:45 UTC (rev 1095) @@ -3,7 +3,7 @@ name="ccm-ldn-theme" prettyName="Theme" version="6.3.1" - release="1"> + release="2"> <ccm:dependencies> <ccm:requires name="ccm-core" version="6.2.0" relation="ge"/> <ccm:requires name="ccm-ldn-subsite" version="6.2.0" relation="ge"/> Modified: trunk/ccm-ldn-theme/src/com/arsdigita/london/theme/util/ThemeFileManager.java =================================================================== --- trunk/ccm-ldn-theme/src/com/arsdigita/london/theme/util/ThemeFileManager.java 2006-02-24 08:52:48 UTC (rev 1094) +++ trunk/ccm-ldn-theme/src/com/arsdigita/london/theme/util/ThemeFileManager.java 2006-02-24 14:17:45 UTC (rev 1095) @@ -143,7 +143,7 @@ } m_lastRunDate = lastRunDate; - } catch (Exception e) { + } catch (Throwable e) { m_log.warn("Ignoring uncaught exception", e); } finally { if ( txn.inTxn() ) { |
From: <ap...@vh...> - 2006-02-24 08:58:20
|
Author: apevec Date: 2006-02-24 09:52:48 +0100 (Fri, 24 Feb 2006) New Revision: 1094 Modified: trunk/tools/bundle/TEMPLATE/rollingbuild.sh Log: missing backquotes Modified: trunk/tools/bundle/TEMPLATE/rollingbuild.sh =================================================================== --- trunk/tools/bundle/TEMPLATE/rollingbuild.sh 2006-02-20 14:08:01 UTC (rev 1093) +++ trunk/tools/bundle/TEMPLATE/rollingbuild.sh 2006-02-24 08:52:48 UTC (rev 1094) @@ -1,14 +1,14 @@ #!/bin/sh # -TEMPLATE=dirname $0 - # Exit immediately if command fails set -e # Print command executed to stdout set -v +TEMPLATE=`dirname $0` + # Bundle specific values (must be executed in Bundle directory) . ./bundle.in |
From: <ap...@vh...> - 2006-02-20 14:13:26
|
Author: apevec Date: 2006-02-20 15:08:01 +0100 (Mon, 20 Feb 2006) New Revision: 1093 Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/item/Summary.java Log: no need for context=live in stable links, redirect to live is default action Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/item/Summary.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/item/Summary.java 2006-02-19 22:56:38 UTC (rev 1092) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/item/Summary.java 2006-02-20 14:08:01 UTC (rev 1093) @@ -165,7 +165,7 @@ // URL Element linkElement = new Element("cms:linkSummary",CMS.CMS_XML_NS); - linkElement.addAttribute("url","/redirect?oid=" + URLEncoder.encode(item.getDraftVersion().getOID().toString()) + "&context=" + ContentItem.LIVE); + linkElement.addAttribute("url","/redirect?oid=" + URLEncoder.encode(item.getDraftVersion().getOID().toString())); // WORKFLOW Element workflowElement = new Element("cms:workflowSummary",CMS.CMS_XML_NS); |