^1639996779776
@
sname
ThingManagerActions
slabel
ThingManagerActions
sdescriptors
xworker.lang.MetaDescriptor3
smany
true
seditCols
2
sinitialization
false
smodifier
public
sinheritDescription
false
snotXmlAttribute
false
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
  @/@InitOuterThingManager
  sname
  InitOuterThingManager
  sdescriptors
  xworker.lang.MetaDescriptor3/@thing
  sextends
  xworker.lang.actions.SelfAction
  smany
  true
  seditCols
  2
  sinitialization
  false
  sgroup
  xworker.thingManager
  smodifier
  public
  sinheritDescription
  false
  Sdescription
#$@text#$@
<p>初始化外部目录下的事物管理器。</p>

<p><strong>可以重载的方法：</strong></p>

<ul>
	<li><strong>getFilePath</strong><br />
	返回外部事物管理器的目录字符串或者java.io.File。</li>
</ul>
#$@text#$@
  snotXmlAttribute
  false
  sth_createIndex
  true
  sth_registThing
  child|xworker.lang.actions.Actions
  sth_registMyChilds
  false
  sth_mark
  false
  sid
  InitOuterThingManager
    @/@InitOuterThingManager/@actions
    sname
    actions
    sdescriptors
    xworker.lang.MetaDescriptor3/@actions
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    actions
      @/@InitOuterThingManager/@actions/@run
      sname
      run
      sisSynchronized
      false
      sthrowException
      true
      suseOtherAction
      false
      suseOuterJava
      true
      souterClassName
      xworker.core.actions.thing.ThingManagerActions
      smethodName
      initThingManager
      sdisableGlobalContext
      false
      sattributeTemplate
      false
      sinterpretationType
      Action
      svarScope
      Global
      screateLocalVarScope
      false
      ssaveReturn
      false
      sdescriptors
      xworker.lang.actions.Actions/@JavaAction
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_mark
      false
      sid
      run
      @/@InitOuterThingManager/@actions/@getFilePath
      sname
      getFilePath
      sisSynchronized
      false
      sthrowException
      true
      suseOtherAction
      false
      suseOuterJava
      true
      souterClassName
      xworker.core.actions.thing.ThingManagerActions
      smethodName
      getFilePath
      sdisableGlobalContext
      false
      sattributeTemplate
      false
      sinterpretationType
      Action
      svarScope
      Global
      screateLocalVarScope
      false
      ssaveReturn
      false
      sdescriptors
      xworker.lang.actions.Actions/@JavaAction
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_mark
      false
      sid
      getFilePath
    @/@InitOuterThingManager/@name
    sname
    name
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    name
    @/@InitOuterThingManager/@label
    sname
    label
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    label
    @/@InitOuterThingManager/@filePath
    sname
    filePath
    sinputtype
    openWindow
    ssize
    60
    sshowLabel
    true
    sinputattrs
    xworker.swt.xworker.attributeEditor.openWins.FileSelector|
    sreadOnly
    false
    sinheritDescription
    false
    sdescription
    <p>外部事物管理器的目录。</p>
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    filePath
    @/@InitOuterThingManager/@description
    sname
    description
    sinputtype
    html
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    description
  @/@CreateThingManager
  sname
  CreateThingManager
  sdescriptors
  xworker.lang.MetaDescriptor3/@thing
  sextends
  xworker.lang.actions.SelfAction
  smany
  true
  seditCols
  2
  sinitialization
  false
  sgroup
  xworker.thingManager
  smodifier
  public
  sinheritDescription
  false
  Sdescription
#$@text#$@
<p>创建项目（事物管理器）。</p>

<p><strong>可以重写的方法：</strong></p>

<ul>
	<li><strong>String getProjectName()</strong><br />
	返回项目名称。<br />
	&nbsp;</li>
	<li><strong>File getDirectory()</strong><br />
	返回项目所在的目录。如果为null，创建到xworker的项目目录下。<br />
	&nbsp;</li>
	<li><strong>boolean isAddToXWorker()</strong><br />
	如果项目目录在xworker之外，是否把它添加到xworker中。注：添加后只在事物管理器中可见。<br />
	&nbsp;</li>
	<li><strong>boolean isCreateSimpleThingManager()</strong><br />
	是否创建简单事物管理器。<br />
	&nbsp;</li>
	<li><strong>String getProjectProperties()</strong><br />
	返回事物管理器配置文件的其它额外属性。是java的properties格式，不包含projectName=xxx这一行数据。<br />
	&nbsp;</li>
	<li><strong>boolean hasThingsDir()</strong><br />
	项目是否包含things目录。</li>
</ul>

<p>&nbsp;</p>

<p>&nbsp;</p>
#$@text#$@
  snotXmlAttribute
  false
  sjson_isArray
  false
  sth_createIndex
  false
  sth_registThing
  child|xworker.lang.actions.Actions
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  CreateThingManager
    @/@CreateThingManager/@actions
    sname
    actions
    sdescriptors
    xworker.lang.MetaDescriptor3/@actions
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    actions
      @/@CreateThingManager/@actions/@run
      sname
      run
      sisSynchronized
      false
      sthrowException
      true
      suseOtherAction
      false
      svarScope
      Local
      sdisableGlobalContext
      false
      Scode
#$@text#$@
import org.xmeta.Thing;
import org.xmeta.ActionException;

//项目名称
def name = self.doAction("getProjectName", actionContext);
//项目所在目录
def dir = self.doAction("getDirectory", actionContext);
//是否添加到xworker
def addToXWorker = self.doAction("isAddToXWorker", actionContext);
//是否创建简单事物管理器
def createSTM = self.doAction("isCreateSimpleThingManager", actionContext);
//项目配置文件的额外属性
def prjProperties = self.doAction("getProjectProperties", actionContext);
//是否包含things目录
def hasThingsDir = self.doAction("hasThingsDir", actionContext);

//检查项目是否已经存在，如果要加入到xworker的话
if(dir == null || addToXWorker == true){
    if(world.getThingManager(name) != null){
        throw new ActionException("Thing manager already exists, name=" + name);
    }
}

//检查和创建模型项目目录
def projectDir = dir;
if(projectDir == null){
    projectDir = new File(world.getPath() + "/projects/" + name);
}
if(projectDir.exists() == false){
    projectDir.mkdirs();
}
   
//创建项目文件
def prjFile = null;
if(dir == null){
    prjFile = new File(projectDir, "config.properties");
}else if(hasThingsDir){
    prjFile = new File(projectDir, "xworker.properties");
}else{
    prjFile = new File(projectDir, "dml.prj");
}    
if(dir == null || hasThingsDir){
    //创建things目录
    def thingsFile = new File(projectDir, "things");
    thingsFile.mkdirs();
}

//保存项目文件
def printWriter = prjFile.newPrintWriter();
printWriter.write("projectName=" + name);
if(prjProperties != null){
    printWriter.write("\r\n");
    printWriter.write(prjProperties);
}
printWriter.flush()  
printWriter.close()

//添加到启动项目中
if(dir != null && addToXWorker){
    def projectSet = world.getThing("_local.xworker.worldExplorer.ProjectSet");
    if(projectSet == null){
        projectSet = new Thing("xworker.ide.worldexplorer.things.ProjectSet");
        projectSet.saveAs("_local", "_local.xworker.worldExplorer.ProjectSet");
    }
    projectSet.doAction("addProject", actionContext, ["projectFile": projectDir, "isWorkspace": false]);
}else if(dir == null){
    def thingManager = world.initThingManager(projectDir);
    return thingManager;
}

//创建事物管理器
//log.info("thingmanager is " + world.getThingManager(name));
return world.getThingManager(name);
#$@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
      sid
      run
      @/@CreateThingManager/@actions/@getProjectName
      sname
      getProjectName
      sattributeName
      projectName
      snotNull
      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.ActionUtil/@GetString
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      getProjectName
      @/@CreateThingManager/@actions/@getDirectory
      sname
      getDirectory
      sattributeName
      directory
      snotNull
      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.ActionUtil/@GetFile
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      getDirectory
      @/@CreateThingManager/@actions/@isAddToXWorker
      sname
      isAddToXWorker
      sattributeName
      addToXWorker
      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.ActionUtil/@GetBoolean
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      isAddToXWorker
      @/@CreateThingManager/@actions/@isCreateSimpleThingManager
      sname
      isCreateSimpleThingManager
      sattributeName
      createSimpleThingManager
      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.ActionUtil/@GetBoolean
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      isCreateSimpleThingManager
      @/@CreateThingManager/@actions/@getProjectProperties
      sname
      getProjectProperties
      sattributeName
      projectProperties
      snotNull
      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.ActionUtil/@GetString
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      getProjectProperties
      @/@CreateThingManager/@actions/@hasThingsDir
      sname
      hasThingsDir
      sattributeName
      thingsDir
      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.ActionUtil/@GetBoolean
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      hasThingsDir
    @/@CreateThingManager/@name
    sname
    name
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    name
    @/@CreateThingManager/@label
    sname
    label
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    label
    @/@CreateThingManager/@projectName
    sname
    projectName
    ssize
    50
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    projectName
    @/@CreateThingManager/@directory
    sname
    directory
    sinputtype
    filePath
    ssize
    60
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    directory
    @/@CreateThingManager/@addToXWorker
    sname
    addToXWorker
    sinputtype
    truefalse
    sshowLabel
    true
    sreadOnly
    false
    sdefault
    true
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    addToXWorker
    @/@CreateThingManager/@createSimpleThingManager
    sname
    createSimpleThingManager
    sinputtype
    truefalse
    sshowLabel
    true
    sreadOnly
    false
    sdefault
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    createSimpleThingManager
    @/@CreateThingManager/@thingsDir
    sname
    thingsDir
    sinputtype
    truefalse
    sshowLabel
    true
    sreadOnly
    false
    sdefault
    false
    sinheritDescription
    false
    sdescription
    <p>是否包含things目录，如果包含项目文件名是xworker.properties，否则是dml.prj。</p>
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    thingsDir
    @/@CreateThingManager/@projectProperties
    sname
    projectProperties
    sinputtype
    textarea
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    projectProperties
    @/@CreateThingManager/@description
    sname
    description
    sinputtype
    html
    sshowLabel
    true
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    description
  @/@MonitorOutterFileThingManager
  sname
  MonitorOutterFileThingManager
  sdescriptors
  xworker.lang.MetaDescriptor3/@thing
  sextends
  xworker.lang.actions.SelfAction
  smany
  true
  seditCols
  2
  sinitialization
  false
  sgroup
  xworker.thingManager
  smodifier
  public
  sinheritDescription
  false
  sdescription
  <p>监听外部的文件事物管理器中的事物文件的变动，如果事物文件被外部修改了，则更新缓存的事物。</p>
  snotXmlAttribute
  false
  sjson_isArray
  false
  sth_createIndex
  true
  sth_registThing
  child|xworker.lang.actions.Actions
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_fileMonitor
  false
  sth_mark
  false
  sid
  MonitorOutterFileThingManager
    @/@MonitorOutterFileThingManager/@actions
    sname
    actions
    sdescriptors
    xworker.lang.MetaDescriptor3/@actions
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_fileMonitor
    false
    sth_mark
    false
    sid
    actions
      @/@MonitorOutterFileThingManager/@actions/@run
      sname
      run
      sisSynchronized
      false
      sthrowException
      true
      suseOtherAction
      false
      svarScope
      Local
      sdisableGlobalContext
      false
      Scode
#$@text#$@
import org.xmeta.thingManagers.FileThingManager;

//外部的FileThingManager自动监听文件改动
def thing = world.getThing("_local.xworker.config.InnerThingManagers.dml");
if(thing != null){
    for(thingManager in world.getThingManagers()){
    if(!(thingManager instanceof FileThingManager)){
            continue;
        }

        def thName = thingManager.getName();             
        for(thingManagerThing in thing.getChilds("ThingManager")){
            if(thName == thingManagerThing.getMetadata().getName()){
                thingManager.setMonitor(true);
            }             
        }
    }
}
#$@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_fileMonitor
      false
      sth_mark
      false
      sid
      run
    @/@MonitorOutterFileThingManager/@name
    sname
    name
    sshowLabel
    true
    slabelAlign
    right
    slabelVAlign
    baseline
    smodifier
    public
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_fileMonitor
    false
    sth_mark
    false
    sid
    name
    @/@MonitorOutterFileThingManager/@label
    sname
    label
    sshowLabel
    true
    slabelAlign
    right
    slabelVAlign
    baseline
    smodifier
    public
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_fileMonitor
    false
    sth_mark
    false
    sid
    label
    @/@MonitorOutterFileThingManager/@description
    sname
    description
    sinputtype
    html
    sshowLabel
    true
    slabelAlign
    right
    slabelVAlign
    baseline
    smodifier
    public
    sreadOnly
    false
    sinheritDescription
    false
    svalidateAllowBlank
    true
    LvalidateOnBlur
    true
    LallowDecimals
    true
    LallowNegative
    true
    snotXmlAttribute
    false
    sdescriptors
    xworker.lang.MetaDescriptor3/@attribute
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_fileMonitor
    false
    sth_mark
    false
    sid
    description
