Merge branch 'develop' into export

This commit is contained in:
Jacson Passold 2018-07-16 11:58:31 -03:00
commit 43e5a59cf4
9 changed files with 74 additions and 33 deletions

View File

@ -31,7 +31,7 @@ install:
- echo -e "Install"
- sudo mv ./tests/bootstrap-config-sample.php ./tests/bootstrap-config.php
- sudo ./tests/bin/install-wp-tests.sh test travis "" /tmp/wordpress localhost latest
true
true
- composer install
- sudo mkdir /tmp/wordpress/wordpress-test/wp-content/uploads
- sudo chmod -R 777 /tmp/wordpress/wordpress-test/wp-content/uploads
@ -54,6 +54,7 @@ before_deploy:
- ssh-add /tmp/deploy_rsa
- echo -e "Host $ssh_host\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- ssh-add -l
#teste Crontab
deploy:
- provider: script
script: sshpass -p '$ssh_password' ssh $ssh_user@$ssh_host sh /home/l3p/atualiza_git/atualiza_todos.sh #ssh $ssh_user@$ssh_host $script_deploy_tainacan

View File

@ -1,8 +1,8 @@
# Exporting and Exposing your Repository
When you buid a digital repository with Tainacan, you gain the ability to show it to the world in many different ways thanks to the power and flexibility of WordPress.
When you build a digital repository with Tainacan, you gain the ability to show it to the world in many different ways thanks to the power and flexibility of WordPress.
But sometimes you dont want just to have your collections browsable via web, you want to download a spreadsheet to work with or you want to make it availabe via APIs so it can be consumed by other applications or harvested by an aggregator. This page describe how Tainacan handle with these situations.
But sometimes you dont want just to have your collections browsable via web, you want to download a spreadsheet to work with or you want to make it available via APIs so it can be consumed by other applications or harvested by an aggregator. This page describe how Tainacan handle with these situations.
## Mapping
@ -12,13 +12,13 @@ You do it by informing, for each metadatum you create, what is it relative in ea
Tainacan is shipped with some Mapping standards that implement popular metadata standards. And it will be easy to create new standards. See more [details about mapping standards](mapping-standards.md).
You can also use these mapping standards as a pre-set when you create a new Collection.
You can also use these mapping standards as a preset when you create a new Collection.
## Exporting
Exporting allows you to download the content of your repository to a file - or to multiple files. The format of the package you will download depends on the exporter you will use. Tainacan ships with a simple CSV exporter and a Tainacan-Package exporter, that allows you to export all the content of your collections, including the attachments, to import in another Tainacan instance.
Whatever exporter you choose to you use, you will be able to choose wether you want to download the collection as it is, which means, with the metadata the way the were created in Tainacan, or wether you want to download it in a mapped version. For example, if you mapped your collection to Dublin Core, you can download a CSV file either in Dublin Core format or in the original format.
Whatever exporter you choose to you use, you will be able to choose wether you want to download the collection as it is, which means, with the metadata the way the were created in Tainacan, or if you want to download it in a mapped version. For example, if you mapped your collection to Dublin Core, you can download a CSV file either in Dublin Core format or in the original format.
Tainacan makes it very easy to developers to create new exporters and publish them as plugins anyone can use.
@ -32,6 +32,14 @@ Each exposer implements a different way of presenting your data in the API respo
For example, the default JSON exposer supports any mapping and can serve your content exposing any metadata standard you mapped your content to. The decision is in the hands of the application that makes the request to your API.
On the other hand, OAI-PMH exposer only supports Dublin Core mapping and will allways serve content this way.
On the other hand, OAI-PMH exposer only supports Dublin Core mapping and will always serve content this way.
Exposers are also really easy to develop and can be added to your Tainacan instance via plugins.
## Exposing API
Using exposing API is easy, need only to set some parameters to API call, for example to expose an Item with id 123 using XML format on site URI http://example.com, so we need to call API with this URI: http://example.com/wp-json/tainacan/v2/items/123 with this URI the Tainacan will return the Item 123 data, but with we send this parameter at body, exposer=xml, It will return a WordPress JSON with XML formatted in data propriety. Or with we want only the XML data, without JSON respond for example, we need only to put the expose parameter at URI, like:
http://example.com/wp-json/tainacan/v2/items/123?exposer=xml
Tainacan have support to metadata mapping, the parameter for using the mapper is mapper=[mapper], so for our last example, if we want a CSV, using dublin-core mapper exposing the content at CSV format, not JSON:
http://example.com/wp-json/tainacan/v2/items/123?exposer=xml&mapper=dublin-core

View File

@ -92,13 +92,13 @@
</button>
</div>
<div class="control">
<button
<a
type="button"
v-if="editForm.url != undefined && editForm.url!= ''"
class="button is-secondary"
:href="editForm.url">
{{ $i18n.get('see') + ' ' + $i18n.get('term') }}
</button>
</a>
</div>
<div class="control">
<button

View File

@ -216,12 +216,20 @@
</option> -->
</b-select>
<button
:disabled="totalItems <= 0"
class="button is-white is-small"
:disabled="totalItems <= 0 || order == 'DESC'"
@click="onChangeOrder()">
<span class="icon is-small gray-icon">
<i class="mdi mdi-sort-ascending"/>
</span>
</button>
<button
:disabled="totalItems <= 0 || order == 'ASC'"
class="button is-white is-small"
@click="onChangeOrder()">
<b-icon
class="gray-icon"
:icon="order === 'ASC' ? 'sort-ascending' : 'sort-descending'"/>
<span class="icon is-small gray-icon">
<i class="mdi mdi-sort-descending"/>
</span>
</button>
</b-field>
</div>
@ -247,6 +255,7 @@
<b-icon icon="menu-down" />
</button>
<b-dropdown-item
:class="{ 'is-active': viewModeOption == viewMode }"
v-for="(viewModeOption, index) of enabledViewModes"
:key="index"
:value="viewModeOption"
@ -272,39 +281,50 @@
class="button is-white"
slot="trigger">
<span>
<b-icon
class="gray-icon view-mode-icon"
:icon="(adminViewMode == 'table' || adminViewMode == undefined) ?
'table' : (adminViewMode == 'cards' ?
'view-list' : 'view-grid')"/>
<span class="icon is-small gray-icon">
<i
:class="{'mdi-table' : ( adminViewMode == 'table' || adminViewMode == undefined),
'mdi-view-list' : adminViewMode == 'cards',
'mdi-view-grid' : adminViewMode == 'grid',
'mdi-view-module' : adminViewMode == 'records'}"
class="mdi"/>
</span>
</span>
&nbsp;&nbsp;&nbsp;{{ $i18n.get('label_visualization') }}
<b-icon icon="menu-down" />
</button>
<b-dropdown-item :value="'table'">
<b-dropdown-item
:class="{ 'is-active': adminViewMode == 'table' }"
:value="'table'">
<b-icon
class="gray-icon"
icon="table"/>
{{ $i18n.get('label_table') }}
</b-dropdown-item>
<b-dropdown-item :value="'cards'">
<b-dropdown-item
:class="{ 'is-active': adminViewMode == 'cards' }"
:value="'cards'">
<b-icon
class="gray-icon"
icon="view-list"/>
{{ $i18n.get('label_cards') }}
</b-dropdown-item>
<b-dropdown-item :value="'records'">
<b-icon
class="gray-icon"
icon="view-module"/>
{{ $i18n.get('label_records') }}
</b-dropdown-item>
<b-dropdown-item :value="'grid'">
<b-dropdown-item
:class="{ 'is-active': adminViewMode == 'grid' }"
:value="'grid'">
<b-icon
class="gray-icon"
icon="view-grid"/>
{{ $i18n.get('label_grid') }}
</b-dropdown-item>
<b-dropdown-item
:class="{ 'is-active': adminViewMode == 'records' }"
:value="'records'">
<b-icon
class="gray-icon"
icon="view-module"/>
{{ $i18n.get('label_records') }}
</b-dropdown-item>
</b-dropdown>
</b-field>
</div>
@ -1002,8 +1022,9 @@
.gray-icon, .gray-icon .icon {
color: $tainacan-placeholder-color !important;
padding-right: 10px;
}
.gray-icon .icon i::before, .gray-icon i::before {
.gray-icon .icon i::before, .gray-icon i::before {
font-size: 21px !important;
}
@ -1018,11 +1039,13 @@
div.dropdown-content {
padding: 0;
.metadata-options-container {
max-height: 240px;
overflow: auto;
}
.dropdown-item {
padding: 0.25rem 1.0rem 0.25rem 0.75rem;
}
.dropdown-item span{
vertical-align: sub;
}

View File

@ -30,7 +30,7 @@
.b-checkbox { width: 100% };
&:hover { background-color: $primary-lighter; }
.is-small { color: gray; }
&.is-active { background-color: white; }
&.is-active { background-color: $primary-light; }
}
}
}

View File

@ -14,6 +14,8 @@
table.tainacan-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
.checkbox-cell {
min-width: 38px;

View File

@ -311,9 +311,16 @@ export default {
font-size: 21px;
}
}
.dropdown-item {
padding: 0.25rem 1.35rem 0.25rem 0.25rem;
}
.view-mode-icon {
margin-right: 8px !important;
margin-top: 2px;
margin-right: 0px !important;
margin-top: 1px;
&.icon i::before, .gray-icon i::before {
font-size: 19px !important;
}
}
}

View File

@ -102,7 +102,7 @@ $Tainacan_Metadata->register_metadata_type('Tainacan\Metadata_Types\Numeric');
$Tainacan_Metadata->register_metadata_type('Tainacan\Metadata_Types\Selectbox');
$Tainacan_Metadata->register_metadata_type('Tainacan\Metadata_Types\Relationship');
$Tainacan_Metadata->register_metadata_type('Tainacan\Metadata_Types\Taxonomy');
$Tainacan_Metadata->register_metadata_type('Tainacan\Metadata_Types\Compound');
//$Tainacan_Metadata->register_metadata_type('Tainacan\Metadata_Types\Compound');
$Tainacan_Filters = \Tainacan\Repositories\Filters::get_instance();

View File

@ -194,7 +194,7 @@ class Metadata extends TAINACAN_UnitTestCase {
*/
function test_metadata_metadata_type(){
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
$this->assertEquals( 8, sizeof( $Tainacan_Metadata->fetch_metadata_types() ) );
$this->assertEquals( 7, sizeof( $Tainacan_Metadata->fetch_metadata_types() ) );
}