CCM NG: JavaDoc for the classes of the PageModel admin UI
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5132 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
4dfc3bee6a
commit
7622de2d29
|
|
@ -26,12 +26,14 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
import com.arsdigita.ui.admin.pagemodels.AbstractComponentModelForm;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelTab;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelsTab;
|
||||
|
||||
import org.librecms.CmsConstants;
|
||||
import org.librecms.pagemodel.ContentItemComponent;
|
||||
|
||||
/**
|
||||
* Basic form for all subclasses of {@link ContentItemComponent}.
|
||||
*
|
||||
* @param <T>
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
|
|
@ -40,13 +42,19 @@ import org.librecms.pagemodel.ContentItemComponent;
|
|||
public abstract class AbstractContentItemComponentForm<T extends ContentItemComponent>
|
||||
extends AbstractComponentModelForm<T> {
|
||||
|
||||
/**
|
||||
* Constant for the name of the {@link #modeField}.
|
||||
*/
|
||||
private static final String ITEM_MODE = "itemMode";
|
||||
|
||||
/**
|
||||
* Text field for {@link ContentItemComponent#mode}.
|
||||
*/
|
||||
private TextField modeField;
|
||||
|
||||
public AbstractContentItemComponentForm(
|
||||
final String name,
|
||||
final PageModelTab pageModelTab,
|
||||
final PageModelsTab pageModelTab,
|
||||
final ParameterSingleSelectionModel<String> selectedModelId,
|
||||
final ParameterSingleSelectionModel<String> selectedComponentId) {
|
||||
|
||||
|
|
|
|||
|
|
@ -19,11 +19,12 @@
|
|||
package com.arsdigita.cms.ui.pagemodel;
|
||||
|
||||
import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelTab;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelsTab;
|
||||
|
||||
import org.librecms.pagemodel.CategorizedItemComponent;
|
||||
|
||||
/**
|
||||
* Form for editing/creating a {@link CategorizedItemComponent}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
@ -31,7 +32,7 @@ public class CategorizedItemComponentForm
|
|||
extends AbstractContentItemComponentForm<CategorizedItemComponent> {
|
||||
|
||||
public CategorizedItemComponentForm(
|
||||
final PageModelTab pageModelTab,
|
||||
final PageModelsTab pageModelTab,
|
||||
final ParameterSingleSelectionModel<String> selectedModelId,
|
||||
final ParameterSingleSelectionModel<String> selectedComponentId) {
|
||||
|
||||
|
|
|
|||
|
|
@ -28,12 +28,13 @@ import com.arsdigita.bebop.form.CheckboxGroup;
|
|||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
import com.arsdigita.ui.admin.pagemodels.AbstractComponentModelForm;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelTab;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelsTab;
|
||||
|
||||
import org.librecms.CmsConstants;
|
||||
import org.librecms.pagemodel.CategoryTreeComponent;
|
||||
|
||||
/**
|
||||
* Form for creating/editing a {@link CategoryTreeComponent}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
@ -45,7 +46,7 @@ public class CategoryTreeComponentForm extends AbstractComponentModelForm<Catego
|
|||
private CheckboxGroup showFullTreeCheckbox;
|
||||
|
||||
public CategoryTreeComponentForm(
|
||||
final PageModelTab pageModelTab,
|
||||
final PageModelsTab pageModelTab,
|
||||
final ParameterSingleSelectionModel<String> selectedModelId,
|
||||
final ParameterSingleSelectionModel<String> selectedComponentId) {
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
|||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.cms.ui.assets.ItemSearchWidget;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelTab;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelsTab;
|
||||
|
||||
import org.libreccm.cdi.utils.CdiUtil;
|
||||
import org.librecms.CmsConstants;
|
||||
|
|
@ -34,6 +34,7 @@ import org.librecms.contentsection.ContentItemRepository;
|
|||
import org.librecms.pagemodel.FixedContentItemComponent;
|
||||
|
||||
/**
|
||||
* Form for creating/editing a {@link FixedContentItemComponent}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
@ -45,7 +46,7 @@ public class FixedContentItemComponentForm
|
|||
private ItemSearchWidget itemSearchWidget;
|
||||
|
||||
public FixedContentItemComponentForm(
|
||||
final PageModelTab pageModelTab,
|
||||
final PageModelsTab pageModelTab,
|
||||
final ParameterSingleSelectionModel<String> selectedModelId,
|
||||
final ParameterSingleSelectionModel<String> selectedComponentId) {
|
||||
|
||||
|
|
|
|||
|
|
@ -19,11 +19,12 @@
|
|||
package com.arsdigita.cms.ui.pagemodel;
|
||||
|
||||
import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelTab;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelsTab;
|
||||
|
||||
import org.librecms.pagemodel.GreetingItemComponent;
|
||||
|
||||
/**
|
||||
* Form for creating/editing a {@link GreetingItemComponent}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
@ -31,7 +32,7 @@ public class GreetingItemComponentForm
|
|||
extends AbstractContentItemComponentForm<GreetingItemComponent> {
|
||||
|
||||
public GreetingItemComponentForm(
|
||||
final PageModelTab pageModelTab,
|
||||
final PageModelsTab pageModelTab,
|
||||
final ParameterSingleSelectionModel<String> selectedModelId,
|
||||
final ParameterSingleSelectionModel<String> selectedComponentId) {
|
||||
|
||||
|
|
|
|||
|
|
@ -30,17 +30,17 @@ import com.arsdigita.bebop.form.TextArea;
|
|||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
import com.arsdigita.ui.admin.pagemodels.AbstractComponentModelForm;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelTab;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelsTab;
|
||||
|
||||
import org.librecms.CmsConstants;
|
||||
import org.librecms.pagemodel.ItemListComponent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Form for adding/editing a {@link ItemListComponent}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
@ -59,7 +59,7 @@ public class ItemListComponentForm
|
|||
private TextArea listOrderArea;
|
||||
|
||||
public ItemListComponentForm(
|
||||
final PageModelTab pageModelTab,
|
||||
final PageModelsTab pageModelTab,
|
||||
final ParameterSingleSelectionModel<String> selectedModelId,
|
||||
final ParameterSingleSelectionModel<String> selectedComponentId) {
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import com.arsdigita.ui.admin.applications.ApplicationsTab;
|
|||
import com.arsdigita.ui.admin.categories.CategoriesTab;
|
||||
import com.arsdigita.ui.admin.configuration.ConfigurationTab;
|
||||
import com.arsdigita.ui.admin.importexport.ImportExportTab;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelTab;
|
||||
import com.arsdigita.ui.admin.pagemodels.PageModelsTab;
|
||||
import com.arsdigita.ui.admin.sites.SitesTab;
|
||||
import com.arsdigita.web.BaseApplicationServlet;
|
||||
import com.arsdigita.web.LoginSignal;
|
||||
|
|
@ -126,10 +126,9 @@ public class AdminServlet extends BaseApplicationServlet {
|
|||
ADMIN_BUNDLE)),
|
||||
new SitesTab());
|
||||
|
||||
tabbedPane.addTab(
|
||||
new Label(new GlobalizedMessage("ui.admin.tab.pagemodels.title",
|
||||
tabbedPane.addTab(new Label(new GlobalizedMessage("ui.admin.tab.pagemodels.title",
|
||||
ADMIN_BUNDLE)),
|
||||
new PageModelTab());
|
||||
new PageModelsTab());
|
||||
|
||||
tabbedPane.addTab(
|
||||
new Label(new GlobalizedMessage(
|
||||
|
|
|
|||
|
|
@ -36,13 +36,32 @@ import org.libreccm.cdi.utils.CdiUtil;
|
|||
import org.libreccm.pagemodel.ComponentModel;
|
||||
import org.libreccm.pagemodel.ComponentModelRepository;
|
||||
import org.libreccm.pagemodel.PageModel;
|
||||
import org.libreccm.pagemodel.PageModelManager;
|
||||
import org.libreccm.pagemodel.PageModelRepository;
|
||||
|
||||
/**
|
||||
* Base form for creating forms for editing/creating components of a
|
||||
* {@link PageModel}.
|
||||
*
|
||||
* Subclasses must provided a constructor with the following signature:
|
||||
* {@code SomeComponentModelForm(PageModelTab, ParameterSingleSelectionModel, ParameterSingleSelectionModel)}.
|
||||
*
|
||||
* This constructor has to call
|
||||
* {@link #AbstractComponentModelForm(java.lang.String, com.arsdigita.ui.admin.pagemodels.PageModelsTab, com.arsdigita.bebop.ParameterSingleSelectionModel, com.arsdigita.bebop.ParameterSingleSelectionModel)}
|
||||
*
|
||||
* with the provided parameters and a unique name for the form. Usually this be
|
||||
* the name of the component model which is associated with the form and the
|
||||
* suffix {@code Form}.
|
||||
*
|
||||
* The constructor is called is using reflection. The parameters passed to the
|
||||
* constructor are:
|
||||
* <ol>
|
||||
* <li>The {@link PageModelsTab} in which the form is displayed.</li>
|
||||
* <li>The {@link ParameterSingleSelectionModel} which holds the ID of the
|
||||
* currently selected {@link PageModel}.</li>
|
||||
* <li>The {@link ParameterSingleSelectionModel} which holds the ID of the
|
||||
* currently selected {@link ComponentModel}. The selected key of the selection
|
||||
* model might be null if a new component model is created.</li>
|
||||
* </ol>
|
||||
*
|
||||
* @param <T>
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
|
|
@ -59,9 +78,9 @@ public abstract class AbstractComponentModelForm<T extends ComponentModel>
|
|||
private static final String COMPONENT_KEY = "componentKey";
|
||||
|
||||
/**
|
||||
* The {@link PageModelTab} in which the form is used
|
||||
* The {@link PageModelsTab} in which the form is used
|
||||
*/
|
||||
private final PageModelTab pageModelTab;
|
||||
private final PageModelsTab pageModelTab;
|
||||
/**
|
||||
* ID of the selected {@link PageModel}.
|
||||
*/
|
||||
|
|
@ -86,7 +105,7 @@ public abstract class AbstractComponentModelForm<T extends ComponentModel>
|
|||
|
||||
public AbstractComponentModelForm(
|
||||
final String name,
|
||||
final PageModelTab pageModelTab,
|
||||
final PageModelsTab pageModelTab,
|
||||
final ParameterSingleSelectionModel<String> selectedModelId,
|
||||
final ParameterSingleSelectionModel<String> selectedComponentId) {
|
||||
|
||||
|
|
@ -96,11 +115,6 @@ public abstract class AbstractComponentModelForm<T extends ComponentModel>
|
|||
this.selectedModelId = selectedModelId;
|
||||
this.selectedComponentId = selectedComponentId;
|
||||
|
||||
// keyField = new TextField(COMPONENT_KEY);
|
||||
// keyField.setLabel(new GlobalizedMessage(
|
||||
// "ui.admin.pagemodels.components.key.label",
|
||||
// AdminUiConstants.ADMIN_BUNDLE));
|
||||
// super.add(keyField);
|
||||
createWidgets();
|
||||
|
||||
super.addInitListener(this);
|
||||
|
|
@ -108,6 +122,12 @@ public abstract class AbstractComponentModelForm<T extends ComponentModel>
|
|||
super.addProcessListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method called by the constructor to create the widgets of the
|
||||
* form. The method also calls the {@link #addWidgets()} after the basic
|
||||
* widgets have been created and adds the {@link SaveCancelSection} at the
|
||||
* end.
|
||||
*/
|
||||
private void createWidgets() {
|
||||
keyField = new TextField(COMPONENT_KEY);
|
||||
keyField.setLabel(new GlobalizedMessage(
|
||||
|
|
@ -121,22 +141,57 @@ public abstract class AbstractComponentModelForm<T extends ComponentModel>
|
|||
super.add(saveCancelSection);
|
||||
}
|
||||
|
||||
protected final PageModelTab getPageModelTab() {
|
||||
/**
|
||||
* Provides access to the {@link PageModelsTab}.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected final PageModelsTab getPageModelTab() {
|
||||
return pageModelTab;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides access the {@link ParameterSingleSelectionModel} holding the ID
|
||||
* of the currently selected {@link ComponentModel}. The selected key of the
|
||||
* selection model is {@code null} if a new {@link ComponentModel} is
|
||||
* created.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected final ParameterSingleSelectionModel<String> getSelectedComponentId() {
|
||||
return selectedComponentId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides access to the {@link ParameterSingleSelectionModel} holding the
|
||||
* ID of the currently selected {@link PageModel}.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected final ParameterSingleSelectionModel<String> getSelectedModelId() {
|
||||
return selectedModelId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides access to the {@link SaveCancelSection} of the form allowing
|
||||
* subclasses to check if the <em>Save</em> button of the
|
||||
* {@link SaveCancelSection} has been pressed.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected final SaveCancelSection getSaveCancelSection() {
|
||||
return saveCancelSection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides access to the currently selected {@link PageModel}. The
|
||||
* implementation for the init and validation listeners
|
||||
* ({@link #init(com.arsdigita.bebop.event.FormSectionEvent)} and
|
||||
* {@link #validate(com.arsdigita.bebop.event.FormSectionEvent)} initialise
|
||||
* this field.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected final T getComponentModel() {
|
||||
return componentModel;
|
||||
}
|
||||
|
|
@ -168,6 +223,21 @@ public abstract class AbstractComponentModelForm<T extends ComponentModel>
|
|||
PageState state,
|
||||
FormData data);
|
||||
|
||||
/**
|
||||
* Init listener for the component form. Subclasses should override this
|
||||
* method to initialise their fields. If this method is overridden the
|
||||
* overriding method <strong>must</strong> call {@code super.init(event)}.
|
||||
* Otherwise the {@link #keyField} will not be initialised properly. Also
|
||||
* the method loads the selected current component model from the database
|
||||
* and stores it in the {@link #componentModel} field. Overriding methods
|
||||
* can access the field using the {@link #getComponentModel()} method. If
|
||||
* {@link super.init(event)} is not called the {@link #componentModel} field
|
||||
* will not be initialised.
|
||||
*
|
||||
* @param event The event which caused the listener to be invoked.
|
||||
*
|
||||
* @throws FormProcessException
|
||||
*/
|
||||
@Override
|
||||
public void init(final FormSectionEvent event) throws FormProcessException {
|
||||
|
||||
|
|
@ -192,6 +262,17 @@ public abstract class AbstractComponentModelForm<T extends ComponentModel>
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validation listener for the component form. Subclasses should override
|
||||
* this method to validate their fields if necessary.. If this method is
|
||||
* overridden the overriding method <strong>must</strong> call
|
||||
* {@code super.validate(event)}. Otherwise the {@link #keyField} will not
|
||||
* be validated properly.
|
||||
*
|
||||
* @param event The event which caused the listener to be invoked.
|
||||
*
|
||||
* @throws FormProcessException
|
||||
*/
|
||||
@Override
|
||||
public void validate(final FormSectionEvent event)
|
||||
throws FormProcessException {
|
||||
|
|
@ -215,8 +296,19 @@ public abstract class AbstractComponentModelForm<T extends ComponentModel>
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process listener for the component form. This method can't be overridden.
|
||||
* Instead subclasses have to implement
|
||||
* {@link #updateComponentModel(org.libreccm.pagemodel.ComponentModel, com.arsdigita.bebop.PageState, com.arsdigita.bebop.FormData)}
|
||||
* to set their specific values on the current component model. The
|
||||
* implementation of that method is called by the this method.
|
||||
*
|
||||
* @param event The event which caused the listener to be invoked.
|
||||
*
|
||||
* @throws FormProcessException
|
||||
*/
|
||||
@Override
|
||||
public void process(final FormSectionEvent event)
|
||||
public final void process(final FormSectionEvent event)
|
||||
throws FormProcessException {
|
||||
|
||||
final PageState state = event.getPageState();
|
||||
|
|
@ -263,6 +355,13 @@ public abstract class AbstractComponentModelForm<T extends ComponentModel>
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method for retrieving the component model from the database.
|
||||
*
|
||||
* @param componentModelId The ID of the component model to retrieve.
|
||||
*
|
||||
* @return The component model.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private T retrieveComponentModel(final String componentModelId) {
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Table used in the {@link PageModelDetails} component to list the components
|
||||
* assigned to a {@link PageModel}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
@ -54,7 +56,7 @@ class ComponentsTable extends Table {
|
|||
protected static final int COL_DELETE = 3;
|
||||
|
||||
public ComponentsTable(
|
||||
final PageModelTab pageModelTab,
|
||||
final PageModelsTab pageModelTab,
|
||||
final ParameterSingleSelectionModel<String> selectedModelId,
|
||||
final ParameterSingleSelectionModel<String> selectedComponentId) {
|
||||
|
||||
|
|
|
|||
|
|
@ -48,13 +48,15 @@ import java.util.List;
|
|||
import java.util.TooManyListenersException;
|
||||
|
||||
/**
|
||||
* Shows the details about a {@link PageModel} including the
|
||||
* {@link ComponentModel}s assigned to the {@link PageModel}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class PageModelDetails extends BoxPanel {
|
||||
|
||||
public PageModelDetails(
|
||||
final PageModelTab pageModelTab,
|
||||
final PageModelsTab pageModelTab,
|
||||
final ParameterSingleSelectionModel<String> selectedModelId,
|
||||
final ParameterSingleSelectionModel<String> selectedComponentId) {
|
||||
|
||||
|
|
@ -110,14 +112,18 @@ class PageModelDetails extends BoxPanel {
|
|||
super.add(componentsTable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Form for selecting the type of {@link ComponentModel} to add to the
|
||||
* {@link PageModel}.
|
||||
*/
|
||||
private class AddComponentForm
|
||||
extends Form
|
||||
implements FormProcessListener {
|
||||
|
||||
private final PageModelTab pageModelTab;
|
||||
private final PageModelsTab pageModelTab;
|
||||
private final SingleSelect selectType;
|
||||
|
||||
public AddComponentForm(final PageModelTab pageModelTab) {
|
||||
public AddComponentForm(final PageModelsTab pageModelTab) {
|
||||
|
||||
super("pagemodel_add_component_form",
|
||||
new BoxPanel(BoxPanel.HORIZONTAL));
|
||||
|
|
@ -171,6 +177,10 @@ class PageModelDetails extends BoxPanel {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link PrintListener} implementation for the select box in the
|
||||
* {@link AddComponentForm}.
|
||||
*/
|
||||
private class ComponentModelSelectPrintListener implements PrintListener {
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ import java.util.Optional;
|
|||
import java.util.TooManyListenersException;
|
||||
|
||||
/**
|
||||
* Form for creating a new {@link PageModel}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
@ -63,7 +64,7 @@ class PageModelForm extends Form {
|
|||
private static final String MODEL_TITLE = "model_title";
|
||||
private static final String MODEL_DESC = "model_desc";
|
||||
|
||||
private final PageModelTab pageModelTab;
|
||||
private final PageModelsTab pageModelTab;
|
||||
private final ParameterSingleSelectionModel<String> selectedModelId;
|
||||
|
||||
private final TextField nameField;
|
||||
|
|
@ -73,7 +74,7 @@ class PageModelForm extends Form {
|
|||
private final SaveCancelSection saveCancelSection;
|
||||
|
||||
public PageModelForm(
|
||||
final PageModelTab pageModelTab,
|
||||
final PageModelsTab pageModelTab,
|
||||
final ParameterSingleSelectionModel<String> selectedModelId) {
|
||||
|
||||
super("pagemodelsform");
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ import java.util.Iterator;
|
|||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Implementation of {@link PropertySheetModel} for the the property sheet used
|
||||
* in {@link PageModelDetails} for displaying the basic properties of a
|
||||
* {@link PageModel}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import com.arsdigita.bebop.PageState;
|
|||
import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
||||
import com.arsdigita.bebop.PropertySheet;
|
||||
import com.arsdigita.bebop.PropertySheetModel;
|
||||
import com.arsdigita.bebop.PropertySheetModelBuilder;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
|
||||
import org.libreccm.cdi.utils.CdiUtil;
|
||||
|
|
@ -29,6 +30,9 @@ import org.libreccm.pagemodel.PageModel;
|
|||
import org.libreccm.pagemodel.PageModelRepository;
|
||||
|
||||
/**
|
||||
* Implementation of {@link PropertySheetModelBuilder} for the the property
|
||||
* sheet used in {@link PageModelDetails} for displaying the basic properties of
|
||||
* a {@link PageModel}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ import javax.inject.Inject;
|
|||
import javax.transaction.Transactional;
|
||||
|
||||
/**
|
||||
* CDI bean encapsulating some actions for the components of the
|
||||
* {@link PageModelTab}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -37,10 +37,11 @@ import org.libreccm.pagemodel.ComponentModel;
|
|||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
/**
|
||||
* Tab for {@code /ccm/admin} for managing {@link PageModel}s.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class PageModelTab extends LayoutPanel {
|
||||
public class PageModelsTab extends LayoutPanel {
|
||||
|
||||
private final ParameterSingleSelectionModel<String> selectedModelId;
|
||||
private final ParameterSingleSelectionModel<String> selectedComponentId;
|
||||
|
|
@ -52,7 +53,7 @@ public class PageModelTab extends LayoutPanel {
|
|||
|
||||
private Class<? extends ComponentModel> componentModelClass;
|
||||
|
||||
public PageModelTab() {
|
||||
public PageModelsTab() {
|
||||
|
||||
super();
|
||||
|
||||
|
|
@ -101,11 +102,10 @@ public class PageModelTab extends LayoutPanel {
|
|||
.getSelectedKey(state)));
|
||||
}
|
||||
return formClass
|
||||
.getDeclaredConstructor(
|
||||
PageModelTab.class,
|
||||
.getDeclaredConstructor(PageModelsTab.class,
|
||||
ParameterSingleSelectionModel.class,
|
||||
ParameterSingleSelectionModel.class)
|
||||
.newInstance(PageModelTab.this,
|
||||
.newInstance(PageModelsTab.this,
|
||||
selectedModelId,
|
||||
selectedComponentId);
|
||||
} catch (InstantiationException
|
||||
|
|
@ -43,6 +43,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Table showing all available {@link PageModels}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
@ -55,7 +56,7 @@ class PageModelsTable extends Table {
|
|||
public static final int COL_REMOVE = 4;
|
||||
|
||||
public PageModelsTable(
|
||||
final PageModelTab parent,
|
||||
final PageModelsTab parent,
|
||||
final ParameterSingleSelectionModel<String> selectedPageModelId) {
|
||||
|
||||
super();
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ package com.arsdigita.ui.admin.pagemodels;
|
|||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Data for one row of the {@link PageModelsTable}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue