Hi
Today I tried to create a custom mapping for a class. One field of the
class is a DBList with the "Multiple Select" option activated. To save
the values to the DB I wanted to use a string field like I'm used to
with static lists and non multi select DB lists. Now I get the
following exception when trying to save a Document with an object
attached: "java.util.ArrayList cannot be cast to java.lang.String"
How could I custom map a DBList field if String ist not possible? or
is there even a simple Solution I missed?
A hint in the right direction would be appreciated
Edo
Hi Devs,
I've created a new FAQ application currently located at http://www.xwiki.org/xwiki/bin/view/FAQ/WebHomeNew
I'd like to publish it in platform since we need to maintain it anyway for xwiki.org (I'm also ok to maintain it).
Here's my +1
Thanks
-Vincent
Hi Denis,
Just looked at the merged code (btw I can't find how to comment on it on github, it's a big mess), so I'm commenting here:
I noticed 2 issues:
* One is that even though I said in the vote mail that I didn't agree about keeping parameters in EntityReferences you've still kept them. Again I think we shouldn't keep them because we don't have an agreement about them ATM (Caleb is against them). Also you've exposed them with a protected method which means users can extend EntityReference and use them. As I said FTM I think you should move the notion of Locale **only** in DocumentReference since this is the only thing we've agreed about so far.
* You have some comments in DocumentReference like this:
* @param locale the new locale for this reference, if null, locale is removed
I don't understand what this means. How can it be removed since they are immutable and it's in a constructor :)
Also looking at setLocale I see:
protected void setLocale(Locale locale)
{
if (locale != null) {
setParameter(LOCALE, locale);
}
}
I don't see any removal.
Is it a leftover/typo?
Thanks
-Vincent
Hi devs,
I made some progress on the AppWithinMinutes and I'd like to get your
feedback. If you download the latest 3.3 snapshot and visit the
AppWithinMinutes.WebHome page you'll be able to test the class editor
and the live table generator. Here's a list of things that you should
check:
* on the class editor
** the field display is updated when the configuration panel is collapsed
** Save&Continue is available
** StaticList values editor
** Date picker
* on the live table generator
** the live table edit sheet
*** how the deprecated class fields are handled (you can edit in
object mode and add a column for a field that doesn't exist)
** the live table view sheet (this is how the application home page
will look like)
*** the Actions pane
** the generated code (edit in wiki mode the generated page)
The things that are left to do before the 3.3 final are:
* custom display (suggest input) for User, Group and Database List
field types (class editor)
* AppWithinMinutes wizard (integrating the class editor and the live
table generator)
* cross-browser testing (your help is welcome)
* i18n
* functional tests (I need more feedback on the UI first)
Regarding the LiveTable generator, I'm not happy with the i18n hack. I
adapted the code from
http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro+2.0
which "overwrites" the $msg variable with a map before rendering the
live table and restores it afterwards. Is there a better way?
Thanks,
Marius
Hi Jeremie,
It seems this is a regression I introduced in 3.2 when I refactored
the XWikiDocument class to use the new display module. The problem is
that the title is parsed as HTML which shouldn't be the case because
the title is plain text + Velocity script.
The title was parsed as HTML before my changes, but only if the output
syntax wasn't HTML (rare, since most of the time wiki pages are
rendered as HTML to be displayed in a browser).
Devs, do you see any issues with parsing the (specified) document
title as plain text (after the Velocity script has been evaluated)?
Thanks,
Marius
On Mon, Nov 14, 2011 at 3:58 PM, jerem <jeremie.bousquet(a)gmail.com> wrote:
> Hi,
>
> - There seem to be some bad displays when a page title contains '<' or '>'.
>
> Display is correct in browser title bar, it is also correct in main content
> area, in hierarchy, but not in page title. For a page with title "TestTest >
> test", generated html looks like this :
>
> <div id="hierarchy">
> TestTest > test
> </div>
> <div id="document-title">
> TestTest* &*gt; test
>
> </div>
>
> The bad trick is that the "&" of ">" gets replaced by "&" ...
>
> - as a side question, is there a way to easily do the equivalent of velocity
> "$escapetool.html($text)", but in {{groovy}} ? I use mainly groovy in my
> pages, and would like to avoid passing parameters between groovy and
> velocity just for this one use-case ...
>
> Thanks,
> Jeremie
>
> --
> View this message in context: http://xwiki.475771.n2.nabble.com/Characters-or-bad-display-in-page-title-t…
> Sent from the XWiki- Users mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> users(a)xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>
Hi devs,
After much brainstorming with Thomas and with the implementation of the new model I'm doing, we've come to the conclusion that it would be better to add the notions of Locale and Version in EntityReference.
The main reasons are:
* otherwise we need to introduce a notion of UniqueEntityReference in the model and it makes it very awkward at an API level (user need to constuct a UniqueEntityReference from an EntityReference depending on the APIs used)
* it makes APIs more complex than what they could be.
For example:
- getDocument(EntityReference)
- getDocument(EntityReference, Locale)
- getDocument(EntityReference, Version)
- getDocument(EntityReference, Locale, Version)
vs
- getDocument(EntityReference)
(subnote: this is why I introduced UniqueEntityReference in the model)
* It'll mean that anywhere we use an entity reference we'll be able to reference a specific version of that entity and/or a specific language. Some example: including a specific version of a page, referencing a specific version of an attachment in wiki syntax, etc.
In a first version I'd like to only introduce a generic get/setAttributes (to allow extensibility) in EntityReference + get/setLocale/Version (for easiness of access).
ATM I'm not planning to define a textual syntax for attributes (but it could something like: wiki:space.page[name1=value1, … nameN=valueN]). I'm not asking to vote on this.
Here's my +1
Thanks
-Vincent
Hi all.
Short version of my question: Can anyone point me to an example of
adding object of a custom class to a page via the ReSTful API?
And now for the long version of my question:
I can successfully create a page using REST, but can't add an object.
Here is the problem step by step.
1) Using this XML definition in a file called AlinaPage.xml:
<?xml version="1.0" encoding="UTF-8"?>
<xwiki:page xmlns:xwiki="http://www.xwiki.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xwiki.org C:\Users\mwallace\
Desktop\xwiki_rest_model.xsd">
<xwiki:link
href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/Alina+Frey/o…"
rel="http://www.xwiki.org/rel/o
bject"></xwiki:link>
<xwiki:id/>
<xwiki:fullName/>
<xwiki:wiki/>
<xwiki:space>Main</xwiki:space>
<xwiki:name>Alina Frey</xwiki:name>
<xwiki:title/>
<xwiki:parent/>
<xwiki:parentId/>
<xwiki:xwikiRelativeUrl/>
<xwiki:xwikiAbsoluteUrl/>
<xwiki:translations/>
<xwiki:syntax/>
<xwiki:language/>
<xwiki:version/>
<xwiki:majorVersion>1</xwiki:majorVersion>
<xwiki:minorVersion>0</xwiki:minorVersion>
<xwiki:created>2011-07-02T12:32:00-04:00</xwiki:created>
<xwiki:creator>XWiki.mwallace</xwiki:creator>
<xwiki:modified>2011-07-02T12:32:00-04:00</xwiki:modified>
<xwiki:modifier/>
<xwiki:content>{{include document="XWiki.PersonSheet"/}}</xwiki:content>
</xwiki:page>
2) I do the following command, which adds the page successfully:
C> curl -u mwallace:password -X PUT --data-binary "@AlinaPage.xml" -H
"Content-Type: application/xml"
http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/Alina+Frey
3) The resulting page from a HTTP GET is:
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="http://www.xwiki.org">
<link href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"
rel="http://www.xwiki.org/rel/space"/>
<link
href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/Alina%20Frey…"
rel="http://www.xwiki.org/rel/history"/>
<link href="http://localhost:8080/xwiki/rest/syntaxes"
rel="http://www.xwiki.org/rel/syntaxes"/>
<link
href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/Alina+Frey"
rel="self"/>
<link
href="http://localhost:8080/xwiki/rest/wikis/xwiki/classes/Main.Alina%20Frey"
rel="http://www.xwiki.org/rel/class"/>
<id>xwiki:Main.Alina Frey</id>
<fullName>Main.Alina Frey</fullName>
<wiki>xwiki</wiki>
<space>Main</space>
<name>Alina Frey</name>
<title>Alina Frey</title>
<parent/>
<parentId/>
<xwikiRelativeUrl>http://localhost:8080/xwiki/bin/view/Main/Alina+Frey</xwikiRelativeUrl>
<xwikiAbsoluteUrl>http://localhost:8080/xwiki/bin/view/Main/Alina+Frey</xwikiAbsoluteUrl>
<translations/>
<syntax>xwiki/2.0</syntax>
<language/>
<version>4.1</version>
<majorVersion>4</majorVersion>
<minorVersion>1</minorVersion>
<created>2011-07-02T12:45:12-04:00</created>
<creator>XWiki.mwallace</creator>
<modified>2011-07-02T21:33:48-04:00</modified>
<modifier>XWiki.mwallace</modifier>
<content>{{include document="XWiki.PersonSheet"/}}</content>
</page>
4) But then, using this definition of an object in file AlenaObject.xml:
<?xml version="1.0" encoding="UTF-8"?>
<xwiki:object xmlns:xwiki="http://www.xwiki.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xwiki.org C:\Users\mwallac
e\Desktop\xwiki_rest_model.xsd">
<xwiki:id/>
<xwiki:guid/>
<xwiki:pageId>Main.Alina Frey</xwiki:pageId>
<xwiki:wiki/>
<xwiki:space>Main</xwiki:space>
<xwiki:pageName>Alina Frey</xwiki:pageName>
<xwiki:className>XWiki.PersonClass</xwiki:className>
<xwiki:number>0</xwiki:number>
<xwiki:headline/>
<xwiki:property name="_knows">
<xwiki:value>Main.Alena</xwiki:value>
</xwiki:property>
<xwiki:property name="_knows">
<xwiki:value>Main.Judi Wallace</xwiki:value>
</xwiki:property>
<xwiki:property name="name">
<xwiki:value>Alina Frey</xwiki:value>
</xwiki:property>
</xwiki:object>
5) I try the following command, which does NOT insert the object properly:
C> curl -u mwallace:password -X PUT --data-binary "@AlinaObject.xml" -H
"Content-Type: application/xml"
http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/Alina+Frey/o…
6) Rather, I get this error message:
<html>
<head>
<title>Status page</title>
</head>
<body>
<h3>The server has not found anything matching the request
URI</h3><p>You can get technical details <a
href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">here</a>.<br>
Please continue your visit at our <a href="/">home page</a>.
</p>
</body>
</html>
What am I doing wrong?
--
Mark Wallace
Principal Engineer, Semantic Applications
Modus Operandi, Melbourne, FL, USA
Hi Team,
I am unable to resolve "outOfMemory" issue.I have already increased heap
size to 4000M but still getting the same error even on fresh installation.
Can someone from xwiki team help me to resolve this issue?
Thanks
Karamjit