alcatel/dataparser/ClientClusterAnnotationCreateAttributes.py
changeset 27 8ca7f2cea729
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/alcatel/dataparser/ClientClusterAnnotationCreateAttributes.py	Thu Jan 24 16:58:55 2013 +0100
@@ -0,0 +1,55 @@
+'''
+Created on 07 August 2012
+
+@author: Corinne
+'''
+import logging
+
+logger = logging.getLogger('document')
+
+class ClientDocumentAnnotationCreateAttributes(object):
+
+    def __init__(self, request):
+        self.request = request
+    
+    def get_user(self):
+        user = ''
+        try:
+            user = self.request.POST['user']
+        except Exception, err:
+            logger.info('No user attribute in the http post request. ' + str(err))
+        return user
+    
+    def get_documentary_file(self):
+        documentary_file = ''
+        try:
+            documentary_file = self.request.POST['documentary_file_id']
+        except Exception, err:
+            logger.info('No documentary_file attribute in the http post request. ' + str(err))
+        return documentary_file
+    
+    def get_annotation(self):
+        annotation = ''
+        try:
+            annotation = self.request.POST['annotation']
+        except Exception, err:
+            logger.info('No annotation attribute in the http post request. ' + str(err))
+        return annotation
+    
+    def get_cluster(self):
+        cluster = ''
+        try:
+            cluster = self.request.POST['cluster_id']
+        except Exception, err:
+            logger.info('No cluster attributes in the http post request. ' + str(err))
+        return cluster
+    
+    def get_tags(self):
+        tags = []
+        try:
+            tags = self.request.POST['tags']
+            tags = eval(tags)
+        except Exception, err:
+            logger.info('Info: ' + str(err))
+        
+        return tags
\ No newline at end of file