This repository has been archived by the owner on Mar 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/resources/org/cristalise/dsl/scaffold/item_queryList_groovy.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import org.cristalise.kernel.entity.proxy.AgentProxy | ||
import org.cristalise.kernel.lookup.DomainPath | ||
import org.cristalise.kernel.process.Gateway | ||
import org.cristalise.kernel.property.Property | ||
|
||
//-------------------------------------------------- | ||
// item, agent and job are injected by the Script class | ||
// automatically so these declaration are only needed | ||
// to write the script with code completion. | ||
// COMMENT OUT before you run the module generators | ||
//-------------------------------------------------- | ||
// ItemProxy item | ||
// AgentProxy agent | ||
// Job job | ||
//-------------------------------------------------- | ||
|
||
def properties = [new Property('Type', '@{item}'), new Property('State', 'ACTIVE')] | ||
|
||
def result = Gateway.getLookup().search(new DomainPath(), properties, 0, 100) | ||
def @{item}Map = []; | ||
|
||
for (DomainPath dp: result.rows) { | ||
map.put(dp.name, dp.itemPath.UUID) | ||
} | ||
|
||
return @{item}Map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import org.cristalise.kernel.entity.proxy.AgentProxy | ||
import org.cristalise.kernel.lookup.DomainPath | ||
import org.cristalise.kernel.process.Gateway | ||
import org.cristalise.kernel.property.Property | ||
|
||
//-------------------------------------------------- | ||
// item, agent and job are injected by the Script class | ||
// automatically so these declaration are only needed | ||
// to write the script with code completion. | ||
// COMMENT OUT before you run the module generators | ||
//-------------------------------------------------- | ||
// ItemProxy item | ||
// AgentProxy agent | ||
// Job job | ||
//-------------------------------------------------- | ||
|
||
def properties = [new Property('Type', 'TestItem'), new Property('State', 'ACTIVE')] | ||
|
||
def result = Gateway.getLookup().search(new DomainPath(), properties, 0, 100) | ||
def TestItemMap = []; | ||
|
||
for (DomainPath dp: result.rows) { | ||
map.put(dp.name, dp.itemPath.UUID) | ||
} | ||
|
||
return TestItemMap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<cristalscript> | ||
<param name='item' type='org.cristalise.kernel.entity.proxy.ItemProxy' /> | ||
<output name='TestItemMap' type='java.util.Map' /> | ||
<script language='groovy' name='TestItem_QueryList'><![CDATA[ import org.cristalise.kernel.entity.proxy.AgentProxy | ||
import org.cristalise.kernel.lookup.DomainPath | ||
import org.cristalise.kernel.process.Gateway | ||
import org.cristalise.kernel.property.Property | ||
//-------------------------------------------------- | ||
// item, agent and job are injected by the Script class | ||
// automatically so these declaration are only needed | ||
// to write the script with code completion. | ||
// COMMENT OUT before you run the module generators | ||
//-------------------------------------------------- | ||
// ItemProxy item | ||
// AgentProxy agent | ||
// Job job | ||
//-------------------------------------------------- | ||
def properties = [new Property('Type', 'TestItem'), new Property('State', 'ACTIVE')] | ||
def result = Gateway.getLookup().search(new DomainPath(), properties, 0, 100) | ||
def TestItemMap = []; | ||
for (DomainPath dp: result.rows) { | ||
map.put(dp.name, dp.itemPath.UUID) | ||
} | ||
return TestItemMap | ||
]]></script> | ||
</cristalscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters