Letzter Teil RSS-Feed, Update Skript.

git-svn-id: https://svn.libreccm.org/ccm/trunk@1464 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2012-01-22 11:23:05 +00:00
parent 588521a359
commit e4ba9dd81e
11 changed files with 68 additions and 62 deletions

View File

@ -16,7 +16,7 @@
<ccm:contact uri="mailto:rhea@redhat.com" type="support"/>
</ccm:contacts>
<ccm:description>
The RSSfeed package provides a rss feeder which may be used to deploy
The RSSfeed package provides a rss feed service which may be used to deploy
internal content which is selected by categorization as well as external
content based on URL.
</ccm:description>

View File

@ -46,7 +46,7 @@ delete from acs_objects
)
);
-- delete all entries in site_nodes referring to a subsite instance
-- delete all entries in site_nodes referring to a RSSFeed instance
delete from site_nodes
where object_id in
(select package_id from applications where application_type_id =
@ -81,7 +81,7 @@ delete from acs_objects
like 'com.arsdigita.rssfeed.RSSFeed')
);
-- delete all entries for subsite instances in apm_packages
-- delete all entries for RSSFeed instances in apm_packages
-- identified by package_type_id in application_types
delete from apm_packages
where package_type_id =
@ -92,7 +92,7 @@ delete from apm_packages
-- 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
-- delete all entries for RSSFeed 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
@ -102,7 +102,7 @@ delete from apm_package_types
like 'com.arsdigita.rssfeed.RSSFeed') ;
-- set package_id to null for all entries referring to a subsite instance
-- set package_id to null for all entries referring to a RSSFeed instance
-- (indicating a new legacy free application)
update applications
set package_id = null
@ -111,7 +111,7 @@ update applications
where object_type
like 'com.arsdigita.rssfeed.RSSFeed') ;
-- set package_id to null for all entries referring to a subsite instance
-- set package_id to null for all entries referring to a RSSFeed instance
-- (indicating a new legacy free application)
update application_types
set package_type_id = null

View File

@ -17,7 +17,7 @@
--
-- $Id: ren_sites_table.sql pboy $
-- rename table subsite_site to subsite_sites following ccm naming conventions
-- rename table rss_feeds to rssfeed_feeds following ccm naming conventions
-- to make maintenance tasks easier
@ -25,8 +25,10 @@ alter table rss_feeds drop constraint rss_feeds_feed_id_p_rm_i5 ;
alter table rss_feeds drop constraint rss_feeds_feed_id_f_2lk3l ;
alter table rss_feeds drop constraint rss_feeds_url_u_3ul6f ;
alter table rss_feeds RENAME TO rssfeed_feeds ;
alter table rssfeed_feeds
add constraint rssfeed_feeds_feed_id_p_493us PRIMARY KEY (feed_id) ;
alter table rssfeed_feeds

View File

@ -47,10 +47,16 @@ ALTER TABLE init_requirements
update application_types
set object_type=replace(object_type,'london.rss', 'rssfeed')
where object_type like '%london.rss%' ;
set (object_type,title,description)=
(replace(object_type,'london.rss.RSS', 'rssfeed.RSSFeed'),
'RSS Feed',
'Provides RSS feed service')
where object_type like '%london.rss.RSS%' ;
-- table applications doesn't require an update
-- table applications requires an update
update applications
set (title,description)=('RSS Feeds','RSS feed channels')
where primary_url like '%channels%' ;
-- table apm_package_types doesn't require an update
@ -58,9 +64,28 @@ update application_types
-- table site_nodes doesn't require an update either
-- update application type in acs_objects
-- update acs_objects
-- (a) update application type
update acs_objects
set (object_type,default_domain_class) =
set (object_type,display_name,default_domain_class) =
(replace(object_type,'london.rss.RSS', 'rssfeed.RSSFeed') ,
'RSS Service',
replace(default_domain_class,'london.rss.RSS', 'rssfeed.RSSFeed') )
where object_type like '%london.rss.RSS%' ;
-- (b) update feeds
update acs_objects
set (object_type,display_name,default_domain_class) =
(replace(object_type,'london.rss', 'rssfeed') ,
replace(display_name,'london.rss','rssfeed'),
replace(default_domain_class,'london.rss', 'rssfeed') )
where object_type like '%london.rss%' ;
where object_type like '%london.rss.Feed%' ;
-- (c) remove unused RSS cat purpose
update acs_objects
set display_name = 'RSS cat purpose to delete'
where object_id = (select purpose_id from cat_purposes
where key like '%RSS%');
delete from cat_purposes where key like '%RSS%' ;
delete from object_context where object_id = (select object_id from acs_objects
where display_name like
'RSS cat purpose to delete') ;
delete from acs_objects where display_name like 'RSS cat purpose to delete' ;

View File

@ -18,13 +18,14 @@
-- $DateTime: 2011/03/27 23:15:09 $
-- $Id: oracle-se-6.6.0-6.6.1 pboy $
-- drop table subsite_app - not needed anyway
-- drop table rss_app - not needed anyway
@@ default/6.6.0-6.6.1/drop_app_table.sql
-- rename table containing defined subsites following ccm naming conventions
-- rename table containing defined feeds following ccm naming conventions
@@ default/6.6.0-6.6.1/ren_sites_table.sql
-- rename application from london.subsite to subsite
-- rename application from london.rss to rssfeed
@@ 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
-- adjust class name in content_sections table
@@ default/6.6.0-6.6.1/upd_cms_tables.sql

View File

@ -17,7 +17,7 @@
--
-- $DateTime: 2010/11/10 23:15:09 $
\echo Red Hat Enterprise ccm-subsite 6.6.0 -> 6.6.1 Upgrade Script (PostgreSQL)
\echo Red Hat Enterprise ccm-rssfeed 6.6.0 -> 6.6.1 Upgrade Script (PostgreSQL)
begin;
@ -27,7 +27,7 @@ begin;
-- rename table containing defined feeds following ccm naming conventions
\i default/6.6.0-6.6.1/ren_sites_table.sql
-- rename application from london.subsite to subsite
-- rename application from london.rss to rssfeed
\i default/6.6.0-6.6.1/upd_system_tables.sql
-- remove legacy compatible bits

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<registry>
<config class="com.arsdigita.rssfeed.RSSFeedConfig"
storage="ccm-rssfeed/rss.properties"/>
storage="ccm-rssfeed/rssfeed.properties"/>
</registry>

View File

@ -18,19 +18,15 @@
package com.arsdigita.rssfeed;
import com.arsdigita.categorization.CategoryPurpose;
// import com.arsdigita.categorization.CategoryPurpose;
import com.arsdigita.domain.DataObjectNotFoundException;
// import com.arsdigita.domain.DomainObject;
// import com.arsdigita.kernel.ACSObjectInstantiator;
import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.KernelExcursion;
import com.arsdigita.loader.PackageLoader;
// import com.arsdigita.persistence.DataObject;
import com.arsdigita.portal.PortletType;
import com.arsdigita.runtime.ScriptContext;
import com.arsdigita.rssfeed.portlet.WorkspaceDirectoryPortlet;
import com.arsdigita.web.Application;
// import com.arsdigita.web.ApplicationSetup;
import com.arsdigita.web.ApplicationType;
import com.arsdigita.web.URL;
@ -59,13 +55,20 @@ public class Loader extends PackageLoader {
public void excurse() {
setEffectiveParty(Kernel.getSystemParty());
// CatgegoryPurpose is deprecated and replaced by terms in
// some way. So this step may be ommitted.
// CategoryPurpose is deprecated and replaced by terms in
// some way. So this step has to be refactored in some way.
// Category creation may be omitted and /channels/admin still
// works, but /channels rsp. /channels/rss does not wether a
// CategoryPurpose ist created or not.
// RSS currently depends on an existing category domain in terms
// an a domain mapping to this applicaion.
/*
String catKey = RSSFeed.getConfig().getCategoryKey();
s_log.info("Setting RSS Category Key to " + catKey + ".");
if (!CategoryPurpose.purposeExists(catKey)) {
(new CategoryPurpose(catKey, "RSS Feed")).save();
}
*/
// load application type for admin application into database
// (i.e. create application type)
@ -82,38 +85,10 @@ public class Loader extends PackageLoader {
/**
* Creates the application type for the admin application as an
* (old style) compatible applicaiton.
* (new style) legacy-free applicaiton.
*/
public void setupChannelControlCenter() {
// Old way to setup of a new style legacy compatible application.
// Kept until transistion to new style legacy free application is
// completed for easy reference and debugging. Delete thereafter!
/* ApplicationSetup setup = new ApplicationSetup(s_log);
setup.setApplicationObjectType(RSSFeed.BASE_DATA_OBJECT_TYPE);
setup.setKey("rss");
setup.setTitle("RSSFeed Channels");
setup.setDescription("RSSFeed Channels");
setup.setSingleton(true);
setup.setInstantiator(new ACSObjectInstantiator() {
@Override
public DomainObject doNewInstance(DataObject dataObject) {
return new RSSFeed(dataObject);
}
});
ApplicationType type = setup.run();
type.save(); */
// Old way to setup of a new style legacy compatible application.
// Kept until transistion to new style legacy free application is
// completed for easy reference and debugging. Delete thereafter!
/* ApplicationType type = ApplicationType.createApplicationType(
"rss",
"RSS Channels",
RSSFeed.BASE_DATA_OBJECT_TYPE);
type.setDescription("RSS Channels"); */
/* Create legacy-free application type
* NOTE: The wording in the title parameter of ApplicationType
* determines the name of the subdirectory for the XSL stylesheets.
@ -122,21 +97,25 @@ public class Loader extends PackageLoader {
* hyphen and converted to lower case.
* "RSSFeed" will become "rssfeed". */
ApplicationType type = new ApplicationType(
"RSSFeed",
"RSS Feed",
RSSFeed.BASE_DATA_OBJECT_TYPE );
type.setDescription("CCM RSS Feed");
type.setDescription("Provides RSS feed service");
if (!Application.isInstalled(RSSFeed.BASE_DATA_OBJECT_TYPE,
"/channels/")) {
Application app = Application
.createApplication(type,
"channels",
"RSS",
"RSS Service",
null);
app.setDescription("RSS feed channels");
app.save();
}
}
/**
*
*/
public void setupLocalFeeds() {
URL external = URL.there("/channels/rss/external.rss", null);

View File

@ -96,9 +96,8 @@ public class RSSFeed extends Application {
*
* @return path name to the applications servlet/JSP
*/
@Override
public String getServletPath() {
// sufficient if execute in its own web context
// return "/files";
return "/ccm-rssfeed/files";
}
}