Skip to content

Instantly share code, notes, and snippets.

@schatterjee4
schatterjee4 / http-delete-cookie.xml
Created July 26, 2017 04:39 — forked from lovuikeng/http-delete-cookie.xml
Spring Security 3.1 added features
It is MS Windows specific.
Adapt the paths, but use the same lower-/upper case scheme for maximum compatibility (m2eclipse or java itself - don't exactly remember which, but other variants broke my build reproducible - relies on exactly that way to write the path like in the M2_RUNTIME variable. You can determine the exact "syntax" for your system at the command line with the `dir` command).
I use it to have jdk installed as non-admin at non-standard place, to use maven the in the same manner and to use maven over ssl-encrypted connections, when server certificates need to be accepted. The env.MAVEN_OPTS_JRE_TAB_VM_ARGS variable belongs to the JVM arguments tab in the Eclipse launch configuration dialog then.
The other (default ones) settings in eclipse.ini stay...
>8---
-vm
h:/jdk1.6.0/bin/javaw.exe
--launcher.XXMaxPermSize
256m
-vmargs
@schatterjee4
schatterjee4 / .content.xml
Created July 17, 2017 09:53 — forked from rjspiker/.content.xml
AEM 6 Touch UI Show/Hide Checkbox Component Extension - Extension to the standard checkbox component. It enables hiding/unhiding of other components based on the selection made in the checkbox.
<enable
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/checkbox"
text="Enable"
id="enable"
value="true"
name="./enable"
class="cq-dialog-checkbox-showhide"
cq-dialog-checkbox-showhide-target=".button-option-enable-showhide-target"/>
<deleteEnable
@schatterjee4
schatterjee4 / aemTouchCheckboxDialog.xml
Created July 17, 2017 09:50 — forked from nateyolles/aemTouchCheckboxDialog.xml
AEM Touch UI component dialog checkboxes
<!-- Checked checkbox will result in a String property of "true" -->
<myCheckbox
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/checkbox"
text="My Checkbox"
name="./myCheckbox"
value="true"/>
<!-- Checked checkbox will result in a Boolean property of true-->
<myBooleanCheckbox
@schatterjee4
schatterjee4 / app.js
Created July 17, 2017 08:59 — forked from itzg/app.js
Coordinating session timeout from Spring MVC (embedded Tomcat with Spring Boot) to AngularJS REST invocations
angular.module('App', [])
.factory('sessionTimeoutInterceptor', function($log, $window) {
return {
response: function(response){
if (response.headers('x-login') === 'true') {
$log.debug('Intercepted login redirect', response);
$window.location.reload();
}
return response;
}
@schatterjee4
schatterjee4 / Learning React Redux ES6 resources.md
Created July 1, 2017 09:32 — forked from tirams/Learning React Redux ES6 resources.md
Here are some resources I’ve used to learn react, redux and es6
@schatterjee4
schatterjee4 / README.md
Created May 9, 2017 17:25 — forked from toodooleedoo/README.md
#AEM #Sightly #SSJS Server Side JavaScript Use-API Breadcrumbs

###Description Retrieve a Page Object from all pages which are in the Site root then build a breadcrumb component and display the current pages title in a submenu.

###Use case Display a bar under eg a menu which displays the current pages title and functional breadcrumb components o the right.

##Requirements

  • Responsive and which works on all mobile devices and desktop.
  • Current pages title on the left
  • Breadcrumbs on the right
@schatterjee4
schatterjee4 / README.md
Created May 9, 2017 17:24 — forked from toodooleedoo/README.md
#AEM #SIGHTLY #SSJS JavaScript Use-API to append parameters and attributes to anchors

##Description

  1. Append two custom parameters to specific URL's entered by an Author.
  2. Open all links pointing outside your site inside a new window
  3. Add .html to links entered through the GUI pathfield widget (@adobe why is this not OOTB?)

##Use case When an Author selects a link via pathfield I found AEM is not adding the extension. I was going to add some Client Side JavaScript to my dialog windows to handle this on save however I also had the following business requests so I leveraged Server Side JavaScript to take care of all of this.

##Requirements

  • When a request is to domain1name.com or domain2name.com append 2 author controllable URL parameters used for Tracking which the authors could control Globally per site.
@schatterjee4
schatterjee4 / dialog.xml
Created May 2, 2017 06:52 — forked from markdaugherty/dialog.xml
CQ5 - disable dialog field when content is loaded
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="cq:Dialog"
xtype="dialog">
<listeners jcr:primaryType="nt:unstructured"
loadcontent="function(dialog) {
// call servlet or perform arbitrary javascript functions
dialog.getField('./operator').disable();
}" />
<items jcr:primaryType="cq:WidgetCollection">
@schatterjee4
schatterjee4 / choice-exception-strategy.xml
Created October 20, 2016 09:50 — forked from cgorshing/choice-exception-strategy.xml
Small Mule example showing a choice-exception-strategy (copied from the Mule docs)
<flow name="RouteByExceptionType">
<jms:inbound-endpoint queue="in">
<jms:transaction action="ALWAYS_BEGIN" />
</jms:inbound-endpoint>
<test:component/>
<jms:outbound-endpoint queue="out">
<jms:transaction action="ALWAYS_JOIN" />
</jms:outbound-endpoint>
<choice-exception-strategy>
<catch-exception-strategy when="exception.causedBy(com.company.BusinessException)">