Examples of findWidgetByGuid()


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

    // 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(persistenceManager.findServerFeatureNames());
               fac.setStartPageProcessor(new StartPageProcessor());
               W3CWidget model = fac.parse(upload);
               WidgetJavascriptSyntaxAnalyzer jsa = new WidgetJavascriptSyntaxAnalyzer(fac.getUnzippedWidgetDirectory());
               if(persistenceManager.findWidgetByGuid(model.getIdentifier()) == null) {
                 WidgetFactory.addNewWidget(model, 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()

        assertNotNull(widgetsByValues);
        assertEquals(1, widgetsByValues.length);
        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()

      IWidget widget;
      IWidgetInstance widgetInstance;
      // Widget ID or Widget Type?
          IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
      if (widgetId != null){
        widget = persistenceManager.findWidgetByGuid(widgetId);
      }
      else {
        // does this type of widget exist?
        widget = persistenceManager.findWidgetDefaultByType(serviceType);       
      }
View Full Code Here

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(persistenceManager.findServerFeatureNames());
        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);
          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()

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

  protected void update(String resourceId, HttpServletRequest request, HttpServletResponse response)
      throws ResourceNotFoundException, InvalidParametersException,
      UnauthorizedAccessException {
   
    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()

      HttpServletResponse response) throws ResourceNotFoundException,
      IOException {

    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    // attempt to get specific widget by URI
    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
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.