Package org.apache.wookie

Examples of org.apache.wookie.Messages


   * (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 = SharedDataHelper.getInternalSharedDataKey(widgetInstance);
    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

   * Note: this method may be deprecated in a future release
   */
  @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);
    }
    else{
      new SharedContext(widgetInstance).updateSharedData(key, value, true);
View Full Code Here

    String apiKey = request.getParameter("api_key"); //$NON-NLS-1$
    String serviceType = request.getParameter("servicetype"); //$NON-NLS-1$
    String widgetId = request.getParameter("widgetid"); //$NON-NLS-1$
    sharedDataKey = SharedDataHelper.getInternalSharedDataKey(apiKey, widgetId, sharedDataKey);
    HttpSession session = request.getSession(true);           
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
         
    if(userId==null || sharedDataKey==null || (serviceType==null && widgetId==null)){
      response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
      return;
    }
View Full Code Here

   * DEPRECATED: This was replaced by the W3C Storage API
   */
  @Deprecated
  public String preferenceForKey(String id_key, String key) {
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
    if(id_key == null) return localizedMessages.getString("WidgetAPIImpl.0");
    if(key == null)return localizedMessages.getString("WidgetAPIImpl.1");
    // check if instance is valid
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if (widgetInstance == null) return localizedMessages.getString("WidgetAPIImpl.0");
    //
    IPreference preference = widgetInstance.getPreference(key);
    if (preference == null) return localizedMessages.getString("WidgetAPIImpl.1");
    return preference.getDvalue();
  }
View Full Code Here

   * DEPRECATED: This was replaced by the Wave Gadget API
   */
  @Deprecated
  public String sharedDataForKey(String id_key, String key) {
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
    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

   */
  @Deprecated
  @SuppressWarnings("static-access")
  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;//
    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, false);
    }
    else{
      new SharedContext(widgetInstance).updateSharedData(key, value, false);
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 = SharedDataHelper.getInternalSharedDataKey(widgetInstance);
    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 = SharedDataHelper.getInternalSharedDataKey(widgetInstance);
    WidgetInstancesController.unlockWidgetInstance(widgetInstance);
    Notifier.callSiblings(widgetInstance,"Widget.onUnlocked(\""+sharedDataKey+"\");");//$NON-NLS-1$
        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.