Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  //  HSGear
  //
  //Copyright (c) 2014 HelpStack (http://helpstack.io)
  //
  //Permission is hereby granted, free of charge, to any person obtaining a copy
  //of this software and associated documentation files (the "Software"), to deal
  //in the Software without restriction, including without limitation the rights
  //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  //copies of the Software, and to permit persons to whom the Software is
 //furnished to do so, subject to the following conditions:
 //
 //The above copyright notice and this permission notice shall be included in
 //all copies or substantial portions of the Software.
 //
 //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //THE SOFTWARE.
 
 package ru.appsm.inapphelp.logic;
 
 
 import java.util.Map;
 

Author(s):
Nalin Chhajer
 
 public abstract class IAHGear {
 	
 	public IAHGear() {
 
 	}
 
     public void init () {
 
     }
 
 	public String getRefer () {
 		return "";
 	}

Parameters:
cancelTag
section
queue
success
errorListener
 
 	public void fetchKBArticle(String cancelTagIAHKBItem sectionRequestQueue queue,  OnFetchedArraySuccessListener successErrorListener errorListener )
 	{
 		errorListener.onErrorResponse(new VolleyError("Not implemented method"));
 	}

    

Parameters:
cancelTag
firstName
lastname
emailAddress
userId
userSecret
queue
success
errorListener
 
 	public void registerNewUser(String cancelTagString firstNameString lastnameString emailAddressString userIdString userSecretRequestQueue queueOnFetchedSuccessListener successErrorListener errorListener)
 	{
 		success.onSuccess(IAHUser.createNewUserWithDetails(firstName, lastname, emailAddress, userId, userSecret));
 	}

HSUploadAttachment.getAttachment() can contain mime/Type and filename

Parameters:
user
body
deviceInfo
successListener
errorListener
 
 	public void createNewTicket(String cancelTagString pushTokenIAHUser userString bodyString deviceInfoIAHUploadAttachment[] attachmentsRequestQueue queueOnNewTicketFetchedSuccessListener successListenerErrorListener errorListener ) {
 		errorListener.onErrorResponse(new VolleyError("Not implemented method"));
 	}

    

Parameters:
cancelTag
get_updates_from_time
user
queue
success
errorListener
	public void fetchUpdateOnTicket(String cancelTagLong get_updates_from_timeIAHUser userRequestQueue queueOnFetchedArraySuccessListener successErrorListener errorListener)
	{
		errorListener.onErrorResponse(new VolleyError("Not implemented method"));
	}

Parameters:
message
deviceInfo
user
queue
success
errorListener
	public void addReplyOnATicket(String cancelTagString messageMap[] deviceInfoIAHUploadAttachment[] attachmentsString pushTokenLong get_updates_from_timeIAHUser userRequestQueue queueOnFetchedArraySuccessListener successErrorListener errorListener) {
		errorListener.onErrorResponse(new VolleyError("Not implemented method"));
	}

    
Set this parameter, if gear is not implementing handling of Issues. Doing this, default email client will be open with given support Email Address. Then there is no need to implement issues fetching related methods.

Parameters:
companySupportEmailAddress
	public void setNotImplementingTicketsFetching(String companySupportEmailAddress) {
		implementsTicketFetching = false;
		this.companySupportEmailAddress = companySupportEmailAddress;
	}

    

Returns:
Company support email address set in setNotImplementingTicketsFetching
        return companySupportEmailAddress;
    }
    
Returns if gear have implemented Ticket Fetching. Modify this parameter using setNotImplementingTicketsFetching

Returns:
    public boolean haveImplementedTicketFetching() {
        return implementsTicketFetching;
    }
    
Set this parameter, if gear is not implementing handling of FAQ. Doing this, FAQ will be fetched from article path. Then there is no need to implement issues fetching related methods.

Parameters:
articleResid
	public void setNotImplementingKBFetching (int articleResid) {
		implementsKBFetching = false;
		this.articleResid = articleResid;
	}

    

Returns:
Local article id set in setNotImplementingKBFetching
    public int getLocalArticleResourceId() {
        return articleResid;
    }

    
Returns if gear have implemented KB Fetching. Modify this parameter using setNotImplementingKBFetching

Returns:
    public boolean haveImplementedKBFetching() {
        return implementsKBFetching;
    }

    
If this parameter is set, message written by user in chat screen and new issue screen will be returned in HTML format.

Parameters:
htmlEnabled
	public void uploadMessageAsHtmlString(boolean htmlEnabled) {
		this.supportHtmlMessage = htmlEnabled;
	}

    
returns if gear can upload message as html string.

Returns:
	public boolean canUplaodMessageAsHtmlString() {
		return supportHtmlMessage;
	}


    
Sets maximum number of attachment gears can handle.

Parameters:
numberOfAttachmentGearCanHandle
	public void setNumberOfAttachmentGearCanHandle (int numberOfAttachmentGearCanHandle) {
		this.numberOfAttachmentGearCanHandle = numberOfAttachmentGearCanHandle;
	}

    

Returns:
maximum number of attachment gear can handle.
		return numberOfAttachmentGearCanHandle;
	}


    
if true, gear don't have to return back HSTicketUpdate object, after a reply is been added.

Parameters:
canIgnore
    public void ignoreTicketUpdateInformationAfterAddingReply(boolean canIgnore) {
        this.ignoreTicketUpdateInformationAfterAddingReply = canIgnore;
    }

    

Returns:
if the HSTicketUpdate object, after a reply is added should be used in UI.
        return this.ignoreTicketUpdateInformationAfterAddingReply;
    }
    ////////////////////////////////////////////////////
    /////////////   Private Variables   ///////////////
    ///////////////////////////////////////////////////
	// If this is true, we don't call kb article functions, will open email app is required.
	private boolean implementsTicketFetching = true;
	private boolean implementsKBFetching = true;
	private int articleResid;
	private boolean supportHtmlMessage = false;
    private boolean ignoreTicketUpdateInformationAfterAddingReply = false;
New to GrepCode? Check out our FAQ X