Weitere Umbauten AtoZ.

git-svn-id: https://svn.libreccm.org/ccm/trunk@1593 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2012-04-14 23:22:50 +00:00
parent c35db8039e
commit 1f88a7bd25
64 changed files with 506 additions and 148 deletions

View File

@ -0,0 +1,40 @@
<?xml version="1.0"?>
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
name="ccm-atoz-siteproxy"
prettyName="A-Z for content type siteproxy"
version="6.6.2"
release="1"
webapp="ROOT">
<ccm:dependencies>
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-navigation" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-subsite" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-atoz" version="6.6.0" relation="ge"/>
<!--
<ccm:requires name="ccm-ldn-aplaws" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-ldn-terms" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-ldn-util" version="6.6.0" relation="ge"/>
-->
<ccm:requires name="ccm-cms-types-siteproxy" version="6.6.0" relation="ge"/>
</ccm:dependencies>
<ccm:contacts>
<ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/>
<ccm:contact uri="mailto:rhea@redhat.com" type="support"/>
</ccm:contacts>
<ccm:description>
The ccm-atoz package enables a site to present all it's content in
alphabetical order as an additional service to it's users. Usually the
theme provides a link to the page as part of its static elements.
By default the application presents the A-Z list at ~/ccm/atoz/.
An administration interface is provided at ~/ccm/atoz/admin/. Here you
can configure the content to be listed by selecting an appropriate
content provider.
</ccm:description>
</ccm:application>

View File

@ -15,7 +15,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
model com.arsdigita.london.atoz;
model com.arsdigita.atoz;
import com.arsdigita.categorization.Category;

View File

@ -0,0 +1,3 @@
@ ddl/oracle-se/create.sql
@ ddl/oracle-se/deferred.sql

View File

@ -0,0 +1,4 @@
begin;
\i ddl/postgres/create.sql
\i ddl/postgres/deferred.sql
end;

View File

@ -17,7 +17,7 @@
*/
package com.arsdigita.atoz.siteproxy;
import com.arsdigita.atoz.AbstractAtoZGenerator;
import com.arsdigita.atoz.AtoZGeneratorAbstractImpl;
import com.arsdigita.atoz.AtoZAtomicEntry;
import com.arsdigita.atoz.AtoZCompoundEntry;
import com.arsdigita.atoz.AtoZEntry;
@ -37,7 +37,7 @@ import com.arsdigita.web.URL;
import com.arsdigita.web.Web;
import com.arsdigita.xml.Element;
public class AtoZSiteProxyGenerator extends AbstractAtoZGenerator {
public class AtoZSiteProxyGenerator extends AtoZGeneratorAbstractImpl {
/**
* Compound Entry for mathched Categories

View File

@ -0,0 +1,51 @@
/*
* Copyright (C) 2012 Peter Boy All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package com.arsdigita.atoz.siteproxy;
import com.arsdigita.atoz.AtoZ;
import com.arsdigita.atoz.AtoZProviderType;
import com.arsdigita.atoz.siteproxy.ui.admin.SiteProxyProviderAdmin;
import com.arsdigita.atoz.siteproxy.ui.admin.SiteProxyProviderForm;
import com.arsdigita.runtime.CompoundInitializer;
import com.arsdigita.runtime.DomainInitEvent;
/**
*
* @author pb
*/
public class Initializer extends CompoundInitializer {
/**
*
* @param evt
*/
@Override
public void init(DomainInitEvent evt) {
super.init(evt);
AtoZ.registerProviderType(
new AtoZProviderType("SiteProxy Provider",
"Provides a SiteProxy A-Z",
AtoZSiteProxyProvider.class,
SiteProxyProviderForm.class,
SiteProxyProviderAdmin.class));
}
}

View File

@ -1,8 +1,8 @@
<?xml version="1.0"?>
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
name="ccm-ldn-atoz"
name="ccm-atoz"
prettyName="A-Z"
version="6.6.1"
version="6.6.2"
release="1"
webapp="ROOT">
@ -14,14 +14,18 @@
<ccm:requires name="ccm-ldn-aplaws" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-ldn-terms" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-ldn-util" version="6.6.0" relation="ge"/>
<!--
<ccm:requires name="ccm-cms-types-siteproxy" version="6.6.0" relation="ge"/>
-->
</ccm:dependencies>
<ccm:contacts>
<ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/>
<ccm:contact uri="mailto:rhea@redhat.com" type="support"/>
</ccm:contacts>
<ccm:description>
The ccm-ldn-atoz package enables a site to present all it's content in
The ccm-atoz package enables a site to present all it's content in
alphabetical order as an additional service to it's users. Usually the
theme provides a link to the page as part of its static elements.

View File

@ -1 +1 @@
@@ ../oracle-se/upgrade/add-item_provider.sql
@@ oracle-se/add-item_provider.sql

View File

@ -1 +1 @@
@@ ../oracle-se/upgrade/add-item_provider_alias.sql
@@ oracle-se/add-item_provider_alias.sql

View File

@ -1,3 +1,3 @@
begin;
\i ../postgres/upgrade/add-item_provider.sql
\i postgres/add-item_provider.sql
commit;

View File

@ -1,3 +1,3 @@
begin;
\i ../postgres/upgrade/add-item_provider_alias.sql
\i postgres/add-item_provider_alias.sql
commit;

View File

@ -4,8 +4,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd">
<xrd:context name="com.arsdigita.london.atoz.ui.admin.ProviderList">
<xrd:adapter objectType="com.arsdigita.london.atoz.AtoZProvider">
<xrd:context name="com.arsdigita.atoz.ui.admin.ProviderList">
<xrd:adapter objectType="com.arsdigita.atoz.AtoZProvider">
<xrd:attributes rule="exclude">
<xrd:property name="/object/id"/>
<xrd:property name="/object/defaultDomainClass"/>
@ -14,9 +14,9 @@
</xrd:adapter>
</xrd:context>
<xrd:context name="com.arsdigita.london.atoz.ui.admin.ProviderDetails">
<xrd:context name="com.arsdigita.atoz.ui.admin.ProviderDetails">
<xrd:adapter objectType="com.arsdigita.london.atoz.AtoZCategoryProvider">
<xrd:adapter objectType="com.arsdigita.atoz.AtoZCategoryProvider">
<xrd:attributes rule="exclude">
<xrd:property name="/object/id"/>
<xrd:property name="/object/defaultDomainClass"/>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<registry>
<config class="com.arsdigita.atoz.AtoZConfig"
storage="ccm-atoz/atoz.properties"/>
</registry>

View File

@ -1,4 +1,5 @@
<load>
<requires>
<table name="inits"/>
<table name="acs_objects"/>
@ -6,12 +7,15 @@
<initializer class="com.arsdigita.london.util.Initializer"/>
<initializer class="com.arsdigita.london.terms.Initializer"/>
</requires>
<provides>
<table name="atoz_provider"/>
<initializer class="com.arsdigita.london.atoz.Initializer"/>
<initializer class="com.arsdigita.atoz.Initializer"/>
</provides>
<scripts>
<schema directory="ccm-ldn-atoz"/>
<data class="com.arsdigita.london.atoz.Loader"/>
<schema directory="ccm-atoz"/>
<data class="com.arsdigita.atoz.Loader"/>
</scripts>
</load>

View File

@ -0,0 +1,22 @@
<upgrade>
<version from="1.0.0" to="1.0.1">
<script sql="ccm-atoz/upgrade/::database::-1.0.0-1.0.1.sql"/>
</version>
<version from="1.0.2" to="1.0.3">
<script sql="ccm-atoz/upgrade/::database::-1.0.2-1.0.3.sql"/>
</version>
<version from="6.3.0" to="6.3.1">
<script sql="ccm-atoz/upgrade/::database::-6.3.0-6.3.1.sql"/>
</version>
<version from="6.5.0" to="6.6.0">
<script sql="ccm-atoz/upgrade/::database::-6.5.0-6.6.0.sql"/>
</version>
<version from="6.6.0" to="6.6.1">
<!-- AtoZ now initialized as legacy free application -->
<script sql="ccm-atoz/upgrade/::database::-6.6.0-6.6.1.sql"/>
</version>
<version from="6.6.1" to="6.6.2">
<!-- AtoZ renamed from ccm-ldn-atoz to ccm-atoz -->
<script sql="ccm-atoz/upgrade/::database::-6.6.0-6.6.1.sql"/>
</version>
</upgrade>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<registry>
<config class="com.arsdigita.london.atoz.AtoZConfig"
storage="ccm-ldn-atoz/atoz.properties"/>
</registry>

View File

@ -1,18 +0,0 @@
<upgrade>
<version from="1.0.0" to="1.0.1">
<script sql="ccm-ldn-atoz/upgrade/::database::-1.0.0-1.0.1.sql"/>
</version>
<version from="1.0.2" to="1.0.3">
<script sql="ccm-ldn-atoz/upgrade/::database::-1.0.2-1.0.3.sql"/>
</version>
<version from="6.3.0" to="6.3.1">
<script sql="ccm-ldn-atoz/upgrade/::database::-6.3.0-6.3.1.sql"/>
</version>
<version from="6.5.0" to="6.6.0">
<script sql="ccm-ldn-atoz/upgrade/::database::-6.5.0-6.6.0.sql"/>
</version>
<version from="6.6.0" to="6.6.1">
<!-- AtoZ now initialized as legacy free application -->
<script sql="ccm-ldn-atoz/upgrade/::database::-6.6.0-6.6.1.sql"/>
</version>
</upgrade>

View File

@ -1,7 +1,22 @@
package com.arsdigita.atoz;
/*
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
import org.apache.commons.cli.CommandLine;
import org.apache.log4j.Logger;
package com.arsdigita.atoz;
import com.arsdigita.domain.DomainObject;
import com.arsdigita.domain.DomainObjectFactory;
@ -13,17 +28,31 @@ import com.arsdigita.london.util.Transaction;
import com.arsdigita.persistence.DataObject;
import com.arsdigita.web.Application;
import org.apache.commons.cli.CommandLine;
import org.apache.log4j.Logger;
/**
* Command line utility to create an application instance of AtoZ.
*
* Usually Loader creates a (default) application instance.
*
*/
public class AddAtoZ extends Program {
private static final Logger LOG = Logger.getLogger(AddAtoZ.class);
/**
* Default Constructor
*/
public AddAtoZ() {
super("Add AtoZ instance", "1.0.0", "URL-FRAGMENT TITLE");
}
private void addAtoZ(String atozURL, String atozTitle) {
if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE, "/"+atozURL+"/")) {
DomainObjectFactory.registerInstantiator(
AtoZ.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() {
public DomainObject doNewInstance(DataObject dataObject) {
@ -33,10 +62,13 @@ public class AddAtoZ extends Program {
Application app = Application.createApplication(
AtoZ.BASE_DATA_OBJECT_TYPE, atozURL, atozTitle, null);
app.save();
} else {
System.err.println(AtoZ.BASE_DATA_OBJECT_TYPE
+ " already installed at " + atozURL);
System.exit(1);
}
}
@ -46,6 +78,7 @@ public class AddAtoZ extends Program {
new KernelExcursion() {
public void excurse() {
setEffectiveParty(Kernel.getSystemParty());
String[] args = cmdLine.getArgs();
if (args.length == 2) {
String atozURL = args[0];

View File

@ -18,25 +18,33 @@
package com.arsdigita.atoz;
import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.domain.DomainCollection;
import com.arsdigita.persistence.DataObject;
import com.arsdigita.persistence.DataCollection;
import com.arsdigita.persistence.OID;
import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.domain.DomainCollection;
import com.arsdigita.web.Application;
import com.arsdigita.xml.Element;
import com.arsdigita.util.Assert;
import com.arsdigita.web.Application;
import com.arsdigita.xml.Element;
import java.util.List;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import org.apache.log4j.Logger;
/**
* Base class of the AtoZ application (module)
* Application domain class and main entry ponit of AtoZ application (package).
*
* The package enables a site to present content in alphabetical oder as an
* additional service to it's users. The content tp present is retrieved from
* the storage by 'providers'. A generic provider for content items is part
* of the package, additional specialized providers may provide specific kind
* of content.
*
* It manages an registry of available providers which generate the content for
* specific content types and provides an entry point for the UI.
*
*/
public class AtoZ extends Application {
@ -50,6 +58,10 @@ public class AtoZ extends Application {
public static final String PROVIDERS = "atozProviders";
public static final String SORT_KEY = "sortKey";
/** Internal registry of available providers. A provider delivers for a
* specific content type the title to include in AtoZ list. */
private static Set s_types = new HashSet();
/** Config object containing various parameter */
private static final AtoZConfig s_config = AtoZConfig.getConfig();
@ -115,6 +127,21 @@ public class AtoZ extends Application {
"http://xmlns.redhat.com/atoz/1.0");
}
/**
* Adds a provider type to the internal list of providers (provider registry).
* Specifically used by Initializer(s) to incorporate additional providers.
*
* @param type
*/
public static void registerProviderType(AtoZProviderType type) {
s_types.add(type);
}
public static AtoZProviderType[] getProviderTypes() {
return (AtoZProviderType[])s_types
.toArray(new AtoZProviderType[s_types.size()]);
}
// /*
// * Application specific method only required if installed in its own
// * web application context
@ -139,13 +166,13 @@ public class AtoZ extends Application {
* <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
* <init-param>
* <param-name>template-path</param-name>
* <param-value>/templates/ccm-ldn-atoz</param-value>
* <param-value>/templates/ccm-atoz</param-value>
* </init-param>
* </servlet>
*
* <servlet-mapping>
* <servlet-name>atoz-files</servlet-name>
* <url-pattern>/ccm-ldn-atoz/files/*</url-pattern>
* <url-pattern>/ccm-atoz/files/*</url-pattern>
* </servlet-mapping>
*
* @return path name to the applications servlet/JSP

View File

@ -21,6 +21,10 @@ package com.arsdigita.atoz;
import com.arsdigita.xml.Element;
/**
*
*
*/
public interface AtoZAtomicEntry extends AtoZEntry {
String getLink();
Element getContent();

View File

@ -38,7 +38,7 @@ public class AtoZCategoryAlias extends DomainObject {
private static final Logger s_log = Logger.getLogger(AtoZCategoryAlias.class);
public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.london.atoz.AtoZCategoryAlias";
"com.arsdigita.atoz.AtoZCategoryAlias";
public static final String ID = "id";
public static final String PROVIDER = "provider";
@ -111,7 +111,7 @@ public class AtoZCategoryAlias extends DomainObject {
return Sequences.getNextValue();
} catch (SQLException e) {
final String errorMsg = "Unable to generate a unique " +
"ACSObject id.";
"ACSObject id.";
s_log.error(errorMsg);
throw PersistenceException.newInstance(errorMsg, e);
}

View File

@ -21,7 +21,6 @@ package com.arsdigita.atoz;
import com.arsdigita.persistence.DataQuery;
import com.arsdigita.persistence.OID;
import com.arsdigita.persistence.Filter;
import com.arsdigita.web.ParameterMap;
import com.arsdigita.web.URL;
import com.arsdigita.web.Web;
@ -32,10 +31,15 @@ import java.util.ArrayList;
/**
*
* @author pb
*
*/
public class AtoZCategoryGenerator extends AbstractAtoZGenerator {
public class AtoZCategoryGenerator extends AtoZGeneratorAbstractImpl {
/**
* Constructor
*
* @param provider
*/
public AtoZCategoryGenerator(AtoZCategoryProvider provider) {
super(provider);
}

View File

@ -18,8 +18,6 @@
package com.arsdigita.atoz;
import org.apache.log4j.Logger;
import com.arsdigita.categorization.Category;
import com.arsdigita.cms.ContentType;
import com.arsdigita.domain.DomainCollection;
@ -34,12 +32,20 @@ import com.arsdigita.persistence.DataQuery;
import com.arsdigita.persistence.OID;
import com.arsdigita.persistence.SessionManager;
import org.apache.log4j.Logger;
/**
*
*
*/
public class AtoZCategoryProvider extends AtoZProvider {
private static final Logger s_log = Logger.getLogger(AtoZCategoryProvider.class);
/** Private logger instance to assist debugging. */
private static final Logger s_log =
Logger.getLogger(AtoZCategoryProvider.class);
public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.london.atoz.AtoZCategoryProvider";
"com.arsdigita.atoz.AtoZCategoryProvider";
public static final String IS_COMPOUND = "isCompound";
@ -53,20 +59,32 @@ public class AtoZCategoryProvider extends AtoZProvider {
public static final String CT_TYPE_ID = "type_id";
public static final String ATOMIC_ENTRIES = "com.arsdigita.london.atoz.getAtomicCategoryEntries";
public static final String ATOMIC_ENTRIES =
"com.arsdigita.atoz.getAtomicCategoryEntries";
public static final String ATOMIC_ENTRIES_FOR_ROOT_CATEGORY = "com.arsdigita.london.atoz.getAtomicCategoryEntriesForRootCategory";
public static final String ATOMIC_ENTRIES_FOR_ROOT_CATEGORY =
"com.arsdigita.atoz.getAtomicCategoryEntriesForRootCategory";
public static final String FILTERED_ATOMIC_ENTRIES = "com.arsdigita.london.atoz.getAtomicFilteredCategoryEntries";
public static final String FILTERED_ATOMIC_ENTRIES =
"com.arsdigita.atoz.getAtomicFilteredCategoryEntries";
public static final String FILTERED_ATOMIC_ENTRIES_FOR_ROOT_CATEGORY = "com.arsdigita.london.atoz.getAtomicFilteredCategoryEntriesForRootCategory";
public static final String FILTERED_ATOMIC_ENTRIES_FOR_ROOT_CATEGORY =
"com.arsdigita.atoz.getAtomicFilteredCategoryEntriesForRootCategory";
public static final String ALL_BLACK_LIST_TYPES = "com.arsdigita.london.atoz.getAllBlackListTypes";
public static final String ALL_BLACK_LIST_TYPES =
"com.arsdigita.atoz.getAllBlackListTypes";
/**
*
*/
public AtoZCategoryProvider() {
this(BASE_DATA_OBJECT_TYPE);
}
/**
* Constructor
* @param type
*/
protected AtoZCategoryProvider(String type) {
super(type);
}
@ -145,7 +163,8 @@ public class AtoZCategoryProvider extends AtoZProvider {
while (types.next()) {
String objectType = (String)types.get("objectType");
s_log.debug("Excluding object type from DataCollection: " + objectType);
s_log.debug("Excluding object type from DataCollection: "
+ objectType);
definition.excludeSpecificObjectType(objectType);
}
types.close();
@ -174,7 +193,8 @@ public class AtoZCategoryProvider extends AtoZProvider {
cats.setParameter("rootCategoryID", root.getID());
} else {
if(filterCats){
cats = SessionManager.getSession().retrieveQuery(FILTERED_ATOMIC_ENTRIES);
cats = SessionManager.getSession()
.retrieveQuery(FILTERED_ATOMIC_ENTRIES);
}else{
cats = SessionManager.getSession().retrieveQuery(ATOMIC_ENTRIES);
}

View File

@ -59,9 +59,6 @@ public class AtoZConfig extends AbstractConfig {
return s_conf;
}
/** */
private Set m_types;
// ///////////////////////////////////////////////////////////////////////
//
@ -69,32 +66,30 @@ public class AtoZConfig extends AbstractConfig {
/** Rules for configuring information in generated XML */
private Parameter m_adapters = new ResourceParameter
("com.arsdigita.london.atoz.traversal_adapters",
("com.arsdigita.atoz.traversal_adapters",
Parameter.REQUIRED,
"/WEB-INF/resources/atoz-adapters.xml");
/** The UI widget for the Root Category Picker */
private Parameter m_rootCategoryPicker = new ClassParameter(
"com.arsdigita.london.atoz.root_category_picker",
"com.arsdigita.atoz.root_category_picker",
Parameter.REQUIRED,
ApplicationCategoryPicker.class);
/** Make AtoZ use subsite-specific navigation categories. Set to true,
* and the AtoZ will use the subsite-specific navigation categories
* if you define *any* CategoryProvider */
private BooleanParameter m_useSubsiteSpecificNavigationCategory = new BooleanParameter
("com.arsdigita.london.atoz.use_subsite_specific_navigation_category",
("com.arsdigita.atoz.use_subsite_specific_navigation_category",
Parameter.OPTIONAL,
Boolean.FALSE);
/** To filter out category without published items. If TRUE, the AtoZ
* category providers will only return Categories with published items */
private BooleanParameter m_filterCategoryProdiver = new BooleanParameter (
"com.arsdigita.london.atoz.filterCategoryProviders",
"com.arsdigita.atoz.filterCategoryProviders",
Parameter.OPTIONAL,
Boolean.FALSE);
public AtoZConfig() {
m_types = new HashSet();
register(m_adapters);
register(m_rootCategoryPicker);
register(m_useSubsiteSpecificNavigationCategory);
@ -104,6 +99,10 @@ public class AtoZConfig extends AbstractConfig {
}
/**
* Provides access to the traversal adapter as stream.
* @return
*/
InputStream getTraversalAdapters() {
return (InputStream)get(m_adapters);
}
@ -112,15 +111,6 @@ public class AtoZConfig extends AbstractConfig {
return (Class)get(m_rootCategoryPicker);
}
public void registerProviderType(AtoZProviderType type) {
m_types.add(type);
}
public AtoZProviderType[] getProviderTypes() {
return (AtoZProviderType[])m_types
.toArray(new AtoZProviderType[m_types.size()]);
}
public boolean useSubsiteSpecificNavigationCategory() {
return ((Boolean) get(m_useSubsiteSpecificNavigationCategory)).booleanValue();
}

View File

@ -18,8 +18,6 @@
package com.arsdigita.atoz;
public interface AtoZEntry {
String getTitle();
String getDescription();

View File

@ -20,11 +20,11 @@ package com.arsdigita.atoz;
public abstract class AbstractAtoZGenerator implements AtoZGenerator {
public abstract class AtoZGeneratorAbstractImpl implements AtoZGenerator {
private AtoZProvider m_provider;
public AbstractAtoZGenerator(AtoZProvider provider) {
public AtoZGeneratorAbstractImpl(AtoZProvider provider) {
m_provider = provider;
}

View File

@ -34,7 +34,7 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class AtoZItemGenerator extends AbstractAtoZGenerator {
public class AtoZItemGenerator extends AtoZGeneratorAbstractImpl {
public AtoZItemGenerator(AtoZItemProvider provider) {
super(provider);
@ -72,9 +72,9 @@ public class AtoZItemGenerator extends AbstractAtoZGenerator {
live = item.getLiveVersion();
if (live != null) {
// should always be a ContentPage
description = (live instanceof ContentPage) ? ((ContentPage) live)
.getSearchSummary()
: live.getName();
description = (live instanceof ContentPage)
? ((ContentPage) live).getSearchSummary()
: live.getName();
title = "";
if (entries.get("aliasTitle") != null) {
title = entries.get("aliasTitle").toString();

View File

@ -30,13 +30,14 @@ import com.arsdigita.categorization.Category;
public class AtoZItemProvider extends AtoZProvider {
public static final String BASE_DATA_OBJECT_TYPE
= "com.arsdigita.london.atoz.AtoZItemProvider";
public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.atoz.AtoZItemProvider";
public static final String CATEGORY = "category";
public static final String LOAD_PATHS = "loadPaths";
public static final String ATOMIC_ENTRIES = "com.arsdigita.london.atoz.getAtomicItemEntries";
public static final String ATOMIC_ENTRIES =
"com.arsdigita.atoz.getAtomicItemEntries";
public AtoZItemProvider() {
this(BASE_DATA_OBJECT_TYPE);
@ -87,7 +88,8 @@ public class AtoZItemProvider extends AtoZProvider {
}
public DomainCollection getAliases() {
DomainCollection aliases = new DomainCollection(SessionManager.getSession().retrieve(AtoZItemAlias.BASE_DATA_OBJECT_TYPE));
DomainCollection aliases = new DomainCollection(SessionManager.getSession()
.retrieve(AtoZItemAlias.BASE_DATA_OBJECT_TYPE));
aliases.addFilter("atozItemProvider = :providerId").set("providerId", getID());
aliases.addOrder("title");
return aliases;

View File

@ -31,10 +31,11 @@ import org.apache.log4j.Logger;
public abstract class AtoZProvider extends ACSObject {
/** Private logger instace to assist debugging */
private static final Logger s_log = Logger.getLogger(AtoZProvider.class);
public static final String BASE_DATA_OBJECT_TYPE
= "com.arsdigita.london.atoz.AtoZProvider";
public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.atoz.AtoZProvider";
public static final String TITLE = "title";
public static final String DESCRIPTION = "description";

View File

@ -26,6 +26,10 @@ import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
import com.arsdigita.util.Assert;
import com.arsdigita.util.Classes;
/**
*
* @author pb
*/
public class AtoZProviderType {
private String m_title;

View File

@ -18,22 +18,20 @@
package com.arsdigita.atoz;
import com.arsdigita.atoz.siteproxy.AtoZSiteProxyProvider;
// import com.arsdigita.atoz.siteproxy.AtoZSiteProxyProvider;
// import com.arsdigita.atoz.siteproxy.ui.admin.SiteProxyProviderAdmin;
// import com.arsdigita.atoz.siteproxy.ui.admin.SiteProxyProviderForm;
import com.arsdigita.atoz.ui.admin.CategoryProviderAdmin;
import com.arsdigita.atoz.ui.admin.CategoryProviderForm;
import com.arsdigita.atoz.ui.admin.ItemProviderAdmin;
import com.arsdigita.atoz.ui.admin.ItemProviderForm;
import com.arsdigita.db.DbHelper;
import com.arsdigita.domain.DomainObject;
import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.domain.DomainObjectInstantiator;
import com.arsdigita.domain.xml.TraversalHandler;
import com.arsdigita.kernel.ACSObjectInstantiator;
import com.arsdigita.london.atoz.terms.DomainProvider;
import com.arsdigita.atoz.ui.admin.CategoryProviderAdmin;
import com.arsdigita.atoz.ui.admin.CategoryProviderForm;
import com.arsdigita.atoz.ui.admin.ItemProviderAdmin;
import com.arsdigita.atoz.ui.admin.ItemProviderForm;
import com.arsdigita.atoz.siteproxy.ui.admin.SiteProxyProviderAdmin;
import com.arsdigita.atoz.siteproxy.ui.admin.SiteProxyProviderForm;
import com.arsdigita.london.atoz.ui.terms.DomainProviderAdmin;
import com.arsdigita.london.atoz.ui.terms.DomainProviderForm;
import com.arsdigita.navigation.ApplicationNavigationModel;
import com.arsdigita.navigation.DefaultNavigationModel;
import com.arsdigita.persistence.DataObject;
@ -94,41 +92,44 @@ public class Initializer extends CompoundInitializer {
XML.parse(AtoZ.getConfig().getTraversalAdapters(),
new TraversalHandler());
AtoZ.getConfig().registerProviderType(
new AtoZProviderType("Category Provider",
"Provides a category A-Z",
AtoZCategoryProvider.class,
CategoryProviderForm.class,
CategoryProviderAdmin.class));
AtoZ.getConfig().registerProviderType(
AtoZ.registerProviderType(
new AtoZProviderType("Item Provider",
"Provides an item A-Z",
AtoZItemProvider.class,
ItemProviderForm.class,
ItemProviderAdmin.class));
AtoZ.registerProviderType(
new AtoZProviderType("Category Provider",
"Provides a category A-Z",
AtoZCategoryProvider.class,
CategoryProviderForm.class,
CategoryProviderAdmin.class));
// Introduces a dependency on ccm-types-siteproxy
// Must be refactored into its own package.
AtoZ.getConfig().registerProviderType(
/* MOVED to ccm-atoz-siteproxy
AtoZ.registerProviderType(
new AtoZProviderType("SiteProxy Provider",
"Provides a SiteProxy A-Z",
AtoZSiteProxyProvider.class,
SiteProxyProviderForm.class,
SiteProxyProviderAdmin.class));
*/
// Introduces dependenciy on navigation package
// Function / purpose ??
ApplicationNavigationModel.register(AtoZ.class.getName(),
new DefaultNavigationModel());
new DefaultNavigationModel());
// Introduces dependency on ccm-ldn-typesesdervise ??
AtoZ.getConfig().registerProviderType(
/* AtoZ.registerProviderType(
new AtoZProviderType("ESD Toolkit Domain Provider",
"Provides a ESD Toolkit A-Z",
DomainProvider.class,
DomainProviderForm.class,
DomainProviderAdmin.class));
*/
}
}

View File

@ -41,6 +41,7 @@ public class Loader extends PackageLoader {
new KernelExcursion() {
public void excurse() {
setEffectiveParty(Kernel.getSystemParty());
setupAtoZ();
}
}.run();
@ -71,6 +72,7 @@ public class Loader extends PackageLoader {
ApplicationType type = setup.run();
type.save();
*/
/* Create new type legacy free application type
* NOTE: The wording in the title parameter of ApplicationType
* determines the name of the subdirectory for the XSL stylesheets.
@ -81,7 +83,7 @@ public class Loader extends PackageLoader {
ApplicationType type = new ApplicationType("AtoZ",
AtoZ.BASE_DATA_OBJECT_TYPE );
type.setDescription("A-Z of content.");
// type.setSingleton(true);
// type.setSingleton(true); // For later use
type.save();
if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE,

View File

@ -21,7 +21,7 @@ package com.arsdigita.atoz.ui;
import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.SimpleContainer;
import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.cms.dispatcher.SiteProxyPanel;
// import com.arsdigita.cms.dispatcher.SiteProxyPanel;
import com.arsdigita.kernel.Kernel;
@ -43,6 +43,7 @@ public class AtoZPane extends SimpleContainer {
m_letter = letter;
}
@Override
public void generateXML(PageState state, Element parent) {
AtoZ atoz = (AtoZ) Kernel.getContext().getResource();
AtoZGenerator[] generators = atoz.getGenerators();
@ -74,8 +75,16 @@ public class AtoZPane extends SimpleContainer {
}
}
private void generateAtoZ(AtoZGenerator generator, String letter,
Element parent) {
/**
*
* @param generator
* @param letter
* @param parent
*/
private void generateAtoZ(AtoZGenerator generator,
String letter,
Element parent) {
AtoZEntry[] entries = generator.getEntries(letter);
Element content = AtoZ.newElement("provider");
content.addAttribute("title", generator.getTitle());
@ -84,6 +93,7 @@ public class AtoZPane extends SimpleContainer {
generateAtoZEntries(entries, content);
parent.addContent(content);
}
public void generateAtoZEntries(AtoZEntry[] entries, Element parent) {

View File

@ -66,7 +66,7 @@ public class AdminPane extends SimpleContainer {
m_createForm.addCompletionListener(new ProviderCreateComplete());
add(m_createForm);
AtoZProviderType[] providers = AtoZ.getConfig().getProviderTypes();
AtoZProviderType[] providers = AtoZ.getProviderTypes();
m_providerCreateMap = new HashMap();
m_providerAdminMap = new HashMap();
@ -85,6 +85,7 @@ public class AdminPane extends SimpleContainer {
}
}
@Override
public void register(Page p) {
super.register(p);

View File

@ -26,6 +26,10 @@ import com.arsdigita.bebop.ActionLink;
import com.arsdigita.bebop.Page;
import com.arsdigita.bebop.Component;
/**
*
*
*/
public class CategoryProviderAdmin extends ProviderAdmin {
private CategoryProviderForm m_detailsForm;

View File

@ -37,6 +37,10 @@ import com.arsdigita.categorization.Category;
import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
import com.arsdigita.atoz.AtoZCategoryProvider;
/**
*
*
*/
public class CategoryProviderAliasForm extends Form {
private ACSObjectSelectionModel m_provider;
@ -47,6 +51,10 @@ public class CategoryProviderAliasForm extends Form {
private SingleSelect m_letter;
private SaveCancelSection m_buttons;
/**
*
* @param provider
*/
public CategoryProviderAliasForm(ACSObjectSelectionModel provider) {
super("categoryAliasForm", new SimpleContainer());
setRedirecting(true);
@ -80,6 +88,9 @@ public class CategoryProviderAliasForm extends Form {
addSubmissionListener(new ProviderSubmissionListener());
}
/**
*
*/
private class ProviderSubmissionListener implements FormSubmissionListener {
public void submitted(FormSectionEvent e)
throws FormProcessException {
@ -92,6 +103,9 @@ public class CategoryProviderAliasForm extends Form {
}
}
/**
*
*/
private class ProviderProcessListener implements FormProcessListener {
public void process(FormSectionEvent e)
throws FormProcessException {

View File

@ -31,7 +31,7 @@ import com.arsdigita.domain.DomainObjectXMLRenderer;
import com.arsdigita.domain.DomainCollection;
import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.persistence.OID;
import com.arsdigita.categorization.Category;
// import com.arsdigita.categorization.Category;
import com.arsdigita.xml.Element;
import com.arsdigita.xml.XML;
@ -49,6 +49,7 @@ public class CategoryProviderAliasList extends SimpleContainer {
m_provider = provider;
}
@Override
public void respond(PageState state) {
String key = state.getControlEventName();
String value = state.getControlEventValue();
@ -63,6 +64,7 @@ public class CategoryProviderAliasList extends SimpleContainer {
}
}
@Override
public void generateXML(PageState state,
Element parent) {
Element content = AtoZ.newElement("categoryProviderAliasList");

View File

@ -37,6 +37,10 @@ import com.arsdigita.xml.Element;
import com.arsdigita.util.UncheckedWrapperException;
import java.io.IOException;
/**
*
*
*/
public class CategoryProviderBlackList extends SimpleContainer {
private ACSObjectSelectionModel m_provider;
@ -46,6 +50,7 @@ public class CategoryProviderBlackList extends SimpleContainer {
m_provider = provider;
}
@Override
public void respond(PageState state) {
String key = state.getControlEventName();
String value = state.getControlEventValue();
@ -61,6 +66,7 @@ public class CategoryProviderBlackList extends SimpleContainer {
}
@Override
public void generateXML(PageState state,
Element parent) {
Element content = AtoZ.newElement("categoryProviderBlackList");

View File

@ -36,6 +36,10 @@ import com.arsdigita.categorization.Category;
import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
import com.arsdigita.kernel.ACSObject;
/**
*
*
*/
public class CategoryProviderBlockForm extends Form {
private ACSObjectSelectionModel m_provider;
@ -43,6 +47,10 @@ public class CategoryProviderBlockForm extends Form {
private ObjectCategoryPicker m_category;
private SaveCancelSection m_buttons;
/**
*
* @param provider
*/
public CategoryProviderBlockForm(ACSObjectSelectionModel provider) {
super("categoryBlockForm", new SimpleContainer());
setRedirecting(true);
@ -66,6 +74,9 @@ public class CategoryProviderBlockForm extends Form {
addSubmissionListener(new ProviderSubmissionListener());
}
/**
*
*/
private class ProviderSubmissionListener implements FormSubmissionListener {
public void submitted(FormSectionEvent e)
throws FormProcessException {
@ -78,6 +89,9 @@ public class CategoryProviderBlockForm extends Form {
}
}
/**
*
*/
private class ProviderProcessListener implements FormProcessListener {
public void process(FormSectionEvent e)
throws FormProcessException {

View File

@ -52,7 +52,7 @@ public class ProviderCreateForm extends Form {
m_providerType.addValidationListener(new NotNullValidationListener());
m_providerType.addOption(new Option(null, "--Select one--"));
AtoZProviderType[] providers = AtoZ.getConfig().getProviderTypes();
AtoZProviderType[] providers = AtoZ.getProviderTypes();
for (int i = 0 ; i < providers.length ; i++) {
m_providerType.addOption(
new Option(providers[i].getProvider().getName(),

View File

@ -9,7 +9,7 @@ the front page of the HTML documentation it produces.
<h1>Purpose</h1>
<p>
The ccm-ldn-atoz package enables a site to present all it's content
The ccm-atoz package enables a site to present all it's content
in alphabetical order as an additional service to it's users. Usually
the theme provides a link to the page as part of its static elements.
</p>
@ -28,7 +28,10 @@ the front page of the HTML documentation it produces.
<p>&nbsp;</p>
<h1>Additional Application Details</h1>
<p>&nbsp;</p>
<p>The content to present is retrieved from the storage by 'providers'.
A generic provider for content items is part of the package, additional
specialized providers may provide specific kind of content.
</p>
<h1>Usage</h1>
<p>
@ -43,11 +46,15 @@ the front page of the HTML documentation it produces.
Currently available providers are:
</p>
<ul>
<li>ESD Toolkit Domain Provider</li>
<li>Item Provider</li>
<li>SiteProxy Provider</li>
<li>Catgegory Provider</li>
</ul>
<p>
Extension packages make available:
</p>
<ul>
<li>ESD Toolkit Domain Provider</li>
<li>SiteProxy Provider</li>
</ul>

View File

@ -4,7 +4,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<!-- module ccm-ldn-atoz - servlet declarations BEGIN -->
<!-- module ccm-atoz - servlet declarations BEGIN -->
<servlet>
<servlet-name>atoz-files</servlet-name>
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
@ -13,13 +13,13 @@
<param-value>/templates/ccm-atoz</param-value>
</init-param>
</servlet>
<!-- module ccm-ldn-atoz - servlet declarations END -->
<!-- module ccm-atoz - servlet declarations END -->
<!-- module ccm-ldn-atoz - servlet mappings BEGIN -->
<!-- module ccm-atoz - servlet mappings BEGIN -->
<servlet-mapping>
<servlet-name>atoz-files</servlet-name>
<url-pattern>/ccm-atoz/files/*</url-pattern>
</servlet-mapping>
<!-- module ccm-ldn-atoz - servlet mappings END -->
<!-- module ccm-atoz - servlet mappings END -->
</web-app>

View File

@ -17,7 +17,7 @@
model com.arsdigita.london.atoz.terms;
import com.arsdigita.london.atoz.AtoZProvider;
import com.arsdigita.atoz.AtoZProvider;
import com.arsdigita.london.terms.Domain;
object type DomainProvider extends AtoZProvider {

View File

@ -18,7 +18,7 @@
package com.arsdigita.london.atoz.terms;
import com.arsdigita.atoz.AbstractAtoZGenerator;
import com.arsdigita.atoz.AtoZGeneratorAbstractImpl;
import com.arsdigita.atoz.AtoZAtomicEntry;
import com.arsdigita.atoz.AtoZEntry;
import com.arsdigita.london.terms.Domain;
@ -37,12 +37,22 @@ import com.arsdigita.xml.Element;
import java.util.List;
import java.util.ArrayList;
public class DomainGenerator extends AbstractAtoZGenerator {
/**
*
*
*/
public class DomainGenerator extends AtoZGeneratorAbstractImpl {
public DomainGenerator(DomainProvider provider) {
super(provider);
}
/**
*
* @param letter
* @return
*/
public AtoZEntry[] getEntries(String letter) {
DomainProvider provider = (DomainProvider) getProvider();
Domain domain = provider.getDomain();
@ -68,15 +78,24 @@ public class DomainGenerator extends AbstractAtoZGenerator {
}
return (AtoZEntry[]) l.toArray(new AtoZEntry[l.size()]);
}
/**
*
*/
private class DomainAtomicEntry implements AtoZAtomicEntry {
private OID m_oid;
private String m_title;
private String m_description;
/**
*
* @param oid
* @param title
* @param description
*/
public DomainAtomicEntry(OID oid, String title, String description) {
m_oid = oid;
m_title = title;

View File

@ -26,10 +26,14 @@ import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.persistence.DataObject;
import com.arsdigita.persistence.OID;
/**
*
*
*/
public class DomainProvider extends AtoZProvider {
public static final String BASE_DATA_OBJECT_TYPE
= "com.arsdigita.london.atoz.terms.DomainProvider";
public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.london.atoz.terms.DomainProvider";
public static final String DOMAIN = "domain";

View File

@ -0,0 +1,53 @@
/*
* Copyright (C) 2012 Peter Boy All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package com.arsdigita.london.atoz.terms;
import com.arsdigita.atoz.AtoZ;
import com.arsdigita.atoz.AtoZProviderType;
// import com.arsdigita.london.atoz.terms.DomainProvider; //same package
import com.arsdigita.london.atoz.ui.terms.DomainProviderAdmin;
import com.arsdigita.london.atoz.ui.terms.DomainProviderForm;
import com.arsdigita.runtime.CompoundInitializer;
import com.arsdigita.runtime.DomainInitEvent;
/**
*
* @author pb
*/
public class Initializer extends CompoundInitializer {
/**
*
* @param evt
*/
@Override
public void init(DomainInitEvent evt) {
super.init(evt);
// Introduces dependency on ccm-ldn-typesesdervise ??
AtoZ.registerProviderType(
new AtoZProviderType("ESD Toolkit Domain Provider",
"Provides a ESD Toolkit A-Z",
DomainProvider.class,
DomainProviderForm.class,
DomainProviderAdmin.class));
}
}

View File

@ -29,12 +29,18 @@ import com.arsdigita.bebop.event.ActionEvent;
import com.arsdigita.bebop.event.ActionListener;
import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
/**
*
*/
public class DomainProviderAdmin extends ProviderAdmin {
private DomainProviderForm m_detailsForm;
private ActionLink m_editDetails;
private ProviderDetails m_details;
/**
* Constructor
*/
public DomainProviderAdmin(ACSObjectSelectionModel provider) {
super("domainProviderAdmin",
provider);

View File

@ -37,10 +37,16 @@ import com.arsdigita.persistence.SessionManager;
import java.util.TooManyListenersException;
/**
*
*/
public class DomainProviderForm extends ProviderForm {
private SingleSelect m_domain;
/**
* Constructor
*/
public DomainProviderForm(ACSObjectSelectionModel provider) {
super("domainProvider",
DomainProvider.class, provider);
@ -48,6 +54,10 @@ public class DomainProviderForm extends ProviderForm {
setMetaDataAttribute("title", "Domain provider properties");
}
/**
*
*/
@Override
protected void addWidgets() {
super.addWidgets();
@ -76,6 +86,12 @@ public class DomainProviderForm extends ProviderForm {
add(m_domain);
}
/**
*
* @param state
* @param provider
*/
@Override
protected void processWidgets(PageState state,
AtoZProvider provider) {
super.processWidgets(state, provider);
@ -88,6 +104,12 @@ public class DomainProviderForm extends ProviderForm {
OID.valueOf(oid)));
}
/**
*
* @param state
* @param provider
*/
@Override
protected void initWidgets(PageState state,
AtoZProvider provider) {
super.initWidgets(state, provider);