Uncomments most of the commented code.

Still needs some love to be perfect.

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4281 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
baka 2016-09-05 15:01:19 +00:00
parent aac3448eec
commit 7cb537b368
2 changed files with 26 additions and 24 deletions

View File

@ -46,8 +46,6 @@ import org.libreccm.security.Role;
import org.libreccm.security.RoleRepository; import org.libreccm.security.RoleRepository;
import org.librecms.contentsection.ContentSection; import org.librecms.contentsection.ContentSection;
import java.math.BigDecimal;
/** /**
* TODO Needs description * TODO Needs description
* *
@ -62,7 +60,7 @@ public class RoleAdminPane extends BaseAdminPane {
private static final CdiUtil cdiutil = CdiUtil.createCdiUtil(); private static final CdiUtil cdiutil = CdiUtil.createCdiUtil();
private final SingleSelectionModel m_model; private final SingleSelectionModel m_model;
//private final RoleRequestLocal m_role; private final RoleRequestLocal m_role;
private final List m_staff; private final List m_staff;
private final List m_viewers; private final List m_viewers;
@ -74,7 +72,7 @@ public class RoleAdminPane extends BaseAdminPane {
m_model.addChangeListener(new SelectionListener()); m_model.addChangeListener(new SelectionListener());
//m_role = new SelectionRequestLocal(); m_role = new SelectionRequestLocal();
m_staff = new List(new StaffListModelBuilder()); m_staff = new List(new StaffListModelBuilder());
m_staff.setSelectionModel(m_model); m_staff.setSelectionModel(m_model);
@ -91,12 +89,12 @@ public class RoleAdminPane extends BaseAdminPane {
final ViewerSection viewers = new ViewerSection(); final ViewerSection viewers = new ViewerSection();
left.add(viewers); left.add(viewers);
//setEdit(gz("cms.ui.role.edit"), new RoleEditForm(m_role, false)); setEdit(gz("cms.ui.role.edit"), new RoleEditForm(m_role, false));
//setDelete(gz("cms.ui.role.delete"), new DeleteForm()); setDelete(gz("cms.ui.role.delete"), new DeleteForm());
setIntroPane(new Label(gz("cms.ui.role.intro"))); setIntroPane(new Label(gz("cms.ui.role.intro")));
//setItemPane(new BaseRoleItemPane(m_model, m_role, setItemPane(new BaseRoleItemPane(m_model, m_role,
// getEditLink(), getDeleteLink())); getEditLink(), getDeleteLink()));
} }
private class StaffSection extends Section { private class StaffSection extends Section {
@ -111,12 +109,12 @@ public class RoleAdminPane extends BaseAdminPane {
final ActionLink link = new ActionLink final ActionLink link = new ActionLink
(new Label(gz("cms.ui.role.staff.add"))); (new Label(gz("cms.ui.role.staff.add")));
//group.addAction(new VisibilityComponent(link, STAFF_ADMIN), group.addAction(new VisibilityComponent(link, SecurityConstants.STAFF_ADMIN),
// ActionGroup.ADD); ActionGroup.ADD);
//final RoleAddForm form = new RoleAddForm(m_model, false); final RoleAddForm form = new RoleAddForm(m_model, false);
//getBody().add(form); getBody().add(form);
//getBody().connect(link, form); getBody().connect(link, form);
} }
} }
@ -132,12 +130,12 @@ public class RoleAdminPane extends BaseAdminPane {
final ActionLink link = new ActionLink final ActionLink link = new ActionLink
(new Label(gz("cms.ui.role.viewer.add"))); (new Label(gz("cms.ui.role.viewer.add")));
//group.addAction(new VisibilityComponent(link, STAFF_ADMIN), group.addAction(new VisibilityComponent(link, SecurityConstants.STAFF_ADMIN),
// ActionGroup.ADD); ActionGroup.ADD);
//final RoleAddForm form = new RoleAddForm(m_model, true); final RoleAddForm form = new RoleAddForm(m_model, true);
//getBody().add(form); getBody().add(form);
//getBody().connect(link, form); getBody().connect(link, form);
} }
} }
@ -158,15 +156,16 @@ public class RoleAdminPane extends BaseAdminPane {
} }
} }
} }
/*
private class SelectionRequestLocal extends RoleRequestLocal { private class SelectionRequestLocal extends RoleRequestLocal {
protected final Object initialValue(final PageState state) { protected final Object initialValue(final PageState state) {
final String id = m_model.getSelectedKey(state).toString(); final Long id = Long.parseLong(m_model.getSelectedKey(state).toString());
final RoleRepository roleRepository = cdiutil.findBean(RoleRepository.class);
return new Role(new BigDecimal(id)); return roleRepository.findById(id);
} }
} }
*/
private static class StaffListModelBuilder extends LockableImpl private static class StaffListModelBuilder extends LockableImpl
implements ListModelBuilder { implements ListModelBuilder {
public StaffListModelBuilder() { public StaffListModelBuilder() {
@ -179,7 +178,7 @@ public class RoleAdminPane extends BaseAdminPane {
CMS.getContext().getContentSection(); CMS.getContext().getContentSection();
//return new RoleListModel //return new RoleListModel
// (section.getStaffGroup().getOrderedRoles()); // (section.getStaffGroup().getOrderedRoles()); FIXME
return null; return null;
} }
} }
@ -192,7 +191,7 @@ public class RoleAdminPane extends BaseAdminPane {
CMS.getContext().getContentSection(); CMS.getContext().getContentSection();
//return new RoleListModel //return new RoleListModel
// (section.getViewersGroup().getOrderedRoles()); // (section.getViewersGroup().getOrderedRoles()); FIXME
return null; return null;
} }
} }

View File

@ -28,6 +28,9 @@ import org.apache.log4j.Logger;
import org.libreccm.security.Role; import org.libreccm.security.Role;
/** /**
* For more detailed information see {@link com.arsdigita.bebop.Form}.
*
* @author <a href="mailto:yannick.buelter@yabue.de">Yannick Bülter</a>
* @author Michael Pih * @author Michael Pih
* @author Justin Ross &lt;jross@redhat.com&gt; * @author Justin Ross &lt;jross@redhat.com&gt;
* @version $Id: RoleEditForm.java 287 2005-02-22 00:29:02Z sskracic $ * @version $Id: RoleEditForm.java 287 2005-02-22 00:29:02Z sskracic $