Hello everybody!
I write my diploma thesis! And I have a problem. I want to attach a file to a page of the xwiki. This should happen automatically - this means without any intervention of a user.
You can attach a file over the GUI and I want the same functionality in my plugin. The file should be loaded from the folder and attached to the page over the plugin and velocity. A batchscript should update the wiki every hour, when some files in a given folder have changed.
The class "Document" in the package "com.xpn.xwiki.api" has a method "addAttachment()", but I have the problem that this method is protected. Thus I cannot attach a file with a self-written plugin. I don't find any information about this context in the documentation.
Has anyone a solution for my problem? Could this person please send me the coding or the link where I find the documentation/ information to solve the problem?
Please please help me! I have to implement this functionality but I don't know how. My diploma thesis is very important for me and I'm desperate!!!
Hi
I have successfully followed the tutorial on creating an FAQ application on
xwiki.org. However, i dont get a table with border encompassing the question
and answer. Here is the HTML from the browser for an actual document:
<dl>
<dt> Question </dt>
<dd>How do i use FAQ?</dd>
<dt> Answer </dt>
<dd>use the FAQ only for questions that do not need lengthy answers. Answers
to the FAQ should be short and should not exceed a few lines with no
screenshots or attachements.</dd>
</dl>
AFAIK, this was working well with Beta1. Did anything change? Or should i
create the answer and question properties with non-default values?
Thanks
Shiva
--
View this message in context: http://www.nabble.com/FAQ-Application---Problem-with-RC2-tf3678189.html#a10…
Sent from the XWiki- Dev mailing list archive at Nabble.com.
Hi,
I need to document all this but I wanted to give you a heads up on
our Maven2 build:
* It's fully functional but requires Maven 2.1 to fully work (this is
due to bugs in 2.0.6 which is fixed in 2.1). As 2.1 isn't released
yet, I've made a version available at
http://xwiki.org/maven-2.1-SNAPSHOT.zip
* What does the m2 build currently do:
- it builds everything including the standalone distribution.
Note: it doesn't generate the NSIS exe yet.
- we can generate artifacts for various databases (we have 3
configured: HSQLDB, MySQL and PostGreSQL). However the application/
and application-test/ modules currently only work with HSQLDB and the
database/ module needs that your database be started if you're not
using HSQLDB (the default).
- it runs selenium tests written as junit tests and located in
xwiki/application-test/src/test/it
* The full build currently takes close to 3mn here. I'll exclude the
functional tests from the default build as they'll start to take too
long as soon as we start having more tests. I'll create a profile
called "integration-tests" for running them. Our CI tool will use it.
* We've installed a CI tool at http://teamcity.xwiki.org but we have
some issues with the svn checkout which hangs. I need to figure out
what's wrong.
* What's left for the m2 build:
- some fine tuning
- configure it so that we can release directly on objectweb's m2
repo at the click of a button
- NSIS integration
- move the tests in xwiki/tests or rewrite them
- review the JAR version differences with the Ant build and try to
align them. It's probably a good time to upgrade all our jars to use
the latest version of libraries too.
* A note on Selenium tests. I've set up an infrastructure so that any
tests dropped in xwiki/application-test/src/test/it gets executed.
Don't hesitate to add new tests there. To whet your appetite here's
an example of a login test to show you how easy it is (yeah I know,
that test is easy :)):
public class LoginTest extends AbstractSeleniumTestCase
{
public void setUp() throws Exception
{
super.setUp();
open("/xwiki/bin/view/Main/");
// Verify that the user isn't logged in
if (isAuthenticated()) {
logout();
}
goToLoginPage();
}
public void testLogAsAdmin()
{
setFieldValue("j_username", "Admin");
setFieldValue("j_password", "admin");
checkField("rememberme");
submit();
assertTrue("Admin user has not been authenticated",
isAuthenticated());
}
public void testLogWithWrongPassword()
{
setFieldValue("j_username", "Admin");
setFieldValue("j_password", "wrong password");
submit();
assertTextPresent("Wrong password");
}
public void testLogWithInvalidUsername()
{
setFieldValue("j_username", "non existent user");
setFieldValue("j_password", "admin");
submit();
assertTextPresent("Wrong user name");
}
}
TODO: I'm going to try writing some tests for the WYSIWYG editor
right now and see how hard it gets.
Comments are most welcome.
Thanks
-Vincent
Hi all,
I know everyone is really busy at this time trying to polish XWiki for
the 1.0 release, so this may not be a good time to start discussing
design issues. Thus feel free to ignore this message until the bug
chase is over ;)
Here I want to discuss about some IMO design flaws in XWiki and suggest
some ways to improve them. I know the programmer's motto that goes
"If it is not broken, don't fix it". While I usually agree with this,
sometimes I believe some changes can improve code readeability,
isolation and encourage better coding practices. Well now without
further ado, some things I believe we should fix:
1) com.xpn.xwiki.XWiki has become a mess. It has become the official
"put the method that does not fit elsewhere" place. Thus it is
gigantic and complex.
2) there are many abstraction violations in XWiki. For example, storage.
XWiki is modular, that's great, everything about storage
goes in com.xpn.xwiki.store and there are nice interfaces that abstract
the underlying storage for the rest of the world.
Sadly this is not true, for example com.xpn.xwiki.XWiki imports
XWikiHibernateStore, XWikiJcrStore, etc. So we loose the isolation.
Far worse, take a look at the methods:
getHibernateStore()
isSQL()
updateDatabase()
...
I mean why are those methods in XWiki.java instead of in some store
class. Those methods are encouraging bad code. Because
those methods are making assumptions about the XWiki storage.
And the problem with them is that they tend to promote
code like 3)
3) Reinventing OO:
I better explain this with an example, this is a method in XWiki.java:
public List getSpaceDocsName(String spaceName, XWikiContext context)
throws XWikiException
{
List docs = null;
if (getNotCacheStore() instanceof XWikiHibernateStore) {
docs = this.search("select distinct
doc.name from XWikiDocument doc",
new Object[][] {{
"doc.web",
spaceName}},
context);
} else if (getNotCacheStore() instanceof XWikiJcrStore)
{
docs = ((XWikiJcrStore)
getNotCacheStore()).getSpaceDocsName(spaceName,
context);
}
What are we doing here, we are doing a special case depending on
the store subclass... Sadly this is done in many places in XWiki,
so when I decide to add a new storage, I have to go to all of these
places and add another else if statement. No way!
Why not just do a dispatching call, that is what OO is for ;)
Ok, so I really think we should start fixing this for XWiki 2.0.
What I propose for the above points:
1) Instead of adding new methods to XWiki.java, try to fit
them in a more appropriate place or even create a new class.
2) Start working on real isolation. To support old versions,
mark the "bad methods" as deprecated and provide nice interfaces
that do not make assumptions about the implementation.
I'm happy, for storage I think Artem Melentyev is going to
improve his QueryPlugin during Soc, so this will be great ;)
3) Factor the hand-made dispatchs scattered in the XWiki codebase,
with dispatching.
I believe this is a first step before moving towards component based
architecture.
I have tried to tackle some of these problems, here is a patch.
Do not hesitate to criticize it, it is not supposed to be anything
else than a proof of concept because I think design issues should
really be discussed before doing any drastic changes.
I have tested it and believe it does not break anything, yet I
have a small doubt, maybe some XWiki expert can enlighten me:
in xwiki.setUserDefaultGroup() a call to saveXWikiObject hibernate
specific method is done.
The question is is the following equivalent and store agnostic ?
getDocument + addObject + saveDocument <=> getDocument + addObject + saveXWikiObject
If not how are we supposed to save the Object when we are not using hibernate ?
Thanks,
Pablo
Hi,
We need to improve our release notes for migrating from a 0.9 wiki to
1.0. I've seen a comment on
http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXWiki10RC3 that
it's not working as described.
It would help a lot if someone who's done it or who's doing it step
forward so that we can work together to make it work/document it.
Thanks a lot
-Vincent
I wish to contribute to xwiki. To begin with, I started configuring my development environment for xwiki. I have checkout out the xwiki project through svn (svn://sanjayjaiswar@svn.forge.objectweb.org/svnroot/xwiki/xwiki/branches/XWIKI_WYSIWYG_NEWARCHI).
I am using is MS Sql Server with Tomcat. I modified the hibernate.cfg.xml
<!-- SQL Server configuration -->
<property name="connection.url">jdbc:inetpool:inetdae7:stgdbsrv:1433?database=sjaiswar_xwiki_inf</property>
<property name="connection.username">sa</property>
<property name="connection.password">sjaiswar</property>
<property name="connection.driver_class">com.inet.pool.PoolDriver</property>
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
The appropriate jdbc driver is also there in xwiki's lib directory.
I am getting the following database error.
14:08:40,409 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome XWikiHibernateBaseStore:updateSchema:340 - Failed updating schema: [STGDBSRV]The size (60000) given to the column 'XWO_CUSTOM_MAPPING' exceeds the maximum allowed for any data type (8000).
It seems as the seed data are not inserted, because of which there are other invoked errors.
The database driver is registered but there are datatype size limitation errors.
I hope the database schema file is xwiki_db.log. I am not even able to manually execute the queries in SQL Analyzer as the queries are not getting to the Query Analyzer due to oversize.
I am referring the Community resources & documentation. But then too can anybody help me how to begin with.
----------------------------------------------------------------------
LOG MESSAGES
14:08:40,409 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome XWikiHibernateBaseStore:updateSchema:340 - Failed updating schema: [STGDBSRV]The size (60000) given to the column 'XWO_CUSTOM_MAPPING' exceeds the maximum allowed for any data type (8000).
14:08:40,440 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 208, SQLState: S0002
14:08:40,455 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Invalid object name 'xwikidoc'.
14:08:40,455 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 8180, SQLState: 01000
14:08:40,455 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Statement(s) could not be prepared.
14:08:40,471 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 208, SQLState: S0002
14:08:40,471 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Invalid object name 'xwikidoc'.
14:08:40,471 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 8180, SQLState: 01000
14:08:40,471 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Statement(s) could not be prepared.
14:08:40,471 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 208, SQLState: S0002
14:08:40,471 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Invalid object name 'xwikidoc'.
14:08:40,471 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 8180, SQLState: 01000
14:08:40,471 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Statement(s) could not be prepared.
14:08:40,487 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 208, SQLState: S0002
14:08:40,487 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Invalid object name 'xwikidoc'.
14:08:40,487 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 8180, SQLState: 01000
14:08:40,487 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Statement(s) could not be prepared.
14:08:40,549 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 208, SQLState: S0002
14:08:40,549 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Invalid object name 'xwikidoc'.
14:08:40,565 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 8180, SQLState: 01000
14:08:40,565 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Statement(s) could not be prepared.
14:08:40,643 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 208, SQLState: S0002
14:08:40,643 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Invalid object name 'xwikidoc'.
14:08:40,643 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 8180, SQLState: 01000
14:08:40,643 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Statement(s) could not be prepared.
14:08:42,424 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome XWikiHibernateBaseStore:updateSchema:340 - Failed updating schema: [STGDBSRV]The size (60000) given to the column 'XWO_CUSTOM_MAPPING' exceeds the maximum allowed for any data type (8000).
14:08:42,424 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 208, SQLState: S0002
14:08:42,424 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Invalid object name 'xwikidoc'.
14:08:42,424 WARN http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:71 - SQL Error: 8180, SQLState: 01000
14:08:42,424 ERROR http-8080-Processor25 http://localhost:8080/xwiki/bin/view/Main/WebHome JDBCExceptionReporter:logExceptions:72 - [STGDBSRV]Statement(s) could not be prepared.
com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document XWiki.CalendarEvent
Wrapped Exception: Error number 3211 in 3: Exception while updating archive XWiki.CalendarEvent
Wrapped Exception: Error number 3212 in 3: Exception while loading archive -237,561,194
Wrapped Exception: could not load an entity: [com.xpn.xwiki.doc.XWikiDocumentArchive#-237561194]
at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:314)
at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:100)
at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:94)
at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:891)
at com.xpn.xwiki.plugin.calendar.CalendarPlugin.getCalendarEventClass(CalendarPlugin.java:84)
at com.xpn.xwiki.plugin.calendar.CalendarPlugin.init(CalendarPlugin.java:293)
at com.xpn.xwiki.plugin.XWikiPluginManager.initPlugin(XWikiPluginManager.java:132)
at com.xpn.xwiki.plugin.XWikiPluginManager.addPlugin(XWikiPluginManager.java:71)
at com.xpn.xwiki.plugin.XWikiPluginManager.addPlugins(XWikiPluginManager.java:97)
at com.xpn.xwiki.XWiki.preparePlugins(XWiki.java:709)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:663)
at com.xpn.xwiki.XWiki.<init>(XWiki.java:566)
at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:281)
at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:382)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:96)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:121)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationValve.java:346)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
Wrapped Exception:
com.xpn.xwiki.XWikiException: Error number 3211 in 3: Exception while updating archive XWiki.CalendarEvent
Wrapped Exception: Error number 3212 in 3: Exception while loading archive -237,561,194
Wrapped Exception: could not load an entity: [com.xpn.xwiki.doc.XWikiDocumentArchive#-237561194]
at com.xpn.xwiki.store.XWikiHibernateVersioningStore.updateXWikiDocArchive(XWikiHibernateVersioningStore.java:249)
at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:239)
at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:100)
at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:94)
at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:891)
On May 1, 2007, at 5:13 AM, David Ward wrote:
> Author: dward
> Date: 2007-05-01 05:13:01 +0200 (Tue, 01 May 2007)
> New Revision: 3053
>
> Added:
> xwiki-apps/gelc/gelcv1/trunk/gelc/src/main/xwiki/Coll_Templates/
> xwiki-apps/gelc/gelcv1/trunk/gelc/src/main/xwiki/Coll_Templates/
> s2ZxMIMgmMrQFl7q
> Log:
> - Joshua wants this template to be committed
I love those commit comments :)
-Vincent