Examples of findWidgetInstanceByIdKey()


Examples of org.apache.wookie.beans.util.IPersistenceManager.findWidgetInstanceByIdKey()

   */
  public String lock(String id_key) {
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance == null) return localizedMessages.getString("WidgetAPIImpl.0");
    //
    String sharedDataKey = SharedDataHelper.getInternalSharedDataKey(widgetInstance);
    WidgetInstancesController.lockWidgetInstance(widgetInstance);
    Notifier.callSiblings(widgetInstance,"Widget.onLocked(\""+sharedDataKey+"\");");//$NON-NLS-1$
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findWidgetInstanceByIdKey()

   */
  public String unlock(String id_key) {
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance==null) return localizedMessages.getString("WidgetAPIImpl.0");
    //
    String sharedDataKey = SharedDataHelper.getInternalSharedDataKey(widgetInstance);
    WidgetInstancesController.unlockWidgetInstance(widgetInstance);
    Notifier.callSiblings(widgetInstance,"Widget.onUnlocked(\""+sharedDataKey+"\");");//$NON-NLS-1$
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findWidgetInstanceByIdKey()

   */
  public String hide(String id_key){
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if (widgetInstance == null) return localizedMessages.getString("WidgetAPIImpl.0");
    //
    Notifier.callSiblings(widgetInstance,"window.onHide()");//$NON-NLS-1$
      return "okay"; //$NON-NLS-1$
  }
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findWidgetInstanceByIdKey()

   */
  public String show(String id_key){
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance==null) return localizedMessages.getString("WidgetAPIImpl.0");
    Notifier.callSiblings(widgetInstance,"window.onShow()"); //$NON-NLS-1$
      return "okay"; //$NON-NLS-1$
  }

View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findWidgetInstanceByIdKey()

  @SuppressWarnings("static-access")
  public String appendSharedDataForKey(String id_key, String key, String value) {
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);              
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();  
    IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance == null) return localizedMessages.getString("WidgetAPIImpl.0");
    if(widgetInstance.isLocked()) return localizedMessages.getString("WidgetAPIImpl.2");
    if(ContextListener.useSharedDataInstanceQueues){//
      QueueManager.getInstance().queueSetSharedDataRequest(id_key, SharedDataHelper.getInternalSharedDataKey(widgetInstance), key, value, true);
    }
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findWidgetInstanceByIdKey()

      state.put("message", localizedMessages.getString("WidgetAPIImpl.0"));   //$NON-NLS-1$
      return state;
    }
    // check if instance is valid
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if (widgetInstance == null){
      state.put("message", localizedMessages.getString("WidgetAPIImpl.0"));   //$NON-NLS-1$
      return state;     
    }
    //
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findWidgetInstanceByIdKey()

  public String getParticipants(String id_key) {
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
    if(id_key == null) return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance==null) return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
    IParticipant[] participants = persistenceManager.findParticipants(widgetInstance);
    return ParticipantHelper.createJSONParticipantsDocument(participants);
  }
 
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findWidgetInstanceByIdKey()

  public String getViewer(String id_key) {
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
    if(id_key == null) return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance == null) return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
        IParticipant participant = persistenceManager.findParticipantViewer(widgetInstance);
    if (participant != null) return ParticipantHelper.createJSONParticipantDocument(participant); //$NON-NLS-1$
    return null; // no viewer i.e. widget is anonymous
  }
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findWidgetInstanceByIdKey()

   */
  public String submitDelta(String id_key, Map<String,String>map){
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance == null) return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
    if(widgetInstance.isLocked()) return localizedMessages.getString("WidgetAPIImpl.2"); //$NON-NLS-1$
    //
    for (String key: map.keySet())
       PropertiesController.updateSharedDataEntry(widgetInstance, key, map.get(key), false);
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findWidgetInstanceByIdKey()

      //
      // Check that the request is coming from a valid widget
      //
      IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
      IWidgetInstance instance = persistenceManager.findWidgetInstanceByIdKey(request.getParameter("instanceid_key"))
      if(instance == null && !isDefaultGadget(request)){
        response.sendError(HttpServletResponse.SC_FORBIDDEN,"<error>"+UNAUTHORISED_MESSAGE+"</error>")
        return;
      }
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.