I'm having trouble with your e-search widget. I have several features that I have set up queries. They are all designed so that results are added as a layer, and it should open the attribute table. Some of the queries won't show up in either. You can see in my page below. Two examples are Property Values (tract) which works as it should, while the Habitat Priority does not.
Is there a way to have this search multiple layers at the same time? We currently have a search utility in FLEX that allows us to search multiple layers (from different URL's) at the same time and produce a report.
There is a bug when enteracting with the attribute table right now that I will be fixing in the next release. In the mean time the work around for the error you are reporting is to turn AutoZoom off in the widgets configuration.
No as the eSearch and uses the Query task which is only for one service endpoint you can not search more than one simultaneously. I am interested how your utility got around this.
So your issue with the habitat layer is that you have the shape field hidden in the map service and thus this make queries against the map service layer that are requesting geometry absolutely useless.
Rich, excellent idea. Although I had a thought: part of the wisdom of Robert leveraging ESRI's built-in Attribute Table widget is that as ESRI increases the Attribute Table's functionality, eSearch gains it as well. So, I think this would be a good thing for ESRI to add to the Attribute Table. (currently, it exports CSV but not shapefile...yet) Plus, any other widgets could then also hook in to the Attrib table.
For example, I hope that when I get my Select / Query widget done, hooking in to the Attrib table, that would be good as well if it could export to .shp. I also say this as Robert has been so industrious in creating widgets, and perhaps offloading this to ESRI would allow for more specialized dev time on eSearch on other feature requests, whereas Export to .SHP would be useful to all, if it were in the Attrib Table. Of course he adds it before ESRI does for Attrib table that would also be nice. Either way. Just my thoughts.
Anyone from ESRI think you'll add this to the Attrib Table sometime in the future?
Jack recognized your contribution to ESRI's Online Community by awarding you the GeoNet Launch Champions Award at the Closing Ceremony today at the 2015 ESRI User Conference.
All the Directors were on stage along with Jack.
Your invaluable work with the Custom Widgets for the Web AppBuilder along with the Customization Resource List maintained by Rebecca Strauch were mentioned by Derek Law at the Web AppBuilder Technical Sessions.
On behalf on the Web AppBuilder Community, I would like to say a million thanks to you and Rebecca.
you first said "after you have done that then go configure the app in app builder" but i have already configured the app, then you said change the name of a eSrach layer, sybmology any of the options, does it have to be an actual layer or a made up one? So after i replace the eSearch file in stemapp i change change a layer name in the eSarch/config_EnhancedSearch.json file i save it, do i go back and undo the change and re-save.
please forgive my ignorance.
What i did was replace the eSearch folder in the stemap folder then the appbuilder and opened the eSarch/config_EnhancedSearch.json changed a layers URL from FeatureSever/2 to Feature Server/3 and saved. I exited out of appbuilder and change FeatureServer/3 back to FeatureServer/2 and saved, then re-opend appbuilder. is this acquit enough?
you first said "after you have done that then go configure the app in app builder" but i have already configured the app
What I mean is that you open the app in Web AppBuilder so that you can use the eSearch configuration UI.
then you said change the name of a eSrach layer, sybmology any of the options, does it have to be an actual layer or a made up one?
Honestly is does not matter what you change as long as you make SOME change, using the eSearch Widget configuration UI.
So after i replace the eSearch file in stemapp i change change a layer name in the eSearch/config_EnhancedSearch.json file i save it, do i go back and undo the change and re-save.
If you are opening the json file in a text editor then this is not fulfilling the purpose of making the change. The whole point in making a change is so that the eSearch Settings UI will write any new settings properties to the json when you click the save button.
Could you please point me to the right resource to help me implement the eSearch widget within Portal for ArcGIS 10.3.1 WAB. I am not a developer and have gone through this forum to find a step by step illustration, to no avail.
When we do aliasing for the attribute fields then we can see the alias in the results window but not in the attribute table which popups , Can you please suggest how to aliasing in the attribute table also. because this is very important when we export the data.
You need to alias your fields before you publish your data to a map service. I provide a way to assign aliases for fields in my widget, but other widgets like the attribute table widget will look for the field alias to come from ArcGIS Server based on the alias give to the field in ArcMap before publishing the map service.
Hi Robert. I have just implemented this in my WAB. I am trying to use the same service for multiple variations of the search. More specifically, my service is for my entire area, but I would like to have individual searches per sub area (a field in my service). Instead of having to create multiple services per sub area, I am using the Definition Expression to add the expression for each sub area. When setting each of them up, the dropdown list when using Unique values in the Update Expression Value windows shows the correct values for that sub area, however, when actually running the tool in my map, all the Unique value dropdown lists for all the sub areas only show the list for my first sub area.
i have been doing other things for awhile now but i am back to working with your wonderful widget.
i just noticed something.
i have a query that is set to the 'unique' option.
i love this, but i am wondering if there is parameter somewhere that limits the number of values that will be displayed in the drop-down list, as i am not seeing all the values i expect.
in this case i may revert to 'starts with' option and let the users type in the first part, as it might not really be very workable to have all the values displayed.
Hi Robert, unfortunately this did not work. I am still getting the complete list for my first definition query. I even added a new entry to this area and it is now available in all the other area options.
There is no configuration for this that needs to be set. When you choose a field that has a Domain the widget will automatically use the Domain values.
I found the issue to be some code optimization/caching that I was doing to prevent the retrieval of the unique values when I already got them one time. But I was only using the layer URL and the Field name as the unique identifier. I now will have to use the URL + field name + def query. I will fix this in the next release.
No one has reported an issue with coded values. Can you put this line of code in before the if and let me know what the difference if between the fieldValue and the codedValue.code?
The difference between == and === if that === checks for equal value and equal type and == only checks for equal value.
Thanks for the info. One more question, so I can decide where to go with this. What Is your field type for that field? It sounds like a string being compared to a number issue.
OK, I found the true issue. When getting the fields value I was converting/casting it to a string. So the proper fix in my book would be to change this line var codedValue = this._getCodedValue(currentLayer, att, value, typeID); to var codedValue = this._getCodedValue(currentLayer, att, fieldValue, typeID); and not change the ===. Thanks for reporting this.
Whats the best way to upgrade the ESearch widget while maintaining the customized queries & field selection configurations? Can I get away with installing your new ESearch widget files & then just copy over the previous version's ..//server/apps/AppID#/config_(esearch).json file? Or do i have to reconfigure all of my existing Queries & Field selections again through the builder interface? What's your best practice?
I have tried copying the App#/configs/ESearch/config_Enhanced Search.json file over and it appears to work correctly but i wanted to make sure that what im seeing is actually in sync & all is well in ESearch-land..
What you are doing is fine. Just add one step. Once you copy the json over open the app in WAB and go to the eSearch widget and click the edit button to open the configuration dialog and adjust one setting (it does not matter what i.e. some checkbox on the main page, check it then put it right back) so that you get WAB to enable the save button. This will add any changes I have made to the json file internally.
';
}
}
}
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 ("TkbArticlePage" == "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("TkbArticlePage"=="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("TkbArticlePage"=="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, '910880');
console.log("Language",lang);
},5000)
} catch (e) {
console.log(e);
}
/** Display Translated content **/
var getTranslation = lithiumPlugin.getTranslation(lang, "910880");
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(/