Package models

Examples of models.Organization


        return ok(members.render(organization, Role.findOrganizationRoles()));
    }

    private static Result validateForSetting(String organizationName) {
        Organization organization = Organization.findByName(organizationName);
        if (organization == null) {
            return notFound(ErrorViews.NotFound.render("organization.member.unknownOrganization", organization));
        }

        User currentUser = UserApp.currentUser();
View Full Code Here


        Result result = validateForSetting(organizationName);
        if (result != null) {
            return result;
        }

        Organization organization = Organization.findByName(organizationName);

        return ok(setting.render(organization, form(Organization.class).fill(organization)));
    }
View Full Code Here

     * @throws IOException
     * @throws NoSuchAlgorithmException
     */
    public static Result updateOrganizationInfo(String organizationName) throws IOException, NoSuchAlgorithmException {
        Form<Organization> organizationForm = form(Organization.class).bindFromRequest();
        Organization modifiedOrganization = organizationForm.get();

        Result result = validateForUpdate(organizationForm, modifiedOrganization);
        if (result != null) {
            return result;
        }

        Http.MultipartFormData.FilePart filePart = request().body().asMultipartFormData()
                .getFile("logoPath");
        if (!isEmptyFilePart(filePart)) {
            Attachment.deleteAll(modifiedOrganization.asResource());
            new Attachment().store(filePart.getFile(), filePart.getFilename(), modifiedOrganization.asResource());
        }

        modifiedOrganization.update();

        return redirect(routes.OrganizationApp.settingForm(modifiedOrganization.name));
    }
View Full Code Here

        return redirect(routes.OrganizationApp.settingForm(modifiedOrganization.name));
    }

    private static Result validateForUpdate(Form<Organization> organizationForm, Organization modifiedOrganization) {
        Organization organization = Organization.find.byId(modifiedOrganization.id);
        if (organization == null) {
            return notFound(ErrorViews.NotFound.render("organization.member.unknownOrganization"));
        }

        if (isDuplicateName(organization, modifiedOrganization)) {
View Full Code Here

TOP

Related Classes of models.Organization

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.