Package org.apache.wookie.beans

Examples of org.apache.wookie.beans.IName


    }
  }

  private static void createNames(IPersistenceManager persistenceManager, W3CWidget model, IWidget widget){
    for (INameEntity name:model.getNames()){
      IName widgetName = persistenceManager.newInstance(IName.class);
      widgetName.setLang(name.getLang());
      widgetName.setDir(name.getDir());
      widgetName.setName(name.getName());
      widgetName.setShortName(name.getShort());
            widget.getNames().add(widgetName);
    }
  }
View Full Code Here


                    widget.setGuid("http://notsupported");
                    widget.setWidgetAuthor("Paul Sharples");
                    widget.setWidgetAuthorEmail("p.sharples@bolton.ac.uk");
                    widget.setWidgetAuthorHref("http://iec.bolton.ac.uk");
                    widget.setVersion("v1.0");
                    IName widgetName = persistenceManager.newInstance(IName.class);
                    widgetName.setName("Unsupported widget widget");
                    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);
View Full Code Here

    return out;
  }

  private static String getName(IWidget widget, String[] locales){
      IName[] names = widget.getNames().toArray(new IName[widget.getNames().size()]);
    IName name = (IName)LocalizationUtils.getLocalizedElement(names,locales, widget.getDefaultLocale());
    String shortName = null;
    String longName = null;
    if (name != null) {
      shortName = name.getShortName();
      longName = name.getName();
    }
    String out = "\t\t<title ";
    if (name != null && name.getDir()!=null) out+=" dir=\""+name.getDir()+"\"";
    if (shortName != null) out +=" short=\""+StringEscapeUtils.escapeXml(shortName) + "\"";
    out +=">";
    if(longName != null) out += StringEscapeUtils.escapeXml(longName);
    out += "</title>\n";
    return out;
View Full Code Here

   * @param locale the required locale, or null to use the default system locale
   * @return a unicode string
   */
  public static String getEncodedWidgetTitle(IWidget widget, String locale){
      IName[] names = widget.getNames().toArray(new IName[widget.getNames().size()]);
        IName name = (IName)LocalizationUtils.getLocalizedElement(names, new String[]{locale}, widget.getDefaultLocale());
        return ((name != null) ? WidgetFormattingUtils.getEncoded(name.getDir(), name.getName()) : IW3CXMLConfiguration.UNKNOWN);      
  }
View Full Code Here

    }
  }

  private static void createNames(IPersistenceManager persistenceManager, W3CWidget model, IWidget widget){
    for (INameEntity name:model.getNames()){
      IName widgetName = persistenceManager.newInstance(IName.class);
      widgetName.setLang(name.getLang());
      widgetName.setDir(name.getDir());
      widgetName.setName(name.getName());
      widgetName.setShortName(name.getShort());
            widget.getNames().add(widgetName);
    }
  }
View Full Code Here

          if (widget.getAuthor().getEmail() != null) email = widget.getAuthor().getEmail();
          if (widget.getAuthor().getHref() != null) href = widget.getAuthor().getHref();
    }

    String name = "";
    IName iname = (IName)LocalizationUtils.getLocalizedElement(widget.getNames().toArray(new IName[widget.getNames().size()]), locales, widget.getDefaultLocale());
    if (iname != null && iname.getName() != null) name = WidgetFormattingUtils.getEncoded(iname.getDir(), iname.getName());
    String shortName = "";
    if (iname != null && iname.getShortName() != null) shortName = WidgetFormattingUtils.getEncoded(iname.getDir(), iname.getShortName());
   
    String description = "";
    IDescription idescription = (IDescription)LocalizationUtils.getLocalizedElement(widget.getDescriptions().toArray(new IDescription[widget.getDescriptions().size()]), locales, widget.getDefaultLocale());
    if (idescription != null && idescription.getContent() != null) description = WidgetFormattingUtils.getEncoded(idescription.getDir(), idescription.getContent());
   
View Full Code Here

    }
  }

  private static void createNames(IPersistenceManager persistenceManager, W3CWidget model, IWidget widget){
    for (INameEntity name:model.getNames()){
      IName widgetName = persistenceManager.newInstance(IName.class);
      widgetName.setLang(name.getLang());
      widgetName.setDir(name.getDir());
      widgetName.setName(name.getName());
      widgetName.setShortName(name.getShort());
            widget.getNames().add(widgetName);
    }
  }
View Full Code Here

                    widget.setGuid("http://notsupported");
                    widget.setWidgetAuthor("Paul Sharples");
                    widget.setWidgetAuthorEmail("p.sharples@bolton.ac.uk");
                    widget.setWidgetAuthorHref("http://iec.bolton.ac.uk");
                    widget.setVersion("v1.0");
                    IName widgetName = persistenceManager.newInstance(IName.class);
                    widgetName.setName("Unsupported widget widget");
                    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);
View Full Code Here

    return out;
  }

  private static String getName(IWidget widget, String[] locales){
      IName[] names = widget.getNames().toArray(new IName[widget.getNames().size()]);
    IName name = (IName)LocalizationUtils.getLocalizedElement(names,locales, widget.getDefaultLocale());
    String shortName = null;
    String longName = null;
    if (name != null) {
      shortName = name.getShortName();
      longName = name.getName();
    }
    String out = "\t\t<name ";
    if (name != null && name.getDir()!=null) out+=" dir=\""+name.getDir()+"\"";
    if (shortName != null) out +=" short=\""+StringEscapeUtils.escapeXml(shortName) + "\"";
    out +=">";
    if(longName != null) out += StringEscapeUtils.escapeXml(longName);
    out += "</name>\n";
    return out;
View Full Code Here

   * @param locale the required locale, or null to use the default system locale
   * @return a unicode string
   */
  public static String getEncodedWidgetTitle(IWidget widget, String locale){
      IName[] names = widget.getNames().toArray(new IName[widget.getNames().size()]);
        IName name = (IName)LocalizationUtils.getLocalizedElement(names, new String[]{locale}, widget.getDefaultLocale());
        return ((name != null) ? WidgetFormattingUtils.getEncoded(name.getDir(), name.getName()) : IW3CXMLConfiguration.UNKNOWN);      
  }
View Full Code Here

TOP

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

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.