Package org.apache.wookie.w3c

Examples of org.apache.wookie.w3c.IContent


      }
  }

  private static void createStartFiles(IPersistenceManager persistenceManager, W3CWidget model, IWidget widget){
    for (IContent page:model.getContentList()){
      IContent start = persistenceManager.newInstance(IContent.class);
      start.setCharSet(page.getCharSet());
      start.setLang(page.getLang());
      start.setSrc(page.getSrc());
            widget.getContentList().add(start);
    }
  }
View Full Code Here


    //
    // Locate the startfile for the Widget Instance
    //
    IContent[] startFiles = instance.getWidget().getContentList().toArray(new IContent[instance.getWidget().getContentList().size()]);
        IContent sf = (IContent) LocalizationUtils.getLocalizedElement(startFiles, new String[]{instance.getLang()}, instance.getWidget().getDefaultLocale());
   
    //
    // Try default locale if no appropriate localization found
    //
    if (sf == null) sf = (IContent) LocalizationUtils.getLocalizedElement(startFiles, null, instance.getWidget().getDefaultLocale());
   
    //
    // No start file found, so throw an exception
    //
    if (sf == null) throw new IOException("No start file located for widget "+instance.getWidget().getIdentifier());
   
    //
    // Get a URL for the start file on this Wookie server
    //
    String path = sf.getSrc();
    URL urlWidget =  getWookieServerURL(request, path);
   
    //
    // Append querystring parameters for the URL: id key, proxy URL, and social token
    //
View Full Code Here

                    widgetName.setShort("Unsupported");
                    widget.getNames().add(widgetName);
                    IDescription widgetDescription = persistenceManager.newInstance(IDescription.class);
                    widgetDescription.setDescription("This widget is a placeholder for when no corresponding widget is found for a given type");
                    widget.getDescriptions().add(widgetDescription);
                    IContent widgetStartFile = persistenceManager.newInstance(IContent.class);
                    widgetStartFile.setSrc(WidgetRuntimeHelper.getWebContextPath() + "/wservices/notsupported/index.htm");
                    widget.getContentList().add(widgetStartFile);
                    IContent widgetBUStartFile = persistenceManager.newInstance(IContent.class);
                    widgetBUStartFile.setSrc(WidgetRuntimeHelper.getWebContextPath() + "/wservices/notsupported/locales/bu/index.htm");
                    widgetBUStartFile.setLang("bu");
                    widget.getContentList().add(widgetBUStartFile);
                    IContent widgetFRStartFile = persistenceManager.newInstance(IContent.class);
                    widgetFRStartFile.setSrc(WidgetRuntimeHelper.getWebContextPath() + "/wservices/notsupported/locales/fr/index.htm");
                    widgetFRStartFile.setLang("fr");
                    widget.getContentList().add(widgetFRStartFile);
                    IContent widgetENStartFile = persistenceManager.newInstance(IContent.class);
                    widgetENStartFile.setSrc(WidgetRuntimeHelper.getWebContextPath() + "/wservices/notsupported/locales/en/index.htm");
                    widgetENStartFile.setLang("en");
                    widget.getContentList().add(widgetENStartFile);
                    IIcon widgetIcon = persistenceManager.newInstance(IIcon.class);
                    widgetIcon.setSrc(WidgetRuntimeHelper.getWebContextPath() + "/shared/images/defaultwidget.png");
                    widgetIcon.setHeight(80);
                    widgetIcon.setWidth(80);
View Full Code Here

      }
  }

  private static void createStartFiles(IPersistenceManager persistenceManager, W3CWidget model, IWidget widget){
    for (IContent page:model.getContentList()){
      IContent start = persistenceManager.newInstance(IContent.class);
      start.setCharSet(page.getCharSet());
      start.setLang(page.getLang());
      start.setSrc(page.getSrc());
            widget.getContentList().add(start);
    }
  }
View Full Code Here

 
  @BeforeClass
  public static void setUp(){
    IWidget widget = new WidgetImpl();
    widget.setIdentifier("http://getwookie.org/test");
    IContent startFile = new StartFileImpl();
        startFile.setSrc("http://getwookie.org/test/index.html");
        startFile.setLang("en");
    widget.getContentList().add(startFile);
   
    INSTANCE = new WidgetInstanceImpl();
    INSTANCE.setWidget(widget);
    INSTANCE.setIdKey("xhKEoiff/4ltxSuuBmPjjxBx5hw.eq.");
View Full Code Here

    return userid;
  }
 
  private static String getUrl(IWidgetInstance instance){
      IContent[] startFiles = instance.getWidget().getContentList().toArray(new IContent[instance.getWidget().getContentList().size()]);
    IContent start = (IContent) LocalizationUtils.getLocalizedElement(startFiles, new String[]{"en"}, instance.getWidget().getDefaultLocale());
    return start.getSrc();
  }
View Full Code Here

    //
    // Locate the startfile for the Widget Instance
    //
    IContent[] startFiles = instance.getWidget().getContentList().toArray(new IContent[instance.getWidget().getContentList().size()]);
        IContent sf = (IContent) LocalizationUtils.getLocalizedElement(startFiles, new String[]{instance.getLang()}, instance.getWidget().getDefaultLocale());
   
    //
    // Try default locale if no appropriate localization found
    //
    if (sf == null) sf = (IContent) LocalizationUtils.getLocalizedElement(startFiles, null, instance.getWidget().getDefaultLocale());
   
    //
    // No start file found, so throw an exception
    //
    if (sf == null) throw new IOException("No start file located for widget "+instance.getWidget().getIdentifier());
   
    //
    // Get a URL for the start file on this Wookie server
    //
    String path = sf.getSrc();
    URL urlWidget =  getWookieServerURL(request, path);

    //
    // If locked domains are enabled, create a host prefix using a UUID generated from the
    // widget instance
View Full Code Here

                    widgetName.setShort("Unsupported");
                    widget.getNames().add(widgetName);
                    IDescription widgetDescription = persistenceManager.newInstance(IDescription.class);
                    widgetDescription.setDescription("This widget is a placeholder for when no corresponding widget is found for a given type");
                    widget.getDescriptions().add(widgetDescription);
                    IContent widgetStartFile = persistenceManager.newInstance(IContent.class);
                    widgetStartFile.setSrc(WidgetRuntimeHelper.getWebContextPath() + "/deploy/notsupported/index.htm");
                    widget.getContentList().add(widgetStartFile);
                    IContent widgetBUStartFile = persistenceManager.newInstance(IContent.class);
                    widgetBUStartFile.setSrc(WidgetRuntimeHelper.getWebContextPath() + "/deploy/notsupported/locales/bu/index.htm");
                    widgetBUStartFile.setLang("bu");
                    widget.getContentList().add(widgetBUStartFile);
                    IContent widgetFRStartFile = persistenceManager.newInstance(IContent.class);
                    widgetFRStartFile.setSrc(WidgetRuntimeHelper.getWebContextPath() + "/deploy/notsupported/locales/fr/index.htm");
                    widgetFRStartFile.setLang("fr");
                    widget.getContentList().add(widgetFRStartFile);
                    IContent widgetENStartFile = persistenceManager.newInstance(IContent.class);
                    widgetENStartFile.setSrc(WidgetRuntimeHelper.getWebContextPath() + "/deploy/notsupported/locales/en/index.htm");
                    widgetENStartFile.setLang("en");
                    widget.getContentList().add(widgetENStartFile);
                    IIcon widgetIcon = persistenceManager.newInstance(IIcon.class);
                    widgetIcon.setSrc(WidgetRuntimeHelper.getWebContextPath() + "/shared/images/defaultwidget.png");
                    widgetIcon.setHeight(80);
                    widgetIcon.setWidth(80);
View Full Code Here

    //
    // Locate the startfile for the Widget Instance
    //
    IContent[] startFiles = instance.getWidget().getContentList().toArray(new IContent[instance.getWidget().getContentList().size()]);
        IContent sf = (IContent) LocalizationUtils.getLocalizedElement(startFiles, new String[]{instance.getLang()}, instance.getWidget().getDefaultLocale());
   
    //
    // Try default locale if no appropriate localization found
    //
    if (sf == null) sf = (IContent) LocalizationUtils.getLocalizedElement(startFiles, null, instance.getWidget().getDefaultLocale());
   
    //
    // No start file found, so throw an exception
    //
    if (sf == null) throw new IOException("No start file located for widget "+instance.getWidget().getIdentifier());
   
    //
    // Get a URL for the start file on this Wookie server
    //
    String path = sf.getSrc();
    URL urlWidget =  getWookieServerURL(request, path);

    //
    // If locked domains are enabled, create a host prefix using a UUID generated from the
    // widget instance
View Full Code Here

TOP

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

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.