/** * Helper method to compute the uuid for views based on explorer types.<p> * * @param typeName the explorer type name * @return the element view id computed from the type name */ public static CmsUUID getExplorerTypeViewId(String typeName) { return CmsUUID.getConstantUUID("elementview-" + typeName); }
/** * Copy constructor.<p> * * @param role the role to copy */ private CmsRole(CmsRole role) { m_roleName = role.m_roleName; m_id = CmsUUID.getConstantUUID(m_roleName); m_groupName = role.m_groupName; m_parentRole = role.m_parentRole; m_systemRole = role.m_systemRole; m_ouDependent = role.m_ouDependent; m_children.addAll(role.m_children); m_distictGroupNames.addAll(Collections.unmodifiableList(role.m_distictGroupNames)); }
/** * Creates a system role.<p> * * @param roleName the name of this role * @param parentRole the parent role of this role * @param groupName the related group name */ private CmsRole(String roleName, CmsRole parentRole, String groupName) { m_roleName = roleName; m_id = CmsUUID.getConstantUUID(m_roleName); m_ouDependent = !groupName.startsWith(CmsOrganizationalUnit.SEPARATOR); m_parentRole = parentRole; m_systemRole = true; if (!m_ouDependent) { m_groupName = groupName.substring(1); } else { m_groupName = groupName; } if (parentRole != null) { parentRole.m_children.add(this); } }
/** * Creates a system role.<p> * * @param roleName the name of this role * @param parentRole the parent role of this role * @param groupName the related group name */ private CmsRole(String roleName, CmsRole parentRole, String groupName) { m_roleName = roleName; m_id = CmsUUID.getConstantUUID(m_roleName); m_ouDependent = !groupName.startsWith(CmsOrganizationalUnit.SEPARATOR); m_parentRole = parentRole; m_systemRole = true; if (!m_ouDependent) { m_groupName = groupName.substring(1); } else { m_groupName = groupName; } if (parentRole != null) { parentRole.m_children.add(this); } }
/** * Enumeration class for project types.<p> */ public static final class CmsProjectType extends A_CmsModeIntEnumeration { /** Project type normal. */ protected static final CmsProjectType MODE_PROJECT_NORMAL = new CmsProjectType(0); /** Project type temporary. */ protected static final CmsProjectType MODE_PROJECT_TEMPORARY = new CmsProjectType(1); /** Serializable version id. */ private static final long serialVersionUID = -8701314451776599534L; /** * Private constructor.<p> * * @param mode the copy mode integer representation */ private CmsProjectType(int mode) { super(mode); } /** * Returns the copy mode object from the old copy mode integer.<p> * * @param mode the old copy mode integer * * @return the copy mode object
/** * Returns the dummy resource object representing the "none" selection, this has to be treated specially.<p> * * @see org.opencms.workplace.list.A_CmsListResourceCollector#getResource(org.opencms.file.CmsObject, org.opencms.workplace.list.CmsListItem) */ @Override public CmsResource getResource(CmsObject cms, CmsListItem item) { // check if the item is the "dummy" item if (item.getId().equals(CmsUUID.getConstantUUID(CmsNewResourceXmlContent.VALUE_NONE + "s").getStringValue())) { for (CmsResource result : m_resources) { if (item.getId().equals(result.getStructureId().getStringValue())) { return result; } } } // all other items are real resources, use the default implementation return super.getResource(cms, item); }
/** * Enumeration class for project types.<p> */ public static final class CmsProjectType extends A_CmsModeIntEnumeration { /** Project type normal. */ protected static final CmsProjectType MODE_PROJECT_NORMAL = new CmsProjectType(0); /** Project type temporary. */ protected static final CmsProjectType MODE_PROJECT_TEMPORARY = new CmsProjectType(1); /** Project type 'workflow'. */ protected static final CmsProjectType MODE_PROJECT_WORKFLOW = new CmsProjectType(2); /** Serializable version id. */ private static final long serialVersionUID = -8701314451776599534L; /** * Private constructor.<p> * * @param mode the copy mode integer representation */ private CmsProjectType(int mode) { super(mode); } /** * Returns the copy mode object from the old copy mode integer.<p> *
CmsUUID structureId = CmsUUID.getConstantUUID("s-" + rootPath); CmsUUID resourceId = CmsUUID.getConstantUUID("r-" + rootPath); @SuppressWarnings("deprecation") int type = OpenCms.getResourceManager().getResourceType(CmsResourceTypeBinary.getStaticTypeName()).getTypeId();
CmsUUID structureId = CmsUUID.getConstantUUID("s-" + rootPath); CmsUUID resourceId = CmsUUID.getConstantUUID("r-" + rootPath); @SuppressWarnings("deprecation") int type = OpenCms.getResourceManager().getResourceType(CmsResourceTypeFolder.getStaticTypeName()).getTypeId();
String resPath = key(Messages.GUI_NEWRESOURCE_XMLCONTENT_NO_MODEL_0); CmsResource dummy = new CmsResource( CmsUUID.getConstantUUID(CmsNewResourceXmlContent.VALUE_NONE + "s"), CmsUUID.getConstantUUID(CmsNewResourceXmlContent.VALUE_NONE + "r"), resPath, dummyType,
String resPath = key(Messages.GUI_NEWRESOURCE_XMLCONTENT_NO_MODEL_0); CmsResource dummy = new CmsResource( CmsUUID.getConstantUUID(CmsNewResourceXmlContent.VALUE_NONE + "s"), CmsUUID.getConstantUUID(CmsNewResourceXmlContent.VALUE_NONE + "r"), resPath, dummyType,
createGroup(dbc, CmsUUID.getConstantUUID(groupName), groupName, "A system role group", flags, null); createGroup( dbc, CmsUUID.getConstantUUID(usersGroup), usersGroup, groupDescription, CmsUUID.getConstantUUID(guestGroup), guestGroup, CmsMacroResolver.localizedKeyMacro(Messages.GUI_DEFAULTGROUP_ROOT_GUESTS_DESCRIPTION_0, null), createGroup( dbc, CmsUUID.getConstantUUID(administratorsGroup), administratorsGroup, CmsMacroResolver.localizedKeyMacro(Messages.GUI_DEFAULTGROUP_ROOT_ADMINS_DESCRIPTION_0, null), CmsUUID.getConstantUUID(guestUser), guestUser, OpenCms.getPasswordHandler().digest((new CmsUUID()).toString()), CmsUUID.getConstantUUID(adminUser), adminUser, OpenCms.getPasswordHandler().digest("admin"), CmsUserSettings.ADDITIONAL_INFO_DESCRIPTION, (Object)CmsMacroResolver.localizedKeyMacro(Messages.GUI_DEFAULTUSER_ROOT_ADMIN_DESCRIPTION_0, null))); createUserInGroup(dbc, admin.getId(), CmsUUID.getConstantUUID(CmsRole.ROOT_ADMIN.getGroupName()));
int flags = I_CmsPrincipal.FLAG_ENABLED | I_CmsPrincipal.FLAG_GROUP_ROLE; if (!existsGroup(dbc, groupName)) { createGroup(dbc, CmsUUID.getConstantUUID(groupName), groupName, "A system role group", flags, null); createGroup( dbc, CmsUUID.getConstantUUID(usersGroup), usersGroup, groupDescription, CmsUUID.getConstantUUID(guestGroup), guestGroup, CmsMacroResolver.localizedKeyMacro(Messages.GUI_DEFAULTGROUP_ROOT_GUESTS_DESCRIPTION_0, null), createGroup( dbc, CmsUUID.getConstantUUID(administratorsGroup), administratorsGroup, CmsMacroResolver.localizedKeyMacro(Messages.GUI_DEFAULTGROUP_ROOT_ADMINS_DESCRIPTION_0, null), CmsUUID.getConstantUUID(guestUser), guestUser, OpenCms.getPasswordHandler().digest((new CmsUUID()).toString()), CmsUUID.getConstantUUID(adminUser), adminUser, OpenCms.getPasswordHandler().digest("admin"), CmsUserSettings.ADDITIONAL_INFO_DESCRIPTION,
createGroup(dbc, CmsUUID.getConstantUUID(groupName), groupName, "A system role group", flags, null); new String[] {ouDescription}) : CmsMacroResolver.localizedKeyMacro(Messages.GUI_DEFAULTGROUP_ROOT_USERS_DESCRIPTION_0, null)); createGroup(dbc, CmsUUID.getConstantUUID(usersGroup), usersGroup, groupDescription, I_CmsPrincipal.FLAG_ENABLED | I_CmsPrincipal.FLAG_GROUP_PROJECT_USER | CmsRole.WORKPLACE_USER.getVirtualGroupFlags(), parentGroup); CmsUUID.getConstantUUID(guestGroup), guestGroup, CmsMacroResolver.localizedKeyMacro(Messages.GUI_DEFAULTGROUP_ROOT_GUESTS_DESCRIPTION_0, null), createGroup( dbc, CmsUUID.getConstantUUID(administratorsGroup), administratorsGroup, CmsMacroResolver.localizedKeyMacro(Messages.GUI_DEFAULTGROUP_ROOT_ADMINS_DESCRIPTION_0, null), createGroup( dbc, CmsUUID.getConstantUUID(projectmanagersGroup), projectmanagersGroup, CmsMacroResolver.localizedKeyMacro(Messages.GUI_DEFAULTGROUP_ROOT_PROJMANS_DESCRIPTION_0, null), CmsUUID.getConstantUUID(guestUser), guestUser, OpenCms.getPasswordHandler().digest(""), CmsUUID.getConstantUUID(adminUser),
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#setColumns(org.opencms.workplace.list.CmsListMetadata) */ @Override protected void setColumns(CmsListMetadata metadata) { // create column for radio button CmsListColumnDefinition radioSelCol = new CmsListColumnDefinition(LIST_COLUMN_SELECT); radioSelCol.setName(Messages.get().container(Messages.GUI_EXPLORER_LIST_COLS_SELECT_0)); radioSelCol.setWidth("20"); radioSelCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER); radioSelCol.setSorteable(false); // add item selection action to column CmsListItemSelectionAction selAction = new CmsListItemSelectionAction(LIST_RACTION_SEL, null); selAction.setName(Messages.get().container(Messages.GUI_EXPLORER_LIST_COLS_SELECT_HELP_0)); selAction.setEnabled(true); selAction.setSelectedItemId(CmsUUID.getConstantUUID(CmsNewResourceXmlContent.VALUE_NONE + "s").toString()); radioSelCol.addDirectAction(selAction); // add the column at first position metadata.addColumn(radioSelCol); // add the other columns super.setColumns(metadata); }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#setColumns(org.opencms.workplace.list.CmsListMetadata) */ @Override protected void setColumns(CmsListMetadata metadata) { // create column for radio button CmsListColumnDefinition radioSelCol = new CmsListColumnDefinition(LIST_COLUMN_SELECT); radioSelCol.setName(Messages.get().container(Messages.GUI_EXPLORER_LIST_COLS_SELECT_0)); radioSelCol.setWidth("20"); radioSelCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER); radioSelCol.setSorteable(false); // add item selection action to column CmsListItemSelectionAction selAction = new CmsListItemSelectionAction(LIST_RACTION_SEL, null); selAction.setName(Messages.get().container(Messages.GUI_EXPLORER_LIST_COLS_SELECT_HELP_0)); selAction.setEnabled(true); selAction.setSelectedItemId(CmsUUID.getConstantUUID(CmsNewResourceXmlContent.VALUE_NONE + "s").toString()); radioSelCol.addDirectAction(selAction); // add the column at first position metadata.addColumn(radioSelCol); // add the other columns super.setColumns(metadata); }
CmsUUID.getConstantUUID(SETUP_PROJECT_NAME), admin, administrators,
CmsUUID.getConstantUUID(SETUP_PROJECT_NAME), admin, administrators,
CmsUUID.getConstantUUID(SETUP_PROJECT_NAME), admin, administrators,