Package com.skava.list.web
Class ListPropertiesController
java.lang.Object
com.skava.list.web.ListPropertiesController
@RestController
@RequestMapping("/lists/{listId}/properties")
public class ListPropertiesController
extends Object
ListPropertiesController class
This class contain constants that are used to property of list.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<ListResponse>
createProperties
(String listId, String authToken, long storeId, String versionId, Long collectionId, Map<String, String> request, String locale) This method is used to create Properties based on given PropertiesRequest.org.springframework.http.ResponseEntity<com.skava.core.ResponseModel>
deleteProperties
(String listId, String propertyName, String authToken, long storeId, String versionId, Long collectionId, String locale) This method is used to create Properties based on given PropertiesRequest.org.springframework.http.ResponseEntity<ListResponse>
patchUpdateProperties
(String listId, String propertyName, String authToken, long storeId, String versionId, Long collectionId, String value, String locale) This method is used to patch update Properties based on given PropertiesRequest.org.springframework.http.ResponseEntity<ListResponse>
updateProperties
(String listId, String authToken, long storeId, String versionId, Long collectionId, Map<String, String> request, String locale) This method is used to update Properties based on given PropertiesRequest.
-
Constructor Details
-
ListPropertiesController
public ListPropertiesController()Instantiates a new list properties controller.
-
-
Method Details
-
createProperties
@PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'list\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'list\', #collectionId) or hasPrivilegeForServiceAndCollection( \'list/manage/list\',\'list\', #collectionId) or hasPrivilegeForServiceAndCollection( \'list/update/list\',\'list\', #collectionId)") @ResponseStatus(CREATED) @PostMapping("") @Audit public org.springframework.http.ResponseEntity<ListResponse> createProperties(@PathVariable(value="listId",required=true) String listId, @RequestHeader(value="x-auth-token",required=true) String authToken, @RequestHeader(value="x-store-id",required=false,defaultValue="0") long storeId, @RequestHeader(value="x-version-id",required=false) String versionId, @RequestHeader(value="x-collection-id",required=true) Long collectionId, @RequestBody(required=true) Map<String, String> request, @RequestParam(value="locale",required=false,defaultValue="en_US") String locale) This method is used to create Properties based on given PropertiesRequest.- Parameters:
listId
- the list idauthToken
- Holds a valid authorization token generated using the Authorization microservice for a user. The Auth Token (JWT format) represents claims containing the roles and privileges of the user accessing this API. The JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API, it has to be generated beforehand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in the HTML and HTTP environments while being more compact when compared to XML-based standards such as SAML. Thus, the generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
versionId
- Holds the value of an API version number. Using this parameter, you can access different versions of the API. The version format is major.minor.patch. For example, 8.0.0.collectionId
- Holds a valid collection identifier of this microservice. The requested operation will be performed on this collection identifier. A collection is the topmost entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with the configured properties. These properties can be modified to bring in a different behavior per collection of the same microservice. The Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way, the storefront can fetch/store the required information from that respective association.storeId
- Indicates the store id associated with the item.request
- It contains the attributes required for the creation of Properties.locale
- Indicates the locale in which the API response and the error messages will be responded. The locale should be mentioned in the Java standard locale format.- Returns:
- It returns the
PropertiesAPIResponse
.
-
deleteProperties
@PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'list\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'list\', #collectionId) or hasPrivilegeForServiceAndCollection( \'list/manage/list\',\'list\', #collectionId) or hasPrivilegeForServiceAndCollection( \'list/update/list\',\'list\', #collectionId)") @ResponseStatus(ACCEPTED) @DeleteMapping("/{propertyName}") @Audit public org.springframework.http.ResponseEntity<com.skava.core.ResponseModel> deleteProperties(@PathVariable(value="listId",required=true) String listId, @PathVariable(value="propertyName",required=true) String propertyName, @RequestHeader(value="x-auth-token",required=true) String authToken, @RequestHeader(value="x-store-id",required=false,defaultValue="0") long storeId, @RequestHeader(value="x-version-id",required=false) String versionId, @RequestHeader(value="x-collection-id",required=true) Long collectionId, @RequestParam(value="locale",required=false,defaultValue="en_US") String locale) This method is used to create Properties based on given PropertiesRequest.- Parameters:
listId
- the list idpropertyName
- the property nameauthToken
- Holds a valid authorization token generated using the Authorization microservice for a user. The Auth Token (JWT format) represents claims containing the roles and privileges of the user accessing this API. The JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API, it has to be generated beforehand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in the HTML and HTTP environments while being more compact when compared to XML-based standards such as SAML. Thus, the generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
versionId
- Holds the value of an API version number. Using this parameter, you can access different versions of the API. The version format is major.minor.patch. For example, 8.0.0.collectionId
- Holds a valid collection identifier of this microservice. The requested operation will be performed on this collection identifier. A collection is the topmost entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with the configured properties. These properties can be modified to bring in a different behavior per collection of the same microservice. The Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way, the storefront can fetch/store the required information from that respective association.storeId
- Indicates the store id associated with the item.locale
- Indicates the locale in which the API response and the error messages will be responded. The locale should be mentioned in the Java standard locale format.- Returns:
- It returns the
PropertiesAPIResponse
.
-
patchUpdateProperties
@PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'list\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'list\', #collectionId) or hasPrivilegeForServiceAndCollection( \'list/manage/list\',\'list\', #collectionId) or hasPrivilegeForServiceAndCollection( \'list/update/list\',\'list\', #collectionId)") @ResponseStatus(ACCEPTED) @PatchMapping("/{propertyName}") @Audit public org.springframework.http.ResponseEntity<ListResponse> patchUpdateProperties(@PathVariable(value="listId",required=true) String listId, @PathVariable(value="propertyName",required=true) String propertyName, @RequestHeader(value="x-auth-token",required=true) String authToken, @RequestHeader(value="x-store-id",required=false,defaultValue="0") long storeId, @RequestHeader(value="x-version-id",required=false) String versionId, @RequestHeader(value="x-collection-id",required=true) Long collectionId, @RequestBody(required=true) String value, @RequestParam(value="locale",required=false,defaultValue="en_US") String locale) This method is used to patch update Properties based on given PropertiesRequest.- Parameters:
listId
- the list idpropertyName
- the property nameauthToken
- Holds a valid authorization token generated using the Authorization microservice for a user. The Auth Token (JWT format) represents claims containing the roles and privileges of the user accessing this API. The JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API, it has to be generated beforehand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in the HTML and HTTP environments while being more compact when compared to XML-based standards such as SAML. Thus, the generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
versionId
- Holds the value of an API version number. Using this parameter, you can access different versions of the API. The version format is major.minor.patch. For example, 8.0.0.collectionId
- Holds a valid collection identifier of this microservice. The requested operation will be performed on this collection identifier. A collection is the topmost entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with the configured properties. These properties can be modified to bring in a different behavior per collection of the same microservice. The Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way, the storefront can fetch/store the required information from that respective association.storeId
- Indicates the store id associated with the item.value
- the property valuelocale
- Indicates the locale in which the API response and the error messages will be responded. The locale should be mentioned in the Java standard locale format.- Returns:
- It returns the
PropertiesAPIResponse
.
-
updateProperties
@PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'list\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'list\', #collectionId) or hasPrivilegeForServiceAndCollection( \'list/manage/list\',\'list\', #collectionId) or hasPrivilegeForServiceAndCollection( \'list/update/list\',\'list\', #collectionId)") @ResponseStatus(ACCEPTED) @PutMapping("") @Audit public org.springframework.http.ResponseEntity<ListResponse> updateProperties(@PathVariable(value="listId",required=true) String listId, @RequestHeader(value="x-auth-token",required=true) String authToken, @RequestHeader(value="x-store-id",required=false,defaultValue="0") long storeId, @RequestHeader(value="x-version-id",required=false) String versionId, @RequestHeader(value="x-collection-id",required=true) Long collectionId, @RequestBody(required=true) Map<String, String> request, @RequestParam(value="locale",required=false,defaultValue="en_US") String locale) This method is used to update Properties based on given PropertiesRequest.- Parameters:
listId
- the list idauthToken
- Holds a valid authorization token generated using the Authorization microservice for a user. The Auth Token (JWT format) represents claims containing the roles and privileges of the user accessing this API. The JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API, it has to be generated beforehand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in the HTML and HTTP environments while being more compact when compared to XML-based standards such as SAML. Thus, the generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
versionId
- Holds the value of an API version number. Using this parameter, you can access different versions of the API. The version format is major.minor.patch. For example, 8.0.0.collectionId
- Holds a valid collection identifier of this microservice. The requested operation will be performed on this collection identifier. A collection is the topmost entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with the configured properties. These properties can be modified to bring in a different behavior per collection of the same microservice. The Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way, the storefront can fetch/store the required information from that respective association.storeId
- Indicates the store id associated with the item.request
- the properties to be updatedlocale
- Indicates the locale in which the API response and the error messages will be responded. The locale should be mentioned in the Java standard locale format.- Returns:
- It returns the
PropertiesAPIResponse
.
-