Package gri.gridp.modules

Examples of gri.gridp.modules.FunctionInfo


    if (info.getGroup() != null)
      elem.addContent(createElement("group", info.getGroup()));
  }

  public FunctionInfo readFunctionInfo(Element element) throws InvalidModuleException {
    FunctionInfo info = new FunctionInfo();

    List children = element.getChildren();
    Element child;
    for (int i=0; i<children.size(); i++) {
      child = (Element)children.get(i);
      String name = child.getName().toLowerCase();

      if (name.equals("title"))
        info.setTitle(child.getText());
      else if (name.equals("description"))
        info.setDescription(child.getText());
      else if (name.equals("group"))
        info.setGroup(child.getText());
    }

    return info;
  }
View Full Code Here


    }

    // validate (set function title to id if absent):
    if (function.getInfo() == null)
      function.setInfo(new FunctionInfo());
    //if (function.getInfo().getTitle() == null)
    //    function.getInfo().setTitle(function.getId());

    return function;
  }
View Full Code Here

 
  protected TaskDescription getTaskDescription(ModuleFunction modFunc) {
    ProgramTaskDescription desc = new ProgramTaskDescription();

    ModuleInfo modInfo = modFunc.getModule().getModuleInfo();
    FunctionInfo funcInfo = modFunc.getFunction().getInfo();

    //custom name:
    String name = funcInfo.getTitle();
   
    //default name = "module (program)"
    if (name == null) {
      name = modInfo.getTitle();

      String program = modInfo.getProgram();
      if (program != null)
        name += " (" + program + ")";   
    }

    desc.setName(name);

    //description:
    String description = funcInfo.getDescription();
    if (description == null)
      description = modInfo.getDescription();
    desc.setDescription(description);

    //extended info:
    desc.setProgramName(modInfo.getProgram());
    desc.setGroup(funcInfo.getGroup());

    PackageInfo pkgInfo = modInfo.getPackageInfo();
    if (pkgInfo != null) {
      desc.setPackageName(pkgInfo.getName());
      desc.setWebsite(pkgInfo.getWebsite());
View Full Code Here

TOP

Related Classes of gri.gridp.modules.FunctionInfo

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.