|
27
|
1 |
''' |
|
|
2 |
Created on 06 August 2012 |
|
|
3 |
|
|
|
4 |
@author: Corinne |
|
|
5 |
''' |
|
|
6 |
import logging |
|
|
7 |
|
|
|
8 |
logger = logging.getLogger('document') |
|
|
9 |
|
|
|
10 |
class ClientDocumentaryFileAttributes(object): |
|
|
11 |
|
|
|
12 |
def __init__(self, request): |
|
|
13 |
self.request = request |
|
|
14 |
|
|
|
15 |
def get_user(self): |
|
|
16 |
user = '' |
|
|
17 |
try: |
|
|
18 |
user = self.request.POST['user'] |
|
|
19 |
except Exception, err: |
|
|
20 |
logger.info('No user attribute in the http post request.' + str(err)) |
|
|
21 |
return user |
|
|
22 |
|
|
|
23 |
def get_title(self): |
|
|
24 |
title = '' |
|
|
25 |
try: |
|
|
26 |
title = self.request.POST['title'] |
|
|
27 |
except Exception, err: |
|
|
28 |
logger.info('No title attribute in the http post request.' + str(err)) |
|
|
29 |
return title |
|
|
30 |
|
|
|
31 |
def get_description(self): |
|
|
32 |
description = '' |
|
|
33 |
try: |
|
|
34 |
description = self.request.POST['description'] |
|
|
35 |
except Exception, err: |
|
|
36 |
logger.info('No description attribute in the http post request.' + str(err)) |
|
|
37 |
return description |
|
|
38 |
|
|
|
39 |
def get_query_id(self): |
|
|
40 |
query_id = '' |
|
|
41 |
try: |
|
|
42 |
query_id = self.request.POST['query_id'] |
|
|
43 |
except Exception, err: |
|
|
44 |
logger.info('No query_id attribute in the http post request. ' + str(err)) |
|
|
45 |
return query_id |
|
|
46 |
|
|
37
|
47 |
def get_json_treemap(self): |
|
|
48 |
jsontreemap = '' |
|
|
49 |
try: |
|
|
50 |
jsontreemap = self.request.POST['jsontreemap'] |
|
|
51 |
except Exception, err: |
|
|
52 |
logger.info('No jsontreemap attribute in the http post request. ' + str(err)) |
|
|
53 |
return jsontreemap |
|
|
54 |
|
|
|
55 |
def get_json_streamgraph(self): |
|
|
56 |
jsonstreamgraph = '' |
|
|
57 |
try: |
|
|
58 |
jsonstreamgraph = self.request.POST['jsonstreamgraph'] |
|
|
59 |
except Exception, err: |
|
|
60 |
logger.info('No jsonstreamgraph attribute in the http post request. ' + str(err)) |
|
|
61 |
return jsonstreamgraph |
|
|
62 |
|
|
27
|
63 |
def get_visibility(self): |
|
|
64 |
visibility = False |
|
|
65 |
try: |
|
|
66 |
visibility = self.request.POST['visibility'] |
|
|
67 |
except Exception, err: |
|
|
68 |
logger.info('No visibility attribute in the http post request. ' + str(err)) |
|
|
69 |
return visibility |