Package org.apache.isis.core.metamodel.consent

Examples of org.apache.isis.core.metamodel.consent.Consent


    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {

        final ObjectAdapter onAdapter = performContext.getOnAdapter();
        final OneToOneAssociation otoa = (OneToOneAssociation) performContext.getObjectMember();

        final Consent validityConsent = otoa.isAssociationValid(onAdapter, null);

        if (!getAssertion().satisfiedBy(validityConsent)) {
            final CellBinding thatBinding = performContext.getPeer().getThatItBinding();
            throw ScenarioBoundValueException.current(thatBinding, getAssertion().getReason(validityConsent));
        }
View Full Code Here


        // obtain existing as 'context' (used if this is a parsed @Value)
        final ObjectAdapter contextAdapter = otoa.get(onAdapter);

        // validate parameter
        final ObjectAdapter toSetAdapter = performContext.getPeer().getAdapter(contextAdapter, otoa.getSpecification(), arg0Binding, arg0Cell);
        final Consent validConsent = otoa.isAssociationValid(onAdapter, toSetAdapter);
        if (validConsent.isVetoed()) {
            throw ScenarioBoundValueException.current(arg0Binding, validConsent.getReason());
        }

        setterFacet.setProperty(onAdapter, toSetAdapter);

    }
View Full Code Here

        // lookup arguments
        final ObjectAdapter[] proposedArguments = performContext.getPeer().getAdapters(onAdapter, nakedObjectAction, onMemberBinding, argumentCells);

        // validate arguments
        final Consent argSetValid = nakedObjectAction.isProposedArgumentSetValid(onAdapter, proposedArguments);
        if (argSetValid.isVetoed()) {
            throw ScenarioBoundValueException.current(onMemberBinding, argSetValid.getReason());
        }

        // execute
        return null;
    }
View Full Code Here

            // lookup arguments
            proposedArguments = performContext.getPeer().getAdapters(onAdapter, objectAction, onMemberBinding, argumentCells);

            // validate arguments
            final Consent argSetValid = objectAction.isProposedArgumentSetValid(onAdapter, proposedArguments);
            if (argSetValid.isVetoed()) {
                throw ScenarioBoundValueException.current(onMemberBinding, argSetValid.getReason());
            }
        } else {
            proposedArguments = new ObjectAdapter[] { onAdapter };
        }
View Full Code Here

    private void addProperties(final ObjectAdapter objectAdapter, final JsonRepresentation members, final List<ObjectAssociation> associations) {
        final LinkFollowSpecs linkFollower = getLinkFollowSpecs().follow("members");
        for (final ObjectAssociation assoc : associations) {

            if (mode.checkVisibility()) {
                final Consent visibility = assoc.isVisible(getRendererContext().getAuthenticationSession(), objectAdapter, rendererContext.getWhere());
                if (!visibility.isAllowed()) {
                    continue;
                }
            }
            if (!(assoc instanceof OneToOneAssociation)) {
                continue;
View Full Code Here

    private void addCollections(final ObjectAdapter objectAdapter, final JsonRepresentation members, final List<ObjectAssociation> associations) {
        final LinkFollowSpecs linkFollower = getLinkFollowSpecs().follow("members");
        for (final ObjectAssociation assoc : associations) {

            if (mode.checkVisibility()) {
                final Consent visibility = assoc.isVisible(getRendererContext().getAuthenticationSession(), objectAdapter, rendererContext.getWhere());
                if (!visibility.isAllowed()) {
                    continue;
                }
            }

            if (!(assoc instanceof OneToManyAssociation)) {
View Full Code Here

        }
    }

    private void addActions(final ObjectAdapter objectAdapter, final List<ObjectAction> actions, final JsonRepresentation members) {
        for (final ObjectAction action : actions) {
            final Consent visibility = action.isVisible(getRendererContext().getAuthenticationSession(), objectAdapter, rendererContext.getWhere());
            if (!visibility.isAllowed()) {
                continue;
            }
            final LinkFollowSpecs linkFollowSpecs = getLinkFollowSpecs().follow("members["+action.getId()+"]");
           
            final ObjectActionReprRenderer renderer = new ObjectActionReprRenderer(getRendererContext(), linkFollowSpecs, action.getId(), JsonRepresentation.newMap());
View Full Code Here

    @Override
    public void checkForValidity(final Context context) {
        final ObjectAdapter target = getTarget(context);
        final ObjectAdapter[] parameters = getEntries(context);

        final Consent valueValid = field.isValidToAdd(target, parameters[0]);
        errors[0] = valueValid.getReason();
    }
View Full Code Here

    public void checkInstances(final Context context, final ObjectAdapter[] objects) {
        final ObjectAdapter collection = field.get(getTarget(context));
        final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
        final ObjectAdapter target = getTarget(context);
        for (int i = 0; i < objects.length; i++) {
            final Consent valueValid = field.isValidToAdd(target, objects[i]);
            if (valueValid.isVetoed()) {
                objects[i] = null;
            } else if (facet.contains(collection, objects[i])) {
                objects[i] = null;
            }
        }
View Full Code Here

        final ObjectAdapter onAdapter = getOnAdapter();
        return onAdapter.getSpecification().isValid(onAdapter);
    }

    public void ensureVisible(final CellBinding onMemberBinding, final ScenarioCell onMemberCell) throws ScenarioBoundValueException {
        final Consent visible = objectMember.isVisible(getAuthenticationSession(), getOnAdapter(), where);
        if (visible.isVetoed()) {
            throw ScenarioBoundValueException.current(onMemberBinding, "(not visible)");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.consent.Consent

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.