public Locale getLocaleByRequest( HttpServletRequest request, Locale defaultLocale) { RequestWrapper rw = new RequestWrapper(request, defaultLocale, storeKeyName); return rw.getLocale(); }
@Override public String get(Object markdown) { String str = ""; if (markdown instanceof JcrPropertyWrapper) { str = ((JcrPropertyWrapper)markdown).toString(); } else if (markdown instanceof JcrValueWrapper) { str = ((JcrValueWrapper)markdown).toString(); } else if (markdown instanceof String) { str = (String)markdown; } else str = markdown.toString(); return service.markdownToHtml(str); } }
public JcrNodeWrapper getActivationFields(Session session, String activationCode) throws RepositoryException { try { if (!session.getRootNode().hasNode(activationPath)) return null; if (!session.getRootNode().getNode(activationPath).hasNode(activationCode)) return null; return new JcrNodeWrapper(session.getRootNode().getNode(activationPath).getNode(activationCode)); } catch (RepositoryException e) { throw e; } finally { } }
for (Object key : properties.keySet()) { if (properties.get(key) != null) { GenericValue val = GenericValue.getGenericValueFromObject(properties.get(key)); if (val.isMultiValue()) { group.setProperty((String) key, val.getValues()); } else { group.setProperty((String) key, val.get());
protected RequestWrapper getRequest() { return new RequestWrapper(this.getThreadLocalRequest(), null); }
/** {@inheritDoc} */ @Override public void changePasswordByName(Session session, String userName, String password) throws UserNotExistsException, PrincipalIsNotUserException, InternalException { try { UserManager userManager = AccessControlUtil.getUserManager(session); Authorizable authorizable = userManager.getAuthorizable(userName); if (authorizable == null) { throw new UserNotExistsException( "User does not exist: " + userName); } if (authorizable.isGroup()) { throw new PrincipalIsNotUserException("Principal is not user: " + userName); } User user = (User) authorizable; user.changePassword(password); user.setProperty("jcr:Password", GenericValue.getGenericValueFromObject(password).get()); } catch (RepositoryException e) { throw new InternalException("Repository exception", e); } finally { } }
JcrNodeTransformer.transformMapToNode(activationNode, fields, null); } catch (InstantiationException e) { log.error("Error converting map to node", e);
/** {@inheritDoc} */ @Override public Map<String, GenericValue> getPrincipalPropertiesByName(Session session, String principal) throws PrincipalNotExistsException, InternalException { Map<String, GenericValue> ret = new HashMap<String, GenericValue>(); try { UserManager userManager = AccessControlUtil.getUserManager(session); Authorizable authorizable = userManager.getAuthorizable(principal); if (authorizable == null) { throw new PrincipalNotExistsException("Principal does not exist: " + principal); } Iterator<String> iter = authorizable.getPropertyNames(); while (iter.hasNext()) { String key = iter.next(); GenericValue value = GenericValue.getGenericValueFromObject(authorizable.getProperty(key)); ret.put(key, value); } } catch (RepositoryException e) { throw new InternalException("Repository exception", e); } finally { } return ret; }
public Locale getLocaleByRequest( HttpServletRequest request) { RequestWrapper rw = new RequestWrapper(request, configurator.getDefaultLocale(), storeKeyName); return rw.getLocale(); }
GenericValue val = GenericValue.getGenericValueFromObject(properties.get(key)); if (val.isMultiValue()) { user.setProperty((String) key, val.getValues()); } else { user.setProperty((String) key, val.get());
protected RequestWrapper getRequest() { return new RequestWrapper(this.getThreadLocalRequest(), null); }
protected Locale getLocale() { if (getThreadLocalRequest().getAttribute("locale") == null) { RequestWrapper rw = new RequestWrapper(getThreadLocalRequest(), config.getDefaultLocale()); getThreadLocalRequest().setAttribute("locale", rw.getLocale()); return rw.getLocale(); } else { return getThreadLocalRequest().getLocale(); } }
protected Locale getLocale() { if (getThreadLocalRequest().getAttribute("locale") == null) { RequestWrapper rw = new RequestWrapper(getThreadLocalRequest(), config.getDefaultLocale()); getThreadLocalRequest().setAttribute("locale", rw.getLocale()); return rw.getLocale(); } else { return getThreadLocalRequest().getLocale(); } }