Jump to content

Document filters: Difference between revisions

From Resco's Wiki
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Synchronization TOC}}
{{Synchronization TOC}}
[[Synchronization]] does not mean only the exchange of database records. It also involves documents, often stored on an external storage (e.g., a SharePoint server). External storage may contain terabytes of data. [[Woodford]] administrator can define document filters; these allow you to synchronize only a subset of the documents and make the synchronization run faster.
[[Synchronization]] does not mean only the exchange of database records. It also involves [[documents]], often stored on external storage (e.g., a SharePoint server). External storage may contain terabytes of data. [[Woodford]] administrator can define document filters; these allow you to synchronize only a subset of the documents and make the synchronization run faster. These filters apply to attachments (such as note/annotation) and cloud documents from external storage.
 
Documents that are blocked by blob filter can still be available in your app, however, they are only downloaded on-demand and require an active internet connection.


== Using blob filters ==
== Using blob filters ==


You have two options how to edit blob filters:
To edit the blob filter, proceed as follows:
* Using [[Woodford]], edit an app project and select '''[[Configuration]]''' from the '''Project''' menu. Then click '''Blob Filter''', edit the document and click '''Save'''.
# Edit an [[App projects|app project]] in [[Woodford]].
* Alternatively, edit the file <code>\Configuration\BlobStoreFilter.xml</code> in the project directory to apply these settings.
# Select '''[[Configuration]]''' from the '''Project''' menu.
# Click '''Blob Filter''' to edit the XML configuration document.
# Update configuration as needed, then click '''Save'''.
 
If you are using a Windows version of Resco Mobile CRM app for testing your synchronization performance, you can also edit the configuration file of the app directly. Edit the file <code>\Configuration\BlobStoreFilter.xml</code> in your Resco project directory.
 
== Basic syntax ==
 
The configuration has two main sections:
* <code><FilesFilter></code> for cloud documents
* <code><AttachmentsFilter></code> for CRM attachments (notes)
 
Some of the common filter elements:
* <code><MaxFileSize></code> / <code><MaxAttachmentSize></code> - specify file size in bytes (0 = all attachments blocked; -1 = unlimited)
* <code><NotSyncingAttachmentsFor></code> / <code><OnlySyncingAttachmentsFor></code> - exclude or include only the specified entities
* <code><Quota></code> - Stop downloading when the total size of all cloud documents exceeds the specified value. Not implemented for attachments.
 
See the examples below for inspiration.


== Simple example ==
== Simple example ==
Line 99: Line 118:
Explanation:
Explanation:
* If there are multiple EntityAttachmentsFilter nodes that apply to given attachment, then all of them must be fulfilled.
* If there are multiple EntityAttachmentsFilter nodes that apply to given attachment, then all of them must be fulfilled.
* MaxAttachmentSize defines the size limit applicable to all attachments. (Same effect as MaxFileSize in the Setup form.)
* MaxAttachmentSize defines the size limit applicable to all attachments. (Same effect as the parameter '''[[Setup#Max_Attachment_Size|Max Attachment Size]]''' in the Setup form.)
* NotSyncingAttachmentsFor is used to specify entity types for which no attachments are downloaded.
* NotSyncingAttachmentsFor is used to specify entity types for which no attachments are downloaded.
* Account annotations are limited to 150K, however there is a stricter limit for *.jpg files (50K) and *.doc files (100K).
* Account annotations are limited to 150K, however, there is a stricter limit for *.jpg files (50K) and *.doc files (100K).
* All annotations (except account annotations) are limited to 300K.
* All annotations (except account annotations) are limited to 300K.
* ActivityMimeAttachment’s use custom size limit.
* ActivityMimeAttachment’s use custom size limit.
Line 120: Line 139:


Notes:
Notes:
* Files that do not pass filter conditions are not downloaded. However, these files are listed on the screen and can be downloaded on demand.
* If you specify a document filter, Resco mobile apps fall back to the default values: a quota of 4GB and the Max Attachment Size defined in the app's [[Setup]] form.
* Size "-1" means unlimited. Size "0" means nothing allowed.
* AttachmentsFilter Quota values are ignored at the time of writing. (MCRM 10.1.0.2)
* If you do not have any explicit BlobStoreFilter, MCRM will use an implicit filter that specifies a quota of 4GB and MaxFileSize as defined in the Setup form
* Pay attention that you use one of the forms of the conditions (positive and negative; NotSyncingAttachmentsForm & OnlySyncingAttachmentsForm), but not both. (Formally allowed, but does not make sense.)
* Pay attention that you use one of the forms of the conditions (positive and negative; NotSyncingAttachmentsForm & OnlySyncingAttachmentsForm), but not both. (Formally allowed, but does not make sense.)


Line 131: Line 147:
* [https://blog.resco.net/2017/08/09/documents-in-mcrm-sharepoint-dropbox-google-drive-onedrive-a-technical-deep-dive-part-2/ Documents in Resco Mobile CRM (SharePoint, DropBox, Google Drive, OneDrive) – a technical deep dive] {{Badge|Blog}}
* [https://blog.resco.net/2017/08/09/documents-in-mcrm-sharepoint-dropbox-google-drive-onedrive-a-technical-deep-dive-part-2/ Documents in Resco Mobile CRM (SharePoint, DropBox, Google Drive, OneDrive) – a technical deep dive] {{Badge|Blog}}


{{Feedback}}
[[Category:Synchronization]]
[[Category:Synchronization]]

Latest revision as of 11:25, 2 January 2024

Synchronization does not mean only the exchange of database records. It also involves documents, often stored on external storage (e.g., a SharePoint server). External storage may contain terabytes of data. Woodford administrator can define document filters; these allow you to synchronize only a subset of the documents and make the synchronization run faster. These filters apply to attachments (such as note/annotation) and cloud documents from external storage.

Documents that are blocked by blob filter can still be available in your app, however, they are only downloaded on-demand and require an active internet connection.

Using blob filters

To edit the blob filter, proceed as follows:

  1. Edit an app project in Woodford.
  2. Select Configuration from the Project menu.
  3. Click Blob Filter to edit the XML configuration document.
  4. Update configuration as needed, then click Save.

If you are using a Windows version of Resco Mobile CRM app for testing your synchronization performance, you can also edit the configuration file of the app directly. Edit the file \Configuration\BlobStoreFilter.xml in your Resco project directory.

Basic syntax

The configuration has two main sections:

  • <FilesFilter> for cloud documents
  • <AttachmentsFilter> for CRM attachments (notes)

Some of the common filter elements:

  • <MaxFileSize> / <MaxAttachmentSize> - specify file size in bytes (0 = all attachments blocked; -1 = unlimited)
  • <NotSyncingAttachmentsFor> / <OnlySyncingAttachmentsFor> - exclude or include only the specified entities
  • <Quota> - Stop downloading when the total size of all cloud documents exceeds the specified value. Not implemented for attachments.

See the examples below for inspiration.

Simple example

<?xml version="1.0" encoding="utf-8"?>
<BlobStoreFilter>
	<FilesFilter>
		<Quota>1000000000</Quota>
		<MaxFileSize>100000</MaxFileSize>
	</FilesFilter>
</BlobStoreFilter>

The filter above is an example of a trivial cloud document filter that says:

  • MaxFileSize: Do not download cloud documents larger than 100K.
  • Quota: Stop downloading when the total size of all cloud documents exceeds 1GB.

Different max file sizes for different file formats

Here is a more complex example:

<?xml version="1.0" encoding="utf-8"?>
<BlobStoreFilter>
	<FilesFilter>
		<Quota>1000000000</Quota>
		<Filters>
			<BlobStoreFileTypeFilter>
				<FileSuffix>jpg</FileSuffix>
				<MaxFileSize>1000000</MaxFileSize>
			</BlobStoreFileTypeFilter>
			<BlobStoreFileTypeFilter>
				<FileSuffix>*</FileSuffix>
				<MaxFileSize>100000</MaxFileSize>
			</BlobStoreFileTypeFilter>
		</Filters>
	</FilesFilter>
</BlobStoreFilter>

The filter above specifies the quota and additional conditions:

  • Download jpeg images up to the 1MB size
  • Any other file type is limited to 100K size

Filtering CRM attachments

The first two examples applied to cloud documents, however, you can filter CRM attachments (notes) as well. Here is an example:

<?xml version="1.0" encoding="utf-8"?>
<BlobStoreFilter>
	<FilesFilter/>
	<AttachmentsFilter>
		<MaxAttachmentSize>300000</MaxAttachmentSize>
		<NotSyncingAttachmentsFor>
			<string>contact</string>
			<string>campaign</string>
		</NotSyncingAttachmentsFor>

		<EntityFilters>
			<EntityAttachmentsFilter Entity="annotation" AttachedTo="account">
				<MaxFileSize>150000</MaxFileSize>
				<Filters>
					<BlobStoreFileTypeFilter>
						<FileSuffix>jpg</FileSuffix>
						<MaxFileSize>50000</MaxFileSize>
					</BlobStoreFileTypeFilter>
					<BlobStoreFileTypeFilter>
						<FileSuffix>doc</FileSuffix>
						<MaxFileSize>100000</MaxFileSize>
					</BlobStoreFileTypeFilter>
				</Filters>
			</EntityAttachmentsFilter>

			<EntityAttachmentsFilter Entity="annotation">
				<Quota>-1</Quota>
				<MaxFileSize>300000</MaxFileSize>
				<Filters />
			</EntityAttachmentsFilter>

			<EntityAttachmentsFilter Entity="activitymimeattachment">
				<Quota>-1</Quota>
				<MaxFileSize>123456</MaxFileSize>
				<Filters />
			</EntityAttachmentsFilter>
		</EntityFilters>
	</AttachmentsFilter>
</BlobStoreFilter>

Explanation:

  • If there are multiple EntityAttachmentsFilter nodes that apply to given attachment, then all of them must be fulfilled.
  • MaxAttachmentSize defines the size limit applicable to all attachments. (Same effect as the parameter Max Attachment Size in the Setup form.)
  • NotSyncingAttachmentsFor is used to specify entity types for which no attachments are downloaded.
  • Account annotations are limited to 150K, however, there is a stricter limit for *.jpg files (50K) and *.doc files (100K).
  • All annotations (except account annotations) are limited to 300K.
  • ActivityMimeAttachment’s use custom size limit.

Filtering by positive condition

Starting with Resco Mobile CRM version 11.1 (Summer Update 2018), you can also utilize a positive condition to filter selected attachments, e.g.:

<AttachmentsFilter>
    <MaxAttachmentSize>100000</MaxAttachmentSize>
    <OnlySyncingAttachmentsFor>
      <string>contact</string>
      <string>account</string>
    </OnlySyncingAttachmentsFor>
</AttachmentsFilter>

Notes:

  • If you specify a document filter, Resco mobile apps fall back to the default values: a quota of 4GB and the Max Attachment Size defined in the app's Setup form.
  • Pay attention that you use one of the forms of the conditions (positive and negative; NotSyncingAttachmentsForm & OnlySyncingAttachmentsForm), but not both. (Formally allowed, but does not make sense.)

The document filter is the most frequent reason that causes not-downloaded documents. Other common errors are various download failures, such as web communication errors.

See also



{{#CI form: title = Was this information helpful? How can we improve? | type = inputs | [textarea] }}