diff --git a/ccm-cms-types-faqitem/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/FAQItem.xml b/ccm-cms-types-faqitem/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/FAQItem.xml
index 6ce84f5a1..4ff0f8115 100755
--- a/ccm-cms-types-faqitem/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/FAQItem.xml
+++ b/ccm-cms-types-faqitem/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/FAQItem.xml
@@ -4,19 +4,20 @@
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
-
-
+ description="An FAQ item type"
+ objectType="com.arsdigita.cms.contenttypes.FAQItem"
+ classname="com.arsdigita.cms.contenttypes.FAQItem">
+
+
-->
+
+ createComponent="com.arsdigita.cms.contenttypes.ui.authoring.FAQItemCreate">
The Content Center main page (index page).
*
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionPage.java b/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionPage.java
index 9c8d5c730..a68cfada3 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionPage.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionPage.java
@@ -55,6 +55,11 @@ import org.apache.log4j.Logger;
/**
* Contains the entire admin UI for a content section.
+ *
+ * Developers Note:
+ * It is based on the dispatcher model is is going to be replaced by the newer
+ * servlet based model. @see c.ad.cms.ui.contentsection.MainPage (currently
+ * not active).
*
* @author Jack Chung
* @author Michael Pih
@@ -127,17 +132,11 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
private LayoutPanel m_csePane;
private ReportPane m_reportPane;
- private static class TitlePrinter implements PrintListener {
-
- @Override
- public void prepare(PrintEvent e) {
- final Label l = (Label) e.getTarget();
-
- l.setLabel(CMS.getContext().getContentSection().getName());
- }
- }
-
/**
+ * Creates the content section index page containing
+ * - a Navigaton bar for the various tasks (items, search, images, ....)
+ * - a breadcrumb
+ * - ....
* Contains the UI for administering a content section.
*/
public ContentSectionPage() {
@@ -158,6 +157,8 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
m_lifecyclePane = getLifecycleAdminPane();
m_categoryPane = getCategoryAdminPane();
m_typePane = getContentTypeAdminPane();
+ // userAdminPane removed, used to contain just one item (reset user
+ // folder) which moved to the FolderAdminPane
//m_userAdminPane = getUserAdminPane();
m_csePane = getCSEPane();
m_reportPane = getReportPane();
@@ -213,6 +214,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
/**
* Creates, and then caches, the browse pane. Overriding this method to
* return null will prevent this tab from appearing.
+ * @return
*/
protected BrowsePane getBrowsePane() {
if (m_browsePane == null) {
@@ -426,6 +428,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
*
* @param item The item from which we get the corresponding content section
* @param tab The index of the tab to display
+ * @return
*/
public static String getSectionURL(ContentItem item, int tab) {
// Get the content section associated with the content item.
@@ -462,4 +465,22 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
final Object[] args) {
return new GlobalizedMessage(key, RESOURCE_BUNDLE, args);
}
+
+ /**
+ * Helper class to be able to use a PrintListener to set the titel of the
+ * page.
+ */
+ private static class TitlePrinter implements PrintListener {
+
+ /**
+ *
+ * @param e
+ */
+ @Override
+ public void prepare(PrintEvent e) {
+ final Label l = (Label) e.getTarget();
+
+ l.setLabel(CMS.getContext().getContentSection().getName());
+ }
+ }
}
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/FlatItemList.java b/ccm-cms/src/com/arsdigita/cms/ui/FlatItemList.java
index 0bae0e21a..cfc411cca 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/FlatItemList.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/FlatItemList.java
@@ -78,8 +78,8 @@ import java.util.List;
import java.util.Map;
/**
- * Encapsulates a {@link FolderManipulator} in order to create a flat
- * item listing. Also contains a new item form.
+ * Encapsulates a {@link FolderManipulator} in order to create a flat item
+ * listing. Also contains a new item form.
*
* @author Stanislav Freidin
* @version $Id: FlatItemList.java 1538 2007-03-23 16:26:36Z apevec $
@@ -229,10 +229,12 @@ public class FlatItemList extends SegmentedPanel
m_removeHomeFolderAction.addActionListener(this);
browseActions.addAction(m_removeHomeFolderAction);
+ /* */
m_newItem = new SectionNewItemForm("newItem");
m_newItem.addProcessListener(this);
browseActions.addAction(m_newItem);
+ /* permission */
m_permissionsSeg = addSegment();
m_permissionsSeg.setIdAttr("folder-permissions");
@@ -408,10 +410,10 @@ public class FlatItemList extends SegmentedPanel
if (e.getSource() == m_folderCreator
&& m_folderCreator.isCancelled(s)) {
browseMode(s);
- throw new FormProcessException((String) GlobalizationUtil.globalize("cms.ui.cancelled").localize());
+ throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.cancelled"));
} else if (e.getSource() == m_folderEditor && m_folderEditor.isCancelled(s)) {
browseMode(s);
- throw new FormProcessException((String) GlobalizationUtil.globalize("cms.ui.cancelled").localize());
+ throw new FormProcessException(GlobalizationUtil.globalize("cms.ui.cancelled"));
} else if (e.getSource() == m_folderManip.getTargetSelector()) {
// This only works if this submission listener is run
// after the target selector's one
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/NewItemForm.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/NewItemForm.java
index 6f3be4828..1c225d498 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/NewItemForm.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/NewItemForm.java
@@ -46,6 +46,8 @@ import com.arsdigita.xml.Element;
import java.math.BigDecimal;
+import org.apache.log4j.Logger;
+
/**
* A form which displays a select box of all content types available under the
* given content section, and forwards to the item creation UI when the user
@@ -57,26 +59,35 @@ import java.math.BigDecimal;
*/
public abstract class NewItemForm extends Form {
+ /** Internal logger instance to faciliate debugging. Enable logging output
+ * by editing /WEB-INF/conf/log4j.properties int hte runtime environment
+ * and set com.arsdigita.cms.ui.authoring.NewItemForm=DEBUG by uncommenting
+ * or adding the line. */
+ private static final Logger s_log = Logger.getLogger(NewItemForm.class);
+
public static String DP_TYPE_PREFIX = "com.arsdigita.dp.";
- private SingleSelect m_typeWidget;
- private Submit m_submit;
- private Label m_emptyLabel;
- private Label m_createLabel;
+ private final SingleSelect m_typeWidget;
+ private final Submit m_submit;
+ private final Label m_emptyLabel;
+ private final Label m_createLabel;
public static final String TYPE_ID = "tid";
/**
- * Construct a new NewItemForm
+ * Construct a new NewItemForm. It sets a vertical BoxPanel as the component
+ * container.
*
+ * @param name the name attribute of the form.
*/
public NewItemForm(String name) {
- //super(name, new BoxPanel(BoxPanel.HORIZONTAL));
+
super(name, new BoxPanel(BoxPanel.VERTICAL));
setIdAttr("new_item_form");
- BoxPanel panel = new BoxPanel(BoxPanel.HORIZONTAL);//(BoxPanel) getPanel();
+ BoxPanel panel = new BoxPanel(BoxPanel.HORIZONTAL);
panel.setWidth("2%");
panel.setBorder(0);
+ // create and add an "empty" component
m_emptyLabel = new Label(GlobalizationUtil
.globalize("cms.ui.authoring.no_types_registered"),
false);
@@ -99,6 +110,7 @@ public abstract class NewItemForm extends Form {
OptionGroup o = (OptionGroup) e.getTarget();
PageState state = e.getPageState();
+ // gather the content types of this section into a list
ContentSection section = getContentSection(state);
ContentType parentType = null;
ContentTypeCollection typesCollection = null;
@@ -128,21 +140,31 @@ public abstract class NewItemForm extends Form {
while (typesCollection.next()) {
boolean list = true;
ContentType type = typesCollection.getContentType();
- if (PermissionService.getDirectGrantedPermissions(type.getOID()).size() > 0) {
- // chris gilbert - allow restriction of some types to certain
- // users/groups. No interface to do this, but group could be
- // created and permission granted in a content type loader
+ if (PermissionService
+ .getDirectGrantedPermissions(type.getOID())
+ .size() > 0) {
+ // chris gilbert - allow restriction of some types
+ // to certain users/groups. No interface to do
+ // this, but group could be created and permission
+ // granted in a content type loader
//
- // can't permission filter the collection because most types
- // will have no permissions granted. This approach involves
- // a small overhead getting the count of granted permissions for
- // each type (mitigated by only checking DIRECT permissions)
+ // can't permission filter the collection because
+ // most types will have no permissions granted.
+ // This approach involves a small overhead getting
+ // the count of granted permissions for each type
+ // (mitigated by only checking DIRECT permissions)
Party party = Kernel.getContext().getParty();
if (party == null) {
party = Kernel.getPublicUser();
}
- PermissionDescriptor create = new PermissionDescriptor(PrivilegeDescriptor.get(SecurityManager.CMS_NEW_ITEM), type, party);
+ PermissionDescriptor create =
+ new PermissionDescriptor(
+ PrivilegeDescriptor
+ .get(SecurityManager
+ .CMS_NEW_ITEM),
+ type,
+ party);
list = PermissionService.checkPermission(create);
}
@@ -165,7 +187,7 @@ public abstract class NewItemForm extends Form {
}
});
} catch (java.util.TooManyListenersException e) {
- throw new UncheckedWrapperException("Too many listeners: " + e.getMessage(), e);
+ throw new UncheckedWrapperException("Too many listeners: " + e.getMessage(), e);
}
panel.add(m_typeWidget);
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/MainPage.java b/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/MainPage.java
index 2b1144587..70dc25fe7 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/MainPage.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/contentcenter/MainPage.java
@@ -35,6 +35,16 @@ import com.arsdigita.ui.DebugPanel;
import org.apache.log4j.Logger;
+// ////////////////////////////////////////////////////////////////////////////
+//
+// Developer's Note:
+// Replaces the (old) Dispatcher based Code cms.ui.CMSPageWorkspacePage
+// Note should be removed as soon as the migration process is competed (in-
+// cluding content section pages).
+//
+// ////////////////////////////////////////////////////////////////////////////
+
+
/**
* The Content Center main page.
*
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/contentsection/MainPage.java b/ccm-cms/src/com/arsdigita/cms/ui/contentsection/MainPage.java
index b02b4f1df..afa09108c 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/contentsection/MainPage.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/contentsection/MainPage.java
@@ -60,6 +60,7 @@ import org.apache.log4j.Logger;
//
// Migration of the Content Section main page from old style dispatcher based
// UI to new style, legacy free UI based on servlet.
+// Currently not yet in use!
// ////////////////////////////////////////////////////////////////////////////
diff --git a/ccm-core/src/com/arsdigita/bebop/Form.java b/ccm-core/src/com/arsdigita/bebop/Form.java
index f5e2e9664..ab5e94d49 100755
--- a/ccm-core/src/com/arsdigita/bebop/Form.java
+++ b/ccm-core/src/com/arsdigita/bebop/Form.java
@@ -36,10 +36,9 @@ import java.util.Iterator;
import org.apache.log4j.Logger;
/**
- * Represents the visual structure of an HTML form. Forms
- * can be constructed with a Container argument to specify the type
- * of layout this form will adhere to. The default is a column panel.
- *
+ * Represents the visual structure of an HTML form. Forms can be constructed
+ * with a Container argument to specify the type of layout this form will
+ * adhere to. The default is a column panel.
*
* As an example, a form that accepts a first and last name may be set
* up as follows:
@@ -78,9 +77,9 @@ import org.apache.log4j.Logger;
* }
*
*
- *
This form automatically checks that the user supplied a last
- * name. Only then does it call the process method, which
- * prints the user-supplied values.
+ *
This form automatically checks that the user supplied a last name. Only
+ * then does it call the process method, which prints the
+ * user-supplied values.
*
* @author Karl Goldstein
* @author Uday Mathur
@@ -93,6 +92,10 @@ import org.apache.log4j.Logger;
public class Form extends FormSection implements BebopConstants {
+ /** Internal logger instance to faciliate debugging. Enable logging output
+ * by editing /WEB-INF/conf/log4j.properties int hte runtime environment
+ * and set com.arsdigita.bebop.Form=DEBUG by uncommenting
+ * or adding the line. */
private static final Logger s_log = Logger.getLogger(Form.class);
/**
@@ -130,15 +133,6 @@ public class Form extends FormSection implements BebopConstants {
*/
private RequestLocal m_formData;
- /**
- * Constructs a new form with the specified name.
- * At the time of creation, instantiates a new
- * form model for the form and instantiates a ColumnPanel as the default to
- * contain the components.
- *
- * @param name the name of the form
- */
-
/**
* Determines whether or not a form is 'redirecting', meaning that
* it will clear the control event and redirect to the resulting
@@ -147,18 +141,25 @@ public class Form extends FormSection implements BebopConstants {
*/
private boolean m_isRedirecting = false;
+
+ /**
+ * Constructs a new form with the specified name.
+ * At the time of creation, instantiates a new form model for the form and
+ * instantiates a default ColumnPanel to contain the components.
+ *
+ * @param name the name of the form
+ */
public Form(String name) {
this(name, new GridPanel(2));
}
/**
- * Constructs a new form with the specified name and container. At the time of
- * at the time of creation, instantiates a new form model for the form
- * and replaces the default ColumnPanel with
- * the specified container as the implicit container of the components.
- *
- * @param name the name of the form
+ * Constructs a new form with the specified name and container. At the time
+ * of creation, instantiates a new form model for the form and replaces
+ * the default ColumnPanel with the specified container as the implicit
+ * container of the components.
*
+ * @param name the name attribute of the form
* @param panel the implicit container that will hold the components
*/
public Form(String name, Container panel) {
@@ -189,6 +190,7 @@ public class Form extends FormSection implements BebopConstants {
* representation
* @see PageState#generateXML
*/
+ @Override
public void generateXML(PageState s, Element parent) {
if ( isVisible(s) ) {
Element form = generateXMLSansState(s, parent);
@@ -204,6 +206,7 @@ public class Form extends FormSection implements BebopConstants {
* state information from s.
*
* @param s represents the curent request
+ * @param parent
* @return the top-level element for the form
*/
protected Element generateXMLSansState(PageState s, Element parent) {