From ea46f42ee640928b92947bfb204c41a482d80937 Mon Sep 17 00:00:00 2001
From: root
Date: Tue, 8 May 2012 18:39:56 -0500
Subject: Add all the source codes into the github.
---
web/webqtl/dataSharing/SharingBody.py | 290 +++++++++++++++++++++++
web/webqtl/dataSharing/SharingInfo.py | 98 ++++++++
web/webqtl/dataSharing/SharingInfoAddPage.py | 47 ++++
web/webqtl/dataSharing/SharingInfoDeletePage.py | 55 +++++
web/webqtl/dataSharing/SharingInfoEditPage.py | 51 ++++
web/webqtl/dataSharing/SharingInfoPage.py | 52 ++++
web/webqtl/dataSharing/SharingInfoUpdatePage.py | 109 +++++++++
web/webqtl/dataSharing/SharingListDataSetPage.py | 99 ++++++++
web/webqtl/dataSharing/SharingPage.py | 40 ++++
web/webqtl/dataSharing/__init__.py | 0
10 files changed, 841 insertions(+)
create mode 100755 web/webqtl/dataSharing/SharingBody.py
create mode 100755 web/webqtl/dataSharing/SharingInfo.py
create mode 100755 web/webqtl/dataSharing/SharingInfoAddPage.py
create mode 100755 web/webqtl/dataSharing/SharingInfoDeletePage.py
create mode 100755 web/webqtl/dataSharing/SharingInfoEditPage.py
create mode 100755 web/webqtl/dataSharing/SharingInfoPage.py
create mode 100755 web/webqtl/dataSharing/SharingInfoUpdatePage.py
create mode 100755 web/webqtl/dataSharing/SharingListDataSetPage.py
create mode 100755 web/webqtl/dataSharing/SharingPage.py
create mode 100755 web/webqtl/dataSharing/__init__.py
(limited to 'web/webqtl/dataSharing')
diff --git a/web/webqtl/dataSharing/SharingBody.py b/web/webqtl/dataSharing/SharingBody.py
new file mode 100755
index 00000000..4445e0d1
--- /dev/null
+++ b/web/webqtl/dataSharing/SharingBody.py
@@ -0,0 +1,290 @@
+# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# This program is available from Source Forge: at GeneNetwork Project
+# (sourceforge.net/projects/genenetwork/).
+#
+# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
+# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
+#
+#
+#
+# This module is used by GeneNetwork project (www.genenetwork.org)
+#
+# Created by GeneNetwork Core Team 2010/08/10
+#
+# Last updated by GeneNetwork Core Team 2010/10/20
+
+sharing_body_string = """
+
+
+ Data Set Download
+
+
+ GeneNetwork Accession Number
+
+
+ |
+"""
+
+sharinginfo_body_string = """
+List of DataSets
+%s
+
+%s
+
+
+
+
+
+ GN Accession: GN%s |
+ GEO Series: %s |
+ Title: %s |
+ Organism: %s |
+ Group: %s |
+ Tissue: %s |
+ Dataset Status: %s |
+ Platforms: %s |
+ Normalization: %s |
+
+ See Contact Information
+
+ %s
+ %s
+ %s
+ %s
+ %s, %s %s %s
+ Tel. %s
+ %s
+ %s
+ |
+
+ |
+
+
+
+ Download datasets and supplementary data files |
+
+
+ %s |
+
+
+ |
+
+
+
+
+
+Summary: |
+ %s
|
+About the cases used to generate this set of data: |
+ %s
|
+About the tissue used to generate this set of data: |
+ %s
|
+About downloading this data set: |
+ %s
|
+About the array platform: |
+ %s
|
+About data values and data processing: |
+ %s
|
+Data source acknowledgment: |
+ %s
|
+Experiment Type: |
+ %s
|
+Overall Design: |
+ %s
|
+Contributor: |
+ %s
|
+Citation: |
+ %s
|
+Submission Date: |
+ %s
|
+Laboratory: |
+ %s
|
+Samples: |
+ %s
|
+
+
+ |
+"""
+
+sharinginfoedit_body_string = """
+%s
+
+
+ | """
diff --git a/web/webqtl/dataSharing/SharingInfo.py b/web/webqtl/dataSharing/SharingInfo.py
new file mode 100755
index 00000000..10abcefa
--- /dev/null
+++ b/web/webqtl/dataSharing/SharingInfo.py
@@ -0,0 +1,98 @@
+# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# This program is available from Source Forge: at GeneNetwork Project
+# (sourceforge.net/projects/genenetwork/).
+#
+# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
+# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
+#
+#
+#
+# This module is used by GeneNetwork project (www.genenetwork.org)
+#
+# Created by GeneNetwork Core Team 2010/08/10
+#
+# Last updated by GeneNetwork Core Team 2010/10/20
+
+import httplib
+
+from dbFunction import webqtlDatabaseFunction
+import SharingBody
+
+
+#########################################
+# Sharing Info
+#########################################
+class SharingInfo:
+
+ def __init__(self, GN_AccessionId, InfoPageName):
+ self.GN_AccessionId = GN_AccessionId
+ self.InfoPageName = InfoPageName
+
+ def getInfo(self):
+ cursor = webqtlDatabaseFunction.getCursor()
+ if (not cursor):
+ return
+ sql = "select Id, GEO_Series, Status, Title, Organism, Experiment_Type, Summary, Overall_Design, Contributor, Citation, Submission_Date, Contact_Name, Emails, Phone, URL, Organization_Name, Department, Laboratory, Street, City, State, ZIP, Country, Platforms, Samples, Species, Normalization, InbredSet, InfoPageName, DB_Name, Organism_Id, InfoPageTitle, GN_AccesionId, Tissue, AuthorizedUsers, About_Cases, About_Tissue, About_Download, About_Array_Platform, About_Data_Values_Processing, Data_Source_Acknowledge, Progreso from InfoFiles where "
+ if(self.GN_AccessionId):
+ sql += "GN_AccesionId = %s"
+ cursor.execute(sql, self.GN_AccessionId)
+ elif (self.InfoPageName):
+ sql += "InfoPageName = %s"
+ cursor.execute(sql, self.InfoPageName)
+ else:
+ raise 'No correct parameter found'
+ info = cursor.fetchone()
+ # fetch datasets file list
+ try:
+ conn = httplib.HTTPConnection("atlas.uthsc.edu")
+ conn.request("GET", "/scandatasets.php?GN_AccesionId=%s" % (info[32]))
+ response = conn.getresponse()
+ data = response.read()
+ filelist = data.split()
+ conn.close()
+ except Exception:
+ filelist = []
+ return info, filelist
+
+ def getBody(self, infoupdate=""):
+ info, filelist = self.getInfo()
+ if filelist:
+ htmlfilelist = '\n'
+ for i in range(len(filelist)):
+ if i%2==0:
+ filename = filelist[i]
+ filesize = filelist[i+1]
+ htmlfilelist += "- "
+ htmlfilelist += '%s' % (self.GN_AccessionId, filename, filename)
+ htmlfilelist += ' '
+ #r=re.compile(r'(?<=\d)(?=(\d\d\d)+(?!\d))')
+ #htmlfilelist += '[%s B]' % r.sub(r',',filesize)
+ if 12\n"
+ htmlfilelist += "
"
+ else:
+ htmlfilelist = "Data sets are not available or are not public yet."
+ return SharingBody.sharinginfo_body_string % (info[31], info[32], infoupdate, info[32], info[1], info[3], info[30], info[4], info[27], info[33], info[2], info[23], info[26], info[11], info[15], info[16], info[18], info[19], info[20], info[21], info[22], info[13], info[12], info[14], info[14], htmlfilelist, info[6], info[35], info[36], info[37], info[38], info[39], info[40], info[5], info[7], info[8], info[9], info[10], info[17], info[24])
diff --git a/web/webqtl/dataSharing/SharingInfoAddPage.py b/web/webqtl/dataSharing/SharingInfoAddPage.py
new file mode 100755
index 00000000..8174bf68
--- /dev/null
+++ b/web/webqtl/dataSharing/SharingInfoAddPage.py
@@ -0,0 +1,47 @@
+# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# This program is available from Source Forge: at GeneNetwork Project
+# (sourceforge.net/projects/genenetwork/).
+#
+# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
+# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
+#
+#
+#
+# This module is used by GeneNetwork project (www.genenetwork.org)
+#
+# Created by GeneNetwork Core Team 2010/08/10
+#
+# Last updated by GeneNetwork Core Team 2010/10/20
+
+from base.templatePage import templatePage
+from base import webqtlConfig
+import SharingBody
+import SharingInfo
+
+
+#########################################
+# Sharing Info Edit Page
+#########################################
+class SharingInfoAddPage(templatePage):
+
+ def __init__(self, fd=None):
+ templatePage.__init__(self, fd)
+ if webqtlConfig.USERDICT[self.privilege] >= webqtlConfig.USERDICT['admin']:
+ pass
+ else:
+ heading = "Adding Info"
+ detail = ["You don't have the permission to add new dataset"]
+ self.error(heading=heading,detail=detail,error="Error")
+ return
+ self.dict['body'] = SharingBody.sharinginfoedit_body_string % ("Add new dataset", "-1", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "")
diff --git a/web/webqtl/dataSharing/SharingInfoDeletePage.py b/web/webqtl/dataSharing/SharingInfoDeletePage.py
new file mode 100755
index 00000000..edc0be7d
--- /dev/null
+++ b/web/webqtl/dataSharing/SharingInfoDeletePage.py
@@ -0,0 +1,55 @@
+# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# This program is available from Source Forge: at GeneNetwork Project
+# (sourceforge.net/projects/genenetwork/).
+#
+# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
+# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
+#
+#
+#
+# This module is used by GeneNetwork project (www.genenetwork.org)
+#
+# Created by GeneNetwork Core Team 2010/08/10
+#
+# Last updated by GeneNetwork Core Team 2010/10/20
+
+from base.templatePage import templatePage
+from base import webqtlConfig
+from dbFunction import webqtlDatabaseFunction
+import SharingBody
+import SharingInfo
+
+
+#########################################
+# Sharing Info Delete Page
+#########################################
+class SharingInfoDeletePage(templatePage):
+
+ def __init__(self, fd=None):
+ templatePage.__init__(self, fd)
+ if webqtlConfig.USERDICT[self.privilege] >= webqtlConfig.USERDICT['admin']:
+ pass
+ else:
+ heading = "Deleting Info"
+ detail = ["You don't have the permission to delete this dataset"]
+ self.error(heading=heading,detail=detail,error="Error")
+ return
+ cursor = webqtlDatabaseFunction.getCursor()
+ if (not cursor):
+ return
+ GN_AccessionId = fd.formdata.getvalue('GN_AccessionId')
+ sql = "delete from InfoFiles where GN_AccesionId=%s"
+ cursor.execute(sql, GN_AccessionId)
+ re = cursor.fetchone()
+ self.dict['body'] = "Delete dataset info record (GN_AccesionId=%s) successfully." % GN_AccessionId
\ No newline at end of file
diff --git a/web/webqtl/dataSharing/SharingInfoEditPage.py b/web/webqtl/dataSharing/SharingInfoEditPage.py
new file mode 100755
index 00000000..266b8602
--- /dev/null
+++ b/web/webqtl/dataSharing/SharingInfoEditPage.py
@@ -0,0 +1,51 @@
+# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# This program is available from Source Forge: at GeneNetwork Project
+# (sourceforge.net/projects/genenetwork/).
+#
+# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
+# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
+#
+#
+#
+# This module is used by GeneNetwork project (www.genenetwork.org)
+#
+# Created by GeneNetwork Core Team 2010/08/10
+#
+# Last updated by GeneNetwork Core Team 2010/10/20
+
+from base.templatePage import templatePage
+from base import webqtlConfig
+import SharingBody
+import SharingInfo
+
+
+#########################################
+# Sharing Info Edit Page
+#########################################
+class SharingInfoEditPage(templatePage):
+
+ def __init__(self, fd=None):
+ templatePage.__init__(self, fd)
+ if webqtlConfig.USERDICT[self.privilege] >= webqtlConfig.USERDICT['admin']:
+ pass
+ else:
+ heading = "Editing Info"
+ detail = ["You don't have the permission to edit this dataset"]
+ self.error(heading=heading,detail=detail,error="Error")
+ return
+ GN_AccessionId = fd.formdata.getvalue('GN_AccessionId')
+ InfoPageName = fd.formdata.getvalue('InfoPageName')
+ sharingInfoObject = SharingInfo.SharingInfo(GN_AccessionId, InfoPageName)
+ info, filelist = sharingInfoObject.getInfo()
+ self.dict['body'] = SharingBody.sharinginfoedit_body_string % (info[31], info[0], info[11], info[12], info[13], info[14], info[15], info[16], info[17], info[18], info[19], info[20], info[21], info[22], info[6], info[5], info[35], info[36], info[37], info[38], info[39], info[7], info[8], info[9], info[40], info[32], info[31], info[1], info[2], info[3], info[30], info[4], info[10], info[23], info[25], info[33], info[26], info[27], info[28], info[24], info[34], info[41])
diff --git a/web/webqtl/dataSharing/SharingInfoPage.py b/web/webqtl/dataSharing/SharingInfoPage.py
new file mode 100755
index 00000000..230ba2f3
--- /dev/null
+++ b/web/webqtl/dataSharing/SharingInfoPage.py
@@ -0,0 +1,52 @@
+# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# This program is available from Source Forge: at GeneNetwork Project
+# (sourceforge.net/projects/genenetwork/).
+#
+# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
+# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
+#
+#
+#
+# This module is used by GeneNetwork project (www.genenetwork.org)
+#
+# Created by GeneNetwork Core Team 2010/08/10
+#
+# Last updated by GeneNetwork Core Team 2010/10/20
+
+from base.templatePage import templatePage
+from base import webqtlConfig
+from dbFunction import webqtlDatabaseFunction
+import SharingBody
+import SharingInfo
+
+
+#########################################
+# Sharing Info Page
+#########################################
+class SharingInfoPage(templatePage):
+
+ def __init__(self, fd=None):
+ templatePage.__init__(self, fd)
+ GN_AccessionId = fd.formdata.getvalue('GN_AccessionId')
+ InfoPageName = fd.formdata.getvalue('InfoPageName')
+ cursor = webqtlDatabaseFunction.getCursor()
+ if InfoPageName and not GN_AccessionId:
+ sql = "select GN_AccesionId from InfoFiles where InfoPageName = %s"
+ cursor.execute(sql, InfoPageName)
+ GN_AccessionId = cursor.fetchone()
+ url = webqtlConfig.CGIDIR + "main.py?FormID=sharinginfo&GN_AccessionId=%s" % GN_AccessionId
+ self.redirection = url
+ else:
+ sharingInfoObject = SharingInfo.SharingInfo(GN_AccessionId, InfoPageName)
+ self.dict['body'] = sharingInfoObject.getBody(infoupdate="")
diff --git a/web/webqtl/dataSharing/SharingInfoUpdatePage.py b/web/webqtl/dataSharing/SharingInfoUpdatePage.py
new file mode 100755
index 00000000..a70238b9
--- /dev/null
+++ b/web/webqtl/dataSharing/SharingInfoUpdatePage.py
@@ -0,0 +1,109 @@
+# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# This program is available from Source Forge: at GeneNetwork Project
+# (sourceforge.net/projects/genenetwork/).
+#
+# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
+# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
+#
+#
+#
+# This module is used by GeneNetwork project (www.genenetwork.org)
+#
+# Created by GeneNetwork Core Team 2010/08/10
+#
+# Last updated by GeneNetwork Core Team 2010/10/20
+
+import MySQLdb
+
+from base.templatePage import templatePage
+from base import webqtlConfig
+from dbFunction import webqtlDatabaseFunction
+import SharingBody
+import SharingInfo
+
+#########################################
+# Sharing Info Update Page
+#########################################
+class SharingInfoUpdatePage(templatePage):
+
+ def __init__(self, fd=None):
+ templatePage.__init__(self, fd)
+ if webqtlConfig.USERDICT[self.privilege] >= webqtlConfig.USERDICT['admin']:
+ pass
+ else:
+ heading = "Editing Info"
+ detail = ["You don't have the permission to modify this file"]
+ self.error(heading=heading,detail=detail,error="Error")
+ return
+ cursor = webqtlDatabaseFunction.getCursor()
+ if (not cursor):
+ return
+ Id=fd.formdata.getvalue('Id')
+ GN_AccesionId=fd.formdata.getvalue('GN_AccesionId')
+ GEO_Series=fd.formdata.getvalue('GEO_Series')
+ Status=fd.formdata.getvalue('Status')
+ Title=fd.formdata.getvalue('Title')
+ Organism_Id=fd.formdata.getvalue('Organism_Id')
+ Organism=fd.formdata.getvalue('Organism')
+ Experiment_Type =fd.formdata.getvalue('Experiment_Type')
+ Summary=fd.formdata.getvalue('Summary')
+ Overall_Design=fd.formdata.getvalue('Overall_Design')
+ Contributor=fd.formdata.getvalue('Contributor')
+ Citation=fd.formdata.getvalue('Citation')
+ Submission_Date=fd.formdata.getvalue('Submission_Date')
+ Contact_Name=fd.formdata.getvalue('Contact_Name')
+ Emails=fd.formdata.getvalue('Emails')
+ Phone=fd.formdata.getvalue('Phone')
+ URL=fd.formdata.getvalue('URL')
+ Organization_Name=fd.formdata.getvalue('Organization_Name')
+ Department=fd.formdata.getvalue('Department')
+ Laboratory=fd.formdata.getvalue('Laboratory')
+ Street=fd.formdata.getvalue('Street')
+ City=fd.formdata.getvalue('City')
+ State=fd.formdata.getvalue('State')
+ ZIP=fd.formdata.getvalue('ZIP')
+ Country=fd.formdata.getvalue('Country')
+ Platforms=fd.formdata.getvalue('Platforms')
+ Samples=fd.formdata.getvalue('Samples')
+ Species=fd.formdata.getvalue('Species')
+ Tissue=fd.formdata.getvalue('Tissue')
+ Normalization=fd.formdata.getvalue('Normalization')
+ InbredSet=fd.formdata.getvalue('InbredSet')
+ InfoPageName=fd.formdata.getvalue('InfoPageName')
+ InfoPageTitle=fd.formdata.getvalue('InfoPageTitle')
+ About_Cases=fd.formdata.getvalue('About_Cases')
+ About_Tissue=fd.formdata.getvalue('About_Tissue')
+ About_Download=fd.formdata.getvalue('About_Download')
+ About_Array_Platform=fd.formdata.getvalue('About_Array_Platform')
+ About_Data_Values_Processing=fd.formdata.getvalue('About_Data_Values_Processing')
+ Data_Source_Acknowledge=fd.formdata.getvalue('Data_Source_Acknowledge')
+ AuthorizedUsers=fd.formdata.getvalue('AuthorizedUsers')
+ Progress=fd.formdata.getvalue('Progress')
+ if Id=='-1':
+ sharingInfoObject = SharingInfo.SharingInfo(GN_AccesionId, InfoPageName)
+ info, filelist = sharingInfoObject.getInfo()
+ if info:
+ heading = "Editing Info"
+ detail = ["The new dataset info record is duplicate."]
+ self.error(heading=heading, detail=detail, error="Error")
+ return
+ sql = """INSERT INTO InfoFiles SET GN_AccesionId=%s, GEO_Series=%s, Status=%s, Title=%s, Organism_Id=%s, Organism=%s, Experiment_Type=%s, Summary=%s, Overall_Design=%s, Contributor=%s, Citation=%s, Submission_Date=%s, Contact_Name=%s, Emails=%s, Phone=%s, URL=%s, Organization_Name=%s, Department=%s, Laboratory=%s, Street=%s, City=%s, State=%s, ZIP=%s, Country=%s, Platforms=%s, Samples=%s, Species=%s, Tissue=%s, Normalization=%s, InbredSet=%s, InfoPageName=%s, InfoPageTitle=%s, About_Cases=%s, About_Tissue=%s, About_Download=%s, About_Array_Platform=%s, About_Data_Values_Processing=%s, Data_Source_Acknowledge=%s, AuthorizedUsers=%s, Progreso=%s"""
+ cursor.execute(sql, tuple([GN_AccesionId, GEO_Series, Status, Title, Organism_Id, Organism, Experiment_Type, Summary, Overall_Design, Contributor, Citation, Submission_Date, Contact_Name, Emails, Phone, URL, Organization_Name, Department, Laboratory, Street, City, State, ZIP, Country, Platforms, Samples, Species, Tissue, Normalization, InbredSet, InfoPageName, InfoPageTitle, About_Cases, About_Tissue, About_Download, About_Array_Platform, About_Data_Values_Processing, Data_Source_Acknowledge, AuthorizedUsers, Progress]))
+ infoupdate="This record has been succesfully added."
+ else:
+ sql = """UPDATE InfoFiles SET GN_AccesionId=%s, GEO_Series=%s, Status=%s, Title=%s, Organism_Id=%s, Organism=%s, Experiment_Type=%s, Summary=%s, Overall_Design=%s, Contributor=%s, Citation=%s, Submission_Date=%s, Contact_Name=%s, Emails=%s, Phone=%s, URL=%s, Organization_Name=%s, Department=%s, Laboratory=%s, Street=%s, City=%s, State=%s, ZIP=%s, Country=%s, Platforms=%s, Samples=%s, Species=%s, Tissue=%s, Normalization=%s, InbredSet=%s, InfoPageName=%s, InfoPageTitle=%s, About_Cases=%s, About_Tissue=%s, About_Download=%s, About_Array_Platform=%s, About_Data_Values_Processing=%s, Data_Source_Acknowledge=%s, AuthorizedUsers=%s, Progreso=%s WHERE Id=%s"""
+ cursor.execute(sql, tuple([GN_AccesionId, GEO_Series, Status, Title, Organism_Id, Organism, Experiment_Type, Summary, Overall_Design, Contributor, Citation, Submission_Date, Contact_Name, Emails, Phone, URL, Organization_Name, Department, Laboratory, Street, City, State, ZIP, Country, Platforms, Samples, Species, Tissue, Normalization, InbredSet, InfoPageName, InfoPageTitle, About_Cases, About_Tissue, About_Download, About_Array_Platform, About_Data_Values_Processing, Data_Source_Acknowledge, AuthorizedUsers, Progress, Id]))
+ infoupdate="This record has been succesfully updated."
+ sharingInfoObject = SharingInfo.SharingInfo(GN_AccesionId, InfoPageName)
+ self.dict['body'] = sharingInfoObject.getBody(infoupdate=infoupdate)
\ No newline at end of file
diff --git a/web/webqtl/dataSharing/SharingListDataSetPage.py b/web/webqtl/dataSharing/SharingListDataSetPage.py
new file mode 100755
index 00000000..ec90f5f3
--- /dev/null
+++ b/web/webqtl/dataSharing/SharingListDataSetPage.py
@@ -0,0 +1,99 @@
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# This program is available from Source Forge: at GeneNetwork Project
+# (sourceforge.net/projects/genenetwork/).
+#
+# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
+# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
+#
+#
+#
+# This module is used by GeneNetwork project (www.genenetwork.org)
+#
+# Created by GeneNetwork Core Team 2010/08/10
+#
+# Last updated by GeneNetwork Core Team 2010/10/20
+
+from htmlgen import HTMLgen2 as HT
+from base import webqtlConfig
+
+from base.templatePage import templatePage
+
+
+#########################################
+# Sharing List DataSet Page
+#########################################
+class SharingListDataSetPage(templatePage):
+
+ def __init__(self, fd=None):
+ templatePage.__init__(self, fd)
+
+ if not self.openMysql():
+ return
+
+ if webqtlConfig.USERDICT[self.privilege] >= webqtlConfig.USERDICT['admin']:
+ pass
+ else:
+ heading = "Editing Info"
+ detail = ["You don't have the permission to list the datasets"]
+ self.error(heading=heading,detail=detail,error="Error")
+ return
+
+
+ TD_LR = HT.TD(height=200,width="100%",bgColor='#eeeeee')
+
+ query = """select GN_AccesionId, InfoPageTitle, Progreso from InfoFiles order by GN_AccesionId"""
+ self.cursor.execute(query)
+ result = self.cursor.fetchall()
+
+ heading = HT.Paragraph('Dataset Table', Class="title")
+
+ newrecord = HT.Href(text="New Record", url="/webqtl/main.py?FormID=sharinginfoadd")
+
+ info = "Click the accession id to view the dataset info. Click the dataset name to edit the dataset info."
+
+ datasetTable = HT.TableLite(border=0, cellpadding=0, cellspacing=0, Class="collap", width="100%")
+
+ tableHeaderRow = HT.TR()
+ tableHeaderRow.append(HT.TD("Accession Id", Class='fs14 fwb ffl b1 cw cbrb', align="center"))
+ tableHeaderRow.append(HT.TD("Dataset name", Class='fs14 fwb ffl b1 cw cbrb', align="center"))
+ tableHeaderRow.append(HT.TD("Progress", Class='fs14 fwb ffl b1 cw cbrb', align="center"))
+ tableHeaderRow.append(HT.TD("Operation", Class='fs14 fwb ffl b1 cw cbrb', align="center"))
+ datasetTable.append(tableHeaderRow)
+
+ for one_row in result:
+ Accession_Id, InfoPage_title, Progress = one_row
+ datasetRow = HT.TR()
+ datasetRow.append(HT.TD(HT.Href(text="GN%s" % Accession_Id, url="/webqtl/main.py?FormID=sharinginfo&GN_AccessionId=%s" % Accession_Id, Class='fs12 fwn'), Class="fs12 fwn b1 c222"))
+ datasetRow.append(HT.TD(HT.Href(text="%s" % InfoPage_title, url="/webqtl/main.py?FormID=sharinginfo&GN_AccessionId=%s" % Accession_Id, Class='fs12 fwn'), Class="fs12 fwn b1 c222"))
+ datasetRow.append(HT.TD("%s" % Progress, Class='fs12 fwn ffl b1 c222'))
+ operation_edit = HT.Href(text="Edit", url="/webqtl/main.py?FormID=sharinginfoedit&GN_AccessionId=%s" % Accession_Id)
+ operation_delete = HT.Href(text="Delete", onClick="deleteRecord(%s); return false;" % Accession_Id)
+ operation = HT.TD(Class="fs12 fwn b1 c222", align="center")
+ operation.append(operation_edit)
+ operation.append(" ")
+ operation.append(operation_delete)
+ datasetRow.append(operation)
+ datasetTable.append(datasetRow)
+
+ TD_LR.append(heading, HT.P(), newrecord, HT.P(), info, HT.P(), datasetTable)
+
+ js1 = """ """
+ self.dict['js1'] = js1
+ self.dict['body'] = str(TD_LR)
\ No newline at end of file
diff --git a/web/webqtl/dataSharing/SharingPage.py b/web/webqtl/dataSharing/SharingPage.py
new file mode 100755
index 00000000..cf1d9ac3
--- /dev/null
+++ b/web/webqtl/dataSharing/SharingPage.py
@@ -0,0 +1,40 @@
+# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# This program is available from Source Forge: at GeneNetwork Project
+# (sourceforge.net/projects/genenetwork/).
+#
+# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
+# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
+#
+#
+#
+# This module is used by GeneNetwork project (www.genenetwork.org)
+#
+# Created by GeneNetwork Core Team 2010/08/10
+#
+# Last updated by GeneNetwork Core Team 2010/10/20
+
+from base.templatePage import templatePage
+import SharingBody
+
+#########################################
+# SharingPage
+#########################################
+
+class SharingPage(templatePage):
+
+ def __init__(self, fd):
+ templatePage.__init__(self, fd)
+ self.dict['title'] = 'GeneNetwork Data Sharing Zone'
+ self.dict['body'] = SharingBody.sharing_body_string
+ self.dict['js2'] = 'onload="javascript:initialDatasetSelection();"'
\ No newline at end of file
diff --git a/web/webqtl/dataSharing/__init__.py b/web/webqtl/dataSharing/__init__.py
new file mode 100755
index 00000000..e69de29b
--
cgit v1.2.3