Diverse Formatierungen und Kommentierungen.

git-svn-id: https://svn.libreccm.org/ccm/trunk@578 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2010-10-17 11:08:57 +00:00
parent 35e1114491
commit 19aa607371
15 changed files with 120 additions and 98 deletions

View File

@ -42,10 +42,6 @@ import com.arsdigita.runtime.DomainInitEvent;
* @version $Id: Initializer.java 755 2005-09-02 13:42:47Z sskracic $ * @version $Id: Initializer.java 755 2005-09-02 13:42:47Z sskracic $
*/ */
public class Initializer extends CompoundInitializer { public class Initializer extends CompoundInitializer {
public final static String versionId =
"$Id: Initializer.java 755 2005-09-02 13:42:47Z sskracic $" +
"$Author: sskracic $" +
"$DateTime: 2004/01/23 10:22:44 $";
public Initializer() { public Initializer() {
final String url = RuntimeConfig.getConfig().getJDBCURL(); final String url = RuntimeConfig.getConfig().getJDBCURL();

View File

@ -44,10 +44,6 @@ import org.apache.log4j.Logger;
* @version $Id: Loader.java 287 2005-02-22 00:29:02Z sskracic $ * @version $Id: Loader.java 287 2005-02-22 00:29:02Z sskracic $
*/ */
public class Loader extends PackageLoader { public class Loader extends PackageLoader {
public final static String versionId =
"$Id: Loader.java 287 2005-02-22 00:29:02Z sskracic $" +
"$Author: sskracic $" +
"$DateTime: 2004/01/23 10:22:44 $";
private static final Logger s_log = Logger.getLogger(Loader.class); private static final Logger s_log = Logger.getLogger(Loader.class);

View File

@ -30,11 +30,11 @@ package com.arsdigita.kernel;
* </font> * </font>
* *
* @see PackageType#addListener * @see PackageType#addListener
* @version $Revision: #7 $, $Date: 2004/08/16 $
* @since ACS 5.0 * @since ACS 5.0
* @version $Revision: #7 $, $Date: 2004/08/16 $
* @version $Id: PackageEventListener.java 287 2005-02-22 00:29:02Z sskracic $
*/ */
public interface PackageEventListener { public interface PackageEventListener {
public static final String versionId = "$Id: PackageEventListener.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
/** /**
* Called when a package instance is mounted on a * Called when a package instance is mounted on a

View File

@ -55,12 +55,9 @@ import org.apache.log4j.Logger;
* *
* @author Dan Berrange * @author Dan Berrange
* @author Justin Ross &lt;jross@redhat.com&gt; * @author Justin Ross &lt;jross@redhat.com&gt;
* @version $Id: Templating.java 1498 2007-03-19 16:22:15Z apevec $
*/ */
public class Templating { public class Templating {
public static final String versionId =
"$Id: Templating.java 1498 2007-03-19 16:22:15Z apevec $" +
"$Author: apevec $" +
"$DateTime: 2004/08/16 18:10:38 $";
private static final Logger s_log = Logger.getLogger(Templating.class); private static final Logger s_log = Logger.getLogger(Templating.class);

View File

@ -27,12 +27,9 @@ import org.apache.log4j.Logger;
/** /**
* @author Justin Ross * @author Justin Ross
* @version $Id: TemplatingConfig.java 287 2005-02-22 00:29:02Z sskracic $
*/ */
public final class TemplatingConfig extends AbstractConfig { public final class TemplatingConfig extends AbstractConfig {
public static final String versionId =
"$Id: TemplatingConfig.java 287 2005-02-22 00:29:02Z sskracic $" +
"$Author: sskracic $" +
"$DateTime: 2004/08/16 18:10:38 $";
private static final Logger s_log = Logger.getLogger private static final Logger s_log = Logger.getLogger
(TemplatingConfig.class); (TemplatingConfig.class);

View File

@ -101,14 +101,18 @@ public class Application extends Resource {
} }
/** /**
* create application without parent, and without an associated * Create (new style / legacy free) application without parent, and without
* container group * an associated container group
*/ */
public static Application createRootApplication(final ApplicationType type, public static Application createRootApplication(final ApplicationType type,
final String title) { final String title) {
return Application.createRootApplication(type, title, false); return Application.createRootApplication(type, title, false);
} }
/**
* Create (new style / legacy free) application without parent and with
* an associated container group
*/
public static Application createRootApplication(final ApplicationType type, public static Application createRootApplication(final ApplicationType type,
final String title, final String title,
final boolean createContainerGroup) { final boolean createContainerGroup) {
@ -172,6 +176,15 @@ public class Application extends Resource {
return Application.createApplication(type,fragment,title,parent,createContainerGroup); return Application.createApplication(type,fragment,title,parent,createContainerGroup);
} }
/**
*
* @param type application type
* @param fragment last part of the applications URL
* @param title descriptive name
* @param parent
* @param createContainerGroup
* @return
*/
private static Application make(final ApplicationType type, private static Application make(final ApplicationType type,
final String fragment, final String fragment,
final String title, final String title,

View File

@ -297,6 +297,7 @@ public class ApplicationSetup {
notice(" DispatcherClass: " + m_dispatcherClass); notice(" DispatcherClass: " + m_dispatcherClass);
if (m_key == null && m_packageType == null) { if (m_key == null && m_packageType == null) {
// This is a new style / legacy free application
applicationType = new ApplicationType(m_title, m_typeName); applicationType = new ApplicationType(m_title, m_typeName);
} else { } else {
// This is a legacy application type. // This is a legacy application type.

View File

@ -56,7 +56,7 @@ public class ApplicationType extends ResourceType {
/** /**
* The fully qualified model name of the underlying data object, which in * The fully qualified model name of the underlying data object, which in
* this case is the same as the Java type. * this case is the same as the Java type (full qualified class name).
*/ */
public static final String BASE_DATA_OBJECT_TYPE = public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.web.ApplicationType"; "com.arsdigita.web.ApplicationType";
@ -65,7 +65,10 @@ public class ApplicationType extends ResourceType {
boolean m_legacyFree = false; boolean m_legacyFree = false;
/** /**
* Constructor. * Constructor creates a new ApplicationType instance to encapsulate a given
* data object (@see com.arsdigita.persistence.Session#retrieve(String) ).
* The super implementation uses overwritable methods initialize() and
* postInitialization() to further process the dataObject (see below).
* *
* @param dataObject * @param dataObject
*/ */
@ -82,13 +85,21 @@ public class ApplicationType extends ResourceType {
final String applicationObjectType) { final String applicationObjectType) {
this(objectType, title, applicationObjectType, false); this(objectType, title, applicationObjectType, false);
} }
/**
* Internal constructor creates a (new) legacy free application type.
*
* @param objectType
* @param title
* @param applicationObjectType
* @param createContainerGroup
*/
protected ApplicationType(final String objectType, protected ApplicationType(final String objectType,
final String title, final String title,
final String applicationObjectType, final String applicationObjectType,
final boolean createContainerGroup) { final boolean createContainerGroup) {
this(objectType); this(objectType); // creates and returns an empty data object
Assert.exists(title, "String title"); Assert.exists(title, "String title");
Assert.exists(applicationObjectType, "String applicationObjectType"); Assert.exists(applicationObjectType, "String applicationObjectType");
@ -111,7 +122,9 @@ public class ApplicationType extends ResourceType {
// previously only set on creation of application type // previously only set on creation of application type
// (to be honest I can't remember the problem that was // (to be honest I can't remember the problem that was
// causing, but it did cause a problem in some // causing, but it did cause a problem in some
// circumstances) // circumstances)
// Method overwrtes a (overwritable) method provided by the super class to
// process a created (empty) data object.
public void initialize() { public void initialize() {
super.initialize(); super.initialize();
s_log.debug("initialising application type "); s_log.debug("initialising application type ");
@ -155,6 +168,7 @@ public class ApplicationType extends ResourceType {
} }
protected ApplicationType(final String dataObjectType, protected ApplicationType(final String dataObjectType,
final PackageType packageType, final PackageType packageType,
final String title, final String title,
@ -180,10 +194,11 @@ public class ApplicationType extends ResourceType {
/** /**
* Creates a legacy-compatible application type using the passed * Creates a legacy-compatible application type using the passed
* in package type. * in package type using an internal constructor (below).
*/ */
public static ApplicationType createApplicationType public static ApplicationType createApplicationType(PackageType packageType,
(PackageType packageType, String title, String applicationObjectType) { String title,
String applicationObjectType) {
return new ApplicationType return new ApplicationType
(BASE_DATA_OBJECT_TYPE, packageType, title, applicationObjectType); (BASE_DATA_OBJECT_TYPE, packageType, title, applicationObjectType);
} }
@ -192,14 +207,23 @@ public class ApplicationType extends ResourceType {
* Creates a legacy-compatible application type. The key * Creates a legacy-compatible application type. The key
* parameter is used to create a legacy package type to back the * parameter is used to create a legacy package type to back the
* new application type. * new application type.
* This variant is applicatable if packageType does not already exist!
*/ */
protected ApplicationType protected ApplicationType(String dataObjectType, String key, String title,
(String dataObjectType, String key, String title, String applicationObjectType) {
String applicationObjectType) {
this(dataObjectType, makePackageType(key, title), title, this(dataObjectType, makePackageType(key, title), title,
applicationObjectType); applicationObjectType);
} }
/**
* Helper method to create a packageType for a new legacy compatible
* application type without a already existing (i.e. installed in db) legacy
* application.
*
* @param key of the package to be created
* @param title of the package to be created
* @return
*/
private static final PackageType makePackageType(String key, String title) { private static final PackageType makePackageType(String key, String title) {
PackageType packageType = new PackageType(); PackageType packageType = new PackageType();
@ -218,8 +242,8 @@ public class ApplicationType extends ResourceType {
* parameter is used to create a legacy package type to back the * parameter is used to create a legacy package type to back the
* new application type. * new application type.
*/ */
public static ApplicationType createApplicationType public static ApplicationType createApplicationType(String key, String title,
(String key, String title, String applicationObjectType) { String applicationObjectType) {
return ApplicationType.createApplicationType( return ApplicationType.createApplicationType(
key, title, applicationObjectType, false); key, title, applicationObjectType, false);
@ -250,6 +274,7 @@ public class ApplicationType extends ResourceType {
(BASE_DATA_OBJECT_TYPE, key, title, applicationObjectType); (BASE_DATA_OBJECT_TYPE, key, title, applicationObjectType);
} }
} }
// Param // Param
public static ApplicationType retrieveApplicationType(BigDecimal id) { public static ApplicationType retrieveApplicationType(BigDecimal id) {
Assert.exists(id, "id"); Assert.exists(id, "id");

View File

@ -37,10 +37,6 @@ import org.apache.log4j.Logger;
* @version $Id: Loader.java 758 2005-09-02 14:26:56Z sskracic $ * @version $Id: Loader.java 758 2005-09-02 14:26:56Z sskracic $
*/ */
public class Loader extends PackageLoader { public class Loader extends PackageLoader {
public final static String versionId =
"$Id: Loader.java 758 2005-09-02 14:26:56Z sskracic $" +
"$Author: sskracic $" +
"$DateTime: 2003/10/28 14:21:31 $";
private static final Logger s_log = Logger.getLogger(Loader.class); private static final Logger s_log = Logger.getLogger(Loader.class);

View File

@ -57,7 +57,7 @@ import org.apache.log4j.Logger;
*/ */
public class Loader extends PackageLoader { public class Loader extends PackageLoader {
/** Creates a s_logging category with name = full name of class */ /** Creates a s_logging category with name = full name of class */
private static final Logger s_log = Logger.getLogger(Loader.class); private static final Logger s_log = Logger.getLogger(Loader.class);
private StringParameter m_templatesFile = new StringParameter( private StringParameter m_templatesFile = new StringParameter(

View File

@ -1,6 +1,7 @@
package com.arsdigita.london.navigation; package com.arsdigita.london.navigation;
public class NavigationConstants { public class NavigationConstants {
public static final String NAV_NS = public static final String NAV_NS =
"http://ccm.redhat.com/london/navigation"; "http://ccm.redhat.com/london/navigation";
public static final String NAV_PREFIX = "nav"; public static final String NAV_PREFIX = "nav";
@ -8,4 +9,5 @@ public class NavigationConstants {
"com.arsdigita.london.navigation.DefaultContentSection"; "com.arsdigita.london.navigation.DefaultContentSection";
public static final String OID = "oid"; public static final String OID = "oid";
} }

View File

@ -91,8 +91,8 @@ public class Initializer extends CompoundInitializer {
super.init(e); super.init(e);
XML.parse(Workspace.getConfig().getTraversalAdapters(), XML.parse(Workspace.getConfig().getTraversalAdapters(),
new TraversalHandler()); new TraversalHandler());
e.getFactory().registerInstantiator( e.getFactory().registerInstantiator(
Workspace.BASE_DATA_OBJECT_TYPE, Workspace.BASE_DATA_OBJECT_TYPE,

View File

@ -89,39 +89,39 @@ public class Workspace extends Application {
*/ */
private static Workspace defaultHomepageWorkspace = null; private static Workspace defaultHomepageWorkspace = null;
/**
/**
* Constructor * Constructor
* @param obj * @param obj
*/ */
public Workspace(DataObject obj) { public Workspace(DataObject obj) {
super(obj); super(obj);
} }
/** /**
* Constructor, retrieves the workspace from database using its OID * Constructor, retrieves the workspace from database using its OID
* @param oid * @param oid
* @throws com.arsdigita.domain.DataObjectNotFoundException * @throws com.arsdigita.domain.DataObjectNotFoundException
*/ */
public Workspace(OID oid) throws DataObjectNotFoundException { public Workspace(OID oid) throws DataObjectNotFoundException {
super(oid);
}
super(oid); /*
} * public String getContextPath() { return "ccm-ldn-portal"; }
*/
/* /**
* public String getContextPath() { return "ccm-ldn-portal"; }
*/
/**
* *
* @return ServletPath (constant) probably should be synchron with web.xml * @return ServletPath (constant) probably should be synchron with web.xml
* entry * entry
*/ */
public String getServletPath() { public String getServletPath() {
// return "/files"; // return "/files";
return "/ccm-ldn-portal/files"; return "/ccm-ldn-portal/files";
} }
/** /**
* Wrapper class to handle a limited set of parameters, * Wrapper class to handle a limited set of parameters,
* here: page layout is set to default layout. * here: page layout is set to default layout.
* *
@ -132,12 +132,12 @@ public class Workspace extends Application {
* @return * @return
*/ */
public static Workspace createWorkspace(String url, String title, public static Workspace createWorkspace(String url, String title,
Application parent, boolean isPublic) { Application parent, boolean isPublic) {
return createWorkspace(url, title, PageLayout.getDefaultLayout(), return createWorkspace(url, title, PageLayout.getDefaultLayout(),
parent, isPublic); parent, isPublic);
} }
/** /**
* *
* @param url * @param url
* @param title * @param title
@ -146,12 +146,12 @@ public class Workspace extends Application {
* @return * @return
*/ */
public static Workspace createWorkspace(String url, String title, public static Workspace createWorkspace(String url, String title,
Application parent, User owner) { Application parent, User owner) {
return createWorkspace(url, title, PageLayout.getDefaultLayout(), return createWorkspace(url, title, PageLayout.getDefaultLayout(),
parent, owner); parent, owner);
} }
/** /**
* Does the real work to create a workspace in the storage (db) * Does the real work to create a workspace in the storage (db)
* *
* @param url * @param url
@ -177,7 +177,7 @@ public class Workspace extends Application {
return workspace; return workspace;
} }
/** /**
* Does the real work to create a workspace in the storage (db) * Does the real work to create a workspace in the storage (db)
* *
* @param url * @param url
@ -239,31 +239,31 @@ public class Workspace extends Application {
} }
public void beforeSave() { public void beforeSave() {
// If no permissions are configured, then setup empty groups // If no permissions are configured, then setup empty groups
if (get(PARTY) == null) { if (get(PARTY) == null) {
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("No party is set, creating shared workspace " s_log.debug("No party is set, creating shared workspace "
+ getOID()); + getOID());
} }
setupGroups(getTitle(), false); setupGroups(getTitle(), false);
} }
// Setup the default layout. // Setup the default layout.
if (isNew() && getDefaultLayout() == null) { if (isNew() && getDefaultLayout() == null) {
setDefaultLayout(PageLayout.getDefaultLayout()); setDefaultLayout(PageLayout.getDefaultLayout());
} }
super.beforeSave(); super.beforeSave();
} }
// public void beforeDelete() { // public void beforeDelete() {
// super.beforeDelete(); // super.beforeDelete();
// Category.clearRootForObject(this); // Category.clearRootForObject(this);
// } // }
// This method wouldn't need to exist if permissioning used // This method wouldn't need to exist if permissioning used
// the associations rather than direct queries which require // the associations rather than direct queries which require
// the object to be saved // the object to be saved
public void afterSave() { public void afterSave() {
super.afterSave(); super.afterSave();
Party party = getParty(); Party party = getParty();
@ -302,9 +302,9 @@ public class Workspace extends Application {
WorkspacePage page = pages.getPage(); WorkspacePage page = pages.getPage();
PermissionService.setContext(page, this); PermissionService.setContext(page, this);
} }
} }
private void setupGroups(String title, boolean isPublic) { private void setupGroups(String title, boolean isPublic) {
Group members = new Group(); Group members = new Group();
members.setName(title); members.setName(title);
members.save(); members.save();
@ -336,11 +336,11 @@ public class Workspace extends Application {
} }
setParty(members); setParty(members);
} }
public static WorkspaceCollection retrieveAll() { public static WorkspaceCollection retrieveAll() {
return retrieveAll(null); return retrieveAll(null);
} }
public static WorkspaceCollection retrieveAll(Application parent) { public static WorkspaceCollection retrieveAll(Application parent) {
DataCollection wks = SessionManager.getSession().retrieve( DataCollection wks = SessionManager.getSession().retrieve(

View File

@ -18,7 +18,7 @@
package com.arsdigita.london.rss; package com.arsdigita.london.rss;
import com.arsdigita.domain.DomainObjectInstantiator; // import com.arsdigita.domain.DomainObjectInstantiator;
import com.arsdigita.db.DbHelper; import com.arsdigita.db.DbHelper;
import com.arsdigita.domain.DomainObject; import com.arsdigita.domain.DomainObject;
@ -63,7 +63,7 @@ import com.arsdigita.london.rss.portlet.WorkspaceDirectoryPortlet;
/** /**
* The CMS initializer. * The RSS initializer.
* *
* @author Justin Ross &lt;jross@redhat.com&gt; * @author Justin Ross &lt;jross@redhat.com&gt;
* @version $Id: Initializer.java 758 2005-09-02 14:26:56Z sskracic $ * @version $Id: Initializer.java 758 2005-09-02 14:26:56Z sskracic $

View File

@ -46,7 +46,6 @@ public class Loader extends PackageLoader {
loadWorkspaceDirectoryPortlet(); loadWorkspaceDirectoryPortlet();
} }
}.run(); }.run();
// Nada yet
} }
private void loadWorkspaceDirectoryPortlet() { private void loadWorkspaceDirectoryPortlet() {