How do I start Polarion xwiki velocity script development? - velocity

How do I start Polarion xwiki velocity script development? I am new to velocity scripts and Polarion.

You can check the Apache Velocity Engine documentation to learn about Velocity syntax: http://velocity.apache.org/engine/1.7/user-guide.html
Also, Polarion adds some custom object that can be used to interact with its API, you can see what is available by editing a wiki page, click the "Detailed Syntax Help" link on the right panel, and in the page that opens check the Polarion SDK section.
It is also useful to check the wiki pages in the demo projects to get a feel of how they works.

Related

Using Microsoft docs inside an ASP.Net Core website

Microsoft's modern documentation website is produced largely from Markdown files hosted in on GitHub. Typically the documentation shows a left pane navigation menu and a document navigation section on the right. Here is an example:
https://learn.microsoft.com/en-gb/dotnet/fsharp/what-is-fsharp
Microsoft also produces a set of tools to help documentation authors and associated extensions for VS Code.
Is it possible to use this to host Microsoft documentation inside your own website? If so, are there any examples of doing this in an ASP.Net Core website?
You might want to have a look at this blog post of one of the Microsoft employees working on Docs, describing on how to set up and use DocFX, which Microsoft Docs is based on.
Also, this GitHub issue gives a good summary of the current status. (All issues in the linked repository have been deleted.)
Aside from that, the links you mentioned correspond to this Visual Studio Code extension package, where you might be especially in Docs Preview.
It will help with writing and previewing Docs Markdown flavor syntax.
The repository links back to the packages GitHub page though, the source code for Docs Preview seems to be unavailable and also the license is not permissive at all, only granting Microsoft rights, but not granting you any in return. Even though you could look into the code of the downloaded extension manually, that would not grant you any permission to use any of the acquired code or knowledge in any commercial project.
I think you want to implement the functionality of displaying a text editor in which the user can enter Markdown text and want to show the preview of that markdown.
For this, you can use MarkDig or CommonMark package from Nuget

Is there any API to automate extension installation in XWiki?

I use xwiki Enterprise 7.4. The official way to install extensions is to use either Import feature or Extension Manager. Both ways require user interaction. I would like to automate extension installation process, so no user interactions for extension installation. Is it possible? I've automated spaces/pages creation via REST API. Maybe it's possible to use REST API to do it, I can't find it in documentation.
Why do I need it? It's simple: I've automated all the steps of deployment/migration process for my application and I would like to automate xwiki extension installation too.
As indicated by Vincent, you can use the extension script service from inside XWiki. This script service is what the UI is using so everything the UI is doing can be done also by any script (as long as the script author has proper rights).
I just wrote a Velocity example on http://extensions.xwiki.org/xwiki/bin/view/Extension/Extension+Script+Module#HNon-interactiveandsynchronousinstall:
{{velocity}}
## Create install request for extension with id org.xwiki.contrib:extension-tweak and version 1.3 on current wiki
#set($installRequest = $services.extension.createInstallRequest('org.xwiki.contrib:extension-tweak', '1.3', "wiki:${xcontext.database}"))
## Disable interactive mode
$installRequest.setInteractive(false)
## Start install
#set($installJob = $services.extension.install($installRequest))
## Wait until install is done
$installJob.join()
{{/velocity}}
All you need is to put the Thomas' script in a page. You can use the REST API for that. See: http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI#HPageresources
Then you call the URL from your application.
Ex: you put the code in XWiki/AutoInstall with a REST call and then you can call this page with the following url:
http://localhost:8080/xwiki/bin/get/XWiki/AutoInstall
I suggest to use the "get" action from the URL to avoid unnecessary informations.
The XWiki Core dev team is aware of this and it's in the roadmap but it's not done yet. For example you can see that it was planned for the 8.0 roadmap but it slipped (http://www.xwiki.org/xwiki/bin/view/Roadmaps/Archives8xCycle/).
Continue improving upgrade tools: Scriptable upgrades (priority 1), Simulation (priority 2)
It seems there's no issue created for this at the moment. Would be great if you could create a JIRA issue at http://xwiki.org in the XWiki Platform project.
Now regarding extensions, there's some Script Service that can be used to manipulate extensions, see http://extensions.xwiki.org/xwiki/bin/view/Extension/Extension+Script+Module
However this documentation is pretty terse. You could check the java code at https://github.com/xwiki/xwiki-platform/blob/95abd2951123431c1624c124b49ca7a88b41be00/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-script/src/main/java/org/xwiki/extension/script/ExtensionManagerScriptService.java#L84-L84
I've not personally used this script service so I can't give real examples of using this API

Apache Isis vs JSON Presentation

I am working on building a sample web application for proof of concept - with a link of some sort on an html page consuming a restful web service via a json object and displaying the data on the web page .
Something like the Apache Isis todo maintenance version with presentation of the json representation on a web page.
I have been trying to use the JQueryMobile example of the Apache Isis (http://danhaywood.com/2012/01/20/jquerymobile-on-apache-isis-rest-api/). But, I do not have the original source code (only the war file with some online demo jar files in the lib). I could decompile the online demo jar files, but its not straight forward setting up the project in eclipse for adapting to a real life project. I searched the Isis github repo and could not find the source , no archtype like the simple wicket etc. Please, could someone help, I really need a sample app or references, with source file and or any kind of guideline on how this works end to end.
FYI - We are not considering changing the choice of technology here, Its DDD using Apache Isis. Any help will be appreciated ... Since there are not too many online tutorials or sample app on this project. Thanks.
I think you posted a similar question on my youtube channel. Just to reiterate what I said there, you might want to check out the JQueryMobile viewer that was developed by one of our "google summer of code" students last year, namely https://github.com/bhargavgolla/isisJavaScript/tree/master/isisJavaScriptViewer.
In terms of ongoing help, your best bet is subscribing to the mailing list (blank email to users-subscribe#isis.apache.org, and reply to the confirmation) then send your questions via email to users#isis.apache.org
HTH
Dan

How do I use Struts-menu in Struts project?

I am using Struts for my college of engineering project. I am creating a main page. For that I want Struts-menu for creating a menu, but I didn't find any tutorial for the same. What site can be recommended or how can I otherwise do it?
See the User Guide
Run struts-menu-2.4.3.war in Tomcat and learn. (same with Struts-menu demo)

How to export wikis from FogBugz 6 to (almost) any other wiki (final destination: Confluence)?

We have a FogBugz 6 installation, with a good deal of wiki content in place. We're transitioning to use Atlassian products (JIRA and Confluence), so we'd like to get that wiki content into Confluence. How would you approach this?
Unfortunately, FogBugz doesn't appear to provide any kind of wiki export functionality, and Confluence doesn't provide any FogBugz wiki import.
FogBugz does have an API, but its a little light on the details w.r.t. accessing wiki content. We don't really care about past revisions of pages (just content, links, and images/attachments), so it's not clear that the API gets us any further than scraping the FB wikis with wget or something, and working with the HTML and images/attachments from there.
Confluence has a pretty full-featured content import utility that supports a number of source wikis:
TWiki
PmWiki
DokuWiki
Mediawiki
MoinMoin
Jotspot
Tikiwiki
Jspwiki
Sharepoint
SWiki
Vqwiki
XWiki
Trac
No FogBugz option there, but if we could export the FogBugz wiki content into one of the above wikis, then we could likely use the Confluence multi-wiki importer from there.
Alternatively, we could use wget to scrape the FogBugz wiki content, and then find a way to get static HTML + images + attachments into either Confluence or into one of the above other wikis as a stepping stone to Confluence.
Thoughts?
A colleague ended up figuring this one out, and the process ended up being generally-applicable to other web content we wanted to pull into Confluence as well. In broad strokes, the process involved:
Using wget to suck all of the content out of FogBugz (configured so that images and attachments were downloaded properly, and links to them and to other pages were properly relativized).
Using a simple XSLT transform to strip away the "template" content (e.g. logos, control/navigation links, etc) that surrounded the body of each page.
(optionally) Using a perl module to convert the resulting HTML fragments into Confluence's markup format
Using the Confluence command line interface to push up all of the page, image, and attachment data.
Note that I said "optionally" in #3 above. That is because the Confluence CLI has two relevant options: it can be used to create new pages directly, in which case it's expecting Confluence markup already, or it can be used to create new pages using HTML, which it converts to Confluence markup itself. In some cases, the Confluence CLI converted the HTML just fine; for other data sources, we needed to use the perl module.