Subversion Repositories SmartDukaan

Rev

Rev 3376 | Rev 4754 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3376 Rev 4691
Line 1... Line 1...
1
'''
1
'''
2
Created on 14-Jul-2010
2
Created on 14-Jul-2010
3
 
3
 
4
@author: ashish
4
@author: ashish
5
'''
5
'''
-
 
6
from shop2020.config.client.ConfigClient import ConfigClient
6
from shop2020.helpers.impl import DataAccessor
7
from shop2020.helpers.impl import DataAccessor
-
 
8
from shop2020.helpers.impl.Converters import to_t_luser, to_t_useremail, \
-
 
9
    to_t_suser, to_t_ruser, to_t_report, to_t_catalog_user
7
from shop2020.helpers.impl.DataAccessor import getSubstitutedMessage, getMessage,\
10
from shop2020.helpers.impl.DataAccessor import getSubstitutedMessage, getMessage, \
8
    updateMessage, addMessage, add_user, delete_user, update_password,\
11
    updateMessage, addMessage, add_user, delete_user, update_password, \
9
    save_user_email_for_sending, get_emails_to_be_sent, mark_email_as_sent , initialize, close_session,\
12
    save_user_email_for_sending, get_emails_to_be_sent, mark_email_as_sent, \
10
    get_reports, authenticate_dashboard_user, is_alive
13
    initialize, close_session, get_reports, authenticate_dashboard_user, is_alive
11
from shop2020.helpers.impl.DataService import LogisticsUser, StatisticsUser,\
14
from shop2020.helpers.impl.DataService import LogisticsUser, StatisticsUser, \
12
    ReportUser, CatalogDashboardUser
15
    ReportUser, CatalogDashboardUser
-
 
16
from shop2020.helpers.impl.model.Agent import Agent
13
from shop2020.thriftpy.utils.ttypes import HelperServiceException
17
from shop2020.thriftpy.utils.ttypes import HelperServiceException
14
from shop2020.helpers.impl.Converters import to_t_luser, to_t_useremail,\
-
 
15
    to_t_suser, to_t_ruser, to_t_report, to_t_catalog_user
-
 
16
from shop2020.config.client.ConfigClient import ConfigClient
-
 
17
 
18
 
18
 
19
 
19
class HelperServiceHandler():
20
class HelperServiceHandler():
20
    
21
    
21
 
22
 
Line 233... Line 234...
233
            return to_t_catalog_user(catalog_user)
234
            return to_t_catalog_user(catalog_user)
234
        except:
235
        except:
235
            raise HelperServiceException(101, "No such catalog user")
236
            raise HelperServiceException(101, "No such catalog user")
236
        finally:
237
        finally:
237
            close_session()         
238
            close_session()         
-
 
239
 
-
 
240
    def getAgents(self, ):
-
 
241
        return [Agent.to_thrift_object(t) for t in Agent.query.all()]
-
 
242
 
-
 
243
    def validateLogIn(self, emailId, password):
-
 
244
        """
-
 
245
        Parameters:
-
 
246
         - emailId
-
 
247
         - password
-
 
248
        """
-
 
249
        pass
-
 
250
 
-
 
251
    def updatePasswordForAgent(self, agentEmailId, password):
-
 
252
        """
-
 
253
        Parameters:
-
 
254
         - agentEmailId
-
 
255
         - password
-
 
256
        """
-
 
257
        pass
-
 
258
 
-
 
259
    def getRoleNamesForAgent(self, agentEmailId):
-
 
260
        """
-
 
261
        Parameters:
-
 
262
         - agentEmailId
-
 
263
        """
-
 
264
        pass
-
 
265
 
-
 
266
    def getPermissionsForRoleName(self, roleName):
-
 
267
        """
-
 
268
        Parameters:
-
 
269
         - roleName
-
 
270
        """
-
 
271
        pass
238
    
272
    
239
    def closeSession(self, ):
273
    def closeSession(self, ):
240
        close_session()
274
        close_session()
241
        
275
        
242
    def isAlive(self, ):
276
    def isAlive(self, ):