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