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

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


    }

    public static void write(final Request request, final ObjectAdapter adapter, final String fieldName, final ObjectAdapter element, final String resultOverride, final String view, final String error, final String title, final String cssClass) {
        final ObjectAssociation field = adapter.getSpecification().getAssociation(fieldName);
        if (field == null) {
            throw new ScimpiException("No field " + fieldName + " in " + adapter.getSpecification().getFullIdentifier());
        }
        if (!field.isOneToManyAssociation()) {
            throw new ScimpiException("Field " + fieldName + " not a collection, in " + adapter.getSpecification().getFullIdentifier());
        }
        if (field.isVisible(IsisContext.getAuthenticationSession(), adapter).isVetoed()) {
            throw new ForbiddenException(field, ForbiddenException.VISIBLE);
        }
        IsisContext.getPersistenceSession().resolveField(adapter, field);
View Full Code Here


    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).isVetoed()) {
            throw new ForbiddenException(field, ForbiddenException.VISIBLE);
        }
View Full Code Here

        final ObjectAction action = MethodsUtils.findAction(object, parameterObject.methodName);
        // TODO how do we distinguish between overloaded methods?

        // REVIEW Is this useful?
        if (action.getParameterCount() == 0) {
            throw new ScimpiException("Action form can only be used for actions with parameters");
        }
        if (parameterObject.showMessage && MethodsUtils.isVisible(object, action)) {
            final String notUsable = MethodsUtils.isUsable(object, action);
            if (notUsable != null) {
                if (!withoutProcessing) {
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).isVetoed()) {
            throw new ForbiddenException(field, ForbiddenException.VISIBLE);
        }
        String delimiter = request.getOptionalProperty("delimiter");
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

    @Override
    public PrintWriter getWriter() {
        try {
            return response.getWriter();
        } catch (final IOException e) {
            throw new ScimpiException(e);
        }
    }
View Full Code Here

                return null;
            } else {
                return fileName;
            }
        } catch (final MalformedURLException e) {
            throw new ScimpiException(e);
        }
    }
View Full Code Here

        if (in == null) {
            servletContext.getResourcePaths("/");
            try {
                servletContext.getResource(path);
            } catch (final MalformedURLException e) {
                throw new ScimpiException(e);
            }

            throw new ScimpiNotFoundException("Cannot find file " + path);
        }
        return in;
View Full Code Here

        final ObjectAction action = MethodsUtils.findAction(object, parameterObject.methodName);
        // TODO how do we distinguish between overloaded methods?

        // REVIEW Is this useful?
        if (action.getParameterCount() == 0) {
            throw new ScimpiException("Action form can only be used for actions with parameters");
        }
        if (parameterObject.showMessage && MethodsUtils.isVisible(object, action)) {
            final String notUsable = MethodsUtils.isUsable(object, action);
            if (notUsable != null) {
                if (!withoutProcessing) {
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).isVetoed()) {
            throw new ForbiddenException(field, ForbiddenException.VISIBLE);
        }
        String delimiter = request.getOptionalProperty("delimiter");
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.