Refactoring of already working files.
Also adds new comments git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4509 8810af33-2d31-482b-a856-94f89814c4dfccm-docs
parent
8d495f0c07
commit
a96c61564e
|
|
@ -88,10 +88,12 @@ class AddUseContextForm extends BaseForm {
|
|||
ParameterData data = e.getParameterData();
|
||||
|
||||
final String name = (String) m_useContext.getValue(e.getPageState());
|
||||
if (true) {//Category.getRootForObject(CMS.getContext().getContentSection(),
|
||||
|
||||
// XXX Do a dupe check ala commented code below
|
||||
//if (true) {//Category.getRootForObject(CMS.getContext().getContentSection(),
|
||||
//name) != null) {
|
||||
data.addError(getError());
|
||||
}
|
||||
// data.addError(getError());
|
||||
//}
|
||||
}
|
||||
}
|
||||
private class ProcessListener implements FormProcessListener {
|
||||
|
|
@ -117,7 +119,7 @@ class AddUseContextForm extends BaseForm {
|
|||
final ContentSection section =
|
||||
CMS.getContext().getContentSection();
|
||||
|
||||
/*
|
||||
/* TODO Maybe trash
|
||||
Category.setRootForObject(section, root, useContext);
|
||||
PermissionService.setContext(root, section);
|
||||
Category defaultRoot = Category.getRootForObject(section);
|
||||
|
|
@ -131,9 +133,11 @@ class AddUseContextForm extends BaseForm {
|
|||
}
|
||||
|
||||
}*/
|
||||
// m_model.setSelectedKey(state, useContext == null ?
|
||||
// CategoryUseContextModelBuilder.DEFAULT_USE_CONTEXT :
|
||||
// useContext);
|
||||
|
||||
//TODO Uncomment when CategoryUseContextModelBuilder works
|
||||
//m_model.setSelectedKey(state, useContext == null ?
|
||||
// CategoryUseContextModelBuilder.DEFAULT_USE_CONTEXT :
|
||||
// useContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ import com.arsdigita.toolbox.ui.ComponentAccess;
|
|||
|
||||
public class CategoryComponentAccess extends ComponentAccess {
|
||||
// XXX implement me!
|
||||
// TODO This seems pretty useless...
|
||||
// FIXME
|
||||
|
||||
public CategoryComponentAccess(Component c,
|
||||
CategoryRequestLocal category) {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ import com.arsdigita.bebop.util.GlobalizationUtil;
|
|||
import com.arsdigita.util.LockableImpl;
|
||||
import org.libreccm.categorization.Category;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* A List of all secondary parents of the current category.
|
||||
*
|
||||
|
|
@ -75,7 +78,8 @@ public class CategoryLinks extends List {
|
|||
setEmptyView(label);
|
||||
}
|
||||
|
||||
/* TODO There is only one parent
|
||||
// Since this part is for non default parents, but the is only one... this is not needed anymore, i guess
|
||||
/*
|
||||
private class LinkedCategoryModelBuilder extends LockableImpl
|
||||
implements ListModelBuilder {
|
||||
public ListModel makeModel(List list, PageState state) {
|
||||
|
|
@ -83,8 +87,11 @@ public class CategoryLinks extends List {
|
|||
|
||||
if (category != null && category.getParent().isPresent()) {
|
||||
|
||||
Collection<Category> categories = new HashSet<>();
|
||||
categories.add(category.getParentCategory());
|
||||
|
||||
return new CategoryCollectionListModel
|
||||
(category.getParents(),
|
||||
(categories,
|
||||
parent == null ? null : parent.getID());
|
||||
} else {
|
||||
return List.EMPTY_MODEL;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import java.util.Collection;
|
|||
/**
|
||||
* A List of all subcategories of the current category.
|
||||
*
|
||||
* @author <a href="mailto:yannick.buelter@yabue.de">Yannick Bülter</a>
|
||||
* @author Stanislav Freidin (stas@arsdigita.com)
|
||||
* @author Michael Pih (pihman@arsdigita.com)
|
||||
* @version $Revision: #15 $ $DateTime: 2004/08/17 23:15:09 $
|
||||
|
|
@ -80,7 +81,7 @@ public class SubcategoryList extends SortableCategoryList {
|
|||
|
||||
if (category != null && !category.getSubCategories().isEmpty()) {
|
||||
Collection<Category> children = category.getSubCategories();
|
||||
//String order = ContentSection.getConfig().getCategoryTreeOrder(); TODO Sorting?
|
||||
//String order = ContentSection.getConfig().getCategoryTreeOrder(); FIXME Collections are not sorted
|
||||
//order = Category.SORT_KEY.equals(order) ? "link." + order : order;
|
||||
//children.addOrder(order);
|
||||
// children.addOrder("link." + Category.SORT_KEY);
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@ import org.librecms.CmsConstants;
|
|||
import org.librecms.contentsection.privileges.AdminPrivileges;
|
||||
|
||||
/**
|
||||
* <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
* @author Uday Mathur
|
||||
* @author Michael Pih
|
||||
* @author <a href="mailto:jross@redhat.com">Justin Ross</a>
|
||||
|
|
|
|||
Loading…
Reference in New Issue