Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database / Default content / Remove categories. #8063

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ public void testCreateMetadataWithTemplateMetadata() throws Exception {
ServiceContext serviceContext = createContextAndLogAsAdmin();
User principal = serviceContext.getUserSession().getPrincipal();
Group group = groupRepository.findAll().get(0);
MetadataCategory testCategory = new MetadataCategory();
testCategory.setName("test-category");
metadataCategoryRepository.save(testCategory);
MetadataCategory category = metadataCategoryRepository.findAll().get(0);
Source source = sourceRepository.save(new Source().setType(SourceType.portal).setName("GN").setUuid("sourceuuid"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.fao.geonet.AbstractCoreIntegrationTest;
import org.fao.geonet.domain.AbstractMetadata;
import org.fao.geonet.domain.ISODate;
import org.fao.geonet.domain.MetadataCategory;
import org.fao.geonet.domain.MetadataType;
import org.fao.geonet.kernel.search.IndexingMode;
import org.fao.geonet.repository.MetadataCategoryRepository;
Expand All @@ -54,6 +55,9 @@ public void testDataManagerCutpoints() throws Exception {
public void run() throws Exception {
ServiceContext serviceContext = createContextAndLogAsAdmin();

MetadataCategory category = new MetadataCategory();
category.setName("sample");
metadataCategoryRepository.save(category);
String metadataCategory = metadataCategoryRepository.findAll().get(0).getName();
Element sampleMetadataXml = getSampleMetadataXml();
UserSession userSession = serviceContext.getUserSession();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ private void populate(AbstractMetadata md) {
md.getSourceInfo().setSourceId("test-faking");
md.getDataInfo().setSchemaId("isoFake");

MetadataCategory category = new MetadataCategory();
category.setName("test-category");
metadataCategoryRepository.save(category);
mdc = metadataCategoryRepository.findAll().get(0);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Managing categories

GeoNetwork has a concept of categories that can be assigned to metadata documents, but these are not represented in the metadata. So when the metadata is exported, the category will be lost. You can use these categories to separate documents into groups, without changing the actual content of the metadata. Categories can be used to filter a search result, or limit the output of a custom csw endpoint.
The catalog has a concept of categories that can be assigned to metadata documents, but these are not represented in the metadata (not encoded in the XML document). So when the metadata is exported or harvested, the category is not available. You can use these categories to separate documents into groups, without changing the actual content of the metadata.

Categories can be used to filter a search result, or limit the output of a custom portal.

To assign a category to a metadata document. Go to the metadata modification form and select the requested category from the pull down in the menu. Then save your metadata.

To modify the available categories in the catalog, from the admin page, open the "classification systems" and then the "category" tab.

Note: If you add or modify categories, they may not obtain an appropriate icon. These icon are managed in `/catalog/style/gn_icons.less`. In this file category-classes are mapped to font-awesome variables that map to a certain [font-awesome icon](https://fontawesome.io).

Usually, it is recommended to use keywords with a thesaurus instead of categories. The main benefit of categories is that it is not encoded in the metadata.
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@

-- ======================================================================
-- === Table: Categories
-- ======================================================================

INSERT INTO Categories (id, name) VALUES (1,'maps');
INSERT INTO Categories (id, name) VALUES (2,'datasets');
INSERT INTO Categories (id, name) VALUES (3,'interactiveResources');
INSERT INTO Categories (id, name) VALUES (4,'applications');
INSERT INTO Categories (id, name) VALUES (5,'caseStudies');
INSERT INTO Categories (id, name) VALUES (6,'proceedings');
INSERT INTO Categories (id, name) VALUES (7,'photo');
INSERT INTO Categories (id, name) VALUES (8,'audioVideo');
INSERT INTO Categories (id, name) VALUES (9,'directories');
INSERT INTO Categories (id, name) VALUES (10,'otherResources');
INSERT INTO Categories (id, name) VALUES (12,'registers');
INSERT INTO Categories (id, name) VALUES (13,'physicalSamples');

-- ======================================================================
-- === Table: Groups
-- ======================================================================
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
INSERT INTO Languages (id, name, isinspire) VALUES ('ara','العربية', 'n');

-- Take care to table ID (related to other loc files)
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (1,'ara','Maps & graphics');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (2,'ara','Datasets');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (3,'ara','Interactive resources');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (4,'ara','Applications');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (5,'ara','Case studies, best practices');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (6,'ara','Conference proceedings');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (7,'ara','Photo');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (8,'ara','Audio/Video');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (9,'ara','Directories');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (10,'ara','Other information resources');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (12,'ara','Registers');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (13,'ara','Physical Samples');

INSERT INTO GroupsDes (iddes, langid, label)VALUES (-1,'ara','Guest');
INSERT INTO GroupsDes (iddes, langid, label)VALUES (0,'ara','Intranet');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
INSERT INTO Languages (id, name, isinspire) VALUES ('cat','català', 'n');

-- Take care to table ID (related to other loc files)
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (1,'cat','Mapes i gràfics');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (2,'cat','Conjunts de dades');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (3,'cat','Recursos interactius');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (4,'cat','Aplicacions');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (5,'cat','Casos d''ús, bones pràctiques');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (6,'cat','Actes de conferències');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (7,'cat','Foto');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (8,'cat','Àudio/Vídeo');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (9,'cat','Directoris');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (10,'cat','Altres recursos d''informació');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (12,'cat','Registers');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (13,'cat','Physical Samples');

INSERT INTO GroupsDes (iddes, langid, label) VALUES (-1,'cat','Guest');
INSERT INTO GroupsDes (iddes, langid, label) VALUES (0,'cat','Intranet');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
INSERT INTO Languages (id, name, isinspire) VALUES ('chi','中文', 'n');

-- Take care to table ID (related to other loc files)
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (1,'chi','Maps & graphics');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (2,'chi','Datasets');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (3,'chi','Interactive resources');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (4,'chi','Applications');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (5,'chi','Case studies, best practices');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (6,'chi','Conference proceedings');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (7,'chi','Photo');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (8,'chi','Audio/Video');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (9,'chi','Directories');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (10,'chi','Other information resources');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (12,'chi','Registers');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (13,'chi','Physical Samples');

INSERT INTO GroupsDes (iddes, langid, label) VALUES (-1,'chi','Guest');
INSERT INTO GroupsDes (iddes, langid, label) VALUES (0,'chi','Intranet');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
INSERT INTO Languages (id, name, isinspire) VALUES ('dan','Dansk', 'y');

-- Take care to table ID (related to other loc files)
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (1,'dan','Kort & grafik');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (2,'dan','Datasæt');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (3,'dan','Interaktive ressourcer');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (4,'dan','Applikationer');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (5,'dan','Case studies, best practices');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (6,'dan','Konference proceedings');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (7,'dan','Foto');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (8,'dan','Audio/Video');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (9,'dan','Kataloger');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (10,'dan','Andre information ressourcer');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (12,'dan','Registere');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (13,'dan','Fysiske prøver');

INSERT INTO GroupsDes (iddes, langid, label) VALUES (-1,'dan','Gæst');
INSERT INTO GroupsDes (iddes, langid, label) VALUES (0,'dan','Intranet');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
INSERT INTO Languages (id, name, isinspire) VALUES ('dut','Nederlands', 'y');

-- Take care to table ID (related to other loc files)
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (1,'dut','Kaarten & afbeeldingen');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (2,'dut','Datasets');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (3,'dut','Interactieve kaarten');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (4,'dut','Toepassingen');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (5,'dut','Case studies, best practices');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (6,'dut','Conferentie handelingen');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (7,'dut','Fotos');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (8,'dut','Audio/Video');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (9,'dut','Catalogi');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (10,'dut','Andere informatie bronnen');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (12,'dut','Registers');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (13,'dut','Fysieke monsters');

INSERT INTO GroupsDes (iddes, langid, label) VALUES (-1,'dut','Gast');
INSERT INTO GroupsDes (iddes, langid, label) VALUES (0,'dut','Intranet');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
INSERT INTO Languages (id, name, isinspire) VALUES ('eng','English', 'y');

-- Take care to table ID (related to other loc files)
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (1,'eng','Maps & graphics');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (2,'eng','Datasets');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (3,'eng','Interactive resources');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (4,'eng','Applications');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (5,'eng','Case studies, best practices');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (6,'eng','Conference proceedings');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (7,'eng','Photo');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (8,'eng','Audio/Video');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (9,'eng','Directories');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (10,'eng','Other information resources');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (12,'eng','Registers');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (13,'eng','Physical Samples');

INSERT INTO GroupsDes (iddes, langid, label) VALUES (-1,'eng','Guest');
INSERT INTO GroupsDes (iddes, langid, label) VALUES (0,'eng','Intranet');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
INSERT INTO Languages (id, name, isinspire) VALUES ('fin','suomi', 'y');

-- Take care to table ID (related to other loc files)
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (1,'fin','Kartat & kuvat');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (2,'fin','Tietoaineistot');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (3,'fin','Vuorovaikutteiset resurssit');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (4,'fin','Sovellukset');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (5,'fin','Esimerkkitapaukset, parhaat käytännöt');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (6,'fin','Konferenssijulkaisut');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (7,'fin','Valokuvat');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (8,'fin','Äänitteet / Videot');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (9,'fin','Hakemistot');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (10,'fin','Other information resources');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (12,'fin','Registers');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (13,'fin','Fyysisiä näytteitä');

INSERT INTO GroupsDes (iddes, langid, label) VALUES (-1,'fin','Vierailija');
INSERT INTO GroupsDes (iddes, langid, label) VALUES (0,'fin','Intranet');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
INSERT INTO Languages (id, name, isinspire) VALUES ('fre','Français', 'y');

-- Take care to table ID (related to other loc files)
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (2,'fre','Jeux de données');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (1,'fre','Cartes & graphiques');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (7,'fre','Photographies');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (10,'fre','Autres ressources');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (5,'fre','Etude de cas, meilleures pratiques');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (8,'fre','Vidéo/Audio');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (9,'fre','Répertoires');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (4,'fre','Applications');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (3,'fre','Ressources interactives');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (6,'fre','Conférences');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (12,'fre','Annuaires');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (13,'fre','Echantillons physiques');

INSERT INTO GroupsDes (iddes, langid, label) VALUES (-1,'fre','Invité');
INSERT INTO GroupsDes (iddes, langid, label) VALUES (0,'fre','Intranet');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
INSERT INTO Languages (id, name, isinspire) VALUES ('ger','Deutsch', 'y');

-- Take care to table ID (related to other loc files)
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (1,'ger','Karten & Grafiken');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (2,'ger','Datensets');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (3,'ger','Interaktive Resourcen');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (4,'ger','Applikationen');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (5,'ger','Fallstudien');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (6,'ger','Konferenz Ergebnisse');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (7,'ger','Photo');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (8,'ger','Audio/Video');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (9,'ger','Verzeichnisse');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (10,'ger','Andere Resourcen');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (12,'ger','Registers');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (13,'ger','Physischen Proben');

INSERT INTO GroupsDes (iddes, langid, label) VALUES (-1,'ger','Gast');
INSERT INTO GroupsDes (iddes, langid, label) VALUES (0,'ger','Intranet');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
INSERT INTO Languages (id, name, isinspire) VALUES ('ita','Italiano', 'y');

-- Take care to table ID (related to other loc files)
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (1,'ita','Mappe e grafici');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (2,'ita','Datasets');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (3,'ita','Risorse interattive');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (4,'ita','Applicazioni');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (5,'ita','Casi di studio');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (6,'ita','Atti di conferenze');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (7,'ita','Fotografie');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (8,'ita','Audio/Video');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (9,'ita','Archivi');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (10,'ita','Altre risorse di informazione');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (12,'ita','Registri');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (13,'ita','campioni fisici');

INSERT INTO GroupsDes (iddes, langid, label) VALUES (-1,'ita','Visitatore');
INSERT INTO GroupsDes (iddes, langid, label) VALUES (0,'ita','Intranet');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
INSERT INTO Languages (id, name, isinspire) VALUES ('nor','norsk', 'n');

-- Take care to table ID (related to other loc files)
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (1,'nor','Kart og grafikk');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (2,'nor','Datasett');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (3,'nor','Interakive ressurser');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (4,'nor','Applikasjoner');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (5,'nor','Studier og anbefalinger');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (6,'nor','Konferanseresultater');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (7,'nor','Fotografier');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (8,'nor','Audio/Video');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (9,'nor','Kataloger');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (10,'nor','Andre ressurser');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (12,'nor','Registers');
INSERT INTO CategoriesDes (iddes, langid, label) VALUES (13,'nor','Physical Samples');

INSERT INTO GroupsDes (iddes, langid, label) VALUES (-1,'nor','Gjest');
INSERT INTO GroupsDes (iddes, langid, label) VALUES (0,'nor','Intranett');
Expand Down
Loading
Loading