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.wemblog.utility.impl; | |
import java.util.ArrayList; | |
import java.util.List; | |
import javax.jcr.Session; | |
import org.apache.felix.scr.annotations.Component; | |
import org.apache.felix.scr.annotations.Reference; | |
import org.apache.felix.scr.annotations.Service; |
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.wemblog; | |
import java.util.Iterator; | |
import javax.jcr.Node; | |
import javax.jcr.RepositoryException; | |
import javax.jcr.Session; | |
import org.apache.sling.api.resource.Resource; | |
import org.apache.sling.api.resource.ResourceMetadata; |
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
@Property(label="Select One Value",name="label", options={ | |
@PropertyOption(name="title1",value="value1"), | |
@PropertyOption(name="title2",value="value2") | |
},value="defaultvalue", description="Some Description") | |
private static final String PROPERTY_SCHEDULER_DATASOURCE = "label"; | |
private String label; | |
//And then | |
@Activate | |
protected void activate(final Map<String, Object> config) { | |
this.lebel = PropertiesUtil.toString(config.get("label"), "some_default_value"); |
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.wemblog; | |
import com.day.cq.dam.api.Asset; | |
import com.day.cq.workflow.exec.WorkflowData; | |
import com.day.cq.replication.ReplicationActionType; | |
import com.day.cq.wcm.workflow.process.ReplicatePageProcess; | |
import com.day.cq.workflow.WorkflowException; | |
import com.day.cq.workflow.WorkflowSession; | |
import com.day.cq.workflow.exec.WorkItem; | |
import com.day.cq.workflow.exec.WorkflowProcess; |
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
//Import | |
import org.osgi.framework.ServiceRegistration; | |
import org.apache.sling.auth.core.spi.AuthenticationHandler; | |
import org.apache.sling.auth.core.spi.DefaultAuthenticationFeedbackHandler; | |
//Your Custom Auth handler class | |
public class CustomAuthHandler extends DefaultAuthenticationFeedbackHandler implements AuthenticationHandler { | |
//All Your Logic | |
private ServiceRegistration loginModule; | |
//All Your Logic |
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
import java.security.Principal; | |
import java.util.Hashtable; | |
import java.util.Map; | |
import java.util.Set; | |
import javax.jcr.Credentials; | |
import javax.jcr.RepositoryException; | |
import javax.jcr.Session; | |
import javax.security.auth.callback.CallbackHandler; |
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
import org.apache.sling.auth.core.spi.AuthenticationFeedbackHandler; | |
import org.apache.sling.auth.core.spi.AuthenticationHandler; | |
import org.apache.sling.auth.core.spi.DefaultAuthenticationFeedbackHandler; | |
@Component(metatype = true, immediate = true, label = "My Custom Authentication Handelr", | |
description="Authenticates User Against Citrix One Web Service") | |
@Service | |
@Properties({ | |
@Property(name = AuthenticationHandler.PATH_PROPERTY, value = "/"), | |
@Property(name = Constants.SERVICE_DESCRIPTION, value = "My Custom Authentication Handler") }) |
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
######## start docker in debug mode ########## | |
docker -dD | |
####### Remove Docker Image ############ | |
# Get Docker image | |
docker images | |
# Remove image | |
docker rmi <Image ID> | |
#If process is already using this image then run this command and then remove image | |
docker rm $(docker ps -aq) |
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
# First check if docker process is running | |
docker ps | |
# Make sure to commit your changes before you stop | |
docker commit --message="<What did you do>" <Container ID> <your docker registry>/wemblog/aem_microsite:5.6 | |
# Grab container ID from above command | |
docker stop <Container ID> | |
# Then pull new image | |
docker pull <your docker registry>/<new or existing docker tag name> | |
# Once docker new docker image is available start your image | |
docker run -d -t -i -p 4502:4502 -p 4503:4503 -p 8080:80 -p 8443:443 <your docker registry>/<new or existing docker tag name> |
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
#First make sure that you can connect to docker registry | |
curl -u admin:admin https://<your docker registry host> | |
#If this works make sure that you can ping images in registry | |
curl -u admin:admin https://<your docker registry host>/v1/_ping | |
#If this works login in to docker registry server (admin:admin) | |
docker login https://<your docker registry host> | |
#if this works then download docker images | |
docker pull <your docker registry host>/wemblog/aem_microsite:5.6 | |
# After download is done start your docker image using following command | |
# You can also a docker image using 'docker run -d -t -i -p 4502:4502 <Image ID>' |