Package org.wymiwyg.wrhapi

Examples of org.wymiwyg.wrhapi.HandlerException


   
      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")) {
      return targetResource;
    } else {
      Property ifp = null;
      if (targetTypeString.equals("mbox")) {
        ifp = FOAF.mbox;
      }
      if (targetTypeString.equals("descriptionDocument")) {
        ifp = FOAF.isPrimaryTopicOf;
      }
      if (ifp == null) {
        throw new HandlerException("unsupported target-type: "+targetTypeString);
      }
      return BaseItemPostHandler.lookUpByIFP(model, ifp, targetResource);
    }
  }
View Full Code Here


    long nextDownload = System.currentTimeMillis() + interval * 60 * 1000;
    newAggregator.addProperty(AGGREGATOR.nextDownload, model.createTypedLiteral(nextDownload));
    try {
      Aggregator.aggregate(newAggregator);
    } catch (IOException ex) {
      throw new HandlerException(ex);
    }
  }
View Full Code Here

    String item = requestBody.getParameter("item");
    URL itemURL;
    try {
      itemURL = new URL(new URL(target.getURI()), item);
    } catch (MalformedURLException e) {
      throw new HandlerException(e);
    }
    Resource itemRes = model.getResource(itemURL.toString());
    if (logger.isDebugEnabled()) {
      logger.debug("Performing action on " + itemRes);
    }
View Full Code Here

      ResIterator iter = model.listSubjectsWithProperty(KNOBOT.target);
      process(iter, out);
      out.close();
     
    } catch (IOException e) {
      throw new HandlerException(e);
    }
   

  }
View Full Code Here

      //gd.stop();
      //gd.restartLayout();
      serializeGraphAsImage(gd, out);
      out.close();
    } catch (IOException e) {
      throw new HandlerException(e);
    } finally {
      //gd.stop();
    }

  }
View Full Code Here

                      * "gif" yet.
                      */
      , out);
      out.close();
    } catch (Exception ex) {
      throw new HandlerException(ex);
    }
  }
View Full Code Here

    int itemsPerTopic = Integer.parseInt(body.getParameter("itemsPerTopic"));
    boolean defalutAllowComments = "allow".equals(body.getParameter("comments"));
    String defaultTimeZoneString = body.getParameter("defaultTimeZone");
    float defaultChildStrength = Float.parseFloat(defaultChildStrengthString);
    if ((defaultChildStrength > 1) || (defaultChildStrength < 0)) {
      throw new HandlerException("Invalid value");
    }
    float defaultStrengthReduction = Float.parseFloat(defaultStrengthReductionString);
    if ((defaultStrengthReduction > 1) || (defaultStrengthReduction < 0)) {
      throw new HandlerException("Invalid value");
    }
    Resource defaults = model.createResource(DefaultValuesHandler.defaults);
    defaults.removeAll(DefaultValuesHandler.defaultChildStrength);
    defaults.removeAll(DefaultValuesHandler.notificationEmail);
    defaults.removeAll(DefaultValuesHandler.defaultTimeZone);
View Full Code Here

    PipedReader reader = new PipedReader();
    PipedWriter writer;
    try {
      writer = new PipedWriter(reader);
    } catch (IOException e) {
      throw new HandlerException(e);
    }
    response.setBody(reader);

    PrintWriter out = new PrintWriter(writer);
    if (!delete) {
View Full Code Here

    EnhancedResponse ehResponse = new EnhancedResponse(response);
    String go = body.getParameter("go");
    if (go == null) {
      String[] referers = request.getHeaderValues(HeaderName.REFERER);
      if (referers.length == 0) {
        throw new HandlerException("no 'go' parameter specified and no htpp-referer found");
      }
      go =referers[0] ;
    }
    ehResponse.sendRedirect(go);
View Full Code Here

    String itemURIString = body.getParameter("item");
    // since this doesn't read, I assume it need no read-lock
    Resource item = model.createResource(itemURIString);
    String recipientURIStrings[] = body.getParameterValues("recipient");
    if (recipientURIStrings == null) {
      throw new HandlerException("A recipient must be specified");
    }
    AcceptLanguagesIterator acceptedLanguages = ehRequest.getAcceptLanguages();
    InternetAddress fromAddress;
    String fromString = body.getParameter("from");
    if ((fromString != null) && (!fromString.equals(""))) {
      try {
        fromAddress = getIntenetAddress(model.createResource(fromString));
      } catch (AddressException e) {
        throw new HandlerException("Couldn't get address", e);
      }
    } else {
      try {
        fromAddress = getDefaultAddress(model);
      } catch (AddressException e) {
        throw new HandlerException("Couldn't get default address", e);
      }
    }

    sendItem(item, fromAddress, recipientURIStrings, acceptedLanguages,
        ehRequest.getRootURL(), hashStore);

    PipedWriter pipedOut = new PipedWriter();
    PipedReader pipedReader;
    try {
      pipedReader = new PipedReader(pipedOut);
    } catch (IOException e) {
      throw new HandlerException(e);
    }
    response.setHeader(HeaderName.CONTENT_TYPE, "application/xhtml+xml");
    response.setBody(pipedReader);
   
    PrintWriter out = new PrintWriter(pipedOut);
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.