2023:Box (CMIS Binding): Difference between revisions

From Grooper Wiki
No edit summary
Line 46: Line 46:


=== Understanding Box For Mapped Export ===
=== Understanding Box For Mapped Export ===
{|class="fyi-box"
|
FYI
|
This article assumes you already have a Box account and can access it.
|}


<tabs>
<tabs>
Line 52: Line 59:
{|
{|
| style="padding:25px; vertical-align:top; width:35%" |
| style="padding:25px; vertical-align:top; width:35%" |
This article assumes you already have a Box account and can access it.


It is important to understand Box is essentially a cloud-based file folder system.
It is important to understand Box is essentially a cloud-based file system.  It is a storage repository consisting of files in folders.
|| [[File:2023-Box-CMIS-Binding-Understanding-Box-As-a-File-System-01.png]]
|| [[File:2023-Box-CMIS-Binding-Understanding-Box-As-a-File-System-01.png]]
|}
|}
Line 61: Line 67:
{|class="how-to-table"
{|class="how-to-table"
|
|
As well as a basic file system, Box can store data using Metadata Templates
As well as a basic file system, Box can store data using "Metadata Templates".


The image on the right is showing the Metadata Template being used for this folder in this Box environment. As you can see it's very simple, just three fields of information.
Metadata Templates can be assigned to files or folders in Box.
* The image on the right is showing the Metadata Template assigned to a folder in this Box environment.
* Metadata Templates are added in Box by your Box Admin.  Any number of custom metadata fields can be added to the template.
* This Metadata Template is very simple.  It has just three fields ("ID", "First Name" and "Last Name")


With a Metadata Template attached to a file (or folder), values for each field can be saved in Box.  With a "Mapped Export", you can marry data Grooper collects for a document with a corresponding field in the Metadata Template on export.  
With a Metadata Template attached to a file or folder, values for each field can be saved in Box.  With a "Mapped Export", you can marry data Grooper collects for a document with a corresponding field in the Metadata Template on export.  


To see how you would go about creating a "Mapped Export", click here: [[#Configuring a Mapped Box Export]]
To see how you would go about creating a "Mapped Export", click here: [[#Configuring a Mapped Box Export]]
Line 75: Line 84:
<tab name="Understanding the Content Model" style="margin:25px">
<tab name="Understanding the Content Model" style="margin:25px">
====Understanding the Content Model====
====Understanding the Content Model====
{|
{|class="how-to-table"
| style="padding:25px; vertical-align:top; width:35%" |
|
The purpose of this '''Content Model''' is to simply extract three fields of information from the document in its accompanying '''[[Batch]]'''.
The purpose of this '''Content Model''' is to simply extract three fields of information from a document in its accompanying '''Batch'''.
* These three fields in the '''Data Model''' ("ID", "First Name" and "Last Name") correspond to the three fields in the Box Metadata Template ("ID", "First Name" and "Last Name").
* When performing a Mapped Export, Grooper can not only export the document to a folder location in Box, but export the data it collects for these three fields to the Metadata Template Box attaches to the exported file.
|| [[File:2023-Box-CMIS-Binding-Understanding-Box-for-Mapped-Export-Understanding-the-Content-Model-01.png]]
|| [[File:2023-Box-CMIS-Binding-Understanding-Box-for-Mapped-Export-Understanding-the-Content-Model-01.png]]
|}
|}
</tab>
</tab>
<tab name="Extracted Data" style="margin:25px">
<tab name="Mapped Export Prereq:  Extracted Data" style="margin:25px">
====Extracted Data====
====Mapped Export Prereq: Extracted Data====
Before the '''Document Export''' activity can send data, it must have data. It's easy to get in the habit of testing extraction on a '''Data Field''' or a '''[[Data Model]]''' and feel good about the results, but it must be understood that the information displayed when doing so is in memory, or temporary. When the '''Extract''' activity is successfully run against a properly classified document (you can at the very least manually assign a '''Document Type''')  it creates '''Index Data''' and marries it to the document via a '''[https://en.wikipedia.org/wiki/JSON JSON]''' file called ''Grooper.DocumentData.json''.  
Please note!  Before the '''Document Export''' activity can send data, it '''''must''''' have data.  
 
In a production scenario, this will be accomplished by the '''Extract''' step of a '''Batch Process'''.
 
However, take care when you're testing your configuration to ensure documents have extracted data '''''before''''' exporting to Box.
* It's easy to get in the habit of testing extraction on a '''Data Field''' or a '''Data Model''' and feel good about the results, but it must be understood that the information displayed when doing so is in memory, or temporary.  
* When the '''Extract''' activity is successfully run against a classified document, it creates "index data" and marries it to the document via a '''[https://en.wikipedia.org/wiki/JSON JSON]''' file called ''Grooper.DocumentData.json''.  


You can verify the extracted data's existence as follows:<br/>
{|class="how-to-table"
{|class="how-to-table"
|
|
#First, navigate to the '''Document''' (or '''Folder''') object in the node tree; not the '''Batch''', not the '''Batch Folder''', not the '''Page''', but specifically the '''Document''' object. This is where the information lives.
You can verify a document has extracted data follows:
#From there, click on the '''Viewer''' tab.
 
#Once there, click the Review button. This will upon up the Reviewer tab.
# Navigate to the document (i.e. the '''Batch Folder''') object in the node tree.
#* Please note! You are not selecting the '''Batch''', not the '''Batch's''' root folder, not one of the document's '''Page''' objects, but specifically the document's '''Batch Folder''' object. This is where the information lives.
# Click on the '''Viewer''' tab.
# Press the Review button.  
#* This will bring up the document in a "Review" page.
|| [[File:2023-Box-CMIS-Binding-Understanding-Box-For-Mapped-Export-Extracted-Data-01.png]]
|| [[File:2023-Box-CMIS-Binding-Understanding-Box-For-Mapped-Export-Extracted-Data-01.png]]
|-
|-
|
|
#<li value="4">Click the Data Viewer icon</li>
#<li value="4">Click the "Data Viewer" icon.</li>
# This will bring up the extracted data of the document.
# This will bring up the extracted data of the document.
#* If the fields have data present, the document has stored index data present.
#* If the fields are empty, run the '''Extract''' activity on the document to collect and store its index data.
|| [[File:2023-Box-CMIS-Binding-Understanding-Box-For-Mapped-Export-Extracted-Data-02.png]]
|| [[File:2023-Box-CMIS-Binding-Understanding-Box-For-Mapped-Export-Extracted-Data-02.png]]
|}
|}

Revision as of 09:33, 7 June 2023

A Box Connection is a type of CMIS Connection one can set up in Grooper in order to import documents from, or export documents to Box.

About

You may download and import the files below into your own Grooper environment (version 2023). The first contains a Project with several Content Models used as examples throughout this article. The second contains some example Batches of sample documents.

Integration with Box in Grooper leverages the CMIS+ architecture to allow you to take full advantage of this powerful Content Management System.

If you are integrating Box with Grooper for the first time, your Box administrator will need to add Grooper as a "Custom App" before connecting.

Using the Admin Console, go to "Apps" then "Custom Apps" to add Grooper.


As part of the setup, you will be prompted to enter a Client ID. These Client IDs are version specific.

Grooper 2.90: cvl1qcgv14wu2dsyji3evncrq0de5h3l
Grooper 2021: z9iyazstefwydilz4x3abdi3w79wogow
Grooper 2022: z9iyazstefwydilz4x3abdi3w79wogow
Grooper 2023: z9iyazstefwydilz4x3abdi3w79wogow

How To

Understanding Box For Mapped Export

FYI

This article assumes you already have a Box account and can access it.

Understanding Box As A File System

It is important to understand Box is essentially a cloud-based file system. It is a storage repository consisting of files in folders.

As well as a basic file system, Box can store data using "Metadata Templates".

Metadata Templates can be assigned to files or folders in Box.

  • The image on the right is showing the Metadata Template assigned to a folder in this Box environment.
  • Metadata Templates are added in Box by your Box Admin. Any number of custom metadata fields can be added to the template.
  • This Metadata Template is very simple. It has just three fields ("ID", "First Name" and "Last Name")

With a Metadata Template attached to a file or folder, values for each field can be saved in Box. With a "Mapped Export", you can marry data Grooper collects for a document with a corresponding field in the Metadata Template on export.

To see how you would go about creating a "Mapped Export", click here: #Configuring a Mapped Box Export

Understanding the Content Model

The purpose of this Content Model is to simply extract three fields of information from a document in its accompanying Batch.

  • These three fields in the Data Model ("ID", "First Name" and "Last Name") correspond to the three fields in the Box Metadata Template ("ID", "First Name" and "Last Name").
  • When performing a Mapped Export, Grooper can not only export the document to a folder location in Box, but export the data it collects for these three fields to the Metadata Template Box attaches to the exported file.

Mapped Export Prereq: Extracted Data

Please note! Before the Document Export activity can send data, it must have data.

In a production scenario, this will be accomplished by the Extract step of a Batch Process.

However, take care when you're testing your configuration to ensure documents have extracted data before exporting to Box.

  • It's easy to get in the habit of testing extraction on a Data Field or a Data Model and feel good about the results, but it must be understood that the information displayed when doing so is in memory, or temporary.
  • When the Extract activity is successfully run against a classified document, it creates "index data" and marries it to the document via a JSON file called Grooper.DocumentData.json.

You can verify a document has extracted data follows:

  1. Navigate to the document (i.e. the Batch Folder) object in the node tree.
    • Please note! You are not selecting the Batch, not the Batch's root folder, not one of the document's Page objects, but specifically the document's Batch Folder object. This is where the information lives.
  2. Click on the Viewer tab.
  3. Press the Review button.
    • This will bring up the document in a "Review" page.
  1. Click the "Data Viewer" icon.
  2. This will bring up the extracted data of the document.
    • If the fields have data present, the document has stored index data present.
    • If the fields are empty, run the Extract activity on the document to collect and store its index data.

Back to top to continue to next tab

How to Create a Box CMIS Connection

Account ID

In order to connect to Box in Grooper you’ll need and enterprise account, and what Box refers to as an Account ID.

  1. When logged into Box, click the icon for your account to expose a drop-down menu.
  2. Click on Account Settings.
  3. Scroll to the bottom of this page and take note of the Account ID.

Create Box CMIS Connection in Grooper

  1. Right-click a Project (or a folder in the Project).
  2. Select Add, then CMIS Connection...
  1. Name the CMIS Connection whatever you want.
  2. Select "Execute".

Once your CMIS Connection has been created, set your Connection Settings to Box. This defines settings for Grooper to connect to Box.

  1. You will then need to enter your Box Account ID.
    • If you are unsure of where to find it, please see the Prereqs tab before this one.
  2. Once your ID has been entered, you will then choose your Metadata Format.
    • Bear in mind, if you want to perform a "Mapped Export", your Metadata Format will need to be Normal.
    • For more information on "Mapped Exports", see the #Configuring a Mapped Box Export section of this article.

Having saved your settings, you can now import the repository. To do so:

  1. Click the "List Repositories" button.
FYI

Repositories and Connections are two different things in Grooper. If you think of Box and Grooper like two separate electrical poles, then the CMIS Connection is the wire that stretches between them. It is the intangible arm that reaches out from Grooper and grasps Box. The Repository on the other hand is the cache where our data is stored.

  1. The repository(ies) awaiting import will appear. At this time, the dot under imported will be red, and it will say "False" under Imported.
  2. Once "List Repositories" has been selected, you will then be able to click "Import Repository."
  1. Select the repository you wish to import.
  2. Click Execute.
  1. Now we have a CMIS Repository.

By now, you're wondering what does importing a repository have to do with connecting to Box? Why is this important? We need the repository because, later on, when we format our export mapping, we'll need to reference this repository. You can't tell Grooper which item will be exported, if you have no item to export.

Configuring a Basic Box Export

Add an Export Behavior

This configuration is specific to this article. While aspects of it can apply to any configuration, it's worth noting that your environment may require slightly different settings (especially considering proprietary pieces of information like the Account ID). Note that the URLs in the image cannot be connected to externally, so attempting to copy this configuration verbatim will give you errors. This is meant as a guide, and will require an actual Box environment on your end to be established, and real information from it supplied.

  1. Select your Content Model.
  2. Make sure you are on the "Content Model" tab
  3. Select the ellipses to the right of "Behaviors".
  1. Select the Add button.
  2. In the drop-down menu, select Export Behavior.
  1. Select "Export Definitions".
  1. Click the Add button.
  2. Select "CMIS Export".

Configure the Export Definition

Now that you've set up your basic configuration, let's move on to configuring your Export Definition. This is a crucial step, as you're essentially laying out the map in front of your configured Behavior, and telling it what you want exported, where you want the data saved, and what properties you want written to the exported object. In other words, you're circling the destination in the brightest red possible, while giving the Behavior everything it needs to take with it.

  1. Click the little hamburger-looking symbol to the right of "CMIS Repository".
  2. In the drop-down menu, navigate down to the file(s) you want to export in your repository.
  1. If you want to change where the exported item(s) will be saved, select "Target Folder".
  1. From here, you can select your desired Target File.
  2. Once chosen, click OK.
  1. With your Target Folder selected, you will then need to choose the Object Type. Select "File".
  2. When finished, click OK.
FYI

Always check the Export Format to ensure that your are setting up the format as an attached file (this can be found under Object Data). For more information on Export Formats, see here: Export (Activity) - 2021

  1. Save.

Back to top to continue to next tab

Configuring a Mapped Box Export

Mapping to a Single Metadata Template

The approach taken below is via the object command interface. These same settings can be applied to a Step in a Batch Process to achieve the same results, albeit in a slightly different area of the Grooper UI.

  1. Remaining on the Content Model tab of the Content Model, select Behaviors once more.
  1. Select "Export Definition".
  1. Under Object Data, select "Secondary Types."
    • While optional, choosing a Secondary Type tells Grooper which particular Metadata template you want it to point to.
      • A Metadata Template is how Box stores its information. It describes a set of key-value pairs that can be assigned to a file or folder.
  1. Select your desired Secondary Type.
    • Since this example document is taken from the Grooper Wiki Metadata Template, we've chosen the Grooper Wiki Secondary Type. Yours will differ.
  2. Once selected, click OK.
  1. From here, select Write Mappings.
    • This is where you'll tell Grooper the exact information you want from your Metadata Template. Hence why selecting a Secondary Type was necessary.
  1. You'll want to specify the output value for the CMIS Name property.
  2. Select Expression.
  1. Enter your expression in the dialogue box.
    • In this step, we're basically mapping our export to the name of the file we have in Box.
FYI

Since the ID is specified as a Decimal format in Grooper, we've added the .ToString extension so it can be exported as text.

  1. When finished, click OK.
FYI

Descriptions and Tags can help you further refine your export mapping, but as they aren't necessary, we've left them alone.

Now, we move onto simple matching. For this, we're specifying which particular pieces of Metadata we're mapping to. Thus, it's important to match each piece exactly.

  1. For our case, we need to match three things: ID, First Name, and Last Name. First, select Grooper Wiki ID.
  2. Match it with the "ID" object from the drop-down menu.
  1. Select Grooper Wiki First Name.
  2. And match it with First_Name
  1. Lastly, select Grooper Wiki Last Name.
  2. Match it with the Last_Name item.
  3. With everything matched, click OK.
  1. In the Export Definitions window, click OK.
  1. Save.

Mapping to Multiple Metadata Templates

Note that for this section, we've changed the original document, and are using a different Content Model.

Much of the steps leading up to constructing your Export Behavior and Definition are the same up to this point. If you would like to see how to configure your Content Model for export, click here: #Configuring a Basic Box Export.

  1. Select your Secondary Types
  2. Click OK.

While the convention is the same, we've changed the Name property to avoid any confusion for Box when we export.

  1. Similar to the preceding section, once your Name property has been set up, you'll begin matching the object in Write Mappings with the piece of Metadata you want to map to.
    • While there is more to match this time around, it's still the same process.
  1. Once everything is matched, click OK.
    • Note that while our Repository and Target Folder appear the same as those of the earlier section, a different CMIS Repository was created. The document will still be exported to the same place in Box, however.
    • The obvious difference is in the Secondary Types and Write Mappings sections. Since we mapping to multiple Metadata types, we have two CMIS Type References and seven additional properties that are associated with the Grooper Wiki - Additional Info Secondary type.
  1. Click OK.
  1. Save.

Now, we have an exported file mapped to two Metadata Templates.

Wonder why we didn't do anything with the tables? Unfortunately, Box cannot read tables, it can only read instances of single value. Hence, why we chose the data we did.

Final Results

Now the Export Behavior(s) have been mapped, it's time to export the document to Box.

Right-Click Export

Normally, exporting would be done through a Batch Process, since all an Export Behavior does is tell Grooper what do do when the process gets to the Export step. However, for the purposes of this article, we will demonstrate how exporting could be done through right-clicking the document.

Note: If you haven't done so, run the Extract Activity before exporting.

  1. Select your Batch.
  2. Go to the Viewer tab.
  3. Right-click the document.
    • Select Activities, then Document Processing, and finally, Export.
  1. In the window that pops up, select Export Behavior.
  1. Add a Behavior.
  2. Select the Content Type.
  3. Select Export Definitions.

From this point on, you will need to set up your Export Definition exactly as depicted above in the "Configuring a Mapped Export" Section. To see those steps, click here: #Configuring a Mapped Box Export

Once your document has been exported, you will see it displayed on the homepage of your Box account.

Selecting the newly imported document, you will be able to view the Metadata mapped to the document from Grooper.

FYI

Notice the Batch is now linked to your Box account.

Performing the Export Within a Batch Step

We will now demonstrate a proxy version of the correct way exporting is performed, ie within a Batch Step process. How to set up a Batch Process will not be discussed here, as it's assumed the reader already knows how to do that. If you would like to know how to set up a Batch Process, click here: [[1]]. This section will display the creating the Export step and working in the Activity Tester of the Batch Process.

  1. Right-click (or create) your Project.
  2. Select Add, followed by Batch Process
  1. Name your Batch Process.
  2. Click Execute.
  1. Select the drop-down menu for Content Type.
  2. Choose the Document Type.
  1. With the Batch Process created, right click.
  2. Add a Batch Process Step.
  1. Name the Step.
  2. Click Execute.
  1. Select the Activity you wish to perform. In our case, this is the Export Activity.
  2. Select the Scope. For this instance, we can leave the scope at Folder.
  3. Once more, you'll need to define the Export Behavior. To see how to do that, click here: #Configuring a Mapped Box Export
  4. Once finished setting up the Behavior, click Save.
  1. With everything set up in the Batch Process Step, navigate to the Activity Tester tab.
  2. Click the play button to execute the tester.