Re: [xwiki-users] Shortcut to another wiki in panel

2016-01-27 Thread Marius Dumitru Florea
On Wed, Jan 27, 2016 at 11:49 AM, Merritt, Cris 
wrote:

> Hi all, XWiki newbie here, just setting up XWiki for my company.
>
> In addition to the Main wiki, I have created 2 other wikis, say
> “Development” and “Support”. Currently I can only switch among the wikis
> via the Wiki Index (in fact, the other wikis do appear in the breadcrumb
> widget at the top, but not when in the Main wiki).
>
> I would like to put shortcuts to each wiki in the left panel, ideally with
> an icon and the wiki name. However, I have not found an out-of-the-box way
> to do this. Can someone point me in the right direction?
>

I guess that by shortcut you mean a link/anchor that points to the wiki.
Well, a link to the wiki is actually a link to the wiki home page. See
http://www.xwiki.org/xwiki/bin/view/XWiki/XWikiSyntax?syntax=2.1§ion=Links
. Something like this should work:

[[Development>>dev:Main.WebHome]]

Replace "dev" with the actual wiki id.

Hope this helps,
Marius


>
> Thank you.
>
> Regards,
> Cris
>
>
> ___
> 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] MyXWiki: migrate users to a permanent XWiki instance

2016-01-27 Thread Thomas Mortagne
XAR exported in 7.3 are supposed to be compatible with 6.4.x (or 1.0
for that matter). Unless you use things like sub space which simply
don't exist in 6.4 (but even in this case you will get your document
imported, just not exactly in the same place).

Do you get an error when you import it in the UI or in the log ?

On Wed, Jan 27, 2016 at 7:02 PM, Gerritjan Koekkoek
 wrote:
> Hi,
>
>
> The last half year we have used a free wiki from myXWiki.org, thanks a lot.
>
> Now we have decides to have a dedicated XWiki. Is it possible to migrate the 
> local users in that myXWiki instance to the new wiki.
>
> I tried to export one user as XAR and import it, but it does not convert to a 
> user-object
>
> The same problem with a macro page with the XWikiMacro and 
> XWikiMacroParameters objects.
>
> It results in empty wiki pages in the new wiki
>
>
> myXWiki = 7.3
>
> The new wiki is on 6.4.x
>
> So maybe a downgrade export/import not possible?
>
>
> Gerritjan Koekkoek
> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
> Visit our website
> Facebook
> email
>
>
>
> ___
> 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


[xwiki-users] MyXWiki: migrate users to a permanent XWiki instance

2016-01-27 Thread Gerritjan Koekkoek
Hi,


The last half year we have used a free wiki from myXWiki.org, thanks a lot.

Now we have decides to have a dedicated XWiki. Is it possible to migrate the 
local users in that myXWiki instance to the new wiki.

I tried to export one user as XAR and import it, but it does not convert to a 
user-object

The same problem with a macro page with the XWikiMacro and XWikiMacroParameters 
objects.

It results in empty wiki pages in the new wiki


myXWiki = 7.3

The new wiki is on 6.4.x

So maybe a downgrade export/import not possible?


Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website
Facebook
email



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


[xwiki-users] Returning JSON data from a java component

2016-01-27 Thread gervwyk
What is the best way to get JSON data from a java component. In my java
component I'm compiling JSONObjects and JSONArrays, I would like to return
this data to my velocity script in JSON format, is this possible? 

something like:

{{velocity wiki="false"}}
#if("$!request.outputSyntax" != '')
  $response.setContentType('application/json')
#end
#set($map = [])
#set ($rightIN =  ${request.rightIN}) 
#set ($spacenameIN =  ${request.spacenameIN}) 
#set($disgard =
$map.add($services.g_pagebuilder.userAccessFindPages($spacenameIN,$rightIN
)))
$jsontool.serialize($map)
{{/velocity}}

and the Java:

  public JSONObject javacomp(String spacenameIN, String rightIN ){
  JSONObject obj = new JSONObject();
  try {
obj.put("spacenameIN ", spacenameIN );
obj.put("rightIN", rightIN );
} catch (JSONException e) {
e.printStackTrace();
}
  return obj;
  }

At the end I would like to access this json object as a data return from an
ajax call. Is this possible?

Thanks
Gerrie






--
View this message in context: 
http://xwiki.475771.n2.nabble.com/Returning-JSON-data-from-a-java-component-tp7597700.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


[xwiki-users] Shortcut to another wiki in panel

2016-01-27 Thread Merritt, Cris
Hi all, XWiki newbie here, just setting up XWiki for my company. 

In addition to the Main wiki, I have created 2 other wikis, say “Development” 
and “Support”. Currently I can only switch among the wikis via the Wiki Index 
(in fact, the other wikis do appear in the breadcrumb widget at the top, but 
not when in the Main wiki). 

I would like to put shortcuts to each wiki in the left panel, ideally with an 
icon and the wiki name. However, I have not found an out-of-the-box way to do 
this. Can someone point me in the right direction?

Thank you.

Regards,
Cris


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


Re: [xwiki-users] Custom display for computed field which is list of users

2016-01-27 Thread Marius Dumitru Florea
On Tue, Jan 26, 2016 at 8:20 PM, Mark Sack 
wrote:

> In 7.4, I've created an app within minutes. One of the properties in the
> app
> is a computed field that returns a list of users that meet some specific
> criteria. If I leave the custom display field for the property blank, the
> contents are displayed as follows:
>
>

> [XWiki.john_smith, XWiki.mark_sack]
>

This must be the result / output of rendering the "script" meta property of
your computed field.


>
> What I would really like to do is display them as hyperlinks to the
> corresponding user page. I thought that I could use a script in the custom
> display field to accomplish this. Reading the following note
>
> http://www.xwiki.org/xwiki/bin/view/FAQ/Which+variables+I+can+use+in+%22Custom+Display%22+field
> there are some variables available. It looks like the $value variable
> should
> contain the computed list of users. But if I put a script like the
> following
> into the custom display field:
>
> {{velocity}}
> $name
> $prefix
> $object
> $type
> $value
> {{/velocity}}
>
> the result is as follows
>
> Usuarios
> Secti.Admin.Setores.Code.SetoresClass_0_
> com.xpn.xwiki.api.Object@543f3466
> view
> $value
>
> The first four values are correct as far as I can tell. But the $value
> variable does not appear to be populated. Does anyone have a suggestion as
> to how I can achieve my desired result with the hyperlinks?
>

$value is null because computed fields don't have a value stored in the
database. Their "value" is dynamic, computed by rendering the "script" meta
property. You have two options:

(1) Render the "script" meta property in the custom displayer and use the
data that has been put in the Velocity context (assuming you're using
Velocity in the "script" value)

{{velocity}}
#set ($script = $object.getxWikiClass().get($name).getValue('script'))
#set ($classSyntax = $xwiki.getDocument($object.documentReference).syntax)
#set ($discard = $doc.getRenderedContent($script, $classSyntax))
## Assuming $users is set in the "script" meta property
$users
{{/velocity}}

(2) Most of the time you don't need to access the "raw" value of a computed
field. If you're only interested in displaying it then it's easier to
generate the hyperlinks directly in the "script" meta property. Which is
equivalent with leaving the "script" meta property empty and putting all
the code in the custom displayer.

Hope this helps,
Marius


>
>
>
> --
> View this message in context:
> http://xwiki.475771.n2.nabble.com/Custom-display-for-computed-field-which-is-list-of-users-tp7597697.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