On 02/11/2010 05:49 PM, vmassol (SVN) wrote:
> Author: vmassol
> Date: 2010-02-11 17:49:55 +0100 (Thu, 11 Feb 2010)
> New Revision: 26953
>
> Modified:
> platform/web/trunk/standard/src/main/webapp/templates/xwikivars.vm
> Log:
> Improved doc
>
> Modified: platform/web/trunk/standard/src/main/webapp/templates/xwikivars.vm
> ===================================================================
> --- platform/web/trunk/standard/src/main/webapp/templates/xwikivars.vm 2010-02-11 16:07:23 UTC (rev 26952)
> +++ platform/web/trunk/standard/src/main/webapp/templates/xwikivars.vm 2010-02-11 16:49:55 UTC (rev 26953)
> @@ -3,7 +3,9 @@
> #set($isSuperAdmin = ($context.user == 'XWiki.superadmin'))
> #set($hasEdit = $xwiki.hasAccessLevel("edit"))
> #set($hasAdmin = $xwiki.hasAccessLevel("admin"))
This is so bad for the performance... Fills the cache with unneeded
entries, makes two unneeded queries to the database (the random document
plus the WebPreferences), and goes through the complex full rights check
each time.
> +## Note: In order to know if the user has the right to create a space we compute a space name that doesn't exist and check edit rights on that space
> #set($hasCreateSpace = $xwiki.hasAccessLevel("edit", "${doc.space}${mathtool.random(0, 999)}.DocumentReservedForInternalXWikiUsage"))
> +## Note: In order to know if the user has the right to create a page we compute a page name that doesn't exist and check edit rights on that page
> #set($hasCreatePage = $xwiki.hasAccessLevel("edit", "${doc.space}.DocumentReservedForInternalXWikiUsage${mathtool.random(0, 999)}"))
> #set($hasGlobalAdmin = $xwiki.hasAccessLevel("admin", $context.user, "XWiki.XWikiPreferences"))
> #set($hasSpaceAdmin = $xwiki.hasAccessLevel("admin", $context.user, "${doc.space}.WebPreferences"))
--
Sergiu Dumitriu
http://purl.org/net/sergiu/
Hi devs,
I'm proposing we add to org.xwiki.rendering.macro.descriptor.MacroDescriptor
[0] the following methods:
1/ MacroId getId();
2/ String getCategory(); // Note: Actually it should allow multiple
categories for one macro, not just one,
because usually this is the case
There is a method called getDefaultCategory() in MacroDescriptor:
String getDefaultCategory();
, but it is not the final category, as it can overridden by the wiki Admin.
(see method comment in api)
So, right now, if you have a list of MacroDescriptors, there is no way of
telling which is the ID or the real
category of each macro.
Also, there is no "getRealMacroCategory by macroId"-like method neither in
MacroCategorymManager [1],
nor in MacroManager [2].
We should either have a getCategory() or getCategories() method in
MacroDescriptor, or a
getMacroCategory(MacroId macroId)/getMacroCategories(MacroId macroId) in
MacroManager/MacroCategoryManager.
Right now, whenever someone needs to add id or category to the macro
descriptor, ends up creating
their own MacroDescriptor class, which is the case of
org.xwiki.gwt.wysiwyg.client.plugin.macro.MacroDescriptor [3]
or in my case.
More about why I need the macroId in the MacroDescriptor:
- I need a component that returns the list of all macros (both XWiki Java
Macros and XWiki Wiki Macros)
in Velocity. The list needs to be sorted by the Macro Name, and not by the
Macro ID.
- Once I get the list, I need to display the info for each of them, plus a
link to their wiki page (nonexistent at this point).
Wiki Macros do have wiki pages (the ones with a XWiki.WikiMacroClass object
attached), but the Java Macros don't.
For the Java Macros, we could use the MacroId in the URL to identify the
macro.
Note: I cannot use
org.xwiki.gwt.wysiwyg.client.plugin.macro.MacroDescriptor, because my
component
would depend on the gwt.wysiwyg module, and has nothing to do with it.
Related Questions:
1/ How can I tell of which type is a macro (Wiki or Java), if I have its
macro descriptor/id?
2/ How can I get the wiki page with the XWiki.WikiMacroClass for a given
Wiki Macro, if I have
its descriptor/id?
So far, I couldn't think of anything better than doing a HQL for the
document with a XWiki.WikiMacroClass
object with the property macroId set to the one I'm looking for. Code
snippet follows:
#set($macros = $gadgets.getMacroDefinitions())
#foreach($m in $macros)
#set($hql = "select doc.fullName from XWikiDocument doc, BaseObject obj,
StringProperty prop where
doc.fullName=obj.name and obj.className='XWiki.WikiMacroClass' and
prop.id.id=obj.id and prop.name='id'
and prop.value='${m.getMacroId().id}'")
#set($results = $xwiki.search($hql))
#if($results.size() > 0)
#set($macroDoc = $results.get(0))
...
Thanks,
Anamaria
[0]
http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-rendering/xwik…
[1]
http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-rendering/xwik…
[2]
http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-rendering/xwik…
[3]
http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/xwiki-gwt-wysiwyg-cli…
Hi,
I have 2 questions related to Macros:
1/ How can I tell of which type is a macro (Wiki or Java), if I have its
macro descriptor/id?
2/ How can I get the wiki page with the XWiki.WikiMacroClass for a given
Wiki Macro, if I have
its descriptor/id?
So far, I couldn't think of anything better than doing a HQL for the
document with a XWiki.WikiMacroClass
object with the property macroId set to the one I'm looking for. Code
snippet follows:
#set($macros = $gadgets.getMacroDefinitions())
#foreach($m in $macros)
#set($hql = "select doc.fullName from XWikiDocument doc, BaseObject obj,
StringProperty prop where
doc.fullName=obj.name and obj.className='XWiki.WikiMacroClass' and
prop.id.id=obj.id and prop.name='id'
and prop.value='${m.getMacroId().id}'")
#set($results = $xwiki.search($hql))
#if($results.size() > 0)
#set($macroDoc = $results.get(0))
...
, $gadgets.getMacroDefinitions() - is a custom component which returns a
list of
org.xwiki.rendering.macro.descriptor.MacroDescriptor's with all the macros
in the wiki
Thanks,
Anamaria
The problem:
When a new wiki administrator uses the registration application, they are faced with a set of fields with
names which are too short to explain what each field is for.
eg:
Boolean field named: "Check Active fields for user authentication"
To a new administrator, this is confusing and it's not apparent where to look for an explanation.
Proposal:
I would like to add fields with names which are links to descriptions of what those fields are for.
I can implement this in the "configurable" class which I am working on.
This means XE would have links to xwiki.org but it already does on the dashboard explanation of tags.
WDYT?
Caleb
Hi,
I need some help configuring Glassfish-managed DataSource for XWiki
Enterprise (stable 2.1.1).
In short, does anyone know how to tweak WEB-INF/hibernate.cfg.xml so
that Hibernate uses a JNDI resource that has been configured in
Glassfish? (for instance, i've defined jdbc/xwiki in Glassfish and would
like Hibernate to use it instead of the settings provided inside
WEB-INF/hibernate.cfg.xml).
The long version:
I'm trying to do a manual installation (as in:
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Installation#HInstallin… )
on a Glassfish v3 app server, and would like to use a Glassfish managed
datasource (let's say using JNDI jdbc/xwiki as javax.sql.DataSource).
I haven't found explicit details on how to do this, so i started by
commenting out line
xwiki.store.hibernate.path=/WEB-INF/hibernate.cfg.xml
inside file WEB-INF/xwiki.cfg
and uncommenting the following inside WEB-INF/web.xml so that it's used
instead:
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/xwiki</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
But this gave me the following error when, after deploying to Glassfish,
i tried to go to http://localhost:8080/xwiki/bin/view/Main/
>HTTP Status 500 -
>type Exception report
>
>message
>
>descriptionThe server encountered an internal error () that prevented
>it from fulfilling this request.
>
>exception
>
>javax.servlet.ServletException: com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main XWiki context
>Wrapped Exception: Error number 3001 in 3: Cannot load class com.xpn.xwiki.store.migration.hibernate.XWikiHibernateMigrationManager from param xwiki.store.migration.manager.class
>Wrapped Exception: Error number 0 in 3: Exception while hibernate execute
>Wrapped Exception: Hibernate Dialect must be explicitly set
>
>root cause
>
>com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main XWiki context
>Wrapped Exception: Error number 3001 in 3: Cannot load class com.xpn.xwiki.store.migration.hibernate.XWikiHibernateMigrationManager from param xwiki.store.migration.manager.class
>Wrapped Exception: Error number 0 in 3: Exception while hibernate execute
>Wrapped Exception: Hibernate Dialect must be explicitly set
Glassfish logs contain the following two logs of this error:
>53:44,236 [http://localhost:8080/xwiki/bin/view/Main/] WARN
>UserSuppliedConnectionProvider - No connection properties specified -
>the user must supply JDBC connections
and also
>53:44,269 [http://localhost:8080/xwiki/bin/view/Main/] WARN
>action.RequestProcessor - Unhandled Exception thrown: class
>com.xpn.xwiki.XWikiException
They seem to show that i need to use WEB-INF/hibernate.xml.cfg
to set up the proper vendor Dialect
So i modified WEB-INF/xwiki.cfg so to use the line:
xwiki.store.hibernate.path=/WEB-INF/hibernate.cfg.xml
Then, inside WEB-INF/hibernate.cfg.xml i ONLY uncommented the line
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
keeping all others (connection.username, connection.password ...)
commented so to check that the ones provided by Glassfish are being used
instead.
After undeploying previous and deploying this modified version i get a
different error when trying to visit
http://localhost:8080/xwiki/bin/view/Main
>HTTP Status 500 -
>type Exception report
>message
>
>descriptionThe server encountered an internal error () that prevented
>it from fulfilling this request.
>
>exception
>
>javax.servlet.ServletException: com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main XWiki context
>Wrapped Exception: Error number 3001 in 3: Cannot load class com.xpn.xwiki.store.migration.hibernate.XWikiHibernateMigrationManager from param xwiki.store.migration.manager.class
>Wrapped Exception: Error number 0 in 3: Exception while hibernate execute
>Wrapped Exception: Errors in named queries: listGroupsForUser, getSpaceDocsName, getAllUsers, getAllDocuments, getSpaces, getAllPublicDocuments, getAllSpaceDocuments
>
>root cause
>
>com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main XWiki context
>Wrapped Exception: Error number 3001 in 3: Cannot load class com.xpn.xwiki.store.migration.hibernate.XWikiHibernateMigrationManager from param xwiki.store.migration.manager.class
>Wrapped Exception: Error number 0 in 3: Exception while hibernate execute
>Wrapped Exception: Errors in named queries: listGroupsForUser, getSpaceDocsName, getAllUsers, getAllDocuments, getSpaces, getAllPublicDocuments, getAllSpaceDocuments
>
And in Glassfish logs:
>19:04,638 [http://localhost:8080/xwiki/bin/view/Main/] WARN
>UserSuppliedConnectionProvider - No connection properties specified -
>the user must supply JDBC connections
and seven more like this one (i truncated the whole stack) that match
the errors in named queries reported above (listGroupsForUser,
getSpaceDocsName,getAllUsers,getAllDocuments,getSpaces,getAllPublicDocuments and getAllSpaceDocuments) :
>19:05,013 [http://localhost:8080/xwiki/bin/view/Main/] ERROR
>impl.SessionFactoryImpl - Error in named query: listGroupsForUser
>org.hibernate.hql.ast.QuerySyntaxException: XWikiDocument is not mapped
>[ select distinct doc.fullName from XWikiDocument as doc, BaseObject as
>obj, StringProperty as prop where obj.name = doc.fullName and
>obj.className='XWiki.XWikiGroups' and obj.id = prop.id.id and
>prop.id.name='member' and (prop.value=:username or
>prop.value=:shortname or prop.value=:veryshortname) ]
This time the errors seem related to the searches themselves...
I think that what might be happening is that Hibernate is not really
configured to be using Glassfish datasource, but instead it expects to
use the connection.username, connection.password,
connection.driver_class, connection.pool_size ... properties defined in
WEB-INF/hibernate.cfg.xml that i've commented out because i'd like to
use Glassfish-configured datasource.
I need help, so as to keep the properties that Hibernate reads from
WEB-INF/hibernate.cfg.xml to a minimum and pointing it to
Glassfish-defined JNDI resource instead.
Thank you very much !
Guillem Plasencia
The problem:
Each time an xar application is added, if it is to be configured it must alter XWikiPreferences and the administration
application making the separation of different applications meaningless.
The goal:
Ability to install an application from an xar file and have configuration appear on the appropriate administration sheet,
also the ability to remove an application easily without leaving anything behind.
My proposal:
Add a class called XWiki.Configurable, any document which contains an object of this class is pulled into the appropriate
administration sheet via an includeForm call.
Concerns:
Upgradeability - We must be able to save the old configuration when the user does an update.
I think this should be up to the individual application to detect that it has been updated, get it's configuration back
from the document history and reinstall the old configuration.
Security - We can't allow just anyone to create a page which will be pulled into the administration sheet.
It must be limited to those with admin or programming rights.
The Configurable class:
I think it should contain two fields, one telling which administration sheet it should be displayed on and the other
holding a version number which is incremented every time an application's configuration changes such that it cannot
simply copy the old configuration into the updated application, much like the database is numbered according to the
revision number of the last schema change.
WDYT?
Caleb
The XWiki development team is pleased to announce the release of XWiki
Enterprise 2.2 RC 2.
Go grab it at http://www.xwiki.org/xwiki/bin/view/Main/Download
This release is mostly a bugfix and stabilization release.
Main changes from XWiki Enterprise 2.2 Release Candidate 1:
* Several bugfixes on WYSIWYG and rendering
* Several bugfixes on references refactoring
* Use current database instead of current document database in
Current*ReferenceResolver
* New user profile pages are created in XWiki Syntax 2.0
* New zh_TW translation
For more information see the Release notes at:
http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXWikiEnterprise22RC2
Thanks
-The XWiki dev team
The XWiki development team is pleased to announce the release of XWiki
Enterprise and XWiki Enterprise Manager 2.1.2
Go grab it at http://www.xwiki.org/xwiki/bin/view/Main/Download
Important bug fixes since 2.1.1:
* XWIKI-4712 : Account Validation always fails
* XWIKI-4615 : HTML export does not support Colibri skin
* XWIKI-4695 : [regression] Private RSS feeds with Basic
authentication does not work in some RSS clients
* XWIKI-4708 : Double URL decoding of the document name
* XWIKI-4709 : After editing a blog post and clicking "Preview" and
"Back to edit" you are taken to page editing instead of blog post
editing
* XWIKI-4717 : Empty table cells not parsed correctly
* XWIKI-4670 : WYSIWIG editor in Xwiki is slow under IE7
* XWIKI-4782 : Including a sheet in 2.0 syntax from a page in 1.0
syntax fails to display properly
* XWIKI-4866 : Wrong skins/resources URLs generated on path based subwiki
* XWIKI-4822 : Using XML symbols (<, >, &) inside the user's name
breaks various parts of the UI and causes the PDF export to throw
exceptions
* XWIKI-4665 : Pressing Meta+G (Jump to page) in the WYSIWYG editor
displays the popup inside the rich text area
* XWIKI-4871 : Message macro does not support non inline content
WYSIWYG:
* XWIKI-4733 : Link is duplicated after being edited
* XWIKI-4734 : Link changes style after being edited
* XWIKI-4777 : Page titles are not interpreted when displayed in the
Link dialog
* XWIKI-4197 : No default font name and font size in IE 6&7
For more information see the Release notes at:
http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXWikiEnterprise212http://www.xwiki.org/xwiki/bin/view/Main/ReleaseNotesXEM212
Thanks
-The XWiki dev team
I asked the Scala group about the availability of a JSR-223 implementation, so that XWiki could make use of it. Below is one response, and here is the URL of the thread, in case other responses are added there in the meantime:
http://old.nabble.com/JSR-223--td27529387.html
Those who are familiar with JSR-223 might find it useful.
Henry
On 10 Feb 2010, at 13:33, michid wrote:
> Story Henry <henry.story@...> writes:
>
>> I was just wondering if there is a good JSR-223 (plugin? Jar?) implementation
>> for Scala. This would allow tools such as XWiki to easily make it available
>> for scripting. Apparently if a language implements this,
>> they can provide it just by placing a jar in a special directory. These are
>> the jsr223 languages they support: Velocity, Groovy, Python, Ruby, PHP.
>
> Henry,
>
> I created a JSR-223 scripting engine for Apache Sling [1]. While it is used by
> Sling and is interoperable with OSGi, it can also be used independently from
> Sling and OSGi. The source is available from SVN [2] and there are some
> instructions [3] on how to use it though these are mainly targeted to Sling.
>
> Note however, that the scripting engine is different from REPL scripting. It
> only accepts 'real' Scala source entities as input. I chose this approach in
> order to be able to use existing tools for developing scripts (i.e. editor, IDE,
> debugging, unit testing).
>
> Michael
>
> [1] http://sling.apache.org/site/index.html
> [2] http://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/scala/script/
> [3] http://cwiki.apache.org/confluence/display/SLING/Using+Scala+with+Sling
>
>
>
When I deploy xWiki to an Oracle Application server 10.3 and try to access
the Wiki I get a 500 internal server error. The log file shows
com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main
XWiki context
Wrapped Exception: java.lang.reflect.InvocationTargetException
at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:341)
...
Wrapped Exception:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
Caused by: java.lang.SecurityException: Unauthorized access from
application: xwiki to MBean: java.lang:type=ClassLoading
at
oracle.oc4j.admin.jmx.shared.UserMBeanServer.checkRegisterAccess(UserMBeanServer.java:873)
>From what I can find out it is related to the security around Oracles JMX
and the MBeans in xWiki, but I cann't seem to find a way to fix it.
--
View this message in context: http://n2.nabble.com/Problems-installing-2-1-on-Oracle-OC4J-tp4548729p45487…
Sent from the XWiki- Dev mailing list archive at Nabble.com.