<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:head>
            <title><ui:insert name="title">BioBankCloud LIMS</ui:insert></title>
            <link rel="stylesheet" type="text/css" href="#{resource['/css/layout.css']}" />
            <link rel="stylesheet" type="text/css" href="#{resource['/css/lims.css']}" />
            <link rel="stylesheet" type="text/css" href="#{resource['/css/studyPage.css']}" />
            <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/>
        </h:head>
        <h:body>
            <ui:insert name="titleBar" >
                <ui:include src="/bbc/lims/titleBar.xhtml" />
            </ui:insert>
            <p:layout id="bbcMainLayout" styleClass="BbcMainLayoutStudy" rendered="#{studyManagedBean.studyName != null}">  
                <p:layoutUnit position="center">
                    <div class="container">
                        <h1>#{studyManagedBean.studyName} </h1>
                        <h:form>
                            <p:commandButton id="toolsBtn" value="Study..." type="button" rendered="#{studyManagedBean.currentOwner}" style="float:right;margin-top: 26px;"/>  
                            <p:menu overlay="true" trigger="toolsBtn" my="left top" at="left bottom" >  
                                <p:menuitem value="Edit services" onclick="PF('editServicesDlg').show()"/> 
                                <p:separator/>
                                <p:menuitem value="Remove" onclick="PF('removeStudyDlg').show();"/> 
                            </p:menu> 
                        </h:form>
                        <div class="content"> 
                            <p:tabView id="tabStudyPage" dynamic="true" cache="false" styleClass="ui-tabs" widgetVar="studyTabs">
                                <p:tab id="showTab" title="Show">
                                    <ui:insert name="showTab">
                                        <ui:include src="/bbc/lims/studyTabs/studyShowTab.xhtml"/>
                                    </ui:insert>
                                </p:tab>
                                <p:tab id="teamTab" title="Team" rendered="#{studyManagedBean.renderComponentList() != null}">
                                    <ui:insert name="teamTab">
                                        <ui:include src="/bbc/lims/studyTabs/teamTab.xhtml"/>
                                    </ui:insert>                                    
                                </p:tab>
                                <p:tab id="browser" title="Browser" rendered="#{studyManagedBean.renderComponentList() != null}">
                                    <ui:insert name="browserTab">
                                        <ui:include src="/bbc/lims/studyTabs/browser.xhtml"/>
                                    </ui:insert>
                                </p:tab>
                                <!-- TODO: figure out how to do this with a loop?-->
                                <p:tab id="flink" title="Flink" rendered="#{studyManagedBean.shouldDrawTab('FLINK')}">
                                    <ui:insert name="flinkTab">
                                        <ui:include src="/bbc/lims/studyTabs/flinkTab.xhtml"/>
                                    </ui:insert>
                                </p:tab>
                                <p:tab id="cuneiform" title="Cuneiform" rendered="#{studyManagedBean.shouldDrawTab('CUNEIFORM')}">
                                    <ui:insert name="workflowsTab">
                                        <ui:include src="/bbc/lims/studyTabs/cuneiformTab.xhtml"/>
                                    </ui:insert>
                                </p:tab>
                                <p:tab id="yarn" title="Yarn" rendered="#{studyManagedBean.shouldDrawTab('YARN')}">
                                    <ui:insert name="yarn">
                                        <ui:include src="/bbc/lims/studyTabs/yarnTab.xhtml"/>
                                    </ui:insert>
                                </p:tab>
                                <p:tab id="studyinfo" title="Study info" rendered="#{studyManagedBean.shouldDrawTab('STUDY_INFO')}">
                                    <ui:insert name="studyinfo">
                                        <ui:include src="/bbc/lims/studyTabs/studyInfoTab.xhtml"/>
                                    </ui:insert>
                                </p:tab>
                                <p:tab id="samples" title="Samples" rendered="#{studyManagedBean.shouldDrawTab('SAMPLES')}">
                                    <ui:insert name="samples">
                                        <ui:include src="/bbc/lims/studyTabs/samplesTab.xhtml"/>
                                    </ui:insert>
                                </p:tab>

                            </p:tabView>
                        </div>
                    </div>
                </p:layoutUnit>
            </p:layout>


            <!-- In case Study has not been set: user navigated to the page manually. -->
            <p:layout id="bbcMainLayoutAlt" styleClass="BbcMainLayoutStudy" rendered="#{studyManagedBean.studyName == null}">  
                <p:layoutUnit position="center">
                    <div class="container">
                        <h1 class="Oops">Oops!</h1>
                        <br></br>
                        <strong> Something went wrong. </strong>
                    </div>
                </p:layoutUnit>
            </p:layout>


            <h:form>
                <p:dialog widgetVar="removeStudyDlg"  closable="true" draggable="false" resizable="false" header="Remove study?" modal="true" style="width: auto;">
                    <p:outputLabel value="Do you want to remove this study and its data?" style="width: auto;"/>
                    <p:selectOneRadio id="console" value="#{studyManagedBean.deleteFilesOnRemove}"  layout="grid" columns="1" style="width: auto;" >
                        <f:selectItem itemLabel="Remove study and its data." itemValue="true"/>
                        <f:selectItem itemLabel="Remove study, but keep data." itemValue="false" />
                    </p:selectOneRadio>
                    <f:facet name="footer">
                        <p:commandButton value="Remove" action="#{studyManagedBean.removeByName()}" onstart="PF('removeStudyDlg').hide()" type="submit"/>
                        <p:commandButton value="Cancel" oncomplete="PF('removeStudyDlg').hide()"/>
                    </f:facet>     
                </p:dialog>
            </h:form>
            <p:dialog id="uploadDialog" header="Upload file" widgetVar="uploadDlg" draggable="false" resizable="false" modal="true">
                <h:form id="uploadForm">
                    <p:fileUpload required="true" multiple="false" label="Select" mode="advanced" allowTypes="/(\.|\/)(cf)$/" fileUploadListener="#{cuneiformController.handleFileUpload}" oncomplete="PF('uploadDlg').hide()"/>
                    <div class="publicCheckbox">
                        <p:selectBooleanCheckbox id="publicCheckbox" value="#{ecuneiformControllerpublicFile}">
                            <p:ajax listener="#{excuneiformControllerheckboxChanged}"/>
                        </p:selectBooleanCheckbox>
                        <h:outputLabel value="Make file public"/>
                    </div>
                </h:form>
            </p:dialog>
            <!-- TODO: fix location of dialogs with appendTo attribute -->
            <p:dialog id="createFolderDialog" widgetVar="createFolderDlg" closable="true" draggable="false" modal="true" resizable="false" header="Create folder">
                <h:form>
                    <p:outputLabel for="folderName" value="New folder name"/>
                    <p:inputText id="folderName" value="#{fileOperationsMB.newFolderName}"/>
                    <p:commandButton value="Create" action="#{fileOperationsMB.mkDir(InodesMB.cwdPath)}" oncomplete="PF('createFolderDlg').hide()" update=":#{p:component('browserForm')}"/>
                    <p:commandButton value="Cancel" type="button" onclick="PF('createFolderDlg').hide()"/>
                </h:form>
            </p:dialog>
            <p:dialog id="addSampleDialog" widgetVar="addSampleDlg" closable="true" draggable="false" modal="true" resizable="false" header="Add sample" rendered="#{studyManagedBean.shouldDrawTab('SAMPLES')}">
                <h:form>
                    <p:outputLabel for="sampleName" value="Sample ID"/>
                    <!--  TODO: add check on existing samples -->
                    <p:inputText id="sampleName" required="true" value="#{samplesController.newSample.id}" placeholder="id"> 
                        <f:validator binding="#{uniqueSampleValidator}"/> 
                    </p:inputText>
                    <p:message for="sampleName"/>
                    <p:pickList id="materialTypesPick" value="#{samplesController.newSampleMaterialTypeDualList}" 
                                var="val" itemLabel="#{val.toString()}" itemValue="#{val}" converter="materialTypeEnumConverter">
                        <f:facet name="sourceCaption">Available</f:facet>
                        <f:facet name="targetCaption">Selected</f:facet><commit_msg>Allow choosing material type upon sample creation (fix: added label)<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:head>
            <title><ui:insert name="title">BioBankCloud LIMS</ui:insert></title>
            <link rel="stylesheet" type="text/css" href="#{resource['/css/layout.css']}" />
            <link rel="stylesheet" type="text/css" href="#{resource['/css/lims.css']}" />
            <link rel="stylesheet" type="text/css" href="#{resource['/css/studyPage.css']}" />
            <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/>
        </h:head>
        <h:body>
            <ui:insert name="titleBar" >
                <ui:include src="/bbc/lims/titleBar.xhtml" />
            </ui:insert>
            <p:layout id="bbcMainLayout" styleClass="BbcMainLayoutStudy" rendered="#{studyManagedBean.studyName != null}">  
                <p:layoutUnit position="center">
                    <div class="container">
                        <h1>#{studyManagedBean.studyName} </h1>
                        <h:form>
                            <p:commandButton id="toolsBtn" value="Study..." type="button" rendered="#{studyManagedBean.currentOwner}" style="float:right;margin-top: 26px;"/>  
                            <p:menu overlay="true" trigger="toolsBtn" my="left top" at="left bottom" >  
                                <p:menuitem value="Edit services" onclick="PF('editServicesDlg').show()"/> 
                                <p:separator/>
                                <p:menuitem value="Remove" onclick="PF('removeStudyDlg').show();"/> 
                            </p:menu> 
                        </h:form>
                        <div class="content"> 
                            <p:tabView id="tabStudyPage" dynamic="true" cache="false" styleClass="ui-tabs" widgetVar="studyTabs">
                                <p:tab id="showTab" title="Show">
                                    <ui:insert name="showTab">
                                        <ui:include src="/bbc/lims/studyTabs/studyShowTab.xhtml"/>
                                    </ui:insert>
                                </p:tab>
                                <p:tab id="teamTab" title="Team" rendered="#{studyManagedBean.renderComponentList() != null}">
                                    <ui:insert name="teamTab">
                                        <ui:include src="/bbc/lims/studyTabs/teamTab.xhtml"/>
                                    </ui:insert>                                    
                                </p:tab>
                                <p:tab id="browser" title="Browser" rendered="#{studyManagedBean.renderComponentList() != null}">
                                    <ui:insert name="browserTab">
                                        <ui:include src="/bbc/lims/studyTabs/browser.xhtml"/>
                                    </ui:insert>
                                </p:tab>
                                <!-- TODO: figure out how to do this with a loop?-->
                                <p:tab id="flink" title="Flink" rendered="#{studyManagedBean.shouldDrawTab('FLINK')}">
                                    <ui:insert name="flinkTab">
                                        <ui:include src="/bbc/lims/studyTabs/flinkTab.xhtml"/>
                                    </ui:insert>
                                </p:tab>
                                <p:tab id="cuneiform" title="Cuneiform" rendered="#{studyManagedBean.shouldDrawTab('CUNEIFORM')}">
                                    <ui:insert name="workflowsTab">
                                        <ui:include src="/bbc/lims/studyTabs/cuneiformTab.xhtml"/>
                                    </ui:insert>
                                </p:tab>
                                <p:tab id="yarn" title="Yarn" rendered="#{studyManagedBean.shouldDrawTab('YARN')}">
                                    <ui:insert name="yarn">
                                        <ui:include src="/bbc/lims/studyTabs/yarnTab.xhtml"/>
                                    </ui:insert>
                                </p:tab>
                                <p:tab id="studyinfo" title="Study info" rendered="#{studyManagedBean.shouldDrawTab('STUDY_INFO')}">
                                    <ui:insert name="studyinfo">
                                        <ui:include src="/bbc/lims/studyTabs/studyInfoTab.xhtml"/>
                                    </ui:insert>
                                </p:tab>
                                <p:tab id="samples" title="Samples" rendered="#{studyManagedBean.shouldDrawTab('SAMPLES')}">
                                    <ui:insert name="samples">
                                        <ui:include src="/bbc/lims/studyTabs/samplesTab.xhtml"/>
                                    </ui:insert>
                                </p:tab>

                            </p:tabView>
                        </div>
                    </div>
                </p:layoutUnit>
            </p:layout>


            <!-- In case Study has not been set: user navigated to the page manually. -->
            <p:layout id="bbcMainLayoutAlt" styleClass="BbcMainLayoutStudy" rendered="#{studyManagedBean.studyName == null}">  
                <p:layoutUnit position="center">
                    <div class="container">
                        <h1 class="Oops">Oops!</h1>
                        <br></br>
                        <strong> Something went wrong. </strong>
                    </div>
                </p:layoutUnit>
            </p:layout>


            <h:form>
                <p:dialog widgetVar="removeStudyDlg"  closable="true" draggable="false" resizable="false" header="Remove study?" modal="true" style="width: auto;">
                    <p:outputLabel value="Do you want to remove this study and its data?" style="width: auto;"/>
                    <p:selectOneRadio id="console" value="#{studyManagedBean.deleteFilesOnRemove}"  layout="grid" columns="1" style="width: auto;" >
                        <f:selectItem itemLabel="Remove study and its data." itemValue="true"/>
                        <f:selectItem itemLabel="Remove study, but keep data." itemValue="false" />
                    </p:selectOneRadio>
                    <f:facet name="footer">
                        <p:commandButton value="Remove" action="#{studyManagedBean.removeByName()}" onstart="PF('removeStudyDlg').hide()" type="submit"/>
                        <p:commandButton value="Cancel" oncomplete="PF('removeStudyDlg').hide()"/>
                    </f:facet>     
                </p:dialog>
            </h:form>
            <p:dialog id="uploadDialog" header="Upload file" widgetVar="uploadDlg" draggable="false" resizable="false" modal="true">
                <h:form id="uploadForm">
                    <p:fileUpload required="true" multiple="false" label="Select" mode="advanced" allowTypes="/(\.|\/)(cf)$/" fileUploadListener="#{cuneiformController.handleFileUpload}" oncomplete="PF('uploadDlg').hide()"/>
                    <div class="publicCheckbox">
                        <p:selectBooleanCheckbox id="publicCheckbox" value="#{ecuneiformControllerpublicFile}">
                            <p:ajax listener="#{excuneiformControllerheckboxChanged}"/>
                        </p:selectBooleanCheckbox>
                        <h:outputLabel value="Make file public"/>
                    </div>
                </h:form>
            </p:dialog>
            <!-- TODO: fix location of dialogs with appendTo attribute -->
            <p:dialog id="createFolderDialog" widgetVar="createFolderDlg" closable="true" draggable="false" modal="true" resizable="false" header="Create folder">
                <h:form>
                    <p:outputLabel for="folderName" value="New folder name"/>
                    <p:inputText id="folderName" value="#{fileOperationsMB.newFolderName}"/>
                    <p:commandButton value="Create" action="#{fileOperationsMB.mkDir(InodesMB.cwdPath)}" oncomplete="PF('createFolderDlg').hide()" update=":#{p:component('browserForm')}"/>
                    <p:commandButton value="Cancel" type="button" onclick="PF('createFolderDlg').hide()"/>
                </h:form>
            </p:dialog>
            <p:dialog id="addSampleDialog" widgetVar="addSampleDlg" closable="true" draggable="false" modal="true" resizable="false" header="Add sample" rendered="#{studyManagedBean.shouldDrawTab('SAMPLES')}">
                <h:form>
                    <p:outputLabel for="sampleName" value="Sample ID"/>
                    <!--  TODO: add check on existing samples -->
                    <p:inputText id="sampleName" required="true" value="#{samplesController.newSample.id}" placeholder="id"> 
                        <f:validator binding="#{uniqueSampleValidator}"/> 
                    </p:inputText>
                    <p:message for="sampleName"/>
                    <br/>
                    <h:outputText value="Select material types:"/>
                    <p:pickList id="materialTypesPick" value="#{samplesController.newSampleMaterialTypeDualList}" 
                                var="val" itemLabel="#{val.toString()}" itemValue="#{val}" converter="materialTypeEnumConverter">
                        <f:facet name="sourceCaption">Available</f:facet>
                        <f:facet name="targetCaption">Selected</f:facet>
{'fraction_non_alphanumeric': 0.14460659250943975, 'fraction_numerical': 0.0024492295132156343, 'mean_word_length': 1.5403758911211924, 'pattern_counts': {'":': 2, '<': 281, '<?xml version=': 2, '>': 281, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 50, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '513924', 'n_tokens_mistral': 5255, 'n_tokens_neox': 4927, 'n_words': 793}