Objektlisten zeigen jetzt auch ExtraXML an, wenn specialize true ist.

git-svn-id: https://svn.libreccm.org/ccm/trunk@1477 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2012-01-29 13:07:33 +00:00
parent 80209ce31b
commit 11177abc31
7 changed files with 416 additions and 389 deletions

View File

@ -600,7 +600,7 @@ public final class CMSConfig extends AbstractConfig {
private final Parameter m_threadPublishing = new BooleanParameter( private final Parameter m_threadPublishing = new BooleanParameter(
"com.arsdigita.cms.lifecycle.threaded_publishing", "com.arsdigita.cms.lifecycle.threaded_publishing",
Parameter.REQUIRED, Parameter.REQUIRED,
false); true);
// /////////////////////////////////////////// // ///////////////////////////////////////////
// publishToFile package related parameter // publishToFile package related parameter

File diff suppressed because it is too large Load Diff

View File

@ -17,23 +17,20 @@ import java.util.Map;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
* <p> * <p> Base class for {@link ExtraXMLGenerator}s for sub classes of
* Base class for {@link ExtraXMLGenerator}s for sub classes of
* {@link GenericOrganizationalUnit}. The only method which has to be * {@link GenericOrganizationalUnit}. The only method which has to be
* overwritten is {@link #getTabConfig()}. This method will return the tabs * overwritten is {@link #getTabConfig()}. This method will return the tabs
* (instances of implementations of {@link GenericOrgaUnitTab}). The * (instances of implementations of {@link GenericOrgaUnitTab}). The
* {@link #generateXML(com.arsdigita.cms.ContentItem, com.arsdigita.xml.Element, com.arsdigita.bebop.PageState)} * {@link #generateXML(com.arsdigita.cms.ContentItem, com.arsdigita.xml.Element, com.arsdigita.bebop.PageState)}
* method delegates the XML creation to this objects. * method delegates the XML creation to this objects. </p> <p>
* </p> * {@link GenericOrganizationalUnit} does not include this generator. The
* <p> * subclasses of {@link GenericOrganizationalUnit} are responsible for
* {@link GenericOrganizationalUnit} does not include this generator.
* The subclasses of {@link GenericOrganizationalUnit} are responsible for
* integrating the subclasses of this class by overwriting the * integrating the subclasses of this class by overwriting the
* {@link ContentPage#getExtraXMLGenerators()}. * {@link ContentPage#getExtraXMLGenerators()}. </p>
* </p>
* *
* @author Jens Pelzetter * @author Jens Pelzetter
* @version $Id$ * @version $Id: GenericOrgaUnitExtraXmlGenerator.java 1186 2011-10-21 18:20:36Z
* jensp $
*/ */
public abstract class GenericOrgaUnitExtraXmlGenerator public abstract class GenericOrgaUnitExtraXmlGenerator
implements ExtraXMLGenerator { implements ExtraXMLGenerator {
@ -62,7 +59,8 @@ public abstract class GenericOrgaUnitExtraXmlGenerator
final GenericOrganizationalUnit orgaunit = final GenericOrganizationalUnit orgaunit =
(GenericOrganizationalUnit) item; (GenericOrganizationalUnit) item;
final Map<String, GenericOrgaUnitTab> tabs = final Map<String, GenericOrgaUnitTab> tabs =
processTabConfig(getTabConfig()); processTabConfig(
getTabConfig());
String selected = state.getRequest().getParameter( String selected = state.getRequest().getParameter(
SELECTED_TAB_PARAM); SELECTED_TAB_PARAM);
if (showOnly != null && !showOnly.isEmpty()) { if (showOnly != null && !showOnly.isEmpty()) {
@ -73,7 +71,8 @@ public abstract class GenericOrgaUnitExtraXmlGenerator
} }
final long availableStart = System.currentTimeMillis(); final long availableStart = System.currentTimeMillis();
if ((showOnly == null) || showOnly.isEmpty()) { if ((showOnly == null) || showOnly.isEmpty()) {
for (Map.Entry<String, GenericOrgaUnitTab> entry : tabs.entrySet()) { for (Map.Entry<String, GenericOrgaUnitTab> entry :
tabs.entrySet()) {
if (entry.getValue().hasData(orgaunit)) { if (entry.getValue().hasData(orgaunit)) {
createAvailableTabElem(availableTabsElem, createAvailableTabElem(availableTabsElem,
entry.getKey(), entry.getKey(),
@ -81,20 +80,25 @@ public abstract class GenericOrgaUnitExtraXmlGenerator
} }
} }
} }
logger.debug(String.format("Created available tabs XML for " logger.debug(String.format(
"Created available tabs XML for "
+ "GenericOrganizationalUnit '%s' in %d ms.", + "GenericOrganizationalUnit '%s' in %d ms.",
orgaunit.getName(), orgaunit.getName(),
System.currentTimeMillis() - availableStart)); System.currentTimeMillis()
- availableStart));
if (tabs.containsKey(selected) && tabs.get(selected).hasData(orgaunit)) { if (tabs.containsKey(selected) && tabs.get(selected).hasData(
orgaunit)) {
final GenericOrgaUnitTab selectedTab = tabs.get(selected); final GenericOrgaUnitTab selectedTab = tabs.get(selected);
final Element selectedTabElem = orgaUnitTabsElem.newChildElement( final Element selectedTabElem =
orgaUnitTabsElem.newChildElement(
"selectedTab"); "selectedTab");
selectedTab.generateXml(orgaunit, selectedTabElem, state); selectedTab.generateXml(orgaunit, selectedTabElem, state);
} else { } else {
orgaUnitTabsElem.newChildElement("selectedTabNotAvailable"); orgaUnitTabsElem.newChildElement("selectedTabNotAvailable");
} }
logger.debug(String.format("Generated XML for GenericOrganizationalUnit " logger.debug(String.format("Generated XML for GenericOrganizationalUnit "
+ "'%s' in %d ms", + "'%s' in %d ms",
orgaunit.getName(), orgaunit.getName(),
@ -124,23 +128,14 @@ public abstract class GenericOrgaUnitExtraXmlGenerator
} }
/** /**
* <p> * <p> This method should return a string containing all tabs to use. The
* This method should return a string containing all tabs to use. The string * string must have to following format: </p> <p>
* must have to following format:
* </p>
* <p>
* <code> * <code>
* tabName:fullyQualifedClassName;... * tabName:fullyQualifedClassName;...
* </code> * </code> </p> <p> Example: </p> <p>
* </p>
* <p>
* Example:
* </p>
* <p>
* <code> * <code>
* foo:com.arsdigita.cms.contenttypes.ui.FooTab;bar:com.arsdigita.cms.contenttypes.BarTab;fooBar:com.arsdigita.cms.contenttypes.ui.FooBarTab * foo:com.arsdigita.cms.contenttypes.ui.FooTab;bar:com.arsdigita.cms.contenttypes.BarTab;fooBar:com.arsdigita.cms.contenttypes.ui.FooBarTab
* </code> * </code> </p>
* </p>
* *
* @return * @return
*/ */

View File

@ -529,9 +529,9 @@ class ItemLifecycleSelectForm extends BaseForm {
* "com.arsdigita.cms.lifecycle.NotifyLifecycleListener"); * "com.arsdigita.cms.lifecycle.NotifyLifecycleListener");
* expirationImminentPhase.save(); } } * expirationImminentPhase.save(); } }
* *
* // Force the lifecycle scheduler to run to avoid any // scheduler * // Force the lifecycle scheduler to run to avoid any //
* delay for items that should be published // immediately. * scheduler delay for items that should be published //
* pending.getLifecycle().start(); * immediately. pending.getLifecycle().start();
* *
* item.save(); * item.save();
* *
@ -542,8 +542,7 @@ class ItemLifecycleSelectForm extends BaseForm {
* active. if * active. if
* (ContentSection.getConfig().getUseStreamlinedCreation()) { throw * (ContentSection.getConfig().getUseStreamlinedCreation()) { throw
* new RedirectSignal(URL.there(state.getRequest(), * new RedirectSignal(URL.there(state.getRequest(),
* Utilities.getWorkspaceURL()), true); * Utilities.getWorkspaceURL()), true); }
}
*/ */
} }
} }

View File

@ -57,8 +57,10 @@ public class PublishLock {
if (!collection.isEmpty()) { if (!collection.isEmpty()) {
collection.next(); collection.next();
final DataObject lock = collection.getDataObject(); final DataObject lock = collection.getDataObject();
if (!(ERROR.equals(lock.get(ACTION)))) {
lock.delete(); lock.delete();
} }
}
collection.close(); collection.close();
SessionManager.getSession().getTransactionContext().commitTxn(); SessionManager.getSession().getTransactionContext().commitTxn();
} }

View File

@ -19,6 +19,7 @@ package com.arsdigita.navigation.cms;
import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ContentItemXMLRenderer; import com.arsdigita.cms.ContentItemXMLRenderer;
import com.arsdigita.cms.ExtraXMLGenerator;
import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.kernel.ACSObject; import com.arsdigita.kernel.ACSObject;
import com.arsdigita.navigation.DataCollectionRenderer; import com.arsdigita.navigation.DataCollectionRenderer;
@ -29,10 +30,20 @@ import com.arsdigita.xml.Element;
public class CMSDataCollectionRenderer extends DataCollectionRenderer { public class CMSDataCollectionRenderer extends DataCollectionRenderer {
private boolean useExtraXml = true;
public CMSDataCollectionRenderer() { public CMSDataCollectionRenderer() {
addAttribute("masterVersion.id"); addAttribute("masterVersion.id");
} }
public boolean getUseExtraXml() {
return useExtraXml;
}
public void setUseExtraXml(final boolean useExtraXml) {
this.useExtraXml = useExtraXml;
}
protected String getStableURL(DataObject dobj, protected String getStableURL(DataObject dobj,
ACSObject obj) { ACSObject obj) {
if (obj == null) { if (obj == null) {
@ -64,6 +75,15 @@ public class CMSDataCollectionRenderer extends DataCollectionRenderer {
* using DataCollectionRenderer#setSpecializeObjectsContext(String). * using DataCollectionRenderer#setSpecializeObjectsContext(String).
*/ */
renderer.walk(obj, getSpecializeObjectsContext()); renderer.walk(obj, getSpecializeObjectsContext());
if ((obj instanceof ContentItem) && useExtraXml) {
final ContentItem contentItem = (ContentItem) obj;
for(ExtraXMLGenerator generator : contentItem.getExtraListXMLGenerators()) {
generator.generateXML(contentItem, item, null);
}
}
} }
} }
} }