From 25b812da9ef34a2d0935c60cccb05318f6662824 Mon Sep 17 00:00:00 2001 From: pb Date: Tue, 27 Dec 2011 02:12:16 +0000 Subject: [PATCH] SVN hat wieder mal Mist gebaut. git-svn-id: https://svn.libreccm.org/ccm/trunk@1400 8810af33-2d31-482b-a856-94f89814c4df --- ccm-shortcuts/application.xml | 13 ++ ccm-shortcuts/doc/shortcuts-standalone/README | 4 +- .../doc/shortcuts-standalone/web.xml | 4 +- ccm-shortcuts/doc/web.xml-shortcuts.in | 4 +- .../arsdigita/london/shortcuts/Shortcut.pdl | 11 -- .../pdl/com/arsdigita/shortcuts/Shortcut.pdl | 28 ++++ .../{london => }/shortcuts/Shortcuts.pdl | 7 +- .../default/sequence-ss_shortcuts_seq.sql | 0 .../default/table-sc_shortcuts.sql | 0 .../oracle-se-create.sql | 0 .../postgres-create.sql | 0 .../default/6.6.0-6.6.1/drop_app_table.sql | 23 +++ .../6.6.0-6.6.1/remove_legacy_entries.sql | 131 ++++++++++++++++++ .../default/6.6.0-6.6.1/upd_system_tables.sql | 69 +++++++++ .../upgrade/oracle-se-6.6.0-6.6.1.sql | 28 ++++ .../upgrade/postgres-6.6.0-6.6.1.sql | 33 +++++ ccm-shortcuts/src/ccm-ldn-shortcuts.config | 5 - ccm-shortcuts/src/ccm-shortcuts.config | 5 + ...-ldn-shortcuts.load => ccm-shortcuts.load} | 6 +- .../{london => }/shortcuts/Initializer.java | 4 +- .../{london => }/shortcuts/Loader.java | 45 ++++-- .../{london => }/shortcuts/Shortcut.java | 5 +- .../shortcuts/ShortcutCollection.java | 2 +- .../shortcuts/ShortcutFilter.java | 2 +- .../{london => }/shortcuts/ShortcutUtil.java | 5 +- .../{london => }/shortcuts/Shortcuts.java | 16 +-- .../shortcuts/ShortcutsConfig.java | 38 ++++- .../ShortcutsConfig_parameter.properties | 0 .../{london => }/shortcuts/ui/AdminPanel.java | 6 +- .../shortcuts/ui/ShortcutForm.java | 6 +- .../shortcuts/ui/ShortcutsTable.java | 8 +- ...dn-shortcuts.xml => web.ccm-shortcuts.xml} | 10 +- .../index.jsp | 2 +- .../heirloom}/apps/shortcuts/xsl/index.xsl | 6 +- 34 files changed, 447 insertions(+), 79 deletions(-) delete mode 100755 ccm-shortcuts/pdl/com/arsdigita/london/shortcuts/Shortcut.pdl create mode 100755 ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcut.pdl rename ccm-shortcuts/pdl/com/arsdigita/{london => }/shortcuts/Shortcuts.pdl (79%) rename ccm-shortcuts/sql/{ccm-ldn-shortcuts => ccm-shortcuts}/default/sequence-ss_shortcuts_seq.sql (100%) rename ccm-shortcuts/sql/{ccm-ldn-shortcuts => ccm-shortcuts}/default/table-sc_shortcuts.sql (100%) rename ccm-shortcuts/sql/{ccm-ldn-shortcuts => ccm-shortcuts}/oracle-se-create.sql (100%) rename ccm-shortcuts/sql/{ccm-ldn-shortcuts => ccm-shortcuts}/postgres-create.sql (100%) create mode 100644 ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/drop_app_table.sql create mode 100644 ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql create mode 100644 ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql create mode 100644 ccm-shortcuts/sql/ccm-shortcuts/upgrade/oracle-se-6.6.0-6.6.1.sql create mode 100644 ccm-shortcuts/sql/ccm-shortcuts/upgrade/postgres-6.6.0-6.6.1.sql delete mode 100755 ccm-shortcuts/src/ccm-ldn-shortcuts.config create mode 100755 ccm-shortcuts/src/ccm-shortcuts.config rename ccm-shortcuts/src/{ccm-ldn-shortcuts.load => ccm-shortcuts.load} (58%) rename ccm-shortcuts/src/com/arsdigita/{london => }/shortcuts/Initializer.java (96%) rename ccm-shortcuts/src/com/arsdigita/{london => }/shortcuts/Loader.java (51%) rename ccm-shortcuts/src/com/arsdigita/{london => }/shortcuts/Shortcut.java (95%) rename ccm-shortcuts/src/com/arsdigita/{london => }/shortcuts/ShortcutCollection.java (98%) rename ccm-shortcuts/src/com/arsdigita/{london => }/shortcuts/ShortcutFilter.java (98%) rename ccm-shortcuts/src/com/arsdigita/{london => }/shortcuts/ShortcutUtil.java (96%) rename ccm-shortcuts/src/com/arsdigita/{london => }/shortcuts/Shortcuts.java (87%) rename ccm-shortcuts/src/com/arsdigita/{london => }/shortcuts/ShortcutsConfig.java (61%) rename ccm-shortcuts/src/com/arsdigita/{london => }/shortcuts/ShortcutsConfig_parameter.properties (100%) rename ccm-shortcuts/src/com/arsdigita/{london => }/shortcuts/ui/AdminPanel.java (91%) rename ccm-shortcuts/src/com/arsdigita/{london => }/shortcuts/ui/ShortcutForm.java (98%) rename ccm-shortcuts/src/com/arsdigita/{london => }/shortcuts/ui/ShortcutsTable.java (95%) rename ccm-shortcuts/web/WEB-INF/{web.ccm-ldn-shortcuts.xml => web.ccm-shortcuts.xml} (71%) rename ccm-shortcuts/web/templates/{ccm-ldn-shortcuts => ccm-shortcuts}/index.jsp (90%) rename ccm-shortcuts/web/{__ccm__ => themes/heirloom}/apps/shortcuts/xsl/index.xsl (69%) diff --git a/ccm-shortcuts/application.xml b/ccm-shortcuts/application.xml index 21dbd0047..3ca0150e6 100755 --- a/ccm-shortcuts/application.xml +++ b/ccm-shortcuts/application.xml @@ -13,6 +13,19 @@ + Package provides the ability to provide abbreviated URLs for long internal + or external URLS. + Example: For the internal url + /ccm/content/events/2008/excellence + you may define a shortcut + /ccm/excellence + + Users may access the page by the short URL, the system provides the + necessary rewriting. + + This is especially usefull for static formally required pages which are + often part of the theme, e.g. contact, webmaster, or imprint. + The Red Hat Web Application Framework is a platform for writing database-backed web applications in Java. diff --git a/ccm-shortcuts/doc/shortcuts-standalone/README b/ccm-shortcuts/doc/shortcuts-standalone/README index c07fad383..94b48a697 100644 --- a/ccm-shortcuts/doc/shortcuts-standalone/README +++ b/ccm-shortcuts/doc/shortcuts-standalone/README @@ -1,5 +1,5 @@ Up to APLAWS version 1.0.4 shortcuts had been installed into its own -application context: [webapps]/ccm-ldn-shortcuts. +application context: [webapps]/ccm-shortcuts. Now it is installed inside the main APLAWS application context along with all other applications. @@ -8,7 +8,7 @@ If shortcuts should be installed as its own web context again following modifications are necessary: 1. remove webapp="xxx" from application.xml 2. move the files in this dir to WEB-INF/ -3. change src/com/ad/london/shortcuts/Shortcuts.java +3. change src/com/ad/shortcuts/Shortcuts.java method getServletContext() as back to "/files" 4. edit __ccm__/.../xsl/index.xsl according the comment 5. edit in ccm-ldn-aplaws /web/__ccm__/themes/aplaws/shortcuts.xml diff --git a/ccm-shortcuts/doc/shortcuts-standalone/web.xml b/ccm-shortcuts/doc/shortcuts-standalone/web.xml index 7084c53ec..929964e2d 100755 --- a/ccm-shortcuts/doc/shortcuts-standalone/web.xml +++ b/ccm-shortcuts/doc/shortcuts-standalone/web.xml @@ -8,7 +8,7 @@ com.arsdigita.web.ContextRegistrationServlet uri - /ccm-ldn-shortcuts/ + /ccm-shortcuts/ 1 @@ -18,7 +18,7 @@ com.arsdigita.web.ApplicationFileServlet template-path - /templates/ccm-ldn-shortcuts + /templates/ccm-shortcuts diff --git a/ccm-shortcuts/doc/web.xml-shortcuts.in b/ccm-shortcuts/doc/web.xml-shortcuts.in index b1aa87ccd..3d831840b 100644 --- a/ccm-shortcuts/doc/web.xml-shortcuts.in +++ b/ccm-shortcuts/doc/web.xml-shortcuts.in @@ -4,13 +4,13 @@ com.arsdigita.web.ApplicationFileServlet template-path - /templates/ccm-ldn-shortcuts + /templates/ccm-shortcuts shortcuts-files - /ccm-ldn-shortcuts/files/* + /ccm-shortcuts/files/* diff --git a/ccm-shortcuts/pdl/com/arsdigita/london/shortcuts/Shortcut.pdl b/ccm-shortcuts/pdl/com/arsdigita/london/shortcuts/Shortcut.pdl deleted file mode 100755 index 3d92347a3..000000000 --- a/ccm-shortcuts/pdl/com/arsdigita/london/shortcuts/Shortcut.pdl +++ /dev/null @@ -1,11 +0,0 @@ -model com.arsdigita.london.shortcuts; - -object type Shortcut { - - BigDecimal[1..1] shortcutID = sc_shortcuts.shortcut_id INTEGER; - String[1..1] urlKey = sc_shortcuts.url_key VARCHAR(1000); - String[1..1] redirect = sc_shortcuts.redirect VARCHAR(1000); - - object key (shortcutID); -} - diff --git a/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcut.pdl b/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcut.pdl new file mode 100755 index 000000000..c151db86d --- /dev/null +++ b/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcut.pdl @@ -0,0 +1,28 @@ +// +// Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of +// the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +model com.arsdigita.shortcuts; + +object type Shortcut { + + BigDecimal[1..1] shortcutID = sc_shortcuts.shortcut_id INTEGER; + String[1..1] urlKey = sc_shortcuts.url_key VARCHAR(1000); + String[1..1] redirect = sc_shortcuts.redirect VARCHAR(1000); + + object key (shortcutID); +} + diff --git a/ccm-shortcuts/pdl/com/arsdigita/london/shortcuts/Shortcuts.pdl b/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcuts.pdl similarity index 79% rename from ccm-shortcuts/pdl/com/arsdigita/london/shortcuts/Shortcuts.pdl rename to ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcuts.pdl index 704dc2264..4f949cc7a 100755 --- a/ccm-shortcuts/pdl/com/arsdigita/london/shortcuts/Shortcuts.pdl +++ b/ccm-shortcuts/pdl/com/arsdigita/shortcuts/Shortcuts.pdl @@ -15,10 +15,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -model com.arsdigita.london.shortcuts; +model com.arsdigita.shortcuts; import com.arsdigita.web.Application; object type Shortcuts extends Application { - reference key (sc_app.application_id); + // nothing to persist + // there is only one instance of shortcuts (the admin application) and + // no instance specific settings to be persisted. + // reference key (sc_app.application_id); } diff --git a/ccm-shortcuts/sql/ccm-ldn-shortcuts/default/sequence-ss_shortcuts_seq.sql b/ccm-shortcuts/sql/ccm-shortcuts/default/sequence-ss_shortcuts_seq.sql similarity index 100% rename from ccm-shortcuts/sql/ccm-ldn-shortcuts/default/sequence-ss_shortcuts_seq.sql rename to ccm-shortcuts/sql/ccm-shortcuts/default/sequence-ss_shortcuts_seq.sql diff --git a/ccm-shortcuts/sql/ccm-ldn-shortcuts/default/table-sc_shortcuts.sql b/ccm-shortcuts/sql/ccm-shortcuts/default/table-sc_shortcuts.sql similarity index 100% rename from ccm-shortcuts/sql/ccm-ldn-shortcuts/default/table-sc_shortcuts.sql rename to ccm-shortcuts/sql/ccm-shortcuts/default/table-sc_shortcuts.sql diff --git a/ccm-shortcuts/sql/ccm-ldn-shortcuts/oracle-se-create.sql b/ccm-shortcuts/sql/ccm-shortcuts/oracle-se-create.sql similarity index 100% rename from ccm-shortcuts/sql/ccm-ldn-shortcuts/oracle-se-create.sql rename to ccm-shortcuts/sql/ccm-shortcuts/oracle-se-create.sql diff --git a/ccm-shortcuts/sql/ccm-ldn-shortcuts/postgres-create.sql b/ccm-shortcuts/sql/ccm-shortcuts/postgres-create.sql similarity index 100% rename from ccm-shortcuts/sql/ccm-ldn-shortcuts/postgres-create.sql rename to ccm-shortcuts/sql/ccm-shortcuts/postgres-create.sql diff --git a/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/drop_app_table.sql b/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/drop_app_table.sql new file mode 100644 index 000000000..e8b00a5a9 --- /dev/null +++ b/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/drop_app_table.sql @@ -0,0 +1,23 @@ +-- +-- Copyright (C) 2011 Peter Boy All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: drop_app_table.sql pboy $ + +-- drops table subsite_app which just contained application type id and is +-- never used for any action. + +drop table sc_app ; diff --git a/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql b/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql new file mode 100644 index 000000000..9e8935e0c --- /dev/null +++ b/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql @@ -0,0 +1,131 @@ +-- +-- Copyright (C) 2011 Peter Boy. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: remove_legacy_entries.sql $ + +-- Subsite is now initialized as a legacy free type of application so +-- entries in tables apm_package_types are no longer needed. + + +-- in case there may be several application instances! + +-- delete from object_context all entries referring to node_id in site_nodes +delete from object_context + where object_id in + (select node_id from site_nodes object_id where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%shortcuts.Shortcuts%') + ) + ); + +-- delete from acs_objects all entries referring to node_id in site_nodes +alter table site_nodes drop constraint site_nodes_node_id_f_n1m2y ; +delete from acs_objects + where object_id in + (select node_id from site_nodes where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%shortcuts.Shortcuts%') + ) + ); + +-- delete all entries in site_nodes referring to a subsite instance +delete from site_nodes + where object_id in + (select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%shortcuts.Shortcuts%') + ); +alter table site_nodes add constraint site_nodes_node_id_f_n1m2y + FOREIGN KEY (node_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; + + + +-- delete from object_context all entries referring to package_id in apm_packages +delete from object_context + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like 'com.arsdigita.shortcuts.Shortcuts') + ); + +-- delete from acs_objects all entries referring to package_id in apm_packages +alter table apm_packages drop constraint apm_package_package_id_f_46may ; +alter table applications drop constraint application_package_id_f_cdaho ; +delete from acs_objects + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like 'com.arsdigita.shortcuts.Shortcuts') + ); + +-- delete all entries for subsite instances in apm_packages +-- identified by package_type_id in application_types +delete from apm_packages + where package_type_id = + (select package_type_id from application_types + where object_type + like 'com.arsdigita.shortcuts.Shortcuts') ; + +-- there seem to be no intries for a apm_packages_types entry (row) in +-- acs_objects or object_context! + +-- delete all entries for subsite in apm_package_types identified by +-- package_type_id in application_types +alter table application_types drop constraint applica_typ_pac_typ_id_f_v80ma ; +delete from apm_package_types + where package_type_id = + (select package_type_id from application_types + where object_type + like 'com.arsdigita.shortcuts.Shortcuts') ; + + +-- set package_id to null for all entries referring to a subsite instance +-- (indicating a new legacy free application) +update applications + set package_id = null + where application_type_id = + (select application_type_id from application_types + where object_type + like 'com.arsdigita.shortcuts.Shortcuts') ; + +-- set package_id to null for all entries referring to a subsite instance +-- (indicating a new legacy free application) +update application_types + set package_type_id = null + where object_type like 'com.arsdigita.shortcuts.Shortcuts' ; + +alter table application_types add constraint applica_typ_pac_typ_id_f_v80ma + FOREIGN KEY (package_type_id) + REFERENCES apm_package_types (package_type_id) + MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table applications add constraint application_package_id_f_cdaho + FOREIGN KEY (package_id) + REFERENCES apm_packages (package_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table apm_packages add constraint apm_package_package_id_f_46may + FOREIGN KEY (package_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; diff --git a/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql b/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql new file mode 100644 index 000000000..577843c34 --- /dev/null +++ b/ccm-shortcuts/sql/ccm-shortcuts/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql @@ -0,0 +1,69 @@ +-- +-- Copyright (C) 2011 Peter Boy All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: upd_system_tables.sql pboy $ + +-- adjust various system tables to the new name of application shortcuts + +alter table init_requirements drop constraint init_requirements_init_f_cmmdn ; + +alter table init_requirements drop constraint init_require_requ_init_f_i6rgg ; + +update inits + set class_name=replace(class_name,'london.shortcuts', 'shortcuts') + where class_name like '%london.shortcuts%' ; + +update init_requirements + set init=replace(init,'london.shortcuts', 'shortcuts') + where init like '%london.shortcuts%' ; + +update init_requirements + set required_init=replace(required_init,'london.shortcuts', 'shortcuts') + where required_init like '%london.shortcuts%' ; + +ALTER TABLE ONLY init_requirements + ADD CONSTRAINT init_requirements_init_f_cmmdn FOREIGN KEY (init) + REFERENCES inits (class_name) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION; + +ALTER TABLE init_requirements + ADD CONSTRAINT init_require_requ_init_f_i6rgg FOREIGN KEY (required_init) + REFERENCES inits (class_name) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION; + + +update application_types + set title='Shortcuts' + where object_type like '%london.shortcuts%' ; +update application_types + set object_type=replace(object_type,'london.shortcuts', 'shortcuts') + where object_type like '%london.shortcuts%' ; + +-- table applications doesn't require an update + +-- table apm_package_types doesn't require an update + +-- table apm_packages doesn't require an update either +-- table site_nodes doesn't require an update either + + +-- update application type in acs_objects +update acs_objects + set (object_type,default_domain_class) = + (replace(object_type,'london.shortcuts', 'shortcuts') , + replace(default_domain_class,'london.shortcuts', 'shortcuts') ) + where object_type like '%london.shortcuts%' ; diff --git a/ccm-shortcuts/sql/ccm-shortcuts/upgrade/oracle-se-6.6.0-6.6.1.sql b/ccm-shortcuts/sql/ccm-shortcuts/upgrade/oracle-se-6.6.0-6.6.1.sql new file mode 100644 index 000000000..5390d170e --- /dev/null +++ b/ccm-shortcuts/sql/ccm-shortcuts/upgrade/oracle-se-6.6.0-6.6.1.sql @@ -0,0 +1,28 @@ +-- +-- Copyright (C) 2011 Peter Boy All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $DateTime: 2011/03/27 23:15:09 $ +-- $Id: oracle-se-6.6.0-6.6.1 pboy $ + +-- drop table sc_app - not needed anyway +@@ default/6.6.0-6.6.1/drop_app_table.sql + +-- rename application from london.shortcuts to shortcuts +@@ default/6.6.0-6.6.1/upd_system_tables.sql + +-- remove legacy compatible bits +@@ default/6.6.0-6.6.1/remove_legacy_entries.sql diff --git a/ccm-shortcuts/sql/ccm-shortcuts/upgrade/postgres-6.6.0-6.6.1.sql b/ccm-shortcuts/sql/ccm-shortcuts/upgrade/postgres-6.6.0-6.6.1.sql new file mode 100644 index 000000000..453c8ce95 --- /dev/null +++ b/ccm-shortcuts/sql/ccm-shortcuts/upgrade/postgres-6.6.0-6.6.1.sql @@ -0,0 +1,33 @@ +-- +-- Copyright (C) 2011 Peter Boy All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $DateTime: 2010/11/10 23:15:09 $ + +\echo Red Hat Enterprise ccm-shortcuts 6.6.0 -> 6.6.1 Upgrade Script (PostgreSQL) + +begin; + +-- drop table sc_app - not needed anyway +\i default/6.6.0-6.6.1/drop_app_table.sql + +-- rename application from london.shortcuts to shortcuts +\i default/6.6.0-6.6.1/upd_system_tables.sql + +-- remove legacy compatible bits +\i default/6.6.0-6.6.1/remove_legacy_entries.sql + +commit; diff --git a/ccm-shortcuts/src/ccm-ldn-shortcuts.config b/ccm-shortcuts/src/ccm-ldn-shortcuts.config deleted file mode 100755 index 27cae8844..000000000 --- a/ccm-shortcuts/src/ccm-ldn-shortcuts.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - diff --git a/ccm-shortcuts/src/ccm-shortcuts.config b/ccm-shortcuts/src/ccm-shortcuts.config new file mode 100755 index 000000000..201a6b1a1 --- /dev/null +++ b/ccm-shortcuts/src/ccm-shortcuts.config @@ -0,0 +1,5 @@ + + + + diff --git a/ccm-shortcuts/src/ccm-ldn-shortcuts.load b/ccm-shortcuts/src/ccm-shortcuts.load similarity index 58% rename from ccm-shortcuts/src/ccm-ldn-shortcuts.load rename to ccm-shortcuts/src/ccm-shortcuts.load index fb904ca6b..11290a457 100755 --- a/ccm-shortcuts/src/ccm-ldn-shortcuts.load +++ b/ccm-shortcuts/src/ccm-shortcuts.load @@ -8,10 +8,10 @@ - + - - + + diff --git a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/Initializer.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/Initializer.java similarity index 96% rename from ccm-shortcuts/src/com/arsdigita/london/shortcuts/Initializer.java rename to ccm-shortcuts/src/com/arsdigita/shortcuts/Initializer.java index 3d21083ac..92a8cc0f5 100755 --- a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/Initializer.java +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/Initializer.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -package com.arsdigita.london.shortcuts; +package com.arsdigita.shortcuts; import com.arsdigita.db.DbHelper; @@ -51,7 +51,7 @@ public class Initializer extends CompoundInitializer { add(new PDLInitializer (new ManifestSource - ("ccm-ldn-shortcuts.pdl.mf", + ("ccm-shortcuts.pdl.mf", new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl")))); } diff --git a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/Loader.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/Loader.java similarity index 51% rename from ccm-shortcuts/src/com/arsdigita/london/shortcuts/Loader.java rename to ccm-shortcuts/src/com/arsdigita/shortcuts/Loader.java index f8779544f..e22463bec 100755 --- a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/Loader.java +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/Loader.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -package com.arsdigita.london.shortcuts; +package com.arsdigita.shortcuts; import com.arsdigita.loader.PackageLoader; @@ -31,6 +31,10 @@ import com.arsdigita.web.Application; import org.apache.log4j.Logger; /** + * Executes nonrecurring at install time and loads (and configures ) the + * shortcut application type and the administration instance. + * Shortcuts works by a filter servlet activated in web.xml + * * Loads the shortcuts application and type. * * @author Daniel Berrange @@ -40,6 +44,11 @@ public class Loader extends PackageLoader { private static final Logger s_log = Logger.getLogger(Loader.class); + /** + * Run script invoked by com.arsdigita.packing loader script. + * + * @param ctx + */ public void run(final ScriptContext ctx) { new KernelExcursion() { public void excurse() { @@ -49,19 +58,37 @@ public class Loader extends PackageLoader { }.run(); } + /** + * Creates a shortcuts as a legacy-free application type. + * + * No localization here because it is an invariant configuration. + */ private void setupShortcuts() { - ApplicationType type = ApplicationType + s_log.debug("Creating an application type for shortcuts. " + + "Base Data Object Type: " + Shortcuts.BASE_DATA_OBJECT_TYPE); + + /* Create legacy-campatible application type */ +/* ApplicationType type = ApplicationType .createApplicationType("shortcuts", "CCM Shortcuts Admin", - Shortcuts.BASE_DATA_OBJECT_TYPE); - type.setDescription("CCM shortcuts administration"); + Shortcuts.BASE_DATA_OBJECT_TYPE); */ + /* Create legacy-free application type + * NOTE: The wording in the title parameter of ApplicationType + * determines the name of the subdirectory for the XSL stylesheets. + * It gets "urlized", i.e. trimming leading and trailing blanks and + * replacing blanks between words and illegal characters with an + * hyphen and converted to lower case. + * "Shortcuts" will become "shortcuts". */ + ApplicationType type = new ApplicationType( + "Shortcuts", + Shortcuts.BASE_DATA_OBJECT_TYPE ); + type.setDescription("CCM Shortcuts Administration instance"); Application admin = Application.retrieveApplicationForPath("/admin/"); - Application app = - Application.createApplication(type, - "shortcuts", - "CCM Shortcuts Admin", - admin); + Application app = Application.createApplication(type, + "shortcuts", + "CCM Shortcuts Admin", + admin); } } diff --git a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/Shortcut.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/Shortcut.java similarity index 95% rename from ccm-shortcuts/src/com/arsdigita/london/shortcuts/Shortcut.java rename to ccm-shortcuts/src/com/arsdigita/shortcuts/Shortcut.java index ae0c9a15b..f45951143 100755 --- a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/Shortcut.java +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/Shortcut.java @@ -13,7 +13,7 @@ * */ -package com.arsdigita.london.shortcuts; +package com.arsdigita.shortcuts; import com.arsdigita.db.Sequences; import com.arsdigita.domain.DataObjectNotFoundException; @@ -39,7 +39,8 @@ public class Shortcut extends DomainObject { public static final String URL_KEY = "urlKey"; public static final String REDIRECT = "redirect"; - public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.london.shortcuts.Shortcut"; + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.shortcuts.Shortcut"; protected String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; diff --git a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutCollection.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutCollection.java similarity index 98% rename from ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutCollection.java rename to ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutCollection.java index 47902fded..fbb4a1a3e 100755 --- a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutCollection.java +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutCollection.java @@ -13,7 +13,7 @@ * */ -package com.arsdigita.london.shortcuts; +package com.arsdigita.shortcuts; import com.arsdigita.domain.DomainCollection; import com.arsdigita.domain.DomainObject; diff --git a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutFilter.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutFilter.java similarity index 98% rename from ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutFilter.java rename to ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutFilter.java index 2ef777d88..492879f94 100755 --- a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutFilter.java +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutFilter.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -package com.arsdigita.london.shortcuts; +package com.arsdigita.shortcuts; import com.arsdigita.web.BaseFilter; diff --git a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutUtil.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutUtil.java similarity index 96% rename from ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutUtil.java rename to ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutUtil.java index 4e0111adb..b11acf3ee 100755 --- a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutUtil.java +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutUtil.java @@ -13,7 +13,7 @@ * */ -package com.arsdigita.london.shortcuts; +package com.arsdigita.shortcuts; import com.arsdigita.caching.CacheTable; import com.arsdigita.persistence.SessionManager; @@ -26,8 +26,7 @@ import org.apache.log4j.Logger; public class ShortcutUtil { - private static final Logger s_log = - Logger.getLogger(ShortcutUtil.class); + private static final Logger s_log = Logger.getLogger(ShortcutUtil.class); private static CacheTable s_remote = new CacheTable("shortcuts"); private static Map s_cache = new HashMap(); diff --git a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/Shortcuts.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/Shortcuts.java similarity index 87% rename from ccm-shortcuts/src/com/arsdigita/london/shortcuts/Shortcuts.java rename to ccm-shortcuts/src/com/arsdigita/shortcuts/Shortcuts.java index 5ed81e4fc..05f29e9a3 100755 --- a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/Shortcuts.java +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/Shortcuts.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -package com.arsdigita.london.shortcuts; +package com.arsdigita.shortcuts; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.OID; @@ -32,16 +32,10 @@ public class Shortcuts extends Application { private static final Logger logger = Logger.getLogger(Shortcuts.class); - public static final String BASE_DATA_OBJECT_TYPE - = "com.arsdigita.london.shortcuts.Shortcuts"; + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.shortcuts.Shortcuts"; - private static ShortcutsConfig s_config = new ShortcutsConfig(); - - static { - logger.debug("Static initalizer starting..."); - s_config.load(); - logger.debug("Static initalizer finished."); - } + private static ShortcutsConfig s_config = ShortcutsConfig.getConfig(); public static ShortcutsConfig getConfig() { return s_config; @@ -93,6 +87,6 @@ public class Shortcuts extends Application { */ public String getServletPath() { // return "/files"; - return "/ccm-ldn-shortcuts/files"; + return "/ccm-shortcuts/files"; } } diff --git a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutsConfig.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutsConfig.java similarity index 61% rename from ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutsConfig.java rename to ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutsConfig.java index 9aa1388ed..f9f90f54d 100755 --- a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutsConfig.java +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutsConfig.java @@ -16,11 +16,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -package com.arsdigita.london.shortcuts; +package com.arsdigita.shortcuts; import com.arsdigita.runtime.AbstractConfig; -import com.arsdigita.util.parameter.IntegerParameter; -import com.arsdigita.util.parameter.Parameter; import org.apache.log4j.Logger; @@ -36,9 +34,43 @@ import org.apache.log4j.Logger; */ public final class ShortcutsConfig extends AbstractConfig { + /** A logger instance to assist debugging. */ private static final Logger s_log = Logger.getLogger(ShortcutsConfig.class); + /** Singelton config object. */ + private static ShortcutsConfig s_conf; + + /** + * Gain a SubsiteConfig object. + * + * Singelton pattern, don't instantiate a config object using the + * constructor directly! + * @return + */ + public static synchronized ShortcutsConfig getConfig() { + if (s_conf == null) { + s_conf = new ShortcutsConfig(); + s_conf.load(); + } + + return s_conf; + } + + // //////////////////////////////////////////////////////////////////////// + // Set of configuration parameters + + // Nothing to configurfe yet + + + /** + * Constructor (singleton pattern). + * Don't instantiate a config object using the constructor directly! + * use getConfig instead! + */ public ShortcutsConfig() { + + // register([parameter]); + loadInfo(); } } diff --git a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutsConfig_parameter.properties b/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutsConfig_parameter.properties similarity index 100% rename from ccm-shortcuts/src/com/arsdigita/london/shortcuts/ShortcutsConfig_parameter.properties rename to ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutsConfig_parameter.properties diff --git a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ui/AdminPanel.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/AdminPanel.java similarity index 91% rename from ccm-shortcuts/src/com/arsdigita/london/shortcuts/ui/AdminPanel.java rename to ccm-shortcuts/src/com/arsdigita/shortcuts/ui/AdminPanel.java index ec9d9e01f..f464b58f3 100755 --- a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ui/AdminPanel.java +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/AdminPanel.java @@ -13,9 +13,7 @@ * */ -package com.arsdigita.london.shortcuts.ui; - -import java.math.BigDecimal; +package com.arsdigita.shortcuts.ui; import org.apache.log4j.Category; @@ -23,7 +21,6 @@ import com.arsdigita.bebop.Page; import com.arsdigita.bebop.SimpleContainer; import com.arsdigita.bebop.parameters.BigDecimalParameter; import com.arsdigita.kernel.ui.ACSObjectSelectionModel; -import com.arsdigita.london.shortcuts.Shortcut; public class AdminPanel extends SimpleContainer { @@ -38,6 +35,7 @@ public class AdminPanel extends SimpleContainer { add(new ShortcutsTable(m_shortcut)); } + @Override public void register(Page p) { super.register(p); diff --git a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ui/ShortcutForm.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ShortcutForm.java similarity index 98% rename from ccm-shortcuts/src/com/arsdigita/london/shortcuts/ui/ShortcutForm.java rename to ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ShortcutForm.java index 1d89fe4a4..ff7c6ce2f 100755 --- a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ui/ShortcutForm.java +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ShortcutForm.java @@ -17,7 +17,7 @@ * */ -package com.arsdigita.london.shortcuts.ui; +package com.arsdigita.shortcuts.ui; import java.math.BigDecimal; @@ -29,8 +29,8 @@ import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.event.FormValidationListener; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.form.Submit; -import com.arsdigita.london.shortcuts.ShortcutUtil; -import com.arsdigita.london.shortcuts.Shortcut; +import com.arsdigita.shortcuts.ShortcutUtil; +import com.arsdigita.shortcuts.Shortcut; import com.arsdigita.bebop.Form; import com.arsdigita.bebop.parameters.TrimmedStringParameter; import com.arsdigita.bebop.parameters.NotEmptyValidationListener; diff --git a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ui/ShortcutsTable.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ShortcutsTable.java similarity index 95% rename from ccm-shortcuts/src/com/arsdigita/london/shortcuts/ui/ShortcutsTable.java rename to ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ShortcutsTable.java index 7bc3aec99..934247987 100755 --- a/ccm-shortcuts/src/com/arsdigita/london/shortcuts/ui/ShortcutsTable.java +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/ui/ShortcutsTable.java @@ -17,7 +17,7 @@ * */ -package com.arsdigita.london.shortcuts.ui; +package com.arsdigita.shortcuts.ui; import com.arsdigita.bebop.Table; import com.arsdigita.bebop.table.TableModelBuilder; @@ -26,9 +26,9 @@ import com.arsdigita.bebop.table.TableModel; import com.arsdigita.bebop.PageState; import com.arsdigita.kernel.ui.ACSObjectSelectionModel; -import com.arsdigita.london.shortcuts.Shortcut; -import com.arsdigita.london.shortcuts.ShortcutUtil; -import com.arsdigita.london.shortcuts.ShortcutCollection; +import com.arsdigita.shortcuts.Shortcut; +import com.arsdigita.shortcuts.ShortcutUtil; +import com.arsdigita.shortcuts.ShortcutCollection; import java.math.BigDecimal; import org.apache.log4j.Category; diff --git a/ccm-shortcuts/web/WEB-INF/web.ccm-ldn-shortcuts.xml b/ccm-shortcuts/web/WEB-INF/web.ccm-shortcuts.xml similarity index 71% rename from ccm-shortcuts/web/WEB-INF/web.ccm-ldn-shortcuts.xml rename to ccm-shortcuts/web/WEB-INF/web.ccm-shortcuts.xml index 9a69a1ab9..85797c5f5 100644 --- a/ccm-shortcuts/web/WEB-INF/web.ccm-ldn-shortcuts.xml +++ b/ccm-shortcuts/web/WEB-INF/web.ccm-shortcuts.xml @@ -6,7 +6,7 @@ shortcuts - com.arsdigita.london.shortcuts.ShortcutFilter + com.arsdigita.shortcuts.ShortcutFilter @@ -14,20 +14,20 @@ /* - + shortcuts-files com.arsdigita.web.ApplicationFileServlet template-path - /templates/ccm-ldn-shortcuts + /templates/ccm-shortcuts - + shortcuts-files - /ccm-ldn-shortcuts/files/* + /ccm-shortcuts/files/* diff --git a/ccm-shortcuts/web/templates/ccm-ldn-shortcuts/index.jsp b/ccm-shortcuts/web/templates/ccm-shortcuts/index.jsp similarity index 90% rename from ccm-shortcuts/web/templates/ccm-ldn-shortcuts/index.jsp rename to ccm-shortcuts/web/templates/ccm-shortcuts/index.jsp index 7fc4039fe..7a26a5e6c 100755 --- a/ccm-shortcuts/web/templates/ccm-ldn-shortcuts/index.jsp +++ b/ccm-shortcuts/web/templates/ccm-shortcuts/index.jsp @@ -16,7 +16,7 @@ title="Shortcuts Admin" cache="true"> + classname="com.arsdigita.shortcuts.ui.AdminPanel"/> shortcutsPage.addRequestListener(new ApplicationAuthenticationListener()); diff --git a/ccm-shortcuts/web/__ccm__/apps/shortcuts/xsl/index.xsl b/ccm-shortcuts/web/themes/heirloom/apps/shortcuts/xsl/index.xsl similarity index 69% rename from ccm-shortcuts/web/__ccm__/apps/shortcuts/xsl/index.xsl rename to ccm-shortcuts/web/themes/heirloom/apps/shortcuts/xsl/index.xsl index 2afabfcbb..d754c48c5 100755 --- a/ccm-shortcuts/web/__ccm__/apps/shortcuts/xsl/index.xsl +++ b/ccm-shortcuts/web/themes/heirloom/apps/shortcuts/xsl/index.xsl @@ -4,14 +4,14 @@ xmlns:shortcuts="http://www.arsdigita.com/shortcuts/1.0" xmlns:bebop="http://www.arsdigita.com/bebop/1.0"> - - - + +