//#import $owl_mall_appinfo:services/modelService.jsx

(function(){
    var searchArgs = {
        status:"up"
    }
    var searchResult = owl_mall_appinfoService.search("0",searchArgs,null,0,100,null);
    if(searchResult && searchResult.state === 'ok'){
        var list = searchResult.list;
        if(list && list.length > 0){
            var appInfo = list[0];
            var url = appInfo.appLogo && appInfo.appLogo[0] && appInfo.appLogo[0].url;
            var setting = {
                title:appInfo.siteTitle,
                logo:url,
                appInfo:appInfo
            }
            var ret = {
                state: 'ok',
                setting:setting
            }
            out.print(JSON.stringify(ret));
            return;
        }
    }
    var ret = {
        state: 'err',
        msg:"no setting"
    }
    out.print(JSON.stringify(ret));
    return;
})();