[  Home  ]   [  EN  |  DE  ]  

Time Recording: Task list export and import

(A) Export and import task list
• Export the task list from your master device with one of the "Export" options.
• File format is "free text", i.e. you can edit it with any text editor once exported.
• Storage location with "Export | Google Drive" is "TimeRecording / timerec-tasks-free.txt" or "TimeRecordingPro / timerec-tasks-pro.txt"
• After editing the text file or when setting up new devices, use "Import".
• Note: task sort order when importing is derived from the line order within the text file.

(B) Import task list from your intranet
• Copy the exported file to a web server.
• Use "Import | Web page" as per above. This is available since Time Recording version 7.67

(C) Power user options
• Task-ID range from 20'000 to 29'999 is reserved and will *not* be used within the app for newly created tasks. I.e. use task ids from this range in your import file to prevent ID clash between "tasks created within the app by the user" and "tasks imported through service API".
• Import optionally supports "MERGE" mode (instead of default "full task list replacement"). When enabled, task import will only insert new tasks and/or update existing tasks (based on provided Task ID) but not delete the unmatched tasks. That is, all other pre-existing tasks will be retained.
To enable, add this line to your task import file:
!MERGE
Task deletion in "MERGE" mode can be forced using this notation (one line per deletion):
!DELETE {taskid}

(D) API calls
The tasks text file can be exported and imported over Android App API call. Examples: // export Button btExport = new Button(this); btExport.setText("Tasks Export Test"); btExport.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(); // for "Pro" use "com.dynamicg.timerecording.pro" intent.setComponent(new ComponentName("com.dynamicg.timerecording" , "com.dynamicg.timerecording.PublicServices")); intent.setAction("com.dynamicg.timerecording.TASKLIST_EXPORT"); BroadcastReceiver resultReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Bundle result = this.getResultExtras(true); System.out.println("## EXPORT STATUS> "+result.getString("STATUS")); System.out.println("## EXPORT FILEPATH> "+result.getString("FILEPATH")); String data = result.getString("DATA"); // this is the full file content of file pointed to by FILEPATH System.out.println("## EXPORT DATA LEN> "+(data!=null ? data.length() : -1)); System.out.println("## EXPORT ERRORS> "+result.getString("ERRORS")); } }; context.sendOrderedBroadcast(intent, null, resultReceiver, null, 0, null, null); } }); body.addView(btExport); // import Button btImport = new Button(this); btImport.setText("Tasks Import Merge Test"); btImport.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(); // for "Pro" use "com.dynamicg.timerecording.pro" intent.setComponent(new ComponentName("com.dynamicg.timerecording" , "com.dynamicg.timerecording.PublicServices")); intent.setAction("com.dynamicg.timerecording.TASKLIST_IMPORT"); String data = "### TEST IMPORT WITH MERGE ###" +"\n!MERGE" +"\n20001|Import-Task1|Import-ClientA" +"\n20002|Import-Task2|Import-ClientA" +"\n20003|Import-Task3|Import-ClientB" ; intent.putExtra("DATA", data); BroadcastReceiver resultReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Bundle result = this.getResultExtras(true); System.out.println("## IMPORT STATUS> "+result.getString("STATUS")); System.out.println("## IMPORT INFO> "+result.getString("INFO")); System.out.println("## IMPORT ERRORS> "+result.getString("ERRORS")); } }; context.sendOrderedBroadcast(intent, null, resultReceiver, null, 0, null, null); } }); body.addView(btImport);


  [  Top  ]  
  [  © DynamicG Android Apps  ]