Wiki source code of University of Helsinki Wiki

Last modified by Xwiki VePa on 2025/01/20 06:42

Hide last authors
Jarkko Seppälä 15.1 1
Xwiki VePa 1.1 2 {{container layoutStyle="columns"}}
3 (((
4 Use Wiki when your content needs to be editable/viewable outside the University.
5
6 If your content is meant for internal University of Helsinki use only, or for use
7 between EduGAIN and/or Haka federations, please use Flamma Workgroups instead.
8
9 [[See IT-Helpdesk instructions for selecting a suitable platform for your content>>https://helpdesk.it.helsinki.fi/node/1183/#varma]]
10
11 {{velocity}}
Xwiki VePa 21.1 12 ## Content visible only for uh-users
13 #set ($testGroup = 'XWiki.uh-users')
14 #if ($xwiki.getUser($xcontext.user).isUserInGroup($testGroup))
15 [[Create new Wiki space>>vepa-admin.public.Create New Space]]
16
17 [[Invite someone external to Wiki>>Invitation]]
18 #end
19 ## Content visible for anyone who has logged in
Xwiki VePa 1.1 20 #if(! $isGuest)
21 #set ($void = $services.async.useEntity("wiki:$xcontext.database"))
22 #set ($query = $services.query.xwql('select doc.fullName, doc.language, doc.contentUpdateDate from Document doc where doc.author = :author order by doc.date desc'))
23 #set ($recentDocs = $query.addFilter('hidden').addFilter('unique').bindValue('author', $xcontext.user).setLimit(5).execute())
24 ## We count the occurence of a document to specify the document language when there are duplicates
25 #set ($docNamesCounter = {})
26 #foreach ($doc in $recentDocs)
27 #if ($docNamesCounter.containsKey($doc[0]))
28 #set ($docNamesCounter[$doc[0]] = $docNamesCounter[$doc[0]] + 1)
29 #else
30 #set ($docNamesCounter[$doc[0]] = 1)
31 #end
32 #end
33 #if ($recentDocs.size() > 0)
34 ==$services.localization.render('xe.panels.modifications.my')==
35 |=Document|=Modified
36 #foreach ($recentDocResult in $recentDocs)
37 #set ($recentDoc = $xwiki.getDocument($recentDocResult[0]).getTranslatedDocument($recentDocResult[1]))
38 #if ($recentDoc)
39 #set ($docLocale = $recentDoc.locale)
40 #if ("$docLocale" == '')
41 #set ($docLocale = $recentDoc.defaultLocale)
42 #end
43 #if ("$docLocale" != '' && $docLocale != $xcontext.locale)
44 #set ($docUrl = $recentDoc.getURL('view', "language=${docLocale}"))
45 #else
46 #set ($docUrl = $recentDoc.getURL())
47 #end
48 ## We use HTML here because we don't have a tool to escape wiki syntax in document title.
49 |{{html}}<a href="${docUrl}">$escapetool.xml($recentDoc.plainTitle)#if ($docNamesCounter[$recentDocResult[0]] > 1) <em>($docLocale)</em>#end</a>{{/html}} ##
50 |$services.date.displayTimeAgo($recentDocResult[2])
51 ##|$recentDocResult[2]
52 #end
53 #end
54 #end
55 == Latest Visits ==
56 #set ($rv_maxItems = "$!xwiki.getUserPreference('recent_actions_items')")
57 #if ($rv_maxItems == '')
58 #set ($rv_maxItems = 10)
59 #end
60 #set ($recentlyViewed = $xwiki.statsService.getRecentActions('view', $rv_maxItems))
61 #if ($recentlyViewed.size() > 0)
62 |=Document
63 #foreach ($docName in $recentlyViewed)
64 #if ($xwiki.hasAccessLevel('view', $docName))
65 #set ($recentDoc = $xwiki.getDocument($docName).getTranslatedDocument())
66 ## We use HTML here because we don't have a tool to escape wiki syntax in document title.
67 |{{html}}<a data-cke-saved-href="$recentDoc.getURL()" href="$recentDoc.getURL()">$escapetool.xml($recentDoc.plainTitle)</a>{{/html}}
68 #end
69 #end
70 #end
71 #set ($userReference = $services.user.currentUserReference)
72 ##==============================
73 ## Offset = item # at which to start displaying data
74 ##==============================
75 ## offset starts from 0 in velocity and 1 in javascript
76 #set($offset = 0)
77 ##==================
78 ## Limit = # of items to display
79 ##==================
80 #set($limit = 50)
81 #set ($likedPages = $services.like.getUserLikes($userReference, $offset, $limit))
82 #set ($optUserLikes = $services.like.countUserLikes($userReference))
83 #set ($pagesRows = [])
84 #foreach($likedPage in $likedPages)
85 #set ($likedDoc = $xwiki.getDocument($likedPage))
86 ## code inspired from getdocuments.vm
87 #set ($viewable = $xwiki.hasAccessLevel('view', $xcontext.user, $services.model.serialize($likedPage, "default")))
88 #set ($row = {'doc_viewable' : $viewable})
89 #if ($viewable)
90 ## Handle troublemaker ':'
91 #set($cleanRequestPagePath = $stringtool.replace($likedDoc.getPageReference(), '\:', ':'))
92 #set ($rootDir = $stringtool.split($stringtool.removeStart($cleanRequestPagePath, 'xwiki:'), '/').get(0))
93 #set ($discard = $row.put('doc_rootDir', $rootDir))
94 #set ($discard = $row.put('doc_url', $xwiki.getURL($likedDoc)))
95 #set ($translatedDoc = $likedDoc.translatedDocument)
96 #set ($discard = $row.put('doc_title', $translatedDoc.plainTitle))
97 #set ($discard = $row.put('like', $documentLikes))
98 #set ($discard = $pagesRows.add($row))
99 #end
100 #end
101 ## -----------------------------------------
102 ## Print
103 ## -----------------------------------------
104 #if ($pagesRows.size() > 0)
105 ==$escapetool.xml($services.localization.render('like.userprofile.menu'))==
106 |=Document|=Space
107 #foreach ($likedPage in $pagesRows)
108 ## We use HTML here because we don't have a tool to escape wiki syntax in document title.
109 |{{html}}<a data-cke-saved-href="$likedPage.get('doc_url')" href="$likedPage.get('doc_url')">$escapetool.xml($likedPage.get('doc_title'))</a>{{/html}}|$likedPage.get('doc_rootDir')
110 #end
111 #end
112 #end
113 {{/velocity}}
114 )))
115 (((
116 == XWiki instructions and tutorials ==
117
118 [[See the XWiki support page for XWiki tutorials, guides and videos.>>vepa-admin.public.HY-Help]]
119
120 === More XWiki instructions ===
121
122 * [[How to migrate Confluence Wiki content to XWiki.>>https://helpdesk.it.helsinki.fi/en/help/20053]]
123 * [[XWiki migrations FAQ.>>https://helpdesk.it.helsinki.fi/en/instructions/collaboration-and-publication/wiki-and-flammas-working-groups/moving-and-archiving#FAQ]]
Jonas Sjöroos 18.1 124 * [[XWiki instructions in Helpdesk>>https://helpdesk.it.helsinki.fi/help/20055]]
Jonas Sjöroos 19.1 125
126
127 == XWiki News ==
128 {{velocity}}
129 #if($isGuest)
130 Log in to see XWiki news of University of Helsinki!
131 #else
132 {{blogpostlist blog="vepa-admin.public.HY XWiki Info Blog.WebHome" layout="full" layoutParams="vepaHideFooter=true"/}}
133 #end
134 {{/velocity}}
135
Xwiki VePa 1.1 136 )))
137 {{/container}}
138
Jarkko Seppälä 15.1 139