Package org.apache.wookie.beans.util

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


      oauthToken.setAccessToken(params.get("access_token"));
      oauthToken.setExpires(System.currentTimeMillis() + 1000 * Integer.parseInt(params.get("expires_in")));
      oauthToken.setClientId(oAuthParams.get("clientId"));
      oauthToken.setAuthzUrl(oAuthParams.get("authzServer"));
      oauthToken.setWidgetInstance(widgetInstance);
      persistenceManager.save(oauthToken);
      return oauthToken.getAccessToken();
    } catch (Exception ex) {
      return "invalid";
    }
  }
View Full Code Here


        widgetInstancePreference.setReadOnly(true);
        widgetInstance.getPreferences().add(widgetInstancePreference);
        //
        // Save the widget instance
        //
        persistenceManager.save(widgetInstance);

        //
        // create a participant
        //
        IParticipant participant = persistenceManager.newInstance(IParticipant.class);
View Full Code Here

        //participant.setWidget(widget);
        participant.setSharedDataKey("test-shared-data-key");
        participant.setParticipantId("test");
        participant.setParticipantDisplayName("");
        participant.setParticipantThumbnailUrl("");
        persistenceManager.save(participant);

        //
        // commit and close persistence manager transaction
        //
        persistenceManager.commit();
View Full Code Here

    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    ISharedData sharedData = persistenceManager.newInstance(ISharedData.class);
    sharedData.setSharedDataKey(this.sharedDataKey);
    sharedData.setDkey(name);
    sharedData.setDvalue(value);
    persistenceManager.save(sharedData);
  }
 
  /**
   * Update a single Shared Data object
   * @param name the name (key) of the data object
View Full Code Here

    participant.setParticipantId(participantId);
    participant.setParticipantDisplayName(participantDisplayName);
    participant.setParticipantThumbnailUrl(participantThumbnailUrl);
    participant.setRole(role);
    participant.setSharedDataKey(this.sharedDataKey);
    persistenceManager.save(participant);
    return true;
  }

  /**
   * Remove a participant from the shared context
View Full Code Here

    {
        ISharedData clone = persistenceManager.newInstance(ISharedData.class);
            clone.setDkey(sharedData.getDkey());
            clone.setDvalue(sharedData.getDvalue());
            clone.setSharedDataKey(cloneKey);
            persistenceManager.save(clone);
    }
    boolean ok = persistenceManager.save(widget);
    if (!ok) throw new InvalidParametersException();
  }
 
View Full Code Here

            clone.setDkey(sharedData.getDkey());
            clone.setDvalue(sharedData.getDvalue());
            clone.setSharedDataKey(cloneKey);
            persistenceManager.save(clone);
    }
    boolean ok = persistenceManager.save(widget);
    if (!ok) throw new InvalidParametersException();
  }
 
  public synchronized static void lockWidgetInstance(IWidgetInstance instance){
    new SharedContext(instance).updateSharedData("isLocked", "true", false); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

 
  public synchronized static void lockWidgetInstance(IWidgetInstance instance){
    new SharedContext(instance).updateSharedData("isLocked", "true", false); //$NON-NLS-1$ //$NON-NLS-2$
    instance.setLocked(true);
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    persistenceManager.save(instance);
  }

  public synchronized static void unlockWidgetInstance(IWidgetInstance instance){
    new SharedContext(instance).updateSharedData("isLocked", "false", false); //$NON-NLS-1$ //$NON-NLS-2$
    instance.setLocked(false);
View Full Code Here

  public synchronized static void unlockWidgetInstance(IWidgetInstance instance){
    new SharedContext(instance).updateSharedData("isLocked", "false", false); //$NON-NLS-1$ //$NON-NLS-2$
    instance.setLocked(false);
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    persistenceManager.save(instance);
  }
 
  // Utility methods
 
  /**
 
View Full Code Here

          (locale != null && instance.getLang()==null) ||          
          (locale != null && !instance.getLang().equals(locale))
      ){
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        instance.setLang(locale);
        persistenceManager.save(instance);
      }
    }
    return instance;
  }
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.