Package org.dspace.content

Examples of org.dspace.content.Community.update()


            // communities
            // and so forth where they don't exist, but it's proving
            // difficult
            // to isolate the community that already exists without hitting
            // the database directly.
            community.update();
           
            // build the element with the handle that identifies the new
            // community
            // along with all the information that we imported here
            // This looks like a lot of repetition of getting information
View Full Code Here


                community.setMetadata("name", name);
                community.setMetadata("short_description", shortDescription);
                community.setMetadata("copyright_text", copyrightText);
                community.setMetadata("side_bar_text", sidebarText);
                community.setMetadata("introductory_text", introductoryText);
                community.update();
            } else {
                throw new EntityException("Internal server error", "Could not update community", 500);
            }
        } catch (SQLException ex) {
            throw new EntityException("Internal server error", "SQL error", 500);
View Full Code Here

        try {
            Community com = Community.find(context, Integer.parseInt(ref.getId()));
            if (com != null) {
                com.createAdministrators();
                com.update();
                Group group = com.getAdministrators();
                return String.valueOf(group.getID());
            } else {
                throw new EntityException("Not found", "Entity not found", 404);
            }
View Full Code Here

    public void removeAdministrators(EntityReference ref, Map<String, Object> inputVar, Context context) {
        try {
            Community com = Community.find(context, Integer.parseInt(ref.getId()));
            if ((com != null)) {
                com.removeAdministrators();
                com.update();
            }
        } catch (SQLException ex) {
            throw new EntityException("Internal server error", "SQL error", 500);
        } catch (AuthorizeException ae) {
            throw new EntityException("Forbidden", "Forbidden", 403);
View Full Code Here

        try {
            Community com = Community.find(context, Integer.parseInt(ref.getId()));
            if (com != null) {
                Bitstream bitstream = com.setLogo((InputStream) inputVar);
                com.update();
                return String.valueOf(bitstream.getID());
            } else {
                throw new EntityException("Not found", "Entity not found", 404);
            }
        } catch (SQLException ex) {
View Full Code Here

    public void removeLogo(EntityReference ref, Map<String, Object> inputVar, Context context) {
        try {
            Community com = Community.find(context, Integer.parseInt(ref.getId()));
            if ((com != null)) {
                com.setLogo(null);
                com.update();
            }
        } catch (SQLException ex) {
            throw new EntityException("Internal server error", "SQL error", 500);
        } catch (AuthorizeException ae) {
            throw new EntityException("Forbidden", "Forbidden", 403);
View Full Code Here

        String jsp;
        DSpaceObject dso;
        if (collection == null)
        {
            community.update();

            // Show community edit page
            request.setAttribute("community", community);
            storeAuthorizeAttributeCommunityEdit(context, request, community);
            dso = community;
View Full Code Here

     
      newCommunity.setLogo(is);
    }
       
    // Save everything
    newCommunity.update();
        context.commit();
        // success
        result.setContinue(true);
        result.setOutcome(true);
        result.setMessage(new Message("default","The community was successfully created."));
View Full Code Here

          community.setLogo(is);
        }
        }
       
        // Save everything
        community.update();
        context.commit();
       
        // No notice...
        result.setContinue(true);
    return result;
View Full Code Here

            if (role == null)
                role = community.createAdministrators();
        }
 
        // In case we needed to create a group, save our changes
        community.update();
        context.commit();
       
        // If the role name was valid then role should be non null,
        if (role != null)
            return role.getID();
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.