From: <ap...@vh...> - 2006-05-03 21:31:45
|
Author: apevec Date: 2006-05-03 23:28:34 +0200 (Wed, 03 May 2006) New Revision: 1133 Added: contrib/ccm-ldn-camden-eforms/trunk/sql/ccm-ldn-camden-eforms/upgrade/ contrib/ccm-ldn-camden-eforms/trunk/sql/ccm-ldn-camden-eforms/upgrade/oracle-se-1.0.0-1.0.1.sql contrib/ccm-ldn-camden-eforms/trunk/sql/ccm-ldn-camden-eforms/upgrade/postgres-1.0.0-1.0.1.sql contrib/ccm-ldn-camden-eforms/trunk/src/ccm-ldn-camden-eforms.upgrade Modified: contrib/ccm-ldn-camden-eforms/trunk/application.xml contrib/ccm-ldn-camden-eforms/trunk/pdl/com/arsdigita/camden/cms/contenttypes/EForm.pdl contrib/ccm-ldn-camden-eforms/trunk/src/com/arsdigita/camden/cms/contenttypes/EForm.java contrib/ccm-ldn-camden-eforms/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/EFormPropertiesStep.java contrib/ccm-ldn-camden-eforms/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/EFormPropertyForm.java Log: add description for EForm aka URLredirect content type Modified: contrib/ccm-ldn-camden-eforms/trunk/application.xml =================================================================== --- contrib/ccm-ldn-camden-eforms/trunk/application.xml 2006-05-03 21:00:00 UTC (rev 1132) +++ contrib/ccm-ldn-camden-eforms/trunk/application.xml 2006-05-03 21:28:34 UTC (rev 1133) @@ -2,7 +2,7 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-ldn-camden-eforms" prettyName="Camden eForms Content Type" - version="1.0.0" + version="1.0.1" release="1" webapp="ROOT"> <ccm:dependencies> Modified: contrib/ccm-ldn-camden-eforms/trunk/pdl/com/arsdigita/camden/cms/contenttypes/EForm.pdl =================================================================== --- contrib/ccm-ldn-camden-eforms/trunk/pdl/com/arsdigita/camden/cms/contenttypes/EForm.pdl 2006-05-03 21:00:00 UTC (rev 1132) +++ contrib/ccm-ldn-camden-eforms/trunk/pdl/com/arsdigita/camden/cms/contenttypes/EForm.pdl 2006-05-03 21:28:34 UTC (rev 1133) @@ -22,7 +22,7 @@ object type EForm extends ContentPage { String [0..1] url = ct_eform.url VARCHAR(2000); + String [0..1] description = ct_eform.description; reference key (ct_eform.form_id); } - Added: contrib/ccm-ldn-camden-eforms/trunk/sql/ccm-ldn-camden-eforms/upgrade/oracle-se-1.0.0-1.0.1.sql =================================================================== --- contrib/ccm-ldn-camden-eforms/trunk/sql/ccm-ldn-camden-eforms/upgrade/oracle-se-1.0.0-1.0.1.sql 2006-05-03 21:00:00 UTC (rev 1132) +++ contrib/ccm-ldn-camden-eforms/trunk/sql/ccm-ldn-camden-eforms/upgrade/oracle-se-1.0.0-1.0.1.sql 2006-05-03 21:28:34 UTC (rev 1133) @@ -0,0 +1 @@ +alter table ct_eform add (description VARCHAR2(4000)); Added: contrib/ccm-ldn-camden-eforms/trunk/sql/ccm-ldn-camden-eforms/upgrade/postgres-1.0.0-1.0.1.sql =================================================================== --- contrib/ccm-ldn-camden-eforms/trunk/sql/ccm-ldn-camden-eforms/upgrade/postgres-1.0.0-1.0.1.sql 2006-05-03 21:00:00 UTC (rev 1132) +++ contrib/ccm-ldn-camden-eforms/trunk/sql/ccm-ldn-camden-eforms/upgrade/postgres-1.0.0-1.0.1.sql 2006-05-03 21:28:34 UTC (rev 1133) @@ -0,0 +1,3 @@ +begin; +alter table ct_eform add description VARCHAR(4000); +end; Added: contrib/ccm-ldn-camden-eforms/trunk/src/ccm-ldn-camden-eforms.upgrade =================================================================== --- contrib/ccm-ldn-camden-eforms/trunk/src/ccm-ldn-camden-eforms.upgrade 2006-05-03 21:00:00 UTC (rev 1132) +++ contrib/ccm-ldn-camden-eforms/trunk/src/ccm-ldn-camden-eforms.upgrade 2006-05-03 21:28:34 UTC (rev 1133) @@ -0,0 +1,5 @@ +<upgrade> + <version from="1.0.0" to="1.0.1"> + <script sql="ccm-ldn-camden-eforms/upgrade/::database::-1.0.0-1.0.1.sql"/> + </version> +</upgrade> Modified: contrib/ccm-ldn-camden-eforms/trunk/src/com/arsdigita/camden/cms/contenttypes/EForm.java =================================================================== --- contrib/ccm-ldn-camden-eforms/trunk/src/com/arsdigita/camden/cms/contenttypes/EForm.java 2006-05-03 21:00:00 UTC (rev 1132) +++ contrib/ccm-ldn-camden-eforms/trunk/src/com/arsdigita/camden/cms/contenttypes/EForm.java 2006-05-03 21:28:34 UTC (rev 1133) @@ -39,6 +39,7 @@ /** PDL property name for definition */ public static final String URL = "url"; + public static final String DESCRIPTION = "description"; /** Data object type for this domain object */ public static final String BASE_DATA_OBJECT_TYPE @@ -86,4 +87,12 @@ public void setURL( String url ) { set(URL, url); } + + public String getDescription() { + return (String) get(DESCRIPTION); + } + + public void setDescription( String description ) { + set(DESCRIPTION, description); + } } Modified: contrib/ccm-ldn-camden-eforms/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/EFormPropertiesStep.java =================================================================== --- contrib/ccm-ldn-camden-eforms/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/EFormPropertiesStep.java 2006-05-03 21:00:00 UTC (rev 1132) +++ contrib/ccm-ldn-camden-eforms/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/EFormPropertiesStep.java 2006-05-03 21:28:34 UTC (rev 1133) @@ -68,6 +68,7 @@ sheet.add( "Name:", EForm.NAME ); sheet.add( "Title:", EForm.TITLE ); sheet.add( "URL:", EForm.URL ); + sheet.add( "Description:", EForm.DESCRIPTION ); return sheet; } Modified: contrib/ccm-ldn-camden-eforms/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/EFormPropertyForm.java =================================================================== --- contrib/ccm-ldn-camden-eforms/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/EFormPropertyForm.java 2006-05-03 21:00:00 UTC (rev 1132) +++ contrib/ccm-ldn-camden-eforms/trunk/src/com/arsdigita/camden/cms/contenttypes/ui/EFormPropertyForm.java 2006-05-03 21:28:34 UTC (rev 1133) @@ -20,9 +20,11 @@ import com.arsdigita.camden.cms.contenttypes.EForm; import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.form.TextArea; import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.ParameterModel; @@ -39,6 +41,7 @@ implements FormProcessListener, FormInitListener { private TextField m_url; + private TextArea m_description; /** * Creates a new form to edit the EForm object specified @@ -57,20 +60,23 @@ super.addWidgets(); add(new Label("URL:")); - ParameterModel urlParam - = new StringParameter("url"); - m_url = new TextField(urlParam); + m_url = new TextField(EForm.URL); m_url.setSize(40); add(m_url); + + add(new Label("Description:")); + m_description = new TextArea(EForm.DESCRIPTION, 5, 40, TextArea.SOFT); + add(m_description); } /** Form initialisation hook. Fills widgets with data. */ public void init(FormSectionEvent fse) { EForm site = (EForm) super.initBasicWidgets(fse); - - m_url.setValue(fse.getPageState(), - site.getURL()); + + PageState state = fse.getPageState(); + m_url.setValue(state, site.getURL()); + m_description.setValue(state,site.getDescription()); } /** Form processing hook. Saves EForm object. */ @@ -78,12 +84,13 @@ EForm site = (EForm) super.processBasicWidgets(fse); + PageState state = fse.getPageState(); // save only if save button was pressed if (site != null && getSaveCancelSection().getSaveButton() - .isSelected(fse.getPageState())) { - site.setURL((String)m_url.getValue(fse.getPageState())); - site.save(); + .isSelected(state)) { + site.setURL((String)m_url.getValue(state)); + site.setDescription((String)m_description.getValue(state)); } } } |