Package org.apache.wookie.beans

Examples of org.apache.wookie.beans.IStartFile


    }
  }

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


    //
    // Locate the startfile for the Widget Instance
    //
    IStartFile[] startFiles = instance.getWidget().getStartFiles().toArray(new IStartFile[instance.getWidget().getStartFiles().size()]);
        IStartFile sf = (IStartFile) LocalizationUtils.getLocalizedElement(startFiles, new String[]{instance.getLang()}, instance.getWidget().getDefaultLocale());
   
    //
    // Try default locale if no appropriate localization found
    //
    if (sf == null) sf = (IStartFile) 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().getGuid());
   
    //
    // Get a URL for the start file on this Wookie server
    //
    String path = sf.getUrl();
    URL urlWidget =  getWookieServerURL(request, path);
   
    //
    // Append querystring parameters for the URL: id key, proxy URL, and social token
    //
View Full Code Here

                    widgetName.setShortName("Unsupported");
                    widget.getNames().add(widgetName);
                    IDescription widgetDescription = persistenceManager.newInstance(IDescription.class);
                    widgetDescription.setContent("This widget is a placeholder for when no corresponding widget is found for a given type");
                    widget.getDescriptions().add(widgetDescription);
                    IStartFile widgetStartFile = persistenceManager.newInstance(IStartFile.class);
                    widgetStartFile.setUrl(WidgetRuntimeHelper.getWebContextPath() + "/wservices/notsupported/index.htm");
                    widget.getStartFiles().add(widgetStartFile);
                    IStartFile widgetBUStartFile = persistenceManager.newInstance(IStartFile.class);
                    widgetBUStartFile.setUrl(WidgetRuntimeHelper.getWebContextPath() + "/wservices/notsupported/locales/bu/index.htm");
                    widgetBUStartFile.setLang("bu");
                    widget.getStartFiles().add(widgetBUStartFile);
                    IStartFile widgetFRStartFile = persistenceManager.newInstance(IStartFile.class);
                    widgetFRStartFile.setUrl(WidgetRuntimeHelper.getWebContextPath() + "/wservices/notsupported/locales/fr/index.htm");
                    widgetFRStartFile.setLang("fr");
                    widget.getStartFiles().add(widgetFRStartFile);
                    IStartFile widgetENStartFile = persistenceManager.newInstance(IStartFile.class);
                    widgetENStartFile.setUrl(WidgetRuntimeHelper.getWebContextPath() + "/wservices/notsupported/locales/en/index.htm");
                    widgetENStartFile.setLang("en");
                    widget.getStartFiles().add(widgetENStartFile);
                    IWidgetType widgetType = persistenceManager.newInstance(IWidgetType.class);
                    widgetType.setWidgetContext("unsupported");
                    widget.getWidgetTypes().add(widgetType);
                    IWidgetIcon widgetIcon = persistenceManager.newInstance(IWidgetIcon.class);
View Full Code Here

    }
  }

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

    //
    // Locate the startfile for the Widget Instance
    //
    IStartFile[] startFiles = instance.getWidget().getStartFiles().toArray(new IStartFile[instance.getWidget().getStartFiles().size()]);
        IStartFile sf = (IStartFile) LocalizationUtils.getLocalizedElement(startFiles, new String[]{instance.getLang()}, instance.getWidget().getDefaultLocale());
   
    //
    // Try default locale if no appropriate localization found
    //
    if (sf == null) sf = (IStartFile) 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().getGuid());
   
    //
    // Get a URL for the start file on this Wookie server
    //
    String path = sf.getUrl();
    URL urlWidget =  getWookieServerURL(request, path);
   
    //
    // Append querystring parameters for the URL: id key, proxy URL, and social token
    //
View Full Code Here

      }
  }

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

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

                    widgetName.setShortName("Unsupported");
                    widget.getNames().add(widgetName);
                    IDescription widgetDescription = persistenceManager.newInstance(IDescription.class);
                    widgetDescription.setContent("This widget is a placeholder for when no corresponding widget is found for a given type");
                    widget.getDescriptions().add(widgetDescription);
                    IStartFile widgetStartFile = persistenceManager.newInstance(IStartFile.class);
                    widgetStartFile.setUrl(WidgetRuntimeHelper.getWebContextPath() + "/wservices/notsupported/index.htm");
                    widget.getStartFiles().add(widgetStartFile);
                    IStartFile widgetBUStartFile = persistenceManager.newInstance(IStartFile.class);
                    widgetBUStartFile.setUrl(WidgetRuntimeHelper.getWebContextPath() + "/wservices/notsupported/locales/bu/index.htm");
                    widgetBUStartFile.setLang("bu");
                    widget.getStartFiles().add(widgetBUStartFile);
                    IStartFile widgetFRStartFile = persistenceManager.newInstance(IStartFile.class);
                    widgetFRStartFile.setUrl(WidgetRuntimeHelper.getWebContextPath() + "/wservices/notsupported/locales/fr/index.htm");
                    widgetFRStartFile.setLang("fr");
                    widget.getStartFiles().add(widgetFRStartFile);
                    IStartFile widgetENStartFile = persistenceManager.newInstance(IStartFile.class);
                    widgetENStartFile.setUrl(WidgetRuntimeHelper.getWebContextPath() + "/wservices/notsupported/locales/en/index.htm");
                    widgetENStartFile.setLang("en");
                    widget.getStartFiles().add(widgetENStartFile);
                    IWidgetIcon widgetIcon = persistenceManager.newInstance(IWidgetIcon.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
    //
    IStartFile[] startFiles = instance.getWidget().getStartFiles().toArray(new IStartFile[instance.getWidget().getStartFiles().size()]);
        IStartFile sf = (IStartFile) LocalizationUtils.getLocalizedElement(startFiles, new String[]{instance.getLang()}, instance.getWidget().getDefaultLocale());
   
    //
    // Try default locale if no appropriate localization found
    //
    if (sf == null) sf = (IStartFile) 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().getGuid());
   
    //
    // Get a URL for the start file on this Wookie server
    //
    String path = sf.getUrl();
    URL urlWidget =  getWookieServerURL(request, path);
   
    //
    // Append querystring parameters for the URL: id key, proxy URL, and social token
    //
View Full Code Here

    }
  }

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

TOP

Related Classes of org.apache.wookie.beans.IStartFile

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.