Package org.apache.wookie

Examples of org.apache.wookie.Messages


   * (non-Javadoc)
   * @see org.apache.wookie.ajaxmodel.IWidgetAPI#setSharedDataForKey(java.lang.String, java.lang.String, java.lang.String)
   */
  public String setSharedDataForKey(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");
    //
    PropertiesController.updateSharedDataEntry(widgetInstance, key, value, false);
    Notifier.notifySiblings(widgetInstance);
    return "okay"; //$NON-NLS-1$
  }
View Full Code Here


   * (non-Javadoc)
   * @see org.apache.wookie.ajaxmodel.IWidgetAPI#appendSharedDataForKey(java.lang.String, java.lang.String, java.lang.String)
   */
  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");
    //
    PropertiesController.updateSharedDataEntry(widgetInstance, key, value, true);
    Notifier.notifySiblings(widgetInstance);
    return "okay"; //$NON-NLS-1$
  }
View Full Code Here

   * (non-Javadoc)
   * @see org.apache.wookie.ajaxmodel.IWidgetAPI#lock(java.lang.String)
   */
  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 = widgetInstance.getSharedDataKey();
    WidgetInstancesController.lockWidgetInstance(widgetInstance);
    Notifier.callSiblings(widgetInstance,"Widget.onLocked(\""+sharedDataKey+"\");");//$NON-NLS-1$
        return "okay"; //$NON-NLS-1$
View Full Code Here

   * (non-Javadoc)
   * @see org.apache.wookie.ajaxmodel.IWidgetAPI#unlock(java.lang.String)
   */
  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 = widgetInstance.getSharedDataKey();
    WidgetInstancesController.unlockWidgetInstance(widgetInstance);
    Notifier.callSiblings(widgetInstance,"Widget.onUnlocked(\""+sharedDataKey+"\");");//$NON-NLS-1$
        return "okay"; //$NON-NLS-1$
View Full Code Here

   * (non-Javadoc)
   * @see org.apache.wookie.ajaxmodel.IWidgetAPI#hide(java.lang.String)
   */
  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

   * (non-Javadoc)
   * @see org.apache.wookie.ajaxmodel.IWidgetAPI#show(java.lang.String)
   */
  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

  /* (non-Javadoc)
   * @see org.apache.wookie.feature.wave.IWaveAPI#getParticipants(java.lang.String)
   */
  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 = new SharedContext(widgetInstance).getParticipants();
    return ParticipantHelper.createJSONParticipantsDocument(participants);
  }
View Full Code Here

    } while (iOffset < tokenBunch.length());
   
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(idKey);
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);   

    if(widgetInstance==null) {
      return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
    }

    Map<String, String> oAuthParams = queryOAuthParams(idKey);
    if (oAuthParams == null) {
      return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$     
    }
   
    IOAuthToken oauthToken = persistenceManager.findOAuthToken(widgetInstance);
    if (oauthToken == null) oauthToken = persistenceManager.newInstance(IOAuthToken.class);
    oauthToken.setAccessToken(oAuthTokenBunch.get("access_token"));
View Full Code Here

  /* (non-Javadoc)
   * @see org.apache.wookie.feature.wave.IWaveAPI#getViewer(java.lang.String)
   */
  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 = new SharedContext(widgetInstance).getViewer(widgetInstance);
    if (participant != null) return ParticipantHelper.createJSONParticipantDocument(participant); //$NON-NLS-1$
    return null; // no viewer i.e. widget is anonymous
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.apache.wookie.feature.wave.IWaveAPI#submitDelta(java.lang.String, java.util.Map)
   */
  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())
      new SharedContext(widgetInstance).updateSharedData(key, map.get(key), false);
    Notifier.notifySiblings(widgetInstance);
    return "okay"; //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.apache.wookie.Messages

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.