Package org.jdesktop.wonderland.modules.contentrepo.common

Examples of org.jdesktop.wonderland.modules.contentrepo.common.ContentCollection


     * @return The ContentConnection holding the user placemarks
     */
    private static ContentCollection getUserPlacemarksContentCollection()
            throws ContentRepositoryException {

        ContentCollection userRoot = getUserContentRepository();
        ContentCollection dir = (ContentCollection)userRoot.getChild("placemarks");
        if (dir == null) {
            dir = (ContentCollection)userRoot.createChild("placemarks", Type.COLLECTION);
        }
        return dir;
    }
View Full Code Here


    }
   
    public static void setLoginCoverScreenInfo(LoginCoverScreenInfo loginCoverScreenInfo) {
        try {
            // Find the LoginCoverScreen.xml file, creating it if necessary.
            ContentCollection collection = getSystemContentRepository();
            ContentCollection grps = (ContentCollection) collection.getParent().getChild("groups");
            if(grps==null) {
                grps = (ContentCollection) collection.getParent().createChild("groups", Type.COLLECTION);
            }
            ContentCollection grpusrs = (ContentCollection) grps.getChild("users");
            if(grpusrs == null) {
                grpusrs = (ContentCollection) grps.createChild("users", Type.COLLECTION);
            }
            ContentCollection csColl = (ContentCollection) grpusrs.getChild("LoginCoverScreen");
            if(csColl==null) {
                csColl = (ContentCollection) grpusrs.createChild("LoginCoverScreen", Type.COLLECTION);
            }
           
            ArrayList<ContentNode> resources = (ArrayList<ContentNode>)csColl.getChildren();
            if (resources != null && resources.size()!=0) {
                csColl.removeChild(resources.get(0).getName());
            }
            ContentResource resource = (ContentResource)csColl.createChild("LoginCoverScreen"+new Date().getTime()+".xml", Type.RESOURCE);

            // Write the new list to the resource
            ByteArrayOutputStream os = new ByteArrayOutputStream();
            Writer w = new OutputStreamWriter(os);
            loginCoverScreenInfo.encode(w);
View Full Code Here

            // not ready yet
            return false;
        }
       
        // create directory if it doesn't exist
        ContentCollection groups = (ContentCollection) repo.getRoot().getChild("groups");
        if (groups == null) {
            groups = (ContentCollection)
                    repo.getRoot().createChild("groups", ContentNode.Type.COLLECTION);
        }

        ContentCollection users = (ContentCollection) groups.getChild("users");
        if (users == null) {
            users = (ContentCollection)
                    groups.createChild("users", ContentNode.Type.COLLECTION);
        }

        ContentCollection dir = (ContentCollection) users.getChild(ErrorReport.DIR_NAME);
        if (dir == null) {
            users.createChild(ErrorReport.DIR_NAME, ContentNode.Type.COLLECTION);
        }
       
        return true;
View Full Code Here

    }
   
    public static LoginCoverScreenInfo getLoginCoverScreenInfo() {
        try {
            // Find the LoginCoverScreen.xml file and parse as a PlacemarkList object.
           ContentCollection collection = getSystemContentRepository();
           ContentCollection grps = (ContentCollection) collection.getParent().getChild("groups");
            if(grps==null) {
                grps = (ContentCollection) collection.getParent().createChild("groups", Type.COLLECTION);
            }
            ContentCollection grpusrs = (ContentCollection) grps.getChild("users");
            if(grpusrs == null) {
                grpusrs = (ContentCollection) grps.createChild("users", Type.COLLECTION);
            }
            ContentCollection csColl = (ContentCollection) grpusrs.getChild("LoginCoverScreen");
            if(csColl==null) {
                csColl = (ContentCollection) grpusrs.createChild("LoginCoverScreen", Type.COLLECTION);
            }
           ArrayList<ContentNode> resources = (ArrayList<ContentNode>) csColl.getChildren();
           ContentResource resource = null;
           if(resources!=null && !resources.isEmpty()) {
                resource = (ContentResource)csColl.getChildren().get(0);
           }
           if (resource == null) {
               logger.warning("Unable to find LoginCoverScreen.xml in " + grpusrs.getPath());
               return null;
           } else {
View Full Code Here

   
    public static LoginCoverScreenInfo getLoginCoverScreenInfo(ContentCollection grpusrs) {
        try {
            // Find the LoginCoverScreen.xml file and parse as a PlacemarkList object.
          
            ContentCollection csColl = (ContentCollection) grpusrs.getChild("LoginCoverScreen");
            if(csColl==null) {
                csColl = (ContentCollection) grpusrs.createChild("LoginCoverScreen", Type.COLLECTION);
            }
           ArrayList<ContentNode> resources = (ArrayList<ContentNode>) csColl.getChildren();
           ContentResource resource = null;
           if(resources!=null && !resources.isEmpty()) {
                resource = (ContentResource)csColl.getChildren().get(0);
           }
           if (resource == null) {
               logger.warning("Unable to find LoginCoverScreen.xml in " + grpusrs.getPath());
               return null;
           } else {
View Full Code Here

    }
   
    public static void setGoToCoverScreenInfo(GoToCoverScreenInfo goToCoverScreenInfo,ServerSessionManager ssm) {
        try {
            // Find the GoToCoverScreen.xml file, creating it if necessary.
            ContentCollection collection = getSystemContentRepository();
            ContentCollection grps = (ContentCollection) collection.getParent().getChild("groups");
            if(grps==null) {
                grps = (ContentCollection) collection.getParent().createChild("groups", Type.COLLECTION);
            }
            ContentCollection grpusrs = (ContentCollection) grps.getChild("users");
            if(grpusrs == null) {
                grpusrs = (ContentCollection) grps.createChild("users", Type.COLLECTION);
            }
            ContentCollection csColl = (ContentCollection) grpusrs.getChild("GoToCoverScreen");
            if(csColl==null) {
                csColl = (ContentCollection) grpusrs.createChild("GoToCoverScreen", Type.COLLECTION);
            }
            ArrayList<ContentNode> resources = (ArrayList<ContentNode>)csColl.getChildren();
            if (resources != null && resources.size()!=0) {
                csColl.removeChild(resources.get(0).getName());
            }
            ContentResource resource = (ContentResource)csColl.createChild("GoToCoverScreen"+new Date().getTime()+".xml", Type.RESOURCE);
          
            // Write the new list to the resource
            ByteArrayOutputStream os = new ByteArrayOutputStream();
            Writer w = new OutputStreamWriter(os);
            goToCoverScreenInfo.encode(w);
View Full Code Here

    }
   
    public static GoToCoverScreenInfo getGoToCoverScreenInfo(ServerSessionManager ssm) {
        try {
            // Find the GoToCoverScreen.xml file and parse as a PlacemarkList object.
           ContentCollection collection = getSystemContentRepository(ssm);
           ContentCollection grps = (ContentCollection) collection.getParent().getChild("groups");
            if(grps==null) {
                grps = (ContentCollection) collection.getParent().createChild("groups", Type.COLLECTION);
            }
            ContentCollection grpusrs = (ContentCollection) grps.getChild("users");
            if(grpusrs == null) {
                grpusrs = (ContentCollection) grps.createChild("users", Type.COLLECTION);
            }
            ContentCollection csColl = (ContentCollection) grpusrs.getChild("GoToCoverScreen");
            if(csColl==null) {
                csColl = (ContentCollection) grpusrs.createChild("GoToCoverScreen", Type.COLLECTION);
            }
           ArrayList<ContentNode> resources = (ArrayList<ContentNode>) csColl.getChildren();
           ContentResource resource = null;
           if(resources!=null && !resources.isEmpty()) {
                resource = (ContentResource)csColl.getChildren().get(0);
           }
           if (resource == null) {
               logger.warning("Unable to find GoToCoverScreen.xml in " + collection.getPath());
               return null;
           } else {
View Full Code Here

    }
   
     public static GoToCoverScreenInfo getGoToCoverScreenInfo() {
        try {
            // Find the GoToCoverScreen.xml file and parse as a PlacemarkList object.
           ContentCollection collection = getSystemContentRepository();
           ContentCollection grps = (ContentCollection) collection.getParent().getChild("groups");
            if(grps==null) {
                grps = (ContentCollection) collection.getParent().createChild("groups", Type.COLLECTION);
            }
            ContentCollection grpusrs = (ContentCollection) grps.getChild("users");
            if(grpusrs == null) {
                grpusrs = (ContentCollection) grps.createChild("users", Type.COLLECTION);
            }
            ContentCollection csColl = (ContentCollection) grpusrs.getChild("GoToCoverScreen");
            if(csColl==null) {
                csColl = (ContentCollection) grpusrs.createChild("GoToCoverScreen", Type.COLLECTION);
            }
           ArrayList<ContentNode> resources = (ArrayList<ContentNode>) csColl.getChildren();
           ContentResource resource = null;
           if(resources!=null && !resources.isEmpty()) {
                resource = (ContentResource)csColl.getChildren().get(0);
           }
           if (resource == null) {
               logger.warning("Unable to find GoToCoverScreen.xml in " + collection.getPath());
               return null;
           } else {
View Full Code Here

    }
     public static GoToCoverScreenInfo getGoToCoverScreenInfo(ContentCollection grpusrs) {
        try {
            // Find the GoToCoverScreen.xml file and parse as a PlacemarkList object.
          
            ContentCollection csColl = (ContentCollection) grpusrs.getChild("GoToCoverScreen");
            if(csColl==null) {
                csColl = (ContentCollection) grpusrs.createChild("GoToCoverScreen", Type.COLLECTION);
            }
           ArrayList<ContentNode> resources = (ArrayList<ContentNode>) csColl.getChildren();
           ContentResource resource = null;
           if(resources!=null && !resources.isEmpty()) {
                resource = (ContentResource)csColl.getChildren().get(0);
           }
           if (resource == null) {
               logger.warning("Unable to find GoToCoverScreen.xml in " + grpusrs.getPath());
               return null;
           } else {
View Full Code Here

                ContentRepositoryRegistry registry = ContentRepositoryRegistry.getInstance();
                ContentRepository cr = registry.getRepository(LoginManager.getPrimary());
                String[] urls = imageURL.toString().split("/");
                String fname = urls[urls.length-1];
                String userName = urls[3];
                ContentCollection user = cr.getUserRoot(userName);
               
                ContentResource res = (ContentResource) user.getChild(fname);
               
                BufferedImage bimg = ImageIO.read(res.getInputStream());
                if(bimg.getWidth()>width || bimg.getHeight()>height) {
                    if(bimg.getWidth()>width && bimg.getHeight()>height) {
                        if(bimg.getWidth()-width>bimg.getHeight()-height) {
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.contentrepo.common.ContentCollection

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.