Erster Schritt beim Umbau von docmgr.
git-svn-id: https://svn.libreccm.org/ccm/trunk@1533 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
8a19a65917
commit
0eb2cad432
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<registry>
|
||||
<config class="com.arsdigita.cms.docmgr.DocMgrConfig"
|
||||
storage="ccm-docmgr/docmgr.properties"/>
|
||||
<config class="com.arsdigita.cms.docmgr.DocMgrConfig"
|
||||
storage="ccm-docmgr/docmgr.properties"/>
|
||||
</registry>
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
<data class="com.arsdigita.cms.docmgr.DocumentLoader"/>
|
||||
<data class="com.arsdigita.cms.docmgr.DocLinkLoader"/>
|
||||
<data class="com.arsdigita.cms.docmgr.DocFolderLoader"/>
|
||||
<data class="com.arsdigita.cms.docmgr.Loader"/>
|
||||
</scripts>
|
||||
</load>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class DocFolder extends Folder implements Resource {
|
|||
|
||||
/** Data object type for this domain object */
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.cms.docmgr.DocFolder";
|
||||
= "com.arsdigita.cms.docmgr.DocFolder";
|
||||
/** Data object type for this domain object (for CMS compatibility) */
|
||||
public static final String TYPE = BASE_DATA_OBJECT_TYPE;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,15 @@
|
|||
*/
|
||||
package com.arsdigita.cms.docmgr;
|
||||
|
||||
import com.arsdigita.docrepo.ui.RecentUpdatedDocsPortlet;
|
||||
// import com.arsdigita.mimetypes.*;
|
||||
import com.arsdigita.cms.docmgr.ui.CategoryDocsNavigatorPortlet;
|
||||
import com.arsdigita.cms.docmgr.ui.LegacyCategoryDocsNavigatorPortlet;
|
||||
import com.arsdigita.cms.docmgr.ui.RecentUpdatedDocsPortlet;
|
||||
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.mimetypes.*;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.portal.PortletType;
|
||||
import com.arsdigita.portal.apportlet.AppPortletSetup;
|
||||
|
|
@ -34,6 +36,33 @@ import com.arsdigita.web.ApplicationType;
|
|||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
// ///////////////////////////////////////////////////////////////////////////
|
||||
// Project: Migrate to new style legacy free type of application.
|
||||
//
|
||||
// Step 1: Copy from Initializer all data base / applicationtype
|
||||
// related code to LOADER and use Loader for data loading.
|
||||
//
|
||||
// Step 2: Remove usage of ApplicationSetup and switch to legacy
|
||||
// compativle AppType xxx = new AppType.create(......)
|
||||
// Move setInstantiator back to Initializer as required.
|
||||
//
|
||||
// Step 3: Move to legacy free app type
|
||||
// (a) modify new App.Tpye.....
|
||||
// (b) create AppServlet from Dispatcher
|
||||
//
|
||||
//
|
||||
// TESTS:
|
||||
// (a) Try to instantiate an instance of each type and check the UI
|
||||
// produced by the dispatcher / servlet
|
||||
// (b) Instantiate the porlets and try to reproduce the behaviour
|
||||
// (probably reproduce the error showing up originally)
|
||||
//
|
||||
//
|
||||
// ///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* CMS Document Manager (DocMgr) Loader
|
||||
*
|
||||
|
|
@ -61,7 +90,18 @@ public class Loader extends PackageLoader {
|
|||
loadDocRepositoryApplicationType(); //former setupDocs
|
||||
setupDocRepositoryPortlet(null); //former setupDocManagerPortlet
|
||||
|
||||
setupDefaultDocRepository();
|
||||
ApplicationType categoryBrowseDocsAppType = setupCategoryBrowsing();
|
||||
setupCategoryDocsPortlet(categoryBrowseDocsAppType);
|
||||
|
||||
ApplicationType legacyCategoryBrowseDocsAppType =
|
||||
setupLegacyCategoryBrowsing();
|
||||
setupLegacyCategoryDocsPortlet(legacyCategoryBrowseDocsAppType);
|
||||
|
||||
// de-activate search for now
|
||||
//SearchUtils.setSearcher
|
||||
// (new com.arsdigita.cms.docmgr.search.IntermediaSearcher());
|
||||
|
||||
setupDefaultDocRepository(); //new here!
|
||||
|
||||
}
|
||||
}.run();
|
||||
|
|
@ -76,6 +116,7 @@ public class Loader extends PackageLoader {
|
|||
// ////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* COPY & PASTE, has to be adopted !!
|
||||
* Creates a document repository application type, the domain class of the
|
||||
* document repository (docrepo) package, as a legacy-compatible type of
|
||||
* application.
|
||||
|
|
@ -85,6 +126,7 @@ public class Loader extends PackageLoader {
|
|||
*
|
||||
* TODO: migrate to a new style, legacy free application type.
|
||||
*/
|
||||
// formerly setupDocs()
|
||||
private ApplicationType loadDocRepositoryApplicationType() {
|
||||
|
||||
ApplicationSetup setup = new ApplicationSetup(s_log);
|
||||
|
|
@ -124,7 +166,8 @@ public class Loader extends PackageLoader {
|
|||
|
||||
private ApplicationType setupCategoryBrowsing() {
|
||||
ApplicationSetup setup = new ApplicationSetup(s_log);
|
||||
setup.setApplicationObjectType(DocumentCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE);
|
||||
setup.setApplicationObjectType(DocumentCategoryBrowserApplication
|
||||
.BASE_DATA_OBJECT_TYPE);
|
||||
setup.setKey("cmsdocs-categories");
|
||||
setup.setTitle("Browse Documents Application");
|
||||
setup.setSingleton(true);
|
||||
|
|
@ -142,7 +185,8 @@ public class Loader extends PackageLoader {
|
|||
}
|
||||
private ApplicationType setupLegacyCategoryBrowsing() {
|
||||
ApplicationSetup setup = new ApplicationSetup(s_log);
|
||||
setup.setApplicationObjectType(LegacyCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE);
|
||||
setup.setApplicationObjectType(LegacyCategoryBrowserApplication
|
||||
.BASE_DATA_OBJECT_TYPE);
|
||||
setup.setKey("cmsdocs-categories-legacy");
|
||||
setup.setTitle("Taxonomy Browser");
|
||||
setup.setSingleton(true);
|
||||
|
|
@ -171,13 +215,16 @@ public class Loader extends PackageLoader {
|
|||
// try {
|
||||
// SiteNode sn = SiteNode.getSiteNode("/administration", false);
|
||||
// if (!"administration".equals(sn.getName())) {
|
||||
Repository repo = Repository.create(
|
||||
"repository", "Default Document Repository", null);
|
||||
Repository repo = Repository
|
||||
.create( "docrepo",
|
||||
"Default DocumentMgr Repository",
|
||||
null);
|
||||
repo.save();
|
||||
// }
|
||||
// } catch (DataObjectNotFoundException e) {
|
||||
// Assert.fail(e.getMessage());
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -195,6 +242,7 @@ public class Loader extends PackageLoader {
|
|||
* Instances (Portlets) are created by user interface or programmatically
|
||||
* by configuration.
|
||||
*/
|
||||
//former setupDocManagerPortlet
|
||||
private void setupDocRepositoryPortlet(ApplicationType provider) {
|
||||
|
||||
// Create the document repository portlet
|
||||
|
|
@ -218,5 +266,49 @@ public class Loader extends PackageLoader {
|
|||
|
||||
}
|
||||
|
||||
private void setupCategoryDocsPortlet(ApplicationType provider) {
|
||||
|
||||
// Create the document manager portlet
|
||||
AppPortletSetup setup = new AppPortletSetup(s_log);
|
||||
|
||||
setup.setPortletObjectType(CategoryDocsNavigatorPortlet
|
||||
.BASE_DATA_OBJECT_TYPE);
|
||||
setup.setTitle("Document Category Navigator");
|
||||
setup.setDescription("Browse documents by category.");
|
||||
setup.setProfile(PortletType.WIDE_PROFILE);
|
||||
setup.setProviderApplicationType(provider);
|
||||
setup.setInstantiator(new ACSObjectInstantiator() {
|
||||
@Override
|
||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new CategoryDocsNavigatorPortlet(dataObject);
|
||||
}
|
||||
});
|
||||
|
||||
setup.run();
|
||||
|
||||
}
|
||||
|
||||
private void setupLegacyCategoryDocsPortlet(ApplicationType provider) {
|
||||
|
||||
// Create the document manager portlet
|
||||
AppPortletSetup setup = new AppPortletSetup(s_log);
|
||||
|
||||
setup.setPortletObjectType(LegacyCategoryDocsNavigatorPortlet
|
||||
.BASE_DATA_OBJECT_TYPE);
|
||||
setup.setTitle("Taxonomy Browser");
|
||||
setup.setDescription("Browse documents by category.");
|
||||
setup.setProfile(PortletType.WIDE_PROFILE);
|
||||
setup.setProviderApplicationType(provider);
|
||||
setup.setInstantiator(new ACSObjectInstantiator() {
|
||||
@Override
|
||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new LegacyCategoryDocsNavigatorPortlet(dataObject);
|
||||
}
|
||||
});
|
||||
|
||||
setup.run();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,9 @@ public class Initializer extends CompoundInitializer {
|
|||
|
||||
@Override
|
||||
public void init(DomainInitEvent e) {
|
||||
s_log.debug("Document (CCM) Manager is initializing using .init(DomainInitEvent e)");
|
||||
s_log.debug("Document (CCM) Manager is Domain initializing ... ");
|
||||
|
||||
setupDomainFactory();
|
||||
startup();
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +92,7 @@ public class Initializer extends CompoundInitializer {
|
|||
public void startup() {
|
||||
s_log.warn("Document Manager is initializing.");
|
||||
|
||||
setupDomainFactory();
|
||||
// setupDomainFactory();
|
||||
|
||||
TransactionContext txn = SessionManager.getSession()
|
||||
.getTransactionContext();
|
||||
|
|
@ -133,7 +135,7 @@ public class Initializer extends CompoundInitializer {
|
|||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new Repository(dataObject);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return setup.run();
|
||||
}
|
||||
|
|
@ -148,6 +150,7 @@ public class Initializer extends CompoundInitializer {
|
|||
setup.setProfile(PortletType.WIDE_PROFILE);
|
||||
setup.setProviderApplicationType(provider);
|
||||
setup.setInstantiator(new ACSObjectInstantiator() {
|
||||
@Override
|
||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new RecentUpdatedDocsPortlet(dataObject);
|
||||
}
|
||||
|
|
@ -169,6 +172,7 @@ public class Initializer extends CompoundInitializer {
|
|||
// 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) {
|
||||
return new DocumentCategoryBrowserApplication(dataObject);
|
||||
}
|
||||
|
|
@ -189,6 +193,7 @@ public class Initializer extends CompoundInitializer {
|
|||
// 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) {
|
||||
return new LegacyCategoryBrowserApplication(dataObject);
|
||||
}
|
||||
|
|
@ -207,6 +212,7 @@ public class Initializer extends CompoundInitializer {
|
|||
setup.setProfile(PortletType.WIDE_PROFILE);
|
||||
setup.setProviderApplicationType(provider);
|
||||
setup.setInstantiator(new ACSObjectInstantiator() {
|
||||
@Override
|
||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new CategoryDocsNavigatorPortlet(dataObject);
|
||||
}
|
||||
|
|
@ -225,6 +231,7 @@ public class Initializer extends CompoundInitializer {
|
|||
setup.setProfile(PortletType.WIDE_PROFILE);
|
||||
setup.setProviderApplicationType(provider);
|
||||
setup.setInstantiator(new ACSObjectInstantiator() {
|
||||
@Override
|
||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new LegacyCategoryDocsNavigatorPortlet(dataObject);
|
||||
}
|
||||
|
|
@ -240,6 +247,7 @@ public class Initializer extends CompoundInitializer {
|
|||
private void setupDomainFactory() {
|
||||
DomainObjectFactory.registerInstantiator(
|
||||
Document.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() {
|
||||
@Override
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new Document(dataObject);
|
||||
}
|
||||
|
|
@ -247,6 +255,7 @@ public class Initializer extends CompoundInitializer {
|
|||
);
|
||||
DomainObjectFactory.registerInstantiator(
|
||||
DocFolder.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() {
|
||||
@Override
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new DocFolder(dataObject);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import com.arsdigita.bebop.event.PrintEvent;
|
|||
import com.arsdigita.bebop.event.PrintListener;
|
||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.bebop.parameters.IntegerParameter;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
// import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.docmgr.util.GlobalizationUtil;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
||||
|
|
@ -369,9 +369,13 @@ public class DocmgrBasePage extends Page implements DMConstants {
|
|||
Assert.exists(app, Application.class);
|
||||
|
||||
Application parent = app.getParentApplication();
|
||||
|
||||
link.setChild(new Label(parent.getTitle()));
|
||||
link.setTarget(parent.getPath());
|
||||
if (parent != null ) { // it's me
|
||||
link.setChild(new Label(parent.getTitle()));
|
||||
link.setTarget(parent.getPath());
|
||||
} else { // it's me (the following 4 lines
|
||||
link.setChild(new Label("/"));
|
||||
link.setTarget(com.arsdigita.web.URL.root().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -359,6 +359,7 @@ class DocrepoBasePage extends Page {
|
|||
}
|
||||
|
||||
protected class CurrentApplicationLabelPrinter implements PrintListener {
|
||||
|
||||
public CurrentApplicationLabelPrinter() {
|
||||
// Empty
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,12 +68,14 @@ public class Converter extends HttpServlet
|
|||
|
||||
public Converter() { }
|
||||
|
||||
@Override
|
||||
public void init() throws ServletException
|
||||
{
|
||||
transformerFactory = TransformerFactory.newInstance();
|
||||
}
|
||||
|
||||
//Setup FOP
|
||||
@Override
|
||||
public void doGet(HttpServletRequest req, HttpServletResponse res)
|
||||
throws ServletException, IOException
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,13 +27,9 @@ import com.arsdigita.runtime.CompoundInitializer;
|
|||
|
||||
/**
|
||||
* Initializes the formbuilder pdf generator
|
||||
* @version $Id: //ps/apps/london/atoz/dev/src/com/arsdigita/london/atoz/Initializer.java#6 $
|
||||
* @version $Id: Initializer.java#6 $
|
||||
*/
|
||||
public class Initializer extends CompoundInitializer {
|
||||
public final static String versionId =
|
||||
"$Id: //ps/apps/london/atoz/dev/src/com/arsdigita/london/atoz/Initializer.java#6 $" +
|
||||
"$Author: mbooth $" +
|
||||
"$DateTime: 2004/04/23 13:04:49 $";
|
||||
|
||||
public Initializer() {
|
||||
final String url = RuntimeConfig.getConfig().getJDBCURL();
|
||||
|
|
|
|||
|
|
@ -31,13 +31,9 @@ import org.apache.log4j.Logger;
|
|||
* Loader.
|
||||
*
|
||||
* @author Justin Ross <jross@redhat.com>
|
||||
* @version $Id: //apps/forum/dev/src/com/arsdigita/forum/Loader.java#7 $
|
||||
* @version $Id: Loader.java#7 $
|
||||
*/
|
||||
public class Loader extends PackageLoader {
|
||||
public final static String versionId =
|
||||
"$Id: //apps/forum/dev/src/com/arsdigita/forum/Loader.java#7 $" +
|
||||
"$Author: dennis $" +
|
||||
"$DateTime: 2004/08/17 23:26:27 $";
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(Loader.class);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ package com.arsdigita.formbuilder.pdf;
|
|||
import com.arsdigita.runtime.AbstractConfig;
|
||||
import com.arsdigita.util.parameter.Parameter;
|
||||
import com.arsdigita.util.parameter.StringParameter;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
|
@ -29,20 +28,16 @@ import org.apache.log4j.Logger;
|
|||
* A set of configuration parameters for the formbuilder PDF action.
|
||||
*
|
||||
* @author Matthew Booth <mbooth@redhat.com>
|
||||
* @version $Id: ForumConfig.java 285 2005-02-22 00:29:02Z sskracic $
|
||||
* @version $Id: PDFConfig.java 285 2005-02-22 00:29:02Z sskracic $
|
||||
*/
|
||||
|
||||
public class PDFConfig extends AbstractConfig {
|
||||
public final static String versionId =
|
||||
"$Id: ForumConfig.java 285 2005-02-22 00:29:02Z sskracic $" +
|
||||
"$Author: sskracic $" +
|
||||
"$DateTime: 2004/08/17 23:26:27 $";
|
||||
|
||||
private Parameter m_xslFile;
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(PDFConfig.class);
|
||||
|
||||
private static final PDFConfig s_config = new PDFConfig();
|
||||
|
||||
private Parameter m_xslFile;
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
|
|
|
|||
Loading…
Reference in New Issue