Re: [xwiki-users] RES: RES: Calendar Application on XE 2.4 not working properly

2010-08-25 Thread Raluca Stavro
Hi,

The solution that I told you about is like this:
In a separate page, let's say 'Main.MyCalendar', paste this piece of
code that is copied from 'XWiki.CalendarSheet' (I also added 2.0 wiki
syntax but this is mandatory - you can keep the 1.0 syntax):

{{velocity}}
$xwiki.ssx.use('XWiki.CalendarSheet')

#set($cview = $xwiki.calendar)
#set($cparams = $cview.calendarParams)
#if($request.month)
$cparams.put(month, $request.get(month))
#end
#if($request.year)
$cparams.put(year, $request.get(year))
#end
#set($rqcategories = $util.arrayList)
#foreach($rqcateg in $request.get(category).split(,))
#if(!$rqcateg.trim().equals())
#set($discard = $rqcategories.add($rqcateg.trim()))
#end
#end
$cparams.put(categories, $rqcategories)

{{html wiki=true}}
[[Add New EventMain.EventCalendar]]
$cview.getHTMLCalendar($cparams, $xwiki.getDocument('Main.EventCalendar'), )
{{/html}}
{{/velocity}}

Now, in 'XWiki.CalendarSheet' just remove the lines that you've put in
'Main.MyCalendar'. You can also remove the piece of code that lists
the current event (the '#foreach($event in
$doc.getObjects(XWiki.CalendarEvent))' block), depending on what you
want to display in the form page.

And finally, in 'XWiki.CalendarSheet' change the action of the creation form:
form action=$xwiki.getDocument('Main.MyCalendar').getURL('objectadd')
method=get
(this will allow adding calendar events to the  'Main.MyCalendar' page)

and the redirect url:
input type=hidden name=xredirect
value=${xwiki.getDocument('Main.MyCalendar').getURL('view')} /
(this will redirect to the 'Main.MyCalendar' page after submitting the
creation form)

This way you don't need extra JavaScript code to hide parts of the
code and your application is modular.

Raluca.



On Wed, Aug 25, 2010 at 5:24 AM, Lockie loc...@gmail.com wrote:

 I worked out a way to hide the form in a way so that the user doesn't have to
 go to another page to fill it out. It hides the div and provides a link to
 reveal it, so I guess it could be used for anything. I thought I'd just
 share it for future reference.

 Go to XWiki.CalendarSheet and EditObjects then add a JavaScriptExtension
 object with the following properties:

 Name:
 (blank)
 Code:
 function toggle() {
        var ele = document.getElementById(toggleText);
        var text = document.getElementById(displayText);
        if(ele.style.display == block) {
                ele.style.display = none;
                text.innerHTML = Click to view and create events...;
        }
        else {
                ele.style.display = block;
                text.innerHTML = Hide form;
        }
 }
 Use this extension:
 Always on this wiki
 Parse content:
 No
 Caching policy:
 Default

 Then edit CalendarSheet in Source mode (Note: I converted mine from 1.0
 syntax to 2.0 previously) and add these lines straight after
 $cview.getHTMLCalendar($cparams, ):

 Click to view events and make events...
 div id=toggleText style=display: none

 Remove the ? from href above. Don't forget the /div tag at the end:
 #end
 /div
 {{/html}}
 {{/velocity}}
 And I think that ends my questions about the calendar

 Cheers,
 Lockie.
 --
 View this message in context: 
 http://xwiki.475771.n2.nabble.com/Calendar-Application-on-XE-2-4-not-working-properly-tp5420827p5459543.html
 Sent from the XWiki- Users mailing list archive at Nabble.com.
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] RES: RES: Calendar Application on XE 2.4 not working properly

2010-08-25 Thread Raluca Stavro
On Wed, Aug 25, 2010 at 10:26 AM, Raluca Stavro
raluca.moro...@xwiki.com wrote:
 Hi,

 The solution that I told you about is like this:
 In a separate page, let's say 'Main.MyCalendar', paste this piece of
 code that is copied from 'XWiki.CalendarSheet' (I also added 2.0 wiki
 syntax but this is mandatory - you can keep the 1.0 syntax):

 {{velocity}}
 $xwiki.ssx.use('XWiki.CalendarSheet')

 #set($cview = $xwiki.calendar)
 #set($cparams = $cview.calendarParams)
 #if($request.month)
 $cparams.put(month, $request.get(month))
 #end
 #if($request.year)
 $cparams.put(year, $request.get(year))
 #end
 #set($rqcategories = $util.arrayList)
 #foreach($rqcateg in $request.get(category).split(,))
 #if(!$rqcateg.trim().equals())
 #set($discard = $rqcategories.add($rqcateg.trim()))
 #end
 #end
 $cparams.put(categories, $rqcategories)

 {{html wiki=true}}
 [[Add New EventMain.EventCalendar]]
 $cview.getHTMLCalendar($cparams, $xwiki.getDocument('Main.EventCalendar'), )
 {{/html}}
 {{/velocity}}


For your case ignore all starting from here. The next explanations are
for the case where you want to add events to another page than
'Main.EventCalendar'.

Raluca.

 Now, in 'XWiki.CalendarSheet' just remove the lines that you've put in
 'Main.MyCalendar'. You can also remove the piece of code that lists
 the current event (the '#foreach($event in
 $doc.getObjects(XWiki.CalendarEvent))' block), depending on what you
 want to display in the form page.

 And finally, in 'XWiki.CalendarSheet' change the action of the creation form:
 form action=$xwiki.getURL('Main.MyCalendar', 'objectadd')
 method=get
 (this will allow adding calendar events to the  'Main.MyCalendar' page)

 and the redirect url:
 input type=hidden name=xredirect
 value=${xwiki.getURL('Main.MyCalendar', 'view')} /
 (this will redirect to the 'Main.MyCalendar' page after submitting the
 creation form)

 This way you don't need extra JavaScript code to hide parts of the
 code and your application is modular.

 Raluca.



 On Wed, Aug 25, 2010 at 5:24 AM, Lockie loc...@gmail.com wrote:

 I worked out a way to hide the form in a way so that the user doesn't have to
 go to another page to fill it out. It hides the div and provides a link to
 reveal it, so I guess it could be used for anything. I thought I'd just
 share it for future reference.

 Go to XWiki.CalendarSheet and EditObjects then add a JavaScriptExtension
 object with the following properties:

 Name:
 (blank)
 Code:
 function toggle() {
        var ele = document.getElementById(toggleText);
        var text = document.getElementById(displayText);
        if(ele.style.display == block) {
                ele.style.display = none;
                text.innerHTML = Click to view and create events...;
        }
        else {
                ele.style.display = block;
                text.innerHTML = Hide form;
        }
 }
 Use this extension:
 Always on this wiki
 Parse content:
 No
 Caching policy:
 Default

 Then edit CalendarSheet in Source mode (Note: I converted mine from 1.0
 syntax to 2.0 previously) and add these lines straight after
 $cview.getHTMLCalendar($cparams, ):

 Click to view events and make events...
 div id=toggleText style=display: none

 Remove the ? from href above. Don't forget the /div tag at the end:
 #end
 /div
 {{/html}}
 {{/velocity}}
 And I think that ends my questions about the calendar

 Cheers,
 Lockie.
 --
 View this message in context: 
 http://xwiki.475771.n2.nabble.com/Calendar-Application-on-XE-2-4-not-working-properly-tp5420827p5459543.html
 Sent from the XWiki- Users mailing list archive at Nabble.com.
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users


___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] RES: RES: Calendar Application on XE 2.4 not working properly

2010-08-24 Thread Lockie

I worked out a way to hide the form in a way so that the user doesn't have to
go to another page to fill it out. It hides the div and provides a link to
reveal it, so I guess it could be used for anything. I thought I'd just
share it for future reference.

Go to XWiki.CalendarSheet and EditObjects then add a JavaScriptExtension
object with the following properties:

Name: 
(blank)
Code:
function toggle() {
var ele = document.getElementById(toggleText);
var text = document.getElementById(displayText);
if(ele.style.display == block) {
ele.style.display = none;
text.innerHTML = Click to view and create events...;
}
else {
ele.style.display = block;
text.innerHTML = Hide form;
}
} 
Use this extension:
Always on this wiki
Parse content:
No
Caching policy:
Default

Then edit CalendarSheet in Source mode (Note: I converted mine from 1.0
syntax to 2.0 previously) and add these lines straight after
$cview.getHTMLCalendar($cparams, ):

Click to view events and make events... 
div id=toggleText style=display: none

Remove the ? from href above. Don't forget the /div tag at the end:
#end
/div
{{/html}}
{{/velocity}}
And I think that ends my questions about the calendar 

Cheers,
Lockie.
-- 
View this message in context: 
http://xwiki.475771.n2.nabble.com/Calendar-Application-on-XE-2-4-not-working-properly-tp5420827p5459543.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] RES: RES: Calendar Application on XE 2.4 not working properly

2010-08-23 Thread Raluca Stavro
Yes, you can do that.
You have to change the parameters for the getHTMLCalendar method.
See 
http://svn.xwiki.org/svnroot/xwiki/platform/xwiki-plugins/trunk/calendar/src/main/java/com/xpn/xwiki/plugin/calendar/CalendarPluginApi.java
.
So this is what you should do in your homepage:

...
## Set the calendar parameters
...
## Display calendar
$cview.getHTMLCalendar($cparams,
$xwiki.getDocument('MySpace.MyEventCalendarPage'), )

Where 'MySpace.MyEventsPage' is 'Main.EventCalendar' by default.

Raluca.

On Mon, Aug 23, 2010 at 5:10 AM, Lockie loc...@gmail.com wrote:

 Ah, thanks.

 I have a question though - I would like to mirror the calendar on my
 homepage without having the entry form on it, and instead have a link to a
 page where you can put events into the calendar. When I use {{include
 document=XWiki.CalendarSheet/}} it creates a new instance of the calendar,
 so if I add events directly to CalendarSheet they don't display on the
 calendar on the homepage.

 So, how can I make the entry form display its user input on a calendar on
 another page?

 Lockie.
 --
 View this message in context: 
 http://xwiki.475771.n2.nabble.com/Calendar-Application-on-XE-2-4-not-working-properly-tp5420827p5451203.html
 Sent from the XWiki- Users mailing list archive at Nabble.com.
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] RES: RES: Calendar Application on XE 2.4 not working properly

2010-08-23 Thread Lockie


Raluca Stavro wrote:
 
 Yes, you can do that.
 You have to change the parameters for the getHTMLCalendar method.
 See
 http://svn.xwiki.org/svnroot/xwiki/platform/xwiki-plugins/trunk/calendar/src/main/java/com/xpn/xwiki/plugin/calendar/CalendarPluginApi.java
 .
 So this is what you should do in your homepage:
 
 ...
 ## Set the calendar parameters
 ...
 ## Display calendar
 $cview.getHTMLCalendar($cparams,
 $xwiki.getDocument('MySpace.MyEventCalendarPage'), )
 
 Where 'MySpace.MyEventsPage' is 'Main.EventCalendar' by default.
 
 Raluca.
 

Thanks Raluca for all the help I really appreciate it. I don't really
understand what I'm meant to do though. I tried putting the code you
provided on the homepage and in different places but I can't seem to get it
to work. Can you tell me exactly where to put it, and am I meant to edit the
calendar parameters java code?

I have made a new page that users will use to fill out the calendar form. It
is called Main.Calendar and in it the only code is: 
{{include document=XWiki.CalendarSheet/}}

Then in Main.Home I have the Main.Calendar appearing below the dashboard:
{{include document=Main.Dashboard/}}
{{include document=Main.Calendar/}}

But rather than displaying the events made in Main.Calendar it only displays
events made on the actual Main.Home page.

All my pages are in 2.0 syntax and I'm using the colibri skin. I hope
nothing went wrong when I converted the calendar from 1.0 to 2.0 syntax. The
reason I need this is because I don't want the user to have to scroll down
on the home page, so if I can get the calendar form on another page, then I
can hide it on the home page with an external stylesheet, making everything
much more organised and neat. I managed to mirror the blog, recent changes,
and other pages on the home page but this one has me baffled.

Thanks again,

Lockie.
-- 
View this message in context: 
http://xwiki.475771.n2.nabble.com/Calendar-Application-on-XE-2-4-not-working-properly-tp5420827p5455028.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] RES: RES: Calendar Application on XE 2.4 not working properly

2010-08-23 Thread Lockie

Ah nevermind I found the answer in the FAQ, was alot simpler than I thought:
--

#foreach ($item in $xwiki.searchDocuments(where doc.web='SpaceName'))
 * [$item]
#end

--
Lockie.
-- 
View this message in context: 
http://xwiki.475771.n2.nabble.com/Calendar-Application-on-XE-2-4-not-working-properly-tp5420827p5455565.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] RES: RES: Calendar Application on XE 2.4 not working properly

2010-08-22 Thread Lockie

Ah, thanks.

I have a question though - I would like to mirror the calendar on my
homepage without having the entry form on it, and instead have a link to a
page where you can put events into the calendar. When I use {{include
document=XWiki.CalendarSheet/}} it creates a new instance of the calendar,
so if I add events directly to CalendarSheet they don't display on the
calendar on the homepage.

So, how can I make the entry form display its user input on a calendar on
another page?

Lockie.
-- 
View this message in context: 
http://xwiki.475771.n2.nabble.com/Calendar-Application-on-XE-2-4-not-working-properly-tp5420827p5451203.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] RES: RES: Calendar Application on XE 2.4 not working properly

2010-08-20 Thread Raluca Stavro
Ah, sorry, I forgot to tell you that in order to use the stylesheet
extension, you have to add this line in the XWiki.CalendarSheet page:
$xwiki.ssx.use('XWiki.CalendarSheet')
You'll see that there is this line somewhere at the end of the patch .
Using the extension 'Always on this wiki' will load the CSS code on
opening any page of your wiki instance, even where you don't need that
CSS.

Raluca.

On Thu, Aug 19, 2010 at 3:06 AM, Lockie loc...@gmail.com wrote:

 I got it to work, however I had to to put the 'Use This Extension' part to
 'Always on this wiki'. I guess the 'Always on this page' part would work as
 well if thats what you're after. I left the name part blank.

 Thanks Raluca it looks much better.

 Lockie
 --
 View this message in context: 
 http://xwiki.475771.n2.nabble.com/Calendar-Application-on-XE-2-4-not-working-properly-tp5420827p5438405.html
 Sent from the XWiki- Users mailing list archive at Nabble.com.
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] RES: RES: Calendar Application on XE 2.4 not working properly

2010-08-18 Thread Ramon Gomes Brandão - SERINT
Raluca, 

I've copied the patch content (the piece you informed) into an 
XWiki.StyleSheetExtension object, as you mentioned, but it had no effect, even 
after refreshing the wiki page. The StyleSheetExtension has a name field. 
Should it be something special? How to refresh/make the new custom style work? 
I'm using the colibri skin.

Thanks, 

Ramon Gomes Brandão


-Mensagem original-
De: users-boun...@xwiki.org [mailto:users-boun...@xwiki.org] Em nome de Raluca 
Stavro
Enviada em: quarta-feira, 18 de agosto de 2010 03:41
Para: XWiki Users
Assunto: Re: [xwiki-users] RES: Calendar Application on XE 2.4 
notworkingproperly

Yes, you have to edit XWiki.CalendarSheet document, add an object of
type 'XWiki.StyleSheetExtension', take the styles from the patch
(don't forget to remove all the '+'-es) and paste them into the
object's content, then set these properties:
Use this extension: 'On demand',
Parse content: 'Yes' .

This is what you have to copy from the patch:
/*
** Calendar
*/

#template('colorThemeInit.vm')
...
...
...
.wiki-calendar-daytitle {
  background-color: $theme.backgroundSecondaryColor;
  padding: 0px 3px;
  text-align: right;
}

Raluca.


2010/8/17 Ramon Gomes Brandão - SERINT ramon.bran...@tjdft.jus.br:
 Raluca,

 Is there a way to apply the modifications of this patch on my running 
 calendar application instance? I would like  to test it without the need to 
 build the application.

 Maybe editing the source code of xwiki/bin/view/XWiki/CalendarSheet ?

 Ramon Gomes Brandão


 -Mensagem original-
 De: users-boun...@xwiki.org [mailto:users-boun...@xwiki.org] Em nome de 
 Raluca Stavro
 Enviada em: terça-feira, 17 de agosto de 2010 10:32
 Para: XWiki Users
 Assunto: Re: [xwiki-users] Calendar Application on XE 2.4 not workingproperly

 Hello Ramon,

 The current calendar application has no custom styles applied on it.
 See http://jira.xwiki.org/jira/browse/XACALENDAR-14 .
 I added a patch to it and I hope that it will be applied very soon.

 Raluca.

 2010/8/13 Ramon Gomes Brandão - SERINT ramon.bran...@tjdft.jus.br:
 Hi,



 I've Just installed Calendar Plugin and Calendar Application on my XE 2.4 
 instance. It works when I point to xwiki/bin/view/Main/EventCalendar/, but 
 its look and feel is far away of that smooth one shown in the Calendar 
 Application home page 
 (http://code.xwiki.org/xwiki/bin/view/Applications/CalendarApplication).



 The calendar appears as a very simple and rough table, its cells don't have 
 a prefixed size (nothing more than just the length of the two digits number 
 of the day) and it does not show the PDF creation link. It also doesn't mark 
 the today day on the calendar. I've checked the source code and it seems 
 that the $cview.getHTMLCalendar($cparams, ) method isn't building a smooth 
 calendar. How can I fix this?



 Doesn't XE 2.4 contain an event calendar by default? If so, how can I access 
 it?



 I'm using the colibri skin.



 Regards,



 Ramon Gomes Brandão



 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users

 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] RES: RES: Calendar Application on XE 2.4 not working properly

2010-08-18 Thread Lockie

I got it to work, however I had to to put the 'Use This Extension' part to
'Always on this wiki'. I guess the 'Always on this page' part would work as
well if thats what you're after. I left the name part blank. 

Thanks Raluca it looks much better.

Lockie
-- 
View this message in context: 
http://xwiki.475771.n2.nabble.com/Calendar-Application-on-XE-2-4-not-working-properly-tp5420827p5438405.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users