This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Sightly classes extending com.adobe.cq.sightly.WCMUse or com.adobe.cq.sightly.WCMUsePojo | |
*/ | |
Boolean checkbox = getProperties().get("myBooleanCheckbox", Boolean.class); | |
/* | |
* Set the default value. | |
*/ | |
Boolean checkbox = getProperties().get("myBooleanCheckbox", false); | |
Boolean checkbox = getProperties().get("myBooleanCheckbox", true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nateyolles.aem; | |
import org.apache.sling.api.resource.Resource; | |
import org.apache.sling.api.resource.ResourceResolver; | |
import org.apache.sling.commons.json.JSONException; | |
import org.apache.sling.commons.json.JSONObject; | |
import org.apache.sling.commons.json.jcr.JsonItemWriter; | |
import javax.jcr.Node; | |
import javax.jcr.RepositoryException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nateyolles.aem; | |
import org.apache.felix.scr.annotations.sling.SlingServlet; | |
import org.apache.sling.api.SlingHttpServletRequest; | |
import org.apache.sling.api.SlingHttpServletResponse; | |
import org.apache.sling.api.resource.Resource; | |
import org.apache.sling.api.resource.ResourceResolver; | |
import org.apache.sling.api.servlets.SlingSafeMethodsServlet; | |
import org.apache.sling.commons.json.JSONException; | |
import org.apache.sling.commons.json.jcr.JsonItemWriter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nateyolles.aem.core.replication; | |
import java.io.BufferedWriter; | |
import java.io.IOException; | |
import java.nio.charset.Charset; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.nio.file.Files; | |
import java.nio.file.Path; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nateyolles.aem.core.replication; | |
import java.io.IOException; | |
import java.util.Arrays; | |
import com.day.cq.replication.AgentConfig; | |
import com.day.cq.replication.ReplicationActionType; | |
import com.day.cq.replication.ReplicationException; | |
import com.day.cq.replication.ReplicationLog; | |
import com.day.cq.replication.ReplicationResult; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ui = $(window).adaptTo('foundation-ui'); | |
ui.alert('Notification', 'This alert was created using the Granite UI "foundation-ui" adapter', 'notice'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Granite UI Multifield adapter | |
* | |
* Has improved setDisabled method which disables all form input fields, the | |
* delete buttons, the reorder buttons and the add button within the Multifield. | |
* The adapter also contains a new method to enable and disable just the add | |
* button which can be used to limit the size of the multifield. | |
* | |
* Usage: | |
* var field = $('.coral-Multifield').adaptTo('nateyolles-field'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var field = $('.coral-Multifield').adaptTo('nateyolles-field'); | |
field.setDisabled(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $input = $('.my-input-field'), | |
errorMessege = 'This field is required'; | |
if ($input.willValidate()) { | |
$input.checkValidity(); // true | |
$input.validationMessage(); // '' | |
/* Set input field as invalid */ | |
$input.setCustomValidity(errorMessage); | |
$input.checkValidity(); // false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Register phone number validation field looking for format "xxx-xxx-xxxx". | |
* | |
* The validator keys off of the ".field-phonenumber" selector. To use in Touch | |
* UI dialogs, add the class "field-phonenumber" to a textfield. | |
* | |
* <phonenumber | |
* jcr:primaryType="nt:unstructured" | |
* sling:resourceType="granite/ui/components/foundation/form/textfield" | |
* fieldLabel="Phone Number" |