Examples of findByValue()


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

      for (IParticipant participant:participants){
        persistenceManager.delete(participant);
      }
     
      // 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()

      // remove the instance
      WidgetInstanceFactory.destroy(instance);
    }

    // remove any AccessRequests
        IAccessRequest[] accessRequests = persistenceManager.findByValue(IAccessRequest.class, "widget", widget);
        persistenceManager.delete(accessRequests);

        //remove SharedDataEntries
        ISharedData[] sharedData = persistenceManager.findByValue(ISharedData.class, "widget", widget);
        persistenceManager.delete(sharedData);
View Full Code Here

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

    // remove any AccessRequests
        IAccessRequest[] accessRequests = persistenceManager.findByValue(IAccessRequest.class, "widget", widget);
        persistenceManager.delete(accessRequests);

        //remove SharedDataEntries
        ISharedData[] sharedData = persistenceManager.findByValue(ISharedData.class, "widget", widget);
        persistenceManager.delete(sharedData);
       
    // remove the widget itself
    persistenceManager.delete(widget);
    return true;
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

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

    // attempt to get specific widget by id
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidget widget = persistenceManager.findById(IWidget.class, resourceId);
    // support queries by type
    if (widget == null) {
      IWidgetService[] services = persistenceManager.findByValue(IWidgetService.class, "serviceName", resourceId);
        if (services != null && services.length == 1) {
          IWidget[] widgets = persistenceManager.findWidgetsByType(resourceId);
            returnXml(WidgetHelper.createXMLWidgetsDocument(widgets, getLocalPath(request), getLocales(request)),response);
            return;
        }
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 widgetName = widget.getLocalName("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()

        assertNotNull(widgetDefaultById);
        assertEquals(allWidgetDefaults[0], widgetDefaultById);

        // test generic findByValue methods
        String widgetGuid = allWidgets[0].getGuid();
        IWidget [] widgetsByValue = persistenceManager.findByValue(IWidget.class, "guid", widgetGuid);
        assertNotNull(widgetsByValue);
        assertEquals(1, widgetsByValue.length);
        assertEquals(allWidgets[0], widgetsByValue[0]);
        IWidgetDefault [] widgetDefaultsByValue = persistenceManager.findByValue(IWidgetDefault.class, "widget", widgetById);
        assertNotNull(widgetDefaultsByValue);
View Full Code Here

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

        String widgetGuid = allWidgets[0].getGuid();
        IWidget [] widgetsByValue = persistenceManager.findByValue(IWidget.class, "guid", widgetGuid);
        assertNotNull(widgetsByValue);
        assertEquals(1, widgetsByValue.length);
        assertEquals(allWidgets[0], widgetsByValue[0]);
        IWidgetDefault [] widgetDefaultsByValue = persistenceManager.findByValue(IWidgetDefault.class, "widget", widgetById);
        assertNotNull(widgetDefaultsByValue);
        assertEquals(1, widgetDefaultsByValue.length);
        assertEquals(allWidgetDefaults[0], widgetDefaultsByValue[0]);
       
        // test generic findByValues methods
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.