Hi,
Im trying to fix http://jira.xwiki.org/jira/browse/XWIKI-4274
Basically if you do $xwiki.getDocument("someDoc").getRenderedContent()
it'll get executed in the context of the current doc which I believe
is wrong especially since other signatures of getRenderedContent()
execute in the target document's context.
I have fixed this locally but found that admin.vm for example is
assuming that getRenderedContent() will get executed in the context of
the calling doc (i.e. XWiki.Import when doing an import for example).
FYI the chain flow is admin.vm -- getRenderedContent() -->
XWiki.AdminSheet --> XWiki.AdminImportSheet --> importinline.vm, which
requires the current doc to be XWiki.Import (to get/put attachments
from/to it).
I can fix this easily using a new getRenderedContent signature I've
introduced.
However I'm wondering if we have other places that incorrectly use
getRenderedContent() and assume it won't be rendered in the context of
the target document.
Is this change too dangerous to make? If not know, we'll need to it
quickly (2.1M1?) since it's an important bug IMO.
WDYT?
Thanks
-Vincent
Could be useful:
http://ocpsoft.com/prettytime/
Idea of usage: For ex we could use that to show the last modified
document dates for dates in the past week (for ex):
"Document created 2 days ago"
It's in the maven central repo and it's under LGPL
-Vincent
Hi there,
I'd like to start a overhaul of the xwiki.org home page + a first
level navigation overhaul.
Today:
* Home page = list the different products
* First level nav = the ecosystem panel
Problems:
* We now have a single product: XE and all the others are actually
modules that plugin into the main products. Hence we shouldn't focus
on other products so much IMO.
* I'd like to view xwiki.org as a forge of projects. Today our top
level projects are the ones listed here: http://svn.xwiki.org/svnroot/xwiki/
* The main page should be more dynamic and show some news and activity
instead of being static
* People are confused by the top level navigation vs the second level
one because they both use panels and it's not easy to differentiate them
Proposal:
* Use a horizontal top level navigation with the following items (from
left to right):
- Overview or Home (the main page)
- Platform
- Projects (when clicked will list all top level projects) - We could
have the list of subproject available as submenu items too (as it's
done on http://jboss.org/)
- Support (when clicked will explain the various ways to get support
including mailing list/forum, irc/jabber, FAQ & listing companies
offering commercial support)
- Contribute or Community (when clicked we'll get dev.xwiki.org)
- Playground
This means that the panels on the right will become the second level
navigation and the content will depend completely on where you are on
the site.
* Have some facilities links in the header on the right:
- News
- Downloads (as a visible button maybe)
* On the home page:
- Have a nice diagram of the xwiki platform that shows how XE, XE
modules are positioned on the platform so that people understand right
away that xwiki is a collaborative web dev platform
- Have a Highlight box with XE so that users looking for a full-
fledged wiki can quickly see it and click on it + maybe one featured
screenshot of an entry from the References page that would be
different every time the page is refreshed (this could encourage
people to add references + provide a link to the references directly)
- Have a Featured project box and list 3-4 featured projects (XE, XEM,
XEclipse, XOffice for ex to start with)
- Have some news:
-- latest 5 blog post titles
-- latest 5 code zone additions (all snippet, plugins, macro, apps,
etc included)
-- latest 5 mailing list threads subjects (with links to our nabble
forum)
We could not have any second level navigation for the home page in
order to have more space for displaying the elements above.
WDYT?
If/when we're ok in term of content maybe Cati (or anyone interested)
could provide some mockups of what it could look like.
Thanks
-Vincent
PS: Let's not get bogged down with details at this point. I think
what's important is to make progress and refine later on. What's
important is that we agree on the broad lines at this stage.
Hi,
This is following the proposal done here some time ago:
http://markmail.org/message/nnybto3mluvp2rov
Since we now have a generic Script notion we need to revisit it in
that light. Also we really need to implement it now since more and
more components are put in the velocity context (office importer,
syntax factory, etc) and we need to bring some order.
Here's a new generic proposal:
Short term
========
* The variable "services" is bound in the script context. For ex in
Velocity: $services
* The Services object (ScriptServiceManager) has a ScriptService
get(String serviceName) method which returns the service
* We use the namespace: services.<module name>.<method>. Each module
provides only one service entry point.
* ScriptService interface (empty interface) represents a service to
be bound in the context
* ScriptServiceManager.get() looks for all components of role
ScriptService and returns the component matching the the name as the
component hint.
Ex:
@Component("mymodule")
public class MyModuleScriptService implements ScriptService,
MyModuleBusinessInterface
{
public void myMethod() {}
}
In script:
{{velocity}}
$services.mymodule.myMethod
{{/velocity}}
Medium term
==========
* We handle @authorization(Authorization.PROGRAMMING) annotations to
check for access rights. To do this in ScriptServiceManager.get() we
use a Dynamic Proxy to implement MyModuleBusinessInterface (we
probably need a ScriptService.getInterface() method to make it
unambiguous). The Dynamic Proxy checks the annotation before proxying
to the real object.
WDYT?
Thanks
-Vincent
PS: This is to answer Sergiu's question about where is
getAvailableParserSyntaxes() from my other mail... ;) Answer: It would
be in RenderingScriptService.
Hi devs,
We need to define a strategy for better handling translations. I've
had a call with Guillaume and Jean-Vincent and here's the process we'd
like to propose:
* One person is in charge of http://l10n.xwiki.org/. This means
monitoring the work there, coordinating validation of key values and
ensuring validated translations are incorporated in the source tree.
Guillaume is willing to take that role for now.
* The XE release manager has the responsibility of taking the
validated keys on l10n.xwiki.org and committing them during the
Milestone 2 dev (before the RC1).
* The l10n manager should ping the release manager whenever there are
translated and validated keys ready to be incorporated or if there
have been important changes to be included in the release after M2 has
been released.
* The l10n manager should test XE and the applications after the keys
have been applied to ensure quality. Basically the l10n manager is
responsible for the quality of translations in general.
Here's my +1
Thanks
-Vincent
Hi,
Wiki macros currently require programming rights and thus are limited
and in addition cannot be created in subwikis by the majority of users.
Since I've now almost finished implementing component isolation I'd
like to agree on what we want for wiki macros.
Proposal:
* Modify the wiki macro class to add a "Visibility" field with 2 values:
- visible only in the current wiki
- visible to everyone
* Visible to everyone will require admin rights
* Make the macro available to a user only if that user has view rights
to the wiki macro page. This is to allow making a wiki macro private
(when testing for example). It also allows making a macro visible only
to a given group of users.
Note: I considered having a "visible only to the current user" value
for the Visibility field but I don't think it means much since if
someone else edit the page and saves it, then suddenly the macro
becomes visible only to that person...
WDYT?
Thanks
-Vincent
Hi,
We have the need to isolate groups of components. For ex a wiki macro
created in a subwiki should only be visible in that subwiki by default.
Here's an implementation proposal that I'm planning to implement:
* There's a Root Component Manager (the current CM)
* There are 3 components which implement the ComponentManager role and
with 3 hints: "wiki", "user" and "all". There's a
CompositeComponentManager class that allows chaining CM and the "all"
CM chains the "default" (root CM), "wiki" CM and "user" CM. This works
the same as with the configuration module.
* Other components can have CMs injected as they want (if not
specified then it's the default, etc). For ex:
@Requirement("all")
private ComponentManager cm
* Creation process. As for now the user creates the root CM and then
the annotation loader will create the descriptors for the other CMs
and register them against the root CM. They'll get instantiated once
(singleton) the first time they're looked up.
* In order to register a component for, say, a given "enterprise"
wiki, we need to add a new property to the ComponentDescriptor: get/
setAdditionalData(Object data). For example:
wikiCM.registerComponent(CD mycd) where
cd.setAdditionalData("enterprise").
* Last, Guice uses Modules to isolate component definitions so it
should be possible and relatively easy to port the implementation to
Guice (even though Guice uses static Modules we can make them dynamic).
WDYT?
Thanks
-Vincent
Hi,
As you knows, Import/Export operation on large XAR file cause problem.
We felt on an even worse situation, where a single XWiki document is
not properly exported due to heap exhaustion during the built of its
XML DOM or due to large attachments.
Having a look at the source, I have notice that many optimizations on
the way the export is produce could be quite easily introduced.
Currently, XWiki stored the exported document several times in memory
during the operation, which impact performance negativly and is
uselessly heavy on memory usage, even for reasonable documents.
Therefore, I have started a large patch to avoid these caveats, here
is the strategies I have followed:
1) The current implementation mostly build a DOM in memory for
immediately serialized it into a stream. So I have remove the
intermediate DOM and provide direct streaming of Element content by:
1.1) extending org.dom4j.XMLWriter to allow direct streaming
of Element content into the output stream, as is, or Base64 encoded.
Accessorily, my extension also ensure proper pairing of open/close tag.
1.2) writing a minimal DOMXMLWriter which extends my XMLWriter and
could be used with the same toXML() code to build a DOMDocument to
provide the toXMLDocument() methods to support the older
implementation unchanged if ever needed.
1.3) using the above, minimal change to the current XML code was
required
1.3.1) replacing element.add(Element) by either writer.writeElement)
or writer.writeOpen(Element)
1.3.2) for large content, use my extensions, either
writer.write(Element, InputStream) or writer.writeBase64(Element,
InputStream) which use the InputStream for the element content
2) The current implementation for binary data such as attachments and
export zip file is mostly based on in memory byte[] passing from
function to function while these data initially came from a
request.getInputStream() or are written to a response.getOutputStream
(). So I have change these to passover the stream instead of the data:
2.1) using IOUtils.copy when required
2.2) using org.apache.commons.codec.binary.Base64OutputStream
for base64 encoding when required
2.3) using an extension of ZipInputStream to cope with
unexpected close()
2.4) avoid buffer duplication in favor of stream filters
3) Since most oftently used large data came from the database through
an attachment content, it would be nice to have these attachment
streamed from the database when they are too large. However, I feel
that it is still too early to convert our binary into a blob, mainly
because HSQLDB and MySQL still does not really support blob, just an
emulation. These are also used to be cached in the document cache, and
this will require improvement to support blob. However I propose to
take the occasion to go in the direction of the blob by:
3.1) deprecating setContent(byte[]) and Byte[] getContent() in favor
of newly created setContent(InputStream, int), InputStream
getContentInputStream() and getSize()
3.2) Begin to use these new function as much as possible as 2) implied
3.3) this also open the ability to store attachment in another
repository that support better the streaming aspect (ie: a filesystem)
I am currently testing the above changes onto our client project, and
I expect to provide a patch really soon. It will require an upgrade of
org.apache.commons.codec to version 1.4, to have access to
Base64OutputStream.
I feel it will be a first step into the right direction, further
improvement should be to:
- import XML using a SAXParser without building a DOM in memory
- manage JRCS Archive better, the way they are built and store raise
the same issue then attachment
- manage the recycle bin better for the same reason
- improve caching to avoid caching very large stuffs
WDYT ?
Denis Gervalle
--
SOFTEC sa
http://www.softec.st
Hi devs,
We need to decide what to do with html macro content (or any other
RawBlock content) in plain text renderer.
For me the rule of plain text renderer should be to print anything we
are able to print which mean printing any pure text content and skip
styles for which obviously we don't have syntax. RawBlock content is
pure text so we should print it.
Note that first version of plain text renderer was printing html
content and it was lost when introducing RawBlock.
Here is my +1 for printing RawBlock content in plain text renderer.
WDYT ?
--
Thomas Mortagne