Diverse Korrekturen an Update scripten.
git-svn-id: https://svn.libreccm.org/ccm/trunk@618 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
527322cd0b
commit
975d6fefd3
|
|
@ -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' ;
|
||||
|
|
@ -2,3 +2,4 @@
|
|||
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_acs_objects.sql
|
||||
|
|
|
|||
|
|
@ -3,5 +3,6 @@
|
|||
begin;
|
||||
|
||||
\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;
|
||||
|
|
|
|||
|
|
@ -24,12 +24,3 @@ update acs_objects
|
|||
'com.arsdigita.cms.contentassets.Note ' || object_id ,
|
||||
'com.arsdigita.cms.contentassets.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' ;
|
||||
|
|
@ -16,4 +16,4 @@
|
|||
-- $Id: upd_table_cms_tel_links.sql pboy $
|
||||
|
||||
alter table cms_related_links
|
||||
add column link__list_name varchar(100);
|
||||
add column link_list_name varchar(100);
|
||||
|
|
|
|||
|
|
@ -557,8 +557,8 @@ public final class LoaderConfig extends AbstractConfig {
|
|||
* Retrieve the
|
||||
*/
|
||||
public List getContentSectionsContentTypes() {
|
||||
String[] taskAlerts = (String[]) get(m_contentTypeList);
|
||||
return Arrays.asList(taskAlerts);
|
||||
String[] contentTypes = (String[]) get(m_contentTypeList);
|
||||
return Arrays.asList(contentTypes);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
* @param types list of content types to be available for this content section
|
||||
|
|
|
|||
|
|
@ -82,12 +82,11 @@ public class CreateGenericContentTypes extends Program {
|
|||
// add new generic content types
|
||||
tc.beginTxn();
|
||||
|
||||
String[] ctDefFiles = new String[]
|
||||
{"/WEB-INF/content-types/GenericAddress.xml",
|
||||
"/WEB-INF/content-types/GenericArticle.xml",
|
||||
"/WEB-INF/content-types/GenericContact.xml",
|
||||
"/WEB-INF/content-types/GenericOrganizationalUnit.xml",
|
||||
"/WEB-INF/content-types/GenericPerson.xml"};
|
||||
String[] ctDefFiles = new String[]{"/WEB-INF/content-types/GenericAddress.xml",
|
||||
"/WEB-INF/content-types/GenericArticle.xml",
|
||||
"/WEB-INF/content-types/GenericContact.xml",
|
||||
"/WEB-INF/content-types/GenericOrganizationalUnit.xml",
|
||||
"/WEB-INF/content-types/GenericPerson.xml"};
|
||||
|
||||
if (ctDefFiles != null) {
|
||||
for (int i = 0; i < ctDefFiles.length; i++) {
|
||||
|
|
@ -100,55 +99,30 @@ public class CreateGenericContentTypes extends Program {
|
|||
tc.commitTxn(); // save database additions for re-reading
|
||||
|
||||
// add the dependency hierarchie to any installed ct
|
||||
/* Das sollte ueberfluessig sein.
|
||||
tc.beginTxn();
|
||||
|
||||
ContentTypeCollection ctc = ContentType.getAllContentTypes();
|
||||
|
||||
s_log.error("Starte content types update");
|
||||
s_log.debug("Starte content types update");
|
||||
|
||||
while (ctc.next()) {
|
||||
|
||||
ContentType ct = ctc.getContentType();
|
||||
|
||||
s_log.error("Verarbeite " + ct.getClassName());
|
||||
s_log.debug("Verarbeite " + ct.getClassName());
|
||||
|
||||
createPedigree(ct);
|
||||
|
||||
}
|
||||
|
||||
tc.commitTxn();
|
||||
*/
|
||||
}
|
||||
}.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.
|
||||
*
|
||||
|
|
@ -166,36 +140,35 @@ public class CreateGenericContentTypes extends Program {
|
|||
// 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.
|
||||
|
||||
|
||||
while (cts.next()) {
|
||||
ContentType ct = cts.getContentType();
|
||||
|
||||
|
||||
|
||||
try {
|
||||
Class.forName(type.getClassName()).asSubclass(Class.forName(ct.getClassName()));
|
||||
|
||||
|
||||
} 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;
|
||||
}
|
||||
|
||||
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
|
||||
// parent earlier found
|
||||
if (parent == null
|
||||
if (!type.getClassName().equals(ct.getClassName())
|
||||
&& (parent == null
|
||||
|| (parent.getAncestors() != null
|
||||
&& ct.getAncestors() != null
|
||||
&& parent.getAncestors().length() < ct.getAncestors().length())) {
|
||||
&& parent.getAncestors().length() < ct.getAncestors().length()))) {
|
||||
parent = ct;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// If there is a valid parent content type create the pedigree
|
||||
if (parent != null && !parent.getClassName().equals(type.getClassName())) {
|
||||
s_log.debug(type.getClassName() + " is a subtype of "
|
||||
+ parent.getClassName());
|
||||
|
||||
if (parent.getAncestors() != null) {
|
||||
String parentAncestors = parent.getAncestors();
|
||||
|
||||
|
|
@ -219,13 +192,13 @@ public class CreateGenericContentTypes extends Program {
|
|||
|
||||
|
||||
} catch (Exception ex) {
|
||||
s_log.error("The db is broken.");
|
||||
// The db is broken. There is no content type for this ID
|
||||
}
|
||||
|
||||
// Add parent ancestor
|
||||
type.addAncestor(ctID);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -236,5 +209,7 @@ public class CreateGenericContentTypes extends Program {
|
|||
parent.addSiblings(type.getID());
|
||||
|
||||
}
|
||||
|
||||
s_log.debug("Method Pedigree finished");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue