Examples of findByValue()


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

        //
        // test findByValue method for IWidget
        //
        String widgetGuid = allWidgets[0].getGuid();
        IWidget [] widgetsByValue = persistenceManager.findByValue(IWidget.class, "guid", widgetGuid);
        assertNotNull(widgetsByValue);
        assertEquals(1, widgetsByValue.length);
        assertEquals(allWidgets[0], widgetsByValue[0]);
       
        //
View Full Code Here

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

        assertEquals(allWidgets[0], widgetsByValue[0]);
       
        //
        // test findByValue method for IWidgetDefault
        //
        IWidgetDefault [] widgetDefaultsByValue = persistenceManager.findByValue(IWidgetDefault.class, "widget", widgetById);
        assertNotNull(widgetDefaultsByValue);
        assertEquals(1, widgetDefaultsByValue.length);
        assertEquals(allWidgetDefaults[0], widgetDefaultsByValue[0]);
       
        //
View Full Code Here

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

    String widgetName = widget.getWidgetTitle("en");
   
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
   
    // remove any widget instances for this widget
    IWidgetInstance[] instances = persistenceManager.findByValue(IWidgetInstance.class, "widget", widget)
    for(IWidgetInstance instance : instances){
     
      // Delete all participants and shared data associated with any instances
      //
      // Note that we don't call this within WidgetInstanceFactory.destroy() as
View Full Code Here

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

  public ISharedData[] getSharedData(){
    //
    // Obtain a persistence manager and return the results of executing a query of SharedData objects matching the sharedDataKey
    //
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    return (ISharedData[]) persistenceManager.findByValue(ISharedData.class, "sharedDataKey", this.sharedDataKey);
  }
 
  /**
   * Find a specific shared data object for a given Widget Instance and object key
   * @param instance the widget instance
View Full Code Here

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

   * get the participants belonging to this shared context
   * @return an arry of Participant instances, or null if there are no participants
   */
  public IParticipant[] getParticipants(){
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    return persistenceManager.findByValue(IParticipant.class, "sharedDataKey", this.sharedDataKey);
  }
 
  /**
   * Add a participant to a shared context
   * @param participantId the id property of the participant to add
View Full Code Here

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

    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;
    IPreference[] preferences = persistenceManager.findByValue(IPreference.class, "widgetInstance", widgetInstance);
    for (IPreference pref: preferences){
      prefs.add(new PreferenceDelegate(pref));     
    }
    return prefs;
  }
View Full Code Here

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

    if (service == null) throw new ResourceNotFoundException();
    String serviceName = service.getServiceName();
   
    // if exists, remove from widget default table
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetDefault[] widgetDefaults = persistenceManager.findByValue(IWidgetDefault.class, "widgetContext", serviceName);
    persistenceManager.delete(widgetDefaults);
   
    // delete from the widget service table
    persistenceManager.delete(service)
    // remove any widgetTypes for each widget that match
View Full Code Here

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

  private static IWidgetService getWidgetService(String resourceId) throws ResourceNotFoundException{
    if (resourceId == null) throw new ResourceNotFoundException();
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetService ws = persistenceManager.findById(IWidgetService.class, resourceId);
    if (ws == null) {
      IWidgetService[] wsa = persistenceManager.findByValue(IWidgetService.class, "serviceName", resourceId);
      if (wsa != null && wsa.length == 1) ws = wsa[0];
    }
    if (ws == null) throw new ResourceNotFoundException();
    return ws;
  }
View Full Code Here

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

    if(widget==null) return false;
   
    // remove any defaults for this widget
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetDefault[] widgetDefault = persistenceManager.findByValue(IWidgetDefault.class, "widget", widget);
    if (widgetDefault.length == 1) persistenceManager.delete(widgetDefault[0]);
   
    // remove any widget instances for this widget
    IWidgetInstance[] instances = persistenceManager.findByValue(IWidgetInstance.class, "widget", widget)
    for(IWidgetInstance instance : instances){
View Full Code Here

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

        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetDefault[] widgetDefault = persistenceManager.findByValue(IWidgetDefault.class, "widget", widget);
    if (widgetDefault.length == 1) persistenceManager.delete(widgetDefault[0]);
   
    // remove any widget instances for this widget
    IWidgetInstance[] instances = persistenceManager.findByValue(IWidgetInstance.class, "widget", widget)
    for(IWidgetInstance instance : instances){
     
      // Delete all participants associated with any instances
      //
      // Note that we don't call this within WidgetInstanceFactory.destroy() as
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.