Package org.apache.isis.viewer.scimpi.dispatcher

Examples of org.apache.isis.viewer.scimpi.dispatcher.ScimpiException


    public void process(final Request request) {
        final String id = request.getOptionalProperty(OBJECT);
        final String fieldName = request.getRequiredProperty(FIELD);
        final ObjectAdapter object = request.getContext().getMappedObjectOrResult(id);
        if (object == null) {
            throw new ScimpiException("No object to get field for: " + fieldName + " - " + id);
        }
        final ObjectAssociation field = object.getSpecification().getAssociation(fieldName);
        if (field == null) {
            throw new ScimpiException("No field " + fieldName + " in " + object.getSpecification().getFullIdentifier());
        }
        final AuthenticationSession session = IsisContext.getAuthenticationSession();
        if (field.isVisible(session, object, where).isVetoed()) {
            throw new ForbiddenException(field, ForbiddenException.VISIBLE);
        }
View Full Code Here


        final String id = request.getOptionalProperty(OBJECT);
        final String fieldName = request.getRequiredProperty(FIELD);
        final ObjectAdapter object = request.getContext().getMappedObjectOrResult(id);
        final ObjectAssociation field = object.getSpecification().getAssociation(fieldName);
        if (field == null) {
            throw new ScimpiException("No field " + fieldName + " in " + object.getSpecification().getFullIdentifier());
        }
        if (field.isVisible(IsisContext.getAuthenticationSession(), object, where).isVetoed()) {
            throw new ForbiddenException(field, ForbiddenException.VISIBLE);
        }
        String delimiter = request.getOptionalProperty("delimiter");
View Full Code Here

                if (nextTag.getType() == SwfTag.EMPTY) {
                    return;
                }
            }
        }
        throw new ScimpiException("Empty tag not closed");
    }
View Full Code Here

    private static List<String> debugUsers = new ArrayList<String>();
    private static DebugMode debugMode;

    public void initialize() {
        if (debugMode != null) {
            throw new ScimpiException("Debug mode is already set up!");
        }

        final String debugUserEntry = IsisContext.getConfiguration().getString(ConfigurationConstants.ROOT + "scimpi.debug.users", "");
        final String[] users = debugUserEntry.split("\\|");
        for (final String name : users) {
View Full Code Here

        String tableId;
        if (field != null) {
            final String objectId = request.getOptionalProperty(OBJECT);
            final ObjectAdapter object = context.getMappedObjectOrResult(objectId);
            if (object == null) {
                throw new ScimpiException("No object for result or " + objectId);
            }
            final ObjectAssociation objectField = object.getSpecification().getAssociation(field);
            if (!objectField.isOneToManyAssociation()) {
                throw new ScimpiException("Field " + objectField.getId() + " is not a collection");
            }
            isFieldEditable = objectField.isUsable(IsisContext.getAuthenticationSession(), object, where).isAllowed();
            getPersistenceSession().resolveField(object, objectField);
            collection = objectField.get(object);
            final TypeOfFacet facet = objectField.getFacet(TypeOfFacet.class);
View Full Code Here

        if (field != null) {
            final String id = request.getRequiredProperty(OBJECT);
            final ObjectAdapter object = context.getMappedObjectOrResult(id);
            final ObjectAssociation objectField = object.getSpecification().getAssociation(field);
            if (!objectField.isOneToManyAssociation()) {
                throw new ScimpiException("Field " + objectField.getId() + " is not a collection");
            }
            collection = objectField.get(object);
        } else {
            final String id = request.getOptionalProperty(COLLECTION);
            collection = context.getMappedObjectOrResult(id);
View Full Code Here

        if (oidStr.equals("collection")) {
            return collection;
        }
        final ObjectAdapter adapter = mappedObject(oidStr);
        if (adapter == null) {
            throw new ScimpiException("No object for " + oidStr);
        }
        return adapter;
    }
View Full Code Here

    public ObjectAdapter getMappedObjectOrVariable(String idOrData, final String name) {
        if (idOrData == null) {
            idOrData = (String) getVariable(name);
            if (idOrData == null) {
                throw new ScimpiException("No variable for " + name);
            }
        }
        if (idOrData.equals("collection")) {
            return collection;
        }
View Full Code Here

    }

    public void addVariable(String name, final Object value, final Scope scope) {
        name = name != null ? name : RESULT;
        if (scope == Scope.SESSION && value != null && !(value instanceof Serializable)) {
            throw new ScimpiException("SESSION scoped variable (" + name + ") must be serializable: " + value);
        }
        removeExistingVariable(name);
        variables.get(scope).put(name, value);
    }
View Full Code Here

        if (method != null && method.equals("add")) {
            debugUsers.add(name);
        } else if (method != null && method.equals("remove")) {
            debugUsers.remove(name);
        } else {
            throw new ScimpiException("Invalid debug-user action");
        }

        context.setRequestPath(view);
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.scimpi.dispatcher.ScimpiException

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.