Skip to content

Commit d20c9e0

Browse files
authored
Merge pull request #1520 from Esri/prev8048-deployed-as-solution
Re-templatize a Deployed Solution
2 parents d3142be + e42423b commit d20c9e0

File tree

19 files changed

+3599
-33
lines changed

19 files changed

+3599
-33
lines changed

build.bat

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ pushd demos\createSolution
2424
call npm install
2525
popd
2626

27+
pushd demos\recreateSolution
28+
call npm install
29+
popd
30+
31+
2732
pushd demos\deleteSolution
2833
call npm install
2934
popd
@@ -133,6 +138,10 @@ pushd demos\createSolution
133138
call npm run build
134139
popd
135140

141+
pushd demos\recreateSolution
142+
call npm run build
143+
popd
144+
136145
pushd demos\deleteSolution
137146
call npm run build
138147
popd

build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ cd demos/compareSolutions && npm install ; cd ../..
99
cd demos/copyItemInfo && npm install ; cd ../..
1010
cd demos/copySolutions && npm install ; cd ../..
1111
cd demos/createSolution && npm install ; cd ../..
12+
cd demos/recreateSolution && npm install ; cd ../..
1213
cd demos/deleteSolution && npm install ; cd ../..
1314
cd demos/deploySolution && npm install ; cd ../..
1415
cd demos/getItemInfo && npm install ; cd ../..
@@ -61,6 +62,7 @@ cd demos/compareSolutions && npm run build ; cd ../..
6162
cd demos/copyItemInfo && npm run build ; cd ../..
6263
cd demos/copySolutions && npm run build ; cd ../..
6364
cd demos/createSolution && npm run build ; cd ../..
65+
cd demos/recreateSolution && npm run build ; cd ../..
6466
cd demos/deleteSolution && npm run build ; cd ../..
6567
cd demos/deploySolution && npm run build ; cd ../..
6668
cd demos/getItemInfo && npm run build ; cd ../..

demos/createSolution/index.html

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!doctype html>
22
<html lang="en" dir="ltr">
3+
34
<head>
4-
<meta charset="utf-8"/>
5+
<meta charset="utf-8" />
56
<title>createSolution example</title>
67
<!--
78
| Copyright 2023 Esri
@@ -18,11 +19,13 @@
1819
| See the License for the specific language governing permissions and
1920
| limitations under the License.
2021
-->
21-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
22+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
23+
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
2224
<style>
2325
.indent {
2426
margin-left: 20px;
2527
}
28+
2629
#subgroupIdsDiv {
2730
display: none;
2831
}
@@ -31,6 +34,7 @@
3134
var goFcn;
3235
</script>
3336
</head>
37+
3438
<body>
3539
<h3>Create a Solution</h3>
3640
<p>Create a solution item from the contents of a group or from a single item and its dependencies.</p>
@@ -69,7 +73,7 @@ <h3>Create a Solution</h3>
6973
<input type="text" id="srcPortal" style="width:256px" placeholder="https://www.arcgis.com">
7074
</div>
7175

72-
<br/><br/>
76+
<br /><br />
7377

7478
<div class="section-title">Credentials in destination organization</div>
7579

@@ -86,8 +90,7 @@ <h3>Create a Solution</h3>
8690
<input type="text" id="destPortal" style="width:256px" placeholder="https://www.arcgis.com">
8791
</div>
8892

89-
<br/><br/>
90-
93+
<br /><br />
9194
<button class="btn btn-default" onclick="goFcn()">Create Solution</button>
9295
</div>
9396

@@ -97,7 +100,7 @@ <h3>Create a Solution</h3>
97100

98101
<script>
99102

100-
function changeSubgroupIdsVisibility(
103+
function changeSubgroupIdsVisibility (
101104
changeEvent
102105
) {
103106
document.getElementById("subgroupIdsDiv").style.display =
@@ -106,4 +109,5 @@ <h3>Create a Solution</h3>
106109

107110
</script>
108111
</body>
109-
</html>
112+
113+
</html>

demos/createSolution/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ function go () {
7373
document.getElementById("output").innerHTML = "Creating..." + percentDone.toFixed().toString() + "%";
7474
},
7575
subgroupIds
76-
).then(function (html){
77-
reportElapsedTime(startTime);
78-
document.getElementById("output").innerHTML = html;
79-
},
76+
).then(function(html) {
77+
reportElapsedTime(startTime);
78+
document.getElementById("output").innerHTML = html;
79+
},
8080
error => {
8181
var message = error?.error || JSON.stringify(error) || "Unspecified error";
8282
if (error.itemIds) {

demos/index.html

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,26 @@
55
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
66
<title>ArcGIS solutions.js Demos</title>
77
</head>
8+
89
<body>
9-
<h3>ArcGIS solutions.js Demos</h3>
10-
<ol>
11-
<li><a href="compareJSON/dist/" target="_blank">Compare two blocks of JSON, with the option to generate the second block as a sanitized version of the first block</a></li>
12-
<li><a href="compareSolutions/dist/" target="_blank">Compare two solution items (files are only compared by name)</a></li>
13-
<li><a href="copyItemInfo/dist/" target="_blank">Creates a copy of an item</li>
14-
<li><a href="copySolutions/dist/" target="_blank">Copy one or more solutions between organizations</a></li>
15-
<li><a href="createSolution/dist/" target="_blank">Create a Solution</a></li>
16-
<li><a href="deleteSolution/dist/" target="_blank">Delete a Solution</a></li>
17-
<li><a href="deploySolution/dist/" target="_blank">Deploy a Solution</a></li>
18-
<li><a href="getItemInfo/dist/" target="_blank">Get information about an item</a></li>
19-
<li><a href="implementedTypes/dist/" target="_blank">List the AGO types that are implemented or being worked on</a></li>
20-
<li><a href="reuseDeployedItems/dist/" target="_blank">Find reusable items and their solutions</a></li>
21-
<li><a href="verifySolution/dist/" target="_blank">Verify a solution</a></li>
22-
</ol>
10+
<h3>ArcGIS solutions.js Demos</h3>
11+
<ol>
12+
<li><a href="compareJSON/dist/" target="_blank">Compare two blocks of JSON, with the option to generate the second
13+
block as a sanitized version of the first block</a></li>
14+
<li><a href="compareSolutions/dist/" target="_blank">Compare two solution items (files are only compared by
15+
name)</a></li>
16+
<li><a href="copyItemInfo/dist/" target="_blank">Creates a copy of an item</li>
17+
<li><a href="copySolutions/dist/" target="_blank">Copy one or more solutions between organizations</a></li>
18+
<li><a href="createSolution/dist/" target="_blank">Create a Solution</a></li>
19+
<li><a href="deleteSolution/dist/" target="_blank">Delete a Solution</a></li>
20+
<li><a href="deploySolution/dist/" target="_blank">Deploy a Solution</a></li>
21+
<li><a href="getItemInfo/dist/" target="_blank">Get information about an item</a></li>
22+
<li><a href="implementedTypes/dist/" target="_blank">List the AGO types that are implemented or being worked on</a>
23+
</li>
24+
<li><a href="recreateSolution/dist/" target="_blank">Create a Solution from a deployed solution</a></li>
25+
<li><a href="reuseDeployedItems/dist/" target="_blank">Find reusable items and their solutions</a></li>
26+
<li><a href="verifySolution/dist/" target="_blank">Verify a solution</a></li>
27+
</ol>
2328
</body>
24-
</html>
29+
30+
</html>

demos/recreateSolution/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## createSolution
2+
3+
This demo re-creates a ArcGIS Solution using an existing deployed Soution.
4+
5+
### Building
6+
7+
```
8+
npm run build
9+
```
10+
11+
to build the application into the `dist/` folder.
12+
13+
### License
14+
15+
Copyright &copy; 2023 Esri
16+
17+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
18+
19+
> http://www.apache.org/licenses/LICENSE-2.0
20+
21+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
22+
23+
A copy of the license is available in the repository's [LICENSE](https://github.com/Esri/solution.js/blob/master/LICENSE) file.

demos/recreateSolution/index.html

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<!doctype html>
2+
<html lang="en" dir="ltr">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<title>recreate Solution example</title>
7+
<!--
8+
| Copyright 2023 Esri
9+
|
10+
| Licensed under the Apache License, Version 2.0 (the "License");
11+
| you may not use this file except in compliance with the License.
12+
| You may obtain a copy of the License at
13+
|
14+
| http://www.apache.org/licenses/LICENSE-2.0
15+
|
16+
| Unless required by applicable law or agreed to in writing, software
17+
| distributed under the License is distributed on an "AS IS" BASIS,
18+
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
| See the License for the specific language governing permissions and
20+
| limitations under the License.
21+
-->
22+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
23+
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
24+
<style>
25+
.indent {
26+
margin-left: 20px;
27+
}
28+
29+
#subgroupIdsDiv {
30+
display: none;
31+
}
32+
</style>
33+
<script>
34+
var goFcn;
35+
</script>
36+
</head>
37+
38+
<body>
39+
<h3>Recreate a Solution</h3>
40+
<p>Create a solution item from a previously deployed solution.</p>
41+
42+
<div id="container" style="display:none">
43+
<div id="input">
44+
<label for="itemOrGroupId">Enter Item ID from a deployed solution:</label>
45+
<input class="form-control" type="text" id="itemOrGroupId">
46+
47+
<br /><br />
48+
49+
<div>
50+
<label for="includeSubgroups">Embed groups in solution?&nbsp;</label>
51+
<input type="checkbox" id="includeSubgroups" onchange="changeSubgroupIdsVisibility(this)">
52+
53+
<div id="subgroupIdsDiv" class="indent">
54+
<label for="subgroupIds">IDs of embedded groups separated by commas:</label>
55+
<input type="text" id="subgroupIds" style="width:485px">
56+
</div>
57+
</div>
58+
59+
<br /><br />
60+
61+
<div class="section-title">Credentials for organization</div>
62+
63+
<div class="labeledItem">
64+
<label for="srcUsername">Username:&nbsp;</label>
65+
<input type="text" id="srcUsername" placeholder="anonymous">
66+
</div>
67+
<div class="labeledItem">
68+
<label for="srcPassword">Password:&nbsp;</label>
69+
<input type="password" id="srcPassword">
70+
</div>
71+
<div class="labeledItem">
72+
<label for="srcPortal">Portal:&nbsp;</label>
73+
<input type="text" id="srcPortal" style="width:256px" placeholder="https://www.arcgis.com">
74+
</div>
75+
<br /><br />
76+
<button class="btn btn-default" onclick="goFcn()">Create Solution</button>
77+
</div>
78+
79+
<br />
80+
</div>
81+
<div id="output" style="display:none">Creating...</div>
82+
83+
<script>
84+
85+
function changeSubgroupIdsVisibility (
86+
changeEvent
87+
) {
88+
document.getElementById("subgroupIdsDiv").style.display =
89+
changeEvent.checked ? "block" : "none";
90+
}
91+
92+
</script>
93+
</body>
94+
95+
</html>

0 commit comments

Comments
 (0)