Examples of findWidgetByGuid()


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

  private void registerOperation(HttpServletRequest request, Configuration properties){
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
    try {
      W3CWidget widgetModel = GadgetUtils.createWidget(request);
          IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
      if(persistenceManager.findWidgetByGuid(widgetModel.getIdentifier()) == null){
        WidgetFactory.addNewWidget(widgetModel);
        request.setAttribute("message_value", widgetModel.getLocalName("en")+": "+localizedMessages.getString("WidgetAdminServlet.16")); //$NON-NLS-1$ //$NON-NLS-2$
      } else {
        request.setAttribute("message_value", widgetModel.getLocalName("en")+": "+localizedMessages.getString("WidgetAdminServlet.17")); //$NON-NLS-1$ //$NON-NLS-2$       
      }
View Full Code Here

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

        fac.setOutputDirectory(WIDGETFOLDER);
        fac.setFeatures(Features.getFeatureNames());
        fac.setStartPageProcessor(new StartPageProcessor());
        W3CWidget widgetModel = fac.parse(zipFile);
        WidgetJavascriptSyntaxAnalyzer jsa = new WidgetJavascriptSyntaxAnalyzer(fac.getUnzippedWidgetDirectory());       
              if(persistenceManager.findWidgetByGuid(widgetModel.getIdentifier()) == null){
          // ADD
          IWidget widget = WidgetFactory.addNewWidget(widgetModel, null, zipFile, false);
          Object dbkey = widget.getId();
          // widget added
          request.setAttribute("message_value", "'"+ widgetModel.getLocalName("en") +"' - " + localizedMessages.getString("WidgetAdminServlet.19")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$         
View Full Code Here

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

          request.setAttribute("dbkey", dbkey); //$NON-NLS-1$
       
        else{
          // UPDATE
          // Update the widget metadata and configuration details
          WidgetFactory.update(widgetModel, persistenceManager.findWidgetByGuid(widgetModel.getIdentifier()), false, zipFile);
          request.setAttribute("message_value", "'"+ widgetModel.getLocalName("en") +"' - " + localizedMessages.getString("WidgetAdminServlet.20")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$         
        }
      }
      else{
        // no file found to be uploaded - shouldn't happen
View Full Code Here

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

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

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

                 String message = model.getLocalName("en") +"' - " + localizedMessages.getString("WidgetAdminServlet.19");
                 _logger.info(message);
                 FlashMessage.getInstance().message(message);
               } else {
                 String message = model.getLocalName("en") +"' - " + localizedMessages.getString("WidgetAdminServlet.20");
                 WidgetFactory.update(model, persistenceManager.findWidgetByGuid(model.getIdentifier()), true, upload);
                 _logger.info(message);
                 FlashMessage.getInstance().message(message);
               }
               persistenceManager.commit();
             } catch (IOException e) {
View Full Code Here

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

        assertEquals(allWidgets[0], widgetsByValues[0]);
       
        //
        // test custom widget query methods
        //
        IWidget widgetByGuid = persistenceManager.findWidgetByGuid(widgetGuid);
        assertNotNull(widgetByGuid);
        assertEquals(allWidgets[0], widgetByGuid);
        String widgetContext = allWidgetDefaults[0].getWidgetContext();
        IWidget widgetDefaultByType = persistenceManager.findWidgetDefaultByType(widgetContext);
        assertNotNull(widgetDefaultByType);
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()

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

               fac.setOutputDirectory(WIDGETFOLDER);
               fac.setFeatures(Features.getFeatureNames());
               fac.setStartPageProcessor(new StartPageProcessor());
               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
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.