
templates.ios.m.vm Maven / Gradle / Ivy
The newest version!
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
##n
${esc.h}import "${className}.h"
##n
/**
* @author Bruno Farache
*/
@implementation $className
##n
#foreach ($action in $actions)
#set ($parameters = $action.parameters)
#objectiveCMethodSignature($action " {")
##t NSMutableDictionary *_params = [NSMutableDictionary dictionaryWithDictionary:@{
#set ($invokeMethod = "invoke")
#foreach ($parameter in $parameters)
#set ($parameterType = $languageUtil.getType($parameter.type))
#if ($parameterType == $LR_UPLOAD_DATA)
#set ($invokeMethod = "upload")
#end
#if ($parameterType != $JSON_OBJECT_WRAPPER)
#set ($parameterName = $parameter.name)
#set ($paramValue = $languageUtil.getParamValue($parameterName, $parameter.type))
#set ($line = "@${esc.q}$parameterName${esc.q}: $paramValue")
#if ($foreach.hasNext)
#set ($line = "$line,")
#end
##t $line
#end
#end
##t }];
##n
#foreach ($parameter in $parameters)
#set ($parameterType = $languageUtil.getType($parameter.type))
#if ($parameterType == $JSON_OBJECT_WRAPPER)
#set ($parameterName = $parameter.name)
##t [self mangleWrapperWithParams:_params name:@${esc.q}$parameterName${esc.q} className:@${esc.q}$parameter.type${esc.q} wrapper:$parameterName];
#if (!$foreach.hasNext)
##n
#end
#end
#end
##t NSDictionary *_command = @{@${esc.q}$action.path${esc.q}: _params};
##n
#if ($returnType == $VOID)
##t [self.session invoke:_command error:error];
#elseif ($returnType == $BOOL)
##t return [self boolValue:(NSNumber *)[self.session invoke:_command error:error]];
#else
##t return ($returnType)[self.session ${invokeMethod}:_command error:error];
#end
}
##n
#end
@end
© 2015 - 2025 Weber Informatics LLC | Privacy Policy