}
public static List<String> buildOptions(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws JavaScriptException, FormattingException, WGAPIException, IOException {
Arguments parsedArgs = _buildOptionsVarargs.parse(args);
Iterable<WGContent> contents = (Iterable<WGContent>) parsedArgs.get("contents");
String titleExpr = (String) parsedArgs.get("title");
TMLContext context = fetchInitialContext(cx);
RhinoExpressionEngineImpl runtime = fetchRuntime(cx);
List<String> options = new ArrayList<String>();
if (parsedArgs.has("emptyTitle")) {
options.add(String.valueOf(parsedArgs.get("emptyTitle")) + "|" + TMLForm.RELATION_NULLPLACE_HOLDER);
}
for (WGContent content : contents) {
String title = content.getTitle();
if (titleExpr != null) {