Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
I'm new to TouchUI, and having trouble knowing how to customize the editor.html even after reading the doc page... https://docs.adobe.com/docs/en/aem/6-1/develop/extending/customizing-page-authoring-touch.html
The goal of the customization is to load the dam images from the appropriate folder based on the "site" loaded. I have done this in ClassicUI some time ago, but am struggling with TouchUI. I am tempted to try the 1:1 overlay of this structure, but that seems wrong given resource merger in AEM6.1. To be clear I do not want to change the search root, since the users should be able to select other paths. I would like to set a default path.
I have a clientlib overlay of the ImageAssetPanel.js. I can see it is getting called by reviewing the JS console and outputting a log messages. The problem is that I don't know what is calling setSearchPath("") function on the initial page load.
/* * ADOBE CONFIDENTIAL * * Copyright 2015 Adobe Systems Incorporated * All Rights Reserved. * * NOTICE: All information contained herein is, and remains * the property of Adobe Systems Incorporated and its suppliers, * if any. The intellectual and technical concepts contained * herein are proprietary to Adobe Systems Incorporated and its * suppliers and may be covered by U.S. and Foreign Patents, * patents in process, and are protected by trade secret or copyright law. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Adobe Systems Incorporated. */ ; (function ($, ns, channel, window, undefined) { var contentPath = Granite.author.ContentFrame.location; var deptcode = contentPath.split("/")[3]; console.log("hello "+deptcode); var self = {}, name = 'Images'; // make the loadAssets fuction more flexible self.searchRoot = '/content/dam'; // "/bin/wcm/contentfinder/asset/view.json/content/dam/" + matches[2`] + "-assets"; // self.setSearchPath(self.searchRoot+"/"+deptcode+"-assets"); var searchPath = self.searchRoot+"/"+deptcode+"-assets", imageServlet = '/bin/wcm/contentfinder/asset/view.html', itemResourceType = 'cq/gui/components/authoring/assetfinder/asset', searchPath2 = self.searchRoot+"/"+deptcode+"-assets"; /** Pre asset type switch hook */ self.setUp = function () {}; /** Post asset type switch hook */ self.tearDown = function () {}; /** * * @param query {String} search query * @param lowerLimit {Number} lower bound for paging * @param upperLimit {Number} upper bound for paging * @returns {jQuery.Promise} */ self.loadAssets = function (query, lowerLimit, upperLimit) { var param = { '_dc': new Date().getTime(), // cache killer 'query': query.concat("order:\"-jcr:content/jcr:lastModified\" "), // sort by jcr:content/jcr:lastModified property 'mimeType': 'image,application/x-ImageSet,application/x-SpinSet,application/x-MixedMediaSet', 'itemResourceType': itemResourceType, // single item rendering (cards) 'limit': lowerLimit + ".." + upperLimit, '_charset_': 'utf-8' }; console.log(searchPath); console.log(searchPath2); return $.ajax({ type: 'GET', dataType: 'html', url: Granite.HTTP.externalize(imageServlet) + searchPath, data: param }); }; /** * Set URL to image servlet * @param servlet {String} URL to image servlet */ self.setServlet = function (imgServlet) { imageServlet = imgServlet; }; self.setSearchPath = function (spath) { console.log("set sp to "+ spath); searchPath = spath; }; self.setItemResourceType = function (rt) { itemResourceType = rt; }; self.resetSearchPath = function () { searchPath = self.searchRoot; }; // register as a asset tab ns.ui.assetFinder.register(name, self); }(jQuery, Granite.author, jQuery(document), this));
Solucionado! Ir para a Solução.
Visualizações
respostas
Total de curtidas
The setSearchPath function is called by the /libs/cq/gui/components/authoring/clientlibs/editor/js/ui/ui.assetFinder.js file at the following line-
if (typeof self.registry[currentController].setSearchPath === 'function') { self.registry[currentController].setSearchPath($currPathBrowserInput.val()); }
Visualizações
respostas
Total de curtidas
I'm not seeing activity on this here. I'll try posting http://stackoverflow.com/questions/35466385/setting-default-path-for-asset-finder. Feel free to post either place. Thanks
Visualizações
respostas
Total de curtidas
The setSearchPath function is called by the /libs/cq/gui/components/authoring/clientlibs/editor/js/ui/ui.assetFinder.js file at the following line-
if (typeof self.registry[currentController].setSearchPath === 'function') { self.registry[currentController].setSearchPath($currPathBrowserInput.val()); }
Visualizações
respostas
Total de curtidas
/************************************************************************* * ADOBE CONFIDENTIAL * ___________________ * * Copyright 2015 Adobe Systems Incorporated * All Rights Reserved. * * NOTICE: All information contained herein is, and remains * the property of Adobe Systems Incorporated and its suppliers, * if any. The intellectual and technical concepts contained * herein are proprietary to Adobe Systems Incorporated and its * suppliers and are protected by all applicable intellectual property laws, * including trade secret and or copyright laws. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Adobe Systems Incorporated. **************************************************************************/ let initDcLocalStoragePromise;function isGoogleQuery(e){if(!e)return!1;try{const t=new URL(e);if(t.host.startsWith("www.google.")||t.host.startsWith("www.bing."))return!0}catch(e){return!1}return!1}function isSupportedBrowserVersion(){const e=navigator.userAgent.match(/Chrome\/([0-9]+)/);return!(e&&e.length>=2)||+e[1]>=SETTINGS.SUPPORTED_VERSION}function checkForThirdPartyCookiesStatus(e){const t=document.createElement("iframe");t.id="third-party-cookies-checker",t.style.display="none",t.src=chrome.runtime.getURL("browser/js/check-cookies.html");const o=(n,r,i)=>{"thirdPartyCookiesChecked"===n.content_op&&(t.remove(),chrome.runtime.onMessage.removeListener(o),e&&e(n.status))};chrome.runtime.onMessage.addListener(o),document.documentElement.appendChild(t)}const renderGenAIWebpageTPs=()=>new Promise((e=>{$(document).ready((()=>{chrome.runtime.sendMessage({type:"isPopupWindow"},(t=>{t.isPopup||async function(){const t=new ActionableCoachmark,o=await t.shouldShow(),n=await GenAIWebpageEligibilityService.shouldShowTouchpoints();if(o)t.render();else{const e=new FABManager;n?e.renderFAB():e.removeFAB()}chrome.runtime.sendMessage({type:"send_to_sidepanel",main_op:"page_switched",qualified:n}),e(n)}()}))}))})),initDcLocalStorageHelper=async()=>{const e=chrome.runtime.getURL("./common/local-storage.js"),{dcLocalStorage:t}=await import(e);return await t.init(),t},initDcLocalStorage=async()=>(initDcLocalStoragePromise||(initDcLocalStoragePromise=initDcLocalStorageHelper()),window.dcLocalStorage||(window.dcLocalStorage=await initDcLocalStoragePromise),window.dcLocalStorage);function getCleanedHtml(){try{const e=document.cloneNode(!0),t=new Set(["script","style","iframe","head","meta","noscript","template","link","colgroup","col","track","param","source","slot","base","map","embed","area","applet"]),o=new Set(["href","title","src","id","alt"]);t.forEach((t=>{e.querySelectorAll(t).forEach((e=>e.remove()))}));const n=e.createTreeWalker(e.documentElement,NodeFilter.SHOW_ELEMENT,null);for(;n.nextNode();){const e=n.currentNode;[...e?.attributes||[]].forEach((t=>{o.has(t.name)||e.removeAttribute(t.name)}))}return e.documentElement.outerHTML}catch(e){return document.documentElement.outerHTML}}initDcLocalStorage(),chrome.runtime.onMessage.addListener(((e,t,o)=>{if("removeActionableCoachmark"===e.type){(new ActionableCoachmark).remove()}return(async()=>{switch(e.main_op){case"getHtmlContent":o({htmlContent:getCleanedHtml(),url:document.URL,initialQuestion:initialQuestion,disqualified:!await GenAIWebpageEligibilityService.isCurrentWebPageReadable(),textContent:document.documentElement.innerText});break;case"highlightText":(new AttributionManager).highlightText(e);break;case"removeHighlights":(new AttributionManager).removeHighlights();break;case"shouldDisableGenAIForWebPagesTPs":o(await GenAIWebpageEligibilityService.shouldDisableTouchpoints());break;case"shouldShowGenAIForWebPagesTPs":o(await GenAIWebpageEligibilityService.shouldShowTouchpoints());break;case"rerunGenAiWebpage":GenAIWebpageEligibilityService.reset(),renderGenAIWebpageTPs()}})(),!0}));
Visualizações
respostas
Total de curtidas
Visualizações
Curtida
respostas