Thank you so much, for your explanation and for advice about naming
articles - it is all very clear now.
Unfortunately, I couldn't find the code you referred to, on the
SubmitArticle page I found:
1 Submit New Article
<form method="post" action="$doc.getURL("view",
"xpage=create")"
onsubmit="cancelCancelEdit()">
<div class="plainmessage">
<input type="hidden" name="tocreate" value="post"/>
$msg.get("posttitle"): <input type="text"
name="title"/>
<input type="submit" class="button"
value="$msg.get("create")"/>
</div>
</form>
Should I have looked at another place?
Darina
________________________________
From: users-bounces(a)xwiki.org [mailto:users-bounces@xwiki.org] On Behalf
Of Guillaume Lerouge
Sent: Sunday, February 17, 2008 6:44 PM
To: XWiki Users
Subject: Re: [xwiki-users] Error in creating a blog article
Indeed. You can create blog titles as long as you wish them to be, but
the best is to avoid any character outside aA - zZ & 0 - 9.
If you use spaces in your titles they will generate URLs such as
xwiki/bin/view/Blog/My+New+Blog+Article. The best way to keep URLs clean
is to ask your users to write MyNewBlogArticle as their title, and then
change it to something nicer.
One thing I find weird is that usually a js function is called to clean
the name of a page before the page is created to help prevent such
problems as the one you encountered... Can you check whether new blog
posts name go through the xwiki updateName() jc function ? Your life
would get much easier if they did, as in :
<form action="" id="newblogarticle" method="post">
<input type="hidden" name="template"
value="Blog.ArticleClassTemplate"/>
<input type="hidden" name="sheet" value="1"/>
Article Name : <input type="text" size="40"
name="articlename"
value="Your blog article"/>
#NOTE HOW updateName() IS USED BELOW
<input type="button" value="Add this blog article" onclick='if
(updateName(this.form.articlename)) {this.form.action="../../inline/" +
this.form.space.value + "/" + this.form.articlename.value;
this.form.submit(); }'/>
</form>
Hope this helps,
Guillaume
On 18/02/2008, Dicheva, Darina <dichevad(a)wssu.edu> wrote:
Thanks, Guillaume - it worked!!
Obviously the special characters have been the problem. So, am I
correctly understanding that string length doesn't matter and spaces are
OK, but special characters shouldn't be used? Since I have to instruct
the future users of the blog...
Thanks again for the help,
Darina
________________________________
From: users-bounces(a)xwiki.org [mailto:users-bounces@xwiki.org] On Behalf
Of Guillaume Lerouge
Sent: Sunday, February 17, 2008 5:34 PM
To: XWiki Users
Subject: Re: [xwiki-users] Error in creating a blog article
Hi,
have you tried entering the same title but removing out special
characters such as "," and ":" ? They might be the cause of your
problem.
-> you may want to prefer using "IdentityHowToNameItHowToFindIt" to
create new pages (because that's what will show up in the URL) and then
use nice name and special chars only in the title field of your blog
post once on the blog article page...
Guillaume
On 17/02/2008, Dicheva, Darina <dichevad(a)wssu.edu> wrote:
Hello,
I have installed a virtual wiki (using XWiki 1.2, MySql, Tomcat 5.5.17),
with a blog with editing rights given to only a specific user group.
Sometimes (but not always) there is a problem in creating new blog
entries (the error doesn't occur each time and it occurs also if the
admin creates the entry ...):
The latest: when trying to enter an article with posttitle "Identity:
How to Name It, How to Find It" I am getting the error:
Error number 4001 in 4: Error while parsing velocity page Wrapped
Exception: Invocation of method 'getDocument' in class
com.xpn.xwiki.api.XWiki threw exception
java.lang.StringIndexOutOfBoundsException: String index out of range:
-10 @ [47,21]
The stack trace is bellow.
I have entered before articles with longer titles - is there a
restriction for the length? Any idea what could be the reason for this
error?
Thanks,
Darina
--------------------------------
16:37:39,679
[
http://o4e.iiscs.wssu.edu/xwiki/bin/view/Blog/SubmitArticle?xpage=
create] [http-80-Processor343] ERROR log.SimpleLog4JLogSystem -
Method ge
tDocument threw exception for reference $xwiki in template at [47,14]
org.apache.velocity.exception.MethodInvocationException: Invocation of
method 'g
etDocument' in class com.xpn.xwiki.api.XWiki threw exception
java.lang.StringIn
dexOutOfBoundsException: String index out of range: -10 @ <unknown
template>[47,
21]
at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.j
ava:286)
at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTRefer
ence.java:203)
at
org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReferen
ce.java:419)
at
org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpres
sion.java:73)
at
org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSet
Directive.java:125)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.
java:318)
at
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRend
erer.java:238)
at
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRend
erer.java:152)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1354)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:105)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:158)
at
org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:431)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:236)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:119
6)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEnc
odingFilter.java:117)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at
org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommon
AccessLogValve.java:495)
at
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.ja
va:392)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
rocessConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out
of range:
-10
at java.lang.String.substring(String.java:1768)
at
com.xpn.xwiki.doc.XWikiDocument.setFullName(XWikiDocument.java:3001)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1075)
at com.xpn.xwiki.api.XWiki.getDocument(XWiki.java:113)
at sun.reflect.GeneratedMethodAccessor149.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.in
voke(UberspectImpl.java:295)
at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.j
ava:245)
... 35 more
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
--
http://wikibc.blogspot.com/
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
--
http://wikibc.blogspot.com/