Package org.apache.wookie.beans.util

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


    IWidgetInstance instance;

    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    String id_key = request.getParameter("id_key"); //$NON-NLS-1$
    if (id_key != null & id_key != ""){
      instance = persistenceManager.findWidgetInstanceByIdKey(id_key);
      return instance;
    }

    try {
      String apiKey = URLDecoder.decode(request.getParameter("api_key"), "UTF-8"); //$NON-NLS-1$
View Full Code Here


      //
      // Check that the request is coming from a valid widget
      //
      IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
      IWidgetInstance instance = persistenceManager.findWidgetInstanceByIdKey(request.getParameter("instanceid_key"))
      if(instance == null && !isDefaultGadget(request)){
        response.sendError(HttpServletResponse.SC_FORBIDDEN,"<error>"+UNAUTHORISED_MESSAGE+"</error>")
        return;
      }
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

    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<IContent> startFiles = widgetInstance.getWidget().getContentList();
    String startFileUrl = null;
    for(IContent 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

    // This will only happen if the resource is the Start File for the Widget
    //
    String idkey = ((HttpServletRequest) request).getParameter("idkey");
    if (idkey != null){
      IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
      IWidgetInstance instance = persistenceManager.findWidgetInstanceByIdKey(idkey);
      if (instance != null) {
        filterConfig.getServletContext().setAttribute("widget-id", instance.getWidget().getIdentifier());
        filterConfig.getServletContext().setAttribute("widget-instance-locale", instance.getLang());
        filterConfig.getServletContext().setAttribute("widget-default-locale", instance.getWidget().getDefaultLocale());
        return instance.getWidget();
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

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.