Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions src/main/java/com/intuit/quickbase/api/QuickBaseConnection.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
public class QuickBaseConnection
{
private final static NameValuePair[] NO_PARAMETERS = {};
private final static String HTTPS_QB_MAIN = "https://www.quickbase.com/db/main?"; //$NON-NLS-1$
private final static String HTTPS_QB = "https://www.quickbase.com/db/"; //$NON-NLS-1$
private static String HTTPS_QB_MAIN = "https://www.quickbase.com/db/main?"; //$NON-NLS-1$
private static String HTTPS_QB = "https://www.quickbase.com/db/"; //$NON-NLS-1$
private final static String USERNAME = "username"; //$NON-NLS-1$
private final static String PASSWORD = "password"; //$NON-NLS-1$
private final static String DBNAME = "dbname"; //$NON-NLS-1$
Expand All @@ -61,8 +61,9 @@ public class QuickBaseConnection
private final static char QUERY = '?';

private HttpClient httpClient;

QuickBaseConnection(PasswordAuthentication credentials) throws QuickBaseException
private String appToken = null;

public QuickBaseConnection(PasswordAuthentication credentials) throws QuickBaseException
{
httpClient = new HttpClient();
execute(authenticate(credentials.getUserName(), credentials.getPassword()));
Expand Down Expand Up @@ -135,7 +136,19 @@ public String getTicket()
}
return null;
}

public void setAppToken(String appToken)
{
this.appToken = appToken;
}

public void setQBLocation(String https_qb, String https_qb_main)
{
QuickBaseConnection.HTTPS_QB = https_qb;
QuickBaseConnection.HTTPS_QB_MAIN = https_qb_main;

}

/**
* Executes a {@link QuickBaseAPICall} for a certain database and returns the database response
* as a SAX {@link InputSource}.
Expand Down Expand Up @@ -187,6 +200,13 @@ public InputSource executeXml(String qbid, QuickBaseAPICall call, String... elem
xml.append(getTicket());
xml.append("</ticket>");

if (appToken != null)
{
xml.append("<apptoken>");
xml.append(appToken);
xml.append("</apptoken>");
}

for (String element: elements) {
xml.append(element);
xml.append("\n");
Expand Down