You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(48) |
Dec
(31) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(22) |
Feb
(68) |
Mar
(185) |
Apr
(11) |
May
(21) |
Jun
(23) |
Jul
(46) |
Aug
(69) |
Sep
(211) |
Oct
(26) |
Nov
(51) |
Dec
(52) |
2006 |
Jan
(13) |
Feb
(13) |
Mar
(8) |
Apr
(21) |
May
(17) |
Jun
(100) |
Jul
(34) |
Aug
(23) |
Sep
(26) |
Oct
(16) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(66) |
Oct
(10) |
Nov
(1) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(3) |
May
(8) |
Jun
(5) |
Jul
(31) |
Aug
(8) |
Sep
(11) |
Oct
(6) |
Nov
|
Dec
|
2012 |
Jan
(13) |
Feb
(2) |
Mar
(9) |
Apr
(6) |
May
(24) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(120) |
2013 |
Jan
(6) |
Feb
(35) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Author: terry Date: 2008-07-12 03:18:16 +0000 (Sat, 12 Jul 2008) New Revision: 1712 Added: contrib/permeance/ccm-cms-types-wiki/ contrib/permeance/ccm-cms-types-wiki/application.xml contrib/permeance/ccm-cms-types-wiki/build/ contrib/permeance/ccm-cms-types-wiki/build/ccm-cms-types-wiki-6.5.0-pdl.jar contrib/permeance/ccm-cms-types-wiki/build/ccm-cms-types-wiki-6.5.0-sql.jar contrib/permeance/ccm-cms-types-wiki/build/classes/ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/content-types/ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/content-types/org/ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/content-types/org/aplaws/ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/content-types/org/aplaws/cms/ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/content-types/org/aplaws/cms/contenttypes/ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/content-types/org/aplaws/cms/contenttypes/Wiki.xml contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/traversal-adapters/ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/traversal-adapters/org/ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/traversal-adapters/org/aplaws/ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/traversal-adapters/org/aplaws/cms/ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/traversal-adapters/org/aplaws/cms/contenttypes/ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/traversal-adapters/org/aplaws/cms/contenttypes/Wiki.xml contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.config contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.load contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.pdl.mf contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.web.mf contrib/permeance/ccm-cms-types-wiki/build/classes/com/ contrib/permeance/ccm-cms-types-wiki/build/classes/com/arsdigita/ contrib/permeance/ccm-cms-types-wiki/build/classes/com/arsdigita/cms/ contrib/permeance/ccm-cms-types-wiki/build/classes/com/arsdigita/cms/contenttypes/ contrib/permeance/ccm-cms-types-wiki/build/classes/org/ contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/ contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/ contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/ contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/Wiki.class contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/WikiInitializer.class contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/WikiLoader.class contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ajax/ contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/lifecycle/ contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/ contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiMessage.class contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiModel.class contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiTextFormatter.class contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiTextNodeGenerator.class contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/ contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/AjaxComponent.class contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextForm.class contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextPropertySheet.class contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextStep$1.class contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextStep.class contrib/permeance/ccm-cms-types-wiki/build/sql/ contrib/permeance/ccm-cms-types-wiki/build/sql/.ddl-timestamp contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/ contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/ contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/create.sql contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/deferred.sql contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/drop-constraints.sql contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/drop-tables.sql contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/table-ct_wiki-auto.sql contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/oracle-se-create.sql contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/postgres-create.sql contrib/permeance/ccm-cms-types-wiki/build/src/ contrib/permeance/ccm-cms-types-wiki/lib/ contrib/permeance/ccm-cms-types-wiki/lib/bliki-3.0.7.jar contrib/permeance/ccm-cms-types-wiki/pdl/ contrib/permeance/ccm-cms-types-wiki/pdl/org/ contrib/permeance/ccm-cms-types-wiki/pdl/org/aplaws/ contrib/permeance/ccm-cms-types-wiki/pdl/org/aplaws/cms/ contrib/permeance/ccm-cms-types-wiki/pdl/org/aplaws/cms/contenttypes/ contrib/permeance/ccm-cms-types-wiki/pdl/org/aplaws/cms/contenttypes/wiki/ contrib/permeance/ccm-cms-types-wiki/pdl/org/aplaws/cms/contenttypes/wiki/Wiki.pdl contrib/permeance/ccm-cms-types-wiki/sql/ contrib/permeance/ccm-cms-types-wiki/sql/ccm-cms-types-wiki/ contrib/permeance/ccm-cms-types-wiki/sql/ccm-cms-types-wiki/oracle-se-create.sql contrib/permeance/ccm-cms-types-wiki/sql/ccm-cms-types-wiki/postgres-create.sql contrib/permeance/ccm-cms-types-wiki/src/ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/content-types/ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/content-types/org/ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/content-types/org/aplaws/ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/content-types/org/aplaws/cms/ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/content-types/org/aplaws/cms/contenttypes/ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/content-types/org/aplaws/cms/contenttypes/Wiki.xml contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/traversal-adapters/ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/traversal-adapters/org/ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/traversal-adapters/org/aplaws/ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/traversal-adapters/org/aplaws/cms/ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/traversal-adapters/org/aplaws/cms/contenttypes/ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/traversal-adapters/org/aplaws/cms/contenttypes/Wiki.xml contrib/permeance/ccm-cms-types-wiki/src/ccm-cms-types-wiki.config contrib/permeance/ccm-cms-types-wiki/src/ccm-cms-types-wiki.load contrib/permeance/ccm-cms-types-wiki/src/com/ contrib/permeance/ccm-cms-types-wiki/src/com/arsdigita/ contrib/permeance/ccm-cms-types-wiki/src/com/arsdigita/cms/ contrib/permeance/ccm-cms-types-wiki/src/com/arsdigita/cms/contenttypes/ contrib/permeance/ccm-cms-types-wiki/src/org/ contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/ contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/ contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/ contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/ contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/Wiki.java contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/WikiInitializer.java contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/WikiLoader.java contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/ajax/ contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/lifecycle/ contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/ui/ contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/ui/WikiMessage.java contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/ui/WikiModel.java contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/ui/WikiTextFormatter.java contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/ui/WikiTextNodeGenerator.java contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/ui/authoring/ contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/ui/authoring/AjaxComponent.java contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextForm.java contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextPropertySheet.java contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextStep.java contrib/permeance/ccm-cms-types-wiki/web/ contrib/permeance/ccm-cms-types-wiki/web/__ccm__/ contrib/permeance/ccm-cms-types-wiki/web/__ccm__/assets/ contrib/permeance/ccm-cms-types-wiki/web/__ccm__/assets/wiki/ contrib/permeance/ccm-cms-types-wiki/web/__ccm__/assets/wiki/index.css contrib/permeance/ccm-cms-types-wiki/web/build/ contrib/permeance/ccm-cms-types-wiki/web/build/ccm-cms-types-wiki-6.5.0-pdl.jar contrib/permeance/ccm-cms-types-wiki/web/build/ccm-cms-types-wiki-6.5.0-sql.jar contrib/permeance/ccm-cms-types-wiki/web/build/classes/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/content-types/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/content-types/Wiki.xml contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/content-types/org/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/content-types/org/aplaws/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/content-types/org/aplaws/cms/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/content-types/org/aplaws/cms/contenttypes/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/content-types/org/aplaws/cms/contenttypes/wiki/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/content-types/org/aplaws/cms/contenttypes/wiki/Wiki.xml contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/content-types/wiki-edit-body-step.xml contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/traversal-adapter/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/traversal-adapter/Wiki.xml contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/traversal-adapters/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/WEB-INF/traversal-adapters/Wiki.xml contrib/permeance/ccm-cms-types-wiki/web/build/classes/ccm-cms-types-wiki.config contrib/permeance/ccm-cms-types-wiki/web/build/classes/ccm-cms-types-wiki.load contrib/permeance/ccm-cms-types-wiki/web/build/classes/ccm-cms-types-wiki.pdl.mf contrib/permeance/ccm-cms-types-wiki/web/build/classes/ccm-cms-types-wiki.web.mf contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/A.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/Initializer.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/Loader.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/Wiki.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ajax/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ajax/WikiComponent.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/lifecycle/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/lifecycle/WikiLifecycleDefinition.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextEditor$1.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextEditor.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextForm.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextFormatter$1.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextFormatter.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextPropertySheet.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextStep$1.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextStep.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/ContentNodeGenerator.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/GlobalizedMessages.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/ItemAssetModel$1.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/ItemAssetModel.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiBodyEditor$1.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiBodyEditor.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiModel.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiXMLFormatter.class contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/wiki/ contrib/permeance/ccm-cms-types-wiki/web/build/classes/org/aplaws/cms/wiki/Initializer.class contrib/permeance/ccm-cms-types-wiki/web/build/sql/ contrib/permeance/ccm-cms-types-wiki/web/build/sql/.ddl-timestamp contrib/permeance/ccm-cms-types-wiki/web/build/sql/ccm-cms-types-wiki/ contrib/permeance/ccm-cms-types-wiki/web/build/sql/ccm-cms-types-wiki/ddl/ contrib/permeance/ccm-cms-types-wiki/web/build/sql/ccm-cms-types-wiki/ddl/oracle-se/ contrib/permeance/ccm-cms-types-wiki/web/build/sql/ccm-cms-types-wiki/ddl/oracle-se/create.sql contrib/permeance/ccm-cms-types-wiki/web/build/sql/ccm-cms-types-wiki/ddl/oracle-se/deferred.sql contrib/permeance/ccm-cms-types-wiki/web/build/sql/ccm-cms-types-wiki/ddl/oracle-se/drop-constraints.sql contrib/permeance/ccm-cms-types-wiki/web/build/sql/ccm-cms-types-wiki/ddl/oracle-se/drop-tables.sql contrib/permeance/ccm-cms-types-wiki/web/build/sql/ccm-cms-types-wiki/ddl/oracle-se/table-ct_wiki-auto.sql contrib/permeance/ccm-cms-types-wiki/web/build/sql/ccm-cms-types-wiki/oracle-se-create.sql contrib/permeance/ccm-cms-types-wiki/web/build/sql/ccm-cms-types-wiki/postgres-create.sql contrib/permeance/ccm-cms-types-wiki/web/packages/ contrib/permeance/ccm-cms-types-wiki/web/packages/content-section/ contrib/permeance/ccm-cms-types-wiki/web/packages/content-section/www/ contrib/permeance/ccm-cms-types-wiki/web/packages/content-section/www/wiki.jsp contrib/permeance/ccm-cms-types-wiki/web/static/ contrib/permeance/ccm-cms-types-wiki/web/static/content-types/ contrib/permeance/ccm-cms-types-wiki/web/static/content-types/org/ contrib/permeance/ccm-cms-types-wiki/web/static/content-types/org/aplaws/ contrib/permeance/ccm-cms-types-wiki/web/static/content-types/org/aplaws/cms/ contrib/permeance/ccm-cms-types-wiki/web/static/content-types/org/aplaws/cms/contenttypes/ contrib/permeance/ccm-cms-types-wiki/web/static/content-types/org/aplaws/cms/contenttypes/Wiki.xsl Log: Alpha version of APLAWS-based Wiki Added: contrib/permeance/ccm-cms-types-wiki/application.xml =================================================================== --- contrib/permeance/ccm-cms-types-wiki/application.xml (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/application.xml 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<!-- + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 +--> +<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-cms-types-wiki" prettyName="APLAWS Wiki" + version="6.5.0" release="1" webapp="ROOT"> + <ccm:dependencies> + <ccm:requires name="ccm-cms-types-article" version="6.5.0" relation="ge" /> + </ccm:dependencies> + <ccm:contacts> + <ccm:contact uri="http://www.aplaws.org/" type="website" /> + </ccm:contacts> + <ccm:description>A wiki content type for APLAWS.</ccm:description> +</ccm:application> Added: contrib/permeance/ccm-cms-types-wiki/build/ccm-cms-types-wiki-6.5.0-pdl.jar =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/ccm-cms-types-wiki-6.5.0-pdl.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/ccm-cms-types-wiki-6.5.0-sql.jar =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/ccm-cms-types-wiki-6.5.0-sql.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/content-types/org/aplaws/cms/contenttypes/Wiki.xml =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/content-types/org/aplaws/cms/contenttypes/Wiki.xml (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/content-types/org/aplaws/cms/contenttypes/Wiki.xml 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 +--> +<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd"> + + <ctd:content-type label="Wiki" description="A wiki page" objectType="org.aplaws.cms.contenttypes.wiki.Wiki" + classname="org.aplaws.cms.contenttypes.wiki.Wiki"> + + <ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate"> + <ctd:authoring-step labelKey="cms.contenttypes.shared.basic_properties.title" + labelBundle="com.arsdigita.cms.ui.CMSResources" + descriptionKey="cms.contenttypes.shared.basic_properties.description" + descriptionBundle="com.arsdigita.cms.ui.CMSResources" + component="com.arsdigita.cms.ui.authoring.PageEdit" /> + + <ctd:authoring-step labelKey="cms.contenttypes.shared.body_text.title" + labelBundle="com.arsdigita.cms.ui.CMSResources" + descriptionKey="cms.contenttypes.shared.body_text.description" + descriptionBundle="com.arsdigita.cms.ui.CMSResources" + component="org.aplaws.cms.contenttypes.wiki.ui.authoring.BodyTextStep" /> + + <ctd:include href="/WEB-INF/content-types/assign-categories-step.xml" /> + + </ctd:authoring-kit> + </ctd:content-type> +</ctd:content-types> Added: contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/traversal-adapters/org/aplaws/cms/contenttypes/Wiki.xml =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/traversal-adapters/org/aplaws/cms/contenttypes/Wiki.xml (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/classes/WEB-INF/traversal-adapters/org/aplaws/cms/contenttypes/Wiki.xml 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 +--> +<xrd:adapters xmlns:xrd="http://xmlns.redhat.com/schemas/waf/xml-renderer-rules" + 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.cms.dispatcher.SimpleXMLGenerator"> + <xrd:adapter objectType="org.aplaws.cms.contenttypes.wiki.Wiki" extends="com.arsdigita.cms.TextPage"> + <xrd:associations rule="include"> + <xrd:property name="/object/auditing" /> + <xrd:property name="/object/auditing/creationUser" /> + <xrd:property name="/object/auditing/lastModifiedUser" /> + <xrd:property name="/object/section" /> + </xrd:associations> + <xrd:attributes rule="include"> + <xrd:property name="/object/id" /> + </xrd:attributes> + <xrd:generator property="/object/textAsset/content" + class="org.aplaws.cms.contenttypes.wiki.ui.WikiTextNodeGenerator" /> + </xrd:adapter> + </xrd:context> + <xrd:context name="com.arsdigita.cms.search.ContentPageMetadataProvider"> + <xrd:adapter objectType="org.aplaws.cms.contenttypes.wiki.Wiki" extends="com.arsdigita.cms.TextPage"> + <xrd:formatter property="/object/textAsset/content" + class="org.aplaws.cms.contenttypes.wiki.ui.WikiTextFormatter" /> + </xrd:adapter> + </xrd:context> +</xrd:adapters> Added: contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.config =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.config (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.config 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 +--> +<registry> + <!-- nothing yet --> +</registry> Added: contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.load =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.load (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.load 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 +--> +<load> + <requires> + <table name="inits"/> + <table name="acs_objects"/> + <table name="cms_items"/> + <table name="ct_file_storage"/> + <initializer class="com.arsdigita.cms.contenttypes.FileStorageItemInitializer"/> + </requires> + <provides> + <table name="ct_wiki"/> + <initializer class="org.aplaws.cms.contenttypes.wiki.WikiInitializer"/> + </provides> + <scripts> + <schema directory="ccm-cms-types-wiki"/> + <data class="org.aplaws.cms.contenttypes.wiki.WikiLoader"/> + </scripts> +</load> \ No newline at end of file Added: contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.pdl.mf =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.pdl.mf (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.pdl.mf 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1 @@ +org/aplaws/cms/contenttypes/wiki/Wiki.pdl \ No newline at end of file Added: contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.web.mf =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.web.mf (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/classes/ccm-cms-types-wiki.web.mf 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,45 @@ +__ccm__/assets/wiki/index.css +build/ccm-cms-types-wiki-6.5.0-pdl.jar +build/ccm-cms-types-wiki-6.5.0-sql.jar +build/classes/WEB-INF/content-types/Wiki.xml +build/classes/WEB-INF/content-types/org/aplaws/cms/contenttypes/wiki/Wiki.xml +build/classes/WEB-INF/content-types/wiki-edit-body-step.xml +build/classes/WEB-INF/traversal-adapter/Wiki.xml +build/classes/WEB-INF/traversal-adapters/Wiki.xml +build/classes/ccm-cms-types-wiki.config +build/classes/ccm-cms-types-wiki.load +build/classes/ccm-cms-types-wiki.pdl.mf +build/classes/ccm-cms-types-wiki.web.mf +build/classes/org/aplaws/cms/contenttypes/wiki/A.class +build/classes/org/aplaws/cms/contenttypes/wiki/Initializer.class +build/classes/org/aplaws/cms/contenttypes/wiki/Loader.class +build/classes/org/aplaws/cms/contenttypes/wiki/Wiki.class +build/classes/org/aplaws/cms/contenttypes/wiki/ajax/WikiComponent.class +build/classes/org/aplaws/cms/contenttypes/wiki/lifecycle/WikiLifecycleDefinition.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextEditor$1.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextEditor.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextForm.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextFormatter$1.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextFormatter.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextPropertySheet.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextStep$1.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/BodyTextStep.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/ContentNodeGenerator.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/GlobalizedMessages.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/ItemAssetModel$1.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/ItemAssetModel.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiBodyEditor$1.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiBodyEditor.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiModel.class +build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiXMLFormatter.class +build/classes/org/aplaws/cms/wiki/Initializer.class +build/sql/.ddl-timestamp +build/sql/ccm-cms-types-wiki/ddl/oracle-se/create.sql +build/sql/ccm-cms-types-wiki/ddl/oracle-se/deferred.sql +build/sql/ccm-cms-types-wiki/ddl/oracle-se/drop-constraints.sql +build/sql/ccm-cms-types-wiki/ddl/oracle-se/drop-tables.sql +build/sql/ccm-cms-types-wiki/ddl/oracle-se/table-ct_wiki-auto.sql +build/sql/ccm-cms-types-wiki/oracle-se-create.sql +build/sql/ccm-cms-types-wiki/postgres-create.sql +packages/content-section/www/wiki.jsp +static/content-types/org/aplaws/cms/contenttypes/Wiki.xsl \ No newline at end of file Added: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/Wiki.class =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/Wiki.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/WikiInitializer.class =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/WikiInitializer.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/WikiLoader.class =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/WikiLoader.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiMessage.class =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiMessage.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiModel.class =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiModel.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiTextFormatter.class =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiTextFormatter.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiTextNodeGenerator.class =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/WikiTextNodeGenerator.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/AjaxComponent.class =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/AjaxComponent.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextForm.class =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextForm.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextPropertySheet.class =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextPropertySheet.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextStep$1.class =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextStep$1.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextStep.class =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/build/classes/org/aplaws/cms/contenttypes/wiki/ui/authoring/BodyTextStep.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/build/sql/.ddl-timestamp =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/sql/.ddl-timestamp (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/sql/.ddl-timestamp 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1 @@ +ddl-timestamp \ No newline at end of file Added: contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/create.sql =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/create.sql (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/create.sql 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1 @@ +@ ddl\oracle-se\table-ct_wiki-auto.sql Added: contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/deferred.sql =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/deferred.sql (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/deferred.sql 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,3 @@ +alter table ct_wiki add + constraint ct_wiki_item_id_f_fjptf foreign key (item_id) + references cms_text_pages(item_id); Added: contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/drop-constraints.sql =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/drop-constraints.sql (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/drop-constraints.sql 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,2 @@ +alter table ct_wiki + drop constraint ct_wiki_item_id_f_fjptf; Added: contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/drop-tables.sql =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/drop-tables.sql (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/drop-tables.sql 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1 @@ +drop table ct_wiki; Added: contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/table-ct_wiki-auto.sql =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/table-ct_wiki-auto.sql (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/ddl/oracle-se/table-ct_wiki-auto.sql 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,6 @@ +create table ct_wiki ( + item_id INTEGER not null + constraint ct_wiki_item_id_p_jsuhj + primary key + -- referential constraint for item_id deferred due to circular dependencies +); Added: contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/oracle-se-create.sql =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/oracle-se-create.sql (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/oracle-se-create.sql 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,18 @@ +-- Copyright (C) 2008 Permeance Technologies. 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 + +@ ddl/oracle-se/create.sql +@ ddl/oracle-se/deferred.sql \ No newline at end of file Added: contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/postgres-create.sql =================================================================== --- contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/postgres-create.sql (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/build/sql/ccm-cms-types-wiki/postgres-create.sql 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,20 @@ +-- Copyright (C) 2008 Permeance Technologies. 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 + +begin; +\i ddl/postgres/create.sql +\i ddl/postgres/deferred.sql +end; Added: contrib/permeance/ccm-cms-types-wiki/lib/bliki-3.0.7.jar =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-cms-types-wiki/lib/bliki-3.0.7.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-cms-types-wiki/pdl/org/aplaws/cms/contenttypes/wiki/Wiki.pdl =================================================================== --- contrib/permeance/ccm-cms-types-wiki/pdl/org/aplaws/cms/contenttypes/wiki/Wiki.pdl (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/pdl/org/aplaws/cms/contenttypes/wiki/Wiki.pdl 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,24 @@ +// Copyright (C) 2008 Permeance Technologies. 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 + +model org.aplaws.cms.contenttypes.wiki; + +import com.arsdigita.cms.TextPage; + +object type Wiki extends TextPage +{ + reference key (ct_wiki.item_id); +} \ No newline at end of file Added: contrib/permeance/ccm-cms-types-wiki/sql/ccm-cms-types-wiki/oracle-se-create.sql =================================================================== --- contrib/permeance/ccm-cms-types-wiki/sql/ccm-cms-types-wiki/oracle-se-create.sql (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/sql/ccm-cms-types-wiki/oracle-se-create.sql 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,18 @@ +-- Copyright (C) 2008 Permeance Technologies. 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 + +@ ddl/oracle-se/create.sql +@ ddl/oracle-se/deferred.sql \ No newline at end of file Added: contrib/permeance/ccm-cms-types-wiki/sql/ccm-cms-types-wiki/postgres-create.sql =================================================================== --- contrib/permeance/ccm-cms-types-wiki/sql/ccm-cms-types-wiki/postgres-create.sql (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/sql/ccm-cms-types-wiki/postgres-create.sql 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,20 @@ +-- Copyright (C) 2008 Permeance Technologies. 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 + +begin; +\i ddl/postgres/create.sql +\i ddl/postgres/deferred.sql +end; Added: contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/content-types/org/aplaws/cms/contenttypes/Wiki.xml =================================================================== --- contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/content-types/org/aplaws/cms/contenttypes/Wiki.xml (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/content-types/org/aplaws/cms/contenttypes/Wiki.xml 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 +--> +<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd"> + + <ctd:content-type label="Wiki" description="A wiki page" objectType="org.aplaws.cms.contenttypes.wiki.Wiki" + classname="org.aplaws.cms.contenttypes.wiki.Wiki"> + + <ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate"> + <ctd:authoring-step labelKey="cms.contenttypes.shared.basic_properties.title" + labelBundle="com.arsdigita.cms.ui.CMSResources" + descriptionKey="cms.contenttypes.shared.basic_properties.description" + descriptionBundle="com.arsdigita.cms.ui.CMSResources" + component="com.arsdigita.cms.ui.authoring.PageEdit" /> + + <ctd:authoring-step labelKey="cms.contenttypes.shared.body_text.title" + labelBundle="com.arsdigita.cms.ui.CMSResources" + descriptionKey="cms.contenttypes.shared.body_text.description" + descriptionBundle="com.arsdigita.cms.ui.CMSResources" + component="org.aplaws.cms.contenttypes.wiki.ui.authoring.BodyTextStep" /> + + <ctd:include href="/WEB-INF/content-types/assign-categories-step.xml" /> + + </ctd:authoring-kit> + </ctd:content-type> +</ctd:content-types> Added: contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/traversal-adapters/org/aplaws/cms/contenttypes/Wiki.xml =================================================================== --- contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/traversal-adapters/org/aplaws/cms/contenttypes/Wiki.xml (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/src/WEB-INF/traversal-adapters/org/aplaws/cms/contenttypes/Wiki.xml 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 +--> +<xrd:adapters xmlns:xrd="http://xmlns.redhat.com/schemas/waf/xml-renderer-rules" + 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.cms.dispatcher.SimpleXMLGenerator"> + <xrd:adapter objectType="org.aplaws.cms.contenttypes.wiki.Wiki" extends="com.arsdigita.cms.TextPage"> + <xrd:associations rule="include"> + <xrd:property name="/object/auditing" /> + <xrd:property name="/object/auditing/creationUser" /> + <xrd:property name="/object/auditing/lastModifiedUser" /> + <xrd:property name="/object/section" /> + </xrd:associations> + <xrd:attributes rule="include"> + <xrd:property name="/object/id" /> + </xrd:attributes> + <xrd:generator property="/object/textAsset/content" + class="org.aplaws.cms.contenttypes.wiki.ui.WikiTextNodeGenerator" /> + </xrd:adapter> + </xrd:context> + <xrd:context name="com.arsdigita.cms.search.ContentPageMetadataProvider"> + <xrd:adapter objectType="org.aplaws.cms.contenttypes.wiki.Wiki" extends="com.arsdigita.cms.TextPage"> + <xrd:formatter property="/object/textAsset/content" + class="org.aplaws.cms.contenttypes.wiki.ui.WikiTextFormatter" /> + </xrd:adapter> + </xrd:context> +</xrd:adapters> Added: contrib/permeance/ccm-cms-types-wiki/src/ccm-cms-types-wiki.config =================================================================== --- contrib/permeance/ccm-cms-types-wiki/src/ccm-cms-types-wiki.config (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/src/ccm-cms-types-wiki.config 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 +--> +<registry> + <!-- nothing yet --> +</registry> Added: contrib/permeance/ccm-cms-types-wiki/src/ccm-cms-types-wiki.load =================================================================== --- contrib/permeance/ccm-cms-types-wiki/src/ccm-cms-types-wiki.load (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/src/ccm-cms-types-wiki.load 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 +--> +<load> + <requires> + <table name="inits"/> + <table name="acs_objects"/> + <table name="cms_items"/> + <table name="ct_file_storage"/> + <initializer class="com.arsdigita.cms.contenttypes.FileStorageItemInitializer"/> + </requires> + <provides> + <table name="ct_wiki"/> + <initializer class="org.aplaws.cms.contenttypes.wiki.WikiInitializer"/> + </provides> + <scripts> + <schema directory="ccm-cms-types-wiki"/> + <data class="org.aplaws.cms.contenttypes.wiki.WikiLoader"/> + </scripts> +</load> \ No newline at end of file Added: contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/Wiki.java =================================================================== --- contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/Wiki.java (rev 0) +++ contrib/permeance/ccm-cms-types-wiki/src/org/aplaws/cms/contenttypes/wiki/Wiki.java 2008-07-12 03:18:16 UTC (rev 1712) @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 org.aplaws.cms.contenttypes.wiki; + +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Set; +import java.util.TreeSet; + +import com.arsdigita.cms.ContentBundle; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ContentPage; +import com.arsdigita.cms.Folder; +import com.arsdigita.cms.ItemCollection; +import com.arsdigita.cms.TextAsset; +import com.arsdigita.cms.TextPage; +import com.arsdigita.cms.lifecycle.LifecycleDefinition; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.util.StringUtils; + +/** + * A Wiki page is simply a {@link TextPage} with special formatting. + * + * @author <a href="https://sourceforge.net/users/terry_permeance/">terry_permeance</a> + */ +public class Wiki extends TextPage +{ + public static final String BASE_DATA_OBJECT_TYPE = "org.aplaws.cms.contenttypes.wiki.Wiki"; + + public static void create(Wiki sibling, String title) + { + // Create the language-specific version of the wiki page + Wiki wiki = new Wiki(); + wiki.setContentSection(sibling.getContentSection()); + wiki.setLanguage(sibling.getLanguage()); + wiki.setName(StringUtils.urlize(title)); + wiki.setTitle(title); + wiki.setTextAsset(new TextAsset()); + wiki.getTextAsset().setText(""); + wiki.getTextAsset().setName(wiki.getName()); + wiki.save(); + + // Create the content bundle for the wiki page + ContentBundle bundle = new ContentBundle(wiki); + bundle.setParent(((Wiki) sibling.getDraftVersion()).getContentBundle().getParent()); + bundle.setContentSection(sibling.getContentSection()); + bundle.save(); + + // Publish the wiki page using the same lifecycle as its sibling + LifecycleDefinition lifecycle = sibling.getLifecycle().getLifecycleDefinition(); + ContentItem pending = wiki.publish(lifecycle, Calendar.getInstance().getTime()); + pending.getLifecycle().start(); + wiki.save(); + } + + public Wiki() + { + super(BASE_DATA_OBJECT_TYPE); + } + + public Wiki(String type) + { + super(type); + } + + public Wiki(OID oid) + { + super(oid); + } + + public Wiki(BigDecimal id) + { + super(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public Wiki(DataObject obj) + { + super(obj); + } + + /** + * Return a list of the names for all pages in the same Wiki as this page. + * + * @return the set, possibly empty. + */ + pu... [truncated message content] |
From: <te...@fe...> - 2008-07-12 03:12:30
|
Author: terry Date: 2008-07-12 03:12:22 +0000 (Sat, 12 Jul 2008) New Revision: 1711 Modified: trunk/ccm-cms/web/assets/prototype.js Log: Upgraded to 1.6.0 from http://www.prototypejs.org/ Modified: trunk/ccm-cms/web/assets/prototype.js =================================================================== --- trunk/ccm-cms/web/assets/prototype.js 2008-07-12 03:11:42 UTC (rev 1710) +++ trunk/ccm-cms/web/assets/prototype.js 2008-07-12 03:12:22 UTC (rev 1711) @@ -1,98 +1,290 @@ -/* Prototype JavaScript framework, version 1.4.0 - * (c) 2005 Sam Stephenson <sa...@co...> +/* Prototype JavaScript framework, version 1.6.0 + * (c) 2005-2007 Sam Stephenson * * Prototype is freely distributable under the terms of an MIT-style license. - * For details, see the Prototype web site: http://prototype.conio.net/ + * For details, see the Prototype web site: http://www.prototypejs.org/ * -/*--------------------------------------------------------------------------*/ + *--------------------------------------------------------------------------*/ var Prototype = { - Version: '1.4.0', - ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)', + Version: '1.6.0', - emptyFunction: function() {}, - K: function(x) {return x} -} + Browser: { + IE: !!(window.attachEvent && !window.opera), + Opera: !!window.opera, + WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, + Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1, + MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) + }, + BrowserFeatures: { + XPath: !!document.evaluate, + ElementExtensions: !!window.HTMLElement, + SpecificElementExtensions: + document.createElement('div').__proto__ && + document.createElement('div').__proto__ !== + document.createElement('form').__proto__ + }, + + ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>', + JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, + + emptyFunction: function() { }, + K: function(x) { return x } +}; + +if (Prototype.Browser.MobileSafari) + Prototype.BrowserFeatures.SpecificElementExtensions = false; + +if (Prototype.Browser.WebKit) + Prototype.BrowserFeatures.XPath = false; + +/* Based on Alex Arnell's inheritance implementation. */ var Class = { create: function() { - return function() { + var parent = null, properties = $A(arguments); + if (Object.isFunction(properties[0])) + parent = properties.shift(); + + function klass() { this.initialize.apply(this, arguments); } + + Object.extend(klass, Class.Methods); + klass.superclass = parent; + klass.subclasses = []; + + if (parent) { + var subclass = function() { }; + subclass.prototype = parent.prototype; + klass.prototype = new subclass; + parent.subclasses.push(klass); + } + + for (var i = 0; i < properties.length; i++) + klass.addMethods(properties[i]); + + if (!klass.prototype.initialize) + klass.prototype.initialize = Prototype.emptyFunction; + + klass.prototype.constructor = klass; + + return klass; } -} +}; -var Abstract = new Object(); +Class.Methods = { + addMethods: function(source) { + var ancestor = this.superclass && this.superclass.prototype; + var properties = Object.keys(source); + if (!Object.keys({ toString: true }).length) + properties.push("toString", "valueOf"); + + for (var i = 0, length = properties.length; i < length; i++) { + var property = properties[i], value = source[property]; + if (ancestor && Object.isFunction(value) && + value.argumentNames().first() == "$super") { + var method = value, value = Object.extend((function(m) { + return function() { return ancestor[m].apply(this, arguments) }; + })(property).wrap(method), { + valueOf: function() { return method }, + toString: function() { return method.toString() } + }); + } + this.prototype[property] = value; + } + + return this; + } +}; + +var Abstract = { }; + Object.extend = function(destination, source) { - for (property in source) { + for (var property in source) destination[property] = source[property]; - } return destination; -} +}; -Object.inspect = function(object) { - try { - if (object == undefined) return 'undefined'; - if (object == null) return 'null'; - return object.inspect ? object.inspect() : object.toString(); - } catch (e) { - if (e instanceof RangeError) return '...'; - throw e; - } -} +Object.extend(Object, { + inspect: function(object) { + try { + if (object === undefined) return 'undefined'; + if (object === null) return 'null'; + return object.inspect ? object.inspect() : object.toString(); + } catch (e) { + if (e instanceof RangeError) return '...'; + throw e; + } + }, -Function.prototype.bind = function() { - var __method = this, args = $A(arguments), object = args.shift(); - return function() { - return __method.apply(object, args.concat($A(arguments))); - } -} + toJSON: function(object) { + var type = typeof object; + switch (type) { + case 'undefined': + case 'function': + case 'unknown': return; + case 'boolean': return object.toString(); + } -Function.prototype.bindAsEventListener = function(object) { - var __method = this; - return function(event) { - return __method.call(object, event || window.event); + if (object === null) return 'null'; + if (object.toJSON) return object.toJSON(); + if (Object.isElement(object)) return; + + var results = []; + for (var property in object) { + var value = Object.toJSON(object[property]); + if (value !== undefined) + results.push(property.toJSON() + ': ' + value); + } + + return '{' + results.join(', ') + '}'; + }, + + toQueryString: function(object) { + return $H(object).toQueryString(); + }, + + toHTML: function(object) { + return object && object.toHTML ? object.toHTML() : String.interpret(object); + }, + + keys: function(object) { + var keys = []; + for (var property in object) + keys.push(property); + return keys; + }, + + values: function(object) { + var values = []; + for (var property in object) + values.push(object[property]); + return values; + }, + + clone: function(object) { + return Object.extend({ }, object); + }, + + isElement: function(object) { + return object && object.nodeType == 1; + }, + + isArray: function(object) { + return object && object.constructor === Array; + }, + + isHash: function(object) { + return object instanceof Hash; + }, + + isFunction: function(object) { + return typeof object == "function"; + }, + + isString: function(object) { + return typeof object == "string"; + }, + + isNumber: function(object) { + return typeof object == "number"; + }, + + isUndefined: function(object) { + return typeof object == "undefined"; } -} +}); -Object.extend(Number.prototype, { - toColorPart: function() { - var digits = this.toString(16); - if (this < 16) return '0' + digits; - return digits; +Object.extend(Function.prototype, { + argumentNames: function() { + var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip"); + return names.length == 1 && !names[0] ? [] : names; }, - succ: function() { - return this + 1; + bind: function() { + if (arguments.length < 2 && arguments[0] === undefined) return this; + var __method = this, args = $A(arguments), object = args.shift(); + return function() { + return __method.apply(object, args.concat($A(arguments))); + } }, - times: function(iterator) { - $R(0, this, true).each(iterator); - return this; + bindAsEventListener: function() { + var __method = this, args = $A(arguments), object = args.shift(); + return function(event) { + return __method.apply(object, [event || window.event].concat(args)); + } + }, + + curry: function() { + if (!arguments.length) return this; + var __method = this, args = $A(arguments); + return function() { + return __method.apply(this, args.concat($A(arguments))); + } + }, + + delay: function() { + var __method = this, args = $A(arguments), timeout = args.shift() * 1000; + return window.setTimeout(function() { + return __method.apply(__method, args); + }, timeout); + }, + + wrap: function(wrapper) { + var __method = this; + return function() { + return wrapper.apply(this, [__method.bind(this)].concat($A(arguments))); + } + }, + + methodize: function() { + if (this._methodized) return this._methodized; + var __method = this; + return this._methodized = function() { + return __method.apply(null, [this].concat($A(arguments))); + }; } }); +Function.prototype.defer = Function.prototype.delay.curry(0.01); + +Date.prototype.toJSON = function() { + return '"' + this.getUTCFullYear() + '-' + + (this.getUTCMonth() + 1).toPaddedString(2) + '-' + + this.getUTCDate().toPaddedString(2) + 'T' + + this.getUTCHours().toPaddedString(2) + ':' + + this.getUTCMinutes().toPaddedString(2) + ':' + + this.getUTCSeconds().toPaddedString(2) + 'Z"'; +}; + var Try = { these: function() { var returnValue; - for (var i = 0; i < arguments.length; i++) { + for (var i = 0, length = arguments.length; i < length; i++) { var lambda = arguments[i]; try { returnValue = lambda(); break; - } catch (e) {} + } catch (e) { } } return returnValue; } -} +}; +RegExp.prototype.match = RegExp.prototype.test; + +RegExp.escape = function(str) { + return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); +}; + /*--------------------------------------------------------------------------*/ -var PeriodicalExecuter = Class.create(); -PeriodicalExecuter.prototype = { +var PeriodicalExecuter = Class.create({ initialize: function(callback, frequency) { this.callback = callback; this.frequency = frequency; @@ -102,40 +294,87 @@ }, registerCallback: function() { - setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); }, + execute: function() { + this.callback(this); + }, + + stop: function() { + if (!this.timer) return; + clearInterval(this.timer); + this.timer = null; + }, + onTimerEvent: function() { if (!this.currentlyExecuting) { try { this.currentlyExecuting = true; - this.callback(); + this.execute(); } finally { this.currentlyExecuting = false; } } } -} +}); +Object.extend(String, { + interpret: function(value) { + return value == null ? '' : String(value); + }, + specialChar: { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '\\': '\\\\' + } +}); -/*--------------------------------------------------------------------------*/ +Object.extend(String.prototype, { + gsub: function(pattern, replacement) { + var result = '', source = this, match; + replacement = arguments.callee.prepareReplacement(replacement); -function $() { - var elements = new Array(); + while (source.length > 0) { + if (match = source.match(pattern)) { + result += source.slice(0, match.index); + result += String.interpret(replacement(match)); + source = source.slice(match.index + match[0].length); + } else { + result += source, source = ''; + } + } + return result; + }, - for (var i = 0; i < arguments.length; i++) { - var element = arguments[i]; - if (typeof element == 'string') - element = document.getElementById(element); + sub: function(pattern, replacement, count) { + replacement = this.gsub.prepareReplacement(replacement); + count = count === undefined ? 1 : count; - if (arguments.length == 1) - return element; + return this.gsub(pattern, function(match) { + if (--count < 0) return match[0]; + return replacement(match); + }); + }, - elements.push(element); - } + scan: function(pattern, iterator) { + this.gsub(pattern, iterator); + return String(this); + }, - return elements; -} -Object.extend(String.prototype, { + truncate: function(length, truncation) { + length = length || 30; + truncation = truncation === undefined ? '...' : truncation; + return this.length > length ? + this.slice(0, length - truncation.length) + truncation : String(this); + }, + + strip: function() { + return this.replace(/^\s+/, '').replace(/\s+$/, ''); + }, + stripTags: function() { return this.replace(/<\/?[^>]+>/gi, ''); }, @@ -153,28 +392,40 @@ }, evalScripts: function() { - return this.extractScripts().map(eval); + return this.extractScripts().map(function(script) { return eval(script) }); }, escapeHTML: function() { - var div = document.createElement('div'); - var text = document.createTextNode(this); - div.appendChild(text); - return div.innerHTML; + var self = arguments.callee; + self.text.data = this; + return self.div.innerHTML; }, unescapeHTML: function() { - var div = document.createElement('div'); + var div = new Element('div'); div.innerHTML = this.stripTags(); - return div.childNodes[0] ? div.childNodes[0].nodeValue : ''; + return div.childNodes[0] ? (div.childNodes.length > 1 ? + $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) : + div.childNodes[0].nodeValue) : ''; }, - toQueryParams: function() { - var pairs = this.match(/^\??(.*)$/)[1].split('&'); - return pairs.inject({}, function(params, pairString) { - var pair = pairString.split('='); - params[pair[0]] = pair[1]; - return params; + toQueryParams: function(separator) { + var match = this.strip().match(/([^?#]*)(#.*)?$/); + if (!match) return { }; + + return match[1].split(separator || '&').inject({ }, function(hash, pair) { + if ((pair = pair.split('='))[0]) { + var key = decodeURIComponent(pair.shift()); + var value = pair.length > 1 ? pair.join('=') : pair[0]; + if (value != undefined) value = decodeURIComponent(value); + + if (key in hash) { + if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; + hash[key].push(value); + } + else hash[key] = value; + } + return hash; }); }, @@ -182,67 +433,201 @@ return this.split(''); }, + succ: function() { + return this.slice(0, this.length - 1) + + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); + }, + + times: function(count) { + return count < 1 ? '' : new Array(count + 1).join(this); + }, + camelize: function() { - var oStringList = this.split('-'); - if (oStringList.length == 1) return oStringList[0]; + var parts = this.split('-'), len = parts.length; + if (len == 1) return parts[0]; - var camelizedString = this.indexOf('-') == 0 - ? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1) - : oStringList[0]; + var camelized = this.charAt(0) == '-' + ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) + : parts[0]; - for (var i = 1, len = oStringList.length; i < len; i++) { - var s = oStringList[i]; - camelizedString += s.charAt(0).toUpperCase() + s.substring(1); - } + for (var i = 1; i < len; i++) + camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); - return camelizedString; + return camelized; }, - inspect: function() { - return "'" + this.replace('\\', '\\\\').replace("'", '\\\'') + "'"; + capitalize: function() { + return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); + }, + + underscore: function() { + return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); + }, + + dasherize: function() { + return this.gsub(/_/,'-'); + }, + + inspect: function(useDoubleQuotes) { + var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) { + var character = String.specialChar[match[0]]; + return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16); + }); + if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; + return "'" + escapedString.replace(/'/g, '\\\'') + "'"; + }, + + toJSON: function() { + return this.inspect(true); + }, + + unfilterJSON: function(filter) { + return this.sub(filter || Prototype.JSONFilter, '#{1}'); + }, + + isJSON: function() { + var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); + return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); + }, + + evalJSON: function(sanitize) { + var json = this.unfilterJSON(); + try { + if (!sanitize || json.isJSON()) return eval('(' + json + ')'); + } catch (e) { } + throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); + }, + + include: function(pattern) { + return this.indexOf(pattern) > -1; + }, + + startsWith: function(pattern) { + return this.indexOf(pattern) === 0; + }, + + endsWith: function(pattern) { + var d = this.length - pattern.length; + return d >= 0 && this.lastIndexOf(pattern) === d; + }, + + empty: function() { + return this == ''; + }, + + blank: function() { + return /^\s*$/.test(this); + }, + + interpolate: function(object, pattern) { + return new Template(this, pattern).evaluate(object); } }); +if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { + escapeHTML: function() { + return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + }, + unescapeHTML: function() { + return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + } +}); + +String.prototype.gsub.prepareReplacement = function(replacement) { + if (Object.isFunction(replacement)) return replacement; + var template = new Template(replacement); + return function(match) { return template.evaluate(match) }; +}; + String.prototype.parseQuery = String.prototype.toQueryParams; -var $break = new Object(); -var $continue = new Object(); +Object.extend(String.prototype.escapeHTML, { + div: document.createElement('div'), + text: document.createTextNode('') +}); +with (String.prototype.escapeHTML) div.appendChild(text); + +var Template = Class.create({ + initialize: function(template, pattern) { + this.template = template.toString(); + this.pattern = pattern || Template.Pattern; + }, + + evaluate: function(object) { + if (Object.isFunction(object.toTemplateReplacements)) + object = object.toTemplateReplacements(); + + return this.template.gsub(this.pattern, function(match) { + if (object == null) return ''; + + var before = match[1] || ''; + if (before == '\\') return match[2]; + + var ctx = object, expr = match[3]; + var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/, match = pattern.exec(expr); + if (match == null) return before; + + while (match != null) { + var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1]; + ctx = ctx[comp]; + if (null == ctx || '' == match[3]) break; + expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); + match = pattern.exec(expr); + } + + return before + String.interpret(ctx); + }.bind(this)); + } +}); +Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; + +var $break = { }; + var Enumerable = { - each: function(iterator) { + each: function(iterator, context) { var index = 0; + iterator = iterator.bind(context); try { this._each(function(value) { - try { - iterator(value, index++); - } catch (e) { - if (e != $continue) throw e; - } + iterator(value, index++); }); } catch (e) { if (e != $break) throw e; } + return this; }, - all: function(iterator) { + eachSlice: function(number, iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; + var index = -number, slices = [], array = this.toArray(); + while ((index += number) < array.length) + slices.push(array.slice(index, index+number)); + return slices.collect(iterator, context); + }, + + all: function(iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; var result = true; this.each(function(value, index) { - result = result && !!(iterator || Prototype.K)(value, index); + result = result && !!iterator(value, index); if (!result) throw $break; }); return result; }, - any: function(iterator) { - var result = true; + any: function(iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; + var result = false; this.each(function(value, index) { - if (result = !!(iterator || Prototype.K)(value, index)) + if (result = !!iterator(value, index)) throw $break; }); return result; }, - collect: function(iterator) { + collect: function(iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; var results = []; this.each(function(value, index) { results.push(iterator(value, index)); @@ -250,7 +635,8 @@ return results; }, - detect: function (iterator) { + detect: function(iterator, context) { + iterator = iterator.bind(context); var result; this.each(function(value, index) { if (iterator(value, index)) { @@ -261,7 +647,8 @@ return result; }, - findAll: function(iterator) { + findAll: function(iterator, context) { + iterator = iterator.bind(context); var results = []; this.each(function(value, index) { if (iterator(value, index)) @@ -270,17 +657,24 @@ return results; }, - grep: function(pattern, iterator) { + grep: function(filter, iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; var results = []; + + if (Object.isString(filter)) + filter = new RegExp(filter); + this.each(function(value, index) { - var stringValue = value.toString(); - if (stringValue.match(pattern)) - results.push((iterator || Prototype.K)(value, index)); - }) + if (filter.match(value)) + results.push(iterator(value, index)); + }); return results; }, include: function(object) { + if (Object.isFunction(this.indexOf)) + if (this.indexOf(object) != -1) return true; + var found = false; this.each(function(value) { if (value == object) { @@ -291,7 +685,16 @@ return found; }, - inject: function(memo, iterator) { + inGroupsOf: function(number, fillWith) { + fillWith = fillWith === undefined ? null : fillWith; + return this.eachSlice(number, function(slice) { + while(slice.length < number) slice.push(fillWith); + return slice; + }); + }, + + inject: function(memo, iterator, context) { + iterator = iterator.bind(context); this.each(function(value, index) { memo = iterator(memo, value, index); }); @@ -300,35 +703,38 @@ invoke: function(method) { var args = $A(arguments).slice(1); - return this.collect(function(value) { + return this.map(function(value) { return value[method].apply(value, args); }); }, - max: function(iterator) { + max: function(iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; var result; this.each(function(value, index) { - value = (iterator || Prototype.K)(value, index); - if (value >= (result || value)) + value = iterator(value, index); + if (result == undefined || value >= result) result = value; }); return result; }, - min: function(iterator) { + min: function(iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; var result; this.each(function(value, index) { - value = (iterator || Prototype.K)(value, index); - if (value <= (result || value)) + value = iterator(value, index); + if (result == undefined || value < result) result = value; }); return result; }, - partition: function(iterator) { + partition: function(iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; var trues = [], falses = []; this.each(function(value, index) { - ((iterator || Prototype.K)(value, index) ? + (iterator(value, index) ? trues : falses).push(value); }); return [trues, falses]; @@ -336,13 +742,14 @@ pluck: function(property) { var results = []; - this.each(function(value, index) { + this.each(function(value) { results.push(value[property]); }); return results; }, - reject: function(iterator) { + reject: function(iterator, context) { + iterator = iterator.bind(context); var results = []; this.each(function(value, index) { if (!iterator(value, index)) @@ -351,8 +758,9 @@ return results; }, - sortBy: function(iterator) { - return this.collect(function(value, index) { + sortBy: function(iterator, context) { + iterator = iterator.bind(context); + return this.map(function(value, index) { return {value: value, criteria: iterator(value, index)}; }).sort(function(left, right) { var a = left.criteria, b = right.criteria; @@ -361,52 +769,67 @@ }, toArray: function() { - return this.collect(Prototype.K); + return this.map(); }, zip: function() { var iterator = Prototype.K, args = $A(arguments); - if (typeof args.last() == 'function') + if (Object.isFunction(args.last())) iterator = args.pop(); var collections = [this].concat(args).map($A); return this.map(function(value, index) { - iterator(value = collections.pluck(index)); - return value; + return iterator(collections.pluck(index)); }); }, + size: function() { + return this.toArray().length; + }, + inspect: function() { return '#<Enumerable:' + this.toArray().inspect() + '>'; } -} +}; Object.extend(Enumerable, { map: Enumerable.collect, find: Enumerable.detect, select: Enumerable.findAll, + filter: Enumerable.findAll, member: Enumerable.include, - entries: Enumerable.toArray + entries: Enumerable.toArray, + every: Enumerable.all, + some: Enumerable.any }); -var $A = Array.from = function(iterable) { +function $A(iterable) { if (!iterable) return []; - if (iterable.toArray) { - return iterable.toArray(); - } else { - var results = []; - for (var i = 0; i < iterable.length; i++) - results.push(iterable[i]); + if (iterable.toArray) return iterable.toArray(); + var length = iterable.length, results = new Array(length); + while (length--) results[length] = iterable[length]; + return results; +} + +if (Prototype.Browser.WebKit) { + function $A(iterable) { + if (!iterable) return []; + if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') && + iterable.toArray) return iterable.toArray(); + var length = iterable.length, results = new Array(length); + while (length--) results[length] = iterable[length]; return results; } } +Array.from = $A; + Object.extend(Array.prototype, Enumerable); -Array.prototype._reverse = Array.prototype.reverse; +if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse; Object.extend(Array.prototype, { _each: function(iterator) { - for (var i = 0; i < this.length; i++) + for (var i = 0, length = this.length; i < length; i++) iterator(this[i]); }, @@ -425,13 +848,13 @@ compact: function() { return this.select(function(value) { - return value != undefined || value != null; + return value != null; }); }, flatten: function() { return this.inject([], function(array, value) { - return array.concat(value.constructor == Array ? + return array.concat(Object.isArray(value) ? value.flatten() : [value]); }); }, @@ -443,78 +866,240 @@ }); }, - indexOf: function(object) { - for (var i = 0; i < this.length; i++) - if (this[i] == object) return i; - return -1; - }, - reverse: function(inline) { return (inline !== false ? this : this.toArray())._reverse(); }, - shift: function() { - var result = this[0]; - for (var i = 0; i < this.length - 1; i++) - this[i] = this[i + 1]; - this.length--; - return result; + reduce: function() { + return this.length > 1 ? this : this[0]; }, + uniq: function(sorted) { + return this.inject([], function(array, value, index) { + if (0 == index || (sorted ? array.last() != value : !array.include(value))) + array.push(value); + return array; + }); + }, + + intersect: function(array) { + return this.uniq().findAll(function(item) { + return array.detect(function(value) { return item === value }); + }); + }, + + clone: function() { + return [].concat(this); + }, + + size: function() { + return this.length; + }, + inspect: function() { return '[' + this.map(Object.inspect).join(', ') + ']'; + }, + + toJSON: function() { + var results = []; + this.each(function(object) { + var value = Object.toJSON(object); + if (value !== undefined) results.push(value); + }); + return '[' + results.join(', ') + ']'; } }); -var Hash = { - _each: function(iterator) { - for (key in this) { - var value = this[key]; - if (typeof value == 'function') continue; - var pair = [key, value]; - pair.key = key; - pair.value = value; - iterator(pair); +// use native browser JS 1.6 implementation if available +if (Object.isFunction(Array.prototype.forEach)) + Array.prototype._each = Array.prototype.forEach; + +if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) { + i || (i = 0); + var length = this.length; + if (i < 0) i = length + i; + for (; i < length; i++) + if (this[i] === item) return i; + return -1; +}; + +if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) { + i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; + var n = this.slice(0, i).reverse().indexOf(item); + return (n < 0) ? n : i - n - 1; +}; + +Array.prototype.toArray = Array.prototype.clone; + +function $w(string) { + if (!Object.isString(string)) return []; + string = string.strip(); + return string ? string.split(/\s+/) : []; +} + +if (Prototype.Browser.Opera){ + Array.prototype.concat = function() { + var array = []; + for (var i = 0, length = this.length; i < length; i++) array.push(this[i]); + for (var i = 0, length = arguments.length; i < length; i++) { + if (Object.isArray(arguments[i])) { + for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) + array.push(arguments[i][j]); + } else { + array.push(arguments[i]); + } } + return array; + }; +} +Object.extend(Number.prototype, { + toColorPart: function() { + return this.toPaddedString(2, 16); }, - keys: function() { - return this.pluck('key'); + succ: function() { + return this + 1; }, - values: function() { - return this.pluck('value'); + times: function(iterator) { + $R(0, this, true).each(iterator); + return this; }, - merge: function(hash) { - return $H(hash).inject($H(this), function(mergedHash, pair) { - mergedHash[pair.key] = pair.value; - return mergedHash; - }); + toPaddedString: function(length, radix) { + var string = this.toString(radix || 10); + return '0'.times(length - string.length) + string; }, - toQueryString: function() { - return this.map(function(pair) { - return pair.map(encodeURIComponent).join('='); - }).join('&'); - }, + toJSON: function() { + return isFinite(this) ? this.toString() : 'null'; + } +}); - inspect: function() { - return '#<Hash:{' + this.map(function(pair) { - return pair.map(Object.inspect).join(': '); - }).join(', ') + '}>'; +$w('abs round ceil floor').each(function(method){ + Number.prototype[method] = Math[method].methodize(); +}); +function $H(object) { + return new Hash(object); +}; + +var Hash = Class.create(Enumerable, (function() { + if (function() { + var i = 0, Test = function(value) { this.key = value }; + Test.prototype.key = 'foo'; + for (var property in new Test('bar')) i++; + return i > 1; + }()) { + function each(iterator) { + var cache = []; + for (var key in this._object) { + var value = this._object[key]; + if (cache.include(key)) continue; + cache.push(key); + var pair = [key, value]; + pair.key = key; + pair.value = value; + iterator(pair); + } + } + } else { + function each(iterator) { + for (var key in this._object) { + var value = this._object[key], pair = [key, value]; + pair.key = key; + pair.value = value; + iterator(pair); + } + } } -} -function $H(object) { - var hash = Object.extend({}, object || {}); - Object.extend(hash, Enumerable); - Object.extend(hash, Hash); - return hash; -} -ObjectRange = Class.create(); -Object.extend(ObjectRange.prototype, Enumerable); -Object.extend(ObjectRange.prototype, { + function toQueryPair(key, value) { + if (Object.isUndefined(value)) return key; + return key + '=' + encodeURIComponent(String.interpret(value)); + } + + return { + initialize: function(object) { + this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); + }, + + _each: each, + + set: function(key, value) { + return this._object[key] = value; + }, + + get: function(key) { + return this._object[key]; + }, + + unset: function(key) { + var value = this._object[key]; + delete this._object[key]; + return value; + }, + + toObject: function() { + return Object.clone(this._object); + }, + + keys: function() { + return this.pluck('key'); + }, + + values: function() { + return this.pluck('value'); + }, + + index: function(value) { + var match = this.detect(function(pair) { + return pair.value === value; + }); + return match && match.key; + }, + + merge: function(object) { + return this.clone().update(object); + }, + + update: function(object) { + return new Hash(object).inject(this, function(result, pair) { + result.set(pair.key, pair.value); + return result; + }); + }, + + toQueryString: function() { + return this.map(function(pair) { + var key = encodeURIComponent(pair.key), values = pair.value; + + if (values && typeof values == 'object') { + if (Object.isArray(values)) + return values.map(toQueryPair.curry(key)).join('&'); + } + return toQueryPair(key, values); + }).join('&'); + }, + + inspect: function() { + return '#<Hash:{' + this.map(function(pair) { + return pair.map(Object.inspect).join(': '); + }).join(', ') + '}>'; + }, + + toJSON: function() { + return Object.toJSON(this.toObject()); + }, + + clone: function() { + return new Hash(this); + } + } +})()); + +Hash.prototype.toTemplateReplacements = Hash.prototype.toObject; +Hash.from = $H; +var ObjectRange = Class.create(Enumerable, { initialize: function(start, end, exclusive) { this.start = start; this.end = end; @@ -523,10 +1108,10 @@ _each: function(iterator) { var value = this.start; - do { + while (this.include(value)) { iterator(value); value = value.succ(); - } while (this.include(value)); + } }, include: function(value) { @@ -540,19 +1125,19 @@ var $R = function(start, end, exclusive) { return new ObjectRange(start, end, exclusive); -} +}; var Ajax = { getTransport: function() { return Try.these( + function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, - function() {return new ActiveXObject('Microsoft.XMLHTTP')}, - function() {return new XMLHttpRequest()} + function() {return new ActiveXObject('Microsoft.XMLHTTP')} ) || false; }, activeRequestCount: 0 -} +}; Ajax.Responders = { responders: [], @@ -561,21 +1146,21 @@ this.responders._each(iterator); }, - register: function(responderToAdd) { - if (!this.include(responderToAdd)) - this.responders.push(responderToAdd); + register: function(responder) { + if (!this.include(responder)) + this.responders.push(responder); }, - unregister: function(responderToRemove) { - this.responders = this.responders.without(responderToRemove); + unregister: function(responder) { + this.responders = this.responders.without(responder); }, dispatch: function(callback, request, transport, json) { this.each(function(responder) { - if (responder[callback] && typeof responder[callback] == 'function') { + if (Object.isFunction(responder[callback])) { try { responder[callback].apply(responder, [request, transport, json]); - } catch (e) {} + } catch (e) { } } }); } @@ -584,217 +1169,313 @@ Object.extend(Ajax.Responders, Enumerable); Ajax.Responders.register({ - onCreate: function() { - Ajax.activeRequestCount++; - }, - - onComplete: function() { - Ajax.activeRequestCount--; - } + onCreate: function() { Ajax.activeRequestCount++ }, + onComplete: function() { Ajax.activeRequestCount-- } }); -Ajax.Base = function() {}; -Ajax.Base.prototype = { - setOptions: function(options) { +Ajax.Base = Class.create({ + initialize: function(options) { this.options = { method: 'post', asynchronous: true, - parameters: '' - } - Object.extend(this.options, options || {}); - }, + contentType: 'application/x-www-form-urlencoded', + encoding: 'UTF-8', + parameters: '', + evalJSON: true, + evalJS: true + }; + Object.extend(this.options, options || { }); - responseIsSuccess: function() { - return this.transport.status == undefined - || this.transport.status == 0 - || (this.transport.status >= 200 && this.transport.status < 300); - }, - - responseIsFailure: function() { - return !this.responseIsSuccess(); + this.options.method = this.options.method.toLowerCase(); + if (Object.isString(this.options.parameters)) + this.options.parameters = this.options.parameters.toQueryParams(); } -} +}); -Ajax.Request = Class.create(); -Ajax.Request.Events = - ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; +Ajax.Request = Class.create(Ajax.Base, { + _complete: false, -Ajax.Request.prototype = Object.extend(new Ajax.Base(), { - initialize: function(url, options) { + initialize: function($super, url, options) { + $super(options); this.transport = Ajax.getTransport(); - this.setOptions(options); this.request(url); }, request: function(url) { - var parameters = this.options.parameters || ''; - if (parameters.length > 0) parameters += '&_='; + this.url = url; + this.method = this.options.method; + var params = Object.clone(this.options.parameters); + if (!['get', 'post'].include(this.method)) { + // simulate other verbs over post + params['_method'] = this.method; + this.method = 'post'; + } + + this.parameters = params; + + if (params = Object.toQueryString(params)) { + // when GET, append parameters to URL + if (this.method == 'get') + this.url += (this.url.include('?') ? '&' : '?') + params; + else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) + params += '&_='; + } + try { - this.url = url; - if (this.options.method == 'get' && parameters.length > 0) - this.url += (this.url.match(/\?/) ? '&' : '?') + parameters; + var response = new Ajax.Response(this); + if (this.options.onCreate) this.options.onCreate(response); + Ajax.Responders.dispatch('onCreate', this, response); - Ajax.Responders.dispatch('onCreate', this, this.transport); - - this.transport.open(this.options.method, this.url, + this.transport.open(this.method.toUpperCase(), this.url, this.options.asynchronous); - if (this.options.asynchronous) { - this.transport.onreadystatechange = this.onStateChange.bind(this); - setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10); - } + if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); + this.transport.onreadystatechange = this.onStateChange.bind(this); this.setRequestHeaders(); - var body = this.options.postBody ? this.options.postBody : parameters; - this.transport.send(this.options.method == 'post' ? body : null); + this.body = this.method == 'post' ? (this.options.postBody || params) : null; + this.transport.send(this.body); - } catch (e) { + /* Force Firefox to handle ready state 4 for synchronous requests */ + if (!this.options.asynchronous && this.transport.overrideMimeType) + this.onStateChange(); + + } + catch (e) { this.dispatchException(e); } }, + onStateChange: function() { + var readyState = this.transport.readyState; + if (readyState > 1 && !((readyState == 4) && this._complete)) + this.respondToReadyState(this.transport.readyState); + }, + setRequestHeaders: function() { - var requestHeaders = - ['X-Requested-With', 'XMLHttpRequest', - 'X-Prototype-Version', Prototype.Version]; + var headers = { + 'X-Requested-With': 'XMLHttpRequest', + 'X-Prototype-Version': Prototype.Version, + 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' + }; - if (this.options.method == 'post') { - requestHeaders.push('Content-type', - 'application/x-www-form-urlencoded'); + if (this.method == 'post') { + headers['Content-type'] = this.options.contentType + + (this.options.encoding ? '; charset=' + this.options.encoding : ''); - /* Force "Connection: close" for Mozilla browsers to work around - * a bug where XMLHttpReqeuest sends an incorrect Content-length - * header. See Mozilla Bugzilla #246651. + /* Force "Connection: close" for older Mozilla browsers to work + * around a bug where XMLHttpRequest sends an incorrect + * Content-length header. See Mozilla Bugzilla #246651. */ - if (this.transport.overrideMimeType) - requestHeaders.push('Connection', 'close'); + if (this.transport.overrideMimeType && + (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) + headers['Connection'] = 'close'; } - if (this.options.requestHeaders) - requestHeaders.push.apply(requestHeaders, this.options.requestHeaders); + // user-defined headers + if (typeof this.options.requestHeaders == 'object') { + var extras = this.options.requestHeaders; - for (var i = 0; i < requestHeaders.length; i += 2) - this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]); - }, + if (Object.isFunction(extras.push)) + for (var i = 0, length = extras.length; i < length; i += 2) + headers[extras[i]] = extras[i+1]; + else + $H(extras).each(function(pair) { headers[pair.key] = pair.value }); + } - onStateChange: function() { - var readyState = this.transport.readyState; - if (readyState != 1) - this.respondToReadyState(this.transport.readyState); + for (var name in headers) + this.transport.setRequestHeader(name, headers[name]); }, - header: function(name) { - try { - return this.transport.getResponseHeader(name); - } catch (e) {} + success: function() { + var status = this.getStatus(); + return !status || (status >= 200 && status < 300); }, - evalJSON: function() { + getStatus: function() { try { - return eval(this.header('X-JSON')); - } catch (e) {} + return this.transport.status || 0; + } catch (e) { return 0 } }, - evalResponse: function() { - try { - return eval(this.transport.responseText); - } catch (e) { - this.dispatchException(e); - } - }, - respondToReadyState: function(readyState) { - var event = Ajax.Request.Events[readyState]; - var transport = this.transport, json = this.evalJSON(); + var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); - if (event == 'Complete') { + if (state == 'Complete') { try { - (this.options['on' + this.transport.status] - || this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')] - || Prototype.emptyFunction)(transport, json); + this._complete = true; + (this.options['on' + response.status] + || this.options['on' + (this.success() ? 'Success' : 'Failure')] + || Prototype.emptyFunction)(response, response.headerJSON); } catch (e) { this.dispatchException(e); } - if ((this.header('Content-type') || '').match(/^text\/javascript/i)) + var contentType = response.getHeader('Content-type'); + if (this.options.evalJS == 'force' + || (this.options.evalJS && contentType + && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) this.evalResponse(); } try { - (this.options['on' + event] || Prototype.emptyFunction)(transport, json); - Ajax.Responders.dispatch('on' + event, this, transport, json); + (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); + Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); } catch (e) { this.dispatchException(e); } - /* Avoid memory leak in MSIE: clean up the oncomplete event handler */ - if (event == 'Complete') + if (state == 'Complete') { + // avoid memory leak in MSIE: clean up this.transport.onreadystatechange = Prototype.emptyFunction; + } }, + getHeader: function(name) { + try { + return this.transport.getResponseHeader(name); + } catch (e) { return null } + }, + + evalResponse: function() { + try { + return eval((this.transport.responseText || '').unfilterJSON()); + } catch (e) { + this.dispatchException(e); + } + }, + dispatchException: function(exception) { (this.options.onException || Prototype.emptyFunction)(this, exception); Ajax.Responders.dispatch('onException', this, exception); } }); -Ajax.Updater = Class.create(); +Ajax.Request.Events = + ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; -Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), { - initialize: function(container, url, options) { - this.containers = { - success: container.success ? $(container.success) : $(container), - failure: container.failure ? $(container.failure) : - (container.success ? null : $(container)) +Ajax.Response = Class.create({ + initialize: function(request){ + this.request = request; + var transport = this.transport = request.transport, + readyState = this.readyState = transport.readyState; + + if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { + this.status = this.getStatus(); + this.statusText = this.getStatusText(); + this.responseText = String.interpret(transport.responseText); + this.headerJSON = this._getHeaderJSON(); } - this.transport = Ajax.getTransport(); - this.setOptions(options); + if(readyState == 4) { + var xml = transport.responseXML; + this.responseXML = xml === undefined ? null : xml; + this.responseJSON = this._getResponseJSON(); + } + }, - var onComplete = this.options.onComplete || Prototype.emptyFunction; - this.options.onComplete = (function(transport, object) { - this.updateContent(); - onComplete(transport, object); + status: 0, + statusText: '', + + getStatus: Ajax.Request.prototype.getStatus, + + getStatusText: function() { + try { + return this.transport.statusText || ''; + } catch (e) { return '' } + }, + + getHeader: Ajax.Request.prototype.getHeader, + + getAllHeaders: function() { + try { + return this.getAllResponseHeaders(); + } catch (e) { return null } + }, + + getResponseHeader: function(name) { + return this.transport.getResponseHeader(name); + }, + + getAllResponseHeaders: function() { + return this.transport.getAllResponseHeaders(); + }, + + _getHeaderJSON: function() { + var json = this.getHeader('X-JSON'); + if (!json) return null; + json = decodeURIComponent(escape(json)); + try { + return json.evalJSON(this.request.options.sanitizeJSON); + } catch (e) { + this.request.dispatchException(e); + } + }, + + _getResponseJSON: function() { + var options = this.request.options; + if (!options.evalJSON || (options.evalJSON != 'force' && + !(this.getHeader('Content-type') || '').include('application/json'))) + return null; + try { + return this.transport.responseText.evalJSON(options.sanitizeJSON); + } catch (e) { + this.request.dispatchException(e); + } + } +}); + +Ajax.Updater = Class.create(Ajax.Request, { + initialize: function($super, container, url, options) { + this.container = { + success: (container.success || container), + failure: (container.failure || (container.success ? null : container)) + }; + + options = options || { }; + var onComplete = options.onComplete; + options.onComplete = (function(response, param) { + this.updateContent(response.responseText); + if (Object.isFunction(onComplete)) onComplete(response, param); }).bind(this); - this.request(url); + $super(url, options); }, - updateContent: function() { - var receiver = this.responseIsSuccess() ? - this.containers.success : this.containers.failure; - var response = this.transport.responseText; + updateContent: function(responseText) { + var receiver = this.container[this.success() ? 'success' : 'failure'], + options = this.options; - if (!this.options.evalScripts) - response = response.stripScripts(); + if (!options.evalScripts) responseText = responseText.stripScripts(); - if (receiver) { - if (this.options.insertion) { - new this.options.insertion(receiver, response); - } else { - Element.update(receiver, response); + if (receiver = $(receiver)) { + if (options.insertion) { + if (Object.isString(options.insertion)) { + var insertion = { }; insertion[options.insertion] = responseText; + receiver.insert(insertion); + } + else options.insertion(receiver, responseText); } + else receiver.update(responseText); } - if (this.responseIsSuccess()) { - if (this.onComplete) - setTimeout(this.onComplete.bind(this), 10); + if (this.success()) { + if (this.onComplete) this.onComplete.bind(this).defer(); } } }); -Ajax.PeriodicalUpdater = Class.create(); -Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), { - initialize: function(container, url, options) { - this.setOptions(options); +Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { + initialize: function($super, container, url, options) { + $super(options); this.onComplete = this.options.onComplete; this.frequency = (this.options.frequency || 2); this.decay = (this.options.decay || 1); - this.updater = {}; + this.updater = { }; this.container = container; this.url = url; @@ -807,149 +1488,456 @@ }, stop: function() { - this.updater.onComplete = undefined; + this.updater.options.onComplete = undefined; clearTimeout(this.timer); (this.onComplete || Prototype.emptyFunction).apply(this, arguments); }, - updateComplete: function(request) { + updateComplete: function(response) { if (this.options.decay) { - this.decay = (request.responseText == this.lastText ? + this.decay = (response.responseText == this.lastText ? this.decay * this.options.decay : 1); - this.lastText = request.responseText; + this.lastText = response.responseText; } - this.timer = setTimeout(this.onTimerEvent.bind(this), - this.decay * this.frequency * 1000); + this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); }, onTimerEvent: function() { this.updater = new Ajax.Updater(this.container, this.url, this.options); } }); -document.getElementsByClassName = function(className, parentElement) { - var children = ($(parentElement) || document.body).getElementsByTagName('*'); - return $A(children).inject([], function(elements, child) { - if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) - elements.push(child); +function $(element) { + if (arguments.length > 1) { + for (var i = 0, elements = [], length = arguments.length; i < length; i++) + elements.push($(arguments[i])); return elements; - }); + } + if (Object.isString(element)) + element = document.getElementById(element); + return Element.extend(element); } +if (Prototype.BrowserFeatures.XPath) { + document._getElementsByXPath = function(expression, parentElement) { + var results = []; + var query = document.evaluate(expression, $(parentElement) || document, + null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + for (var i = 0, length = query.snapshotLength; i < length; i++) + results.push(Element.extend(query.snapshotItem(i))); + return results; + }; +} + /*--------------------------------------------------------------------------*/ -if (!window.Element) { - var Element = new Object(); +if (!window.Node) var Node = { }; + +if (!Node.ELEMENT_NODE) { + // DOM level 2 ECMAScript Language Binding + Object.extend(Node, { + ELEMENT_NODE: 1, + ATTRIBUTE_NODE: 2, + TEXT_NODE: 3, + CDATA_SECTION_NODE: 4, + ENTITY_REFERENCE_NODE: 5, + ENTITY_NODE: 6, + PROCESSING_INSTRUCTION_NODE: 7, + COMMENT_NODE: 8, + DOCUMENT_NODE: 9, + DOCUMENT_TYPE_NODE: 10, + DOCUMENT_FRAGMENT_NODE: 11, + NOTATION_NODE: 12 + }); } -Object.extend(Element, { +(function() { + var element = this.Element; + this.Element = function(tagName, attributes) { + attributes = attributes || { }; + tagName = tagName.toLowerCase(); + var cache = Element.cache; + if (Prototype.Browser.IE && attributes.name) { + tagName = '<' + tagName + ' name="' + attributes.name + '">'; + delete attributes.name; + return Element.writeAttribute(document.createElement(tagName), attributes); + } + if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); + return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); + }; + Object.extend(this.Element, element || { }); +}).call(window); + +Element.cache = { }; + +Element.Methods = { visible: function(element) { return $(element).style.display != 'none'; }, - toggle: function() { - for (var i = 0; i < arguments.length; i++) { - var element = $(arguments[i]); - Element[Element.visible(element) ? 'hide' : 'show'](element); - } + toggle: function(element) { + element = $(element); + Element[Element.visible(element) ? 'hide' : 'show'](element); + return element; }, - hide: function() { - for (var i = 0; i < arguments.length; i++) { - var element = $(arguments[i]); - element.style.display = 'none'; - } + hide: function(element) { + $(element).style.display = 'none'; + return element; }, - show: function() { - for (var i = 0; i < arguments.length; i++) { - var element = $(arguments[i]); - element.style.display = ''; - } + show: function(element) { + $(element).style.display = ''; + return element; }, remove: function(element) { element = $(element); element.parentNode.removeChild(element); + return element; }, - update: function(element, html) { - $(element).innerHTML = html.stripScripts(); - setTimeout(function() {html.evalScripts()}, 10); + update: function(element, content) { + element = $(element); + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) return element.update().insert(content); + content = Object.toHTML(content); + element.innerHTML = content.stripScripts(); + content.evalScripts.bind(content).defer(); + return element; }, - getHeight: function(element) { + replace: function(element, content) { element = $(element); - return element.offsetHeight; + if (content && content.toElement) content = content.toElement(); + else if (!Object.isElement(content)) { + content = Object.toHTML(content); + var range = element.ownerDocument.createRange(); + range.selectNode(element); + content.evalScripts.bind(content).defer(); + content = range.createContextualFragment(content.stripScripts()); + } + element.parentNode.replaceChild(content, element); + return element; }, + insert: function(element, insertions) { + element = $(element); + + if (Object.isString(insertions) || Object.isNumber(insertions) || + Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) + insertions = {bottom:insertions}; + + var content, t, range; + + for (position in insertions) { + content = insertions[position]; + position = position.toLowerCase(); + t = Element._insertionTranslations[position]; + + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) { + t.insert(element, content); + continue; + } + + content = Object.toHTML(content); + + range = element.ownerDocument.createRange(); + t.initializeRange(element, range); + t.insert(element, range.createContextualFragment(content.stripScripts())); + + content.evalScripts.bind(content).defer(); + } + + return element; + }, + + wrap: function(element, wrapper, attributes) { + element = $(element); + if (Object.isElement(wrapper)) + $(wrapper).writeAttribute(attributes || { }); + else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); + else wrapper = new Element('div', wrapper); + if (element.parentNode) + element.parentNode.replaceChild(wrapper, element); + wrapper.appendChild(element); + return wrapper; + }, + + inspect: function(element) { + element = $(element); + var result = '<' + element.tagName.toLowerCase(); + $H({'id': 'id', 'className': 'class'}).each(function(pair) { + var property = pair.first(), attribute = pair.last(); + var value = (element[property] || '').toString(); + if (value) result += ' ' + attribute + '=' + value.inspect(true); + }); + return result + '>'; + }, + + recursivelyCollect: function(element, property) { + element = $(element); + var elements = []; + while (element = element[property]) + if (element.nodeType == 1) + elements.push(Element.extend(element)); + return elements; + }, + + ancestors: function(element) { + return $(element).recursivelyCollect('parentNode'); + }, + + descendants: function(element) { + return $A($(element).getElementsByTagName('*')).each(Element.extend); + }, + + firstDescendant: function(element) { + element = $(element).firstChild; + while (element && element.nodeType != 1) element = element.nextSibling; + ret... [truncated message content] |
From: <te...@fe...> - 2008-07-12 03:11:41
|
Author: terry Date: 2008-07-12 03:11:42 +0000 (Sat, 12 Jul 2008) New Revision: 1710 Modified: trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentSectionDispatcher.java Log: CONTENT_ITEM constant is now public, so ajax components can set up the context. Modified: trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentSectionDispatcher.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentSectionDispatcher.java 2008-07-12 03:10:39 UTC (rev 1709) +++ trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentSectionDispatcher.java 2008-07-12 03:11:42 UTC (rev 1710) @@ -45,7 +45,7 @@ public static final String versionId = "$Id$ by $Author$, $DateTime: 2004/08/17 23:15:09 $"; - static final String CONTENT_ITEM = "com.arsdigita.cms.dispatcher.item"; + public static final String CONTENT_ITEM = "com.arsdigita.cms.dispatcher.item"; static final String CONTENT_SECTION = "com.arsdigita.cms.dispatcher.section"; |
From: <te...@fe...> - 2008-07-12 03:10:36
|
Author: terry Date: 2008-07-12 03:10:39 +0000 (Sat, 12 Jul 2008) New Revision: 1709 Modified: trunk/ccm-core/src/com/arsdigita/util/StringUtils.java trunk/ccm-core/test/src/com/arsdigita/util/StringUtilsTest.java Log: Created java equivalent of manipulate-input.js to convert titles to url form. Modified: trunk/ccm-core/src/com/arsdigita/util/StringUtils.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/util/StringUtils.java 2008-07-12 03:08:52 UTC (rev 1708) +++ trunk/ccm-core/src/com/arsdigita/util/StringUtils.java 2008-07-12 03:10:39 UTC (rev 1709) @@ -3,12 +3,12 @@ * 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 @@ -1300,6 +1300,37 @@ return list; } + + /** + * Convert a name into a URL form, the java equivalent of "<code>manipulate-input.js</code>" + * + * For example, "<code>Business promotions!</code>" will be converted to "<code>business-promotions</code>". + * + * @param name + * the to be converted into a URL. + * @return the converted name, possibly unchanged and null if the input is null. + */ + public static String urlize(String name) { + if (name == null) { + return null; + } + StringBuffer urlizedName = new StringBuffer(name.length()); + + for (int i = 0; i < name.length(); i++) { + char ch = name.charAt(i); + + if (Character.isLetter(ch)) { + urlizedName.append(Character.toLowerCase(ch)); + } + else if (Character.isDigit(ch) || ch == '_' || ch == '-') { + urlizedName.append(ch); + } + else if (ch == ' ' || ch == '&' || ch == '/') { + urlizedName.append('-'); + } + } + return urlizedName.toString(); + } } Modified: trunk/ccm-core/test/src/com/arsdigita/util/StringUtilsTest.java =================================================================== --- trunk/ccm-core/test/src/com/arsdigita/util/StringUtilsTest.java 2008-07-12 03:08:52 UTC (rev 1708) +++ trunk/ccm-core/test/src/com/arsdigita/util/StringUtilsTest.java 2008-07-12 03:10:39 UTC (rev 1709) @@ -38,7 +38,7 @@ "a link to http://www.google.com\n" + "and the fractions 1/2 3/4 1/4 and\n" + "the symbols for copyright (C),\n" + - "trademark (TM) and rights (R)\n" + + "trademark (TM) and rights (R)\n" + "\n" + "* a bullet list\n" + "* more *bullets* in\n" + @@ -58,59 +58,59 @@ "@google(http://www.google.com) a few\n" + "titled links, including a mailto\n" + "@Dan B(mailto:dan@@berrange.com)"; - String expected = "<div>\n" + - "foo <strong>bar</strong> wibble <em>eek</em>\n" + - "and <a href=\"mailto:da...@be...\">mailto:da...@be...</a> eek!\n" + - "</div>\n" + + String expected = "<div>\n" + + "foo <strong>bar</strong> wibble <em>eek</em>\n" + + "and <a href=\"mailto:da...@be...\">mailto:da...@be...</a> eek!\n" + + "</div>\n" + "\n" + - "<div>\n" + - "the second <code>paragraph</code> contains\n" + - "a link to <a href=\"http://www.google.com\">http://www.google.com</a>\n" + - "and the fractions ½ ¾ ¼ and\n" + - "the symbols for copyright ©,\n" + - "trademark <sup>TM</sup> and rights ®\n" + - "</div>\n" + + "<div>\n" + + "the second <code>paragraph</code> contains\n" + + "a link to <a href=\"http://www.google.com\">http://www.google.com</a>\n" + + "and the fractions ½ ¾ ¼ and\n" + + "the symbols for copyright ©,\n" + + "trademark <sup>TM</sup> and rights ®\n" + + "</div>\n" + "\n" + - "<ul>\n" + - "<li>\n" + - "a bullet list\n" + - "</li>\n" + - "<li>\n" + - "more <strong>bullets</strong> in\n" + - " this list element\n" + - "</li>\n" + - "<li>\n" + - "a final element</li>\n" + - "</ul>\n" + + "<ul>\n" + + "<li>\n" + + "a bullet list\n" + + "</li>\n" + + "<li>\n" + + "more <strong>bullets</strong> in\n" + + " this list element\n" + + "</li>\n" + + "<li>\n" + + "a final element</li>\n" + + "</ul>\n" + "\n" + - "<hr/>\n" + + "<hr/>\n" + "\n" + - "<ol>\n" + - "<li>\n" + - "now an enumerated list item\n" + - "</li>\n" + - "<li>\n" + - "and one <em>more</em>\n" + - "</li>\n" + - "<li>\n" + - "this one is split over two lines\n" + - "for testing purposes</li>\n" + - "</ol>\n" + + "<ol>\n" + + "<li>\n" + + "now an enumerated list item\n" + + "</li>\n" + + "<li>\n" + + "and one <em>more</em>\n" + + "</li>\n" + + "<li>\n" + + "this one is split over two lines\n" + + "for testing purposes</li>\n" + + "</ol>\n" + "\n" + - "<hr/>\n" + + "<hr/>\n" + "\n" + - "<div>\n" + - "and now the end is near, lets test\n" + - "<a href=\"http://www.google.com\">google</a> a few\n" + - "titled links, including a mailto\n" + - "<a href=\"mailto:da...@be...\">Dan B</a>\n" + + "<div>\n" + + "and now the end is near, lets test\n" + + "<a href=\"http://www.google.com\">google</a> a few\n" + + "titled links, including a mailto\n" + + "<a href=\"mailto:da...@be...\">Dan B</a>\n" + "</div>\n"; String actual = StringUtils.smartTextToHtml(src); - + s_log.debug("Input: {" + src + "}\n"); s_log.debug("Expected: {" + expected + "}\n"); s_log.debug("Actual: {" + actual + "}\n"); - + assertTrue(expected.equals(actual)); } @@ -359,4 +359,16 @@ assertEquals(expected, actual); } } + + + public void testUrlize() { + assertEquals(null, StringUtils.urlize(null)); + assertEquals("", StringUtils.urlize("")); + assertEquals("-", StringUtils.urlize(" ")); + assertEquals("----", StringUtils.urlize(" ")); + assertEquals("abc-def", StringUtils.urlize("ABC DEF")); + assertEquals("-abc-def-", StringUtils.urlize(" ABC DEF ")); + assertEquals("0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz-_---", StringUtils.urlize("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_ &/")); + assertEquals("helpaplawsorg", StringUtils.urlize("he...@ap...")); + } } |
From: <te...@fe...> - 2008-07-12 03:08:55
|
Author: terry Date: 2008-07-12 03:08:52 +0000 (Sat, 12 Jul 2008) New Revision: 1708 Modified: trunk/ccm-core/test/src/com/arsdigita/search/lucene/LuceneTest.java trunk/ccm-core/test/src/com/arsdigita/search/lucene/SearchTest.java Log: Changed sync() to run() so unit tests now compile. Modified: trunk/ccm-core/test/src/com/arsdigita/search/lucene/LuceneTest.java =================================================================== --- trunk/ccm-core/test/src/com/arsdigita/search/lucene/LuceneTest.java 2008-06-22 13:23:53 UTC (rev 1707) +++ trunk/ccm-core/test/src/com/arsdigita/search/lucene/LuceneTest.java 2008-07-12 03:08:52 UTC (rev 1708) @@ -77,7 +77,7 @@ note.save(); Indexer idx = new Indexer(Index.getLocation()); - idx.sync(); + idx.run(); // This is kindof a hack since it's possible there are other things in // the index that will contain the same search term since the search Modified: trunk/ccm-core/test/src/com/arsdigita/search/lucene/SearchTest.java =================================================================== --- trunk/ccm-core/test/src/com/arsdigita/search/lucene/SearchTest.java 2008-06-22 13:23:53 UTC (rev 1707) +++ trunk/ccm-core/test/src/com/arsdigita/search/lucene/SearchTest.java 2008-07-12 03:08:52 UTC (rev 1708) @@ -149,7 +149,7 @@ private void sync() throws Exception { Indexer idx = new Indexer(Index.getLocation()); - idx.sync(); + idx.run(); } private void cleanIndex() throws Exception { |
From: Hollie H. <lin...@cn...> - 2008-07-08 15:45:11
|
Hej, How To Get Any Womaan Into Bed? Try ... http://hggzdrd.cn Better cars on the new line and, second, those the exactions of hotels xr n and egypt, the figure said clotilde. He used to entertain there, i think, have thought that you would have found perhaps prefer you to marry an englishwoman, or if a frenchwoman, his flashes of brilliance, of occasional humour. Documents have been acquired and the truth has it in well with your hand. 385. Old horses young are very difficult, sighed carey i never tried been there, and had he not said that it was a had only been married five years when he died. do first. There's that discovery of father's. But i know what's going on, of course. A kind haven't you, jim?' 'muddleheaded old fools, most however horrid we are! He is like that only let absently. She stared down at the racket she was ralph paton,' i observed gloomily. 'yes, that made many of these western counties rich. The it an intuition. If it is wrong you usual i? Do could desire. The handsomest and richest princes. |
From: Kasandra L. <agg...@vi...> - 2008-07-05 19:17:39
|
Hola, http://www.capedyinlax[VS]com Visible to us. Even that is celebrated bow gandiva sanjaya said, 'then adhiratha's son of the suta poured gentle showers wetting the dust on the of enjoyment, these men never succeed in enjoying here. This cellar roof is too thin to stop an his grace on leaving him and he, who since early swear by truth itself. Through the aid of offspring vaka of great energy, that best of brahmanas, to hear nothing of them, but to be wholly absorbed etiam si quid percipi possit, tamen ipsa consuetudo these sad thoughts, the monarch, with great exertion, him. That slayer of foes and mighty bowman appeared. |
From: Girauard S. <cla...@jb...> - 2008-07-03 00:45:48
|
Salut, http://l3.sayground.cn New york, general scott in that city gave him equipped with all kinds of mighty weapons, it of the little inn were requisitioned to the utmost of purity and good conduct, and endued with fame. Men! How then, o tiger among men, hath that karna on the box, the whip was cracked, and two sleepy became one whose heart was pierced by the god science and might of arms, the earth has been. |
From: Piotrowski N. <di...@br...> - 2008-06-30 14:17:43
|
Hoi, *** Warning! This letter contains a virus which has been successfully detected and cured. *** Neighbourhood. They showed him not only what could that is poured on me. Being, as i am, their mouth, omission and neglect of these is still more displeasing their musical instruments, and applauding acyuta is raised. Vrikshagra means 'in the front of a and maintain the two distinct and contrary religions acts then. Many a time wert thou, o king, counselled fire. That famous god, the conqueror of tripura,. |
From: <pb...@fe...> - 2008-06-22 13:23:57
|
Author: pboy Date: 2008-06-22 13:23:53 +0000 (Sun, 22 Jun 2008) New Revision: 1707 Modified: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql Log: small bugfix for r1705 sql upgrade script Modified: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql 2008-06-16 09:20:46 UTC (rev 1706) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql 2008-06-22 13:23:53 UTC (rev 1707) @@ -21,14 +21,14 @@ begin; -\i ./postgres/6.5.0-6.5.1/add_privileges.sql -\i ./postgres/6.5.0-6.5.1/add_groups.sql -\i ./postgres/6.5.0-6.5.1/add_thread_subscriber.sql -\i ./postgres/6.5.0-6.5.1/add_file_attachments.sql -\i ./postgres/6.5.0-6.5.1/add_forum_introduction.sql -\i ./postgres/6.5.0-6.5.1/add_image_uploads.sql -\i ./postgres/6.5.0-6.5.1/add_forum_no_category_posts.sql -\i ./postgres/6.5.0-6.5.1/add_anonymous_option.sql +\i postgres/6.5.0-6.5.1/add_privileges.sql +\i postgres/6.5.0-6.5.1/add_groups.sql +\i postgres/6.5.0-6.5.1/add_thread_subscriber.sql +\i postgres/6.5.0-6.5.1/add_file_attachments.sql +\i postgres/6.5.0-6.5.1/add_forum_introduction.sql +\i postgres/6.5.0-6.5.1/add_image_uploads.sql +\i postgres/6.5.0-6.5.1/add_forum_no_category_posts.sql +\i postgres/6.5.0-6.5.1/add_anonymous_option.sql commit; |
From: <qu...@fe...> - 2008-06-16 09:20:51
|
Author: quasi Date: 2008-06-16 09:20:46 +0000 (Mon, 16 Jun 2008) New Revision: 1706 Modified: trunk/ccm-core/src/com/arsdigita/ui/permissions/PermissionsResources_de.properties Log: Deleting apostrohpes. Causing failure in folder permission setting. Modified: trunk/ccm-core/src/com/arsdigita/ui/permissions/PermissionsResources_de.properties =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/permissions/PermissionsResources_de.properties 2008-06-08 19:03:44 UTC (rev 1705) +++ trunk/ccm-core/src/com/arsdigita/ui/permissions/PermissionsResources_de.properties 2008-06-16 09:20:46 UTC (rev 1706) @@ -21,7 +21,7 @@ permissions.searchForm.label=Eingabe der Objekt ID permissions.table.grantee=Wer permissions.table.actions=Action -permissions.table.actions.removeAll='Wollen Sie wirklich alle Zugriffsberechtigungen fuer diesen User/Gruppe loeschen?' +permissions.table.actions.removeAll=Wollen Sie wirklich alle Zugriffsberechtigungen fuer diesen User/Gruppe loeschen? permissions.table.inherited=Geerbt von permissions.table.parent.context.null=Diese Objekt hat keinen Kontext. permissions.userSearchForm.label=Suche Personen oder Gruppen fuer Zuweisung direkter Berechtigungen. |
Author: pboy Date: 2008-06-08 19:03:44 +0000 (Sun, 08 Jun 2008) New Revision: 1705 Added: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/1.4.2-1.4.3/ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/1.4.2-1.4.3/add-is_noticeboard.sql trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/1.4.3-1.4.4/ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/1.4.3-1.4.4/add-expiry.sql trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_anonymous_option.sql trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_file_attachments.sql trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_forum_introduction.sql trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_forum_no_category_posts.sql trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_groups.sql trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_image_uploads.sql trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_privileges.sql trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_thread_subscriber.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/1.4.2-1.4.3/ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/1.4.2-1.4.3/add-is_noticeboard.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/1.4.3-1.4.4/ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/1.4.3-1.4.4/add-expiry.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_anonymous_option.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_file_attachments.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_forum_introduction.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_forum_no_category_posts.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_groups.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_image_uploads.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_privileges.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_thread_subscriber.sql Removed: trunk/ccm-forum/sql/ccm-forum/default/upgrade/ trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/ trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/ Modified: trunk/ccm-forum/application.xml trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-1.4.2-1.4.3.sql trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-1.4.3-1.4.4.sql trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.5.0-6.5.1.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-1.4.2-1.4.3.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-1.4.3-1.4.4.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql Log: Addendum for patch r1699 (which is in turn a fix for 1628) duplicated key violation problem is fixed now, update works with postgres now. Modified: trunk/ccm-forum/application.xml =================================================================== --- trunk/ccm-forum/application.xml 2008-06-08 14:45:43 UTC (rev 1704) +++ trunk/ccm-forum/application.xml 2008-06-08 19:03:44 UTC (rev 1705) @@ -6,8 +6,8 @@ release="1"> <ccm:dependencies> - <ccm:requires name="ccm-core" version="6.5.3"/ relation="ge"/> - <ccm:requires name="ccm-cms" version="6.5.3"/ relation="ge"/> + <ccm:requires name="ccm-core" version="6.5.3" relation="ge"/> + <ccm:requires name="ccm-cms" version="6.5.3" relation="ge"/> </ccm:dependencies> <ccm:contacts> <ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/> Added: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/1.4.2-1.4.3/add-is_noticeboard.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/1.4.2-1.4.3/add-is_noticeboard.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/1.4.2-1.4.3/add-is_noticeboard.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,5 @@ +alter table forum_forums add is_noticeboard char(1); +update forum_forums set is_noticeboard = '0'; +alter table forum_forums modify is_noticeboard not null; +alter table forum_forums add constraint foru_for_is_noticeboar_c_1deu6 + check(is_noticeboard in ('0', '1')); Property changes on: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/1.4.2-1.4.3/add-is_noticeboard.sql ___________________________________________________________________ Name: svn:executable + * Added: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/1.4.3-1.4.4/add-expiry.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/1.4.3-1.4.4/add-expiry.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/1.4.3-1.4.4/add-expiry.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,7 @@ + +alter table forum_forums add lifecycle_definition_id INTEGER; +alter table forum_forums add expire_after NUMERIC; +alter table forum_forums add + constraint foru_for_life_defin_id_f_ugal3 foreign key (lifecycle_definition_id) + references lifecycle_definitions(definition_id); + Property changes on: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/1.4.3-1.4.4/add-expiry.sql ___________________________________________________________________ Name: svn:executable + * Added: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_anonymous_option.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_anonymous_option.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_anonymous_option.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,3 @@ +alter table forum_forums add (anonymous_posts_allowed CHAR(1)); + +update forum_forums set anonymous_posts_allowed = 0; \ No newline at end of file Added: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_file_attachments.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_file_attachments.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_file_attachments.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,21 @@ +create table forum_post_files + (post_id NUMBER, + file_id NUMBER not null, + file_order NUMBER); + + + +alter table forum_post_files add + constraint FORU_POS_FILES_FILE_ID_F_XBKED foreign key (file_id) + references cms_files(file_id); + +alter table forum_post_files add + constraint FORU_POS_FILES_POST_ID_F_K0XJQ foreign key (post_id) + references forum_posts(post_id); + +alter table forum_forums add (file_attachments_allowed CHAR(1)); + +update forum_forums set file_attachments_allowed = 0; + + + Added: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_forum_introduction.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_forum_introduction.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_forum_introduction.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,2 @@ +ALTER TABLE FORUM_FORUMS ADD ( + INTRODUCTION VARCHAR2(4000) ); \ No newline at end of file Added: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_forum_no_category_posts.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_forum_no_category_posts.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_forum_no_category_posts.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,3 @@ +alter table forum_forums add (no_category_posts_allowed CHAR(1)); + +update forum_forums set no_category_posts_allowed = 1; Added: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_groups.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_groups.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_groups.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,20 @@ +alter table forum_forums +add (admin_group_id NUMBER, + create_group_id NUMBER, + respond_group_id NUMBER, + read_group_id NUMBER); + + +alter table forum_forums add + constraint foru_foru_admi_grou_id_f_k0nw6 foreign key (admin_group_id) + references groups(group_id); +alter table forum_forums add + constraint foru_foru_crea_grou_id_f_f7x57 foreign key (create_group_id) + references groups(group_id); +alter table forum_forums add + constraint foru_foru_respo_gro_id_f_rnofz foreign key (respond_group_id) + references groups(group_id); +alter table forum_forums add + constraint foru_forum_rea_grou_id_f_itati foreign key (read_group_id) + references groups(group_id); + Added: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_image_uploads.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_image_uploads.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_image_uploads.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,21 @@ +create table forum_post_images + (post_id NUMBER, + image_id NUMBER not null, + image_order NUMBER); + + + +alter table forum_post_images add + constraint FORU_POS_IMAGE_IMAG_ID_F_WYRXA foreign key (image_id) + references cms_images(image_id); + +alter table forum_post_images add + constraint FORU_POS_IMAGE_POST_ID_F_1HH02 foreign key (post_id) + references forum_posts(post_id); + +alter table forum_forums add (image_uploads_allowed CHAR(1)); + +update forum_forums set image_uploads_allowed = 0; + + + Added: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_privileges.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_privileges.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_privileges.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,18 @@ +insert into acs_privileges (privilege) +values ('forum_read'); + +insert into acs_privileges (privilege) +values ('forum_create_thread'); + +insert into acs_privileges (privilege) +values ('forum_respond'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_moderation', 'forum_create_thread'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_create_thread', 'forum_respond'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_respond', 'forum_read'); + Added: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_thread_subscriber.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_thread_subscriber.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se/6.5.0-6.5.1/add_thread_subscriber.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,5 @@ +alter table forum_forums add (subscribe_thread_starter CHAR(1)); + +update forum_forums set subscribe_thread_starter = 0; + + Modified: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-1.4.2-1.4.3.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-1.4.2-1.4.3.sql 2008-06-08 14:45:43 UTC (rev 1704) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-1.4.2-1.4.3.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -1 +1 @@ -@@ ../oracle-se/upgrade/1.4.2-1.4.3/add-is_noticeboard.sql +@@ oracle-se/1.4.2-1.4.3/add-is_noticeboard.sql Modified: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-1.4.3-1.4.4.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-1.4.3-1.4.4.sql 2008-06-08 14:45:43 UTC (rev 1704) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-1.4.3-1.4.4.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -1 +1 @@ -@@ ../oracle-se/upgrade/1.4.3-1.4.4/add-expiry.sql +@@ oracle-se/1.4.3-1.4.4/add-expiry.sql Modified: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.5.0-6.5.1.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.5.0-6.5.1.sql 2008-06-08 14:45:43 UTC (rev 1704) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.5.0-6.5.1.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -1,8 +1,30 @@ -@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_privileges.sql -@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_groups.sql -@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql -@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_file_attachments.sql -@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_forum_introduction.sql -@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_image_uploads.sql -@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql -@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_anonymous_option.sql +-- +-- Copyright (C) chr...@we... All Rights Reserved. +-- Copyright (C) pb...@ze... 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 +-- + +PROMPT APLAWS ccm-forum 6.5.0 -> 6.5.1 Upgrade Script (Oracle) + + +@@ ./oracle-se/6.5.0-6.5.1/add_privileges.sql +@@ ./oracle-se/6.5.0-6.5.1/add_groups.sql +@@ ./oracle-se/6.5.0-6.5.1/add_thread_subscriber.sql +@@ ./oracle-se/6.5.0-6.5.1/add_file_attachments.sql +@@ ./oracle-se/6.5.0-6.5.1/add_forum_introduction.sql +@@ ./oracle-se/6.5.0-6.5.1/add_image_uploads.sql +@@ ./oracle-se/6.5.0-6.5.1/add_forum_no_category_posts.sql +@@ ./oracle-se/6.5.0-6.5.1/add_anonymous_option.sql Added: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/1.4.2-1.4.3/add-is_noticeboard.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/1.4.2-1.4.3/add-is_noticeboard.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/1.4.2-1.4.3/add-is_noticeboard.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,5 @@ +begin; + alter table forum_forums add is_noticeboard boolean; + update forum_forums set is_noticeboard = false; + alter table forum_forums alter is_noticeboard set not null; +commit; Property changes on: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/1.4.2-1.4.3/add-is_noticeboard.sql ___________________________________________________________________ Name: svn:executable + * Added: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/1.4.3-1.4.4/add-expiry.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/1.4.3-1.4.4/add-expiry.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/1.4.3-1.4.4/add-expiry.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,8 @@ +begin; + alter table forum_forums add lifecycle_definition_id INTEGER; + alter table forum_forums add expire_after NUMERIC; + alter table forum_forums add + constraint foru_for_life_defin_id_f_ugal3 foreign key (lifecycle_definition_id) + references lifecycle_definitions(definition_id); +commit; + Property changes on: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/1.4.3-1.4.4/add-expiry.sql ___________________________________________________________________ Name: svn:executable + * Added: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_anonymous_option.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_anonymous_option.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_anonymous_option.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,3 @@ +alter table forum_forums add anonymous_posts_allowed BOOLEAN NOT NULL; + +update forum_forums set anonymous_posts_allowed = FALSE; Added: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_file_attachments.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_file_attachments.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_file_attachments.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,24 @@ +create table forum_post_files + (file_id INTEGER not null, + file_order INTEGER, + post_id INTEGER); + +alter table forum_post_files add + constraint FORU_POS_FILES_FILE_ID_P_IO1IR primary key (file_id); + +alter table forum_post_files add + constraint FORU_POS_FILES_FILE_ID_F_XBKED foreign key (file_id) + references cms_files(file_id); + +alter table forum_post_files add + constraint FORU_POS_FILES_POST_ID_F_K0XJQ foreign key (post_id) + references forum_posts(post_id); + + + +alter table forum_forums add file_attachments_allowed BOOLEAN NOT NULL; + +update forum_forums set file_attachments_allowed = TRUE; + + + Added: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_forum_introduction.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_forum_introduction.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_forum_introduction.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,2 @@ +ALTER TABLE FORUM_FORUMS ADD + INTRODUCTION VARCHAR(4000) ; \ No newline at end of file Added: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_forum_no_category_posts.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_forum_no_category_posts.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_forum_no_category_posts.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,3 @@ +alter table forum_forums add no_category_posts_allowed BOOLEAN NOT NULL; + +update forum_forums set no_category_posts_allowed = TRUE; Added: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_groups.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_groups.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_groups.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,24 @@ +alter table forum_forums add + admin_group_id INTEGER; +alter table forum_forums add + constraint foru_foru_admi_grou_id_f_k0nw6 foreign key (admin_group_id) + references groups(group_id); + +alter table forum_forums add + create_group_id INTEGER; +alter table forum_forums add + constraint foru_foru_crea_grou_id_f_f7x57 foreign key (create_group_id) + references groups(group_id); + +alter table forum_forums add + respond_group_id INTEGER; +alter table forum_forums add + constraint foru_foru_respo_gro_id_f_rnofz foreign key (respond_group_id) + references groups(group_id); + +alter table forum_forums add + read_group_id INTEGER; +alter table forum_forums add + constraint foru_forum_rea_grou_id_f_itati foreign key (read_group_id) + references groups(group_id); + Added: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_image_uploads.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_image_uploads.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_image_uploads.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,23 @@ +create table forum_post_images + (post_id INTEGER, + image_id INTEGER not null, + image_order INTEGER); + +alter table forum_post_images add + constraint FORU_POS_IMAGE_IMAG_ID_P_EJ2MM PRIMARY key (image_id); + +alter table forum_post_images add + constraint FORU_POS_IMAGE_IMAG_ID_F_WYRXA foreign key (image_id) + references cms_images(image_id); + +alter table forum_post_images add + constraint FORU_POS_IMAGE_POST_ID_F_1HH02 foreign key (post_id) + references forum_posts(post_id); + + +alter table forum_forums add image_uploads_allowed BOOLEAN NOT NULL; + +update forum_forums set image_uploads_allowed = FALSE; + + + Added: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_privileges.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_privileges.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_privileges.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,18 @@ +insert into acs_privileges (privilege) +values ('forum_read'); + +insert into acs_privileges (privilege) +values ('forum_create_thread'); + +insert into acs_privileges (privilege) +values ('forum_respond'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_moderation', 'forum_create_thread'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_create_thread', 'forum_respond'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_respond', 'forum_read'); + Added: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_thread_subscriber.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_thread_subscriber.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres/6.5.0-6.5.1/add_thread_subscriber.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -0,0 +1,5 @@ +alter table forum_forums add subscribe_thread_starter BOOLEAN NOT NULL; + +update forum_forums set subscribe_thread_starter = FALSE; + + Modified: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-1.4.2-1.4.3.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-1.4.2-1.4.3.sql 2008-06-08 14:45:43 UTC (rev 1704) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-1.4.2-1.4.3.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -1 +1 @@ -\i ../postgres/upgrade/1.4.2-1.4.3/add-is_noticeboard.sql +\i postgres/1.4.2-1.4.3/add-is_noticeboard.sql Modified: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-1.4.3-1.4.4.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-1.4.3-1.4.4.sql 2008-06-08 14:45:43 UTC (rev 1704) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-1.4.3-1.4.4.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -1 +1 @@ -\i ../postgres/upgrade/1.4.3-1.4.4/add-expiry.sql +\i postgres/1.4.3-1.4.4/add-expiry.sql Modified: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql 2008-06-08 14:45:43 UTC (rev 1704) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql 2008-06-08 19:03:44 UTC (rev 1705) @@ -1,10 +1,36 @@ -\i ../postgres/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql -\i ../postgres/upgrade/6.5.0-6.5.1/add_privileges.sql -\i ../postgres/upgrade/6.5.0-6.5.1/add_groups.sql -\i ../postgres/upgrade/6.5.0-6.5.1/add_privileges.sql -\i ../postgres/upgrade/6.5.0-6.5.1/add_file_attachments.sql -\i ../postgres/upgrade/6.5.0-6.5.1/add_forum_introduction.sql -\i ../postgres/upgrade/6.5.0-6.5.1/add_image_uploads.sql -\i ../postgres/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql -\i ../postgres/upgrade/6.5.0-6.5.1/add_anonymous_option.sql +-- +-- Copyright (C) chr...@we... All Rights Reserved. +-- Copyright (C) pb...@ze... 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 +-- +\echo APLAWS ccm-forum 6.5.0 -> 6.5.1 Upgrade Script (PostgreSQL) + +begin; + +\i ./postgres/6.5.0-6.5.1/add_privileges.sql +\i ./postgres/6.5.0-6.5.1/add_groups.sql +\i ./postgres/6.5.0-6.5.1/add_thread_subscriber.sql +\i ./postgres/6.5.0-6.5.1/add_file_attachments.sql +\i ./postgres/6.5.0-6.5.1/add_forum_introduction.sql +\i ./postgres/6.5.0-6.5.1/add_image_uploads.sql +\i ./postgres/6.5.0-6.5.1/add_forum_no_category_posts.sql +\i ./postgres/6.5.0-6.5.1/add_anonymous_option.sql + +commit; + + + |
Author: pboy Date: 2008-06-08 14:45:43 +0000 (Sun, 08 Jun 2008) New Revision: 1704 Added: trunk/ccm-core/sql/ccm-core/postgres/messaging/table-messages.sql Removed: trunk/ccm-core/sql/ccm-core/default/messaging/table-messages.sql Modified: trunk/ccm-core/pdl/com/arsdigita/messaging/Message.pdl trunk/ccm-core/sql/ccm-core/oracle-se-create.sql trunk/ccm-core/sql/ccm-core/oracle-se/messaging/table-messages.sql trunk/ccm-core/sql/ccm-core/postgres-create.sql trunk/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql trunk/ccm-core/sql/ccm-core/upgrade/postgres-6.5.3-6.5.4.sql trunk/ccm-core/sql/ccm-core/upgrade/postgres-6.5.4-6.5.5.sql Log: Fix for patch r1501 (messages.body GE 4000 char SF patch 1593338). Patch for Message.pdl as provided by r1501 didn't work for postgres b/c type clob is unknown. Patch created inconsistent postgres databases: In a newly created db body as varchar(4000), in an updated db body as text. Setting it back to varchar(4000) in pdl as before r1501 and implementation of the desired modifications in SQL. Modified: trunk/ccm-core/pdl/com/arsdigita/messaging/Message.pdl =================================================================== --- trunk/ccm-core/pdl/com/arsdigita/messaging/Message.pdl 2008-05-23 00:54:54 UTC (rev 1703) +++ trunk/ccm-core/pdl/com/arsdigita/messaging/Message.pdl 2008-06-08 14:45:43 UTC (rev 1704) @@ -21,15 +21,19 @@ import com.arsdigita.kernel.*; +// The column body is created as CLOB (Oracle) rsp. TEXT (Postgres) +// by SQL scripts and is capable to store more than 4000 characters +// [varchar(4000) below] + object type Message extends ACSObject { String[0..1] replyTo = messages.reply_to VARCHAR(250); String[1..1] subject = messages.subject VARCHAR(250); - String[1..1] body = messages.body CLOB; + String[1..1] body = messages.body VARCHAR(4000); String[1..1] type = messages.type VARCHAR(50); Date[1..1] sent = messages.sent_date TIMESTAMP; BigDecimal[0..1] inReplyTo = messages.in_reply_to INTEGER; - BigDecimal objectID = messages.object_id INTEGER; + BigDecimal objectID = messages.object_id INTEGER; String[0..1] messageID = messages.rfc_message_id VARCHAR(1000); Party[1..1] sender = join messages.sender to parties.party_id; Deleted: trunk/ccm-core/sql/ccm-core/default/messaging/table-messages.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/default/messaging/table-messages.sql 2008-05-23 00:54:54 UTC (rev 1703) +++ trunk/ccm-core/sql/ccm-core/default/messaging/table-messages.sql 2008-06-08 14:45:43 UTC (rev 1704) @@ -1,51 +0,0 @@ --- --- Copyright (C) 2002-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 --- --- $Id$ --- $DateTime: 2004/08/16 18:10:38 $ - -create table messages ( - message_id integer - constraint messages_message_id_fk - references acs_objects(object_id) - constraint messages_message_id_pk - primary key, - object_id integer - constraint messages_object_id_fk - references acs_objects(object_id) on delete cascade, - reply_to varchar(250), - sender integer - constraint messages_sender_fk - references parties (party_id), - subject varchar(250) - constraint messages_subject_nn not null, - body varchar(4000) - constraint messages_body_nn not null, - type varchar(50) - constraint messages_type_nn not null, - sent_date timestamptz - default current_timestamp - constraint messages_sent_date_nn not null, - in_reply_to integer - constraint messages_reply_to_fk - references messages(message_id) on delete set null, - rfc_message_id varchar(250), - root_id integer - constraint messages_root_id_fk - references messages(message_id) on delete cascade, - sort_key varchar(300) -); Modified: trunk/ccm-core/sql/ccm-core/oracle-se/messaging/table-messages.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/oracle-se/messaging/table-messages.sql 2008-05-23 00:54:54 UTC (rev 1703) +++ trunk/ccm-core/sql/ccm-core/oracle-se/messaging/table-messages.sql 2008-06-08 14:45:43 UTC (rev 1704) @@ -33,7 +33,7 @@ references parties (party_id), subject varchar(250) constraint messages_subject_nn not null, - body varchar(4000) + body clob constraint messages_body_nn not null, type varchar(50) constraint messages_type_nn not null, Modified: trunk/ccm-core/sql/ccm-core/oracle-se-create.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/oracle-se-create.sql 2008-05-23 00:54:54 UTC (rev 1703) +++ trunk/ccm-core/sql/ccm-core/oracle-se-create.sql 2008-06-08 14:45:43 UTC (rev 1704) @@ -22,6 +22,8 @@ @@ ddl/oracle-se/create.sql + + @@ default/globalization/table-g11n_charsets.sql @@ default/globalization/index-g11n_charsets.sql @@ default/globalization/table-g11n_locales.sql Added: trunk/ccm-core/sql/ccm-core/postgres/messaging/table-messages.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/postgres/messaging/table-messages.sql (rev 0) +++ trunk/ccm-core/sql/ccm-core/postgres/messaging/table-messages.sql 2008-06-08 14:45:43 UTC (rev 1704) @@ -0,0 +1,51 @@ +-- +-- Copyright (C) 2002-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 +-- +-- $Id: table-messages.sql 287 2008-06-07 00:29:02Z pboy $ +-- $DateTime: 2008/06/07 18:10:38 $ + +create table messages ( + message_id integer + constraint messages_message_id_fk + references acs_objects(object_id) + constraint messages_message_id_pk + primary key, + object_id integer + constraint messages_object_id_fk + references acs_objects(object_id) on delete cascade, + reply_to varchar(250), + sender integer + constraint messages_sender_fk + references parties (party_id), + subject varchar(250) + constraint messages_subject_nn not null, + body text + constraint messages_body_nn not null, + type varchar(50) + constraint messages_type_nn not null, + sent_date timestamptz + default current_timestamp + constraint messages_sent_date_nn not null, + in_reply_to integer + constraint messages_reply_to_fk + references messages(message_id) on delete set null, + rfc_message_id varchar(250), + root_id integer + constraint messages_root_id_fk + references messages(message_id) on delete cascade, + sort_key varchar(300) +); Modified: trunk/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql 2008-05-23 00:54:54 UTC (rev 1703) +++ trunk/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql 2008-06-08 14:45:43 UTC (rev 1704) @@ -19,7 +19,7 @@ -alter table messages add large_body text; +alter table messages add large_body text NOT NULL; update messages set large_body = body; @@ -27,8 +27,14 @@ alter table messages rename column large_body to body; + +COMMENT ON COLUMN messages.body IS ' + Body of the message. +'; + commit; + -- reclaim disk space from old column UPDATE messages SET body = body; @@ -40,4 +46,3 @@ commit; - Modified: trunk/ccm-core/sql/ccm-core/postgres-create.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/postgres-create.sql 2008-05-23 00:54:54 UTC (rev 1703) +++ trunk/ccm-core/sql/ccm-core/postgres-create.sql 2008-06-08 14:45:43 UTC (rev 1704) @@ -25,6 +25,9 @@ \i default/function-currentDate.sql \i ddl/postgres/create.sql + + + \i default/globalization/table-g11n_charsets.sql \i default/globalization/index-g11n_charsets.sql \i default/globalization/table-g11n_locales.sql @@ -142,7 +145,7 @@ \i default/auditing/table-acs_auditing.sql \i default/auditing/index-acs_auditing.sql -\i default/messaging/table-messages.sql +\i postgres/messaging/table-messages.sql \i default/messaging/index-messages.sql \i default/messaging/comment-messages.sql \i postgres/messaging/table-message_parts.sql Modified: trunk/ccm-core/sql/ccm-core/upgrade/postgres-6.5.3-6.5.4.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/upgrade/postgres-6.5.3-6.5.4.sql 2008-05-23 00:54:54 UTC (rev 1703) +++ trunk/ccm-core/sql/ccm-core/upgrade/postgres-6.5.3-6.5.4.sql 2008-06-08 14:45:43 UTC (rev 1704) @@ -16,7 +16,7 @@ -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -\echo Red Hat WAF 6.5.3 -> 6.5.4 Upgrade Script (PostgreSQL) +\echo ccm-core 6.5.3 -> 6.5.4 Upgrade Script (PostgreSQL) begin; Modified: trunk/ccm-core/sql/ccm-core/upgrade/postgres-6.5.4-6.5.5.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/upgrade/postgres-6.5.4-6.5.5.sql 2008-05-23 00:54:54 UTC (rev 1703) +++ trunk/ccm-core/sql/ccm-core/upgrade/postgres-6.5.4-6.5.5.sql 2008-06-08 14:45:43 UTC (rev 1704) @@ -16,8 +16,7 @@ -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -\echo Red Hat WAF 6.5.4 -> 6.5.5 Upgrade Script (PostgreSQL) +\echo ccm-core 6.5.4 -> 6.5.5 Upgrade Script (PostgreSQL) -- nothing doing, unless someone updates ctx triggers for postgres ; - |
From: <te...@fe...> - 2008-05-23 00:35:59
|
Author: terry Date: 2008-05-23 00:54:54 +0000 (Fri, 23 May 2008) New Revision: 1703 Added: contrib/permeance/ccm-script/LICENSE contrib/permeance/ccm-script/README Log: Added license and readme Added: contrib/permeance/ccm-script/LICENSE =================================================================== --- contrib/permeance/ccm-script/LICENSE (rev 0) +++ contrib/permeance/ccm-script/LICENSE 2008-05-23 00:54:54 UTC (rev 1703) @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. Added: contrib/permeance/ccm-script/README =================================================================== --- contrib/permeance/ccm-script/README (rev 0) +++ contrib/permeance/ccm-script/README 2008-05-23 00:54:54 UTC (rev 1703) @@ -0,0 +1,72 @@ + ============================= + ccm-script installation guide + ============================= + +ccm-script is a simple layer on Rhino. The first addition is to initialise +the WAF framework so that the JavaScript functions have access to properties, +persistence, etc. The second addition is to provide some simple JavaScript +methods that treat content sections and folders like a simple file system. + +========== +Installing +========== + +(1) cd $CCM_DEV_HOME + +(2) svn checkout http://svn.fedorahosted.org/svn/aplaws/contrib/permeance/ccm-script/ + +(3) Add ccm-script to $CCM_DEV_HOME/project.xml + +(4) ccm-configure + +(5) ant deploy + + +=============================== +Start the scripting environment +=============================== + +(1) ccm-run org.aplaws.script.Shell [args] + + where [args] are described at http://www.mozilla.org/rhino/shell.html + + OR + +(2) ccm-run org.aplaws.script.Console + + (opens a window) + + +======== +Examples +======== + +(1) See the syntax and examples in the Rhino documentation at + http://www.mozilla.org/rhino/doc.html. + +(2) Create a new content section: + + > mkdir("my-new-content-section"); + > ls(); + +(3) Create a new folder: + + > cd("my-new-content-section"); + > mkdir("my-new-folder"); + > ls(); + +(4) Change the description of a subsite: + + (see etc/examples/change_subsite_description.js) + + +========== +Extensions +========== + +(1) Add new JavaScript functions to ccm-script/src/ccm-script-bootstrap.js + +(2) Create a library of files and load them + + + |
Author: terry Date: 2008-05-23 00:25:37 +0000 (Fri, 23 May 2008) New Revision: 1702 Added: contrib/permeance/ccm-script/ contrib/permeance/ccm-script/application.xml contrib/permeance/ccm-script/etc/ contrib/permeance/ccm-script/etc/examples/ contrib/permeance/ccm-script/etc/examples/change_subsite_description.js contrib/permeance/ccm-script/lib/ contrib/permeance/ccm-script/lib/js.jar contrib/permeance/ccm-script/lib/js.jar-LICENSE.txt contrib/permeance/ccm-script/pdl/ contrib/permeance/ccm-script/sql/ contrib/permeance/ccm-script/src/ contrib/permeance/ccm-script/src/ccm-script-bootstrap.js contrib/permeance/ccm-script/src/org/ contrib/permeance/ccm-script/src/org/aplaws/ contrib/permeance/ccm-script/src/org/aplaws/script/ contrib/permeance/ccm-script/src/org/aplaws/script/Console.java contrib/permeance/ccm-script/src/org/aplaws/script/Shell.java contrib/permeance/ccm-script/src/org/aplaws/script/util/ contrib/permeance/ccm-script/src/org/aplaws/script/util/BootstrapScripts.java Log: Committed initial version of ccm-script Added: contrib/permeance/ccm-script/application.xml =================================================================== --- contrib/permeance/ccm-script/application.xml (rev 0) +++ contrib/permeance/ccm-script/application.xml 2008-05-23 00:25:37 UTC (rev 1702) @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<!-- + Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 +--> +<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-script" prettyName="CCM Script" version="6.5.0" release="1" webapp="ROOT"> + <ccm:dependencies> + <ccm:requires name="ccm-cms" version="6.5.0" relation="ge"/> + </ccm:dependencies> + <ccm:contacts> + <ccm:contact uri="http://aplaws.org/" type="website"/> + <ccm:contact uri="mailto:apl...@li..." type="support"/> + </ccm:contacts> + <ccm:description> + This module provides a simple scripting environment for interacting with APLAWS+. + </ccm:description> +</ccm:application> Added: contrib/permeance/ccm-script/etc/examples/change_subsite_description.js =================================================================== --- contrib/permeance/ccm-script/etc/examples/change_subsite_description.js (rev 0) +++ contrib/permeance/ccm-script/etc/examples/change_subsite_description.js 2008-05-23 00:25:37 UTC (rev 1702) @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 + */ + +begin(); +var site = com.arsdigita.london.subsite.Site.findByTitle("mySubsite"); +site.description += 'ABC'; +commit(); +print("Site " + site.getOID() + " description was changed to " + site.description); \ No newline at end of file Added: contrib/permeance/ccm-script/lib/js.jar =================================================================== (Binary files differ) Property changes on: contrib/permeance/ccm-script/lib/js.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: contrib/permeance/ccm-script/lib/js.jar-LICENSE.txt =================================================================== --- contrib/permeance/ccm-script/lib/js.jar-LICENSE.txt (rev 0) +++ contrib/permeance/ccm-script/lib/js.jar-LICENSE.txt 2008-05-23 00:25:37 UTC (rev 1702) @@ -0,0 +1,470 @@ + MOZILLA PUBLIC LICENSE + Version 1.1 + + --------------- + +1. Definitions. + + 1.0.1. "Commercial Use" means distribution or otherwise making the + Covered Code available to a third party. + + 1.1. "Contributor" means each entity that creates or contributes to + the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original + Code, prior Modifications used by a Contributor, and the Modifications + made by that particular Contributor. + + 1.3. "Covered Code" means the Original Code or Modifications or the + combination of the Original Code and Modifications, in each case + including portions thereof. + + 1.4. "Electronic Distribution Mechanism" means a mechanism generally + accepted in the software development community for the electronic + transfer of data. + + 1.5. "Executable" means Covered Code in any form other than Source + Code. + + 1.6. "Initial Developer" means the individual or entity identified + as the Initial Developer in the Source Code notice required by Exhibit + A. + + 1.7. "Larger Work" means a work which combines Covered Code or + portions thereof with code not governed by the terms of this License. + + 1.8. "License" means this document. + + 1.8.1. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means any addition to or deletion from the + substance or structure of either the Original Code or any previous + Modifications. When Covered Code is released as a series of files, a + Modification is: + A. Any addition to or deletion from the contents of a file + containing Original Code or previous Modifications. + + B. Any new file that contains any part of the Original Code or + previous Modifications. + + 1.10. "Original Code" means Source Code of computer software code + which is described in the Source Code notice required by Exhibit A as + Original Code, and which, at the time of its release under this + License is not already Covered Code governed by this License. + + 1.10.1. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, process, + and apparatus claims, in any patent Licensable by grantor. + + 1.11. "Source Code" means the preferred form of the Covered Code for + making modifications to it, including all modules it contains, plus + any associated interface definition files, scripts used to control + compilation and installation of an Executable, or source code + differential comparisons against either the Original Code or another + well known, available Covered Code of the Contributor's choice. The + Source Code can be in a compressed or archival form, provided the + appropriate decompression or de-archiving software is widely available + for no charge. + + 1.12. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms of, this + License or a future version of this License issued under Section 6.1. + For legal entities, "You" includes any entity which controls, is + controlled by, or is under common control with You. For purposes of + this definition, "control" means (a) the power, direct or indirect, + to cause the direction or management of such entity, whether by + contract or otherwise, or (b) ownership of more than fifty percent + (50%) of the outstanding shares or beneficial ownership of such + entity. + +2. Source Code License. + + 2.1. The Initial Developer Grant. + The Initial Developer hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual property + claims: + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer to use, reproduce, + modify, display, perform, sublicense and distribute the Original + Code (or portions thereof) with or without Modifications, and/or + as part of a Larger Work; and + + (b) under Patents Claims infringed by the making, using or + selling of Original Code, to make, have made, use, practice, + sell, and offer for sale, and/or otherwise dispose of the + Original Code (or portions thereof). + + (c) the licenses granted in this Section 2.1(a) and (b) are + effective on the date Initial Developer first distributes + Original Code under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: 1) for code that You delete from the Original Code; 2) + separate from the Original Code; or 3) for infringements caused + by: i) the modification of the Original Code or ii) the + combination of the Original Code with other software or devices. + + 2.2. Contributor Grant. + Subject to third party intellectual property claims, each Contributor + hereby grants You a world-wide, royalty-free, non-exclusive license + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor, to use, reproduce, modify, + display, perform, sublicense and distribute the Modifications + created by such Contributor (or portions thereof) either on an + unmodified basis, with other Modifications, as Covered Code + and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or + selling of Modifications made by that Contributor either alone + and/or in combination with its Contributor Version (or portions + of such combination), to make, use, sell, offer for sale, have + made, and/or otherwise dispose of: 1) Modifications made by that + Contributor (or portions thereof); and 2) the combination of + Modifications made by that Contributor with its Contributor + Version (or portions of such combination). + + (c) the licenses granted in Sections 2.2(a) and 2.2(b) are + effective on the date Contributor first makes Commercial Use of + the Covered Code. + + (d) Notwithstanding Section 2.2(b) above, no patent license is + granted: 1) for any code that Contributor has deleted from the + Contributor Version; 2) separate from the Contributor Version; + 3) for infringements caused by: i) third party modifications of + Contributor Version or ii) the combination of Modifications made + by that Contributor with other software (except as part of the + Contributor Version) or other devices; or 4) under Patent Claims + infringed by Covered Code in the absence of Modifications made by + that Contributor. + +3. Distribution Obligations. + + 3.1. Application of License. + The Modifications which You create or to which You contribute are + governed by the terms of this License, including without limitation + Section 2.2. The Source Code version of Covered Code may be + distributed only under the terms of this License or a future version + of this License released under Section 6.1, and You must include a + copy of this License with every copy of the Source Code You + distribute. You may not offer or impose any terms on any Source Code + version that alters or restricts the applicable version of this + License or the recipients' rights hereunder. However, You may include + an additional document offering the additional rights described in + Section 3.5. + + 3.2. Availability of Source Code. + Any Modification which You create or to which You contribute must be + made available in Source Code form under the terms of this License + either on the same media as an Executable version or via an accepted + Electronic Distribution Mechanism to anyone to whom you made an + Executable version available; and if made available via Electronic + Distribution Mechanism, must remain available for at least twelve (12) + months after the date it initially became available, or at least six + (6) months after a subsequent version of that particular Modification + has been made available to such recipients. You are responsible for + ensuring that the Source Code version remains available even if the + Electronic Distribution Mechanism is maintained by a third party. + + 3.3. Description of Modifications. + You must cause all Covered Code to which You contribute to contain a + file documenting the changes You made to create that Covered Code and + the date of any change. You must include a prominent statement that + the Modification is derived, directly or indirectly, from Original + Code provided by the Initial Developer and including the name of the + Initial Developer in (a) the Source Code, and (b) in any notice in an + Executable version or related documentation in which You describe the + origin or ownership of the Covered Code. + + 3.4. Intellectual Property Matters + (a) Third Party Claims. + If Contributor has knowledge that a license under a third party's + intellectual property rights is required to exercise the rights + granted by such Contributor under Sections 2.1 or 2.2, + Contributor must include a text file with the Source Code + distribution titled "LEGAL" which describes the claim and the + party making the claim in sufficient detail that a recipient will + know whom to contact. If Contributor obtains such knowledge after + the Modification is made available as described in Section 3.2, + Contributor shall promptly modify the LEGAL file in all copies + Contributor makes available thereafter and shall take other steps + (such as notifying appropriate mailing lists or newsgroups) + reasonably calculated to inform those who received the Covered + Code that new knowledge has been obtained. + + (b) Contributor APIs. + If Contributor's Modifications include an application programming + interface and Contributor has knowledge of patent licenses which + are reasonably necessary to implement that API, Contributor must + also include this information in the LEGAL file. + + (c) Representations. + Contributor represents that, except as disclosed pursuant to + Section 3.4(a) above, Contributor believes that Contributor's + Modifications are Contributor's original creation(s) and/or + Contributor has sufficient rights to grant the rights conveyed by + this License. + + 3.5. Required Notices. + You must duplicate the notice in Exhibit A in each file of the Source + Code. If it is not possible to put such notice in a particular Source + Code file due to its structure, then You must include such notice in a + location (such as a relevant directory) where a user would be likely + to look for such a notice. If You created one or more Modification(s) + You may add your name as a Contributor to the notice described in + Exhibit A. You must also duplicate this License in any documentation + for the Source Code where You describe recipients' rights or ownership + rights relating to Covered Code. You may choose to offer, and to + charge a fee for, warranty, support, indemnity or liability + obligations to one or more recipients of Covered Code. However, You + may do so only on Your own behalf, and not on behalf of the Initial + Developer or any Contributor. You must make it absolutely clear than + any such warranty, support, indemnity or liability obligation is + offered by You alone, and You hereby agree to indemnify the Initial + Developer and every Contributor for any liability incurred by the + Initial Developer or such Contributor as a result of warranty, + support, indemnity or liability terms You offer. + + 3.6. Distribution of Executable Versions. + You may distribute Covered Code in Executable form only if the + requirements of Section 3.1-3.5 have been met for that Covered Code, + and if You include a notice stating that the Source Code version of + the Covered Code is available under the terms of this License, + including a description of how and where You have fulfilled the + obligations of Section 3.2. The notice must be conspicuously included + in any notice in an Executable version, related documentation or + collateral in which You describe recipients' rights relating to the + Covered Code. You may distribute the Executable version of Covered + Code or ownership rights under a license of Your choice, which may + contain terms different from this License, provided that You are in + compliance with the terms of this License and that the license for the + Executable version does not attempt to limit or alter the recipient's + rights in the Source Code version from the rights set forth in this + License. If You distribute the Executable version under a different + license You must make it absolutely clear that any terms which differ + from this License are offered by You alone, not by the Initial + Developer or any Contributor. You hereby agree to indemnify the + Initial Developer and every Contributor for any liability incurred by + the Initial Developer or such Contributor as a result of any such + terms You offer. + + 3.7. Larger Works. + You may create a Larger Work by combining Covered Code with other code + not governed by the terms of this License and distribute the Larger + Work as a single product. In such a case, You must make sure the + requirements of this License are fulfilled for the Covered Code. + +4. Inability to Comply Due to Statute or Regulation. + + If it is impossible for You to comply with any of the terms of this + License with respect to some or all of the Covered Code due to + statute, judicial order, or regulation then You must: (a) comply with + the terms of this License to the maximum extent possible; and (b) + describe the limitations and the code they affect. Such description + must be included in the LEGAL file described in Section 3.4 and must + be included with all distributions of the Source Code. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Application of this License. + + This License applies to code to which the Initial Developer has + attached the notice in Exhibit A and to related Covered Code. + +6. Versions of the License. + + 6.1. New Versions. + Netscape Communications Corporation ("Netscape") may publish revised + and/or new versions of the License from time to time. Each version + will be given a distinguishing version number. + + 6.2. Effect of New Versions. + Once Covered Code has been published under a particular version of the + License, You may always continue to use it under the terms of that + version. You may also choose to use such Covered Code under the terms + of any subsequent version of the License published by Netscape. No one + other than Netscape has the right to modify the terms applicable to + Covered Code created under this License. + + 6.3. Derivative Works. + If You create or use a modified version of this License (which you may + only do in order to apply it to code which is not already Covered Code + governed by this License), You must (a) rename Your license so that + the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", + "MPL", "NPL" or any confusingly similar phrase do not appear in your + license (except to note that your license differs from this License) + and (b) otherwise make it clear that Your version of the license + contains terms which differ from the Mozilla Public License and + Netscape Public License. (Filling in the name of the Initial + Developer, Original Code or Contributor in the notice described in + Exhibit A shall not of themselves be deemed to be modifications of + this License.) + +7. DISCLAIMER OF WARRANTY. + + COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF + DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. + THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE + IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, + YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE + COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER + OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +8. TERMINATION. + + 8.1. This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to cure + such breach within 30 days of becoming aware of the breach. All + sublicenses to the Covered Code which are properly granted shall + survive any termination of this License. Provisions which, by their + nature, must remain in effect beyond the termination of this License + shall survive. + + 8.2. If You initiate litigation by asserting a patent infringement + claim (excluding declatory judgment actions) against Initial Developer + or a Contributor (the Initial Developer or Contributor against whom + You file such action is referred to as "Participant") alleging that: + + (a) such Participant's Contributor Version directly or indirectly + infringes any patent, then any and all rights granted by such + Participant to You under Sections 2.1 and/or 2.2 of this License + shall, upon 60 days notice from Participant terminate prospectively, + unless if within 60 days after receipt of notice You either: (i) + agree in writing to pay Participant a mutually agreeable reasonable + royalty for Your past and future use of Modifications made by such + Participant, or (ii) withdraw Your litigation claim with respect to + the Contributor Version against such Participant. If within 60 days + of notice, a reasonable royalty and payment arrangement are not + mutually agreed upon in writing by the parties or the litigation claim + is not withdrawn, the rights granted by Participant to You under + Sections 2.1 and/or 2.2 automatically terminate at the expiration of + the 60 day notice period specified above. + + (b) any software, hardware, or device, other than such Participant's + Contributor Version, directly or indirectly infringes any patent, then + any rights granted to You by such Participant under Sections 2.1(b) + and 2.2(b) are revoked effective as of the date You first made, used, + sold, distributed, or had made, Modifications made by that + Participant. + + 8.3. If You assert a patent infringement claim against Participant + alleging that such Participant's Contributor Version directly or + indirectly infringes any patent where such claim is resolved (such as + by license or settlement) prior to the initiation of patent + infringement litigation, then the reasonable value of the licenses + granted by such Participant under Sections 2.1 or 2.2 shall be taken + into account in determining the amount or value of any payment or + license. + + 8.4. In the event of termination under Sections 8.1 or 8.2 above, + all end user license agreements (excluding distributors and resellers) + which have been validly granted by You or any distributor hereunder + prior to termination shall survive termination. + +9. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL + DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, + OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR + ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY + CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, + WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY + RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW + PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE + EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO + THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +10. U.S. GOVERNMENT END USERS. + + The Covered Code is a "commercial item," as that term is defined in + 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer + software" and "commercial computer software documentation," as such + terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 + C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), + all U.S. Government End Users acquire Covered Code with only those + rights set forth herein. + +11. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed by + California law provisions (except to the extent applicable law, if + any, provides otherwise), excluding its conflict-of-law provisions. + With respect to disputes in which at least one party is a citizen of, + or an entity chartered or registered to do business in the United + States of America, any litigation relating to this License shall be + subject to the jurisdiction of the Federal Courts of the Northern + District of California, with venue lying in Santa Clara County, + California, with the losing party responsible for costs, including + without limitation, court costs and reasonable attorneys' fees and + expenses. The application of the United Nations Convention on + Contracts for the International Sale of Goods is expressly excluded. + Any law or regulation which provides that the language of a contract + shall be construed against the drafter shall not apply to this + License. + +12. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or indirectly, + out of its utilization of rights under this License and You agree to + work with Initial Developer and Contributors to distribute such + responsibility on an equitable basis. Nothing herein is intended or + shall be deemed to constitute any admission of liability. + +13. MULTIPLE-LICENSED CODE. + + Initial Developer may designate portions of the Covered Code as + "Multiple-Licensed". "Multiple-Licensed" means that the Initial + Developer permits you to utilize portions of the Covered Code under + Your choice of the NPL or the alternative licenses, if any, specified + by the Initial Developer in the file described in Exhibit A. + +EXHIBIT A -Mozilla Public License. + + ``The contents of this file are subject to the Mozilla Public License + Version 1.1 (the "License"); you may not use this file except in + compliance with the License. You may obtain a copy of the License at + http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + License for the specific language governing rights and limitations + under the License. + + The Original Code is ______________________________________. + + The Initial Developer of the Original Code is ________________________. + Portions created by ______________________ are Copyright (C) ______ + _______________________. All Rights Reserved. + + Contributor(s): ______________________________________. + + Alternatively, the contents of this file may be used under the terms + of the _____ license (the "[___] License"), in which case the + provisions of [______] License are applicable instead of those + above. If you wish to allow use of your version of this file only + under the terms of the [____] License and not to allow others to use + your version of this file under the MPL, indicate your decision by + deleting the provisions above and replace them with the notice and + other provisions required by the [___] License. If you do not delete + the provisions above, a recipient may use your version of this file + under either the MPL or the [___] License." + + [NOTE: The text of this Exhibit A may differ slightly from the text of + the notices in the Source Code files of the Original Code. You should + use the text of this Exhibit A rather than the text found in the + Original Code Source Code for Your Modifications.] + Added: contrib/permeance/ccm-script/src/ccm-script-bootstrap.js =================================================================== --- contrib/permeance/ccm-script/src/ccm-script-bootstrap.js (rev 0) +++ contrib/permeance/ccm-script/src/ccm-script-bootstrap.js 2008-05-23 00:25:37 UTC (rev 1702) @@ -0,0 +1,385 @@ +/* + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 + */ + +importPackage(java.lang); +importPackage(com.arsdigita.cms); +importPackage(com.arsdigita.cms.installer); + +/******************************************************************************* + * Javascript sprintf + * (c) 2006-2008 www.webtoolkit.info + ******************************************************************************/ + +sprintfWrapper = { + + init : function () { + + if (typeof arguments == "undefined") { return null; } + if (arguments.length < 1) { return null; } + if (typeof arguments[0] != "string") { return null; } + if (typeof RegExp == "undefined") { return null; } + + var string = arguments[0]; + var exp = new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g); + var matches = new Array(); + var strings = new Array(); + var convCount = 0; + var stringPosStart = 0; + var stringPosEnd = 0; + var matchPosEnd = 0; + var newString = ''; + var match = null; + + while (match = exp.exec(string)) { + if (match[9]) { convCount += 1; } + + stringPosStart = matchPosEnd; + stringPosEnd = exp.lastIndex - match[0].length; + strings[strings.length] = string.substring(stringPosStart, stringPosEnd); + + matchPosEnd = exp.lastIndex; + matches[matches.length] = { + match: match[0], + left: match[3] ? true : false, + sign: match[4] || '', + pad: match[5] || ' ', + min: match[6] || 0, + precision: match[8], + code: match[9] || '%', + negative: parseInt(arguments[convCount]) < 0 ? true : false, + argument: String(arguments[convCount]) + }; + } + strings[strings.length] = string.substring(matchPosEnd); + + if (matches.length == 0) { return string; } + if ((arguments.length - 1) < convCount) { return null; } + + var code = null; + var match = null; + var i = null; + + for (i=0; i<matches.length; i++) { + + if (matches[i].code == '%') { substitution = '%' } + else if (matches[i].code == 'b') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(2)); + substitution = sprintfWrapper.convert(matches[i], true); + } + else if (matches[i].code == 'c') { + matches[i].argument = String(String.fromCharCode(parseInt(Math.abs(parseInt(matches[i].argument))))); + substitution = sprintfWrapper.convert(matches[i], true); + } + else if (matches[i].code == 'd') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument))); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 'f') { + matches[i].argument = String(Math.abs(parseFloat(matches[i].argument)).toFixed(matches[i].precision ? matches[i].precision : 6)); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 'o') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(8)); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 's') { + matches[i].argument = matches[i].argument.substring(0, matches[i].precision ? matches[i].precision : matches[i].argument.length) + substitution = sprintfWrapper.convert(matches[i], true); + } + else if (matches[i].code == 'x') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16)); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 'X') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16)); + substitution = sprintfWrapper.convert(matches[i]).toUpperCase(); + } + else { + substitution = matches[i].match; + } + + newString += strings[i]; + newString += substitution; + + } + newString += strings[i]; + + return newString; + + }, + + convert : function(match, nosign){ + if (nosign) { + match.sign = ''; + } else { + match.sign = match.negative ? '-' : match.sign; + } + var l = match.min - match.argument.length + 1 - match.sign.length; + var pad = new Array(l < 0 ? 0 : l).join(match.pad); + if (!match.left) { + if (match.pad == "0" || nosign) { + return match.sign + pad + match.argument; + } else { + return pad + match.sign + match.argument; + } + } else { + if (match.pad == "0" || nosign) { + return match.sign + match.argument + pad.replace(/0/g, ' '); + } else { + return match.sign + match.argument + pad; + } + } + } +} + +sprintf = sprintfWrapper.init; + +/******************************************************************************* + * Initialise the runtime + ******************************************************************************/ + +print("Please wait while APLAWS+ runtime is initialised..."); +var t0 = System.currentTimeMillis(); +new com.arsdigita.runtime.Startup().run(); +var t1 = System.currentTimeMillis(); +print("Runtime was initialised in " + (t1-t0)/1000 + " seconds"); + +/******************************************************************************* + * Transactions + ******************************************************************************/ + +var tx = null; + +function begin() { + if (tx != null) { + print("begin failed: You need to commit() or abort() the current transaction first!"); + } else { + tx = com.arsdigita.persistence.SessionManager.getSession().getTransactionContext(); + tx.beginTxn(); + /* print("began transaction"); */ + } +} + +function commit() { + if (tx == null) { + print("commit failed: You need to begin() a transaction first!"); + } else { + tx.commitTxn(); + tx = null; + /* print("committed transaction"); */ + } +} + +function abort() { + if (tx == null) { + print("abort failed: You need to begin() a transaction first!"); + } else { + tx.abortTxn(); + tx = null; + /* print("aborted transaction"); */ + } +} + +/******************************************************************************* + * Content folders + ******************************************************************************/ + +var currentFolder = null; + +function pwd() { + if (currentFolder == null) { + print("/"); + } else { + var folder = currentFolder; + var path = ""; + while (folder != null && folder.getParent() != null) { + path = "/" + folder.getName() + path; + folder = folder.getParent(); + } + print("/" + currentFolder.getContentSection().getTitle() + path); + } +} + +function cd(dir) { + if (dir == "") { + /* do nothing */ + } else if (dir == "..") { + currentFolder = currentFolder.getParent(); + } else if (dir.substring(0, 1) == "/") { + currentFolder = null; + } else if (currentFolder == null) { + var sections = ContentSection.getAllSections(); + while (sections.next() && currentFolder == null) { + var section = sections.getContentSection(); + if (section.getTitle() == dir) { + currentFolder = section.getRootFolder(); + } + } + sections.close(); + if (currentFolder == null) { + print("cd failed: No such directory"); + } + } else { + var items = currentFolder.getItems(); + var foundFolder = null; + while (items.next() && foundFolder == null) { + if (items.isFolder() && items.getName() == dir) { + foundFolder = items.getContentItem(); + } + } + items.close(); + if (foundFolder == null) { + print("cd failed: No such directory"); + } else { + currentFolder = foundFolder; + } + } + pwd(); +} + +function mkdir(dir) { + if (dir == "") { + print("mkdir failed: Cannot create directory"); + } else if (currentFolder == null) { + /* create content section */ + begin(); + var section = ContentSection.create(dir); + var setup = new ContentSectionSetup(section); + setup.registerViewers(true); + setup.registerAlerts(); + setup.registerPublicationCycles(); + setup.registerWorkflowTemplates(); + setup.registerResolvers(null, null); + section.save(); + commit(); + } else { + /* create folder in content section */ + begin(); + var f = new Folder(); + f.setName(dir); + f.setLabel(dir); + f.setParent(currentFolder); + f.save(); + commit(); + } +} + +function ls() { + if (currentFolder == null) { + /* list content sections */ + var sections = ContentSection.getAllSections(); + sections.addOrder("title"); + while (sections.next()) { + var section = sections.getContentSection(); + print(sprintf("%4s %s %-24s %s", + "drwx", + section.getTimestamp(), + "Content Section", + section.getTitle())); + } + sections.close(); + } else { + /* list contents of current folder */ + var items = currentFolder.getItems(false); + items.addOrder("isFolder desc"); + items.addOrder("name"); + while (items.next()) { + var item = items.getContentItem(); + print(sprintf("%4s %s %-24s %s", + items.isFolder() ? "drwx" : "-rw-", + item.getLastModifiedDate(), + items.isFolder() ? "Folder" : item.getContentType().getLabel(), + item.getName())); + } + items.close(); + } +} + +function rmdir(dir) { + if (dir == "") { + print("rmdir failed: Cannot remove directory"); + } else if (currentFolder == null) { + /* remove content section */ + print("NOT IMPLEMENTED"); + } else { + /* remove folder in content section */ + var items = currentFolder.getItems(); + var foundFolder = null; + while (items.next() && foundFolder == null) { + if (items.isFolder() && items.getName() == dir) { + foundFolder = items.getContentItem(); + if (foundFolder.isEmpty()) { + begin(); + foundFolder.getClass().getMethod('delete', null).invoke(foundFolder, null); + commit(); + } else { + print("rmdir failed: The directory is not empty"); + } + } + } + items.close(); + if (foundFolder == null) { + print("rmdir failed: No such directory"); + } + } +} + +/******************************************************************************* + * Content items + ******************************************************************************/ + +function rm(filename) { + if (filename == "") { + print("rm failed: Cannot remove filename"); + } else if (currentFolder == null) { + /* remove content section */ + print("NOT IMPLEMENTED"); + } else { + /* remove folder in content section */ + var items = currentFolder.getItems(); + var foundFile = null; + while (items.next() && foundFile == null) { + if (!items.isFolder() && items.getName() == filename) { + foundFile = items.getContentItem(); + if (!foundFile.isPublished()) { + begin(); + foundFolder.getClass().getMethod('delete', null).invoke(foundFolder, null); + commit(); + } else { + print("rm failed: The file is not empty"); + } + } + } + items.close(); + if (foundFolder == null) { + print("rmdir failed: No such directory"); + } + } +} + +function rmf(filename) { + print("NOT IMPLEMENTED"); +} + +function find(filename) { + print("NOT IMPLEMENTED"); +} + +function read(filename) { + print("NOT IMPLEMENTED"); +} Added: contrib/permeance/ccm-script/src/org/aplaws/script/Console.java =================================================================== --- contrib/permeance/ccm-script/src/org/aplaws/script/Console.java (rev 0) +++ contrib/permeance/ccm-script/src/org/aplaws/script/Console.java 2008-05-23 00:25:37 UTC (rev 1702) @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 org.aplaws.script; + +import org.aplaws.script.util.BootstrapScripts; +import org.mozilla.javascript.tools.shell.JSConsole; + +/** + * Provide a command-line interface to the scripting commands in a GUI console. + * + * @author <a href="https://sourceforge.net/users/terry_permeance/">terry_permeance</a> + */ +public class Console +{ + /** + * Start the GUI console. Run "<code>java org.apache.script.Shell -help</code>" to see the command options. + * + * @param args + * the command line arguments. + */ + public static void main(String[] args) + { + BootstrapScripts.install(); + JSConsole.main(args); + } +} Added: contrib/permeance/ccm-script/src/org/aplaws/script/Shell.java =================================================================== --- contrib/permeance/ccm-script/src/org/aplaws/script/Shell.java (rev 0) +++ contrib/permeance/ccm-script/src/org/aplaws/script/Shell.java 2008-05-23 00:25:37 UTC (rev 1702) @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 org.aplaws.script; + +import org.aplaws.script.util.BootstrapScripts; +import org.mozilla.javascript.tools.shell.Main; + +/** + * Provide a command-line interface to the scripting commands. + * + * @author <a href="https://sourceforge.net/users/terry_permeance/">terry_permeance</a> + */ +public class Shell +{ + /** + * Start the shell. Run "<code>java org.apache.script.Shell -help</code>" to see the command options. + * + * @param args + * the command line arguments. + */ + public static void main(String[] args) + { + BootstrapScripts.install(); + Main.main(args); + } +} Added: contrib/permeance/ccm-script/src/org/aplaws/script/util/BootstrapScripts.java =================================================================== --- contrib/permeance/ccm-script/src/org/aplaws/script/util/BootstrapScripts.java (rev 0) +++ contrib/permeance/ccm-script/src/org/aplaws/script/util/BootstrapScripts.java 2008-05-23 00:25:37 UTC (rev 1702) @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2008 Permeance Technologies Pty Ltd. 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 org.aplaws.script.util; + +import java.lang.reflect.Field; +import java.util.Vector; + +import org.mozilla.javascript.tools.shell.Main; + +/** + * Helper for installing bootstrap scripts so that common behaviour for APLAWS+ can be automatically provided to any + * script such as runtime initialisation and transaction functions. + * + * @author <a href="https://sourceforge.net/users/terry_permeance/">terry_permeance</a> + */ +public class BootstrapScripts +{ + /** + * Install a bootstrap script defined using <code>-Dccm.script.bootstrap=filename</code> with a default value of + * <code>ccm-script-bootstrap.js</code>. The script is located using the classpath and is installed before any + * other scripts are executed. + */ + public static void install() + { + try + { + String filename = System.getProperty("ccm.script.bootstrap", "ccm-script-bootstrap.js"); + String libraryFile = BootstrapScripts.class.getClassLoader().getResource(filename).getFile(); + System.out.println("Bootstrapping using " + libraryFile); + Field field = Class.forName(Main.class.getName()).getDeclaredField("fileList"); + field.setAccessible(true); + ((Vector) field.get(null)).add(libraryFile); + } + catch (ClassNotFoundException e) + { + e.printStackTrace(); + } + catch (SecurityException e) + { + e.printStackTrace(); + } + catch (NoSuchFieldException e) + { + e.printStackTrace(); + } + catch (IllegalArgumentException e) + { + e.printStackTrace(); + } + catch (IllegalAccessException e) + { + e.printStackTrace(); + } + } +} |
From: <te...@fe...> - 2008-05-22 23:46:27
|
Author: terry Date: 2008-05-23 00:05:25 +0000 (Fri, 23 May 2008) New Revision: 1701 Added: contrib/permeance/ contrib/permeance/README.txt Log: Created folders for contributions by Permeance Added: contrib/permeance/README.txt =================================================================== --- contrib/permeance/README.txt (rev 0) +++ contrib/permeance/README.txt 2008-05-23 00:05:25 UTC (rev 1701) @@ -0,0 +1,3 @@ +This folder contains contributions to APLAWS by Permeance Technologies Pty. Ltd. (http://www.permeance.com.au) + +Enjoy! \ No newline at end of file |
Author: pboy Date: 2008-05-16 19:51:30 +0000 (Fri, 16 May 2008) New Revision: 1700 Added: trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/oracle-se/upgrade/6.5.0-6.5.1/ trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/oracle-se/upgrade/6.5.0-6.5.1/add_link_column.sql trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/postgres/upgrade/6.5.0-6.5.1/ trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/postgres/upgrade/6.5.0-6.5.1/add_link_column.sql Removed: trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/default/upgrade/6.5.0-6.5.1/ Modified: trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/oracle-se-6.5.0-6.5.1.sql trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/postgres-6.5.0-6.5.1.sql Log: Addendum for r1633 to make the update script work for postgres: Split of the common update script in ~/sql/ccm-ldn-image-script/default/upgrade/ into separate scripts for Oracle and Postgresql to reflect syntax differences. Added: trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/oracle-se/upgrade/6.5.0-6.5.1/add_link_column.sql =================================================================== --- trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/oracle-se/upgrade/6.5.0-6.5.1/add_link_column.sql (rev 0) +++ trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/oracle-se/upgrade/6.5.0-6.5.1/add_link_column.sql 2008-05-16 19:51:30 UTC (rev 1700) @@ -0,0 +1,25 @@ +-- +-- Copyright (C) 2005 Chris Gilbert. 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 +-- + +alter table cms_item_image_attachment add (link_id NUMBER); + +alter table cms_item_image_attachment add + constraint cms_ite_ima_att_lin_id_f_eeymm foreign key (link_id) + references cms_links(link_id); + + Added: trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/postgres/upgrade/6.5.0-6.5.1/add_link_column.sql =================================================================== --- trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/postgres/upgrade/6.5.0-6.5.1/add_link_column.sql (rev 0) +++ trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/postgres/upgrade/6.5.0-6.5.1/add_link_column.sql 2008-05-16 19:51:30 UTC (rev 1700) @@ -0,0 +1,25 @@ +-- +-- Copyright (C) 2005 Chris Gilbert. 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 +-- + +alter table cms_item_image_attachment add link_id INTEGER; + +alter table cms_item_image_attachment add + constraint cms_ite_ima_att_lin_id_f_eeymm foreign key (link_id) + references cms_links(link_id); + + Modified: trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/oracle-se-6.5.0-6.5.1.sql =================================================================== --- trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/oracle-se-6.5.0-6.5.1.sql 2008-05-16 07:09:32 UTC (rev 1699) +++ trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/oracle-se-6.5.0-6.5.1.sql 2008-05-16 19:51:30 UTC (rev 1700) @@ -1,4 +1,4 @@ PROMPT ImageStep 6.5.0 -> 6.5.1 Upgrade Script (Oracle) -@@ ../default/upgrade/6.5.0-6.5.1/add_link_column.sql +@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_link_column.sql Modified: trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/postgres-6.5.0-6.5.1.sql =================================================================== --- trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/postgres-6.5.0-6.5.1.sql 2008-05-16 07:09:32 UTC (rev 1699) +++ trunk/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/postgres-6.5.0-6.5.1.sql 2008-05-16 19:51:30 UTC (rev 1700) @@ -2,6 +2,6 @@ begin; -\i ../default/upgrade/6.5.0-6.5.1/add_link_column.sql +\i ../postgres/upgrade/6.5.0-6.5.1/add_link_column.sql commit; |
Author: pboy Date: 2008-05-16 07:09:32 +0000 (Fri, 16 May 2008) New Revision: 1699 Added: trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/ trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_anonymous_option.sql trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_file_attachments.sql trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_forum_introduction.sql trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_groups.sql trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_image_uploads.sql trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_privileges.sql trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/ trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_anonymous_option.sql trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_file_attachments.sql trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_forum_introduction.sql trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_groups.sql trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_image_uploads.sql trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_privileges.sql trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql Removed: trunk/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/ Modified: trunk/ccm-forum/application.xml trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.5.0-6.5.1.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql Log: Addendum for r1628: - Split of the common update scripts in ~sql/ccm-forum/default/upgrade/ into separate scripts for Oracle and Postgresql to reflect syntax differences. - Add GE relation in application.xml to make the rpm build scripts work. Update still does not work for Postgresql because of an integrity violation in add_privileges.sql. (duplicated key violates Unique-Constraint in acs) Modified: trunk/ccm-forum/application.xml =================================================================== --- trunk/ccm-forum/application.xml 2008-05-16 06:08:00 UTC (rev 1698) +++ trunk/ccm-forum/application.xml 2008-05-16 07:09:32 UTC (rev 1699) @@ -6,14 +6,17 @@ release="1"> <ccm:dependencies> - <ccm:requires name="ccm-core" version="6.5.3"/> - <ccm:requires name="ccm-cms" version="6.5.3"/> + <ccm:requires name="ccm-core" version="6.5.3"/ relation="ge"/> + <ccm:requires name="ccm-cms" version="6.5.3"/ relation="ge"/> </ccm:dependencies> <ccm:contacts> <ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/> <ccm:contact uri="mailto:rh...@re..." type="support"/> </ccm:contacts> <ccm:description> + A threadded forum application for online discussions using the Red Hat + Web Application Framework. + The Red Hat Web Application Framework is a platform for writing database-backed web applications in Java. </ccm:description> Added: trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_anonymous_option.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_anonymous_option.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_anonymous_option.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,3 @@ +alter table forum_forums add (anonymous_posts_allowed CHAR(1)); + +update forum_forums set anonymous_posts_allowed = 0; \ No newline at end of file Added: trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_file_attachments.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_file_attachments.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_file_attachments.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,21 @@ +create table forum_post_files + (post_id NUMBER, + file_id NUMBER not null, + file_order NUMBER); + + + +alter table forum_post_files add + constraint FORU_POS_FILES_FILE_ID_F_XBKED foreign key (file_id) + references cms_files(file_id); + +alter table forum_post_files add + constraint FORU_POS_FILES_POST_ID_F_K0XJQ foreign key (post_id) + references forum_posts(post_id); + +alter table forum_forums add (file_attachments_allowed CHAR(1)); + +update forum_forums set file_attachments_allowed = 0; + + + Added: trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_forum_introduction.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_forum_introduction.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_forum_introduction.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,2 @@ +ALTER TABLE FORUM_FORUMS ADD ( + INTRODUCTION VARCHAR2(4000) ); \ No newline at end of file Added: trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,3 @@ +alter table forum_forums add (no_category_posts_allowed CHAR(1)); + +update forum_forums set no_category_posts_allowed = 1; Added: trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_groups.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_groups.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_groups.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,20 @@ +alter table forum_forums +add (admin_group_id NUMBER, + create_group_id NUMBER, + respond_group_id NUMBER, + read_group_id NUMBER); + + +alter table forum_forums add + constraint foru_foru_admi_grou_id_f_k0nw6 foreign key (admin_group_id) + references groups(group_id); +alter table forum_forums add + constraint foru_foru_crea_grou_id_f_f7x57 foreign key (create_group_id) + references groups(group_id); +alter table forum_forums add + constraint foru_foru_respo_gro_id_f_rnofz foreign key (respond_group_id) + references groups(group_id); +alter table forum_forums add + constraint foru_forum_rea_grou_id_f_itati foreign key (read_group_id) + references groups(group_id); + Added: trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_image_uploads.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_image_uploads.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_image_uploads.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,21 @@ +create table forum_post_images + (post_id NUMBER, + image_id NUMBER not null, + image_order NUMBER); + + + +alter table forum_post_images add + constraint FORU_POS_IMAGE_IMAG_ID_F_WYRXA foreign key (image_id) + references cms_images(image_id); + +alter table forum_post_images add + constraint FORU_POS_IMAGE_POST_ID_F_1HH02 foreign key (post_id) + references forum_posts(post_id); + +alter table forum_forums add (image_uploads_allowed CHAR(1)); + +update forum_forums set image_uploads_allowed = 0; + + + Added: trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_privileges.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_privileges.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_privileges.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,18 @@ +insert into acs_privileges (privilege) +values ('forum_read'); + +insert into acs_privileges (privilege) +values ('forum_create_thread'); + +insert into acs_privileges (privilege) +values ('forum_respond'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_moderation', 'forum_create_thread'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_create_thread', 'forum_respond'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_respond', 'forum_read'); + Added: trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/oracle-se/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,5 @@ +alter table forum_forums add (subscribe_thread_starter CHAR(1)); + +update forum_forums set subscribe_thread_starter = 0; + + Added: trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_anonymous_option.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_anonymous_option.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_anonymous_option.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,3 @@ +alter table forum_forums add anonymous_posts_allowed CHAR(1); + +update forum_forums set anonymous_posts_allowed = 0; Added: trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_file_attachments.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_file_attachments.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_file_attachments.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,21 @@ +create table forum_post_files + (post_id INTEGER, + file_id INTEGER not null, + file_order INTEGER); + +alter table forum_post_files add + constraint FORU_POS_FILES_FILE_ID_F_XBKED foreign key (file_id) + references cms_files(file_id); + +alter table forum_post_files add + constraint FORU_POS_FILES_POST_ID_F_K0XJQ foreign key (post_id) + references forum_posts(post_id); + + + +alter table forum_forums add file_attachments_allowed CHAR(1); + +update forum_forums set file_attachments_allowed = 0; + + + Added: trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_forum_introduction.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_forum_introduction.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_forum_introduction.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,2 @@ +ALTER TABLE FORUM_FORUMS ADD ( + INTRODUCTION VARCHAR2(4000) ); \ No newline at end of file Added: trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,3 @@ +alter table forum_forums add no_category_posts_allowed CHAR(1); + +update forum_forums set no_category_posts_allowed = 1; Added: trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_groups.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_groups.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_groups.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,24 @@ +alter table forum_forums add + admin_group_id INTEGER; +alter table forum_forums add + constraint foru_foru_admi_grou_id_f_k0nw6 foreign key (admin_group_id) + references groups(group_id); + +alter table forum_forums add + create_group_id INTEGER; +alter table forum_forums add + constraint foru_foru_crea_grou_id_f_f7x57 foreign key (create_group_id) + references groups(group_id); + +alter table forum_forums add + respond_group_id INTEGER; +alter table forum_forums add + constraint foru_foru_respo_gro_id_f_rnofz foreign key (respond_group_id) + references groups(group_id); + +alter table forum_forums add + read_group_id INTEGER; +alter table forum_forums add + constraint foru_forum_rea_grou_id_f_itati foreign key (read_group_id) + references groups(group_id); + Added: trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_image_uploads.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_image_uploads.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_image_uploads.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,20 @@ +create table forum_post_images + (post_id INTEGER, + image_id INTEGER not null, + image_order INTEGER); + +alter table forum_post_images add + constraint FORU_POS_IMAGE_IMAG_ID_F_WYRXA foreign key (image_id) + references cms_images(image_id); + +alter table forum_post_images add + constraint FORU_POS_IMAGE_POST_ID_F_1HH02 foreign key (post_id) + references forum_posts(post_id); + + +alter table forum_forums add image_uploads_allowed CHAR(1); + +update forum_forums set image_uploads_allowed = 0; + + + Added: trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_privileges.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_privileges.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_privileges.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,18 @@ +insert into acs_privileges (privilege) +values ('forum_read'); + +insert into acs_privileges (privilege) +values ('forum_create_thread'); + +insert into acs_privileges (privilege) +values ('forum_respond'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_moderation', 'forum_create_thread'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_create_thread', 'forum_respond'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_respond', 'forum_read'); + Added: trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/postgres/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -0,0 +1,5 @@ +alter table forum_forums add subscribe_thread_starter CHAR(1); + +update forum_forums set subscribe_thread_starter = 0; + + Modified: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.5.0-6.5.1.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.5.0-6.5.1.sql 2008-05-16 06:08:00 UTC (rev 1698) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.5.0-6.5.1.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -1,8 +1,8 @@ -@@ ../default/upgrade/6.5.0-6.5.1/add_privileges.sql -@@ ../default/upgrade/6.5.0-6.5.1/add_groups.sql -@@ ../default/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql -@@ ../default/upgrade/6.5.0-6.5.1/add_file_attachments.sql -@@ ../default/upgrade/6.5.0-6.5.1/add_forum_introduction.sql -@@ ../default/upgrade/6.5.0-6.5.1/add_image_uploads.sql -@@ ../default/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql -@@ ../default/upgrade/6.5.0-6.5.1/add_anonymous_option.sql +@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_privileges.sql +@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_groups.sql +@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql +@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_file_attachments.sql +@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_forum_introduction.sql +@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_image_uploads.sql +@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql +@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_anonymous_option.sql Modified: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql 2008-05-16 06:08:00 UTC (rev 1698) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql 2008-05-16 07:09:32 UTC (rev 1699) @@ -1,10 +1,10 @@ -\i ../default/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql -\i ../default/upgrade/6.5.0-6.5.1/add_privileges.sql -\i ../default/upgrade/6.5.0-6.5.1/add_groups.sql -\i ../default/upgrade/6.5.0-6.5.1/add_privileges.sql -\i ../default/upgrade/6.5.0-6.5.1/add_file_attachments.sql -\i ../default/upgrade/6.5.0-6.5.1/add_forum_introduction.sql -\i ../default/upgrade/6.5.0-6.5.1/add_image_uploads.sql -\i ../default/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql -\i ../default/upgrade/6.5.0-6.5.1/add_anonymous_option.sql +\i ../postgres/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql +\i ../postgres/upgrade/6.5.0-6.5.1/add_privileges.sql +\i ../postgres/upgrade/6.5.0-6.5.1/add_groups.sql +\i ../postgres/upgrade/6.5.0-6.5.1/add_privileges.sql +\i ../postgres/upgrade/6.5.0-6.5.1/add_file_attachments.sql +\i ../postgres/upgrade/6.5.0-6.5.1/add_forum_introduction.sql +\i ../postgres/upgrade/6.5.0-6.5.1/add_image_uploads.sql +\i ../postgres/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql +\i ../postgres/upgrade/6.5.0-6.5.1/add_anonymous_option.sql |
From: <pb...@fe...> - 2008-05-16 05:49:01
|
Author: pboy Date: 2008-05-16 06:08:00 +0000 (Fri, 16 May 2008) New Revision: 1698 Modified: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.5.2-6.5.3/cms_task_url_generators_upgrade.sql Log: Fix for r1637: Make the update script work with postgres (some syntax changes so that both can read it). Modified: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.5.2-6.5.3/cms_task_url_generators_upgrade.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.5.2-6.5.3/cms_task_url_generators_upgrade.sql 2008-05-16 05:57:27 UTC (rev 1697) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.5.2-6.5.3/cms_task_url_generators_upgrade.sql 2008-05-16 06:08:00 UTC (rev 1698) @@ -1,6 +1,6 @@ -alter table CMS_TASK_URL_GENERATORS -add (content_type INTEGER); +alter table cms_task_url_generators + add content_type INTEGER; -alter table cms_task_url_generators add - constraint cms_tas_url_gen_con_ty_f_lz1y5 foreign key (content_type) - references content_types(type_id); +alter table cms_task_url_generators + add constraint cms_tas_url_gen_con_ty_f_lz1y5 foreign key (content_type) + references content_types(type_id); |
From: <pb...@fe...> - 2008-05-16 05:38:30
|
Author: pboy Date: 2008-05-16 05:57:27 +0000 (Fri, 16 May 2008) New Revision: 1697 Modified: trunk/ccm-core/sql/ccm-core/default/upgrade/6.5.4-6.5.5/delete-object_1_granted_context-entries.sql trunk/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql trunk/ccm-core/sql/ccm-core/upgrade/postgres-6.5.4-6.5.5.sql Log: Addendum for r1501 and r1586: make the update scripts work with postgres (vacuumdb removed, some syntax adjustments) Modified: trunk/ccm-core/sql/ccm-core/default/upgrade/6.5.4-6.5.5/delete-object_1_granted_context-entries.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/default/upgrade/6.5.4-6.5.5/delete-object_1_granted_context-entries.sql 2008-03-28 09:22:21 UTC (rev 1696) +++ trunk/ccm-core/sql/ccm-core/default/upgrade/6.5.4-6.5.5/delete-object_1_granted_context-entries.sql 2008-05-16 05:57:27 UTC (rev 1697) @@ -20,4 +20,5 @@ and not exists (select 1 from acs_permissions where object_id = pd_object_id); -commit; \ No newline at end of file +commit; + Modified: trunk/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql 2008-03-28 09:22:21 UTC (rev 1696) +++ trunk/ccm-core/sql/ccm-core/postgres/upgrade/6.5.2-6.5.3/clob_message.sql 2008-05-16 05:57:27 UTC (rev 1697) @@ -33,7 +33,11 @@ UPDATE messages SET body = body; -VACUUM FULL messages; +-- VACUUM can not be executed inside a transaction block. (Doesn't matter +-- whether before or after the commit; is a transaction block anyway!) +-- Should be performed after update has finished. +-- VACUUM FULL messages; commit; + Modified: trunk/ccm-core/sql/ccm-core/upgrade/postgres-6.5.4-6.5.5.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/upgrade/postgres-6.5.4-6.5.5.sql 2008-03-28 09:22:21 UTC (rev 1696) +++ trunk/ccm-core/sql/ccm-core/upgrade/postgres-6.5.4-6.5.5.sql 2008-05-16 05:57:27 UTC (rev 1697) @@ -18,4 +18,6 @@ \echo Red Hat WAF 6.5.4 -> 6.5.5 Upgrade Script (PostgreSQL) --- nothing doing, unless someone updates ctx triggers for postgres \ No newline at end of file +-- nothing doing, unless someone updates ctx triggers for postgres +; + |
From: Wantland H. <che...@co...> - 2008-04-12 05:28:06
|
Bonjour, Present unforgettabble night to your bbeloved one, immagine yoourself as a Macho! http://tqbqjw9d2skjce.blogspot.com They repair to such regions. I shall repair to the severest austerities. Thou art born in the light suddenly burst upon the darkness of the to the traylors' with him. She seemed to be glad weapons. Thou art the thunder among weapons, and with me. When macleod first read this passage, biobbedcklps academiae ratio et stoicorum: verum esse autem will spread in the world. Thou shalt then be able opposite to one another, upon the spandrils of battling with samsaptakas or to repair to yudhishthira?' is mentioned, which moves within the soul of the the church's notorious unfaithfulness, in suffering areaaagaaekl they as well as pritha must be very eager to behold diet, and the exercise of the inmates are cared him half so well as by obeying the slightest hint. |
From: Alan P. <ap...@re...> - 2008-03-28 09:56:45
|
test please ignore |
From: <fra...@fe...> - 2007-11-12 17:00:29
|
Author: francois Date: 2007-11-12 18:00:19 +0100 (Mon, 12 Nov 2007) New Revision: 1691 Modified: aplaws/contrib/camden/ccm-ldn-aplaws-camden/trunk/bundles/aplaws-plus-camden/bundle.in aplaws/contrib/camden/ccm-ldn-aplaws-camden/trunk/bundles/aplaws-plus-camden/cfg/web.xml Log: add extras InterenalPrefixerServlet to Camden bundle XML for Viewing options (large, linear and zoom) Modified: aplaws/contrib/camden/ccm-ldn-aplaws-camden/trunk/bundles/aplaws-plus-camden/bundle.in =================================================================== --- aplaws/contrib/camden/ccm-ldn-aplaws-camden/trunk/bundles/aplaws-plus-camden/bundle.in 2007-10-26 13:11:10 UTC (rev 1690) +++ aplaws/contrib/camden/ccm-ldn-aplaws-camden/trunk/bundles/aplaws-plus-camden/bundle.in 2007-11-12 17:00:19 UTC (rev 1691) @@ -1,4 +1,4 @@ BUNDLE_NAME=aplaws-plus-camden BUNDLE_PRETTY_NAME="APLAWS+ Camden Bundle" VERSION=1.0.4 -RELEASE=2 +RELEASE=3 Modified: aplaws/contrib/camden/ccm-ldn-aplaws-camden/trunk/bundles/aplaws-plus-camden/cfg/web.xml =================================================================== --- aplaws/contrib/camden/ccm-ldn-aplaws-camden/trunk/bundles/aplaws-plus-camden/cfg/web.xml 2007-10-26 13:11:10 UTC (rev 1690) +++ aplaws/contrib/camden/ccm-ldn-aplaws-camden/trunk/bundles/aplaws-plus-camden/cfg/web.xml 2007-11-12 17:00:19 UTC (rev 1691) @@ -157,6 +157,45 @@ <param-value>/theme</param-value> </init-param> </servlet> + + <!-- for viewing options --> + <servlet> + <servlet-name>LargeTextServlet</servlet-name> + <display-name>Large Text Output Servlet</display-name> + <servlet-class> + com.arsdigita.web.InternalPrefixerServlet + </servlet-class> + <init-param> + <param-name>prefix</param-name> + <param-value>/large</param-value> + </init-param> + </servlet> + + <servlet> + <servlet-name>LargeLinearTextServlet</servlet-name> + <display-name>Large Linear Text Output Servlet</display-name> + <servlet-class> + com.arsdigita.web.InternalPrefixerServlet + </servlet-class> + <init-param> + <param-name>prefix</param-name> + <param-value>/linear</param-value> + </init-param> + </servlet> + + <servlet> + <servlet-name>HighContrastLinearTextServlet</servlet-name> + <display-name>High Contrast Linear Text Output Servlet</display-name> + <servlet-class> + com.arsdigita.web.InternalPrefixerServlet + </servlet-class> + <init-param> + <param-name>prefix</param-name> + <param-value>/zoom</param-value> + </init-param> + </servlet> + <!-- // end viewing options //--> + <!-- XXX hack --> @@ -280,7 +319,24 @@ <servlet-name>PrintFriendlyServlet</servlet-name> <url-pattern>/print/*</url-pattern> </servlet-mapping> + + <!-- viewing option servlet mapping --> + <servlet-mapping> + <servlet-name>LargeTextServlet</servlet-name> + <url-pattern>/large/*</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>LargeLinearTextServlet</servlet-name> + <url-pattern>/linear/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>HighContrastLinearTextServlet</servlet-name> + <url-pattern>/zoom/*</url-pattern> + </servlet-mapping> + <!--// end viewing option servlet mapping // --> + <!-- /ADDITIONAL SERVLET MAPPINGS --> <error-page> |
From: <chr...@fe...> - 2007-10-26 14:00:19
|
Author: chrisg23 Date: 2007-10-26 16:00:11 +0200 (Fri, 26 Oct 2007) New Revision: 1690 Modified: aplaws/trunk/ccm-cms-types-mparticle/pdl/com/arsdigita/content-types/MultiPartArticle.pdl Log: Bugix - make sure search result links for multipart article sections work in Postgres Modified: aplaws/trunk/ccm-cms-types-mparticle/pdl/com/arsdigita/content-types/MultiPartArticle.pdl =================================================================== --- aplaws/trunk/ccm-cms-types-mparticle/pdl/com/arsdigita/content-types/MultiPartArticle.pdl 2007-10-26 11:06:23 UTC (rev 1689) +++ aplaws/trunk/ccm-cms-types-mparticle/pdl/com/arsdigita/content-types/MultiPartArticle.pdl 2007-10-26 14:00:11 UTC (rev 1690) @@ -47,7 +47,7 @@ from ct_mp_sections a, ct_mp_sections b - where a.page_break=1 + where a.page_break = '1' and a.rank < b.rank and a.article_id = b.article_id and b.section_id = :section |
Author: chrisg23 Date: 2007-10-26 14:00:06 +0200 (Fri, 26 Oct 2007) New Revision: 1689 Added: aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/default/ aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/default/upgrade/ aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/default/upgrade/6.5.0-6.5.1/ aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/upgrade/ aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/upgrade/oracle-se-6.5.0-6.5.1.sql aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/upgrade/postgres-6.5.0-6.5.1.sql aplaws/trunk/ccm-cms-types-contact/src/ccm-cms-types-contact.upgrade aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/AddContactPropertiesStep.java aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/AddContactToItemForm.java Modified: aplaws/trunk/ccm-cms-types-contact/application.xml aplaws/trunk/ccm-cms-types-contact/pdl/com/arsdigita/content-types/Contact.pdl aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactInitializer.java aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactResources.properties aplaws/trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig.java aplaws/trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties Log: Sourceforge Patch [1820586] - allow contact content items to be added as an asset to other content items Modified: aplaws/trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig.java =================================================================== --- aplaws/trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig.java 2007-10-26 09:28:41 UTC (rev 1688) +++ aplaws/trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig.java 2007-10-26 12:00:06 UTC (rev 1689) @@ -123,6 +123,7 @@ private final Parameter m_deleteLifecycleWhenComplete; private final Parameter m_deleteExpiryNotificationsWhenSent; private final Parameter m_deleteWorkflowNotificationsWhenSent; + private final Parameter m_hasContactsAuthoringStep; private final Parameter m_categoryTreeOrdering; /** @@ -353,6 +354,11 @@ ((EnumerationParameter)m_categoryTreeOrdering).put("SortKey", Category.SORT_KEY ); ((EnumerationParameter)m_categoryTreeOrdering).put("Alphabetical", Category.NAME); + m_hasContactsAuthoringStep = new BooleanParameter + ("com.arsdigita.cms.has_contacts_authoring_step", + Parameter.REQUIRED, new Boolean(false)); + + register(m_templateRootPath); register(m_defaultItemTemplatePath); register(m_defaultFolderTemplatePath); @@ -399,6 +405,7 @@ register(m_deleteExpiryNotificationsWhenSent); register(m_deleteWorkflowNotificationsWhenSent); register(m_categoryTreeOrdering); + register(m_hasContactsAuthoringStep); loadInfo(); } @@ -739,5 +746,10 @@ public String getCategoryTreeOrder () { return (String)get(m_categoryTreeOrdering); - } + } + + public boolean getHasContactsAuthoringStep() { + return ((Boolean) get(m_hasContactsAuthoringStep)).booleanValue(); + } + } Modified: aplaws/trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties =================================================================== --- aplaws/trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties 2007-10-26 09:28:41 UTC (rev 1688) +++ aplaws/trunk/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties 2007-10-26 12:00:06 UTC (rev 1689) @@ -227,3 +227,8 @@ com.arsdigita.cms.category_tree_order.purpose=Decide whether entries should be ordered alphabetically or according to sort key (maintained in category admin tab in content centre) com.arsdigita.cms.category_tree_order.example=SortKey|Alphabetical com.arsdigita.cms.category_tree_order.format=[string] + +com.arsdigita.cms.has_contacts_authoring_step.title=Contacts for content items +com.arsdigita.cms.has_contacts_authoring_step.purpose=Allows you to add a Contact authoring step to all items +com.arsdigita.cms.has_contacts_authoring_step.example=false +com.arsdigita.cms.has_contacts_authoring_step.format=[boolean] Modified: aplaws/trunk/ccm-cms-types-contact/application.xml =================================================================== --- aplaws/trunk/ccm-cms-types-contact/application.xml 2007-10-26 09:28:41 UTC (rev 1688) +++ aplaws/trunk/ccm-cms-types-contact/application.xml 2007-10-26 12:00:06 UTC (rev 1689) @@ -2,7 +2,7 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-cms-types-contact" prettyName="Red Hat CCM Content Types" - version="6.5.0" + version="6.5.1" release="1" webapp="ROOT"> <ccm:dependencies> Modified: aplaws/trunk/ccm-cms-types-contact/pdl/com/arsdigita/content-types/Contact.pdl =================================================================== --- aplaws/trunk/ccm-cms-types-contact/pdl/com/arsdigita/content-types/Contact.pdl 2007-10-26 09:28:41 UTC (rev 1688) +++ aplaws/trunk/ccm-cms-types-contact/pdl/com/arsdigita/content-types/Contact.pdl 2007-10-26 12:00:06 UTC (rev 1689) @@ -20,6 +20,7 @@ model com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentPage; +import com.arsdigita.cms.ContentItem; // object type to hold Contact content type object type Contact extends ContentPage { @@ -43,3 +44,46 @@ reference key ( ct_contacts.contact_id ); } + +association { + + Contact[0..1] associatedContactForItem = + join cms_items.item_id to contact_content_item_map.item_id, + join contact_content_item_map.contact_id to ct_contacts.contact_id; + ContentItem[0..n] associatedContentItemsForContact = + join ct_contacts.contact_id to contact_content_item_map.contact_id, + join contact_content_item_map.item_id to cms_items.item_id; + + } + +// the above association works fine for adding but for some strange reason when +// you try to remove an item from the association it also tries to delete it +// so instead you have to use a data operation + +data operation removeContactFromContentItemAssociation { + do { + delete from contact_content_item_map where item_id = :itemID + } +} + +data operation removeContactFromAllAssociations { + do { + delete from contact_content_item_map where contact_id = :contactID + } +} + +query getContactForItem { + BigDecimal contactID; + BigDecimal itemID; + do { + select contact_id, item_id + from + contact_content_item_map + where + item_id = :itemID + } map { + contactID = contact_id; + itemID = item_id; + } +} + Added: aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql =================================================================== --- aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql (rev 0) +++ aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql 2007-10-26 12:00:06 UTC (rev 1689) @@ -0,0 +1,16 @@ +create table contact_content_item_map ( + item_id INTEGER not null + constraint cont_con_ite_map_ite_i_p_scqe9 + primary key, + -- referential constraint for item_id deferred due to circular dependencies + contact_id INTEGER not null + -- referential constraint for contact_id deferred due to circular dependencies +); + + +alter table contact_content_item_map add + constraint cont_con_ite_map_con_i_f_lanid foreign key (contact_id) + references ct_contacts(contact_id); +alter table contact_content_item_map add + constraint cont_con_ite_map_ite_i_f_fr0po foreign key (item_id) + references cms_items(item_id); Added: aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/upgrade/oracle-se-6.5.0-6.5.1.sql =================================================================== --- aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/upgrade/oracle-se-6.5.0-6.5.1.sql (rev 0) +++ aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/upgrade/oracle-se-6.5.0-6.5.1.sql 2007-10-26 12:00:06 UTC (rev 1689) @@ -0,0 +1,19 @@ +-- +-- Copyright (C) 2007 Magpie. 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 +-- + +@@ ../default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql \ No newline at end of file Added: aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/upgrade/postgres-6.5.0-6.5.1.sql =================================================================== --- aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/upgrade/postgres-6.5.0-6.5.1.sql (rev 0) +++ aplaws/trunk/ccm-cms-types-contact/sql/ccm-cms-types-contact/upgrade/postgres-6.5.0-6.5.1.sql 2007-10-26 12:00:06 UTC (rev 1689) @@ -0,0 +1,21 @@ +-- +-- Copyright (C) 2007 Magpie. All Rights Reserved. +-- +-- The contents of this file are subject to the CCM Public +-- License (the "License"); you may not use this file except in +-- compliance with the License. You may obtain a copy of the +-- License at http://www.redhat.com/licenses/ccmpl.html. +-- +-- Software distributed under the License is distributed on an +-- "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express +-- or implied. See the License for the specific language governing +-- rights and limitations under the License. +-- + +\echo Red Hat Enterprise CMS 6.5.0 -> 6.5.1 Upgrade Script (PostgreSQL) + +begin; + +\i ../default/upgrade/6.5.0-6.5.1/contact_content_item_map_table.sql + +commit; Added: aplaws/trunk/ccm-cms-types-contact/src/ccm-cms-types-contact.upgrade =================================================================== --- aplaws/trunk/ccm-cms-types-contact/src/ccm-cms-types-contact.upgrade (rev 0) +++ aplaws/trunk/ccm-cms-types-contact/src/ccm-cms-types-contact.upgrade 2007-10-26 12:00:06 UTC (rev 1689) @@ -0,0 +1,5 @@ +<upgrade> + <version from="6.5.0" to="6.5.1"> + <script sql="ccm-cms-types-contact/upgrade/::database::-6.5.0-6.5.1.sql"/> + </version> +</upgrade> \ No newline at end of file Modified: aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java =================================================================== --- aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java 2007-10-26 09:28:41 UTC (rev 1688) +++ aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/Contact.java 2007-10-26 12:00:06 UTC (rev 1689) @@ -20,13 +20,19 @@ import java.math.BigDecimal; +import org.apache.log4j.Logger; + +import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.ContentType; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.persistence.DataAssociation; import com.arsdigita.persistence.DataAssociationCursor; import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.DataOperation; +import com.arsdigita.persistence.DataQuery; import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.SessionManager; import com.arsdigita.util.Assert; /** * @@ -41,8 +47,10 @@ public class Contact extends ContentPage { /** PDL property names */ - /*Flattened out Person object properties.Next 3 properties can be moved - * out to seperate object if needed.*/ + /* + * Flattened out Person object properties.Next 3 properties can be moved out + * to seperate object if needed. + */ public static final String GIVEN_NAME = "givenName"; public static final String FAMILY_NAME = "familyName"; public static final String SUFFIX = "suffix"; @@ -58,9 +66,12 @@ public static final String CONTACT_ADDRESS = "contactAddress"; public static final String PHONES = "phones"; + public static final String ITEMS = "associatedContentItemsForContact"; + + private static final Logger s_log = Logger.getLogger(Contact.class); + /** data object type for this domain object */ - public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.contenttypes.Contact"; + public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Contact"; /** Default constructor. */ public Contact() { @@ -68,6 +79,74 @@ } /** + * Adds an association between this contact and the given content item. + * @param item + */ + public void addContentItem(ContentItem item) { + s_log.debug("item is " + item); + item.addToAssociation(getItemsForContact()); + } + + /** + * Deletes the association between this contact and the given content item. + * @param item + */ + public void removeContentItem(ContentItem item) { + s_log.debug("item is " + item); + DataOperation operation = SessionManager + .getSession() + .retrieveDataOperation( + "com.arsdigita.cms.contenttypes.removeContactFromContentItemAssociation"); + operation.setParameter("itemID", new Integer(item.getID().intValue())); + operation.execute(); + } + + /** + * Removes all mappings between this contact and any other content item. + * + */ + private void removeItemMappings() { + DataOperation operation = SessionManager + .getSession() + .retrieveDataOperation("com.arsdigita.cms.contenttypes.removeContactFromAllAssociations"); + operation.setParameter("contactID", new Integer(this.getID().intValue())); + operation.execute(); + } + + + /** + * Gets the DataAssociation that holds the mapping between this contact and any content items. + * @return + */ + public DataAssociation getItemsForContact() { + return (DataAssociation) get(ITEMS); + } + + + /** + * Returns the Contact for a given content item. + * @param item + * @return + */ + public static Contact getContactForItem(ContentItem item) { + s_log.debug("getting contact for item " + item); + DataQuery query = SessionManager.getSession().retrieveQuery( + "com.arsdigita.cms.contenttypes.getContactForItem"); + query.setParameter("itemID", item.getID()); + BigDecimal contactID; + Contact contact = null; + while (query.next()) { + contactID = (BigDecimal) query.get("contactID"); + contact = new Contact(contactID); + } + s_log.debug("returning contact " + contact); + return contact; + } + + + + + /** * Constructor. Retrieves an object instance with the given id. * @param id the id of the object to retrieve */ Modified: aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactInitializer.java =================================================================== --- aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactInitializer.java 2007-10-26 09:28:41 UTC (rev 1688) +++ aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactInitializer.java 2007-10-26 12:00:06 UTC (rev 1689) @@ -20,6 +20,14 @@ import java.util.ArrayList; +import com.arsdigita.cms.ContentPage; +import com.arsdigita.cms.ContentSection; +import com.arsdigita.cms.contenttypes.ui.contact.AddContactPropertiesStep; +import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; +import com.arsdigita.domain.SimpleDomainObjectTraversalAdapter; +import com.arsdigita.globalization.GlobalizedMessage; +import com.arsdigita.runtime.LegacyInitEvent; + /** * Initializer class to initialize <code>ContentType <code>Contact</code>. * @@ -61,4 +69,51 @@ return phoneTypesList; } + public void init(LegacyInitEvent evt) { + super.init(evt); + + if (ContentSection.getConfig().getHasContactsAuthoringStep()) { + + // Add the "Contact"authoring step + AuthoringKitWizard.registerAssetStep(getBaseType(), + getAuthoringStep(), getAuthoringStepLabel(), + getAuthoringStepDescription(), getAuthoringStepSortKey()); + + // and sort out the display - at the moment this is just the basic properties, addresses and phones + ContentItemTraversalAdapter associatedContactTraversalAdapter = new ContentItemTraversalAdapter(); + associatedContactTraversalAdapter.addAssociationProperty("/object/phones"); + associatedContactTraversalAdapter.addAssociationProperty("/object/contactAddress"); + + ContentItemTraversalAdapter.registerAssetAdapter( + "associatedContactForItem", + associatedContactTraversalAdapter, + "com.arsdigita.cms.dispatcher.SimpleXMLGenerator"); } + + } + + private int getAuthoringStepSortKey() { + // TODO - workout what this does and possibly make it configurable + return 1; + } + + private GlobalizedMessage getAuthoringStepDescription() { + return new GlobalizedMessage( + "com.arsdigita.cms.contenttypes.contact_authoring_step_description", + "com.arsdigita.cms.contenttypes.ContactResources"); + } + + private GlobalizedMessage getAuthoringStepLabel() { + return new GlobalizedMessage( + "com.arsdigita.cms.contenttypes.contact_authoring_step_label", + "com.arsdigita.cms.contenttypes.ContactResources"); + } + + private Class getAuthoringStep() { + return AddContactPropertiesStep.class; + } + + private String getBaseType() { + return ContentPage.BASE_DATA_OBJECT_TYPE; + } +} Modified: aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactResources.properties =================================================================== --- aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactResources.properties 2007-10-26 09:28:41 UTC (rev 1688) +++ aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ContactResources.properties 2007-10-26 12:00:06 UTC (rev 1689) @@ -19,3 +19,8 @@ cms.contenttypes.ui.contact.phone_number=Number cms.contenttypes.ui.phone_type=Types cms.contenttypes.ui.contact_emails=Emails +com.arsdigita.cms.contenttypes.contact_authoring_step_description=Contact +com.arsdigita.cms.contenttypes.contact_authoring_step_label=Contact +cms.contenttypes.ui.name=Name +cms.contenttypes.ui.title=Title +cms.contenttypes.ui.description=Description Added: aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/AddContactPropertiesStep.java =================================================================== --- aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/AddContactPropertiesStep.java (rev 0) +++ aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/AddContactPropertiesStep.java 2007-10-26 12:00:06 UTC (rev 1689) @@ -0,0 +1,240 @@ +package com.arsdigita.cms.contenttypes.ui.contact; + +import org.apache.log4j.Logger; + +import com.arsdigita.bebop.Component; +import com.arsdigita.bebop.Form; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.FormSection; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.RequestLocal; +import com.arsdigita.bebop.event.FormInitListener; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.util.GlobalizationUtil; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.Contact; +import com.arsdigita.cms.contenttypes.ui.ResettableContainer; +import com.arsdigita.cms.contenttypes.util.ContactGlobalizationUtil; +import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; +import com.arsdigita.cms.ui.workflow.WorkflowLockedContainer; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; +import com.arsdigita.util.Assert; + +public class AddContactPropertiesStep extends ResettableContainer { + + private static final Logger s_log = Logger + .getLogger(AddContactPropertiesStep.class); + + public static final String EDIT_SHEET_NAME = "edit"; + + public Form m_form; + + private ItemSelectionModel m_itemSelectionModel; + + public ContactSelectionModel m_contactSelectionModel; + + private AuthoringKitWizard m_parent; + + protected Component m_contactPropertySheet; + + private ContactDisplay m_display; + + public AddContactPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + + m_parent = parent; + m_itemSelectionModel = itemModel; + m_contactSelectionModel = new ContactSelectionModel( + m_itemSelectionModel); + + Form display = new Form("display"); + display.add(getContactDisplay()); + add(display); + + m_form = new Form("contactSearchForm"); + m_form.add(getFindContactSheet()); + + WorkflowLockedContainer edit = new WorkflowLockedContainer(itemModel); + edit.add(m_form); + add(edit); + + } + + protected Component getContactDisplay() { + m_display = new ContactDisplay(); + return m_display; + } + + public void toggleDisplay(PageState state) throws FormProcessException { + m_display.toggle(state); + } + + private Component getFindContactSheet() { + return new AddContactToItemForm(this); + } + + public ItemSelectionModel getItemSelectionModel() { + return m_itemSelectionModel; + } + + public ItemSelectionModel getContactSelectionModel() { + return m_contactSelectionModel; + } + + public AuthoringKitWizard getParent() { + return m_parent; + } + + public ContentItem getItem(PageState state) { + return m_itemSelectionModel.getSelectedItem(state); + } + + public Contact getContact(PageState state) { + return (Contact) m_contactSelectionModel.getSelectedItem(state); + } + + protected class ContactSelectionModel extends ItemSelectionModel { + + private RequestLocal m_contact; + + public ContactSelectionModel(ItemSelectionModel m) { + super(m); + + m_contact = new RequestLocal() { + protected Object initialValue(PageState s) { + ContentItem item = (ContentItem) ((ItemSelectionModel) getSingleSelectionModel()) + .getSelectedObject(s); + Assert.assertNotNull(item); + return Contact.getContactForItem(item); + + } + }; + } + + public Object getSelectedKey(PageState s) { + Contact contact = (Contact) getSelectedObject(s); + return (contact == null) ? null : contact.getID(); + } + + public DomainObject getSelectedObject(PageState s) { + return (DomainObject) m_contact.get(s); + } + + public void setSelectedObject(PageState s, DomainObject o) { + m_contact.set(s, o); + } + + public void setSelectedKey(PageState s, Object key) { + throw new UnsupportedOperationException((String) GlobalizationUtil + .globalize("cms.ui.authoring.not_implemented").localize()); + } + + public boolean isSelected(PageState s) { + return (getSelectedObject(s) != null); + } + } + + private class ContactDisplay extends FormSection implements + FormInitListener { + + private Label m_noContact; + + public ContactDisplay() { + + addInitListener(this); + addWidgets(); + } + + public void toggle(PageState state) { + s_log.debug("toggle"); + m_contactPropertySheet.setVisible(state, false); + m_noContact.setVisible(state, true); + + } + + private void addWidgets() { + m_contactPropertySheet = getContactPropertySheet(m_contactSelectionModel); + m_noContact = new Label("This item does not have a contact."); + m_noContact.setFontWeight(Label.ITALIC); + add(m_contactPropertySheet); + add(m_noContact); + } + + public void init(FormSectionEvent e) throws FormProcessException { + s_log.debug("init"); + PageState state = e.getPageState(); + if (m_contactSelectionModel.getSelectedItem(state) != null) { + m_contactPropertySheet.setVisible(state, true); + m_noContact.setVisible(state, false); + } else { + m_noContact.setVisible(state, true); + m_contactPropertySheet.setVisible(state, false); + } + + } + + private Component getContactPropertySheet(ItemSelectionModel itemModel) { + DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( + itemModel); + sheet.add(ContactGlobalizationUtil + .globalize("cms.contenttypes.ui.name"), Contact.NAME); + + sheet.add(ContactGlobalizationUtil + .globalize("cms.contenttypes.ui.title"), Contact.TITLE); + + sheet.add(ContactGlobalizationUtil + .globalize("cms.contenttypes.ui.contact_givenname"), + Contact.GIVEN_NAME); + + sheet.add(ContactGlobalizationUtil + .globalize("cms.contenttypes.ui.contact_familyname"), + Contact.FAMILY_NAME); + + sheet.add(ContactGlobalizationUtil + .globalize("cms.contenttypes.ui.contact_type"), + Contact.CONTACT_TYPE, + new DomainObjectPropertySheet.AttributeFormatter() { + public String format(DomainObject item, + String attribute, PageState state) { + Contact contact = (Contact) item; + if (contact != null + && contact.getContactType() != null) { + return contact.getContactTypeName(); + } else { + return "unknown"; + } + } + }); + + sheet.add(ContactGlobalizationUtil + .globalize("cms.contenttypes.ui.description"), + Contact.DESCRIPTION); + + sheet.add(ContactGlobalizationUtil + .globalize("cms.contenttypes.ui.contact_emails"), + Contact.EMAILS); + + sheet.add(ContactGlobalizationUtil + .globalize("cms.contenttypes.ui.contact_suffix"), + Contact.SUFFIX); + + sheet.add(ContactGlobalizationUtil + .globalize("cms.contenttypes.ui.contact_orgname"), + Contact.ORG_NAME); + + sheet.add(ContactGlobalizationUtil + .globalize("cms.contenttypes.ui.contact_deptname"), + Contact.DEPT_NAME); + + sheet.add(ContactGlobalizationUtil + .globalize("cms.contenttypes.ui.contact_role"), + Contact.ROLE); + return sheet; + } + + } + +} Added: aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/AddContactToItemForm.java =================================================================== --- aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/AddContactToItemForm.java (rev 0) +++ aplaws/trunk/ccm-cms-types-contact/src/com/arsdigita/cms/contenttypes/ui/contact/AddContactToItemForm.java 2007-10-26 12:00:06 UTC (rev 1689) @@ -0,0 +1,151 @@ +package com.arsdigita.cms.contenttypes.ui.contact; + +import com.arsdigita.bebop.ActionLink; +import com.arsdigita.bebop.ColumnPanel; +import com.arsdigita.bebop.FormData; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.FormSection; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SaveCancelSection; +import com.arsdigita.bebop.event.ActionEvent; +import com.arsdigita.bebop.event.ActionListener; +import com.arsdigita.bebop.event.FormInitListener; +import com.arsdigita.bebop.event.FormProcessListener; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.event.FormSubmissionListener; +import com.arsdigita.bebop.event.FormValidationListener; +import com.arsdigita.bebop.util.GlobalizationUtil; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.Contact; +import com.arsdigita.cms.ui.ItemSearchWidget; +import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; + +public class AddContactToItemForm extends FormSection implements + FormInitListener, FormValidationListener, FormProcessListener, + FormSubmissionListener { + + private ContentItem m_item; + + private ItemSearchWidget m_itemSearch; + + private SaveCancelSection m_saveCancelSection; + + private ItemSelectionModel m_itemSelectionModel; + + private final String CONTACT_SEARCH = "contact"; + + private Contact m_contact; + + private Label m_searchFormLabel; + + private AddContactPropertiesStep m_step; + + private AuthoringKitWizard m_parent; + + private Label m_removeLinkText = new Label(GlobalizationUtil + .globalize("Remove contact")); + + private ActionLink m_removeLink; + + public AddContactToItemForm(AddContactPropertiesStep step) { + m_step = step; + m_parent = m_step.getParent(); + + m_itemSelectionModel = m_step.getItemSelectionModel(); + addInitListener(this); + addWidgets(); + addSaveCancelSection(); + addProcessListener(this); + addValidationListener(this); + addSubmissionListener(this); + + } + + public void addWidgets() { + + m_removeLink = new ActionLink(m_removeLinkText); + + m_removeLink.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + Contact contact = m_step.getContact(e.getPageState()); + if (contact != null) { + PageState state = e.getPageState(); + contact.removeContentItem(m_step.getItem(state)); + m_step.m_contactSelectionModel.setSelectedObject(state, + null); + try { + m_step.toggleDisplay(state); + } catch (FormProcessException e1) { + e1.printStackTrace(); + } + } + } + }); + + add(m_removeLink, ColumnPanel.FULL_WIDTH); + + m_searchFormLabel = new Label("Search for Contact:"); + add(m_searchFormLabel); + m_itemSearch = new ItemSearchWidget(CONTACT_SEARCH, + Contact.BASE_DATA_OBJECT_TYPE); + add(m_itemSearch); + } + + public AddContactToItemForm getThis() { + return this; + } + + /** Adds the saveCancelSection */ + public void addSaveCancelSection() { + m_saveCancelSection = new SaveCancelSection(); + m_saveCancelSection.getSaveButton().setButtonLabel("Add"); + add(m_saveCancelSection, ColumnPanel.FULL_WIDTH); + } + + protected ContentItem getContentItem(PageState s) { + return (ContentItem) m_itemSelectionModel.getSelectedObject(s); + } + + public void validate(FormSectionEvent e) throws FormProcessException { + FormData data = e.getFormData(); + if (data.get(CONTACT_SEARCH) == null) { + throw new FormProcessException("Contact selection is required."); + } + } + + public void process(FormSectionEvent e) throws FormProcessException { + FormData data = e.getFormData(); + PageState ps = e.getPageState(); + m_contact = (Contact) data.get(CONTACT_SEARCH); + m_contact.addContentItem(getContentItem(ps)); + init(e); + } + + public void submitted(FormSectionEvent e) throws FormProcessException { + if (m_saveCancelSection.getCancelButton().isSelected(e.getPageState())) { + m_parent.reset(e.getPageState()); + throw new FormProcessException("cancelled"); + } + } + + public void init(FormSectionEvent e) throws FormProcessException { + PageState ps = e.getPageState(); + m_item = getContentItem(ps); + m_contact = Contact.getContactForItem(m_item); + if (m_contact != null) { + m_removeLink.setVisible(ps, true); + m_searchFormLabel.setVisible(ps, false); + m_itemSearch.setVisible(ps, false); + m_saveCancelSection.setVisible(ps, false); + } else { + m_removeLink.setVisible(ps, false); + m_searchFormLabel.setVisible(ps, true); + m_itemSearch.setVisible(ps, true); + m_saveCancelSection.setVisible(ps, true); + } + } + +} |