Examples of SharedContext


Examples of org.apache.wookie.beans.SharedContext

    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);
    } else {
      found = updatePreference(instance, name, null);
    }
    if (!found) throw new ResourceNotFoundException();
View Full Code Here

Examples of org.apache.wookie.beans.SharedContext

    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 {
      updatePreference(instance, name, value);
    }
  }
View Full Code Here

Examples of org.apache.wookie.beans.SharedContext

      try {  
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        persistenceManager.begin();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(bean.getId_key());
        if (widgetInstance != null){
          new SharedContext(widgetInstance).updateSharedData(bean.getKey(), bean.getValue(), bean.append());
          persistenceManager.commit();
        }
      }
      catch (Exception ex) {       
        logger.error("("+queueIdentifer+ " to " +bean.getValue() + ")(Error setting SharedData: "+ ex, ex);
View Full Code Here

Examples of org.apache.wookie.beans.SharedContext

      throw new InvalidParametersException();
    }
    String cloneKey = SharedDataHelper.getInternalSharedDataKey(instance, cloneSharedDataKey);
        IWidget widget = instance.getWidget();
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    for (ISharedData sharedData : new SharedContext(instance).getSharedData())
    {
        ISharedData clone = persistenceManager.newInstance(ISharedData.class);
            clone.setDkey(sharedData.getDkey());
            clone.setDvalue(sharedData.getDvalue());
            clone.setSharedDataKey(cloneKey);
View Full Code Here

Examples of org.apache.wookie.beans.SharedContext

    boolean ok = persistenceManager.save(widget);
    if (!ok) throw new InvalidParametersException();
  }
 
  public synchronized static void lockWidgetInstance(IWidgetInstance instance){
    new SharedContext(instance).updateSharedData("isLocked", "true", false); //$NON-NLS-1$ //$NON-NLS-2$
    instance.setLocked(true);
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    persistenceManager.save(instance);
  }
View Full Code Here

Examples of org.apache.wookie.beans.SharedContext

    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    persistenceManager.save(instance);
  }

  public synchronized static void unlockWidgetInstance(IWidgetInstance instance){
    new SharedContext(instance).updateSharedData("isLocked", "false", false); //$NON-NLS-1$ //$NON-NLS-2$
    instance.setLocked(false);
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    persistenceManager.save(instance);
  }
View Full Code Here

Examples of org.apache.wookie.beans.SharedContext

 
  @Override
  public void show(String resourceId,HttpServletRequest request, HttpServletResponse response) throws UnauthorizedAccessException,ResourceNotFoundException, IOException{
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance == null) throw new ResourceNotFoundException();
    IParticipant[] participants = new SharedContext(instance).getParticipants();
    switch (format(request)) {
       case XML: returnXml(ParticipantHelper.createXMLParticipantsDocument(participants),response);break;
       case JSON: returnJson(ParticipantHelper.createJSONParticipantsDocument(participants),response);break;
       default: returnXml(ParticipantHelper.createXMLParticipantsDocument(participants),response);break;
    }
View Full Code Here

Examples of org.apache.wookie.beans.SharedContext

    if (participantId == null || participantId.trim().equals("")) {
      _logger.error("participant_id parameter cannot be null");
      throw new InvalidParametersException();
    }

    if (new SharedContext(instance).addParticipant(participantId, participantDisplayName, participantThumbnailUrl, participantRole)){
      Notifier.notifyWidgets(session, instance, Notifier.PARTICIPANTS_UPDATED);
      _logger.debug("added user to widget instance: " + participantId);
      return true;
    } else {
      // No need to create a new participant, it already existed
View Full Code Here

Examples of org.apache.wookie.beans.SharedContext

      InvalidParametersException {
    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(new SharedContext(instance).removeParticipant(participantId)){
      Notifier.notifyWidgets(session, instance, Notifier.PARTICIPANTS_UPDATED);
      return true;
    }else{
      throw new ResourceNotFoundException();       
    }
View Full Code Here

Examples of org.apache.wookie.beans.SharedContext

    if(id_key==null) return localizedMessages.getString("WidgetAPIImpl.0");
    if(key==null) return localizedMessages.getString("WidgetAPIImpl.1");
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if (widgetInstance == null) return localizedMessages.getString("WidgetAPIImpl.0");
    ISharedData data = new SharedContext(widgetInstance).getSharedData(key);
    if (data == null) return localizedMessages.getString("WidgetAPIImpl.1");
    return data.getDvalue();
  }
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.