Index: openacs-4/packages/dynamic-types/catalog/dynamic-types.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dynamic-types/catalog/dynamic-types.en_US.ISO-8859-1.xml,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/dynamic-types/catalog/dynamic-types.en_US.ISO-8859-1.xml 4 Jun 2005 12:50:03 -0000 1.3 +++ openacs-4/packages/dynamic-types/catalog/dynamic-types.en_US.ISO-8859-1.xml 4 Jun 2005 16:09:54 -0000 1.4 @@ -18,12 +18,15 @@ Attribute Name This name must be lower case, contain only letters and underscores, and contain no spaces. If not specified one will be generated for you. Attributes + Export code to recreate dynamic types and forms + Tcl code to recreate selected dynamic types and forms Content Datatype Dynamic Types Management Dynamic Types Edit Form Name Form elements + Export Form Name Form "%form_name%" Forms Index: openacs-4/packages/dynamic-types/lib/dtype-code.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dynamic-types/lib/dtype-code.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dynamic-types/lib/dtype-code.adp 4 Jun 2005 16:09:54 -0000 1.1 @@ -0,0 +1,33 @@ + +############ +# Object Type "@object_type@" +############ + +dtype::create_attribute \ + -object_type {@object_type@} \ + -name {@attributes.attribute_name@} \ + -data_type {@attributes.datatype@} \ + -pretty_name {@attributes.pretty_name@} \ + -pretty_plural {@attributes.pretty_plural@} \ + -default_value {@attributes.default_value@} +lang::message::register \ + -update_sync $default_locale acs-translations \ + {@object_type@_@attributes.attribute_name@} {@attributes.pretty_name@} +lang::message::register \ + -update_sync $default_locale acs-translations \ + {@object_type@_@attributes.attribute_name@s} {@attributes.pretty_plural@} + + + +# Form "@forms.form_name@" +dtype::form::new -object_type {@object_type@} -form_name {@forms.form_name@} + +dtype::form::metadata::create_widget \ + -object_type {@object_type@} \ + -dform {@forms.form_name@} \ + -attribute_name {@forms.attribute_name@} \ + -widget {@forms.widget@} \ + -required_p {@forms.is_required@} + + + Index: openacs-4/packages/dynamic-types/lib/dtype-code.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dynamic-types/lib/dtype-code.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dynamic-types/lib/dtype-code.tcl 4 Jun 2005 16:09:54 -0000 1.1 @@ -0,0 +1,5 @@ +db_multirow attributes dynamic_attributes {} + +db_multirow forms dynamic_forms {} { + set is_required [ad_decode $is_required t 1 0] +} Index: openacs-4/packages/dynamic-types/lib/dtype-code.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dynamic-types/lib/dtype-code.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dynamic-types/lib/dtype-code.xql 4 Jun 2005 16:09:54 -0000 1.1 @@ -0,0 +1,31 @@ + + + + + + + + select a.attribute_id, a.attribute_name, a.pretty_name, a.pretty_plural, + a.datatype, a.default_value + from acs_attributes a, dtype_attributes d + where a.attribute_id = d.attribute_id + and a.object_type = :object_type + order by a.sort_order + + + + + + + + select f.form_id, f.name as form_name, a.attribute_name, + e.widget, e.is_required + from dtype_forms f, dtype_form_elements e, acs_attributes a + where f.object_type = :object_type + and e.form_id = f.form_id + and a.attribute_id = e.attribute_id + + + + + Index: openacs-4/packages/dynamic-types/www/dtypes-code.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dynamic-types/www/dtypes-code.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dynamic-types/www/dtypes-code.adp 4 Jun 2005 16:09:54 -0000 1.1 @@ -0,0 +1,10 @@ + +@page_title;noquote@ +@context;noquote@ + +

#dynamic-types.code_necessary#

+
+
+
+
+
Index: openacs-4/packages/dynamic-types/www/dtypes-code.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dynamic-types/www/dtypes-code.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dynamic-types/www/dtypes-code.tcl 4 Jun 2005 16:09:54 -0000 1.1 @@ -0,0 +1,19 @@ +ad_page_contract { + + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2005-06-04 + @cvs-id $Id: dtypes-code.tcl,v 1.1 2005/06/04 16:09:54 timoh Exp $ + +} { + {object_type:multiple} +} + +set page_title "[_ dynamic-types.code_export]" +set context [list [list dtypes "[_ dynamic-types.dynamic_types]"] $page_title] + +multirow create types object_type +foreach type $object_type { + multirow append types $type +} + +ad_return_template Index: openacs-4/packages/dynamic-types/www/dtypes.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dynamic-types/www/Attic/dtypes.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/dynamic-types/www/dtypes.tcl 4 Jun 2005 12:51:20 -0000 1.1 +++ openacs-4/packages/dynamic-types/www/dtypes.tcl 4 Jun 2005 16:09:54 -0000 1.2 @@ -15,6 +15,7 @@ -multirow dtypes \ -key object_type \ -row_pretty_plural "[_ dynamic-types.dynamic_types]" \ + -bulk_actions [list "[_ dynamic-types.export]" dtypes-code "[_ dynamic-types.code_export]"] \ -elements { pretty_name { label "[_ dynamic-types.pretty_name]"