diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java
index 5bcaf0f1e..a18a61e2c 100644
--- a/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java
+++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java
@@ -44,6 +44,7 @@ public class Loader extends PackageLoader {
private static final Logger s_log = Logger.getLogger(Loader.class);
/**
+ * Run script invoked by com.arsdigita.packing loader script.
*
* @param ctx
*/
@@ -104,10 +105,10 @@ public class Loader extends PackageLoader {
/* Determine a parent application. Bookmarks admin page will be
* installed beyond the admin's applications URL. */
- Application admin = Application.retrieveApplicationForPath("/admin/");
+ Application parent = Application.retrieveApplicationForPath("/admin/");
// create application instance
- Bookmarks app = Bookmarks.create("bookmarks", "Bookmarks", admin);
+ Bookmarks app = Bookmarks.create("bookmarks", "Bookmarks", parent);
s_log.debug("Bookmarks instance " + " created.");
}
diff --git a/ccm-cms/web/themes/heirloom/packages/cms/xsl/admin/cms-admin.xsl b/ccm-cms/web/themes/heirloom/packages/cms/xsl/admin/cms-admin.xsl
index cf01cf783..8e3a30bcf 100755
--- a/ccm-cms/web/themes/heirloom/packages/cms/xsl/admin/cms-admin.xsl
+++ b/ccm-cms/web/themes/heirloom/packages/cms/xsl/admin/cms-admin.xsl
@@ -3,7 +3,6 @@
version="1.0">
-
diff --git a/ccm-cms/web/themes/heirloom/packages/cms/xsl/cms-admin.xsl b/ccm-cms/web/themes/heirloom/packages/cms/xsl/cms-admin.xsl
index e818299f7..9969c98c2 100755
--- a/ccm-cms/web/themes/heirloom/packages/cms/xsl/cms-admin.xsl
+++ b/ccm-cms/web/themes/heirloom/packages/cms/xsl/cms-admin.xsl
@@ -15,7 +15,6 @@
-
diff --git a/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java b/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java
index c9f0938c6..093b1513d 100755
--- a/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java
+++ b/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java
@@ -126,16 +126,6 @@ public class PageTransformer implements PresentationManager {
}
});
- registerXSLParameterGenerator("static-prefix",
- new XSLParameterGenerator() {
-
- @Override
- public String generateValue(HttpServletRequest request) {
- return Web.getContext().getRequestURL().getContextPath()
- + com.arsdigita.web.URL.STATIC_DIR;
- }
- });
-
registerXSLParameterGenerator("dispatcher-prefix",
new XSLParameterGenerator() {
diff --git a/ccm-core/src/com/arsdigita/web/URL.java b/ccm-core/src/com/arsdigita/web/URL.java
index a3b310a10..b105210cd 100755
--- a/ccm-core/src/com/arsdigita/web/URL.java
+++ b/ccm-core/src/com/arsdigita/web/URL.java
@@ -133,20 +133,7 @@ import org.apache.log4j.Logger;
public class URL {
private static final Logger s_log = Logger.getLogger(URL.class);
- /**
- * @deprecated
- */
- private static final String INTERNAL_DIR = "/__ccm__";
- /**
- * The standard location for JSP files.
- * @deprecated
- */
- public static final String JSP_DIR = INTERNAL_DIR + "/jsp";
- /**
- * The standard location for static files.
- * @deprecated
- */
- public static final String STATIC_DIR = INTERNAL_DIR + "/static";
+
/**
* The standard location for XSL files.
* No longer in use.
diff --git a/ccm-faq/src/com/arsdigita/faq/Faq.java b/ccm-faq/src/com/arsdigita/faq/Faq.java
index f528462b8..34a6e3775 100644
--- a/ccm-faq/src/com/arsdigita/faq/Faq.java
+++ b/ccm-faq/src/com/arsdigita/faq/Faq.java
@@ -183,9 +183,9 @@ public class Faq extends Application {
*
* The method overwrites the super class to provide an application specific
* location for servlets/JSP. This is necessary if you whish to install the
- * module (application) along with others in one context. If you install the
- * module into its own context (no longer recommended) you may use a
- * standard location.
+ * package (application) along with others in one context. If you install
+ * it into its own context (no longer recommended) you may use a standard
+ * location.
*
* Usually it is a symbolic name/path, which will be mapped in the web.xml
* to the real location in the file system. Example:
@@ -199,7 +199,12 @@ public class Faq extends Application {
* /faq/*
*
*
- * The appended "/*" ensures BaseServlet will find additional JSP's.
+ * The appended "/*" ensures BaseServlet will find additional JSP's (located
+ * in URL.TEMPLATE_DIR/ccm-faq/*).
+ *
+ * Ensure the url-pattern does NOT have a real counterpart in the file
+ * system! For virtual locations you may use URL.SERVLET_DIR as base
+ * directory.
*
* @return path name to the applications servlet/JSP
*/
diff --git a/ccm-faq/src/com/arsdigita/faq/FaqDispatcher.java b/ccm-faq/src/com/arsdigita/faq/FaqDispatcher.java.nolongerInUse
similarity index 100%
rename from ccm-faq/src/com/arsdigita/faq/FaqDispatcher.java
rename to ccm-faq/src/com/arsdigita/faq/FaqDispatcher.java.nolongerInUse
diff --git a/ccm-faq/src/com/arsdigita/faq/FaqServlet.java b/ccm-faq/src/com/arsdigita/faq/FaqServlet.java
index 1809b9de1..cf2bf0020 100644
--- a/ccm-faq/src/com/arsdigita/faq/FaqServlet.java
+++ b/ccm-faq/src/com/arsdigita/faq/FaqServlet.java
@@ -29,6 +29,9 @@ import javax.servlet.ServletException;
import org.apache.log4j.Logger;
/**
+ * FAQ Application Servlet class, central entry point to
+ * create and process the applications UI.
+ *
*
* @author pb
*/
@@ -38,6 +41,10 @@ public class FaqServlet extends BebopApplicationServlet {
private static final Logger s_log = Logger.getLogger(FaqServlet.class);
+ /**
+ *
+ * @throws ServletException
+ */
@Override
public void init() throws ServletException {
super.init();
@@ -48,10 +55,9 @@ public class FaqServlet extends BebopApplicationServlet {
put("/", index);
put("/index.jsp", index);
- put("/one.jsp", index);
- // put("admin", admin);
- // put("admin/index.jsp", admin);
+ put("/admin", admin);
+ put("/admin/index.jsp", admin);
}
@@ -60,6 +66,7 @@ public class FaqServlet extends BebopApplicationServlet {
* @return
*/
private FaqPage buildIndexPage() {
+
FaqPage p = new FaqPage();
p.add(new FaqUserView());
diff --git a/ccm-faq/src/com/arsdigita/faq/Loader.java b/ccm-faq/src/com/arsdigita/faq/Loader.java
index f1fe3811a..ae14b3a52 100644
--- a/ccm-faq/src/com/arsdigita/faq/Loader.java
+++ b/ccm-faq/src/com/arsdigita/faq/Loader.java
@@ -24,12 +24,15 @@ import com.arsdigita.kernel.KernelExcursion;
import com.arsdigita.loader.PackageLoader;
import com.arsdigita.portal.apportlet.AppPortletType;
import com.arsdigita.runtime.ScriptContext;
+import com.arsdigita.web.Application;
import com.arsdigita.web.ApplicationType;
import org.apache.log4j.Logger;
/**
- * FAQ Application Loader
+ * FAQ Application Loader executes nonrecurring at install time and loads
+ * (installs and initializes) the FAQ application type, portlet type and
+ * default application instance persistently into database.
*
* @author pboy <pboy@barkhof.uni-bremen.de>
* @version $Id: Loader.java $
@@ -37,7 +40,7 @@ import org.apache.log4j.Logger;
public class Loader extends PackageLoader {
- /** Logger instance for debugging */
+ /** Creates a s_logging category with name = full name of class */
private static final Logger s_log = Logger.getLogger(Loader.class);
/**
@@ -52,9 +55,9 @@ public class Loader extends PackageLoader {
setEffectiveParty(Kernel.getSystemParty());
loadFAQApplicationType();
- setupFaqQuestionsPortlet(null);
+ loadFaqQuestionsPortletType(null);
- setupDefaultFaq();
+ setupDefaultFaqInstance();
}
}.run();
@@ -70,33 +73,19 @@ public class Loader extends PackageLoader {
/**
* Creates a FAQ application type, the domain class of the
- * FAQ package, as a legacy-compatible type of application.
- *
- * Creates an entry in table application_types and a corresponding entry in
- * apm_package_types
- *
- * TODO: migrate to a new style, legacy free application type.
+ * FAQ package.
*/
private void loadFAQApplicationType() {
- // /* Setup a new style legacy compatible application type. */
- // ApplicationType type = ApplicationType.createApplicationType(
- // "faq",
- // "Frequently Asked Questions",
- // Faq.BASE_DATA_OBJECT_TYPE);
- // /* Current code requires an apps specific dispatcher class. */
- // /* Has to be modified to be able to create a legacy free app type. */
- // type.setDispatcherClass ("com.arsdigita.faq.FaqDispatcher");
-
/* Setup as new stype legacy free aplcation */
// NOTE: The title "FAQ" is used to retrieve the application's
// name to determine the location of xsl files (by url-izing it). So
// DON'T modify it without synchronizing web directory tree accordingly!
ApplicationType type = new ApplicationType("FAQ",
Faq.BASE_DATA_OBJECT_TYPE);
- // set.Description is independent from application type:
type.setDescription
("Frequently Asked Questions empower users to share knowledge.");
+ type.save();
}
@@ -112,9 +101,22 @@ public class Loader extends PackageLoader {
* Creates a default FAQ application instance at address /faq/
*
*/
- private void setupDefaultFaq() {
+ private void setupDefaultFaqInstance() {
+ s_log.debug("About to create FAQ application instance ...");
- Faq faq = Faq.create("faq", "Default FAQ", null);
+ /* Determine a parent application. */
+ Application parent;
+
+ /* For now we install FAQ as an root application.
+ * If admin needs to install several FAQ instances this decision may
+ * become inappropriate. It may be better to either not install any
+ * default application and leave it to the admin to install proper
+ * instances or try to find a more flexible solution which better fits
+ * to many instances. */
+ // parent = Application.retrieveApplicationForPath("/admin/");
+ parent=null;
+
+ Faq faq = Faq.create("faq", "Default FAQ", parent);
faq.setDescription("The default ccm-faq instance.");
faq.save();
}
@@ -134,28 +136,9 @@ public class Loader extends PackageLoader {
* Instances (Portlets) are created by user interface or programmatically
* by configuration.
*/
- private void setupFaqQuestionsPortlet(ApplicationType provider) {
+ private void loadFaqQuestionsPortletType(ApplicationType provider) {
// Create the FAQ questions portlet
-/* Copied from docfrepo as an example
- AppPortletSetup setup = new AppPortletSetup(s_log);
-
- setup.setPortletObjectType(RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE);
- setup.setTitle("Recently Updated Documents");
- setup.setDescription(
- "Displays the most recent documents in the document repository.");
- setup.setProfile(PortletType.WIDE_PROFILE);
- // setup.setProviderApplicationType(provider);
- setup.setProviderApplicationType(Repository.BASE_DATA_OBJECT_TYPE);
- setup.setInstantiator(new ACSObjectInstantiator() {
- @Override
- protected DomainObject doNewInstance(DataObject dataObject) {
- return new RecentUpdatedDocsPortlet(dataObject);
- }
- });
-
- setup.run();
-*/
AppPortletType portletType = AppPortletType.createAppPortletType
("Faq Questions Portlet", AppPortletType.WIDE_PROFILE,
FaqQuestionsPortlet.BASE_DATA_OBJECT_TYPE);
diff --git a/ccm-faq/src/com/arsdigita/faq/ui/AdminQuestionTable.java b/ccm-faq/src/com/arsdigita/faq/ui/AdminQuestionTable.java
index 5634362e9..415be837f 100644
--- a/ccm-faq/src/com/arsdigita/faq/ui/AdminQuestionTable.java
+++ b/ccm-faq/src/com/arsdigita/faq/ui/AdminQuestionTable.java
@@ -33,8 +33,11 @@ import com.arsdigita.util.LockableImpl;
import java.math.BigDecimal;
+/**
+ *
+ * @version $Id: AdminQuestionTable.java#3 2004/08/17 23:26:27 $
+ */
class AdminQuestionTable extends Table {
- public static final String versionId = "$Id: //apps/faq/dev/src/com/arsdigita/faq/ui/AdminQuestionTable.java#3 $ by $Author: dennis $, $DateTime: 2004/08/17 23:26:27 $";
private final static String[] HEADERS = {"#", "Question"};
diff --git a/ccm-faq/src/com/arsdigita/faq/ui/FaqBasePage.java b/ccm-faq/src/com/arsdigita/faq/ui/FaqBasePage.java
index b06653e6c..217396550 100644
--- a/ccm-faq/src/com/arsdigita/faq/ui/FaqBasePage.java
+++ b/ccm-faq/src/com/arsdigita/faq/ui/FaqBasePage.java
@@ -34,7 +34,6 @@ import com.arsdigita.bebop.event.PrintEvent;
import com.arsdigita.bebop.event.PrintListener;
import com.arsdigita.web.Application;
import com.arsdigita.kernel.Kernel;
-import com.arsdigita.faq.ApplicationAuthenticationListener;
import com.arsdigita.kernel.permissions.PermissionDescriptor;
import com.arsdigita.kernel.permissions.PermissionService;
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
@@ -62,8 +61,7 @@ public class FaqBasePage extends Page {
public static final String FAQ_HEADER_ELEMENT = "faq:header";
public static final String FAQ_BODY_ELEMENT = "faq:body";
public static final String FAQ_FOOTER_ELEMENT = "faq:footer";
- public static final String FAQ_XML_NS =
- "http://www.redhat.com/faq/1.0";
+ public static final String FAQ_XML_NS = "http://www.redhat.com/faq/1.0";
private static final Logger s_log = Logger.getLogger(FaqBasePage.class);
@@ -78,6 +76,9 @@ public class FaqBasePage extends Page {
private boolean CHECK_PERMISSION = true;
+ /**
+ * Default Constructor
+ */
public FaqBasePage() {
this(null);
}
@@ -120,6 +121,7 @@ public class FaqBasePage extends Page {
}
+ @Override
public void lock() {
buildPage();
@@ -176,7 +178,9 @@ public class FaqBasePage extends Page {
}
protected void buildGlobal(Container global) {
- Link link = new Link( new Label(GlobalizationUtil.globalize("cw.workspace.sign_out")), "/register/logout");
+ Link link = new Link( new Label(GlobalizationUtil
+ .globalize("cw.workspace.sign_out")),
+ "/register/logout");
link.setClassAttr("signoutLink");
@@ -186,13 +190,17 @@ public class FaqBasePage extends Page {
protected void buildHeader(Container header) {
if (m_view != null) {
if (m_view.equals("user")) {
- m_viewLink = new Link
- ( new Label(GlobalizationUtil.globalize("cw.faq.ui.admin_view")), "./admin/index.jsp") {
- public boolean isVisible(PageState ps) {
- return userIsAdmin(ps);
- }};
+ m_viewLink = new Link( new Label(GlobalizationUtil
+ .globalize("cw.faq.ui.admin_view")),
+ "./admin/index.jsp") {
+ @Override
+ public boolean isVisible(PageState ps) {
+ return userIsAdmin(ps);
+ }};
} else if (m_view.equals("admin")) {
- m_viewLink = new Link( new Label(GlobalizationUtil.globalize("cw.faq.ui.user_view")), "../index.jsp");
+ m_viewLink = new Link( new Label(GlobalizationUtil
+ .globalize("cw.faq.ui.user_view")),
+ "../index.jsp");
}
}
@@ -214,6 +222,7 @@ public class FaqBasePage extends Page {
private class Panel extends SimpleContainer {
+ @Override
public void generateXML(PageState ps, Element p) {
Component selected = getSelected(ps);
if (selected == null) {
diff --git a/ccm-faq/src/com/arsdigita/faq/ui/FaqPage.java b/ccm-faq/src/com/arsdigita/faq/ui/FaqPage.java
index a13c38f70..855ffbf69 100644
--- a/ccm-faq/src/com/arsdigita/faq/ui/FaqPage.java
+++ b/ccm-faq/src/com/arsdigita/faq/ui/FaqPage.java
@@ -43,12 +43,11 @@ import java.math.BigDecimal;
*
* @author Tracy Adams
* @version $Revision: #4 $ $Date: 2004/08/17 $
+ * @version $Id: FaqPage.java#4 $
*/
public class FaqPage extends FaqBasePage {
- public static final String versionId = "$Id: //apps/faq/dev/src/com/arsdigita/faq/ui/FaqPage.java#4 $ by $Author: dennis $, $DateTime: 2004/08/17 23:26:27 $";
-
private static final org.apache.log4j.Logger log =
org.apache.log4j.Logger.getLogger(FaqPage.class);
diff --git a/ccm-faq/src/com/arsdigita/faq/util/GlobalizationUtil.java b/ccm-faq/src/com/arsdigita/faq/util/GlobalizationUtil.java
index 5428cc050..757828f72 100644
--- a/ccm-faq/src/com/arsdigita/faq/util/GlobalizationUtil.java
+++ b/ccm-faq/src/com/arsdigita/faq/util/GlobalizationUtil.java
@@ -33,7 +33,7 @@ import com.arsdigita.globalization.GlobalizedMessage;
public class GlobalizationUtil implements Globalized {
- private static final String BUNDLE_NAME = "com.arsdigita.faq.ui.FaqResources";
+ private static final String BUNDLE_NAME = "com.arsdigita.faq.FaqResources";
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
diff --git a/ccm-faq/web/themes/heirloom/packages/faq/xsl/faq.xsl b/ccm-faq/web/themes/heirloom/packages/faq/xsl/faq.xsl
index e20111e40..d15a70179 100644
--- a/ccm-faq/web/themes/heirloom/packages/faq/xsl/faq.xsl
+++ b/ccm-faq/web/themes/heirloom/packages/faq/xsl/faq.xsl
@@ -11,7 +11,7 @@
-
+
diff --git a/ccm-forum/src/com/arsdigita/forum/Loader.java b/ccm-forum/src/com/arsdigita/forum/Loader.java
index ae1d140c8..acef34300 100755
--- a/ccm-forum/src/com/arsdigita/forum/Loader.java
+++ b/ccm-forum/src/com/arsdigita/forum/Loader.java
@@ -109,13 +109,9 @@ public class Loader extends PackageLoader {
setupDigestUser();
setupForumAppType( (String[]) get(m_forumInstances) );
- //setupInboxAppType(); //TODO: why it is commented out?
setupRecentPostingsPortletType();
setupMyForumsPortletType();
- // moved upwards
- // setupDigestUser();
-
SessionManager.getSession().flushAll();
}
}.run();
@@ -131,8 +127,7 @@ public class Loader extends PackageLoader {
*/
private static void setupForumAppType(String[] forumNames) {
- /* Create 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
@@ -157,20 +152,6 @@ public class Loader extends PackageLoader {
return ;
}
- /**
- * TODO: What is it for? Execution is currently commented out.
- * Referenced class com.arsdigita.forum.Inbox does not exist.
- * @return
- */
- private static ApplicationType setupInboxAppType() {
- ApplicationType type = ApplicationType
- .createApplicationType(Forum.PACKAGE_TYPE,
- "Inbox",
- "com.arsdigita.forum.Inbox");
- type.setDescription("Inbox");
- return type;
- }
-
/**
*
* @return