Sunday, January 14, 2018

Sling scheduler to auto create the packages through JcrPackageManager API - Adobe Experience Manager(AEM)

Sling scheduler to auto create the packages through JcrPackageManager API - Adobe Experience Manager(AEM)


This post will explains the approach to define Sling scheduler to auto create the packages through JcrPackageManager API in Adobe Experience Manager(AEM).

Define a Service user:


Define a Service User with required access to create a  package.

Login to CRX explorer -  http://localhost:4502/crx/explorer/index.jsp
Click on User Administration

AEM-service-user

Click on Create System User

AEM-service-user

Enter the User Id - "packageassembler and the path - "system/packageassembler"

AEM-service-user



How to define factory of OSGI schedulers(Dynamic Schedulers) in Adobe Experience Manager(AEM)

Defining Factory of OSGI schedulers(Dynamic Schedulers) in Adobe Experience Manager(AEM)


This post explains the approach to define factory of OSGI schedulers(Dynamic Schedulers) in Adobe Experience Manager(AEM)

Define a factory class to capture the configurations:


Define a component and enable as configuration factory(configurationFactory=true)
Configure all the required properties run the scheduler job.

Retrieve the properties through activate method and assign the values to class variable, define the getters to retrieve the property values in Job Class.

Specify the label to identify the configuration in OSGI console.

@Component(configurationFactory = true, policy = ConfigurationPolicy.OPTIONAL, metatype = true, immediate = true, label = "Scheduled Package Generator")
@Service(value = GeneratePackageSchedulerRequest.class)
public class GeneratePackageSchedulerRequest {

final Logger logger = LoggerFactory.getLogger(this.getClass());

@Property(unbounded=PropertyUnbounded.DEFAULT, label="Scheduler Expression", description="Scheduler Expression", value="")
private static final String SCHEDULER_EXPRESSION = "sheduleExpression";
private String sheduleExpression;

@Property(unbounded = PropertyUnbounded.ARRAY, label = "Packages Filter String", cardinality = 50, description = "Packages Filter String")
public static final String PACKAGE_FILTERS = "packageFilters";
private String[] packageFilters;

@Property(unbounded=PropertyUnbounded.DEFAULT, label="Package Name", description="Package Name")
private static final String PACKAGE_NAME = "packgeName";
private String packageName;

@Property(unbounded=PropertyUnbounded.DEFAULT, label="Root Path to store the package", description="Root Path")
private static final String ROOT_PATH = "rootpath";
private String rootPath;


@Activate
protected void activate(final ComponentContext ctx) {

Dictionary<?, ?> props = ctx.getProperties();
sheduleExpression = PropertiesUtil.toString(props.get(SCHEDULER_EXPRESSION), "");
packageFilters = PropertiesUtil.toStringArray(props.get(PACKAGE_FILTERS), null);
packageName = PropertiesUtil.toString(props.get(PACKAGE_NAME), null);
rootPath=PropertiesUtil.toString(props.get(ROOT_PATH), null);
}

public String[] getPackageFilters() {
return packageFilters;
}

public String getJobname() {
return packageName;
}

public String getSheduleExpression() {
return sheduleExpression;
}

public String getRootPath() {
return rootPath;
}

}


Monday, January 1, 2018

How to receive Outbound Message notification from Salesfore through Salesforce Adapter in Oracle SOA Suite 12c

How to receive Outbound Message notification from Salesfore through Salesforce Adapter in Oracle SOA Suite 12c

Salesforce Outbound messaging allows you to specify that changes to fields within Salesforce can cause messages with field values to be sent to designated external servers.

Outbound messaging is part of the workflow rule functionality in Salesforce. Workflow rules watch for specific kinds of field changes and trigger automatic Salesforce actions, such as sending email alerts, creating task records, or sending an outbound message.

After you set up outbound messaging, when a triggering event occurs, a message is sent to the specified endpoint URL. The message contains the fields specified when you created the outbound message. Once the endpoint URL receives the message, it can take the information from the message and process it. To do that, you need to examine the outbound messaging WSDL.

The Salesforce Adapter in Oracle SOA Suite help to integrate with Salesforce cloud. This post will explain the steps to enable the Outbound messaging in Salesfore and receive the notifications in Oracle SOA Suite via Salesforce Adapter.

Define Outbound message in Salesforce:


Login to Salesforce
Click on Setup

salesforce_setup

Search for Outbound messages and click on Workflow & Approvals -  Outbound Messages

salesforce_outbound_messages

Click on Continue in the next screen
Click on New Outbound Message

salesforce_outbound_messages

Select the required Object and Click on Next




Sunday, December 31, 2017

How to integrate with Salesforce.com through Salesforce Adapter in Oracle SOA Suite 12c

How to integrate with Salesforce.com through Salesforce Adapter in Oracle SOA Suite 12c

Oracle SOA Suite Salesforce adapter helps to integrate with Salesfore to perform different operation on objects like CURD, QUERY etc.
This post will explain the approach to configure Salesfore Adapter to perform different operations.

Installing Salesforce.com  SSL certificates to Weblogic server:


Download the certificates(I am using the test salesforce instance): 


Open login.salesforce.com in browser(here I am using chrome browser)
Click on certificate icon and valid

export_salesfoce_login_certificate


Click on Details and Copy to File

export_salesfoce_login_certificate


Click on Next



Saturday, December 30, 2017

JCA Binding execute of Reference operation 'search' failed due to: LDAP_ERROR_IX_INVALID_IN_REC

JCA Binding execute of Reference operation 'search' failed due to: LDAP_ERROR_IX_INVALID_IN_REC

I was getting the below exception while integrating with Ldap Adapter for search operation in Oracle SOA Suite 12c

A fault occurred while invoking the webservice operation. The fault is : <env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode>env:Server</faultcode>
<faultstring>Exception occurred when binding was invoked.
Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'search' failed due to: LDAP_ERROR_IX_INVALID_IN_REC.
Ldap Adapter has encountered an invalid operation request payload while executing an outbound interaction.
Operation request payload should be a valid instance of the ldap adapter request schema.
Please ensure that the request payload is a valid instance of the request operation schema.
".
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution.
</faultstring>
<faultactor/>
<detail>
<exception>Element not completed: 'searchRequest'</exception>
</detail>
</env:Fault>
oracle.sysman.emInternalSDK.webservices.util.SoapTestException: Client received SOAP Fault from server : Exception occurred when binding was invoked.
Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'search' failed due to: LDAP_ERROR_IX_INVALID_IN_REC.
Ldap Adapter has encountered an invalid operation request payload while executing an outbound interaction.
Operation request payload should be a valid instance of the ldap adapter request schema.
Please ensure that the request payload is a valid instance of the request operation schema.
".
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution.

This exception occurred due to the missing input mapping for baseDN and searchFilter in the Ldap input variable(Invoke activity), make sure the variable is mapped with required input e.g. below