Package org.apache.wookie.beans

Examples of org.apache.wookie.beans.IStartFile


   */
  protected static String getUrl(HttpServletRequest request, IWidgetInstance instance) throws IOException{
    String url = "";

    IStartFile[] startFiles = instance.getWidget().getStartFiles().toArray(new IStartFile[instance.getWidget().getStartFiles().size()]);
        IStartFile sf = (IStartFile) LocalizationUtils.getLocalizedElement(startFiles, new String[]{instance.getLang()});
    // Try default locale if no appropriate localization found
    if (sf == null) sf = (IStartFile) LocalizationUtils.getLocalizedElement(startFiles, null);
    // No start file found, so throw an exception
    if (sf == null) throw new IOException("No start file located for widget "+instance.getWidget().getGuid());
   
    URL urlWidget =  new URL(request.getScheme() ,
        request.getServerName() ,
        request.getServerPort() , sf.getUrl());
   
    if (urlWidget.getQuery() != null){
      url+= urlWidget + "&idkey=" + instance.getIdKey()  //$NON-NLS-1$
          + "&proxy=" + urlWidgetProxyServer.toExternalForm()  //$NON-NLS-1$
          + "&st=" + instance.getOpensocialToken(); //$NON-NLS-1$
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"});
    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("/wookie/wservices/notsupported/index.htm");
                    widget.getStartFiles().add(widgetStartFile);
                    IStartFile widgetBUStartFile = persistenceManager.newInstance(IStartFile.class);
                    widgetBUStartFile.setUrl("/wookie/wservices/notsupported/locales/bu/index.htm");
                    widgetBUStartFile.setLang("bu");
                    widget.getStartFiles().add(widgetBUStartFile);
                    IStartFile widgetFRStartFile = persistenceManager.newInstance(IStartFile.class);
                    widgetFRStartFile.setUrl("/wookie/wservices/notsupported/locales/fr/index.htm");
                    widgetFRStartFile.setLang("fr");
                    widget.getStartFiles().add(widgetFRStartFile);
                    IStartFile widgetENStartFile = persistenceManager.newInstance(IStartFile.class);
                    widgetENStartFile.setUrl("/wookie/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

 
  @BeforeClass
  public static void setUp(){
    IWidget widget = new WidgetImpl();
    widget.setGuid("http://getwookie.org/test");
    IStartFile startFile = new StartFileImpl();
        startFile.setUrl("http://getwookie.org/test/index.html");
        startFile.setLang("en");
    widget.getStartFiles().add(startFile);
   
    INSTANCE = new WidgetInstanceImpl();
    INSTANCE.setWidget(widget);
    INSTANCE.setIdKey("xhKEoiff/4ltxSuuBmPjjxBx5hw.eq.");
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.