AEM 63 - This and That



FIND_BINARY_LOCATION_ON_FILE_SYSTEM

With AEM 63, the default store for binaries is File Data Store - FDS; to find the location of binary on file system

     1) Get the jcr:content/metadata/dam:sha1 of binary from CRXDE eg. 4608b968ad44797313ee7d6710be9c3dfba1e937



     2) Search for the file with name as dam:shal value in <path_to_aem_author_install>/author/crx-quickstart/repository



     3) To be sure, just add the extension of binary eg. 4608b968ad44797313ee7d6710be9c3dfba1e937.jpg, dont forget to change it back to no extension





REPORT_PATHS_HTTP_STATUS_ERROR_CODE

Scan access.log files and report page paths generating errors sorted by most frequent to least frequent (thank you Himanshu Pathak for the tip, more details here)

awk '{if($9!=200 && $9!=304 && $9!=302) { print $7 "\t" $9}}' access.log*  | sort | uniq -c | sort -nr



If the sling repository is not starting, you receive errors like Exception in a SlingRepositoryInitializer, 503 AuthenticationSupport service missing in error logs and offline/cmdline access to repo is required to add/delete nodes, oak-run jar console mode might help...

             1) Download latest oak-run jar https://repo1.maven.org/maven2/org/apache/jackrabbit/oak-run/

             2) Access the repo using command : > java -jar oak-run-1.9.9.jar console crx-quickstart/repository/segmentstore --read-write 

             3) Load the script to delete nodes eg. > :load https://gist.githubusercontent.com/stillalex/43c49af065e3dd1fd5bf/raw/9e726a59f75b46e7b474f7ac763b0888d5a3f0c3/rmNode.groovy

             4) Delete node eg. > rmNode(session, "/apps/delete-me-using-oak-run.txt")


import org.apache.jackrabbit.oak.spi.commit.CommitInfo
import org.apache.jackrabbit.oak.spi.commit.EmptyHook
import org.apache.jackrabbit.oak.spi.state.NodeStore
import org.apache.jackrabbit.oak.commons.PathUtils

def rmNode(def session, String path) {
    println "Removing node ${path}"

    NodeStore ns = session.store
    def nb = ns.root.builder()

    def aBuilder = nb
    for(p in PathUtils.elements(path)) {  aBuilder = aBuilder.getChildNode(p) }

    if(aBuilder.exists()) {
        rm = aBuilder.remove()
        ns.merge(nb, EmptyHook.INSTANCE, CommitInfo.EMPTY)
        return rm
    } else {
        println "Node ${path} doesn't exist"
        return false
    }
}



Use glob expressions in permissions editor to provide write permissions for auto generated folders at any level, however rest of structure is read only... (thank you Yuan Dong for the tip)




No comments:

Post a Comment