How do you change the parameter description in StrongLoop? - api

Building our first API in StrongLoop. By default our id parameters all show up as "Model id" or "PersistedModel Id". (See example in screenshot)
I would like to replace these with something more meaningful to the API users, but can't figure out where this is done.
Thanks.

Since there is no elegant way to overwrite description of built-in API methods, I created a simple model mixin which can achieve your requirement.
Please follow the documentation to integrate the mixin into your project.
For custom API methods, please read remoteMethods. It's very easy to define your own description for them.

Related

Entering custom data into GraphiQL Docs

I would like to use GraphiQL docs to document my GraphQL API. The out-of-the-box version already looks pretty useful, however I would like to enrich it by the information about permissions.
My imagination is that in this
there will be another section, i.e. "Permissions", with some description of the permissions.
My question: is this the way to do it? If not, how can one express permissions in the GraphiQL Docs? And if this could be the way, is there any tool capable of doing this?
What's shown in GraphiQL (or similar tools like GraphQL Playground, Altair, etc.) is limited to what can be returned through introspection of the schema, which is limited by what the spec specifies. You can add descriptions to types, fields, arguments, enum values and directives. A description for the schema itself is in the works.
At best, you could add a description to your field specifying the permissions. You can use markdown if you want to jazz it up.

How can I add autocomplete "Candidate Users, Candidate Groups" for User Task?

i'm beginner in bpmn ,i created human task , how can add autocomplete in Candidate Users, Candidate Groups fileds it's possible? autocomplete from list ,active directory, ... .
The properties panel is just a minimal example and has no built in data binding.
However, it is itself highly flexible in what content is displayed and this is where you can start to develop your custom data provider.
There are not really tutorials out there on how to write a custom data provider for your properties panel but you can make use of the following example from the official examples repository:
bpmn-js-examples/properties-panel-extension/
It is quite complex and takes some time to understand just from the code and the spare documentation but let me tell you, that this is the place to look at if you want to write your custom data provider.
If you get stuck at a specific point, you can create a new question here on SO with a concrete code example.

Passing a variable from the store to my API

Each category page on the Bigcommerce store has a unique id: %%GLOBAL_CatId%%
I need to pass this variable, which I cannot possibly know before hand, to my API script. I'm using an include for my script so I've tried several variations of the following but I can't get anything to work:
%%Include.http://example.com/api.php?catid=%%GLOBAL_CatId%%%%
Is this possible and how can I accomplish this?
I was informed by API support that this is NOT possible.

create query using webservice api for Rally

I am trying to write a query in Ruby to insert a user story in Rally using WSAPI. I read through https://rally1.rallydev.com/slm/doc/webservice/.I looked it up and found that wsapi has a create() method, but I am not aware of its signature. I know it uses PUT/Post method for creation, but I just need an example to understand how to write create queries. Does anyone know of any useful resource to know more about this? I have all my code ready, just need information about writing "create" queries using Rally's WSAPI.
Thanks
There is a full directory of Ruby REST examples in the Github Repository for RallyRestToolkitForRuby:
https://github.com/RallyTools/RallyRestToolkitForRuby/tree/master/examples
This create example may be of particular interest. It's for a Defect, but the same logic would apply to Stories:
04-create-defect.rb

Pass product variables by user selection

I want to make a ticket sales site theme. As you might guess, most of ticket sales site using a flash based chair selection tool. Those systems using premade scenes which is audiences can select their chairs. I can make premade scenes with jQuery or flash but I don't know how can we handle this selection by Magento.
So, what I want to know that is it possible to pass a user specific variable in Magento? I mean, this variable should be available in checkout and backend as well. Could you please give me an advice to accomplish such an idea?
If this option can be selected from a fixed list of options, then what you want can be achieved using Configurable Products, or Custom Options.
If what you're looking for is a completely bespoke user-defined value, then this is pretty programming intensive, so if you're not a developer it's not an easy task.
Forgive the shameless self-link, but I've recently posted on this topic here:
http://mikebywaters.wordpress.com/2012/03/29/adding-custom-data-to-a-cart-item-in-magento/
In short, the post says that you can add an array of custom data to the quote when the item is added to the quote. For this, you’ll have to hijack the add-to-cart controller completely. To start with, take all the functionality from the existing controller. Look at the Mage_Sales_Model_Quote::addProduct() function and you’ll see that it takes two parameters like so:
$quote->addProduct($product, $request);
where $request is of type Varien_Object formatted like this:
$request = new Varien_Object(array(
'qty'=>$qty,
'options'=>$options,
'custom_options'=>$custom_options
));
Hope this helps.