How to provide child class of document in OASIS API for Filenet - document

We are trying to use OASIS API to create a document in Filenet through Atom. We tried different syntax but not working. If it's just cmis:document it's working but if we change that with any leaf class of document it's not supporting. Does anyone worked with OASIS API to interact with FIleNet for a custom class?

After going through the IBM website found answer. We were confused by following similar syntax "cmis:document". We were passing as "cmis:leafclass". But eventually came to know if you are passing leaf class no need of cmis: present. You just need to pass "leafclass". Below link for reference.
https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014928326

Related

What is the difference between StripeAPI.defaultPublishableKey and STPAPIClient.shared.publishableKey?

I know this might seem like a simple question but I haven't found any answers in the documentation. Can someone please explain the difference between StripeAPI.defaultPublishableKey and STPAPIClient.shared.publishableKey. When are they used and for what specifically?
I'm new to coding so any help is appreciated! :)
StripeAPI is the top-level class that imports the rest of the Stripe iOS SDK. The documentation explains the defaultPublishableKey property on StripeAPI:
Set this to your Stripe publishable API key, obtained from https://dashboard.stripe.com/apikeys. Set this as early as possible in your application’s lifecycle, preferably in your AppDelegate or SceneDelegate. New instances of STPAPIClient will be initialized with this value. #warning Make sure not to ship your test API keys to the App Store! This will log a warning if you use your test key in a release build.
STPAPIClient, on the other hand, is the class/singleton you use to make Stripe API requests. The shared property on this class is the singleton, and the publishableKey property on that singleton defaults to the value of StripeAPI.defaultPublishableKey. You can, however, change it if you need to make a request with a different key, although doing so would be an uncommon edge case.
You can read more about STPAPIClient, including the properties mentioned above in Stripe's documentation.

Customize Controller from commercewebservices in SAP Commerce Cloud

From what I understand, from SAP Commerce Cloud 2005 onward the way to customize the REST-endpoints within SAP Commerce Cloud for Spartacus is to use commercewebservices (non-template) and then add own occ-extensions with your REST-endpoints.
That works fine for new endpoints, but what if I want to customize an existing controller from within commercewebservices? Since I am not using the template anymore commercewebservices cannot be modified anymore. I don't see a way how I could for example customize de.hybris.platform.commercewebservices.core.v2.controller.CartsController.
Swapping out commercewebservices with your own extension generated from the template does not work since multiple OOTB (e.g. cmsocc) extensions depend on commercewebservices hence it will always be loaded and clash with our own extension derived from commercewebservices.
Customizing commercewebservices with an addOn also does not solve the problem since, as I understand, it is not possible to add your own controller and bind it to the a url-pattern already used from a controller within commercewebservices
If you want to override an existing API endpoint (CartsController in our case), you can do so with the #RequestMappingOverride annotation.
Using this annotation, you can "shadow" the existing request mapping of the out-of-the-box controller with your custom controller in your own OCC extension.
You can find more details and an example here:
Overriding the REST API [help.sap.com]
EDIT
And let's not forget:
All of the action happens in the facades anyway, and you can also extend the API responses without overriding the Controller using the WsDTO concept plus additional converters. (see Extending Data Objects[help.sap.com] for more details)
Thanks for the response.
The annotation RequestMappingOverride works fine. There is one problem with this approach, lets assume I do following:
Introduce an new called MyController extending the CartsController
Override a single method and annotated this method with RequestMappingOverride
Starting up the system I do get now ambiguous mappings on all mappings of CartsController which I did not override
The reason is, I have now two Controllers registered with the same mappings. The CartsController and MyController which inherits all the methods which are not overriden from CartsController. The only solution I found is to override every single method of the CartsController, annotate all methods with RequestMappingOverride and then just do a super call. That is a bit clumsy and leads to a lot of boilerplate code. I wish the annoation RequestMappingOverride would work on class-level rather than only on method level

Which function in "nestjs/swagger" converts DTOs to Swagger model definitions?

I have DTOs specified with Class-Validator and I am looking for a library that can be used to generate Swagger specification from it. I am not using it for a REST API, the code is addressing an IoT/MQTT scenario - I simply use Class-Validator to manage JSON.
NestJS/Swagger is the best maintained library. I would like to use it's capability to produce Swagger definitions without a NestJS Server. Ideally I would like to pass in a DTO definition and get it's Swagger schema.
I have been reading the source, but am struggling to understand which function in the framework actually does that. At best, I have been able to track it down to modelsDefinitions property in swagger-explorer class.
As best I can tell, from there, api-parameters.explorer and api-produces.explorer. The way they work is not clear to me. I was wondering of someone might help me out?
I'd like to add that I am aware of class-validator-jsonschema, but it is not maintained and no longer seems to work properly.
nestjs/swagger does not expose what you need as its public API which you cannot access it. The class you're looking for is SchemaObjectFactory and the method is exploreModelSchema.
Reference:
SwaggerObjectFactory
Test

How to retrieve post data, validate it in controller and save it in database using GORM in Micronaut?

I come from Grails background and have recently started a project in Micronaut using GORM.
I tried to find required information in documentation but its not clear how we retrieve post data in controller, validate it similar to Command Objects offered in Grails and save it into database using interface service provided in documentation
PS : I know I can map every field to action argument in controller, and also declare a interface method specifying each argument as property but that does not seems right thing to do as my domain class has so many properties.
Making the action #Transactional or any method would work for saving data as far as I know but I want to know the proper way in Micronaut.
My requirement is simple, save post data in database using GORM in Micronaut.
If I were you I would look back at the documentation, sections 6.4 to 6.11:
https://docs.micronaut.io/snapshot/guide/index.html#binding
https://docs.micronaut.io/snapshot/guide/index.html#datavalidation
http://hibernate.org/validator/
Micronaut is very annotation based, unlike Grails which uses convention over configuration. However in Grails 4, Micronaut will toke over the application context, giving you some of the benefits of Micronaut, but still maintaining the convention over configuration.

Using Rally's REST API to retrieve User Stories for a project

I am tyring to retrieve the details of all User Stories for a specific project. I am using the REST URL:
https://rally1.rallydev.com/slm/webservice/1.34/hierarchicalrequirement?project={Rally_REST_URL_for_the_project}&fetch=true
I am using JAXB to unmarshal the XML response. However, the result consists of objects of type DomainObjectType and hence I cannot cast them into HierarchicalRequirementType - in fact the data pertaining to User Stories are not retrievable.
Is there any other way of doing this? I got the XML Schema from the Rally Help pages, and I do not see any way to do it other than make N+1 requests - which I would like to avoid.
Any help will be appreciated.
kind of roundabout answer - we have a beta/labs Java REST toolkit you could try here: http://developer.rallydev.com/help/java-toolkit-rally-rest-api
That might be worth a try to help move some of that along.
I have contacted Rally support for a validation of their XML Schema. Will post again once they get back to me.
--A few days later--
Thanks to everyone for their efforts.
Apparently, the XML Schema is meant for SOAP and not REST, although it can be used for REST too in some cases.
I have to modify Schema for my requirement - something I am working on now.

Resources