On Dec 29, 2008, at 10:49 AM, Ludovic Dubost wrote:
> Marius Dumitru Florea wrote:
>> ludovic (SVN) wrote:
>>
>>> Author: ludovic
>>> Date: 2008-12-29 10:10:55 +0100 (Mon, 29 Dec 2008)
>>> New Revision: 14946
>>>
>>> Modified:
>>> platform/web/trunk/standard/src/main/webapp/templates/
>>> editwysiwygnew.vm
>>> Log:
>>> XWIKI-3046 GWT Editor SyncPlugin: correct loading of initial
>>> content supporting images. Added a reset sync action
>>>
>>> Modified: platform/web/trunk/standard/src/main/webapp/templates/
>>> editwysiwygnew.vm
>>> ===================================================================
>>> --- platform/web/trunk/standard/src/main/webapp/templates/
>>> editwysiwygnew.vm 2008-12-29 09:10:38 UTC (rev 14945)
>>> +++ platform/web/trunk/standard/src/main/webapp/templates/
>>> editwysiwygnew.vm 2008-12-29 09:10:55 UTC (rev 14946)
>>> @@ -47,11 +47,16 @@
>>> hookId: 'content',
>>> #if($request.sync=="1")
>>> syncPage: '$doc.fullName',
>>> + plugins: 'separator text valign list indent undo format
>>> symbol link image table sync',
>>>
>>
>>
>>> + inputURL: "${request.contextPath}/
>>> com.xpn.xwiki.wysiwyg.Wysiwyg/empty.html",
>>>
>>
>>
> Well I need a read empty content, and the issue is that when
> parseTemplate returns empty this is not considered as ok and will
> generate an error. So I have to use a real static HTML. What I need is
> not the exact relative path but the server part name so that images
> display properly.
>
> This is currently working. This is good enough for now and specific to
> the sync method, since this is demo code. We can change it later.
Well this definitely needs comments since it's a hack and not an
obvious one.
Thanks
-Vincent
> Ludovic
>
>> Why do you need this empty.html? Did you try setting the wysiwyg
>> input
>> to an empty string?
>>
>> #set($ok = $wysiwygInput.put($wysiwygInputKey, "")) ?
>>
>> Plus, all the links and images will be relative to
>> ${request.contextPath}/com.xpn.xwiki.wysiwyg.Wysiwyg and this is
>> not good.
>>
>>
>>> + #if($request.reset=="1")
>>> + syncReset: 1,
>>> + #end
>>> #else
>>> inputURL: "${tdoc.getExternalURL("view",
>>> "xpage=wysiwyginput&key=$wysiwygInputKey")}",
>>> + plugins: 'separator text valign list indent undo format
>>> symbol link image table',
>>> #end
>>> syntax: "$doc.syntaxId",
>>> - plugins: 'separator text valign list indent undo format
>>> symbol link image table',
>>> toolbar: 'bold italic underline strikethrough | subscript
>>> superscript | unorderedlist orderedlist | outdent indent | undo
>>> redo | format | hr symbol | link unlink | image | inserttable
>>> deletetable | insertrowbefore insertrowafter deleterow |
>>> insertcolbefore insertcolafter deletecol',
>>> space: '${doc.space}',
>>> page: '${doc.name}',
Dear all,
I am starting a new thread because the old one started to be overloaded.
I have started to write some media types that could be used as the
representations returned by our RESTful API.
It's a first attempt but they already contain some ideas and the guiding
design principle I would like to follow.
You can find them on http://dev.xwiki.org/xwiki/bin/view/Design/RestfulAPI
Comments are welcome.
-Fabio
Hi,
We need to decide something: do we want to close old rendering/wysiwyg
issues as won't fix explaining that they are fixed in the new
rendering/new wysiwyg?
My take is the following:
* I don't think any xwiki committers will want to spend time fixing
old rendering/old wysiwyg issues since all our energy is spent on the
new versions
* We're going to have a XWiki Syntax 1.0 --> 2.0 converter soon
(before 16th of January)
* The new wysiwyg editor should also be usable before the 16th of
January
* If a contributor wants to fix some old rendering/old wysiwyg issue
he can create a new issues or reopen a closed one.
As a consequence I think we can close them as won't fix and explain
that the user should move to the new Syntax.
WDYT?
Thanks
-Vincent
Dear all,
I worked a bit on the design of the RESTful API and as a result I've
integrated what was written on the
http://dev.xwiki.org/xwiki/bin/view/Design/RestfulAPI page.
There is still a big and important part missing (maybe the most
important one), i.e., the one about the data formats for representations
(in particular the XML schemas to be used in requests and responses). I
am working on it.
Anyway you can already comment on what is present on the page.
Thank you.
-Fabio
Devs,
I'm working on integrating office importer functionality into our new
wysiwyg editor and I thought of sharing few ideas and different approaches
available to us so that you can comment on them and help me select the most
appropriate path.
First of all, a crude version of the integration is available at
http://91.121.237.216/xwiki/bin/view/Main/. You can login with asiri/asiri
and try editing the Main.WebHome page. You will notice the import button
placed right next to first 4 text formatting buttons.
Now the full version of the importer dialog will include two tabs. First
visible tag will allow a user to paste office content right into a local
rich-text-area and import them in place of the current selection in the
wysiwyg editor. The second tab allows the user to upload an office document
which will also be imported in place of the current selection. My idea is to
include the first tab's functionality into 1.8M1 release.
The general approach towards implementation is to introduce a new wysiwyg
plugin called "importer". The crude version mentioned above make use of the
default WysiwygService::cleanHTML() gwt rpc call for cleaning the pasted
html content. But for the actual implementation we have to introduce a new
importer specific gwt rpc call because the default cleanHTML() is not going
to be enough when cleaning html content comming from various office suits.
So here I propose we introduce WysiwygService::cleanOfficeHTML() gwt rpc
call.
The next question is about the implementation of the cleanOfficeHTML()
method. Here the complication arises from the fact that the incomming html
can be from various sources; it can be MSWord, MSExcel, OpenOffice Writer
and any editor capable of exporting html content into user's clipboard (so
that user can paste them). I see several approaches to solve this issue:
1. Perform an exhaustive cleaning leaving out only basic html elements that
we can handle. Here we'll have to consider various formatting elements used
by different office suits and convert them as necessary. For an example,
http://office.microsoft.com/en-us/help/HA010549981033.aspx contains
information about various MSOffice 2000 specific markup.
2. By analysing the incomming html content, first we determine the office
suite which generated the content (with a default case for unknowns). And
there after perform a specific cleaning procedure for that office suite.
Note that there is no generic way of determining the office suite and there
can be many such suites.
3. We pass the incomming html through jodconverter (openoffice server) and
get the resulting html. Since this html is from openoffice, there is no need
to worry about different office suites and we can perform our cleaning
afterwards. The downsides of this approach are:
* Passing though openoffice server can be time consuming.
* Jodconverter seems to have some limitations with html formats as
mentioned at
http://www.artofsolving.com/opensource/jodconverter/guide/supportedformats
Of the three approaches mentioned above, I'm preferring the first approach
since it's the most simple one. Also, the other two approaches doesn't seem
to provide any advantages w.r.t first approach.
And the final question is about embedded elements inside pasted html content
(like images). This is not a problem if the whole document is uploaded for
importing; the document is a container for images and they can be retrieved
on the server. But with pasted html content, images are simply links to
local files. Now I don't know if it's possible to trigger an automated
upload of these files but for the moment I'm proposing we should strip-off
such content.
Thanks.
- Asiri
tmortagne (SVN) wrote:
> Author: tmortagne
> Date: 2008-12-19 15:33:02 +0100 (Fri, 19 Dec 2008)
> New Revision: 14879
>
> Added:
> platform/core/trunk/xwiki-rendering/src/test/resources/list/list10.test
> Modified:
> platform/core/trunk/xwiki-rendering/src/test/java/org/xwiki/rendering/RenderingTests.java
> Log:
> XWIKI-3006: All spaces at the begining of a list item content are consummed by the parser.
> * add unit test
> + suite.addTestsFromResource("list/list10", false);
Why is there a need to manually add test cases? Why don't we just use
all the test cases available?
--
Sergiu Dumitriu
http://purl.org/net/sergiu/
Hi devs,
We already decided that in a general way, spaces entered by user are
meaningful: when you enter
"Some<space><space><space>content"
you will get in XHTML
"<p>Some content</p>"
This not fully the case with list for example where:
"**<space><space><space>list<space><space><space>content"
will give
"<li>list content</li>"
I propose, for consistency, to make first spaces of list content
meaningful like in any other content:
"**<space><space><space>list<space><space><space>content"
will give
"<li> list content</li>"
Here is my +1
On Wed, Dec 17, 2008 at 3:50 PM, Vincent Massol <vincent(a)massol.net> wrote:
>
> On Dec 17, 2008, at 3:39 PM, Thomas Mortagne wrote:
>
>> On Wed, Dec 17, 2008 at 3:38 PM, Thomas Mortagne
>> <thomas.mortagne(a)xwiki.com> wrote:
>>> On Wed, Dec 17, 2008 at 3:12 PM, Vincent Massol
>>> <vincent(a)massol.net> wrote:
>>>>
>>>> On Dec 17, 2008, at 3:07 PM, Thomas Mortagne wrote:
>>>>
>>>>> On Wed, Dec 17, 2008 at 3:02 PM, Vincent Massol
>>>>> <vincent(a)massol.net>
>>>>> wrote:
>>>>>>
>>>>>> On Dec 17, 2008, at 2:38 PM, Thomas Mortagne wrote:
>>>>>>
>>>>>>> On Wed, Dec 17, 2008 at 1:15 PM, Vincent Massol <vincent(a)massol.net
>>>>>>> >
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> On Dec 17, 2008, at 12:57 PM, Lucien PEREIRA wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Working on annotation feature, I need to retrieve
>>>>>>>>> xwiki document source code from a selection on XHTML.
>>>>>>>>>
>>>>>>>>> This requires to have a correspondence between content
>>>>>>>>> typed by user and content that appears in html.
>>>>>>>>>
>>>>>>>>> I noticed in xwiki 2.0 synthax that white spaces typed
>>>>>>>>> in a list item context are ignored :
>>>>>>>>>
>>>>>>>>> *<
>>>>>>>>> space
>>>>>>>>>>
>>>>>>>>> <
>>>>>>>>> space
>>>>>>>>>> <
>>>>>>>>>> space
>>>>>>>>>>> <
>>>>>>>>>>> space><space>foo<space><space><space>bar<space><space><space>
>>>>>>>>>
>>>>>>>>> renders in XHTML
>>>>>>>>>
>>>>>>>>> <li>foo<space> bar </li>
>>>>>>>>>
>>>>>>>>> so I could not determine the real offset of selection in xwiki
>>>>>>>>> document source.
>>>>>>>>
>>>>>>>> There's another problem: leading spaces before list items and
>>>>>>>> headers.
>>>>>>>> We need to allow them (for several reasons, one of them is for
>>>>>>>> supporting indenting velocity code when we have velocity mixed
>>>>>>>> with
>>>>>>>> wiki syntax). So in term of rendering they should be considered
>>>>>>>> as a
>>>>>>>> ListItemBlock and the spaces should not be rendered.
>>>>>>>>
>>>>>>>> One problem is when we go through the wysiwyg these spaces
>>>>>>>> will be
>>>>>>>> removed. Removing them for content not in macros is not such a
>>>>>>>> big
>>>>>>>> deal IMO (except for Lucien's use case but there are other
>>>>>>>> ways of
>>>>>>>> doing it for him). Removing them would be a problem when inside
>>>>>>>> macros. Fortunately we don't touch at macro content for the
>>>>>>>> moment.
>>>>>>>>
>>>>>>>>> This can be solved by not ignoring spaces so render become :
>>>>>>>>>
>>>>>>>>> <
>>>>>>>>> li
>>>>>>>>>>
>>>>>>>>>  
>>>>>>>>> ; 
>>>>>>>>> ; 
>>>>>>>>> ; foo<space> bar </
>>>>>>>>> li>
>>>>>>>>>
>>>>>>>>> This policy of rendering already exists in underline or italic
>>>>>>>>> context so it's strange to have a different behaviour in list
>>>>>>>>> item context.
>>>>>>>>>
>>>>>>>>> Moreover I think we should not suppose what content is
>>>>>>>>> relevant for user or not, so source shouldn't be altered.
>>>>>>>>
>>>>>>>> We have to alter source in the case of badly formed content,
>>>>>>>> as in
>>>>>>>> "**bold". We also later for unisignificant escapes (as with
>>>>>>>> "~hello"'
>>>>>>>> is transformed into "hello") + some other use cases probably.
>>>>>>>>
>>>>>>>> Right now I don't have any idea of what to do differently. Only
>>>>>>>> idea I
>>>>>>>> could think of would be to have a parameter for list items and
>>>>>>>> headers, passing to them the number of leading spaces, tabs, etc
>>>>>>>> but I
>>>>>>>> don't like this too much.
>>>>>>>>
>>>>>>>> I think the idea of leaving the content intact is not correct
>>>>>>>> and
>>>>>>>> we
>>>>>>>> shouldn't expect that behavior for a wiki syntax. A wiki syntax
>>>>>>>> needs
>>>>>>>> to be as simple as possible for users to use. Allowing leading
>>>>>>>> spaces
>>>>>>>> go in that direction. OTOH I agree with Lucien that we've
>>>>>>>> decided
>>>>>>>> to
>>>>>>>> make spaces in paragraph significant so it's not fully
>>>>>>>> consistent.
>>>>>>>>
>>>>>>>> What do others think?
>>>>>>>
>>>>>>> I agree that it's not alway possible to respect the original
>>>>>>> source
>>>>>>> especially with useless escapes (~toto which become toto).
>>>>>>>
>>>>>>> Now in the case of list item content I think we should support it
>>>>>>> because it's exactly the same context that space in a paragraph
>>>>>>> and
>>>>>>> such so it have to behave the same way for consistency.
>>>>>>>
>>>>>>> So +1 to support spaces at beginning of list item.
>>>>>>
>>>>>> Could you explain what you mean by "support spaces at begining of
>>>>>> list
>>>>>> item"?
>>>>>
>>>>> Yes it's not very clear: +1 for not removing first spaces of list
>>>>> item
>>>>> content. In other words +1 for changing the current behavior.
>>>>
>>>> This is still not clear.
>>>>
>>>> If we don't remove leading spaces is it still a list item?
>>>>
>>>> And if it's still a list item how do we implement this since lists
>>>> are
>>>> block elements?
>>>>
>>>> And what about spaces after the first space after the list item
>>>> delimiters?
>>>>
>>>
>>> +1 for :
>>>
>>> <#LI: (<SPACE>)* ( ("*")+ (":" | ";")* | ( "1" | "*" )+ "." (":" |
>>> ";")* | (":" | ";")+ ) (<SPACE>)* >
>>
>> I mean
>> <#LI: (<SPACE>)* ( ("*")+ (":" | ";")* | ( "1" | "*" )+ "." (":" |
>> ";")* | (":" | ";")+ ) (<SPACE>) >
>
> ok, I'd agree with this one. It makes sense to me too.
>
> Note for others: it still means that entering:
>
> (space)(space)*(space)item
>
> is transformed into:
>
> *(space)item
>
> for example when going from wysiwyg editor to wiki syntax.
>
> Thanks
> -Vincent
>
>>> in place of
>>>
>>> <#LI: (<SPACE>)* ( ("*")+ (":" | ";")* | ( "1" | "*" )+ "." (":" |
>>> ";")* | (":" | ";")+ ) (<SPACE>)+ >
>>>
>>>> Thanks
>>>> -Vincent
> _______________________________________________
> devs mailing list
> devs(a)xwiki.org
> http://lists.xwiki.org/mailman/listinfo/devs
>
--
Thomas Mortagne