Proposal to add a link to the documentation of the Execute SQL snippet

Hi! I would like to add a link to the section Using a Component to Connect to connect to Create a component using Groovy.

It is being not easy to me to connect all the pieces involved/available to access data in remote databases from XWiki.

Hi, If you want to add a link to components, I think it would make more sense to link to Creating XWiki Components (XWiki.org) or Component Module (XWiki.org)

And if you want to add a link to scripting in Groovy, then the link would be Scripting (XWiki.org)

Thanks, Vincent. All your proposals seem reasonable to me. But I would also add a link to Create a component using Groovy to the words separate Groovy page:

image

Don’t you think it can be useful to show with an example how to create components using XWiki pages and Groovy?

A separate groovy page is not a component :slight_smile: It’s just a scripting page, hence the proposed link to https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Scripting/ to understand how to write a groovy script in a wiki page.

I understand now. If you write a groovy snippet then you don’t need a component, but if you want one, then the recommendation is to use wiki components. Basically I don’t feel it’s a good idea to point to something that is not official. But YMMV and any link is good so feel free to do what you think is best! I guess you’re better to judge it than I am (as a user).

This is one of the dangers of wanting to become a wizard’s apprentice! :frowning: Thanks for your patience!

But, then, I don’t understand the sentence “You can hide some of the access details within a component, either of an external JAR or as a separate Groovy page”

All I’m trying to do so far is to hide the details of the connection to a remote database.

ok, then you can indeed hide it in a component. If you don’t want to write java then you can register a script service using a wiki component. See Wiki Component API (XWiki.org)

Actually you could also use Script Component (XWiki.org) (I’ve never used it myself). It requires to install an Extension though.

I would recommend that, yes (much easier and faster than wiki components).

I guess we could merge it to XWiki Standard but since it not really something we would use in XWiki Standard itself (we would always implement the component in Java in such a case IMO) it made sense to keep it as an extension.

+1

Good point! Thus, how could I separate official from non-official documents/statements

I tried! But I was not able to enter the editor! Perhaps I did something wrong. Should I be able to edit the documentation of a snippet with my user account @XWiki?

Done! Script Component test

@tmortagne My take: add a paragraph similar to this:

image

to the documentation of the Script Component extension. Just at the end of the Description

There are such examples in the linked script service reference documentation but yes it does not harm to complete the example, so I added a usage example matching the suggested script service.

Thanks, Thomas. Some simple examples close to the description will help ordinary users like me understand the power of many XWiki features better and be encouraged to go deeper into the documentation to solve more challenging objectives.

I am not sure yet why I regularly get confused by the structure of some documents. For instance, by putting the use cases within the Description? Won’t they deserve a heading at the same level of Description? Also, I would move Prerequisites and installation just after Description. First, the Description provides us with an explanation of the use of the extension, snippet or application. Then, we will check if our installation satisfies the prerequisites and, eventually, we will install it. Finally, we confirmed it’s working with a very simple use case. Later, more documentation will bring us into more complex applications and the whole universe of XWiki possibilities!

Just my two cents!

Confirm, please: Recommended Extensions + Sponsored Extensions = Official Extensions?

Thanks!

There’s no concept of official extensions :slight_smile:

The only concept that exists is Recommended extensions, with a definition here: https://extensions.xwiki.org/xwiki/bin/view/ExtensionCode/RecommendedExtensions/RecommendedDefinition/

Thanks

1 Like