# Archive 🗂️

Archives are a sort of snapshot of artifacts of FRIC. This feature is used to store away artifacts such as findings, tasks, systems, etc for potential use at a later time.

{% hint style="info" %}
<http://localhost:8080/#/archive>
{% endhint %}

### Archive Page (Archive.vue)

This page displays the overview table of the artifacts of FRIC in order to archive any of them, or restore them. This page displays&#x20;

* Task overview table
* Subtask overview table
* Findings overview table
* Systems overview table

In addition, when the user clicks on the *New Archive* button in the top right, individual artifacts can be exported to the user's computer, documented below.

### Export Data (ExportData.vue)

Users can select any of the following artifacts to directly download them from the database to their computer

| Button Label | Description                                                 | File Downloaded             |
| ------------ | ----------------------------------------------------------- | --------------------------- |
| Systems      | Exports all of the current systems in the database          | systems*dateTime.json*      |
| Tasks        | Exports all of the current tasks in the database            | *tasksdateTime.json*        |
| Subtasks     | Exports all of the current subtasks in the database         | *subtasksdateTime.json*     |
| Findings     | Exports all of the current findings in the database         | *findingsdateTime.json*     |
| Transactions | Exports all of the current transaction logs in the database | *transactionsdateTime.json* |
| All          | Exports all of the current data in the database             |                             |

To test the exporting of all data you can run the following command

```bash
mongodump -d db -o Archive
```

> This will dump everything from the db called `db` and then output it to a folder called Archive

#### Methods

| Name             | Parameter                                                    | Description                                                                                                            |
| ---------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| onExportFinish() | { systems \|  tasks \| subtasks \| findings \| transactions} | Exports the parameter data and generates the file to the user, alerting them on the frontend that it has been exported |
| archiveAll()     |                                                              | Exports all data, reference the code snippet above                                                                     |
