ccm-ldn-terms jetzt legacy free, Update included.
git-svn-id: https://svn.libreccm.org/ccm/trunk@1506 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
2b024d91cd
commit
a22561defa
|
|
@ -2,7 +2,7 @@
|
|||
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||
name="ccm-ldn-terms"
|
||||
prettyName="Terms"
|
||||
version="6.6.0"
|
||||
version="6.6.2"
|
||||
release="1"
|
||||
webapp="ROOT">
|
||||
<ccm:dependencies>
|
||||
|
|
@ -15,7 +15,10 @@
|
|||
<ccm:contact uri="mailto:rhea@redhat.com" type="support"/>
|
||||
</ccm:contacts>
|
||||
<ccm:description>
|
||||
The Red Hat Web Application Framework is a platform for writing
|
||||
database-backed web applications in Java.
|
||||
Package ccm-ldn-terms creates and maintains domain based categories. One
|
||||
domain is specifically used by ccm-navigation to create a navigation menue
|
||||
for the site.
|
||||
|
||||
It replaces the "purpose" based categorization of ccm-core.
|
||||
</ccm:description>
|
||||
</ccm:application>
|
||||
|
|
|
|||
|
|
@ -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 $
|
||||
|
||||
-- ccm-ldn-terms 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 '%terms.Terms%')
|
||||
)
|
||||
);
|
||||
|
||||
-- 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 '%terms.Terms%')
|
||||
)
|
||||
);
|
||||
|
||||
-- delete all entries in site_nodes referring to a Terms 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 '%terms.Terms%')
|
||||
);
|
||||
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 '%terms.Terms%')
|
||||
);
|
||||
|
||||
-- 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 '%terms.Terms%')
|
||||
);
|
||||
|
||||
-- delete all entries for Terms 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 '%terms.Terms%') ;
|
||||
|
||||
-- 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 '%terms.Terms%') ;
|
||||
|
||||
|
||||
-- set package_id to null for all entries referring to a ContentSection 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 '%terms.Terms%') ;
|
||||
|
||||
-- set package_id to null for all entries referring to a Terms instance
|
||||
-- (indicating a new legacy free application)
|
||||
update application_types
|
||||
set package_type_id = null
|
||||
where object_type like '%terms.Terms%' ;
|
||||
|
||||
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 ;
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
--
|
||||
-- Copyright (C) 2008 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: oracle-se-6.6.1-6.6.2.sql 293 2012-02-07 15:10:39Z pboy $
|
||||
|
||||
PROMPT Red Hat Enterprise TERMS 6.6.1 -> 6.6.2 Upgrade Script (Oracle)
|
||||
|
||||
-- Terms now initialized legacy free
|
||||
@@ ../default/upgrade/6.6.1-6.6.2/remove_legacy_entries.sql
|
||||
|
|
@ -21,6 +21,9 @@
|
|||
|
||||
begin;
|
||||
|
||||
-- Under unknown circumstances a constraint may get lost during updating.
|
||||
-- Only needed under special conditions or when a missing constraint causes
|
||||
-- errors.
|
||||
\i ../default/upgrade/6.6.0-6.6.1/upd_constraints.sql
|
||||
|
||||
commit;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
--
|
||||
-- Copyright (C) 2008 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: 2012/02/10 23:15:09 $
|
||||
|
||||
\echo Red Hat Enterprise TERMS 6.6.1 -> 6.6.2 Upgrade Script (PostgreSQL)
|
||||
|
||||
begin;
|
||||
|
||||
-- Terms now initialized legacy free
|
||||
\i ../default/upgrade/6.6.1-6.6.2/remove_legacy_entries.sql
|
||||
|
||||
commit;
|
||||
|
|
@ -18,4 +18,7 @@
|
|||
<version from="6.6.0" to="6.6.1">
|
||||
<script sql="ccm-ldn-terms/upgrade/::database::-6.6.0-6.6.1.sql"/>
|
||||
</version>
|
||||
<version from="6.6.1" to="6.6.2">
|
||||
<script sql="ccm-ldn-terms/upgrade/::database::-6.6.1-6.6.2.sql"/>
|
||||
</version>
|
||||
</upgrade>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ import com.arsdigita.web.Application;
|
|||
import com.arsdigita.web.ApplicationType;
|
||||
|
||||
/**
|
||||
* Loader.
|
||||
* Terms Loader executes nonrecurring at install time and loads (installs and
|
||||
* initializes) the ccm-ldn-terms module into database.
|
||||
*
|
||||
* @author Justin Ross <jross@redhat.com>
|
||||
* @version $Id: Loader.java 1878 2009-04-21 13:56:23Z terry $
|
||||
|
|
@ -40,11 +41,18 @@ public class Loader extends PackageLoader {
|
|||
}.run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a legacy free application type and a admin application instance.
|
||||
*/
|
||||
public static void setupApplication() {
|
||||
ApplicationType type = ApplicationType
|
||||
.createApplicationType("terms",
|
||||
"CCM Terms Admin",
|
||||
|
||||
// NOTE: The title "Navigation" is used to retrieve the application's
|
||||
// name to determine the location of xsl files (by url-izing it). So
|
||||
// DON'T modify it without synchronizing web directory tree accordingly!
|
||||
ApplicationType type =
|
||||
new ApplicationType( "Terms",
|
||||
Terms.BASE_DATA_OBJECT_TYPE );
|
||||
|
||||
type.setDescription("CCM Terms administration");
|
||||
|
||||
Application admin = Application.retrieveApplicationForPath("/admin/");
|
||||
|
|
|
|||
Loading…
Reference in New Issue