CMS: Erstellung neuer content sections implementiert.

git-svn-id: https://svn.libreccm.org/ccm/trunk@591 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2010-10-29 06:45:00 +00:00
parent 5751398d42
commit 07d864b427
3 changed files with 52 additions and 27 deletions

View File

@ -46,6 +46,9 @@ public class ContentSectionCollection extends DomainCollection {
* Set the order of this Collection. This method needs to be called
* before <code>next()</code> is called on this collection.
*
* @param order: name of the pdl property to use for sorting the collection
* (e.g. "primaryURL" in order to sort by section name
* see c.ad.london.util.cmd.SiteMapList as an example ).
*/
public void addOrder(String order) {
m_dataCollection.addOrder(order);

View File

@ -85,9 +85,6 @@ public final class ContentSectionSetup {
private WorkflowTemplate m_wf;
final ContentSection m_section;
// Load main CMS configuration file
private static final LoaderConfig s_conf = new LoaderConfig();
/**
* Constructor. Using this constructor the content section has to be
@ -133,8 +130,6 @@ public final class ContentSectionSetup {
// section specific categories, usually not used.
if (useSectionCategories) {
// Iterator files = ((List) m_conf.getParameter(CATEGORIES)).iterator();
// Iterator files = s_conf.getCategoryFileList().iterator();
Iterator files = categoryFileList.iterator();
while ( files.hasNext() ) {
setup.registerCategories((String) files.next());

View File

@ -31,12 +31,12 @@ import com.arsdigita.cms.workflow.UnfinishedTaskNotifier;
// import com.arsdigita.persistence.TransactionContext;
import com.arsdigita.runtime.CompoundInitializer;
// import com.arsdigita.runtime.ConfigError;
// import com.arsdigita.runtime.DataInitEvent;
import com.arsdigita.runtime.ContextInitEvent;
import com.arsdigita.runtime.ContextCloseEvent;
// import com.arsdigita.runtime.DomainInitEvent;
// import com.arsdigita.runtime.DataInitEvent;
import com.arsdigita.runtime.DomainInitEvent;
// import com.arsdigita.util.Assert;
// import com.arsdigita.web.Application;
import com.arsdigita.web.Application;
import com.arsdigita.cms.workflow.CMSTask;
// import java.math.BigDecimal;
@ -96,25 +96,52 @@ public class Initializer extends CompoundInitializer {
// }
// Currently nothing to do here. Will be changed in the ongoing migration process
// /**
// * Initializes domain-coupling machinery, usually consisting of
// * registering object instantiators and observers.
// *
// */
// public void init(DomainInitEvent evt) {
// s_log.debug("CMS.installer.Initializer.init(DomainInitEvent) invoked");
//
// // Recursive invokation of init, is it really necessary??
// // On the other hand:
// // An empty implementations prevents this initializer from being executed.
// // A missing implementations causes the super class method to be executed,
// // which invokes the above added LegacyInitializer.
// // If super is not invoked, various other cms sub-initializer may not run.
// super.init(evt);
//
//
// s_log.debug("CMS.installer.Initializer.init(DomainInitEvent) completed");
// }
/**
* Initializes domain-coupling machinery, usually consisting of
* registering object instantiators and observers.
*
*/
public void init(DomainInitEvent evt) {
s_log.debug("CMS.installer.Initializer.init(DomainInitEvent) invoked");
// Recursive invokation of init!
// An empty implementations prevents this initializer from being executed.
super.init(evt);
// Check here weather a new content section has to be created.
String newSectionName = s_conf.getNewContentSectionName();
if (newSectionName != null && !newSectionName.isEmpty() ) {
ContentSectionCollection sections=ContentSection.getAllSections();
sections.addEqualsFilter( Application.PRIMARY_URL,
"/" + newSectionName + "/" );
ContentSection section;
if( sections.next() ) {
// Section with the configured name already exists
s_log.debug( "Content section " + newSectionName +
" already exists, skipping creation task." );
section = sections.getContentSection();
sections.close();
} else {
s_log.debug( "Content section " + newSectionName + " in " +
" doesn't exist, creating it." );
ContentSectionSetup.setupContentSectionAppInstance
(newSectionName,
s_conf.getStuffGroup(),
s_conf.isPubliclyViewable(),
s_conf.getItemResolverClass(),
s_conf.getTemplateResolverClass(),
s_conf.getContentSectionsContentTypes(),
s_conf.getUseSectionCategories(),
s_conf.getCategoryFileList()
);
}
}
s_log.debug("CMS.installer.Initializer.init(DomainInitEvent) completed");
}
/**