From 8a19a659177bb9bd2c9a4d332073f13b5fe4fa63 Mon Sep 17 00:00:00 2001 From: pb Date: Sun, 4 Mar 2012 12:49:57 +0000 Subject: [PATCH] =?UTF-8?q?http-auth=20und=20ccm-bookmarks=20jetzt=20legac?= =?UTF-8?q?y=20free.=20Update=20Skripte=20m=C3=BCssen=20noch=20erg=C3=A4nz?= =?UTF-8?q?t=20werden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@1532 8810af33-2d31-482b-a856-94f89814c4df --- .../pdl/com/arsdigita/auth/http/HTTPAuth.pdl | 3 +- .../src/com/arsdigita/auth/http/Loader.java | 70 +++++- ccm-bookmarks/src/ccm-bookmarks.load | 1 + .../src/com/arsdigita/bookmarks/Bookmark.java | 13 +- .../bookmarks/BookmarkCollection.java | 2 +- ...ookmarkApplication.java => Bookmarks.java} | 52 +++- ...=> BookmarksDispatcher.java.nolongerInUse} | 6 +- .../arsdigita/bookmarks/BookmarksServlet.java | 112 +++++++++ .../com/arsdigita/bookmarks/Initializer.java | 102 +++----- .../src/com/arsdigita/bookmarks/Loader.java | 126 ++++++++++ .../bookmarks/ui/BookmarkBasePage.java | 10 +- .../bookmarks/ui/BookmarkEditPane.java | 20 +- .../bookmarks/ui/BookmarkPortlet.java | 48 +++- .../web/WEB-INF/web.ccm-bookmarks.xml | 18 ++ .../com/arsdigita/domain/DomainObject.java | 29 ++- .../src/com/arsdigita/portal/PortletType.java | 14 +- .../portal/apportlet/AppPortlet.java | 1 + .../portal/apportlet/AppPortletType.java | 13 +- ccm-docmgr/application.xml | 2 +- .../src/com/arsdigita/cms/docmgr/Loader.java | 222 ++++++++++++++++++ .../cms/docmgr/installer/Initializer.java | 6 +- .../arsdigita/london/search/Initializer.java | 3 + .../bundles/devel/cfg/integration.properties | 3 + ccm-sci-bundle/bundles/devel/cfg/project.xml | 10 +- 24 files changed, 721 insertions(+), 165 deletions(-) rename ccm-bookmarks/src/com/arsdigita/bookmarks/{BookmarkApplication.java => Bookmarks.java} (61%) rename ccm-bookmarks/src/com/arsdigita/bookmarks/{BookmarkDispatcher.java => BookmarksDispatcher.java.nolongerInUse} (90%) create mode 100644 ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java create mode 100644 ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java create mode 100644 ccm-bookmarks/web/WEB-INF/web.ccm-bookmarks.xml create mode 100644 ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java diff --git a/ccm-auth-http/pdl/com/arsdigita/auth/http/HTTPAuth.pdl b/ccm-auth-http/pdl/com/arsdigita/auth/http/HTTPAuth.pdl index 25e7f64df..377206901 100755 --- a/ccm-auth-http/pdl/com/arsdigita/auth/http/HTTPAuth.pdl +++ b/ccm-auth-http/pdl/com/arsdigita/auth/http/HTTPAuth.pdl @@ -20,5 +20,6 @@ model com.arsdigita.auth.http; import com.arsdigita.web.Application; object type HTTPAuth extends Application { - reference key (auth_http.application_id); + // reference key (auth_http.application_id); + // nothing to store here } diff --git a/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java b/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java index 2c6e487f5..ed819a068 100755 --- a/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java +++ b/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java @@ -18,33 +18,31 @@ package com.arsdigita.auth.http; -import com.arsdigita.loader.PackageLoader; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; import com.arsdigita.kernel.User; - +import com.arsdigita.loader.PackageLoader; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.SessionManager; - import com.arsdigita.runtime.ScriptContext; - import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.StringParameter; - import com.arsdigita.web.ApplicationType; import com.arsdigita.web.Application; import org.apache.log4j.Logger; /** - * Loads the HTTP Auth application and type + *

Executes nonrecurring at install time and loads (installs and initializes) + * the HTTP Auth application and type persistently into database.

* * @author Daniel Berrange * @version $Id: Loader.java 287 2005-02-22 00:29:02Z sskracic $ */ public class Loader extends PackageLoader { + /** Creates a s_logging category with name = full name of class */ private static final Logger s_log = Logger.getLogger(Loader.class); private StringParameter m_adminEmail = new StringParameter @@ -53,40 +51,77 @@ public class Loader extends PackageLoader { ("auth.http.admin_identifier", Parameter.REQUIRED, null); + /** + * Constructor registers parameters + */ public Loader() { + register(m_adminEmail); register(m_adminIdent); + loadInfo(); + } + + /** + * + * @param ctx + */ public void run(final ScriptContext ctx) { new KernelExcursion() { public void excurse() { setEffectiveParty(Kernel.getSystemParty()); + setupAdministrator(); setupHTTPAuth(); } }.run(); } + /** + * Loads HTTPAuth type as a legacy free type of application and + * instantiates a (single) default instance. + */ private void setupHTTPAuth() { +/* ApplicationType type = ApplicationType .createApplicationType("auth-http", "CCM HTTP Authentication Admin", HTTPAuth.BASE_DATA_OBJECT_TYPE); +*/ + + /* Create new type legacy free application type + * 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 + * hyphen and converted to lower case. + * "Auth HTTP" will become "auth-http". */ + ApplicationType type = new ApplicationType("Auth HTTP", + HTTPAuth.BASE_DATA_OBJECT_TYPE ); + type.setDescription("CCM HTTP authentication administration"); + type.save(); Application admin = Application.retrieveApplicationForPath("/admin/"); - Application app = - Application.createApplication(type, - "auth-http", - "CCM HTTP Authentication Admin", - admin); + Application app = Application + .createApplication(type, + "auth-http", + "CCM HTTP Authentication Admin", + admin); + app.save(); } + /** + * + */ private void setupAdministrator() { - DataCollection coll = SessionManager.getSession().retrieve - ( User.BASE_DATA_OBJECT_TYPE ); + + s_log.warn("Administrator eMail is retrieved as: " + getAdminEmail()); + + DataCollection coll = SessionManager.getSession() + .retrieve(User.BASE_DATA_OBJECT_TYPE); coll.addEqualsFilter( "primaryEmail", getAdminEmail() ); if (!coll.next()) { @@ -98,6 +133,7 @@ public class Loader extends PackageLoader { User admin = User.retrieve( coll.getDataObject() ); coll.close(); + s_log.warn("Administrator is retrieved as: " + admin); UserLogin login = UserLogin.findByUser(admin); if (login == null) { @@ -106,10 +142,18 @@ public class Loader extends PackageLoader { } } + /** + * + * @return + */ private String getAdminEmail() { return (String) get(m_adminEmail); } + /** + * + * @return + */ private String getAdminIdentifier() { return (String) get(m_adminIdent); } diff --git a/ccm-bookmarks/src/ccm-bookmarks.load b/ccm-bookmarks/src/ccm-bookmarks.load index abe31997e..75c6308cc 100755 --- a/ccm-bookmarks/src/ccm-bookmarks.load +++ b/ccm-bookmarks/src/ccm-bookmarks.load @@ -9,5 +9,6 @@ + diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmark.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmark.java index 1a43e5768..6105a42f4 100755 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmark.java +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmark.java @@ -28,16 +28,15 @@ import com.arsdigita.util.Assert; import java.math.BigDecimal; /** - * A bookmark. + * Represents a single bookmark. * * @author Jim Parsons - * */ public class Bookmark extends ACSObject { private static final int SORT_KEY_JUMP = 10; - private BookmarkApplication m_bmrkapp = null; + private Bookmarks m_bmrkapp = null; /** * The type of the {@link com.arsdigita.persistence.DataObject} @@ -45,7 +44,7 @@ public class Bookmark extends ACSObject { * com.arsdigita.domain.DomainObject}. */ public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.workspace.Bookmark"; + "com.arsdigita.workspace.Bookmark"; protected String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; @@ -105,17 +104,17 @@ public class Bookmark extends ACSObject { return Bookmark.retrieveBookmark(dataObject); } - public BookmarkApplication getBookmarkApplication() { + public Bookmarks getBookmarkApplication() { if(m_bmrkapp == null) { DataObject bmrkdata = (DataObject)get("bookmarkapp"); if(bmrkdata != null) { - m_bmrkapp = new BookmarkApplication(bmrkdata); + m_bmrkapp = new Bookmarks(bmrkdata); } } return m_bmrkapp; } - public void setBookmarkApplication(BookmarkApplication bmrkapp) { + public void setBookmarkApplication(Bookmarks bmrkapp) { m_bmrkapp = bmrkapp; setAssociation("bookmarkapp",bmrkapp); } diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkCollection.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkCollection.java index 4026ad7b1..1d15118a0 100755 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkCollection.java +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkCollection.java @@ -24,7 +24,7 @@ import java.math.BigDecimal; /** - * + * Represents a collection of single bookmarks * */ public class BookmarkCollection extends DomainCollection { diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkApplication.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmarks.java similarity index 61% rename from ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkApplication.java rename to ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmarks.java index 33d5e36c9..9b89ce42f 100755 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkApplication.java +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmarks.java @@ -25,33 +25,34 @@ import com.arsdigita.web.Application; import java.math.BigDecimal; /** - * BookmarkApplication class. - * + * Bookmarks application domain class. + * Central entry point into the bookmarks application. * @author dennis - * @version $Id: BookmarkApplication.java#3 2003/07/10 14:47:30 $ + * @version $Id: Bookmarks.java#3 2003/07/10 14:47:30 $ */ -public class BookmarkApplication extends Application { +public class Bookmarks extends Application { public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.workspace.BookmarkApplication"; + "com.arsdigita.workspace.BookmarkApplication"; private static final int SORT_KEY_JUMP = 10; + @Override protected String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; } private static final org.apache.log4j.Logger log = - org.apache.log4j.Logger.getLogger(BookmarkApplication.class); + org.apache.log4j.Logger.getLogger(Bookmarks.class); - public BookmarkApplication(OID oid) throws DataObjectNotFoundException { + public Bookmarks(OID oid) throws DataObjectNotFoundException { super(oid); } - public BookmarkApplication(BigDecimal key) throws DataObjectNotFoundException { + public Bookmarks(BigDecimal key) throws DataObjectNotFoundException { this(new OID(BASE_DATA_OBJECT_TYPE, key)); } - public BookmarkApplication(DataObject dataObject) { + public Bookmarks(DataObject dataObject) { super(dataObject); } @@ -59,9 +60,9 @@ public class BookmarkApplication extends Application { * Use this instead of the constructor to create new Bookmark * Application objects */ - public static BookmarkApplication create(String urlName, String title, + public static Bookmarks create(String urlName, String title, Application parent) { - return (BookmarkApplication) Application.createApplication + return (Bookmarks) Application.createApplication (BASE_DATA_OBJECT_TYPE, urlName, title, parent); } @@ -113,4 +114,33 @@ public class BookmarkApplication extends Application { b.save(); } } + /** + * Returns the servletPath part of the URL to the application servlet. + * (see Servlet API specification or web.URL for more information) + * + * 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 for versions newer + * than 1.0.4) 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: + * + * bookmarks + * com.arsdigita.bookmarks.BookmarksServlet + * + * + * + * bookmarks + * /bookmarks/* + * + * + * @return ServelPath of the applications servlet + */ + @Override + public String getServletPath() { + return "/bookmarks/"; + } + } diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkDispatcher.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse similarity index 90% rename from ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkDispatcher.java rename to ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse index 5eb69553c..05888ebe2 100755 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkDispatcher.java +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse @@ -31,13 +31,13 @@ import org.apache.log4j.Logger; * @author Jim Parsons */ -public class BookmarkDispatcher extends BebopMapDispatcher { +public class BookmarksDispatcher extends BebopMapDispatcher { private static final Logger s_log = - Logger.getLogger(BookmarkDispatcher.class); + Logger.getLogger(BookmarksDispatcher.class); - public BookmarkDispatcher() { + public BookmarksDispatcher() { super(); Map m = new HashMap(); diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java new file mode 100644 index 000000000..54bdb35bd --- /dev/null +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2012 Peter Boy 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 com.arsdigita.bookmarks; + +import com.arsdigita.bebop.Page; +import com.arsdigita.bookmarks.ui.BookmarkBasePage; +import com.arsdigita.bookmarks.ui.BookmarkEditPane; +import com.arsdigita.templating.PresentationManager; +import com.arsdigita.templating.Templating; +import com.arsdigita.web.Application; +import com.arsdigita.web.BaseApplicationServlet; +import com.arsdigita.xml.Document; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + + +/** + * Web Developer Support Application Servlet class, central entry point to + * create and process the applications UI. + * + * We should have subclassed BebopApplicationServlet but couldn't overwrite + * doService() method to add permission checking. So we use our own page + * mapping. The general logic is the same as for BebopApplicationServlet. + * {@see com.arsdigita.bebop.page.BebopApplicationServlet} + * + * @author pb + */ +public class BookmarksServlet extends BaseApplicationServlet { + + /** Logger instance for debugging */ + private static final Logger s_log = Logger.getLogger(BookmarksServlet.class); + + private Page adminPage; + + /** + * User extension point, overwrite this method to setup a URL - page mapping + * + * @throws ServletException + */ + @Override + public void doInit() throws ServletException { + + adminPage = buildAdminPage(); + + } + + + /** + * Central service method, checks for required permission, determines the + * requested page and passes the page object to PresentationManager. + */ + public final void doService(HttpServletRequest sreq, + HttpServletResponse sresp, + Application app) + throws ServletException, IOException { + + if (adminPage != null) { + + final Document doc = adminPage.buildDocument(sreq, sresp); + + PresentationManager pm = Templating.getPresentationManager(); + pm.servePage(doc, sreq, sresp); + + } else { + + sresp.sendError(404, "No such page."); + + } + + } + + /** + * + * @return + */ + private Page buildAdminPage() { + + 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/Initializer.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java index 8af677db5..084e264af 100755 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java @@ -18,46 +18,34 @@ package com.arsdigita.bookmarks; +import com.arsdigita.bookmarks.ui.BookmarkPortlet; import com.arsdigita.db.DbHelper; import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.TransactionContext; -import com.arsdigita.persistence.SessionManager; -// unused import com.arsdigita.persistence.OID; -import com.arsdigita.web.*; import com.arsdigita.kernel.*; -// unused import com.arsdigita.sitenode.*; -import com.arsdigita.bookmarks.ui.*; -// unused import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DomainObject; -// import com.arsdigita.initializer.Configuration; -// unused import com.arsdigita.initializer.InitializationException; -// unused import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.persistence.pdl.ManifestSource; import com.arsdigita.persistence.pdl.NameFilter; -import com.arsdigita.portal.PortletType; -import com.arsdigita.portal.apportlet.AppPortletSetup; import com.arsdigita.runtime.CompoundInitializer; -// unused import com.arsdigita.runtime.DataInitEvent; import com.arsdigita.runtime.DomainInitEvent; import com.arsdigita.runtime.PDLInitializer; import com.arsdigita.runtime.RuntimeConfig; -// unusd import com.arsdigita.util.Assert; + import org.apache.log4j.Logger; /** - *

Experimental

* * @author Jim Parsons */ public class Initializer extends CompoundInitializer { + /** Creates a s_logging category with name = full name of class */ private static final Logger s_log = Logger.getLogger (Initializer.class); - // required by Old Initializer. - // private Configuration m_conf = new Configuration(); - + /** + * + */ public Initializer() { final String url = RuntimeConfig.getConfig().getJDBCURL(); final int database = DbHelper.getDatabaseFromURL(url); @@ -69,70 +57,34 @@ public class Initializer extends CompoundInitializer { } + /** + * + * @param e + */ @Override public void init(DomainInitEvent e) { s_log.info("Bookmarks app is initializing using .init(DomainInitEvent e)"); - // setupDomainFactory(); + super.init(e); - TransactionContext txn = SessionManager.getSession() - .getTransactionContext(); - txn.beginTxn(); - setupBookmarks(); - txn.commitTxn(); - s_log.info("Bookamrks Initializer completed."); - } - - - -// public final void doStartup() { -// s_log.warn("Initializing Bookmarks..."); - -// TransactionContext txn = -// SessionManager.getSession().getTransactionContext(); - -// txn.beginTxn(); - -// setupBookmarks(); - -// txn.commitTxn(); - -// } - - private void setupBookmarks() { - - ApplicationSetup appsetup = new ApplicationSetup(s_log); - appsetup.setApplicationObjectType( BookmarkApplication.BASE_DATA_OBJECT_TYPE); - appsetup.setKey("bookmarks"); - appsetup.setTitle("Bookmarks Application"); - appsetup.setDescription("Bookmarks for a Portal"); - appsetup.setDispatcherClass("com.arsdigita.bookmarks.BookmarkDispatcher"); - appsetup.setPortalApplication(true); - appsetup.setInstantiator(new ACSObjectInstantiator() { - protected DomainObject doNewInstance(DataObject dataObject) { - return new BookmarkApplication(dataObject); - } - }); - - ApplicationType bmrkAppType = appsetup.run(); - - - AppPortletSetup setup = new AppPortletSetup(s_log); - - setup.setPortletObjectType - (BookmarkPortlet.BASE_DATA_OBJECT_TYPE); - setup.setTitle("Portal Bookmarks"); - setup.setDescription("Displays bookmarks for this portal."); - setup.setProfile(PortletType.NARROW_PROFILE); - setup.setPortalApplication(false); - setup.setProviderApplicationType(bmrkAppType); - setup.setInstantiator(new ACSObjectInstantiator() { + /* Register object instantiator for Bookmarks Application */ + e.getFactory().registerInstantiator( + Bookmarks.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + @Override public DomainObject doNewInstance(DataObject dataObject) { - return new BookmarkPortlet(dataObject); + return new Bookmarks(dataObject); } }); - setup.run(); + + /* Register object instantiator for Bookmarks Portlet */ + e.getFactory().registerInstantiator( + BookmarkPortlet.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + public DomainObject doNewInstance(DataObject dataObject) { + return new BookmarkPortlet(dataObject); + } + }); + } - -// public final void doShutdown() {} } diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java new file mode 100644 index 000000000..8e35daf8f --- /dev/null +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2012 Peter Boy 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 com.arsdigita.bookmarks; + + +import com.arsdigita.bookmarks.ui.BookmarkPortlet; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelExcursion; +import com.arsdigita.loader.PackageLoader; +import com.arsdigita.portal.PortletType; +import com.arsdigita.portal.apportlet.AppPortletType; +import com.arsdigita.runtime.ScriptContext; +import com.arsdigita.web.ApplicationType; +import com.arsdigita.web.Application; + +import org.apache.log4j.Logger; + +/** + *

Executes nonrecurring at install time and loads (installs and initializes) + * the HTTP Auth application and type persistently into database.

+ * + * @author Daniel Berrange + * @version $Id: Loader.java 287 2005-02-22 00:29:02Z sskracic $ + */ + +/** + * + * @author pb + */ +public class Loader extends PackageLoader { + + /** Creates a s_logging category with name = full name of class */ + private static final Logger s_log = Logger.getLogger(Loader.class); + + /** + * + * @param ctx + */ + public void run(final ScriptContext ctx) { + new KernelExcursion() { + public void excurse() { + setEffectiveParty(Kernel.getSystemParty()); + + ApplicationType bmrkAppType = loadBookmarksApp(); + loadBookmarksPortlet(bmrkAppType); + setupDefaultBookmarkApplicationInstance(); + + } + }.run(); + } + + /** + * Load the Bookmarks application into persistent storage. + * + * @return Bookmarks application type, requirred to load the portlet type + */ + private ApplicationType loadBookmarksApp() { + + /* Create new type legacy free application type + * 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 + * hyphen and converted to lower case. + * "Bookmarks" will become "bookmarks". */ + ApplicationType type = new ApplicationType("Bookmarks", + Bookmarks.BASE_DATA_OBJECT_TYPE ); + + type.setDescription("Bookmarks for a Portal"); + type.save(); + + return type; + } + + private void loadBookmarksPortlet(ApplicationType bmrkAppType ) { + + AppPortletType type = AppPortletType.createAppPortletType( + "Portal Bookmarks", + PortletType.NARROW_PROFILE, + BookmarkPortlet.BASE_DATA_OBJECT_TYPE); + type.setProviderApplicationType(bmrkAppType); + type.setDescription("Displays bookmarks for this portal."); + + } + + + /** + * Instantiates the Bookmarks application admin instance. + * + */ + public static void setupDefaultBookmarkApplicationInstance() { + + /* 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."); + s_log.debug("Done loading bookmarks."); + } + +} diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkBasePage.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkBasePage.java index 1ac996397..06ac0bee3 100755 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkBasePage.java +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkBasePage.java @@ -117,10 +117,12 @@ public class BookmarkBasePage extends Page { } + @Override public void lock() { - buildPage(); + buildPage(); super.lock(); + } // Only the PortalPage.lock() should invoke this @@ -342,8 +344,10 @@ public class BookmarkBasePage extends Page { Application parent = app.getParentApplication(); - link.setChild(new Label(parent.getTitle())); - link.setTarget(parent.getPath()); + if (parent != null) { + link.setChild(new Label(parent.getTitle())); + link.setTarget(parent.getPath()); + } } } diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkEditPane.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkEditPane.java index 5fa8e3367..1b7457e85 100755 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkEditPane.java +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkEditPane.java @@ -18,7 +18,7 @@ package com.arsdigita.bookmarks.ui; import com.arsdigita.bookmarks.util.GlobalizationUtil; import com.arsdigita.bookmarks.BookmarkCollection; -import com.arsdigita.bookmarks.BookmarkApplication; +import com.arsdigita.bookmarks.Bookmarks; import com.arsdigita.bookmarks.Bookmark; import com.arsdigita.web.Application; @@ -89,7 +89,7 @@ public class BookmarkEditPane extends DynamicListWizard { BookmarkCollection m_bmrks; Bookmark m_bmrk; public BmrkListModel(PageState s) { - BookmarkApplication bmrkapp = (BookmarkApplication)Application.getCurrentApplication(s.getRequest()); + Bookmarks bmrkapp = (Bookmarks)Application.getCurrentApplication(s.getRequest()); m_bmrks = bmrkapp.getBookmarks(); } public boolean next() { @@ -129,7 +129,7 @@ public class BookmarkEditPane extends DynamicListWizard { m_prtlRL = new RequestLocal() { protected Object initialValue(PageState ps) { - return (BookmarkApplication)Application.getCurrentApplication( + return (Bookmarks)Application.getCurrentApplication( ps.getRequest()); } }; @@ -181,7 +181,7 @@ public class BookmarkEditPane extends DynamicListWizard { public void validate(FormSectionEvent ev) { // check that the user has permission to create bookmarks. PageState ps = ev.getPageState(); - BookmarkApplication ba = (BookmarkApplication)m_prtlRL.get(ps); + Bookmarks ba = (Bookmarks)m_prtlRL.get(ps); ba.assertPrivilege(PrivilegeDescriptor.CREATE); } }); @@ -190,7 +190,7 @@ public class BookmarkEditPane extends DynamicListWizard { addForm.addProcessListener(new FormProcessListener() { public void process(FormSectionEvent ev) { PageState ps = ev.getPageState(); - final BookmarkApplication ba = (BookmarkApplication)m_prtlRL.get(ps); + final Bookmarks ba = (Bookmarks)m_prtlRL.get(ps); final Bookmark newBmrk = new Bookmark(newBmrkName.getValue(ps).toString(), newBmrkURL.getValue(ps).toString()); @@ -252,7 +252,7 @@ public class BookmarkEditPane extends DynamicListWizard { public Component getComponent(List list, PageState state, Object value, String key, int index, boolean isSelected) { - BookmarkApplication app = (BookmarkApplication) Web.getContext() + Bookmarks app = (Bookmarks) Web.getContext() .getApplication(); BookmarkCollection bColl = app.getBookmarks(); final long size = bColl.size(); @@ -303,13 +303,13 @@ public class BookmarkEditPane extends DynamicListWizard { if (EVENT_SWAP_UP.equals(name)) { BigDecimal bID = new BigDecimal(bIDstr); Bookmark b = Bookmark.retrieveBookmark(bID); - BookmarkApplication bApp = b.getBookmarkApplication(); + Bookmarks bApp = b.getBookmarkApplication(); bApp.swapBookmarkWithPrevious(b); } else if (EVENT_SWAP_DOWN.equals(name)) { BigDecimal bID = new BigDecimal(bIDstr); Bookmark b = Bookmark.retrieveBookmark(bID); - BookmarkApplication bApp = b.getBookmarkApplication(); + Bookmarks bApp = b.getBookmarkApplication(); bApp.swapBookmarkWithNext(b); } else { @@ -536,7 +536,7 @@ public class BookmarkEditPane extends DynamicListWizard { BigDecimal bd = new BigDecimal((String) getSelectionModel().getSelectedKey(s)); Bookmark bmrk = Bookmark.retrieveBookmark(bd); - BookmarkApplication ba = (BookmarkApplication)Application.getCurrentApplication(s.getRequest()); + Bookmarks ba = (Bookmarks)Application.getCurrentApplication(s.getRequest()); bmrk.setName(bookmarkName.getValue(s).toString()); bmrk.setURL(bookmarkURL.getValue(s).toString()); bmrk.setDescription(bookmarkDescription.getValue(s).toString()); @@ -592,7 +592,7 @@ public class BookmarkEditPane extends DynamicListWizard { if(button.isSelected(s)) { BigDecimal bmrkID = new BigDecimal((String)getSelectionModel().getSelectedKey(s)); Bookmark bmrk = Bookmark.retrieveBookmark(bmrkID); - BookmarkApplication bmrkapp = (BookmarkApplication)Application.getCurrentApplication(s.getRequest()); + Bookmarks bmrkapp = (Bookmarks)Application.getCurrentApplication(s.getRequest()); bmrkapp.removeBookmark(bmrk); getSelectionModel().clearSelection(s); reset(s); diff --git a/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkPortlet.java b/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkPortlet.java index 898c73dca..6cf293fe3 100755 --- a/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkPortlet.java +++ b/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkPortlet.java @@ -23,7 +23,7 @@ import com.arsdigita.bebop.GridPanel; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.portal.AbstractPortletRenderer; -import com.arsdigita.bookmarks.BookmarkApplication; +import com.arsdigita.bookmarks.Bookmarks; import com.arsdigita.bookmarks.BookmarkCollection; import com.arsdigita.bookmarks.util.GlobalizationUtil; import com.arsdigita.kernel.permissions.PermissionDescriptor; @@ -44,44 +44,82 @@ import com.arsdigita.xml.Element; */ public class BookmarkPortlet extends AppPortlet { + /** Logger instance for debugging */ private static final Logger s_log = Logger.getLogger(BookmarkPortlet.class); + /** PDL stuff - Data Object */ public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.workspace.BookmarkPortlet"; + "com.arsdigita.workspace.BookmarkPortlet"; + /** + * Provide the Data Object Type. + * @return DataObjectType as String + */ + @Override protected String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; } + /** + * Constructor + * + * @param dataObject + */ public BookmarkPortlet(DataObject dataObject) { super(dataObject); } + /** + * + * @return + */ + @Override public String getZoomURL() { Application app = getParentApplication(); if (!PermissionService.checkPermission( - new PermissionDescriptor(PrivilegeDescriptor.READ, app, Web.getContext().getUser()))) { + new PermissionDescriptor(PrivilegeDescriptor.READ, + app, + Web.getContext().getUser()))) { return null; } return (URL.getDispatcherPath() + app.getPrimaryURL()); } + /** + * + * @return + */ + @Override protected AbstractPortletRenderer doGetPortletRenderer() { return new BookmarkPortletRenderer(this); } } +/** + * + * + */ class BookmarkPortletRenderer extends AbstractPortletRenderer { + private BookmarkPortlet m_portlet; + /** + * + * @param portlet + */ public BookmarkPortletRenderer (BookmarkPortlet portlet) { m_portlet = portlet; } + /** + * + * @param pageState + * @param parentElement + */ protected void generateBodyXML(PageState pageState, Element parentElement) { - BookmarkApplication bmrkapp = - (BookmarkApplication)m_portlet.getParentApplication(); + Bookmarks bmrkapp = + (Bookmarks)m_portlet.getParentApplication(); // Variables used cursorwise. int counter; diff --git a/ccm-bookmarks/web/WEB-INF/web.ccm-bookmarks.xml b/ccm-bookmarks/web/WEB-INF/web.ccm-bookmarks.xml new file mode 100644 index 000000000..9421251ce --- /dev/null +++ b/ccm-bookmarks/web/WEB-INF/web.ccm-bookmarks.xml @@ -0,0 +1,18 @@ + + + + + + bookmarks + com.arsdigita.bookmarks.BookmarksServlet + + + + bookmarks + /bookmarks/* + + + \ No newline at end of file diff --git a/ccm-core/src/com/arsdigita/domain/DomainObject.java b/ccm-core/src/com/arsdigita/domain/DomainObject.java index 3a2b340f5..beade4f72 100755 --- a/ccm-core/src/com/arsdigita/domain/DomainObject.java +++ b/ccm-core/src/com/arsdigita/domain/DomainObject.java @@ -341,17 +341,16 @@ public abstract class DomainObject { } /** - * Set an association DomainObjects DataObject. - * This should only be used inside of a setXXX - * method. + * Set an association DomainObjects DataObject. This should only be used + * inside of a setXXX method. *

- * Specificall, this method should only be used to set - * associations whose multiplicity is 0..1 or 1..1. - * If the upper bound of the multiplicity is greater than 1 - * then the {@link #add(String, DataObject)} method should be used. + * Specifically, this method should only be used to set associations + * whose multiplicity is 0..1 or 1..1. + * If the upper bound of the multiplicity is greater than 1 then the + * {@link #add(String, DataObject)} method should be used. * * @see com.arsdigita.persistence.DataObject#set(String, Object) - **/ + */ protected void setAssociation(String attr, DomainObject dobj) { set(attr, dobj == null ? null : dobj.m_dataObject); } @@ -515,8 +514,9 @@ public abstract class DomainObject { * whether the object is new, modified, deleted, or unknown. Unknown is for * objects that have been invalidated. */ + @Override public String toString() { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); OID oid = getOID(); if ( oid != null ) { result.append(oid.toString()); @@ -586,37 +586,47 @@ public abstract class DomainObject { private DomainObject getDomainObject() { return DomainObject.this; } + @Override public void set(DataObject object, String property, Object previous, Object value) { } + @Override public void add(DataObject object, String property, DataObject value) { } + @Override public void remove(DataObject object, String property, DataObject value) { } + @Override public void clear(DataObject object, String property) { } + @Override public void beforeSave(DataObject object) { getDomainObject().beforeSave(); } + @Override public void afterSave(DataObject object) { getDomainObject().afterSave(); } + @Override public void beforeDelete(DataObject object) { getDomainObject().beforeDelete(); } + @Override public void afterDelete(DataObject object) { getDomainObject().afterDelete(); } + @Override public int hashCode() { return getDomainObject().hashCode(); } + @Override public boolean equals(Object other) { if (other instanceof SaveObserver) { return getDomainObject().equals( @@ -639,6 +649,7 @@ public abstract class DomainObject { return false; } + @Override public String toString() { return "Save observer for: " + getDomainObject().getOID() + " (" + super.toString() + ")"; diff --git a/ccm-core/src/com/arsdigita/portal/PortletType.java b/ccm-core/src/com/arsdigita/portal/PortletType.java index 9d5189ff9..166a9bab0 100755 --- a/ccm-core/src/com/arsdigita/portal/PortletType.java +++ b/ccm-core/src/com/arsdigita/portal/PortletType.java @@ -109,19 +109,7 @@ public class PortletType extends ResourceType { Assert.exists(title, "title"); Assert.exists(profile, "profile"); Assert.exists(portletObjectType, "portletObjectType"); -/* Portal now legacy free. To be deleted when transistion is completed. - PackageType packageType = null; - // is com.arsdigita.portal.Portal initialized - try { - packageType = PackageType.findByKey("portal"); - } catch (DataObjectNotFoundException nfe) { - String message = - "The PackageType 'portal' is not installed. It must be " + - "installed in order to create a new PortletType."; - s_cat.error(message); - throw new IllegalStateException(message); - } -*/ + // is com.arsdigita.portal.Portal initialized? if ( !ResourceType.isInstalled(Portal.BASE_DATA_OBJECT_TYPE) ) { String message = diff --git a/ccm-core/src/com/arsdigita/portal/apportlet/AppPortlet.java b/ccm-core/src/com/arsdigita/portal/apportlet/AppPortlet.java index 863fdad3b..1e52d7d9d 100755 --- a/ccm-core/src/com/arsdigita/portal/apportlet/AppPortlet.java +++ b/ccm-core/src/com/arsdigita/portal/apportlet/AppPortlet.java @@ -82,6 +82,7 @@ public class AppPortlet extends Portlet { } } + @Override public PortletRenderer getPortletRenderer() { AbstractPortletRenderer portletRenderer = doGetPortletRenderer(); diff --git a/ccm-core/src/com/arsdigita/portal/apportlet/AppPortletType.java b/ccm-core/src/com/arsdigita/portal/apportlet/AppPortletType.java index bd6974196..2c2b55672 100755 --- a/ccm-core/src/com/arsdigita/portal/apportlet/AppPortletType.java +++ b/ccm-core/src/com/arsdigita/portal/apportlet/AppPortletType.java @@ -35,19 +35,20 @@ import java.math.BigDecimal; public final class AppPortletType extends PortletType { private static final Logger s_cat = - Logger.getLogger(AppPortletType.class.getName()); + Logger.getLogger(AppPortletType.class.getName()); - private final static String IS_PORTAL_APPLICATION = - "isWorkspaceApplication"; + private final static String IS_PORTAL_APPLICATION = "isWorkspaceApplication"; protected AppPortletType(DataObject dataObject) { super(dataObject); } // Create from packageType. - protected AppPortletType - (String dataObjectType, String title, String profile, - String portletObjectType) { + protected AppPortletType(String dataObjectType, + String title, + String profile, + String portletObjectType) { + super(dataObjectType,title,profile,portletObjectType); } diff --git a/ccm-docmgr/application.xml b/ccm-docmgr/application.xml index 7feedbeec..a04736874 100755 --- a/ccm-docmgr/application.xml +++ b/ccm-docmgr/application.xml @@ -11,7 +11,7 @@ - + diff --git a/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java b/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java new file mode 100644 index 000000000..5e769c32f --- /dev/null +++ b/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java @@ -0,0 +1,222 @@ +/* + * Copyright (C) 2012 Peter Boy 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 com.arsdigita.cms.docmgr; + +import com.arsdigita.docrepo.ui.RecentUpdatedDocsPortlet; +// import com.arsdigita.mimetypes.*; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.kernel.ACSObjectInstantiator; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelExcursion; +import com.arsdigita.loader.PackageLoader; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.portal.PortletType; +import com.arsdigita.portal.apportlet.AppPortletSetup; +import com.arsdigita.runtime.ScriptContext; +import com.arsdigita.web.ApplicationSetup; +import com.arsdigita.web.ApplicationType; + +import org.apache.log4j.Logger; + +/** + * CMS Document Manager (DocMgr) Loader + * + * @author pboy <pboy@barkhof.uni-bremen.de> + * @version $Id: Loader.java $ + **/ + +public class Loader extends PackageLoader { + + + /** Logger instance for debugging */ + private static final Logger s_log = Logger.getLogger(Loader.class); + + /** + * Run script invoked by com.arsdigita.packing loader script. + * + * @param ctx + */ + public void run(final ScriptContext ctx) { + + new KernelExcursion() { + public void excurse() { + setEffectiveParty(Kernel.getSystemParty()); + + loadDocRepositoryApplicationType(); //former setupDocs + setupDocRepositoryPortlet(null); //former setupDocManagerPortlet + + setupDefaultDocRepository(); + + } + }.run(); + + s_log.info("Done"); + } + + // //////////////////////////////////////////////////////////////////////// + // + // S e t u p o f a p p l i c a t i o n t y p e s + // + // //////////////////////////////////////////////////////////////////////// + + /** + * Creates a document repository application type, the domain class of the + * document repository (docrepo) 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. + */ + private ApplicationType loadDocRepositoryApplicationType() { + + ApplicationSetup setup = new ApplicationSetup(s_log); + setup.setApplicationObjectType(Repository.BASE_DATA_OBJECT_TYPE); + setup.setKey("cmsdocs"); + setup.setTitle("Document Manager (CMS) Application"); + setup.setSingleton(false); + setup.setDescription + ("The document manager empowers users to share documents."); + setup.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DMDispatcher"); + setup.setInstantiator(new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new Repository(dataObject); + } + }); + + return setup.run(); + + + /* Legacy free initialization + * 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 hyphen and converted + * to lower case. + * Example: "DocRepo" will become "docrepo". + */ + // ApplicationType type = new + // ApplicationType("DocRepo", + // Repository.BASE_DATA_OBJECT_TYPE ); + + // type.setDescription + // ("The document repository empowers users to share documents."); + + } + + private ApplicationType setupCategoryBrowsing() { + ApplicationSetup setup = new ApplicationSetup(s_log); + setup.setApplicationObjectType(DocumentCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE); + setup.setKey("cmsdocs-categories"); + setup.setTitle("Browse Documents Application"); + setup.setSingleton(true); + setup.setDescription + ("Browse documents by category."); + setup.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher"); + setup.setInstantiator(new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new DocumentCategoryBrowserApplication(dataObject); + } + }); + return setup.run(); + + } + private ApplicationType setupLegacyCategoryBrowsing() { + ApplicationSetup setup = new ApplicationSetup(s_log); + setup.setApplicationObjectType(LegacyCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE); + setup.setKey("cmsdocs-categories-legacy"); + setup.setTitle("Taxonomy Browser"); + setup.setSingleton(true); + setup.setDescription + ("Browse documents by category."); + setup.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher"); + setup.setInstantiator(new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new LegacyCategoryBrowserApplication(dataObject); + } + }); + return setup.run(); + + } + + + + // //////////////////////////////////////////////////////////////////////// + // + // S e t u p a D O C M G R a p p l i c a t i o n + // + // //////////////////////////////////////////////////////////////////////// + private void setupDefaultDocRepository() { + + // try { + // SiteNode sn = SiteNode.getSiteNode("/administration", false); + // if (!"administration".equals(sn.getName())) { + Repository repo = Repository.create( + "repository", "Default Document Repository", null); + repo.save(); + // } + // } catch (DataObjectNotFoundException e) { + // Assert.fail(e.getMessage()); + // } + } + + + // //////////////////////////////////////////////////////////////////////// + // + // S e t u p o f i n t e r n a l p o r t l e t s + // + // //////////////////////////////////////////////////////////////////////// + + + /** + * Creates a PortletType (persistent object) for the RecentUpdatedDocs + * Portlet. + * + * Instances (Portlets) are created by user interface or programmatically + * by configuration. + */ + private void setupDocRepositoryPortlet(ApplicationType provider) { + + // Create the document repository portlet + 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(); + + } + + +} diff --git a/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java b/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java index 5847dd120..4beaf7e11 100755 --- a/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java +++ b/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java @@ -78,6 +78,7 @@ public class Initializer extends CompoundInitializer { // return m_conf; // } + @Override public void init(DomainInitEvent e) { s_log.debug("Document (CCM) Manager is initializing using .init(DomainInitEvent e)"); startup(); @@ -92,7 +93,7 @@ public class Initializer extends CompoundInitializer { setupDomainFactory(); TransactionContext txn = SessionManager.getSession() - .getTransactionContext(); + .getTransactionContext(); txn.beginTxn(); ApplicationType docsAppType = setupDocs(); @@ -127,9 +128,6 @@ public class Initializer extends CompoundInitializer { setup.setDescription ("The document manager empowers users to share documents."); setup.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DMDispatcher"); - // Class Stylesheet and database backed stylesheet locations are - // deprecated and removed. New StylesheetResolver is pattern based. - // setup.setStylesheet("/packages/cms-docmgr/xsl/docs.xsl"); setup.setInstantiator(new ACSObjectInstantiator() { @Override public DomainObject doNewInstance(DataObject dataObject) { diff --git a/ccm-ldn-search/src/com/arsdigita/london/search/Initializer.java b/ccm-ldn-search/src/com/arsdigita/london/search/Initializer.java index fa9c0bd79..dcabe57fa 100755 --- a/ccm-ldn-search/src/com/arsdigita/london/search/Initializer.java +++ b/ccm-ldn-search/src/com/arsdigita/london/search/Initializer.java @@ -51,6 +51,9 @@ public class Initializer extends CompoundInitializer { private Thread[] m_workers; + /** + * + */ public Initializer() { final String url = RuntimeConfig.getConfig().getJDBCURL(); final int database = DbHelper.getDatabaseFromURL(url); diff --git a/ccm-sci-bundle/bundles/devel/cfg/integration.properties b/ccm-sci-bundle/bundles/devel/cfg/integration.properties index 5aee817d9..17f9b57ce 100644 --- a/ccm-sci-bundle/bundles/devel/cfg/integration.properties +++ b/ccm-sci-bundle/bundles/devel/cfg/integration.properties @@ -123,6 +123,9 @@ themedirector.default_theme_context= themedirector.default_theme_path=themes/static/aplaws-generic themedirector.file_extensions=bmp css gif jpeg jpg js png xml xsl +# ccm-auth-http application +auth.http.admin_email=webmaster@scientificcms.org +auth.http.admin_identifier=webmaster # ccm-sci-bundle (Loader only) #com.arsdigita.bundle.loader.category_files=bundle/categories/sci-nav-domain-1.00.xml,bundle/categories/sci-nav-hierarchy-1.00.xml diff --git a/ccm-sci-bundle/bundles/devel/cfg/project.xml b/ccm-sci-bundle/bundles/devel/cfg/project.xml index 647a9697f..35e8c836b 100644 --- a/ccm-sci-bundle/bundles/devel/cfg/project.xml +++ b/ccm-sci-bundle/bundles/devel/cfg/project.xml @@ -138,10 +138,10 @@ ---> @@ -154,10 +154,10 @@ ---> @@ -167,20 +167,24 @@ + + + +