Exemple #1
0
int _ExecuteApp(HttpContextRef context, RouteRef route) {
	
	if (route->_application && !strcmp(route->_application,"AppManager")) {
		RAWLOG_INFO("Executing AppManager");
		return ExecuteAppManager(context,route);
	} else if (route->_application && !strcmp(route->_application,"system")) {
		if (context->_request->_method == METHOD_GET) {
			if (route->_model && !strcmp(route->_model,"geolocation")) {
				return HTTPSendReply(context,GeoGetLocation()); 	
			} else if (route->_model && !strcmp(route->_model,"syncdb")) {
				rho_sync_doSyncAllSources();
				return HTTPSendReply(context,"OK"); 	
			} else if (route->_model && !strcmp(route->_model,"redirect_to")) {
				if (context->_request->_query && !strncmp("url=",context->_request->_query,4)) {
					char* location = context->_request->_query+4;
					int len = strlen(location);
					HTTPUrlDecode(location, len, location, len+1);
					return HTTPRedirect(context, location);
				} else {
					return HTTPRedirect(context, "/app/");
				}
			}
		}
	} else if (route->_application && !strcmp(route->_application,"shared")) {
		return 0;
	} else {
		RAWLOG_INFO1( "Executing %s",route->_application);
		return _CallApplication(context, route);
	}
	return 0;
}
Exemple #2
0
RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_Rhodes_doSyncAllSources
  (JNIEnv *, jobject, jboolean show_status_popup)
{
    rho_sync_doSyncAllSources(show_status_popup);
}