Package org.apache.wookie.w3c

Examples of org.apache.wookie.w3c.W3CWidget


    W3CWidget widget = processWidgetNoErrors("http://dev.w3.org/2006/waf/widgets/test-suite/test-cases/ta-viewmodes/007/viewh.wgt");
    assertEquals("floating windowed maximized",widget.getViewModes());
  }
  @Test
  public void viewi(){
    W3CWidget widget = processWidgetNoErrors("http://dev.w3.org/2006/waf/widgets/test-suite/test-cases/ta-viewmodes/008/viewi.wgt");
    assertTrue(widget.getViewModes().equals(""));
  }
View Full Code Here


    W3CWidget widget = processWidgetNoErrors("http://dev.w3.org/2006/waf/widgets/test-suite/test-cases/ta-viewmodes/008/viewi.wgt");
    assertTrue(widget.getViewModes().equals(""));
  }
  @Test
  public void i18nlro43(){
    W3CWidget widget = processWidgetNoErrors("http://dev.w3.org/2006/waf/widgets/test-suite/test-cases/i18n-lro/043/i18nlro43.wgt");
    assertTrue(widget.getViewModes().equals("windowed floating"));
 
View Full Code Here

    W3CWidget widget = processWidgetNoErrors("http://dev.w3.org/2006/waf/widgets/test-suite/test-cases/i18n-lro/043/i18nlro43.wgt");
    assertTrue(widget.getViewModes().equals("windowed floating"));
 
  @Test
  public void i18nltr43(){
    W3CWidget widget = processWidgetNoErrors("http://dev.w3.org/2006/waf/widgets/test-suite/test-cases/i18n-ltr/043/i18nltr43.wgt");
    assertTrue(widget.getViewModes().equals("windowed floating"));
 
View Full Code Here

    W3CWidget widget = processWidgetNoErrors("http://dev.w3.org/2006/waf/widgets/test-suite/test-cases/i18n-ltr/043/i18nltr43.wgt");
    assertTrue(widget.getViewModes().equals("windowed floating"));
 
  @Test
  public void i18nrlo43(){
    W3CWidget widget = processWidgetNoErrors("http://dev.w3.org/2006/waf/widgets/test-suite/test-cases/i18n-rlo/043/i18nrlo43.wgt");
    assertTrue(widget.getViewModes().equals("windowed floating"));
 
View Full Code Here

    W3CWidget widget = processWidgetNoErrors("http://dev.w3.org/2006/waf/widgets/test-suite/test-cases/i18n-rlo/043/i18nrlo43.wgt");
    assertTrue(widget.getViewModes().equals("windowed floating"));
 
  @Test
  public void i18nrtl43(){
    W3CWidget widget = processWidgetNoErrors("http://dev.w3.org/2006/waf/widgets/test-suite/test-cases/i18n-rtl/043/i18nrtl43.wgt");
    assertTrue(widget.getViewModes().equals("windowed floating"));
 
View Full Code Here

 

  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$       
      }
    } catch (Exception e1) {
      e1.printStackTrace();
      request.setAttribute("error_value", localizedMessages.getString("WidgetAdminServlet.18")); //$NON-NLS-1$ //$NON-NLS-2$
    }
View Full Code Here

        fac.setLocales(locales);
        fac.setLocalPath(getServletContext().getContextPath()+properties.getString("widget.widgetfolder"));
        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$         
          retrieveServices(request);
          request.setAttribute("hasValidated", Boolean.valueOf(true));                                   //$NON-NLS-1$
          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
        request.setAttribute("error_value", localizedMessages.getString("WidgetAdminServlet.24")); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

               fac.setLocales(locales);
               fac.setLocalPath(contextPath+localWidgetFolderPath);
               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 {
                 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

public class WidgetOutputterTest extends ConformanceTest{
 
  @Test
  public void outputString() throws Exception{
    File testWidget = new File("build/widgets/bubbles.wgt");
    W3CWidget widget = load(testWidget);
    WidgetOutputter outputter = new WidgetOutputter();
    outputter.setWidgetFolder("/widgets");
    String manifest = outputter.outputXMLString(widget);
    assertTrue(manifest.contains("id=\"http://www.opera.com/widgets/bubbles\""));
    assertTrue(manifest.contains("<content src=\"index.html\""));
View Full Code Here

    assertTrue(manifest.contains("<content src=\"index.html\""));
  }
  @Test
  public void outputString2() throws Exception{
    File testWidget = new File("build/widgets/natter.wgt");
    W3CWidget widget = load(testWidget);
    WidgetOutputter outputter = new WidgetOutputter();
    outputter.setWidgetFolder("/widgets");
    String manifest = outputter.outputXMLString(widget);
    assertTrue(manifest.contains("id=\"http://www.getwookie.org/widgets/natter\""));
    assertTrue(manifest.contains("<content src=\"index.htm\""));
View Full Code Here

TOP

Related Classes of org.apache.wookie.w3c.W3CWidget

Copyright © 2018 www.massapicom. 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.