Weitere Einstellung "Sichtbar" für Kategorien (Ticket #1634). Dafür wird eine weitere Spalte in cat_categories benötigt. Upgrade-Skript enthalten.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2172 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
7125d102df
commit
4edddb7faa
|
|
@ -1120,3 +1120,5 @@ cms.ui.contentcenter.action=Action
|
||||||
cms.ui.set_home_folder=Set as home folder
|
cms.ui.set_home_folder=Set as home folder
|
||||||
cms.ui.go_to_home_folder=Go to home folder
|
cms.ui.go_to_home_folder=Go to home folder
|
||||||
cms.ui.no_home_folder_selected=No home folder selected
|
cms.ui.no_home_folder_selected=No home folder selected
|
||||||
|
cms.ui.cateogry.is_visible=Visible?
|
||||||
|
cms.ui.category.is_visible=Visible?
|
||||||
|
|
|
||||||
|
|
@ -1112,3 +1112,5 @@ cms.ui.contentcenter.action=Aktion
|
||||||
cms.ui.set_home_folder=Als Start-Ordner festlegen
|
cms.ui.set_home_folder=Als Start-Ordner festlegen
|
||||||
cms.ui.go_to_home_folder=Zum Start-Ordner
|
cms.ui.go_to_home_folder=Zum Start-Ordner
|
||||||
cms.ui.no_home_folder_selected=Kein Start-Ordner festgelegt
|
cms.ui.no_home_folder_selected=Kein Start-Ordner festgelegt
|
||||||
|
cms.ui.cateogry.is_visible=Sichtbar?
|
||||||
|
cms.ui.category.is_visible=Sichtbar?
|
||||||
|
|
|
||||||
|
|
@ -59,3 +59,5 @@ cms.ui.set_home_folder=Set as home folder
|
||||||
cms.ui.go_to_home_folder=Go to home folder
|
cms.ui.go_to_home_folder=Go to home folder
|
||||||
cms.ui.no_home_folder_selected=No home folder selected
|
cms.ui.no_home_folder_selected=No home folder selected
|
||||||
cms.ui.contentcenter.action=Action
|
cms.ui.contentcenter.action=Action
|
||||||
|
cms.ui.cateogry.is_visible=
|
||||||
|
cms.ui.category.is_visible=
|
||||||
|
|
|
||||||
|
|
@ -590,3 +590,5 @@ cms.ui.contentcenter.action=
|
||||||
cms.ui.set_home_folder=Set as home folder
|
cms.ui.set_home_folder=Set as home folder
|
||||||
cms.ui.go_to_home_folder=
|
cms.ui.go_to_home_folder=
|
||||||
cms.ui.no_home_folder_selected=No home folder selected
|
cms.ui.no_home_folder_selected=No home folder selected
|
||||||
|
cms.ui.cateogry.is_visible=
|
||||||
|
cms.ui.category.is_visible=
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ import com.arsdigita.xml.Element;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A form which creates a new category. Extends the edit form for
|
* A form which creates a new category. Extends the edit form for
|
||||||
* convenience.
|
* convenience.
|
||||||
|
|
@ -49,25 +48,23 @@ import org.apache.log4j.Logger;
|
||||||
* @version $Id: BaseCategoryForm.java 1951 2009-06-30 04:35:04Z terry $
|
* @version $Id: BaseCategoryForm.java 1951 2009-06-30 04:35:04Z terry $
|
||||||
*/
|
*/
|
||||||
class BaseCategoryForm extends BaseForm {
|
class BaseCategoryForm extends BaseForm {
|
||||||
private static final Logger s_log = Logger.getLogger
|
|
||||||
(BaseCategoryForm.class);
|
|
||||||
|
|
||||||
|
private static final Logger s_log = Logger.getLogger(BaseCategoryForm.class);
|
||||||
final CategoryRequestLocal m_parent;
|
final CategoryRequestLocal m_parent;
|
||||||
final TextField m_name;
|
final TextField m_name;
|
||||||
final TextArea m_description;
|
final TextArea m_description;
|
||||||
final TextField m_url;
|
final TextField m_url;
|
||||||
final RadioGroup m_isAbstract;
|
final RadioGroup m_isAbstract;
|
||||||
|
final RadioGroup m_isVisible;
|
||||||
final RadioGroup m_isEnabled;
|
final RadioGroup m_isEnabled;
|
||||||
private Label m_script = new Label(
|
private Label m_script = new Label(
|
||||||
"<script language=\"javascript\" src=\"/javascript/manipulate-input.js\"></script>",
|
"<script language=\"javascript\" src=\"/javascript/manipulate-input.js\"></script>",
|
||||||
false);
|
false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private final static String NAME = "name";
|
private final static String NAME = "name";
|
||||||
private final static String DESCRIPTION = "description";
|
private final static String DESCRIPTION = "description";
|
||||||
private final static String URL = "url";
|
private final static String URL = "url";
|
||||||
private final static String IS_ABSTRACT = "isAbstract";
|
private final static String IS_ABSTRACT = "isAbstract";
|
||||||
|
private final static String IS_VISIBLE = "isVisible";
|
||||||
private final static String IS_ENABLED = "isEnabled";
|
private final static String IS_ENABLED = "isEnabled";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -86,11 +83,9 @@ class BaseCategoryForm extends BaseForm {
|
||||||
m_name.setSize(30);
|
m_name.setSize(30);
|
||||||
m_name.setMaxLength(200);
|
m_name.setMaxLength(200);
|
||||||
m_name.addValidationListener(new NotNullValidationListener());
|
m_name.addValidationListener(new NotNullValidationListener());
|
||||||
m_name.setOnFocus("if (this.form." + URL + ".value == '') { " +
|
m_name.setOnFocus("if (this.form." + URL + ".value == '') { " + " defaulting = true; this.form." + URL
|
||||||
" defaulting = true; this.form." + URL +
|
+ ".value = urlize(this.value); }");
|
||||||
".value = urlize(this.value); }");
|
m_name.setOnKeyUp("if (defaulting) { this.form." + URL + ".value = urlize(this.value) }");
|
||||||
m_name.setOnKeyUp("if (defaulting) { this.form." + URL +
|
|
||||||
".value = urlize(this.value) }");
|
|
||||||
|
|
||||||
// is abstract?
|
// is abstract?
|
||||||
m_isAbstract = new RadioGroup(IS_ABSTRACT);
|
m_isAbstract = new RadioGroup(IS_ABSTRACT);
|
||||||
|
|
@ -98,6 +93,12 @@ class BaseCategoryForm extends BaseForm {
|
||||||
m_isAbstract.addOption(new Option("yes", new Label(gz("cms.ui.yes"))));
|
m_isAbstract.addOption(new Option("yes", new Label(gz("cms.ui.yes"))));
|
||||||
addField(gz("cms.ui.category.is_not_abstract"), m_isAbstract);
|
addField(gz("cms.ui.category.is_not_abstract"), m_isAbstract);
|
||||||
|
|
||||||
|
// is visible
|
||||||
|
m_isVisible = new RadioGroup(IS_VISIBLE);
|
||||||
|
m_isVisible.addOption(new Option("no", new Label(gz("cms.ui.no"))));
|
||||||
|
m_isVisible.addOption(new Option("yes", new Label(gz("cms.ui.yes"))));
|
||||||
|
addField(gz("cms.ui.category.is_visible"), m_isVisible);
|
||||||
|
|
||||||
// is enabled?
|
// is enabled?
|
||||||
m_isEnabled = new RadioGroup(IS_ENABLED);
|
m_isEnabled = new RadioGroup(IS_ENABLED);
|
||||||
m_isEnabled.addOption(new Option("no", new Label(gz("cms.ui.no"))));
|
m_isEnabled.addOption(new Option("no", new Label(gz("cms.ui.no"))));
|
||||||
|
|
@ -105,8 +106,7 @@ class BaseCategoryForm extends BaseForm {
|
||||||
addField(gz("cms.ui.category.is_enabled"), m_isEnabled);
|
addField(gz("cms.ui.category.is_enabled"), m_isEnabled);
|
||||||
|
|
||||||
|
|
||||||
m_description = new TextArea
|
m_description = new TextArea(new TrimmedStringParameter(DESCRIPTION));
|
||||||
(new TrimmedStringParameter(DESCRIPTION));
|
|
||||||
addField(gz("cms.ui.description"), m_description);
|
addField(gz("cms.ui.description"), m_description);
|
||||||
|
|
||||||
m_description.setWrap(TextArea.SOFT);
|
m_description.setWrap(TextArea.SOFT);
|
||||||
|
|
@ -130,10 +130,8 @@ class BaseCategoryForm extends BaseForm {
|
||||||
m_url.setMaxLength(200);
|
m_url.setMaxLength(200);
|
||||||
m_url.addValidationListener(new NotNullValidationListener());
|
m_url.addValidationListener(new NotNullValidationListener());
|
||||||
m_url.setOnFocus("defaulting = false");
|
m_url.setOnFocus("defaulting = false");
|
||||||
m_url.setOnBlur("if (this.value == '') " +
|
m_url.setOnBlur("if (this.value == '') " + "{ defaulting = true; this.value = urlize(this.form." + NAME
|
||||||
"{ defaulting = true; this.value = urlize(this.form." + NAME +
|
+ ".value) } " + "else { this.value = urlize(this.value); }");
|
||||||
".value) } " +
|
|
||||||
"else { this.value = urlize(this.value); }");
|
|
||||||
addField(gz("cms.ui.category.url"), m_url);
|
addField(gz("cms.ui.category.url"), m_url);
|
||||||
|
|
||||||
addAction(new Finish());
|
addAction(new Finish());
|
||||||
|
|
@ -146,6 +144,7 @@ class BaseCategoryForm extends BaseForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
class NameUniqueListener implements ParameterListener {
|
class NameUniqueListener implements ParameterListener {
|
||||||
|
|
||||||
private final CategoryRequestLocal m_category;
|
private final CategoryRequestLocal m_category;
|
||||||
private final Widget m_widget;
|
private final Widget m_widget;
|
||||||
private final int m_type;
|
private final int m_type;
|
||||||
|
|
@ -155,6 +154,7 @@ class BaseCategoryForm extends BaseForm {
|
||||||
NameUniqueListener(final CategoryRequestLocal category) {
|
NameUniqueListener(final CategoryRequestLocal category) {
|
||||||
this(category, m_name, NAME_FIELD);
|
this(category, m_name, NAME_FIELD);
|
||||||
}
|
}
|
||||||
|
|
||||||
NameUniqueListener(final CategoryRequestLocal category,
|
NameUniqueListener(final CategoryRequestLocal category,
|
||||||
Widget widget, int type) {
|
Widget widget, int type) {
|
||||||
m_category = category;
|
m_category = category;
|
||||||
|
|
@ -178,10 +178,10 @@ class BaseCategoryForm extends BaseForm {
|
||||||
if (compField.equalsIgnoreCase(title)
|
if (compField.equalsIgnoreCase(title)
|
||||||
&& (m_category == null
|
&& (m_category == null
|
||||||
|| !m_category.getCategory(state).equals(child))) {
|
|| !m_category.getCategory(state).equals(child))) {
|
||||||
throw new FormProcessException
|
throw new FormProcessException(lz("cms.ui.category.name_not_unique"));
|
||||||
(lz("cms.ui.category.name_not_unique"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,9 @@ import org.apache.log4j.Logger;
|
||||||
*/
|
*/
|
||||||
final class CategoryEditForm extends BaseCategoryForm {
|
final class CategoryEditForm extends BaseCategoryForm {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger
|
private static final Logger s_log = Logger.getLogger(CategoryEditForm.class);
|
||||||
(CategoryEditForm.class);
|
private static final String NO = "no";
|
||||||
|
private static final String YES = "yes";
|
||||||
private final CategoryRequestLocal m_category;
|
private final CategoryRequestLocal m_category;
|
||||||
|
|
||||||
public CategoryEditForm(final CategoryRequestLocal parent,
|
public CategoryEditForm(final CategoryRequestLocal parent,
|
||||||
|
|
@ -54,6 +54,8 @@ final class CategoryEditForm extends BaseCategoryForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
private class InitListener implements FormInitListener {
|
private class InitListener implements FormInitListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
public final void init(final FormSectionEvent e)
|
public final void init(final FormSectionEvent e)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
final PageState state = e.getPageState();
|
final PageState state = e.getPageState();
|
||||||
|
|
@ -70,20 +72,30 @@ final class CategoryEditForm extends BaseCategoryForm {
|
||||||
// items in this category. If the user says "yes" then the
|
// items in this category. If the user says "yes" then the
|
||||||
// category is not abstract
|
// category is not abstract
|
||||||
if (category.isAbstract()) {
|
if (category.isAbstract()) {
|
||||||
m_isAbstract.setValue(state, "no");
|
m_isAbstract.setValue(state, NO);
|
||||||
} else {
|
} else {
|
||||||
m_isAbstract.setValue(state, "yes");
|
m_isAbstract.setValue(state, YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (category.isEnabled("")) {
|
if (category.isVisible()) {
|
||||||
m_isEnabled.setValue(state, "yes");
|
m_isVisible.setValue(state, YES);
|
||||||
} else {
|
} else {
|
||||||
m_isEnabled.setValue(state, "no");
|
m_isVisible.setValue(state, NO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (category.isEnabled("")) {
|
||||||
|
m_isEnabled.setValue(state, YES);
|
||||||
|
} else {
|
||||||
|
m_isEnabled.setValue(state, NO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ProcessListener implements FormProcessListener {
|
private class ProcessListener implements FormProcessListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
public final void process(final FormSectionEvent e)
|
public final void process(final FormSectionEvent e)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
final PageState state = e.getPageState();
|
final PageState state = e.getPageState();
|
||||||
|
|
@ -93,20 +105,28 @@ final class CategoryEditForm extends BaseCategoryForm {
|
||||||
category.setName((String) m_name.getValue(state));
|
category.setName((String) m_name.getValue(state));
|
||||||
category.setDescription((String) m_description.getValue(state));
|
category.setDescription((String) m_description.getValue(state));
|
||||||
category.setURL((String) m_url.getValue(state));
|
category.setURL((String) m_url.getValue(state));
|
||||||
String isAbstract = (String)m_isAbstract.getValue(state);
|
|
||||||
|
final String isAbstract = (String) m_isAbstract.getValue(state);
|
||||||
// this seems anti-intuitive but the question is "can you place
|
// this seems anti-intuitive but the question is "can you place
|
||||||
// items in this category. If the user says "yes" then the
|
// items in this category. If the user says "yes" then the
|
||||||
// category is not abstract
|
// category is not abstract
|
||||||
if ("yes".equals(isAbstract)) {
|
if (YES.equals(isAbstract)) {
|
||||||
category.setAbstract(false);
|
category.setAbstract(false);
|
||||||
} else if ("no".equals(isAbstract)) {
|
} else if (NO.equals(isAbstract)) {
|
||||||
category.setAbstract(true);
|
category.setAbstract(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
String isEnabled = (String)m_isEnabled.getValue(state);
|
final String isVisible = (String) m_isVisible.getValue(state);
|
||||||
if ("yes".equals(isEnabled)) {
|
if (YES.equals(isVisible)) {
|
||||||
|
category.setVisible(true);
|
||||||
|
} else {
|
||||||
|
category.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
final String isEnabled = (String) m_isEnabled.getValue(state);
|
||||||
|
if (YES.equals(isEnabled)) {
|
||||||
category.setEnabled(true);
|
category.setEnabled(true);
|
||||||
} else if ("no".equals(isEnabled)) {
|
} else if (NO.equals(isEnabled)) {
|
||||||
category.setEnabled(false);
|
category.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -115,5 +135,6 @@ final class CategoryEditForm extends BaseCategoryForm {
|
||||||
throw new AccessDeniedException();
|
throw new AccessDeniedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,12 +106,14 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
if (!super.isVisible(state)) {
|
if (!super.isVisible(state)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
CategorizedCollection items = m_category.getCategory(state).getObjects(ContentItem.BASE_DATA_OBJECT_TYPE);
|
CategorizedCollection items = m_category.getCategory(state).
|
||||||
|
getObjects(ContentItem.BASE_DATA_OBJECT_TYPE);
|
||||||
items.addEqualsFilter(ContentItem.VERSION, ContentItem.LIVE);
|
items.addEqualsFilter(ContentItem.VERSION, ContentItem.LIVE);
|
||||||
boolean canOrder = items.size() > 1;
|
boolean canOrder = items.size() > 1;
|
||||||
items.close();
|
items.close();
|
||||||
return canOrder;
|
return canOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -155,6 +157,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CategoryLocalizationAddForm addCategoryLocalizationForm =
|
CategoryLocalizationAddForm addCategoryLocalizationForm =
|
||||||
|
|
@ -203,6 +206,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
public boolean hasPermission(PageState ps) {
|
public boolean hasPermission(PageState ps) {
|
||||||
return m_category.getCategory(ps).canEdit();
|
return m_category.getCategory(ps).canEdit();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class AdminVisible extends VisibilityComponent {
|
private class AdminVisible extends VisibilityComponent {
|
||||||
|
|
@ -215,6 +219,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
public boolean hasPermission(PageState ps) {
|
public boolean hasPermission(PageState ps) {
|
||||||
return m_category.getCategory(ps).canAdmin();
|
return m_category.getCategory(ps).canAdmin();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SummarySection extends Section {
|
private class SummarySection extends Section {
|
||||||
|
|
@ -298,6 +303,10 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
category.isAbstract()
|
category.isAbstract()
|
||||||
? gz("cms.ui.no")
|
? gz("cms.ui.no")
|
||||||
: gz("cms.ui.yes")));
|
: gz("cms.ui.yes")));
|
||||||
|
props.add(new Property(gz("cms.ui.cateogry.is_visible"),
|
||||||
|
category.isVisible()
|
||||||
|
? gz("cms.ui.yes")
|
||||||
|
: gz("cms.ui.no")));
|
||||||
props.add(new Property(gz("cms.ui.category.is_enabled"),
|
props.add(new Property(gz("cms.ui.category.is_enabled"),
|
||||||
category.isEnabled("")
|
category.isEnabled("")
|
||||||
? gz("cms.ui.yes")
|
? gz("cms.ui.yes")
|
||||||
|
|
@ -307,6 +316,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
|
|
||||||
return props;
|
return props;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -362,6 +372,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
super.register(page);
|
super.register(page);
|
||||||
page.addComponentStateParam(m_editCategoryLocalizationForm, m_catLocaleParam);
|
page.addComponentStateParam(m_editCategoryLocalizationForm, m_catLocaleParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SubcategorySection extends Section {
|
private class SubcategorySection extends Section {
|
||||||
|
|
@ -375,6 +386,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
group.setSubject(new SubcategoryList(m_category, m_model));
|
group.setSubject(new SubcategoryList(m_category, m_model));
|
||||||
group.addAction(new AdminVisible(addLink), ActionGroup.ADD);
|
group.addAction(new AdminVisible(addLink), ActionGroup.ADD);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class LinkedCategorySection extends Section {
|
private class LinkedCategorySection extends Section {
|
||||||
|
|
@ -393,6 +405,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
public final boolean isVisible(final PageState state) {
|
public final boolean isVisible(final PageState state) {
|
||||||
return !m_category.getCategory(state).isRoot();
|
return !m_category.getCategory(state).isRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class CategoryTemplateSection extends Section {
|
private class CategoryTemplateSection extends Section {
|
||||||
|
|
@ -407,6 +420,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
// XXX secvis
|
// XXX secvis
|
||||||
//group.addAction(link);
|
//group.addAction(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class PermissionsSection extends Section {
|
private class PermissionsSection extends Section {
|
||||||
|
|
@ -436,7 +450,8 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
privMap.put(Category.MAP_DESCRIPTOR.getName(), "Categorize Items");
|
privMap.put(Category.MAP_DESCRIPTOR.getName(), "Categorize Items");
|
||||||
privMap.put("admin", "Admin");
|
privMap.put("admin", "Admin");
|
||||||
|
|
||||||
final CMSPermissionsPane permPane = new CMSPermissionsPane(privs, privMap, new ACSObjectSelectionModel(m_model)) {
|
final CMSPermissionsPane permPane = new CMSPermissionsPane(privs, privMap, new ACSObjectSelectionModel(
|
||||||
|
m_model)) {
|
||||||
@Override
|
@Override
|
||||||
public void showAdmin(PageState ps) {
|
public void showAdmin(PageState ps) {
|
||||||
Assert.exists(m_model.getSelectedKey(ps));
|
Assert.exists(m_model.getSelectedKey(ps));
|
||||||
|
|
@ -444,6 +459,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
super.showAdmin(ps);
|
super.showAdmin(ps);
|
||||||
getAdminListingPanel().setVisible(ps, false);
|
getAdminListingPanel().setVisible(ps, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
final ActionLink restoreDefault = new ActionLink(new Label(gz(
|
final ActionLink restoreDefault = new ActionLink(new Label(gz(
|
||||||
|
|
@ -453,6 +469,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
Category cat = m_category.getCategory(ps);
|
Category cat = m_category.getCategory(ps);
|
||||||
return PermissionService.getContext(cat) == null;
|
return PermissionService.getContext(cat) == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
final ActionLink useCustom = new ActionLink(new Label(gz(
|
final ActionLink useCustom = new ActionLink(new Label(gz(
|
||||||
|
|
@ -462,6 +479,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
Category cat = m_category.getCategory(ps);
|
Category cat = m_category.getCategory(ps);
|
||||||
return PermissionService.getContext(cat) != null;
|
return PermissionService.getContext(cat) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ActionListener al = new ActionListener() {
|
ActionListener al = new ActionListener() {
|
||||||
|
|
@ -500,6 +518,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
}
|
}
|
||||||
permPane.reset(state);
|
permPane.reset(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
restoreDefault.addActionListener(al);
|
restoreDefault.addActionListener(al);
|
||||||
|
|
@ -516,8 +535,10 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
public void stateChanged(ChangeEvent e) {
|
public void stateChanged(ChangeEvent e) {
|
||||||
PageState ps = e.getPageState();
|
PageState ps = e.getPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class OrderItemsForm extends CMSForm {
|
private static class OrderItemsForm extends CMSForm {
|
||||||
|
|
@ -532,6 +553,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
add(new Submit("Done"));
|
add(new Submit("Done"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -571,6 +593,7 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private class EditItemLink extends Link {
|
private class EditItemLink extends Link {
|
||||||
|
|
@ -648,5 +671,6 @@ class CategoryItemPane extends BaseItemPane {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ object type Category extends ACSObject {
|
||||||
String[1..1] name = cat_categories.name VARCHAR(200);
|
String[1..1] name = cat_categories.name VARCHAR(200);
|
||||||
String[0..1] url = cat_categories.url VARCHAR(200);
|
String[0..1] url = cat_categories.url VARCHAR(200);
|
||||||
Boolean[1..1] isEnabled = cat_categories.enabled_p CHAR(1);
|
Boolean[1..1] isEnabled = cat_categories.enabled_p CHAR(1);
|
||||||
|
Boolean[1..1] isVisible = cat_categories.visible_p CHAR(1);
|
||||||
Boolean[1..1] isAbstract = cat_categories.abstract_p CHAR(1);
|
Boolean[1..1] isAbstract = cat_categories.abstract_p CHAR(1);
|
||||||
String[1..1] defaultAncestors = cat_categories.default_ancestors VARCHAR(3209);
|
String[1..1] defaultAncestors = cat_categories.default_ancestors VARCHAR(3209);
|
||||||
Boolean[1..1] ignoreParentIndexItem = cat_categories.ignore_parent_index_p CHAR(1);
|
Boolean[1..1] ignoreParentIndexItem = cat_categories.ignore_parent_index_p CHAR(1);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
--
|
||||||
|
-- Copyright (C) 2013 Jens Pelzetter. 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
|
||||||
|
--
|
||||||
|
-- $Id$
|
||||||
|
|
||||||
|
ALTER TABLE cat_categories ADD COLUMN visible_p CHAR(1);
|
||||||
|
UPDATE cat_categories SET visible_p = 1;
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
--
|
--
|
||||||
-- Copyright (C) 2013 Peter Boy. All Rights Reserved.
|
-- Copyright (C) 2013 Jens Pelzetter. All Rights Reserved.
|
||||||
--
|
--
|
||||||
-- This library is free software; you can redistribute it and/or
|
-- This library is free software; you can redistribute it and/or
|
||||||
-- modify it under the terms of the GNU Lesser General Public License
|
-- modify it under the terms of the GNU Lesser General Public License
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,6 @@
|
||||||
begin;
|
begin;
|
||||||
|
|
||||||
\i default/6.6.5-6.6.6/set_singleton.sql
|
\i default/6.6.5-6.6.6/set_singleton.sql
|
||||||
|
\i default/6.6.5-6.6.6/add_cat_visible.sql
|
||||||
|
|
||||||
commit;
|
commit;
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,7 @@ public class Category extends ACSObject {
|
||||||
* An attribute name for the underlying data object.
|
* An attribute name for the underlying data object.
|
||||||
*/
|
*/
|
||||||
public static final String IS_ENABLED = "isEnabled";
|
public static final String IS_ENABLED = "isEnabled";
|
||||||
|
public static final String IS_VISIBLE = "isVisible";
|
||||||
/**
|
/**
|
||||||
* An attribute name for the underlying data object.
|
* An attribute name for the underlying data object.
|
||||||
*/
|
*/
|
||||||
|
|
@ -213,6 +214,7 @@ public class Category extends ACSObject {
|
||||||
/**
|
/**
|
||||||
* Returns the model name of {@link #BASE_DATA_OBJECT_TYPE}.
|
* Returns the model name of {@link #BASE_DATA_OBJECT_TYPE}.
|
||||||
*
|
*
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String getBaseDataObjectPackage() {
|
public static String getBaseDataObjectPackage() {
|
||||||
return BASE_DATA_OBJECT_PACKAGE;
|
return BASE_DATA_OBJECT_PACKAGE;
|
||||||
|
|
@ -290,6 +292,8 @@ public class Category extends ACSObject {
|
||||||
* storage mechanism. This method is just a wrapper for the {@link
|
* storage mechanism. This method is just a wrapper for the {@link
|
||||||
* #Category(OID)} constructor.
|
* #Category(OID)} constructor.
|
||||||
*
|
*
|
||||||
|
* @param id
|
||||||
|
*
|
||||||
* @throws DataObjectNotFoundException
|
* @throws DataObjectNotFoundException
|
||||||
*/
|
*/
|
||||||
public Category(BigDecimal id) {
|
public Category(BigDecimal id) {
|
||||||
|
|
@ -389,6 +393,7 @@ public class Category extends ACSObject {
|
||||||
setName("name me");
|
setName("name me");
|
||||||
}
|
}
|
||||||
setEnabled(true);
|
setEnabled(true);
|
||||||
|
setVisible(true);
|
||||||
setAbstract(false);
|
setAbstract(false);
|
||||||
//by default do not ignore the parent index item
|
//by default do not ignore the parent index item
|
||||||
setIgnoreParentIndexItem(false);
|
setIgnoreParentIndexItem(false);
|
||||||
|
|
@ -807,6 +812,14 @@ public class Category extends ACSObject {
|
||||||
set(IS_ENABLED, isEnabled);
|
set(IS_ENABLED, isEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isVisible() {
|
||||||
|
return ((Boolean) get(IS_VISIBLE)).booleanValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVisible(final boolean visible) {
|
||||||
|
set(IS_VISIBLE, visible);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An abstract category cannot have any child objects, but it can have child
|
* An abstract category cannot have any child objects, but it can have child
|
||||||
* categories.
|
* categories.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue