Download file
				
					<?xml version="1.0" encoding="UTF-8" ?>
<project name="Heroes Sample" package="com.example.heroessample" prefix="H" version="1.0">
	<description>Project's sample</description>
	
	<!-- MANQUE CLASS => IMPLEMENTS -->
	<classes subpackage="domains.classes">
	
		<class name="Identifiable" subpackage="common">
			<properties>
				<property name="id" type="int" primary="true" />
			</properties>
		</class>
		
		<class name="Character" subpackage="characters" extends="Identifiable">
			<description>Character model</description>
			<properties>
				<property name="login" type="string" />
				<property name="created_on" type="date" />
				<property name="name" type="string" />
				<property name="gender" type="Gender" />
				<property name="picture" type="URL" />
				<property name="attributes" type="map" parameterType="string;double" />
				<property name="stuffs" type="list" parameterType="Stuff" />
			</properties>
		</class>
		
		<class name="Stuff" subpackage="stuffs" extends="Identifiable">
			<description>Item model</description>
			<properties>
				<property name="name" type="string" />
				<property name="picture" type="URL" />
				<property name="material" type="Material" />
				<property name="attributes" type="map" parameterType="string;double" />
				<property name="active" type="boolean" />
			</properties>
		</class>
        
        <class name="SpecialStuff" subpackage="stuffs" extends="Stuff">
            <description>Special item using conditions</description>
            <properties>
                <property name="description" type="string" />
                <property name="created_on" type="date" />
            </properties>
        </class>
		
		<!-- ******************** -->
		
		<class name="CharacterCreateData" subpackage="data">
			<description>Data model describing character creation</description>
			<properties>
				<property name="login" type="string" />
				<property name="password" type="string" />
				<property name="created_on" type="date" />
				<property name="name" type="string" />
				<property name="gender" type="Gender" />
				<property name="picture" type="blob" />
				<property name="level" type="int" />
				<property name="attributes" type="map" parameterType="string;double" />
				<property name="stuffs" type="list" parameterType="Stuff" />
			</properties>
		</class>
		
		<class name="CharacterEditData" subpackage="data" extends="Identifiable">
			<properties>
				<property name="name" type="string" />
				<property name="picture" type="blob" />
				<property name="stuffs" type="list" parameterType="Stuff" />
			</properties>
		</class>
		
		<class name="CharacterDeleteData" subpackage="data">
			<properties>
                <property name="character_id" type="int" />
            </properties>
		</class>
		
		<!-- ******************** -->
		
		<class name="RangeCriteria" subpackage="criterias">
			<properties>
				<property name="offset" type="int" />
				<property name="limit" type="int" />
			</properties>
		</class>
		
		<class name="CharacterCriteria" subpackage="criterias">
			<properties>
                <property name="character_id" type="int" />
            </properties>
		</class>
		
		<class name="CharactersCriteria" subpackage="criterias" extends="RangeCriteria">
			<description>Search filter for characters</description>
			<properties>
				<property name="name" type="string" />
				<property name="attributes" type="map" parameterType="string;double" />
			</properties>
		</class>
		
		<!-- ******************** -->
		
		<class name="CommonResult" subpackage="results">
			<properties>
				<property name="code" type="ResultCode" />
				<property name="message" type="string" />
			</properties>
		</class>
		
		<class name="CharacterResult" subpackage="results" extends="CommonResult">
            <properties>
                <property name="character" type="Character" />
        	</properties>
        </class>
        
        <class name="CharactersResult" subpackage="results" extends="CommonResult">
        	<description>Filtered list of characters</description>
            <properties>
                <property name="characters" type="list" parameterType="Character" />
        	</properties>
        </class>
		
	</classes>
	
	<enums subpackage="domains.classes">
		
		<enum name="ResultCode" subpackage="common">
			<description>Server's result code</description>
			<values>
				<value name="SUCCESS">
					<description>SUCCESS</description>
				</value>
				<value name="FAILED">
					<description>FAILED</description>
				</value>
			</values>
		</enum>
		
		<enum name="Gender" subpackage="characters">
			<values>
				<value name="MALE" value="1">
					<description>MALE</description>
				</value>
				<value name="FEMALE" value="2">
					<description>FEMALE</description>
				</value>
			</values>
		</enum>
		
		<enum name="Material" subpackage="stuffs">
			<values default="STONE">
				<value name="WOOD">
					<description>WOOD</description>
				</value>
				<value name="STONE">
					<description>STONE</description>
				</value>
				<value name="IRON" value="4">
					<description>IRON</description>
				</value>
				<value name="DIAMOND" value="8">
					<description>DIAMOND</description>
				</value>
				<value name="GOLD">
					<description>GOLD</description>
				</value>
			</values>
		</enum>
		
	</enums>
	
	<webservices interfaceSubpackage="domains.interfaces" implementationSubpackage="platforms.webservices" mockSubpackage="platforms.mocks">
		
		<webservice name="Character" interfaceSubpackage="characters" implementationSubpackage="classes.characters" mockSubpackage="classes.characters" base="HHttpWebService">
		
			<method name="create" timeout="30" type="post">
				<description>Creates a character</description>
				<cache duration="30" unit="second" />
				<urls>
					<url type="prod">http://framework.digipolitan.com/api/v1/character/create.php</url>
					<url type="test">http://192.168.1.35:8080/Digipolitan/Samples/Heroes/character/create.php</url>
					<url type="debug">http://192.168.1.35:8080/Digipolitan/Samples/Heroes/character/create</url>
				</urls>
				<input type="CharacterCreateData" reverseProxy="CharacterReverseProxy">
					<annotations>
						<keys>
							<key name="login" />
						</keys>
					</annotations>
				</input>
				<output format="json" type="CharacterResult" proxy="CharacterResultProxy" />
			</method>
			
			<method name="edit" timeout="30" type="post">
				<description>Edit a character</description>
				<cache duration="60" unit="minute" secure="true" />
				<urls>
					<url type="prod">http://framework.digipolitan.com/api/v1/character/edit.php</url>
					<url type="test">http://192.168.1.35:8080/Digipolitan/Samples/Heroes/character/edit.php</url>
					<url type="debug">http://192.168.1.35:8080/Digipolitan/Samples/Heroes/character/edit</url>
				</urls>
				<input type="CharacterEditData" reverseProxy="CharacterEditReverseProxy" />
				<output format="json" type="CharacterResult" proxy="CharacterResultProxy" />
			</method>
			
			<method name="delete" timeout="30" type="post">	
				<description>Delete a character</description>
				<cache duration="2" unit="day" mode="no_connection" />
				<urls>
					<url type="prod">http://framework.digipolitan.com/api/v1/character/delete.php</url>
					<url type="test">http://192.168.1.35:8080/Digipolitan/Samples/Heroes/character/delete.php</url>
					<url type="debug">http://192.168.1.35:8080/Digipolitan/Samples/Heroes/character/delete</url>
				</urls>
				<input type="CharacterDeleteData" />
				<output format="json" type="CommonResult" proxy="CommonResultProxy" />
			</method>
			
			<method name="get" timeout="30" type="get">
				<description>Retrieve character's data</description>
				<cache duration="2" unit="week" type="light" />
				<urls>
					<url type="prod">http://framework.digipolitan.com/api/v1/character/get.php</url>
					<url type="test">http://192.168.1.35:8080/Digipolitan/Samples/Heroes/character/get.php</url>
					<url type="debug">http://192.168.1.35:8080/Digipolitan/Samples/Heroes/character/get</url>
				</urls>
				<input type="CharacterCriteria" />
				<output format="json" type="CharacterResult" proxy="CharacterResultProxy" />
			</method>
			
			<method name="list" timeout="30" type="get">
				<description>Retrieve characters data by search filter</description>
				<urls>
					<url type="prod">http://framework.digipolitan.com/api/v1/character/list.php</url>
					<url type="test">http://192.168.1.35:8080/Digipolitan/Samples/Heroes/character/list.php</url>
					<url type="debug">http://192.168.1.35:8080/Digipolitan/Samples/Heroes/character/list</url>
				</urls>
				<input type="CharactersCriteria" />
				<output format="json" type="CharactersResult" proxy="CharactersResultProxy">
					<annotations>
						<keys>
							<key name="created_on" />
							<key name="stuffs">
								<keys>
									<key name="material" />
								</keys>
							</key>
						</keys>
					</annotations>
				</output>
			</method>
			
		</webservice>
		
		<!-- MANQUE SUB PROXY => CONDITIONAL PROXY -->
		<proxies subpackage="classes.proxies">
			
			<proxy name="CommonResultProxy" model="CommonResult" subpackage="common">
				<description>Server's result proxy handler</description>
				<transformers>
					<transformer key="code" type="ResultCode" format="ordinal">
						<description>Server's code transformer</description>
					</transformer>
				</transformers>
			</proxy>
			
			<proxy name="CharacterResultProxy" model="CharacterResult" subpackage="characters" extends="CommonResultProxy">
				<transformers>
					<transformer key="result" type="CharacterProxy" />
				</transformers>
				<setters>
	                <setter key="result" target="setCharacter" />
	            </setters>
	            <ignoreKeys values="useless_data;not_used_data" />
			</proxy>
			
			<proxy name="CharacterProxy" model="Character" subpackage="characters">
				<transformers>
					<transformer key="created_on" type="Date" format="yyyy-MM-dd" />
					<transformer key="gender" type="Gender" format="ordinal" />
					<transformer key="picture" type="URL" />
					<transformer key="stuffs" type="StuffConditionalProxy" />
                </transformers>
			</proxy>
			
			<proxy name="StuffProxy" model="Stuff" subpackage="stuffs">
				<transformers>
					<transformer key="picture" type="URL" />
					<transformer key="material" type="Material" format="ordinal" />
	            </transformers>
			</proxy>
            
            <proxy name="SpecialStuffProxy" model="SpecialStuff" subpackage="stuffs" extends="StuffProxy">
                <transformers>
                    <transformer key="created_on" type="Date" format="yyyy-MM-dd" />
                </transformers>
            </proxy>
			
			<proxy name="CharactersResultProxy" model="CharactersResult" subpackage="characters" extends="CommonResultProxy">
				<transformers>
					<transformer key="result" type="CharacterProxy" />
				</transformers>
				<setters>
	                <setter key="result" target="setCharacters" />
	            </setters>
			</proxy>
			
		</proxies>
		
		<reverseProxies subpackage="classes.reverseproxies">
			
			<reverseProxy name="CharacterReverseProxy" subpackage="characters"> 
				<description>Character's reverse proxy</description>
				<transformers>
					<transformer key="password" type="Encrypt" format="AES_128" environmentKey="crypt_key_ws_h">
						<description>Password's transformer</description>
					</transformer>
					<transformer key="created_on" type="Date" format="yyyy-MM-dd" />
					<transformer key="gender" type="Gender" format="ordinal" />
					<transformer key="picture" type="Encode" format="Base64" />
					<transformer key="stuffs" type="StuffReverseProxy" />
				</transformers>
				<keys>
					<key name="login" target="nickname">
						<description>Here we map the property 'login' from Character model with the parameter 'nickname' from the request</description>
					</key>
				</keys>
			</reverseProxy>
			
			<reverseProxy name="CharacterEditReverseProxy" subpackage="characters" extends="CharacterReverseProxy">
				<ignoreFields values="login;password;created_on;gender;level;attributes" />
			</reverseProxy>
			
			<reverseProxy name="StuffReverseProxy" subpackage="stuffs">
				<transformers>
					<transformer key="picture" type="URL" />
					<transformer key="material" type="Material" format="ordinal" />
	            </transformers>
			</reverseProxy>
			
		</reverseProxies>
		
		<conditionalProxies subpackage="classes.conditionalproxies">
            
            <conditionalProxy name="StuffConditionalProxy" subpackage="stuffs" defaultProxy="StuffProxy">
                <conditions>
                    <condition key="description" proxy="SpecialStuffProxy" />
                </conditions>
            </conditionalProxy>
            
        </conditionalProxies>
        
	</webservices>
	
</project>				
			
Download file