DocMgrConfig record; it cannot be null
+ */
+ public static synchronized DocMgrConfig getInstance() {
+ if (s_config == null) {
+ s_config = new DocMgrConfig();
+ s_config.load();
+ }
- m_contentSection = new StringParameter
+ return s_config;
+ }
+
+ // /////////////////////////////////////////////////////////////////////////
+ //
+ // Parameter Sektion
+
+ private Parameter m_contentSection = new StringParameter
("com.arsdigita.cms.docmgr.content_section",
Parameter.REQUIRED,
"content");
-
- m_legacyFolderName = new StringParameter
+ private Parameter m_legacyFolderName = new StringParameter
("com.arsdigita.cms.docmgr.legacy_folder_name",
Parameter.REQUIRED,
"legacy");
-
- m_legacyFolderID = new IntegerParameter
+ private Parameter m_legacyFolderID = new IntegerParameter
("com.arsdigita.cms.docmgr.legacy_folder_id",
Parameter.REQUIRED,
- "-200");
-
-
- m_internalGroupID = new IntegerParameter
+ -200);
+ private Parameter m_internalGroupID = new IntegerParameter
("com.arsdigita.cms.docmgr.internal_group_id",
Parameter.REQUIRED,
- "-200");
-
- m_rowsPerPage = new IntegerParameter
+ -200);
+ private Parameter m_rowsPerPage = new IntegerParameter
("com.arsdigita.cms.docmgr.rows_per_page",
Parameter.OPTIONAL,
- "20");
+ 20);
+
+ /**
+ * Constructor registers Parameters and reads repository file if exist.
+ *
+ * Do NOT instantiate this class directly using its constructor but use
+ * the provided getDocMgrConfig method above.
+ */
+ public DocMgrConfig() {
register(m_contentSection);
register(m_legacyFolderName);
- register(m_legacyFolderID);
+ register(m_legacyFolderID);
register(m_internalGroupID);
register(m_rowsPerPage);
diff --git a/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java b/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java
index 7678e14d0..335501e15 100644
--- a/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java
+++ b/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java
@@ -30,6 +30,7 @@ import com.arsdigita.loader.PackageLoader;
import com.arsdigita.persistence.DataObject;
import com.arsdigita.portal.PortletType;
import com.arsdigita.portal.apportlet.AppPortletSetup;
+import com.arsdigita.portal.apportlet.AppPortletType;
import com.arsdigita.runtime.ScriptContext;
import com.arsdigita.web.ApplicationSetup;
import com.arsdigita.web.ApplicationType;
@@ -129,7 +130,7 @@ public class Loader extends PackageLoader {
// formerly setupDocs()
private ApplicationType loadDocRepositoryApplicationType() {
- ApplicationSetup setup = new ApplicationSetup(s_log);
+/* ApplicationSetup setup = new ApplicationSetup(s_log);
setup.setApplicationObjectType(Repository.BASE_DATA_OBJECT_TYPE);
setup.setKey("cmsdocs");
setup.setTitle("Document Manager (CMS) Application");
@@ -145,6 +146,14 @@ public class Loader extends PackageLoader {
});
return setup.run();
+*/
+ /* Create new type legacy compatible application type */
+ ApplicationType type = ApplicationType
+ .createApplicationType("cmsdocs",
+ "DocRepo",
+ Repository.BASE_DATA_OBJECT_TYPE);
+ type.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DMDispatcher");
+ type.setDescription("The document manager empowers users to share documents.");
/* Legacy free initialization
@@ -162,10 +171,11 @@ public class Loader extends PackageLoader {
// type.setDescription
// ("The document repository empowers users to share documents.");
+ return type;
}
private ApplicationType setupCategoryBrowsing() {
- ApplicationSetup setup = new ApplicationSetup(s_log);
+/* ApplicationSetup setup = new ApplicationSetup(s_log);
setup.setApplicationObjectType(DocumentCategoryBrowserApplication
.BASE_DATA_OBJECT_TYPE);
setup.setKey("cmsdocs-categories");
@@ -181,10 +191,20 @@ public class Loader extends PackageLoader {
}
});
return setup.run();
+*/
+ /* Create new type legacy compatible application type */
+ ApplicationType type = ApplicationType
+ .createApplicationType("cmsdocs-categories",
+ "Browse Documents Application",
+ DocumentCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE);
+ type.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher");
+ type.setDescription("Browse documents by category.");
+
+ return type;
}
private ApplicationType setupLegacyCategoryBrowsing() {
- ApplicationSetup setup = new ApplicationSetup(s_log);
+/* ApplicationSetup setup = new ApplicationSetup(s_log);
setup.setApplicationObjectType(LegacyCategoryBrowserApplication
.BASE_DATA_OBJECT_TYPE);
setup.setKey("cmsdocs-categories-legacy");
@@ -200,6 +220,16 @@ public class Loader extends PackageLoader {
}
});
return setup.run();
+*/
+ /* Create new type legacy compatible application type */
+ ApplicationType type = ApplicationType
+ .createApplicationType("cmsdocs-categories-legacy",
+ "Taxonomy Browser",
+ LegacyCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE);
+ type.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher");
+ type.setDescription("Browse documents by category.");
+
+ return type;
}
@@ -246,7 +276,7 @@ public class Loader extends PackageLoader {
private void setupDocRepositoryPortlet(ApplicationType provider) {
// Create the document repository portlet
- AppPortletSetup setup = new AppPortletSetup(s_log);
+/* AppPortletSetup setup = new AppPortletSetup(s_log);
setup.setPortletObjectType(RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE);
setup.setTitle("Recently Updated Documents");
@@ -263,6 +293,16 @@ public class Loader extends PackageLoader {
});
setup.run();
+*/
+ AppPortletType type = AppPortletType.createAppPortletType(
+ "Portal Bookmarks",
+ PortletType.NARROW_PROFILE,
+ RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE);
+ // type.setProviderApplicationType(provider);
+ type.setProviderApplicationType(Repository.BASE_DATA_OBJECT_TYPE);
+ type.setDescription(
+ "Displays the most recent documents in the document repository.");
+
}
diff --git a/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java b/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java
index c15677c72..80cc97b83 100755
--- a/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java
+++ b/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java
@@ -50,6 +50,10 @@ import org.apache.log4j.Logger;
*/
public class Repository extends Application {
+
+ private static Logger s_log =
+ Logger.getLogger(Repository.class);
+
public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.cms.docmgr.Repository";
@@ -57,9 +61,6 @@ public class Repository extends Application {
return BASE_DATA_OBJECT_TYPE;
}
- private static Logger s_log =
- Logger.getLogger(Repository.class);
-
// pdl constants
public static final String OWNER = "ownerID";
public static final String ROOT = "rootID";
diff --git a/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocLinkInitializer.java b/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocLinkInitializer.java
index 53893d17b..c2f25deff 100755
--- a/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocLinkInitializer.java
+++ b/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocLinkInitializer.java
@@ -30,6 +30,7 @@ public class DocLinkInitializer extends ContentTypeInitializer {
super("empty.pdl.mf", DocLink.BASE_DATA_OBJECT_TYPE);
}
+ @Override
public String getTraversalXML() {
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/docmgr/DocLink.xml";
}
@@ -41,8 +42,10 @@ public class DocLinkInitializer extends ContentTypeInitializer {
*
* @return fully qualified path info string relative to document root
*/
+ @Override
public String[] getStylesheets() {
return new String[] {
- "/static/content-types/com/arsdigita/cms/docmgr/DocLink.xsl" };
+ "/themes/heirloom/contenttypes/DMDocLink.xsl" };
+ // "/static/content-types/com/arsdigita/cms/docmgr/DocLink.xsl" };
}
}
diff --git a/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocumentInitializer.java b/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocumentInitializer.java
index b1fcf3847..c7cc5da0f 100755
--- a/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocumentInitializer.java
+++ b/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocumentInitializer.java
@@ -23,6 +23,7 @@ public class DocumentInitializer extends ContentTypeInitializer {
super("ccm-docmgr.pdl.mf", Document.BASE_DATA_OBJECT_TYPE);
}
+ @Override
public String getTraversalXML() {
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/docmgr/Document.xml";
}
@@ -34,8 +35,10 @@ public class DocumentInitializer extends ContentTypeInitializer {
*
* @return fully qualified path info string reltive to document (context) root
*/
+ @Override
public String[] getStylesheets() {
return new String[] {
- "/static/content-types/com/arsdigita/cms/docmgr/Document.xsl" };
+ "/themes/heirloom/contenttypes/DMDocument.xsl" };
+ // "/static/content-types/com/arsdigita/cms/docmgr/Document.xsl" };
}
}
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 44e2c100c..49ccb4d2f 100755
--- a/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java
+++ b/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java
@@ -50,9 +50,11 @@ import com.arsdigita.web.ApplicationType;
*
* @version $Revision: #11 $ $Date: 2004/01/14 $
*/
-
public class Initializer extends CompoundInitializer {
+ /** Private Logger instance for debugging purpose. */
+ private static Logger s_log = Logger.getLogger(Initializer.class);
+
// private Configuration m_conf = new Configuration();
private static final String SEPARATOR = java.io.File.separator;
@@ -65,9 +67,9 @@ public class Initializer extends CompoundInitializer {
public static final String INTERNAL_GROUP_ID = "internalGroupID";
public static final String LEGACY_FOLDER_NAME = "legacyFolderName";
- private static Logger s_log =
- Logger.getLogger(Initializer.class);
-
+ /**
+ *
+ */
public Initializer() {
}
@@ -78,11 +80,55 @@ public class Initializer extends CompoundInitializer {
// return m_conf;
// }
+ /**
+ *
+ * @param e
+ */
@Override
public void init(DomainInitEvent e) {
s_log.debug("Document (CCM) Manager is Domain initializing ... ");
- setupDomainFactory();
+ /* Register REPOSITORY application type.*/
+ e.getFactory().registerInstantiator(
+ Repository.BASE_DATA_OBJECT_TYPE,
+ new ACSObjectInstantiator() {
+ @Override
+ public DomainObject doNewInstance(DataObject dataObject) {
+ return new Repository(dataObject);
+ }
+ });
+
+ /* Register Portlet DocumentBrowser. */
+ e.getFactory().registerInstantiator(
+ RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE,
+ new ACSObjectInstantiator() {
+ @Override
+ public DomainObject doNewInstance(DataObject dataObject) {
+ return new RecentUpdatedDocsPortlet(dataObject);
+ }
+ });
+
+ /* Set up domain object factories for basic document manager
+ * object types. */
+
+ DomainObjectFactory.registerInstantiator(
+ Document.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() {
+ @Override
+ public DomainObject doNewInstance(DataObject dataObject) {
+ return new Document(dataObject);
+ }
+ }
+ );
+ DomainObjectFactory.registerInstantiator(
+ DocFolder.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() {
+ @Override
+ public DomainObject doNewInstance(DataObject dataObject) {
+ return new DocFolder(dataObject);
+ }
+ }
+ );
+
+
startup();
}
@@ -98,15 +144,15 @@ public class Initializer extends CompoundInitializer {
.getTransactionContext();
txn.beginTxn();
- ApplicationType docsAppType = setupDocs();
- setupDocManagerPortlet(docsAppType);
+ // ApplicationType docsAppType = setupDocs();
+ // setupDocManagerPortlet(docsAppType);
- ApplicationType categoryBrowseDocsAppType = setupCategoryBrowsing();
- setupCategoryDocsPortlet(categoryBrowseDocsAppType);
+ // ApplicationType categoryBrowseDocsAppType = setupCategoryBrowsing();
+ // setupCategoryDocsPortlet(categoryBrowseDocsAppType);
- ApplicationType legacyCategoryBrowseDocsAppType =
- setupLegacyCategoryBrowsing();
- setupLegacyCategoryDocsPortlet(legacyCategoryBrowseDocsAppType);
+ // ApplicationType legacyCategoryBrowseDocsAppType =
+ // setupLegacyCategoryBrowsing();
+ // setupLegacyCategoryDocsPortlet(legacyCategoryBrowseDocsAppType);
// de-activate search for now
//SearchUtils.setSearcher
@@ -240,28 +286,6 @@ public class Initializer extends CompoundInitializer {
setup.run();
}
- /**
- * Set up domain object factories for basic document manager
- * object types.
- */
- private void setupDomainFactory() {
- DomainObjectFactory.registerInstantiator(
- Document.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() {
- @Override
- public DomainObject doNewInstance(DataObject dataObject) {
- return new Document(dataObject);
- }
- }
- );
- DomainObjectFactory.registerInstantiator(
- DocFolder.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() {
- @Override
- public DomainObject doNewInstance(DataObject dataObject) {
- return new DocFolder(dataObject);
- }
- }
- );
- }
/**
* Shutdown the document manager.
diff --git a/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/FolderTable.java b/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/FolderTable.java
index b50409be6..355a30bc3 100755
--- a/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/FolderTable.java
+++ b/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/FolderTable.java
@@ -109,6 +109,7 @@ class FolderTable extends Table implements TableActionListener, DMConstants {
addTableActionListener(this);
}
+ @Override
public void generateXML(PageState s, Element p) {
long start = System.currentTimeMillis();
super.generateXML(s, p);
@@ -117,6 +118,7 @@ class FolderTable extends Table implements TableActionListener, DMConstants {
}
}
+ @Override
public void register(Page p) {
super.register(p);
p.addComponentStateParam(this, m_sources);
@@ -305,11 +307,17 @@ class FolderTable extends Table implements TableActionListener, DMConstants {
// }
}
+/**
+ *
+ *
+ */
class FolderTableModelBuilder extends LockableImpl implements TableModelBuilder {
- private final static Logger s_log = Logger.getLogger(FolderTableModelBuilder.class);
+ private final static Logger s_log =
+ Logger.getLogger(FolderTableModelBuilder.class);
- public static final SimpleDateFormat dateFormatter = new SimpleDateFormat("MMMMMMMMMMM d, yyyy");
+ public static final SimpleDateFormat dateFormatter = new
+ SimpleDateFormat("MMMMMMMMMMM d, yyyy");
private Tree m_tree;
private FolderContentsTableForm m_parent;
@@ -361,7 +369,8 @@ class FolderTableModelBuilder extends LockableImpl implements TableModelBuilder
Folder parentFolder = new Folder(folderID);
- m_collection = SessionManager.getSession().retrieveQuery("com.arsdigita.cms.docmgr.ui.ItemsInFolder");
+ m_collection = SessionManager.getSession().retrieveQuery(
+ "com.arsdigita.cms.docmgr.ui.ItemsInFolder");
m_collection.setParameter(Folder.PARENT, folderID);
m_collection.setParameter(Folder.VERSION, parentFolder.getVersion());
m_collection.addOrder("isFolder desc");
@@ -375,24 +384,34 @@ class FolderTableModelBuilder extends LockableImpl implements TableModelBuilder
m_parent.hideEmptyLabel(state);
}
- int maxPages = (int) (size / m_rowsPerPage) + (size % m_rowsPerPage > 0 ? 1 : 0);
+ int maxPages = (int) (size / m_rowsPerPage)
+ + (size % m_rowsPerPage > 0 ? 1 : 0);
Integer pn = (Integer) state.getValue(m_parent.getPageNoParameter());
int pageNo = (pn == null ? 0 : pn.intValue());
int firstRowNo = ((int) (pageNo * m_rowsPerPage)) + 1;
int lastRowNo = firstRowNo + m_rowsPerPage;
if (s_log.isDebugEnabled()) {
- s_log.debug("items count:" + size + "; items per page:" + m_rowsPerPage + "; max pages:" + maxPages +
- "; pageNo:" + pageNo + "; first row no:" + firstRowNo + "; last row no:" + lastRowNo);
+ s_log.debug("items count:" + size + "; items per page:" +
+ m_rowsPerPage + "; max pages:" + maxPages +
+ "; pageNo:" + pageNo + "; first row no:" +
+ firstRowNo + "; last row no:" + lastRowNo);
}
m_collection.setRange(new Integer(firstRowNo), new Integer(lastRowNo));
- m_typeIdDocument = ContentType.findByAssociatedObjectType(Document.TYPE).getID();
- m_typeIdDocLink = ContentType.findByAssociatedObjectType(DocLink.TYPE).getID();
- m_typeIdDocFolder = ContentType.findByAssociatedObjectType(DocFolder.TYPE).getID();
+ m_typeIdDocument = ContentType.findByAssociatedObjectType(
+ Document.TYPE).getID();
+ m_typeIdDocLink = ContentType.findByAssociatedObjectType(
+ DocLink.TYPE).getID();
+ m_typeIdDocFolder = ContentType.findByAssociatedObjectType(
+ DocFolder.TYPE).getID();
m_user = Web.getContext().getUser();
Application app = Web.getContext().getApplication();
- m_isManager = PermissionService.checkPermission(new PermissionDescriptor(PrivilegeDescriptor.ADMIN, app, m_user));
+ m_isManager = PermissionService.checkPermission(new
+ PermissionDescriptor(PrivilegeDescriptor.ADMIN,
+ app,
+ m_user)
+ );
}
public int getColumnCount() {
@@ -439,8 +458,10 @@ class FolderTableModelBuilder extends LockableImpl implements TableModelBuilder
}
else if (isLink) {
Repository rep = ((Document) resource).getRepository();
- String path = Web.getConfig().getDispatcherContextPath() + rep.getPath() + "/file?" + FILE_ID_PARAM_NAME + "="
- + resource.getID();
+ String path = Web.getConfig().getDispatcherContextPath()
+ + rep.getPath() + "/file?"
+ + FILE_ID_PARAM_NAME + "="
+ + resource.getID();
Link l = new Link((String) resource.getTitle(), path);
link.add(l);
}
diff --git a/ccm-docmgr/web/themes/heirloom/apps/cmsdocs/xsl/index.xsl b/ccm-docmgr/web/themes/heirloom/apps/cmsdocs/xsl/index.xsl
new file mode 100755
index 000000000..7699fd717
--- /dev/null
+++ b/ccm-docmgr/web/themes/heirloom/apps/cmsdocs/xsl/index.xsl
@@ -0,0 +1,8 @@
+
+| 5 Most Recent Items | +Size | +Modified | +
|
+ |
+
+ |
+
+ |
+
| + add a document + | +||
| + view all documents + | +||
5 Most Recent Items
+ + +
+
+ | + |
| Name: | +|
| Description: | +|
| Size: | +|
| Type: | +|
| Last Modified: | +|
| Revision: | +|
| Author: | +|
| URI: | +
+
+ |
+
|
+ |
+
+
|
+
+
|
+
+
|
+
+
+
+
+
|
|
+ |
+ ||||
|
+ |
+ ||||
|
+ |
+
+ |
+
+ |
+ ||
|
+ |
If this user does not currently have an authentication record, + one will be created when you submit this form and the account + will be enabled for login to the system.
+You don't have permission to perform the requested action.
+Your search returned no results.
+Results matching your query:
+None
+