<commit_before><?xml version="1.0" encoding="UTF-8"?>

<!--
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<xwikidoc>
  <web>data</web>
  <name>AllData</name>
  <language/>
  <defaultLanguage/>
  <translation>0</translation>
  <parent>data.WebHome</parent>
  <creator>xwiki:XWiki.Admin</creator>
  <author>xwiki:XWiki.Admin</author>
  <customClass/>
  <contentAuthor>xwiki:XWiki.Admin</contentAuthor>
  <creationDate>1384801354000</creationDate>
  <date>1384802193000</date>
  <contentUpdateDate>1384802193000</contentUpdateDate>
  <version>1.1</version>
  <title>All patient records</title>
  <defaultTemplate/>
  <validationScript/>
  <comment/>
  <minorEdit>false</minorEdit>
  <syntaxId>xwiki/2.1</syntaxId>
  <hidden>true</hidden>
  <content>{{include document="PhenoTips.DatabaseFilters" /}}

{{velocity}}
{{html wiki=false clean=false}}&lt;div class="general-tools"&gt;#if($hasCreatePage)&lt;label for="create-patient-record"&gt;&lt;span class="icon-plus-sign"&gt; &lt;/span&gt;New patient record&lt;/label&gt; · #end&lt;a id="phenotips_export" title="Export the database in CSV format (MS Excel compatible)" href="$xwiki.getURL('PhenoTips.Export', 'get', "space=${escapetool.url($doc.space)}&amp;amp;outputSyntax=plain")"&gt;&lt;span class="icon-table"&gt; &lt;/span&gt;Export database&lt;/a&gt;&lt;/div&gt;{{/html}}{{/velocity}}

{{velocity}}
$xwiki.ssfx.use('uicomponents/suggest/suggestPicker.css', true)##
$xwiki.jsfx.use('uicomponents/suggest/suggestPicker.js', true)##
$xwiki.ssfx.use('uicomponents/widgets/userpicker/userPicker.css', true)##
$xwiki.jsfx.use('uicomponents/widgets/userpicker/userPicker.js', true)##
$xwiki.ssx.use('PhenoTips.DatabaseFilters')##
$xwiki.ssx.use('PhenoTips.Skin', {'colorTheme' : "$xwiki.getSpacePreference('colorTheme')"})##
$xwiki.jsx.use('PhenoTips.DBWebHomeSheet')##
$xwiki.ssx.use('PhenoTips.DBWebHomeSheet')##
$xwiki.ssx.use('PhenoTips.Widgets')##
$xwiki.jsx.use('PhenoTips.Widgets')##
$xwiki.jsx.use('XWiki.DateTimePicker')##
$xwiki.ssx.use('XWiki.DateTimePicker')##
#set ($config = $xwiki.getDocument('data.WebHome').getObject('PhenoTips.DBConfigurationClass'))
#set ($patientClassName = 'PhenoTips.PatientClass')
#if ($config)
#set ($configuredColumns = $config.getProperty('livetableColumns').value)
#if (!$configuredColumns &amp;&amp; !($configuredColumns.length &gt; 0))
  #set ($configuredColumns = 'doc.name')
#end
#set ($columns = [])
#set ($discard = $columns.addAll($configuredColumns))
#set ($columnsProperties = {
  '_actions' : {'actions': ['edit', 'delete']}
})
#foreach ($column in $columns)
  #set ($isFilterable = ($column.toLowerCase().indexOf('date') &lt; 0))
  #set ($discard = $columnsProperties.put($column, { 'type' : 'text', 'link' : 'view', 'size' : 7, 'filterable' : $isFilterable, 'sortable': true, 'html': true }))
#end
#foreach ($filterableColumn in ['date_of_birth', 'omim_id', 'phenotype'])
  #if (!$configuredColumns.contains($filterableColumn))
    #set ($discard = $columns.add($filterableColumn))
    #set ($discard = $columnsProperties.put($filterableColumn, { 'type' : 'hidden' }))
  #end
#end
##
#set ($topFilters = $doc.getRenderedContent("(% class='xform' %)((((% class=""toggle-filters"" %) filters(% %)
== Filters ==

{{velocity}}#__filters_display('xform'){{/velocity}})))", "xwiki/2.1"))
#set ($discard = $columns.add('_actions'))
##
#set ($options = {
  'className'         : $patientClassName,
  'translationPrefix' : 'patient.livetable.',
  'rowCount'          : 25,
  'maxPages'          : 10,
  'selectedColumn'    : $config.getProperty('livetableSortColumn').value,
  'defaultOrder'      : 'asc',
  'topFilters'        : $topFilters,
  'resultPage'        : 'PhenoTips.LiveTableResults'
})
#if ("$!config.getProperty('livetableRows').value" != '' &amp;&amp; $config.getProperty('livetableRows').value &gt; 0)
  #set ($options.rowCount = $config.getProperty('livetableRows').value)
#end
#livetable('patients' $columns $columnsProperties $options)
$xwiki.ssfx.use('js/xwiki/table/livetable.css', {'colorTheme' : "$xwiki.getSpacePreference('colorTheme')", 'forceSkinAction' : true})##
#else
{{warning}}**Configuration missing.**{{/warning}}
#end
{{/velocity}}</content>
</xwikidoc><commit_msg>Issue #519: Adapt the livetable widget to not show inaccessible documents at all Done.<commit_after><?xml version="1.0" encoding="UTF-8"?>

<!--
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<xwikidoc>
  <web>data</web>
  <name>AllData</name>
  <language/>
  <defaultLanguage/>
  <translation>0</translation>
  <parent>data.WebHome</parent>
  <creator>xwiki:XWiki.Admin</creator>
  <author>xwiki:XWiki.Admin</author>
  <customClass/>
  <contentAuthor>xwiki:XWiki.Admin</contentAuthor>
  <creationDate>1384801354000</creationDate>
  <date>1384802193000</date>
  <contentUpdateDate>1384802193000</contentUpdateDate>
  <version>1.1</version>
  <title>All patient records</title>
  <defaultTemplate/>
  <validationScript/>
  <comment/>
  <minorEdit>false</minorEdit>
  <syntaxId>xwiki/2.1</syntaxId>
  <hidden>true</hidden>
  <content>{{include document="PhenoTips.DatabaseFilters" /}}

{{velocity}}
{{html wiki=false clean=false}}&lt;div class="general-tools"&gt;#if($hasCreatePage)&lt;label for="create-patient-record"&gt;&lt;span class="icon-plus-sign"&gt; &lt;/span&gt;New patient record&lt;/label&gt; · #end&lt;a id="phenotips_export" title="Export the database in CSV format (MS Excel compatible)" href="$xwiki.getURL('PhenoTips.Export', 'get', "space=${escapetool.url($doc.space)}&amp;amp;outputSyntax=plain")"&gt;&lt;span class="icon-table"&gt; &lt;/span&gt;Export database&lt;/a&gt;&lt;/div&gt;{{/html}}{{/velocity}}

{{velocity}}
$xwiki.ssfx.use('uicomponents/suggest/suggestPicker.css', true)##
$xwiki.jsfx.use('uicomponents/suggest/suggestPicker.js', true)##
$xwiki.ssfx.use('uicomponents/widgets/userpicker/userPicker.css', true)##
$xwiki.jsfx.use('uicomponents/widgets/userpicker/userPicker.js', true)##
$xwiki.ssx.use('PhenoTips.DatabaseFilters')##
$xwiki.ssx.use('PhenoTips.Skin', {'colorTheme' : "$xwiki.getSpacePreference('colorTheme')"})##
$xwiki.jsx.use('PhenoTips.DBWebHomeSheet')##
$xwiki.ssx.use('PhenoTips.DBWebHomeSheet')##
$xwiki.ssx.use('PhenoTips.Widgets')##
$xwiki.jsx.use('PhenoTips.Widgets')##
$xwiki.jsx.use('XWiki.DateTimePicker')##
$xwiki.ssx.use('XWiki.DateTimePicker')##
#set ($config = $xwiki.getDocument('data.WebHome').getObject('PhenoTips.DBConfigurationClass'))
#set ($patientClassName = 'PhenoTips.PatientClass')
#if ($config)
#set ($configuredColumns = $config.getProperty('livetableColumns').value)
#if (!$configuredColumns &amp;&amp; !($configuredColumns.length &gt; 0))
  #set ($configuredColumns = 'doc.name')
#end
#set ($columns = [])
#set ($discard = $columns.addAll($configuredColumns))
#set ($columnsProperties = {
  '_actions' : {'actions': ['edit', 'delete']}
})
#foreach ($column in $columns)
  #set ($isFilterable = ($column.toLowerCase().indexOf('date') &lt; 0))
  #set ($discard = $columnsProperties.put($column, { 'type' : 'text', 'link' : 'view', 'size' : 7, 'filterable' : $isFilterable, 'sortable': true, 'html': true }))
#end
#foreach ($filterableColumn in ['date_of_birth', 'omim_id', 'phenotype'])
  #if (!$configuredColumns.contains($filterableColumn))
    #set ($discard = $columns.add($filterableColumn))
    #set ($discard = $columnsProperties.put($filterableColumn, { 'type' : 'hidden' }))
  #end
#end
##
#set ($topFilters = $doc.getRenderedContent("(% class='xform' %)((((% class=""toggle-filters"" %) filters(% %)
== Filters ==

{{velocity}}#__filters_display('xform'){{/velocity}})))", "xwiki/2.1"))
#set ($discard = $columns.add('_actions'))
##
#set ($options = {
  'className'         : $patientClassName,
  'translationPrefix' : 'patient.livetable.',
  'rowCount'          : 25,
  'maxPages'          : 10,
  'selectedColumn'    : $config.getProperty('livetableSortColumn').value,
  'defaultOrder'      : 'asc',
  'topFilters'        : $topFilters,
  'resultPage'        : 'PhenoTips.LiveTableResults'
})
#if (!$hasAdmin)
  #set ($groups = [])
  #if ($xcontext.userReference)
    #set ($discard = $groups.add($xcontext.userReference))
  #end
  #foreach ($group in $xwiki.wrapDocs($xwiki.rightsmanager.getAllGroupsNamesForMember($xcontext.userReference)))
    #if ($group.getObject('PhenoTips.PhenoTipsGroupClass'))
      #set ($discard = $groups.add($group.documentReference.toString()))
    #end
  #end
  #set ($groups = "('${stringtool.join($groups, ""','"")}')")
  #set ($filterFrom = ", BaseObject accessObj, StringProperty accessProp")
  #set ($filterWhere = "and accessObj.name = doc.fullName and accessProp.id.id = accessObj.id and ((accessObj.className = 'PhenoTips.OwnerClass' and accessProp.value in ${groups}) or (accessObj.className = 'PhenoTips.CollaboratorClass' and accessProp.value in ${groups}) or (accessObj.className = 'PhenoTips.VisibilityClass' and accessProp.value = 'public'))")
  #set ($discard = $options.put('extraParams', "&amp;filterFrom=${escapetool.url($filterFrom)}&amp;filterWhere=${escapetool.url($filterWhere)}"))
#end
#if ("$!config.getProperty('livetableRows').value" != '' &amp;&amp; $config.getProperty('livetableRows').value &gt; 0)
  #set ($options.rowCount = $config.getProperty('livetableRows').value)
#end
#livetable('patients' $columns $columnsProperties $options)
$xwiki.ssfx.use('js/xwiki/table/livetable.css', {'colorTheme' : "$xwiki.getSpacePreference('colorTheme')", 'forceSkinAction' : true})##
#else
{{warning}}**Configuration missing.**{{/warning}}
#end
{{/velocity}}</content>
</xwikidoc>
{'fraction_non_alphanumeric': 0.18311746315319338, 'fraction_numerical': 0.012773559624832514, 'mean_word_length': 5.98876404494382, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 2, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1782948', 'n_tokens_mistral': 3903, 'n_tokens_neox': 3764, 'n_words': 757}