^1438335470365
@
sname
UpdateIndexTask
slabel
UpdateIndexTask
sdescriptors
xworker.lang.MetaDescriptor3
smany
true
seditCols
2
sinitialization
false
smodifier
public
sinheritDescription
false
Sdescription
#$@text#$@
<p>定时更新index.html，rssmap.xml和sitemap.xml。</p>
#$@text#$@
snotXmlAttribute
false
sth_createIndex
false
sth_registMyChilds
false
sth_registDisabled
false
sth_mark
false
@/@actions
sname
actions
sdescriptors
xworker.lang.MetaDescriptor3/@actions
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_registDisabled
false
sth_mark
false
@/@actions/@run
sname
httpDo
senable
true
scallback
false
scallbackCancel
false
ssingleInstance
true
ssaveAsGlobalVar
false
sschedule
true
sdelay
5000
speriod
10000
sfixedRate
false
stimeUnit
MILLISECONDS
sfixTime
false
scalculatePassCount
false
sinterpretationType
Self
sattributeTemplate
false
schildsAttributeTemplate
false
svarScope
Local
sisSynchronized
false
sthrowException
true
suseOtherAction
false
screateLocalVarScope
false
ssaveReturn
false
sdisableGlobalContext
false
sdebugLog
false
sdescriptors
xworker.lang.actions.Actions/@Task
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_registDisabled
false
sth_mark
false
@/@actions/@run/@actions
sname
actions
sdescriptors
xworker.lang.task.Task/@actions1
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_registDisabled
false
sth_mark
false
@/@actions/@run/@actions/@doTask
sname
doTask
sisSynchronized
false
sthrowException
true
suseOtherAction
false
svarScope
Local
sdisableGlobalContext
false
Scode
#$@text#$@
def cfg = world.getThing("_local.xworker.config.OrgwebConfig");

//保存主页
def url = cfg.getString("host") + "/" + cfg.getString("defaultUrl");
def thing = world.getThing("xworker.app.orgweb.utils.UpdateIndexTask");
def html = thing.doAction("getUrl", actionContext, ["url": url]);
save(html, "index.html");

url = cfg.getString("host") + "/do?sc=xworker.app.orgweb.web.SitemapBaidu";
html = thing.doAction("getUrl", actionContext, ["url": url]);
save(html, "sitemap.xml");

url = cfg.getString("host") + "/do?sc=xworker.app.orgweb.web.SitemapGoogle";
html = thing.doAction("getUrl", actionContext, ["url": url]);
save(html, "rssmap.xml");

def save(html, path){
    def fout = new FileOutputStream(world.getPath() + "/webroot/" + path);
    fout.write(html.getBytes("utf-8"));
    fout.close();
}
#$@text#$@
sinterpretationType
Action
screateLocalVarScope
false
ssaveReturn
false
sdebugLog
false
sdescriptors
xworker.lang.actions.Actions/@GroovyAction
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_registDisabled
false
sth_mark
false
@/@actions/@getUrl
sname
getUrl
suri
var:url
sinterpretationType
Self
sattributeTemplate
false
schildsAttributeTemplate
false
svarScope
Local
sisSynchronized
false
sthrowException
true
suseOtherAction
false
screateLocalVarScope
false
ssaveReturn
false
sdisableGlobalContext
false
sdebugLog
false
sdescriptors
xworker.httpclient.HttpGet
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_registDisabled
false
sth_mark
false
