Examples of findWidgetByGuid()


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

   
    //
    // Identify the widget to delete
    //
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidget widget = persistenceManager.findWidgetByGuid(resourceId);
    // attempt to get specific widget by id
    if (widget == null) {
      persistenceManager = PersistenceManagerFactory.getPersistenceManager();
      widget = persistenceManager.findById(IWidget.class, resourceId);
    }
View Full Code Here

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

       
        //
        // Check if the widget model corresponds to an existing installed widget
        //
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        if (persistenceManager.findWidgetByGuid(widgetId) == null) {

            //
            // A new widget was created, so return 201
            //
            WidgetFactory.addNewWidget(widgetModel, zipFile, true);
View Full Code Here

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

            //
            // Widget already exists, so update the widget metadata and configuration details
            // and return 200
            //
            WidgetFactory.update(widgetModel,persistenceManager.findWidgetByGuid(widgetId), true, zipFile);
            returnXml(WidgetImportHelper.createXMLWidgetDocument(widgetModel, new File(fac.getUnzippedWidgetDirectory(), "config.xml"), getWookieServerURL(request, "").toString(), true), response);
            return false;

        }
View Full Code Here

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

    //
    // If the gadget is not already registered, add it
    //
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    if(persistenceManager.findWidgetByGuid(widget.getIdentifier()) == null){
      WidgetFactory.addNewWidget(widget);
      return true;
    } else {
      return false;
    }
View Full Code Here

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

      for(Policy policy: policies){
        JSONObject policyJson = new JSONObject();
        policyJson.put("scope", policy.getScope());
        if (!policy.getScope().equals("*")){
          IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
          IWidget widget = persistenceManager.findWidgetByGuid(policy.getScope());
          if (widget != null){
            policyJson.put("widget-title", WidgetAdvertHelper.getEncodedWidgetTitle(widget, null));
          }
        }
        policyJson.put("origin", policy.getOrigin());
View Full Code Here

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

    // Get the widget id from the session, and if its not null, obtain the widget it relates to
    //
    String guid = (String) filterConfig.getServletContext().getAttribute("widget-id");
    if (guid != null) {
      IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
      return persistenceManager.findWidgetByGuid(guid);
    }
   
    //
    // No widget found
    //
View Full Code Here

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

   * @return an IWidgetInstance for the default widget, typically the "unsupported widget widget"
   */
  public static IWidgetInstance defaultInstance(String locale){
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance instance = persistenceManager.newInstance(IWidgetInstance.class);
    instance.setWidget(persistenceManager.findWidgetByGuid("http://notsupported")); //$NON-NLS-1$
    instance.setIdKey("0000");
    instance.setLang(locale);
    instance.setOpensocialToken("");
    return instance;
  }
View Full Code Here

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

      IWidget widget = null;
      IWidgetInstance widgetInstance;
      // Widget ID or Widget Type?
          IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
      if (widgetId != null){
        widget = persistenceManager.findWidgetByGuid(widgetId);
      }
      // Unsupported
      if (widget == null) return null;

      // generate a nonce
View Full Code Here

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

                            File upload = WidgetFileUtils.dealWithDroppedFile(UPLOADFOLDER, f);
                            W3CWidgetFactory fac = W3CWidgetFactoryUtils.createW3CWidgetFactory(context, configuration, localizedMessages);

                            W3CWidget model = fac.parse(upload);
                            WidgetJavascriptSyntaxAnalyzer jsa = new WidgetJavascriptSyntaxAnalyzer(fac.getUnzippedWidgetDirectory());
                            if(persistenceManager.findWidgetByGuid(model.getIdentifier()) == null) {
                                WidgetFactory.addNewWidget(model, upload, true);
                                String message = model.getLocalName("en") +"' - " + localizedMessages.getString("WidgetAdminServlet.19");
                                _logger.info(message);
                            } else {
                                String message = model.getLocalName("en") +"' - " + localizedMessages.getString("WidgetAdminServlet.20");
View Full Code Here

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

                                WidgetFactory.addNewWidget(model, upload, true);
                                String message = model.getLocalName("en") +"' - " + localizedMessages.getString("WidgetAdminServlet.19");
                                _logger.info(message);
                            } else {
                                String message = model.getLocalName("en") +"' - " + localizedMessages.getString("WidgetAdminServlet.20");
                                WidgetFactory.update(model, persistenceManager.findWidgetByGuid(model.getIdentifier()), true, upload);
                                _logger.info(message);
                            }
                            persistenceManager.commit();
                            NewWidgetBroadcaster.broadcast(configuration, model.getIdentifier());
                        } catch (IOException e) {
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.