- Sortierbare Publikationsliste (derzeit nach Titel und Erscheinungsjahr)
- Formatierungen git-svn-id: https://svn.libreccm.org/ccm/trunk@773 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
b28a6cf8b5
commit
1ef984825e
|
|
@ -15,7 +15,6 @@
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.london.navigation;
|
package com.arsdigita.london.navigation;
|
||||||
|
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
|
|
@ -51,19 +50,18 @@ import org.apache.log4j.Logger;
|
||||||
*/
|
*/
|
||||||
public class DataCollectionDefinition extends LockableImpl {
|
public class DataCollectionDefinition extends LockableImpl {
|
||||||
|
|
||||||
|
private static Logger s_log = Logger.getLogger(
|
||||||
|
DataCollectionDefinition.class);
|
||||||
private String m_objectType = ACSObject.BASE_DATA_OBJECT_TYPE;
|
private String m_objectType = ACSObject.BASE_DATA_OBJECT_TYPE;
|
||||||
private String m_specificObjectType = null;
|
private String m_specificObjectType = null;
|
||||||
|
|
||||||
private boolean m_filterCategory = true;
|
private boolean m_filterCategory = true;
|
||||||
private boolean m_descendCategories = false;
|
private boolean m_descendCategories = false;
|
||||||
private boolean m_excludeIndexObjects = true;
|
private boolean m_excludeIndexObjects = true;
|
||||||
private boolean m_checkPermissions = false;
|
private boolean m_checkPermissions = false;
|
||||||
private boolean m_blackListTypes = false;
|
private boolean m_blackListTypes = false;
|
||||||
|
|
||||||
private ArrayList m_ordering = new ArrayList();
|
private ArrayList m_ordering = new ArrayList();
|
||||||
private ArrayList m_excludedTypes = new ArrayList();
|
private ArrayList m_excludedTypes = new ArrayList();
|
||||||
private ArrayList m_properties = new ArrayList();
|
private ArrayList m_properties = new ArrayList();
|
||||||
|
|
||||||
private String m_dateAttribute = null;
|
private String m_dateAttribute = null;
|
||||||
|
|
||||||
public final void setObjectType(String objectType) {
|
public final void setObjectType(String objectType) {
|
||||||
|
|
@ -87,16 +85,17 @@ public class DataCollectionDefinition extends LockableImpl {
|
||||||
m_excludedTypes.add(specificObjectType);
|
m_excludedTypes.add(specificObjectType);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Logger s_log = Logger.getLogger(DataCollectionDefinition.class);
|
|
||||||
|
|
||||||
public void setDateAttribute(DataCollectionRenderer renderer) {
|
public void setDateAttribute(DataCollectionRenderer renderer) {
|
||||||
ObjectType type = SessionManager.getMetadataRoot().getObjectType(m_objectType);
|
ObjectType type = SessionManager.getMetadataRoot().getObjectType(
|
||||||
s_log.debug("set date attribute for collection of " + type.getQualifiedName());
|
m_objectType);
|
||||||
|
s_log.debug("set date attribute for collection of " + type.
|
||||||
|
getQualifiedName());
|
||||||
if (s_log.isDebugEnabled()) {
|
if (s_log.isDebugEnabled()) {
|
||||||
Iterator properties = type.getProperties();
|
Iterator properties = type.getProperties();
|
||||||
while (properties.hasNext()) {
|
while (properties.hasNext()) {
|
||||||
Property prop = (Property) properties.next();
|
Property prop = (Property) properties.next();
|
||||||
s_log.debug("object has property " + prop.getName() + " of class " + prop.getJavaClass().getName());
|
s_log.debug("object has property " + prop.getName()
|
||||||
|
+ " of class " + prop.getJavaClass().getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Iterator it = (renderer.getAttributes().iterator());
|
Iterator it = (renderer.getAttributes().iterator());
|
||||||
|
|
@ -106,9 +105,11 @@ public class DataCollectionDefinition extends LockableImpl {
|
||||||
Property property = type.getProperty(attribute);
|
Property property = type.getProperty(attribute);
|
||||||
s_log.debug("property of object: " + property);
|
s_log.debug("property of object: " + property);
|
||||||
if (property != null) {
|
if (property != null) {
|
||||||
s_log.debug("Property class is " + property.getJavaClass().getName());
|
s_log.debug("Property class is " + property.getJavaClass().
|
||||||
|
getName());
|
||||||
}
|
}
|
||||||
if (property != null && property.getJavaClass().getName().equals(Date.class.getName())) {
|
if (property != null && property.getJavaClass().getName().equals(Date.class.
|
||||||
|
getName())) {
|
||||||
m_dateAttribute = attribute;
|
m_dateAttribute = attribute;
|
||||||
// if more than one date attribute is specified for the type included in this
|
// if more than one date attribute is specified for the type included in this
|
||||||
// definition, then we cannot determine in the code which is to be used as the
|
// definition, then we cannot determine in the code which is to be used as the
|
||||||
|
|
@ -121,7 +122,8 @@ public class DataCollectionDefinition extends LockableImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void validateObjectType(String objectType) {
|
private final void validateObjectType(String objectType) {
|
||||||
ObjectType type = SessionManager.getMetadataRoot().getObjectType(objectType);
|
ObjectType type = SessionManager.getMetadataRoot().getObjectType(
|
||||||
|
objectType);
|
||||||
Assert.exists(type, ObjectType.class);
|
Assert.exists(type, ObjectType.class);
|
||||||
validateObjectType(type);
|
validateObjectType(type);
|
||||||
}
|
}
|
||||||
|
|
@ -161,6 +163,13 @@ public class DataCollectionDefinition extends LockableImpl {
|
||||||
|
|
||||||
public final void addOrder(String order) {
|
public final void addOrder(String order) {
|
||||||
Assert.isUnlocked(this);
|
Assert.isUnlocked(this);
|
||||||
|
if(s_log.isDebugEnabled()) {
|
||||||
|
s_log.debug(String.format("Adding order '%s' to current list of "
|
||||||
|
+ "order attributes: ", order));
|
||||||
|
for(Object orderAttr : m_ordering) {
|
||||||
|
s_log.debug(String.format("\t%s", orderAttr));
|
||||||
|
}
|
||||||
|
}
|
||||||
m_ordering.add(order);
|
m_ordering.add(order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -172,15 +181,15 @@ public class DataCollectionDefinition extends LockableImpl {
|
||||||
public final DataCollection getDataCollection(NavigationModel model) {
|
public final DataCollection getDataCollection(NavigationModel model) {
|
||||||
Assert.isLocked(this);
|
Assert.isLocked(this);
|
||||||
|
|
||||||
DataCollection objects = SessionManager.getSession()
|
DataCollection objects = SessionManager.getSession().retrieve(
|
||||||
.retrieve(m_objectType);
|
m_objectType);
|
||||||
|
|
||||||
applyFilters(objects, model);
|
applyFilters(objects, model);
|
||||||
|
|
||||||
Iterator properties = m_properties.iterator();
|
Iterator properties = m_properties.iterator();
|
||||||
while (properties.hasNext()) {
|
while (properties.hasNext()) {
|
||||||
DataCollectionProperty property = (DataCollectionProperty)
|
DataCollectionProperty property = (DataCollectionProperty) properties.
|
||||||
properties.next();
|
next();
|
||||||
property.addProperty(objects);
|
property.addProperty(objects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -189,12 +198,16 @@ public class DataCollectionDefinition extends LockableImpl {
|
||||||
// that primary ordering is the date attribute included in the renderer
|
// that primary ordering is the date attribute included in the renderer
|
||||||
// if there is one
|
// if there is one
|
||||||
if (s_log.isDebugEnabled()) {
|
if (s_log.isDebugEnabled()) {
|
||||||
s_log.debug("Category is " + model.getCategory().getID() + ": " + model.getCategory().getName());
|
s_log.debug("Category is " + model.getCategory().getID() + ": " + model.
|
||||||
|
getCategory().getName());
|
||||||
s_log.debug("getting data collection. Is category date ordered? "
|
s_log.debug("getting data collection. Is category date ordered? "
|
||||||
+ Navigation.getConfig().isDateOrderedCategory(model.getCategory(), PageState.getPageState())
|
+ Navigation.getConfig().isDateOrderedCategory(model.
|
||||||
+ " date attribute has been set to " + m_dateAttribute);
|
getCategory(), PageState.getPageState())
|
||||||
|
+ " date attribute has been set to "
|
||||||
|
+ m_dateAttribute);
|
||||||
}
|
}
|
||||||
if (Navigation.getConfig().isDateOrderedCategory(model.getCategory(), PageState.getPageState()) && m_dateAttribute != null) {
|
if (Navigation.getConfig().isDateOrderedCategory(model.getCategory(), PageState.
|
||||||
|
getPageState()) && m_dateAttribute != null) {
|
||||||
objects.addOrder(m_dateAttribute + " desc");
|
objects.addOrder(m_dateAttribute + " desc");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -225,8 +238,8 @@ public class DataCollectionDefinition extends LockableImpl {
|
||||||
Iterator excludedTypes = m_excludedTypes.iterator();
|
Iterator excludedTypes = m_excludedTypes.iterator();
|
||||||
while (excludedTypes.hasNext()) {
|
while (excludedTypes.hasNext()) {
|
||||||
String excludedType = excludedTypes.next().toString();
|
String excludedType = excludedTypes.next().toString();
|
||||||
objects.addFilter(ACSObject.OBJECT_TYPE + " != '" +
|
objects.addFilter(ACSObject.OBJECT_TYPE + " != '" + excludedType
|
||||||
excludedType + "'" );
|
+ "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_blackListTypes) {
|
if (m_blackListTypes) {
|
||||||
|
|
@ -242,10 +255,10 @@ public class DataCollectionDefinition extends LockableImpl {
|
||||||
"com.arsdigita.categorization.objectIDsInSubtree");
|
"com.arsdigita.categorization.objectIDsInSubtree");
|
||||||
children.set("categoryID", cat.getID());
|
children.set("categoryID", cat.getID());
|
||||||
if (m_excludeIndexObjects) {
|
if (m_excludeIndexObjects) {
|
||||||
Filter moreChildren = objects.addNotInSubqueryFilter(
|
Filter moreChildren =
|
||||||
|
objects.addNotInSubqueryFilter(
|
||||||
getCategorizedObjectPath("id"),
|
getCategorizedObjectPath("id"),
|
||||||
"com.arsdigita.categorization.liveIndexItemsInSubtree"
|
"com.arsdigita.categorization.liveIndexItemsInSubtree");
|
||||||
);
|
|
||||||
moreChildren.set("categoryID", cat.getID());
|
moreChildren.set("categoryID", cat.getID());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -253,10 +266,10 @@ public class DataCollectionDefinition extends LockableImpl {
|
||||||
getCategorizedObjectPath("categories.id"),
|
getCategorizedObjectPath("categories.id"),
|
||||||
cat.getID());
|
cat.getID());
|
||||||
if (m_excludeIndexObjects) {
|
if (m_excludeIndexObjects) {
|
||||||
Filter moreChildren = objects.addNotInSubqueryFilter(
|
Filter moreChildren =
|
||||||
|
objects.addNotInSubqueryFilter(
|
||||||
getCategorizedObjectPath("id"),
|
getCategorizedObjectPath("id"),
|
||||||
"com.arsdigita.categorization.liveIndexItemsInCategory"
|
"com.arsdigita.categorization.liveIndexItemsInCategory");
|
||||||
);
|
|
||||||
moreChildren.set("categoryID", cat.getID());
|
moreChildren.set("categoryID", cat.getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,9 @@ public class DataCollectionRenderer extends LockableImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @pageNumber current page, starting from 1
|
* @param objects
|
||||||
|
* @param pageNumber current page, starting from 1
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public Element generateXML(DataCollection objects,
|
public Element generateXML(DataCollection objects,
|
||||||
int pageNumber) {
|
int pageNumber) {
|
||||||
|
|
@ -148,7 +150,8 @@ public class DataCollectionRenderer extends LockableImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
long objectCount = objects.size();
|
long objectCount = objects.size();
|
||||||
int pageCount = (int) Math.ceil((double) objectCount / (double) m_pageSize);
|
int pageCount = (int) Math.ceil((double) objectCount
|
||||||
|
/ (double) m_pageSize);
|
||||||
|
|
||||||
if (pageNumber < 1) {
|
if (pageNumber < 1) {
|
||||||
pageNumber = 1;
|
pageNumber = 1;
|
||||||
|
|
@ -163,7 +166,8 @@ public class DataCollectionRenderer extends LockableImpl {
|
||||||
long end = begin + count;
|
long end = begin + count;
|
||||||
|
|
||||||
if (count != 0) {
|
if (count != 0) {
|
||||||
objects.setRange(new Integer((int) begin + 1), new Integer((int) end + 1));
|
objects.setRange(new Integer((int) begin + 1),
|
||||||
|
new Integer((int) end + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
Element paginator = Navigation.newElement("paginator");
|
Element paginator = Navigation.newElement("paginator");
|
||||||
|
|
@ -187,7 +191,8 @@ public class DataCollectionRenderer extends LockableImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
paginator.addAttribute("pageParam", pageParam);
|
paginator.addAttribute("pageParam", pageParam);
|
||||||
paginator.addAttribute("baseURL", URL.there(url.getPathInfo(), map).toString());
|
paginator.addAttribute("baseURL", URL.there(url.getPathInfo(), map).
|
||||||
|
toString());
|
||||||
// Quasimodo: End
|
// Quasimodo: End
|
||||||
|
|
||||||
paginator.addAttribute("pageNumber", new Long(pageNumber).toString());
|
paginator.addAttribute("pageNumber", new Long(pageNumber).toString());
|
||||||
|
|
@ -218,7 +223,8 @@ public class DataCollectionRenderer extends LockableImpl {
|
||||||
|
|
||||||
Iterator properties = m_properties.iterator();
|
Iterator properties = m_properties.iterator();
|
||||||
while (properties.hasNext()) {
|
while (properties.hasNext()) {
|
||||||
DataCollectionPropertyRenderer property = (DataCollectionPropertyRenderer) properties.next();
|
DataCollectionPropertyRenderer property = (DataCollectionPropertyRenderer) properties.
|
||||||
|
next();
|
||||||
property.render(objects, item);
|
property.render(objects, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -274,18 +280,27 @@ public class DataCollectionRenderer extends LockableImpl {
|
||||||
Date date = (Date) value;
|
Date date = (Date) value;
|
||||||
Calendar calDate = Calendar.getInstance();
|
Calendar calDate = Calendar.getInstance();
|
||||||
calDate.setTime(date);
|
calDate.setTime(date);
|
||||||
attribute.addAttribute("year", Integer.toString(calDate.get(Calendar.YEAR)));
|
attribute.addAttribute("year", Integer.toString(calDate.get(
|
||||||
attribute.addAttribute("month", Integer.toString(calDate.get(Calendar.MONTH) + 1));
|
Calendar.YEAR)));
|
||||||
attribute.addAttribute("day", Integer.toString(calDate.get(Calendar.DAY_OF_MONTH)));
|
attribute.addAttribute("month", Integer.toString(calDate.get(
|
||||||
attribute.addAttribute("hour", Integer.toString(calDate.get(Calendar.HOUR_OF_DAY)));
|
Calendar.MONTH) + 1));
|
||||||
attribute.addAttribute("minute", Integer.toString(calDate.get(Calendar.MINUTE)));
|
attribute.addAttribute("day", Integer.toString(calDate.get(
|
||||||
attribute.addAttribute("second", Integer.toString(calDate.get(Calendar.SECOND)));
|
Calendar.DAY_OF_MONTH)));
|
||||||
|
attribute.addAttribute("hour", Integer.toString(calDate.get(
|
||||||
|
Calendar.HOUR_OF_DAY)));
|
||||||
|
attribute.addAttribute("minute", Integer.toString(calDate.get(
|
||||||
|
Calendar.MINUTE)));
|
||||||
|
attribute.addAttribute("second", Integer.toString(calDate.get(
|
||||||
|
Calendar.SECOND)));
|
||||||
|
|
||||||
// Quasimodo: BEGIN
|
// Quasimodo: BEGIN
|
||||||
// Add attributes for date and time
|
// Add attributes for date and time
|
||||||
Locale negLocale = com.arsdigita.dispatcher.DispatcherHelper.getNegotiatedLocale();
|
Locale negLocale = com.arsdigita.dispatcher.DispatcherHelper.
|
||||||
DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.MEDIUM, negLocale);
|
getNegotiatedLocale();
|
||||||
DateFormat timeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT, negLocale);
|
DateFormat dateFormatter = DateFormat.getDateInstance(
|
||||||
|
DateFormat.MEDIUM, negLocale);
|
||||||
|
DateFormat timeFormatter = DateFormat.getTimeInstance(
|
||||||
|
DateFormat.SHORT, negLocale);
|
||||||
attribute.addAttribute("date", dateFormatter.format(date));
|
attribute.addAttribute("date", dateFormatter.format(date));
|
||||||
attribute.addAttribute("time", timeFormatter.format(date));
|
attribute.addAttribute("time", timeFormatter.format(date));
|
||||||
// Quasimodo: END
|
// Quasimodo: END
|
||||||
|
|
@ -320,6 +335,5 @@ public class DataCollectionRenderer extends LockableImpl {
|
||||||
DataObject dobj,
|
DataObject dobj,
|
||||||
ACSObject obj,
|
ACSObject obj,
|
||||||
int index) {
|
int index) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,9 @@ public class ComplexObjectList extends AbstractObjectList {
|
||||||
public static final String CUSTOM_NAME = "customName";
|
public static final String CUSTOM_NAME = "customName";
|
||||||
protected String m_customName = null;
|
protected String m_customName = null;
|
||||||
protected String m_filter = null;
|
protected String m_filter = null;
|
||||||
protected HashMap m_filterParameters = new HashMap();
|
protected Map m_filterParameters = new HashMap();
|
||||||
|
|
||||||
|
private Map<String, String> m_customAttributes = new HashMap<String, String>();
|
||||||
|
|
||||||
public void setCustomName(String name) {
|
public void setCustomName(String name) {
|
||||||
m_customName = name;
|
m_customName = name;
|
||||||
|
|
@ -67,9 +69,18 @@ public class ComplexObjectList extends AbstractObjectList {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCustomAttribute(final String attribute) {
|
||||||
|
return m_customAttributes.get(attribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addCustomAttribute(final String attribute, final String value) {
|
||||||
|
m_customAttributes.put(attribute, value);
|
||||||
|
}
|
||||||
|
|
||||||
/* Diese Methode überschreibt die Methode aus der Eltern-Klasse, um
|
/* Diese Methode überschreibt die Methode aus der Eltern-Klasse, um
|
||||||
* die SQL-Filter berücksichtigen zu können
|
* die SQL-Filter berücksichtigen zu können
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected DataCollection getObjects( HttpServletRequest request, HttpServletResponse response ) {
|
protected DataCollection getObjects( HttpServletRequest request, HttpServletResponse response ) {
|
||||||
DataCollection objects = super.getObjects( request, response );
|
DataCollection objects = super.getObjects( request, response );
|
||||||
|
|
||||||
|
|
@ -105,6 +116,10 @@ public class ComplexObjectList extends AbstractObjectList {
|
||||||
content.addAttribute(CUSTOM_NAME, m_customName);
|
content.addAttribute(CUSTOM_NAME, m_customName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(Map.Entry<String, String> attribute : m_customAttributes.entrySet()) {
|
||||||
|
content.addAttribute(attribute.getKey(), attribute.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
content.addContent(generateObjectListXML(request, response));
|
content.addContent(generateObjectListXML(request, response));
|
||||||
|
|
||||||
return content;
|
return content;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
<jsp:directive.page import="com.arsdigita.london.navigation.Navigation"/>
|
<jsp:directive.page import="com.arsdigita.london.navigation.Navigation"/>
|
||||||
<jsp:directive.page import="com.arsdigita.london.navigation.cms.CMSDataCollectionDefinition"/>
|
<jsp:directive.page import="com.arsdigita.london.navigation.cms.CMSDataCollectionDefinition"/>
|
||||||
<jsp:directive.page import="com.arsdigita.london.navigation.cms.CMSDataCollectionRenderer"/>
|
<jsp:directive.page import="com.arsdigita.london.navigation.cms.CMSDataCollectionRenderer"/>
|
||||||
|
<jsp:directive.page import="org.apache.log4j.Logger"/>
|
||||||
|
|
||||||
<jsp:scriptlet>
|
<jsp:scriptlet>
|
||||||
long age = Navigation.getConfig().getIndexPageCacheLifetime();
|
long age = Navigation.getConfig().getIndexPageCacheLifetime();
|
||||||
|
|
@ -20,7 +21,7 @@
|
||||||
</jsp:scriptlet>
|
</jsp:scriptlet>
|
||||||
|
|
||||||
<define:page name="defaultItemPage" application="navigation"
|
<define:page name="defaultItemPage" application="navigation"
|
||||||
title="Navigation" cache="true">
|
title="Navigation" cache="false">
|
||||||
|
|
||||||
<define:component name="greetingItem"
|
<define:component name="greetingItem"
|
||||||
classname="com.arsdigita.london.navigation.ui.GreetingItem"/>
|
classname="com.arsdigita.london.navigation.ui.GreetingItem"/>
|
||||||
|
|
@ -29,17 +30,45 @@
|
||||||
<define:component name="categoryMenu"
|
<define:component name="categoryMenu"
|
||||||
classname="com.arsdigita.london.navigation.ui.category.Menu"/>
|
classname="com.arsdigita.london.navigation.ui.category.Menu"/>
|
||||||
<define:component name="itemList"
|
<define:component name="itemList"
|
||||||
classname="com.arsdigita.london.navigation.ui.object.SimpleObjectList"/>
|
classname="com.arsdigita.london.navigation.ui.object.ComplexObjectList"/>
|
||||||
<jsp:scriptlet>
|
<jsp:scriptlet>
|
||||||
((com.arsdigita.london.navigation.ui.object.SimpleObjectList) itemList).setDefinition(new CMSDataCollectionDefinition());
|
|
||||||
((com.arsdigita.london.navigation.ui.object.SimpleObjectList) itemList).setRenderer(new CMSDataCollectionRenderer());
|
|
||||||
((com.arsdigita.london.navigation.ui.object.SimpleObjectList) itemList).getDefinition().setObjectType("com.arsdigita.cms.ContentPage");
|
|
||||||
|
|
||||||
((com.arsdigita.london.navigation.ui.object.SimpleObjectList) itemList).getDefinition().setDescendCategories(false);
|
org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger("SciPublicationListJsp");
|
||||||
((com.arsdigita.london.navigation.ui.object.SimpleObjectList) itemList).getDefinition().addOrder("parent.categories.link.sortKey");
|
|
||||||
|
|
||||||
((com.arsdigita.london.navigation.ui.object.SimpleObjectList) itemList).getRenderer().setPageSize(20);
|
application.log("JSP::Configuring object list...");
|
||||||
((com.arsdigita.london.navigation.ui.object.SimpleObjectList) itemList).getRenderer().setSpecializeObjects(true);
|
logger.warn("JSP::Configuring object list...");
|
||||||
|
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).setDefinition(new CMSDataCollectionDefinition());
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).setRenderer(new CMSDataCollectionRenderer());
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).getDefinition().setObjectType("com.arsdigita.cms.contenttypes.Publication");
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).setCustomName("SciPublicationsList");
|
||||||
|
|
||||||
|
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).getDefinition().setDescendCategories(false);
|
||||||
|
logger.warn(String.format("JSP::orderBy = %s", request.getParameter("orderBy")));
|
||||||
|
if((request.getParameter("orderBy") == null)) {
|
||||||
|
logger.warn("JSP::Setting list order to 'title'...");
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).getDefinition().addOrder("title");
|
||||||
|
} else {
|
||||||
|
if("title".equals(request.getParameter("orderBy"))) {
|
||||||
|
logger.warn("JSP::Setting list order to 'title'...");
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).getDefinition().addOrder("title");
|
||||||
|
} else if("authors".equals(request.getParameter("orderBy"))) {
|
||||||
|
logger.warn("JSP::Setting list order to 'authors'...");
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).getDefinition().addOrder("authors asc");
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).getDefinition().addOrder("authors.givenname asc");
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).getDefinition().addOrder("authors.link.editor asc");
|
||||||
|
} else if("year".equals(request.getParameter("orderBy"))) {
|
||||||
|
logger.warn("JSP::Setting list order to 'yearOfPublication'...");
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).getDefinition().addOrder("yearOfPublication asc");
|
||||||
|
} else {
|
||||||
|
logger.warn("JSP::Unknown value for order, setting list order to 'title'...");
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).getDefinition().addOrder("title");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).getRenderer().setPageSize(20);
|
||||||
|
((com.arsdigita.london.navigation.ui.object.ComplexObjectList) itemList).getRenderer().setSpecializeObjects(true);
|
||||||
</jsp:scriptlet>
|
</jsp:scriptlet>
|
||||||
|
|
||||||
<define:component name="assignedTerms"
|
<define:component name="assignedTerms"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue