Editing the geoportal server catalog

3696
22
Jump to solution
02-28-2021 04:24 PM
by Anonymous User
Not applicable

I am trying to add another tab in the Metadata Editor. Basically, I am trying to add a tab somewhere here

NovicaJ_0-1614558300927.png

with two additional fields that will be saved. Can this be done?

0 Kudos
1 Solution

Accepted Solutions
Marten
by
Occasional Contributor

Like so?

Marten_1-1614716616059.png

I did this by updating the myprofile files. the attached zip has the files for it.

View solution in original post

0 Kudos
22 Replies
Marten
by
Occasional Contributor

hi, this is indeed possible, but requires a few things:

  • If you are adding new elements/attributes, the underlying metadata specification needs to include your additional information also. can you share more on what items you would want to include on the new tab?
  • Geoportal Server includes a number of metadata formats. Although you can build an editor from scratch, typically you would start from one of the existing ones. Which metadata standard are you looking to extend?
  • You will find the configuration files/code for the editor in : ../geoportal/app/gxe/types. In fact there is a sample type 'myprofile' included when installing Geoportal Server.
  • The metadata editor (gxe = Geoportal XML Editor, it can be made to edit pretty much any XML document) uses Dojo and you will find JavaScript files declaring classes and components and a related template file that lays out the components in the preferred order.
  • It is best to start by looking at the 'myprofile' editor to see some of the foundations of gxe. You'll see esri/dijit/metadata/form/Tabs that results in tabs for each of the elements included and then individual dijit references for the sections in the tabs. While you could build an entire editor in a single file, you would be repeating a lot of elements. What the gxe does is break out those reusable elements all the way from a multi-select option list to an entire metadata identification section.
0 Kudos
by Anonymous User
Not applicable

Hi Marten,

Thank you for the detailed reply, I really appreciate it. 

  • I am looking to include two new items. One would be an input field for Price and the other one would be a Tax dropdown menu with 2 or 3 items in the dropdown - number with percentages (ex. 5%; 18%; 0%). 
  • I am looking to extend any metadata, which ever one is simplest to modify /edit. 
  • I did find the 'myprofile2' but I cannot find the esri/dijit/metadata/form/Tabs. I presume if I want to add a new tab or new field in an existing Tab, I need to do so in the /Tabs?
0 Kudos
Marten
by
Occasional Contributor

Like so?

Marten_1-1614716616059.png

I did this by updating the myprofile files. the attached zip has the files for it.

0 Kudos
by Anonymous User
Not applicable

Yes, exactly like so. Wow, thank you. I now can examine the files and use it for myself. 

So how does one apply these new files /tabs /fields to the existing geoportal? I overwrite the existing 'myprofile' or is there another process?

0 Kudos
Marten
by
Occasional Contributor

yep! just replace the existing myprofile folder with the contents of the zip. no need even to restart Tomcat. Just a 'clear browser cache' in Chrome will show the updated editor.

0 Kudos
by Anonymous User
Not applicable

I must be missing something, I did replace the existing myprofile folder but it's the same. I can't get the Ecommerce to show. 

0 Kudos
by Anonymous User
Not applicable

So, I login and go to the Admin menu, I choose Create Metadata and choose the New Document option. 

From there, I have the following options

NovicaJ_0-1614814398333.png

Is the myprofile profile supposed to be here or should I choose one of the above templates /profiles?

0 Kudos
Marten
by
Occasional Contributor

ah, that means you have not yet configured the geoportal to consider myprofile yet. to do so, you will need to edit geoportal\app\context\metadata-editor.js. That file lists the known and used profiles. You will see a list 'allowedTypeKeys' with quite some values. Those values are the keys of the active metadata profiles in your geoportal. You can remove some you don't need and then add "myprofile-iso-19115" to the list.

Then notice the list called 'typeDefinitions'. The entries in this list describe the different metadata profiles by telling geoportal where to find a profile (in the webapp structure) and how to recognize XML to be of the defined profile by an XPath expression ("path"), a criterion ("must":true) and sometimes a value. In that list insert the following JSON object:

{
  key: "myprofile-iso-19115",
  requiredPath: "app/gxe/types/myprofile/base/DataDocumentType",
  interrogationRules: [{
    path: "/gmd:MD_Metadata/gmd:metadataStandardName/gco:CharacterString",
    value: "MyProfile",
    must: true
  }]
}

 

 

0 Kudos
by Anonymous User
Not applicable

Yes, that did the trick. I did not know of the metadata-editor.js - Thank you kind sir!
One last question, this custom profile you have provided me with, is based of which profile? I'd like to extend the 'Arcgis metadata' but I will need to examine the custom profile you have made so that I can do it on my own. I need to extend this type 

NovicaJ_2-1614815522406.png

 

0 Kudos