From 06eec8f86ee8d8740512b915491f7e1106cf4101 Mon Sep 17 00:00:00 2001 From: pb Date: Sun, 17 Apr 2011 07:54:01 +0000 Subject: [PATCH] =?UTF-8?q?Neues=20Modul=20ccm-faq.=20Ist=20ein=20port=20d?= =?UTF-8?q?es=20Moduls=20aus=20Byline=20/=20original=20Red=20Hat=20CCM.=20?= =?UTF-8?q?Abfallprodukt=20der=20Bech=C3=A4ftigung=20mit=20ccm-docmgr=20un?= =?UTF-8?q?d=20lie=C3=9F=20sich=20mit=20wenigen=20Anpassungen=20am=20Initi?= =?UTF-8?q?alizer=20zum=20Laufen=20bringen.=20Legt=20eine=20oder=20mehrere?= =?UTF-8?q?=20FAQ=20Instanzen=20unabh=C3=A4ngig=20von=20CMS=20und=20dem=20?= =?UTF-8?q?entsprechenden=20content=20typ=20an.=20Per=20default=20wird=20e?= =?UTF-8?q?ine=20Instanz=20unter=20/ccm/faq=20installiert.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@859 8810af33-2d31-482b-a856-94f89814c4df --- ccm-faq/application.xml | 24 ++ ccm-faq/doc/package.html | 16 + ccm-faq/etc/enterprise.init.in | 1 + ccm-faq/pdl/com/arsdigita/faq/Faq.pdl | 60 +++ .../com/arsdigita/faq/FaqQuestionsPortlet.pdl | 26 ++ .../index-faq_questions_faq_id_idx.sql | 21 + ccm-faq/sql/ccm-faq/oracle-se-create.sql | 26 ++ ccm-faq/sql/ccm-faq/postgres-create.sql | 29 ++ .../ccm-faq/upgrade/oracle-se-6.x.y-6.x.z.sql | 23 + .../ccm-faq/upgrade/postgres-6.x.y-6.x.z.sql | 30 ++ ccm-faq/src/ccm-faq.config | 4 + ccm-faq/src/ccm-faq.load | 14 + ccm-faq/src/ccm-faq.upgrade | 6 + .../ApplicationAuthenticationListener.java | 114 +++++ ccm-faq/src/com/arsdigita/faq/Faq.java | 162 ++++++++ .../src/com/arsdigita/faq/FaqDispatcher.java | 94 +++++ .../com/arsdigita/faq/FaqResources.properties | 7 + .../arsdigita/faq/FaqResources_de.properties | 7 + .../arsdigita/faq/FaqResources_en.properties | 7 + .../src/com/arsdigita/faq/Initializer.java | 112 +++++ ccm-faq/src/com/arsdigita/faq/Loader.java | 170 ++++++++ .../src/com/arsdigita/faq/OldInitializer.java | 223 ++++++++++ ccm-faq/src/com/arsdigita/faq/QAPair.java | 117 ++++++ ccm-faq/src/com/arsdigita/faq/Util.java | 35 ++ .../arsdigita/faq/ui/AdminQuestionTable.java | 112 +++++ .../arsdigita/faq/ui/AdminQuestionView.java | 131 ++++++ .../arsdigita/faq/ui/AdminQuestionsPane.java | 122 ++++++ .../com/arsdigita/faq/ui/FaqAdminView.java | 38 ++ .../src/com/arsdigita/faq/ui/FaqBasePage.java | 383 +++++++++++++++++ ccm-faq/src/com/arsdigita/faq/ui/FaqPage.java | 120 ++++++ .../faq/ui/FaqQuestionEntryForm.java | 207 +++++++++ .../arsdigita/faq/ui/FaqQuestionsPortlet.java | 43 ++ .../faq/ui/FaqQuestionsPortletRenderer.java | 69 +++ .../src/com/arsdigita/faq/ui/FaqUserView.java | 38 ++ ccm-faq/src/com/arsdigita/faq/ui/QAList.java | 82 ++++ ccm-faq/src/com/arsdigita/faq/ui/QAView.java | 48 +++ .../arsdigita/faq/util/GlobalizationUtil.java | 45 ++ .../src/com/arsdigita/faq/PopulateFaq.java | 89 ++++ ccm-faq/web/__ccm__/apps/faq/xsl/index.xsl | 6 + ccm-faq/web/assets/cw/applications/faq-32.gif | Bin 0 -> 1193 bytes ccm-faq/web/packages/faq/xsl/comments.xsl | 235 +++++++++++ ccm-faq/web/packages/faq/xsl/faq.xsl | 393 ++++++++++++++++++ 42 files changed, 3489 insertions(+) create mode 100644 ccm-faq/application.xml create mode 100644 ccm-faq/doc/package.html create mode 100644 ccm-faq/etc/enterprise.init.in create mode 100644 ccm-faq/pdl/com/arsdigita/faq/Faq.pdl create mode 100644 ccm-faq/pdl/com/arsdigita/faq/FaqQuestionsPortlet.pdl create mode 100644 ccm-faq/sql/ccm-faq/default/index-faq_questions_faq_id_idx.sql create mode 100644 ccm-faq/sql/ccm-faq/oracle-se-create.sql create mode 100644 ccm-faq/sql/ccm-faq/postgres-create.sql create mode 100644 ccm-faq/sql/ccm-faq/upgrade/oracle-se-6.x.y-6.x.z.sql create mode 100644 ccm-faq/sql/ccm-faq/upgrade/postgres-6.x.y-6.x.z.sql create mode 100644 ccm-faq/src/ccm-faq.config create mode 100644 ccm-faq/src/ccm-faq.load create mode 100644 ccm-faq/src/ccm-faq.upgrade create mode 100644 ccm-faq/src/com/arsdigita/faq/ApplicationAuthenticationListener.java create mode 100644 ccm-faq/src/com/arsdigita/faq/Faq.java create mode 100644 ccm-faq/src/com/arsdigita/faq/FaqDispatcher.java create mode 100644 ccm-faq/src/com/arsdigita/faq/FaqResources.properties create mode 100644 ccm-faq/src/com/arsdigita/faq/FaqResources_de.properties create mode 100644 ccm-faq/src/com/arsdigita/faq/FaqResources_en.properties create mode 100644 ccm-faq/src/com/arsdigita/faq/Initializer.java create mode 100644 ccm-faq/src/com/arsdigita/faq/Loader.java create mode 100644 ccm-faq/src/com/arsdigita/faq/OldInitializer.java create mode 100644 ccm-faq/src/com/arsdigita/faq/QAPair.java create mode 100644 ccm-faq/src/com/arsdigita/faq/Util.java create mode 100644 ccm-faq/src/com/arsdigita/faq/ui/AdminQuestionTable.java create mode 100644 ccm-faq/src/com/arsdigita/faq/ui/AdminQuestionView.java create mode 100644 ccm-faq/src/com/arsdigita/faq/ui/AdminQuestionsPane.java create mode 100644 ccm-faq/src/com/arsdigita/faq/ui/FaqAdminView.java create mode 100644 ccm-faq/src/com/arsdigita/faq/ui/FaqBasePage.java create mode 100644 ccm-faq/src/com/arsdigita/faq/ui/FaqPage.java create mode 100644 ccm-faq/src/com/arsdigita/faq/ui/FaqQuestionEntryForm.java create mode 100644 ccm-faq/src/com/arsdigita/faq/ui/FaqQuestionsPortlet.java create mode 100644 ccm-faq/src/com/arsdigita/faq/ui/FaqQuestionsPortletRenderer.java create mode 100644 ccm-faq/src/com/arsdigita/faq/ui/FaqUserView.java create mode 100644 ccm-faq/src/com/arsdigita/faq/ui/QAList.java create mode 100644 ccm-faq/src/com/arsdigita/faq/ui/QAView.java create mode 100644 ccm-faq/src/com/arsdigita/faq/util/GlobalizationUtil.java create mode 100644 ccm-faq/test/src/com/arsdigita/faq/PopulateFaq.java create mode 100644 ccm-faq/web/__ccm__/apps/faq/xsl/index.xsl create mode 100644 ccm-faq/web/assets/cw/applications/faq-32.gif create mode 100644 ccm-faq/web/packages/faq/xsl/comments.xsl create mode 100644 ccm-faq/web/packages/faq/xsl/faq.xsl diff --git a/ccm-faq/application.xml b/ccm-faq/application.xml new file mode 100644 index 000000000..e42e67400 --- /dev/null +++ b/ccm-faq/application.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + An application for managing persisted faq. Useful for team + bookmarking, or accessing personal faq remotely. + + + diff --git a/ccm-faq/doc/package.html b/ccm-faq/doc/package.html new file mode 100644 index 000000000..01d8449c5 --- /dev/null +++ b/ccm-faq/doc/package.html @@ -0,0 +1,16 @@ + + + +com.arsdigita.faq + + + +

+ The FAQ packages provide functionality for maintaining + collections of questions and answers. + +

+ + + + diff --git a/ccm-faq/etc/enterprise.init.in b/ccm-faq/etc/enterprise.init.in new file mode 100644 index 000000000..6077dc177 --- /dev/null +++ b/ccm-faq/etc/enterprise.init.in @@ -0,0 +1 @@ +init com.arsdigita.faq.Initializer { } diff --git a/ccm-faq/pdl/com/arsdigita/faq/Faq.pdl b/ccm-faq/pdl/com/arsdigita/faq/Faq.pdl new file mode 100644 index 000000000..25e8fee54 --- /dev/null +++ b/ccm-faq/pdl/com/arsdigita/faq/Faq.pdl @@ -0,0 +1,60 @@ +// +// Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of +// the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $Id: //apps/faq/dev/pdl/com/arsdigita/faq/Faq.pdl#3 $ +// $DateTime: 2004/08/17 23:26:27 $ +model com.arsdigita.faq; + +import com.arsdigita.kernel.ACSObject; + +import com.arsdigita.web.Application; + +object type Faq extends Application { + + component QAPair[0..n] questions = + join faqs.faq_id to faq_questions.faq_id; + + reference key (faqs.faq_id); + +} + + +object type QAPair extends ACSObject { + + String question = faq_questions.question VARCHAR(1000); + String answer = faq_questions.answer VARCHAR(1000); + String answerFormat = faq_questions.answer_format VARCHAR(100); + Integer sortKey = faq_questions.sort_key INTEGER; + + Faq[1..1] faq = join faq_questions.faq_id to faqs.faq_id; + + reference key (faq_questions.question_id); + +} + + +query nextSortKey { + Integer nextSortKey; + do { + select CASE WHEN max(sort_key) is null THEN 0 + ELSE max(sort_key) END + 1 as next_sort_key + from faq_questions + where faq_id = :faqID + } map { + nextSortKey = faq_questions.next_sort_key; + } +} diff --git a/ccm-faq/pdl/com/arsdigita/faq/FaqQuestionsPortlet.pdl b/ccm-faq/pdl/com/arsdigita/faq/FaqQuestionsPortlet.pdl new file mode 100644 index 000000000..89c1b02cf --- /dev/null +++ b/ccm-faq/pdl/com/arsdigita/faq/FaqQuestionsPortlet.pdl @@ -0,0 +1,26 @@ +// +// Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of +// the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $Id: //apps/faq/dev/pdl/com/arsdigita/faq/FaqQuestionsPortlet.pdl#3 $ +// $DateTime: 2004/08/17 23:26:27 $ +model com.arsdigita.faq; + +import com.arsdigita.portal.Portlet; + +object type FaqQuestionsPortlet extends Portlet { + // Empty +} diff --git a/ccm-faq/sql/ccm-faq/default/index-faq_questions_faq_id_idx.sql b/ccm-faq/sql/ccm-faq/default/index-faq_questions_faq_id_idx.sql new file mode 100644 index 000000000..4cf7af6a0 --- /dev/null +++ b/ccm-faq/sql/ccm-faq/default/index-faq_questions_faq_id_idx.sql @@ -0,0 +1,21 @@ +-- +-- Copyright (C) 2003-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: //apps/faq/dev/sql/default/index-faq_questions_faq_id_idx.sql#2 $ +-- $DateTime: 2004/08/17 23:26:27 $ + +create index faq_questions_faq_id_idx on faq_questions(faq_id); diff --git a/ccm-faq/sql/ccm-faq/oracle-se-create.sql b/ccm-faq/sql/ccm-faq/oracle-se-create.sql new file mode 100644 index 000000000..77108a61d --- /dev/null +++ b/ccm-faq/sql/ccm-faq/oracle-se-create.sql @@ -0,0 +1,26 @@ +-- +-- Copyright (C) 2003-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: //apps/faq/dev/sql/oracle-se-create.sql#4 $ +-- $DateTime: 2004/08/17 23:26:27 $ + + +@@ ddl/oracle-se/create.sql + +@@ default/index-faq_questions_faq_id_idx.sql + +@@ ddl/oracle-se/deferred.sql diff --git a/ccm-faq/sql/ccm-faq/postgres-create.sql b/ccm-faq/sql/ccm-faq/postgres-create.sql new file mode 100644 index 000000000..2dbe27900 --- /dev/null +++ b/ccm-faq/sql/ccm-faq/postgres-create.sql @@ -0,0 +1,29 @@ +-- +-- Copyright (C) 2003-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: //apps/faq/dev/sql/postgres-create.sql#4 $ +-- $DateTime: 2004/08/17 23:26:27 $ + +begin; + +\i ddl/postgres/create.sql + +\i default/index-faq_questions_faq_id_idx.sql + +\i ddl/postgres/deferred.sql + +commit; diff --git a/ccm-faq/sql/ccm-faq/upgrade/oracle-se-6.x.y-6.x.z.sql b/ccm-faq/sql/ccm-faq/upgrade/oracle-se-6.x.y-6.x.z.sql new file mode 100644 index 000000000..4ca19ded0 --- /dev/null +++ b/ccm-faq/sql/ccm-faq/upgrade/oracle-se-6.x.y-6.x.z.sql @@ -0,0 +1,23 @@ +-- +-- Copyright (C) pb@zes.uni-bremen.de 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-faq 6.x.y -> 6.x.z Upgrade Script (Oracle) + +-- Update scripts go here +@@ ./oracle-se/6.x.0-6.x.1/example_01.sql +@@ ./default/6.x.0-6.x.1/example_02.sql diff --git a/ccm-faq/sql/ccm-faq/upgrade/postgres-6.x.y-6.x.z.sql b/ccm-faq/sql/ccm-faq/upgrade/postgres-6.x.y-6.x.z.sql new file mode 100644 index 000000000..04d834963 --- /dev/null +++ b/ccm-faq/sql/ccm-faq/upgrade/postgres-6.x.y-6.x.z.sql @@ -0,0 +1,30 @@ +-- +-- Copyright (C) pb@zes.uni-bremen.de 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-faq 6.x.0 -> 6.x.1 Upgrade Script (PostgreSQL) + +begin; + +-- Update scripts go here +\i postgres/6.x.0-6.x.1/example_01.sql +\i postgres/6.x.0-6.x.1/example_02.sql + +commit; + + + diff --git a/ccm-faq/src/ccm-faq.config b/ccm-faq/src/ccm-faq.config new file mode 100644 index 000000000..adfdba100 --- /dev/null +++ b/ccm-faq/src/ccm-faq.config @@ -0,0 +1,4 @@ + + + + diff --git a/ccm-faq/src/ccm-faq.load b/ccm-faq/src/ccm-faq.load new file mode 100644 index 000000000..1aaa50aaf --- /dev/null +++ b/ccm-faq/src/ccm-faq.load @@ -0,0 +1,14 @@ + + + +
+ + + + + + + + + + diff --git a/ccm-faq/src/ccm-faq.upgrade b/ccm-faq/src/ccm-faq.upgrade new file mode 100644 index 000000000..9f6bd2053 --- /dev/null +++ b/ccm-faq/src/ccm-faq.upgrade @@ -0,0 +1,6 @@ + + +