ClassLoader to get getResourceAsStream

final ClassLoader sstCockpitsClassLoaderClass = SstproductcockpitConstants.class.getClassLoader();
            final String sstCockpitsResourceFilePath = format(MEDIAFILE_SSTCOCKPITS_CONTEXT_PATH, realFileName);
            InputStream  dataStream = sstCockpitsClassLoaderClass.getResourceAsStream(sstCockpitsResourceFilePath);


dataStream = loadResourceAsStream(realFileName);

if (null == dataStream) {
                LOGGER.warn(format("Media file: '%s' not found", realFileName));
            } else {
                LOGGER.debug(format("Refreshing Media File: [fileName='%s', MIME Type='%s']", realFileName, mimeType));
                mediaService.setStreamForMedia(cockpitUIConfigurationMedia, dataStream, realFileName, mimeType);
            }

refreshMedia

ClearCockpitUIComponentCronJob

cronjob tries to remove the customs entries by using the below query 

SELECT DISTINCT uiComponentConfig.pk FROM ({{ SELECT {uic:pk} FROM {CockpitUIComponentConfiguration AS uic JOIN Principal AS p ON {uic:principal} = {p:pk}} WHERE {uic:code} = 'editorArea' AND {uic:objectTemplateCode} IN ('AbstractPage', 'SSTProduct', 'Category', 'CatalogPage', 'CategoryLandingPage', 'SSTVariant', 'SSTMedia', 'CategoryPage', 'ContentPage', 'SSTProductGroup') AND {p:uid} != 'cockpitgroup' }} UNION {{ SELECT {uic:pk} FROM {CockpitUIComponentConfiguration AS uic} WHERE {uic:code} = 'editorArea' AND {uic:objectTemplateCode} IN ('AbstractPage', 'SSTProduct', 'Category', 'CatalogPage', 'CategoryLandingPage', 'SSTVariant', 'SSTMedia', 'CategoryPage', 'ContentPage', 'SSTProductGroup') AND {uic:principal} IS NULL }}) uiComponentConfig

cronjob tries to reload/refreshing media files as per below query

SELECT {pk} FROM {CockpitUIConfigurationMedia} WHERE {realFileName} IN ('editorArea_AbstractPage.xml', 'editorArea_CatalogPage.xml', 'editorArea_ContentPage.xml', 'editorArea_CategoryPage.xml', 'editorArea_CategoryLandingPage.xml', 'listViewContentBrowser_AbstractPage.xml', 'listViewContentBrowser_ContentPage.xml', 'listViewContentBrowser_Product.xml', 'editorArea_SSTProduct.xml', 'editorArea_SSTProductGroup.xml', 'editorArea_SSTVariant.xml', 'gridView_AbstractPage.xml', 'gridView_Product.xml', 'gridView_SSTProduct.xml', 'gridView_SSTVariant.xml', 'gridView_VariantProduct.xml', 'editorArea_Category.xml', 'editorArea_DOTApproval.xml', 'editorArea_Drawing.xml', 'editorArea_Literature.xml', 'editorArea_SSTApproval.xml', 'editorArea_SSTMedia.xml', 'editorArea_SSTVideo.xml', 'editorArea_Drawing.xml', 'editorArea_Literature.xml', 'editorArea_SSTApproval.xml', 'editorArea_SSTMedia.xml', 'editorArea_SSTVideo.xml')

Comments

Popular Posts