Objektlisten zeigen jetzt auch ExtraXML an, wenn specialize true ist.
git-svn-id: https://svn.libreccm.org/ccm/trunk@1477 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
80209ce31b
commit
11177abc31
|
|
@ -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
|
|
@ -17,23 +17,20 @@ import java.util.Map;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Base class for {@link ExtraXMLGenerator}s for sub classes of
|
||||
* {@link GenericOrganizationalUnit}. The only method which has to be
|
||||
* <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
|
||||
* integrating the subclasses of this class by overwriting the
|
||||
* {@link ContentPage#getExtraXMLGenerators()}.
|
||||
* </p>
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
* @version $Id$
|
||||
* (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
|
||||
* integrating the subclasses of this class by overwriting the
|
||||
* {@link ContentPage#getExtraXMLGenerators()}. </p>
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
* @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(),
|
||||
|
|
@ -102,10 +106,10 @@ public abstract class GenericOrgaUnitExtraXmlGenerator
|
|||
}
|
||||
|
||||
/**
|
||||
* Can be used from a JSP template for Navigation to show only a specific
|
||||
* tab in category.
|
||||
*
|
||||
* @param showOnly
|
||||
* Can be used from a JSP template for Navigation to show only a specific
|
||||
* tab in category.
|
||||
*
|
||||
* @param showOnly
|
||||
*/
|
||||
public void setShowOnly(final String showOnly) {
|
||||
this.showOnly = showOnly;
|
||||
|
|
@ -124,25 +128,16 @@ 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>
|
||||
*
|
||||
* @return
|
||||
* </code> </p>
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public abstract String getTabConfig();
|
||||
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ class ItemLifecycleItemPane extends BaseItemPane {
|
|||
newInstance(OID.valueOf(itemOid));
|
||||
PublishLock.getInstance().lock(item);
|
||||
republish(item, false);
|
||||
PublishLock.getInstance().unlock(item);
|
||||
PublishLock.getInstance().unlock(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
|||
public void run() {
|
||||
PublishLock.getInstance().lock(item);
|
||||
publisher.publish();
|
||||
PublishLock.getInstance().unlock(item);
|
||||
PublishLock.getInstance().unlock(item);
|
||||
}
|
||||
};
|
||||
final Thread thread = new Thread(threadAction);
|
||||
|
|
@ -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); }
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class PublishLock {
|
|||
public final static String TIMESTAMP = "timestamp";
|
||||
public final static String ACTION = "action";
|
||||
public final static String ERROR = "error";
|
||||
private static PublishLock instance = new PublishLock();
|
||||
private static PublishLock instance = new PublishLock();
|
||||
|
||||
private PublishLock() {
|
||||
}
|
||||
|
|
@ -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();
|
||||
|
|
@ -94,7 +96,7 @@ public class PublishLock {
|
|||
collection.close();
|
||||
SessionManager.getSession().getTransactionContext().commitTxn();
|
||||
}
|
||||
|
||||
|
||||
protected synchronized boolean hasError(final ContentItem item) {
|
||||
final DataCollection collection = SessionManager.getSession().retrieve(
|
||||
LOCK_OBJECT_TYPE);
|
||||
|
|
@ -105,7 +107,7 @@ public class PublishLock {
|
|||
return false;
|
||||
} else {
|
||||
collection.next();
|
||||
|
||||
|
||||
final DataObject lock = collection.getDataObject();
|
||||
if (ERROR.equals(lock.get(ACTION).toString())) {
|
||||
collection.close();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue