void TestUploadService::removeAllFiles(Ref *sender) { //App42API::setIsTraceEnabled(true); UploadService *uploadService = App42API::BuildUploadService(); uploadService->RemoveAllFiles(app42callback(TestUploadService::onUploadRequestCompleted, this)); }
void TestGeoService::getAllStorageByPaging(Ref* pSender) { GeoService *geoService = App42API::BuildGeoService(); int max = 5; int offset = 0; geoService->GetAllStorageByPaging(max, offset, app42callback(TestGeoService::onGeoRequestCompleted, this)); }
void TestUploadService::getFilesByType(Ref *sender) { //App42API::setIsTraceEnabled(true); UploadService *uploadService = App42API::BuildUploadService(); FileType fileType = IMAGE; uploadService->GetFilesByType(fileType,app42callback(TestUploadService::onUploadRequestCompleted, this)); }
void TestUploadService::removeAllFilesByUser(Ref *sender) { //App42API::setIsTraceEnabled(true); UploadService *uploadService = App42API::BuildUploadService(); const char* userName = "******"; uploadService->RemoveAllFilesByUser(userName,app42callback(TestUploadService::onUploadRequestCompleted, this)); }
void TestUploadService::getAllFilesByPaging(Ref *sender) { //App42API::setIsTraceEnabled(true); UploadService *uploadService = App42API::BuildUploadService(); int max = 2; int offset = 0; uploadService->GetAllFiles(max, offset,app42callback(TestUploadService::onUploadRequestCompleted, this)); }
void TestGeoService::getAllPointsByPaging(Ref* pSender) { GeoService *geoService = App42API::BuildGeoService(); const char* geoStorageName = "geolist"; int max = 5; int offset = 0; geoService->GetAllPointsByPaging(geoStorageName, max, offset, app42callback(TestGeoService::onGeoRequestCompleted, this)); }
void TestEmailService::removeConfiguration(Ref *sender) { //App42API::setIsTraceEnabled(true); EmailService *emailService = App42API::BuildEmailService(); string emailId = "*****@*****.**"; emailService->removeEmailConfiguration(emailId.c_str(),app42callback(TestEmailService::onEmailRequestCompleted, this)); }
void TestUploadService::removeFileByName(Ref *sender) { //App42API::setIsTraceEnabled(true); UploadService *uploadService = App42API::BuildUploadService(); const char* fileName = "BackButton11.png"; uploadService->RemoveFileByName(fileName,app42callback(TestUploadService::onUploadRequestCompleted, this)); }
void TestUploadService::getFileByUser(Ref *sender) { //App42API::setIsTraceEnabled(true); UploadService *uploadService = App42API::BuildUploadService(); const char* fileName = "BackButton"; const char* userName = "******"; uploadService->GetFileByUser(fileName, userName,app42callback(TestUploadService::onUploadRequestCompleted, this)); }
void TestGeoService::getNearByPointsByMaxDistance(Ref* pSender) { GeoService *geoService = App42API::BuildGeoService(); const char* geoStorageName = "geolist"; double lat = -73.99171; double lng = 40.738868; double distanceInKM = 2; geoService->GetNearByPointsByMaxDistance(geoStorageName, lat, lng, distanceInKM, app42callback(TestGeoService::onGeoRequestCompleted, this)); }
void TestSessionService::getSessionWithCreateFlag(Ref* sender) { static bool isCreate = true; SessionService *sessionService = App42API::BuildSessionService(); const char* userName = "******"; isCreate = !isCreate; sessionService->GetSession(userName, isCreate, app42callback(TestSessionService::onSessionServiceRequestCompleted, this)); }
void TestGeoService::getNearByPoint(Ref* pSender) { GeoService *geoService = App42API::BuildGeoService(); const char* geoStorageName = "geolist"; double lat = -73.99171; double lng = 40.738868; int resultLimit = 2; geoService->GetNearByPoint(geoStorageName, lat, lng, resultLimit, app42callback(TestGeoService::onGeoRequestCompleted, this)); }
void TestGeoService::deleteGeoPoints(Ref* pSender) { GeoService *geoService = App42API::BuildGeoService(); const char* geoStorageName = "<Your_storage_name>"; vector<App42GeoPoint> geoPointsList; App42GeoPoint geoPoint; geoPoint.latitude = -73.99171; geoPoint.longitude = 40.738868; geoPoint.markerName = "Maplewood, NJ"; geoPointsList.push_back(geoPoint); geoService->DeleteGeoPoints(geoStorageName, geoPointsList, app42callback(TestGeoService::onGeoRequestCompleted, this)); }
void TestGeoService::createGeoPoints(Ref* pSender) { GeoService *geoService = App42API::BuildGeoService(); const char* geoStorageName = "geolist"; vector<App42GeoPoint> geoPointsList; App42GeoPoint geoPoint; geoPoint.latitude = -74.26213; geoPoint.longitude = 40.77313; geoPoint.markerName = "New Delhi"; geoPointsList.push_back(geoPoint); geoService->CreateGeoPoints(geoStorageName, geoPointsList,app42callback(TestGeoService::onGeoRequestCompleted, this)); }
void TestUploadService::uploadFile(Ref *sender) { UploadService *uploadService = App42API::BuildUploadService(); uploadService->setAdminKey(APP_ADMIN_KEY); string filePath = FileUtils::getInstance()->fullPathForFilename("BackButton.png"); //App42API::setLoggedInUser("Nick"); const char* fileName = "BackButton11";//"<Your_file_name>"; //const char* filePath = "Your Local File Path"; const char* description = "File Description"; FileType fileType = IMAGE; uploadService->UploadFile(fileName, filePath.c_str(), fileType, description, app42callback(TestUploadService::onUploadRequestCompleted, this)); }
void TestUploadService::grantAccess(Ref* sender) { UploadService *uploadService = App42API::BuildUploadService(); const char* fileName = "BackButton1112"; const char* userName = "******"; App42API::setUserSessionId("1fd666f7-03d1-4553-bed6-a3a9575a7e16"); vector<App42ACL>App42ACLList; App42ACL *App42ACL1 = new App42ACL("Rajeev",R); App42ACLList.push_back(*App42ACL1); uploadService->GrantAccess(fileName, userName, App42ACLList, app42callback(TestUploadService::onUploadRequestCompleted, this)); }
void TestEmailService::sendMail(Ref *sender) { //App42API::setIsTraceEnabled(true); EmailService *emailService = App42API::BuildEmailService(); string sendTo = "*****@*****.**"; string senderEmailId = "*****@*****.**"; string sendSubject = "Feedback"; string sendMsg = "Your message"; EmailMIME emailMime = PLAIN_TEXT_MIME_TYPE; emailService->sendMail(sendTo.c_str(), sendSubject.c_str(), sendMsg.c_str(),senderEmailId.c_str(),emailMime,app42callback(TestEmailService::onEmailRequestCompleted, this)); }
void TestEmailService::getConfiguration(Ref *sender) { //App42API::setIsTraceEnabled(true); EmailService *emailService = App42API::BuildEmailService(); emailService->getEmailConfigurations(app42callback(TestEmailService::onEmailRequestCompleted, this)); }
void TestGeoService::getAllStorage(Ref* pSender) { GeoService *geoService = App42API::BuildGeoService(); geoService->GetAllStorage(app42callback(TestGeoService::onGeoRequestCompleted, this)); }
void TestEmailService::configureEmail(Ref *sender) { EmailService *emailService = App42API::BuildEmailService(); string emailHost = "smtp.gmail.com"; int emailPort = 465; string emailId = "*****@*****.**"; string password = "******"; bool isSSL = true; emailService->createMailConfiguration(emailHost.c_str(), emailPort, emailId.c_str(), password.c_str(), isSSL, app42callback(TestEmailService::onEmailRequestCompleted, this)); }
void TestSessionService::removeAllAttributes(Ref* sender) { SessionService *sessionService = App42API::BuildSessionService(); sessionService->RemoveAllAttributes(sessionId.c_str(), app42callback(TestSessionService::onSessionServiceRequestCompleted, this)); }
void TestSessionService::getAttribute(Ref* sender) { SessionService *sessionService = App42API::BuildSessionService(); sessionService->GetAttribute(sessionId.c_str(), attributeName, app42callback(TestSessionService::onSessionServiceRequestCompleted, this)); }
void TestSessionService::invalidate(Ref* sender) { SessionService *sessionService = App42API::BuildSessionService(); sessionService->Invalidate(sessionId.c_str(), app42callback(TestSessionService::onSessionServiceRequestCompleted, this)); }
void TestGeoService::getAllPoints(Ref* pSender) { GeoService *geoService = App42API::BuildGeoService(); const char* geoStorageName = "geolist"; geoService->GetAllPoints(geoStorageName, app42callback(TestGeoService::onGeoRequestCompleted, this)); }
void TestSessionService::getSession(Ref* sender) { SessionService *sessionService = App42API::BuildSessionService(); const char* userName = "******"; sessionService->GetSession(userName, app42callback(TestSessionService::onSessionServiceRequestCompleted, this)); }
void TestTimerService::createOrUpdateTimer(Ref *sender) { TimerService *timerService = App42API::BuildTimerService(); timerService->CreateOrUpdateTimer(timerName,5,app42callback(TestTimerService::onTimerServiceRequestCompleted, this)); }
void TestTimerService::startTimer(Ref *sender) { TimerService *timerService = App42API::BuildTimerService(); timerService->StartTimer(timerName,userName,app42callback(TestTimerService::onTimerServiceRequestCompleted, this)); }
void TestUploadService::uploadFileDataForUser(Ref *sender) { //App42API::setIsTraceEnabled(true); UploadService *uploadService = App42API::BuildUploadService(); const char* fileName = "BackButton"; const char* userName = "******"; string filePath = FileUtils::getInstance()->fullPathForFilename("BackButton.png"); FileType fileType = IMAGE; const char* description = "Image file"; unsigned char* imageData = copy_file(filePath.c_str()); printf("dataBytes=%s..size=%zd",imageData,imageDataLength); uploadService->UploadFileForUser(fileName,userName, imageData,imageDataLength, fileType, description, app42callback(TestUploadService::onUploadRequestCompleted, this)); }
void TestUploadService::uploadFileForUser(Ref *sender) { //App42API::setIsTraceEnabled(true); UploadService *uploadService = App42API::BuildUploadService(); //uploadService->setAdminKey(APP_ADMIN_KEY); const char* fileName = "BackButton1112"; const char* userName = "******"; App42API::setUserSessionId("1fd666f7-03d1-4553-bed6-a3a9575a7e16"); string filePath = FileUtils::getInstance()->fullPathForFilename("BackButton.png"); FileType fileType = IMAGE; const char* description = "Image file"; printf("\nfilePath=%s\n",filePath.c_str()); uploadService->UploadFileForUser(fileName,userName, filePath.c_str(), fileType, description, app42callback(TestUploadService::onUploadRequestCompleted, this)); }
void TestUploadService::uploadFileData(Ref *sender) { //App42API::setIsTraceEnabled(true); UploadService *uploadService = App42API::BuildUploadService(); const char* fileName = "upload"; string filePath = FileUtils::getInstance()->fullPathForFilename("upload.json"); FileType fileType = JSON; const char* description = "File Description"; unsigned char* imageData = copy_file(filePath.c_str()); uploadService->UploadFile(fileName, imageData,(int)imageDataLength, fileType, description, app42callback(TestUploadService::onUploadRequestCompleted, this)); }