Package 

Class CaseUtils


  • 
    public class CaseUtils
    
                        

    Created by willpride on 3/27/18.

    • Method Detail

      • getCaseName

         static String getCaseName(Context context, String caseId)

        Get the case name of a given case

        Parameters:
        context - Android Context
        caseId - 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 Context
        caseId - The caseId of the case to lookup
        caseProperty - 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 Context
        caseId - The caseId of the case to lookup
        caseProperties - 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 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 Context
        caseId - The caseId of the case to lookup
      • 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 Context
        caseId - the caseId of the case to lookups
        selection - The query to perform against the case table
        selectionArgs - 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 Context
        caseId - 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 Context
        caseId - the caseId of the case to lookup