|
(Initial Page Creation)
|
(Posted in AHPSCRIPTS-109)
|
| Line 1: | |||
| This page lists remoting scripts that are meant to be used in conjunction with the [http://docs.urbancode.com/anthill3-help-3.8/html/DevKit.html anthill3 dev-kit]. These scripts were taken straight from the [https://bugs.urbancode.com/secure/IssueNavigator.jspa?reset=true&&pid=10110&sorter/field=issuekey&sorter/order=ASC public JIRA site]. Please note that some scripts may be ''snippets'' and '''probably WILL need''' modification to work properly for your situation. Treat these as templates that you can modify from. | This page lists remoting scripts that are meant to be used in conjunction with the [http://docs.urbancode.com/anthill3-help-3.8/html/DevKit.html anthill3 dev-kit]. These scripts were taken straight from the [https://bugs.urbancode.com/secure/IssueNavigator.jspa?reset=true&&pid=10110&sorter/field=issuekey&sorter/order=ASC public JIRA site]. Please note that some scripts may be ''snippets'' and '''probably WILL need''' modification to work properly for your situation. Treat these as templates that you can modify from. | ||
| + | = List Contents of a Build Life's Artifacts = | ||
| + | Script Notes: | ||
| + | * Treat this mostly as a snippet for doing something more interesting with. | ||
| + | * This script requires the following packaging changes to the remoting library: | ||
| + | :# Change 1 | ||
| + | :# Change 2 | ||
| + | ==== AHPSCRIPTS-109 ==== | ||
| + | <pre>import com.urbancode.anthill3.main.client.AnthillClient; | ||
| + | import com.urbancode.anthill3.persistence.UnitOfWork; | ||
| + | import com.urbancode.anthill3.domain.buildlife.*; | ||
| + | import com.urbancode.codestation2.server.*; | ||
| + | String serverHost = "localhost"; | ||
| + | int serverPort = 4567; | ||
| + | String userName = "admin"; | ||
| + | String password = "admin"; | ||
| + | // obtain connection to the Anthill server | ||
| + | AnthillClient anthill = AnthillClient.connect(serverHost, serverPort, userName, password); | ||
| + | // create a Unit of Work | ||
| + | UnitOfWork uow = anthill.createUnitOfWork(); | ||
| + | BuildLife buildLife = BuildLifeFactory.getInstance().restore(2111L); | ||
| + | CodestationRepositoryFileHelper cs = CodestationRepositoryFileHelper.getInstance(); | ||
| + | sets = cs.getPopulatedBuildLifeArtifactSetList(buildLife); | ||
| + | for (int s=0; s<sets.length; s++) { | ||
| + | print(""); | ||
| + | print("Contents of '" + sets[s].getName() + "'"); | ||
| + | artifacts = cs.listBuildLifeArtifactSetFiles(buildLife, sets[s]); | ||
| + | |||
| + | for (int a=0; a<artifacts.length; a++) { | ||
| + | print(" " + artifacts[a]); | ||
| + | } | ||
| + | } | ||
| + | uow.close();</pre> | ||