Package org.wymiwyg.wrhapi

Examples of org.wymiwyg.wrhapi.HandlerException


      // change references with pseudo-url "formfile:"
      FormModelPost.handleFormFiles(
          new URL(agentProfileDocument.getURI()), importing, request,
          model, hashStore);
    } catch (MalformedURLException e) {
      throw new HandlerException("Not an URL for PPD "
          + agentProfileDocument.getURI(), e);
    }

    agentProfileDocument.addProperty(RDF.type, FOAFEX.AgentProfileDocument);
    agentProfileDocument.addProperty(RDF.type,
View Full Code Here


   */
  private void verifyAgentNew(Resource agent) throws HandlerException {
    // check with IFP if agent already exists
    Resource existing = getExistingAgent(agent);
    if (existing != null) {
      throw new HandlerException("Agent already exist: " + existing);
    }
  }
View Full Code Here

                        Aggregator.aggregateTarget(resource, null);
                    } finally {
                        model.enterCriticalSection(ModelLock.READ);
                    }
                } catch (IOException e) {
                    throw new HandlerException(e);
                } catch (AggregatingToOwnInstanceException e) {
                    resource.addProperty(RDF.type, RWCF.AuthoritativelyServedResource);
                } catch (RuntimeException e) {
                    log.warn("could not aggregate "+resource, e);
                }
View Full Code Here

    try {
        HttpURLTools tools = new HttpURLTools(new URL(url));
        tools.setAccept("application/rdf+xml, */*;q=.1");
      importing.read(tools.getConnection().getInputStream(), url);
    } catch (Exception ex) {
      throw new HandlerException("Exception retriewing "+url,ex);
    }
       
    model.enterCriticalSection(ModelLock.READ);
    try {
      foafImportProcess(importing);
View Full Code Here

       Resource source = model.getResource(sourceURLString);
       String targetTypeString = body.getParameter("targetType");
       String targetURLString = body.getParameter("target");
       boolean inline = "on".equals(body.getParameter("inline"));
       if (targetURLString.equals("http://") || targetURLString.equals("")) {
            throw new HandlerException("Must specify a target");
        }
        Resource target;
        try {
            target = getTarget(targetTypeString, targetURLString, new URL(
                    source.getURI()));
        } catch (MalformedURLException e) {
            throw new HandlerException(e);
        }
        removeExisting(source, target);
      
        Resource newRelation = model.createResource(KNOBOT.Relation);
View Full Code Here

       
            URL relationTargetURL;
            try {
                relationTargetURL = new URL(baseURL, targetString);
            } catch (MalformedURLException e) {
                throw new HandlerException(e);
            }
            Resource targetResource =  model.createResource(relationTargetURL
                    .toString());
        if (targetTypeString.equals("url") || targetTypeString.equals("select")) {
            return targetResource;
        } else {
            Property ifp = null;
            if (targetTypeString.equals("mbox")) {
                ifp = FOAF.mbox;
            }
            if (targetTypeString.equals("descriptionDocument")) {
                ifp = FOAF.isPrimaryTopicOf; //FOAFEX.agentDescriptionDocument;
            }
            if (ifp == null) {
                throw new HandlerException("unsupported target-type: "+targetTypeString);
            }
            return BaseItemPostHandler.lookUpByIFP(model, ifp, targetResource);
        }
    }
View Full Code Here

    public void handle(Request request, Response response, HandlerChain chain)
            throws HandlerException {
       Resource user = VirtuserHandler.getSubject();
       String[] uriStrings = request.getRequestURI().getParameterValues("uri");
       if ((uriStrings == null) || (uriStrings.length != 1)) {
           throw new HandlerException("must be invoked with exactly one uri param");
       }
       Resource item = model.getResource(uriStrings[0]);
       log.info("marking "+item+" as read by "+user);
       item.addProperty(KNOBOT.isReadBy, user);
       //MultiPartBody body = (MultiPartBody) request.getBody();
View Full Code Here

TOP

Related Classes of org.wymiwyg.wrhapi.HandlerException

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.