Package org.apache.wookie.w3c

Examples of org.apache.wookie.w3c.W3CWidget


 
    //
    // Test it works!
    //
    System.out.println(file.getAbsolutePath());
    W3CWidget fpWidget = fac.parse(file);
    assertEquals("hiScore", fpWidget.getPreferences().get(0).getName());
    assertEquals("1000", fpWidget.getPreferences().get(0).getValue());
  }
View Full Code Here


 
    //
    // Test it works!
    //
    System.out.println(file.getAbsolutePath());
    W3CWidget fpWidget = fac.parse(file);
    assertEquals("moderator", fpWidget.getPreferences().get(0).getName());
    assertEquals("true", fpWidget.getPreferences().get(0).getValue());
    assertEquals(1,fpWidget.getPreferences().size());
  }
View Full Code Here

    System.out.println(outputFolder.getPath());

    W3CWidgetFactory fac = new W3CWidgetFactory();
    fac.setOutputDirectory(outputFolder.getPath());
    W3CWidget widget = fac.parse(file);
    assertEquals("Unsupported widget widget", widget.getLocalName("en"));
  }
View Full Code Here

    W3CWidgetFactory fac = new W3CWidgetFactory();
    fac.setStartPageProcessor(null);
    File outputDir = new File("src-tests" + File.separatorChar + "testdata" + File.separatorChar + "widgets");
    outputDir.mkdirs();
    fac.setOutputDirectory("src-tests" + File.separatorChar + "testdata" + File.separatorChar + "widgets");
    W3CWidget widget = fac.parse(downloadedFile);
    File file = fac.getUnzippedWidgetDirectory();
    assertEquals("src-tests" + File.separatorChar + "testdata"
        + File.separatorChar + "widgets" + File.separatorChar
        + "www.getwookie.org" + File.separatorChar + "widgets"
        + File.separatorChar + "weather", file.getPath());
    assertTrue(file.isDirectory());
    assertEquals(WIDGET_ID_WEATHER, widget.getIdentifier());

    //clean up
    FileUtils.deleteDirectory(outputDir);
    FileUtils.deleteQuietly(downloadedFile);
  }
View Full Code Here

   
    System.out.println(outputFolder.getPath());
   
    W3CWidgetFactory fac = new W3CWidgetFactory();
    fac.setOutputDirectory(outputFolder.getPath());
    W3CWidget widget = fac.parse(file);
    assertEquals("Unsupported widget widget", widget.getLocalName("en"));
  }
View Full Code Here

   */
  public static W3CWidget getUpdate(W3CWidgetFactory factory, String identifier, String href, String version, boolean onlyUseHttps) throws InvalidContentTypeException, BadWidgetZipFileException, BadManifestException, IOException, Exception{
    UpdateDescriptionDocument udd = checkForUpdate(href, version);
    if (udd == null) return null;
    if (onlyUseHttps && !udd.getUpdateSource().getProtocol().equalsIgnoreCase("https")) return  null;
    W3CWidget updatedWidget = factory.parse(udd.getUpdateSource(), false, identifier);
    return updatedWidget;
  }
View Full Code Here

   
    // Get folder name for widget id
    String folder = WidgetPackageUtils.convertIdToFolderName(widget.getIdentifier());
    String installedPath = widgetFolder + File.separator + folder + File.separator;
   
    W3CWidget localWidget = widget;
   
    // Replace Content Src attributes
    for (IContentEntity content:localWidget.getContentList()){
      String src = content.getSrc();
      src = src.replace(installedPath, "");
      content.setSrc(src);
    }
   
    // Replace Icon Src attributes
    for (IIconEntity icon:localWidget.getIconsList()){
      String src = icon.getSrc();
      src = src.replace(installedPath, "");
      icon.setSrc(src);
    }
   
View Full Code Here

 
    //
    // Test it works!
    //
    System.out.println(file.getAbsolutePath());
    W3CWidget fpWidget = fac.parse(file);
    assertNotNull(fpWidget);
   
  }
View Full Code Here

 
    //
    // Test it works!
    //
    System.out.println(file.getAbsolutePath());
    W3CWidget fpWidget = fac.parse(file);
    assertNotNull(fpWidget);
   
  }
View Full Code Here

 
    //
    // Test it works!
    //
    System.out.println("createFeatureFlatpackUsingDefaults: "+file.getAbsolutePath());
    W3CWidget fpWidget = fac.parse(file);
    assertNotNull(fpWidget);
   
    //
    // The JQM feature should have been removed from config.xml
    //
    assertEquals(0, fpWidget.getFeatures().size());
   
  }
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.