/** * Sets the user Name.<p> * * @param userName the name to set */ public void setUserName(String userName) { m_userName = OpenCms.getImportExportManager().translateUser(userName); }
/** * Sets the user Name.<p> * * @param userName the name to set */ public void setUserName(String userName) { m_userName = OpenCms.getImportExportManager().translateUser(userName); }
/** * Sets the user Name.<p> * * @param userName the name to set */ public void setUserName(String userName) { m_userName = OpenCms.getImportExportManager().translateUser(userName); }
/** * Changes the access control for a given resource and a given principal(user/group). * * @param resourceName name of the resource * @param principalType the type of the principal (group or user) * @param principalName name of the principal * @param permissionString the permissions in the format ((+|-)(r|w|v|c|i))* * @throws CmsException if something goes wrong * @see CmsObject#chacc(String, String, String, String) */ public void chacc(String resourceName, String principalType, String principalName, String permissionString) throws CmsException { m_cms.lockResource(resourceName); if (I_CmsPrincipal.PRINCIPAL_GROUP.equalsIgnoreCase(principalType.trim())) { principalName = OpenCms.getImportExportManager().translateGroup(principalName); } else { principalName = OpenCms.getImportExportManager().translateUser(principalName); } m_cms.chacc(resourceName, principalType, principalName, permissionString); }
/** * Changes the access control for a given resource and a given principal(user/group). * * @param resourceName name of the resource * @param principalType the type of the principal (group or user) * @param principalName name of the principal * @param permissionString the permissions in the format ((+|-)(r|w|v|c|i))* * @throws CmsException if something goes wrong * @see CmsObject#chacc(String, String, String, String) */ public void chacc(String resourceName, String principalType, String principalName, String permissionString) throws CmsException { m_cms.lockResource(resourceName); if (I_CmsPrincipal.PRINCIPAL_GROUP.equalsIgnoreCase(principalType.trim())) { principalName = OpenCms.getImportExportManager().translateGroup(principalName); } else { principalName = OpenCms.getImportExportManager().translateUser(principalName); } m_cms.chacc(resourceName, principalType, principalName, permissionString); }
name = OpenCms.getImportExportManager().translateUser(name);
name = OpenCms.getImportExportManager().translateUser(name);
principal = OpenCms.getImportExportManager().translateUser(principal); try { principalId = cms.readUser(principal).getId();
principalId = getCms().readGroup(principal).getId(); } else if (acePrincipalId.startsWith(I_CmsPrincipal.PRINCIPAL_USER)) { principal = OpenCms.getImportExportManager().translateUser(principal); principalId = getCms().readUser(principal).getId(); } else if (acePrincipalId.startsWith(CmsRole.PRINCIPAL_ROLE)) {
principal = OpenCms.getImportExportManager().translateUser(principal); try { principalId = cms.readUser(principal).getId();
principalId = getCms().readGroup(principal).getId(); } else if (acePrincipalId.startsWith(I_CmsPrincipal.PRINCIPAL_USER)) { principal = OpenCms.getImportExportManager().translateUser(principal); principalId = getCms().readUser(principal).getId(); } else if (acePrincipalId.startsWith(CmsRole.PRINCIPAL_ROLE)) {
principalId = getCms().readGroup(principal).getId(); } else if (acePrincipalId.startsWith(I_CmsPrincipal.PRINCIPAL_USER)) { principal = OpenCms.getImportExportManager().translateUser(principal); principalId = getCms().readUser(principal).getId(); } else if (acePrincipalId.startsWith(CmsRole.PRINCIPAL_ROLE)) {
/** * Log a user in to the the CmsSell.<p> * * @param username the name of the user to log in * @param password the password of the user */ public void login(String username, String password) { username = OpenCms.getImportExportManager().translateUser(username); try { m_cms.loginUser(username, password); // reset the settings, this will switch the startup site root etc. m_shell.initSettings(); System.out.println(getMessages().key(Messages.GUI_SHELL_LOGIN_1, whoami().getName())); // output the login message if required CmsLoginMessage message = OpenCms.getLoginManager().getLoginMessage(); if ((message != null) && (message.isActive())) { System.out.println(message.getMessage()); } } catch (Exception exc) { System.out.println(getMessages().key(Messages.GUI_SHELL_LOGIN_FAILED_0)); } }
/** * Log a user in to the the CmsSell.<p> * * @param username the name of the user to log in * @param password the password of the user */ public void login(String username, String password) { username = OpenCms.getImportExportManager().translateUser(username); try { m_cms.loginUser(username, password); // reset the settings, this will switch the startup site root etc. m_shell.initSettings(); m_shell.getOut().println(getMessages().key(Messages.GUI_SHELL_LOGIN_1, whoami().getName())); // output the login message if required CmsLoginMessage message = OpenCms.getLoginManager().getLoginMessage(); if ((message != null) && (message.isActive())) { m_shell.getOut().println(message.getMessage()); } } catch (Exception exc) { m_shell.getOut().println(getMessages().key(Messages.GUI_SHELL_LOGIN_FAILED_0)); } }
/** * Sets the userLastModified.<p> * * @param userLastModified the userLastModified to set * * @see #N_USERLASTMODIFIED * @see #addResourceAttributesRules(Digester, String) */ public void setUserLastModified(String userLastModified) { try { String userLastModifiedName = OpenCms.getImportExportManager().translateUser(userLastModified); try { m_userLastModified = getCms().readUser(userLastModifiedName).getId(); } catch (CmsDbEntryNotFoundException e) { m_userLastModified = getCms().getRequestContext().currentUser().getId(); } } catch (Throwable e) { setThrowable(e); } }
/** * Sets the userCreated.<p> * * @param userCreated the userCreated to set * * @see #N_USERCREATED * @see #addResourceAttributesRules(Digester, String) */ public void setUserCreated(String userCreated) { try { String userCreatedName = OpenCms.getImportExportManager().translateUser(userCreated); try { m_userCreated = getCms().readUser(userCreatedName).getId(); } catch (CmsDbEntryNotFoundException e) { m_userCreated = getCms().getRequestContext().getCurrentUser().getId(); } } catch (Throwable e) { setThrowable(e); } }
/** * Sets the userCreated.<p> * * @param userCreated the userCreated to set * * @see #N_USERCREATED * @see #addResourceAttributesRules(Digester, String) */ public void setUserCreated(String userCreated) { try { String userCreatedName = OpenCms.getImportExportManager().translateUser(userCreated); try { m_userCreated = getCms().readUser(userCreatedName).getId(); } catch (CmsDbEntryNotFoundException e) { m_userCreated = getCms().getRequestContext().currentUser().getId(); } } catch (Throwable e) { setThrowable(e); } }
/** * Sets the userLastModified.<p> * * @param userLastModified the userLastModified to set * * @see #N_USERLASTMODIFIED * @see #addResourceAttributesRules(Digester, String) */ public void setUserLastModified(String userLastModified) { try { String userLastModifiedName = OpenCms.getImportExportManager().translateUser(userLastModified); try { m_userLastModified = getCms().readUser(userLastModifiedName).getId(); } catch (CmsDbEntryNotFoundException e) { m_userLastModified = getCms().getRequestContext().getCurrentUser().getId(); } } catch (Throwable e) { setThrowable(e); } }
/** * Sets the userCreated.<p> * * @param userCreated the userCreated to set * * @see #N_USERCREATED * @see #addResourceAttributesRules(Digester, String) */ public void setUserCreated(String userCreated) { try { String userCreatedName = OpenCms.getImportExportManager().translateUser(userCreated); try { m_userCreated = getCms().readUser(userCreatedName).getId(); } catch (@SuppressWarnings("unused") CmsDbEntryNotFoundException e) { m_userCreated = getCms().getRequestContext().getCurrentUser().getId(); } } catch (Throwable e) { setThrowable(e); } }
/** * Sets the userLastModified.<p> * * @param userLastModified the userLastModified to set * * @see #N_USERLASTMODIFIED * @see #addResourceAttributesRules(Digester, String) */ public void setUserLastModified(String userLastModified) { if (null == userLastModified) { // The optional user last modified information is not provided m_userLastModified = m_cms.getRequestContext().getCurrentUser().getId(); } else { // use the user last modified information from the manifest try { String userLastModifiedName = OpenCms.getImportExportManager().translateUser(userLastModified); try { m_userLastModified = getCms().readUser(userLastModifiedName).getId(); } catch (@SuppressWarnings("unused") CmsDbEntryNotFoundException e) { m_userLastModified = getCms().getRequestContext().getCurrentUser().getId(); } } catch (Throwable e) { setThrowable(e); } } }