OneM2M_Templates.ttcn 144 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
 *  @author     oneM2M
9
 *  @version    $URL: https://oldforge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
10
 *              $Id: OneM2M_Templates.ttcn 356 2017-08-21 12:25:14Z 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
    		primitive := { requestPrimitive := p_requestPrimitive},
46
    		host := PX_SUT_ADDRESS,
47 48 49
    		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 82 83 84 85 86
    	template MsgIn mw_request(in template (present) RequestPrimitive p_requestPrimitive) := {
    		primitive := { requestPrimitive := p_requestPrimitive}
    	};
    	
		/** 
		 * @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
				roleIDs := 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 122 123
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
124
				localTokenIDs := omit,
125
				tokenRequestIndicator := omit
126 127
			};
        	
128 129 130 131
			/**
			 * @desc Base Receive RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 */
132
			template RequestPrimitive mw_retrieve(XSD.ID p_targetResourceAddress) := {
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
				operation := int2,
				to_ := p_targetResourceAddress,
				from_ := ?,
				requestIdentifier := ?,
				resourceType := ?,
				primitiveContent := ?,
				roleIDs := *, 
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
				discoveryResultType := *,
				tokens := *,
				tokenIDs := *,
				localTokenIDs := *,
				tokenRequestIndicator := *
			};
        	
158 159 160 161 162
			/**
			 * @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)
			 */
163
			template (value) RequestPrimitive m_retrieveAttributeToOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
164
        		operation := int2,
165
        		to_ := p_targetResourceAddress,
166
        		from_ := p_originator,
167 168
        		requestIdentifier := "m_retrieveResourceAttributeOptionTo" & f_rnd(1, 1000000),
        		resourceType := omit,
169
				primitiveContent := omit, 
170
				roleIDs := omit,
171 172 173 174 175 176 177 178 179 180 181
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
182 183 184
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
185
				localTokenIDs := omit,
186
				tokenRequestIndicator := omit
187 188
        	};
        	
189 190 191 192 193
			/**
			 * @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)
194
			 */
195
			template (value) RequestPrimitive m_retrieveAttributeContentOption(XSD.ID p_targetResourceAddress, in template (value) AttributeList_1 p_attributeList, in XSD.ID p_originator) := {
196
				operation := int2,
197
				to_ := p_targetResourceAddress,
198
				from_ := p_originator,
199 200
				requestIdentifier := "m_retrieveResourceAttributeContentOption" & f_rnd(1, 1000000),
				resourceType := omit,
201
				primitiveContent := {attributeList := p_attributeList},
202
				roleIDs := omit,
203 204 205 206 207 208 209 210 211 212 213
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
214 215 216
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
217
				localTokenIDs := omit,
218
				tokenRequestIndicator := omit
219
			};
220 221 222 223 224 225 226
			
			/**
			  * @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)
		     */
227
			template (value) RequestPrimitive m_retrieveFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := {
228 229
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
230 231 232 233 234 235 236 237 238 239 240 241 242 243
					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 := {},
244
					filterUsage := p_filterUsage,
245 246 247 248 249 250 251
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
252 253 254
				}
			};
			
Pramod Kulkarni's avatar
Pramod Kulkarni committed
255 256 257 258 259 260 261
			/**
			  * @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
			 */
262
			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
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
				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, 
280 281 282 283 284 285 286
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
Pramod Kulkarni's avatar
Pramod Kulkarni committed
287 288
				}
			};
289 290 291 292 293 294
			/**
			  * @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)
			 */
295
			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 := {
296 297
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
298 299 300 301 302 303 304 305 306 307 308 309 310 311
					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 := {},
312
					filterUsage := p_filterUsage,
313 314 315 316 317 318 319
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
320 321 322 323 324 325 326 327 328 329
				},
				discoveryResultType := p_discResType
			};
			
			/**
				  * @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)
				 */
330
				template (value) RequestPrimitive m_retrieveInvalidFormatOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) modifies m_retrieve := {
331 332
					requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
					filterCriteria := {
333 334 335 336 337 338 339 340 341 342 343 344 345 346
						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 := {},
347
						filterUsage := omit,
348 349 350 351 352 353 354
						limit := omit,
						semanticsFilter_list := {},
						filterOperation := omit,
						contentFilterSyntax := omit,
						contentFilterQuery := omit,
						level := omit,
						offset := omit
355 356 357
					}
				};
			
358 359 360
    	}//end group Retrieve

    	group Update {
361 362
    		
    		template (value) RequestPrimitive m_update := {
363 364
				operation := int3,
				to_ := "NotInitialized",
365
				from_ := "NotInitialized",
366
				requestIdentifier := "m_update",
367
				resourceType := omit,
368
				primitiveContent:= omit,
369
				roleIDs := omit, 
370 371 372 373 374 375 376 377 378 379 380
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
381 382 383
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
384
				localTokenIDs := omit,
385
				tokenRequestIndicator := omit
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
						
			template RequestPrimitive mw_update(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
				operation := int3,
				to_ := p_to,
				from_ := p_from,
				requestIdentifier := ?,
				resourceType := ?,
				primitiveContent:= ?,
				roleIDs := *, 
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
				discoveryResultType := *, 
				tokens := *,
				tokenIDs := *,
				localTokenIDs := *,
				tokenRequestIndicator := *
			};
        	
415 416 417 418
			/**
			 * @desc Base UPDATE request primitive for Ae resource
			 */
			template (value) RequestPrimitive m_updateAeBase modifies m_update:= {
419
				requestIdentifier := "m_updateAe",
420
				primitiveContent:= {aE := m_contentUpdateAe}
421 422
			};
        	
423 424 425 426 427 428 429 430 431
			/**
			 * @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 := ?}
			};
			 
        	
432 433 434 435
			/**
			 * @desc Base UPDATE request primitive for Container resource
			 */
			template (value) RequestPrimitive m_updateContainerBase modifies m_update:= {
436
				requestIdentifier := "m_updateContainer",
437
				primitiveContent:= {container := m_contentUpdateContainer}
438
			};
439
			
440 441 442 443 444 445 446 447
			/**
			 * @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
448 449 450 451
			/**
			 * @desc Base UPDATE request primitive for ContentInstance resource
			 */
			template (value) RequestPrimitive m_updateContentInstanceBase modifies m_update:= {
452
				requestIdentifier := "m_updateContentInstance",
453
				primitiveContent:= {contentInstance := m_contentUpdateContentInstance}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
454 455
			};
			
456 457 458
			/**
			 * @desc Base UPDATE request primitive for AccessControlPolicy resource
			 */        				
459
			template (value) RequestPrimitive m_updateAcpBase modifies m_update := {
460
				requestIdentifier := "m_updateAcp",
461
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcp}
462 463
			};
			
464
			template (value) RequestPrimitive m_updateAcpPrivileges(in template(omit) SetOfAcrs p_privileges := omit, in template(omit) SetOfAcrs p_selfPrivileges := omit) modifies m_update := {
465
				requestIdentifier := "m_updateAcp",
466
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcpPrivileges(p_privileges, p_selfPrivileges)}
467 468
			};
			
469 470 471
			/**
			 * @desc Base UPDATE request primitive for Group resource
			 */
472
			template (value) RequestPrimitive m_updateGroupBase modifies m_update := {
473
				requestIdentifier := "m_updateGroup",
474
				primitiveContent:= {group_ := m_contentUpdateGroup}
475 476
			};
			
477 478 479 480
			/**
			 * @desc Base UPDATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_updateCSEBaseBase modifies m_update := {
481
				requestIdentifier := "m_updateGroup",
482
				primitiveContent:= {cSEBase := m_contentUpdateCSEBase}
483 484
			};
			
485 486 487
			/**
			 * @desc Base UPDATE request primitive for Schedule resource
			 */
488
			template (value) RequestPrimitive m_updateScheduleBase modifies m_update := {
489
				requestIdentifier := "m_updateSchedule",
490
				primitiveContent:= {schedule := m_contentUpdateSchedule}
491 492
			};
			
493 494 495
			/**
			 * @desc Base UPDATE request primitive for PollingChannel resource
			 */
496
			template (value) RequestPrimitive m_updatePollingChannelBase modifies m_update := {
497
				requestIdentifier := "m_updatePollingChannel",
498
				primitiveContent:= {pollingChannel := m_contentUpdatePollingChannel}
499 500
			};
			
501 502 503
			/**
			 * @desc Base UPDATE request primitive for Subscription resource
			 */
504
			template (value) RequestPrimitive m_updateSubscriptionBase modifies m_update := {
505
				requestIdentifier := "m_updateSubscription",
506
				primitiveContent:= {subscription := m_contentUpdateSubscription}
507
			};
508
			
509
			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 := {
oneM2MTester Develop Team's avatar
oneM2MTester Develop Team committed
510
        	  	to_ 				:= p_locResourceAddress,
511
        	  	requestIdentifier	:= "m_updateLocationPolicy",
512
        	  	primitiveContent	:= {locationPolicy := m_contentUpdateLocationPolicy(p_accessControlPolicyIds, p_locationUpdatePeriod)}
513
			  };
514
        	
515
        	template (value) RequestPrimitive m_updateNodeBase modifies m_update := {
516
				requestIdentifier := "m_updateNode",
517 518 519 520
				primitiveContent:= {node := m_contentUpdateNode}
        	}
        	
        	template (value) RequestPrimitive m_updateRemoteCSEBase modifies m_update := {
521
			   requestIdentifier := "m_updateRemoteCSEBase",
522 523 524 525
        	   primitiveContent := {remoteCSE := m_contentUpdateRemoteCSE}
        	}
        	
        	template (value) RequestPrimitive m_updateAE modifies m_update := {
526
				requestIdentifier := "m_updateAE",
527
				primitiveContent := {aE := m_contentUpdateAe}
528
        	}
529 530
        	
        	template (value) RequestPrimitive m_updateAEAnnc(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) XSD.ID p_to := omit, template (omit) XSD.ID p_from := omit, XSD.ID p_appId, XSD.ID p_stemId := "") modifies m_update:= {
531
				requestIdentifier := testcasename() & "-m_updateAEAnnc",
532
				resourceType := int10002,
533
				primitiveContent := {aEAnnc := m_contentUpdateAEAnnc(p_appId,p_stemId)}
534
			};
535 536 537
    	}//end group Update
    	
    	group Create {
538 539 540 541 542

			template (value) RequestPrimitive m_create := {
				operation := int1,
				to_ := "NotInitialized",
				from_ := "NotInitialized",
543
				requestIdentifier := testcasename() & "-m_create",
544 545
				resourceType := omit,
				primitiveContent := omit,
546
				roleIDs := omit,
547 548 549 550 551 552 553 554 555 556 557 558 559 560
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
561
				localTokenIDs := omit,
562
				tokenRequestIndicator := omit
563 564

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

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