com.supermap.onlineservices

Class OnlineService

  • java.lang.Object
    • com.supermap.onlineservices.OnlineService


  • public class OnlineService
    extends java.lang.Object
    The class OnlineService focuses on the login and logout
    • Constructor Detail

      • OnlineService

        public OnlineService(android.content.Context context)
        The constructor.
        Parameters:
        context - The context.
    • Method Detail

      • init

        public static void init(android.content.Context context)
        The constructor.
        Parameters:
        context - The context.
      • getNickName

        public java.lang.String getNickName()
        Returns the nick name

        Gets after logging in successfully

        Returns:
        Returns the nick name
      • getUserName

        public java.lang.String getUserName()
        Returns the username

        Gets after logging in successfully

        Returns:
        Returns the username
      • getAllColorTable

        public static void getAllColorTable(int currentPage,
                                            OnlineCallBack.CallBackString callBackString)
        Gets the color table data Gets data in some page (9 lines of data in each page)
        Parameters:
        currentPage - the current page number
        callBackString - the result callback interface
      • getAllUserSymbolyLibList

        public static void getAllUserSymbolyLibList(int currentPage,
                                                    OnlineCallBack.CallBackString callBackString)
        Gets symbol libraries 9 records of data in each page
        Parameters:
        currentPage - the current page number
        callBackString - the result callback interface
      • getAllUserDataList

        public static void getAllUserDataList(int currentPage,
                                              OnlineCallBack.CallBackString callBackString)
        Gets the user data. All user data is displayed by 9 records in each page
        Parameters:
        currentPage - the current page number
        callBackString - the result callback interface
      • deleteService

        public static void deleteService(java.lang.String dataName,
                                         EnumServiceType serviceType,
                                         OnlineCallBack.CallBackString callBackString)
        Deletes service
        Parameters:
        dataName - the name of data
        serviceType - the service type
        callBackString - the result callback interface
      • deleteData

        public static void deleteData(java.lang.String dataName,
                                      OnlineCallBack.CallBackString callBackString)
        Delete data as names
        Parameters:
        dataName - the name of data to be deleted
        callBackString - the result callback interface
      • retrievePasswordFourth

        public static void retrievePasswordFourth(java.lang.String newPassword,
                                                  OnlineCallBack.CallBackString callBackString)
        The fourth step for resetting your password: modifying your password
        Parameters:
        newPassword - The password to be modified
        callBackString - the result callback interface
      • retrievePasswordThird

        public static void retrievePasswordThird(java.lang.String safeCode,
                                                 OnlineCallBack.CallBackString commonCallBack)
        The third step for resetting your password: entering a security code
        Parameters:
        safeCode - the security code
        commonCallBack - the result callback interface
      • retrievePasswordSecond

        public static void retrievePasswordSecond(OnlineCallBack.CallBackString callBackString)
        The second step for resetting your password: sending a security code
        Parameters:
        callBackString - the result callback interface
      • retrievePassword

        public static void retrievePassword(java.lang.String verifyCode,
                                            java.lang.String accountStr,
                                            boolean isPhoneAccount,
                                            OnlineCallBack.CallBackString commonCallBack)
        The first step for resetting your password: entering the security code in the image and an account
        Parameters:
        verifyCode - the security code in the image
        accountStr - the account
        isPhoneAccount - Whether the account is a phone number
        commonCallBack - the result callback interface
      • verifyCodeImage

        public static void verifyCodeImage(OnlineCallBack.CallBackBitmap callBackBitmap)
        Finds the password and gets a verification picture
        Parameters:
        callBackBitmap - the online bit map result callback interface
      • getServiceList

        public static void getServiceList(int currentPage,
                                          int pageSize,
                                          OnlineCallBack.CallBackString commonDataCallBack)
        Gets the service list All services are sorted in descending order by time
        Parameters:
        currentPage - the current page number
        pageSize - the number of lines in the current page
        commonCallBack - the online string result callback interface
      • changeServiceVisiblity

        public static void changeServiceVisiblity(java.lang.String id,
                                                  boolean isPublic,
                                                  OnlineCallBack.CallBackString callBackString)
        Sets the status of service to public or private
        Parameters:
        id - id in the service list
        isPublic - whether it is public
        callBackString - the result callback interface
      • changeDataVisiblity

        public static void changeDataVisiblity(java.lang.String id,
                                               boolean isPublic,
                                               OnlineCallBack.CallBackString callBackString)
        Modifies my data status
        Parameters:
        id - File id
        isPublic - whether it is public
        callBackString - the result callback interface
      • publishService

        public static void publishService(java.lang.String dataName,
                                          EnumServiceType serviceType,
                                          OnlineCallBack.CallBackString callBackString)
        Publishes service
        Parameters:
        dataName - the name of data to be published
        serviceType - the service types to be published
        callBackString - the result callback interface
      • getDataList

        public static void getDataList(int currentPage,
                                       int pageSize,
                                       OnlineCallBack.CallBackString callBackString)
        Gets my data
        Parameters:
        currentPage - the current page number
        pageSize - the number of lines in the current page
        callBackString - callback
      • registerWithEmail

        public static void registerWithEmail(java.lang.String email,
                                             java.lang.String nikeName,
                                             java.lang.String password,
                                             OnlineCallBack.CallBackString callBackString)
        E-mail registration
        Parameters:
        email - Email accounts
        nikeName - the nickname
        password - the password
        callBackString - the result callback interface
      • registerWithPhone

        public static void registerWithPhone(java.lang.String phoneNumber,
                                             java.lang.String nikename,
                                             java.lang.String SMSVerifyCode,
                                             java.lang.String password,
                                             OnlineCallBack.CallBackString callBackString)
        Registers with a phone number
        Parameters:
        phoneNumber - the phone number
        nikename - the nickname
        SMSVerifyCode - cell phone verification code
        password - the password
        callBackString - callback
      • sendSMSVerifyCodeWithPhoneNumber

        public static void sendSMSVerifyCodeWithPhoneNumber(java.lang.String phoneNumber,
                                                            OnlineCallBack.CallBackString CallBackString)
        Gets a cell phone verification code
        Parameters:
        phoneNumber - the phone number
        CallBackString - the result callback interface
      • login

        public static void login(java.lang.String userName,
                                 java.lang.String userPassword,
                                 OnlineService.LoginCallback callback)
        For logging in online with an e-mail or a nickname
        Parameters:
        userName - Username/Email
        userPassword - Password
        callback - the login callback
      • loginByPhoneNumber

        public static void loginByPhoneNumber(java.lang.String phoneNumber,
                                              java.lang.String userPassword,
                                              OnlineService.LoginCallback callback)
        For logging in online with a phone number
        Parameters:
        phoneNumber - the user phone number
        userPassword - Password
        callback - the login callback
      • logout

        public static void logout(OnlineCallBack.CallBackString callBackString)
        For logout online
        Parameters:
        callBackString - the result callback interface
      • downloadFile

        public static void downloadFile(android.content.Context mContext,
                                        java.lang.String filename,
                                        java.lang.String filePath)
        Downloads files
        Parameters:
        mContext - The context.
        filename - the name of the file
        filePath - the absolute path of the file
      • downloadFile

        public static void downloadFile(android.content.Context mContext,
                                        java.lang.String filename,
                                        java.lang.String filePath,
                                        DownloadFile.DownLoadListener downloadListener)
        Downloads files
        Parameters:
        mContext - The context.
        filename - the name of the file
        filePath - the absolute path of the file
        downloadListener - the download callback
      • downloadResourceFileById

        public static void downloadResourceFileById(android.content.Context context,
                                                    java.lang.String fileId,
                                                    java.lang.String filePath,
                                                    DownloadResourceFile.DownloadListener downloadListener)
        Downloads files public in the data resource or sharing in a group.
        Parameters:
        context -
        fileId - file id
        filePath - the absolute path of the file
        downloadListener - the download callback
      • uploadFile

        public static void uploadFile(java.lang.String filename,
                                      java.lang.String filePath)
        Uploads files
        Parameters:
        filename - the name of the file
        filePath - The absolute path of a file in a phone
      • uploadFile

        public static void uploadFile(java.lang.String filename,
                                      java.lang.String filePath,
                                      UpLoadFile.UpLoadListener UpLoadListener)
        Uploads files
        Parameters:
        filename - the name of the file
        filePath - The absolute path of a file in a phone
        UpLoadListener - the upload callback
      • uploadFile

        public static void uploadFile(java.lang.String fileName,
                                      java.lang.String filePath,
                                      java.lang.String tags,
                                      java.lang.String description,
                                      DataType dataType,
                                      UpLoadFile.UpLoadListener UpLoadListener)
        Uploads files
        Parameters:
        fileName - the name of the file
        filePath - The absolute path of a file in a phone
        tags - tags
        dataType - the type of the file to be uploaded
        UpLoadListener - the upload callback
      • getDefaultJsessionidCookie

        public static java.lang.String getDefaultJsessionidCookie()
        Gets JsessionidCookie
        Returns:
        Gets JsessionidCookie
      • deleteServiceByName

        public static void deleteServiceByName(java.lang.String serviceName,
                                               OnlineCallBack.CallBackString callBackString)
        Deletes a service by its name
        Parameters:
        serviceName - service name.
        callBackString - callback
      • deleteServiceById

        public static void deleteServiceById(java.lang.String id,
                                             OnlineCallBack.CallBackString callBackString)
        Deletes a service by its id
        Parameters:
        id - The id of the service to be deleted
        callBackString - callback
      • verifyOldPassword

        public static void verifyOldPassword(java.lang.String oldPassword,
                                             OnlineCallBack.CallBackString callBackString)
        Verifies a password
        Parameters:
        oldPassword - The old password
        callBackString - the result callback
      • modifyPassword

        public static void modifyPassword(java.lang.String oldPassword,
                                          java.lang.String newPassword,
                                          OnlineCallBack.CallBackString callBackString)
        Modifies a password
        Parameters:
        oldPassword - The old password
        newPassword - The password to be modified
        callBackString - the result callback
      • modifyNickname

        public static void modifyNickname(java.lang.String newNickname,
                                          OnlineCallBack.CallBackString callBackString)
        Modifies a nickname
        Parameters:
        newNickname - the nickname to be modified
        callBackString - the result callback
      • sendVerficationCode

        public static void sendVerficationCode(java.lang.String phoneNumber,
                                               OnlineCallBack.CallBackString callBackString)
        Sends a verification code when binding a phone number
        Parameters:
        phoneNumber - the phone number
        callBackString - the result callback
      • bindPhoneNumber

        public static void bindPhoneNumber(java.lang.String phoneNumber,
                                           java.lang.String verifyCode,
                                           OnlineCallBack.CallBackString callBackString)
        Binds a phone number
        Parameters:
        phoneNumber - the phone number
        verifyCode - the verification code
        callBackString - the result callback
      • bindEmail

        public static void bindEmail(java.lang.String email,
                                     OnlineCallBack.CallBackString callBackString)
        Binds an email address
        Parameters:
        email - the email address to be bound
        callBackString - the callback after binding an email adress
      • validateEmail

        public static void validateEmail(java.lang.String email,
                                         OnlineCallBack.CallBackString callBackString)
        Verifies the bound email
        Parameters:
        email - the email address
        callBackString - callback
      • validatePhoneNumber

        public static void validatePhoneNumber(java.lang.String phoneNumber,
                                               OnlineCallBack.CallBackString callBackString)
        Verifies the bound phone number
        Parameters:
        phoneNumber - the phone number
        callBackString - the result callback
      • getAccountInfoByType

        public static void getAccountInfoByType(java.lang.String name,
                                                AccountInfoType type,
                                                OnlineService.AccountInfoByTypeCallback accountInfoByTypeCallback)
        Gets id of a user by its nickname
        Parameters:
        name - nickname
        type - 0: nickname 1: phone number 2: emal address
        accountInfoByTypeCallback - the result callback
      • getGroupsInfo

        public static void getGroupsInfo(int currentPage,
                                         int pageSize,
                                         GroupOrderBy groupOrderBy,
                                         java.lang.String keywords,
                                         JoinTypes[] joinTypes,
                                         OrderType odrerType,
                                         OnlineCallBack.CallBackString callBackString)
        Gets the group list that the current user has permissions to check. To get a specified group list, use the key words of groups. Search according to group types joinTypes including CREATE (you created), JOINED (you have joined), CANJOIN (you can join)
        Parameters:
        currentPage - The current page number
        pageSize - The number of items in the current page
        groupOrderBy - What is the order type
        odrerType - Ordering types. Ascending (ASC) or descending (DESC)
        keywords - Keyword query (if you don't need it, set it to null)
        joinTypes - The group type
        callBackString - Callback
      • getMyGroupsInfo

        public static void getMyGroupsInfo(int currentPage,
                                           int pageSize,
                                           GroupOrderBy groupOrderBy,
                                           java.lang.String keywords,
                                           OrderType orderType,
                                           OnlineCallBack.CallBackString callBackString)
        Gets the groups that the current user created
        Parameters:
        currentPage - The current page number
        pageSize - The number of items in the current page
        groupOrderBy - What is the order type
        orderType - Ordering types. Ascending (ASC) or descending (DESC)
        keywords - keyword (null is acceptable)
        callBackString - Callback
      • createGroup

        public static void createGroup(java.lang.String groupName,
                                       java.lang.String tags,
                                       boolean isPublic,
                                       java.lang.String description,
                                       GroupRole groupRole,
                                       boolean isNeedCheck,
                                       OnlineCallBack.CallBackString callBackString)
        Create a group
        Parameters:
        groupName - The group name
        tags - Group tags
        isPublic - Whether to public
        description - The group description information
        groupRole - the resource sharer of group
        isNeedCheck - Whether to verify the user who applies to join a group
        callBackString - Callback
      • deleteGroup

        public static void deleteGroup(java.util.List<java.lang.String> groupsIds,
                                       GroupDeleteListener groupDeleteListener)
        Deletes groups in bulk
        Parameters:
        groupsIds - Group Id collection
        groupDeleteListener - Callback
      • shareDataToGroup

        public static void shareDataToGroup(java.util.List<java.lang.String> dataIds,
                                            java.lang.String groupId,
                                            OnlineCallBack.CallBackString callBackString)
        Shares private data to groups in bulk using data ID
        Parameters:
        dataIds - File Id collection
        groupId - Group Id
      • getGroupInfo

        public static void getGroupInfo(java.lang.String groupId,
                                        OnlineCallBack.CallBackString callBackString)
        Checks resource information of a group
        Parameters:
        groupId - Group Id
        callBackString - Callback
      • getGroupResources

        public static void getGroupResources(java.lang.String groupId,
                                             int currentPage,
                                             int pageSize,
                                             java.lang.String keywords,
                                             ResourceOrderBy resourceOrderBy,
                                             OrderType orderType,
                                             java.lang.String resourceCreator,
                                             OnlineCallBack.CallBackString callBackString)
        Check data resource of a group Once members of a group get data ID, they can download data directly
        Parameters:
        currentPage - The current page number
        pageSize - The number of items in the current page
        keywords - Key words
        resourceOrderBy - What is the order type
        orderType - Ordering types. Ascending (ASC) or descending (DESC)
        resourceCreator - The creator who created the resource
        callBackString - Callback
      • inviteUsersToGroup

        public static void inviteUsersToGroup(java.lang.String groupId,
                                              java.lang.String inviteReason,
                                              java.util.List<java.lang.String> inviteNames,
                                              OnlineCallBack.CallBackString callBackString)
        Invites users to join a specified group in bulk. Only the owner of the group has the permission.
        Parameters:
        groupId - The target group id
        inviteReason - The reason why you want to invite a member
        inviteNames - The nickname of the user who you want to invite
        callBackString - Callback
      • applyToGroups

        public static void applyToGroups(java.util.List<java.lang.String> groupIds,
                                         java.lang.String applyReason,
                                         java.lang.String applicant,
                                         OnlineCallBack.CallBackString callBackString)
        User applies for adding a group. If join a group does not need to verify, user can join it directly. Otherwise, user can join a group until the creator agrees The name of applicant must be the same as the current user
        Parameters:
        groupIds - The target group id
        applyReason - The reason why you want to join the group
        applicant - The nickname of the user who applies to join the group
        callBackString - Callback
      • checkGroupApply

        public static void checkGroupApply(java.lang.String groupId,
                                           java.util.List<java.lang.Integer> applyIds,
                                           boolean isAccepted,
                                           OnlineCallBack.CallBackString callBackString)
        Checks all applications of the group in bulk. Supports auditing the specific application according to its id
        Parameters:
        groupId - Group ID
        applyIds - Application ID
        isAccepted - Accept or not?
      • getGroupApply

        public static void getGroupApply(java.lang.String groupId,
                                         int currentPage,
                                         int pageSize,
                                         GroupCheckStatus groupCheckStatus,
                                         OrderType orderType,
                                         OnlineCallBack.CallBackString callBackString)
        Gets the application list information of the current group. Including application information, passed application information, and privileged audit.
        Parameters:
        groupId - Group ID
        currentPage - The current page number
        pageSize - The number of items in the current page
        orderType - Ordering types. Ascending (ASC) or descending (DESC)
        groupCheckStatus - The checking status
        callBackString - Callback
      • getMyInvatation

        public static void getMyInvatation(int currentPage,
                                           int pageSize,
                                           InviteFeedbackStatus feedbackStatus,
                                           OrderType orderType,
                                           InviteOrderby inviteOrderby,
                                           GroupInviteRole groupInviteRole,
                                           OnlineCallBack.CallBackString callBackString)
        Gets the invitation list information related to the current user. If the parameter is not set, returns all invitation list information related to the current user.
        Parameters:
        currentPage -
        pageSize -
        feedbackStatus -
        orderType -
        inviteOrderby -
        groupInviteRole -
        callBackString -
      • processMyInvatation

        public static void processMyInvatation(java.util.List<java.lang.Integer> inviteIds,
                                               InviteFeedbackStatus feedbackStatus,
                                               java.lang.String feedbackInfo,
                                               OnlineCallBack.CallBackString callBackString)
        Accepts or refuses the invitation (updating invitation status of multiple groups)
        Parameters:
        inviteIds - Invitation ID
        feedbackStatus - Feedback status (ACCEPTED or REFUSED).
        feedbackInfo - Feedback information.
        callBackString -
      • deleteGroupMembers

        public static void deleteGroupMembers(java.util.List<java.lang.String> userIds,
                                              java.lang.String groupId,
                                              GroupDeleteListener groupDeleteListener)
        Deletes members from groups in bulk
        Parameters:
        userIds - User ID collection
        groupDeleteListener - Callback
      • getDataInfo

        public static void getDataInfo(java.lang.String dataId,
                                       OnlineCallBack.CallBackString callBackString)
        Searches basic information of data according to ID
        Parameters:
        dataId - The current page number
        callBackString -
      • setHostnameVerifier

        public void setHostnameVerifier(X509HostnameVerifier hostnameVerifier)
        Set the host name validator

        Used to verify host names when accessing https addresses

        Parameters:
        hostnameVerifier - hostnameVerifier Host name validator