Skip to content

Instantly share code, notes, and snippets.

View davidtruchet's full-sized avatar

david.truchet davidtruchet

  • IfThen
  • Punta Del Este, Uruguay
  • 10:30 (UTC -12:00)
View GitHub Profile
Subject: Obrigado por se cadastrar na Conexão Roche
<!doctype html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
public PatientPlatformSearchResult<StudyModel> findStudies(SearchFilter filter, ResourceResolver resourceResolver) {
Map<String, String> predicateGroupMap = new HashMap<>();
predicateGroupMap.put("type", "cq:PageContent");
predicateGroupMap.put("path", filter.getHomePagePath());
predicateGroupMap.put("property", "sling:resourceType");
predicateGroupMap.put("property.value", ResourceType.CLINICAL_TRIAL.getResourceType());
if (filter.getResultsonly()) {
predicateGroupMap.put(TAG_ID_PREDICATE, WITH_RESULTS_TAG_ID);
}
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured"
jcr:title="Explore Speciality"
sling:resourceType="cq/gui/components/authoring/dialog"
mode="edit">
<content
sling:resourceType="granite/ui/components/coral/foundation/container"
jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
@davidtruchet
davidtruchet / NotificationEmailService.java
Last active June 18, 2017 01:49
AEM Custom Email Service
package com.site.dotcom.service.notification;
import java.util.Map;
public interface NotificationEmailService {
void sendEmail(String emailTemplate, String emailReceipt, Map<String, String> properties);
void sendEmailToGroup(String emailTemplate, String emailGroup, Map<String, String> properties);
}
package com.site.dotcom.service.services.impl;
import java.util.ArrayList;
import java.util.List;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.ReferencePolicy;
import org.apache.felix.scr.annotations.Service;
(function ($, $document) {
"use strict";
$document.on("dialog-ready", function(e) {
console.log("gogoogogo!");
});
})($, $(document));
protected Asset getAssetFromPayload(WorkItem item, Session session) {
Asset asset = null;
if (item.getWorkflowData().getPayloadType().equals("JCR_PATH")) {
String path = item.getWorkflowData().getPayload().toString();
Resource resource = getResourceResolver(session).getResource(path);
if (null != resource)
asset = DamUtil.resolveToAsset(resource);
else {
log.error("getAssetFromPaylod: asset [{}] in payload of workflow [{}] does not exist.", path,
,'do_tagging_comparison_add': function (product) {
// safely handle global objects and nested data lookups
if (_.isUndefined( window.fossilTrack ) ){
// break out
return;
}
// do tag
window.fossilTrack('compare_addition', {
site: {
'productID': product.code,
private void paginateLists() {
int careIndex = 0;
List<ProductAttributeModel> currentList = new ArrayList<ProductAttributeModel>();
for (ProductAttributeModel productAttributeModel : this.careTextList) {
if (careIndex != 0 && careIndex % CARE_PAGE_SIZE == 0) {
this.resultCareList.add(currentList);
currentList = new ArrayList<ProductAttributeModel>();
}
currentList.add(productAttributeModel);
@davidtruchet
davidtruchet / pom.xml
Created May 12, 2016 13:45
Running Grunt with Maven
<properties>
....
....
<grunt.executable>grunt</grunt.executable>
....
....
</properties>
<build>
<pluginManagement>