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

View File

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

View File

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

View File

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