# Path: webui/server/tornadows/complextypes.py
# class Property:
# class IntegerProperty(Property):
# class DecimalProperty(Property):
# class DoubleProperty(Property):
# class FloatProperty(Property):
# class DurationProperty(Property):
# class DateProperty(Property):
# class TimeProperty(Property):
# class DateTimeProperty(Property):
# class StringProperty(Property):
# class BooleanProperty(Property):
# class ArrayProperty(list):
# class ComplexType(object):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self, object, minOccurs = 1, maxOccurs=None, data=[]):
# 	def toXSD(self,namespace='xsd',nameelement=None):
# 	def __init__(self):
# 	def toXML(self,name=None,method=''):
# 	def toXSD(cls,xmlns='http://www.w3.org/2001/XMLSchema',namespace='xsd',method='', ltype=[]):
# 	def _generateXSD(cls,xmlns='http://www.w3.org/2001/XMLSchema',namespace='xsd', ltype=[]):
# 	def getName(cls):
# 	def _createAttributeType(self,element):
# def xml2object(xml,xsd,complex,method=''):
# def cls2dict(complex):
# def xsd2dict(xsd,namespace='xsd'):
# def xml2list(xmldoc,name,types,method=''):
# def generateOBJ(d,namecls,types):
# def createProperty(typ,value):
# def genattr(elems):
# def findElementFromDict(dictionary,key):
# def convert(typeelement,value):
# def createPythonType2XMLType(pyType):


import inspect
from webui.server.tornadows import complextypes
	    @webservices(_params=xmltypes.Array(xmltypes.Integer),_returns=xmltypes.Integer)
	    def function(sefl, list_of_elements):
		for e in list_of_elements:
		# Do something with the element    
        	return len(list_of_elements)

	    xmltypes.Array(xmltype.Integer) generate an xml element into schema definition:
		<xsd:element name="arrayOfElement" type="xsd:integer" maxOccurs="unbounded"/>

	    this make the parameter of the function list_of_elements is a python list.

	    if you specify xmltypes.Array(xmltypes.Integer,10), is generated:
		<xsd:element name="arrayOfElement" type="xsd:integer" maxOccurs="10"/>
	"""
	def __init__(self,type,maxOccurs=None):
		self._type = type
		self._n    = maxOccurs

	def createArray(self,name):
		type = None
		if inspect.isclass(self._type) and not issubclass(self._type,PrimitiveType):
			type = complextypes.createPythonType2XMLType(self._type.__name__)
		else:
			type = self._type.getType(self._type)
		return createArrayXML(name,type,'xsd',self._n)

	def createType(self,name):
		prefix = 'xsd'
		type = None
		if inspect.isclass(self._type) and not issubclass(self._type,PrimitiveType):

# Path: webui/server/tornadows/complextypes.py
# class Property:
# class IntegerProperty(Property):
# class DecimalProperty(Property):
# class DoubleProperty(Property):
# class FloatProperty(Property):
# class DurationProperty(Property):
# class DateProperty(Property):
# class TimeProperty(Property):
# class DateTimeProperty(Property):
# class StringProperty(Property):
# class BooleanProperty(Property):
# class ArrayProperty(list):
# class ComplexType(object):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self):
# 	def __init__(self, object, minOccurs = 1, maxOccurs=None, data=[]):
# 	def toXSD(self,namespace='xsd',nameelement=None):
# 	def __init__(self):
# 	def toXML(self,name=None,method=''):
# 	def toXSD(cls,xmlns='http://www.w3.org/2001/XMLSchema',namespace='xsd',method='', ltype=[]):
# 	def _generateXSD(cls,xmlns='http://www.w3.org/2001/XMLSchema',namespace='xsd', ltype=[]):
# 	def getName(cls):
# 	def _createAttributeType(self,element):
# def xml2object(xml,xsd,complex,method=''):
# def cls2dict(complex):
# def xsd2dict(xsd,namespace='xsd'):
# def xml2list(xmldoc,name,types,method=''):
# def generateOBJ(d,namecls,types):
# def createProperty(typ,value):
# def genattr(elems):
# def findElementFromDict(dictionary,key):
# def convert(typeelement,value):
# def createPythonType2XMLType(pyType):


# Path: webui/server/tornadows/xmltypes.py
import inspect
from webui.server.tornadows import complextypes

	    @webservices(_params=xmltypes.Array(xmltypes.Integer),_returns=xmltypes.Integer)
	    def function(sefl, list_of_elements):
		for e in list_of_elements:
		# Do something with the element    
        	return len(list_of_elements)

	    xmltypes.Array(xmltype.Integer) generate an xml element into schema definition:
		<xsd:element name="arrayOfElement" type="xsd:integer" maxOccurs="unbounded"/>

	    this make the parameter of the function list_of_elements is a python list.

	    if you specify xmltypes.Array(xmltypes.Integer,10), is generated:
		<xsd:element name="arrayOfElement" type="xsd:integer" maxOccurs="10"/>
	"""
	def __init__(self,type,maxOccurs=None):
		self._type = type
		self._n    = maxOccurs

	def createArray(self,name):
		type = None
		if inspect.isclass(self._type) and not issubclass(self._type,PrimitiveType):
			type = complextypes.createPythonType2XMLType(self._type.__name__)
		else:
			type = self._type.getType(self._type)
		return createArrayXML(name,type,'xsd',self._n)

	def createType(self,name):
		prefix = 'xsd'
		type = None
		if inspect.isclass(self._type) and not issubclass(self._type,PrimitiveType):

			type = complextypes.createPythonType2XMLType(self._type.__name__)