public class AttachmentManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected MapItem |
mapItem |
static java.lang.String |
TAG |
Constructor and Description |
---|
AttachmentManager(MapView mapView,
android.widget.ImageButton attachmentsButton)
Given a map item and an attachment button, track the number of attachments.
|
Modifier and Type | Method and Description |
---|---|
static java.io.File |
addAttachment(MapItem mi,
java.io.File f)
Convenience method for adding an attachment to to a map item.
|
void |
cleanup() |
static java.util.List<MapItem> |
findAttachmentItems() |
static java.util.List<MapItem> |
findAttachmentItems(MapGroup rootGroup)
Find all items with attachments
|
static java.util.List<java.io.File> |
getAttachments(java.lang.String uid)
Get list of files attached to a given map item
|
static java.lang.String |
getFolderPath(java.lang.String uid)
Method for getting the folder path related to attachments.
|
static java.lang.String |
getFolderPath(java.lang.String uid,
boolean createDir)
Method for getting the folder path related to attachments.
|
static int |
getNumberOfAttachments(java.lang.String uid)
Get the number of files attached to a given map item
|
void |
hideAttachmentOption(boolean hide) |
void |
promptSendAttachments(MapItem item,
java.lang.String onReceiveAction)
Prompt the user with the option to include marker attachments
|
void |
refresh() |
void |
send() |
void |
send(java.lang.String onReceiveAction) |
protected void |
sendCoT(MapItem item) |
static void |
sendWithAttachmentsNoPrompt(MapItem mi,
java.lang.String onReceiveAction)
Convenience method for sending a marker with all attachments unconditionally.
|
void |
setMapItem(MapItem mi) |
protected void |
updateAttachmentsButton() |
static void |
viewItem(MapView mapView,
MapItem mapItem,
java.io.File file)
View a given item attachment
|
public static final java.lang.String TAG
protected MapItem mapItem
public AttachmentManager(MapView mapView, android.widget.ImageButton attachmentsButton)
public void setMapItem(MapItem mi)
public void refresh()
public void cleanup()
public void hideAttachmentOption(boolean hide)
protected void updateAttachmentsButton()
public void send()
public void send(java.lang.String onReceiveAction)
protected void sendCoT(MapItem item)
public void promptSendAttachments(MapItem item, java.lang.String onReceiveAction)
item
- Item to sendonReceiveAction
- Optional receive callbackpublic static java.util.List<MapItem> findAttachmentItems(MapGroup rootGroup)
rootGroup
- The root map group to use for scanning UIDspublic static java.util.List<MapItem> findAttachmentItems()
public static java.util.List<java.io.File> getAttachments(java.lang.String uid)
uid
- Map item UIDpublic static int getNumberOfAttachments(java.lang.String uid)
uid
- Map item UIDpublic static java.io.File addAttachment(MapItem mi, java.io.File f)
mi
- the map item to attach a file to.f
- the attachment to attach to the map item.public static java.lang.String getFolderPath(java.lang.String uid, boolean createDir)
uid
- the map item uid used to generate the folder path.createDir
- automatically create the directory if it does not exist.public static java.lang.String getFolderPath(java.lang.String uid)
uid
- the map item uid used to generate the folder path.public static void sendWithAttachmentsNoPrompt(MapItem mi, java.lang.String onReceiveAction)
mi
- the map item.onReceiveAction
- intent that is fired when the item is sent.
Listen for this if you want to be notified that it has been sent.