Package org.wso2.carbon.registry.core.session

Examples of org.wso2.carbon.registry.core.session.UserRegistry


    public static void applyThemeForDomain(String themeName, UserRegistry systemTenantRegistry)
                throws RegistryException {
        String sourcePath = StratosConstants.ALL_THEMES_PATH + "/" + themeName; // tenant 0s path
        String targetPath = THEME_PATH;

        UserRegistry systemZeroRegistry = registryService.getGovernanceSystemRegistry();

        // if the themes doesn't exist we would exclude applying it
        if (!systemZeroRegistry.resourceExists(sourcePath)) {
            log.info("The theme source path: " + sourcePath + " doesn't exist.");
            return;
        }

        // first delete the old one, or we can backup it if required
        // we are anyway getting a backup of the logo
        Resource logoR = null;
        String logoPath = targetPath + "/admin/" + "logo.gif";
        if (systemTenantRegistry.resourceExists(targetPath)) {
            if (systemTenantRegistry.resourceExists(logoPath)) {
                logoR = systemTenantRegistry.get(logoPath);
            }
            if (logoR != null) {
                logoR.getContent(); // we will load the content as well.
            }
            systemTenantRegistry.delete(targetPath);
        }
        // get a dump of source
        Writer writer = new StringWriter();
        systemZeroRegistry.dump(sourcePath, writer);

        // put the dump to the target
        Reader reader = new StringReader(writer.toString());
        systemTenantRegistry.restore(targetPath, reader);
View Full Code Here


import java.util.ArrayList;
import java.util.Stack;

public class ThemeMgtService extends AbstractAdmin {
    public ResourceTreeEntryBean getResourceTreeEntry(String resourcePath) throws Exception {
        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
        return GetResourceTreeEntryUtil.getResourceTreeEntry(resourcePath, themeRegistry);
    }
View Full Code Here

        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
        return GetResourceTreeEntryUtil.getResourceTreeEntry(resourcePath, themeRegistry);
    }

    public ContentBean getContentBean(String path) throws Exception {
        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
        return ContentUtil.getContent(path, themeRegistry);
    }
View Full Code Here

        return ContentUtil.getContent(path, themeRegistry);
    }


    public CollectionContentBean getCollectionContent(String path) throws Exception {
        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
        return ContentUtil.getCollectionContent(path, themeRegistry);
    }
View Full Code Here

        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
        return ContentUtil.getCollectionContent(path, themeRegistry);
    }

    public ResourceData[] getResourceData(String[] paths) throws Exception {
        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
        return ContentUtil.getResourceData(paths, themeRegistry);
    }
View Full Code Here

    }
   
    public String addCollection(
            String parentPath, String collectionName, String mediaType, String description)
            throws Exception {
        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
        return AddCollectionUtil.process(parentPath, collectionName, mediaType, description, registry);
    }
View Full Code Here

    }

    public void addResource(String path, String mediaType, String description, DataHandler content,
                            String symlinkLocation, String tenantPass)
            throws Exception {
        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
        if (registry == null) {
            registry = ThemeUtil.getThemeRegistryFromTenantPass(tenantPass);
        }
        AddResourceUtil.addResource(path, mediaType, description, content, symlinkLocation, registry);
    }
View Full Code Here

            String description,
            String fetchURL,
            String symlinkLocation,
            String tenantPass) throws Exception {

        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
        if (registry == null) {
            registry = ThemeUtil.getThemeRegistryFromTenantPass(tenantPass);
        }
        ImportResourceUtil.importResource(parentPath, resourceName, mediaType, description, fetchURL,
                        symlinkLocation, registry);
View Full Code Here

            String parentPath,
            String fileName,
            String mediaType,
            String description,
            String content) throws Exception {
        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
        AddTextResourceUtil.addTextResource(parentPath, fileName, mediaType, description, content, registry);
    }
View Full Code Here

        AddTextResourceUtil.addTextResource(parentPath, fileName, mediaType, description, content, registry);
    }

    public MetadataBean getMetadata(String path) throws Exception {
        RegistryUtil.setSessionResourcePath(path);
        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
        return MetadataPopulator.populate(path, registry);
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.session.UserRegistry

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.