Diverse Korrekturen an Update scripten.

git-svn-id: https://svn.libreccm.org/ccm/trunk@618 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2010-11-17 23:09:57 +00:00
parent 527322cd0b
commit 975d6fefd3
8 changed files with 54 additions and 60 deletions

View File

@ -0,0 +1,26 @@
--
-- Copyright (C) 2010 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_acs_objects.sql $
update acs_objects
set (object_type,display_name,default_domain_class) =
('com.arsdigita.cms.contentassets.ItemImageAttachment' ,
'com.arsdigita.cms.contentassets.ItemImageAttachment ' || object_id ,
'com.arsdigita.cms.contentassets.ItemImageAttachment' )
where default_domain_class like 'com.arsdigita.cms.contenttypes.ItemImageAttachment' ;

View File

@ -2,3 +2,4 @@
PROMPT ImageStep 6.6.0 -> 6.6.1 Upgrade Script (Oracle) PROMPT ImageStep 6.6.0 -> 6.6.1 Upgrade Script (Oracle)
@@ ../default/upgrade/6.6.0-6.6.1/upd_inits.sql @@ ../default/upgrade/6.6.0-6.6.1/upd_inits.sql
@@ ../default/upgrade/6.6.0-6.6.1/upd_acs_objects.sql

View File

@ -3,5 +3,6 @@
begin; begin;
\i ../default/upgrade/6.6.0-6.6.1/upd_inits.sql \i ../default/upgrade/6.6.0-6.6.1/upd_inits.sql
\i ../default/upgrade/6.6.0-6.6.1/upd_acs_objects.sql
commit; commit;

View File

@ -24,12 +24,3 @@ update acs_objects
'com.arsdigita.cms.contentassets.Note ' || object_id , 'com.arsdigita.cms.contentassets.Note ' || object_id ,
'com.arsdigita.cms.contentassets.Note' ) 'com.arsdigita.cms.contentassets.Note' )
where default_domain_class like 'com.arsdigita.london.notes.Note' ; where default_domain_class like 'com.arsdigita.london.notes.Note' ;
-- update acs_objects
-- set object_type = 'com.arsdigita.cms.contentassets.Note'
-- where object_type like 'com.arsdigita.london.notes.Note' ;
-- update acs_objects
-- set default_domain_class = 'com.arsdigita.cms.contentassets.Note'
-- where default_domain_class like 'com.arsdigita.london.notes.Note' ;

View File

@ -16,4 +16,4 @@
-- $Id: upd_table_cms_tel_links.sql pboy $ -- $Id: upd_table_cms_tel_links.sql pboy $
alter table cms_related_links alter table cms_related_links
add column link__list_name varchar(100); add column link_list_name varchar(100);

View File

@ -557,8 +557,8 @@ public final class LoaderConfig extends AbstractConfig {
* Retrieve the * Retrieve the
*/ */
public List getContentSectionsContentTypes() { public List getContentSectionsContentTypes() {
String[] taskAlerts = (String[]) get(m_contentTypeList); String[] contentTypes = (String[]) get(m_contentTypeList);
return Arrays.asList(taskAlerts); return Arrays.asList(contentTypes);
} }

View File

@ -405,7 +405,7 @@ public final class ContentSectionSetup {
} }
/** /**
* Steps through a list of congtent types to be available for this content * Steps through a list of content types to be available for this content
* section and delegates processing of each type. * section and delegates processing of each type.
* *
* @param types list of content types to be available for this content section * @param types list of content types to be available for this content section

View File

@ -82,8 +82,7 @@ public class CreateGenericContentTypes extends Program {
// add new generic content types // add new generic content types
tc.beginTxn(); tc.beginTxn();
String[] ctDefFiles = new String[] String[] ctDefFiles = new String[]{"/WEB-INF/content-types/GenericAddress.xml",
{"/WEB-INF/content-types/GenericAddress.xml",
"/WEB-INF/content-types/GenericArticle.xml", "/WEB-INF/content-types/GenericArticle.xml",
"/WEB-INF/content-types/GenericContact.xml", "/WEB-INF/content-types/GenericContact.xml",
"/WEB-INF/content-types/GenericOrganizationalUnit.xml", "/WEB-INF/content-types/GenericOrganizationalUnit.xml",
@ -100,55 +99,30 @@ public class CreateGenericContentTypes extends Program {
tc.commitTxn(); // save database additions for re-reading tc.commitTxn(); // save database additions for re-reading
// add the dependency hierarchie to any installed ct // add the dependency hierarchie to any installed ct
/* Das sollte ueberfluessig sein.
tc.beginTxn(); tc.beginTxn();
ContentTypeCollection ctc = ContentType.getAllContentTypes(); ContentTypeCollection ctc = ContentType.getAllContentTypes();
s_log.error("Starte content types update"); s_log.debug("Starte content types update");
while (ctc.next()) { while (ctc.next()) {
ContentType ct = ctc.getContentType(); ContentType ct = ctc.getContentType();
s_log.error("Verarbeite " + ct.getClassName()); s_log.debug("Verarbeite " + ct.getClassName());
createPedigree(ct); createPedigree(ct);
} }
tc.commitTxn(); tc.commitTxn();
*/
} }
}.run(); }.run();
} }
/*
private boolean isLoadableInto(ContentSection section) {
if (section == null) {
throw new NullPointerException("section");
}
if (getContentSections().size() > 0) {
return getContentSections().contains(section.getName());
} else {
return ContentSection.getConfig().getDefaultContentSection().
equals(section.getName());
}
}
protected void prepareSection(final ContentSection section,
final ContentType type,
final LifecycleDefinition ld,
final WorkflowTemplate wf) {
ContentTypeLifecycleDefinition.updateLifecycleDefinition(section, type, ld);
ContentTypeWorkflowTemplate.updateWorkflowTemplate(section, type, wf);
}
protected List getContentSections() {
return java.util.Collections.EMPTY_LIST;
}
*/
/** /**
* Generates the pedigree for new content types created during update. * Generates the pedigree for new content types created during update.
* *
@ -166,36 +140,35 @@ public class CreateGenericContentTypes extends Program {
// This is a brute force method, but I can't come up with something // This is a brute force method, but I can't come up with something
// better atm without changing either all Loader or the xml-files. // better atm without changing either all Loader or the xml-files.
while (cts.next()) { while (cts.next()) {
ContentType ct = cts.getContentType(); ContentType ct = cts.getContentType();
try { try {
Class.forName(type.getClassName()).asSubclass(Class.forName(ct.getClassName())); Class.forName(type.getClassName()).asSubclass(Class.forName(ct.getClassName()));
} catch (Exception ex) { } catch (Exception ex) {
// This cast is not valid so type is not a sublacss of ct // This cast is not valid so type is not a subclass of ct
continue; continue;
}
s_log.debug("Possible Parent: " + ct.getClassName());
} // Save the current ct as possible parent if we haven't found any parent yet // Save the current ct as possible parent if we haven't found any parent yet
// or if the current ancestor list is longer than that one from the possible // or if the current ancestor list is longer than that one from the possible
// parent earlier found // parent earlier found
if (parent == null if (!type.getClassName().equals(ct.getClassName())
&& (parent == null
|| (parent.getAncestors() != null || (parent.getAncestors() != null
&& ct.getAncestors() != null && ct.getAncestors() != null
&& parent.getAncestors().length() < ct.getAncestors().length())) { && parent.getAncestors().length() < ct.getAncestors().length()))) {
parent = ct; parent = ct;
} }
} }
// If there is a valid parent content type create the pedigree // If there is a valid parent content type create the pedigree
if (parent != null && !parent.getClassName().equals(type.getClassName())) { if (parent != null && !parent.getClassName().equals(type.getClassName())) {
s_log.debug(type.getClassName() + " is a subtype of "
+ parent.getClassName());
if (parent.getAncestors() != null) { if (parent.getAncestors() != null) {
String parentAncestors = parent.getAncestors(); String parentAncestors = parent.getAncestors();
@ -219,13 +192,13 @@ public class CreateGenericContentTypes extends Program {
} catch (Exception ex) { } catch (Exception ex) {
s_log.error("The db is broken.");
// The db is broken. There is no content type for this ID // The db is broken. There is no content type for this ID
} }
// Add parent ancestor // Add parent ancestor
type.addAncestor(ctID); type.addAncestor(ctID);
} }
} }
@ -236,5 +209,7 @@ public class CreateGenericContentTypes extends Program {
parent.addSiblings(type.getID()); parent.addSiblings(type.getID());
} }
s_log.debug("Method Pedigree finished");
} }
} }