How do you create INSPIRE Metadata using the new ArcGIS metadata editor? This tutorial provides step-by-step guidance. The new ArcGIS metadata editor, available in ArcGIS Online and ArcGIS Enterprise 11.3+, makes creating metadata in compliance with the European Commission's Open Data Directive and INSPIRE Directive easier than ever.
This lesson assumes that you have content in ArcGIS Enterprise or Online, for example, a hosted Feature Layer, and your organization's administrator has enabled metadata with the European ‘INSPIRE Metadata Directive’ style.
Administrators configure the metadata style in the organization settings.Administrators configure the metadata style in the organization settings.Administrators configure the metadata style in the organization settings.
Verify that you are signed in, have privileges to create content, and that your organization has enabled metadata.
From the 'My Content' tab of the content page, click ‘View Details’ of the item you want to create INSPIRE metadata for.
Review Layer Settings
Review the item Settings and update as needed. Click on the item ‘Settings’ tab.
The following are best practices[1] for shared authoritative content:
As appropriate, mark the item as ‘’Authoritative’ to recommend the use of this item.
Check the box to enable delete protection. Click ‘Save.’
As appropriate, ensure editing is disabled or approve the layer to be shared when editing is enabled.
At the bottom of the dialog, check the ‘Export Data’ box to allow others to export the data. This will enable downloads for your open data in different formats.
Click ‘Save,’ then return to the item ‘Overview’ tab.
When ready, ‘Share’ the item with everyone (public).
Create INSPIRE Metadata
Click the ‘Metadata’ button to open the metadata editor. Complete the metadata elements on the Essential tab as described below.[2]
The editor has two main tabs: Essential metadata and All metadata. Essential metadata includes all the required elements for the INSPIRE metadata style.
When you open the editor for the first time, existing values are populated from the item information: title, tags, snippet, description, accessinformation, licenseinfo, and extent. For your convenience, some INSPIRE-required elements are pre-populated with static values, such as the keyword thesaurus title and publication date.
If you published the item from a layer in ArcGIS Pro that already contained metadata, the metadata flows to ArcGIS Online.
Required elements have an asterisk (*) next to them. While not required, suggested metadata elements, such as item thumbnails, are included to improve content usability.
In the Essential metadata tab, complete the required and suggested elements.
Steps to Fulfill INSPIRE Metadata Requirements
Item Description elements
Title*
The title is automatically provided from the item information (updating the title in the metadata editor does not change the item title).
A clear title conveys the topic, location, and date when relevant. Follow the pattern: "LayerTopic of Jurisdiction" and include time period when relevant. learn more
Required
Summary (Purpose)
Provide a short yet descriptive summary to be displayed when content is shared. Aim for a 7th-9th grade reading level to reach a broad audience. Use a free readability analysis tool to test your text. Include keywords different from those in your title to increase discoverability. learn more
Suggested
Thumbnail
Click 'Edit Thumbnail' to add an image or create thumbnail from map. The standard thumbnail size is 600 x 400 px. The thumbnail image is displayed on layout cards and content views. learn more
Suggested
Description (Abstract)*
Tell visitors about your content. Describe “what, where, when, why, who, and how” about the data. If appropriate, consider including the definition from the INSPIRE theme register http://inspire.ec.europa.eu/theme as part of your abstract. learn more
Required
Tags
Add narrower terms that could be used to search for the resource.
Suggested
Topic Category(s)*
Assign one or more ISO Categories for browsing and discovery.
Required
Credits (Attribution)
Acknowledge the source of the content and other support.
Suggested
Use Limitation (Terms of Use)
Add any general terms of use. For example, enter “CC0” (without quotes). If you add a Creative Commons license (CC0, CC BY, CC BY-SA) by either the name or the URL and share to a Hub catalog, the item’s dataset page will display the Creative Commons license icon and link to the appropriate license details web page. If you add an Open Data Commons license (PDDL, ODbL, ODC-By), the dataset page will display the license name and link to the appropriate license details web page.
Suggested
Constraints
INSPIRE Limitations On Public Access*
Choose an ‘Access Constraint’ statement from the dropdown menu, for example, choose “no limitations to public access.”
If public access is limited, choose which part of Article 13 of the INSPIRE Directive 2007/2/EC provides the basis for those limitations. If public access is limited, you must describe the reason for the legal constraints. Go to the ALL metadata tab Constraints section. Click ‘Add another section card’ to choose Legal Constraints, then add a free-text description in Other Constraints. See the INSPIRE Registry for definitions of Limitations on public access https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess
Required
INSPIRE Conditions Applying to Access and Use*
Choose a ‘Use Limitation’ statement from the dropdown menu, for example, choose “no conditions to access and use.” If there are known conditions, these must be described.
Required
Use Limitation
Use Limitation appearing in the Item Description also appears here. These values are synced - changes in either update the other.
Update the Use Limitation as needed. It is the objective of Open Data Directive (EU) 2019/1024 to promote the use of standard public licences available online for re-using public sector information. The European Commission’s Guidelines on recommended standard licences identify Creative Commons (‘CC’) licences as an example of recommended standard public licences.
Suggested
Extents
Geographic Extent*
If an extent hasn’t already been provided, click the ’Select extent’ button to add a bounding box location, or provide the bounding coordinates in the appropriate text boxes in decimal degrees, based on the WGS84 coordinate reference system.
Required
Temporal Extent
If a time period or set of dates better represents the item's temporal reference than the dates provided in the Citation, click ‘Overview > Extents > Extents’ to jump to this section in All metadata. Click + Add another extent to add either Temporal Extent or Temporal Instant to provide this information.
Conditional - as needed, use the All metadata tab to add a temporal extent
Keywords
Theme Keywords*
Click the ’Lookup’ button to open the INSPIRE Keyword Lookup dialog. In the dialog, as needed, choose an appropriate language from the drop-down list then select at least one keyword from the INSPIRE Spatial Data Themes vocabulary. Click ‘Accept.’
Required
Thesaurus Title*
The INSPIRE GEMET Keyword Thesaurus title is automatically provided.
Required
Thesaurus Dates*
For the GEMET thesaurus, the publication date (“2008-06-01”) is automatically provided.
Required
Resource Info
Details > Spatial Representation Type*
Choose an appropriate value, for example, select ‘Vector’ for feature layers.
Required
Resource Contact Organization Name*
Enter the name of the organisation responsible for the dataset.
Required
Resource Contact Role*
Choose an appropriate value from the drop-down list, for example, ‘Point of Contact’.
Required
Resource Contact Email*
Enter an email address for the resource contact.
Required
Resource Language*
Choose one of the official EU languages from the dropdown list.
Required
Citation
Citation Title*
The title automatically provided in the Item Description also appears here. These titles are synced - changes in either update the other.
Required
Citation Identifiers*
Enter "publication” (enter exactly as written, without quotes).
Required
Citation Dates*
Choose a citation date type (Created, Published, or Updated) and add an appropriate date. > TIP: Click the clock icon to add the current date.
Required
Distribution**
Digital Transfer Options: Online Distribution*
The access link/URL to the item web service is automatically provided.
Required
Distribution Format Name*
Enter a format name, for example, “GeoService” without quotes.
Required
Distribution Format Version*
Enter a format version, for example, “not applicable” without quotes.
Required
Quality
Lineage Statement*
Enter a lineage statement, for example, “Data were loaded from source data into INSPIRE GDB template, then published to ArcGIS Online.”
Required
Report Type*
Choose “Domain Consistency” from the dropdown list.
Required
Conformance Result - Outcome*
Describe the outcome of testing. If your dataset is conformant, choose “Pass” from the dropdown list; otherwise, choose “Fail.”
Required
Conformance Result - Explanation*
A citation of the specification against which conformity was tested, for example, enter: “See the referenced specification” (without quotes).
Required
Report Specification Title*
The INSPIRE specification title is automatically provided; as needed, click ‘Lookup’ to choose the report name in a different EU language.
Required
Report Specification Dates*
The required INSPIRE specification date is automatically provided and cannot be edited.
Required
Scope of Report*
As needed, choose "Dataset" or "Series" from the drop-down list.
Required
Spatial Info
Coordinate Reference System - Unique Identifier Code*
Enter the spatial reference code “WGS84” (enter exactly as written, without quotes).
Required
Metadata Details
Metadata File Identifier*
A globally unique identifier (GUID) for the item is automatically provided.
Required
Metadata Date*
Choose the date when the metadata was last updated. > TIP: Click the clock icon to add the current date.
Required
Metadata Language*
Choose the language in which the metadata elements are expressed; choose the language from the dropdown menu.
Required
Metadata Character Set*
ArcGIS metadata is always encoded in UTF-8 format. The value is pre-populated.
Required
Metadata Scope (Hierarchy)*
If the item you are describing is a layer, "Dataset" should already be selected (if it is not already, select "Dataset" from the drop-down list). If the item you describe is not a dataset, click the drop-down list and choose an appropriate value.
Required
Metadata Contact Organization*
Enter the name of the organisation responsible for the metadata as free text.
Required
Metadata Contact Role*
Choose an appropriate contact role value in the Role drop-down list. For example, choose “Point of Contact.”
Required
Metadata Contact Email*
Enter an email address for the metadata contact.
Required
Additional Distributions**
Users can easily reuse ArcGIS REST services in third-party apps that support the GeoServices REST open specification — consult the documentation provided with the third-party app.
The INSPIRE Directive requires data providers to also share “View” and “Download” services based on OGC specifications. In the past, these services required separate metadata documents. Today, INSPIRE allows a more straightforward approach by adding additional distributions in the dataset metadata (no longer requiring separate metadata for the services). INSPIRE technical guidance calls this 'Linked service metadata for datasets and dataset series.' [3]
Here’s how:
Create the View Service – After completing the above metadata on the parent feature layer, publish a Tile Layer[4] as a child service (or use an existing WMS or WMTS). Share the Tile Layer item with everyone (public), then copy the WTMS URL from the bottom of the item overview page. Keep this URL handy; you will use it in step #3.
Create the Download Service – Return to the parent layer and publish an OGC Feature Layer as a child service. Share the OGC Feature Layer item with everyone (public), then copy the URL from the bottom of the item overview page. Keep this URL handy; you will use it in the following step.
Update the Dataset Metadata – Return to the parent layer and open the metadata editor. Click the ‘All metadata’ tab and choose ‘Distribution’ from the left sidebar. Complete the following information:
The first ‘Online Distribution’ > ‘Access Link/URL’ automatically provides the GeoServices REST URL.
Click the ‘+’ next to the ‘Online Distribution’ heading to add another distribution.
Access Link/URL – paste the URL of the WMTS from the Tile Layer from the previous step.
Connection Protocol [5] – enter the label “OGC Web Map Tile Service” exactly as written, without quotes.
Application Profile – enter “View Service” exactly as written, without quotes.
Protocol Name – enter “INSPIRE View service (WMTS)”
Distribution Function – choose “Information” from the drop-down list.
Click the ‘+’ next to the ‘Online Distribution’ heading to add another distribution.
Access Link/URL – paste the URL of the OGC Feature Layer from the previous step.
Connection Protocol – enter the label “OGC API-Features” exactly as written, without quotes.
Application Profile – enter “Download Service” exactly as written, without quotes.
Protocol Name – enter “INSPIRE Download service (OAPIF)”
Distribution Function – choose “Download” from the drop-down list.
Click 'Save' Then View Your Metadata
Click ‘Save’ to save the metadata.
Click the three-dot ellipse button and choose ‘View XML’ to view the standards-based metadata in a separate tab.
Check Your Metadata Using the INSPIRE Reference Validator
You will use either the metadata URL or download the metadata XML file for testing.
For publicly shared items, copy the URL from your browser menu bar up to ?format=default (do not include the &token= ).
Alternatively, use your browser’s ‘File > Save As’ menu to save the XML file for use with the INSPIRE Reference Validator.
Open the official INSPIRE Reference Validator in a web browser and click ’Test your data, services, or metadata’ to start a test. Advanced options include Conformance Class 8: INSPIRE data sets and data set series linked service metadata (for additional distributions described above).
Add Your Metadata To Test
Choose ‘Remote file’ or ‘File upload’ then follow instructions to provide your metadata to test and click ’Start test’.
Check the Status of Your Report
The validator runs its tests and generates a report. View the results to see your metadata "Passed" inspection. It may fail some tests if you left metadata elements blank or incorrectly filled in elements when creating your metadata. Click the “See report” link to expand sections and view detailed results. Then, return to the ArcGIS metadata editor and update your metadata as needed.
You're Finished!
For your convenience, you can download the example metadata file used in this lesson along with the Validator 'Passed' report (generated 18-May-2021) to assist you in your metadata creation.
[2] Note, in the ArcGIS Online 2024 Spring release, the metadata editor (Classic) can be accessed from the metadata button drop-down.
[3] The distributions are checked in the INSPIRE Validator Conformance Class 8: 'INSPIRE data sets and data set series linked service metadata.’ It is recommended that you use this simplified approach.
';
}
}
}
catch(e){
}
}
}
if (newSub.getAttribute("slang").toLowerCase() != code_l.toLowerCase()) {
if (trLabelsHtml != "") {
var labelSname = "";
if(labelEle[i].querySelector("ul li:nth-child(1)").getAttribute("aria-hidden")){
labelSname = labelEle[i].querySelector("ul li:nth-child(1)").outerHTML;
}
labelEle[i].innerHTML = "";
labelEle[i].innerHTML = labelSname + trLabelsHtml;
}
}
}
}
}
catch(e){
}
}
}
/* V 2.0:3 = Store not translated reply id */
if(lingoRSXML.snapshotLength == 0){
if($scope.falseReplyID == "") {
$scope.falseReplyID = value;
}
}
/* Get translated Body of Replies/Comments */
var lingoRBXML = doc.evaluate(lingoRBExp, doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for(var i=0;i 0) {
var attachDiv = rootElement.querySelector('div.lia-quilt-row-main').querySelector('div.custom-attachments');
if (attachDiv) {
attachDiv = attachDiv.outerHTML;
}
else if(rootElement.querySelector('div.lia-quilt-row-main').querySelectorAll('#attachments').length > 0){
if ("BlogArticlePage" == "BlogArticlePage") {
attachDiv = rootElement.querySelector('div.lia-quilt-row-main .lia-message-body-content').querySelector('#attachments');
if (attachDiv) {
attachDiv = attachDiv.outerHTML;
}
else{
attachDiv = "";
}
}else{
attachDiv = rootElement.querySelector('div.lia-quilt-row-main').querySelector('#attachments').outerHTML;
}
}
else {
attachDiv = "";
}
/* Feedback Div */
var feedbackDiv = "";
var feedbackDivs = rootElement.querySelector('div.lia-quilt-row-main').querySelectorAll('div.lia-panel-feedback-banner-safe');
if (feedbackDivs.length > 0) {
for (var k = 0; k < feedbackDivs.length; k++) {
feedbackDiv = feedbackDiv + feedbackDivs[k].outerHTML;
}
}
}
else {
var attachDiv = rootElement.querySelector('div.lia-message-body-content').querySelector('div.Attachments.preview-attachments');
if (attachDiv) {
attachDiv = attachDiv.outerHTML;
} else {
attachDiv = "";
}
/* Everyone tags links */
if (document.querySelectorAll("div.TagList").length > 0){
var everyoneTagslink = document.querySelector('div.lia-quilt-row-main').querySelector(".MessageTagsTaplet .TagList");
if ((everyoneTagslink != null)||(everyoneTagslink != undefined)){
everyoneTagslink = everyoneTagslink.outerHTML;
}
else{
everyoneTagslink = "";
}
}
/* Feedback Div */
var feedbackDiv = "";
var feedbackDivs = rootElement.querySelector('div.lia-message-body-content').querySelectorAll('div.lia-panel-feedback-banner-safe');
if (feedbackDivs.length > 0) {
for (var m = 0; m < feedbackDivs.length; m++) {
feedbackDiv = feedbackDiv + feedbackDivs[m].outerHTML;
}
}
}
}
} catch (e) {
}
if (body_L == "") {
/* V 2.0:7 Replacing translated video data with source video data */
var newBodyVideoData = newBody.querySelectorAll('div[class*="video-embed"]');
angular.forEach($scope.videoData[value], function (sourceVideoElement, index) {
if (index <= (newBodyVideoData.length - 1)) {
newBodyVideoData[index].outerHTML = sourceVideoElement.outerHTML
}
});
/* V 2.0:7 = Replacing translated image data with source data */
var newBodyImageData = newBody.querySelectorAll('[class*="lia-image"]');
angular.forEach($scope.imageData[value], function (sourceImgElement, index) {
if (index <= (newBodyImageData.length - 1)) {
newBodyImageData[index].outerHTML = sourceImgElement.outerHTML;
}
});
/* V 2.0:7 = Replacing translated pre tag data with source data */
var newBodyPreTagData = newBody.querySelectorAll('pre');
angular.forEach($scope.preTagData[value], function (sourcePreTagElement, index) {
if (index <= (newBodyPreTagData.length - 1)) {
newBodyPreTagData[index].outerHTML = sourcePreTagElement.outerHTML;
}
});
}
var copyBodySubject = false;
if (body_L == "") {
copyBodySubject = true;
body_L = newBody.innerHTML;
}
/* This code is written as part of video fix by iTalent */
/* try{
var iframeHTMLText = body_L;
var searchIframeText = "<IFRAME";
var foundiFrameTag;
if (iframeHTMLText.indexOf(searchIframeText) > -1) {
foundiFrameTag = decodeHTMLEntities(iframeHTMLText);
foundiFrameTag = foundiFrameTag.split('src="')[1];
body_L = foundiFrameTag;
}
}
catch(e){
} */
/* This code is placed to remove the extra meta tag adding in the UI*/
try{
body_L = body_L.replace('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />','');
}
catch(e){
}
/** We should not replace the source content if user profile language and selected target language matches with source language **/
if(showTrContent) {
var compiled = false;
rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = null
if("BlogArticlePage"=="IdeaPage"){
// var customAttachDiv = '';
rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = body_L + feedbackDiv ;
$compile(rootElement.querySelectorAll('div.lia-message-body-content')[0])($scope);
compiled = true;
/* Attach atttach div */
// document.querySelector("div.translation-attachments-"+value).innerHTML = attachDiv;
rootElement.querySelectorAll('div.lia-message-body-content')[0].insertAdjacentHTML('afterend',attachDiv);
if(rootElement.querySelectorAll('div.lia-quilt-idea-message .lia-message-body .lia-attachments-message').length > 1){
rootElement.querySelectorAll('div.lia-quilt-idea-message .lia-message-body .lia-attachments-message')[1].remove();
}
} else {
if("BlogArticlePage"=="TkbArticlePage"){
rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = body_L + feedbackDiv ;
}else{
rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = body_L + feedbackDiv + attachDiv;
compiled = true;
}
}
/* Destroy and recreate OOyala player videos to restore the videos in target languages which is written by iTalent as part of iTrack LILICON-79 */ /* Destroy and recreate OOyala player videos */
try{
// $scope.videoData[value][0].querySelector("div").getAttribute("id");
for(var vidIndex=0; vidIndex<$scope.videoData[value].length; vidIndex++){
if( $scope.videoData[value][vidIndex].querySelector("div") != null){
var containerId = LITHIUM.OOYALA.players[$scope.videoData[value][vidIndex].querySelector("div").getAttribute("id")].containerId;
videoId = LITHIUM.OOYALA.players[$scope.videoData[value][vidIndex].querySelector("div").getAttribute("id")].videoId;
/** Get the Video object */
vid = OO.Player.create(containerId,videoId);
/** Destroy the video **/
vid.destroy();
/** recreate in the same position */
var vid = OO.Player.create(containerId,videoId);
}
}
}
catch(e){
}
try{
for(var vidIndex=0; vidIndex<($scope.videoData[value].length); vidIndex++){
if($scope.videoData[value][vidIndex].querySelector('video-js') != null){
var data_id = $scope.videoData[value][vidIndex].querySelector('video-js').getAttribute('data-video-id');
var data_account = $scope.videoData[value][vidIndex].querySelector('video-js').getAttribute('data-account');
var data_palyer = $scope.videoData[value][vidIndex].querySelector('video-js').getAttribute('data-player');
var div = document.createElement('div');
div.id = "brightcove";
div.class = "brightcove-player";
div.innerHTML =
'(view in my videos)'
var data = div.getElementsByClassName("video-js");
var script = document.createElement('script');
script.src = "https://players.brightcove.net/" + data_account + "/" + data_palyer + "_default/index.min.js";
for(var i=0;i< data.length;i++){
videodata.push(data[i]);
}
}
}
for(var i=0;i< videodata.length;i++){
document.getElementsByClassName('lia-vid-container')[i].innerHTML = videodata[i].outerHTML;
document.body.appendChild(script);
}
}
catch(e){
}
if(!compiled){
/* Re compile html */
$compile(rootElement.querySelectorAll('div.lia-message-body-content')[0])($scope);
}
}
if (code_l.toLowerCase() != newBody.getAttribute("slang").toLowerCase()) {
/* Adding Translation flag */
var tr_obj = $filter('filter')($scope.sourceLangList, function (obj_l) {
return obj_l.code.toLowerCase() === newBody.getAttribute("slang").toLowerCase()
});
if (tr_obj.length > 0) {
tr_text = "Esri may utilize third parties to translate your data and/or imagery to facilitate communication across different languages.".replace(/lilicon-trans-text/g, tr_obj[0].title);
try {
if ($scope.wootMessages[$rootScope.profLang] != undefined) {
tr_text = $scope.wootMessages[$rootScope.profLang].replace(/lilicon-trans-text/g, tr_obj[0].title);
}
} catch (e) {
}
} else {
//tr_text = "This message was translated for your convenience!";
tr_text = "Esri may utilize third parties to translate your data and/or imagery to facilitate communication across different languages.";
}
try {
if (!document.getElementById("tr-msz-" + value)) {
var tr_para = document.createElement("P");
tr_para.setAttribute("id", "tr-msz-" + value);
tr_para.setAttribute("class", "tr-msz");
tr_para.style.textAlign = 'justify';
var tr_fTag = document.createElement("IMG");
tr_fTag.setAttribute("class", "tFlag");
tr_fTag.setAttribute("src", "/html/assets/langTrFlag.PNG");
tr_fTag.style.marginRight = "5px";
tr_fTag.style.height = "14px";
tr_para.appendChild(tr_fTag);
var tr_textNode = document.createTextNode(tr_text);
tr_para.appendChild(tr_textNode);
/* Woot message only for multi source */
if(rootElement.querySelector(".lia-quilt-forum-message")){
rootElement.querySelector(".lia-quilt-forum-message").appendChild(tr_para);
} else if(rootElement.querySelector(".lia-message-view-blog-topic-message")) {
rootElement.querySelector(".lia-message-view-blog-topic-message").appendChild(tr_para);
} else if(rootElement.querySelector(".lia-quilt-blog-reply-message")){
rootElement.querySelector(".lia-quilt-blog-reply-message").appendChild(tr_para);
} else if(rootElement.querySelector(".lia-quilt-tkb-message")){
rootElement.querySelector(".lia-quilt-tkb-message").appendChild(tr_para);
} else if(rootElement.querySelector(".lia-quilt-tkb-reply-message")){
rootElement.querySelector(".lia-quilt-tkb-reply-message").insertBefore(tr_para,rootElement.querySelector(".lia-quilt-row.lia-quilt-row-footer"));
} else if(rootElement.querySelector(".lia-quilt-idea-message")){
rootElement.querySelector(".lia-quilt-idea-message").appendChild(tr_para);
} else if(rootElement.querySelector('.lia-quilt-occasion-message')){
rootElement.querySelector('.lia-quilt-occasion-message').appendChild(tr_para);
}
else {
if (rootElement.querySelectorAll('div.lia-quilt-row-footer').length > 0) {
rootElement.querySelectorAll('div.lia-quilt-row-footer')[0].appendChild(tr_para);
} else {
rootElement.querySelectorAll('div.lia-quilt-column-message-footer')[0].appendChild(tr_para);
}
}
}
} catch (e) {
}
}
} else {
/* Do not display button for same language */
// syncList.remove(value);
var index = $scope.syncList.indexOf(value);
if (index > -1) {
$scope.syncList.splice(index, 1);
}
}
}
}
});
});
/* V 1.1:2 = Reply Sync button for multi source translation */
} catch(e){
console.log(e);
}
};
if((rContent != undefined) && (rContent != "")) {
drawCanvas(decodeURIComponent(rContent));
/** Update variable with selected language code **/
$scope.previousSelCode = code_l;
}
};
/**
* @function manageTranslation
* @description Managess the translation of given language for the thread
* @param {string} langCode - Language Code
* @param {string} tid - Thread ID
*/
$scope.manageTranslation = function (langCode, tid) {
//debugger;
$scope.showTrText = false;
/* V 2.0:5 = actualStatus variable introduced to indicate detailed connector status on UI. This variable holds the actual translation percentage */
$scope.transPercent = "";
$scope.actualStatus = "";
if (tid != "") {
var bulkTranslation = lithiumPlugin.bulkTranslation(langCode, tid);
bulkTranslation.then(function (trContent) {
if(trContent.body != "") {
$scope.showPreview(trContent.body, $scope.mszList, langCode);
if(langCode != "en-US") {
$scope.showTrText = true;
}
}
if((trContent.status != "NA") && trContent.status != null) {
// $scope.transPercent = String(trContent.status);
$scope.actualStatus = String(trContent.status);
} else {
// $rootScope.errorMsg = "Translation is in progress. Please check again a few minutes."
$rootScope.errorMsg = "Translation is in progress. Please retry in a few minutes."
}
$scope.workbench = trContent.wb;
/* V 2.0:4 = Trigger uncalled or delayed callbacks (documnet uploaded/translation completed from lithium).*/
if(trContent.callback == 'true') {
var trCompletCallback = lithiumPlugin.trCompletCallback(langCode, trContent.docID);
trCompletCallback.then(function (callback){
// $rootScope.errorMsg = "Downloading Translated content in " + langCode + " now. Please check again in a few minutes."
$rootScope.errorMsg = "Uploading content to translate. Please check again in a few minutes."
});
} else if (trContent.callback == 'upload') {
var trCompletUpload = lithiumPlugin.trCompletUpload(langCode, trContent.docID);
trCompletUpload.then(function (callback) {
//$rootScope.errorMsg = "Uploading content to translate. Please check again in a few minutes."
$rootScope.errorMsg = "Uploading content to translate. Please check again in a few minutes."
});
} else if ("many" == "one") {
$scope.updateOOS();
} else if("SmartConx" == "SmartConx"){
if ("many" == "many"){
$scope.updateOOS();
}
}else if ((trContent.status != null) && trContent.status.includes("100")) {
/* If everything fine then only check Out of Sync status */
$scope.updateOOS();
} else {
/* If translation perccent is less than 100 then show the percentage on UI */
$scope.transPercent = $scope.actualStatus;
}
});
}
}
/**
* @function selectThisLang
* @description Called on select dropdown.
* @param {string} lang - Language code
*
*/
$scope.selectThisLang = function (lang, anonymousFlag) {
/* 1.4:3 Update Analytics on language selection */
try {
setTimeout(()=>{
lingoThreadLangSelected(lang, '1389903');
console.log("Language",lang);
},5000)
} catch (e) {
console.log(e);
}
/** Display Translated content **/
var getTranslation = lithiumPlugin.getTranslation(lang, "1389903");
getTranslation.then(function (trContent) {
if (trContent.body != "") {
$scope.showPreview(trContent.body, $scope.mszList, lang);
} else {
//$rootScope.errorMsg = "Translation is in progress. Please check again in a few minutes."
$rootScope.errorMsg = "Translation is in progress. Please retry in a few minutes."
}
});
};
var decodeEntities = (function() {
// this prevents any overhead from creating the object each time
var element = document.createElement('div');
function decodeHTMLEntities (str) {
if(str && typeof str === 'string') {
// strip script/html tags
str = str.replace(/