[xwiki-users] C++ bindings
This is sort of a random shot, just hoping someone has implemented something similar before. There is a C++ API used to securely connect to and query a database. The database is maintained by IT, so I need to go through this API rather than directly accessing the database (in which case I would use JDBC with groovy). I was wondering if there is a way to write groovy bindings for C++ functions. I know this can be done with Java for C++ (JNI/Jace/etc), but does anyone have any experience doing such a thing with groovy or in a wiki context? Thanks, -Mike _ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2 ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Creating class properties with groovy
Similar question has appeared in this list earlier with no good answer. Though I suspect, this approach seems necessary is due to weak design. Can you describe use case why it seems necessary in place of database list, where you can set hql query for filtering necessary elements? Valdis Essentially I'm creating a sort of template for a space that I will want to duplicate later. I have scripts that create objects from a spreadsheet specifically for a certain class in this space. Rather than duplicating the class by hand on the next space I want these scripts/objects on, I'd like to be able to quickly and safely duplicate the class, so I wanted to write a quick groovy script to do it. If there is an easier way of doing this, I'd appreciate any ideas. -Mike I want to create properties for a new class on a blank document with groovy. I can do the following: def doc = xwiki.getDocument(space.docname) c = doc.getxWikiClass(); and look at elements of a class that already exists by doing: prop = c.get('propertyname') propToEdit = prop.getPropertyClass propToEdit.setValues('a|b|c') But, how can I add a new property to a class that has no existing properties/fields? Thanks, -Mike _ The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multiaccountocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4 ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] Creating class properties with groovy
I want to create properties for a new class on a blank document with groovy. I can do the following: def doc = xwiki.getDocument(space.docname) c = doc.getxWikiClass(); and look at elements of a class that already exists by doing: prop = c.get('propertyname') propToEdit = prop.getPropertyClass propToEdit.setValues('a|b|c') But, how can I add a new property to a class that has no existing properties/fields? Thanks, -Mike _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3 ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] users Digest, Vol 32, Issue 67
I want to parse XML attachments to a page and display the data in a table or list on the page. Does this functionality exist? Just checking before I write my own code. So you have attachments which are XML files and you want to parse them and display their content in a wiki table ? If so, I'd suggest you use the {{groovy}} macro and use the groovy xml slurper to do the work. You should be able to write this in less than 10 lines :) http://groovy.codehaus.org/Reading+XML+using+Groovy%27s+XmlSlurper Thanks -Vincent Thanks, got that up and running in only a few minutes! Now I'd like a way to have the user click on one level of the xml hierarchy I display and have it expand to show the children of that section (I have the hierarchy iteration code, just not the gui code). Something graphically like a macro error (the one that says Failed to execute macro: groovy) and then you click to expand and view the content. http://code.xwiki.org/xwiki/bin/view/Snippets/ShowHideDIVSnippet Guillaume Ok, I have that code working (ShowHidDIV) in a velocity macro with {{html}} tags around the div. Unfortunately, when I pass the xmlslurper object to a velocity macro, I can no longer access fields of the object, it looks like it's all being converted to a big string. My code: {{groovy}} xmlFile = new String(doc.getAttachment(file.xml).content) def slurp = new XmlSlurper().parseText(xmlFile) def allReg = slurp.Register xcontext.put(allReg,allReg) {{/groovy}} {{velocity}} #set($allReg=$xcontext.get(allReg)) {{html}} div onclick=toggleClass($('REG'), 'hidden') Show/Hide /div div id=REG class=hidden $allReg.field /div {{/html}} {{/velocity}} But like I said, I can't access the fields of allReg in the velocity script: $allReg.field just returns the whole string from the slurper. So I need a way to either embed html in the groovy code with access to the groovy variables, or a way to correctly pass a slurper object using xcontext. Thanks, -Mike _ Hotmail: Trusted email with powerful SPAM protection. http://clk.atdmt.com/GBL/go/210850553/direct/01/ ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] XML parser for displaying on pages
I want to parse XML attachments to a page and display the data in a table or list on the page. Does this functionality exist? Just checking before I write my own code. _ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_2 ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] Is WYSIWYG editor available for TextArea?
Hello, we'd like to use the bulletinboard application (http://code.xwiki.org/xwiki/bin/view/Applications/BulletinBoardApplication), but we want to allow WYSIWYG editing of a post so links and perhaps photos can be embedded. Right now, the class for each post only has a author, date, and the text is a TextArea. So, I guess I have two questions: 1) Is there a handle for the WYSIWIG editor to be embedded in a page? 2) Can it be used on a TextArea or does it have to be used on a document? It looks to me like we might have to make every post it's own document to get WYSIWIG, but wanted to check first. Current code that is displaying the text input box: span class=bbsmalltitle a name=postmessage href=#postmessage $msg.bb_postmessage /a /span form method=post action=$doc.getURL(objectadd) class=postreply input type=hidden name=xredirect value=$doc.getURL()#$lastpostid / input type=hidden name=classname value=BBCode.PostClass / input type=hidden name=BBCode.PostClass_postauthor value=$context.user / textarea rows=10 cols=65 id=BBCode.PostClass_postcontent name=BBCode.PostClass_postcontent //textareabr / input id=BBCode.PostClass_postbutton type=submit value=Post! / /form Thanks, -Mike _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_3 ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] XMLRPC and sql 2005 questions
1) Is there a way to search/create objects using XMLRPC? I can get and update pages and attachments, but I want to be able to create or query objects of classes that I have created. I'm using perl if anyone has code samples. I saw there is a search function on the confluence API but I couldn't get the syntax correct and it wasn't clear if it can access objects: http://confluence.atlassian.com/display/CONFDEV/Remote+API+Specification#RemoteAPISpecification-Search 2) Is there a way to remotely access a sql 2005 database from an xwiki script? A groovy wrapper for java jdbc or something. I want to query the database and put the results in a livetable, but the db lives on a completely separate server. Thanks! -Mike _ Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. http://clk.atdmt.com/GBL/go/201469229/direct/01/ ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users