# coding: utf-8

from ru.curs.showcase.core.jython import JythonProc
from ru.curs.showcase.core.jython import JythonDTO
#from ru.curs.showcase.util.xml import XMLUtils
#from org.xml.sax.helpers import DefaultHandler
#from ru.curs.showcase.util import TextUtils

# init vars
main = ""
add = ""
session = ""
filterContext = ""
elementId = ""


class simple_reg_data(JythonProc):
    def getRawData(self, context, elId):
        global main, add, session, filterContext, elementId
        main = context.getMain()
        if context.getAdditional():
            add = context.getAdditional()
        session = context.getSession()
        if context.getFilter():
            filterContext = context.getFilter()
        elementId = elId
        return mainproc()


def mainproc():
    data = u'''<schema xmlns="">
                    <data name="" surname="" patronymic="" birthdate="" sex="" diplomanum="" diplomaser="" vuz="">
                    </data>
                </schema>'''
    settings = u'''<properties>
                        <event name="single_click" linkId="1">
                            <action >
                                <main_context>current</main_context>
                                <datapanel type="current" tab="current">
                                    <element id="link_webtext">
                                        <add_context></add_context>
                                    </element>
                                </datapanel>
                            </action>
                       </event>
                    </properties>'''
    return JythonDTO(data, settings)

if __name__ == "__main__":
    mainproc()
