-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomExport
More file actions
811 lines (688 loc) · 26.5 KB
/
Copy pathCustomExport
File metadata and controls
811 lines (688 loc) · 26.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
import java.net.MalformedURLException;
import java.rmi.RemoteException;
import java.util.HashMap;
import javax.xml.rpc.ServiceException;
import org.apache.axis.client.Stub;
import com.cognos.developer.schemas.bibus._3.*;
public class CustomDeployment {
private static ContentManagerService_Port cmService = null;
private MonitorService_Port mService = null;
private static String strLocale = "en";
static HashMap<String, SearchPathSingleObject> packageInformation=null;
static String password = "password";
static String gateway = "http://localhost:9300/p2pd/servlet/dispatch";
static String nameSpace= "namespaceID";
static String userID = "username";
static String pass = "password";//this is the archive password
static private String archiveStr = "test";
class BaseClassWrapper {
private BaseClass myBaseClass = null;
//constructor
public BaseClassWrapper(BaseClass newBaseClass)
{
myBaseClass = newBaseClass;
}
public BaseClass getBaseClassObject ()
{
return myBaseClass;
}
public void setBaseClassObject(BaseClass newBaseClassObject)
{
myBaseClass = newBaseClassObject;
}
//Override toString()
public String toString()
{
if (myBaseClass != null)
{
return myBaseClass.getDefaultName().getValue();
}
return null;
}
public String getSearchPath()
{
if (myBaseClass != null)
{
return myBaseClass.getSearchPath().getValue();
}
return null;
}
}
public static void main(String[] args)
{
CustomDeployment testDeploy=new CustomDeployment();
testDeploy.connectToReportServer(gateway);
testDeploy.quickLogon(nameSpace, userID, password);
String[] folders=testDeploy.getAllFolders();
// folders[0]="/content/folder[@name='Samples']";
testDeploy.deployContent("export", archiveStr,null,folders);
}
///This method logs the user to Cognos 8
public String quickLogon(String namespace, String uid, String pwd)
{
StringBuffer credentialXML = new StringBuffer();
credentialXML.append("<credential>");
credentialXML.append("<namespace>").append(namespace).append("</namespace>");
credentialXML.append("<username>").append(uid).append("</username>");
credentialXML.append("<password>").append(pwd).append("</password>");
credentialXML.append("</credential>");
String encodedCredentials = credentialXML.toString();
XmlEncodedXML xmlCredentials = new XmlEncodedXML();
xmlCredentials.setValue(encodedCredentials);
//Invoke the ContentManager service logon() method passing the credential string
//You will pass an empty string in the second argument. Optionally,
//you could pass the Role as an argument
try
{
cmService.logon(xmlCredentials,null );
}
catch (Exception e)
{
System.out.println(e);
}
BiBusHeader CMbibus =
(BiBusHeader) ((Stub)cmService).getHeaderObject("", "biBusHeader");
if (CMbibus != null)
((Stub)mService).setHeader("", "biBusHeader", CMbibus);
return ("Logon successful as " + uid);
}
//This method connects to ReportNet
public void connectToReportServer (String endPoint)
{
ContentManagerService_ServiceLocator cmServiceLocator = new ContentManagerService_ServiceLocator();
MonitorService_ServiceLocator mServiceLocator = new MonitorService_ServiceLocator();
try
{
cmService = cmServiceLocator.getcontentManagerService(new java.net.URL(endPoint));
mService = mServiceLocator.getmonitorService(new java.net.URL(endPoint));
// set the Axis request timeout
((Stub) cmService).setTimeout(0); // in milliseconds, 0 turns the timeout off
((Stub)mService).setTimeout(0); // in milliseconds, 0 turns the timeout off
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
catch (ServiceException e)
{
e.printStackTrace();
}
}
public CustomDeployment()
{}
/**
* Deploying content
*
* @param myDeployType
* a Deployment specification
* @param strArchiveName
* an Archive name
* @param strDeployArchive
* a Deployment archive name
* @param selectedPubContent
* selected public folder contents which are associated with one
* specific archive
* @param connection
* Connection to IBM Cognos 8
* @return String indicate the operation successed,failed or cancel
*/
public String deployContent(String myDeployType, String strArchiveName, String strDeployArchive,
String[] selectedPubContent) {
AsynchReply asynchReply = null;
String reportEventID = "-1";
String deployPath;
SearchPathSingleObject searchPathObject = new SearchPathSingleObject();
// Add an archive name to the content store
BaseClass[] ArchiveInfo = addArchive(myDeployType, strArchiveName);
if ((ArchiveInfo != null) && (ArchiveInfo.length == 1)) {
deployPath = ArchiveInfo[0].getSearchPath().getValue();
searchPathObject.setValue(deployPath);
} else {
return reportEventID;
}
Option[] myDeploymentOptionsEnum=null;
if (myDeployType.equalsIgnoreCase("import")) {
myDeploymentOptionsEnum = setDeploymentOptionEnum(myDeployType, strDeployArchive, selectedPubContent);
}else{
myDeploymentOptionsEnum = setDeploymentOptionEnum(myDeployType, strArchiveName, selectedPubContent);
}
OptionArrayProp deploymentOptionsArray = new OptionArrayProp();
deploymentOptionsArray.setValue(myDeploymentOptionsEnum);
if (myDeployType.equalsIgnoreCase("import")) {
((ImportDeployment) ArchiveInfo[0])
.setOptions(deploymentOptionsArray);
} else {
((ExportDeployment) ArchiveInfo[0])
.setOptions(deploymentOptionsArray);
}
try {
cmService.update(ArchiveInfo, new UpdateOptions());
asynchReply =mService.run(searchPathObject,
new ParameterValue[] {}, new Option[] {});
} catch (RemoteException remoteEx) {
System.out.println("An error occurred while deploying content:"
+ "\n" + remoteEx.getMessage());
}
if (asynchReply != null) {
reportEventID = "Success";
} else {
reportEventID = "Failed";
}
return reportEventID;
}
public String[] getAllFolders() {
BaseClassWrapper[] listOfFolders = null;
String[] allFolders = null;
int count = 0;
String packName=null;
String packSearchPath=null;
SearchPathSingleObject myPackSearchPath=null;
String[] mySearchPath = new String[2];
mySearchPath[0] = "/content/package";
mySearchPath[1] = "/content/folder[@name='Samples']/folder[@name='Sample Template']|/content/folder[@name='Samples']/folder[@name='Models']/folder[@name='Interactive Samples']";
// get available packages
BaseClass[] packageList = getCSObject( mySearchPath[0]);
// get available folders
BaseClass[] folderList = getCSObject( mySearchPath[1]);
packageInformation=new HashMap<String, SearchPathSingleObject>(packageList.length+folderList.length);
for(int i=0;i<packageList.length;i++)
{
packName=packageList[i].getDefaultName().getValue();
packSearchPath=packageList[i].getSearchPath().getValue();
myPackSearchPath=new SearchPathSingleObject(packSearchPath);
packageInformation.put(packName, myPackSearchPath);
System.out.println(packName);
System.out.println(myPackSearchPath.getValue());
System.out.println("-------------------------");
}
for(int j=0;j<folderList.length;j++)
{
packName=folderList[j].getDefaultName().getValue();
packSearchPath=folderList[j].getSearchPath().getValue();
myPackSearchPath=new SearchPathSingleObject(packSearchPath);
packageInformation.put(packName, myPackSearchPath);
//System.out.println(packName);
//System.out.println(myPackSearchPath.getValue());
//System.out.println("-------------------------");
}
listOfFolders = new BaseClassWrapper[packageList.length
+ folderList.length];
allFolders = new String[packageList.length + folderList.length];
if (packageList != null && packageList.length > 0) {
for (int j = 0; j < packageList.length; j++) {
listOfFolders[count] = new BaseClassWrapper(packageList[j]);
allFolders[count] = listOfFolders[count].toString();
count++;
}
}
if (folderList != null && folderList.length > 0) {
for (int i = 0; i < folderList.length; i++) {
listOfFolders[count] = new BaseClassWrapper(folderList[i]);
allFolders[count] = listOfFolders[count].toString();
count++;
}
}
return allFolders;
}
public static BaseClass[] getCSObject( String myPathStr) {
SearchPathMultipleObject cmSearchPath = new SearchPathMultipleObject(
myPathStr);
BaseClass[] myCMObject = null;
PropEnum props[] = new PropEnum[] { PropEnum.searchPath,
PropEnum.defaultName };
Sort sortOptions[] = { new Sort() };
sortOptions[0].setOrder(OrderEnum.ascending);
sortOptions[0].setPropName(PropEnum.defaultName);
try {
myCMObject = cmService.query(cmSearchPath, props,
sortOptions, new QueryOptions());
} catch (RemoteException remoteEx) {
System.out
.println("An error occurred while querying CM object:"
+ "\n" + remoteEx.getMessage());
}
return myCMObject;
}
/**
* use this method to add a Deployment object to the content store
*/
private BaseClass[] addArchive(String deploySpec, String nameOfArchive
) {
ImportDeployment importDeploy = null;
ExportDeployment exportDeploy = null;
BaseClass[] addedDeploymentObjects = null;
BaseClass[] bca = new BaseClass[1];
AddOptions addOpts = null;
SearchPathSingleObject objOfSearchPath = new SearchPathSingleObject();
objOfSearchPath.setValue("/adminFolder");
MultilingualTokenProp multilingualTokenProperty = new MultilingualTokenProp();
MultilingualToken[] multilingualTokenArr = new MultilingualToken[1];
MultilingualToken myMultilingualToken = new MultilingualToken();
myMultilingualToken.setLocale(strLocale);
myMultilingualToken.setValue(nameOfArchive);
multilingualTokenArr[0] = myMultilingualToken;
multilingualTokenProperty.setValue(multilingualTokenArr);
if (deploySpec.equalsIgnoreCase("import")) {
importDeploy = new ImportDeployment();
addOpts = new AddOptions();
importDeploy.setName(multilingualTokenProperty);
addOpts.setUpdateAction(UpdateActionEnum.replace);
bca[0] = importDeploy;
} else {
exportDeploy = new ExportDeployment();
addOpts = new AddOptions();
exportDeploy.setName(multilingualTokenProperty);
addOpts.setUpdateAction(UpdateActionEnum.replace);
bca[0] = exportDeploy;
}
try {
addedDeploymentObjects = cmService.add(objOfSearchPath,
bca, addOpts);
} catch (RemoteException remoEx) {
System.out
.println("An error occurred when adding a deployment object:"
+ "\n" + remoEx.getMessage());
}
if ((addedDeploymentObjects != null)
&& (addedDeploymentObjects.length > 0)) {
return addedDeploymentObjects;
} else {
return null;
}
}
private Option[] setDeploymentOptionEnum(String deploymentType, String nameOfArchive,
String[] listOfSelectedFolders) {
Option[] deploymentOptions = null;
int num = 0;
int eOptionCount=0;
String[] deployOptionEnumBoolean = { "archiveOverwrite",
"dataSourceSelect", "namespaceSelect", "namespaceThirdParty",
"objectPolicies", "packageHistories", "packageOutputs",
"packageSchedules", "packageSelect", "recipientsSelect",
"takeOwnership" };
String[] deployOptionEnumResolution = { "dataSourceConflictResolution",
"namespaceConflictResolution",
"objectPoliciesConflictResolution",
"ownershipConflictResolution",
"packageHistoriesConflictResolution",
"packageOutputsConflictResolution",
"packageSchedulesConflictResolution",
"recipientsConflictResolution" };
if(deploymentType.equalsIgnoreCase("import"))
{
eOptionCount=2;
}
else
{
eOptionCount=3;
}
deploymentOptions = new DeploymentOption[eOptionCount
+ deployOptionEnumBoolean.length
+ deployOptionEnumResolution.length+1];
// Define the deployment options
if(deploymentType.equalsIgnoreCase("import"))
{
deploymentOptions[num] = this
.setImportDeploymentOptionPackageInfo(listOfSelectedFolders);
}
if (deploymentType.equalsIgnoreCase("export"))
{
deploymentOptions[num] = this
.setImportDeploymentOptionPackageInfo(listOfSelectedFolders);
deploymentOptions[++num] = this
.setExportDeploymentOptionPackageInfo(listOfSelectedFolders);
}
deploymentOptions[++num] = this
.setDeploymentOptionString(nameOfArchive);
// change default value into 'true'
deploymentOptions[++num] = this.setArchiveOverWrite(false);
// use default value
deploymentOptions[++num] = this.setDataSourceSelect(true);
// use default value
deploymentOptions[++num] = this.setNameSpaceSelect(true);
// change default value into 'false'
deploymentOptions[++num] = this.setNameSpaceThirdParty(false);
// use default value
deploymentOptions[++num] = this.setObjectPolicies(true);
// use default value
deploymentOptions[++num] = this.setPackageHistories(true);
// use default value
deploymentOptions[++num] = this.setPackageOutputs(true);
// use default value
deploymentOptions[++num] = this.setPackageSchedules(true);
// use default value
deploymentOptions[++num] = this.setPackageSelect(true);
// use default value
deploymentOptions[++num] = this.setRecipientsSelect(true);
// change default value into 'true'
deploymentOptions[++num] = this.setTakeOwnership(false);
// use default value
deploymentOptions[++num] = this.setDataSourceConflictResolution(true);
// use default value
deploymentOptions[++num] = this.setNamespaceConflictResolution(true);
// use default value
deploymentOptions[++num] = this
.setObjectPoliciesConflictResolution(true);
// use default value
deploymentOptions[++num] = this.setOwnershipConflictResolution(true);
// use default value
deploymentOptions[++num] = this
.setPackageHistoriesConflictResolution(true);
// use default value
deploymentOptions[++num] = this
.setPackageOutputsConflictResolution(true);
// use default value
deploymentOptions[++num] = this
.setPackageSchedulesConflictResolution(true);
// use default value
deploymentOptions[++num] = this.setRecipientsConflictResolution(true);
//set archivePassword
deploymentOptions[++num]= this.setArchivePassword(pass);
return deploymentOptions;
}
// set import deployment option property (mandatory)
private DeploymentOptionImportRuleArray setImportDeploymentOptionPackageInfo(String[] arrOfFolders) {
DeploymentImportRule[] pkgDeployInfoArr = new DeploymentImportRule[arrOfFolders.length];
DeploymentImportRule pkgDeployInfo;
MultilingualToken[] multilingualTokenArr;
MultilingualToken multilingualToken;
SearchPathSingleObject packSearchPath=null;
for (int i = 0; i < arrOfFolders.length; i++) {
multilingualToken = new MultilingualToken();
multilingualTokenArr = new MultilingualToken[1];
pkgDeployInfo = new DeploymentImportRule();
multilingualToken.setLocale(strLocale);
multilingualToken.setValue(arrOfFolders[i]);
multilingualTokenArr[0] = multilingualToken;
String myPackageName=arrOfFolders[i];
HashMap<String, SearchPathSingleObject> myPackInfo=new HashMap<String, SearchPathSingleObject>(packageInformation);
if (myPackInfo.containsKey(myPackageName))
{
packSearchPath=myPackInfo.get(myPackageName);
}
pkgDeployInfo.setArchiveSearchPath(packSearchPath);
pkgDeployInfo.setName(multilingualTokenArr);
pkgDeployInfo.setParent(new SearchPathSingleObject("/content"));
pkgDeployInfoArr[i] = pkgDeployInfo;
}
DeploymentOptionImportRuleArray deployOptionPkgInfo = new DeploymentOptionImportRuleArray();
deployOptionPkgInfo.setName(DeploymentOptionEnum.fromString("import"));
deployOptionPkgInfo.setValue(pkgDeployInfoArr);
return deployOptionPkgInfo;
}
// set export deployment option property (mandatory)
private DeploymentOptionSearchPathSingleObjectArray setExportDeploymentOptionPackageInfo(String[] arrOfFolders) {
SearchPathSingleObject[] exportPkgDeployInfoArr = new SearchPathSingleObject[arrOfFolders.length];
SearchPathSingleObject exportPkgDeployInfo;
String packSearchPath=null;
for (int i = 0; i < arrOfFolders.length; i++) {
exportPkgDeployInfo = new SearchPathSingleObject();
String myPackageName=arrOfFolders[i];
HashMap<String, SearchPathSingleObject> myExPackInfo=new HashMap<String, SearchPathSingleObject>(packageInformation);
if (myExPackInfo.containsKey(myPackageName))
{
packSearchPath=myExPackInfo.get(myPackageName).getValue();
System.out.println("Exporting Folder");
System.out.println(packSearchPath);
}
exportPkgDeployInfo.setValue(packSearchPath);
exportPkgDeployInfoArr[i] = exportPkgDeployInfo;
}
DeploymentOptionSearchPathSingleObjectArray exportDeployOptionPkgInfo = new DeploymentOptionSearchPathSingleObjectArray();
exportDeployOptionPkgInfo.setName(DeploymentOptionEnum.fromString("export"));
exportDeployOptionPkgInfo.setValue(exportPkgDeployInfoArr);
return exportDeployOptionPkgInfo;
}// set DeploymentOptionString property (mandatory)
private DeploymentOptionString setDeploymentOptionString(String archiveName) {
MultilingualString archiveDefault = new MultilingualString();
archiveDefault.setLocale(strLocale);
archiveDefault.setValue(archiveName);
DeploymentOptionString deployOptionStr = new DeploymentOptionString();
deployOptionStr.setName(DeploymentOptionEnum.fromString("archive"));
deployOptionStr.setValue(archiveDefault.getValue());
return deployOptionStr;
}
// allow the deployment overwrites the archive
private DeploymentOptionBoolean setArchiveOverWrite(boolean setValue) {
DeploymentOptionBoolean deployOptionBool = new DeploymentOptionBoolean();
deployOptionBool.setName(DeploymentOptionEnum
.fromString("archiveOverwrite"));
if (setValue) {
deployOptionBool.setValue(false);
} else {
deployOptionBool.setValue(true);
}
return deployOptionBool;
}
//set the archive password
private Option setArchivePassword(String pass2) {
DeploymentOptionString archiveEncryptPassword = new DeploymentOptionString();
archiveEncryptPassword.setName(DeploymentOptionEnum.fromString("archiveEncryptPassword"));
archiveEncryptPassword.setValue("<credential><password>" + pass2 + "</password></credential>");
return archiveEncryptPassword;
}
// set dataSourceSelect as default value - 'false'
private DeploymentOptionBoolean setDataSourceSelect(boolean setValue) {
DeploymentOptionBoolean deployOptionBool = new DeploymentOptionBoolean();
deployOptionBool.setName(DeploymentOptionEnum
.fromString("dataSourceSelect"));
if (setValue) {
deployOptionBool.setValue(false);
} else {
deployOptionBool.setValue(true);
}
return deployOptionBool;
}
// set namespaceSelect as default value - 'false'
private DeploymentOptionBoolean setNameSpaceSelect(boolean setValue) {
DeploymentOptionBoolean deployOptionBool = new DeploymentOptionBoolean();
deployOptionBool.setName(DeploymentOptionEnum
.fromString("namespaceSelect"));
if (setValue) {
deployOptionBool.setValue(false);
} else {
deployOptionBool.setValue(true);
}
return deployOptionBool;
}
// Not include references to external namespaces - value is false
private DeploymentOptionBoolean setNameSpaceThirdParty(boolean setValue) {
DeploymentOptionBoolean deployOptionBool = new DeploymentOptionBoolean();
deployOptionBool.setName(DeploymentOptionEnum
.fromString("namespaceThirdParty"));
if (setValue) {
deployOptionBool.setValue(true);
} else {
deployOptionBool.setValue(false);
}
return deployOptionBool;
}
// set objectPolicies as default value - 'false'
private DeploymentOptionBoolean setObjectPolicies(boolean setValue) {
DeploymentOptionBoolean deployOptionBool = new DeploymentOptionBoolean();
deployOptionBool.setName(DeploymentOptionEnum
.fromString("objectPolicies"));
if (setValue) {
deployOptionBool.setValue(false);
} else {
deployOptionBool.setValue(true);
}
return deployOptionBool;
}
// set packageHistories as default value - 'false'
private DeploymentOptionBoolean setPackageHistories(boolean setValue) {
DeploymentOptionBoolean deployOptionBool = new DeploymentOptionBoolean();
deployOptionBool.setName(DeploymentOptionEnum
.fromString("packageHistories"));
if (setValue) {
deployOptionBool.setValue(false);
} else {
deployOptionBool.setValue(true);
}
return deployOptionBool;
}
// set packageOutputs as default value - 'false'
private DeploymentOptionBoolean setPackageOutputs(boolean setValue) {
DeploymentOptionBoolean deployOptionBool = new DeploymentOptionBoolean();
deployOptionBool.setName(DeploymentOptionEnum
.fromString("packageOutputs"));
if (setValue) {
deployOptionBool.setValue(false);
} else {
deployOptionBool.setValue(true);
}
return deployOptionBool;
}
// set packageSchedules as default value - 'false'
private DeploymentOptionBoolean setPackageSchedules(boolean setValue) {
DeploymentOptionBoolean deployOptionBool = new DeploymentOptionBoolean();
deployOptionBool.setName(DeploymentOptionEnum
.fromString("packageSchedules"));
if (setValue) {
deployOptionBool.setValue(false);
} else {
deployOptionBool.setValue(true);
}
return deployOptionBool;
}
// set packageSelect as default value - 'true'
private DeploymentOptionBoolean setPackageSelect(boolean setValue) {
DeploymentOptionBoolean deployOptionBool = new DeploymentOptionBoolean();
deployOptionBool.setName(DeploymentOptionEnum
.fromString("packageSelect"));
if (setValue) {
deployOptionBool.setValue(true);
} else {
deployOptionBool.setValue(false);
}
return deployOptionBool;
}
// set recipientsSelect as default value - 'false'
private DeploymentOptionBoolean setRecipientsSelect(boolean setValue) {
DeploymentOptionBoolean deployOptionBool = new DeploymentOptionBoolean();
deployOptionBool.setName(DeploymentOptionEnum
.fromString("recipientsSelect"));
if (setValue) {
deployOptionBool.setValue(false);
} else {
deployOptionBool.setValue(true);
}
return deployOptionBool;
}
// set the owner to the owner from the source - the value is 'true'
private DeploymentOptionBoolean setTakeOwnership(boolean setValue) {
DeploymentOptionBoolean deployOptionBool = new DeploymentOptionBoolean();
deployOptionBool.setName(DeploymentOptionEnum
.fromString("takeOwnership"));
if (setValue) {
deployOptionBool.setValue(false);
} else {
deployOptionBool.setValue(true);
}
return deployOptionBool;
}
// set dataSourceConflictResolution as default value - 'replace'
private DeploymentOptionResolution setDataSourceConflictResolution(
boolean setValue) {
DeploymentOptionResolution deployOptionResolute = new DeploymentOptionResolution();
deployOptionResolute.setName(DeploymentOptionEnum
.fromString("dataSourceConflictResolution"));
if (setValue) {
deployOptionResolute.setValue(ConflictResolutionEnum.replace);
} else {
deployOptionResolute.setValue(ConflictResolutionEnum.keep);
}
return deployOptionResolute;
}
// set namespaceConflictResolution as default value - 'replace'
private DeploymentOptionResolution setNamespaceConflictResolution(
boolean setValue) {
DeploymentOptionResolution deployOptionResolute = new DeploymentOptionResolution();
deployOptionResolute.setName(DeploymentOptionEnum
.fromString("namespaceConflictResolution"));
if (setValue) {
deployOptionResolute.setValue(ConflictResolutionEnum.replace);
} else {
deployOptionResolute.setValue(ConflictResolutionEnum.keep);
}
return deployOptionResolute;
}
// set objectPoliciesConflictResolution as default value - 'replace'
private DeploymentOptionResolution setObjectPoliciesConflictResolution(
boolean setValue) {
DeploymentOptionResolution deployOptionResolute = new DeploymentOptionResolution();
deployOptionResolute.setName(DeploymentOptionEnum
.fromString("objectPoliciesConflictResolution"));
if (setValue) {
deployOptionResolute.setValue(ConflictResolutionEnum.replace);
} else {
deployOptionResolute.setValue(ConflictResolutionEnum.keep);
}
return deployOptionResolute;
}
// set ownershipConflictResolution as default value - 'replace'
private DeploymentOptionResolution setOwnershipConflictResolution(
boolean setValue) {
DeploymentOptionResolution deployOptionResolute = new DeploymentOptionResolution();
deployOptionResolute.setName(DeploymentOptionEnum
.fromString("ownershipConflictResolution"));
if (setValue) {
deployOptionResolute.setValue(ConflictResolutionEnum.replace);
} else {
deployOptionResolute.setValue(ConflictResolutionEnum.keep);
}
return deployOptionResolute;
}
// set packageHistoriesConflictResolution as default value - 'replace'
private DeploymentOptionResolution setPackageHistoriesConflictResolution(
boolean setValue) {
DeploymentOptionResolution deployOptionResolute = new DeploymentOptionResolution();
deployOptionResolute.setName(DeploymentOptionEnum
.fromString("packageHistoriesConflictResolution"));
if (setValue) {
deployOptionResolute.setValue(ConflictResolutionEnum.replace);
} else {
deployOptionResolute.setValue(ConflictResolutionEnum.keep);
}
return deployOptionResolute;
}
// set packageOutputsConflictResolution as default value - 'replace'
private DeploymentOptionResolution setPackageOutputsConflictResolution(
boolean setValue) {
DeploymentOptionResolution deployOptionResolute = new DeploymentOptionResolution();
deployOptionResolute.setName(DeploymentOptionEnum
.fromString("packageOutputsConflictResolution"));
if (setValue) {
deployOptionResolute.setValue(ConflictResolutionEnum.replace);
} else {
deployOptionResolute.setValue(ConflictResolutionEnum.keep);
}
return deployOptionResolute;
}
// set packageSchedulesConflictResolution as default value - 'replace'
private DeploymentOptionResolution setPackageSchedulesConflictResolution(
boolean setValue) {
DeploymentOptionResolution deployOptionResolute = new DeploymentOptionResolution();
deployOptionResolute.setName(DeploymentOptionEnum
.fromString("packageSchedulesConflictResolution"));
if (setValue) {
deployOptionResolute.setValue(ConflictResolutionEnum.replace);
} else {
deployOptionResolute.setValue(ConflictResolutionEnum.keep);
}
return deployOptionResolute;
}
// set recipientsConflictResolution as default value - 'replace'
private DeploymentOptionResolution setRecipientsConflictResolution(
boolean setValue) {
DeploymentOptionResolution deployOptionResolute = new DeploymentOptionResolution();
deployOptionResolute.setName(DeploymentOptionEnum
.fromString("recipientsConflictResolution"));
if (setValue) {
deployOptionResolute.setValue(ConflictResolutionEnum.replace);
} else {
deployOptionResolute.setValue(ConflictResolutionEnum.keep);
}
return deployOptionResolute;
}
}