Weitere Umbauten AtoZ.
git-svn-id: https://svn.libreccm.org/ccm/trunk@1593 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
c35db8039e
commit
1f88a7bd25
|
|
@ -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>
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
// 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
|
||||||
|
|
||||||
model com.arsdigita.london.atoz;
|
model com.arsdigita.atoz;
|
||||||
|
|
||||||
import com.arsdigita.categorization.Category;
|
import com.arsdigita.categorization.Category;
|
||||||
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
@ ddl/oracle-se/create.sql
|
||||||
|
@ ddl/oracle-se/deferred.sql
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
begin;
|
||||||
|
\i ddl/postgres/create.sql
|
||||||
|
\i ddl/postgres/deferred.sql
|
||||||
|
end;
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.atoz.siteproxy;
|
package com.arsdigita.atoz.siteproxy;
|
||||||
|
|
||||||
import com.arsdigita.atoz.AbstractAtoZGenerator;
|
import com.arsdigita.atoz.AtoZGeneratorAbstractImpl;
|
||||||
import com.arsdigita.atoz.AtoZAtomicEntry;
|
import com.arsdigita.atoz.AtoZAtomicEntry;
|
||||||
import com.arsdigita.atoz.AtoZCompoundEntry;
|
import com.arsdigita.atoz.AtoZCompoundEntry;
|
||||||
import com.arsdigita.atoz.AtoZEntry;
|
import com.arsdigita.atoz.AtoZEntry;
|
||||||
|
|
@ -37,7 +37,7 @@ import com.arsdigita.web.URL;
|
||||||
import com.arsdigita.web.Web;
|
import com.arsdigita.web.Web;
|
||||||
import com.arsdigita.xml.Element;
|
import com.arsdigita.xml.Element;
|
||||||
|
|
||||||
public class AtoZSiteProxyGenerator extends AbstractAtoZGenerator {
|
public class AtoZSiteProxyGenerator extends AtoZGeneratorAbstractImpl {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compound Entry for mathched Categories
|
* Compound Entry for mathched Categories
|
||||||
|
|
|
||||||
|
|
@ -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));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||||
name="ccm-ldn-atoz"
|
name="ccm-atoz"
|
||||||
prettyName="A-Z"
|
prettyName="A-Z"
|
||||||
version="6.6.1"
|
version="6.6.2"
|
||||||
release="1"
|
release="1"
|
||||||
webapp="ROOT">
|
webapp="ROOT">
|
||||||
|
|
||||||
|
|
@ -14,14 +14,18 @@
|
||||||
<ccm:requires name="ccm-ldn-aplaws" 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-terms" version="6.6.0" relation="ge"/>
|
||||||
<ccm:requires name="ccm-ldn-util" 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:requires name="ccm-cms-types-siteproxy" version="6.6.0" relation="ge"/>
|
||||||
|
-->
|
||||||
</ccm:dependencies>
|
</ccm:dependencies>
|
||||||
|
|
||||||
<ccm:contacts>
|
<ccm:contacts>
|
||||||
<ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/>
|
<ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/>
|
||||||
<ccm:contact uri="mailto:rhea@redhat.com" type="support"/>
|
<ccm:contact uri="mailto:rhea@redhat.com" type="support"/>
|
||||||
</ccm:contacts>
|
</ccm:contacts>
|
||||||
|
|
||||||
<ccm:description>
|
<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
|
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.
|
theme provides a link to the page as part of its static elements.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
@@ ../oracle-se/upgrade/add-item_provider.sql
|
@@ oracle-se/add-item_provider.sql
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
@@ ../oracle-se/upgrade/add-item_provider_alias.sql
|
@@ oracle-se/add-item_provider_alias.sql
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
begin;
|
begin;
|
||||||
\i ../postgres/upgrade/add-item_provider.sql
|
\i postgres/add-item_provider.sql
|
||||||
commit;
|
commit;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
begin;
|
begin;
|
||||||
\i ../postgres/upgrade/add-item_provider_alias.sql
|
\i postgres/add-item_provider_alias.sql
|
||||||
commit;
|
commit;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd">
|
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:context name="com.arsdigita.atoz.ui.admin.ProviderList">
|
||||||
<xrd:adapter objectType="com.arsdigita.london.atoz.AtoZProvider">
|
<xrd:adapter objectType="com.arsdigita.atoz.AtoZProvider">
|
||||||
<xrd:attributes rule="exclude">
|
<xrd:attributes rule="exclude">
|
||||||
<xrd:property name="/object/id"/>
|
<xrd:property name="/object/id"/>
|
||||||
<xrd:property name="/object/defaultDomainClass"/>
|
<xrd:property name="/object/defaultDomainClass"/>
|
||||||
|
|
@ -14,9 +14,9 @@
|
||||||
</xrd:adapter>
|
</xrd:adapter>
|
||||||
</xrd:context>
|
</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:attributes rule="exclude">
|
||||||
<xrd:property name="/object/id"/>
|
<xrd:property name="/object/id"/>
|
||||||
<xrd:property name="/object/defaultDomainClass"/>
|
<xrd:property name="/object/defaultDomainClass"/>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<registry>
|
||||||
|
<config class="com.arsdigita.atoz.AtoZConfig"
|
||||||
|
storage="ccm-atoz/atoz.properties"/>
|
||||||
|
</registry>
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<load>
|
<load>
|
||||||
|
|
||||||
<requires>
|
<requires>
|
||||||
<table name="inits"/>
|
<table name="inits"/>
|
||||||
<table name="acs_objects"/>
|
<table name="acs_objects"/>
|
||||||
|
|
@ -6,12 +7,15 @@
|
||||||
<initializer class="com.arsdigita.london.util.Initializer"/>
|
<initializer class="com.arsdigita.london.util.Initializer"/>
|
||||||
<initializer class="com.arsdigita.london.terms.Initializer"/>
|
<initializer class="com.arsdigita.london.terms.Initializer"/>
|
||||||
</requires>
|
</requires>
|
||||||
|
|
||||||
<provides>
|
<provides>
|
||||||
<table name="atoz_provider"/>
|
<table name="atoz_provider"/>
|
||||||
<initializer class="com.arsdigita.london.atoz.Initializer"/>
|
<initializer class="com.arsdigita.atoz.Initializer"/>
|
||||||
</provides>
|
</provides>
|
||||||
|
|
||||||
<scripts>
|
<scripts>
|
||||||
<schema directory="ccm-ldn-atoz"/>
|
<schema directory="ccm-atoz"/>
|
||||||
<data class="com.arsdigita.london.atoz.Loader"/>
|
<data class="com.arsdigita.atoz.Loader"/>
|
||||||
</scripts>
|
</scripts>
|
||||||
|
|
||||||
</load>
|
</load>
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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>
|
|
||||||
|
|
@ -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>
|
|
||||||
|
|
@ -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;
|
package com.arsdigita.atoz;
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
import com.arsdigita.domain.DomainObject;
|
import com.arsdigita.domain.DomainObject;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
|
|
@ -13,17 +28,31 @@ import com.arsdigita.london.util.Transaction;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
import com.arsdigita.web.Application;
|
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 {
|
public class AddAtoZ extends Program {
|
||||||
|
|
||||||
private static final Logger LOG = Logger.getLogger(AddAtoZ.class);
|
private static final Logger LOG = Logger.getLogger(AddAtoZ.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default Constructor
|
||||||
|
*/
|
||||||
public AddAtoZ() {
|
public AddAtoZ() {
|
||||||
super("Add AtoZ instance", "1.0.0", "URL-FRAGMENT TITLE");
|
super("Add AtoZ instance", "1.0.0", "URL-FRAGMENT TITLE");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAtoZ(String atozURL, String atozTitle) {
|
private void addAtoZ(String atozURL, String atozTitle) {
|
||||||
|
|
||||||
if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE, "/"+atozURL+"/")) {
|
if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE, "/"+atozURL+"/")) {
|
||||||
|
|
||||||
DomainObjectFactory.registerInstantiator(
|
DomainObjectFactory.registerInstantiator(
|
||||||
AtoZ.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() {
|
AtoZ.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() {
|
||||||
public DomainObject doNewInstance(DataObject dataObject) {
|
public DomainObject doNewInstance(DataObject dataObject) {
|
||||||
|
|
@ -33,10 +62,13 @@ public class AddAtoZ extends Program {
|
||||||
Application app = Application.createApplication(
|
Application app = Application.createApplication(
|
||||||
AtoZ.BASE_DATA_OBJECT_TYPE, atozURL, atozTitle, null);
|
AtoZ.BASE_DATA_OBJECT_TYPE, atozURL, atozTitle, null);
|
||||||
app.save();
|
app.save();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
System.err.println(AtoZ.BASE_DATA_OBJECT_TYPE
|
System.err.println(AtoZ.BASE_DATA_OBJECT_TYPE
|
||||||
+ " already installed at " + atozURL);
|
+ " already installed at " + atozURL);
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -46,6 +78,7 @@ public class AddAtoZ extends Program {
|
||||||
new KernelExcursion() {
|
new KernelExcursion() {
|
||||||
public void excurse() {
|
public void excurse() {
|
||||||
setEffectiveParty(Kernel.getSystemParty());
|
setEffectiveParty(Kernel.getSystemParty());
|
||||||
|
|
||||||
String[] args = cmdLine.getArgs();
|
String[] args = cmdLine.getArgs();
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
String atozURL = args[0];
|
String atozURL = args[0];
|
||||||
|
|
|
||||||
|
|
@ -18,25 +18,33 @@
|
||||||
|
|
||||||
package com.arsdigita.atoz;
|
package com.arsdigita.atoz;
|
||||||
|
|
||||||
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
|
import com.arsdigita.domain.DomainCollection;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
import com.arsdigita.persistence.DataCollection;
|
import com.arsdigita.persistence.DataCollection;
|
||||||
import com.arsdigita.persistence.OID;
|
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.util.Assert;
|
||||||
|
import com.arsdigita.web.Application;
|
||||||
|
import com.arsdigita.xml.Element;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
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 {
|
public class AtoZ extends Application {
|
||||||
|
|
@ -50,6 +58,10 @@ public class AtoZ extends Application {
|
||||||
public static final String PROVIDERS = "atozProviders";
|
public static final String PROVIDERS = "atozProviders";
|
||||||
public static final String SORT_KEY = "sortKey";
|
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 */
|
/** Config object containing various parameter */
|
||||||
private static final AtoZConfig s_config = AtoZConfig.getConfig();
|
private static final AtoZConfig s_config = AtoZConfig.getConfig();
|
||||||
|
|
||||||
|
|
@ -115,6 +127,21 @@ public class AtoZ extends Application {
|
||||||
"http://xmlns.redhat.com/atoz/1.0");
|
"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
|
// * Application specific method only required if installed in its own
|
||||||
// * web application context
|
// * web application context
|
||||||
|
|
@ -139,13 +166,13 @@ public class AtoZ extends Application {
|
||||||
* <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
* <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
||||||
* <init-param>
|
* <init-param>
|
||||||
* <param-name>template-path</param-name>
|
* <param-name>template-path</param-name>
|
||||||
* <param-value>/templates/ccm-ldn-atoz</param-value>
|
* <param-value>/templates/ccm-atoz</param-value>
|
||||||
* </init-param>
|
* </init-param>
|
||||||
* </servlet>
|
* </servlet>
|
||||||
*
|
*
|
||||||
* <servlet-mapping>
|
* <servlet-mapping>
|
||||||
* <servlet-name>atoz-files</servlet-name>
|
* <servlet-name>atoz-files</servlet-name>
|
||||||
* <url-pattern>/ccm-ldn-atoz/files/*</url-pattern>
|
* <url-pattern>/ccm-atoz/files/*</url-pattern>
|
||||||
* </servlet-mapping>
|
* </servlet-mapping>
|
||||||
*
|
*
|
||||||
* @return path name to the applications servlet/JSP
|
* @return path name to the applications servlet/JSP
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ package com.arsdigita.atoz;
|
||||||
import com.arsdigita.xml.Element;
|
import com.arsdigita.xml.Element;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public interface AtoZAtomicEntry extends AtoZEntry {
|
public interface AtoZAtomicEntry extends AtoZEntry {
|
||||||
String getLink();
|
String getLink();
|
||||||
Element getContent();
|
Element getContent();
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public class AtoZCategoryAlias extends DomainObject {
|
||||||
private static final Logger s_log = Logger.getLogger(AtoZCategoryAlias.class);
|
private static final Logger s_log = Logger.getLogger(AtoZCategoryAlias.class);
|
||||||
|
|
||||||
public static final String BASE_DATA_OBJECT_TYPE =
|
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 ID = "id";
|
||||||
public static final String PROVIDER = "provider";
|
public static final String PROVIDER = "provider";
|
||||||
|
|
@ -111,7 +111,7 @@ public class AtoZCategoryAlias extends DomainObject {
|
||||||
return Sequences.getNextValue();
|
return Sequences.getNextValue();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
final String errorMsg = "Unable to generate a unique " +
|
final String errorMsg = "Unable to generate a unique " +
|
||||||
"ACSObject id.";
|
"ACSObject id.";
|
||||||
s_log.error(errorMsg);
|
s_log.error(errorMsg);
|
||||||
throw PersistenceException.newInstance(errorMsg, e);
|
throw PersistenceException.newInstance(errorMsg, e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ package com.arsdigita.atoz;
|
||||||
import com.arsdigita.persistence.DataQuery;
|
import com.arsdigita.persistence.DataQuery;
|
||||||
import com.arsdigita.persistence.OID;
|
import com.arsdigita.persistence.OID;
|
||||||
import com.arsdigita.persistence.Filter;
|
import com.arsdigita.persistence.Filter;
|
||||||
|
|
||||||
import com.arsdigita.web.ParameterMap;
|
import com.arsdigita.web.ParameterMap;
|
||||||
import com.arsdigita.web.URL;
|
import com.arsdigita.web.URL;
|
||||||
import com.arsdigita.web.Web;
|
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) {
|
public AtoZCategoryGenerator(AtoZCategoryProvider provider) {
|
||||||
super(provider);
|
super(provider);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
package com.arsdigita.atoz;
|
package com.arsdigita.atoz;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
import com.arsdigita.categorization.Category;
|
import com.arsdigita.categorization.Category;
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.domain.DomainCollection;
|
import com.arsdigita.domain.DomainCollection;
|
||||||
|
|
@ -34,12 +32,20 @@ import com.arsdigita.persistence.DataQuery;
|
||||||
import com.arsdigita.persistence.OID;
|
import com.arsdigita.persistence.OID;
|
||||||
import com.arsdigita.persistence.SessionManager;
|
import com.arsdigita.persistence.SessionManager;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class AtoZCategoryProvider extends AtoZProvider {
|
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 =
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
"com.arsdigita.london.atoz.AtoZCategoryProvider";
|
"com.arsdigita.atoz.AtoZCategoryProvider";
|
||||||
|
|
||||||
public static final String IS_COMPOUND = "isCompound";
|
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 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() {
|
public AtoZCategoryProvider() {
|
||||||
this(BASE_DATA_OBJECT_TYPE);
|
this(BASE_DATA_OBJECT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param type
|
||||||
|
*/
|
||||||
protected AtoZCategoryProvider(String type) {
|
protected AtoZCategoryProvider(String type) {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
|
|
@ -145,7 +163,8 @@ public class AtoZCategoryProvider extends AtoZProvider {
|
||||||
|
|
||||||
while (types.next()) {
|
while (types.next()) {
|
||||||
String objectType = (String)types.get("objectType");
|
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);
|
definition.excludeSpecificObjectType(objectType);
|
||||||
}
|
}
|
||||||
types.close();
|
types.close();
|
||||||
|
|
@ -174,7 +193,8 @@ public class AtoZCategoryProvider extends AtoZProvider {
|
||||||
cats.setParameter("rootCategoryID", root.getID());
|
cats.setParameter("rootCategoryID", root.getID());
|
||||||
} else {
|
} else {
|
||||||
if(filterCats){
|
if(filterCats){
|
||||||
cats = SessionManager.getSession().retrieveQuery(FILTERED_ATOMIC_ENTRIES);
|
cats = SessionManager.getSession()
|
||||||
|
.retrieveQuery(FILTERED_ATOMIC_ENTRIES);
|
||||||
}else{
|
}else{
|
||||||
cats = SessionManager.getSession().retrieveQuery(ATOMIC_ENTRIES);
|
cats = SessionManager.getSession().retrieveQuery(ATOMIC_ENTRIES);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,6 @@ public class AtoZConfig extends AbstractConfig {
|
||||||
return s_conf;
|
return s_conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
|
||||||
private Set m_types;
|
|
||||||
|
|
||||||
|
|
||||||
// ///////////////////////////////////////////////////////////////////////
|
// ///////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
|
@ -69,32 +66,30 @@ public class AtoZConfig extends AbstractConfig {
|
||||||
|
|
||||||
/** Rules for configuring information in generated XML */
|
/** Rules for configuring information in generated XML */
|
||||||
private Parameter m_adapters = new ResourceParameter
|
private Parameter m_adapters = new ResourceParameter
|
||||||
("com.arsdigita.london.atoz.traversal_adapters",
|
("com.arsdigita.atoz.traversal_adapters",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
"/WEB-INF/resources/atoz-adapters.xml");
|
"/WEB-INF/resources/atoz-adapters.xml");
|
||||||
/** The UI widget for the Root Category Picker */
|
/** The UI widget for the Root Category Picker */
|
||||||
private Parameter m_rootCategoryPicker = new ClassParameter(
|
private Parameter m_rootCategoryPicker = new ClassParameter(
|
||||||
"com.arsdigita.london.atoz.root_category_picker",
|
"com.arsdigita.atoz.root_category_picker",
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
ApplicationCategoryPicker.class);
|
ApplicationCategoryPicker.class);
|
||||||
/** Make AtoZ use subsite-specific navigation categories. Set to true,
|
/** Make AtoZ use subsite-specific navigation categories. Set to true,
|
||||||
* and the AtoZ will use the subsite-specific navigation categories
|
* and the AtoZ will use the subsite-specific navigation categories
|
||||||
* if you define *any* CategoryProvider */
|
* if you define *any* CategoryProvider */
|
||||||
private BooleanParameter m_useSubsiteSpecificNavigationCategory = new BooleanParameter
|
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,
|
Parameter.OPTIONAL,
|
||||||
Boolean.FALSE);
|
Boolean.FALSE);
|
||||||
/** To filter out category without published items. If TRUE, the AtoZ
|
/** To filter out category without published items. If TRUE, the AtoZ
|
||||||
* category providers will only return Categories with published items */
|
* category providers will only return Categories with published items */
|
||||||
private BooleanParameter m_filterCategoryProdiver = new BooleanParameter (
|
private BooleanParameter m_filterCategoryProdiver = new BooleanParameter (
|
||||||
"com.arsdigita.london.atoz.filterCategoryProviders",
|
"com.arsdigita.atoz.filterCategoryProviders",
|
||||||
Parameter.OPTIONAL,
|
Parameter.OPTIONAL,
|
||||||
Boolean.FALSE);
|
Boolean.FALSE);
|
||||||
|
|
||||||
public AtoZConfig() {
|
public AtoZConfig() {
|
||||||
|
|
||||||
m_types = new HashSet();
|
|
||||||
|
|
||||||
register(m_adapters);
|
register(m_adapters);
|
||||||
register(m_rootCategoryPicker);
|
register(m_rootCategoryPicker);
|
||||||
register(m_useSubsiteSpecificNavigationCategory);
|
register(m_useSubsiteSpecificNavigationCategory);
|
||||||
|
|
@ -104,6 +99,10 @@ public class AtoZConfig extends AbstractConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides access to the traversal adapter as stream.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
InputStream getTraversalAdapters() {
|
InputStream getTraversalAdapters() {
|
||||||
return (InputStream)get(m_adapters);
|
return (InputStream)get(m_adapters);
|
||||||
}
|
}
|
||||||
|
|
@ -112,15 +111,6 @@ public class AtoZConfig extends AbstractConfig {
|
||||||
return (Class)get(m_rootCategoryPicker);
|
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() {
|
public boolean useSubsiteSpecificNavigationCategory() {
|
||||||
return ((Boolean) get(m_useSubsiteSpecificNavigationCategory)).booleanValue();
|
return ((Boolean) get(m_useSubsiteSpecificNavigationCategory)).booleanValue();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
package com.arsdigita.atoz;
|
package com.arsdigita.atoz;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public interface AtoZEntry {
|
public interface AtoZEntry {
|
||||||
String getTitle();
|
String getTitle();
|
||||||
String getDescription();
|
String getDescription();
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,11 @@ package com.arsdigita.atoz;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public abstract class AbstractAtoZGenerator implements AtoZGenerator {
|
public abstract class AtoZGeneratorAbstractImpl implements AtoZGenerator {
|
||||||
|
|
||||||
private AtoZProvider m_provider;
|
private AtoZProvider m_provider;
|
||||||
|
|
||||||
public AbstractAtoZGenerator(AtoZProvider provider) {
|
public AtoZGeneratorAbstractImpl(AtoZProvider provider) {
|
||||||
m_provider = provider;
|
m_provider = provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -34,7 +34,7 @@ import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class AtoZItemGenerator extends AbstractAtoZGenerator {
|
public class AtoZItemGenerator extends AtoZGeneratorAbstractImpl {
|
||||||
|
|
||||||
public AtoZItemGenerator(AtoZItemProvider provider) {
|
public AtoZItemGenerator(AtoZItemProvider provider) {
|
||||||
super(provider);
|
super(provider);
|
||||||
|
|
@ -72,9 +72,9 @@ public class AtoZItemGenerator extends AbstractAtoZGenerator {
|
||||||
live = item.getLiveVersion();
|
live = item.getLiveVersion();
|
||||||
if (live != null) {
|
if (live != null) {
|
||||||
// should always be a ContentPage
|
// should always be a ContentPage
|
||||||
description = (live instanceof ContentPage) ? ((ContentPage) live)
|
description = (live instanceof ContentPage)
|
||||||
.getSearchSummary()
|
? ((ContentPage) live).getSearchSummary()
|
||||||
: live.getName();
|
: live.getName();
|
||||||
title = "";
|
title = "";
|
||||||
if (entries.get("aliasTitle") != null) {
|
if (entries.get("aliasTitle") != null) {
|
||||||
title = entries.get("aliasTitle").toString();
|
title = entries.get("aliasTitle").toString();
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,14 @@ import com.arsdigita.categorization.Category;
|
||||||
|
|
||||||
public class AtoZItemProvider extends AtoZProvider {
|
public class AtoZItemProvider extends AtoZProvider {
|
||||||
|
|
||||||
public static final String BASE_DATA_OBJECT_TYPE
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
= "com.arsdigita.london.atoz.AtoZItemProvider";
|
"com.arsdigita.atoz.AtoZItemProvider";
|
||||||
|
|
||||||
public static final String CATEGORY = "category";
|
public static final String CATEGORY = "category";
|
||||||
public static final String LOAD_PATHS = "loadPaths";
|
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() {
|
public AtoZItemProvider() {
|
||||||
this(BASE_DATA_OBJECT_TYPE);
|
this(BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
@ -87,7 +88,8 @@ public class AtoZItemProvider extends AtoZProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DomainCollection getAliases() {
|
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.addFilter("atozItemProvider = :providerId").set("providerId", getID());
|
||||||
aliases.addOrder("title");
|
aliases.addOrder("title");
|
||||||
return aliases;
|
return aliases;
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,11 @@ import org.apache.log4j.Logger;
|
||||||
|
|
||||||
public abstract class AtoZProvider extends ACSObject {
|
public abstract class AtoZProvider extends ACSObject {
|
||||||
|
|
||||||
|
/** Private logger instace to assist debugging */
|
||||||
private static final Logger s_log = Logger.getLogger(AtoZProvider.class);
|
private static final Logger s_log = Logger.getLogger(AtoZProvider.class);
|
||||||
|
|
||||||
public static final String BASE_DATA_OBJECT_TYPE
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
= "com.arsdigita.london.atoz.AtoZProvider";
|
"com.arsdigita.atoz.AtoZProvider";
|
||||||
|
|
||||||
public static final String TITLE = "title";
|
public static final String TITLE = "title";
|
||||||
public static final String DESCRIPTION = "description";
|
public static final String DESCRIPTION = "description";
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,10 @@ import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
import com.arsdigita.util.Classes;
|
import com.arsdigita.util.Classes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author pb
|
||||||
|
*/
|
||||||
public class AtoZProviderType {
|
public class AtoZProviderType {
|
||||||
|
|
||||||
private String m_title;
|
private String m_title;
|
||||||
|
|
|
||||||
|
|
@ -18,22 +18,20 @@
|
||||||
|
|
||||||
package com.arsdigita.atoz;
|
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.db.DbHelper;
|
||||||
import com.arsdigita.domain.DomainObject;
|
import com.arsdigita.domain.DomainObject;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.domain.DomainObjectInstantiator;
|
import com.arsdigita.domain.DomainObjectInstantiator;
|
||||||
import com.arsdigita.domain.xml.TraversalHandler;
|
import com.arsdigita.domain.xml.TraversalHandler;
|
||||||
import com.arsdigita.kernel.ACSObjectInstantiator;
|
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.ApplicationNavigationModel;
|
||||||
import com.arsdigita.navigation.DefaultNavigationModel;
|
import com.arsdigita.navigation.DefaultNavigationModel;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
|
@ -94,41 +92,44 @@ public class Initializer extends CompoundInitializer {
|
||||||
XML.parse(AtoZ.getConfig().getTraversalAdapters(),
|
XML.parse(AtoZ.getConfig().getTraversalAdapters(),
|
||||||
new TraversalHandler());
|
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",
|
new AtoZProviderType("Item Provider",
|
||||||
"Provides an item A-Z",
|
"Provides an item A-Z",
|
||||||
AtoZItemProvider.class,
|
AtoZItemProvider.class,
|
||||||
ItemProviderForm.class,
|
ItemProviderForm.class,
|
||||||
ItemProviderAdmin.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
|
// Introduces a dependency on ccm-types-siteproxy
|
||||||
// Must be refactored into its own package.
|
// Must be refactored into its own package.
|
||||||
AtoZ.getConfig().registerProviderType(
|
/* MOVED to ccm-atoz-siteproxy
|
||||||
|
AtoZ.registerProviderType(
|
||||||
new AtoZProviderType("SiteProxy Provider",
|
new AtoZProviderType("SiteProxy Provider",
|
||||||
"Provides a SiteProxy A-Z",
|
"Provides a SiteProxy A-Z",
|
||||||
AtoZSiteProxyProvider.class,
|
AtoZSiteProxyProvider.class,
|
||||||
SiteProxyProviderForm.class,
|
SiteProxyProviderForm.class,
|
||||||
SiteProxyProviderAdmin.class));
|
SiteProxyProviderAdmin.class));
|
||||||
|
*/
|
||||||
// Introduces dependenciy on navigation package
|
// Introduces dependenciy on navigation package
|
||||||
|
// Function / purpose ??
|
||||||
ApplicationNavigationModel.register(AtoZ.class.getName(),
|
ApplicationNavigationModel.register(AtoZ.class.getName(),
|
||||||
new DefaultNavigationModel());
|
new DefaultNavigationModel());
|
||||||
|
|
||||||
// Introduces dependency on ccm-ldn-typesesdervise ??
|
// Introduces dependency on ccm-ldn-typesesdervise ??
|
||||||
AtoZ.getConfig().registerProviderType(
|
/* AtoZ.registerProviderType(
|
||||||
new AtoZProviderType("ESD Toolkit Domain Provider",
|
new AtoZProviderType("ESD Toolkit Domain Provider",
|
||||||
"Provides a ESD Toolkit A-Z",
|
"Provides a ESD Toolkit A-Z",
|
||||||
DomainProvider.class,
|
DomainProvider.class,
|
||||||
DomainProviderForm.class,
|
DomainProviderForm.class,
|
||||||
DomainProviderAdmin.class));
|
DomainProviderAdmin.class));
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ public class Loader extends PackageLoader {
|
||||||
new KernelExcursion() {
|
new KernelExcursion() {
|
||||||
public void excurse() {
|
public void excurse() {
|
||||||
setEffectiveParty(Kernel.getSystemParty());
|
setEffectiveParty(Kernel.getSystemParty());
|
||||||
|
|
||||||
setupAtoZ();
|
setupAtoZ();
|
||||||
}
|
}
|
||||||
}.run();
|
}.run();
|
||||||
|
|
@ -71,6 +72,7 @@ public class Loader extends PackageLoader {
|
||||||
ApplicationType type = setup.run();
|
ApplicationType type = setup.run();
|
||||||
type.save();
|
type.save();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Create new type legacy free application type
|
/* Create new type legacy free application type
|
||||||
* NOTE: The wording in the title parameter of ApplicationType
|
* NOTE: The wording in the title parameter of ApplicationType
|
||||||
* determines the name of the subdirectory for the XSL stylesheets.
|
* determines the name of the subdirectory for the XSL stylesheets.
|
||||||
|
|
@ -81,7 +83,7 @@ public class Loader extends PackageLoader {
|
||||||
ApplicationType type = new ApplicationType("AtoZ",
|
ApplicationType type = new ApplicationType("AtoZ",
|
||||||
AtoZ.BASE_DATA_OBJECT_TYPE );
|
AtoZ.BASE_DATA_OBJECT_TYPE );
|
||||||
type.setDescription("A-Z of content.");
|
type.setDescription("A-Z of content.");
|
||||||
// type.setSingleton(true);
|
// type.setSingleton(true); // For later use
|
||||||
type.save();
|
type.save();
|
||||||
|
|
||||||
if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE,
|
if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE,
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ package com.arsdigita.atoz.ui;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.SimpleContainer;
|
import com.arsdigita.bebop.SimpleContainer;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.dispatcher.SiteProxyPanel;
|
// import com.arsdigita.cms.dispatcher.SiteProxyPanel;
|
||||||
|
|
||||||
import com.arsdigita.kernel.Kernel;
|
import com.arsdigita.kernel.Kernel;
|
||||||
|
|
||||||
|
|
@ -43,6 +43,7 @@ public class AtoZPane extends SimpleContainer {
|
||||||
m_letter = letter;
|
m_letter = letter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void generateXML(PageState state, Element parent) {
|
public void generateXML(PageState state, Element parent) {
|
||||||
AtoZ atoz = (AtoZ) Kernel.getContext().getResource();
|
AtoZ atoz = (AtoZ) Kernel.getContext().getResource();
|
||||||
AtoZGenerator[] generators = atoz.getGenerators();
|
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);
|
AtoZEntry[] entries = generator.getEntries(letter);
|
||||||
Element content = AtoZ.newElement("provider");
|
Element content = AtoZ.newElement("provider");
|
||||||
content.addAttribute("title", generator.getTitle());
|
content.addAttribute("title", generator.getTitle());
|
||||||
|
|
@ -84,6 +93,7 @@ public class AtoZPane extends SimpleContainer {
|
||||||
generateAtoZEntries(entries, content);
|
generateAtoZEntries(entries, content);
|
||||||
|
|
||||||
parent.addContent(content);
|
parent.addContent(content);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateAtoZEntries(AtoZEntry[] entries, Element parent) {
|
public void generateAtoZEntries(AtoZEntry[] entries, Element parent) {
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ public class AdminPane extends SimpleContainer {
|
||||||
m_createForm.addCompletionListener(new ProviderCreateComplete());
|
m_createForm.addCompletionListener(new ProviderCreateComplete());
|
||||||
add(m_createForm);
|
add(m_createForm);
|
||||||
|
|
||||||
AtoZProviderType[] providers = AtoZ.getConfig().getProviderTypes();
|
AtoZProviderType[] providers = AtoZ.getProviderTypes();
|
||||||
m_providerCreateMap = new HashMap();
|
m_providerCreateMap = new HashMap();
|
||||||
m_providerAdminMap = new HashMap();
|
m_providerAdminMap = new HashMap();
|
||||||
|
|
||||||
|
|
@ -85,6 +85,7 @@ public class AdminPane extends SimpleContainer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void register(Page p) {
|
public void register(Page p) {
|
||||||
super.register(p);
|
super.register(p);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,10 @@ import com.arsdigita.bebop.ActionLink;
|
||||||
import com.arsdigita.bebop.Page;
|
import com.arsdigita.bebop.Page;
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class CategoryProviderAdmin extends ProviderAdmin {
|
public class CategoryProviderAdmin extends ProviderAdmin {
|
||||||
|
|
||||||
private CategoryProviderForm m_detailsForm;
|
private CategoryProviderForm m_detailsForm;
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,10 @@ import com.arsdigita.categorization.Category;
|
||||||
import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
|
import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
|
||||||
import com.arsdigita.atoz.AtoZCategoryProvider;
|
import com.arsdigita.atoz.AtoZCategoryProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class CategoryProviderAliasForm extends Form {
|
public class CategoryProviderAliasForm extends Form {
|
||||||
|
|
||||||
private ACSObjectSelectionModel m_provider;
|
private ACSObjectSelectionModel m_provider;
|
||||||
|
|
@ -47,6 +51,10 @@ public class CategoryProviderAliasForm extends Form {
|
||||||
private SingleSelect m_letter;
|
private SingleSelect m_letter;
|
||||||
private SaveCancelSection m_buttons;
|
private SaveCancelSection m_buttons;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param provider
|
||||||
|
*/
|
||||||
public CategoryProviderAliasForm(ACSObjectSelectionModel provider) {
|
public CategoryProviderAliasForm(ACSObjectSelectionModel provider) {
|
||||||
super("categoryAliasForm", new SimpleContainer());
|
super("categoryAliasForm", new SimpleContainer());
|
||||||
setRedirecting(true);
|
setRedirecting(true);
|
||||||
|
|
@ -80,6 +88,9 @@ public class CategoryProviderAliasForm extends Form {
|
||||||
addSubmissionListener(new ProviderSubmissionListener());
|
addSubmissionListener(new ProviderSubmissionListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class ProviderSubmissionListener implements FormSubmissionListener {
|
private class ProviderSubmissionListener implements FormSubmissionListener {
|
||||||
public void submitted(FormSectionEvent e)
|
public void submitted(FormSectionEvent e)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
|
|
@ -92,6 +103,9 @@ public class CategoryProviderAliasForm extends Form {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class ProviderProcessListener implements FormProcessListener {
|
private class ProviderProcessListener implements FormProcessListener {
|
||||||
public void process(FormSectionEvent e)
|
public void process(FormSectionEvent e)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ import com.arsdigita.domain.DomainObjectXMLRenderer;
|
||||||
import com.arsdigita.domain.DomainCollection;
|
import com.arsdigita.domain.DomainCollection;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.persistence.OID;
|
import com.arsdigita.persistence.OID;
|
||||||
import com.arsdigita.categorization.Category;
|
// import com.arsdigita.categorization.Category;
|
||||||
|
|
||||||
import com.arsdigita.xml.Element;
|
import com.arsdigita.xml.Element;
|
||||||
import com.arsdigita.xml.XML;
|
import com.arsdigita.xml.XML;
|
||||||
|
|
@ -49,6 +49,7 @@ public class CategoryProviderAliasList extends SimpleContainer {
|
||||||
m_provider = provider;
|
m_provider = provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void respond(PageState state) {
|
public void respond(PageState state) {
|
||||||
String key = state.getControlEventName();
|
String key = state.getControlEventName();
|
||||||
String value = state.getControlEventValue();
|
String value = state.getControlEventValue();
|
||||||
|
|
@ -63,6 +64,7 @@ public class CategoryProviderAliasList extends SimpleContainer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void generateXML(PageState state,
|
public void generateXML(PageState state,
|
||||||
Element parent) {
|
Element parent) {
|
||||||
Element content = AtoZ.newElement("categoryProviderAliasList");
|
Element content = AtoZ.newElement("categoryProviderAliasList");
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,10 @@ import com.arsdigita.xml.Element;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class CategoryProviderBlackList extends SimpleContainer {
|
public class CategoryProviderBlackList extends SimpleContainer {
|
||||||
|
|
||||||
private ACSObjectSelectionModel m_provider;
|
private ACSObjectSelectionModel m_provider;
|
||||||
|
|
@ -46,6 +50,7 @@ public class CategoryProviderBlackList extends SimpleContainer {
|
||||||
m_provider = provider;
|
m_provider = provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void respond(PageState state) {
|
public void respond(PageState state) {
|
||||||
String key = state.getControlEventName();
|
String key = state.getControlEventName();
|
||||||
String value = state.getControlEventValue();
|
String value = state.getControlEventValue();
|
||||||
|
|
@ -61,6 +66,7 @@ public class CategoryProviderBlackList extends SimpleContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void generateXML(PageState state,
|
public void generateXML(PageState state,
|
||||||
Element parent) {
|
Element parent) {
|
||||||
Element content = AtoZ.newElement("categoryProviderBlackList");
|
Element content = AtoZ.newElement("categoryProviderBlackList");
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,10 @@ import com.arsdigita.categorization.Category;
|
||||||
import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
|
import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
|
||||||
import com.arsdigita.kernel.ACSObject;
|
import com.arsdigita.kernel.ACSObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class CategoryProviderBlockForm extends Form {
|
public class CategoryProviderBlockForm extends Form {
|
||||||
|
|
||||||
private ACSObjectSelectionModel m_provider;
|
private ACSObjectSelectionModel m_provider;
|
||||||
|
|
@ -43,6 +47,10 @@ public class CategoryProviderBlockForm extends Form {
|
||||||
private ObjectCategoryPicker m_category;
|
private ObjectCategoryPicker m_category;
|
||||||
private SaveCancelSection m_buttons;
|
private SaveCancelSection m_buttons;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param provider
|
||||||
|
*/
|
||||||
public CategoryProviderBlockForm(ACSObjectSelectionModel provider) {
|
public CategoryProviderBlockForm(ACSObjectSelectionModel provider) {
|
||||||
super("categoryBlockForm", new SimpleContainer());
|
super("categoryBlockForm", new SimpleContainer());
|
||||||
setRedirecting(true);
|
setRedirecting(true);
|
||||||
|
|
@ -66,6 +74,9 @@ public class CategoryProviderBlockForm extends Form {
|
||||||
addSubmissionListener(new ProviderSubmissionListener());
|
addSubmissionListener(new ProviderSubmissionListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class ProviderSubmissionListener implements FormSubmissionListener {
|
private class ProviderSubmissionListener implements FormSubmissionListener {
|
||||||
public void submitted(FormSectionEvent e)
|
public void submitted(FormSectionEvent e)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
|
|
@ -78,6 +89,9 @@ public class CategoryProviderBlockForm extends Form {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class ProviderProcessListener implements FormProcessListener {
|
private class ProviderProcessListener implements FormProcessListener {
|
||||||
public void process(FormSectionEvent e)
|
public void process(FormSectionEvent e)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ public class ProviderCreateForm extends Form {
|
||||||
m_providerType.addValidationListener(new NotNullValidationListener());
|
m_providerType.addValidationListener(new NotNullValidationListener());
|
||||||
m_providerType.addOption(new Option(null, "--Select one--"));
|
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++) {
|
for (int i = 0 ; i < providers.length ; i++) {
|
||||||
m_providerType.addOption(
|
m_providerType.addOption(
|
||||||
new Option(providers[i].getProvider().getName(),
|
new Option(providers[i].getProvider().getName(),
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ the front page of the HTML documentation it produces.
|
||||||
|
|
||||||
<h1>Purpose</h1>
|
<h1>Purpose</h1>
|
||||||
<p>
|
<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
|
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.
|
the theme provides a link to the page as part of its static elements.
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -28,7 +28,10 @@ the front page of the HTML documentation it produces.
|
||||||
<p> </p>
|
<p> </p>
|
||||||
|
|
||||||
<h1>Additional Application Details</h1>
|
<h1>Additional Application Details</h1>
|
||||||
<p> </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>
|
<h1>Usage</h1>
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -43,11 +46,15 @@ the front page of the HTML documentation it produces.
|
||||||
Currently available providers are:
|
Currently available providers are:
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>ESD Toolkit Domain Provider</li>
|
|
||||||
<li>Item Provider</li>
|
<li>Item Provider</li>
|
||||||
<li>SiteProxy Provider</li>
|
|
||||||
<li>Catgegory 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>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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"
|
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||||
version="2.4">
|
version="2.4">
|
||||||
|
|
||||||
<!-- module ccm-ldn-atoz - servlet declarations BEGIN -->
|
<!-- module ccm-atoz - servlet declarations BEGIN -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>atoz-files</servlet-name>
|
<servlet-name>atoz-files</servlet-name>
|
||||||
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
<servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class>
|
||||||
|
|
@ -13,13 +13,13 @@
|
||||||
<param-value>/templates/ccm-atoz</param-value>
|
<param-value>/templates/ccm-atoz</param-value>
|
||||||
</init-param>
|
</init-param>
|
||||||
</servlet>
|
</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-mapping>
|
||||||
<servlet-name>atoz-files</servlet-name>
|
<servlet-name>atoz-files</servlet-name>
|
||||||
<url-pattern>/ccm-atoz/files/*</url-pattern>
|
<url-pattern>/ccm-atoz/files/*</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
<!-- module ccm-ldn-atoz - servlet mappings END -->
|
<!-- module ccm-atoz - servlet mappings END -->
|
||||||
|
|
||||||
</web-app>
|
</web-app>
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
model com.arsdigita.london.atoz.terms;
|
model com.arsdigita.london.atoz.terms;
|
||||||
|
|
||||||
import com.arsdigita.london.atoz.AtoZProvider;
|
import com.arsdigita.atoz.AtoZProvider;
|
||||||
import com.arsdigita.london.terms.Domain;
|
import com.arsdigita.london.terms.Domain;
|
||||||
|
|
||||||
object type DomainProvider extends AtoZProvider {
|
object type DomainProvider extends AtoZProvider {
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
package com.arsdigita.london.atoz.terms;
|
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.AtoZAtomicEntry;
|
||||||
import com.arsdigita.atoz.AtoZEntry;
|
import com.arsdigita.atoz.AtoZEntry;
|
||||||
import com.arsdigita.london.terms.Domain;
|
import com.arsdigita.london.terms.Domain;
|
||||||
|
|
@ -37,12 +37,22 @@ import com.arsdigita.xml.Element;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class DomainGenerator extends AbstractAtoZGenerator {
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class DomainGenerator extends AtoZGeneratorAbstractImpl {
|
||||||
public DomainGenerator(DomainProvider provider) {
|
public DomainGenerator(DomainProvider provider) {
|
||||||
super(provider);
|
super(provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param letter
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public AtoZEntry[] getEntries(String letter) {
|
public AtoZEntry[] getEntries(String letter) {
|
||||||
|
|
||||||
DomainProvider provider = (DomainProvider) getProvider();
|
DomainProvider provider = (DomainProvider) getProvider();
|
||||||
|
|
||||||
Domain domain = provider.getDomain();
|
Domain domain = provider.getDomain();
|
||||||
|
|
@ -68,15 +78,24 @@ public class DomainGenerator extends AbstractAtoZGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (AtoZEntry[]) l.toArray(new AtoZEntry[l.size()]);
|
return (AtoZEntry[]) l.toArray(new AtoZEntry[l.size()]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class DomainAtomicEntry implements AtoZAtomicEntry {
|
private class DomainAtomicEntry implements AtoZAtomicEntry {
|
||||||
|
|
||||||
private OID m_oid;
|
private OID m_oid;
|
||||||
|
|
||||||
private String m_title;
|
private String m_title;
|
||||||
|
|
||||||
private String m_description;
|
private String m_description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param oid
|
||||||
|
* @param title
|
||||||
|
* @param description
|
||||||
|
*/
|
||||||
public DomainAtomicEntry(OID oid, String title, String description) {
|
public DomainAtomicEntry(OID oid, String title, String description) {
|
||||||
m_oid = oid;
|
m_oid = oid;
|
||||||
m_title = title;
|
m_title = title;
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,14 @@ import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
import com.arsdigita.persistence.OID;
|
import com.arsdigita.persistence.OID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class DomainProvider extends AtoZProvider {
|
public class DomainProvider extends AtoZProvider {
|
||||||
|
|
||||||
public static final String BASE_DATA_OBJECT_TYPE
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
= "com.arsdigita.london.atoz.terms.DomainProvider";
|
"com.arsdigita.london.atoz.terms.DomainProvider";
|
||||||
|
|
||||||
public static final String DOMAIN = "domain";
|
public static final String DOMAIN = "domain";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -29,12 +29,18 @@ import com.arsdigita.bebop.event.ActionEvent;
|
||||||
import com.arsdigita.bebop.event.ActionListener;
|
import com.arsdigita.bebop.event.ActionListener;
|
||||||
import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
|
import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class DomainProviderAdmin extends ProviderAdmin {
|
public class DomainProviderAdmin extends ProviderAdmin {
|
||||||
|
|
||||||
private DomainProviderForm m_detailsForm;
|
private DomainProviderForm m_detailsForm;
|
||||||
private ActionLink m_editDetails;
|
private ActionLink m_editDetails;
|
||||||
private ProviderDetails m_details;
|
private ProviderDetails m_details;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
public DomainProviderAdmin(ACSObjectSelectionModel provider) {
|
public DomainProviderAdmin(ACSObjectSelectionModel provider) {
|
||||||
super("domainProviderAdmin",
|
super("domainProviderAdmin",
|
||||||
provider);
|
provider);
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,16 @@ import com.arsdigita.persistence.SessionManager;
|
||||||
|
|
||||||
import java.util.TooManyListenersException;
|
import java.util.TooManyListenersException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class DomainProviderForm extends ProviderForm {
|
public class DomainProviderForm extends ProviderForm {
|
||||||
|
|
||||||
private SingleSelect m_domain;
|
private SingleSelect m_domain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
public DomainProviderForm(ACSObjectSelectionModel provider) {
|
public DomainProviderForm(ACSObjectSelectionModel provider) {
|
||||||
super("domainProvider",
|
super("domainProvider",
|
||||||
DomainProvider.class, provider);
|
DomainProvider.class, provider);
|
||||||
|
|
@ -48,6 +54,10 @@ public class DomainProviderForm extends ProviderForm {
|
||||||
setMetaDataAttribute("title", "Domain provider properties");
|
setMetaDataAttribute("title", "Domain provider properties");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
|
|
@ -76,6 +86,12 @@ public class DomainProviderForm extends ProviderForm {
|
||||||
add(m_domain);
|
add(m_domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @param provider
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
protected void processWidgets(PageState state,
|
protected void processWidgets(PageState state,
|
||||||
AtoZProvider provider) {
|
AtoZProvider provider) {
|
||||||
super.processWidgets(state, provider);
|
super.processWidgets(state, provider);
|
||||||
|
|
@ -88,6 +104,12 @@ public class DomainProviderForm extends ProviderForm {
|
||||||
OID.valueOf(oid)));
|
OID.valueOf(oid)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @param provider
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
protected void initWidgets(PageState state,
|
protected void initWidgets(PageState state,
|
||||||
AtoZProvider provider) {
|
AtoZProvider provider) {
|
||||||
super.initWidgets(state, provider);
|
super.initWidgets(state, provider);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue