Package org.dspace.content

Examples of org.dspace.content.Community


        }
        else if (dso.getType() == Constants.COMMUNITY)
        {
            // Subcommunities are directly under "DSpace Object Contents" <div>,
            // but are labeled as Communities.
            Community subcomms[] = ((Community)dso).getSubcommunities();
            for (int i = 0; i < subcomms.length; ++i)
            {
                //add a child <div> for each subcommunity in this community
                Div childDiv = makeChildDiv(getObjectTypeString(subcomms[i]), subcomms[i], params);
                if(childDiv!=null)
                {
                    div0.getContent().add(childDiv);
                }
            }
            // Collections are also directly under "DSpace Object Contents" <div>,
            // but are labeled as Collections.
            Collection colls[] = ((Community)dso).getCollections();
            for (int i = 0; i < colls.length; ++i)
            {
                //add a child <div> for each collection in this community
                Div childDiv = makeChildDiv(getObjectTypeString(colls[i]), colls[i], params);
                if(childDiv!=null)
                {
                    div0.getContent().add(childDiv);
                }
            }
            //add Community logo bitstream
            Bitstream logoBs = ((Community)dso).getLogo();
            if (logoBs != null)
            {
                fileSec = new FileSec();
                addLogoBitstream(logoBs, fileSec, div0, params);
            }
        }
        else if (dso.getType() == Constants.SITE)
        {
            // This is a site-wide <structMap>, which just lists the top-level
            // communities.  Each top level community is referenced by a div.
            Community comms[] = Community.findAllTop(context);
            for (int i = 0; i < comms.length; ++i)
            {
                //add a child <div> for each top level community in this site
                Div childDiv = makeChildDiv(getObjectTypeString(comms[i]),
                        comms[i], params);
View Full Code Here


     */
    @Override
    protected DAVResource[] children() throws SQLException
    {
        Vector result = new Vector();
        Community subs[] = this.community.getSubcommunities();
        for (Community element : subs)
        {
            result.add(new DAVCommunity(this.context, this.request, this.response,
                    makeChildPath(element), element));
        }
View Full Code Here

     */
    @Override
    protected int deleteInternal() throws DAVStatusException, SQLException,
            AuthorizeException, IOException
    {
        Community c = this.community.getParentCommunity();
        if (c != null)
        {
            c.removeSubcommunity(this.community);
        }
        this.community.delete();
        return HttpServletResponse.SC_OK;
    }
View Full Code Here

        // now ensure communities have READ policies
        Community[] communities = Community.findAll(c);

        for (int i = 0; i < communities.length; i++)
        {
            Community t = communities[i];

            System.out.println("Community " + t + " " + t.getMetadata("name"));

            // check for READ
            if (checkForPolicy(c, t, Constants.READ))
            {
                System.out.println("\tFound READ policies!");
View Full Code Here

        c.setIgnoreAuthorization(true);

        try
        {
            // validate and resolve the parent and child IDs into commmunities
            Community parent = filiator.resolveCommunity(c, parentID);
            Community child = filiator.resolveCommunity(c, childID);

            if (parent == null)
            {
                System.out.println("Error, parent community cannot be found: "
                        + parentID);
View Full Code Here

            throws SQLException, AuthorizeException, IOException
    {
        // check that a valid filiation would be established
        // first test - proposed child must currently be an orphan (i.e.
        // top-level)
        Community childDad = child.getParentCommunity();

        if (childDad != null)
        {
            System.out.println("Error, child community: " + child.getID()
                    + " already a child of: " + childDad.getID());
            System.exit(1);
        }

        // second test - circularity: parent's parents can't include proposed
        // child
View Full Code Here

    }

    private Community resolveCommunity(Context c, String communityID)
            throws SQLException
    {
        Community community = null;

        if (communityID.indexOf('/') != -1)
        {
            // has a / must be a handle
            community = (Community) HandleManager.resolveToObject(c,
                    communityID);

            // ensure it's a community
            if ((community == null)
                    || (community.getType() != Constants.COMMUNITY))
            {
                community = null;
            }
        }
        else
View Full Code Here

                        }

                        break;
                    case Constants.COMMUNITY :
                        //Also find all SubCommunities in this Community and disseminate
                        Community community = (Community) dso;
                        Community[] subcommunities = community.getSubcommunities();
                        for(int i=0; i<subcommunities.length; i++)
                        {
                            //disseminate all sub-communities (recursively!)
                            String childFileName = pkgDirectory + PackageUtils.getPackageName(subcommunities[i], fileExtension);
                            disseminateAll(context, subcommunities[i], params, new File(childFileName));
                        }

                        //Also find all Collections in this Community and disseminate
                        Collection[] collections = community.getCollections();
                        for(int i=0; i<collections.length; i++)
                        {
                            //disseminate all collections (recursively!)
                            String childFileName = pkgDirectory + PackageUtils.getPackageName(collections[i], fileExtension);
                            disseminateAll(context, collections[i], params, new File(childFileName));
View Full Code Here

                            groupObj = collection.createWorkflowGroup(3);
                        }
                    }
                    else if(parent.getType()==Constants.COMMUNITY)
                    {
                        Community community = (Community) parent;

                        // Create this Community-associated group, based on its group type
                        if(type.equals(RoleDisseminator.GROUP_TYPE_ADMIN))
                        {
                            groupObj = community.createAdministrators();
                        }
                    }
                    //Ignore all other dspace object types
                }
View Full Code Here

                dim.addContent(createField("dc","rights","license",null,rights_license));
                dim.addContent(createField("dc","title",null,null,title));
            }
            else if (dso.getType() == Constants.COMMUNITY)
            {
                Community community = (Community) dso;

                String description = community.getMetadata("introductory_text");
                String description_abstract = community.getMetadata("short_description");
                String description_table = community.getMetadata("side_bar_text");
                String identifier_uri = "hdl:" + community.getHandle();
                String rights = community.getMetadata("copyright_text");
                String title = community.getMetadata("name");

                dim.addContent(createField("dc","description",null,null,description));
                dim.addContent(createField("dc","description","abstract",null,description_abstract));
                dim.addContent(createField("dc","description","tableofcontents",null,description_table));
                dim.addContent(createField("dc","identifier","uri",null,identifier_uri));
View Full Code Here

TOP

Related Classes of org.dspace.content.Community

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.