Package org.apache.wookie.exceptions

Examples of org.apache.wookie.exceptions.InvalidParametersException


          requestContainedWgtFile = true;
        }
      }

    } catch (FileUploadException e) {
      throw new InvalidParametersException();
    } catch (Exception e) {
      //
      // Catch any other exceptions thrown by the save file operation
      // and throw a basic 400 response to the client, though really
      // this is more like a 500. At least we can log the details.
      //
      _logger.error(e.getMessage(), e);
      throw new InvalidParametersException();
    }

    //
    // If there are no .wgt files in the POST, throw an exception
    // We have to check for this here as other exceptions are caught in
    // the code above, e.g. generic file system errors
    //
    if (requestContainedWgtFile == false){
      throw new InvalidParametersException();
    }

    return true;
  }
View Full Code Here


    //
    W3CWidget widget;
    try {
      widget = GadgetUtils.createWidget(request);
    } catch (Exception e) {
      throw new InvalidParametersException();
    }

    //
    // If the gadget is not already registered, add it
    //
View Full Code Here

  }

  @Override
  protected boolean remove(String resourceId, HttpServletRequest request)
      throws ResourceNotFoundException,UnauthorizedAccessException,InvalidParametersException {
    if (request.getParameter("value") != null) throw new InvalidParametersException();//$NON-NLS-1$
    String name = request.getParameter("propertyname"); //$NON-NLS-1$
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new InvalidParametersException();
    if (name == null || name.trim().equals("")) throw new InvalidParametersException();
   
    boolean found = false;
    if (isPublic(request)){
      found = new SharedContext(instance).removeSharedData(name);
      Notifier.notifyWidgets(request.getSession(), instance, Notifier.STATE_UPDATED);
View Full Code Here

  public static void createOrUpdate(HttpServletRequest request)
  throws InvalidParametersException,UnauthorizedAccessException {
    String name = request.getParameter("propertyname"); //$NON-NLS-1$
    String value = request.getParameter("propertyvalue"); //$NON-NLS-1$
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new InvalidParametersException();
    if (name == null || name.trim().equals("")) throw new InvalidParametersException();
   
    if (isPublic(request)){
      new SharedContext(instance).updateSharedData(name, value, false);
      Notifier.notifyWidgets(request.getSession(), instance, Notifier.STATE_UPDATED);
    } else {
View Full Code Here

     
      //
      // Problem with the configuration
      //
      _logger.error("Problem with policies configuration", e);
      throw new InvalidParametersException();
     
    } catch (PolicyFormatException e) {
     
      //
      // Format of the policy is incorrect
      //
      throw new InvalidParametersException();
     
    } catch (IOException e) {
     
      //
      // No body
      //
      throw new InvalidParametersException();
    }
  }
View Full Code Here

    } catch (PolicyFormatException e) {

      //
      // The resource isn't formatted correctly
      //
      throw new InvalidParametersException();

    } catch (ConfigurationException e) {

      //
      // Problem with the configuration
      //
      _logger.error("Problem with policies configuration", e);
      throw new InvalidParametersException();
    }

  }
View Full Code Here

      throws ResourceDuplicationException, InvalidParametersException,
      UnauthorizedAccessException {
    if (!WidgetKeyManager.isValidRequest(request)) throw new UnauthorizedAccessException();

    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new InvalidParametersException();
   
    HttpSession session = request.getSession(true);           
    String participantId = request.getParameter("participant_id"); //$NON-NLS-1$
    String participantDisplayName = request.getParameter("participant_display_name"); //$NON-NLS-1$
    String participantThumbnailUrl = request.getParameter("participant_thumbnail_url"); //$NON-NLS-1$
   
    // Check required params
    if (participantId == null || participantId.trim().equals("")) {
      _logger.error("participant_id parameter cannot be null");
      throw new InvalidParametersException();
    }

    if (addParticipantToWidgetInstance(instance, participantId, participantDisplayName, participantThumbnailUrl)){
      Notifier.notifyWidgets(session, instance, Notifier.PARTICIPANTS_UPDATED);
      _logger.debug("added user to widget instance: " + participantId);
View Full Code Here

  public static boolean remove(HttpServletRequest request)
      throws ResourceNotFoundException, UnauthorizedAccessException,
      InvalidParametersException {
    if (!WidgetKeyManager.isValidRequest(request)) throw new UnauthorizedAccessException();
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new InvalidParametersException();
    HttpSession session = request.getSession(true);           
    String participantId = request.getParameter("participant_id"); //$NON-NLS-1$
    if(removeParticipantFromWidgetInstance(instance, participantId)){
      Notifier.notifyWidgets(session, instance, Notifier.PARTICIPANTS_UPDATED);
      return true;
View Full Code Here

  @Override
  protected boolean remove(String resourceId, HttpServletRequest request)
      throws ResourceNotFoundException,UnauthorizedAccessException,InvalidParametersException {
    if (!WidgetKeyManager.isValidRequest(request)) throw new UnauthorizedAccessException();
    if (request.getParameter("value") != null) throw new InvalidParametersException();//$NON-NLS-1$
    String name = request.getParameter("propertyname"); //$NON-NLS-1$
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new InvalidParametersException();
    if (name == null || name.trim().equals("")) throw new InvalidParametersException();
   
    boolean found = false;
    if (isPublic(request)){
      found = updateSharedDataEntry(instance, name, null, false);
      Notifier.notifyWidgets(request.getSession(), instance, Notifier.STATE_UPDATED);
View Full Code Here

  throws InvalidParametersException,UnauthorizedAccessException {
    if (!WidgetKeyManager.isValidRequest(request)) throw new UnauthorizedAccessException();
    String name = request.getParameter("propertyname"); //$NON-NLS-1$
    String value = request.getParameter("propertyvalue"); //$NON-NLS-1$
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new InvalidParametersException();
    if (name == null || name.trim().equals("")) throw new InvalidParametersException();
   
    if (isPublic(request)){
      updateSharedDataEntry(instance, name, value, false);
      Notifier.notifyWidgets(request.getSession(), instance, Notifier.STATE_UPDATED);
    } else {
View Full Code Here

TOP

Related Classes of org.apache.wookie.exceptions.InvalidParametersException

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.