Package org.apache.isis.applib.annotation

Examples of org.apache.isis.applib.annotation.Where


            if(disabled != null) {
                // same default as in Disabled.when()
                final When disabledWhen = disabled.when!=null?disabled.when: When.ALWAYS;
                props.setProperty("member." + memberName + ".disabled.when", disabledWhen.toString());
                // same default as in Disabled.where()
                final Where disabledWhere = disabled.where!=null?disabled.where: Where.ANYWHERE;
                props.setProperty("member." + memberName + ".disabled.where", disabledWhere.toString());
                // same default as in Disabled.reason()
                final String disabledReason = disabled.reason!=null?disabled.reason: "";
                props.setProperty("member." + memberName + ".disabled.reason", disabledReason);
            }
            final HiddenFacetRepr hidden = memberRepr.hidden;
            if(hidden != null) {
                // same default as in Hidden.when()
                final When hiddenWhen = hidden.when!=null?hidden.when: When.ALWAYS;
                props.setProperty("member." + memberName + ".hidden.when", hiddenWhen.toString());
                // same default as in Hidden.where()
                final Where hiddenWhere = hidden.where!=null?hidden.where: Where.ANYWHERE;
                props.setProperty("member." + memberName + ".hidden.where", hiddenWhere.toString());
            }
            final RenderFacetRepr render = memberRepr.render;
            if(render != null) {
                // same default as in Render.Type.value()
                final Type renderType = render.value!=null?render.value: Render.Type.EAGERLY;
View Full Code Here


            if(disabled != null) {
                // same default as in Disabled.when()
                final When disabledWhen = disabled.when!=null?disabled.when: When.ALWAYS;
                props.setProperty("member." + memberName + ".disabled.when", disabledWhen.toString());
                // same default as in Disabled.where()
                final Where disabledWhere = disabled.where!=null?disabled.where: Where.ANYWHERE;
                props.setProperty("member." + memberName + ".disabled.where", disabledWhere.toString());
                // same default as in Disabled.reason()
                final String disabledReason = disabled.reason!=null?disabled.reason: "";
                props.setProperty("member." + memberName + ".disabled.reason", disabledReason);
            }
            final HiddenFacetRepr hidden = memberRepr.hidden;
            if(hidden != null) {
                // same default as in Hidden.when()
                final When hiddenWhen = hidden.when!=null?hidden.when: When.ALWAYS;
                props.setProperty("member." + memberName + ".hidden.when", hiddenWhen.toString());
                // same default as in Hidden.where()
                final Where hiddenWhere = hidden.where!=null?hidden.where: Where.ANYWHERE;
                props.setProperty("member." + memberName + ".hidden.where", hiddenWhere.toString());
            }
            final RenderFacetRepr render = memberRepr.render;
            if(render != null) {
                // same default as in Render.Type.value()
                final Type renderType = render.value!=null?render.value: Render.Type.EAGERLY;
View Full Code Here

            // REVIEW: should provide this rendering context, rather than hardcoding.
            // the net effect currently is that class members annotated with
            // @Hidden(where=Where.ANYWHERE) or @Disabled(where=Where.ANYWHERE) will indeed
            // be hidden/disabled, but will be visible/enabled (perhaps incorrectly)
            // for any other value for Where
            final Where where = Where.ANYWHERE;
           
            if (field.isVisible(IsisContext.getAuthenticationSession(), adapter, where).isVetoed()) {
                throw new ForbiddenException(field, ForbiddenException.VISIBLE);
            }
            IsisContext.getPersistenceSession().resolveField(adapter, field);
View Full Code Here

    }

    public OneToOneAssociation getPropertyThatIsVisibleForIntent(
            final String propertyId, final Intent intent) {

        final Where where = rendererContext.getWhere();

        final ObjectAssociation association;
        try {
            final ObjectSpecification specification = objectAdapter.getSpecification();
            association = specification.getAssociation(propertyId);
View Full Code Here

    }

    public OneToManyAssociation getCollectionThatIsVisibleForIntent(
            final String collectionId, final Intent intent) {

        final Where where = rendererContext.getWhere();
        final ObjectAssociation association;
        try {
            final ObjectSpecification specification = objectAdapter.getSpecification();
            association = specification.getAssociation(collectionId);
        } catch(Exception ex) {
View Full Code Here

    }

    public ObjectAction getObjectActionThatIsVisibleForIntent(
            final String actionId, final Intent intent) {

        final Where where = rendererContext.getWhere();

        final ObjectAction action;
        try {
            final ObjectSpecification specification = objectAdapter.getSpecification();
            action = specification.getObjectAction(actionId);
View Full Code Here

    }

    public <T extends ObjectMember> T memberThatIsVisibleForIntent(
            final T objectMember, final MemberType memberType, final Intent intent) {

        final Where where = rendererContext.getWhere();

        final String memberId = objectMember.getId();
        final AuthenticationSession authenticationSession = rendererContext.getAuthenticationSession();
        if (objectMember.isVisible(authenticationSession, objectAdapter, where).isVetoed()) {
            throwNotFoundException(memberId, memberType);
View Full Code Here

        final JsonRepresentation arguments = getResourceContext().getQueryStringAsJsonRepr();
       
        final ObjectAdapter objectAdapter = getObjectAdapterElseThrowNotFound(domainType, instanceId);
        final DomainResourceHelper helper = getDomainResourceHelper(objectAdapter);

        Where where = getResourceContext().getWhere();
        return helper.invokeAction(actionId, arguments);
    }
View Full Code Here

    }

    private void addPropertyColumnsIfRequired(final List<IColumn<ObjectAdapter,String>> columns) {
        final ObjectSpecification typeOfSpec = getModel().getTypeOfSpecification();

        final Where whereContext =
                getModel().isParented()
                    ? Where.PARENTED_TABLES
                    : Where.STANDALONE_TABLES;
       
        final ObjectSpecification parentSpecIfAny =
View Full Code Here

    }

    private void addPropertyColumnsIfRequired(final List<IColumn<ObjectAdapter,String>> columns) {
        final ObjectSpecification typeOfSpec = getModel().getTypeOfSpecification();

        final Where whereContext =
                getModel().isParented()
                    ? Where.PARENTED_TABLES
                    : Where.STANDALONE_TABLES;
       
        final ObjectSpecification parentSpecIfAny =
View Full Code Here

TOP

Related Classes of org.apache.isis.applib.annotation.Where

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.