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
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)
Hi all,
I'd like to change the way the XML version of an XClass looks, because the
current version lacks XML design patterns ( http://www.xmlpatterns.com/ )
compliance, is not extensible and not intuitive enough. The changes will
preserve backwards compatibility, meaning that old XML classes will still be
recognized, but will be replaced with the new XML structure when changed. I
think this change is safe, as the only thing the XML version should be used
for is serialization/deserialization, so in general no other code or user
should use the raw XML.
Here is a proposed structure, illustrated by an example:
<xclass version="1.1" name="XWiki.XWikiPreferences">
<meta>
<customMapping>internal</customMapping>
<defaultViewSheet>XWiki.PreferencesSheet</defaultViewSheet>
<!-- empty fields like customClass, defaultWeb, validationScript, etc. will
not be written in the XML, as they only consume space. -->
</meta>
<properties>
<property name="admin_email">
<prettyName>Admin eMail</prettyName>
<customDisplay></customDisplay>
<validationRegExp></validationRegExp>
<unmodifiable>0</unmodifiable>
<size>30</size>
<name>admin_email</name>
<number>14</number>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</property>
</properties>
</xclass>
WDYT?
Sergiu
--
http://purl.org/net/sergiu
Hi XWiki developers,
Till now I have been using mostly the Wiki editor of XWiki. Probably
because I'm too used to the wiki syntax and I find it faster. However
our WYSIWYG editor is a very very key feature of XWiki (users need it
and use it - They don't usually use the wiki editor, it's mostly
developers who uses it) and I suspect most of us developers are using
the wiki editor as I've been doing. As we don't have automated
functional tests for the WYSIWYG editor yet, it means we're bound to
find regressions to it... We're also bound not to fix little
usability problems fast enough as we're not using it.
Thus starting from today I'll start using the WYSIWYG editor on
xwiki.org whenever I have to make some change and report on JIRA or
here when I find issues. I'd like to propose that xwiki developers
try doing this too as much as possible. This should allow us to
improve it quickly.
WDYT?
Thanks
-Vincent
Thank you all very much for your quick response. I will try to do as suggested and hope it will work right for me. Thank you once again Vincent, Sergiu and Stephane.
And yes, I will continue this post on xwiki-users, if neccessary, as Stephane said.
Evelina Slatineanu
The XWiki development team team is pleased to announce the
availability of the 1.0 RC 3 release.
Go grab it on http://www.xwiki.org/xwiki/bin/view/Main/Download
This release is planned to be promoted as the final 1.0 release next
week if no critical bug is found till then.
New in this release:
Bugs fixed:
* Filter conflict: external links can be rendered two times. This
fixes a problem with some absolute URLs in wiki pages that make XWiki
hang.
* The link to the user profile is broken for non-local users
* Links to virtual wikis broken when using XWiki behind a proxy
* The top menu entry shadow disappears when hovering
* Generated PDF loses paragraphs
Improvements:
* Make password type HASH by default
IMPORTANT: XWiki 1.0 RC 2 and RC 3 fix an important security issue in
past releases where passwords were stored in clear in the database.
Passwords are now hashed. If you are upgrading from a previous
version, any new user or any password update will automatically get
the password hashed. However existing users who do not change their
passwords will still have their passwords in clear in the database.
Thus, we are providing a tool to automatically hash all passwords
from an existing database.
See the full release notes on http://www.xwiki.org/xwiki/bin/view/
Main/ReleaseNotesXWiki10RC3
Enjoy
-The XWiki development team
Hello,
I have the following question regarding relationing 2 classes in xwiki. I made a class Person with 2 properties (firstName, lastName) and a class Media with a prop. (title) and then I made an object "Richard Gere" of class person and 2 objects "Pretty Woman" and "Autumn at New York" of class Media. Now I would like to link somehow the 3 objects, i.e to say that Richard Gere played in "Pretty Woman" and also in the other movie (media). How can I do that? I don't seem to understand how to link the already created objects one with another. For instance, I cannot create another class with 2 properties, one of type Media and one of type Person, because these types don't appear under "Type" on "Add Property" panel.
Please help me understand how can I do that in xwiki.
Ps. I heard something about attachments but I don't really understand how...
Thank you.
Evelina Slatineanu
(sorry forgot the subject in my previous email)
Hi everyone,
I've staged the RC3 release on http://www.xwiki.org/10rc3/
It would be nice if some of you could quickly try it out (we'd like
to release ASAP) and let us know if it's working as expected. Once we
get a few confirmations we'll officially release it. We'd like to do
this tonight so that we can leave some time for users to install RC3
before we declare it the 1.0 finale version on next wednesday.
You can check the release notes on
http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXWiki10RC3
Thanks a lot
-Vincent (on behalf of the XWiki dev team)
Hi everyone,
I've staged the RC3 release on http://www.xwiki.org/10rc3/
It would be nice if some of you could quickly try it out (we'd like
to release ASAP) and let us know if it's working as expected. Once we
get a few confirmations we'll officially release it. We'd like to do
this tonight so that we can leave some time for users to install RC3
before we declare it the 1.0 finale version on next wednesday.
You can check the release notes on
http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXWiki10RC3
Thanks a lot
-Vincent (on behalf of the XWiki dev team)
Hi,
I'd like to remove the DataSource reference in web.xml (for 1.1 Beta 1):
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/XWikiDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
it's defined in there but our default hibernate config doesn't use
it, so it's not used by default... but forces users using an app
server to create a fake DS as is described for example in the install
notes for Websphere and jboss.
We also need to document how to configure xwiki to use the app server
DS.
For example see:
http://mail-archive.objectweb.org/xwiki-dev/2005-06/msg00124.html
But I think our default should be the simplest possible ie without DS.
WDYT?
Thanks
-Vincent