/
ProjectSocialComponentFactory.java
45 lines (37 loc) · 1.94 KB
/
ProjectSocialComponentFactory.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*************************************************************************
* Copyright 2015 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
* terms of the Adobe license agreement accompanying it. If you have received this file from a
* source other than Adobe, then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
**************************************************************************/
package com.adobe.cq.social.samples.scf.tasks.impl;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import com.adobe.cq.social.samples.scf.tasks.api.ProjectSocialComponent;
import com.adobe.cq.social.scf.ClientUtilities;
import com.adobe.cq.social.scf.QueryRequestInfo;
import com.adobe.cq.social.scf.SocialComponent;
import com.adobe.cq.social.scf.SocialComponentFactory;
import com.adobe.cq.social.scf.core.AbstractSocialComponentFactory;
@Service
@Component
public class ProjectSocialComponentFactory extends AbstractSocialComponentFactory implements SocialComponentFactory {
public SocialComponent getSocialComponent(Resource resource) {
return new ProjectSocialComponentImpl(resource, getClientUtilities(resource.getResourceResolver()));
}
public SocialComponent getSocialComponent(Resource resource, SlingHttpServletRequest request) {
return new ProjectSocialComponentImpl(resource, getClientUtilities(request));
}
public SocialComponent getSocialComponent(Resource resource, ClientUtilities clientUtils,
QueryRequestInfo requestInfo) {
return new ProjectSocialComponentImpl(resource, clientUtils);
}
public String getSupportedResourceType() {
return ProjectSocialComponent.PROJECT_RESOURCE_TYPE;
}
}