Package org.apache.wookie.beans.util

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


  public List<IPreference> preferences(String id_key) {
    ArrayList<IPreference> prefs = new ArrayList<IPreference>();
    if(id_key == null) return prefs;
    // check if instance is valid
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance==null) return prefs;
    for(IPreference preference : widgetInstance.getPreferences()){
      prefs.add(new PreferenceDelegate(preference));
    }
    return prefs;
View Full Code Here


    Map<String, String> map = new HashMap<String, String>();
    if(id_key == null) return map;
 
    // check if instance is valid
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance==null) return map;
   
    // Get i18n-enabled metadata for the Widget's locale and encode it using unicode control characters.
   
    String locales[] = {widgetInstance.getLang()};
View Full Code Here

  @SuppressWarnings("static-access")
  public String setPreferenceForKey(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(ContextListener.usePreferenceInstanceQueues){
      QueueManager.getInstance().queueSetPreferenceRequest(id_key, key, value);
    }
    else{
View Full Code Here

    if (localized == null){
      // Find the instance key in the current session
      String key = (String)filterConfig.getServletContext().getAttribute("id_key");
      if (key != null){
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance instance = persistenceManager.findWidgetInstanceByIdKey(key);
        if (instance != null){
          // Only if we have a valid instance and a resource which has no localization
          // parameter do we start the locale algorithm

          // Get the original request URL
View Full Code Here

    public void process(IQueuedBean bean) {     
      //logger.info("("+queueIdentifer+")CONSUME START SharedDataQueueConsumer" + bean.getKey()+ "' TO '" + bean.getValue()+"'"); 
      try {  
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        persistenceManager.begin();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(bean.getId_key());
        if (widgetInstance != null){
          PropertiesController.updateSharedDataEntry(widgetInstance, bean.getKey(), bean.getValue(), bean.append());
          persistenceManager.commit();
        }
      }
View Full Code Here

        assertEquals(widgetInstance0, widgetInstance1);
       
        //
        // Get the widget instance created in the previous transaction via instance_idkey
        //
        IWidgetInstance widgetInstance2 = persistenceManager.findWidgetInstanceByIdKey("test");
        assertNotNull(widgetInstance2);
        assertEquals(widgetInstance0, widgetInstance2);
       
        //
        // Get the participant created in the previous transaction by widget instance
View Full Code Here

  public List<IPreference> preferences(String id_key) {
    ArrayList<IPreference> prefs = new ArrayList<IPreference>();
    if(id_key == null) return prefs;
    // check if instance is valid
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance==null) return prefs;
    for(IPreference preference : widgetInstance.getPreferences()){
      prefs.add(new PreferenceDelegate(preference));
    }
    return prefs;
View Full Code Here

    Map<String, String> map = new HashMap<String, String>();
    if(id_key == null) return map;
 
    // check if instance is valid
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance==null) return map;
    // Add in metadata
    IWidget widget = widgetInstance.getWidget();
    map.put("id", String.valueOf(widget.getGuid()))//$NON-NLS-1$
    map.put("author", String.valueOf(widget.getWidgetAuthor()))//$NON-NLS-1$
View Full Code Here

    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

    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 = 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.