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

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


    // /////////////////////////////
    // Parameters
    // /////////////////////////////
    public void addParameter(final String name, final String parameter) {
        if (name == null) {
            throw new ScimpiException("Name must be specified for parameter " + parameter);
        }
        addVariable(name, parameter, Scope.REQUEST);
    }
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);
        }
        request.appendAsHtmlEncoded(field.getName());
View Full Code Here

            LOG.debug("requested file set = " + filePath);

        } else {
            final int lastSlash = filePath.lastIndexOf('/');
            if (lastSlash == -1) {
                throw new ScimpiException("No slash in request path: " + filePath);
            }
            final String path = filePath.substring(0, lastSlash + 1);
            LOG.debug("requested path set = " + path);
            this.requestedParentPath = path;
View Full Code Here

        return resourceParentPath;
    }

    public void setResourcePath(final String filePath) {
        if (filePath == null) {
            throw new ScimpiException("Path must be specified");
        } else {
            final int lastSlash = filePath.lastIndexOf('/');
            if (lastSlash == -1) {
                throw new ScimpiException("No slash in request path: " + filePath);
            }
            final String path = /* getContextPath() + */filePath.substring(0, lastSlash + 1);
            LOG.debug("resource path set = " + path);
            this.resourceParentPath = path;

View Full Code Here

        className = className == null ? "" : " class=\"" + className + "\"";
        RequestContext context = request.getContext();
        final ObjectAdapter object = context.getMappedObjectOrVariable(id, tableBlock.getElementName());
        final ObjectAssociation field = object.getSpecification().getAssociation(fieldName);
        if (field == null) {
            throw new ScimpiException("No field " + fieldName + " in " + object.getSpecification().getFullIdentifier());
        }
        request.appendHtml("<td" + className + ">");
        if (field.isVisible(IsisContext.getAuthenticationSession(), object, where).isAllowed()) {
            final ObjectAdapter fieldReference = field.get(object);
            final String source = fieldReference == null ? "" : context.mapObject(fieldReference, Scope.REQUEST);
View Full Code Here

            index = next++;
        } else {
            index = Integer.valueOf(field).intValue() - 1;
        }
        if (index < 0 || index >= parameters.length) {
            throw new ScimpiException("Parameter numbers should be between 1 and " + parameters.length + ": " + index);
        }
        parameters[index] = value;
    }
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

                    break;
                }
            }
            reader.close();
        } catch (final IOException e) {
            throw new ScimpiException(e);
        }
    }
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.