How can I create a services in Capella and call it in my M2DOC Word document? - eclipse

How can I create a services in Capella and call it in my M2DOC Word document?
I want, for example, create a services for print a functional tree, and use this code in many different documents without re-write every time the code.
Thank you a lot.
Stefania

It seems this section of the documentation explains what you want to do: https://www.m2doc.org/ref-doc/nightly/index.html#providing-new-services

Related

Protractor Implementation in Angular2 without using ids

I have application in Angularjs2, and developers have not been using ids into it. Now I have to implement the Protractor on same application. Is there anyway to implement the Protractor without using "absolute XPath"?
Thanks in advance!
Please find a huge range of locator-possibilities on the official Protractortest API Page
Every element on a page needs to be uniquely identifiable... else the page wouldn't work, no matter which technology. Therefore with the help of any of the above provided locator-possibilities you'll always find the element you're looking for.
And there is never a need for XPath, except for this only one. (though there is an parentElementArrayFinder introduced in the meantime, so not even that one exception is valid anymore)
UDPATE
If you could use XPath, you can for sure use CSS-Locators.
Here some examples for locators:
$('div.class#id[anyAttribute="anyValue"] div.child.somewhere-below-div-point-class')
element(by.cssContainingText('div[data-index="2"]', 'select this option'))
Or as a specific example the "Learn More" of the "Tree List" section of https://js.devexpress.com/ :
treeListSection = element(by.cssContainingText('div.tab-content h2', 'Tree List')).getDriver();
learnMoreBtn = treeListSection.element(by.cssContainingText('a.tab-button','Learn More'));
learnMoreBtn.click();
Those are just examples, but there is always a way to do it.
If you provide some example-HTML in your Question, I can direct you towards a solution.
UPDATE 2
For getting the Parent Web Element, one could use getDriver() as well

Can I return the tag and routine name?

I am working on a code "maintenance" idea where I would like to populate a global when routines are accessed and by who. I can pull the current routine name using $t(+0) or $ZNAME, but what about the current tag and/or line offset? Is there a way so I can put a standard line in the routines I want to track?
Rob, you can get these information from $STACK.
If you call your own tracking function, you get the calling stack info like this:
W $STACK($STACK(-1)-1,"PLACE")
zExecute+2^%Studio.General.1 +1
Take a look at the Caché ObjectScript Reference for $STACK for detailed description and examples.
Rob!
Maybe you just turn on Audit? It gathers logs for different users activities in InterSystems Caché database. See the documentation on Caché Audit.
Also, see this solution which will help you to examine analytics in DeepSee regarding Audit entries.
You can find the routine that's calling your label, by the following ClassMethod.
write ##class(%SYSTEM.Process).CallingRoutine()
As well as the database which is calling your label.
write ##class(%SYSTEM.Process).CallingDatabase()

Custom Search Results in REST MarkLogic

So new to MarkLogic am stuck and not finding the documentation of use. I know what i need to do, just do not know how to do it.
I have a keyvalue? search on my REST server which returns ML's standard search results and XML snippet. I want to create my own custom search result which will output a title element for my XML files.
I am aware that i need to create an XSLT transformation document and upload that to the server but do not know how to target ML's search function or how to write this out.
I have basic knowledge of XSLT, if i just created something that targets each files title using xPath will this work, or does ML require use of their custom functions?
I know its a bit broad, but hopefully someone can point steer me.
Sounds like you are talking about the GET /v1/keyvalue endpoint of MarkLogic REST API. Unfortunately that does not allow you to choose a transform. You can probably use GET /v1/search with a transform param instead though, using a structured query for an element value query. The docs contain a good syntax reference on that.
Docs on creating and managing transforms can be found here:
http://docs.marklogic.com/guide/rest-dev/transforms#chapter
HTH!
You can use extract-metadata in your search options with search:search or the /v1/search/ REST API endpoint to include the title element in a metadata element or JSON property in your results:
import module namespace search = "http://marklogic.com/appservices/search"
at "/MarkLogic/appservices/search/search.xqy";
search:search(
"my query string",
<options xmlns="http://marklogic.com/appservices/search">
<extract-metadata>
<qname elem-ns="" elem-name="title"/>
</extract-metadata>
</options>)
If you need more flexibility, you specify a custom snippet implementation or a results decorator function in your search options.
Is this key-value or full text? For key-value you could use XPath. Any XPath that starts with / or // or fn:collection() or fn:doc() will search the entire database. You can search specific document(s) or collection(s) too.
For full text you'd probably want to use https://docs.marklogic.com/search:search - or possibly https://docs.marklogic.com/cts:search for really low-level control.
There's some example code using search:search from XSL at https://github.com/marklogic/RunDMC which might help. It doesn't use the REST API: it's a traditional form-submit web page. But the view/search.xsl code might give you some idea how to call the search API from XSLT.
That RunDMC code might also help you if you need to call XSL from XQuery: take a look at controller/transform.xqy.

RESTful urls for restore operation from a trash bin

I've been implementing a RESTful web service which has these operations:
List articles:
GET /articles
Delete articles (which should remove only selected articles to a trash bin):
DELETE /articles
List articles in the trash bin:
GET /trash/articles
I have to implement an operation for restoring "articles" from "/trash/articles" back to "/articles".
And here is the question. Ho do you usually do it? What url do I have to use?
I came up to the 2 ways of doing it. The first is:
DELETE /trash/articles
But it feels strange and a user can read it like "delete it permanently, don't restore".
And the second way is
PUT /trash/articles
Which is more odd and a user will be confused what this operation does.
I'm new to REST, so please advice how you do it normally. I tried to search in google but I don't know how to ask it right, so I didn't get something useful.
Another option could be to use "query params" to define a "complementary action/verb" to cover this "special condition" you have (given that this is not very easily covered by the HTTP verbs). This then could be done for example by:
PUT /trash/articles?restore=true
This would make the URI path still complaint with REST guideline (referring to a resource, and not encoding "actions" - like "restore") and would shift the "extra semantics" of what you want to do (which is a very special situation) to the "query parameter". "Query params" are very commonly used for "filtering" resources in REST, not so much for this kind of situation... but maybe this is a reasonable assumption given your requirements.
I would recommend using
PUT /restore/articles
or
PUT /restore/trash/articles
Late answer but, in my opinion, the best way is to change the resource itself.
For instance:
<article is_in_trash="true">
<title>come title</title>
<body>the article body</body>
<date>1990-01-01</date>
</article>
So, in order to remove the article from Trash, you would simple use PUT an updated version of the article, where is_in_trash="false".

Updating value on a xml located on the web

I have a file on the web, that looks like this. I would like to update the value a 1 tag
Let's say "tempset" and change 150 for another number. How can i do this? NSURLConnection? NSMutableURLRequest? NSURLRequest? If possible keep it to iOs 4! Thanks!
<Courbe>
<age>45</age>
<tempdesi>150</tempdesi>
<vmininit>35</vmininit>
<tempinit>220</tempinit>
<unittemp>0</unittemp><te_fin_c>220,700,700,700,700,700,700,700,700,700</te_fin_c> <vm_fin_c>50,50,50,50,50,50,50,50,50,50</vm_fin_c>
<grfan_a>1,1,1,1,1,1,1,1,1,1</grfan_a>
<ecarnuit>0</ecarnuit>
<tempset>150</tempset>
<tempsetp>700</tempsetp>
<jo_cou_t>1</jo_cou_t>
<ty_stcha>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</ty_stcha>
</Courbe>
You have several options:
create a "service" for this , a kind of API so you can call this service from your client in different languages include ObjectiveC
like http://myserver.com/myobject/set?tempset=1
(in real world, use post and not get for this)
of course, to do this you need to write some server part in your favorite language
provide a way to upload the file and replace it completely, a kind of "upload.php"
Which solution is the best depends on your problem: how this file is generated and maintened