I am trying to add another tab in the Metadata Editor. Basically, I am trying to add a tab somewhere here
with two additional fields that will be saved. Can this be done?
Like so?
I did this by updating the myprofile files. the attached zip has the files for it.
Hi Marten,
I'm also going through the same situation. while saving the myprofile metadata I'm getting the following error. any help will be appreciated. ( I have added the console error as well )
That did the trick, moving the custom profile to the top of the list. Thank you kind sir!
The interrogation rule itself looks ok. However, if you also have the base ISO 19115 profile active AND if the interrogation rule for ISO 19115 is before your custom profile, the metadata may still be interpreted as ISO 19115. That is because the rule for ISO 19115 is:
{ key: "iso-19115", requiredPath: "esri/dijit/metadata/types/iso/base/DataDocumentType", interrogationRules: [{ path: "/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification", must: true }] },
And means your ISO-based metadata will still be recognized by this rule. You have two options:
One additional note. The Geoportal Server will look at the metadata and based on some rules decide what is the best fitting profile. If you create a profile for example of ISO 19115, you will want to set the metadata standard/version to your profile. OR if you have additional elements you can test for those.
In ...\geoportal\app\context\metadata-editor.js you will find the typeDefinitions. You added your custom profile here already. Look for the interrogationRules field in your custom profile and change its content to one or more paths, values, and must fields so that your profile is distinguished from other profiles.
@Marten here's a LINK to the my catalog, hopefully someone can figure out what I am missing because I sure haven't figured it out yet.
screen share works for me, would be a lot more educational rather than me uploading my files here 🙂
Shall we organize a screen share session? Will be quicker than going back and forth guessing what steps you take. OR, if you can zip your profile directory and attach here?
When I go to Network, there is only one item and when I go to preview, it says this:
I was comparing the path in the interrogationRules to the ones above, but all is same, nothing stands out.
Typically this means the framework cannot find one of those JS/HTML objects that define a piece of the editor. What helps me with troubleshooting this is to follow the network traffic in the browser developer tools. This error will typically be accompanied by an HTTP 404 error to some .js file in the editor definition tree. The request before that failed one is in most cases the file that makes a bad reference or is missing the reference.
When referencing an object in GXE you need to decide whether to reference the definition as included in the JS API or to reference your own in the GXE 'tree'. Referencing objects in the JS API means you don't need to go to all the details in that object. Think for example contact info (ISO - CI_Contact). If you're happy with how the JS API defines it, you can reference CI_Contact and automatically include the elements it is composed of by including something like this in your definition:
HTML template:
<div data-dojo-type="esri/dijit/metadata/form/iso/ObjectReference" data-dojo-props="target:'gmd:onlineResource',minOccurs:0, label:'${i18nIso.CI_Contact.onlineResource}'"> <div data-dojo-type="esri/dijit/metadata/types/iso/gmd/citation/CI_OnlineResource"> </div> </div>
The key is the data-dojo-type attribute. That is the object reference in the JS API, recognizable with esri/dijit/metadata/types/iso as the path to the ISO definition in that JS API.
If you want to change one of the elements in CI_Contact, you would create a local copy of the element with the changes and then replace the reference to JS API with one to your local app: app/gxe/types/iso.
It is important to also look at the JS file corresponding to the object that references CI_Contact and update the reference there to the local one. CI_Contact is referenced for example in CI_ResponsibleParty. That reference could be to the default one in the JS API by including the full esri/dijit... path OR it could be a reference to you local customized version by including the app/gxe path or a relative path. Since CI_ResponsibleParty and CI_Contact are in the same folder, that relative reference would be ./CI_Contact.
Marten,
I have two more questions. Sometimes but not always, when choosing the custom 'MyProfile', I get this error
Also, when I try to save the profile, I get this error
Am I missing some configuration like in the case of the metadata-editor?
Marten, thank you for your time and effort. I'll accept the original response as the solution 🙂
myprofile is based on ISO 19115, but the same mechanism applies if you want to extend the ArcGIS metadata profile.
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
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 }] }
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
Is the myprofile profile supposed to be here or should I choose one of the above templates /profiles?
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.
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.
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?
Thank you for the detailed reply, I really appreciate it.
hi, this is indeed possible, but requires a few things:
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.