Package org.jahia.ajax.gwt.client.data.toolbar

Examples of org.jahia.ajax.gwt.client.data.toolbar.GWTEditConfiguration


     *
     * @return
     * @throws GWTJahiaServiceException
     */
    public GWTEditConfiguration getEditConfiguration(String path, String name) throws GWTJahiaServiceException {
        GWTEditConfiguration config = null;
        try {
            JCRSessionWrapper session = retrieveCurrentSession();
            config = uiConfig.getGWTEditConfiguration(session.getNode(path), getSite(), getRemoteJahiaUser(), getLocale(), getUILocale(),
                    getRequest(), name);
            config.setSiteNode(navigation.getGWTJahiaNode(getSite(), GWTJahiaNode.DEFAULT_SITE_FIELDS));

            List<GWTJahiaNode> sites = getRoot(Arrays.asList(config.getSitesLocation()), Arrays.asList("jnt:virtualsite"), null, null, GWTJahiaNode.DEFAULT_SITE_FIELDS, null, null, false, false, null, null);
            String permission = name.equals("editmode") ? "editModeAccess" : "studioModeAccess";
            Map<String, GWTJahiaNode> sitesMap = new HashMap<String, GWTJahiaNode>();
            for (GWTJahiaNode site : sites) {
                if (session.getNodeByUUID(site.getUUID()).hasPermission(permission)) {
                    sitesMap.put(site.getSiteUUID(), site);
                }
            }
            config.setSitesMap(sitesMap);

            setAvailablePermissions(config);
        } catch (RepositoryException e) {
            logger.error("Cannot get node", e);
            throw new GWTJahiaServiceException(e.getMessage());
View Full Code Here

TOP

Related Classes of org.jahia.ajax.gwt.client.data.toolbar.GWTEditConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.