- RIS-Exporter optimiert
- Formatierungen git-svn-id: https://svn.libreccm.org/ccm/trunk@1677 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
697835822b
commit
986acd393e
|
|
@ -48,6 +48,7 @@ public class ContentItemXMLRenderer extends DomainObjectXMLRenderer {
|
|||
final String path,
|
||||
final String context,
|
||||
final DomainObject linkObject) {
|
||||
final long start = System.nanoTime();
|
||||
|
||||
DomainObject nObj = obj;
|
||||
|
||||
|
|
@ -58,6 +59,8 @@ public class ContentItemXMLRenderer extends DomainObjectXMLRenderer {
|
|||
}
|
||||
|
||||
super.walk(adapter, nObj, path, context, linkObject);
|
||||
|
||||
System.out.printf("Walked object in %d ms\n", (System.nanoTime() - start) / 1000000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ public class GenericPersonExtraXmlGenerator implements ExtraXMLGenerator {
|
|||
|
||||
final Element contactsElem = element.newChildElement("contacts");
|
||||
while (contacts.next()) {
|
||||
final GenericContact contact = contacts.getContact(GlobalizationHelper.getNegotiatedLocale().getLanguage());
|
||||
generateContactXml(
|
||||
contactsElem,
|
||||
contacts.getContact(GlobalizationHelper.getNegotiatedLocale().
|
||||
getLanguage()),
|
||||
contact,
|
||||
state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,12 +133,14 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
|||
* @param useContext The use context
|
||||
*/
|
||||
public void generateXML(PageState state, Element parent, String useContext) {
|
||||
final long start = System.nanoTime();
|
||||
|
||||
ContentSection section = CMS.getContext().getContentSection();
|
||||
//ContentSection section = CMS.getContext().getContentSection();
|
||||
ContentItem item = getContentItem(state);
|
||||
|
||||
s_log.info("Generate XML for item " + item.getOID());
|
||||
System.out.printf("After getting contentitem: %d ms\n", (System.nanoTime() - start) / 1000000);
|
||||
|
||||
s_log.info("Generate XML for item " + item.getOID());
|
||||
|
||||
Party currentParty = Kernel.getContext().getParty();
|
||||
if (currentParty == null) {
|
||||
|
|
@ -164,6 +166,8 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
|||
}
|
||||
String className = item.getDefaultDomainClass();
|
||||
|
||||
System.out.printf("After creating permission attributes: %d ms\n", (System.nanoTime() - start) / 1000000);
|
||||
|
||||
// Ensure correct subtype of ContentItem is instantiated
|
||||
if (!item.getClass().getName().equals(className)) {
|
||||
s_log.info("Specializing item");
|
||||
|
|
@ -179,6 +183,8 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
System.out.printf("After checking type: %d ms\n", (System.nanoTime() - start) / 1000000);
|
||||
|
||||
// Implementing XMLGenerator directly is now deprecated
|
||||
if (item instanceof XMLGenerator) {
|
||||
s_log.info("Item implements XMLGenerator interface");
|
||||
|
|
@ -206,6 +212,8 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
|||
|
||||
renderer.walk(item, ADAPTER_CONTEXT);
|
||||
|
||||
System.out.printf("After getting rendering standard item xml: %d ms\n", (System.nanoTime() - start) / 1000000);
|
||||
|
||||
//parent.addContent(content);
|
||||
|
||||
/*
|
||||
|
|
@ -222,6 +230,8 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
|||
generator.generateXML(item, content, state);
|
||||
}
|
||||
}
|
||||
|
||||
System.out.printf("After rendering extra xml: %d ms\n", (System.nanoTime() - start) / 1000000);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,33 +40,23 @@ import java.util.HashSet;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* <p>This class provides a general purpose framework for iterating
|
||||
* over a domain object's properties, processing attributes and
|
||||
* traversing associations as required.</p>
|
||||
* <p>This class provides a general purpose framework for iterating over a domain object's properties, processing
|
||||
* attributes and traversing associations as required.</p>
|
||||
*
|
||||
* <p>Subclasses should implement the startXXX and endXXX methods to
|
||||
* provide whatever processing logic they require upon encountering
|
||||
* attributes, roles, associations and objects.</p>
|
||||
* <p>Subclasses should implement the startXXX and endXXX methods to provide whatever processing logic they require upon
|
||||
* encountering attributes, roles, associations and objects.</p>
|
||||
*
|
||||
* <p>The {@link com.arsdigita.domain.DomainObjectTraversalAdapter}
|
||||
* provides a means to control which properties are processed and,
|
||||
* most importantly, which associations are traversed. When
|
||||
* registering an adapter, a 'use context' is supplied allowing
|
||||
* different adapters to be used according to the requirements of any
|
||||
* implementing subclass. It is recommended that the use context be
|
||||
* based on the fully qualified name of the class using
|
||||
* DomainObjectTraversal, e.g.,
|
||||
* <p>The {@link com.arsdigita.domain.DomainObjectTraversalAdapter} provides a means to control which properties are
|
||||
* processed and, most importantly, which associations are traversed. When registering an adapter, a 'use context' is
|
||||
* supplied allowing different adapters to be used according to the requirements of any implementing subclass. It is
|
||||
* recommended that the use context be based on the fully qualified name of the class using DomainObjectTraversal, e.g.,
|
||||
* com.arsdigita.cms.ui.DomainObjectRenderer.</p>
|
||||
*
|
||||
* <p>The path argument provided to the adapter and the startXXX ad
|
||||
* endXXX methods indicates which associations are currently being
|
||||
* traversed. The first element in the path is always '/object'. If it
|
||||
* then starts to traverse the 'rootCategory' association, the path
|
||||
* will become '/object/rootCategory'. For self-recursive
|
||||
* associations, rather than building up a long repeating string, the
|
||||
* path will be shortened by adding a '+' for each element that is
|
||||
* repeated. For example, '/object/container+' indicates that the
|
||||
* container association has been followed two or more times.</p>
|
||||
* <p>The path argument provided to the adapter and the startXXX ad endXXX methods indicates which associations are
|
||||
* currently being traversed. The first element in the path is always '/object'. If it then starts to traverse the
|
||||
* 'rootCategory' association, the path will become '/object/rootCategory'. For self-recursive associations, rather than
|
||||
* building up a long repeating string, the path will be shortened by adding a '+' for each element that is repeated.
|
||||
* For example, '/object/container+' indicates that the container association has been followed two or more times.</p>
|
||||
*/
|
||||
public abstract class DomainObjectTraversal {
|
||||
|
||||
|
|
@ -77,8 +67,7 @@ public abstract class DomainObjectTraversal {
|
|||
public final static String LINK_NAME = "link";
|
||||
|
||||
/**
|
||||
* Registers a traversal adapter for an object type in a given
|
||||
* context.
|
||||
* Registers a traversal adapter for an object type in a given context.
|
||||
*
|
||||
* @param type the object type whose items will be traversed
|
||||
* @param adapter the adapter for controlling object traversal
|
||||
|
|
@ -102,8 +91,7 @@ public abstract class DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Unregisters a traversal adapter for an object type in a
|
||||
* given context
|
||||
* Unregisters a traversal adapter for an object type in a given context
|
||||
*
|
||||
* @param type the object type whose items will be traversed
|
||||
* @param context the context in which the adapter should be used
|
||||
|
|
@ -121,8 +109,7 @@ public abstract class DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Registers a traversal adapter for an object type in a given
|
||||
* context.
|
||||
* Registers a traversal adapter for an object type in a given context.
|
||||
*
|
||||
* @param type the object type whose items will be traversed
|
||||
* @param adapter the adapter for controlling object traversal
|
||||
|
|
@ -137,8 +124,7 @@ public abstract class DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Unregisters a traversal adapter for an object type in a
|
||||
* given context
|
||||
* Unregisters a traversal adapter for an object type in a given context
|
||||
*
|
||||
* @param type the object type whose items will be traversed
|
||||
* @param context the context in which the adapter should be used
|
||||
|
|
@ -150,8 +136,7 @@ public abstract class DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Retrieves the traversal adapter for an object type in a given
|
||||
* context.
|
||||
* Retrieves the traversal adapter for an object type in a given context.
|
||||
*
|
||||
* @param type the object type to lookup
|
||||
* @param context the adapter context
|
||||
|
|
@ -172,10 +157,9 @@ public abstract class DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Retrieves the closest matching traversal adapter for an object type
|
||||
* in a given context. The algorithm looks for an exact match, then
|
||||
* considers the supertype, and the supertype's supertype. If no match
|
||||
* could be found at all, returns null
|
||||
* Retrieves the closest matching traversal adapter for an object type in a given context. The algorithm looks for
|
||||
* an exact match, then considers the supertype, and the supertype's supertype. If no match could be found at all,
|
||||
* returns null
|
||||
*
|
||||
* @param type the object type to search for
|
||||
* @param context the adapter context
|
||||
|
|
@ -212,8 +196,7 @@ public abstract class DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Walks over properties of a domain object, invoking
|
||||
* methods to handle associations, roles and attributes.
|
||||
* Walks over properties of a domain object, invoking methods to handle associations, roles and attributes.
|
||||
*
|
||||
* @param obj the domain object to traverse
|
||||
* @param context the context for the traversal adapter
|
||||
|
|
@ -290,7 +273,8 @@ public abstract class DomainObjectTraversal {
|
|||
prop,
|
||||
context)) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Not processing " + appendToPath(path, prop.getName()) + " in object " + oid + " and context "
|
||||
s_log.debug("Not processing " + appendToPath(path, prop.getName()) + " in object " + oid
|
||||
+ " and context "
|
||||
+ context + " with adapter " + adapter.getClass().
|
||||
getName());
|
||||
}
|
||||
|
|
@ -353,30 +337,17 @@ public abstract class DomainObjectTraversal {
|
|||
} else {
|
||||
//2010-11-08: Moved to seperate Methods to allow simple
|
||||
//extending of the handling of data assocications
|
||||
/*if (s_log.isDebugEnabled()) {
|
||||
s_log.debug(prop.getName() + " is a DataAssociation");
|
||||
}
|
||||
beginAssociation(obj, path, prop);
|
||||
|
||||
DataAssociationCursor daCursor =
|
||||
((DataAssociation) propValue).
|
||||
getDataAssociationCursor();
|
||||
|
||||
while (daCursor.next()) {
|
||||
s_log.debug("Processing data assoication cursor...");
|
||||
DataObject link = daCursor.getLink();
|
||||
DomainObject linkObj = null;
|
||||
if (link != null) {
|
||||
linkObj = new LinkDomainObject(link);
|
||||
}
|
||||
walk(adapter,
|
||||
DomainObjectFactory.newInstance(daCursor.
|
||||
getDataObject()),
|
||||
appendToPath(path, propName),
|
||||
context,
|
||||
linkObj);
|
||||
}
|
||||
endAssociation(obj, path, prop);*/
|
||||
/*
|
||||
* if (s_log.isDebugEnabled()) { s_log.debug(prop.getName() + " is a DataAssociation"); }
|
||||
* beginAssociation(obj, path, prop);
|
||||
*
|
||||
* DataAssociationCursor daCursor = ((DataAssociation) propValue). getDataAssociationCursor();
|
||||
*
|
||||
* while (daCursor.next()) { s_log.debug("Processing data assoication cursor..."); DataObject link =
|
||||
* daCursor.getLink(); DomainObject linkObj = null; if (link != null) { linkObj = new
|
||||
* LinkDomainObject(link); } walk(adapter, DomainObjectFactory.newInstance(daCursor.
|
||||
* getDataObject()), appendToPath(path, propName), context, linkObj); } endAssociation(obj, path, prop);
|
||||
*/
|
||||
|
||||
walkDataAssociations(adapter,
|
||||
obj,
|
||||
|
|
@ -442,38 +413,33 @@ public abstract class DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Method called when the processing of an object
|
||||
* starts
|
||||
* Method called when the processing of an object starts
|
||||
*/
|
||||
protected abstract void beginObject(DomainObject obj,
|
||||
String path);
|
||||
|
||||
/**
|
||||
* Method called when the procesing of an object
|
||||
* completes
|
||||
* Method called when the procesing of an object completes
|
||||
*/
|
||||
protected abstract void endObject(DomainObject obj,
|
||||
String path);
|
||||
|
||||
/**
|
||||
* Method called when the processing of a Link Object
|
||||
* starts
|
||||
* Method called when the processing of a Link Object starts
|
||||
*/
|
||||
protected void beginLink(DomainObject obj, String path) {
|
||||
s_log.debug(String.format("Starting link with path = %s", path));
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called when the procesing of a Link Object
|
||||
* completes
|
||||
* Method called when the procesing of a Link Object completes
|
||||
*/
|
||||
protected void endLink(DomainObject obj, String path) {
|
||||
s_log.debug(String.format("Finished link with path = %s", path));
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called when a previously visited object
|
||||
* is encountered for a second time.
|
||||
* Method called when a previously visited object is encountered for a second time.
|
||||
*/
|
||||
protected abstract void revisitObject(DomainObject obj,
|
||||
String path);
|
||||
|
|
@ -486,32 +452,28 @@ public abstract class DomainObjectTraversal {
|
|||
Property property);
|
||||
|
||||
/**
|
||||
* Method called when the processing of a role
|
||||
* starts
|
||||
* Method called when the processing of a role starts
|
||||
*/
|
||||
protected abstract void beginRole(DomainObject obj,
|
||||
String path,
|
||||
Property property);
|
||||
|
||||
/**
|
||||
* Method called when the procesing of a role
|
||||
* completes
|
||||
* Method called when the procesing of a role completes
|
||||
*/
|
||||
protected abstract void endRole(DomainObject obj,
|
||||
String path,
|
||||
Property property);
|
||||
|
||||
/**
|
||||
* Method called when the processing of an association
|
||||
* starts
|
||||
* Method called when the processing of an association starts
|
||||
*/
|
||||
protected abstract void beginAssociation(DomainObject obj,
|
||||
String path,
|
||||
Property property);
|
||||
|
||||
/**
|
||||
* Method called when the procesing of an association
|
||||
* completes
|
||||
* Method called when the procesing of an association completes
|
||||
*/
|
||||
protected abstract void endAssociation(DomainObject obj,
|
||||
String path,
|
||||
|
|
@ -585,8 +547,7 @@ public abstract class DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* this is simply a subclass since DomainObject is abstract
|
||||
* but we don't have any other domain object to use.
|
||||
* this is simply a subclass since DomainObject is abstract but we don't have any other domain object to use.
|
||||
*/
|
||||
protected class LinkDomainObject extends DomainObject {
|
||||
|
||||
|
|
|
|||
|
|
@ -37,10 +37,8 @@ import java.util.Locale;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* An implementation of DomainObjectTraversal that generates an XML
|
||||
* tree representing the DomainObject. The output format of the XML
|
||||
* can be controlled using the various setWrapXXX methods detailed
|
||||
* below.
|
||||
* An implementation of DomainObjectTraversal that generates an XML tree representing the DomainObject. The output
|
||||
* format of the XML can be controlled using the various setWrapXXX methods detailed below.
|
||||
*
|
||||
* @version $Id: DomainObjectXMLRenderer.java 2141 2011-01-16 12:17:15Z pboy $
|
||||
*/
|
||||
|
|
@ -61,8 +59,7 @@ public class DomainObjectXMLRenderer extends DomainObjectTraversal {
|
|||
private String m_context;
|
||||
|
||||
/**
|
||||
* Registers a traversal formatter for an object type in a given
|
||||
* context.
|
||||
* Registers a traversal formatter for an object type in a given context.
|
||||
*
|
||||
* @param type the object type whose items will be traversed
|
||||
* @param formatter the formatter for controlling object traversal
|
||||
|
|
@ -75,8 +72,7 @@ public class DomainObjectXMLRenderer extends DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Unregisteres a traversal formatter for an object type in a
|
||||
* given context
|
||||
* Unregisteres a traversal formatter for an object type in a given context
|
||||
*
|
||||
* @param type the object type whose items will be traversed
|
||||
* @param context the context in which the formatter should be used
|
||||
|
|
@ -87,8 +83,7 @@ public class DomainObjectXMLRenderer extends DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Registers a traversal formatter for an object type in a given
|
||||
* context.
|
||||
* Registers a traversal formatter for an object type in a given context.
|
||||
*
|
||||
* @param type the object type whose items will be traversed
|
||||
* @param formatter the formatter for controlling object traversal
|
||||
|
|
@ -109,8 +104,7 @@ public class DomainObjectXMLRenderer extends DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Unregisteres a traversal formatter for an object type in a
|
||||
* given context
|
||||
* Unregisteres a traversal formatter for an object type in a given context
|
||||
*
|
||||
* @param type the object type whose items will be traversed
|
||||
* @param context the context in which the formatter should be used
|
||||
|
|
@ -122,8 +116,7 @@ public class DomainObjectXMLRenderer extends DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Retrieves the traversal formatter for an object type in a given
|
||||
* context.
|
||||
* Retrieves the traversal formatter for an object type in a given context.
|
||||
*
|
||||
* @param type the object type to lookup
|
||||
* @param context the formatter context
|
||||
|
|
@ -135,10 +128,9 @@ public class DomainObjectXMLRenderer extends DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Retrieves the closest matching traversal formatter for an object type
|
||||
* in a given context. The algorithm looks for an exact match, then
|
||||
* considers the supertype, and the supertype's supertype. If no match
|
||||
* could be found at all, returns null
|
||||
* Retrieves the closest matching traversal formatter for an object type in a given context. The algorithm looks for
|
||||
* an exact match, then considers the supertype, and the supertype's supertype. If no match could be found at all,
|
||||
* returns null
|
||||
*
|
||||
* @param type the object type to search for
|
||||
* @param context the formatter context
|
||||
|
|
@ -157,9 +149,7 @@ public class DomainObjectXMLRenderer extends DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a new DomainObject XML renderer
|
||||
* that outputs XML into the element passed into
|
||||
* the constructor.
|
||||
* Creates a new DomainObject XML renderer that outputs XML into the element passed into the constructor.
|
||||
*
|
||||
* @param root the XML element in which to output children
|
||||
*/
|
||||
|
|
@ -198,7 +188,8 @@ public class DomainObjectXMLRenderer extends DomainObjectTraversal {
|
|||
rendered = null;
|
||||
}
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("FALLBACK supertype " + objectType + " formatter=" + formatter + " rendered=" + rendered);
|
||||
s_log.debug("FALLBACK supertype " + objectType + " formatter=" + formatter + " rendered="
|
||||
+ rendered);
|
||||
}
|
||||
objectType = objectType.getSupertype();
|
||||
}
|
||||
|
|
@ -231,43 +222,33 @@ public class DomainObjectXMLRenderer extends DomainObjectTraversal {
|
|||
}
|
||||
|
||||
/**
|
||||
* Determines XML output for root object.
|
||||
* If set to true a separate element will
|
||||
* be output for the root object, if false,
|
||||
* then the element passed into the constructor
|
||||
* will be used.
|
||||
* Determines XML output for root object. If set to true a separate element will be output for the root object, if
|
||||
* false, then the element passed into the constructor will be used.
|
||||
*/
|
||||
public void setWrapRoot(boolean value) {
|
||||
m_wrapRoot = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines XML output used for objects.
|
||||
* If set to true, then a wrapper XML element
|
||||
* will be generated for the association,
|
||||
* and then individual elements generated for
|
||||
* each object. If false then no wrapper
|
||||
* XML element will be produced.
|
||||
* Determines XML output used for objects. If set to true, then a wrapper XML element will be generated for the
|
||||
* association, and then individual elements generated for each object. If false then no wrapper XML element will be
|
||||
* produced.
|
||||
*/
|
||||
public void setWrapObjects(boolean value) {
|
||||
m_wrapObjects = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines XML output used for scalar
|
||||
* attributes. If set to true, then each
|
||||
* attribute is output as a separate element,
|
||||
* otherwise, attributes are output as simple
|
||||
* attributes.
|
||||
* Determines XML output used for scalar attributes. If set to true, then each attribute is output as a separate
|
||||
* element, otherwise, attributes are output as simple attributes.
|
||||
*/
|
||||
public void setWrapAttributes(boolean value) {
|
||||
m_wrapAttributes = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines XML output used for objects.
|
||||
* If set to true, then repeated objects will generate full xml.
|
||||
* If false then only the OID will be printed.
|
||||
* Determines XML output used for objects. If set to true, then repeated objects will generate full xml. If false
|
||||
* then only the OID will be printed.
|
||||
*/
|
||||
public void setRevisitFullObject(boolean value) {
|
||||
m_revisitFullObject = value;
|
||||
|
|
@ -364,7 +345,8 @@ public class DomainObjectXMLRenderer extends DomainObjectTraversal {
|
|||
element.addAttribute("date", dateFormatter.format(date));
|
||||
element.addAttribute("longDate", longDateFormatter.format(date));
|
||||
element.addAttribute("time", timeFormatter.format(date));
|
||||
element.addAttribute("monthName", calDate.getDisplayName(Calendar.MONTH, Calendar.LONG, negLocale));
|
||||
element.addAttribute("monthName", calDate.getDisplayName(Calendar.MONTH, Calendar.LONG,
|
||||
negLocale));
|
||||
// Quasimodo: END
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -214,11 +214,10 @@ public class DataCollectionRenderer extends LockableImpl {
|
|||
s_log.error(String.format("Failed to specialize object with with id %s. Skiping object.", dobj.getOID().toString()));
|
||||
continue;
|
||||
} else {
|
||||
s_log.error("Specializing successful.");
|
||||
s_log.debug("Specializing successful.");
|
||||
}
|
||||
}
|
||||
|
||||
Element item = Navigation.newElement("item");
|
||||
Element item = Navigation.newElement(content, "item");
|
||||
|
||||
Iterator attributes = m_attributes.iterator();
|
||||
while (attributes.hasNext()) {
|
||||
|
|
@ -233,14 +232,14 @@ public class DataCollectionRenderer extends LockableImpl {
|
|||
property.render(objects, item);
|
||||
}
|
||||
|
||||
Element path = Navigation.newElement("path");
|
||||
Element path = Navigation.newElement(item, "path");
|
||||
path.setText(getStableURL(dobj, object));
|
||||
item.addContent(path);
|
||||
//item.addContent(path);
|
||||
|
||||
generateItemXML(item, dobj, object, index);
|
||||
|
||||
index++;
|
||||
content.addContent(item);
|
||||
//content.addContent(item);
|
||||
}
|
||||
|
||||
return content;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,11 @@ public class Navigation extends Application {
|
|||
NavigationConstants.NAV_NS);
|
||||
}
|
||||
|
||||
public static Element newElement(final Element parent, final String name) {
|
||||
return parent.newChildElement(String.format("%s:%s", NavigationConstants.NAV_PREFIX, name),
|
||||
NavigationConstants.NAV_NS);
|
||||
}
|
||||
|
||||
public static String redirectURL(OID oid) {
|
||||
ParameterMap map = new ParameterMap();
|
||||
map.setParameter( NavigationConstants.OID, oid.toString() );
|
||||
|
|
|
|||
|
|
@ -3,13 +3,10 @@
|
|||
*
|
||||
* Autor: Sören Bernstein
|
||||
*
|
||||
* Diese Klasse realisiert eine ObjectList für Navigation,
|
||||
* der man Filterbefehle für die SQL-Abfrage mitgeben kann.
|
||||
* Auf diese Weise lassen sich Objekte listen, die bestimmte
|
||||
* Kriterien erfüllen.
|
||||
* Diese Klasse realisiert eine ObjectList für Navigation, der man Filterbefehle für die SQL-Abfrage mitgeben kann. Auf
|
||||
* diese Weise lassen sich Objekte listen, die bestimmte Kriterien erfüllen.
|
||||
*
|
||||
* Angelegt wurde Sie für die Auflistung der aktuellen News
|
||||
* und Veranstalungen auf einer Navigationsseite.
|
||||
* Angelegt wurde Sie für die Auflistung der aktuellen News und Veranstalungen auf einer Navigationsseite.
|
||||
*/
|
||||
package com.arsdigita.navigation.ui.object;
|
||||
|
||||
|
|
@ -50,9 +47,9 @@ public class ComplexObjectList extends AbstractObjectList {
|
|||
}
|
||||
|
||||
/**
|
||||
* Hinzufügen eines SQL-Filter zur Abfrage
|
||||
* Verarbeitet einen boolschen Filter, der SQL-konform Formatiert ist.
|
||||
* Siehe PostgreSQL-Handbuch zur where-Klausel
|
||||
* Hinzufügen eines SQL-Filter zur Abfrage Verarbeitet einen boolschen Filter, der SQL-konform Formatiert ist. Siehe
|
||||
* PostgreSQL-Handbuch zur where-Klausel
|
||||
*
|
||||
* @param sqlfilter
|
||||
*/
|
||||
public void setSQLFilter(String sqlfilter) {
|
||||
|
|
@ -75,8 +72,8 @@ public class ComplexObjectList extends AbstractObjectList {
|
|||
m_customAttributes.put(attribute, value);
|
||||
}
|
||||
|
||||
/* Diese Methode überschreibt die Methode aus der Eltern-Klasse, um
|
||||
* die SQL-Filter berücksichtigen zu können
|
||||
/*
|
||||
* Diese Methode überschreibt die Methode aus der Eltern-Klasse, um die SQL-Filter berücksichtigen zu können
|
||||
*/
|
||||
@Override
|
||||
protected DataCollection getObjects(HttpServletRequest request,
|
||||
|
|
@ -109,7 +106,9 @@ public class ComplexObjectList extends AbstractObjectList {
|
|||
return objects;
|
||||
}
|
||||
|
||||
/* Diese Methode wird vom Servlet aufgerufen */
|
||||
/*
|
||||
* Diese Methode wird vom Servlet aufgerufen
|
||||
*/
|
||||
public Element generateXML(HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
Element content = Navigation.newElement("complexObjectList");
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ import com.arsdigita.cms.contenttypes.PublicationWithPublisher;
|
|||
import com.arsdigita.cms.contenttypes.SeriesCollection;
|
||||
|
||||
/**
|
||||
* An abstract base implementation of the {@link RisConverter} interface
|
||||
* providing common functionality.
|
||||
* An abstract base implementation of the {@link RisConverter} interface providing common functionality.
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
|
|
@ -66,16 +65,18 @@ public abstract class AbstractRisConverter implements RisConverter {
|
|||
|
||||
protected void convertYear(final Publication publication) {
|
||||
getRisBuilder().addField(RisFields.PY,
|
||||
String.format("%d///", publication.
|
||||
getYearOfPublication()));
|
||||
String.format("%d///", publication.getYearOfPublication()));
|
||||
}
|
||||
|
||||
protected void convertPublisher(final PublicationWithPublisher publication) {
|
||||
convertPublisher(publication, RisFields.CY);
|
||||
}
|
||||
|
||||
protected void convertPublisher(final PublicationWithPublisher publication, final RisFields placeField) {
|
||||
if (publication.getPublisher() != null) {
|
||||
if ((publication.getPublisher().getPlace() != null)
|
||||
&& !(publication.getPublisher().getPlace().isEmpty())) {
|
||||
getRisBuilder().addField(RisFields.CY,
|
||||
publication.getPublisher().getPlace());
|
||||
getRisBuilder().addField(placeField, publication.getPublisher().getPlace());
|
||||
}
|
||||
|
||||
getRisBuilder().addField(RisFields.PB,
|
||||
|
|
|
|||
|
|
@ -56,18 +56,18 @@ public class ArticleInCollectedVolumeConverter extends AbstractRisConverter {
|
|||
convertYear(publication);
|
||||
|
||||
if (article.getCollectedVolume() != null) {
|
||||
getRisBuilder().addField(RisFields.BT,
|
||||
getRisBuilder().addField(RisFields.T2,
|
||||
article.getCollectedVolume().getTitle());
|
||||
|
||||
}
|
||||
|
||||
if (article.getPagesFrom() != null) {
|
||||
getRisBuilder().addField(RisFields.SP,
|
||||
article.getPagesFrom().toString());
|
||||
if (article.getPagesTo() != null) {
|
||||
String.format("%d - %d", article.getPagesFrom(), article.getPagesTo()));
|
||||
/*if (article.getPagesTo() != null) {
|
||||
getRisBuilder().addField(RisFields.EP,
|
||||
article.getPagesTo().toString());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
return getRisBuilder().toRis();
|
||||
|
|
|
|||
|
|
@ -50,16 +50,20 @@ public class ArticleInJournalConverter extends AbstractRisConverter {
|
|||
|
||||
article = (ArticleInJournal) publication;
|
||||
|
||||
getRisBuilder().setType(RisTypes.MGZN);
|
||||
getRisBuilder().setType(RisTypes.JOUR);
|
||||
convertAuthors(publication);
|
||||
convertTitle(publication);
|
||||
convertYear(publication);
|
||||
|
||||
if (article.getJournal() != null) {
|
||||
getRisBuilder().addField(RisFields.JF,
|
||||
getRisBuilder().addField(RisFields.T2,
|
||||
article.getJournal().getTitle());
|
||||
}
|
||||
|
||||
if (article.getIssue() != null) {
|
||||
getRisBuilder().addField(RisFields.M1, article.getIssue());
|
||||
}
|
||||
|
||||
if (article.getVolume() != null) {
|
||||
getRisBuilder().addField(RisFields.VL,
|
||||
article.getVolume().toString());
|
||||
|
|
@ -67,9 +71,15 @@ public class ArticleInJournalConverter extends AbstractRisConverter {
|
|||
|
||||
if (article.getPagesFrom() != null) {
|
||||
getRisBuilder().addField(RisFields.SP,
|
||||
article.getPagesFrom().toString());
|
||||
getRisBuilder().addField(RisFields.EP,
|
||||
String.format("%d - %d", article.getPagesFrom(), article.getPagesTo()));
|
||||
/*
|
||||
* getRisBuilder().addField(RisFields.EP,
|
||||
article.getPagesTo().toString());
|
||||
*/
|
||||
}
|
||||
|
||||
if (article.getReviewed()) {
|
||||
getRisBuilder().addField(RisFields.RI, "");
|
||||
}
|
||||
|
||||
return getRisBuilder().toRis();
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class CollectedVolumeConverter extends AbstractRisConverter {
|
|||
|
||||
collectedVolume = (CollectedVolume) publication;
|
||||
|
||||
getRisBuilder().setType(RisTypes.BOOK);
|
||||
getRisBuilder().setType(RisTypes.EDBOOK);
|
||||
convertAuthors(publication);
|
||||
|
||||
convertTitle(publication);
|
||||
|
|
|
|||
|
|
@ -29,11 +29,23 @@ public class GreyLiteratureConverter extends AbstractRisConverter {
|
|||
|
||||
greyLiterature = (GreyLiterature) publication;
|
||||
|
||||
getRisBuilder().setType(RisTypes.GEN);
|
||||
getRisBuilder().setType(RisTypes.UNPB);
|
||||
convertAuthors(publication);
|
||||
convertTitle(publication);
|
||||
convertYear(publication);
|
||||
|
||||
if (greyLiterature.getPlace() != null) {
|
||||
getRisBuilder().addField(RisFields.CY, greyLiterature.getPlace());
|
||||
}
|
||||
|
||||
if (greyLiterature.getNumber() != null) {
|
||||
getRisBuilder().addField(RisFields.M1, greyLiterature.getNumber());
|
||||
}
|
||||
|
||||
if (greyLiterature.getOrganization() != null) {
|
||||
getRisBuilder().addField(RisFields.PB, greyLiterature.getOrganization().getTitle());
|
||||
}
|
||||
|
||||
return getRisBuilder().toRis();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,29 +51,28 @@ public class InProceedingsConverter extends AbstractRisConverter {
|
|||
|
||||
inProceedings = (InProceedings) publication;
|
||||
|
||||
getRisBuilder().setType(RisTypes.GEN);
|
||||
getRisBuilder().setType(RisTypes.CPAPER);
|
||||
convertAuthors(publication);
|
||||
convertTitle(publication);
|
||||
convertYear(publication);
|
||||
|
||||
if (inProceedings.getPagesFrom() != null) {
|
||||
getRisBuilder().addField(RisFields.SP,
|
||||
inProceedings.getPagesFrom().toString());
|
||||
getRisBuilder().addField(RisFields.EP,
|
||||
inProceedings.getPagesTo().toString());
|
||||
if (inProceedings.getProceedings() != null) {
|
||||
final Proceedings proceedings = inProceedings.getProceedings();
|
||||
if (proceedings.getPlaceOfConference() != null) {
|
||||
getRisBuilder().addField(RisFields.CY, proceedings.getPlaceOfConference());
|
||||
}
|
||||
|
||||
if(inProceedings.getProceedings() != null) {
|
||||
Proceedings proceedings;
|
||||
|
||||
proceedings = inProceedings.getProceedings();
|
||||
|
||||
getRisBuilder().addField(RisFields.BT,
|
||||
proceedings.getTitle());
|
||||
}
|
||||
|
||||
convertVolume(proceedings);
|
||||
convertSeries(proceedings);
|
||||
convertPublisher(proceedings);
|
||||
if (inProceedings.getPagesFrom() != null) {
|
||||
getRisBuilder().addField(RisFields.SP,
|
||||
String.format("%d - %d",
|
||||
inProceedings.getPagesFrom(),
|
||||
inProceedings.getPagesTo()));
|
||||
/*getRisBuilder().addField(RisFields.EP,
|
||||
inProceedings.getPagesTo().toString());*/
|
||||
}
|
||||
|
||||
return getRisBuilder().toString();
|
||||
|
|
|
|||
|
|
@ -50,11 +50,19 @@ public class InternetArticleConverter extends AbstractRisConverter {
|
|||
|
||||
article = (InternetArticle) publication;
|
||||
|
||||
getRisBuilder().setType(RisTypes.GEN);
|
||||
getRisBuilder().setType(RisTypes.EJOUR);
|
||||
convertAuthors(publication);
|
||||
convertTitle(publication);
|
||||
convertYear(publication);
|
||||
|
||||
if (article.getReviewed()) {
|
||||
getRisBuilder().addField(RisFields.RI, "");
|
||||
}
|
||||
|
||||
if (article.getUrl() != null) {
|
||||
getRisBuilder().addField(RisFields.UR, article.getUrl());
|
||||
}
|
||||
|
||||
return getRisBuilder().toRis();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,17 @@ public class ProceedingsConverter extends AbstractRisConverter {
|
|||
|
||||
convertVolume(proceedings);
|
||||
convertSeries(publication);
|
||||
convertPublisher(proceedings);
|
||||
convertPublisher(proceedings, RisFields.C1);
|
||||
|
||||
if (proceedings.getPlaceOfConference() != null) {
|
||||
getRisBuilder().addField(RisFields.CY, proceedings.getPlaceOfConference());
|
||||
}
|
||||
|
||||
if (proceedings.getNameOfConference() != null) {
|
||||
getRisBuilder().addField(RisFields.T2, proceedings.getNameOfConference());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return getRisBuilder().toRis();
|
||||
|
|
|
|||
|
|
@ -331,5 +331,16 @@ public enum RisFields {
|
|||
* Edition. Not found in the specification, but used but by some other
|
||||
* exports.
|
||||
*/
|
||||
ET
|
||||
ET,
|
||||
/**
|
||||
* Reviewed item
|
||||
*/
|
||||
RI,
|
||||
/**
|
||||
* DA
|
||||
*/
|
||||
DA,
|
||||
C1,
|
||||
C2,
|
||||
C3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,10 @@ public enum RisTypes {
|
|||
* Conference proceedings
|
||||
*/
|
||||
CONF,
|
||||
/**
|
||||
* Conference Paper
|
||||
*/
|
||||
CPAPER,
|
||||
/**
|
||||
* Catalog
|
||||
*/
|
||||
|
|
@ -70,10 +74,18 @@ public enum RisTypes {
|
|||
* Data file
|
||||
*/
|
||||
DATA,
|
||||
/**
|
||||
* Edited book
|
||||
*/
|
||||
EDBOOK,
|
||||
/**
|
||||
* Electronic citation
|
||||
*/
|
||||
ELEC,
|
||||
/**
|
||||
* Eletronic Article
|
||||
*/
|
||||
EJOUR,
|
||||
/**
|
||||
* Generic
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue