Added documentation.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2030 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2013-01-07 22:12:34 +00:00
parent fa7e3ca2b5
commit e66def347e
17 changed files with 312 additions and 69 deletions

View File

@ -1,6 +1,34 @@
/*
* Copyright (C) 2011 - 2013 University of Bremen. 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.contenttypes;
/**
* Loader executes nonrecurring once at install time and loads the
* Public Personal Profile contenttype package persistently into database.
*
* It uses the base class to create the database schema and the required
* table entries for the contenttype.
*
* NOTE: Configuration parameters used at load time MUST be part of Loader
* class and can not delegated to a Config object (derived from AbstractConfig).
* They will (and can) not be persisted into an registry object (file).
*
* @author Jens Pelzetter
* @version $Id$
@ -11,11 +39,22 @@ public class PublicPersonalProfileLoader extends AbstractContentTypeLoader {
super();
}
/** Defines the xml file containing the PPP content types property
* definitions. */
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/"
+ "PublicPersonalProfile.xml"
};
/**
* Provides the of PPP contenttype property definitions implementing
* the parent's class abstract method.
*
* The file defines the types name as displayed in content center
* select box and the authoring steps. These are loaded into database.
*
* @return String Atring Array of fully qualified file names
*/
@Override
public String[] getTypes() {
return TYPES;

View File

@ -1,15 +1,53 @@
/*
* Copyright (C) 2010 University of Bremen. 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.contenttypes;
/**
* Loader
* Loader executes nonrecurring once at install time and loads the e-Form
* contenttype package persistently into database.
*
* It uses the base class to create the database schema and the required
* table entries for the contenttype.
*
* NOTE: Configuration parameters used at load time MUST be part of Loader
* class and can not delegated to a Config object (derived from AbstractConfig).
* They will (and can) not be persisted into an registry object (file).
*
*/
public class AddressLoader extends AbstractContentTypeLoader {
/** Defines the xml file containing the Address content type property
* definitions. */
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Address.xml"
};
/**
* Provides the of Address contenttype property definitions implementing
* the parent's class abstract method.
*
* The file defines the types name as displayed in content center
* select box and the authoring steps. These are loaded into database.
*
* @return String Atring Array of fully qualified file names
*/
public String[] getTypes() {
return TYPES;
}

View File

@ -21,7 +21,11 @@ package com.arsdigita.cms.contenttypes;
import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
/**
* Loader. Just sets content type specific properties for use of the parent class.
* Loader executes nonrecurring once at install time and loads the Agenda
* contenttype package persistently into database.
*
* It uses the base class to create the database schema and the required
* table entries for the contenttype.
*
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #7 $ $Date: 2004/08/17 $
@ -29,10 +33,21 @@ import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
*/
public class AgendaLoader extends AbstractContentTypeLoader {
/** Defines the xml file containing the EForm content types property
* definitions. */
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Agenda.xml"
};
/**
* Provides the of Agenda contenttype property definitions implementing
* the parent's class abstract method.
*
* The file defines the types name as displayed in content center
* select box and the authoring steps. These are loaded into database.
*
* @return String Array of fully qualified file names
*/
public String[] getTypes() {
return TYPES;
}

View File

@ -21,17 +21,32 @@ package com.arsdigita.cms.contenttypes;
// import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
/**
* Loader.
* Loader executes nonrecurring once at install time and loads the Article
* contenttype package persistently into database.
*
* It uses the base class to create the database schema and the required
* table entries for the contenttype.
*
* @author Justin Ross <jross@redhat.com>
* @version $Id: ArticleLoader.java 287 2005-02-22 00:29:02Z sskracic $
*/
public class ArticleLoader extends AbstractContentTypeLoader {
/** Defines the xml file containing the Article content types property
* definitions. */
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Article.xml"
};
/**
* Provides the of Article contenttype property definitions
* implementing the parent's class abstract method.
*
* The file defines the types name as displayed in content center
* select box and the authoring steps. These are loaded into database.
*
* @return String Atring Array of fully qualified file names
*/
public String[] getTypes() {
return TYPES;
}

View File

@ -21,11 +21,11 @@ package com.arsdigita.cms.contenttypes.ui;
import com.arsdigita.bebop.Component;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.Article;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
/**
* Authoring step to edit the simple attributes of the Article content

View File

@ -21,17 +21,32 @@ package com.arsdigita.cms.contenttypes;
import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
/**
* Loader.
* Loader executes nonrecurring once at install time and loads the
* Bookmark contenttype package persistently into database.
*
* It uses the base class to create the database schema and the required
* table entries for the contenttype.
*
* @author Justin Ross <jross@redhat.com>
* @version $Id: BookmarkLoader.java 287 2005-02-22 00:29:02Z sskracic $
*/
public class BookmarkLoader extends AbstractContentTypeLoader {
private static final String[] TYPES = {
/** Defines the xml file containing the Bookmark content types
* property definitions. */
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Bookmark.xml"
};
/**
* Provides the of Bookmark contenttype property definitions implementing
* the parent's class abstract method.
*
* The file defines the types name as displayed in content center
* select box and the authoring steps. These are loaded into database.
*
* @return String Atring Array of fully qualified file names
*/
public String[] getTypes() {
return TYPES;
}

View File

@ -1,17 +1,50 @@
/*
* Copyright (C) 2010-2013 University of Bremen. 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.contenttypes;
/**
* Loader.
* Loader executes nonrecurring once at install time and loads the
* Contact contenttype package persistently into database.
*
* It uses the base class to create the database schema and the required
* table entries for the contenttype.
*
* @author Sören Bernstein
*/
public class ContactLoader extends AbstractContentTypeLoader {
/** Defines the xml file containing the Contact content types
* property definitions. */
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Contact.xml"
};
/**
* Provides the of Event contenttype property definitions
* implementing the parent's class abstract method.
*
* The file defines the types name as displayed in content center
* select box and the authoring steps. These are loaded into database.
*
* @return String Atring Array of fully qualified file names
*/
public String[] getTypes() {
return TYPES;
}

View File

@ -21,19 +21,33 @@ package com.arsdigita.cms.contenttypes;
import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
/**
* Loader
* Loader executes nonrecurring once at install time and loads the
* Event contenttype package persistently into database.
*
* It uses the base class to create the database schema and the required
* table entries for the contenttype.
*
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #6 $ $Date: 2004/08/17 $
* @version $Id: EventLoader.java 1595 2007-07-10 16:14:44Z p_boy $
**/
*/
public class EventLoader extends AbstractContentTypeLoader {
private static final String[] TYPES = {
/** Defines the xml file containing the EForm content types
* property definitions. */
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Event.xml"
};
/**
* Provides the of Event contenttype property definitions
* implementing the parent's class abstract method.
*
* The file defines the types name as displayed in content center
* select box and the authoring steps. These are loaded into database.
*
* @return String Atring Array of fully qualified file names
*/
public String[] getTypes() {
return TYPES;
}

View File

@ -24,14 +24,14 @@ import com.arsdigita.cms.ContentPage;
import com.arsdigita.cms.ContentSection;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.Event;
import com.arsdigita.domain.DomainObject;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
import com.arsdigita.cms.contenttypes.util.EventGlobalizationUtil;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.cms.contenttypes.util.EventGlobalizationUtil;
import com.arsdigita.domain.DomainObject;
import com.arsdigita.globalization.GlobalizationHelper;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
import java.text.DateFormat;
import java.util.Calendar;
@ -39,26 +39,36 @@ import java.util.Date;
/**
* Authoring step to view/edit the simple attributes of the Event content type (and
* its subclasses). The attributes edited are 'name', 'title', 'lead',
* its subclasses).
*
* The attributes edited are 'name', 'title', 'lead',
* 'start date', 'starttime', end date', 'end time','event date' (literal descr. of date),
* 'location', 'main contributor', 'event type', 'map link', and
* 'cost'. This authoring step replaces the
* 'cost'.
*
* This authoring step replaces the
* <code>com.arsdigita.ui.authoring.PageEdit</code> step for this type.
**/
*/
public class EventPropertiesStep extends SimpleEditStep {
/** The name of the editing sheet added to this step */
public static String EDIT_SHEET_NAME = "edit";
/**
*
* @param itemModel
* @param parent
*/
public EventPropertiesStep(ItemSelectionModel itemModel,
AuthoringKitWizard parent) {
AuthoringKitWizard parent) {
super(itemModel, parent);
setDefaultEditKey(EDIT_SHEET_NAME);
BasicPageForm editSheet;
editSheet = new EventPropertyForm(itemModel, this);
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel),
add(EDIT_SHEET_NAME, "Edit",
new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton());
setDisplayComponent(getEventPropertySheet(itemModel));
@ -76,9 +86,14 @@ public class EventPropertiesStep extends SimpleEditStep {
public static Component getEventPropertySheet(ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.name").localize(), Event.NAME);
sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.title").localize(), Event.TITLE);
sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead").localize(), Event.LEAD);
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.name").localize(), Event.NAME);
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.title").localize(), Event.TITLE);
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead").localize(), Event.LEAD);
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.name"), Event.NAME);
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.title"), Event.TITLE);
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead"), Event.LEAD);
if (!ContentSection.getConfig().getHideLaunchDate()) {
sheet.add(EventGlobalizationUtil.globalize("cms.contenttypes.ui.launch_date"),
ContentPage.LAUNCH_DATE,
@ -96,8 +111,9 @@ public class EventPropertiesStep extends SimpleEditStep {
}
});
}
sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time").localize(), Event.START_DATE,
new DomainObjectPropertySheet.AttributeFormatter() {
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time").localize(), Event.START_DATE,
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time"), Event.START_DATE,
new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject item,
String attribute,
@ -121,7 +137,8 @@ public class EventPropertiesStep extends SimpleEditStep {
}
});
sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.end_time").localize(), Event.END_DATE,
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.end_time").localize(), Event.END_DATE,
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.end_time"), Event.END_DATE,
new DomainObjectPropertySheet.AttributeFormatter() {
public String format(DomainObject item,
@ -145,21 +162,27 @@ public class EventPropertiesStep extends SimpleEditStep {
}
});
if (!Event.getConfig().getHideDateDescription()) {
sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.date_description").localize(), Event.EVENT_DATE);
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.date_description").localize(), Event.EVENT_DATE);
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.date_description"), Event.EVENT_DATE);
}
sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.location").localize(), Event.LOCATION);
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.location").localize(), Event.LOCATION);
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.location"), Event.LOCATION);
if (!Event.getConfig().getHideMainContributor()) {
sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.main_contributor").localize(), Event.MAIN_CONTRIBUTOR);
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.main_contributor").localize(), Event.MAIN_CONTRIBUTOR);
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.main_contributor"), Event.MAIN_CONTRIBUTOR);
}
if (!Event.getConfig().getHideEventType()) {
sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.event_type").localize(), Event.EVENT_TYPE);
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.event_type").localize(), Event.EVENT_TYPE);
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.event_type"), Event.EVENT_TYPE);
}
if (!Event.getConfig().getHideLinkToMap()) {
sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.link_to_map").localize(), Event.MAP_LINK);
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.link_to_map").localize(), Event.MAP_LINK);
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.link_to_map"), Event.MAP_LINK );
}
if (!Event.getConfig().getHideCost()) {
sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.cost").localize(), Event.COST);
// sheet.add((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.cost").localize(), Event.COST);
sheet.add( EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.cost"), Event.COST );
}
return sheet;
}

View File

@ -30,22 +30,24 @@ import com.arsdigita.bebop.form.TextField;
import com.arsdigita.bebop.form.Time;
import com.arsdigita.bebop.parameters.DateParameter;
import com.arsdigita.bebop.parameters.NotNullValidationListener;
import com.arsdigita.bebop.parameters.StringInRangeValidationListener;
import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringInRangeValidationListener;
import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.bebop.parameters.TimeParameter;
import com.arsdigita.bebop.parameters.TrimmedStringParameter;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.Event;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.contenttypes.util.EventGlobalizationUtil;
import com.arsdigita.cms.ui.CMSDHTMLEditor;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import java.util.Calendar;
import java.util.GregorianCalendar;
/**
* Form to edit the basic properties of an <code>Event</code> object. Used by
* <code>EventPropertiesStep</code> authoring kit step.
* Form to edit the basic properties of an <code>Event</code> object.
*
* Used by <code>EventPropertiesStep</code> authoring kit step.
* <br />
* This form can be extended to create forms for Event subclasses.
**/
@ -113,7 +115,7 @@ public class EventPropertyForm extends BasicPageForm
super.addWidgets();
/* Summary (lead) */
add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead").localize()));
add(new Label(EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.lead")) );
ParameterModel leadParam = new StringParameter(LEAD);
if(Event.getConfig().isLeadTextOptional()) {
leadParam.addParameterListener(new NotNullValidationListener());
@ -124,7 +126,7 @@ public class EventPropertyForm extends BasicPageForm
add(lead);
/* Start date and time */
ParameterModel eventStartDateParam = new DateParameter(START_DATE);
add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_date").localize()));
add(new Label(EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_date")) );
eventStartDateParam.addParameterListener(new NotNullValidationListener());
// Use bebop date instead of java.util.date
m_startDate = new com.arsdigita.bebop.form.Date(eventStartDateParam);
@ -134,7 +136,7 @@ public class EventPropertyForm extends BasicPageForm
add(m_startDate);
ParameterModel eventStartTimeParam = new TimeParameter(START_TIME);
add(new Label((String) EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time").localize()));
add(new Label(EventGlobalizationUtil.globalize("cms.contenttypes.ui.event.start_time")) );
if(Event.getConfig().isStartTimeOptional()) {
eventStartTimeParam.addParameterListener(new NotNullValidationListener());
}

View File

@ -16,10 +16,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package com.arsdigita.cms.contenttypes.util;
import com.arsdigita.globalization.GlobalizedMessage;
/**
* <p>
* Contains methods to simplify globalizing keys
@ -28,9 +30,9 @@ import com.arsdigita.globalization.GlobalizedMessage;
* @author <a href="mailto:randyg@arsdigita.com">randyg@arsdigita.com</a>
* @version $Revision: #4 $ $Date: 2004/08/17 $
*/
public class EventGlobalizationUtil {
/** Name of the Java class to handle Event's globalisation. */
final public static String BUNDLE_NAME =
"com.arsdigita.cms.contenttypes.util.EventResourceBundle";

View File

@ -18,17 +18,18 @@
*/
package com.arsdigita.cms.contenttypes.util;
import java.util.PropertyResourceBundle;
import com.arsdigita.globalization.ChainedResourceBundle;
import com.arsdigita.cms.CMSGlobalized;
import com.arsdigita.globalization.ChainedResourceBundle;
import java.util.PropertyResourceBundle;
/**
* Resource Bundle used in UI for Event ContentType.
*
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
*
* @author Shashin Shinde (sshinde@redhat.com)
*/
public class EventResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
public class EventResourceBundle extends ChainedResourceBundle
implements CMSGlobalized {
public final static String EVENT_BUNDLE_NAME =
"com.arsdigita.cms.contenttypes.EventResources";

View File

@ -21,17 +21,32 @@ package com.arsdigita.cms.contenttypes;
import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
/**
* Loader.
* Loader executes nonrecurring once at install time and loads the
* FAQ contenttype package persistently into database.
*
* It uses the base class to create the database schema and the required
* table entries for the contenttype.
*
* @author Justin Ross &lt;jross@redhat.com&gt;
* @version $Id: FAQItemLoader.java 287 2005-02-22 00:29:02Z sskracic $
*/
public class FAQItemLoader extends AbstractContentTypeLoader {
/** Defines the xml file containing the FAQ content types
* property definitions. */
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/FAQItem.xml"
};
/**
* Provides the of FAQ contenttype property definitions
* implementing the parent's class abstract method.
*
* The file defines the types name as displayed in content center
* select box and the authoring steps. These are loaded into database.
*
* @return String Atring Array of fully qualified file names
*/
public String[] getTypes() {
return TYPES;
}

View File

@ -64,6 +64,10 @@ import org.apache.log4j.Logger;
* processing, otherwise hardcoded default values take effect. After processing,
* the installation values can not be modified anymore without a fresh
* installation of the whole system.</p>
*
* NOTE: Configuration parameters used at load time MUST be part of Loader
* class and can not delegated to a Config object (derived from AbstractConfig).
* They will (and can) not be persisted into an registry object (file).
*
* @author Peter Boy &lt;pboy@barkhof.uni-bremen.de&gt;
* @since ccm-cms version 6.6.0
@ -83,6 +87,7 @@ public class Loader extends PackageLoader {
* time, the parameter must be relocated into this Loader class!
*/
private static final LoaderConfig s_conf = LoaderConfig.getInstance();
// ///////////////////////////////////////////////////////////////////
// Configurable parameters during load step.
// ///////////////////////////////////////////////////////////////////
@ -96,6 +101,10 @@ public class Loader extends PackageLoader {
"com.arsdigita.cms.loader.section_names",
Parameter.REQUIRED,
new String[]{"content"});
// ///////////////////////////////////////////////////////////////////
// Configurable parameters during load step END.
// ///////////////////////////////////////////////////////////////////
/**
* List of classnames of internal base content types (needed in every
* section created), generated while loading those content types in

View File

@ -53,6 +53,12 @@ import org.apache.log4j.Logger;
* This is the base loader that can be used by individual content types.
* Specifically, it provides type loading functionality in the "run" method
* that can be used by content types to reduce code duplication.
*
* NOTE: Implementing clases may need to define and use configuration parameters
* to adjust things at load time. These MUST be part of Loader class
* implementationand itself and can not be delegated to a Config object
* (derived from AbstractConfig). They will (and can) not be persisted into an
* registry object (file).
*
* @author Rafael H. Schloming &lt;rhs@mit.edu&gt;
* @authro Sören Bernstein (quasi@barkhof.uni-bremen.de)
@ -134,6 +140,16 @@ public abstract class AbstractContentTypeLoader extends PackageLoader {
ContentTypeWorkflowTemplate.updateWorkflowTemplate(section, type, wf);
}
/**
* Provides a list of contenttype property definitions.
*
* The file defines the types name as displayed in content center
* select box and the authoring steps. These are loaded into database.
*
* Must be implemented by each content type loader to provide its
* specific definition files.
* @return
*/
protected abstract String[] getTypes();
/*

View File

@ -22,21 +22,19 @@ import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.PropertySheet;
import com.arsdigita.bebop.PropertySheetModel;
import com.arsdigita.bebop.PropertySheetModelBuilder;
import com.arsdigita.domain.DomainObject;
import com.arsdigita.domain.DomainService;
import com.arsdigita.globalization.GlobalizedMessage;
import com.arsdigita.kernel.ui.DomainObjectSelectionModel;
import com.arsdigita.persistence.DataObject;
import com.arsdigita.toolbox.util.GlobalizationUtil;
import com.arsdigita.util.LockableImpl;
import java.util.List;
import java.util.LinkedList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.StringTokenizer;
import com.arsdigita.domain.DomainService;
import com.arsdigita.domain.DomainObject;
import com.arsdigita.persistence.DataObject;
import com.arsdigita.kernel.ui.DomainObjectSelectionModel;
import com.arsdigita.globalization.GlobalizedMessage;
import com.arsdigita.toolbox.util.GlobalizationUtil;
/**
* Displays a list of label-value pairs, which represent the attributes
@ -44,7 +42,8 @@ import com.arsdigita.toolbox.util.GlobalizationUtil;
* <p>
* Typical usage is
* <blockquote><pre><code>
* DomainObjectPropertySheet mySheet = new DomainObjectPropertySheet(myDomainObjectSelectionModel);
* DomainObjectPropertySheet mySheet =
* new DomainObjectPropertySheet(myDomainObjectSelectionModel);
* mySheet.add("Name:", ContentPage.NAME);
* mySheet.add("Title:", ContentPage.TITLE);
* </code></pre></blockquote>
@ -65,9 +64,9 @@ import com.arsdigita.toolbox.util.GlobalizationUtil;
* Note that, by default, <code>DomainObjectPropertySheet</code> retrieves
* the values for its properties directly from the underlying {@link DataObject}
* of the {@link DomainObject}. This means that the Java <code>getXXX</code>
* methods of the <code>DomainObject</code> will never be called. Of course, it
* is always possible to create a custom {@link AttributeFormatter} that will call the
* appropriate methods.
* methods of the <code>DomainObject</code> will never be called. Of course,
* it is always possible to create a custom {@link AttributeFormatter} that
* will call the appropriate methods.
*
* @author Stanislav Freidin
* @version $Id: DomainObjectPropertySheet.java 287 2005-02-22 00:29:02Z sskracic $
@ -75,8 +74,6 @@ import com.arsdigita.toolbox.util.GlobalizationUtil;
*/
public class DomainObjectPropertySheet extends PropertySheet {
public static final String versionId =
"$Id: DomainObjectPropertySheet.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
private List m_props;
private DomainObjectSelectionModel m_objModel;
private AttributeFormatter m_toStringFormatter;
@ -157,7 +154,8 @@ public class DomainObjectPropertySheet extends PropertySheet {
* @param label The label for the attribute
* @param attribute The name for the attribute
* @param formatter An instance of AttributeFormatter
* @deprecated Use add(GlobalizedMessage label, String attribute, AttributeFormatter f) instead
* @deprecated Use add(GlobalizedMessage label, String attribute,
* AttributeFormatter f) instead
*/
public void add(String label, String attribute, AttributeFormatter f) {
add(GlobalizationUtil.globalize(label), attribute, f);
@ -252,7 +250,7 @@ public class DomainObjectPropertySheet extends PropertySheet {
private Iterator m_props;
private Property m_current;
private static String ERROR =
"No current property. Make sure that nextRow() was called at least once.";
"No current property. Make sure that nextRow() was called at least once.";
public DomainObjectPropertiesModel(
DomainObject obj, Iterator props, PageState state) {

View File

@ -33,13 +33,21 @@ import com.arsdigita.runtime.ScriptContext;
*/
public class ContactLoader extends AbstractContentTypeLoader {
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/london/contenttypes/Contact.xml"
};
/** Defines the xml file containing the Contact content types property
* definitions. */
private static final String[] TYPES = {
"/WEB-INF/content-types/com/arsdigita/london/contenttypes/Contact.xml"
};
/**
* @see com.arsdigita.cms.contenttypes.AbstractContentTypeLoader#getTypes()
*/
/**
* Provides the of Contact contenttype property definitions implementing
* the parent's class abstract method.
*
* The file defines the types name as displayed in content center
* select box and the authoring steps. These are loaded into database.
*
* @return String Atring Array of fully qualified file names
*/
public String[] getTypes() {
return TYPES;
}