Examples of Community


Examples of models.Community

            Form<Community> filledForm = form(Community.class).bindFromRequest("name", "copyrightText", "introductoryText", "shortDescription", "sidebarText");
            if(filledForm.hasErrors()){
                return badRequest(views.html.community.edit.render(user, filledForm, "Edit Comm", "", ""));
            }

            Community editCommunity = filledForm.get();

            //Determine if the edited community is changed from original. i.e. don't update unless necessary
            RestResponse originalCommunityResponse = Community.findByID(id);
            Community originalCommunity = null;
            if(originalCommunityResponse.modelObject instanceof Community) {
                originalCommunity = (Community) originalCommunityResponse.modelObject;
            }

            if(editCommunity.equals(originalCommunity)) {
View Full Code Here

Examples of models.Community

            request.addHeader("Content-Type", "application/json");
            String token = session("userToken");
            request.addHeader("rest-dspace-token", token);


            Community community = form(Community.class).bindFromRequest().get();

            StringEntity communityEntity = new StringEntity("{\"name\":\""+ community.name +"\"}");

            request.setEntity(communityEntity);
            Logger.info("ready");
            HttpResponse response = httpClient.execute(request);

            Logger.info("response: " + response.toString());
            if(response.getStatusLine().getStatusCode() == 200) {
                Logger.info("ok");
                Community parsedCommunity = Community.parseCommunityFromJSON(Json.parse(EntityUtils.toString(response.getEntity())));
                return redirect(routes.Communities.show(parsedCommunity.id));
            } else {
                Logger.info("not ok");
                return badRequest();
            }
View Full Code Here

Examples of org.dspace.content.Community

        // 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

Examples of org.dspace.rest.common.Community

            log.info("DSO Lookup by handle: [" + prefix + "] / [" + suffix + "] got result of: " + dso.getTypeText() + "_" + dso.getID());

            if(AuthorizeManager.authorizeActionBoolean(context, dso, org.dspace.core.Constants.READ)) {
                switch(dso.getType()) {
                    case Constants.COMMUNITY:
                        return new Community((org.dspace.content.Community) dso, expand, context);
                    case Constants.COLLECTION:
                        return new Collection((org.dspace.content.Collection) dso, expand, context, null, null);
                    case Constants.ITEM:
                        return new Item((org.dspace.content.Item) dso, expand, context);
                    default:
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.