Hello all,
what would be the best way to show pictures/thumbnails from an active directory in an xwiki site?
So far, we are using groovy to contact an active directoy, extract user info, like name, mail, phone etc and return xwiki 2.0 syntax, see code below
Now we would love to extend that contact list with photos stored in the active directory.
Would that be possible? If so, how?
Thanks in advance,
Florian
---
// KE1019746, März 13, fke
// list contact data
// to be included via includeInContext-Marco
//
// CAUTION: has to saved by user with programming rights
// import lib for ldap access
import org.apache.directory.groovyldap.*
// ldap connection
ldap = LDAP.newInstance('ldap://ad-server/', 'ldapbind', 'secret')
ldapsearchParams = new Search()
ldapsearchParams.base = 'OU=People,DC=domain,DC=de'
ldapsearchParams.scope = SearchScope.SUB
// for each letter in the alphabet
//for ( letter in (('A'..'Z') + ('0'..'9')) ) {
for ( letter in [ 'F' ] ) {
ldapsearchParams.filter = '(&(|(memberOf=CN=CN1-FIXME)(memberOf=CN=CN2-FIXME))(sn=' + letter.toLowerCase() + '*))'
// do the query
resultsUnsorted = ldap.search(ldapsearchParams)
// ldap output isn't sorted
// http://www.openldap.org/lists/openldap-software/200003/msg00058.html
// 'A robust client should not rely on servers maintaining any
// particular order over what are defined as unordered sequences.
//
// If your client wants to present the attributes and their values
// in some order, it should order them itself.'
//
// results is an array of hashed maps:
// groovy:000> println results.getClass()
// class java.util.ArrayList
// groovy:000> println results[3].getClass()
// class java.util.HashMap
//
// sort the array depending on the value of the field 'cn'
results = resultsUnsorted.sort { it.sn }
println results
// if results contains at least one cn, i.e. ldap search result isn't emtpy
if ( results.isEmpty() == false) {
println '' // xwiki markup stunt - new line necessary to not merge different letters to one xwiki table
println '==' + letter // xwiki markup - header
println '|=Name|=Funktion|=Tel|=Mobile|=Privat|=Fax'
for (entry in results) {
if ( ! ( entry.dn.toUpperCase() =~ 'DEAKTIVIERT' ) ) {
print '|'
if ( entry.sn ) {
print entry.sn
}
if ( entry.givenname ) {
print " "
print entry.givenname
}
print '|'
if ( entry.title ) {
print entry.title
}
print '|'
if ( entry.telephonenumber ) {
print entry.telephonenumber
}
print '|'
if ( entry.mobile ) {
print entry.mobile
}
print '|'
if ( entry.homephone ) {
print entry.homephone
}
print '|'
if ( entry.facsimiletelephonenumber ) {
print entry.facsimiletelephonenumber
}
print '|'
if ( entry.thumbnailphoto ) {
byte [] picture = entry.thumbnailphoto
//print entry.thumbnailphoto
print picture
}
println '' // xwiki markup to 'close' table
//} else {
// println 'No Match for ' + entry.dn.toUpperCase()
}
} // end for-token-loop
} // end results-isnt-Empty
} // end for-letter-in-alphabet-loop
Hello everyone,
I need to manipulate user and groups (create/delete) via the REST-API. Has anyone done this before? Maybe he/she is willing to share their scripts?
I appreciate any help. So if anyone can point me in the right direction this would be great.
I started here:
http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI#HXWikiRES…
But I always get the result:
The server has not found anything matching the request URI.
Thank you for your help,
Chris
Je serai absent(e) à partir du 22/12/2014 de retour le 29/12/2014.
je suis en congés.
Je répondrai à vos messages dès mon retour.
En cas de problème technique, veuillez contacter SYNOX au 05 67 34 66 56.
Merci
I was thinking basic current side AJAX, rather than doing something server side in Velocity. It's not my area, but I'm sure it's possible. The idea is just too get your browser to call the CGI script.
----- Reply message -----
From: "Jason Clemons" <jason.clemons(a)live.com>
To: "XWiki Users" <users(a)xwiki.org>
Subject: Re: [xwiki-users] Run external script to generate data for wiki page
Date: Fri, Dec 19, 2014 12:02
I have control over the script..so it can be in the CGI bin...would I then be able to invoke it through velocity?
> On Dec 18, 2014, at 6:01 PM, Bryn Jeffries <bryn.jeffries(a)sydney.edu.au> wrote:
>
> How "external" is the external script? Couldn't you wrap the script into a cgi script on the same server and invoke it from the client with an AJAX call?
> ________________________________________
> From: Jason Clemons [jason.clemons(a)live.com]
> Sent: 19 December 2014 10:00
> To: 'XWiki Users'
> Subject: Re: [xwiki-users] Run external script to generate data for wiki page
>
> Bump... :)
>
> Hello all,
>
> I'm wondering if anyone has done anything like this before so, I thought I'd
> ask it here. Essentially, what I want to do is have a page / form that my
> users fill out and then submit. Upon submit I need to invoke an external
> script (e.g..Perl, Python, VBScript, Batch etc...) that will do some quick
> data gathering then insert some data in a database. Once the script
> generates the data the page will then retrieve it and render some results
> based on it. Most of the mechanics I can figure out I think, but I wanted
> to get some tips on the best way to actually invoke the script from a page
> in Xwiki.
> Any ideas or suggestions are appreciated...
> _______________________________________________
> users mailing list
> users(a)xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>
> _______________________________________________
> users mailing list
> users(a)xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
I have managed the following with an external PostgreSQL server:
Retrieve and display queried data in a page with Groovy;
Write a Java component to perform query, call and display with Groovy or Velocity;
Generate JSON data of query results with Groovy, call and display from LiveTable.
Happy to share but not near my computer till later today, so let me know which of the above is closest to what you want to do and I'll post something when I can.
----- Reply message -----
From: "Jason Clemons" <jason.clemons(a)live.com>
To: "Xwiki Users" <users(a)xwiki.org>
Cc: "Clemons Jason" <jason.m.clemons(a)aexp.com>
Subject: [xwiki-users] Query external MSSQL DB in a wiki page
Date: Tue, Dec 9, 2014 08:26
Hello,
Can anyone point me in the right direction? I'm trying to query and external Microsoft SQL database from a wiki page. My current wiki runs on MSSQL just fine using sqljdbc4.jar configured with hibernate. The DB I want to query is actually on the same server, I can actually make it appear in the same DB if that makes things easier.
I've looked at SQL Tools extension --> http://extensions.xwiki.org/xwiki/bin/view/Extension/SQL+Tools and I can get that to work just fine even querying the other database, but I don't know how to make the results of a query from that tool appear in a separate page I've created for use in Velocity for example.
I've tried to get the example on the "Execute SQL" page here --> http://extensions.xwiki.org/xwiki/bin/view/Extension/Execute+SQL to work but I get a Groovy error on the second snippet and nothing at all appears on the page using the first snippet (but no error).
I've also looked at this plugin --> http://xwikisql.gradsoft.ua/docs/XWikiSqlPluginGuide.html but it hasn't been updated since 2008, so I'm not really sure that's a good idea from a sustainability perspective in a production environment.
Ultimately, I will have a flat table in some database, really any database (e.g..it can be the XWIKI DB)..and I need to be able to get the rows and columns from the table and expose them as an HTML table in my wiki page. Once I figure out how to get the data making it into a table is easy enough, but I can't even figure out how to get an object or array with the data in it to iterate.
All help is greatly appreciated.
Thanks in advance,
Jason
> Hello all,
>
> I'm wondering if anyone has done anything like this before so, I thought I'd ask it here. Essentially, what I want to do is have a page / form that my users fill out and then submit. Upon submit I need to invoke an external script (e.g..Perl, Python, VBScript, Batch etc...) that will do some quick data gathering then insert some data in a database. Once the script generates the data the page will then retrieve it and render some results based on it. Most of the mechanics I can figure out I think, but I wanted to get some tips on the best way to actually invoke the script from a page in Xwiki.
>
> Any ideas or suggestions are appreciated...
The XWiki development team is proud to announce the availability of XWiki
6.4 Milestone 2.
This version brings mainly UI improvements in the Menu application, Mail
application and Flamingo skin, while offering developers the ability to
write LESS in Skin Extensions, a cool icon picker and new ConfigurableClass
and Mail Sender API features.
You can download it here: http://www.xwiki.org/xwiki/bin/view/Main/Download
Make sure to review the release notes:
http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki64M2
Thanks
-The XWiki dev team
Hi Xwiki Members,
We're working on a brand new instance of our intranet using XE6.3.
Despite the very nice new features, one of them - maybe the most
important for our use case - is not working: the Menu Application. It
was the first and only extension I've installed since now on a fresh new
standard 6.3 using flamingo skin, following the instructions on the menu
application page -
http://extensions.xwiki.org/xwiki/bin/view/Extension/Menu+Application
<http://extensions.xwiki.org/xwiki/bin/view/Extension/Menu+Application>.
I have only the Admin user so far. I've created the same sample menu
using the app documentation, set to display after the page header,
selected current wiki (tested all the options by the way) and nothing
happened. The XWikiAdminGroup has programming rights selected. I've
simply changed to colibri skin in WebPrefs look and feel section and
also not worked.
Am I losing any config/setup step? How can I check what's happening?
I've not tested 6.4M2 yet, once it brings improvements on look and feel
to Menu Application. I would like to learn and get the Menu working on
6.3 first.
Could you help me?
Best Regards,
--
Ramon Gomes Brandão
**
**
*RAMON BRANDÃO*