IRC Archive for channel #xwiki on 16 June 2014

Last modified by Vincent Massol on 2014/06/16 23:49

<lucaa> has quit
03:36 <abusenius> has quit
07:47 <vmassol> has joined #xwiki
07:51 <Inge-> has joined #xwiki
08:03 <msmeria> has joined #xwiki
08:17 <vierfzweievieraz> has joined #xwiki
08:17 <vierfzweievieraz> has left #xwiki
08:25 <evalica> has joined #xwiki
08:47 <vfzevaze> has joined #xwiki
08:48 <Denis> has joined #xwiki
08:49 <cjd> has joined #xwiki
08:52 <vfzevaze> has left #xwiki
09:09 <tmortagne> has joined #xwiki
09:13 <woshilapin> has joined #xwiki
09:42 <Lyes> has joined #xwiki
09:51 <lucaa> has joined #xwiki
09:57 <mflorea> has joined #xwiki
10:08 <gdelhumeau> has joined #xwiki
10:23 <ClemensR> has joined #xwiki
10:23 <vmassol> guys, we need to decide if we want only admins to be able to send mails (see when using the new mail scripting api, any idea?
10:26 <cjd> happy releaseday :)
10:27 <ClemensR> mails send via "share page"  and "invitations" are send by normal users via Programming rights ?
10:28 <vmassol> ClemensR: good question
10:28 <tmortagne> vmassol: we could have a send mail right like we introduced create wiki right
10:28 <cjd> Invitations might as well be PR because it needs PR to let someone into a closed wiki
10:29 <vmassol> ClemensR: what we need to fix is in the context of a public farm like
10:29 <vmassol> public open farm
10:29 <vmassol> where everyone can register
10:29 <vmassol> and thus spam the entire planet
10:29 <vmassol> tmortagne: indeed but we would need a UI
10:29 <vmassol> our UI is not generic ATM
10:29 <vmassol> (rights UIĀ°
10:29 <vmassol> )
10:30 <ClemensR> yes, I tentatively agree with the "admins only", just trying to find use cases that would break if only admins can send mail
10:30 <vmassol> still I guess even without UI at least we can document how to do it using XObjects in the meantime
10:30 <tmortagne> vmassol: we can start by introducing a send mail right which inherit admin right and base the code on send mail right so that it's ready when improving the UI
10:30 <tmortagne> yes
10:31 <vmassol> the question is more: do we need a finer grained right than what we have now
10:31 <vmassol> i.e. admin right for ex
10:31 <vmassol> this won't solve the send page by mail potential issue
10:32 <tmortagne> it depends on the use case IMO and that's why we need a special right I think
10:32 <vmassol> well we need to decide who we want to be able to do that
10:32 <vmassol> ideally everyone
10:32 <vmassol> I guess
10:32 <vmassol> actually that's a nice spam system :)
10:33 <vmassol> you create a new page with some page
10:33 <vmassol> and then you email it with the send page by email feature to lots of people
10:33 <vmassol> ;)
10:33 <vmassol> s/some page/some spam
10:34 <cjd> there are zillions of websites which let you do that
10:34 <vmassol> does "share by email" support specifying several emails?
10:35 <vmassol> (it doesn't mention it in the UI)
10:35 <vmassol> it just says "XWiki user or email address"
10:35 <evalica> has quit
10:35 <vmassol> answer: yes
10:35 <vmassol> it supports more than 1 recipient
10:36 <evalica> has joined #xwiki
10:36 <evalica> has quit
10:36 <vmassol> cjd: you're saying this is a false problem and it's ok?
10:36 <cjd> nah, we should consider spam but we should not call it critical
10:36 <cjd> bb in a few
10:38 <vmassol> hmmm
10:38 <vmassol> either gdelhumeau didn't do it right or we cannot contribute a new right cleanly
10:38 <vmassol> I see the create wiki right is in the security module itself
10:38 <vmassol> in the Right class itself
10:39 <vmassol> Denis: ?
10:43 <tmortagne> vmassol: it was probably seen as standard enough to be put directly in security module
10:43 <tmortagne> but AFAIK it's very easy to add a right
10:43 <vmassol> Lyes: good morning, you're working on the template support for the new mail module today right? any ETA?
10:44 <vmassol> tmortagne: nothing is standard, multiwiki support is supposed to be all in the platform-wiki modules
10:44 <vmassol> (ideally)
10:44 <Slashman> has joined #xwiki
10:44 <vmassol> but ok if it's easy good
10:44 <vmassol> I can try it
10:44 <tmortagne> vmassol: concept of multiwiki is everywhere, you have it in the modle module etc
10:44 <vmassol> yes but we're moving everything in the platform-wiki module
10:45 <tmortagne> it's not something the platform-wiki module can do alone
10:45 <tmortagne> no we are not
10:45 <vmassol> we moved quite a lot already to there
10:45 <tmortagne> we are not going to move WikiReference in there for example
10:45 <Lyes> @Vincent : Good morning I'm on customer project for the morning
10:46 <vmassol> tmortagne: that's an interesting discussion, to decide what the boundaries are
10:46 <tmortagne> anyway adding a new right is just calling AuthorizationManager#register AFAIK
10:46 <Denis> vmassol: right can be registered anytime and multiple times, however we have an known issue with implied right
10:47 <Denis> the way those are current setup should be reversed
10:47 <tmortagne> Denis: +1
10:47 <vmassol> Denis: can I contribute a new right in another module?
10:47 <Denis> yes, unless you that right to be implied by a right not in that module
10:47 <vmassol> ok good I dont think that's my case here
10:47 <Denis> s/you/you need
10:48 <vmassol> it's the other way around AFAIU
10:48 <tmortagne> Denis: in the meantime from what I seen in the code you can override a standard right using register too
10:48 <Denis> vmassol: no so sure
10:48 <Denis> tmortagne: I think so, but I have never check it
10:48 <tmortagne> vmassol: if you want that Admin imply SendMail then you can't officially since that's Admin who indicate that right now
10:49 <vmassol> what I'd ike is Admin Right implies sendMail right
10:49 <vmassol> ok
10:49 <vmassol> I see
10:49 <Denis> you cannot currently
10:49 <vmassol> too bad
10:49 <tmortagne> it should be done the other way since it does not make much sense
10:49 <Denis> I know
10:49 <tmortagne> but you can re-register admin right
10:49 <tmortagne> (even if not very clean on the long run)
10:49 <Denis> it should be change, and it will be an API breakage, for sure
10:50 <vmassol> either brekage or create a new Right class
10:50 <tmortagne> Denis: could be a new interface that extends RightDescription
10:50 <vmassol> (and support both)
10:50 <tmortagne> that would not break anything
10:50 <tmortagne> then Right implement the new interface
10:51 <tmortagne> adding a new method in Right does not break anything since it's a class and not an interface
10:51 <Denis> tmortagne: you should be careful while redefining however, since this redefinition feature is there mainly to avoid issue when you install/uninstall/reinstall an extension
10:51 <tmortagne> Denis: as I said it's not clean and it's only in the meantime
10:52 <Denis> I have look at it carefully enough to confirm the breakage or not
10:53 <Denis> s/I have/I have not
10:53 <tmortagne> from API point of view it's ok at least, then in the implementation of course it was be a bit more complex but it could probably be done since it's hidden
10:53 <Denis> What I know is that the ability to redefine a right was not their to change its definition
10:54 <tmortagne> we should not try to redefine a standard right anyway, even if it works
10:54 <tmortagne> it's like overwriting a template, it's a pain for upgrades and it can create a real mess when it's done by an extension
10:55 <vmassol> Lyes: ok I'll start it then
10:56 <vmassol> Lyes: do you already have code for the template feature?
10:59 <Lyes> yes i start coding it
11:00 <vmassol> Lyes: best would be that you clone xwiki-platform in your github account
11:00 <vmassol> and then commit in your repo
11:00 <vmassol> so that you can then do PR
11:00 <vmassol> and so that I can check the code there too
11:00 <vmassol> wdyt?
11:01 <Lyes> ok
11:05 <vmassol> Lyes: ping me when you have some code ready for me to look at, I'd like to get moving on this as we need to finish and be iso-feature real fast now
11:07 <Lyes> ok
11:57 <Denis> vmassol: what is the progress status of your evalution of teamcity ?
11:58 <vmassol> still needs tuning
11:58 <vmassol> to make all our builds pass
11:58 <vmassol> interesting features though
11:58 <vmassol> I've not been active on it for months now
11:58 <vmassol> do you want to take over?
11:59 <vmassol> the instance is accessible
11:59 <Denis> and regarding the license, do we got one ?
12:01 <vmassol> yes
12:02 <vmassol>
12:02 <vmassol> but
12:02 <vmassol> FTM we are allowed to have 3 agents AFAIK
12:03 <vmassol> hmm wait
12:04 <vmassol> ok now we have unliimted agents
12:04 <vmassol> :)
12:04 <vmassol> I just forgot to install the license ;)
12:12 <evalica> has joined #xwiki
12:41 <vfzevaze> has joined #xwiki
15:02 <OSIMasson> has joined #xwiki
15:02 <Slashman> hello, I restarted a xwiki 6.0.1 instance tomcat7 and now all search give me 0 result, any idea how I can debug this? (search worked before the tomcat restart)
15:26 <OSIMasson> has quit
15:56 <ClemensR> Slashman:  seems the  environment.permanentDirectory derined in WEB-INF/ has chnage so that solr does not find its index (maybe).
15:56 <ClemensR> that should be logged in the xwiki.lon on startup (" .... New index directory detected: old=null new=/path/to/index")
15:58 <tmortagne> Slashman: you migrated and xwiki.cfg ?
15:59 <tmortagne> (or any other modification in the WAR files)
16:03 <OSIMasson> has joined #xwiki
16:05 <Slashman> ClemensR, tmortagne : I didn't do anything, but I solved the issue by emptying the following folders: "/var/lib/xwiki/data/lucene" and "/var/lib/xwiki/data/solr/xwiki/data" and then force a reindex
16:07 <OSIMasson> has quit
16:09 <ClemensR> hm, there is an extra "xwiki" in "/var/lib/xwiki/data/solr/xwiki/data" compated to an 5.4.4 instance, seems this has changed in between
16:09 <ClemensR> and in that case a reindex is in order, yes
16:17 <tmortagne> /var/lib/xwiki/data/solr/xwiki/data path does not make much sense
16:17 <tmortagne> wrong copy/paste ?
16:21 <ClemensR> in my jetty-hsql developer install it is under data/solr/xwiki/data/  instead of data/solr/data/ (for 5.4.4), too
16:21 <ClemensR> so it seems somehow an extra "/xwiki" slipped in
16:33 <evalica> has quit
16:38 <tmortagne> hmm looks like a bug
16:40 <vfzevaze> hello dear xwiki community! i have a question, how can i manipulate, edit a content from a document that were created via a template via  java-api?
16:42 <ClemensR> there is nothing special about a document created from a template compared to any other document (I think), so this should be possible
16:45 <vfzevaze> well, how so? even if i want to edit that document via xwiki it is not possible via the wiki editor neither wysiwyg editor, which means that the document content is saved as objects
16:45 <vfzevaze> so that is special right?
16:46 <msmeria> has quit
16:47 <vfzevaze> so the content filled in from the user in the formular (inline editor) is saved ro that object property? field? and than attached to the document object...
16:48 <ClemensR> I guess I misunderstood the use case
16:49 <vfzevaze> my code is manipulating the content from pages coming in via events, that works fine, thanks to your help and documentation, but it is not working with pages created via template ....
16:49 <vfzevaze> no problem
16:51 <ClemensR> inline editing happens as soon as the document has a sheet, and it should inherit this from its template (if the template has one)
16:51 <ClemensR> ah, so you have an event listener taking care of the content
16:51 <vfzevaze> that's fine, it's the way it should be
16:51 <ClemensR> and the event listener is not invoked when a page is created from a template?
16:51 <vfzevaze> i just need a way to do that via java
16:52 <vfzevaze> when i get the "special" document the document.getContent() is empty
16:54 <ClemensR> ah, ok, and the template does have content?
16:55 <vfzevaze> ^^ yes of course, but i don't know how to access it and manipulate it, because its beeing handle other way
16:56 <ClemensR> I just trying to be able to reproduce it step by step ..
16:56 <vfzevaze> no problem
16:56 <vfzevaze> i am glad you are helping me go through it
16:59 <vfzevaze> normal case: onEvent(Event event, Object source, Object data) -> document = (XWikiDocument) source -> xdom = document.getXDOM() -> getChildrenByType(xdom, TableRowBlock.class, true)) (and from here on i start editing the document)
17:00 <vfzevaze> but when fetching data from the document created via template that is not possible...
17:02 <vfzevaze> brb in 20min.
17:06 <tmortagne> vfzevaze: I doubt it has much to do with the fact that the document is created from template, not all document have content in the XWikiDocument#getContent() way, some documents have content stored in objects and have empty content (created from template or not)
17:06 <tmortagne> for those you usually need to know the objects to know what is the main content (if any)
17:06 <ClemensR> vfzevaze: I think you want to set the "Action on create"  on "Save and Edit"  instead of "Edit"  in the Template Provider
17:07 <tmortagne> it depend on what you edit content basically
17:07 <tmortagne> maybe it does not matter in case of documents like that
17:08 <tmortagne> s/what/why/
17:10 <tmortagne> usually wiki content stored in an object is stored in a TextAreaClass property and you can check if it's wiki content using TextAreaClass#isWikiContent()
17:12 <tmortagne> basically you get all document's object xclasses, for each one you look at TextAreaClass properties and if it's a wiki content you can user rendering API to parse the content do you transformation and then put the new content
17:12 <tmortagne> but usually those document has quite strict format and you might break some things by doing it
17:14 <KermitTheFragger> has joined #xwiki
17:26 <vfzevaze> ok, got the content: document.getXObjects().entrySet().iterator()
17:26 <vfzevaze> but how to get the xdom object? or how to manipulate that content?
17:26 <tmortagne> using rendering API (that's what XWikiDocument#getXDOM does), see
17:27 <tmortagne> you can also look at XWikiDocument#getXDOM sources I guess
17:27 <vfzevaze> sure
17:27 <tmortagne> (and XWikiDocument#setContent(XDOM content))
17:32 <vfzevaze> XWikiDocument#getXDOM is in this case empty
17:32 <vfzevaze> somehow i have to get it through the xobjects
17:36 <tmortagne> vfzevaze: I'm talking about the Java source of XWikiDocument#getXDOM
17:36 <tmortagne> what you need to do with the object proerty is what XWikiDocument#getXDOM do with the document content
17:36 <vfzevaze> ok
17:37 <ClemensR> I tried to reproduce the issue but failed .... setting SandBox.TestPage1 as the template, however ...
17:37 <vfzevaze> oh just to parse it...
17:37 <vfzevaze> ok
17:37 <ClemensR> the XDOM is not empty initially
17:37 <ClemensR> over here
17:37 <vfzevaze> because the content of the page is not empty...
17:38 <tmortagne> ClemensR: from what I understood vfzevaze is talking about (not very rare) use case where everything is in the object
17:38 <tmortagne> for example pages in don't have any content
17:38 <vfzevaze>
17:39 <tmortagne> *
17:39 <ClemensR> ah, I understood  that vfzevaze checked that the template contains wiki content ...
17:39 <ClemensR> ... maybe I misunderstand
17:39 <vfzevaze>
17:39 <Inge-> has quit
17:42 <vfzevaze> and here you can see that the content is in the field / property
17:43 <ClemensR> ah, ok, and this O2 is the template?
17:43 <ClemensR> or a page created from the template ?
17:43 <vfzevaze> at the beginning it thought thats the way to get it, throught document.getContent(), but it is correct empry
17:43 <vfzevaze> *empty
17:43 <vfzevaze> 02 is the page created via the template yes
17:44 <ClemensR> if the stuff is all in XObjects which have a sheet, then it is ok that the document.getContent() is empty
17:44 <ClemensR> now trying to see why the wiki editor comes up an creating the page
17:47 <Inge-> has joined #xwiki
17:47 <ClemensR> ok, I get the inline (forms) editor on the spot when creating the  page from the template ... so I misunderstoor the issue a third time or so :)
17:49 <vfzevaze> when iterating the xobjects that how far i got untill now:
17:49 <vfzevaze> that's when i decided to ask, because it's getting too ugly
17:50 <vfzevaze1> has joined #xwiki
17:50 <tmortagne> comparing entity reference by their toString is pretty dangerous
17:50 <tmortagne> toString here is not an API
17:51 <vfzevaze> right? i now, it was just for debugging
17:51 <tmortagne> so what do you want to know exactly ?
17:51 <vfzevaze> *know
17:52 <vfzevaze> i want to know if there is a best practice to do that
17:52 <vfzevaze> not having to parse the content again
17:52 <vfzevaze> acessing the ceratin field and than editing it
17:52 <vfzevaze> that's it
17:52 <vfzevaze> i want to edit that one table
17:53 <tmortagne> you already know the class and want the objects of that class ?
17:53 <vfzevaze> yes
17:53 <vfzevaze> but as xdom
17:53 <vfzevaze> or similar already parsed...
17:53 <tmortagne> there is no API returning you directly the XDOM of an object field
17:54 <tmortagne> there is only String in there
17:54 <tmortagne> you will have to parse it yourself (that it just use rendering parser API)
17:54 <vfzevaze> and how can i edit that field then? editing the string and setting the field?
17:55 <tmortagne> as I said look at XWikiDocument#getXDOM and XWikiDocument#setContent(XDOM)
17:55 <tmortagne> that's exactly what you are supposed to do basically but with the object field content instead of document content
17:56 <tmortagne> if you really really don't want to use the rendering API you can create a XWikiDocument set the field content as content and user getXDOM/setContent and then getContent
17:57 <tmortagne> (I mean a temporary XWikiDocument java instance, no need to save it)
17:57 <tmortagne> it's pretty ugly from design point of view but it will be the same code
18:01 <vfzevaze1> thank you
18:04 <vfzevaze1> i will write a howto for this, maybe it helps someone
18:19 <tmortagne> vfzevaze1: that's a good idea :)
18:28 <ClemensR> has quit
18:31 <vfzevaze1> has quit
18:34 <tmortagne> has quit
18:36 <woshilapin> has quit
18:40 <vmassol> has quit
18:45 <KermitTheFragger> has quit
18:48 <vfzevaze1> has joined #xwiki
18:49 <vfzevaze1> has left #xwiki
19:09 <Denis> has quit
19:09 <sdumitriu1> has quit
19:10 <gdelhumeau> has quit
19:11 <sdumitriu1> has joined #xwiki
19:25 <mflorea> has quit
19:29 <Slashman> has quit
19:30 <Denis> has joined #xwiki
19:43 <OSIMasson> has joined #xwiki
19:45 <cjd> has quit
19:46 <lucaa> has quit
19:56 <lucaa> has joined #xwiki
20:20 <lucaa> has quit
20:41 <vfzevaze> has left #xwiki
20:42 <Lyes> has quit
20:59 <abusenius> has joined #xwiki
21:03 <lucaa> has joined #xwiki
21:25 <Denis1> has joined #xwiki
21:26 <Denis> has quit
21:48 <Denis1> has quit
22:19 <D-Spair> has quit
22:24 <D-Spair> has joined #xwiki
22:30 <woshilapin> has joined #xwiki
23:12 <lucaa> has quit
23:35 <Lyes> has joined #xwiki
23:49 <woshilapin> has quit

Get Connected