-
public class CaseUtilsCreated by willpride on 3/27/18.
-
-
Method Summary
Modifier and Type Method Description static voidsetPackageExtension(Context context, String extension)static StringgetCaseName(Context context, String caseId)Get the case name of a given case static StringgetCaseProperty(Context context, String caseId, String caseProperty)Get the specified property of a specified case static Map<String, String>getCaseProperties(Context context, String caseId, ArrayList<String> caseProperties)Get the specified properties of a specified case static List<String>getCaseIds(Context context)Get a list of the caseIds of all cases in the user's database static CursorgetCaseMetaData(Context context)Provides a listing of all cases in the system, along with their metadata.Returns all of the named attributes for a case (case_type, date_opened, etc) in columns. static CursorgetCaseMetaData(Context context, String selection, Array<String> selectionArgs)static CursorgetCaseMetaData(Context context, String caseId)Returns all of the named attributes for a single case (case_type, date_opened, etc) in columns. static CursorgetCaseDataCursor(Context context, String caseId)static CursorgetCaseDataCursor(Context context, String caseId, String selection, Array<String> selectionArgs)Returns the key/value pairs of all data for a specific case content://org.commcare.dalvik. static CursorgetCaseIndexData(Context context, String caseId)Returns all indices for a specific case content://org.commcare.dalvik. static CursorgetCaseAttachmentData(Context context, String caseId)Returns all case attachments (still in flux) associated with a specific case. -
-
Method Detail
-
setPackageExtension
static void setPackageExtension(Context context, String extension)
-
getCaseName
static String getCaseName(Context context, String caseId)
Get the case name of a given case
- Parameters:
context- Android ContextcaseId- The caseId to look up
-
getCaseProperty
static String getCaseProperty(Context context, String caseId, String caseProperty)
Get the specified property of a specified case
- Parameters:
context- Android ContextcaseId- The caseId of the case to lookupcaseProperty- The name of the case property to lookup
-
getCaseProperties
static Map<String, String> getCaseProperties(Context context, String caseId, ArrayList<String> caseProperties)
Get the specified properties of a specified case
- Parameters:
context- Android ContextcaseId- The caseId of the case to lookupcaseProperties- A list of the names of the case properties to lookup
-
getCaseIds
static List<String> getCaseIds(Context context)
Get a list of the caseIds of all cases in the user's database
- Parameters:
context- Android Context
-
getCaseMetaData
static Cursor getCaseMetaData(Context context)
Provides a listing of all cases in the system, along with their metadata.Returns all of the named attributes for a case (case_type, date_opened, etc) in columns. content://org.commcare.dalvik.case/casedb/case Response Content column required case_id yes case_type yes owner_id yes status yes case_name yes date_opened yes last_modified
- Parameters:
context- Android Context
-
getCaseMetaData
static Cursor getCaseMetaData(Context context, String selection, Array<String> selectionArgs)
-
getCaseMetaData
static Cursor getCaseMetaData(Context context, String caseId)
Returns all of the named attributes for a single case (case_type, date_opened, etc) in columns. content://org.commcare.dalvik.case/casedb/case/CASE_ID Response Content column required case_id yes case_type yes owner_id yes status yes case_name yes date_opened yes last_modified
- Parameters:
context- Android ContextcaseId- The caseId of the case to lookup
-
getCaseDataCursor
static Cursor getCaseDataCursor(Context context, String caseId)
-
getCaseDataCursor
static Cursor getCaseDataCursor(Context context, String caseId, String selection, Array<String> selectionArgs)
Returns the key/value pairs of all data for a specific case content://org.commcare.dalvik.case/casedb/data/CASE_ID Response Content column required case_id yes datum_id yes value
- Parameters:
context- Android ContextcaseId- the caseId of the case to lookupsselection- The query to perform against the case tableselectionArgs- The arguments to use in the query
-
getCaseIndexData
static Cursor getCaseIndexData(Context context, String caseId)
Returns all indices for a specific case content://org.commcare.dalvik.case/casedb/index/CASE_ID Response Content column required case_id yes index_id yes case_type yes value yes
- Parameters:
context- Android ContextcaseId- the caseId of the case to lookups
-
getCaseAttachmentData
static Cursor getCaseAttachmentData(Context context, String caseId)
Returns all case attachments (still in flux) associated with a specific case. Note that the value returned is the full body of the attachment, which means this API is only viable for communicating with attachments that are not particularly large, depending on the amount of memory on the device.
- Parameters:
context- Android ContextcaseId- the caseId of the case to lookup
-
-
-
-