Exemplo n.º 1
0
 def __init__(self):
     map = {"id": "long", "xml": "string"}
     RegistryFile.__init__(self,
                           ServiceInjector.getStorageRegistryFactory(),
                           "LIST-XML-REGISTRY",
                           ServiceInjector.getSequenceGen(), map, "list",
                           "id")
Exemplo n.º 2
0
 def __init__(self):
     map = {
         "leftk": "string",
         "rightk": "string",
         "amount": "decimal",
         "id": "long"
     }
     RegistryFile.__init__(self,
                           ServiceInjector.getStorageRegistryFactory(),
                           "FOOTER-DIFFERENT",
                           ServiceInjector.getSequenceGen(), map, "list",
                           "id")
Exemplo n.º 3
0
 def __init__(self):
     map = {
         "id": "long",
         "firstname": "string",
         "lastname": "string",
         "credit": "decimal"
     }
     RegistryFile.__init__(self,
                           ServiceInjector.getStorageRegistryFactory(),
                           "LIST-ICON-REGISTRY",
                           ServiceInjector.getSequenceGen(), map, "list",
                           "id")
Exemplo n.º 4
0
def dialoglist(action, var):
    print "dialoglist", action

    if action == "select":
        for k in var.keys():
            print k, var[k]
        if not var["list_lineset"]: return
        var['helplist'] = var["pnumber"]
        var['JCOPY_helplist'] = True
        var["JCLOSE_DIALOG"] = True

    if action == "before":
        list = []
        op = ServiceInjector.constructPersonOp()
        seq = op.getAllPersons()

        for s in seq:
            elem = {}
            elem["key"] = s.id
            elem["pnumber"] = s.getPersonNumb()
            elem["pname"] = s.getPersonName()
            list.append(elem)

        map = {}
        map["list"] = list
        var["JLIST_MAP"] = map
        return
Exemplo n.º 5
0
def doaction(action, var):
    printVar("dialogres", action, var)
    op = ServiceInjector.constructPersonOp()

    if action == "before":
        __create_list(op, var)
        setAddEditMode(var, "list", ["pname,pnumber"])

    if action == "run1":
        var["JUP_DIALOG"] = "resdialog.xml"
        var['JAFTERDIALOG_ACTION'] = "actionres"
        var["JUPDIALOG_START"] = "Hello from script"

    if action == "editlistrowaction":
        var["JLIST_EDIT_ACTIONOK_list"] = True

    if action == "selectvar":
        var["JUP_DIALOG"] = "resdialog.xml"
        var['JAFTERDIALOG_ACTION'] = "selectrowvalue"

    if action == "selectrowvalue":
        setCopy(var, ["key", "pname", "pnumber"], "list")
        var["pname"] = var["JUPDIALOG_BUTTON"]
        var["pnumber"] = var["JUPDIALOG_RES"]
        var["key"] = 999

    if action == "actionres":
        setCopy(var, ["buttonres", "stringres"])
        var["buttonres"] = var["JUPDIALOG_BUTTON"]
        var["stringres"] = var["JUPDIALOG_RES"]
Exemplo n.º 6
0
def doaction(action,var):
    printVar("dialogres",action,var)
    op = ServiceInjector.constructPersonOp()

    if action == "before" :
        __create_list(op,var)
        setAddEditMode(var,"list",["pname,pnumber"])
        
        
    if action == "run1" :
        var["JUP_DIALOG"] = "resdialog.xml"
        var['JAFTERDIALOG_ACTION'] = "actionres"
        var["JUPDIALOG_START"] = "Hello from script"
        
    if action == "editlistrowaction"  :
        var["JLIST_EDIT_ACTIONOK_list"] = True
    
    if action == "selectvar" :
        var["JUP_DIALOG"] = "resdialog.xml"
        var['JAFTERDIALOG_ACTION'] = "selectrowvalue"
        
    if action == "selectrowvalue" :
        setCopy(var,["key","pname","pnumber"],"list")
        var["pname"] = var["JUPDIALOG_BUTTON"]
        var["pnumber"] = var["JUPDIALOG_RES"]
        var["key"] = 999
    
    
    if action == "actionres" :
        setCopy(var,["buttonres","stringres"])
        var["buttonres"] = var["JUPDIALOG_BUTTON"]
        var["stringres"] =var["JUPDIALOG_RES"]
Exemplo n.º 7
0
def dialoglist(action,var) :
  print "dialoglist",action
  
  if action == "select" :
    for k in var.keys() : 
      print k, var[k]
    if not var["list_lineset"] : return
    var['helplist'] = var["pnumber"]
    var['JCOPY_helplist'] = True
    var["JCLOSE_DIALOG"] = True
    
  
  
  if action == "before" :
    list = []
    op = ServiceInjector.constructPersonOp()
    seq = op.getAllPersons()
       
    for s in seq : 
       elem = {}
       elem["key"] = s.id
       elem["pnumber"] = s.getPersonNumb()
       elem["pname"] = s.getPersonName()
       list.append(elem)
       
    map={}   
    map["list"] = list
    var["JLIST_MAP"] = map  
    return
     
Exemplo n.º 8
0
def dialogaction(action,var) :

  printVar("list",action,var)
    
  op = ServiceInjector.constructPersonOp()
          
  if action == "before" or action == "crud_readlist" :
    __create_list(op,var)
    return
    
  if action == "clearpersons" :
     yes = var['JYESANSWER']
     if not yes : return
     op.clearAll()
     for i in range(100) :
       numb = str(i)
       name = 'NAME ' + numb
       p = op.construct()
       p.setPersonNumb(numb)
       p.setPersonName(name)
       op.savePerson(p)
     __create_list(op,var)  
     return
     
      
  pname = var["pname"]
  pnumb = var["pnumber"]
  print pname," ",pnumb
    
  if action == "crud_add"  :
    pname = var["pname"]
    pnumb = var["pnumber"]
    print pname," ",pnumb
    if action == "crud_add" :
       p = op.findPersonByNumb(pnumb)
       if p != None :
         var["JERROR_pnumber"] = "Duplicated number, person number should be unique"
         return  
       if not var["JCRUD_AFTERCONF"] :
         var["JYESNO_MESSAGE"] = "Are you ready to add new elem ?"
         var["JMESSAGE_TITLE"] = "Ask for something"
         print "var kom ",var["JYESNO_MESSAGE"]
         return
       p = op.construct()
       p.setPersonNumb(pnumb)
       p.setPersonName(pname)
       op.savePerson(p)
       var["JCLOSE_DIALOG"] = True
       return

  key = var["key"]      
  if action == "crud_remove" or action == "crud_change" :
       p = op.construct()
       print key,pnumb,pname
       p.setId(key)
       p.setPersonNumb(pnumb)
       p.setPersonName(pname)
       if action == "crud_remove" : op.removePerson(p)
       else : op.changePerson(p)
       var["JCLOSE_DIALOG"] = True
Exemplo n.º 9
0
def dialogaction(action, var):

    printVar("list", action, var)

    op = ServiceInjector.constructPersonOp()

    if action == "before" or action == "crud_readlist":
        __create_list(op, var)
        return

    if action == "clearpersons":
        yes = var['JYESANSWER']
        if not yes: return
        op.clearAll()
        for i in range(100):
            numb = str(i)
            name = 'NAME ' + numb
            p = op.construct()
            p.setPersonNumb(numb)
            p.setPersonName(name)
            op.savePerson(p)
        __create_list(op, var)
        return

    pname = var["pname"]
    pnumb = var["pnumber"]
    print pname, " ", pnumb

    if action == "crud_add":
        pname = var["pname"]
        pnumb = var["pnumber"]
        print pname, " ", pnumb
        if action == "crud_add":
            p = op.findPersonByNumb(pnumb)
            if p != None:
                var["JERROR_pnumber"] = "Duplicated number, person number should be unique"
                return
            if not var["JCRUD_AFTERCONF"]:
                var["JYESNO_MESSAGE"] = "Are you ready to add new elem ?"
                var["JMESSAGE_TITLE"] = "Ask for something"
                print "var kom ", var["JYESNO_MESSAGE"]
                return
            p = op.construct()
            p.setPersonNumb(pnumb)
            p.setPersonName(pname)
            op.savePerson(p)
            var["JCLOSE_DIALOG"] = True
            return

    key = var["key"]
    if action == "crud_remove" or action == "crud_change":
        p = op.construct()
        print key, pnumb, pname
        p.setId(key)
        p.setPersonNumb(pnumb)
        p.setPersonName(pname)
        if action == "crud_remove": op.removePerson(p)
        else: op.changePerson(p)
        var["JCLOSE_DIALOG"] = True
Exemplo n.º 10
0
def footeraction(action, var):
    print "footeraction", action
    for k in var.keys():
        print k
        print var[k]

    op = ServiceInjector.constructPersonOp()

    if action == "before" or action == "crud_readlist":
        __create_list(op, var)
        var["JFOOTER_COPY_list_pnumber"] = True
        var["JFOOTER_list_pnumber"] = action
        return

    dialogaction(action, var)
Exemplo n.º 11
0
def footeraction(action,var):
  print "footeraction",action
  for k in var.keys() : 
    print k
    print var[k]
    
  op = ServiceInjector.constructPersonOp()
          
  if action == "before" or action == "crud_readlist" :
    __create_list(op,var)
    var["JFOOTER_COPY_list_pnumber"] = True
    var["JFOOTER_list_pnumber"] = action
    return
 
  dialogaction(action,var) 
Exemplo n.º 12
0
 def __init__(self):
     self.op = ServiceInjector.constructDateOp()
Exemplo n.º 13
0
 def __init__(self):
     StorageRegistry.__init__(self,
                              ServiceInjector.getStorageRegistryFactory(),
                              "PAYMENT")
Exemplo n.º 14
0
 def __init__(self): 
    StorageRegistry.__init__(self,ServiceInjector.getStorageRegistryFactory(),"PAYMENT")
Exemplo n.º 15
0
 def __init__(self) :
   map = {"leftk" : "string", "rightk" : "string","amount" : "decimal", "id" : "long" }
   RegistryFile.__init__(self,ServiceInjector.getStorageRegistryFactory(),"FOOTER-DIFFERENT",ServiceInjector.getSequenceGen(),map, "list","id")
Exemplo n.º 16
0
 def __getV(self,s):
     V = StorageRegistry(ServiceInjector.getStorageRegistryFactory(),"PAYMENT-" + s)
     return V
Exemplo n.º 17
0
 def __init__(self) :
   map = {"id" : "long", "date1" : "date", "nameid" : "string","comboid" : "string", "helperid" : "string" }
   RegistryFile.__init__(self,ServiceInjector.getStorageRegistryFactory(),"LIST-TEST-REGISTRY",ServiceInjector.getSequenceGen(),map, "listda","id")
Exemplo n.º 18
0
 def __init__(self) :
   map = {"id" : cutil.LONG, "firstname" : cutil.STRING, "lastname" : cutil.STRING,"realm" : cutil.STRING, "key" : cutil.STRING, "filename" : cutil.STRING, "info" : cutil.STRING }
   cutil.RegistryFile.__init__(self,ServiceInjector.getStorageRegistryFactory(),"LIST-ATTACH-PERSON-DEMO",ServiceInjector.getSequenceGen(),map, "list","id")
Exemplo n.º 19
0
 def __init__(self):
     map = {"id": cutil.LONG, "number": cutil.LONG, "dic": cutil.STRING}
     cutil.RegistryFile.__init__(
         self, ServiceInjector.getStorageRegistryFactory(),
         "REGISTRY-CUSTOM-ENUM", ServiceInjector.getSequenceGen(), map,
         "list", "id")
Exemplo n.º 20
0
def editlistaction(action, var):
    printVar("editlistaction", action, var)

    op = ServiceInjector.constructPersonOp()
    dOp = ServiceInjector.constructDateRecordOp()

    if action == "clear1action":
        if not var['JYESANSWER']: return
        op.clearAll()
        __create_list(op, var)
        return

    if action == "clear2action":
        if not var['JYESANSWER']: return
        dOp.clearAll()
        __create_listda(dOp, var)
        return

    if action == "before":
        __create_list(op, var)
        var["JLIST_EDIT_list_pname"] = ""
        var["JLIST_EDIT_list_pnumber"] = ""
        #    var["JLIST_EDIT_list_MODE"] = "NORMALMODE"
        #    var["JLIST_EDIT_list_MODE"] = "CHANGEMODE"
        var["JLIST_EDIT_list_MODE"] = "ADDCHANGEDELETEMODE"

        __create_listda(dOp, var)
        #    var["JLIST_EDIT_listda_date1"] = ""
        #    var["JLIST_EDIT_listda_date2"] = ""
        #    var["JLIST_EDIT_listda_vals"] = ""
        #    var["JLIST_EDIT_listda_MODE"] = "CHANGEMODE"
        #    var["JLIST_EDIT_listda_MODE"] = "NORMALMODE"
        #    var["JLIST_EDIT_listda_MODE"] = "ADDCHANGEDELETEMODE"
        setAddEditMode(var, "listda", ["date1", "date2", "vals"])
        #    cutil.setChangeEditMode(var,"listda",["date1","date2","vals"])
        #    cutil.setStandEditMode(var,"listda",["date1","date2","vals"])

        __create_listb(var)
        #    setAddEditMode(var,"listb",["id","name","check"])
        cutil.setChangeEditMode(var, "listb", ["id", "name", "check"])
        #    cutil.setStandEditMode(var,"listb",["id","name","check"])
        #    setAddEditMode(var,"listb",["id","name","check"])

        return

    if action == "vali":
        return

    if var["JLIST_NAME"] == "list":

        if action == "editlistrowaction":
            var["JYESNO_MESSAGE"] = "Are you ready to add new elem ?"
            var["JMESSAGE_TITLE"] = "Ask for something"
            var["JAFTERDIALOG_ACTION"] = "afteryesno"

        if action == "afteryesno" and var["JYESANSWER"]:
            var["JLIST_EDIT_ACTIONOK_list"] = True
            var["pname"] = "xxxx"
            var["JCOPY_pname"] = True
            var["pnumber"] = "1"
            var["JCOPY_pnumber"] = True

        if action == "columnchangeaction" and var["changefield"] == "pnumber":
            val = var["pnumber"]
            print "val", val, "!"
            if val == None or val == "":
                print "==============="


#        var["JERROR_pnumber"] = "Cannot be empty"

    if var["JLIST_NAME"] == "listb":
        var["JLIST_EDIT_ACTIONOK_listb"] = True

    if var["JLIST_NAME"] == "listda":
        if action == "afteryesno" and var["JYESANSWER"]:
            var["JLIST_EDIT_ACTIONOK_listda"] = True

        if action == "editlistrowaction" and (
                var["JLIST_EDIT_ACTION_listda"] == "ADDBEFORE"
                or var["JLIST_EDIT_ACTION_listda"] == "ADD"):
            var["JYESNO_MESSAGE"] = "Are you ready to add new empty date elem ?"
            var["JMESSAGE_TITLE"] = "Ask for something"
            var["JAFTERDIALOG_ACTION"] = "afteryesno"

        if action == "editlistrowaction" and var[
                "JLIST_EDIT_ACTION_listda"] == "REMOVE":
            if var["date1"] == None and var["date2"] == None:
                dOp.removeRecord(var["id"])
                var["JLIST_EDIT_ACTIONOK_listda"] = True
                print "REMOVE --------------"
                return

            var["JYESNO_MESSAGE"] = "Do you want to remove this line ?"
            var["JMESSAGE_TITLE"] = "Ask for something"
            var["JAFTERDIALOG_ACTION"] = "removeyesno"

        if action == "afteryesno" and var["JYESANSWER"]:
            var["JLIST_EDIT_ACTIONOK_listda"] = True
            iRec = dOp.construct()
            var["id"] = dOp.addRecord(iRec)
            var["JCOPY_id"] = True

        if action == "afteryesno" and not var["JYESANSWER"]:
            var["JLIST_EDIT_ACTIONOK_listda"] = False

        if action == "removeyesno" and var["JYESANSWER"]:
            var["JLIST_EDIT_ACTIONOK_listda"] = True
            dOp.removeRecord(var["id"])
            print "REMOVE -----------------"

        if action == "removeyesno" and not var["JYESANSWER"]:
            var["JLIST_EDIT_ACTIONOK_listda"] = False

        if action == "aftereditrow":
            d1 = toDate(var["date1"])
            d2 = toDate(var["date2"])
            iRec = dOp.findRecord(var["id"])
            if iRec != None:
                iRec.setDates(d1, d2)
                dOp.changeRecord(iRec)
            var["JEDIT_ROW_OK_listda"] = True
Exemplo n.º 21
0
 def __init__(self) :
   map = {"id" : "long", "firstname" : "string","lastname" : "string", "credit" : "decimal"  }
   RegistryFile.__init__(self,ServiceInjector.getStorageRegistryFactory(),"LIST-ICON-REGISTRY",ServiceInjector.getSequenceGen(),map, "list","id")
Exemplo n.º 22
0
 def __init__(self):
     self.op = ServiceInjector.constructDateOp()
Exemplo n.º 23
0
 def __getV(self, s):
     V = StorageRegistry(ServiceInjector.getStorageRegistryFactory(),
                         "PAYMENT-" + s)
     return V
Exemplo n.º 24
0
def editlistaction(action,var):
  printVar("editlistaction",action,var)
    
  op = ServiceInjector.constructPersonOp()
  dOp = ServiceInjector.constructDateRecordOp()
          
  if action == "clear1action" :
      if not var['JYESANSWER'] : return
      op.clearAll()
      __create_list(op,var)  
      return

  if action == "clear2action" :
      if not var['JYESANSWER'] : return
      dOp.clearAll()
      __create_listda(dOp,var)    
      return         
          
  if action == "before" :
    __create_list(op,var)
    var["JLIST_EDIT_list_pname"] = ""
    var["JLIST_EDIT_list_pnumber"] = ""
#    var["JLIST_EDIT_list_MODE"] = "NORMALMODE" 
#    var["JLIST_EDIT_list_MODE"] = "CHANGEMODE" 
    var["JLIST_EDIT_list_MODE"] = "ADDCHANGEDELETEMODE" 

    __create_listda(dOp,var)
#    var["JLIST_EDIT_listda_date1"] = ""
#    var["JLIST_EDIT_listda_date2"] = ""
#    var["JLIST_EDIT_listda_vals"] = ""
#    var["JLIST_EDIT_listda_MODE"] = "CHANGEMODE" 
#    var["JLIST_EDIT_listda_MODE"] = "NORMALMODE" 
#    var["JLIST_EDIT_listda_MODE"] = "ADDCHANGEDELETEMODE" 
    setAddEditMode(var,"listda",["date1","date2","vals"])
#    cutil.setChangeEditMode(var,"listda",["date1","date2","vals"])
#    cutil.setStandEditMode(var,"listda",["date1","date2","vals"])
    
    
    __create_listb(var)
#    setAddEditMode(var,"listb",["id","name","check"])
    cutil.setChangeEditMode(var,"listb",["id","name","check"])
#    cutil.setStandEditMode(var,"listb",["id","name","check"])
#    setAddEditMode(var,"listb",["id","name","check"])
    
    return

  if action == "vali" :
      return

  if var["JLIST_NAME"] == "list" :
      
    if action == "editlistrowaction"  :
        var["JYESNO_MESSAGE"] = "Are you ready to add new elem ?"
        var["JMESSAGE_TITLE"] = "Ask for something"
        var["JAFTERDIALOG_ACTION"] = "afteryesno"
     
    if action == "afteryesno" and var["JYESANSWER"] :
        var["JLIST_EDIT_ACTIONOK_list"] = True
        var["pname"] = "xxxx"
        var["JCOPY_pname"] = True
        var["pnumber"] = "1"
        var["JCOPY_pnumber"] = True
        
    if action == "columnchangeaction" and var["changefield"] == "pnumber" :
       val = var["pnumber"]
       print "val",val,"!"
       if val == None or val == "" :
         print "==============="    
#        var["JERROR_pnumber"] = "Cannot be empty"


  if var["JLIST_NAME"] == "listb" :      
     var["JLIST_EDIT_ACTIONOK_listb"] = True


  if var["JLIST_NAME"] == "listda" :      
    if action == "afteryesno" and var["JYESANSWER"] :
      var["JLIST_EDIT_ACTIONOK_listda"] = True
    
    if action == "editlistrowaction" and (var["JLIST_EDIT_ACTION_listda"] == "ADDBEFORE" or var["JLIST_EDIT_ACTION_listda"] == "ADD")  :
        var["JYESNO_MESSAGE"] = "Are you ready to add new empty date elem ?"
        var["JMESSAGE_TITLE"] = "Ask for something"
        var["JAFTERDIALOG_ACTION"] = "afteryesno"

    if action == "editlistrowaction" and var["JLIST_EDIT_ACTION_listda"] == "REMOVE" :
        if var["date1"] == None and var["date2"] == None :
            dOp.removeRecord(var["id"])
            var["JLIST_EDIT_ACTIONOK_listda"] = True
            print "REMOVE --------------"
            return
            
        var["JYESNO_MESSAGE"] = "Do you want to remove this line ?"
        var["JMESSAGE_TITLE"] = "Ask for something"
        var["JAFTERDIALOG_ACTION"] = "removeyesno"

    if action == "afteryesno" and var["JYESANSWER"] :
        var["JLIST_EDIT_ACTIONOK_listda"] = True
        iRec = dOp.construct()
        var["id"] = dOp.addRecord(iRec)
        var["JCOPY_id"] = True

    if action == "afteryesno" and not var["JYESANSWER"] :
        var["JLIST_EDIT_ACTIONOK_listda"] = False

    if action == "removeyesno" and var["JYESANSWER"] :
        var["JLIST_EDIT_ACTIONOK_listda"] = True
        dOp.removeRecord(var["id"])
        print "REMOVE -----------------"

    if action == "removeyesno" and not var["JYESANSWER"] :
        var["JLIST_EDIT_ACTIONOK_listda"] = False

    if action == "aftereditrow" :
        d1 = toDate(var["date1"])
        d2 = toDate(var["date2"])
        iRec = dOp.findRecord(var["id"])
        if iRec != None : 
          iRec.setDates(d1,d2)
          dOp.changeRecord(iRec)
        var["JEDIT_ROW_OK_listda"] = True
Exemplo n.º 25
0
 def __init__(self) :
   map = {"id" : cutil.LONG, "number" : cutil.LONG, "dic" : cutil.STRING }
   cutil.RegistryFile.__init__(self,ServiceInjector.getStorageRegistryFactory(),"REGISTRY-CUSTOM-ENUM",ServiceInjector.getSequenceGen(),map, "list","id")
Exemplo n.º 26
0
 def __init__(self) :
   map = {"id" : "long", "xml" : "string" }
   RegistryFile.__init__(self,ServiceInjector.getStorageRegistryFactory(),"LIST-XML-REGISTRY",ServiceInjector.getSequenceGen(),map, "list","id")