Hello,
Can somebody tell me how to include a servlet in Xwiki.
I came across the following in the macros.vm file:
But, I am not very sure as to where do I save the servlet and is
#includeServlet("/xwiki/bin/view/Some/Document?params") this the syntax to
include a servlet?
I mean does this line go into the Xwiki editor?
Thanks
## #includeServlet("/xwiki/bin/view/Some/Document?params")
## Invokes on the server another servlet corresponding to the passed URL,
and returns the output.
## This is done using standard servlet mechanisms
(javax.servlet.RequestDispatcher#include).
##
#macro(includeServlet $url)
<!-- including $url -->
$xwiki.invokeServletAndReturnAsString($url)
<!-- included $url -->
#end
##
jvdrean (SVN) wrote:
> Modified: xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources.properties
> ===================================================================
> --- xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources.properties 2008-04-18 10:34:43 UTC (rev 9234)
> +++ xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources.properties 2008-04-18 14:14:39 UTC (rev 9235)
> @@ -41,6 +41,7 @@
> save=Save
> delete=Delete
> preview=Preview
> +copy=Copy
> login=Log-in
> logout=Log-out
> homepage=User Profile
> @@ -65,6 +66,8 @@
> author=Author
> lastauthor=Last Author
> filename=Filename
> +rights=Rights
> +actions=Actions
> default=default
> confirmobjectremove=Are you sure you want to remove this object?
> confirmdelete=This action is not reversible. Are you sure you want to delete this document?
I second Vincent. There should be no "generic" resources. Even if a
piece of text appears in more than one place, each feature/page should
be self-contained. In the future each feature might come in its own xar,
together with its resources, and ApplicationResources should either
disappear or contain core messages only, nothing related to the interface.
> Modified: xwiki-platform/skins/trunk/albatross/src/main/resources/albatross/usersandgroups.css
This should be renamed (split?) to something like ajaxTable.css, and the
selectors should be not on specific IDs, but to all tables with a
specific class (like .ajaxTable)
> Added: xwiki-products/xwiki-enterprise/trunk/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/AllDocsTest.java
> + /**
> + * Validate input suggest for Page field.
> + */
> + public void testTableViewSuggestForPage()
> + {
> + getSelenium().typeKeys("page", "Treeview");
> + // The table is updated via Ajax, we give it the time to make this call
> + getSelenium().setSpeed("1000");
> + assertElementPresent("//td[@class='pagename']/a[text()='Treeview']");
> + getSelenium().setSpeed("0");
> + }
This test should be done like:
- typeKeys
- waitForCondition(loading is displayed)
- waitForCondition(loading disappears)
- assertPresent(Treeview)
- assertNotPresent(AllDocs)
and maybe delete the filter and assert that AllDocs is there
The same for the other filter tests.
> + public void testTableViewSuggestForSpace()
> + public void testTableViewSuggestForLastAuthor()
> + public void testTableViewCopyAction()
> + {
> + getSelenium().typeKeys("page", "treeview");
Shouldn't this have some waiting?
> + assertElementPresent("//td[@class='pagename']/a[text()='Treeview']");
> + assertElementPresent("link=Copy");
> + clickLinkWithText("Copy");
This already asserts, so the above assertElementPresent("link=Copy") is
not needed.
> + setFieldValue("targetdoc", "New.TreeviewCopy");
> + getSelenium().click("//input[@value='Copy']");
> + open(getUrl("Main", "AllDocs"));
> + getSelenium().typeKeys("space", "New");
> + getSelenium().typeKeys("page", "treeviewcopy");
> + assertElementPresent("//td[@class='pagename']/a[text()='TreeviewCopy']");
> + }
> +
--
Sergiu Dumitriu
http://purl.org/net/sergiu/
Hello!
This is a beginner question, sorry if it's documented somewhere but I didn't
find it.
I've read the documentation available at
http://dev.xwiki.org/xwiki/bin/view/Community/Building#HBuildingforaspecifi…,
made the configuration as suggested (changing the .m2/settings.xml file) and
executed mvn install -Pmysql, but in the end, my hibernate.cfg.xml (inside
xwiki-product-enterprise/web/target/xwiki-enterprise-web-1.4-SNAPSHOT/WEB-INF/)
had still the MySQL section commented. I've also noted that the
mysql-connector jar is not at the lib dir after the build.
Isn't there a way to build the application for mysql and have it ready to
run without any intervention? (changing and adding files) If there is, what
am I missing?
(By the way, is this the proper list for such a question or should I have
mailed this to the users list?)
Thank you very much,
--
Tiago Rinck Caveden
http://caveden.multiply.com
Hi Sergiu,
On Apr 18, 2008, at 1:28 AM, sdumitriu (SVN) wrote:
> Author: sdumitriu
> Date: 2008-04-18 01:28:31 +0200 (Fri, 18 Apr 2008)
> New Revision: 9229
>
> Modified:
> xwiki-products/xwiki-enterprise/trunk/distribution-test/selenium-
> tests/src/test/it/com/xpn/xwiki/it/selenium/AllTests.java
> xwiki-products/xwiki-enterprise/trunk/distribution-test/selenium-
> tests/src/test/it/com/xpn/xwiki/it/selenium/framework/
> XWikiTestSuite.java
> Log:
> [cleanup] Apply codestyle
[snip]
>
> * {
> - * XWikiTestSuite suite = new XWikiTestSuite("My Suite");
> + * XWikiTestSuite suite = new XWikiTestSuite("My
> Suite");
This looks strange. I'm offline right now so can't svn up to check but
it looks like the quotes were replaced with " in the java class.
[snip]
Thanks
-Vincent
On Fri, Apr 18, 2008 at 7:54 PM, Vincent Massol <vincent(a)massol.net> wrote:
>
> I think we should also provides the French translation by default
> since lots of us are French and can translate it easily...
True; done.
> Also it might be good to follow the naming conventions started by
> Sergiu.
>
I thought copy/rights/actions were generic enough to be included like this.
> > + public void setUp() throws Exception
> > + {
> > + super.setUp();
> > + loginAsAdmin();
> > + open(getUrl("Main", "AllDocs"));
> > + }
> > +
> > + /**
> > + * Validate presence of "Actions" column in table view for
> > administrator. Validate absence of
> > + * "Actions" column for users without administration rights.
> > + */
> > + public void testTableViewActionsPresence()
> > + {
> > + assertElementPresent("//td[text()='Actions']");
> > +
> > + // Verify that the user is logged in and log out
> > + if (isAuthenticated()) {
> > + logout();
>
> Why is that needed since the setup always does a loginAsAdmin? I think
> this can be changed to: logout();
Indeed; done.
> > + /**
> > + * Validate input suggest for Page field.
> > + */
> > + public void testTableViewSuggestForPage()
> > + {
> > + getSelenium().typeKeys("page", "Treeview");
> > + // The table is updated via Ajax, we give it the time to
> > make this call
> > + getSelenium().setSpeed("1000");
> > + assertElementPresent("//td[@class='pagename']/
> > a[text()='Treeview']");
> > + getSelenium().setSpeed("0");
>
> Is the setSpeed() required? We don't do any action after it's set so
> is it used for anything? Shouldn't it be before the typeKeys?
The setSpeed() affects the assert that follows (without this setSpeed
the test fails).
> There are way too many test methods. These are NOT unit tests and thus
> 1) are costly and 2) are not supposed to be independent of each other.
>
> Thus most of them should be grouped in the same test method IMO, with
> nice comments separating them. Maybe we don't need to have a single
> test method but they should be grouped according to what they are doing.
My bad, all the tests were grouped in Evelina's version, I've re-grouped them.
Thanks,
--
Jean-Vincent Drean
Some quick comments below.
First let me say: Very cool tests! This is really cool and needed and
it's good to see we're improving our tests. Well done Evelina/JV.
On Apr 18, 2008, at 4:14 PM, jvdrean (SVN) wrote:
> Author: jvdrean
> Date: 2008-04-18 16:14:39 +0200 (Fri, 18 Apr 2008)
> New Revision: 9235
>
> Added:
> xwiki-products/xwiki-enterprise/trunk/distribution-test/selenium-
> tests/src/test/it/com/xpn/xwiki/it/selenium/AllDocsTest.java
> xwiki-products/xwiki-enterprise/trunk/wiki/src/main/resources/XWiki/
> Tableresults
> xwiki-products/xwiki-enterprise/trunk/wiki/src/main/resources/XWiki/
> Tableview
> Modified:
> xwiki-platform/core/trunk/xwiki-core/src/main/resources/
> ApplicationResources.properties
> xwiki-platform/skins/trunk/albatross/src/main/resources/albatross/
> usersandgroups.css
> xwiki-platform/skins/trunk/toucan/src/main/resources/toucan/
> usersandgroups.css
> xwiki-products/xwiki-enterprise/trunk/distribution-test/selenium-
> tests/src/test/it/com/xpn/xwiki/it/selenium/AllTests.java
> xwiki-products/xwiki-enterprise/trunk/wiki/src/main/resources/Main/
> AllDocs
> Log:
> XE-221 : Change the table that displays all the documents
> (Main.AllDocs) to use ajax for more rapid loading
> XE-224 : Write selenium test to verify the behaviour of the AllDocs
> ajax table
>
> Applied patch from Evelina with few modifications.
>
> Modified: xwiki-platform/core/trunk/xwiki-core/src/main/resources/
> ApplicationResources.properties
I think we should also provides the French translation by default
since lots of us are French and can translate it easily...
Also it might be good to follow the naming conventions started by
Sergiu.
[snip]
> Modified: xwiki-platform/skins/trunk/albatross/src/main/resources/
> albatross/usersandgroups.css
> ===================================================================
> --- xwiki-platform/skins/trunk/albatross/src/main/resources/
> albatross/usersandgroups.css 2008-04-18 10:34:43 UTC (rev 9234)
> +++ xwiki-platform/skins/trunk/albatross/src/main/resources/
> albatross/usersandgroups.css 2008-04-18 14:14:39 UTC (rev 9235)
> @@ -1,7 +1,6 @@
> /* USERS SCROLLING SYSTEM */
> -
> div.scrollbar {
> - overflow: auto;
> + overflow: auto !important;
Is that going to change the rights and users tables?
[snip]
> -#userstable, #groupstable, #usersandgroupstable {
> +#userstable, #groupstable, #usersandgroupstable, #alldocstable {
I think we should rename the file usersandgroups.css since it's no
longer about users and groups! :)
(same for Toucan)
[snip]
> Added: xwiki-products/xwiki-enterprise/trunk/distribution-test/
> selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/AllDocsTest.java
[snip]
> + public void setUp() throws Exception
> + {
> + super.setUp();
> + loginAsAdmin();
> + open(getUrl("Main", "AllDocs"));
> + }
> +
> + /**
> + * Validate presence of "Actions" column in table view for
> administrator. Validate absence of
> + * "Actions" column for users without administration rights.
> + */
> + public void testTableViewActionsPresence()
> + {
> + assertElementPresent("//td[text()='Actions']");
> +
> + // Verify that the user is logged in and log out
> + if (isAuthenticated()) {
> + logout();
Why is that needed since the setup always does a loginAsAdmin? I think
this can be changed to:
logout();
> + }
> + assertElementNotPresent("//td[text()='Actions']");
> + }
> +
> + /**
> + * Validate input suggest for Page field.
> + */
> + public void testTableViewSuggestForPage()
> + {
> + getSelenium().typeKeys("page", "Treeview");
> + // The table is updated via Ajax, we give it the time to
> make this call
> + getSelenium().setSpeed("1000");
> + assertElementPresent("//td[@class='pagename']/
> a[text()='Treeview']");
> + getSelenium().setSpeed("0");
Is the setSpeed() required? We don't do any action after it's set so
is it used for anything? Shouldn't it be before the typeKeys?
Also if it's required I think we should introduce a method in our DSL
for this that does setspeed, type keys and reset speed.
[snip]
There are way too many test methods. These are NOT unit tests and thus
1) are costly and 2) are not supposed to be independent of each other.
Thus most of them should be grouped in the same test method IMO, with
nice comments separating them. Maybe we don't need to have a single
test method but they should be grouped according to what they are doing.
[snip]
Thanks
-Vincent
Hello devs,
Now that we entered the release candidate phase for XWiki Workspaces 1.0,
I would like to create a branch for it. Along with delivering a stable 1.0
version, we do also need to start working on the 1.1 version.
I will send an email in the coming days with roadmap and planning for XWS 1.1
For now, here is my +1 to create the branch xwiki-workspaces-1.0.
Regards,
Jerome.
Hi again,
We are trying to figure out how to validate the form field values in XWiki.
For example, if we have a form like this:
<html>
<form name="feedback" action="" method="post" onSubmit="return checkform()">
<input type="text" name="name">
<input type="text" name="email" value="xyz">
<textarea name="feed"></textarea>
<input type="submit" value="Submit" />
</form>
how do we check that none of the fields are left blank, valid characters
etc...
1) Can we use Javascript? If yes, is there a special macro to embed
javascript in xwiki editor?
2)I guess this question goes back to the $msg construct. Is there a msg that
I can display if any fields have wrong values?
Also, when I tried:
<html>
<form name="feedback" action="" method="post" onSubmit="return checkform()">
<input type="text" name="name">
<input type="text" name="email" value="xyz">
<textarea name="feed"></textarea>
<input type="submit" value="Submit" />
# set($name = $request.getParameter("name"))
# set($email= $request.getParameter("email"))
# set($feed= $request.getParameter("feed"))
</form>
The name is $name
the velocity statements just printed as is on the page..the # being
interpreted as 1, 2, 3.
Why did this happen?
Thanks
Hello folks,
finally I found some time to deploy a demo environment and write some
explanations about my work...
go on http://myxwikidemo.dyndns.org:8080/xwiki and click on "improve class
properties management" to access the text presentation and the demo guide...
Sorry for the long text but it also helped me structure my thinking...
it demonstrates how I implemented class versioning in order to better manage
class properties deletion and consequences on existing objects.
This is a private server so it might be slower sometimes ;)
It's a draft based on the trunk so you might discover bugs I don't even know
about.
This is a proof of concept so be indulgent and follow the demo guide to see
it work with your own eyes :)
If you are interested in this idea, tell me...
I'm naturally opened to discussion because I may think in the wrong way or
you may have other ideas...
Anyway, I had fun digging in XWiki code ;)
Don't hesitate to tell me if you discover big problems!
Have fun
regards
Pascal