Examples of IWidgetInstance


Examples of org.apache.wookie.beans.IWidgetInstance

  public static boolean create(HttpServletRequest request)
      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$
View Full Code Here

Examples of org.apache.wookie.beans.IWidgetInstance

  }
  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);
View Full Code Here

Examples of org.apache.wookie.beans.IWidgetInstance

  @Override
  protected void show(String resourceId, HttpServletRequest request,
      HttpServletResponse response) throws ResourceNotFoundException,
      UnauthorizedAccessException, IOException {
    if (!WidgetKeyManager.isValidRequest(request)) throw new UnauthorizedAccessException();
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new ResourceNotFoundException();
    String name = request.getParameter("propertyname"); //$NON-NLS-1$
    if (name == null || name.trim().equals("")) throw new ResourceNotFoundException();
    String value = null;
    // Note that preferences and shared data keys may be the same!
    // We let the shared data values override.
    IPreference pref = instance.getPreference(name);
    if (pref != null) value = pref.getDvalue();
    ISharedData data = SharedDataHelper.findSharedData(instance, name);
    if (data != null) value = data.getDvalue();
    if (value == null) throw new ResourceNotFoundException();
    PrintWriter out = response.getWriter();
View Full Code Here

Examples of org.apache.wookie.beans.IWidgetInstance

  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)){
View Full Code Here

Examples of org.apache.wookie.beans.IWidgetInstance

  public static void createOrUpdate(HttpServletRequest request)
  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);
View Full Code Here

Examples of org.apache.wookie.beans.IWidgetInstance

  /* (non-Javadoc)
   * @see org.apache.wookie.controller.Controller#show(java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected void show(String resourceId, HttpServletRequest request, HttpServletResponse response) throws ResourceNotFoundException, UnauthorizedAccessException, IOException {
     IWidgetInstance instance = WidgetInstancesController.getLocalizedWidgetInstance(request);
     if (instance == null){
       throw new ResourceNotFoundException();
     } else {
       // Check the API key matches
       String apiKey = request.getParameter("api_key");
       if (!instance.getApiKey().equals(apiKey)) throw new UnauthorizedAccessException();
       // Return the response XML
       checkProxy(request);
       String url = getUrl(request, instance);
       String locale = request.getParameter("locale");//$NON-NLS-1$
       response.setContentType(CONTENT_TYPE);
View Full Code Here

Examples of org.apache.wookie.beans.IWidgetInstance

   * Locks a widget instance
   * @param request
   * @throws InvalidParametersException
   */
  public static void doStopWidget(HttpServletRequest request) throws InvalidParametersException{       
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request)
    if(instance!=null){
      lockWidgetInstance(instance);
      Notifier.notifyWidgets(request.getSession(), instance, Notifier.STATE_UPDATED);
    }else{
      throw new InvalidParametersException();
View Full Code Here

Examples of org.apache.wookie.beans.IWidgetInstance

   * UNlocks a widget insa
   * @param request
   * @throws InvalidParametersException
   */
  public static void doResumeWidget(HttpServletRequest request) throws InvalidParametersException{         
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if(instance!=null){
      unlockWidgetInstance(instance);
      Notifier.notifyWidgets(request.getSession(), instance, Notifier.STATE_UPDATED);
    }else{
      throw new InvalidParametersException();
View Full Code Here

Examples of org.apache.wookie.beans.IWidgetInstance

      return;
    }

    checkProxy(request);
   
    IWidgetInstance instance = WidgetInstancesController.getLocalizedWidgetInstance(request);
        String locale = request.getParameter("locale");//$NON-NLS-1$
   
    // Widget exists
    if(instance==null){
      instance = WidgetInstanceFactory.getWidgetFactory(session, localizedMessages).newInstance(apiKey, userId, sharedDataKey, serviceType, widgetId, locale);
View Full Code Here

Examples of org.apache.wookie.beans.IWidgetInstance

   * Create a clone of the instance
   * @param request
   * @throws InvalidParametersException
   */
  public static void cloneSharedData(HttpServletRequest request) throws InvalidParametersException{
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request)
    if (instance == null){
      throw new InvalidParametersException();   
    }
    String sharedDataKey = request.getParameter("shareddatakey");   //$NON-NLS-1$; 
    String cloneSharedDataKey = request.getParameter("cloneshareddatakey");
    if (sharedDataKey == null || sharedDataKey.trim().equals("") || cloneSharedDataKey == null || cloneSharedDataKey.trim().equals("")){//$NON-NLS-1$ //$NON-NLS-2$
      throw new InvalidParametersException();
    }
    String cloneKey = SharedDataHelper.getInternalSharedDataKey(instance, cloneSharedDataKey);
        IWidget widget = instance.getWidget();
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    for (ISharedData sharedData : SharedDataHelper.findSharedData(instance))
    {
        ISharedData clone = persistenceManager.newInstance(ISharedData.class);
            clone.setDkey(sharedData.getDkey());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.