Examples of asResource()


Examples of models.Milestone.asResource()

            }

            newMilestone.project = project;
            newMilestone.dueDate = JodaDateUtil.lastSecondOfDay(newMilestone.dueDate);
            Milestone.create(newMilestone);
            Attachment.moveAll(UserApp.currentUser().asResource(), newMilestone.asResource());
            return redirect(routes.MilestoneApp.milestone(userName, projectName, newMilestone.id));
        }
    }

    private static void validate(Project project, Form<Milestone> milestoneForm) {
View Full Code Here

Examples of models.Organization.asResource()

            flash(Constants.WARNING, "organization.member.isNotAMember");
            return okWithLocation(routes.OrganizationApp.members(organizationName).url());
        }

        User currentUser = UserApp.currentUser();
        if (!AccessControl.isAllowed(currentUser, organization.asResource(), Operation.UPDATE)
                && !currentUser.id.equals(userId)) {
            flash(Constants.WARNING, "organization.member.needManagerRole");
            return okWithLocation(routes.OrganizationApp.members(organizationName).url());
        }
View Full Code Here

Examples of models.Project.asResource()

        User user = User.find.byId(userId);
        Project project = Project.find.byId(projectId);
        EventType eventType = EventType.valueOf(eventTypeValue);

        Watch.watch(user, project.asResource());
        assertThat(user.getWatchingProjects().contains(project)).isTrue();
        assertThat(UserProjectNotification.isEnabledNotiType(user, project, eventType)).isTrue();

        FakeRequest request = fakeRequest("POST", "/noti/toggle/" + projectId + "/" + eventTypeValue)
                .withSession(UserApp.SESSION_USERID, String.valueOf(userId));
View Full Code Here

Examples of models.User.asResource()

            return forbidden();
        }

        // Attach the file to the user who upload it.
        Attachment attach = new Attachment();
        boolean isCreated = attach.store(file, filePart.getFilename(), uploader.asResource());

        // The request has been fulfilled and resulted in a new resource being
        // created. The newly created resource can be referenced by the URI(s)
        // returned in the entity of the response, with the most specific URI
        // for the resource given by a Location header field.
View Full Code Here

Examples of models.resource.ResourceConvertible.asResource()

        if(resourceObject == null) {
            return AccessLogger.log(context.request(),
                    notFound(ErrorViews.NotFound.render("error.notfound", project, resourceType.resource())) , null);
        }

        if(!AccessControl.isAllowed(UserApp.currentUser(), resourceObject.asResource(), operation)) {
            return AccessLogger.log(context.request(),
                    forbidden(ErrorViews.Forbidden.render("error.forbidden", project)), null);
        }

        return this.delegate.call(context);
View Full Code Here

Examples of org.jboss.as.console.client.widgets.forms.AddressBinding.asResource()

        loadDiverts();
    }

    private void loadDiverts() {
        AddressBinding address = metaData.getBeanMetaData(MessagingProvider.class).getAddress();
        ModelNode operation = address.asResource(Baseadress.get(), getCurrentServer());

        operation.get(OP).set(READ_CHILDREN_RESOURCES_OPERATION);
        operation.get(CHILD_TYPE).set("divert");

        dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {
View Full Code Here

Examples of org.jboss.as.console.client.widgets.forms.AddressBinding.asResource()

    }

    public void loadProviderDetails() {

        AddressBinding address = metaData.getBeanMetaData(MessagingProvider.class).getAddress();
        ModelNode operation = address.asResource(Baseadress.get(), getCurrentServer());
        operation.get(OP).set(READ_RESOURCE_OPERATION);
        operation.get(RECURSIVE).set(Boolean.TRUE);

        dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {
View Full Code Here

Examples of org.jboss.as.console.client.widgets.forms.AddressBinding.asResource()

        }

        // the child resource

        AddressBinding address = metaData.getBeanMetaData(SecurityPattern.class).getAddress();
        ModelNode addressModel = address.asResource(
                Baseadress.get(),
                getCurrentServer(),
                newEntity.getPattern(), newEntity.getRole()
        );
View Full Code Here

Examples of org.jboss.as.console.client.widgets.forms.AddressBinding.asResource()

    }

    public void onSaveSecDetails(final SecurityPattern pattern, Map<String, Object> changedValues) {

        AddressBinding address = metaData.getBeanMetaData(SecurityPattern.class).getAddress();
        ModelNode proto = address.asResource(Baseadress.get(), getCurrentServer(), pattern.getPattern(), pattern.getRole());
        proto.get(OP).set(WRITE_ATTRIBUTE_OPERATION);

        List<PropertyBinding> bindings = metaData.getBindingsForType(SecurityPattern.class);
        ModelNode operation  = ModelAdapter.detypedFromChangeset(proto, changedValues, bindings);
View Full Code Here

Examples of org.jboss.as.console.client.widgets.forms.AddressBinding.asResource()

    @Override
    public void loadDataSource(String name, boolean isXA, final AsyncCallback<DataSource> callback) {

        AddressBinding address = isXA ? xadsMetaData.getAddress() : dsMetaData.getAddress();
        ModelNode operation = address.asResource(baseadress.getAdress(), name);
        operation.get(OP).set(READ_RESOURCE_OPERATION);

        dispatcher.execute(new DMRAction(operation), new AsyncCallback<DMRResponse>() {
            @Override
            public void onFailure(Throwable caught) {
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.