Examples of ContentBean


Examples of com.jada.content.ContentBean

    }

    public void attachHibernateSession(HttpServletRequest request) throws Exception {
        EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
        synchronized (this) {
          ContentBean contentBean = ContentLookupDispatchAction.getContentBean(request);
        if (customer != null) {
          customer = (Customer) em.find(Customer.class, customer.getCustId());
          customerClass = customer.getCustomerClass();
        }
        if (customerCreditCard != null) {
View Full Code Here

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

    }

     public ContentBean getContent(HttpServletRequest request) throws Exception {

        String path = RegistryUtil.getPath(request);
        ContentBean bean = null;
        try {
            bean = stub.getContentBean(path);
        } catch (Exception e) {
            String msg = "Failed to get content from the resource service. " +
                    e.getMessage();
View Full Code Here

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

    }

    public static ContentBean getContent(String path, UserRegistry registry) throws Exception {

        ResourcePath resourcePath = new ResourcePath(path);
        ContentBean bean = new ContentBean();

        Resource resource = registry.get(path);
        bean.setMediaType(resource.getMediaType());
        bean.setCollection(resource instanceof Collection);
        bean.setLoggedIn(!RegistryConstants.ANONYMOUS_USER.equals(registry.getUserName()));
        bean.setPathWithVersion(resourcePath.getPathWithVersion());
        bean.setAbsent(resource.getProperty("registry.absent"));
        List mountPoints = resource.getPropertyValues("registry.mountpoint");
        List targetPoints = resource.getPropertyValues("registry.targetpoint");
//        List paths = resource.getPropertyValues("registry.path");
        List actualPaths = resource.getPropertyValues("registry.actualpath");
        String user = resource.getProperty("registry.user");

        if (resource.getProperty("registry.link") != null) {

            if (mountPoints != null && targetPoints != null) {
//                String mountPoint = (String)mountPoints.get(0);
//                String targetPoint = (String)targetPoints.get(0);
//                String tempPath;
//                if (targetPoint.equals(RegistryConstants.PATH_SEPARATOR) && !childPath.equals(mountPoint)) {
//                    tempPath = ((String)paths.get(0)).substring(mountPoint.length());
//                } else {
//                    tempPath = targetPoint + ((String)paths.get(0)).substring(mountPoint.length());
//                }
                String tempPath = (String)actualPaths.get(0);
                bean.setPutAllowed(
                        UserUtil.isPutAllowed(registry.getUserName(), tempPath, registry));
                bean.setRealPath(tempPath);
            } else if (user != null) {
                if (registry.getUserName().equals(user)) {
                    bean.setPutAllowed(true);
                } else {
                    bean.setPutAllowed(
                        UserUtil.isPutAllowed(registry.getUserName(), path, registry));
                }
                // Mounted resources should be accessed via the link, and we need not set
                // the real path.
            }
        } else {
            boolean putAllowed = UserUtil.isPutAllowed(registry.getUserName(), path, registry);
            bean.setPutAllowed(putAllowed);
        }

        bean.setVersionView(!resourcePath.isCurrentVersion());
        bean.setContentPath(resourcePath.getCompletePath());
        resource.discard();
       
        return bean;
    }
View Full Code Here

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

    }

     public ContentBean getContent(HttpServletRequest request) throws Exception {

        String path = RegistryUtil.getPath(request);
        ContentBean bean = null;
        try {
            bean = stub.getContentBean(path);
        } catch (Exception e) {
            String msg = "Failed to get content 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.