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 @@ + + +