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()

   
    //
    // 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", 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()

    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 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()

      persistenceManager.delete(participants);
          ISharedData[] sharedData =  SharedDataHelper.findSharedData(instance);
          persistenceManager.delete(sharedData);
         
      // remove any preferences
      IPreference[] preferences = persistenceManager.findByValue(IPreference.class, "widgetInstance", instance);
      persistenceManager.delete(preferences);
     
      // remove the instance
      WidgetInstanceFactory.destroy(instance);
     
View Full Code Here

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

      WidgetInstanceFactory.destroy(instance);
     
    }

    // remove any AccessRequests
        IAccessRequest[] accessRequests = persistenceManager.findByValue(IAccessRequest.class, "widget", widget);
        persistenceManager.delete(accessRequests);
       
    // remove the widget itself
    persistenceManager.delete(widget);
    return true;
View Full Code Here

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

            accessRequests = persistenceManager.findAll(IAccessRequest.class);
        }
    if (widgetId != null && widgetId.trim().length()>0){
      // Filter by widgetId
      IWidget widget = persistenceManager.findById(IWidget.class, widgetId);
            if (widget != null) accessRequests = persistenceManager.findByValue(IAccessRequest.class, "widget", widget);
    }
   
    switch (format(request)) {
      case XML: returnXml(AccessRequestHelper.createXMLAccessRequestDocument(accessRequests),response);break;
      case HTML: returnHtml(AccessRequestHelper.createAccessRequestHTMLTable(accessRequests),response);break;
View Full Code Here

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

    String url = request.getParameter("url");
    if (url == null || url.trim().length() == 0) throw new InvalidParametersException();
    if (!IRIValidator.isValidIRI(url)) throw new InvalidParametersException();
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    // Check for duplicates
    IWhitelist[] matches = persistenceManager.findByValue(IWhitelist.class, "fUrl", url);
    if (matches.length != 0) throw new ResourceDuplicationException();
    IWhitelist entry = persistenceManager.newInstance(IWhitelist.class);
    entry.setfUrl(url);
    return persistenceManager.save(entry);
  }
View Full Code Here

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

  public static boolean revokeKey(String value){
    if (value == null) return false;
    if (value.trim().equals("")) return false;
    value = value.trim();
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IApiKey[] key = persistenceManager.findByValue(IApiKey.class, "value", value);
    if (key == null || key.length !=1) return false;
    return revokeKey(persistenceManager, key[0]);
  }
 
  /**
 
View Full Code Here

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

    }

    // Empty key/empty origin
    if (key.trim().equals("")) return false; //$NON-NLS-1$
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IApiKey[] apiKey = persistenceManager.findByValue(IApiKey.class, "value", key);
    if (apiKey == null || apiKey.length !=1) {
      _logger.info("Invalid API key supplied: " + key);
      return false;
    }
    return true;
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.