<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 version="1.2" reference="ExtensionCode.ExtensionSheet" locale="">
  <web>ExtensionCode</web>
  <name>ExtensionSheet</name>
  <language/>
  <defaultLanguage/>
  <translation>0</translation>
  <creator>xwiki:XWiki.Admin</creator>
  <creationDate>1312816151000</creationDate>
  <parent>ExtensionCode.ExtensionClass</parent>
  <author>xwiki:XWiki.Admin</author>
  <contentAuthor>xwiki:XWiki.Admin</contentAuthor>
  <date>1444202919000</date>
  <contentUpdateDate>1444202521000</contentUpdateDate>
  <version>1.1</version>
  <title>#if($doc.getObject('ExtensionCode.ExtensionClass'))$doc.getObject('ExtensionCode.ExtensionClass').getProperty('name').value#{else}Extension sheet#end</title>
  <comment/>
  <minorEdit>false</minorEdit>
  <syntaxId>xwiki/2.1</syntaxId>
  <hidden>true</hidden>
  <content>{{include reference="ExtensionCode.RepositoryCode"/}}

{{include reference="XWiki.RatingsMacros"/}}

{{velocity output="false"}}
#if ($xcontext.action == 'edit' || $xcontext.action == 'inline')
  #set($isEditMode = true)
#else
  #set($isViewMode = true)
#end

#set($extension = $doc.getObject("ExtensionCode.ExtensionClass"))

#if ($extension)
  #set($id = $extension.getProperty('id').value)
  #set($type = $extension.getProperty('type').value)
  #set($category = $extension.getProperty('category').value)

  #set ($extensionTypeDocumentNames = $services.query.xwql('from doc.object(ExtensionCode.ExtensionTypeClass) as type where type.id = :id').bindValue("id", $type).execute())
  #if ($extensionTypeDocumentNames.size() &gt; 0)
    #set ($extensionTypeDocumentName = $extensionTypeDocumentNames.get(0))
    #set($extensionTypeObject = $xwiki.getDocument($extensionTypeDocumentName).getObject("ExtensionCode.ExtensionTypeClass"))
  #end

  #if ($category)
    #set ($extensionCategoryDocumentNames = $services.query.xwql('from doc.object(ExtensionCode.ExtensionCategoryClass) as category where category.id = :id').bindValue("id", $category).execute())
    #if ($extensionCategoryDocumentNames.size() &gt; 0)
      #set ($extensionCategoryDocumentName = $extensionCategoryDocumentNames.get(0))
      #set($extensionCategoryObject = $xwiki.getDocument($extensionCategoryDocumentName).getObject("ExtensionCode.ExtensionCategoryClass"))
    #end
  #end

  #set ($extensionSheetExtensionDocumentNames = $services.query.xwql('from doc.object(ExtensionCode.ExtensionSheetExtensionClass) as sheetExtension').execute())
  #set($sheetExtensions = [])
  #foreach($extensionSheetExtensionDocumentName in $extensionSheetExtensionDocumentNames)
    #set($sheetExtension = $xwiki.getDocument($extensionSheetExtensionDocumentName).getObject('ExtensionCode.ExtensionSheetExtensionClass'))
    #if ($sheetExtension.getProperty('type').value == '' || $sheetExtension.getProperty('type').value == $type)
      #set($void = $sheetExtensions.add($sheetExtension))
    #end
  #end
#end

#set($proxyExtensionObject = $doc.getObject('ExtensionCode.ExtensionProxyClass'))
{{/velocity}}

{{velocity}}
#if ($extension)
  $doc.use("ExtensionCode.ExtensionClass")
  #if ($isViewMode)
    ##------- Icon &amp; Summary -----------------
    (% class="extensionSummary" %)
    #set($icon = $doc.getValue("icon"))
    #if ("$!{icon.trim()}" != "")
      |[[image:${doc.getValue('icon')}]]|**{{{$doc.getValue("summary")}}}**
    #else
      |[[image:icon:cog]]|**{{{$doc.getValue("summary")}}}**
    #end

    ## Viewing
    ##
    {{box cssClass="floatinginfobox"}}
      #if ($hasEdit)
        #if ($proxyExtensionObject)
          #set($repositoryId = $proxyExtensionObject.getProperty('repositoryId').value)
          #set($repositoryURI = $proxyExtensionObject.getProperty('repositoryURI').value)
          {{info}}Extension imported from repository [[$repositoryId&gt;&gt;$repositoryURI]]{{/info}} #if ($hasEdit)[[image:icon:arrow_refresh&gt;&gt;ExtensionCode.ImportExtension||title="Update extension" queryString="importExtension=true&amp;extensionId=$escapetool.url($id)&amp;repositoryId=$escapetool.url($repositoryId)"]]#end
        #end
      #end

      (% class="extensionInfo" %)
      ##------- Type --------------
      #set($typeDisplay = $extensionTypeObject.getProperty('name').value)
      #if ("$!typeDisplay" == '')
        #set($typeDisplay = $type)
      #end
      |(% class="label" width='30%' %)Type(%%)|$typeDisplay
      ##------- Category --------------
      #set($categoryDisplay = $extensionCategoryObject.getProperty('name').value)
      #if ("$!categoryDisplay" == '')
        #set($categoryDisplay = $category)
      #end
      #if ($categoryDisplay)
      |(% class="label" width='30%' %)Category(%%)|$categoryDisplay
      #end
      ##------- Developed By --------
      #set($authors = $doc.getValue("authors"))
      |(% class="label" %)Developed by(%%)|#if ($authors.isEmpty())
          Unknown
        #else
          $doc.authors
        #end
      ##------- Active Installs --------
      #if ($doc.getValue('installedCount') &amp;&amp; $doc.getValue('showInstalledCount'))
        |(% class="label" %)Active Installs(%%)|$!doc.getValue('installedCount')
      #end
      ##------- Rating --------
      |(% class="label" %)Rating(%%)|#displayFullRating($doc.documentReference "")
      ##------- Website --------------
      #set($website = $extension.getProperty("website").value)
      #if ("$!website" != '')
        |(% class="label" %)Website(%%)|#if ($website.length() &gt; 40)
                                          [[{{{$website.substring(0, 40)...}}}&gt;&gt;url:$website]]
                                        #else
                                          $website
                                        #end
      #end
      ##------- License --------
      #set($licenseName = $doc.getValue("licenseName"))
      #if ("$!licenseName" != "")
        |(% class="label" %)License(%%)|$licenseName<commit_msg>XWIKI-13581 : Display the number of Active installs on each extension page on e.x.o.<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 version="1.2" reference="ExtensionCode.ExtensionSheet" locale="">
  <web>ExtensionCode</web>
  <name>ExtensionSheet</name>
  <language/>
  <defaultLanguage/>
  <translation>0</translation>
  <creator>xwiki:XWiki.Admin</creator>
  <creationDate>1312816151000</creationDate>
  <parent>ExtensionCode.ExtensionClass</parent>
  <author>xwiki:XWiki.Admin</author>
  <contentAuthor>xwiki:XWiki.Admin</contentAuthor>
  <date>1444202919000</date>
  <contentUpdateDate>1444202521000</contentUpdateDate>
  <version>1.1</version>
  <title>#if($doc.getObject('ExtensionCode.ExtensionClass'))$doc.getObject('ExtensionCode.ExtensionClass').getProperty('name').value#{else}Extension sheet#end</title>
  <comment/>
  <minorEdit>false</minorEdit>
  <syntaxId>xwiki/2.1</syntaxId>
  <hidden>true</hidden>
  <content>{{include reference="ExtensionCode.RepositoryCode"/}}

{{include reference="XWiki.RatingsMacros"/}}

{{velocity output="false"}}
#if ($xcontext.action == 'edit' || $xcontext.action == 'inline')
  #set($isEditMode = true)
#else
  #set($isViewMode = true)
#end

#set($extension = $doc.getObject("ExtensionCode.ExtensionClass"))

#if ($extension)
  #set($id = $extension.getProperty('id').value)
  #set($type = $extension.getProperty('type').value)
  #set($category = $extension.getProperty('category').value)

  #set ($extensionTypeDocumentNames = $services.query.xwql('from doc.object(ExtensionCode.ExtensionTypeClass) as type where type.id = :id').bindValue("id", $type).execute())
  #if ($extensionTypeDocumentNames.size() &gt; 0)
    #set ($extensionTypeDocumentName = $extensionTypeDocumentNames.get(0))
    #set($extensionTypeObject = $xwiki.getDocument($extensionTypeDocumentName).getObject("ExtensionCode.ExtensionTypeClass"))
  #end

  #if ($category)
    #set ($extensionCategoryDocumentNames = $services.query.xwql('from doc.object(ExtensionCode.ExtensionCategoryClass) as category where category.id = :id').bindValue("id", $category).execute())
    #if ($extensionCategoryDocumentNames.size() &gt; 0)
      #set ($extensionCategoryDocumentName = $extensionCategoryDocumentNames.get(0))
      #set($extensionCategoryObject = $xwiki.getDocument($extensionCategoryDocumentName).getObject("ExtensionCode.ExtensionCategoryClass"))
    #end
  #end

  #set ($extensionSheetExtensionDocumentNames = $services.query.xwql('from doc.object(ExtensionCode.ExtensionSheetExtensionClass) as sheetExtension').execute())
  #set($sheetExtensions = [])
  #foreach($extensionSheetExtensionDocumentName in $extensionSheetExtensionDocumentNames)
    #set($sheetExtension = $xwiki.getDocument($extensionSheetExtensionDocumentName).getObject('ExtensionCode.ExtensionSheetExtensionClass'))
    #if ($sheetExtension.getProperty('type').value == '' || $sheetExtension.getProperty('type').value == $type)
      #set($void = $sheetExtensions.add($sheetExtension))
    #end
  #end
#end

#set($proxyExtensionObject = $doc.getObject('ExtensionCode.ExtensionProxyClass'))
{{/velocity}}

{{velocity}}
#if ($extension)
  $doc.use("ExtensionCode.ExtensionClass")
  #if ($isViewMode)
    ##------- Icon &amp; Summary -----------------
    (% class="extensionSummary" %)
    #set($icon = $doc.getValue("icon"))
    #if ("$!{icon.trim()}" != "")
      |[[image:${doc.getValue('icon')}]]|**{{{$doc.getValue("summary")}}}**
    #else
      |[[image:icon:cog]]|**{{{$doc.getValue("summary")}}}**
    #end

    ## Viewing
    ##
    {{box cssClass="floatinginfobox"}}
      #if ($hasEdit)
        #if ($proxyExtensionObject)
          #set($repositoryId = $proxyExtensionObject.getProperty('repositoryId').value)
          #set($repositoryURI = $proxyExtensionObject.getProperty('repositoryURI').value)
          {{info}}Extension imported from repository [[$repositoryId&gt;&gt;$repositoryURI]]{{/info}} #if ($hasEdit)[[image:icon:arrow_refresh&gt;&gt;ExtensionCode.ImportExtension||title="Update extension" queryString="importExtension=true&amp;extensionId=$escapetool.url($id)&amp;repositoryId=$escapetool.url($repositoryId)"]]#end
        #end
      #end

      (% class="extensionInfo" %)
      ##------- Type --------------
      #set($typeDisplay = $extensionTypeObject.getProperty('name').value)
      #if ("$!typeDisplay" == '')
        #set($typeDisplay = $type)
      #end
      |(% class="label" width='30%' %)Type(%%)|$typeDisplay
      ##------- Category --------------
      #set($categoryDisplay = $extensionCategoryObject.getProperty('name').value)
      #if ("$!categoryDisplay" == '')
        #set($categoryDisplay = $category)
      #end
      #if ($categoryDisplay)
      |(% class="label" width='30%' %)Category(%%)|$categoryDisplay
      #end
      ##------- Developed By --------
      #set($authors = $doc.getValue("authors"))
      |(% class="label" %)Developed by(%%)|#if ($authors.isEmpty())
          Unknown
        #else
          $doc.authors
        #end
      ##------- Active Installs --------
      #if ($doc.getValue('installedCount') &amp;&amp; $doc.getValue('showInstalledCount') != 0)
        |(% class="label" %)Active Installs(%%)|$!doc.getValue('installedCount')
      #end
      ##------- Rating --------
      |(% class="label" %)Rating(%%)|#displayFullRating($doc.documentReference "")
      ##------- Website --------------
      #set($website = $extension.getProperty("website").value)
      #if ("$!website" != '')
        |(% class="label" %)Website(%%)|#if ($website.length() &gt; 40)
                                          [[{{{$website.substring(0, 40)...}}}&gt;&gt;url:$website]]
                                        #else
                                          $website
                                        #end
      #end
      ##------- License --------
      #set($licenseName = $doc.getValue("licenseName"))
      #if ("$!licenseName" != "")
        |(% class="label" %)License(%%)|$licenseName
{'fraction_non_alphanumeric': 0.18175833820947923, 'fraction_numerical': 0.011410181392627268, 'mean_word_length': 3.7975438596491227, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 2, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1701376', 'n_tokens_mistral': 4008, 'n_tokens_neox': 3825, 'n_words': 750}