/** * @see org.opencms.workplace.tools.accounts.A_CmsUserGroupsList#setIndependentActions(org.opencms.workplace.list.CmsListMetadata) */ @Override protected void setIndependentActions(CmsListMetadata metadata) { super.setIndependentActions(metadata); metadata.getItemDetailDefinition(LIST_DETAIL_OTHEROU).setVisible(false); }
/** * @see org.opencms.workplace.tools.accounts.A_CmsRoleUsersList#setIndependentActions(org.opencms.workplace.list.CmsListMetadata) */ @Override protected void setIndependentActions(CmsListMetadata metadata) { super.setIndependentActions(metadata); metadata.getItemDetailDefinition(LIST_DETAIL_ORGUNIT).setVisible(false); }
/** * @see org.opencms.workplace.tools.accounts.A_CmsGroupUsersList#setIndependentActions(org.opencms.workplace.list.CmsListMetadata) */ @Override protected void setIndependentActions(CmsListMetadata metadata) { super.setIndependentActions(metadata); metadata.getItemDetailDefinition(LIST_DETAIL_OTHEROU).setVisible(false); }
/** * Checks whether users of other OUs should be shown.<p> * * @return true if users of other OUs should be shown */ protected boolean hasOuDetail() { CmsListMetadata meta = getList().getMetadata(); CmsListItemDetails detail = meta.getItemDetailDefinition(LIST_DETAIL_OTHEROU); return (detail != null) && detail.isVisible(); }
/** * Checks if the image size should be shown or not.<p> * * @return <code>true</code> if the image size should be shown */ public boolean showSize() { CmsListItemDetails details = getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_SIZE); return (details != null) && details.isVisible(); }
/** * Checks if other OUs are visible.<p> * * @return true if other OUs are visible */ protected boolean otherOrgUnitsVisible() { return getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_ORGUNIT).isVisible(); }
/** * Returns the value of the column for this item.<p> * * @param columnId the column id * * @return the content, may be <code>null</code> * * @throws CmsIllegalArgumentException if the given <code>columnId</code> is invalid */ public Object get(String columnId) throws CmsIllegalArgumentException { if ((getMetadata().getColumnDefinition(columnId) == null) && (getMetadata().getItemDetailDefinition(columnId) == null)) { throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_LIST_INVALID_COLUMN_1, columnId)); } return m_values.get(columnId); }
/** * Sets the object to display at the given column.<p> * * @param columnId the column id * @param value the value to display * * @return the previous value, or <code>null</code> if not set * @throws CmsIllegalArgumentException if the given <code>columnId</code> is invalid * */ public Object set(String columnId, Object value) throws CmsIllegalArgumentException { if ((getMetadata().getColumnDefinition(columnId) == null) && (getMetadata().getItemDetailDefinition(columnId) == null)) { throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_LIST_INVALID_COLUMN_1, columnId)); } return m_values.put(columnId, value); }
/** * Returns the value of the column for this item.<p> * * @param columnId the column id * * @return the content, may be <code>null</code> * * @throws CmsIllegalArgumentException if the given <code>columnId</code> is invalid */ public Object get(String columnId) throws CmsIllegalArgumentException { if ((getMetadata().getColumnDefinition(columnId) == null) && (getMetadata().getItemDetailDefinition(columnId) == null)) { throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_LIST_INVALID_COLUMN_1, columnId)); } return m_values.get(columnId); }
/** * Sets the object to display at the given column.<p> * * @param columnId the column id * @param value the value to display * * @return the previous value, or <code>null</code> if not set * @throws CmsIllegalArgumentException if the given <code>columnId</code> is invalid * */ public Object set(String columnId, Object value) throws CmsIllegalArgumentException { if ((getMetadata().getColumnDefinition(columnId) == null) && (getMetadata().getItemDetailDefinition(columnId) == null)) { throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_LIST_INVALID_COLUMN_1, columnId)); } return m_values.put(columnId, value); }
/** * Lazy details initialization.<p> * * @param detailId the id of the detail column */ protected void initializeDetail(String detailId) { // if detail column visible or printable CmsListItemDetails details = getList().getMetadata().getItemDetailDefinition(detailId); if (details.isVisible() || details.isPrintable()) { // if the list is not empty if (getList().getTotalSize() > 0) { // if the detail column has not been previously initialized if (getList().getAllContent().get(0).get(detailId) == null) { if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_START_DETAILS_LIST_2, getListId(), detailId)); } fillDetails(detailId); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_END_DETAILS_LIST_2, getListId(), detailId)); } } } } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#getListItems() */ @Override protected List<CmsListItem> getListItems() throws CmsException { CmsListItemDetails details = getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_OTHEROU); boolean withOtherOus = hasGroupsInOtherOus() && (details != null) && details.isVisible(); List<CmsListItem> ret = new ArrayList<CmsListItem>(); // get content List<CmsGroup> groups = getGroups(withOtherOus); Iterator<CmsGroup> itGroups = groups.iterator(); while (itGroups.hasNext()) { CmsGroup group = itGroups.next(); CmsListItem item = getList().newItem(group.getId().toString()); item.set(LIST_COLUMN_NAME, group.getName()); item.set(LIST_COLUMN_DISPLAY, OpenCms.getWorkplaceManager().translateGroupName(group.getName(), false)); item.set(LIST_COLUMN_DESCRIPTION, group.getDescription(getLocale())); item.set(LIST_COLUMN_ORGUNIT, CmsOrganizationalUnit.SEPARATOR + group.getOuFqn()); ret.add(item); } return ret; }
/** * Public constructor with JSP action element.<p> * * @param jsp an initialized JSP action element * @param lockedResources the list of locked resources (as root paths) * @param relativeTo the current folder * @param lockParams the parameter map for creating the ajax request in the independent action */ public CmsLockedResourcesList(CmsJspActionElement jsp, List lockedResources, String relativeTo, Map lockParams) { super(jsp, LIST_ID, Messages.get().container(Messages.GUI_LOCKED_FILES_LIST_NAME_0)); m_collector = new CmsLockedResourcesCollector(this, lockedResources); // prevent paging getList().setMaxItemsPerPage(Integer.MAX_VALUE); // set the right resource util parameters CmsResourceUtil resUtil = getResourceUtil(); resUtil.setAbbrevLength(50); resUtil.setRelativeTo(getCms().getRequestContext().addSiteRoot(relativeTo)); m_lockParams = lockParams; getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_OWN_LOCKS).setVisible( Boolean.valueOf((String)getLockParams().get(CmsLock.PARAM_SHOWOWNLOCKS)).booleanValue()); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#initializeDetail(java.lang.String) */ @Override protected void initializeDetail(String detailId) { super.initializeDetail(detailId); if (detailId.equals(LIST_DETAIL_OTHEROU)) { boolean visible = hasGroupsInOtherOus() && getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_OTHEROU).isVisible(); getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setVisible(visible); getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setPrintable(visible); } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#initializeDetail(java.lang.String) */ @Override protected void initializeDetail(String detailId) { super.initializeDetail(detailId); if (detailId.equals(LIST_DETAIL_OTHEROU)) { boolean visible = hasUsersInOtherOus() && getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_OTHEROU).isVisible(); getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setVisible(visible); getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setPrintable(visible); } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#initializeDetail(java.lang.String) */ @Override protected void initializeDetail(String detailId) { super.initializeDetail(detailId); if (detailId.equals(LIST_DETAIL_ORGUNIT)) { boolean visible = hasUsersInOtherOus() && getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_ORGUNIT).isVisible(); getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setVisible(visible); getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setPrintable(visible); } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#initializeDetail(java.lang.String) */ @Override protected void initializeDetail(String detailId) { super.initializeDetail(detailId); if (detailId.equals(LIST_DETAIL_OTHEROU)) { boolean visible = hasPrincipalsInOtherOus() && getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_OTHEROU).isVisible(); getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setVisible(visible); getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setPrintable(visible); } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#initializeDetail(java.lang.String) */ @Override protected void initializeDetail(String detailId) { super.initializeDetail(detailId); if (detailId.equals(LIST_DETAIL_OTHEROU)) { boolean visible = hasPrincipalsInOtherOus() && getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_OTHEROU).isVisible(); getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setVisible(visible); getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setPrintable(visible); } }
/** * This method should handle the default list independent actions, * by comparing <code>{@link #getParamListAction()}</code> with the id * of the action to execute.<p> * * if you want to handle additional independent actions, override this method, * handling your actions and FINALLY calling <code>super.executeListIndepActions();</code>.<p> */ public void executeListIndepActions() { if (getList().getMetadata().getItemDetailDefinition(getParamListAction()) != null) { // toggle item details getList().getMetadata().toogleDetailState(getParamListAction()); // lazy initialization initializeDetail(getParamListAction()); } listSave(); }
/** * This method should handle the default list independent actions, * by comparing <code>{@link #getParamListAction()}</code> with the id * of the action to execute.<p> * * if you want to handle additional independent actions, override this method, * handling your actions and FINALLY calling <code>super.executeListIndepActions();</code>.<p> */ public void executeListIndepActions() { if (getList().getMetadata().getItemDetailDefinition(getParamListAction()) != null) { // toggle item details getList().getMetadata().toogleDetailState(getParamListAction()); // lazy initialization initializeDetail(getParamListAction()); } listSave(); }