Hi,
how is it possible to intantiate a valid MacroTransformationContext?
I tried this:
MacroTransformationContext mc=new
MacroTransformationContext(new TransformationContext());
mc.setSyntax(Syntax.XWIKI_2_0);
contentParser.parse(ts.getContent(),mc,true,true);
but it threw the following Exception:
org.xwiki.rendering.macro.MacroExecutionException: Failed to parse
content [ == Werner == * test ]
at
org.xwiki.rendering.internal.macro.DefaultMacroContentParser.parseXDOM(DefaultMacroContentParser.java:122)
at
org.xwiki.rendering.internal.macro.DefaultMacroContentParser.parse(DefaultMacroContentParser.java:77)
at
org.centauron.xwiki.XWikiConnector.getCodeSnipsFromPage(XWikiConnector.java:117)
at
org.centauron.xwiki.XWikiConnector.getCodeSnipsFromPage(XWikiConnector.java:105)
...
Hi, Anca,
Thanks very much for your response, I understand how data are saved to
database now, but I got another question:
In the following code from BlogPostSheet
<dl>
<dt>$msg.get('xe.blog.sheet.title')</dt>
<dd>$doc.display('title', 'edit', $entryObj)</dd>
<dt>$msg.get('xe.blog.sheet.content')</dt>
<dd>$doc.display('content', 'edit', $entryObj)</dd>
<dt>Feature ID:</dt>
<dd>$doc.display('FID', 'view', $entryObj)</dd>
<dt>Package ID:</dt>
<dd>$doc.display('PID', 'view', $entryObj)</dd>
<div class="clearfloats"></div>
</dd>
</dl>
If I change the 'view' to 'edit' for both FID and PID, then both of FID and
PID will be saved to database, and I can query retrieve them, but I have
use view, then they are not saved to database. the problem is I donot want
these two fields editable, so I have to use view, any workaround for this?
so the bottom line is I want them to be saved to database and not editable
from the inline form.
Thanks again for your help.
Dave
On Wed, Mar 28, 2012 at 4:47 AM, Anca Luca <lucaa(a)xwiki.com> wrote:
> Hi Dave,
>
> You should read http://platform.xwiki.org/**xwiki/bin/view/DevGuide/**
> Architecture<http://platform.xwiki.org/xwiki/bin/view/DevGuide/Architecture>, but I understand that it might be cryptic for a first time usage so here
> we go:
> must know that xwiki is a java engine, so there is some java code that
> does things, it's not all done in velocity.
> Basically, there is a java "platform" that can handle documents, objects
> in documents, classes, etc (load, save) and then there is the velocity
> scripting that you can do in wiki pages which **uses** this core (injected
> variables like $xwiki, $doc). See here about how this scripting in pages
> works: http://platform.xwiki.org/**xwiki/bin/view/DevGuide/**Scripting<http://platform.xwiki.org/xwiki/bin/view/DevGuide/Scripting>.
> Also, there are some interesting information about the data model here
> http://platform.xwiki.org/**xwiki/bin/view/DevGuide/**DataModel<http://platform.xwiki.org/xwiki/bin/view/DevGuide/DataModel>.
>
> The 'platform' project on git contains all this 'platform' code: java
> sources, default templates, default js, css, etc, which you can enhance in
> wiki pages (but we don't do everything in wiki pages, so you should not
> look for it only in wiki pages).
>
> Also, there are a bunch of "default" velocity templates that handle the
> default layout and actions for the wiki (in the webapps/xwiki/templates
> folder of the installation). For example, the save and view button is
> generated by these templates, along with the url to which the data in the
> form is posted.
>
> I recommend firebug and LiveHttpheaders extensions of firefox to study
> what data is posted to which URL, etc what data is received. from then on,
> with the help of http://platform.xwiki.org/**xwiki/bin/view/DevGuide/**
> Architecture#**HUnderstandinghowHTTPrequestsa**rehandled<http://platform.xwiki.org/xwiki/bin/view/DevGuide/Architecture#HUnderstandi…>, you should be able to find the code that actually does the save.
>
> Have fun,
> Anca
>
>
> On 03/28/2012 05:42 AM, du du wrote:
>
>> Also from the following BlogPostSheet wiki code, after users type in
>> message from the inline form, users click Save& View button, how are the
>>
>> messages saved to database?
>> see the attached code:
>> {{include document="Blog.BlogCode"/}}
>>
>> {{include document="Blog.CategoriesCode"**/}}
>>
>> {{velocity filter="none"}}
>> {{html clean="false" wiki="true"}}
>> $xwiki.jsx.use('Blog.**ManageCategories', {'mode' : 'select'})##
>> $xwiki.ssx.use('Blog.**ManageCategories')##
>> #getEntryObject($doc $entryObj)
>> #if("$!entryObj" == '')
>> #warning($msg.get('xe.blog.**sheet.notpost'))
>> ## Keep testing the inline action for backward compatibility with older
>> blog posts.
>> #elseif($xcontext.action != 'edit'&& $xcontext.action != 'inline')
>> ## View mode
>> #isPublished($entryObj $isPublished)
>> #isHidden($entryObj $isHidden)
>> ## displayBlog requires a list of documents, and whether to display only
>> an extract or the full entry.
>> #displayBlog([$tdoc] 'single' false false)
>> #else
>> <dl>
>> <dt>$msg.get('xe.blog.sheet.**title')</dt>
>> <dd>$doc.display('title', 'edit', $entryObj)</dd>
>> <dt>$msg.get('xe.blog.sheet.**content')</dt>
>> <dd>$doc.display('content', 'edit', $entryObj)</dd>
>> <dt>$msg.get('xe.blog.sheet.**summary')</dt>
>> <dd>$doc.display('extract', 'edit', $entryObj)</dd>
>> <dt>$msg.get('xe.blog.sheet.**category')</dt>
>> <dd>
>> #**displayCategoryManagementTree(**'' 'selectable')
>> <div class="clearfloats"></div>
>> </dd>
>> </dl>
>> #template('tagedit.vm')
>> #isPublished($entryObj $isPublished)
>> #if($isPublished)
>> #if($doc.creator == $xcontext.user)
>> #publishMessageBox($msg.get('**xe.blog.sheet.publicationdate'**,
>> [${doc.display('publishDate', 'view', $entryObj)}]))
>> #set($hideArticle = ${doc.display('hidden', 'edit', $entryObj)})
>> #hideMessageBox($msg.get('xe.**blog.sheet.hidearticle',
>> [${hideArticle}]))
>> #end
>> #else
>> #set($defaultDate =
>> $xwiki.getDocument($**blogPostTemplate).getObject($**blogPostClassname).*
>> *getProperty('publishDate').**value.time)
>> #if($entryObj.getProperty('**publishDate').value.time ==
>> $defaultDate)
>> ## The publish date was not set, force it to be the creation date
>> $entryObj.set('publishDate', $doc.creationDate)
>> #end
>> #publishMessageBox("$msg.get('**xe.blog.sheet.notpublished')
>> <label>**$msg.get('xe.blog.**sheet.publish') ${doc.display('published',
>> 'edit', $entryObj)}**</label>\\<label>**$msg.get('xe.blog.sheet.**
>> setdate')
>> ${doc.display('publishDate', 'edit', $entryObj)}</label>")
>> #end
>> #end
>> {{/html}}
>> {{/velocity}}
>>
>> Thanks
>> Dave
>>
>> On Tue, Mar 27, 2012 at 11:36 PM, du du<dddu88(a)gmail.com> wrote:
>>
>> Hi, all
>>>
>>> I am studying the BlogClass, BlogPostClass, I checked the Blog.BlogCode,
>>> there are alot of velocity scripts, I can see the search documents from
>>> db,
>>> but could not find any code related to insert document records into
>>> database, so how is the document created from blog saved into database?
>>> please point me to the script code in the Blog.BlogCode.
>>>
>>> Thanks
>>>
>>> Dave
>>>
>> ______________________________**_________________
>>
>> users mailing list
>> users(a)xwiki.org
>> http://lists.xwiki.org/**mailman/listinfo/users<http://lists.xwiki.org/mailman/listinfo/users>
>>
>
> ______________________________**_________________
> devs mailing list
> devs(a)xwiki.org
> http://lists.xwiki.org/**mailman/listinfo/devs<http://lists.xwiki.org/mailman/listinfo/devs>
>
Hi, all
I am studying the BlogClass, BlogPostClass, I checked the Blog.BlogCode,
there are alot of velocity scripts, I can see the search documents from db,
but could not find any code related to insert document records into
database, so how is the document created from blog saved into database?
please point me to the script code in the Blog.BlogCode.
Thanks
Dave
Hello,
My Dashboard page suddenly broke, with no apparent reason (I was renaming a
page ...)
First everything seemed to be broken in my wiki : home page full of velocity
exceptions, renaming, copying, ..., conducing to velocity exceptions.
I think I focused down to what might be the root cause when I visualized the
Main.Dashboard page. It displays, but the activity stream fails with this
exception (see at the end).
Strangely, I'm able to connect to the database and run simple queries on
activitystream_events table.
Any help welcome,
Jeremie
--
View this message in context: http://xwiki.475771.n2.nabble.com/XWiki-3-5-Exception-from-activity-stream-…
Sent from the XWiki- Users mailing list archive at Nabble.com.
On Mar 27, 2012, at 10:13 AM, Grüner Heinrich wrote:
> Hi Vincent,
> in my api "parse" returns a List<Block> and parseXDOM returns a XDOM.
> But I am still on 3.1 release.
Ok that's why. In 3.1 this component was private (it has an "internal" part in the package name),this means you're not supposed to use it because it's not a user public api and it can change at any time.
We've made it in 3.3M1:
https://github.com/xwiki/xwiki-rendering/commit/a3f012852f7b7caeaaf6205dca4…
The new API starting in 3.3M1:
https://github.com/xwiki/xwiki-rendering/blob/master/xwiki-rendering-transf…
Thanks
-Vincent
PS: Please don't answer privately to me and instead always send mails to the list so that we all see them and we can all answer and learn from them :)
> Am 27.03.2012 09:31, schrieb Vincent Massol:
>> Hi Stefan,
>>
>> On Mar 27, 2012, at 9:24 AM, Stefan Bernsdorf wrote:
>>
>>> Hi Vincent,
>>>
>>> thanks for replying.
>>> There is a typo in your example. You have to remove .getChildren() in the code.
>>>
>>>
>>> List
>>> <Block> blocks = this.contentParser.parse(content, context, true, context.isInline()).getChildren();
>> Thanks but it looks correct. parse() will return a XDOM and execute() needs a list of Blocks so you need to get them with XDOM.getChildren().
>>
>> Thanks
>> -Vincent
>>
>>>
>>> Am 27.03.2012 08:49, schrieb Vincent Massol:
>>>> Hi Stefan
>>>>
>>>> On Mar 26, 2012, at 11:43 PM, Grüner Heinrich wrote:
>>>>
>>>>
>>>>> Hi,
>>>>> i want the content of my Macro to be parsed as XWiki Syntax.
>>>>> How would that be possible.
>>>>> I cant find no parsing Method in AbstractMacro. When I want to extend AbstractScriptMacro then the initializing of the macro fails.
>>>>>
>>>> See http://rendering.xwiki.org/xwiki/bin/view/Main/ExtendingMacro#HParsingMacro…
>>>>
>>>>
>>>> Thanks
>>>> -Vincent
>>
>
Hi Stefan,
On Mar 27, 2012, at 9:24 AM, Stefan Bernsdorf wrote:
> Hi Vincent,
>
> thanks for replying.
> There is a typo in your example. You have to remove .getChildren() in the code.
>
>
> List
> <Block> blocks = this.contentParser.parse(content, context, true, context.isInline()).getChildren();
Thanks but it looks correct. parse() will return a XDOM and execute() needs a list of Blocks so you need to get them with XDOM.getChildren().
Thanks
-Vincent
>
> Am 27.03.2012 08:49, schrieb Vincent Massol:
>> Hi Stefan
>>
>> On Mar 26, 2012, at 11:43 PM, Grüner Heinrich wrote:
>>
>>
>>> Hi,
>>> i want the content of my Macro to be parsed as XWiki Syntax.
>>> How would that be possible.
>>> I cant find no parsing Method in AbstractMacro. When I want to extend AbstractScriptMacro then the initializing of the macro fails.
>>>
>> See http://rendering.xwiki.org/xwiki/bin/view/Main/ExtendingMacro#HParsingMacro…
>>
>>
>> Thanks
>> -Vincent
Hi, i have a problem with deinstalling MySQL completly from my notebook.
I have the xwiki running on my normal pc, but i also want to work on it on
the notebook.
But after watching a lot of forums about that i can't configure the MySQL
server.
So i thought about asking here because i just only know one way of getting
through it --> completly new windows installation.
Have someone any idea how to get it with MySQL or is it easier with Postgre
or Xampp?
It is not so easy to install xwiki because there is only a tutorial for
debian users and not for windows...
I hope someone can help me...
Thanks
--
View this message in context: http://xwiki.475771.n2.nabble.com/How-to-get-MySQL-after-installed-running-…
Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi,
i want the content of my Macro to be parsed as XWiki Syntax.
How would that be possible.
I cant find no parsing Method in AbstractMacro. When I want to extend
AbstractScriptMacro then the initializing of the macro fails.
Thanks, Stefan.
Hi.
We're using xWiki as a help/eLearning system and we'll like to know if
there is a way to create a new document version that will not be
published until it has been reviewed and approved, so the users will not
see the new version until the approval for the new one has been granted.
Thanks un advance and best regards.