Package org.apache.wookie.beans.util

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


  public String getViewer(String id_key) {
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
    if(id_key == null) return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance == null) return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
    IParticipant participant = new SharedContext(widgetInstance).getViewer(widgetInstance);
    if (participant != null) return ParticipantHelper.createJSONParticipantDocument(participant); //$NON-NLS-1$
    return null; // no viewer i.e. widget is anonymous
  }
View Full Code Here


   */
  public String submitDelta(String id_key, Map<String,String>map){
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(id_key);
    if(widgetInstance == null) return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
    if(widgetInstance.isLocked()) return localizedMessages.getString("WidgetAPIImpl.2"); //$NON-NLS-1$
    //
    for (String key: map.keySet())
      new SharedContext(widgetInstance).updateSharedData(key, map.get(key), false);
View Full Code Here

    int iPos = idKey_RedirectUri.indexOf('#');
    String idKey = idKey_RedirectUri.substring(0, iPos);
    String redirectUri = idKey_RedirectUri.substring(iPos + 1);
    if(idKey == null) return "invalid";   
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(idKey);
    if(widgetInstance==null) return "invalid";
   
    Collection<IStartFile> startFiles = widgetInstance.getWidget().getStartFiles();
    String startFileUrl = null;
    for(IStartFile startFile : startFiles) {
View Full Code Here

  }
 
  public String queryToken(String idKey) {
    if(idKey == null) return "invalid";
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(idKey);
    if(widgetInstance==null) return "invalid";
   
    IOAuthToken oauthToken = persistenceManager.findOAuthToken(widgetInstance);
    if (oauthToken != null) {
      if (!oauthToken.isExpires())
View Full Code Here

  }
 
  public void invalidateToken(String idKey) {
    if(idKey == null) return;
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(idKey);
    if(widgetInstance==null) return;
   
    IOAuthToken oauthToken = persistenceManager.findOAuthToken(widgetInstance);
    if (oauthToken != null) {
      persistenceManager.delete(oauthToken);
View Full Code Here

  }
 
  public String getClientId(String idKey) {
    if(idKey == null) return "invalid";
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(idKey);
    if(widgetInstance==null) return "invalid";
    IOAuthToken oauthToken = persistenceManager.findOAuthToken(widgetInstance);
    if (oauthToken != null) {
      return oauthToken.getClientId();
    } else {
View Full Code Here

      if (iEqual < 0) continue;
      oAuthTokenBunch.put(fragment.substring(0, iEqual), fragment.substring(iEqual + 1));
    } while (iOffset < tokenBunch.length());
   
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(idKey);
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    Messages localizedMessages = LocaleHandler.localizeMessages(request);   

    if(widgetInstance==null) {
      return localizedMessages.getString("WidgetAPIImpl.0"); //$NON-NLS-1$
View Full Code Here

    return oauthToken.getAccessToken();
  }
 
  private Map<String, String> queryOAuthParams(String idKey) {
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByIdKey(idKey);
    if(widgetInstance==null) return null;
   
    Collection<org.apache.wookie.beans.IFeature> widgetFeatures = widgetInstance.getWidget().getFeatures();
    org.apache.wookie.beans.IFeature oAuthFeature = null;
    for (org.apache.wookie.beans.IFeature aFeature : widgetFeatures) {
View Full Code Here

    if (id_key == null){
      id_key = request.getParameter("idkey");
    }
   
    if (id_key != null & id_key != ""){
      instance = persistenceManager.findWidgetInstanceByIdKey(id_key);
      return instance;
    }
    // Try using the resource part of the path as an id key e.g. widgetinstances/xyz
    id_key = getResourceId(request);
    if (id_key != null & id_key != ""){
View Full Code Here

      return instance;
    }
    // Try using the resource part of the path as an id key e.g. widgetinstances/xyz
    id_key = getResourceId(request);
    if (id_key != null & id_key != ""){
      instance = persistenceManager.findWidgetInstanceByIdKey(id_key);
      return instance;
    }
    //
    // If all else fails, try using instance parameters
    //
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.