OneM2M_Templates.ttcn 136 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
			primitive := { requestPrimitive := p_requestPrimitive},
			host := PX_SUT_ADDRESS,
			xmlNamespace := PX_XML_NAMESPACE,
48
			protocolBinding := PX_PROTOCOL_BINDING_CSE1,
49
			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
			xmlNamespace := PX_XML_NAMESPACE,
61
			protocolBinding := PX_PROTOCOL_BINDING_CSE1,
62
			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, template AttributeList_1 p_nullFields := *) := {
			primitive := { requestPrimitive := p_requestPrimitive}, 
			nullFields := p_nullFields
82
		};
83 84 85 86 87
    	
		/** 
		 * @desc Base template for response receiving operations
		 * @param p_responsePrimitive
		 */
88 89 90
		template MsgIn mw_response(in template (present) ResponsePrimitive p_responsePrimitive := ?, template AttributeList_1 p_nullFields := *) := {
			primitive := { responsePrimitive := p_responsePrimitive}, 
			nullFields := p_nullFields
91 92
		};
    	
93
	}//end of group primitives
94 95 96 97
	
	group RequestPrimitives { 
		
		group Retrieve {
98

99 100 101 102
			/**
			 * @desc Base RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 * @param p_originator Originator (from)
103
			 */
104
			template (value) RequestPrimitive m_retrieve(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
105
				operation := int2,
106
				to_ := p_targetResourceAddress,
107
				from_ := p_originator,
108
				requestIdentifier := "m_retrieve" & f_rnd(1, 1000000),
109
				resourceType := omit,
110
				primitiveContent := omit,
111
				role := omit, 
112 113 114 115 116 117 118 119 120 121 122
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
123
				discoveryResultType := omit
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
			/**
			 * @desc RETRIEVE request primitive for child references
			 * @param p_targetResourceAddress Target resource address
			 * @param p_originator Originator (from)
			 */
			template (value) RequestPrimitive m_retrieveChildReferences(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, template (omit) ResourceTypeList p_resourceTypeList := omit) modifies m_retrieve := {
				resultContent := int6, 
				filterCriteria := {
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := omit,
					resourceType := p_resourceTypeList,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
					filterUsage := omit,
					limit := omit
				}
			};
			
153 154 155 156
			/**
			 * @desc Base Receive RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 */
157
			template RequestPrimitive mw_retrieve(template XSD.ID p_targetResourceAddress) := {
158 159 160 161
				operation := int2,
				to_ := p_targetResourceAddress,
				from_ := ?,
				requestIdentifier := ?,
162
				resourceType := omit,
163
				primitiveContent := *,
164
				role := *, 
165 166 167 168 169 170 171 172 173 174 175
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
176
				discoveryResultType := *
177 178
			};
        	
179 180 181 182 183
			/**
			 * @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)
			 */
184
			template (value) RequestPrimitive m_retrieveAttributeToOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
185 186 187 188 189
				operation := int2,
				to_ := p_targetResourceAddress,
				from_ := p_originator,
				requestIdentifier := "m_retrieveResourceAttributeOptionTo" & f_rnd(1, 1000000),
				resourceType := omit,
190
				primitiveContent := omit, 
191
				role := omit,
192 193 194 195 196 197 198 199 200 201 202
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
203
				discoveryResultType := omit
204
			};
205
        	
206 207 208 209 210
			/**
			 * @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)
211
			 */
212
			template (value) RequestPrimitive m_retrieveAttributeContentOption(XSD.ID p_targetResourceAddress, in template (value) AttributeList_1 p_attributeList, in XSD.ID p_originator) := {
213
				operation := int2,
214
				to_ := p_targetResourceAddress,
215
				from_ := p_originator,
216 217
				requestIdentifier := "m_retrieveResourceAttributeContentOption" & f_rnd(1, 1000000),
				resourceType := omit,
218
				primitiveContent := {attributeList := p_attributeList},
219
				role := omit,
220 221 222 223 224 225 226 227 228 229 230
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
231
				discoveryResultType := omit
232
			};
233 234 235 236 237 238
			
			/**
			  * @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)
239
			 */
240
			template (value) RequestPrimitive m_retrieveFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := {
241 242
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
243 244 245 246 247 248 249 250 251 252 253 254 255 256
					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 := {},
257 258
					filterUsage := p_filterUsage, 
					limit := omit
259 260 261
				}
			};
			
262 263 264 265 266 267 268 269 270 271 272
			/**
			  * @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
273 274 275 276 277 278 279
			/**
			  * @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
			 */
280
			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
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297
				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, 
298
					limit := omit
Pramod Kulkarni's avatar
Pramod Kulkarni committed
299 300
				}
			};
301
			
302 303 304 305 306 307
			/**
			  * @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)
			 */
308
			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 := {
309 310
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
311 312 313 314 315 316 317 318 319 320 321 322 323 324
					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 := {},
325
					filterUsage := p_filterUsage,
326
					limit := omit
327 328 329 330 331
				},
				discoveryResultType := p_discResType
			};
			
			/**
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354
			  * @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,
355
					limit := omit
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
				}
			};
			
			/**
			  * @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
			}
			
381
			
382
			
383
		}//end group Retrieve
384

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

			template (value) RequestPrimitive m_create := {
				operation := int1,
				to_ := "NotInitialized",
				from_ := "NotInitialized",
554
				requestIdentifier := testcasename() & "-m_create",
555 556
				resourceType := omit,
				primitiveContent := omit,
557
				role := omit,
558 559 560 561 562 563 564 565 566 567 568
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
569
				discoveryResultType := omit
570
			};
571
        	
572 573 574 575 576
			/**
			 * @desc Base Reception template for create operation
			 */
			template RequestPrimitive mw_create(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
				operation := int1,
577
				to_ := p_to,
578 579 580
				from_ := p_from,
				requestIdentifier := ?,
				resourceType := ?,
581
				primitiveContent := ?,
582
				role := *,
583 584 585 586 587 588 589 590 591 592
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
593 594
				filterCriteria := omit,
				discoveryResultType := omit
595 596
			}
			
597 598
			
			/**
599 600 601 602 603 604
			 * @desc Base CREATE request primitive for AEAnnc resource
			 * @param p_accessControlPolicyIds
			 * @param p_to
			 * @param p_from
			 * @param p_appId
			 * @param p_stemId
605
			 */
606
			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:= {
607
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
608
				requestIdentifier := testcasename() & "-m_createAEAnnc",
609
				resourceType := int10002,
610
				primitiveContent := {aEAnnc := m_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, p_link)}
611 612
			};
			
613
			/**
614
			 * @desc Reception template for CREATE AEAnnc
615
			 */
616
			template RequestPrimitive mw_createAEAnnc(template XSD.ID p_from := ?, template XSD.ID p_to := ?, template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) modifies mw_create := {
617
				resourceType := int10002,
618
				primitiveContent := {aEAnnc := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)}
619
			};
620

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