Hello,
I want to create a class with a DBList property not containing strings but a
list of ID to other BaseObjects...
Then from velocity I want to access directly to this list of objects to
display each object one by one.
But for this, you need ProgrammingRights because
api.Object.get(propertyname) returns a display of the list and not the
list... to retrieve the list, you must call getXWikiObject which requires
programming rights...
But I don't want to give programming rights just to view objects!
Moreover I don't want to be forced to go among $doc.searchXXX just to find
my objects because I have already these objects in my list...
Do you a solution for me? my model might be bad also...
Pascal
I have certainly found a small bug
in com.xpn.xwiki.api.Document, there is:
/**
* Select a subset of objects from a given class, filtered on a "key =
value" criteria.
*
* @param classname The type of objects to return.
* @param key The name of the property used for filtering.
* @param value The required value.
* @return A Vector of {@link Object objects} matching the criteria. If
no objects are found, or
* if the key is an empty String, then an empty vector is
returned.
*/
public Vector<Object> getObjects(String classname, String key, String
value)
{
Vector<Object> result = new Vector<Object>();
if (StringUtils.isBlank(key) || value == null) {
return getObjects(classname);
}
try {
Vector<BaseObject> allObjects = doc.getObjects(classname);
if (allObjects == null || allObjects.size() == 0) {
return result;
} else {
for (BaseObject obj : allObjects) {
if (obj != null) {
BaseProperty prop = (BaseProperty) obj.get(key);
if (prop == null || prop.getValue() == null) {
continue;
}
if (value.equals(prop.getValue())) {
result.add(newObjectApi(obj,
getXWikiContext()));
}
}
}
}
} catch (Exception e) {
}
return result;
}
What is not good:
if (value.equals(prop.getValue())) {
result.add(newObjectApi(obj,
getXWikiContext()));
}
in XWikiDocument.getObject(), it is:
if (value.equals(obj.getStringValue(key))) {
return obj;
}
so getObjects only works when the property is a String.
Best Regards
Pascal
Hi,
We have a problem with the GWT character map. It contains some
characters that are not ISO-8859-1. The problem is that since our
default encoding is ISO-8859-1 (<?xml version="1.0"
encoding="ISO-8859-1" ?>) the browser replaces for example this
character ∞ with ∞
Our rendering doesn't accept HTML so this value is escaped and is
shown as is.
So we have several non-satisfactory options:
1) Switch to UTF8 by default. A good thing but that won't solve the
problem for those using the GWT editor in ISO-8859-1 encoding.
2) Modify the GWT editor character map so that it only shows
characters valid with the current encoding. This is a pity since it
should be possible to display other chars since the browser knows how
to display them even though the user is not in the correct encoding
3) Introduce a wiki syntax for representing characters not allowed in
the current encoding. However this means we'll still need to replace
∞ with this syntax before the rendering is called and this
forbids users to enter ∞ in the wiki editor so this is not good.
Any better idea?
WDYT?
Thanks
-Vincent
Hi Devs,
I'm working on integrating webdav into XWiki UI (+FoXWiki) and I kind of ran
into a small problem.
Our current xwiki-webdav-foxwiki test server is at
http://91.121.237.216/xwiki/bin/view/Main/ (you may give this a try with
firefox). Here in the attachments view, if a firefox user clicks on the
"Edit" link, it should first check if the user has foxwiki installed and if
not should trigger an installation. If the user has foxwiki installed,
foxwiki will take care of the rest of tasks.
The problem is, foxwiki install trigger code is something like this :
<code>
var params = {
"FoXWiki": { URL: "
http://91.121.237.216/xwiki/bin/download/Main/WebHome/foxwiki.xpi",
IconURL: "
http://91.121.237.216/xwiki/bin/download/Main/WebHome/foxwiki.png",
Hash:
"sha1:76920ec6392fec911e13b53ed8d23f64d75502c6",
toString: function () { return this.URL; }
}
};
InstallTrigger.install(params);
</code>
Currently i have put this code into /skins/albatross/scripts/webdav.js
This doesn't look right for obvious reasons, but where else would i put this
code ?
Please help me out :)
Thanks.
- Asiri
Hello,
I want to do the following:
I create a class with one LongProperty field containing a long ID of another
BaseObject.
The idea is to link an object to another object by simply using its hashcode
ID and not the whole docname+classname+nb string. A one-to-one association
if you prefer.
$xwiki.search("from BaseObject as obj...") will return a BaseObject so I can
get the ID here.
But in velocity, I access objects using $doc.getObject() which returns a
Object API.
I can't find any simple way to retrieve the ID of the nested BaseObject from
Object API because getBaseObject requires programming rights.
Do you have an idea for me?
Is it mandatory to use the docname+classname+nb string to identify an object
from velocity?
regards
Pascal
In order to be as efficient as possible in answering questions and so
that the answer benefit others the most we had defined a strategy.
It's written on
http://dev.xwiki.org/xwiki/bin/view/Community/Contributing#HStrategiesforan…
Here's the relevant excerpt:
"
1.1 Strategies for answering on the XWiki lists
Here's a good strategy that improves the XWiki documentation on
xwiki.org:
1. someone (A) asks a question on a xwiki list
1. someone (B) knows the answer
1. B verifies that the answer can be found on xwiki.org and if so
gives a link to it in the reply to A
1. If the answer is not found on xwiki.org, then B adds it (*) and
then gives a link to it in the reply to A
In this manner we all enrich the xwiki documentation and it'll only
take marginally longer to answer questions. The next time someone asks
the question again we can simply point him/her to the location on
xwiki.org
What happens otherwise is that usually people answer in the email,
often giving very long and elaborate answers with lots of knowledge/
wisdom in it. Then another person comes in, asks the same question and
we answer again, etc. The result is:
* the xwiki.org documentation is not better
* overall as a team we are less efficient
(*) One difficult in putting the answer on xwiki.org is to find the
right location where to put it. So here are a few tips:
* For code snippets, add it to the [Code Zone>code:Main.WebHome]
* For questions on how to use XWiki, please add it to the [Features
guide>platform:Features.WebHome]
* For development questions, add it to the [Developer's
guide>platform:DevGuide.WebHome]
* For configuration questions and administration questions, add it to
the [Administration guide>platform:AdminGuide.WebHome]
* For other questions, add them to the [FAQ>xwiki:FAQ.WebHome]
"
I've seen a lot of emails recently where we're not doing this (me
included) and thus I thought it would be to remind us all about
strategy. Also xwiki.org hasn't been improved a lot for a while so
it's good to make an effort to do so. Could be a good thing to do
especially during the bug fixing week.
WDYT?
Thanks
-Vincent
Hi all,
I'm very much happy to have the opportunity to continue work on xwiki after
completing the GSOC and I must thank all of you for giving me this chance.
I'll be working with fabio on implementing the syntax coloring for xwiki.
Basically I will be integrating my gsoc code with the current xwiki
plugin.Thanks again for giving me this opportunity.
----Malaka
Hello,
is there a chance for me to succeed at building xeclipse?
I tried following
http://svn.xwiki.org/svnroot/xwiki/xeclipse/trunk/plugins/org.xwiki.eclipse…
but failed.
- it is spoken there about three downloads but two configs in the
profile... maybe I goofed there
It ended up as:
> generateFeature:
>
> BUILD FAILED
> /Users/paul/tmp/xeclipse/eclise-SDK-3.4/plugins/
> org.eclipse.pde.build_3.4.0.v20080604/scripts/productBuild/
> productBuild.xml:21: The following error occurred while executing
> this line:
> /Users/paul/tmp/xeclipse/eclise-SDK-3.4/plugins/
> org.eclipse.pde.build_3.4.0.v20080604/scripts/productBuild/
> productBuild.xml:53: Unable to find element: /org.xwiki.eclipse.rcp/
> org.xwiki.eclipse.product.
hints welcome
paul
Hi guys,
We're getting behind again in term of bug closings vs bug openings, see
http://tinyurl.com/52oxjq
I think we'll need to start again the Bug Fixing Day.
I propose to start it again next week.
WDYT? Any better idea?
Thanks
-Vincent
Hi,
We're having some last-minute problems with the new GWT editor and we
need a few more days to fix them.
Thus I'm proposing that we delay the XE 1.5RC1 release for 3 more days
to Thursday 25th of Sept.
This means a potential 1.6 Final (if no important bugs are found) for
the 29th of Sept.
Thanks
-Vincent