incorporate several APLAWS patches for ccm-ldn-navigation:

r1727:	Fixed NPE when Content Item List portlet had no category selected.
r1748:	Added DataCollectionDefinition.setBlackListTypes() to filter for
	for content types which are blacklisted in the AtoZ module
r1749:	Bumped version number from 6.5.1 to 6.5.2



git-svn-id: https://svn.libreccm.org/ccm/trunk@64 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2008-12-21 11:38:09 +00:00
parent 76c1523cf7
commit 08ebde26fe
3 changed files with 43 additions and 11 deletions

View File

@ -2,7 +2,7 @@
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
name="ccm-ldn-navigation"
prettyName="Navigation"
version="6.5.1"
version="6.5.2"
release="1"
webapp="ROOT">
<ccm:dependencies>

View File

@ -16,3 +16,16 @@ query TypesInSection {
typeID = type_id;
}
}
query blackListTypes {
String objectType;
do {
select ct.classname
from atoz_cat_ct_blacklist_map bm,
content_types ct
where ct.type_id = bm.type_id
} map {
objectType = classname;
}
}

View File

@ -58,6 +58,7 @@ public class DataCollectionDefinition extends LockableImpl {
private boolean m_descendCategories = false;
private boolean m_excludeIndexObjects = true;
private boolean m_checkPermissions = false;
private boolean m_blackListTypes = false;
private ArrayList m_ordering = new ArrayList();
private ArrayList m_excludedTypes = new ArrayList();
@ -149,6 +150,15 @@ public class DataCollectionDefinition extends LockableImpl {
m_checkPermissions = checkPermissions;
}
/**
* Activates a filter for content types which are blacklisted
* in the AtoZ module.
*/
public void setBlackListTypes(boolean blackListTypes) {
Assert.unlocked(this);
m_blackListTypes = blackListTypes;
}
public final void addOrder(String order) {
Assert.unlocked(this);
m_ordering.add(order);
@ -174,15 +184,19 @@ public class DataCollectionDefinition extends LockableImpl {
property.addProperty( objects );
}
// for date ordered categories, if pagination occurs, we need to ensure
// that primary ordering is the date attribute included in the renderer
// if there is one
s_log.debug("Category is " + model.getCategory().getID() + ": " + model.getCategory().getName());
s_log.debug("getting data collection. Is category date ordered? "
+ Navigation.getConfig().isDateOrderedCategory(model.getCategory(), PageState.getPageState())
+ " date attribute has been set to " + m_dateAttribute);
if (Navigation.getConfig().isDateOrderedCategory(model.getCategory(), PageState.getPageState()) && m_dateAttribute != null) {
objects.addOrder(m_dateAttribute + " desc");
if (model.getCategory() != null) {
// for date ordered categories, if pagination occurs, we need to ensure
// that primary ordering is the date attribute included in the renderer
// if there is one
if (s_log.isDebugEnabled()) {
s_log.debug("Category is " + model.getCategory().getID() + ": " + model.getCategory().getName());
s_log.debug("getting data collection. Is category date ordered? "
+ Navigation.getConfig().isDateOrderedCategory(model.getCategory(), PageState.getPageState())
+ " date attribute has been set to " + m_dateAttribute);
}
if (Navigation.getConfig().isDateOrderedCategory(model.getCategory(), PageState.getPageState()) && m_dateAttribute != null) {
objects.addOrder(m_dateAttribute + " desc");
}
}
if (m_ordering.size() > 0) {
@ -215,6 +229,11 @@ public class DataCollectionDefinition extends LockableImpl {
excludedType + "'" );
}
if (m_blackListTypes) {
objects.addNotInSubqueryFilter(ACSObject.OBJECT_TYPE,
"com.arsdigita.london.navigation.blackListTypes");
}
Category cat = getCategory(model);
if (m_filterCategory && cat != null) {
if (m_descendCategories) {
@ -247,7 +266,7 @@ public class DataCollectionDefinition extends LockableImpl {
// allow subclasses to override the permission check
checkPermissions(objects);
}
}
}
protected void checkPermissions(DataCollection objects) {
Party party = Kernel.getContext().getParty();