OneM2M_Templates.ttcn 132 KB
Newer Older
1 2 3 4 5 6 7
/**
 *  Copyright Notification
 *  No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission.
 *  The copyright and the foregoing restriction extend to reproduction in all media.
 *  © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).
 *  All rights reserved.
 *  
8 9 10
 *  @author     ETSI
 *  @version    $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
 *              $Id: OneM2M_Templates.ttcn 347 2017-08-11 08:48:20Z reinaortega $
11 12 13 14 15 16 17 18 19 20
 *  @desc       Module containing templates for oneM2M
 *
 */
module OneM2M_Templates {

	import from XSD all;
	import from OneM2M_Types all;
	import from OneM2M_TypesAndValues all;
	//import from OneM2M_AdditionalTypes all;
	import from OneM2M_Pixits all;
21
	//import from OneM2M_Functions all;
22

23
		
24 25 26 27 28 29
	/**
	 * @desc Get a converted to string random number 
	 * @param p_lower Lower limit 
	 * @param p_upper Upper limit
	 * @return Random number converted to string
	 * @verdict 
30
	 */
31 32 33 34 35
	function f_rnd(in integer p_lower, in integer p_upper) return charstring {
		
		return int2str(float2int(rnd() * int2float(p_upper - p_lower + 1)) + p_lower);	
	}

36 37

	/* Templates */
38
	
39
	group Primitives {
40 41 42 43
		/** 
		 * @desc Base template for request sending operations
		 * @param p_requestPrimitive
		 */
44
		template (value) MsgOut m_request(in template (value) RequestPrimitive p_requestPrimitive, in template (omit) AttributeAux_list p_forcedFields := omit) := {
45 46 47 48 49
			primitive := { requestPrimitive := p_requestPrimitive},
			host := PX_SUT_ADDRESS,
			xmlNamespace := PX_XML_NAMESPACE,
			protocolBinding := PX_PROTOCOL_BINDING,
			serialization := PX_SERIALIZATION, 
50
			forcedFields := p_forcedFields
51
		};
52 53 54 55 56
    	
		/** 
		 * @desc Base template for response sending operations
		 * @param p_responsePrimitive
		 */
57
		template (value) MsgOut m_response(in template (value) ResponsePrimitive p_responsePrimitive, in template (omit) AttributeAux_list p_forcedFields := omit) := {
58
			primitive := { responsePrimitive := p_responsePrimitive},
59
			host := PX_SUT_ADDRESS,
60 61 62
			xmlNamespace := PX_XML_NAMESPACE,
			protocolBinding := PX_PROTOCOL_BINDING,
			serialization := PX_SERIALIZATION, 
63
			forcedFields := p_forcedFields
64
		};
65 66 67 68 69 70 71 72 73 74 75 76 77 78
		
		/** 
		 * @desc Base template for response sending operations
		 * @param p_responsePrimitive
		 */
		template (value) MsgOut m_httpResponse(in template (value) ResponsePrimitive p_responsePrimitive, in template (omit) AttributeAux_list p_forcedFields := omit) := {
			primitive := { responsePrimitive := p_responsePrimitive},
			host := PX_SUT_ADDRESS,
			xmlNamespace := PX_XML_NAMESPACE,
			protocolBinding := "HTTP",
			serialization := PX_SERIALIZATION, 
			forcedFields := p_forcedFields
		};
		
79 80 81
		template MsgIn mw_request(in template (present) RequestPrimitive p_requestPrimitive) := {
			primitive := { requestPrimitive := p_requestPrimitive}
		};
82 83 84 85 86
    	
		/** 
		 * @desc Base template for response receiving operations
		 * @param p_responsePrimitive
		 */
87
		template MsgIn mw_response(in template (present) ResponsePrimitive p_responsePrimitive := ?) := {
88 89 90
			primitive := { responsePrimitive := p_responsePrimitive}
		};
    	
91
	}//end of group primitives
92 93 94 95
	
	group RequestPrimitives { 
		
		group Retrieve {
96

97 98 99 100
			/**
			 * @desc Base RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 * @param p_originator Originator (from)
101
			 */
102
			template (value) RequestPrimitive m_retrieve(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
103
				operation := int2,
104
				to_ := p_targetResourceAddress,
105
				from_ := p_originator,
106
				requestIdentifier := "m_retrieve" & f_rnd(1, 1000000),
107
				resourceType := omit,
108
				primitiveContent := omit,
109
				role := omit, 
110 111 112 113 114 115 116 117 118 119 120
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
121
				discoveryResultType := omit
122
			};
123
			
124 125 126 127
			/**
			 * @desc Base Receive RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 */
128
			template RequestPrimitive mw_retrieve(template XSD.ID p_targetResourceAddress) := {
129 130 131 132
				operation := int2,
				to_ := p_targetResourceAddress,
				from_ := ?,
				requestIdentifier := ?,
133
				resourceType := omit,
134
				primitiveContent := *,
135
				role := *, 
136 137 138 139 140 141 142 143 144 145 146
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
147
				discoveryResultType := *
148 149
			};
        	
150 151 152 153 154
			/**
			 * @desc RETRIEVE request primitive for a single attribute in To field ("targetResourceAddress#AttributeName")
			 * @param p_targetResourceAddress Target resource address (including "#AttributeName")
			 * @param p_originator Originator (from)
			 */
155
			template (value) RequestPrimitive m_retrieveAttributeToOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
156 157 158 159 160
				operation := int2,
				to_ := p_targetResourceAddress,
				from_ := p_originator,
				requestIdentifier := "m_retrieveResourceAttributeOptionTo" & f_rnd(1, 1000000),
				resourceType := omit,
161
				primitiveContent := omit, 
162
				role := omit,
163 164 165 166 167 168 169 170 171 172 173
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
174
				discoveryResultType := omit
175
			};
176
        	
177 178 179 180 181
			/**
			 * @desc RETRIEVE request primtive containing the target attributes in the primitiveContent field
			 * @param p_targetResourceAddress Target resource address 
			 * @param p_attributeList Target attribute list
			 * @param p_originator Originator (from)
182
			 */
183
			template (value) RequestPrimitive m_retrieveAttributeContentOption(XSD.ID p_targetResourceAddress, in template (value) AttributeList_1 p_attributeList, in XSD.ID p_originator) := {
184
				operation := int2,
185
				to_ := p_targetResourceAddress,
186
				from_ := p_originator,
187 188
				requestIdentifier := "m_retrieveResourceAttributeContentOption" & f_rnd(1, 1000000),
				resourceType := omit,
189
				primitiveContent := {attributeList := p_attributeList},
190
				role := omit,
191 192 193 194 195 196 197 198 199 200 201
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
202
				discoveryResultType := omit
203
			};
204 205 206 207 208 209
			
			/**
			  * @desc RETRIEVE request primtive containing the Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_filterCriteria FilterCriteria
			  * @param p_originator Originator (from)
210
			 */
211
			template (value) RequestPrimitive m_retrieveFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := {
212 213
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
214 215 216 217 218 219 220 221 222 223 224 225 226 227
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := omit,
					resourceType := omit,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
228 229
					filterUsage := p_filterUsage, 
					limit := omit
230 231 232
				}
			};
			
233 234 235 236 237 238 239 240 241 242 243
			/**
			  * @desc RETRIEVE request primtive containing the Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_filterCriteria FilterCriteria
			  * @param p_originator Originator (from)
			 */
			template (value) RequestPrimitive m_retrieveFilterCriteria(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterCriteria p_filterCriteria) modifies m_retrieve := {
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := p_filterCriteria
			};
			
Pramod Kulkarni's avatar
Pramod Kulkarni committed
244 245 246 247 248 249 250
			/**
			  * @desc RETRIEVE request primtive containing the Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_originator Originator (from)
			  * @param p_filterUsage FilterUsage
			  * @param p_labels Labels
			 */
251
			template (value) RequestPrimitive m_retrieveFilterUsageOptionLabel(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage, in Labels p_labels) modifies m_retrieve := {
Pramod Kulkarni's avatar
Pramod Kulkarni committed
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
				requestIdentifier := "m_retrieveResourceFilterUsageOptionLabel" & f_rnd(1, 1000000),
				filterCriteria := {
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := p_labels,
					resourceType := omit,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
					filterUsage := p_filterUsage, 
269
					limit := omit
Pramod Kulkarni's avatar
Pramod Kulkarni committed
270 271
				}
			};
272
			
273 274 275 276 277 278
			/**
			  * @desc RETRIEVE request primtive containing the Discovery Type in the discoveryResultType field and Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_filterCriteria FilterCriteria
			  * @param p_originator Originator (from)
			 */
279
			template (value) RequestPrimitive m_retrieveDiscResTypeFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) DiscResType p_discResType, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := {
280 281
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
282 283 284 285 286 287 288 289 290 291 292 293 294 295
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := omit,
					resourceType := omit,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
296
					filterUsage := p_filterUsage,
297
					limit := omit
298 299 300 301 302
				},
				discoveryResultType := p_discResType
			};
			
			/**
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325
			  * @desc RETRIEVE request primtive containing the Discovery Type in the discoveryResultType field and Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_filterCriteria FilterCriteria
			  * @param p_originator Originator (from)
			 */
			template (value) RequestPrimitive m_retrieveInvalidFormatOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) modifies m_retrieve := {
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := omit,
					resourceType := omit,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
					filterUsage := omit,
326
					limit := omit
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
				}
			};
			
			/**
			  * @desc FilterCriteria empty template
			 */
			template (value) FilterCriteria m_filterCriteria := {
				createdBefore := omit,
				createdAfter := omit,
				modifiedSince := omit,
				unmodifiedSince := omit,
				stateTagSmaller := omit,
				stateTagBigger := omit,
				expireBefore := omit,
				expireAfter := omit,
				labels := omit,
				resourceType := omit,
				sizeAbove := omit,
				sizeBelow := omit,
				contentType_list := {},
				attribute_list := {},
				filterUsage := omit,
				limit := omit
			}
			
352
			
353
			
354
		}//end group Retrieve
355

356
		group Update {
357
    		
358
			template (value) RequestPrimitive m_update := {
359 360
				operation := int3,
				to_ := "NotInitialized",
361
				from_ := "NotInitialized",
362
				requestIdentifier := "m_update",
363
				resourceType := omit,
364
				primitiveContent:= omit,
365
				role := omit, 
366 367 368 369 370 371 372 373 374 375 376
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
377
				discoveryResultType := omit
378
			};
379
			
380 381 382 383 384 385
						
			template RequestPrimitive mw_update(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
				operation := int3,
				to_ := p_to,
				from_ := p_from,
				requestIdentifier := ?,
386
				resourceType := omit,
387
				primitiveContent:= ?,
388
				role := *, 
389 390 391 392 393 394 395 396 397 398 399
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
400
				discoveryResultType := omit
401 402
			};
        	
403 404 405 406
			/**
			 * @desc Base UPDATE request primitive for Ae resource
			 */
			template (value) RequestPrimitive m_updateAeBase modifies m_update:= {
407
				requestIdentifier := "m_updateAe",
408
				primitiveContent:= {aE := m_contentUpdateAe}
409
			};
410
						
411 412 413 414 415 416 417 418 419
			/**
			 * @desc Reception template for update Ae resource
			 */
			template RequestPrimitive mw_updateAe(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				resourceType := int2,
				primitiveContent:= {aE := ?}
			};
			 
        	
420 421 422 423
			/**
			 * @desc Base UPDATE request primitive for Container resource
			 */
			template (value) RequestPrimitive m_updateContainerBase modifies m_update:= {
424
				requestIdentifier := "m_updateContainer",
425
				primitiveContent:= {container := m_contentUpdateContainer}
426
			};
427
			
428 429 430 431 432 433 434 435
			/**
			 * @desc Base Reception template for update Container
			 */
			template RequestPrimitive mw_updateContainer(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				resourceType := int3,
				primitiveContent := {container := ?}
			}; 
			
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
436 437 438 439
			/**
			 * @desc Base UPDATE request primitive for ContentInstance resource
			 */
			template (value) RequestPrimitive m_updateContentInstanceBase modifies m_update:= {
440
				requestIdentifier := "m_updateContentInstance",
441
				primitiveContent:= {contentInstance := m_contentUpdateContentInstance}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
442 443
			};
			
444 445 446
			/**
			 * @desc Base UPDATE request primitive for AccessControlPolicy resource
			 */        				
447
			template (value) RequestPrimitive m_updateAcpBase modifies m_update := {
448
				requestIdentifier := "m_updateAcp",
449
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcp}
450 451
			};
			
452
			template (value) RequestPrimitive m_updateAcpPrivileges(in template(omit) SetOfAcrs p_privileges := omit, in template(omit) SetOfAcrs p_selfPrivileges := omit) modifies m_update := {
453
				requestIdentifier := "m_updateAcp",
454
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcpPrivileges(p_privileges, p_selfPrivileges)}
455 456
			};
			
457 458 459
			/**
			 * @desc Base UPDATE request primitive for Group resource
			 */
460
			template (value) RequestPrimitive m_updateGroupBase modifies m_update := {
461
				requestIdentifier := "m_updateGroup",
462
				primitiveContent:= {group_ := m_contentUpdateGroup}
463 464
			};
			
465 466 467 468
			/**
			 * @desc Base UPDATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_updateCSEBaseBase modifies m_update := {
469
				requestIdentifier := "m_updateGroup",
470
				primitiveContent:= {cSEBase := m_contentUpdateCSEBase}
471 472
			};
			
473 474 475
			/**
			 * @desc Base UPDATE request primitive for Schedule resource
			 */
476
			template (value) RequestPrimitive m_updateScheduleBase modifies m_update := {
477
				requestIdentifier := "m_updateSchedule",
478
				primitiveContent:= {schedule := m_contentUpdateSchedule}
479 480
			};
			
481 482 483
			/**
			 * @desc Base UPDATE request primitive for PollingChannel resource
			 */
484
			template (value) RequestPrimitive m_updatePollingChannelBase modifies m_update := {
485
				requestIdentifier := "m_updatePollingChannel",
486
				primitiveContent:= {pollingChannel := m_contentUpdatePollingChannel}
487 488
			};
			
489 490 491
			/**
			 * @desc Base UPDATE request primitive for Subscription resource
			 */
492
			template (value) RequestPrimitive m_updateSubscriptionBase modifies m_update := {
493
				requestIdentifier := "m_updateSubscription",
494
				primitiveContent:= {subscription := m_contentUpdateSubscription}
495
			};
496
			
497
			template (value) RequestPrimitive m_updateLocationPolicy(XSD.ID p_locResourceAddress, in template (omit) AcpType p_accessControlPolicyIds, in template (value) XSD.Duration p_locationUpdatePeriod) modifies m_update := {
498 499
				to_ 				:= p_locResourceAddress,
				requestIdentifier	:= "m_updateLocationPolicy",
500
				primitiveContent	:= {locationPolicy := m_contentUpdateLocationPolicy(p_accessControlPolicyIds, p_locationUpdatePeriod)}
501
			  };
502
        	
503
			template (value) RequestPrimitive m_updateNodeBase modifies m_update := {
504
				requestIdentifier := "m_updateNode",
505
				primitiveContent:= {node := m_contentUpdateNode}
506
			}
507
        	
508
			template (value) RequestPrimitive m_updateRemoteCSEBase modifies m_update := {
509
			   requestIdentifier := "m_updateRemoteCSEBase",
510 511
			   primitiveContent := {remoteCSE := m_contentUpdateRemoteCSE}
			}
512
        	
513
			template (value) RequestPrimitive m_updateAEAnncBase modifies m_update:= {
514
				requestIdentifier := testcasename() & "-m_updateAEAnnc",
515
				resourceType := int10002,
516
				primitiveContent := {aEAnnc := m_contentUpdateAEAnnc}
517
			};
518
		}//end group Update
519
    	
520
		group Create {
521 522 523 524 525

			template (value) RequestPrimitive m_create := {
				operation := int1,
				to_ := "NotInitialized",
				from_ := "NotInitialized",
526
				requestIdentifier := testcasename() & "-m_create",
527 528
				resourceType := omit,
				primitiveContent := omit,
529
				role := omit,
530 531 532 533 534 535 536 537 538 539 540
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
541
				discoveryResultType := omit
542
			};
543
        	
544 545 546 547 548
			/**
			 * @desc Base Reception template for create operation
			 */
			template RequestPrimitive mw_create(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
				operation := int1,
549
				to_ := p_to,
550 551 552
				from_ := p_from,
				requestIdentifier := ?,
				resourceType := ?,
553
				primitiveContent := ?,
554
				role := *,
555 556 557 558 559 560 561 562 563 564
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
565 566
				filterCriteria := omit,
				discoveryResultType := omit
567 568
			}
			
569 570
			
			/**
571 572 573 574 575 576
			 * @desc Base CREATE request primitive for AEAnnc resource
			 * @param p_accessControlPolicyIds
			 * @param p_to
			 * @param p_from
			 * @param p_appId
			 * @param p_stemId
577
			 */
578
			template (value) RequestPrimitive m_createAEAnnc(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) XSD.ID p_from := omit, XSD.ID p_appId, XSD.ID p_link) modifies m_create:= {
579
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
580
				requestIdentifier := testcasename() & "-m_createAEAnnc",
581
				resourceType := int10002,
582
				primitiveContent := {aEAnnc := m_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, p_link)}
583 584
			};
			
585
			/**
586
			 * @desc Reception template for CREATE AEAnnc
587
			 */
588
			template RequestPrimitive mw_createAEAnnc(template (omit) XSD.ID p_from := omit, template (omit) XSD.ID p_to := omit, template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) modifies mw_create := {
589
				resourceType := int10002,
590
				primitiveContent := {aEAnnc := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)}
591
			};
592

593
			template (value) RequestPrimitive m_createAe(XSD.ID p_appId, template (omit) AcpType p_accessControlPolicyIds := omit,template (omit) XSD.ID p_from := omit, template (omit) ResourceName p_resourceName :=  c_aeAuxName, in template (omit) PoaList p_poaList := omit) modifies m_create := {
594
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
595
				requestIdentifier := testcasename() & "-m_createAe",
596
				resourceType := int2,
597
				primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds,p_resourceName, p_appId, p_poaList)}
598
			};
599
        	
600 601 602
			/**
			 * @desc Reception template for AE registration
			 */
603
			template RequestPrimitive mw_createAe(template XSD.ID p_from := *, template XSD.ID p_to := ?, template AE_optional p_ae := ?) modifies mw_create := {
604
				resourceType := int2,
605
				primitiveContent := {aE := p_ae}
606 607
			};  
			        	
608 609
			template (value) RequestPrimitive m_createAeAux(template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) PoaList p_poaList) modifies m_create := {
				from_ := PX_AE1_ID_STEM,//TODO We should use omit, "s", or "c"
610
				requestIdentifier := testcasename() & "-m_createAe",
611 612
				resourceType := int2,
				primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds, c_aeAuxName, -, p_poaList)}
613
			};
614
        	
615 616 617
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource
			 */
618
			template (value) RequestPrimitive m_createAcpBase modifies m_create := {
619
				requestIdentifier := testcasename() & "-m_createAcp",
620
				resourceType := int1,
621
				primitiveContent := {accessControlPolicy := m_contentCreateAcp ()}
622 623
			};
				
624
			template (value) RequestPrimitive m_createAcp(XSD.ID p_parentResourceAddress, in template (omit)  XSD.String p_name := c_defaultAccessControlPolicyResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63) modifies m_create := {
625
				to_ := p_parentResourceAddress,
626
				requestIdentifier := testcasename() & "-m_createAcp",
627
				resourceType := int1,
628 629
				primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_name, p_acor, p_allowedOperations)}
			};
630
        	
631 632 633 634 635 636
			/**
			 * @desc Reception template for CREATE AcpAnnc
			 */
			template RequestPrimitive mw_createAccessControlPolicyAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				to_ := p_to,
				from_ := p_from,
637
				resourceType := int10002,
638
				primitiveContent := {accessControlPolicyAnnc := mw_contentCreateAcpAnnc(-)}
639 640
			};
        	
641 642 643 644
       	
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource (AUX)
			 */
645
			template (value) RequestPrimitive m_createAcpAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) modifies m_create := {
646
				requestIdentifier := testcasename() & "-m_createAcpAux",
647
				resourceType := int1,
648
				primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_acpName, p_acor, p_allowedOperations)}
649
			};
650
        	
651
			/*template (value) RequestPrimitive m_createCSEBase (in ServiceSubscribedAppRule p_serviceSubscribedAppRule) modifies m_create := {
652
				from_ := PX_SUPER_USER,
653
				requestIdentifier := testcasename() & "-m_createCSE" & f_rnd(1, 1000000),
654
				resourceType := int1,//FIXME Is this the value for CSEBase? In any case, this template is not used at all
655
				primitiveContent := {cSEBase := m_contentCreateCSEBase (p_serviceSubscribedAppRule)}
656 657 658 659 660 661
			};*/
			
			/**
			 * @desc Base CREATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_createCSEBaseBase modifies m_create := {
662
				requestIdentifier := testcasename() & "-m_createCSEBase",
663
				resourceType := int5,
664
				primitiveContent := {cSEBase := m_contentCreateCSEBase}
665 666
			};
        	
667 668 669 670
       	
			/**
			 * @desc Base CREATE request primitive for Container resource
			 */
671
			template (value) RequestPrimitive m_createContainerBase modifies m_create := {
672
				requestIdentifier := testcasename() & "-m_createContainer",
673
				resourceType := int3,
674
				primitiveContent := {container := m_contentCreateContainer}
675
			};
676
			
677 678 679
			/**
			 * @desc Base CREATE request primitive for remoteCSE resource
			 */
680
			template (value) RequestPrimitive m_createRemoteCSEBase(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) ResourceName p_resourceName :=  c_defaultRemoteCSEResourceName, in template (omit) XSD.AnyURI p_cSEBase := PX_CSE1_ID, in template (omit) XSD.ID p_cSE_ID := PX_CSE1_ID) modifies m_create := {
681
				requestIdentifier := testcasename() & "-m_createRemoteCSE",
682
				resourceType := int16,
683
				primitiveContent := {remoteCSE := m_contentCreateRemoteCSE(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID)}
684 685
			};
			
686
			/**
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
687 688 689 690 691
			 * @desc Reception template for CREATE RemoteCSE
			 */
			template RequestPrimitive mw_createRemoteCSE(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int16,
				primitiveContent := {remoteCSE := ?}	//{remoteCSE := m_contentCreateRemoteCSE(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID)}
692
			};
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
693
			
694
			/**
695
			 * @desc Base reception template for CREATE RemoteCSE
696 697 698
			 */
			template RequestPrimitive mw_createRemoteCSEBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int16,
699
				primitiveContent := {remoteCSE := mw_contentCreateRemoteCSEBase}
700 701
			};
			
702 703 704 705
			/**
			 * @desc CREATE request primitive for Container resource wiht no resourceName provided
			 */
			template (value) RequestPrimitive m_createContainer_noResourceName modifies m_createContainerBase := {
706
				primitiveContent := {container := m_contentCreateContainer(omit)}
707
			};
708
	
709
			template (value) RequestPrimitive m_createContainer(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_resourceName := c_defaultContainerResourceName) modifies m_create := {
710
				to_ := p_parentResourceAddress,
711
				requestIdentifier := testcasename() & "-m_createContainer",
712
				resourceType := int3,
713 714
				primitiveContent := {container := m_contentCreateContainer(p_resourceName)}
			};
715
        	
716 717 718 719 720
			/**
			 * @desc Reception template for CREATE Container
			 */
			template RequestPrimitive mw_createContainer(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int3,
721
				primitiveContent := {container := ?}
722 723
			};  
			
724
			/**
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
725
			 * @desc Base Reception template for CREATE ContainerAnnc
726
			 */
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
727
			template RequestPrimitive mw_createContainerAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
728
				resourceType := int10003,
729
				primitiveContent := {containerAnnc := mw_contentCreateContainerAnncBase}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
730
			};
731
        	
732 733 734 735
			/**
			 * @desc Base CREATE request primitive for Content Instance resource
			 */
			template (value) RequestPrimitive m_createContentInstanceBase modifies m_create := {
736
				requestIdentifier := testcasename() & "-m_createContentInstance",
737
				resourceType := int4,
738
				primitiveContent := {contentInstance := m_contentCreateContentInstance}
739
			};
740 741 742 743 744
				
			/**
			 * @desc CREATE request primitive for Content Instance resource with no resourceName provided
			 */
			template (value) RequestPrimitive m_createContentInstance_noResourceName modifies m_createContentInstanceBase := {
745
				primitiveContent := {contentInstance := m_contentCreateContentInstance(omit)}
746
			};
747
    		
748 749 750
			template (value) RequestPrimitive m_createContentInstance(XSD.ID p_parentResourceAddress, XSD.String p_primitiveContent) modifies m_create := {
				to_ := p_parentResourceAddress,
				from_ := "admin:admin",
751
				requestIdentifier := testcasename() & "-m_createContentInstance",
752
				resourceType := int4,
753
				primitiveContent := {contentInstance := m_contentCreateContentInstance(-, p_primitiveContent)}
754
			};
755
    		
756 757 758 759 760
			/**
			 * @desc Reception template for CREATE ContentInstanceAnnc
			 */
			template RequestPrimitive mw_createContentInstanceAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10014,
761
				primitiveContent := {contentInstanceAnnc := ?}
762 763
			}; 
		
764 765 766 767 768 769 770 771
			/**
			 * @desc Reception template for CREATE ContentInstance
			 */
			template RequestPrimitive mw_createContentInstance(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int4,
				primitiveContent := {contentInstance := ?}
			}; 
			
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
772 773 774 775 776
			/**
			 * @desc Base Reception template for CREATE ContentInstanceAnnc
			 */
			template RequestPrimitive mw_createContentInstanceAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10014,
777
				primitiveContent := {contentInstanceAnnc := mw_contentCreateContentInstanceAnncBase}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
778
			};  
779 780 781 782 783 784 785 786 787
			
			/**
			 * @desc Base CREATE request primitive for Delivery resource
			 */
			/*template (value) RequestPrimitive m_createDeliveryBase modifies m_create := {
				requestIdentifier := testcasename() & "-m_createDelivery" & f_rnd(1, 1000000),
				resourceType := int6,
				primitiveContent := {delivery := m_contentCreateDelivery()}
			};*/
788
        	    		
789 790 791 792
       	
			/**
			 * @desc Base CREATE request primitive for Group resource
			 */
793
			template (value) RequestPrimitive m_createGroupBase modifies m_create := {
794
				requestIdentifier := testcasename() & "-m_createGroup",
795
				resourceType := int9,
796
				primitiveContent := {group_ := m_contentCreateGroup (1, {"NotInitialized"}, omit, omit)}	//TODO: p_resourceId
797
			};
798
        	
799
			template (value) RequestPrimitive m_createGroup(in template (value) XSD.NonNegativeInteger p_maxNrOfMembers,
800
															in template (value) ListOfURIs p_memberIds := {"NotInitialized"},
801
															in template (omit) AcpType p_accessControlPolicyIds,
802 803 804 805
															in template (omit) MemberType p_memberType := omit,
															in template (omit) ConsistencyStrategy p_consistencyStrategy := omit,
															in template (omit) ListOfURIs p_membersAccessControlPolicyIDs := omit,
															in template (omit) XSD.String p_name := "MyGroup") modifies m_create := {
806
				requestIdentifier := testcasename() & "-m_createGroup",
807 808 809
				resourceType := int9,
				primitiveContent := {group_ := m_contentCreateGroup (p_maxNrOfMembers, p_memberIds, p_accessControlPolicyIds, p_memberType, p_consistencyStrategy, p_membersAccessControlPolicyIDs, p_name)}	//TODO: p_resourceId
			};
810
        	
811 812 813 814 815
			/**
			 * @desc Reception template for CREATE GroupAnnc
			 */
			template RequestPrimitive mw_createGroupAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10009,
816
				primitiveContent := {groupAnnc := ?}
817
			};  
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
818 819 820 821 822 823
			
			/**
			 * @desc Base Reception template for CREATE GroupAnnc
			 */
			template RequestPrimitive mw_createGroupAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10009,
824
				primitiveContent := {groupAnnc := mw_contentCreateGroupAnncBase}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
825
			};
826
        	
827
			/**
828 829 830
			 * @desc Base CREATE request primitive for MgmtCmd resource
			 */
			template (value) RequestPrimitive m_createMgmtCmdBase modifies m_create := {
831
				requestIdentifier := testcasename() & "-m_createMgmtCmd",
832
				resourceType := int12,
833
				primitiveContent := {mgmtResource := m_contentCreateMgmtCmd (-,-)}
834 835
			};
			
836 837 838 839
			/**
			 * @desc Base CREATE request primitive for MgmtObj resource
			 */
			template (value) RequestPrimitive m_createMgmtObjBase modifies m_create := {
840
				requestIdentifier := testcasename() & "-m_createMgmtObj",
841
				resourceType := int13,
842
				primitiveContent := {mgmtResource := m_contentCreateMgmtObj (-,-)}
843 844 845 846 847 848
			};
        	
			/**
			 * @desc CREATE request primitive for MgmtObj resource
			 */
			template (value) RequestPrimitive m_createMgmtObj modifies m_create := {
849
				requestIdentifier := testcasename() & "-m_createMgmtObj",
850
				resourceType := int13,
851
				primitiveContent := {mgmtResource := m_contentCreateMgmtObj (-, -)}
852 853 854 855 856 857 858
			};
        	
			/**
			 * @desc Reception template for CREATE MgmtObjAnnc
			 */
			template RequestPrimitive mw_createMgmtObjAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10013,
859
				primitiveContent := {announcedMgmtResource := ?}
860 861
			};  
			
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
862 863 864 865