^1750909429077
@
lth_createTime
1662729417651
sname
ThingQueryerByKeyword
slabel
ThingQueryerByKeyword
sdescriptors
xworker.swt.widgets.Display
  @/@shell
  sname
  shell
  stext
  事物查询
  sNO_TRIM
  false
  sCLOSE
  true
  sTITLE
  true
  sMIN
  true
  sMAX
  true
  sBORDER
  false
  sRESIZE
  true
  sON_TOP
  false
  sTOOL
  false
  sNO_FOCUS
  false
  swidth
  800
  sheight
  600
  scenterScreen
  true
  spack
  false
  smaximized
  false
  sfullScreen
  false
  sH_SCROLL
  false
  sV_SCROLL
  false
  sNO_BACKGROUND
  false
  sNO_MERGE_PAINTS
  false
  sNO_REDRAW_RESIZE
  false
  sNO_RADIO_GROUP
  false
  sEMBEDDED
  false
  sDOUBLE_BUFFERED
  false
  scapture
  false
  senabled
  true
  sredraw
  true
  svisible
  true
  sdescriptors
  xworker.swt.widgets.Display/@Shell
  sid
  shell
    @/@shell/@ListenersPrepared
    sname
    ListenersPrepared
    sdescriptors
    xworker.swt.widgets.Widget/@ListenersPrepared
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ListenersPrepared
      @/@shell/@ListenersPrepared/@menuListener
      sname
      menuSelection
      stype
      Selection
      sdescription
      <p>事物菜单的监听事件。</p>
      sdescriptors
      xworker.swt.events.Listeners/@listenersPrepared/@Listener
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      menuListener
        @/@shell/@ListenersPrepared/@menuListener/@menuSelection
        sname
        menuSelection
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        svarScope
        Local
        sdisableGlobalContext
        false
        Scode
#$@text#$@
import org.xmeta.ActionContext;
import org.xmeta.Thing;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;

import org.xmeta.util.UtilString;

String actionUrl = event.widget.getData("url");
def menuThing = event.widget.getData("menu")

try{
    if(actionUrl != null){
        if(actionUrl.startsWith("http:")){
            explorerActions.doAction("openUrl", explorerContext, ["url": actionUrl, "name":actionUrl]);
        }else if(actionUrl == "do?sc="){
            def cfg = world.getThing("_local.xworker.config.GlobalConfig");
            explorerActions.doAction("openUrl", explorerContext, ["url": cfg.getString("webUrl") + actionUrl + currentThing.getMetadata().getPath(), "name":actionUrl]);
        }else if(actionUrl.startsWith("do?")){
            def cfg = world.getThing("_local.xworker.config.GlobalConfig");
            explorerActions.doAction("openUrl", explorerContext, ["url": cfg.getString("webUrl") + actionUrl + "&currentThing=" + currentThing.getMetadata().getPath(), "name":actionUrl]);
        }else{
            def action = world.getAction(actionUrl);
            //log.info(actionUrl);
            if(action != null){    
                action.run(actionContext);
            }
        }
    }else if(menuThing.shell != null){
        def shellPath = menuThing.shell;
        def index = shellPath.indexOf("?");
        def params = [:];
        if(index != -1){
            def paramsStr = shellPath.substring(index + 1, shellPath.length());
            shellPath = shellPath.substring(0, index);
            params = UtilString.getParams(paramsStr); 
        }
        def shellThing = world.get(shellPath);
        if(shellThing != null){
            ActionContext context = new ActionContext();
            context.put("parent", coolBar.getShell());
            context.put("editorShell", coolBar.getShell());
            context.put("thing", currentThing);
            context.put("currentThing", currentThing);
            
            def newShell = shellThing.doAction("create", context);
            if(newShell != null){
                if(newShell.getData("menuShellDispose") == true){
                    newShell.dispose();
                }else{
                    newShell.open();
                }
            }
        }else{
            log.info("shell thing is not exists, path=" + menuThing.shell);
            throw new Exception("窗体不存在, path=" + menuThing.shell);
        }
    }else{
        log.info("menu action is null");
        throw new Exception("需要设置动作或窗体。");
    }
}catch(Exception e){
    log.error("open thing menu errror", e);
    def box = new MessageBox(event.widget.parent.shell, SWT.ICON_ERROR | SWT.OK);
    box.setText("操作提示");
    box.setMessage("" + e.getMessage());
    box.open();
}
#$@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
        menuSelection
    @/@shell/@shellFillLayout
    sname
    shellFillLayout
    stype
    SWT.HORIZONTAL
    slabel
    shellFillLayout
    sdescriptors
    xworker.swt.Layouts/@FillLayout
    sid
    shellFillLayout
    @/@shell/@mainComposite
    sname
    mainComposite
    sBORDER
    false
    sH_SCROLL
    false
    sV_SCROLL
    false
    sNO_BACKGROUND
    false
    sNO_FOCUS
    false
    sNO_MERGE_PAINTS
    false
    sNO_REDRAW_RESIZE
    false
    sNO_RADIO_GROUP
    false
    sEMBEDDED
    false
    sDOUBLE_BUFFERED
    false
    scapture
    false
    senabled
    true
    sredraw
    true
    svisible
    true
    sdescriptors
    xworker.swt.Widgets/@Composite
    sid
    mainComposite
      @/@shell/@mainComposite/@mainCompositeGridLayout
      sname
      mainCompositeGridLayout
      smakeColumnsEqualWidth
      false
      smarginWidth
      5
      smarginHeight
      5
      smarginLeft
      0
      smarginTop
      0
      smarginRight
      0
      smarginBottom
      0
      shorizontalSpacing
      5
      sverticalSpacing
      5
      sdescriptors
      xworker.swt.Layouts/@GridLayout
      sth_createIndex
      false
      sth_mark
      false
      sid
      mainCompositeGridLayout
      @/@shell/@mainComposite/@sashForm
      sname
      sashForm
      sstyle
      VERTICAL
      sSMOOTH
      true
      sweights
      50,50
      sBORDER
      false
      sH_SCROLL
      false
      sV_SCROLL
      false
      sNO_BACKGROUND
      false
      sNO_FOCUS
      false
      sNO_MERGE_PAINTS
      false
      sNO_REDRAW_RESIZE
      false
      sNO_RADIO_GROUP
      false
      sEMBEDDED
      false
      sDOUBLE_BUFFERED
      false
      scapture
      false
      senabled
      true
      sredraw
      true
      svisible
      true
      sdescriptors
      xworker.swt.Widgets/@SashForm
      sid
      sashForm
        @/@shell/@mainComposite/@sashForm/@searchComposite
        sname
        searchComposite
        sBORDER
        false
        sH_SCROLL
        false
        sV_SCROLL
        false
        sNO_BACKGROUND
        false
        sNO_FOCUS
        false
        sNO_MERGE_PAINTS
        false
        sNO_REDRAW_RESIZE
        false
        sNO_RADIO_GROUP
        false
        sEMBEDDED
        false
        sDOUBLE_BUFFERED
        false
        scapture
        false
        senabled
        true
        sredraw
        true
        svisible
        true
        sdescriptors
        xworker.swt.Widgets/@Composite
        sid
        searchComposite
          @/@shell/@mainComposite/@sashForm/@searchComposite/@searchCompositeGridLayout
          sname
          searchCompositeGridLayout
          snumColumns
          2
          smakeColumnsEqualWidth
          false
          smarginWidth
          5
          smarginHeight
          5
          smarginLeft
          0
          smarginTop
          0
          smarginRight
          0
          smarginBottom
          0
          shorizontalSpacing
          5
          sverticalSpacing
          5
          slabel
          searchCompositeGridLayout
          sdescriptors
          xworker.swt.Layouts/@GridLayout
          sid
          searchCompositeGridLayout
          @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText
          sname
          searchText
          sstyle
          SINGLE
          sH_SCROLL
          false
          sV_SCROLL
          false
          sWRAP
          false
          sREAD_ONLY
          false
          sPASSWORD
          false
          sSEARCH
          false
          sCANCEL
          false
          sBORDER
          true
          salign
          LEFT
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          slabel
          searchText
          sdescriptors
          xworker.swt.Widgets/@Text
          sid
          searchText
            @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText/@searchTextGridData
            sname
            searchTextGridData
            sstyle
            FILL_HORIZONTAL
            shorizontalIndent
            0
            swidth
            -1
            sheight
            -1
            shorizontalAlignment
            BEGINNING
            sverticalAlignment
            CENTER
            shorizontalSpan
            1
            sverticalSpan
            1
            sgrabExcessHorizontalSpace
            false
            sgrabExcessVerticalSpace
            false
            slabel
            searchTextGridData
            sdescriptors
            xworker.swt.layout.LayoutDatas/@GridData
            sid
            searchTextGridData
            @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText/@Listeners
            sname
            Listeners
            slabel
            Listeners
            sdescriptors
            xworker.swt.widgets.Widget/@Listeners
            sid
            Listeners
              @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText/@Listeners/@searchTextDefaultSelection
              sname
              searchTextDefaultSelection
              stype
              DefaultSelection
              sref
              searchButtonSelection
              slabel
              searchTextDefaultSelection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sid
              searchTextDefaultSelection
              @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText/@Listeners/@Listener
              sname
              ModiyListener
              stype
              Hide
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_mark
              false
              sid
              Listener
                @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText/@Listeners/@Listener/@modifyGroovy
                sname
                modifyGroovy
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Local
                sdisableGlobalContext
                false
                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
                modifyGroovy
                @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText/@Listeners/@Listener/@searchDelay
                sname
                searchDelay
                sdelay
                500
                sreservedVars
                searchText,searchButtonSelection,store,openButton
                sinterpretationType
                Self
                sattributeTemplate
                false
                schildsAttributeTemplate
                false
                svarScope
                Local
                sisSynchronized
                false
                sthrowException
                true
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdisableGlobalContext
                false
                sdebugLog
                false
                sdescriptors
                xworker.lang.actions.Actions/@DelayAction
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_registDisabled
                false
                sth_mark
                false
                sid
                searchDelay
                  @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText/@Listeners/@Listener/@searchDelay/@actions
                  sname
                  actions
                  sdescriptors
                  xworker.lang.actions.DelayAction/@actions1
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_registDisabled
                  false
                  sth_mark
                  false
                  sid
                  actions
                    @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText/@Listeners/@Listener/@searchDelay/@actions/@DisplayExec
                    sname
                    doTask
                    swidgetForDisplay
                    sashForm
                    stype
                    async
                    svariables
                    searchText,searchButton,searchButtonSelection
                    scancelTaskOnWidgetDisposed
                    false
                    sinterpretationType
                    Self
                    sattributeTemplate
                    false
                    schildsAttributeTemplate
                    false
                    svarScope
                    Local
                    sisSynchronized
                    false
                    sthrowException
                    true
                    screateLocalVarScope
                    false
                    ssaveReturn
                    false
                    sswitchResult
                    false
                    sdisableGlobalContext
                    false
                    sdebugLog
                    false
                    sdescriptors
                    xworker.swt.actions.DisplayActions/@DisplayExec
                    sinheritDescription
                    false
                    sth_createIndex
                    false
                    sth_registMyChilds
                    false
                    sth_registDisabled
                    false
                    sth_mark
                    false
                    sid
                    DisplayExec
                      @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText/@Listeners/@Listener/@searchDelay/@actions/@DisplayExec/@actions
                      sname
                      actions
                      sdescriptors
                      xworker.swt.actions.DisplayActions/@DisplayExec/@actions
                      sinheritDescription
                      false
                      sth_createIndex
                      false
                      sth_registMyChilds
                      false
                      sth_registDisabled
                      false
                      sth_mark
                      false
                      sid
                      actions
                        @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText/@Listeners/@Listener/@searchDelay/@actions/@DisplayExec/@actions/@doAction
                        sname
                        doAction
                        srefActionPath
                        xworker.ide.db.dbindex.app.swt.ThingQueryerByKeyword/@shell/@mainComposite/@sashForm/@searchComposite/@searchButton/@Listeners/@searchButtonSelection/@GroovyAction
                        sinterpretationType
                        Self
                        sattributeTemplate
                        false
                        schildsAttributeTemplate
                        false
                        svarScope
                        Local
                        sisSynchronized
                        false
                        sthrowException
                        true
                        screateLocalVarScope
                        false
                        ssaveReturn
                        false
                        sdisableGlobalContext
                        false
                        sdebugLog
                        false
                        sdescriptors
                        xworker.lang.actions.Actions/@RefAction
                        sinheritDescription
                        false
                        sth_createIndex
                        false
                        sth_registMyChilds
                        false
                        sth_registDisabled
                        false
                        sth_mark
                        false
                        sid
                        doAction
              @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText/@Listeners/@textKeyDown
              sname
              textKeyDown
              stype
              KeyDown
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_registDisabled
              false
              sth_mark
              false
              sid
              textKeyDown
                @/@shell/@mainComposite/@sashForm/@searchComposite/@searchText/@Listeners/@textKeyDown/@KeyTravel
                sname
                KeyTravel
                swidget
                dataTable
                sselectionListener
                xworker.ide.db.dbindex.app.swt.ThingQueryerByKeyword/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@listeners/@dataTableSelection/@GroovyAction
                sinterpretationType
                Self
                sattributeTemplate
                false
                schildsAttributeTemplate
                false
                svarScope
                Local
                sisSynchronized
                false
                sthrowException
                true
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdisableGlobalContext
                false
                sdebugLog
                false
                sdescriptors
                xworker.swt.actions.EventActions/@KeyTravel
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_registDisabled
                false
                sth_mark
                false
                sid
                KeyTravel
          @/@shell/@mainComposite/@sashForm/@searchComposite/@searchButton
          sname
          searchButton
          stext
          label:xworker.swt.ide.worldexplorer.swt.i18n.I18nResource/@buttons/@queryButton
          stype
          SWT.PUSH
          sflat
          false
          sborder
          false
          sselected
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          slabel
          searchButton
          sdescriptors
          xworker.swt.Widgets/@Button
          sid
          searchButton
            @/@shell/@mainComposite/@sashForm/@searchComposite/@searchButton/@Listeners
            sname
            Listeners
            slabel
            Listeners
            sdescriptors
            xworker.swt.widgets.Widget/@Listeners
            sid
            Listeners
              @/@shell/@mainComposite/@sashForm/@searchComposite/@searchButton/@Listeners/@searchButtonSelection
              sname
              searchButtonSelection
              stype
              Selection
              slabel
              searchButtonSelection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sid
              searchButtonSelection
                @/@shell/@mainComposite/@sashForm/@searchComposite/@searchButton/@Listeners/@searchButtonSelection/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Global
                sdisableGlobalContext
                false
                Scode
#$@text#$@
import xworker.core.text.Stemmer;

def keyText = searchText.getText().toLowerCase();
if(keyText == ""){
    //browser.setText("Search content cannot be null");
    //return;
}

def keys = [];
def keystr = "";
if(keyText.trim() != ""){
    for(key in keyText.split("[ ]")){
        key = key.trim().toLowerCase();
        //key = Stemmer.stem(key);
        if(key != ""){
            keys.add(key);
        }
        if(keystr != ""){
            keystr = keystr + "," + key;
        }else{
            keystr = key;
        }
    }
}

actionContext.getScope(0).put("keys", keys);
actionContext.getScope(0).put("keystr", keystr);
store.doAction("load", actionContext, ["params":["keystr": keystr]]);
//keysStore.doAction("load", actionContext);

openButton.setEnabled(false);

//显示文档等
descriptionLabel.setText("");
browser.setText("");
for(item in toolBar.getItems()){
    item.dispose();
}
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sswitchResult
                false
                sdebugLog
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sid
                GroovyAction
            @/@shell/@mainComposite/@sashForm/@searchComposite/@searchButton/@searchBtnGridData
            sname
            searchBtnGridData
            shorizontalIndent
            0
            swidth
            80
            sheight
            -1
            shorizontalAlignment
            BEGINNING
            sverticalAlignment
            CENTER
            shorizontalSpan
            1
            sverticalSpan
            1
            sgrabExcessHorizontalSpace
            false
            sgrabExcessVerticalSpace
            false
            slabel
            searchBtnGridData
            sdescriptors
            xworker.swt.layout.LayoutDatas/@GridData
            sid
            searchBtnGridData
          @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable
          sname
          dataTable
          sselectStyle
          SINGLE
          sV_SCROLL
          true
          sH_SCROLL
          true
          sCHECK
          false
          sFULL_SELECTION
          true
          sHIDE_SELECTION
          true
          sBORDER
          false
          slineVisible
          true
          smultipleColumns
          true
          sheaderVisible
          true
          ssortIndicator
          true
          smoveableColumns
          true
          sheadImages
          false
          ssubImages
          false
          sVIRTUAL
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          slabel
          dataTable
          sdescriptors
          xworker.swt.Widgets/@Table
          sid
          dataTable
            @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@dataTableGridDAta
            sname
            dataTableGridDAta
            sstyle
            FILL_BOTH
            shorizontalIndent
            0
            swidth
            -1
            sheight
            -1
            shorizontalAlignment
            BEGINNING
            sverticalAlignment
            CENTER
            shorizontalSpan
            2
            sverticalSpan
            1
            sgrabExcessHorizontalSpace
            false
            sgrabExcessVerticalSpace
            false
            slabel
            dataTableGridDAta
            sdescriptors
            xworker.swt.Commons/@GridData
            sid
            dataTableGridDAta
            @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store
            sname
            store
            sattachToParent
            true
            sloadBackground
            true
            sautoLoad
            false
            sautoSave
            false
            squeryConfig
            xworker.ide.db.dbindex.app.swt.ThingQueryerByKeyword/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things/@Condition
            spaging
            extend
            spageSize
            50
            sstoreSortField
            _extend
            sstoreSortDir
            ASC
            seditable
            extend
            seditmethod
            extend
            slabel
            store
            sdescriptors
            xworker.swt.Commons/@DataStore
            sid
            store
              @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects
              sname
              dataObjects
              slabel
              dataObjects
              sdescriptors
              xworker.swt.app.view.swt.data.DataStore/@DataObjects
              sid
              dataObjects
                @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things
                sname
                Things
                stableName
                tblthings
                sdataSource
                _local.xworker.db.XWorkerIDEDataSource
                sDDL
                false
                sshowSql
                true
                squerySqlForQueryOnly
                false
                skeepQuerySql
                false
                seditCols
                2
                spaging
                true
                spageSize
                200
                snoTotalCount
                false
                spagineByCursor
                false
                sreadUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectStore/@read
                screateUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectStore/@create
                supdateUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectStore/@update
                sdestroyUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectStore/@destroy
                LstoreAutoDestroy
                false
                sstoreAutoLoad
                false
                LstoreAutoSave
                true
                LstoreBatch
                true
                LstorePruneModifiedRecords
                false
                LstoreRemoteSort
                false
                LstoreRestful
                false
                sstoreRoot
                'rows'
                sstoreSuccessProperty
                'success'
                sstoreTotalProperty
                'totalCount'
                sstoreMessageProperty
                'msg'
                sgridEditable
                false
                sgridEditType
                cell
                sformReadUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectForm/@read
                sformCreateUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectForm/@create
                sformUpdateUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectForm/@update
                sformDestroyUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectForm/@delete
                spaging_afterPageText
                页 共
                spaging_beforePageText
                第
                Lpaging_displayInfo
                false
                spaging_displayMsg
                第{0}-第{1}条，共{2}条
                spaging_emptyMsg
                没有数据
                spaging_firstText
                首页
                spaging_lastText
                最后一页
                spaging_nextText
                下一页
                Lpaging_prependButtons
                false
                spaging_prevText
                上一页
                spaging_refreshText
                刷新
                sgridColumnLocking
                false
                sgridLockText
                '锁定'
                sgridUnlockText
                '解锁'
                scolumnGroup
                false
                sgridCheckable
                false
                sgridRowNumber
                false
                sgridGrouping
                false
                sgridGroupTextTpl
                '{text} ({[values.rs.length]} 条)'
                sgridRowExpander
                false
                sautoGenerateId
                false
                sidGenerateType
                action
                sidAction
                generateId
                sstoreSortDir
                ASC
                sautoInit
                false
                sautoInitAction
                beforeCreate
                scacheRelation
                false
                scacheRelationMaxSize
                1000
                scacheRelationReadnone
                false
                safterCreated
                false
                sonLoaded
                false
                sbeforeUpdate
                false
                safterUpdated
                false
                sbeforeDelete
                false
                safterDeleted
                false
                sbeforeQuery
                false
                safterQueryed
                false
                sshowUserTask
                false
                sdescriptors
                xworker.dataObject.DataObjects/@DbDataObject
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_registDisabled
                false
                sth_mark
                false
                sid
                Things
                  @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things/@14377
                  sname
                  id
                  slabel
                  标识
                  sfieldName
                  id
                  stype
                  string
                  soptional
                  true
                  skey
                  false
                  sdataField
                  true
                  sviewField
                  true
                  sreadField
                  true
                  screateEditor
                  true
                  seditEditor
                  true
                  sviewEditor
                  true
                  sgridEditor
                  true
                  squeryEditor
                  true
                  sreadOnly
                  false
                  sdisabled
                  false
                  sshowLabel
                  true
                  slabelAlign
                  right
                  slabelVAlign
                  baseline
                  svalidateAllowBlank
                  true
                  LvalidateOnBlur
                  true
                  LallowDecimals
                  true
                  LallowNegative
                  true
                  sshowInTable
                  true
                  seditable
                  true
                  sdisplayRelationLabel
                  false
                  sgridFixed
                  false
                  sgridHidden
                  false
                  sgridHideable
                  true
                  sgridSortable
                  false
                  scolumnLocked
                  false
                  sgridGroupable
                  true
                  sgridMenuDisabled
                  false
                  sgridResizable
                  true
                  sdescriptors
                  xworker.dataObject.db.DbDataObject/@attribute
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_registDisabled
                  false
                  sth_mark
                  false
                  sid
                  14377
                  @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things/@14378
                  sname
                  path
                  slabel
                  路径
                  sfieldName
                  path
                  stype
                  string
                  soptional
                  true
                  skey
                  false
                  sdataField
                  true
                  sviewField
                  true
                  sreadField
                  true
                  screateEditor
                  true
                  seditEditor
                  true
                  sviewEditor
                  true
                  sgridEditor
                  true
                  squeryEditor
                  true
                  sreadOnly
                  false
                  sdisabled
                  false
                  sshowLabel
                  true
                  slabelAlign
                  right
                  slabelVAlign
                  baseline
                  svalidateAllowBlank
                  true
                  LvalidateOnBlur
                  true
                  LallowDecimals
                  true
                  LallowNegative
                  true
                  sshowInTable
                  true
                  sgridWidth
                  400
                  seditable
                  true
                  sdisplayRelationLabel
                  false
                  sgridFixed
                  false
                  sgridHidden
                  false
                  sgridHideable
                  true
                  sgridSortable
                  false
                  scolumnLocked
                  false
                  sgridGroupable
                  true
                  sgridMenuDisabled
                  false
                  sgridResizable
                  true
                  sdescriptors
                  xworker.dataObject.db.DbDataObject/@attribute
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_registDisabled
                  false
                  sth_mark
                  false
                  sid
                  14378
                  @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things/@14379
                  sname
                  name
                  slabel
                  名称
                  sfieldName
                  name
                  stype
                  string
                  soptional
                  true
                  skey
                  false
                  sdataField
                  true
                  sviewField
                  true
                  sreadField
                  true
                  screateEditor
                  true
                  seditEditor
                  true
                  sviewEditor
                  true
                  sgridEditor
                  true
                  squeryEditor
                  true
                  sreadOnly
                  false
                  sdisabled
                  false
                  sshowLabel
                  true
                  slabelAlign
                  right
                  slabelVAlign
                  baseline
                  svalidateAllowBlank
                  true
                  LvalidateOnBlur
                  true
                  LallowDecimals
                  true
                  LallowNegative
                  true
                  sshowInTable
                  true
                  sgridWidth
                  150
                  seditable
                  true
                  sdisplayRelationLabel
                  false
                  sgridFixed
                  false
                  sgridHidden
                  false
                  sgridHideable
                  true
                  sgridSortable
                  false
                  scolumnLocked
                  false
                  sgridGroupable
                  true
                  sgridMenuDisabled
                  false
                  sgridResizable
                  true
                  sdescriptors
                  xworker.dataObject.db.DbDataObject/@attribute
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_registDisabled
                  false
                  sth_mark
                  false
                  sid
                  14379
                  @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things/@14380
                  sname
                  label
                  slabel
                  标签
                  sfieldName
                  label
                  stype
                  string
                  soptional
                  true
                  skey
                  false
                  sdataField
                  true
                  sviewField
                  true
                  sreadField
                  true
                  screateEditor
                  true
                  seditEditor
                  true
                  sviewEditor
                  true
                  sgridEditor
                  true
                  squeryEditor
                  true
                  sreadOnly
                  false
                  sdisabled
                  false
                  sshowLabel
                  true
                  slabelAlign
                  right
                  slabelVAlign
                  baseline
                  svalidateAllowBlank
                  true
                  LvalidateOnBlur
                  true
                  LallowDecimals
                  true
                  LallowNegative
                  true
                  sshowInTable
                  true
                  sgridWidth
                  150
                  seditable
                  true
                  sdisplayRelationLabel
                  false
                  sgridFixed
                  false
                  sgridHidden
                  false
                  sgridHideable
                  true
                  sgridSortable
                  false
                  scolumnLocked
                  false
                  sgridGroupable
                  true
                  sgridMenuDisabled
                  false
                  sgridResizable
                  true
                  sdescriptors
                  xworker.dataObject.db.DbDataObject/@attribute
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_registDisabled
                  false
                  sth_mark
                  false
                  sid
                  14380
                  @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things/@Condition
                  sname
                  Condition
                  boperator
                  1
                  sjoin
                  and
                  smultiple
                  false
                  smultiValueJoin
                  or
                  signoreNull
                  true
                  sdummySql
                  false
                  sisClause
                  false
                  salwaysAddClause
                  false
                  sisClauseTemplate
                  false
                  saddOneDay
                  false
                  sdebug
                  false
                  sdescriptors
                  xworker.dataObject.DataObject/@Condition
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_registDisabled
                  false
                  sth_mark
                  false
                  sid
                  Condition
                    @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things/@Condition/@28643
                    sname
                    id
                    sattributeName
                    id
                    boperator
                    11
                    sjoin
                    and
                    smultiple
                    false
                    smultiValueJoin
                    or
                    signoreNull
                    true
                    sdummySql
                    false
                    sisClause
                    true
                    salwaysAddClause
                    false
                    sisClauseTemplate
                    false
                    sclauseSQL
                    select thingId from TBLTHINGKEYWORDS
                    saddOneDay
                    false
                    sdebug
                    false
                    sdescriptors
                    xworker.dataObject.query.Condition/@Condition
                    sinheritDescription
                    false
                    sth_createIndex
                    false
                    sth_registMyChilds
                    false
                    sth_registDisabled
                    false
                    sth_noThingRegistViewer
                    false
                    sth_fileMonitor
                    false
                    sth_mark
                    false
                    sth_registQueryOnlySelf
                    false
                    snotXmlAttribute
                    false
                    sjson_isArray
                    false
                    sid
                    28643
                      @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things/@Condition/@28643/@28644
                      sname
                      KEYWORD
                      sattributeName
                      KEYWORD
                      sdataName
                      keystr
                      boperator
                      10
                      sjoin
                      and
                      smultiple
                      true
                      smultiValueJoin
                      or
                      signoreNull
                      true
                      sdummySql
                      false
                      sisClause
                      false
                      salwaysAddClause
                      false
                      sisClauseTemplate
                      false
                      saddOneDay
                      false
                      sdebug
                      false
                      sdescriptors
                      xworker.dataObject.query.Condition/@Condition
                      sinheritDescription
                      false
                      sth_createIndex
                      false
                      sth_registMyChilds
                      false
                      sth_registDisabled
                      false
                      sth_noThingRegistViewer
                      false
                      sth_fileMonitor
                      false
                      sth_mark
                      false
                      sth_registQueryOnlySelf
                      false
                      snotXmlAttribute
                      false
                      sjson_isArray
                      false
                      sid
                      28644
                        @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things/@Condition/@28643/@28644/@actions
                        sname
                        actions
                        sdescriptors
                        xworker.dataObject.query.Condition/@actions1
                        sinheritDescription
                        false
                        sth_createIndex
                        false
                        sth_registMyChilds
                        false
                        sth_registDisabled
                        false
                        sth_noThingRegistViewer
                        false
                        sth_fileMonitor
                        false
                        sth_mark
                        false
                        sth_registQueryOnlySelf
                        false
                        snotXmlAttribute
                        false
                        sjson_isArray
                        false
                        sid
                        actions
                          @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things/@Condition/@28643/@28644/@actions/@nodeToSql
                          sname
                          nodeToSql
                          sisSynchronized
                          false
                          sthrowException
                          true
                          suseOtherAction
                          false
                          svarScope
                          Local
                          sdisableGlobalContext
                          false
                          Scode
#$@text#$@
//println "ssssssssssssssssssssssssssss";
println datas;
return null;
#$@text#$@
                          sai_needGenerate
                          false
                          sai_rootThingXml
                          true
                          sai_promptContainsVars
                          true
                          sinterpretationType
                          Action
                          screateLocalVarScope
                          false
                          ssaveReturn
                          false
                          sswitchResult
                          false
                          sdebugLog
                          false
                          sdescriptors
                          xworker.groovy.GroovyAction
                          sinheritDescription
                          false
                          sth_createIndex
                          false
                          sth_registMyChilds
                          false
                          sth_registDisabled
                          false
                          sth_noThingRegistViewer
                          false
                          sth_fileMonitor
                          false
                          sth_mark
                          false
                          sth_registQueryOnlySelf
                          false
                          snotXmlAttribute
                          false
                          sjson_isArray
                          false
                          sid
                          nodeToSql
                    @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things/@Condition/@actions
                    sname
                    actions
                    sdescriptors
                    xworker.dataObject.query.Condition/@actions1
                    sinheritDescription
                    false
                    sth_createIndex
                    false
                    sth_registMyChilds
                    false
                    sth_registDisabled
                    false
                    sth_noThingRegistViewer
                    false
                    sth_fileMonitor
                    false
                    sth_mark
                    false
                    sth_registQueryOnlySelf
                    false
                    snotXmlAttribute
                    false
                    sjson_isArray
                    false
                    sid
                    actions
                      @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@Things/@Condition/@actions/@parse
                      sname
                      parse
                      sisSynchronized
                      false
                      sthrowException
                      true
                      suseOtherAction
                      false
                      svarScope
                      Local
                      sdisableGlobalContext
                      false
                      Scode
#$@text#$@
import xworker.dataObject.query.Condition;

Condition condition = new Condition();

def keystr = values.get("keystr");
if(keystr != ""){
    def keys = keystr.split("[,]");
    def clause = null;
    for(key in keys){
        if(clause == null){
            clause = "select  thingId,KEYWORD from TBLTHINGKEYWORDS where KEYWORD = ?";
        }else{
            clause = clause + " union select  thingId,KEYWORD from TBLTHINGKEYWORDS where KEYWORD = ?";
        }
    }
    
    def sql = """
id in (
select thingId from (select thingId, count(*) as cnt from (
${clause}) u1 group by thingId) u2 where cnt = ?)""";

    def list = keys.toList();
    list.add(keys.length);
    keys = list as Object[];
   
    condition.sql("someAttr", sql, keys);
    println "kkkkkkkkkkkkkkkkkkkkkk: " + keys;
}

return condition;
#$@text#$@
                      sinterpretationType
                      Action
                      screateLocalVarScope
                      false
                      ssaveReturn
                      false
                      sswitchResult
                      false
                      sdebugLog
                      false
                      sdescriptors
                      xworker.groovy.GroovyAction
                      sinheritDescription
                      false
                      sth_createIndex
                      false
                      sth_registMyChilds
                      false
                      sth_registDisabled
                      false
                      sth_noThingRegistViewer
                      false
                      sth_fileMonitor
                      false
                      sth_mark
                      false
                      sth_registQueryOnlySelf
                      false
                      snotXmlAttribute
                      false
                      sjson_isArray
                      false
                      sid
                      parse
                @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@DbDataObject
                sname
                DbDataObject
                sdataSource
                xworker.ide.db.datasource.XWorkerDataSource
                sshowSql
                false
                squerySqlForQueryOnly
                false
                seditCols
                2
                spaging
                true
                spageSize
                50
                sreadUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectStore/@read
                screateUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectStore/@create
                supdateUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectStore/@update
                sdestroyUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectStore/@destroy
                LstoreAutoDestroy
                false
                sstoreAutoLoad
                false
                LstoreAutoSave
                true
                LstoreBatch
                true
                LstorePruneModifiedRecords
                false
                LstoreRemoteSort
                false
                LstoreRestful
                false
                sstoreRoot
                'rows'
                sstoreSuccessProperty
                'success'
                sstoreTotalProperty
                'totalCount'
                sstoreMessageProperty
                'msg'
                sgridEditable
                false
                sgridEditType
                cell
                sformReadUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectForm/@read
                sformCreateUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectForm/@create
                sformUpdateUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectForm/@update
                sformDestroyUrl
                do?sc=xworker.web.app.view.extjs.server.DataObjectForm/@delete
                spaging_afterPageText
                页 共
                spaging_beforePageText
                第
                Lpaging_displayInfo
                false
                spaging_displayMsg
                第{0}-第{1}条，共{2}条
                spaging_emptyMsg
                没有数据
                spaging_firstText
                首页
                spaging_lastText
                最后一页
                spaging_nextText
                下一页
                Lpaging_prependButtons
                false
                spaging_prevText
                上一页
                spaging_refreshText
                刷新
                sgridColumnLocking
                false
                sgridLockText
                '锁定'
                sgridUnlockText
                '解锁'
                scolumnGroup
                false
                sgridCheckable
                false
                sgridRowNumber
                false
                sgridGrouping
                false
                sgridGroupTextTpl
                '{text} ({[values.rs.length]} 条)'
                sgridRowExpander
                false
                sautoGenerateId
                false
                sidGenerateType
                action
                sidAction
                generateId
                sstoreSortField
                path
                sstoreSortDir
                ASC
                sautoInit
                false
                sautoInitAction
                beforeCreate
                scacheRelation
                false
                scacheRelationMaxSize
                1000
                scacheRelationReadnone
                false
                safterCreated
                false
                sonLoaded
                false
                sbeforeUpdate
                false
                safterUpdated
                false
                sbeforeDelete
                false
                safterDeleted
                false
                safterQueryed
                false
                sdescriptors
                xworker.dataObject.DataObjects/@DbDataObject
                sid
                DbDataObject
                  @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@DbDataObject/@actions
                  sname
                  actions
                  slabel
                  actions
                  sdescriptors
                  xworker.dataObject.db.DbDataObject/@actions1
                  sid
                  actions
                    @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@DbDataObject/@actions/@query
                    sname
                    query
                    sisSynchronized
                    false
                    sthrowException
                    true
                    suseOtherAction
                    false
                    svarScope
                    Global
                    sdisableGlobalContext
                    false
                    Scode
#$@text#$@
import xworker.dataObject.DataObject;
import xworker.dataObject.DataObjectList;
import xworker.dataObject.utils.DbUtil;

import org.xmeta.Thing;

println("xxxxxxxxxxxxxxxxxxxxx");
def pst = null;
def rs = null;
try{
    def sql = "";
    def keys = actionContext.get("keys");
    if(keys == null && actionContext.get("parentActionContext") != null){
        keys = actionContext.parentActionContext.keys;
    }
    sql = "select * from tblThings";
    if(keys != null && keys.size() > 0){
        //sql = "select distinct thingId from (select thingId, count(*) as cnt from tblThingKeywords where ";
        def clause = "select thingId, count(*) as cnt from tblThingKeywords where keyword in ";
        def inStr = null;
        for(int i=0; i<keys.size(); i++){
            if(inStr == null){
                inStr = "?";
            }else{
                inStr = inStr + ",?";
            }
            /*
            if(i != 0){
                sql = sql + " and ";
            }else{
                sql = sql + " where ";
            }
            
            sql = sql + " id in (select thingId from  tblThingKeywords where keyword=?)";
            */
        }
        clause = clause + "(" + inStr + ") group by thingId";
        
        clause = "select thingId from (" + clause + ") t where cnd =" + keys.size();
        sql = sql + " where id in (" + clause + ") t";
        println(sql);
    }else{
        keys = null;
    }
    
    /*    
    if(keys == null){
        sql = "select name, path, label,en_label,zh_label from tblThings";
    }else{
        sql = "select s0.name, s0.path, s0.label,s0.en_label,s0.zh_label from tblThings s0, (" + sql + ") s1 where s0.id=s1.thingId";
    }*/

    //log.info("sql=" + sql);
    if(pageInfo != null && pageInfo.limit != 0){
        //分页查询
        def countSql = "select count(*) from (" + sql + ") as t";
        //log.info(countSql);
        pst = con.prepareStatement(countSql);
        def index = 1;
        for(key in keys){
            pst.setString(index, key);
            index++;
        }
        rs = pst.executeQuery();
        rs.next();
        pageInfo.totalCount = rs.getInt(1);
        rs.close();
        pst.close();
        
        //分页的sql    
        sql = "SELECT * FROM ( SELECT ROW_NUMBER() OVER() AS rownum, t.*  FROM (" + sql + " order by path) t) AS tmp WHERE rownum >= ? AND rownum < ?";
    }
    
    log.info(sql);
    pst = con.prepareStatement(sql);
    def index = 1;
    for(key in keys){
        pst.setString(index, key);
        index++;
    }

    if(pageInfo != null && pageInfo.limit != 0){
        def start = pageInfo.start + 1;
        pst.setInt(index, start);
        pst.setInt(index + 1, start + pageInfo.limit);
    }
    rs = pst.executeQuery();
    def datas = [];
    def tmpThing = new Thing();
    while(rs.next()){
        def dobj = new DataObject("xworker.ide.db.dbindex.app.swt.ThingQueryerByKeyword/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@DbDataObject");
        dobj.setInited(false);
        dobj.put("path", rs.getString("path"));
        tmpThing.set("label", rs.getString("label"));        
        tmpThing.set("name", rs.getString("name"));
        tmpThing.set("en_label", rs.getString("en_label"));
        tmpThing.set("zh_label", rs.getString("zh_label"));
        dobj.put("name", tmpThing.metadata.label);
        dobj.setInited(true);;
        datas.add(dobj);
    }
    
    return datas;
}finally{
    if(rs != null){
        rs.close();
    }
    
    if(pst != null){
        pst.close();
    }
}
#$@text#$@
                    sinterpretationType
                    Action
                    screateLocalVarScope
                    false
                    ssaveReturn
                    false
                    sdebugLog
                    false
                    sdescriptors
                    xworker.lang.actions.Actions/@GroovyAction
                    sid
                    query
                      @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@DbDataObject/@actions/@query/@contexts
                      sname
                      contexts
                      slabel
                      contexts
                      sdescriptors
                      xworker.lang.actions.Inout/@contexts
                      sid
                      contexts
                        @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@DbDataObject/@actions/@query/@contexts/@dataSource
                        sname
                        dataSource
                        sconnectionName
                        con
                        stransaction
                        false
                        sdataSourcePath
                        self.dataSource
                        sdisable
                        false
                        sonError
                        ignore
                        spreventError
                        false
                        sinherit
                        true
                        sdescriptors
                        xworker.lang.db.jdbc.DataSouceActionContext,xworker.lang.actions.Inout/@contexts/@context
                        sid
                        dataSource
                  @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@DbDataObject/@name
                  sname
                  name
                  slabel
                  名称
                  sfieldName
                  name
                  stype
                  string
                  soptional
                  true
                  skey
                  false
                  sdataField
                  true
                  sviewField
                  true
                  sreadField
                  true
                  screateEditor
                  true
                  seditEditor
                  true
                  sviewEditor
                  true
                  sgridEditor
                  true
                  squeryEditor
                  true
                  sreadOnly
                  false
                  sdisabled
                  false
                  sshowLabel
                  true
                  slabelAlign
                  right
                  slabelVAlign
                  baseline
                  svalidateAllowBlank
                  true
                  LvalidateOnBlur
                  true
                  LallowDecimals
                  true
                  LallowNegative
                  true
                  sshowInTable
                  true
                  sgridWidth
                  200
                  seditable
                  true
                  sdisplayRelationLabel
                  false
                  sgridFixed
                  false
                  sgridHidden
                  false
                  sgridHideable
                  true
                  sgridSortable
                  false
                  scolumnLocked
                  false
                  sgridGroupable
                  true
                  sgridMenuDisabled
                  false
                  sgridResizable
                  true
                  sen_label
                  Name
                  sdescriptors
                  xworker.dataObject.db.DbDataObject/@attribute
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_registDisabled
                  false
                  sth_mark
                  false
                  sid
                  name
                  @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@store/@dataObjects/@DbDataObject/@path
                  sname
                  path
                  slabel
                  路径
                  sfieldName
                  path
                  stype
                  string
                  soptional
                  true
                  skey
                  false
                  sdataField
                  true
                  sviewField
                  true
                  sreadField
                  true
                  screateEditor
                  true
                  seditEditor
                  true
                  sviewEditor
                  true
                  sgridEditor
                  true
                  squeryEditor
                  true
                  sreadOnly
                  false
                  sdisabled
                  false
                  sshowLabel
                  true
                  slabelAlign
                  right
                  slabelVAlign
                  baseline
                  svalidateAllowBlank
                  true
                  LvalidateOnBlur
                  true
                  LallowDecimals
                  true
                  LallowNegative
                  true
                  sshowInTable
                  true
                  sgridWidth
                  400
                  seditable
                  true
                  sdisplayRelationLabel
                  false
                  sgridFixed
                  false
                  sgridHidden
                  false
                  sgridHideable
                  true
                  sgridSortable
                  false
                  scolumnLocked
                  false
                  sgridGroupable
                  true
                  sgridMenuDisabled
                  false
                  sgridResizable
                  true
                  sen_label
                  Path
                  sdescriptors
                  xworker.dataObject.db.DbDataObject/@attribute
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_registDisabled
                  false
                  sth_mark
                  false
                  sid
                  path
            @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@listeners
            sname
            listeners
            slabel
            listeners
            sdescriptors
            xworker.swt.events.Listeners/@listeners
            sid
            listeners
              @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@listeners/@dataTableSelection
              sname
              dataTableSelection
              stype
              Selection
              slabel
              dataTableSelection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sid
              dataTableSelection
                @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@listeners/@dataTableSelection/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Global
                sdisableGlobalContext
                false
                Scode
#$@text#$@
import java.net.URLEncoder;
import xworker.swt.listeners.SwtMenuListener;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import xworker.swt.listeners.SwtMenuListener;
import xworker.swt.util.SwtUtils;
import xworker.swt.events.SwtListener;
import org.xmeta.util.UtilString;
import org.xmeta.Thing;
import xworker.swt.form.ThingDescriptorForm;

//事物数据
def tableItem = dataTable.getSelection()[0];
def data = tableItem.getData();

//显示文档等
descriptionLabel.setText(data.get("path"));
openUrl(browser, "do?sc=xworker.ide.worldexplorer.swt.http.ThingDoc/@desc&thing=" + URLEncoder.encode(data.path, "UTF-8"), false);
openButton.setEnabled(true);

//显示菜单
for(item in toolBar.getItems()){
    item.dispose();
}
def thing = world.getThing(data.get("path"));
if(thing == null){
    return;
}
actionContext.g().put("currentThing", thing);
actionContext.g().put("thing", thing);
if(coolBar != null && !coolBar.isDisposed()){
    //初始化菜单
    def menus = [];
    SwtMenuListener swtMenu = SwtMenuListener.getInstance();
    String[] paths = thing.getDescriptors()[0].metadata.getPaths();
    //过滤掉MetaThing
    menus = swtMenu.getMenu(thing, paths, "data");
    menus = fileterMenus(menus);

    def toolItemListenerObject = world.getThing("xworker.swt.ide.worldexplorer.swt.dataExplorerParts.ThingEditor/@tempShell/@listenersPrepared/@toolBarItemSelection");
    def disposeListenerObject = world.getThing("xworker.swt.ide.worldexplorer.swt.dataExplorerParts.ThingEditor/@tempShell/@listenersPrepared/@dispose");
    def menuListenerObject = world.getThing("xworker.ide.db.dbindex.app.swt.ThingQueryerByKeyword/@shell/@ListenersPrepared/@menuListener");
    
    for(menu in menus){
        ToolItem item = new ToolItem(toolBar, SWT.PUSH);
        item.setText(menu.metadata.label);
        item.addListener(SWT.Selection, new SwtListener(toolItemListenerObject, actionContext));
        item.addListener(SWT.Dispose, new SwtListener(disposeListenerObject, actionContext));
        
        String attachUrl = "&thingName=" + thing.metadata.path + "&descriptors=";
        //创建菜单
        Menu amenu = new Menu(toolBar.getShell(), SWT.POP_UP);
        //item.setMenu(amenu);
        for(child in menu.getChilds()){
            initMenuItem(amenu, child, attachUrl, menuListenerObject, actionContext);
        }    
        item.setData("menu", amenu);
    }    
}

//过滤菜单
def fileterMenus(menus){
    def newMenus = [];
    for(menu in menus){
        def newMenu = fileterMenu(menu);
        if(newMenu != null){
            newMenus.add(newMenu);
        }
    }    
    
    return newMenus;
}

def fileterMenu(menu){
    def newMenu = new Thing();
    for(item in menu.getChilds()){
        if(item.getMetadata().getPath().startsWith("xworker.ide.config.ProjectMenuSwt")){
            continue;
        }else{
            //一定不要改变parent
            newMenu.addChild(item, false);
        }        
    }
    
    if(newMenu.getChilds().size() > 0){
        newMenu.put("label", menu.getMetadata().getLabel());
        return newMenu;
    }else{
        return null;
    }
}

//是否显示菜单工具栏
//if(structureThing.get)
def initMenuItem(parent, menuData, attachUrl, menuListenerObject, swtActionContext){
    int style = SWT.PUSH;
    if(menuData.childs.size() > 0){
        style = SWT.CASCADE;
    }else if(menuData.getBoolean("isSplit")){
        style = SWT.SEPARATOR;
    }
        
    MenuItem mitem = new MenuItem(parent, style);
    mitem.setData("menu", menuData);
    if(menuData.accelerator != null && menuData.accelerator != ""){
        mitem.setText(menuData.metadata.label + "\t" + menuData.accelerator);        
        mitem.setAccelerator(SwtUtil.getAccelerator(menuData.accelerator));
    }else{
        mitem.setText(menuData.metadata.label);
    }
    mitem.addListener(SWT.Selection, new SwtListener(menuListenerObject, swtActionContext));
    
    String url = menuData.getString("url");
    if(url != null && url != ""){
        //if(menuData.getBoolean("attachParam")){
        //    mitem.setData("url", menuData.getString("url") + attachUrl);
        //}else{
        mitem.setData("url", menuData.getString("url"));
        //}
    }else{
        def menuActions = menuData.get("actions@0");
        if(menuActions != null && menuActions.childs.size() > 0){
            mitem.setData("url", menuActions.childs[0].metadata.path);
        }
    }
    
    def childMenus = menuData.get("Menu@");
    if(childMenus.size() > 0){
        Menu subMenu = new Menu(mitem); 
        mitem.setMenu(subMenu);   
        for(child in childMenus){                     
            initMenuItem(subMenu, child, attachUrl, menuListenerObject, swtActionContext);        
        }
    }
}

def openUrl(browser, url, isOuterUrl){
    //log.info(url);
    if(isOuterUrl){
        browser.setUrl(url);
    }else{
        def globalCfg = world.getThing("_local.xworker.config.GlobalConfig");
        browser.setUrl(globalCfg.webUrl + url);
    }
}
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdebugLog
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sid
                GroovyAction
              @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@listeners/@dataTableDefaultSelection
              sname
              dataTableDefaultSelection
              stype
              DefaultSelection
              slabel
              dataTableDefaultSelection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sid
              dataTableDefaultSelection
                @/@shell/@mainComposite/@sashForm/@searchComposite/@dataTable/@listeners/@dataTableDefaultSelection/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Global
                sdisableGlobalContext
                false
                Scode
#$@text#$@
import xworker.swt.design.Designer;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;

def explorerActions = Designer.getExplorerActions();
if(explorerActions != null){
    def thing = world.getThing(dataTable.getSelection()[0].getData().path);
    if(thing != null){
        explorerActions.doAction("openThing", ["thing": thing]);
    }else{
        def box = new MessageBox(dataTable.getShell(), actionContext);
        box.setText("打开事物");
        box.setMessage("事物不存在，可能已删除！");
        box.open();    
    }
}else{
    def box = new MessageBox(dataTable.getShell(), actionContext);
    box.setText("打开事物");
    box.setMessage("只能在有事物管理器的环境下打开事物！");
    box.open();
}
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdebugLog
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sid
                GroovyAction
          @/@shell/@mainComposite/@sashForm/@searchComposite/@pageToolbar
          sname
          pageToolbar
          sbeforePageText
          第
          safterPageText
          页 共{0}页
          sdisplayInfo
          true
          sdisplayMsg
          第{0}-第{1}条，共{2}条
          semptyMsg
          没有数据
          sfirstText
          首页
          slastText
          最后一页
          sstore
          store
          sdescriptors
          xworker.swt.app.view.swt.Items/@PagingToolbar
          sid
          pageToolbar
            @/@shell/@mainComposite/@sashForm/@searchComposite/@pageToolbar/@pageToolbarGridData
            sname
            pageToolbarGridData
            sstyle
            FILL_HORIZONTAL
            shorizontalIndent
            0
            swidth
            -1
            sheight
            -1
            shorizontalAlignment
            BEGINNING
            sverticalAlignment
            CENTER
            shorizontalSpan
            2
            sverticalSpan
            1
            sgrabExcessHorizontalSpace
            false
            sgrabExcessVerticalSpace
            false
            slabel
            pageToolbarGridData
            sdescriptors
            xworker.swt.Commons/@GridData
            sid
            pageToolbarGridData
        @/@shell/@mainComposite/@sashForm/@docComposite
        sname
        docComposite
        sBORDER
        false
        sH_SCROLL
        false
        sV_SCROLL
        false
        sNO_BACKGROUND
        false
        sNO_FOCUS
        false
        sNO_MERGE_PAINTS
        false
        sNO_REDRAW_RESIZE
        false
        sNO_RADIO_GROUP
        false
        sEMBEDDED
        false
        sDOUBLE_BUFFERED
        false
        scapture
        false
        senabled
        true
        sredraw
        true
        svisible
        true
        sdescriptors
        xworker.swt.Widgets/@Composite
        sid
        docComposite
          @/@shell/@mainComposite/@sashForm/@docComposite/@docCompositeGridLayout
          sname
          docCompositeGridLayout
          snumColumns
          1
          smakeColumnsEqualWidth
          false
          smarginWidth
          5
          smarginHeight
          5
          smarginLeft
          0
          smarginTop
          0
          smarginRight
          0
          smarginBottom
          0
          shorizontalSpacing
          5
          sverticalSpacing
          5
          slabel
          docCompositeGridLayout
          sdescriptors
          xworker.swt.Layouts/@GridLayout
          sid
          docCompositeGridLayout
          @/@shell/@mainComposite/@sashForm/@docComposite/@pathLabel
          sname
          pathLabel
          sBORDER
          false
          stype
          HORIZONTAL
          sshadow
          SHADOW_OUT
          salignment
          LEFT
          stext
          路径：
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.Widgets/@Label
          sth_createIndex
          false
          sth_mark
          false
          sid
          pathLabel
          @/@shell/@mainComposite/@sashForm/@docComposite/@descriptionLabel1
          sname
          descriptionLabel
          sstyle
          SINGLE
          sH_SCROLL
          false
          sV_SCROLL
          false
          sWRAP
          false
          sREAD_ONLY
          true
          sPASSWORD
          false
          sSEARCH
          false
          sCANCEL
          false
          sBORDER
          true
          salign
          LEFT
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.Widgets/@Text
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          descriptionLabel1
            @/@shell/@mainComposite/@sashForm/@docComposite/@descriptionLabel1/@descriptionLabelGridData
            sname
            descriptionLabelGridData
            sstyle
            FILL_HORIZONTAL
            shorizontalIndent
            0
            swidth
            -1
            sheight
            -1
            shorizontalAlignment
            BEGINNING
            sverticalAlignment
            CENTER
            shorizontalSpan
            1
            sverticalSpan
            1
            sgrabExcessHorizontalSpace
            false
            sgrabExcessVerticalSpace
            false
            slabel
            descriptionLabelGridData
            sdescriptors
            xworker.swt.layout.LayoutDatas/@GridData
            sid
            descriptionLabelGridData
          @/@shell/@mainComposite/@sashForm/@docComposite/@coolBar
          sname
          coolBar
          stype
          HORIZONTAL
          sBORDER
          false
          sFLAT
          true
          sH_SCROLL
          false
          sV_SCROLL
          false
          sNO_BACKGROUND
          false
          sNO_FOCUS
          false
          sNO_MERGE_PAINTS
          false
          sNO_REDRAW_RESIZE
          false
          sNO_RADIO_GROUP
          false
          sEMBEDDED
          false
          sDOUBLE_BUFFERED
          false
          slabel
          coolBar
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.Widgets/@CoolBar
          sth_createIndex
          false
          sth_mark
          true
          sth_font
          "|10|1|#000000"
          sth_nodeColor
          DARK_RED
          sid
          coolBar
            @/@shell/@mainComposite/@sashForm/@docComposite/@coolBar/@menuCoolItem
            sname
            menuCoolItem
            sDROP_DOWN
            false
            slabel
            menuCoolItem
            sdescriptors
            xworker.swt.widgets.CoolBar/@CoolItem
            sid
            menuCoolItem
              @/@shell/@mainComposite/@sashForm/@docComposite/@coolBar/@menuCoolItem/@toolBar
              sname
              toolBar
              stype
              HORIZONTAL
              sFLAT
              true
              sWRAP
              false
              sBORDER
              false
              sSHADOW_OUT
              false
              sRIGHT
              false
              slabel
              toolBar
              sdescriptors
              xworker.swt.widgets.CoolBar/@CoolItem/@ToolBar
              sid
              toolBar
                @/@shell/@mainComposite/@sashForm/@docComposite/@coolBar/@menuCoolItem/@toolBar/@test
                sname
                test
                stype
                PUSH
                stext
                " "
                senabled
                true
                slabel
                test
                sdescriptors
                xworker.swt.widgets.ToolBar/@ToolItem
                sid
                test
            @/@shell/@mainComposite/@sashForm/@docComposite/@coolBar/@coolBarGridData
            sname
            coolBarGridData
            sstyle
            FILL_HORIZONTAL
            shorizontalIndent
            0
            swidth
            -1
            sheight
            -1
            shorizontalAlignment
            BEGINNING
            sverticalAlignment
            CENTER
            shorizontalSpan
            1
            sverticalSpan
            1
            sgrabExcessHorizontalSpace
            false
            sgrabExcessVerticalSpace
            false
            sdescriptors
            xworker.swt.layout.LayoutDatas/@GridData
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_registDisabled
            false
            sth_mark
            false
            sid
            coolBarGridData
          @/@shell/@mainComposite/@sashForm/@docComposite/@browser
          sname
          browser
          slabel
          browser
          sdescriptors
          xworker.swt.Widgets/@Browser
          sid
          browser
            @/@shell/@mainComposite/@sashForm/@docComposite/@browser/@browserGridData
            sname
            browserGridData
            sstyle
            FILL_BOTH
            shorizontalIndent
            0
            swidth
            -1
            sheight
            150
            shorizontalAlignment
            BEGINNING
            sverticalAlignment
            CENTER
            shorizontalSpan
            2
            sverticalSpan
            1
            sgrabExcessHorizontalSpace
            false
            sgrabExcessVerticalSpace
            false
            slabel
            browserGridData
            sdescriptors
            xworker.swt.layout.LayoutDatas/@GridData
            sid
            browserGridData
        @/@shell/@mainComposite/@sashForm/@sashFormGridData
        sname
        sashFormGridData
        sstyle
        FILL_BOTH
        shorizontalIndent
        0
        swidth
        -1
        sheight
        -1
        shorizontalAlignment
        BEGINNING
        sverticalAlignment
        CENTER
        shorizontalSpan
        1
        sverticalSpan
        1
        sgrabExcessHorizontalSpace
        false
        sgrabExcessVerticalSpace
        false
        sdescriptors
        xworker.swt.layout.LayoutDatas/@GridData
        sth_createIndex
        false
        sth_mark
        false
        sid
        sashFormGridData
      @/@shell/@mainComposite/@5277
      sname
      buttonComposite
      sBORDER
      false
      sH_SCROLL
      false
      sV_SCROLL
      false
      sNO_BACKGROUND
      false
      sNO_FOCUS
      false
      sNO_MERGE_PAINTS
      false
      sNO_REDRAW_RESIZE
      false
      sNO_RADIO_GROUP
      false
      sEMBEDDED
      false
      sDOUBLE_BUFFERED
      false
      scapture
      false
      senabled
      true
      sredraw
      true
      svisible
      true
      sdescriptors
      xworker.swt.Widgets/@Composite
      sid
      5277
        @/@shell/@mainComposite/@5277/@5278
        sname
        buttonCompositeGridData
        sstyle
        FILL_HORIZONTAL
        shorizontalIndent
        0
        swidth
        -1
        sheight
        -1
        shorizontalAlignment
        END
        sverticalAlignment
        CENTER
        shorizontalSpan
        1
        sverticalSpan
        1
        sgrabExcessHorizontalSpace
        false
        sgrabExcessVerticalSpace
        false
        sdescriptors
        xworker.swt.layout.LayoutDatas/@GridData
        sid
        5278
        @/@shell/@mainComposite/@5277/@5279
        sname
        buttonCompositeRowLayout
        sfill
        false
        sjustify
        false
        smarginWidth
        0
        smarginHeight
        0
        smarginLeft
        3
        smarginTop
        3
        smarginRight
        3
        smarginBottom
        3
        spack
        true
        sspacing
        3
        stype
        SWT.HORIZONTAL
        swrap
        true
        sdescriptors
        xworker.swt.Layouts/@RowLayout
        sid
        5279
        @/@shell/@mainComposite/@5277/@5280
        sname
        openButton
        stext
        label:xworker.ide.worldexplorer.swt.i18n.TopicI18n/@buttons/@openThing
        stype
        SWT.PUSH
        sflat
        false
        sborder
        false
        sselected
        false
        scapture
        false
        senabled
        false
        sredraw
        true
        svisible
        true
        sdescriptors
        xworker.swt.Widgets/@Button
        sth_createIndex
        false
        sid
        5280
          @/@shell/@mainComposite/@5277/@5280/@5281
          sname
          RowData
          sexclude
          false
          swidth
          80
          sheight
          -1
          sdescriptors
          xworker.swt.layout.LayoutDatas/@RowData
          sth_createIndex
          false
          sid
          5281
          @/@shell/@mainComposite/@5277/@5280/@5282
          sname
          Listeners
          sdescriptors
          xworker.swt.widgets.Widget/@Listeners
          sth_createIndex
          false
          sid
          5282
            @/@shell/@mainComposite/@5277/@5280/@5282/@5283
            sname
            openButtonSelection
            stype
            Selection
            sref
            dataTableDefaultSelection
            sdescriptors
            xworker.swt.events.Listeners/@listeners/@Listener
            sth_createIndex
            false
            sid
            5283
      @/@shell/@mainComposite/@init
      sname
      init
      sisSynchronized
      false
      sthrowException
      true
      suseOtherAction
      false
      svarScope
      Global
      sdisableGlobalContext
      false
      Scode
#$@text#$@
if(actionContext.get("utilBrowser") != null){
    utilBrowser.attach(browser);
}else if(actionContext.get("explorerContext") != null){
    explorerContext.utilBrowser.attach(browser);
}
#$@text#$@
      sdescriptors
      xworker.swt.Widgets/@Code
      sid
      init
