Examples of findByValue()


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

    //
    // Locate instances using the old key and migrate to the new key
    //
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance[] widgetInstances = persistenceManager.findByValue(IWidgetInstance.class, "sharedDataKey", oldKey);
    for (IWidgetInstance widgetInstance:widgetInstances){
      widgetInstance.setSharedDataKey(newKey);
      persistenceManager.save(widgetInstance);
    }
View Full Code Here

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

    }

    //
    // locate shared data objects using the old key and migrate to the new key
    //
    ISharedData[] sharedDataItems = persistenceManager.findByValue(ISharedData.class, "sharedDataKey", oldKey);
    for (ISharedData sharedData: sharedDataItems){
      sharedData.setSharedDataKey(newKey);
      persistenceManager.save(sharedData);
    }
   
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()

   
    //
    // Key not found
    //
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IApiKey[] apiKeyBean = persistenceManager.findByValue(IApiKey.class, "value", apiKey);
    if (apiKeyBean == null || apiKeyBean.length != 1) {
      _logger.info("Invalid API key supplied: " + apiKey);
      return false;
    }
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()

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

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

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

       
        //
        // test findByValue method for IWidget
        //
        String widgetGuid = allWidgets[0].getIdentifier();
        IWidget [] widgetsByValue = persistenceManager.findByValue(IWidget.class, "guid", widgetGuid);
        assertNotNull(widgetsByValue);
        assertEquals(1, widgetsByValue.length);
        assertEquals(allWidgets[0], widgetsByValue[0]);
              
        //
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.