Examples of MetadataBean


Examples of org.apache.stratos.theme.mgt.stub.registry.resource.stub.beans.xsd.MetadataBean

            }

            request.setAttribute("path", path);
        }

        MetadataBean bean = null;
        try {
            bean = stub.getMetadata(path);
        } catch (Exception e) {
            String msg = "Failed to get resource metadata from the resource service. " +
                    e.getMessage();
View Full Code Here

Examples of org.apache.stratos.theme.mgt.stub.registry.resource.stub.beans.xsd.MetadataBean

            if (path == null) {
                path = RegistryConstants.ROOT_PATH;
            }
        }

        MetadataBean bean = null;
        try {
            bean = stub.getMetadata(path);
        } catch (Exception e) {
            String msg = "Failed to get resource metadata from the resource service. " +
                    e.getMessage();
View Full Code Here

Examples of org.wso2.carbon.registry.resource.beans.MetadataBean

    public static MetadataBean populate(String purePath, UserRegistry registry) throws Exception {

        ResourcePath path = new ResourcePath(purePath);
        Resource resource = registry.get(path.getPathWithVersion());
        MetadataBean bean = new MetadataBean();

        bean.setAuthor(resource.getAuthorUserName());
        bean.setCollection(resource instanceof Collection);
        bean.setDescription(resource.getDescription());
        bean.setLastUpdater(resource.getLastUpdaterUserName());
        bean.setMediaType(resource.getMediaType());
        bean.setPath(resource.getPath());

        bean.setFormattedCreatedOn(CommonUtil.formatDate(resource.getCreatedTime()));
        bean.setFormattedLastModified(CommonUtil.formatDate(resource.getLastModified()));

        bean.setActiveResourcePath(path.getPath());

        if (path.parameterExists("version")) {
            bean.setVersionView(true);
            bean.setPermalink(path.getCompletePath());
        } else {
            bean.setVersionView(false);
            bean.setPermalink(resource.getPermanentPath());
        }
        if ((resource.getProperty("registry.link") != null) || (resource.getProperty("registry.mount") != null)) {
            bean.setPermalink("hide");
         }

        bean.setNavigatablePaths(constructNavigatablePaths(path.getCompletePath()));
        bean.setContentPath(path.getCompletePath());
        bean.setServerBaseURL("carbon registry base URL.");

        String versionPath;
        if (path.parameterExists("version")) {
            versionPath = path.getPath() + RegistryConstants.URL_SEPARATOR + "version" +
                    RegistryConstants.URL_PARAMETER_SEPARATOR + path.getParameterValue("version");
        } else {
            versionPath = path.getPath();
        }
        bean.setPathWithVersion(versionPath);

        String userName = registry.getUserName();
        AuthorizationManager authorizer = registry.getUserRealm().getAuthorizationManager();
        boolean putAllowed = authorizer.
                isUserAuthorized(userName, path.getPath(), ActionConstants.PUT);
        bean.setPutAllowed(putAllowed);

        return bean;
    }
View Full Code Here

Examples of org.wso2.carbon.registry.resource.stub.beans.xsd.MetadataBean

            }

            request.setAttribute("path", path);
        }

        MetadataBean bean = null;
        try {
            bean = stub.getMetadata(path);
        } catch (Exception e) {
            String msg = "Failed to get resource metadata from the resource service. " +
                    e.getMessage();
View Full Code Here

Examples of org.wso2.carbon.registry.resource.stub.beans.xsd.MetadataBean

            if (path == null) {
                path = RegistryConstants.ROOT_PATH;
            }
        }

        MetadataBean bean = null;
        try {
            bean = stub.getMetadata(path);
        } catch (Exception e) {
            String msg = "Failed to get resource metadata from the resource service. " +
                    e.getMessage();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.