[xwiki-devs] Cleaning XWiki XML files for commit
Hi devs, Is there a documentation and a tool to clean XWiki XML files for commit. I used to use the SVN Application to clean the XML and commit in the sandbox for the contributed apps. But the SVN app does not work with git (even with the SVN bridge as it seems svnkit is not compatible), so I'm left to export to commit. How do developers usually do that ? Ludovic -- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
When I'm making changes to an existing document, I generally make a patch from the differences then remove the changes to the version number and author from the patch and apply the patch. It's definitely not the best solution though. Caleb On 11/05/2011 04:34 AM, Ludovic Dubost wrote:
Hi devs,
Is there a documentation and a tool to clean XWiki XML files for commit. I used to use the SVN Application to clean the XML and commit in the sandbox for the contributed apps. But the SVN app does not work with git (even with the SVN bridge as it seems svnkit is not compatible), so I'm left to export to commit.
How do developers usually do that ?
Ludovic
I fear I am out of topic but I strongly, very strongly!, prefer to commit source files for xwiki pages. So my general deployment mechanism is: - import some XML files (can't really avoid it for classes or pages full of objects) - upload the source (I am using this script which relies on curl: http://svn.xwiki.org/svnroot/xwiki/curriki/trunk/tools/src/main/java/org/cur...). I generally put them in wiki/src/main/pages/Space/Name.xxx where xxx is the extension (grv, vm, properties...). The cleanup left is then... the cleanup of source files which is considerably more important. More importantly, the diff is quite useful and readable and the source tree is well searchable. paul Le 5 nov. 2011 à 09:34, Ludovic Dubost a écrit :
Hi devs,
Is there a documentation and a tool to clean XWiki XML files for commit. I used to use the SVN Application to clean the XML and commit in the sandbox for the contributed apps. But the SVN app does not work with git (even with the SVN bridge as it seems svnkit is not compatible), so I'm left to export to commit.
How do developers usually do that ?
Ludovic
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
You are brining up another issue here, which works when most of the code in the the content field. However there is more than the content field. There are the classes, objects, JS and CSS extensions. How we've been talking for a while to have a non XML representation of a page which would make the content field and the textarea fields separate from the XML. This would lead to having them plain text in the repository which would solve the searchable source tree issue. The maven xar builder would then be able to reconstruct the final xar for importing. As we'll have to make a GITApp to replace the SVNApp, it might be time to go this way Ludovic 2011/11/5 Paul Libbrecht <[email protected]>
I fear I am out of topic but I strongly, very strongly!, prefer to commit source files for xwiki pages.
So my general deployment mechanism is: - import some XML files (can't really avoid it for classes or pages full of objects) - upload the source (I am using this script which relies on curl: http://svn.xwiki.org/svnroot/xwiki/curriki/trunk/tools/src/main/java/org/cur...). I generally put them in wiki/src/main/pages/Space/Name.xxx where xxx is the extension (grv, vm, properties...).
The cleanup left is then... the cleanup of source files which is considerably more important. More importantly, the diff is quite useful and readable and the source tree is well searchable.
paul
Le 5 nov. 2011 à 09:34, Ludovic Dubost a écrit :
Hi devs,
Is there a documentation and a tool to clean XWiki XML files for commit. I used to use the SVN Application to clean the XML and commit in the sandbox for the contributed apps. But the SVN app does not work with git (even with the SVN bridge as it seems svnkit is not compatible), so I'm left to export to commit.
How do developers usually do that ?
Ludovic
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
On Sat, Nov 5, 2011 at 11:10 AM, Ludovic Dubost <[email protected]> wrote:
You are brining up another issue here, which works when most of the code in the the content field. However there is more than the content field. There are the classes, objects, JS and CSS extensions.
How we've been talking for a while to have a non XML representation of a page which would make the content field and the textarea fields separate from the XML. This would lead to having them plain text in the repository which would solve the searchable source tree issue.
The maven xar builder would then be able to reconstruct the final xar for importing.
As we'll have to make a GITApp to replace the SVNApp, it might be time to go this way
Definitely +1 to go in that direction Jerome
Ludovic
2011/11/5 Paul Libbrecht <[email protected]>
I fear I am out of topic but I strongly, very strongly!, prefer to commit source files for xwiki pages.
So my general deployment mechanism is: - import some XML files (can't really avoid it for classes or pages full of objects) - upload the source (I am using this script which relies on curl:
http://svn.xwiki.org/svnroot/xwiki/curriki/trunk/tools/src/main/java/org/cur... ).
I generally put them in wiki/src/main/pages/Space/Name.xxx where xxx is the extension (grv, vm, properties...).
The cleanup left is then... the cleanup of source files which is considerably more important. More importantly, the diff is quite useful and readable and the source tree is well searchable.
paul
Le 5 nov. 2011 à 09:34, Ludovic Dubost a écrit :
Hi devs,
Is there a documentation and a tool to clean XWiki XML files for commit. I used to use the SVN Application to clean the XML and commit in the sandbox for the contributed apps. But the SVN app does not work with git (even with the SVN bridge as it seems svnkit is not compatible), so I'm left to export to commit.
How do developers usually do that ?
Ludovic
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Jérôme Velociter Winesquare http://www.winesquare.net/
On Sun, Nov 6, 2011 at 12:17 AM, Jerome Velociter <[email protected]>wrote:
On Sat, Nov 5, 2011 at 11:10 AM, Ludovic Dubost <[email protected]> wrote:
You are brining up another issue here, which works when most of the code in the the content field. However there is more than the content field. There are the classes, objects, JS and CSS extensions.
How we've been talking for a while to have a non XML representation of a page which would make the content field and the textarea fields separate from the XML. This would lead to having them plain text in the repository which would solve the searchable source tree issue.
The maven xar builder would then be able to reconstruct the final xar for importing.
As we'll have to make a GITApp to replace the SVNApp, it might be time to go this way
Definitely +1 to go in that direction
On a side note, I think it's quite important to make it an easy development cycle for developers of XWiki applications/products. We have to keep in mind we sort of compete with other RAD platforms where you don't have builds nor server restarts, so keeping the committing hassle to a bear minimum is really something XWiki should offer IMO. Jerome
Jerome
Ludovic
2011/11/5 Paul Libbrecht <[email protected]>
I fear I am out of topic but I strongly, very strongly!, prefer to commit source files for xwiki pages.
So my general deployment mechanism is: - import some XML files (can't really avoid it for classes or pages full of objects) - upload the source (I am using this script which relies on curl:
http://svn.xwiki.org/svnroot/xwiki/curriki/trunk/tools/src/main/java/org/cur... ).
I generally put them in wiki/src/main/pages/Space/Name.xxx where xxx is the extension (grv, vm, properties...).
The cleanup left is then... the cleanup of source files which is considerably more important. More importantly, the diff is quite useful and readable and the source tree is well searchable.
paul
Le 5 nov. 2011 à 09:34, Ludovic Dubost a écrit :
Hi devs,
Is there a documentation and a tool to clean XWiki XML files for commit. I used to use the SVN Application to clean the XML and commit in the sandbox for the contributed apps. But the SVN app does not work with git (even with the SVN bridge as it seems svnkit is not compatible), so I'm left to export to commit.
How do developers usually do that ?
Ludovic
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Jérôme Velociter Winesquare http://www.winesquare.net/
-- Jérôme Velociter Winesquare http://www.winesquare.net/
On Sat, Nov 5, 2011 at 9:34 AM, Ludovic Dubost <[email protected]> wrote:
Hi devs,
Is there a documentation and a tool to clean XWiki XML files for commit. I used to use the SVN Application to clean the XML and commit in the sandbox for the contributed apps. But the SVN app does not work with git (even with the SVN bridge as it seems svnkit is not compatible), so I'm left to export to commit.
How do developers usually do that ?
Will not help you much but I usually export things to the FS and then use git after a bit of cleanup (mostly the reset of the versions to 1.1). I never used SVNApp either.
Ludovic
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
I did not know SVNapp before. I googled for it: http://www.google.com/search?ie=utf8&oe=utf8&q=svnapp+xwiki then found the first to be: http://extensions.xwiki.org/xwiki/bin/undelete/ImportedExtension/SVNApplicat... which clearly shows an issue at a missing robots entry! The second is better: http://extensions.xwiki.org/xwiki/bin/view/Extension/SVN+Application But again, I am out of topic. When I do commit wiki XML files for the xar maven plugin, which is rare, I do as Thomas. paul Le 5 nov. 2011 à 09:34, Ludovic Dubost a écrit :
Hi devs,
Is there a documentation and a tool to clean XWiki XML files for commit. I used to use the SVN Application to clean the XML and commit in the sandbox for the contributed apps. But the SVN app does not work with git (even with the SVN bridge as it seems svnkit is not compatible), so I'm left to export to commit.
How do developers usually do that ?
Ludovic
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On 11/05/2011 04:34 AM, Ludovic Dubost wrote:
Hi devs,
Is there a documentation and a tool to clean XWiki XML files for commit. I used to use the SVN Application to clean the XML and commit in the sandbox for the contributed apps. But the SVN app does not work with git (even with the SVN bridge as it seems svnkit is not compatible), so I'm left to export to commit.
How do developers usually do that ?
Ludovic
I use a bash script on the filesystem, relying on dos2unix and sed:
$ cat clean-xml.sh dos2unix -q "$@" sed -r -i -f /home/sgm/clean.sed "$@"
$ cat clean.sed s/ encoding=".*" ?\?>/ encoding="UTF-8"?>/ s/<version>[0-9]+\.[0-9]+<\/version>/<version>1.1<\/version>/ s/<defaultLanguage>([^<]*)<\/defaultLanguage>/<defaultLanguage><\/defaultLanguage>/ s/<creator>([^<]*)<\/creator>/<creator>xwiki:XWiki.Admin<\/creator>/ s/<author>([^<]*)<\/author>/<author>xwiki:XWiki.Admin<\/author>/ s/<contentAuthor>([^<]*)<\/contentAuthor>/<contentAuthor>xwiki:XWiki.Admin<\/contentAuthor>/ s/<comment>([^<]*)<\/comment>/<comment><\/comment>/ s/<minorEdit>([^<]*)<\/minorEdit>/<minorEdit>false<\/minorEdit>/
Two things to note, it sets the author to the global xwiki:XWiki.Admin, and the language to empty; that should be manually fixed if the target project expects something else. -- Sergiu Dumitriu http://purl.org/net/sergiu/
I use the patch option of Git's interactive add (git add -i) to drop/edit changes before commit. Hope this helps, Marius On Sat, Nov 5, 2011 at 10:34 AM, Ludovic Dubost <[email protected]> wrote:
Hi devs,
Is there a documentation and a tool to clean XWiki XML files for commit. I used to use the SVN Application to clean the XML and commit in the sandbox for the contributed apps. But the SVN app does not work with git (even with the SVN bridge as it seems svnkit is not compatible), so I'm left to export to commit.
How do developers usually do that ?
Ludovic
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (7)
-
Caleb James DeLisle -
Jerome Velociter -
Ludovic Dubost -
Marius Dumitru Florea -
Paul Libbrecht -
Sergiu Dumitriu -
Thomas Mortagne