Re: [xwiki-users] FAQ Application tutorial is incomprehensible

2015-08-26 Thread Manuel Smeria
Hello Alex,

I will look over the manual FAQ tutorial this week and update it.
I'll also add some links to the documentation pages for the terms you
specified.

Thank you,
Manuel

On Tue, Aug 25, 2015 at 5:12 AM, Alex Henrie alexhenri...@gmail.com wrote:

 Hi,

 I need to modify an XWiki application to add some functionality, but I
 am new to XWiki and I am having a really hard time understanding it.
 I'm running XWiki Enterprise 7.1.2. The FAQ application tutorial
 http://platform.xwiki.org/xwiki/bin/view/DevGuide/FAQTutorialManual
 looks promising, but the instructions are outdated and I can't figure
 out how to get a finished product that looks like what the tutorial
 has. The following instructions are particularly problematic:

  In the code, change the word Main with the name of the space where you
 want you FAQ pages to be created

 There is no word Main.

  If you click on View the template document and edit that page in wiki
 mode, you will see the following code: {{include
 document=FAQ.FAQClassSheet/}}

 The page is blank, I don't see any code.

  Use the Create top level menu (when using the Colibri skin) or the
 Create Panel to create the FAQ.WebHome page

 I don't see anything marked Create.

 Is there an experienced XWiki developer who would be willing to go
 through the FAQ application tutorial and rewrite it to make sense for
 the latest version of XWiki?

 More generally, it would be very helpful to have a glossary that
 defines and relates terms like application, page, document,
 object, property, class, template, and template provider.
 These terms are used in the documentation with little or no
 explanation, which adds to the confusion.

 -Alex
 ___
 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] Container authentication

2015-08-26 Thread Thomas Mortagne
On Tue, Aug 25, 2015 at 5:04 PM, Tim Dudgeon
tdudg...@informaticsmatters.com wrote:
 So it looks like the AppServerTrustedAuthServiceImpl class is calling
 createUser():
 https://github.com/xwiki/xwiki-platform/blob/dd5152e8ff39e6358c20becb4c9925628cf08ea4/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/user/impl/xwiki/AppServerTrustedAuthServiceImpl.java

 But that should mean that my externally authenticated user should be being
 added and should get the XWiki.XWikiAllGroup.

 But that doesn't seem to be happening in my case as I'm being although I'm
 authenticated I'm denied access.

It's easy to check in the administration who is part of XWikiAllGroup.


 Have I misunderstood the situation?

 Tim




 On 24/08/2015 10:15, Thomas Mortagne wrote:

 Note that an authenticator is supposed to use
 com.xpn.xwiki.XWiki#createUser API which automatically add the user in
 the minimum groups.

 On Mon, Aug 24, 2015 at 4:11 PM, Thomas Mortagne
 thomas.morta...@xwiki.com wrote:

 The minimum group is XWiki.XWikiAllGroup.

 On Mon, Aug 24, 2015 at 1:50 PM, Tim Dudgeon
 tdudg...@informaticsmatters.com wrote:

 On 24/08/2015 04:24, Thomas Mortagne wrote:


 Sounds like your user is not added in the right group(s) (which mean
 it does not have any right).



 Quite likely. But what groups are needed?


 Tim

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




 --
 Thomas Mortagne






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



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


Re: [xwiki-users] Container authentication

2015-08-26 Thread Tim Dudgeon

So its not working for me.

I've made sure the external user has the XWiki.XWikiAllGroup role and 
its still not working. The user does not get the necessary rights and I 
get the Error. You are not allowed to view this document or perform 
this action error message.

Also, that user is not added to the XWiki users.

Are there any example sof how to get this working?

Tim



On 26/08/2015 02:51, Thomas Mortagne wrote:

On Tue, Aug 25, 2015 at 5:04 PM, Tim Dudgeon
tdudg...@informaticsmatters.com wrote:

So it looks like the AppServerTrustedAuthServiceImpl class is calling
createUser():
https://github.com/xwiki/xwiki-platform/blob/dd5152e8ff39e6358c20becb4c9925628cf08ea4/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/user/impl/xwiki/AppServerTrustedAuthServiceImpl.java

But that should mean that my externally authenticated user should be being
added and should get the XWiki.XWikiAllGroup.

But that doesn't seem to be happening in my case as I'm being although I'm
authenticated I'm denied access.


It's easy to check in the administration who is part of XWikiAllGroup.



Have I misunderstood the situation?

Tim




On 24/08/2015 10:15, Thomas Mortagne wrote:


Note that an authenticator is supposed to use
com.xpn.xwiki.XWiki#createUser API which automatically add the user in
the minimum groups.

On Mon, Aug 24, 2015 at 4:11 PM, Thomas Mortagne
thomas.morta...@xwiki.com wrote:


The minimum group is XWiki.XWikiAllGroup.

On Mon, Aug 24, 2015 at 1:50 PM, Tim Dudgeon
tdudg...@informaticsmatters.com wrote:


On 24/08/2015 04:24, Thomas Mortagne wrote:



Sounds like your user is not added in the right group(s) (which mean
it does not have any right).




Quite likely. But what groups are needed?


Tim

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





--
Thomas Mortagne








___
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] on XWiki.StyleSheetExtension

2015-08-26 Thread Thomas Mortagne
You can enable Velocity in StyleSheetExtension content (the Parse
content property).

The problem is that it means you need to disable caching as otherwise
the browser will stick with the first version it downloaded.

On Wed, Aug 26, 2015 at 10:32 AM, [IDIS Technical Secretariat] Ricardo
Rodríguez ricardo.rodrig...@idisantiago.es wrote:
 Hi!

 Please, is it possible to customise a XWiki.StyleSheetExtension object to
 apply different properties to different actions in the same page?

 For instance, I would like to use different #mainContentArea { margin-top:
 ; } values when viewing, or editing a page, i.e. Home.WebHome, or creating
 new pages in that Home space.

 Thanks for your help!

 Ricardo

 --
 Ricardo Rodríguez
 Research Management and Promotion Technician
 Technical Secretariat
 Health Research Institute of Santiago de Compostela (IDIS)
 http://www.idisantiago.es
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users



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


Re: [xwiki-users] on XWiki.StyleSheetExtension

2015-08-26 Thread [IDIS Technical Secretariat] Ricardo Rodríguez
Thanks! So simple, so nice...

Still, I'm not able to get it working yet... Here what I'm trying to get...

{{velocity}}
#if($context.action == 'view')
#mainContentArea {
  margin-top: -35px;
  padding: 0px 0px;
}
#end
{{/velocity}}

I didn't get this code read while within the Velocity IF structure. In the
log, I'm getting this...

2015-08-26 13:00:13,926 [
http://localhost:8080/xwiki/bin/ssx/Home/WebHome?language=en] WARN
 o.x.v.i.DefaultVelocityEngine  - Deprecated usage of getter
[com.xpn.xwiki.api.DeprecatedContext.getAction] in 360:xwiki:Home.WebHome@6
,14

Please, what am I doing wrong? Thanks!

Ricardo


On Wed, Aug 26, 2015 at 10:52 AM, Thomas Mortagne thomas.morta...@xwiki.com
 wrote:

 You can enable Velocity in StyleSheetExtension content (the Parse
 content property).

 The problem is that it means you need to disable caching as otherwise
 the browser will stick with the first version it downloaded.

 On Wed, Aug 26, 2015 at 10:32 AM, [IDIS Technical Secretariat] Ricardo
 Rodríguez ricardo.rodrig...@idisantiago.es wrote:
  Hi!
 
  Please, is it possible to customise a XWiki.StyleSheetExtension object to
  apply different properties to different actions in the same page?
 
  For instance, I would like to use different #mainContentArea {
 margin-top:
  ; } values when viewing, or editing a page, i.e. Home.WebHome, or
 creating
  new pages in that Home space.
 
  Thanks for your help!
 
  Ricardo
 
  --
  Ricardo Rodríguez
  Research Management and Promotion Technician
  Technical Secretariat
  Health Research Institute of Santiago de Compostela (IDIS)
  http://www.idisantiago.es
  ___
  users mailing list
  users@xwiki.org
  http://lists.xwiki.org/mailman/listinfo/users



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




-- 
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] on XWiki.StyleSheetExtension

2015-08-26 Thread Thomas Mortagne
On Wed, Aug 26, 2015 at 1:37 PM, [IDIS Technical Secretariat] Ricardo
Rodríguez ricardo.rodrig...@idisantiago.es wrote:
 Thanks! But there is still something I doing the wrong way. If I introduce
 the following lines in the XWiki.StyleSheetExtension object code...

 #if($context.action == 'view')
 #mainContentArea {
   margin-top: -35px;
   padding: 0px 0px;
 }
 #else
 #mainContentArea {
   margin-top: 100px;
   padding: 0px 0px;
 }
 #end

 I do get a 100px top margin when viewing the page...

 http://portal.idisantiago.es

 I'm afraid I'm wrongly using $context.action, but I don't understand why!

The problem with this specific use case is that your code is not
executed in the context of the document view but as an asynchronous
ssx resource with an URL looking like
http://mydomain/xwiki/bin/ssx/Space/Page and the action being ssx I
think (not view in any case).

If you are the one calling $xwiki.ssx.use(Spac.Page) you could do
something like $xwiki.ssx.use('Space.Page', {'sourceAction' :
$xcontext.action}) and then modify your ssx to be something like

#if($request.sourceAction == 'view')
#mainContentArea {
  margin-top: -35px;
  padding: 0px 0px;
}
#else
#mainContentArea {
  margin-top: 100px;
  padding: 0px 0px;
}
#end

 Help, please!

 Thanks,

 Ricardo

 On Wed, Aug 26, 2015 at 1:14 PM, Thomas Mortagne thomas.morta...@xwiki.com
 wrote:

 {{velocity}} is wiki syntax to indicate that you want to insert some
 Velocity. When you enable parsing the whole content become Velocity
 already.

 On Wed, Aug 26, 2015 at 1:04 PM, [IDIS Technical Secretariat] Ricardo
 Rodríguez ricardo.rodrig...@idisantiago.es wrote:
  Thanks! So simple, so nice...
 
  Still, I'm not able to get it working yet... Here what I'm trying to
 get...
 
  {{velocity}}
  #if($context.action == 'view')
  #mainContentArea {
margin-top: -35px;
padding: 0px 0px;
  }
  #end
  {{/velocity}}
 
  I didn't get this code read while within the Velocity IF structure. In
 the
  log, I'm getting this...
 
  2015-08-26 13:00:13,926 [
  http://localhost:8080/xwiki/bin/ssx/Home/WebHome?language=en] WARN
   o.x.v.i.DefaultVelocityEngine  - Deprecated usage of getter
  [com.xpn.xwiki.api.DeprecatedContext.getAction] in
 360:xwiki:Home.WebHome@6
  ,14
 
  Please, what am I doing wrong? Thanks!
 
  Ricardo
 
 
  On Wed, Aug 26, 2015 at 10:52 AM, Thomas Mortagne 
 thomas.morta...@xwiki.com
  wrote:
 
  You can enable Velocity in StyleSheetExtension content (the Parse
  content property).
 
  The problem is that it means you need to disable caching as otherwise
  the browser will stick with the first version it downloaded.
 
  On Wed, Aug 26, 2015 at 10:32 AM, [IDIS Technical Secretariat] Ricardo
  Rodríguez ricardo.rodrig...@idisantiago.es wrote:
   Hi!
  
   Please, is it possible to customise a XWiki.StyleSheetExtension
 object to
   apply different properties to different actions in the same page?
  
   For instance, I would like to use different #mainContentArea {
  margin-top:
   ; } values when viewing, or editing a page, i.e. Home.WebHome, or
  creating
   new pages in that Home space.
  
   Thanks for your help!
  
   Ricardo
  
   --
   Ricardo Rodríguez
   Research Management and Promotion Technician
   Technical Secretariat
   Health Research Institute of Santiago de Compostela (IDIS)
   http://www.idisantiago.es
   ___
   users mailing list
   users@xwiki.org
   http://lists.xwiki.org/mailman/listinfo/users
 
 
 
  --
  Thomas Mortagne
  ___
  users mailing list
  users@xwiki.org
  http://lists.xwiki.org/mailman/listinfo/users
 
 
 
 
  --
  Ricardo Rodríguez
  Research Management and Promotion Technician
  Technical Secretariat
  Health Research Institute of Santiago de Compostela (IDIS)
  http://www.idisantiago.es
  ___
  users mailing list
  users@xwiki.org
  http://lists.xwiki.org/mailman/listinfo/users



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




 --
 Ricardo Rodríguez
 Research Management and Promotion Technician
 Technical Secretariat
 Health Research Institute of Santiago de Compostela (IDIS)
 http://www.idisantiago.es
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users



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


Re: [xwiki-users] on XWiki.StyleSheetExtension

2015-08-26 Thread [IDIS Technical Secretariat] Ricardo Rodríguez
Thanks! But there is still something I doing the wrong way. If I introduce
the following lines in the XWiki.StyleSheetExtension object code...

#if($context.action == 'view')
#mainContentArea {
  margin-top: -35px;
  padding: 0px 0px;
}
#else
#mainContentArea {
  margin-top: 100px;
  padding: 0px 0px;
}
#end

I do get a 100px top margin when viewing the page...

http://portal.idisantiago.es

I'm afraid I'm wrongly using $context.action, but I don't understand why!
Help, please!

Thanks,

Ricardo

On Wed, Aug 26, 2015 at 1:14 PM, Thomas Mortagne thomas.morta...@xwiki.com
wrote:

 {{velocity}} is wiki syntax to indicate that you want to insert some
 Velocity. When you enable parsing the whole content become Velocity
 already.

 On Wed, Aug 26, 2015 at 1:04 PM, [IDIS Technical Secretariat] Ricardo
 Rodríguez ricardo.rodrig...@idisantiago.es wrote:
  Thanks! So simple, so nice...
 
  Still, I'm not able to get it working yet... Here what I'm trying to
 get...
 
  {{velocity}}
  #if($context.action == 'view')
  #mainContentArea {
margin-top: -35px;
padding: 0px 0px;
  }
  #end
  {{/velocity}}
 
  I didn't get this code read while within the Velocity IF structure. In
 the
  log, I'm getting this...
 
  2015-08-26 13:00:13,926 [
  http://localhost:8080/xwiki/bin/ssx/Home/WebHome?language=en] WARN
   o.x.v.i.DefaultVelocityEngine  - Deprecated usage of getter
  [com.xpn.xwiki.api.DeprecatedContext.getAction] in
 360:xwiki:Home.WebHome@6
  ,14
 
  Please, what am I doing wrong? Thanks!
 
  Ricardo
 
 
  On Wed, Aug 26, 2015 at 10:52 AM, Thomas Mortagne 
 thomas.morta...@xwiki.com
  wrote:
 
  You can enable Velocity in StyleSheetExtension content (the Parse
  content property).
 
  The problem is that it means you need to disable caching as otherwise
  the browser will stick with the first version it downloaded.
 
  On Wed, Aug 26, 2015 at 10:32 AM, [IDIS Technical Secretariat] Ricardo
  Rodríguez ricardo.rodrig...@idisantiago.es wrote:
   Hi!
  
   Please, is it possible to customise a XWiki.StyleSheetExtension
 object to
   apply different properties to different actions in the same page?
  
   For instance, I would like to use different #mainContentArea {
  margin-top:
   ; } values when viewing, or editing a page, i.e. Home.WebHome, or
  creating
   new pages in that Home space.
  
   Thanks for your help!
  
   Ricardo
  
   --
   Ricardo Rodríguez
   Research Management and Promotion Technician
   Technical Secretariat
   Health Research Institute of Santiago de Compostela (IDIS)
   http://www.idisantiago.es
   ___
   users mailing list
   users@xwiki.org
   http://lists.xwiki.org/mailman/listinfo/users
 
 
 
  --
  Thomas Mortagne
  ___
  users mailing list
  users@xwiki.org
  http://lists.xwiki.org/mailman/listinfo/users
 
 
 
 
  --
  Ricardo Rodríguez
  Research Management and Promotion Technician
  Technical Secretariat
  Health Research Institute of Santiago de Compostela (IDIS)
  http://www.idisantiago.es
  ___
  users mailing list
  users@xwiki.org
  http://lists.xwiki.org/mailman/listinfo/users



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




-- 
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] on XWiki.StyleSheetExtension

2015-08-26 Thread Thomas Mortagne
{{velocity}} is wiki syntax to indicate that you want to insert some
Velocity. When you enable parsing the whole content become Velocity
already.

On Wed, Aug 26, 2015 at 1:04 PM, [IDIS Technical Secretariat] Ricardo
Rodríguez ricardo.rodrig...@idisantiago.es wrote:
 Thanks! So simple, so nice...

 Still, I'm not able to get it working yet... Here what I'm trying to get...

 {{velocity}}
 #if($context.action == 'view')
 #mainContentArea {
   margin-top: -35px;
   padding: 0px 0px;
 }
 #end
 {{/velocity}}

 I didn't get this code read while within the Velocity IF structure. In the
 log, I'm getting this...

 2015-08-26 13:00:13,926 [
 http://localhost:8080/xwiki/bin/ssx/Home/WebHome?language=en] WARN
  o.x.v.i.DefaultVelocityEngine  - Deprecated usage of getter
 [com.xpn.xwiki.api.DeprecatedContext.getAction] in 360:xwiki:Home.WebHome@6
 ,14

 Please, what am I doing wrong? Thanks!

 Ricardo


 On Wed, Aug 26, 2015 at 10:52 AM, Thomas Mortagne thomas.morta...@xwiki.com
 wrote:

 You can enable Velocity in StyleSheetExtension content (the Parse
 content property).

 The problem is that it means you need to disable caching as otherwise
 the browser will stick with the first version it downloaded.

 On Wed, Aug 26, 2015 at 10:32 AM, [IDIS Technical Secretariat] Ricardo
 Rodríguez ricardo.rodrig...@idisantiago.es wrote:
  Hi!
 
  Please, is it possible to customise a XWiki.StyleSheetExtension object to
  apply different properties to different actions in the same page?
 
  For instance, I would like to use different #mainContentArea {
 margin-top:
  ; } values when viewing, or editing a page, i.e. Home.WebHome, or
 creating
  new pages in that Home space.
 
  Thanks for your help!
 
  Ricardo
 
  --
  Ricardo Rodríguez
  Research Management and Promotion Technician
  Technical Secretariat
  Health Research Institute of Santiago de Compostela (IDIS)
  http://www.idisantiago.es
  ___
  users mailing list
  users@xwiki.org
  http://lists.xwiki.org/mailman/listinfo/users



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




 --
 Ricardo Rodríguez
 Research Management and Promotion Technician
 Technical Secretariat
 Health Research Institute of Santiago de Compostela (IDIS)
 http://www.idisantiago.es
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users



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


Re: [xwiki-users] [myxwiki] new wiki request

2015-08-26 Thread Andrew Roberts
Hi Thomas, just tested it, and you're right.  Strange, when first logging
into fabfarm, it was saying my user didn't even exist.  Then I tried the
main portal, logged in fine.  And now I can login through the fabfarm
subwiki.

Anyhow, thanks again! I'm going to have fun I think!

Andy

On Mon, Aug 24, 2015 at 3:01 AM, Thomas Mortagne thomas.morta...@xwiki.com
wrote:

 Actually you can login with your main wiki user from your wiki (which
 is a subwiki).

 On Wed, Aug 19, 2015 at 8:39 PM, Andrew Roberts
 roberts.andre...@gmail.com wrote:
  Hi Thomas,
That's my bad... didn't realize I need to login through the main site.
 
  Thank you!
  Andy
 
  On Wed, Aug 19, 2015 at 2:10 AM, Thomas Mortagne 
 thomas.morta...@xwiki.com
  wrote:
 
  That user does exist, you are probably using the wrong password.
 
  On Mon, Aug 17, 2015 at 5:58 PM, Andrew Roberts
  roberts.andre...@gmail.com wrote:
   Hmmm,
  
   The *AndrewRoberts* user does not exist
  
  
   Correct me if I'm wrong but that's the name I submitted?
  
   A
  
   On Mon, Aug 17, 2015 at 10:55 AM, Thomas Mortagne 
  thomas.morta...@xwiki.com
   wrote:
  
   You can login with the user you gave me in the first mail.
  
   On Mon, Aug 17, 2015 at 5:49 PM, Andrew Roberts
   roberts.andre...@gmail.com wrote:
Hi Thomas,
   
Very cool, thanks for your efforts.  However, did I miss how to
 login
administratively?
   
Best,
Andy
   
On Mon, Aug 17, 2015 at 1:29 AM, Thomas Mortagne 
   thomas.morta...@xwiki.com
wrote:
   
Sorry for the delay, August is not the best month to ask stuff :)
   
You can access your new wiki on http://fabfarm.myxwiki.org.
 Enjoy !
   
On Mon, Aug 10, 2015 at 6:45 AM,  roberts.andre...@gmail.com
  wrote:
 description: forking opensource hardware project (
   opensourceecology.org
- “fabfarm”)
 owner name: AndrewRoberts
 wiki name: fabfarm.myxwiki.org






 Sent from Windows Mail
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
   
   
   
--
Thomas Mortagne
___
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
  
  
  
   --
   Thomas Mortagne
   ___
   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
 
 
 
  --
  Thomas Mortagne
  ___
  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



 --
 Thomas Mortagne
 ___
 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] on XWiki.StyleSheetExtension

2015-08-26 Thread [IDIS Technical Secretariat] Ricardo Rodríguez
Hi!

Please, is it possible to customise a XWiki.StyleSheetExtension object to
apply different properties to different actions in the same page?

For instance, I would like to use different #mainContentArea { margin-top:
; } values when viewing, or editing a page, i.e. Home.WebHome, or creating
new pages in that Home space.

Thanks for your help!

Ricardo

-- 
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] on XWiki.StyleSheetExtension

2015-08-26 Thread [IDIS Technical Secretariat] Ricardo Rodríguez
Thanks! Please, read below...

On Wed, Aug 26, 2015 at 2:45 PM, Thomas Mortagne thomas.morta...@xwiki.com
wrote:

 On Wed, Aug 26, 2015 at 1:37 PM, [IDIS Technical Secretariat] Ricardo
 Rodríguez ricardo.rodrig...@idisantiago.es wrote:
  Thanks! But there is still something I doing the wrong way. If I
 introduce
  the following lines in the XWiki.StyleSheetExtension object code...
 
  #if($context.action == 'view')
  #mainContentArea {
margin-top: -35px;
padding: 0px 0px;
  }
  #else
  #mainContentArea {
margin-top: 100px;
padding: 0px 0px;
  }
  #end
 
  I do get a 100px top margin when viewing the page...
 
  http://portal.idisantiago.es
 
  I'm afraid I'm wrongly using $context.action, but I don't understand why!

 The problem with this specific use case is that your code is not
 executed in the context of the document view but as an asynchronous
 ssx resource with an URL looking like
 http://mydomain/xwiki/bin/ssx/Space/Page and the action being ssx I
 think (not view in any case).

 If you are the one calling $xwiki.ssx.use(Spac.Page) you could do
 something like $xwiki.ssx.use('Space.Page', {'sourceAction' :
 $xcontext.action}) and then modify your ssx to be something like

 #if($request.sourceAction == 'view')
 #mainContentArea {
   margin-top: -35px;
   padding: 0px 0px;
 }
 #else
 #mainContentArea {
   margin-top: 100px;
   padding: 0px 0px;
 }
 #end


Following these notes plus reading once again..

http://platform.xwiki.org/xwiki/bin/view/DevGuide/SkinExtensionsTutorial

I've done this..

1) Change to SSX extension to on demand only to be sure when and which
extension I'm calling.

2) Call the extension from the concerned page with this code...

{{velocity}}
#set($void = $xwiki.ssx.use($doc.fullName, {'sourceAction' :
$xcontext.action}))
{{/velocity}}

3) Modify the code of the SSX extension the way you proposed...

#if($request.sourceAction == 'view')
#mainContentArea {
  margin-top: -35px;
  padding: 0px 0px;
}
#else
#mainContentArea {
  margin-top: 100px;
  padding: 0px 0px;
}
#end

I've learnt a lot! Thank you very much! Unfortunately my programming
background, despite years of good intentions, remains still quite poor!
I'll keep trying.


  Help, please!
 
  Thanks,
 
  Ricardo
 
  On Wed, Aug 26, 2015 at 1:14 PM, Thomas Mortagne 
 thomas.morta...@xwiki.com
  wrote:
 
  {{velocity}} is wiki syntax to indicate that you want to insert some
  Velocity. When you enable parsing the whole content become Velocity
  already.
 
  On Wed, Aug 26, 2015 at 1:04 PM, [IDIS Technical Secretariat] Ricardo
  Rodríguez ricardo.rodrig...@idisantiago.es wrote:
   Thanks! So simple, so nice...
  
   Still, I'm not able to get it working yet... Here what I'm trying to
  get...
  
   {{velocity}}
   #if($context.action == 'view')
   #mainContentArea {
 margin-top: -35px;
 padding: 0px 0px;
   }
   #end
   {{/velocity}}
  
   I didn't get this code read while within the Velocity IF structure. In
  the
   log, I'm getting this...
  
   2015-08-26 13:00:13,926 [
   http://localhost:8080/xwiki/bin/ssx/Home/WebHome?language=en] WARN
o.x.v.i.DefaultVelocityEngine  - Deprecated usage of getter
   [com.xpn.xwiki.api.DeprecatedContext.getAction] in
  360:xwiki:Home.WebHome@6
   ,14
  
   Please, what am I doing wrong? Thanks!
  
   Ricardo
  
  
   On Wed, Aug 26, 2015 at 10:52 AM, Thomas Mortagne 
  thomas.morta...@xwiki.com
   wrote:
  
   You can enable Velocity in StyleSheetExtension content (the Parse
   content property).
  
   The problem is that it means you need to disable caching as otherwise
   the browser will stick with the first version it downloaded.
  
   On Wed, Aug 26, 2015 at 10:32 AM, [IDIS Technical Secretariat]
 Ricardo
   Rodríguez ricardo.rodrig...@idisantiago.es wrote:
Hi!
   
Please, is it possible to customise a XWiki.StyleSheetExtension
  object to
apply different properties to different actions in the same page?
   
For instance, I would like to use different #mainContentArea {
   margin-top:
; } values when viewing, or editing a page, i.e. Home.WebHome, or
   creating
new pages in that Home space.
   
Thanks for your help!
   
Ricardo
   
--
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
  
  
  
   --
   Thomas Mortagne
   ___
   users mailing list
   users@xwiki.org
   http://lists.xwiki.org/mailman/listinfo/users
  
  
  
  
   --
   Ricardo Rodríguez
   Research Management and Promotion Technician
   Technical Secretariat
   Health Research Institute of Santiago de Compostela (IDIS)
   http://www.idisantiago.es
   ___
   users mailing list
   

Re: [xwiki-users] Creating a new page creates a space instead

2015-08-26 Thread junglur
Hi,

Sorry for the late reply, I've just moved house so been pretty busy.

But yes that update has made it much clearer for someone new to understand.

Thanks!!



--
View this message in context: 
http://xwiki.475771.n2.nabble.com/Creating-a-new-page-creates-a-space-instead-tp7595617p7595770.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