From 66eddde8048fc23f7e8404b05e5bbba1236b690c Mon Sep 17 00:00:00 2001 From: pb Date: Thu, 29 Mar 2012 23:05:50 +0000 Subject: [PATCH] Verfeinerungen von code und doku. git-svn-id: https://svn.libreccm.org/ccm/trunk@1562 8810af33-2d31-482b-a856-94f89814c4df --- ccm-bookmarks/application.xml | 22 +++++-- .../BookmarksDispatcher.java.nolongerInUse | 63 ------------------- ...operties => BookmarksResources.properties} | 0 .../BookmarksResources_de.properties | 17 +++++ .../BookmarksResources_en.properties | 17 +++++ .../arsdigita/bookmarks/BookmarksServlet.java | 10 +-- .../com/arsdigita/bookmarks/Initializer.java | 1 + .../src/com/arsdigita/bookmarks/Loader.java | 10 +-- .../bookmarks/util/GlobalizationUtil.java | 3 +- ccm-ldn-atoz/application.xml | 11 +++- 10 files changed, 69 insertions(+), 85 deletions(-) delete mode 100755 ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse rename ccm-bookmarks/src/com/arsdigita/bookmarks/{ui/BookmarkResources.properties => BookmarksResources.properties} (100%) create mode 100755 ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_de.properties create mode 100755 ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_en.properties diff --git a/ccm-bookmarks/application.xml b/ccm-bookmarks/application.xml index 1de5b9b2d..bcdd78ce7 100755 --- a/ccm-bookmarks/application.xml +++ b/ccm-bookmarks/application.xml @@ -13,11 +13,21 @@ - Bookmarks application for CCM. Displays bookmarks for a portal. - - - CCM is a collaboration and content management system which is based upon - the Red Hat Web Application Framework (WAF), which is a platform for writing - database-backed web applications in Java. + Bookmarks application provides an admin interface to maintain one or more + lists of bookmarks and a portlet to embed on one or more portal pages. + Each portlet instance can be configured to display one of several bookmark + list. + + By default an administration instance to maintain a list of bookmarks is + installed at ~/ccm/admin/bookmarks. The UI provides the capability to add, + modify and delete bookmarks and to modify their order. + + To display this list the Bookmark portlet must be installed on a portal + page. It's installation UI provides (besides the standard properties title + and description) a drop-down list to select the list provider, + “/admin/bookmarks” in case of the default installation. + + For each additional, separate bookmarks list it is necessary to install an + additional administration instance for each list. diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse deleted file mode 100755 index 05888ebe2..000000000 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2001, 2002 Red Hat Inc. 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. - * - */ - -package com.arsdigita.bookmarks; - -import com.arsdigita.bookmarks.ui.BookmarkEditPane; -import com.arsdigita.bookmarks.ui.BookmarkBasePage; - -import com.arsdigita.bebop.page.BebopMapDispatcher; -import com.arsdigita.bebop.Page; - -import java.util.HashMap; -import java.util.Map; -import org.apache.log4j.Logger; - -/** - * Bookmark dispatcher for both Bebop-backed and other URLs. - * - * @author Jim Parsons - */ - -public class BookmarksDispatcher extends BebopMapDispatcher { - - - private static final Logger s_log = - Logger.getLogger(BookmarksDispatcher.class); - - public BookmarksDispatcher() { - super(); - - Map m = new HashMap(); - - Page index = buildIndexPage(); - - m.put("", index); - - setMap(m); - } - - private Page buildIndexPage() { - BookmarkBasePage p = new BookmarkBasePage(); - - p.addRequestListener(new ApplicationAuthenticationListener("admin")); - p.getBody().add(new BookmarkEditPane()); - - p.lock(); - return p; - } - - -} diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkResources.properties b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources.properties similarity index 100% rename from ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkResources.properties rename to ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources.properties diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_de.properties b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_de.properties new file mode 100755 index 000000000..76b3dc0c6 --- /dev/null +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_de.properties @@ -0,0 +1,17 @@ +bookmarks.ui.select_a_bookmark_for_editing=Ein Lesezeichen zur Bearbeitung ausw\u00e4hlen +bookmarks.ui.name_of_new_bookmark=Name f\u00fcr das Lesezeichens: +bookmarks.ui.new_bookmark_url=URL f\u00fcr das Lesezeichen: +bookmarks.ui.bookmark_description=Lesezeichen Beschreibung: +bookmarks.ui.delete_this_bookmark=Dieses LEsezeichen l\u00f6schen +bookmarks.ui.edit_fields_and_click_save_button=Edit fields and click save button. +bookmarks.ui.bookmark_name=Lesezeichen Name: +bookmarks.ui.none=Keine Lesezeichen +bookmarks.ui.bookmark_url=URL Lesezeichen: +bookmarks.ui.creation_date=Erstellungsdatum: +bookmarks.ui.last_modified_date=Zuletzt ver\u00e4ndert: +bookmarks.ui.created_by=Erstellt von: +bookmarks.ui.number_of_visits=Anzahl Besuche: +bookmarks.ui.modification_date=\u00c4nderungsdatum +bookmarks.ui.creator=Ersteller +bookmarks.ui.are_you_sure_you_want_to_delete_this_bookmark=Soll dieses Lesezeichen tats\u00e4chlich gel\u00f6scht werden? +bookmarks.ui.bookmark_in_new_window=In einen neuen Fenster \u00f6ffnen diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_en.properties b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_en.properties new file mode 100755 index 000000000..e6de89d64 --- /dev/null +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_en.properties @@ -0,0 +1,17 @@ +bookmarks.ui.select_a_bookmark_for_editing=Select a Bookmark for editing +bookmarks.ui.name_of_new_bookmark=Name of New Bookmark: +bookmarks.ui.new_bookmark_url=New Bookmark URL: +bookmarks.ui.bookmark_description=Bookmark Description: +bookmarks.ui.delete_this_bookmark=Delete this Bookmark +bookmarks.ui.edit_fields_and_click_save_button=Edit fields and click save button. +bookmarks.ui.bookmark_name=Bookmark Name: +bookmarks.ui.none=No Bookmarks +bookmarks.ui.bookmark_url=Bookmark URL: +bookmarks.ui.creation_date=Creation Date: +bookmarks.ui.last_modified_date=Last Modified Date: +bookmarks.ui.created_by=Created by: +bookmarks.ui.number_of_visits=Number of visits: +bookmarks.ui.modification_date=Modification Date +bookmarks.ui.creator=Creator +bookmarks.ui.are_you_sure_you_want_to_delete_this_bookmark=Are you sure you want to delete this Bookmark? +bookmarks.ui.bookmark_in_new_window=Open in a new window diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java index 2012f7ce8..7a1616055 100644 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java @@ -53,7 +53,7 @@ public class BookmarksServlet extends BaseApplicationServlet { /** Logger instance for debugging */ private static final Logger s_log = Logger.getLogger(BookmarksServlet.class); - private Page adminPage; + private Page indexPage; /** * User extension point, overwrite this method to setup a URL - page mapping @@ -63,7 +63,7 @@ public class BookmarksServlet extends BaseApplicationServlet { @Override public void doInit() throws ServletException { - adminPage = buildAdminPage(); + indexPage = buildIndexPage(); } @@ -77,9 +77,9 @@ public class BookmarksServlet extends BaseApplicationServlet { Application app) throws ServletException, IOException { - if (adminPage != null) { + if (indexPage != null) { - final Document doc = adminPage.buildDocument(sreq, sresp); + final Document doc = indexPage.buildDocument(sreq, sresp); PresentationManager pm = Templating.getPresentationManager(); pm.servePage(doc, sreq, sresp); @@ -96,7 +96,7 @@ public class BookmarksServlet extends BaseApplicationServlet { * * @return */ - private Page buildAdminPage() { + private Page buildIndexPage() { BookmarkBasePage p = new BookmarkBasePage(); diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java index 6777b7b5b..c0cc13812 100755 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java @@ -79,6 +79,7 @@ public class Initializer extends CompoundInitializer { e.getFactory().registerInstantiator( BookmarkPortlet.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { + @Override public DomainObject doNewInstance(DataObject dataObject) { return new BookmarkPortlet(dataObject); } diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java index dc7c2f44e..5bcaf0f1e 100644 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java @@ -68,8 +68,7 @@ public class Loader extends PackageLoader { */ private ApplicationType loadBookmarksApp() { - /* Create new type legacy free application type - * NOTE: The wording in the title parameter of ApplicationType + /* NOTE: The wording in the title parameter of ApplicationType * determines the name of the subdirectory for the XSL stylesheets. * It gets "urlized", i.e. trimming leading and trailing blanks and * replacing blanks between words and illegal characters with an @@ -101,18 +100,13 @@ public class Loader extends PackageLoader { * */ public static void setupDefaultBookmarkApplicationInstance() { + s_log.debug("Creating BookmarkApplication instance ..."); /* Determine a parent application. Bookmarks admin page will be * installed beyond the admin's applications URL. */ Application admin = Application.retrieveApplicationForPath("/admin/"); // create application instance - // Whether a legacy compatible or a legacy free application is - // created depends on the type of ApplicationType above. No need to - // modify anything here in the migration process - // old-style package key used as url fragment where to install the instance - s_log.debug("Creating BookmarkApplication instance ..."); - Bookmarks app = Bookmarks.create("bookmarks", "Bookmarks", admin); s_log.debug("Bookmarks instance " + " created."); diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/util/GlobalizationUtil.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/util/GlobalizationUtil.java index 20939937f..0c244969f 100755 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/util/GlobalizationUtil.java +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/util/GlobalizationUtil.java @@ -31,7 +31,8 @@ import com.arsdigita.globalization.GlobalizedMessage; public class GlobalizationUtil implements Globalized { - private static final String BUNDLE_NAME = "com.arsdigita.bookmarks.ui.BookmarkResources"; + private static final String BUNDLE_NAME = + "com.arsdigita.bookmarks.BookmarksResources"; public static GlobalizedMessage globalize(String key) { return new GlobalizedMessage(key, BUNDLE_NAME); diff --git a/ccm-ldn-atoz/application.xml b/ccm-ldn-atoz/application.xml index f83719535..18fbaf154 100755 --- a/ccm-ldn-atoz/application.xml +++ b/ccm-ldn-atoz/application.xml @@ -21,8 +21,15 @@ - The Red Hat Web Application Framework is a platform for writing - database-backed web applications in Java. + The ccm-ldn-atoz package enables a site to present all it's content in + alphabetical order as an additional service to it's users. Usually the + theme provides a link to the page as part of its static elements. + + By default the application presents the A-Z list at ~/ccm/atoz/. + + An administration interface is provided at ~/ccm/atoz/admin/. Here you + can configure the content to be listed by selecting an appropriate + content provider.