Category Archives: Coding

AEM 6.4 Mind map

A nice mind map of the AEM 6.4 environment. click here

 

 

Handy links for within AEM

  • /crx/explorer/index.jsp – CRX explorer
  • /crx/de/index.jsp – CRXDE Lite url
  • /libs/cq/search/content/querydebug.html – Query debug tool
  • /libs/cq/contentsync/content/console.html – Content sync console
  • /system/console/bundles – Felix web admin console
  • /system/console/jmx/com.adobe.granite.workflow%3Atype%3DMaintenance – Felix web admin console JMX / Workflow maintenance tasks
  • /system/console/jmx/com.adobe.granite%3Atype%3DRepository – Felix web admin console JMX / Repository maintenance tasks
  • /system/console/depfinder – This tool will help you figure out what package exports a class and also prints a Maven Dependency for the class.
  • /libs/granite/ui/content/dum/crx/explorer/index.jsp – CRX explorer
  • /crx/de/index.jsp – CRXDE Lite url
  • /libs/cq/search/content/querydebug.html – Query debug tool
  • /libs/cq/contentsync/content/console.html – Content sync console
  • /system/console/bundles – Felix web admin console
  • /system/console/jmx/com.adobe.granite.workflow%3Atype%3DMaintenance – Felix web admin console JMX / Workflow maintenance tasks
  • /system/console/jmx/com.adobe.granite%3Atype%3DRepository – Felix web admin console JMX / Repository maintenance tasks
  • /system/console/depfinder – This tool will help you figure out what package exports a class and also prints a Maven Dependency for the class.
  • /libs/granite/ui/content/dumplibs.rebuild.html?rebuild=true – Helpful link for debugging caching problems. Wipes the clientlibs and designs and forces it to rebuild it. Thanks to Mark Ellis for this link.
  • /system/console/adapters – This link shows you the Adapters are registered in the system. This helps you figure out what you can adaptTo() from resource to resource.
  • /libs/cq/compat/components/ntupgrade.html – This link allows you to update Node Types in the system.
  • https://www.adobeaemcloud.coddsdm/content/packageshare.html – Link to the external interface for the CQ Package Share.
  • /crx/explorer/diagnostic/prof.jsp – Shows you the built in profiler
  • /system/console/profiler – Shows you the built in profilerplibs.rebuild.html?rebuild=true – Helpful link for debugging caching problems. Wipes the clientlibs and designs and forces it to rebuild it. Thanks to Mark Ellis for this link.
  • /system/console/adapters – This link shows you the Adapters are registered in the system. This helps you figure out what you can adaptTo() from resource to resource.
  • /libs/cq/compat/components/ntupgrade.html – This link allows you to update Node Types in the system.
  • https://www.adobeaemcloud.com/content/packageshare.html – Link to the external interface for the CQ Package Share.
  • /crx/explorer/diagnostic/prof.jsp – Shows you the built in profiler
  • /system/console/profiler – Shows you the built in profiler
  • /etc/replication.html – Replicationand tree activation
  • /system/console/logs – Log viewer
  • /libs/granite/ui/content/dumplibs.rebuild.html – Clear / rebuild clientlibs cache
  • /useradmin – user admin
  • /system/console/crypto – Crypto module to encrypt strings
  • /libs/cq/i18n/translator.html – Translation module

Enabling/Disabling Javascript minification

  1. Goto http://<server>:<port>/system/console/configMgr
  2. Search for Adobe Granite HTML Library Manager
  3. and edit away 😉

Creating an Adobe Experience Manager 6.3 Project using Adobe Maven Archetype 11

A complete description can be found here.

but the main command is:

mvn \
  org.apache.maven.plugins:maven-archetype-plugin:2.4:generate \
  -DarchetypeGroupId=com.adobe.granite.archetypes \
  -DarchetypeArtifactId=aem-project-archetype \
  -DarchetypeVersion=11 \
  -DarchetypeCatalog=https://repo.adobe.com/nexus/content/groups/public/

Handy Aem CURL commands (6.*)

Steps

REPLICATION ACTIONS:

Activate

curl -u admin:admin -X POST -F path=”/content/path/to/page” -F cmd=”activate” http://localhost:4502/bin/replicate.json

Deactivate
curl -u admin:admin -X POST -F path=”/content/path/to/page” -F cmd=”deactivate” http://localhost:4502/bin/replicate.json

Tree Activation
curl -u admin:admin -F cmd=activate -F ignoredeactivated=true -F onlymodified=true
-F path=/content/geometrixx http://localhost:4502/etc/replication/treeactivation.html

PAGES:

Lock page
curl -u admin:admin -X POST -F cmd=”lockPage” -F path=”/content/path/to/page” -F “_charset_”=”utf-8” http://localhost:4502/bin/wcmcommand

Unlock page
curl -u admin:admin -X POST -F cmd=”unlockPage” -F path=”/content/path/to/page” -F “_charset_”=”utf-8” http://localhost:4502/bin/wcmcommand

Copy page
curl -u admin:admin -F cmd=copyPage -F destParentPath=/path/to/destination/parent -F srcPath=/path/to/source/locaiton http://localhost:4502/bin/wcmcommand

REPLICATION AGENT:

Create Replication Agents

curl -u admin:admin ‘http://localhost:4502/bin/wcmcommand’ -H ‘Content-Type: application/x-www-form-urlencoded; charset=UTF-8’ –data ‘cmd=createPage&_charset_=utf-8&parentPath=/etc/replication/agents.author&title=ReplicationAgentTest&label=&template=/libs/cq/replication/templates/agent’

BUNDLES:

Uninstall a bundle

curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/”name of bundle”

Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F
bundlefile=@”name of jar.jar” http://localhost:4505/system/console/bundles

Build a bundle
curl -u admin:admin -F bundleHome=/apps/centrica/bundles/name of bundle -F
descriptor=/apps/centrica/bundles/com.centrica.cq.wcm.core-bundle/name_of_bundle.bnd
http://localhost:4505/libs/crxde/build

Stop a bundle
curl -u admin:admin http://localhost:4505/system/console/bundles/org.apache.sling.scripting.jsp
-F action=stop

Start a bundle
curl -u admin:admin http://localhost:4505/system/console/bundles/org.apache.sling.scripting.jsp
-F action=start

PACKAGES:

Upload a new package

curl -u admin:admin -F package=@”name_of_package.zip” http://localhost:4505/crx/packmgr/service/.json/?cmd=upload

Install an existing package
curl -u admin:admin -X POST http://localhost:4505/crx/packmgr/service/.json/etc/packages/export/name of package?cmd=install

Upload a package AND install
curl -u admin:admin -F file=@”name of zip file” -F name=”name of package”
-F force=true -F install=true http://localhost:4505/crx/packmgr/service.jsp

Upload a package DO NOT install
curl -u admin:admin -F file=@”name of zip file” -F name=”name of package”
-F force=true -F install=false http://localhost:4505/crx/packmgr/service.jsp

Rebuild an existing package in CQ
curl -u admin:admin -X POST http://localhost:4505:/crx/packmgr/service/.json/etc/packages/name_of_package.zip?cmd=build

Download (the package)
curl -u admin:admin http://localhost:4505/etc/packages/export/name_of_package.zip > name of local package file

USER ADMINISTRATION:

Add user to a group

curl -u admin:admin -FaddMembers=testing http://localhost:4502/home/groups/c/contributor.rw.html

Remove User from a Group
curl -u admin:admin -FremoveMembers=testing http://localhost:4502/home/groups/c/contributor.rw.html

BACKUP

Upload Assets in DAM

curl -u admin:admin -X POST -F file=@”test.png” http://localhost:4508/content/dam/geometrixx/portraits.createasset.html

Source: https://helpx.adobe.com/experience-manager/kb/common-AEM-Curl-commands.html

Performing Offline Revision Cleanup (6.2)

  1. java -jar oak-run.jar checkpoints install-folder/crx-quickstart/repository/segmentstore
  2. java -jar oak-run.jar checkpoints install-folder/crx-quickstart/repository/segmentstore rm-unreferenced
  3. java -jar oak-run.jar compact install-folder/crx-quickstart/repository/segmentstore

Oauth Tool

I found a nice a simple ouath console last week.

simply install it with gem install oauth.

getting oauth tokens is then so simple as

oauth \
   --verbose \
    --query-string \
    --consumer-key <consumer key> \
    --consumer-secret <consumer secret> \
    --access-token-url <get token url: example /oauth/token> \
    --authorize-url <get authorize url: example /oauth/authorize> \
    --request-token-url <get request token url" example /oauth/initiate> \
    authorize

Move Magento database

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;
SET NAMES utf8;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;
 
-- <SQL FROM MYSQLDUMP>
 
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT;
SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS;
SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION;
SET SQL_NOTES=@OLD_SQL_NOTES;

List custom fonts

Always handy to list all the fonts available on the phone.

    NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
    NSArray *fontNames;
    NSInteger indFamily, indFont;
    for (indFamily=0; indFamily<[familyNames count]; ++indFamily)
    {
        NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]);
        fontNames = [[NSArray alloc] initWithArray:
                     [UIFont fontNamesForFamilyName:
                      [familyNames objectAtIndex:indFamily]]];
        for (indFont=0; indFont<[fontNames count]; ++indFont)
        {
            NSLog(@"    Font name: %@", [fontNames objectAtIndex:indFont]);
        }
 
    }

Clear magento test orders (Tested v1.8)

A easy set of queries to drop all orders and customers after testing.

SET FOREIGN_KEY_CHECKS=0;
 
##############################
# SALES TABELLEN
##############################
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_order_grid`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_payment`;
TRUNCATE `sales_flat_order_status_history`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_quote_payment`;
TRUNCATE `sales_flat_quote_shipping_rate`;
TRUNCATE `sales_flat_shipment`;
TRUNCATE `sales_flat_shipment_comment`;
TRUNCATE `sales_flat_shipment_grid`;
TRUNCATE `sales_flat_shipment_item`;
TRUNCATE `sales_flat_shipment_track`;
TRUNCATE `sales_invoiced_aggregated`;
TRUNCATE `sales_invoiced_aggregated_order`;
TRUNCATE `sales_bestsellers_aggregated_daily`;
TRUNCATE `sales_bestsellers_aggregated_monthly`;
TRUNCATE `sales_bestsellers_aggregated_yearly`;
TRUNCATE `sales_order_tax`;
TRUNCATE `sales_order_tax_item`;
TRUNCATE `log_quote`;
 
ALTER TABLE `sales_flat_creditmemo_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_track` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated_order` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
 
#########################################
# DOWNLOADABLE PRODUCTEN
#########################################
TRUNCATE `downloadable_link_purchased`;
TRUNCATE `downloadable_link_purchased_item`;
 
ALTER TABLE `downloadable_link_purchased` AUTO_INCREMENT=1;
ALTER TABLE `downloadable_link_purchased_item` AUTO_INCREMENT=1;
 
#########################################
# RESET ID COUNTERS
#########################################
TRUNCATE `eav_entity_store`;
ALTER TABLE  `eav_entity_store` AUTO_INCREMENT=1;
 
##############################
# KLANT TABELLEN
##############################
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;
TRUNCATE `customer_entity_datetime`;
TRUNCATE `customer_entity_decimal`;
TRUNCATE `customer_entity_int`;
TRUNCATE `customer_entity_text`;
TRUNCATE `customer_entity_varchar`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `rating_option_vote`;
TRUNCATE `rating_option_vote_aggregated`;
TRUNCATE `review`;
TRUNCATE `review_detail`;
TRUNCATE `review_entity_summary`;
TRUNCATE `review_store`;
TRUNCATE `log_customer`;
 
ALTER TABLE `customer_address_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `tag_properties` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_customer` AUTO_INCREMENT=1;
 
##############################
# OVERIGE LOGFILES
##############################
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;
TRUNCATE `report_event`;
TRUNCATE `report_viewed_product_index`;
TRUNCATE `sendfriend_log`;
 
ALTER TABLE `log_url` AUTO_INCREMENT=1;
ALTER TABLE `log_url_info` AUTO_INCREMENT=1;
ALTER TABLE `log_visitor` AUTO_INCREMENT=1;
ALTER TABLE `log_visitor_info` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;
ALTER TABLE `report_viewed_product_index` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
 
##############################
# ZOEKTERMEN
##############################
TRUNCATE TABLE `catalogsearch_query`;
 
SET FOREIGN_KEY_CHECKS=1;