Package org.dspace.content

Examples of org.dspace.content.Community


        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
        if (!(dso instanceof Community))
            return;

        // Set up the major variables
        Community community = (Community) dso;

        // Build the community viewer division.
        Division home = body.addDivision("community-home", "primary repository community");

View Full Code Here


            dso = communities[0];
        }

        if (dso instanceof Community)
        {
            Community community = (Community) dso;
            stack.push(community);

            for (Community parent : community.getAllParents())
            {
                stack.push(parent);
            }
        }

        while (!stack.empty())
        {
            DSpaceObject pop = stack.pop();
           
            if (pop instanceof Collection)
            {
              Collection collection = (Collection) pop;
              String name = collection.getMetadata("name");
              if (name == null || name.length() == 0)
                pageMeta.addTrailLink(contextPath + "/handle/" + pop.getHandle(), new Message("default","xmlui.general.untitled") );
              else
                pageMeta.addTrailLink(contextPath + "/handle/" + pop.getHandle(), name);
            }
            else if (pop instanceof Community)
            {
              Community community = (Community) pop;
              String name = community.getMetadata("name");
              if (name == null || name.length() == 0)
                pageMeta.addTrailLink(contextPath + "/handle/" + pop.getHandle(), new Message("default","xmlui.general.untitled") );
              else
                pageMeta.addTrailLink(contextPath + "/handle/" + pop.getHandle(), name);
            }
View Full Code Here

                  }
            }
            }
            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 = "http://hdl.handle.net/" + community.getHandle();
                String rights = community.getMetadata("copyright_text");
                String title = community.getMetadata("name");
               
                createField("dc","description",null,null,description);
                createField("dc","description","abstract",null,description_abstract);
                createField("dc","description","tableofcontents",null,description_table);
                createField("dc","identifier","uri",null,identifier_uri);
View Full Code Here

     */
    private Bitstream getLogo()
    {
        if (dso instanceof Community)
        {
            Community community = (Community) dso;
            return community.getLogo();
        }
        else if (dso instanceof Collection)
        {

            Collection collection = (Collection) dso;
View Full Code Here

                 if (collection != null)
                   adapter = new ContainerAdapter(context, collection,contextPath);
               }
               else if ("community".equals(type))
               {
                 Community community = Community.find(context,id);
                 if (community != null)
                   adapter = new ContainerAdapter(context, community,contextPath);
               }
      }
           }
View Full Code Here

        Collection coll = Collection.find(context, collId);

        List<Object> owningComms = new ArrayList<Object>();
        for (int i = 0; i < coll.getCommunities().length; i++)
        {
            Community community = coll.getCommunities()[i];
            findComms(community, owningComms);
        }

        return owningComms;
    }
View Full Code Here

                dao.setContainerIDField("collection_id");
                dao.setContainerID(col.getID());
            }
            else if (scope.inCommunity())
            {
                Community com = (Community) scope.getBrowseContainer();
                dao.setContainerTable("communities2item");
                dao.setContainerIDField("community_id");
                dao.setContainerID(com.getID());
            }
        }

        dao.setOffset(scope.getOffset());
        dao.setLimit(scope.getResultsPerPage());
View Full Code Here

                    dao.setContainerIDField("collection_id");
                    dao.setContainerID(col.getID());
                }
                else if (scope.inCommunity())
                {
                    Community com = (Community) scope.getBrowseContainer();
                    dao.setContainerTable("communities2item");
                    dao.setContainerIDField("community_id");
                    dao.setContainerID(com.getID());
                }
            }

            // this is the total number of results in answer to the query
            int total = getTotalResults();
View Full Code Here

                    dao.setContainerIDField("collection_id");
                    dao.setContainerID(col.getID());
                }
                else if (scope.inCommunity())
                {
                    Community com = (Community) scope.getBrowseContainer();
                    dao.setContainerTable("communities2item");
                    dao.setContainerIDField("community_id");
                    dao.setContainerID(com.getID());
                }
            }

            // this is the total number of results in answer to the query
            int total = getTotalResults(true);
View Full Code Here

      group = Group.find(context,groupID);
     
   
    // Find the collection or community if applicable
    Collection collection = null;
    Community community = null;
    if (group != null)
    {
      int collectionID = FlowGroupUtils.getCollectionId(group.getName());
      if (collectionID > -1)
        collection = Collection.find(context, collectionID);
      else
      {
          int communityID = FlowGroupUtils.getCommunityId(group.getName());
          if (communityID > -1)
              community = Community.find(context, communityID);
        }
    }
   
    // Get list of member groups
    String memberGroupIDsString = parameters.getParameter("memberGroupIDs",null);
    ArrayList<Integer> memberGroupIDs = new ArrayList<Integer>();
    if (memberGroupIDsString != null)
    {
      for (String id : memberGroupIDsString.split(","))
      {
        if (id.length() > 0)
          memberGroupIDs.add(Integer.valueOf(id));
      }
    }
     
    // Get list of member epeople
    String memberEPeopleIDsString = parameters.getParameter("memberEPeopleIDs",null);
    ArrayList<Integer> memberEPeopleIDs = new ArrayList<Integer>();
    if (memberEPeopleIDsString != null)
    {
      for (String id : memberEPeopleIDsString.split(","))
        if (id.length() > 0)
          memberEPeopleIDs.add(Integer.valueOf(id));
    }
   
    // Get highlight parameters
    int highlightEPersonID = parameters.getParameterAsInteger("highlightEPersonID",-1);
    int highlightGroupID = parameters.getParameterAsInteger("highlightGroupID",-1);
   
    // Get search parameters
      String query = URLDecode(parameters.getParameter("query",null));
      int page     = parameters.getParameterAsInteger("page",0);
      String type  = parameters.getParameter("type",null);
     
      // Get any errors
      String errorString = parameters.getParameter("errors",null);
    ArrayList<String> errors = new ArrayList<String>();
    if (errorString != null)
      for (String error : errorString.split(","))
        errors.add(error);
     
   
     
      //DIVISION: group-edit
      Division main = body.addInteractiveDivision("group-edit",contextPath+"/admin/groups",Division.METHOD_POST,"primary administrative groups");
      if (group == null)
        main.setHead(T_main_head_new);
      else
        main.setHead(T_main_head.parameterize(group.getName(),groupID));
  
     
      if(collection != null)
      {
        Para para = main.addPara();
        para.addContent(T_collection_para);
        para.addXref(contextPath+"/handle/"+collection.getHandle(), collection.getMetadata("name"));
      }
      else if(community != null)
        {
            Para para = main.addPara();
            para.addContent(T_community_para);
            para.addXref(contextPath+"/handle/"+community.getHandle(), community.getMetadata("name"));
        }
    
      // DIVISION: group-actions
      Division actions = main.addDivision("group-edit-actions");
      Para groupName = actions.addPara();
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.