67 Implement Oracle Social Network Integration

This chapter documents how developers can implement Oracle Social Network in an application by creating the Model project in JDeveloper and by displaying it in the Global Area of the UIShell.

The chapter includes these sections:

67.1 Prerequisites for Oracle Social Network Integration

For Oracle Social Network integration to work, there first must be a connection defined between Oracle Fusion applications and Oracle Social Network. This connection normally is set up by the provisioner (see Table 67-1) and must be able to be configured because Oracle Fusion applications and Oracle Social Network will not reside on the same server. These configuration items must be in place:

  • Oracle Social Network URL must be defined in Topology Manager with a Module Short Name of 'OSN'.

    On a production instance, there will be an internal and external Topology Manager URL for Oracle Social Network. The internal URL will be used for all data sent to Oracle Social Network. The external URL will be used when navigating from within Fusion Applications.

  • The Oracle Social Network credential must exist in the WebLogic Server credential store.

  • In the weblogic-application.xml file that is present at the workspace level, add a reference to the Oracle Social Network model shared library:

    <library-ref>
     <library-name>oracle.social.client</library-name>
    </library-ref>
    

    In the weblogic.xml file for the UI project (that is mapped to the WAR deployment), add a reference to the Oracle Social Network view shared library. This entry is needed in any UI project that needs to test or run the Oracle Social Network integration using the UIShell as described in Adding Oracle Social Network to Your Application UI.

    <library-ref>
     <library-name>oracle.social.client.view</library-name>
    </library-ref> 
    

67.2 Implementing the Oracle Social Network Model Project

Each of the roles listed in Table 67-1involves a different part of the entire Oracle Fusion Applications-Oracle Social Network integration work flow.

Table 67-1 Oracle Social Network Integration Roles

Role Description Primary responsibilities for integration

Fusion Applications Developer

A developer in a product team that has view object data that is to be sent to Oracle Social Network.

  • Defining which view objects are to be available for Oracle Social Network integration.

  • Configuring the view object and its Attributes for Oracle Social Network integration.

  • Updating the product User Interface to include the Oracle Social Network Share button to allow for Manual Oracle Social Network integration.

  • Configuring their Oracle Fusion Functional Setup Manager to have a task flow entry for "Manage Social Network Objects".

Provisioner

The person who provides and configures the Oracle WebLogic Server environment in which the Oracle Fusion applicationis to be run.

  • Creating the Oracle Social Network credential in the credential store (if not pre-provisioned).

  • Configuring Topology Manager to have a deployed application entry for "Oracle Social Network."

Functional Administrator

The person on the site who will configure which view objects will be used at product runtime from the list of available view objects for Oracle Social Network integration.

  • Choosing the type of integration each of the available view objects will have.

  • Selecting which attributes will be sent to Oracle Social Network for the list of view objects that have integration enabled.

End User

The user who generates transactions using Oracle Fusion applications with Oracle Social Network and who is saving the view object row in the product UI.

  • Triggering the send of the view object row as a Social Object to Oracle Social Network.

  • Launching and using Oracle Social Network to view the Social Object.

At different times during the development process, a person must be able to perform several of these roles. For example, an Oracle Fusion Applications developer who is performing development through to testing will need to wear the hats for most or all of these roles to ensure that their integration pieces work correctly to send the data to Oracle Social Network.

67.2.1 How the Oracle Fusion Applications Developer Role Works

For developers, there are several phases of the development process in which they need to perform setup and configuration of the Oracle Social Network integration with their products.

  • Design Time - Making a Business Object available for Oracle Social Network integration.

    The prerequisite is that the JDeveloper environment has at minimum the "Applications Core" extension loaded.

  • Configuring the Business Object for Oracle Social Network Integration

    When implementing the Oracle Fusion Applications-Oracle Social Network integration provided by Oracle Fusion Middleware Extensions for Applications, the product team must already have a view object that meets the following criteria:

    • The view object is underpinned by one or more entity objects that are derived from the OAViewObjectImpl and OAEntityObjectImpl respectively.

    • Any rows from the view object must be derived from OAViewRowImpl.

    • The view object must not be "Expert" (SQL) based.

      Any view object that matches these criteria can be considered for Oracle Social Network integration availability. When a view object has been made available for Oracle Social Network integration, it can be enabled on the site using the "Manage Social Network Objects" page.

To set up a view object for Oracle Social Network integration, there is a common set of steps to provide basic integration. This basic integration can be customized based upon how the integration is to work for that view object. Customizations that can be applied are:

  • Adding translated labels.

  • Changing Oracle Social Network field data types, object title, object key, view details URL and registration name.

67.2.1.1 Configure the Business Object for Oracle Social Network Integration

The business object is underpinned by one or more entity objects that are derived from the OAViewObjectImpl and OAEntityObjectImpl respectively.

A wizard helps make view objects available for Oracle Social Network integration. The wizard will guide you through selecting the view objects and the set of attributes within the view object that are available for a site to send through to Oracle Social Network. All view objects that are to be available for Oracle Social Network integration must follow the steps listed here. Then they can have additional configuration made to tailor the integration further. The required steps to have a basic integration with Oracle Social Network are:

  1. In JDeveloper's Navigator pane, find the application module that contains the view object to be made available for Oracle Social Network integration.
  2. Right-click the application module and select the Add OSN View Instances menu item. This will start the OSN Enabled View Instances wizard, shown in Figure 67-1.

    Figure 67-1 OSN Enabled View Instances Wizard

    Starting the OSN Enabled View Instances Wizard
  3. At the top of the wizard is a dropdown list called Module. Choose the module that best represents the line of business for the current project.
  4. Just beneath the Modules, there is a list of available view objects and a data model list. Find the view objects that are to be made available for Oracle Social Network integration from the list of available view objects and shuttle them into the data model. This signifies that the view object will be available for Oracle Social Network integration.
  5. Click the view object in the data model pane to show the list of attributes for that view object in the Attributes tab.
  6. Select the Enable check box next to any attribute that is to be available within that view object for Oracle Social Network integration. Only attributes that are enabled will be allowed to be sent to Oracle Social Network.
  7. Click OK to finish the wizard.

If the deployment profile for the project is an ADF Library JAR file, then the META-INF folder and the fnd-osn-integration.xml file automatically will be bundled into the JAR file at the correct location. However, if the deployment profile is a regular JAR file, then the META-INF folder will need to be added as Project Output Contributor and ensure that the fnd-osn-integration.xml file is selected for inclusion in the JAR file. There should be no additional steps required for product integrators or special build steps so long as the META-INF/fnd-osn-integration.xml file is included in the root of the JAR file.

When the Model project is deployed and loaded at the client site, the view objects that were moved to the Data Model pane will be available in "Manage Social Network Objects," allowing them to be Oracle Social Network-enabled.

67.2.1.1.1 What happens when using the "OSN Enabled View Instances" wizard
After clicking OK to close the wizard, several tasks are performed with new artifacts generated. The first thing that happens is that a new file is created (if it did not already exist) called fnd-osn-integration.xml under the META-INF folder (that also will be created if it did not exist) of the JDeveloper project's Application Source. There will only be one of these files per JDeveloper project and it will be re-loaded if the developer re-opens the wizard. This XML file contains the module information and the names of the view objects that have been made available for Oracle Social Network integration. A sample fnd-osn-integration.xml file looks like:
<?xml version="1.0" encoding="utf-8"?>
<fnd-osn-metadata xmlns="http://xmlns.oracle.com/apps/fnd/applcore/osn" moduleId="84944D4BE32F441AE0401490D3C52A40">
 <AppModule Name="ProjectTaskAM" ApplicationModuleName="oracle.apps.fnd.applcore.demo.applicationModule.ProjectTaskAM">
 <ViewUsage Name="Projects" ViewObjectName="oracle.apps.fnd.applcore.crmdemo.model.ProjectsVO"/>
 <ViewUsage Name="Tasks" ViewObjectName="oracle.apps.fnd.applcore.crmdemo.model.TasksVO">
 <ViewLinkUsage Name="ProjectsToTasksVL" ViewLinkObjectName="oracle.apps.fnd.applcore.crmdemo.model.ProjectsToTasksVL"
 SrcViewUsageName="oracle.apps.fnd.applcore.crmdemo.model.applicationModule.ProjectsTasksAM.Projects"
 DstViewUsageName="oracle.apps.fnd.applcore.crmdemo.model.applicationModule.ProjectsTasksAM.Tasks"
 Reversed="false"/>
 </ViewUsage>
 </AppModule>
</fnd-osn-metadata>

When deployed in an ADF Library JAR file, this file will be located at META-INF/fnd-osn-integration.xml allowing it be looked up directly on the class path from the "Manage Social Network Objects" page.

The other change that the wizard makes is to modify the view object definition XML file for the attributes that are available for Oracle Social Network integration. It adds or updates a new custom property called fnd:OSN_ENABLED_ATTR within the attribute XML node with a value of true to make that attribute available.

<ViewAttribute Name="DeptName">
 <Properties>
 <SchemaBasedProperties>
 <fnd:OSN_ENABLED_ATTR Value="true"/>
 </SchemaBasedProperties>
 </Properties>
</ViewAttribute>

67.2.1.2 Translating Oracle Social Network Labels

The view object and its attributes are displayed to the functional administrator and end users in the "Manage Social Network Objects" page and also within Oracle Social Network, so these strings must be translated. A functional administrator can use the "Manage Social Network Objects" taskflow to enable Oracle Social Network integration by selecting view objects and attributes. When Oracle Social Network displays a view object Social Object, the data is displayed as name-value pairs. The Oracle Social Network integration re-uses the standard view object process for defining prompts for the translations that are sent to Oracle Social Network. This is done using the UI Hints properties that are already defined upon the business objects.

These UI Hint properties are used from the view object for translations:

  • Display Name - used to show when a label is required for the view object.

  • Display Name (Plural) - used to show when a plural label is required for the view object.

  • Description - used for showing the description in the "Manage Social Network Objects" page.

These UI Hint properties are used from the view object's attributes as Oracle Social Network field label translations:

  • Label - used to show when a label is required for the attribute.

  • Display Name (Plural) - used to show when a plural label is required for the attribute.

What happens when translated Oracle Social Network labels are provided

The view object definition XML file will be modified with these custom properties set:

  • View Object Property node names:

    • LABEL - Display Name

    • LABEL_PLURAL - Display Name (Plural)

    • TOOLTIP - Description

  • Attribute Property node names:

    • LABEL - Label

    • LABEL_PLURAL - Display Name (Plural)

    The values provided in the Edit property window will be seeded into the translation bundle and the key will be stored as the ResId attribute of the relevant property node in the view object definition file. These are sample changes to the view object definition file:

    <ViewObject Name="SndDemoDeptVO">
     <Properties>
     <SchemaBasedProperties>
     <LABEL ResId="DEMO_DEPARTMENT"/>
     <LABEL_PLURAL ResId="DEMO_DEPARTMENTS"/>
     <TOOLTIP ResId="DEMONSTRATION_DEPARTMENT_FOR_S"/>
     </SchemaBasedProperties>
     </Properties>
     <ViewAttribute Name="DeptName">
     <Properties>
     <SchemaBasedProperties>
     <LABEL ResId="DEPARTMENT_NAME"/>
     <LABEL_PLURAL ResId="DEPARTMENT_NAMES"/>
     </SchemaBasedProperties>
     </Properties>
     </ViewAttribute>
    </ViewObject>
    

67.2.1.3 Configuring Oracle Social Network Field Data Types

Oracle Social Network integration is restricted to sending data using a limited number of data types. The view object attributes can be configured to provide some contextual information about how the attribute value will be shown as a field value in Oracle Social Network. For example, a string representing a URL will be kept in the attribute as a String but can be configured to show in Oracle Social Network to display as a clickable link rather than as a static String.

The supported data types, explanations, and their usage are listed in Table 67-2.

Note: A Gadget Type is a type definition for data sent to Oracle Social Network that allows the Oracle Social Network server to provide additional functionality when rendering the value in the UI. For example, a Percent gadget type can be displayed with a %symbol after it and must be a value between 0.0 and 100.0.

Table 67-2 Supported Data Types

Gadget Type Description When to Use Notes

Boolean

Allows the value sent to Oracle Social Network to be treated like a boolean. If the gadget that the conversation/wall is using has been modified in the gadget editor to show the editable representation of the field, then this will be displayed as a check box.

If the attribute being sent to Oracle Social Network is to be viewed as a boolean value.

If the Java Type of the attribute is anything other than java.lang.Boolean, then refer to the Boolean entry in Special Cases - Boolean.

Currency

When sending a numeric attribute value representing a value in a currency to Oracle Social Network, this gadget type can send the additional currency code information relating to that attribute. To send the currency code with the numeric value perform the following steps:

  • Set the Gadget Type on the numeric value attribute to "currency".

  • Set the Currency Code Attribute property to be the name of another attribute in the view object whose value at runtime will be the Currency Code for the numeric value attribute. For example if the following attributes exist:

    Attribute #1: "Credit" Gadget Type="CURRENCY" OSN_ENABLED="true" OSN_CURRENCY_CODE_ATTR="CreditCurrencyCode" Value="23"

    Attribute #2 : "CreditCurrencyCode" Gadget Type="STRING" OSN_ENABLED="false" Value="USD"

    When sent to Oracle Social Network, the credit field will show as Credit: 23 USD

If the numeric value being sent to Oracle Social Network specifies a currency value and the currency code is also required to be sent to Oracle Social Network.

  • The attribute for currency code should be a String value.

  • The attribute for currency code does not need to be flagged as OSN_ENABLED="true" as the currency code value will be sent as part of the numeric value payload being sent to Oracle Social Network.

  • If the attribute for currency code is marked as OSN_ENABLED="true" then it will be shown in a separate Oracle Social Network field from the currency code and if it also is flagged as the "Currency Code Attribute" property value on the numeric value attribute then it will be shown twice: in its own field and also as the numeric attribute's currency code.

Date

Display the attribute value as a formatted date.

If the attribute value is defined as a Date and can be shown as such in Oracle Social Network.

 

Double

Display a number as a floating point with a decimal fraction representation of the number.

When the attribute value will have a decimal fraction to be displayed.

 

Integer

Display a number as a whole number.

When the attribute value will not have a decimal fraction to be displayed.

 

Percent

Display a number as a percentage.

When the attribute value is to be displayed as a percentage.

The values can only be numbers between 0.0 and 100.0.

Person

Display the attribute as a clickable user who exists in Oracle Social Network. By sending the username or identifiable value for a user (most likely an email address in an LDAP-based Oracle Social Network) as a Person Gadget Type, Oracle Social Network will look up the display name for the user in its user security store (local/LDAP) and display a link using the user's display name. When the link is clicked, it will redirect to the Wall for the user represented by the person attribute.

When the attribute value represents the username/identifiable value for a user in Oracle Social Network.

Only email addresses are supported.

  • Attribute value must be a String.

  • Attribute value must be the identifiable value for a user in the security store being used by Oracle Social Network (local/LDAP).

String

Display a value.

If the Java Type of the object being retrieved from the view object does not conform to any of the other Gadget Types.

 

URL

Display a string value as a clickable URL link in Oracle Social Network.

If the attribute value is a fully qualified URL that an Oracle Social Network user will be allowed to click.

  • The URL rendered in Oracle Social Network will not have a label appear next to it.

  • The URL value should be a fully qualified URL to the destination.

If the OSN_GADGET_TYPE is not provided (default state for the property), then the Oracle Social Network integration code will use the Java Type to Gadget Type mapping shown in Table 67-3for sending the data to Oracle Social Network.

Table 67-3 Java Type to Gadget Type Mapping

ADFBC /Java Type Gadget Type Gadget Description

java.sql.Date

java.sql.Timestamp

java.util.Date

oracle.jbo.domain.Date

oracle.jbo.domain.Timestamp

Date

Display the attribute value as a formatted date in Oracle Social Network.

java.lang.Integer

java.lang.Long

java.lang.Short

java.math.BigInteger

java.util.concurrent.atomic.AtomicInteger

java.util.concurrent.atomic.AtomicLong

Integer

Display a number in Oracle Social Network as a whole number.

java.lang.Double

java.lang.Float

java.lang.Number

java.math.BigDecimal

oracle.jbo.domain.Number

Double

Display a number in Oracle Social Network as a floating point with a decimal fraction representation of the number.

java.lang.Boolean

Boolean

Allows the value sent to Oracle Social Network to be treated like a boolean. If the gadget that the conversation/wall is using has been modified (in the Oracle Social Network gadget editor) to show the editable representation of the field then this will be displayed as a check box.

any object using toString

String

Display a value.

any number supported by the Integer or Double Gadget Types

Currency

When sending an numeric attribute value representing a value in a currency to Oracle Social Network this gadget type allows for the sending of the additional currency code information relating to that attribute.

any number supported by the Integer or Double Gadget Types

Percent

Display a number as a percentage.

java.lang.String

Person

Display the attribute in Oracle Social Network as a clickable user who exists in Oracle Social Network. By sending the username or identifiable value for a user, most likely email address in an LDAP based Oracle Social Network, as a Person Gadget Type Oracle Social Network will look up the display name for the user in its user security store (local/LDAP) and display a link with using the users display name. When the link is clicked it will redirect to the Wall for the user represented by the person attribute.

java.lang.String

URL

Display a string value as a clickable URL link in Oracle Social Network.

To configure the attributes for the Oracle Social Network field gadget types (non-Currency):

  • Open the view object.

  • Open the Attributes tab and click an Attribute.

  • In the Property Inspector, open the Applications - Oracle Social Network section.

  • Change the value in the Oracle Social Network Gadget Type to the required type.

  • Click Save to keep the changes.

For setting an attribute to the Currency gadget type, an additional step must be followed to add the currency code for the currency value. By setting the Currency Code attribute property for the attribute, when the Social Object is sent to Oracle Social Network, the currency code value also will be sent with the currency value so that Oracle Social Network can display both values when it displays the currency value. Note that the currency code attribute does not need to be available to Oracle Social Network integration for its value to be used when sending the currency so long as the attribute for the Currency is available to Oracle Social Network integration. These are the steps to set up an attribute for currency:

  • Open the view object.

  • Open the Attributes tab and click an attribute that is to have the gadget type of Currency.

  • In the Property Inspector, open the Applications - Oracle Social Network section.

  • Change the Oracle Social Network Gadget Type to Currency.

  • In the Currency Code attribute property, enter the name of the attribute whose value will contain the currency code value.

  • Click Save to keep the changes.

What happens when setting the Gadget Type

The View Attribute node in the view object definition XML file will be modified with these modified custom properties:

  • fnd:OSN_GADGET_TYPE - the Oracle Social Network Gadget Type.

  • fnd:OSN_CURRENCY_CODE_ATTR - the name of the attribute on the view object whose value will contain the currency code when fnd:OSN_GADGET_TYPE=currency.

    For non-currency attributes:

    <ViewAttribute Name="ColBoolean">
     <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_ENABLED_ATTR Value="true"/>
     <fnd:OSN_GADGET_TYPE Value="boolean"/>
     </SchemaBasedProperties>
     </Properties>
    </ViewAttribute>
    

    For currency attributes:

    <ViewAttribute Name="ColCurrency">
     <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_ENABLED_ATTR Value="true"/>
     <fnd:OSN_GADGET_TYPE Value="currency"/>
     <fnd:OSN_CURRENCY_CODE_ATTR Value="ColCurrencyCode"/>
     </SchemaBasedProperties>
     </Properties>
    </ViewAttribute>
    <ViewAttribute Name="ColCurrencyCode"/>
    

Special Cases - Boolean

If an attribute represents a boolean value, a conversion will be required to send the value to Oracle Social Network. The recommended way to perform a Boolean conversion is to use the Attribute Conversion Framework, described in Implementing the Integration Attribute Conversion Framework.. If the conversion framework cannot be used, then below are the alternative instructions on how to use a transient to achieve the conversion.

The Oracle Social Network integration requires that any attribute marked as Gadget Type Boolean must provide the string value "T" to represent true or "F" to represent false. As part of the Oracle Social Network integration, if a Java Type of java.lang.Boolean is provided, it implicitly is sent to Oracle Social Network as "T" or "F."

An additional exception was made that if an attribute was of type String with Gadget Type of Boolean and the value provided being "T" or "F," then that value will be sent to Oracle Social Network. Any other values or types will not be sent to Oracle Social Network with a message being written to the Diagnostic log.

In Oracle Fusion Applications, it is common practice to define a Boolean value as a String and use values such as "Y" and "N" or "1" and "0." However, it is not just restricted to those values. In this case, just setting the Gadget Type to Boolean will not send any value to Oracle Social Network.

Follow these alternative instructions on how to use a transient to achieve the conversion if the conversion framework cannot be used:

  • Add a new transient attribute to the view object.

  • Set the Type of the attribute to be Boolean.

  • Implement the conversion between the string boolean attribute and the Java Boolean attribute as a Groovy expression or as a Java override of the getter attribute of the transient attribute in the RowImpl class for the view object. For example, this Groovy expression can be used in the "Y"/"N" case:

    "Y".equalsIgnoreCase(<your attribute name>)
    
  • In the Dependencies page of the attribute wizard, make the Boolean transient attribute dependent upon the String boolean attribute.

  • Set the Gadget Type for the Boolean transient attribute as boolean.

  • Either re-open the OSN Enabled View Instances wizard, find the view object and click the Enabled check box for the transient attribute and click OK.

    or

    Open the Attributes tab in the view object, select the transient attribute, go to the Property Inspector and change the OSN Enabled property to be "true."

  • Click Save to keep the changes.

Special Cases - Lookups and Conversion Values

Attributes that are a lookup code must provide a meaning or translated value to Oracle Social Network. The preferred method of conversion for lookups is to use the lookup converters in the conversion framework, as described in Implementing the Integration Attribute Conversion Framework.

The primary use case is lists of values where the lookup code is stored in the view object attribute and a lookup list of values provides a mapping between the lookup code and the descriptive meaning. Supporting the lookups in Oracle Social Network integration requires creating a new attribute that contains the lookup display value. There are two ways the attribute can be defined to provide the meaning value.

  • Foreign key lookup

    Most view objects with a lookup code will already have a join to get the lookup display value. Essentially, a foreign key is defined through the lookup entity object in the view object definition. In this case, the meaning attribute can be Oracle Social Network enabled by using one of these methods:

    • Open the Add OSN View Instances wizard, find the view object, select the Enabled check box for the meaning attribute, and click OK.

    • Open the Attributes tab in the view object, select the meaning attribute, go the Property Inspector and change the OSN Enabled property to be "true".

  • Transient attribute lookup

    A string transient attribute will be defined and the view object Row Impl's getter for the transient will perform the lookup based upon the lookup code and return the meaning value. This is similar to how boolean values are handled where the transient attribute will be Oracle Social Network enabled.

Special Cases - Timezone Affected Values

The function of Oracle Social Network requires that a date value be passed to Oracle Social Network as the number of milliseconds since Epoch. The Oracle Social Network integration takes the date value provided from the attribute count in milliseconds and sends it to Oracle Social Network. Oracle Social Network then will display that value with the settings configured with Oracle Social Network. If there must be a deviation to how this works to account for timezoned dates, then a transient attribute approach where the time is modified and passed to Oracle Social Network integration as a new date will need to be performed.

  • Add a new transient attribute to the view object.

  • Set the Type of the attribute to be Date/TimeStamp.

  • Implement the timezone conversion between the original Date/TimeStamp attribute and the Date/TimeStamp transient attribute so that the value will be correct when being retrieved as milliseconds since Epoch as a Groovy expression or as a Java override of the getter attribute of the transient attribute in the RowImpl class for the view object.

  • In the Dependencies page of the attribute wizard, make the Date/TimeStamp transient attribute dependent upon the Original Date/TimeStamp attribute.

  • Set the Gadget Type for the transient attribute as Date.

  • Either re-open the Add OSN View Instances wizard, find the view object and select the Enabled check box for the transient attribute and click OK.

    or

    Open the Attributes tab in the view object, select the transient attribute, go to the Property Inspector and change the OSN Enabled property to be "true".

  • Click Save to keep the changes.

Special Cases - Other types of attributes that do not fit the defined list of Oracle Social Network Gadget Types

If there are other value types in a view object attribute that need to be sent to Oracle Social Network or provided in a different format, The preferred method to convert other types is a custom conversion as described in How Custom Attribute Conversions Are Implemented.If the conversion framework cannot be used, then follow these alternative instructions on how to use a transient to achieve the conversion.

  • Add a new transient attribute to the view object.

  • Set the Type of the attribute to be String.

  • Implement the conversion between the custom value type and the String transient attribute as a Groovy expression or as a Java override of the getter attribute of the transient attribute in the RowImpl class for the view object.

  • In the Dependencies page of the attribute wizard, make the String transient attribute dependent upon the custom value type attribute.

  • Set the Gadget Type for the transient attribute as String.

  • Either re-open the Add OSN View Instances wizard, find the view object, select the Enabled check box for the transient attribute, and click OK.

    or

    Open the Attributes tab in the view object, select the transient attribute, go to the Property Inspector and change the OSN Enabled property to be "true".

  • Click Save to keep the changes.

67.2.1.4 Implement the Integration Attribute Conversion Framework

An Oracle Fusion Applications developer can choose attributes from a view object that can be sent to Oracle Social Network. However, in some circumstances, the value that is retrieved may not be the value that is required to be sent. In these cases, a converter is required to take the attribute value from the view object row and change it into the value required. The converter is defined against the view object's attribute definition and executed automatically by the Oracle Social Network integration code. The converters:

  • Allow being able to send to Oracle Social Network a modified version of the value stored in Oracle Fusion Applications.

  • Provide the ability for lookup values (such as LOV values) to be looked up without having to add additional transient attributes to the original view object.

  • Ensure the modification tracking of updates will work correctly as the modification is made to the "code" value in a lookup, not the "display" value. Previous to this enhancement, the "display" value would be required to be Oracle Social Network-enabled rather than the "code".

For example, Oracle Fusion Applications developers configure the view objects and attributes for the Oracle Social Network integration. However, restrictions on the Oracle Social Network server, and product team requirements mean that the value stored in the database table for a record cannot be sent to Oracle Social Network as-is. In these cases, a converter is required to be assigned to the attribute definition to take the stored value and convert it into the required format or value required by Oracle Social Network without any additional effect on the send to Oracle Social Network process.

There are four out-of-the-box converters ready to be used. A single converter can be added to the Attribute by using the values in the OSN Converter property in the property inspector. The OSN Converter property has a dropdown list containing these out-of-the-box converters. If the converter requires additional values to be supplied before the conversion can occur, then these can be set in the OSN Converter Parameters property that resides immediately below the OSN Converter property. The list of additional converter parameters to fill in can be seen by choosing the Edit... option from the property menu. The four out-of-the-box converters are:

  • Boolean Converter

    Provides the ability to convert the object passed in into a boolean type based upon a customizable list of accepted (whitelist/true) or rejected (blacklist/false) values. If the object passed into convertBoolean is of type java.lang.Boolean, then this will be returned immediately. Otherwise, toString will be called on the object and the resultant String will be compared using a case-insensitive comparison to the trueValues or falseValues using the following algorithm:

    • trueValues and falseValues provided, then use trueValues and ignore falseValues.

    • trueValues=null and falseValues=null, default trueValues to be "y,t,1,yes,true".

    • trueValues supplied, then split the trueValues CSV and see if the passed-in value matches one of the values. If so, return true, otherwise false.

    • falseValues supplied and trueValues=null, then split the falseValues CSV and see if the passed-in value matches one of those values. If so, return false, otherwise true.

    The CSV parameters will conform to a standard CSV encoding to ensure the parameters do not become corrupt during persistence. Double quotes will be escaped by a second double quote (for example, " becomes "") and each entry in the CSV can be quoted.

    Note: This converter is strictly meant for converting "code values" into boolean values. Looked-up translated values are not supported with the OsnBooleanConverter. If a translated value is required to be sent to Oracle Social Network, either the translation can be sent as a string (using the LovConverter or LookupConverter) or a custom converter will need to be written. When mentioning the default trueValues whitelist, the values of yes/true are constant code values, not translatable versions of yes/true.

    OSN Converter: BooleanConv

    Parameters:

    • trueValues - (optional) - the CSV string list of values that when matched will return true from the converter.

    • falseValues - (optional) - the CSV string list of values that when matched will return false from the converter.

    Validates For: If attribute value to convert is null.

    Upon Validation Failure Return: null

    Can Convert Null: No

    Example:

    ColBoolean field in Oracle Social Network will be true if the attribute value is either "y" or "yes" (case-insensitive). All other values will return false.

    <ViewAttribute
     Name="ColBoolean"
     PrecisionRule="true"
     EntityAttrName="ColBoolean"
     EntityUsage="FndDemoOsnFieldsEO"
     AliasName="COL_BOOLEAN">
     <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_ENABLED_ATTR
     Value="true"/>
     <fnd:OSN_GADGET_TYPE
     Value="boolean"/>
     <fnd:OSN_CONVERTER
     Value="BooleanConv"/>
     <fnd:OSN_CONVERTER_PARAM
     Value="trueValues=y,yes"/>
     </SchemaBasedProperties>
     </Properties>
     </ViewAttribute>
    
  • Percentage Converter - 0.0-1.0 range converted to 0.0-100.0 range

    Converts the value between 0.0 and 1.0 that is provided and returns the matching percentage value between 0.0 and 100.0 required by Oracle Social Network for the percent Gadget Type. The convertPercentage method takes the value supplied, ensures that it meets the exception statement, converts it to a double value, and multiplies it by 100.0.

    OSN Converter: ZeroToOnePercentConv

    Parameters: None

    Validates For: A null, a non-numeric value, or a value not between 0.0 and 1.0 is passed in.

    Upon Validation Failure Return: null

    Can Convert Null: No

    Example:

    <ViewAttribute
     Name="ColPercent"
     PrecisionRule="true"
     EntityAttrName="ColPercent"
     EntityUsage="FndDemoOsnFieldsEO"
     AliasName="COL_PERCENT">
     <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_ENABLED_ATTR
     Value="true"/>
     <fnd:OSN_GADGET_TYPE
     Value="percent"/>
     <fnd:OSN_CONVERTER
     Value="ZeroToOnePercentConv"/>
     </SchemaBasedProperties>
     </Properties>
     </ViewAttribute>
    
  • Attribute Lookup Converter

    The converter will look up another attribute value from the same view object row and substitute it for the actual attribute value.

    OSN Converter: OsnFieldValueConverter

    Parameters:

    displayAttributeName - mandatory - the name of another attribute in the view object to return the value of.

    Validates For: A null or a non-existent display attribute name supplied.

    Upon Validation Failure Return: null

    Can Convert Null: No

    Example:

    The value assigned to the ColString attribute will be sent to Oracle Social Network as the value for the ColLookupString Oracle Social Network field.

    <ViewAttribute
     Name="ColLookupString"
     PrecisionRule="true"
     EntityAttrName="ColLookupString"
     EntityUsage="FndDemoOsnFieldsEO"
     AliasName="COL_LOOKUP_STRING">
     <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_ENABLED_ATTR
     Value="true"/>
     <fnd:OSN_CONVERTER
     Value="LookupConv"/>
     <fnd:OSN_CONVERTER_PARAM
     Value="displayAttributeName=ColString"/>
     <LABEL
     ResId="LOOKUP_CONVERTED"/>
     </SchemaBasedProperties>
     </Properties>
    </ViewAttribute>
    <ViewAttribute
     Name="ColString"
     PrecisionRule="true"
     EntityAttrName="ColString"
     EntityUsage="FndDemoOsnFieldsEO"
     AliasName="COL_STRING">
     <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_ENABLED_ATTR
     Value="true"/>
     <fnd:OSN_GADGET_TYPE
     Value="string"/>
     <DISPLAYWIDTH
     Value="80"/>
     </SchemaBasedProperties>
     </Properties>
    </ViewAttribute>
    
  • LOV Converter

    If an attribute has an LOV associated with it, then the LOV converter will use the definition of the attribute and look up the LOV associated with the attribute. It can then look up the display value from the LOV that is associated with the attribute value and send the LOV display value to Oracle Social Network.

    OSN Converter: OsnAttributeLookupLovConverter

    Parameters: None

    Validates For: An LOV List Binding must be defined for the attribute.

    Upon Validation Failure Return: null

    Can Convert Null: No

    Example:

    In this example the display value from the LOV_ColStatus LOV will be sent that matches the value of this attribute.

    <ViewAttribute
     Name="ColStatus"
     PrecisionRule="true"
     EntityAttrName="ColStatus"
     EntityUsage="FndDemoOsnFieldsEO"
     AliasName="COL_STATUS"
     LOVName="LOV_ColStatus">
     <Properties>
     <SchemaBasedProperties>
     <CONTROLTYPE
     Value="choice"/>
     <fnd:OSN_CONVERTER
     Value="LovConv"/>
     <LABEL
     ResId="LOV_CONVERTED"/>
     <fnd:OSN_ENABLED_ATTR
     Value="true"/>
     </SchemaBasedProperties>
     </Properties>
    </ViewAttribute>
    
67.2.1.4.1 How Custom Attribute Conversions Are Implemented

If the conversions supplied do not meet the requirement for a conversion of an attribute value being sent to Oracle Social Network, then a custom converter can be written. The conversion framework converters are based around a central Java class called OsnFieldValueConverter (oracle.apps.fnd.applcore.oaext.osn.publicutil.converter). It is the abstract base class that all converters will inherit. There must be a zero parameter default constructor that will be used to create the instance of the converter. It contains a solitary public method, run, that will be passed the value to convert and a context object comprised of the attribute name, the intended Oracle Social Network gadget type, and the ViewRowImpl containing the value to convert.

The run method is responsible for executing the conversion by calling the abstract convert method and not allowing any exceptions that happen during conversion to be bubbled outside of the converter. If an exception occurs during the conversion, the implementing converter can choose to return the passed-in value, or null (the default behavior) back from the conversion.

It also has logging around the convert call to describe the performance and the converted result of the conversion attempt. A short circuit is built in for null handling using the canConvertNull override method. If a converter returns false for this method (which is the default implementation), then the convert method will not be called and null immediately will be returned from the run method. If a converter can convert null into another value, then the converter can override this method and return true so that the convert method will always be called.

Any converter that is built as a sub-class of OsnFieldValueConverter must implement the convert method that has the same signature as the run method, except that it can throw a checked OsnConversionException. This exception can provide details from the converter implementation about why a conversion attempt failed.

To provide more type checking abilities during conversion, three abstract "base" converters, which implement the OsnFieldValueConverter, are available that implement the convert method but call another abstract method that any sub-classes must implement that will ensure that the return value from a conversion is of the type required:

  • OsnBaseBooleanValueConverter - Has an abstract convertBoolean method that takes the same parameters as convert but requires that a Java boolean native type be returned. Since the Oracle Social Network server requires that a boolean be provided as either "T" or "F", the boolean result from convertBoolean will be returned from the convert method as "T"/"F".

  • OsnBasePercentageValueConverter - Has an abstract convertPercentage method that takes the same parameters as convert but requires that a Java double native type be returned. It also will do post processing to ensure that the value conforms with the expected range of 0.0 to 100.0 from Oracle Social Network and throw an OsnConversionException if the converted value from convertPercent is out of range.

  • OsnBaseDateValueConverter - Has an abstract convertDate method that takes the same parameters as convert but requires that a Java long native type be returned. The long value signifies the Oracle Social Network requirement that all Date gadget type values be represented as the number of milliseconds since Epoch.

For an Oracle Fusion Applicationsproduct team to consume a converter for its attributes, the fully-qualified class name for the converter can be manually typed into the OSN Converter property (fnd:OSN_CONVERTER). If there are custom parameter values required for the converter, they will be read from the view object Attributes Converter Parameters parameter. The fnd:OSN_CONVERTER_PARAM is in the format "parameter1=value1;parameter2=value2". Each parameter will need to have its own getter and setter on the converter class. In this example, the setParameter1 method would be called with value1 and the setParameter2 method would be called with value2 before the run method was called. The getter for these parameters will need to be annotated with @OsnConverterParam to identify it as a converter parameter and show in the OSN Converter Parameters property menu UI. Any parameter values that are supplied in fnd:OSN_CONVERTER_PARAM that do not have a matching getter and setter will be ignored in the property menu. Expression Language expressions are not supported as the fnd:OSN_CONVERTER_PARAM, or as the values within the parameter list.

What happens at runtime when sending to OSN:

When the view object row attribute value is loaded and is about to be put into the payload to send to Oracle Social Network, the converter will be enacted using the following process:

  • Read the Converter parameter (fnd:OSN_CONVERTER).

  • Create the instance of the converter class using the fully-qualified class name.

  • Read and set any parameters from fnd:OSN_CONVERTER_PARAM on the converter instance.

  • Determine the run method called to execute the conversion.

  • Put the value returned from the converter into the Oracle Social Network payload for that attribute.

67.2.1.5 Configuring Oracle Social Network Object Title

When a view object row is sent to Oracle Social Network as a Social Object, it will be displayed in the Oracle Social Network UI as a record with a title and a collection of name-value pairs. The value that is shown as the title of the Social Object can be configured on the view object. The following steps describe how to set the title for the Social Object:

  • Open the view object in JDeveloper and click the Attributes tab.

  • Determine that the attribute is to be used as the Social Object title value. If this is a pre-existing attribute value, skip the next three optional steps.

  • [Optional-generated title] Define a new transient attribute that has a type of String.

  • [Optional-generated title] Implement the title generation in the transient attribute as a Groovy expression or as a Java override of the getter attribute of the transient attribute in the RowImpl class for the view object.

  • [Optional-generated title] In the Dependencies page of the attribute wizard, make the String transient attribute dependent upon the custom value type attribute.

  • Select the attribute (transient or actual).

  • Access the Property Inspector in the Applications - Oracle Social Network section and set the Oracle Social Network User Key to be "true".

  • Click Save to keep the changes.

What happens when you define the Oracle Social Network Social Object Title

The Attribute definition within the view object definition XML file will be modified with the following custom property:

fnd:OSN_USER_KEY - The Oracle Social Network User Key custom attribute.

The following is an example of the modification in the view object attribute definition XML file:

<ViewAttribute Name="DeptName">
 <Properties>
 <SchemaBasedProperties>
 <fnd:OSN_ENABLED_ATTR Value="true"/>
 <fnd:OSN_USER_KEY Value="true"/>
 </SchemaBasedProperties>
 </Properties>
</ViewAttribute>

Note:

  • There should be only one attribute with the Oracle Social Network User Key custom property value set to "true". If there are multiple attributes with the custom property set, then the first one that is found during processing will be used and all others will be ignored.

  • If no attributes are provided with this custom property set, then the concatenated values of the attributes that comprise the view object primary key will be used.

67.2.1.6 Configuring Oracle Social Network Object Key

When a view object row is sent to Oracle Social Network, the Social Object will be assigned an internal unique identifier that will represent the Social Object during any interactions with Oracle Social Network. To perform subsequent updates to the Social Object from the view object, the Social Object also retains an external key based upon a single attribute value that must be sent to Oracle Social Network with every call. Without any additional configuration, the Oracle Social Network integration will build a concatenated value based upon the values of the attributes marked as the primary key that should suffice in most scenarios. If this concatenated value is longer than 256 characters, or the developer has a better key to use to uniquely identify the row, the Oracle Social Network integration provides the ability to override the automatically-generated value with a value of a custom property called OSN Object Key. For example, if a child object in a parent-child relationship is being sent to Oracle Social Network, then its primary key may be comprised of the parent object's primary key plus a unique value for the child. If the child value is unique within the child table, then the parent primary key is not required for the Social Object to uniquely identify with the view object row. So by marking the child unique value as the Oracle Social Network Object Key, there will be a slight performance gain as the external key for the Social Object does not need to be calculated.

To set up the Oracle Social Network Object Key:

  • Open the view object in JDeveloper and click the Attributes tab.

  • Determine that attribute is to be used as the Social Object external key value. If this is a pre-existing attribute value then skip the next three optional steps.

  • [Optional-generated key] Define a new transient attribute that has a type of String.

  • [Optional-generated key] Implement the key generation in the transient attribute as a Groovy expression or as a Java override of the getter attribute of the transient attribute in the RowImpl class for the view object.

  • [Optional-generated key] In the Dependencies page of the attribute wizard, make the String transient attribute dependent upon the custom value type attribute.

  • Select the attribute (transient or actual).

  • Access the Property Inspector in the Applications - Oracle Social Network section and set the Object Key to be "true."

  • Click Save to keep the changes.

    What happens when you define the Oracle Social Network Social Object Key

    The Attribute definition within the view object definition XML file will be modified with the following custom property:

    fnd:OSN_OBJECT_KEY - The Object Key attribute.
    

    The following is an example of the modification in the view object Attribute definition XML.

    <ViewAttribute Name="DeptNum">
     <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_ENABLED_ATTR Value="true"/>
     <fnd:OSN_OBJECT_KEY Value="true"/>
     </SchemaBasedProperties>
     </Properties>
    </ViewAttribute>
    

    Note:

    • Single attribute primary key view objects do not need to set this value because no concatenations need to occur to get the primary key value to use.

    • There should only one attribute with the Oracle Social Network Object Key custom property value set to "true". If there are multiple attributes with the custom property set, then the first one that is found during processing will be used and all others will be ignored.

    • If no attributes are provided with this custom property set, then the concatenated values of the attributes that comprise the view object primary key will be used.

67.2.1.7 Configuring the View Details URL

Use the information in this section to navigate from the Oracle Social Network Social Object into the Oracle Fusion Applicationsuser interface.

After a view object row is sent to Oracle Social Network as a Social Object there may be a need for the user to modify the original values for that row. The mechanism that allows navigating from the Social Object back into the record in Oracle Fusion Applicationsuses a "View Details" URL that is shown when viewing the Social Object details. To be able to generate a URL that can navigate into Oracle Fusion Applications, there must be a taskflow to be called that can accept parameters to load the row in the product application page as well as configuration on the view object that provides the information allowing the Oracle Social Network integration to build the URL. The configuration on the view object is performed by setting the following properties:

  • Nav Web Application (fnd:OSN_FA_WEBAPP) - This is a mandatory field. It is the identifier for a registered web application that is to be called back into. The value provided here must be seeded into Topology Manager as a deployed application.

    It is used in the Oracle Social Network integration to determine the web applications that will be called back into when the View Details link is clicked. This web application will be used to look up the base URL for the callback URL. An example is shown here:

    <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_FA_WEBAPP
     Value="ApplcoreCRMDemo"/>
     </SchemaBasedProperties>
     </Properties>
    
  • Nav View Id (fnd:OSN_FA_VIEW_ID) -This is a mandatory field. This is the identifier for the view that will be displayed upon callback.

    It is used in the Oracle Social Network integration to determine what view is to be loaded when the callback is made from the View Details link. An example is shown here:

    <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_FA_VIEW_ID
     Value="MyPage"/>
     </SchemaBasedProperties>
     </Properties> 
    
  • Nav Page Params List (fnd:OSN_FA_PAGE_PARAMS_LIST) - This is a semicolon separated list of name-value pairs to be passed to the Oracle Fusion application's page as page level parameters when the callback is made from the View Details link. An example is shown here:

    <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_FA_PAGE_PARAMS_LIST
     Value="key1=value1;key2=value2"/>
     </SchemaBasedProperties>
     </Properties> 
    
  • Nav Taskflow Id (fnd:OSN_FA_NAV_TASKFLOW_ID) - This is a mandatory field. This is an Id to a bound task flow available in the page. This task flow will be called and passed parameters from OSN_FA_NAV_TASK_PARAMS_LIST when the callback is made from the View Details link. An example is shown here:

    <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_FA_NAV_TASKFLOW_ID
     Value="/WEB-INF/StartupDefaultMainTaskFlow.xml#StartupDefaultMainTaskFlow"/>
     </SchemaBasedProperties>
     </Properties> 
    
  • Nav Task Key List (fnd:OSN_FA_NAV_TASK_KEY_LIST) - This is a semicolon separated list of name-value pairs to be passed to the page containing the task flow. These parameters are used to distinguish one instance of the task flow from any others that are also running. An example is shown here:

    <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_FA_NAV_TASK_KEY_LIST
     Value="key1=value1;key2=value2"/>
     </SchemaBasedProperties>
     </Properties> 
    
  • Nav Task Params List (fnd:OSN_FA_NAV_TASK_PARAMS_LIST) - This is a semicolon separated list of name-value pairs to be passed to the called bound task flow in the Oracle Fusion application's page. These will be specific to the task flow and need to be defined as input parameters on the task flow. An example is shown here:

    <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_FA_NAV_TASK_PARAMS_LIST
     Value="key1=value1;key2=value2"/>
     </SchemaBasedProperties>
     </Properties>
    
  • Task Label (fnd:OSN_FA_NAV_TASK_LABEL) - This is the label to be shown on the tab displayed that contains the bound task flow. This label will be a key into the appropriate translated bundle. An example is shown here:

    <SchemaBasedProperties>
     <fnd:OSN_FA_NAV_TASK_LABEL
     Value="SearchFlatTableVO1_OSN_FA_NAV_TASK_LABEL"/>
     </SchemaBasedProperties>
     </Properties>
    xlf bundle ....
    <trans-unit id="SearchFlatTableVO1_OSN_FA_NAV_TASK_LABEL">
     <source>Flat Table</source>
     <target/>
     </trans-unit> 
    
  • Task Label Attribute (fnd:OSN_FA_NAV_TASK_LABEL_ATTR) - This is the name of an attribute in the view object that contains the label to be shown on the tab displayed that contains the bound task flow. An example is shown here:

    <Properties>
     <SchemaBasedProperties>
     <fnd:OSN_FA_NAV_TASK_LABEL_ATTR
     Value="TaskLabelAttribute"/>
     </SchemaBasedProperties>
    </Properties>
    

    Note:

    • This should not be used if the Task Label property is set. If both are set, then this one will take precedence and the Task Label will be ignored.

    • The attribute to which this property refers can be a transient or actual attribute.

The values supplied for Nav Page Params List, Nav Task Key List, Nav Task Params List and Task Label can contain attribute name tokens that will be resolved when the View Details URL is being generated before it is sent to Oracle Social Network. The token is made up of an attribute name contained within curly brackets {}.

For example, if the Nav Task Params List is defined as "deptNumParam={DeptNum}" then the value of the view object row Attribute called "DeptNum" will replace the {DeptNum} token.

To set up the view object for the View Details URL:

  • Open the view object in JDeveloper and click the General tab.

  • In the Property Inspector, go to the Applications - Oracle Social Network section.

  • Fill in the following custom properties:

    Nav Web Application

    Nav View Id

    Nav Page Params List

    Nav Taskflow Id

    Nav Task Key List

    Nav Task Params List

    Task Label

    Task Label Attribute

  • Click Save to keep the changes.

What happens when you configure the View Details URL Properties

The view object definition XML file will be modified with the following custom properties:

<ViewObject Name="SndDemoDeptVO">
 <Properties>
 <SchemaBasedProperties>
 <fnd:OSN_FA_WEBAPP Value="SocialNetworkDemo"/>
 <fnd:OSN_FA_VIEW_ID Value="SocialNetworkDemo"/>
 <fnd:OSN_FA_NAV_TASKFLOW_ID Value="/WEB-INF/DemoDepartmentTF.xml#DemoDepartmentTF"/>
 <fnd:OSN_FA_NAV_TASK_PARAMS_LIST Value="deptNumParam={DeptNum}"/>
 <fnd:OSN_FA_PAGE_PARAMS_LIST Value="deptNumPageParam={DeptNum}"/>
 <fnd:OSN_FA_NAV_TASK_KEY_LIST Value="deptNumKeyParam={DeptNum}"/>
 <fnd:OSN_FA_NAV_TASK_LABEL ResId="NAVIGATE_DEPT_DEPTNUM"/>
 </SchemaBasedProperties>
 </Properties>
</ViewObject>

When the end user submits the view object row this will trigger the Social Object to be generated for sending to Oracle Social Network. As part of this generation the View Details URL will be constructed and added to the Social Object payload. The URL is generated using an algorithm that will perform lookups, such as determining the base URL from the Web App Id, and other parameter manipulations that will convert these parameters into a string that UIShell will accept as secure and valid. The UIShell, when called with this URL, will be able to determine what the parameters were and how to load the page and taskflow. For example, the following parameters will generate into the URL.

  • View Object Custom Properties

    fnd:OSN_FA_WEBAPP="SocialNetworkDemoApp"
    fnd:OSN_FA_VIEW_ID="SocialNetworkDemo"
    fnd:OSN_FA_NAV_TASKFLOW_ID="/WEB-INF/DemoDepartmentTF.xml#DemoDepartmentTF"
    fnd:OSN_FA_NAV_TASK_PARAMS_LIST="deptNumParam={DeptNum}"
    fnd:OSN_FA_NAV_TASK_LABEL="Navigated {DeptNum}Department"
    
  • Topology Manager Setup

    Deployed Module "SocialNetworkDemoApp"=http://localhost:7001/snd-context-root
    
  • View Object Row

    DeptNum attribute value=350
    
  • Generated View Details URL

    http://localhost:7001/snd-context-root/faces/SocialNetworkDemo?fnd=%252FWEB-INF%252FDemoDepartmentTF.xml%2523DemoDepartmentTF%3BdeptNumParam%253D350%3B%3BNavigated%2B350%2BDepartment%3Bfalse%3B256
    

67.2.1.8 Changing the Oracle Social Network Registration Name

When a view object is registered with Oracle Social Network as a Social Object definition, the definition must have a unique name assigned to it that will be used to identify the definition. Without any additional configuration, the registration name will be the concatenation of the application module Id and the fully qualified view object Name. For example, if the application module Id was FND and the view object was oracle.apps.fnd.applcore.demo.FndDemoDeptVO, then the registration definition would be FND.oracle.apps.fnd.applcore.demo.FndDemoDeptVO. In addition to the registration name for the view object, the Social Object Field Names are based upon the names of the attributes in the view object.

The Oracle Social Network integration provides a way to override the view object Social Object registration name and the Social Object Field Names. This can be done for the continued support of the existing Oracle Social Network registrations (such as for CRM/HCM) or to ensure that the length of the names does not exceed the 256 character limit.

To set the overrides of the Social Object definition registration names:

  • Open the view object in JDeveloper and click the General tab.

  • In the Property Inspector go to the Applications - Oracle Social Network section.

  • Set the following custom property to override the view object's Social Object registration definition name:

    fnd:OSN_DEFINITION_NAME - This must be in the format <module id>.<name>. For example: FND.FndDempDept.

  • Click the Attributes tab and select the attribute that is to have its Social Object Field Name overridden.

  • Set the following custom property:

    fnd:OSN_DEFINITION_NAME - The Social Object Field name the attribute will be referred to as.

  • Click Save to keep the changes.

What happens when you change the Social Object Registration Name

The following custom properties are modified within the view object XML definition.

  • fnd:OSN_DEFINITION_NAME - Definition Name

  • fnd:OSN_ATTR_DEFINTION_NAME - Oracle Social Network Attribute Name Override

The view object definition XML file will be modified with these custom properties:

<ViewObject Name="FndDemoOsnFieldsVO">
<Properties>
 <SchemaBasedProperties>
 <fnd:OSN_DEFINITION_NAME Value="fnd.FndDemoOsnFieldsVO"/>
 </SchemaBasedProperties>
</Properties>
<ViewAttribute Name="OsnTestRecordId">
 <Properties>
 <SchemaBasedProperties>
 <fnd:OSN_ENABLED_ATTR Value="true"/>
 <fnd:OSN_ATTR_DEFINITION_NAME Value="TestId"/>
 </SchemaBasedProperties>
 </Properties>
</ViewAttribute>

67.2.1.9 Configuring View Objects that Have Multiple Updatable Entities

The Oracle Social Network integration can support view objects that are comprised of multiple updatable entity objects.

A multi-updatable entity object view object is:

  • A view object that has multiple entity objects selected to be within it.

  • The Join Type must be an inner join.

  • The entity objects that are participating in the update must have an association defined between them that creates an accessor in the Primary entity object that returns an instance of an OAEntityImpl (or one of its sub-classes) objects that is the instance of the Secondary entity object.

There are several cases in Oracle Fusion Applicationswhere an Oracle Social Network integration available view object is tied to multiple updatable entity objects. For example, several Oracle Fusion applicationsuse TCA (HZ_PARTIES) to manage key attributes about a person or company. Many teams, such as Procurement and CRM, extend the TCA schema with their own tables and columns to meet the information gathering requirements for their product. Procurement owns an entity called Supplier that extends the TCA Party schema to maintain information about a company from which you would like to purchase goods and services. The Supplier view object would therefore have updateable attributes from both the Supplier entity object and the TCA Party entity object. ATG business event registration for Oracle Social Network integration typically only references the primary entity object. In the TCA case, a customer can go to the Maintain Supplier UI and update a single attribute, such as Supplier Name. The Supplier Name is maintained in the TCA Party entity object that, in this case, is not the primary entity object. We must publish these cases to Oracle Social Network as update events but we do not want to place the Oracle Social Network integration events on multiple entity objects to avoid mass duplication of events.

The solution for this use case is to register the Primary entity object (Supplier entity object) as a post transaction listener for the Secondary entity object (Party entity object). Whenever an update occurs in the Secondary entity object, the primary entity object will also be notified and its post transaction processing will send the view object data from both entity objects to Oracle Social Network.

These implementation steps are required to enable Oracle Social Network for multi-entity entity objects. This assumes the pre-condition of the accessor being as described at the beginning of this section.

  • In Jdeveloper, open the definition of the Primary entity object class.

  • Access the Java tab and click the Edit icon.

  • Click Generate Entity Collection Class.

  • Click OK to generate the EOCollImpl class for the entity object.

  • Open the EOCollImpl class for the entity object in the source editor.

  • Add the following code:

    @Override
    protected EntityImpl add(EntityImpl srow)
    { 
    OAEntityImpl eo =(OAEntityImpl) super.add(srow); 
    byte state =srow.getPostState();
     if(EntityImpl.STATUS_UNMODIFIED ==state ||
    EntityImpl.STATUS_MODIFIED ==state)
     {
    eo.registerOsnExternalListener("SecondaryEOAccessor"); 
    }
    return eo;
    }
    
  • Change the SecondaryEOAccessor to be the name of the accessor attribute in the Primary entity object that returns the OAEntityImpl (or sub-class) for the Secondary entity object.

What happens when the secondary Entity Object Accessor Registration occurs

The "add" method override accomplishes these actions:

  • Ensures that Oracle Social Network integration on the primary entity object exists before performing any registration.

  • Ensures that the accessor provided refers to an instance of an OAEntityImpl object.

  • Checks to see that attributes in the Secondary entity object are to be sent to Oracle Social Network as marked in the view object. If there are no fields from the Secondary entity object to be sent, then no listener will be registered. If there are fields to be sent to Oracle Social Network, then an internal reference is set up in the instance of the Secondary entity object marking that column it is to track for Oracle Social Network.

At runtime, each entity object will track which fields are to be sent to Oracle Social Network (if any). When a post action occurs, the Secondary Entity Object will notify the Primary Entity Object that it has been modified. The Primary Entity Object retrieves the associated view object to collate all fields that have been traced for sending to Oracle Social Network from all participating entity objects. The view object then will perform the send to Oracle Social Network. The Primary Entity Object will ensure that if multiple Secondary Entity Objects are modified, then only one send to Oracle Social Network will occur.

What happens if "add" in the Primary EOCollImpl is not performed and attributes from the Secondary entity object have been marked as Oracle Social Network enabled in the view object?

There are three types of events that will occur:

  • Primary entity object fields only updated - The post event occurs on the Primary entity object and those fields in the Primary entity object will be sent to Oracle Social Network.

  • Primary entity object and Secondary entity object fields updated - When the post event occurs, it will fire on the Primary entity object. Because the send is done from the view object, all fields that can be sent to Oracle Social Network from both the Primary and Secondary entity objects will be sent to Oracle Social Network.

  • Secondary entity object fields only updated - Only a post transaction event will occur on the Secondary entity object and therefore no data will be sent to Oracle Social Network.

What if Multiple Updateable Entity Objects are included in View Object as non-reference

Having multiple entity objects included in the view object is generally not recommended by the BC4J framework but it is possible to implement. The complication for Oracle Social Network integration is that it uses the non-reference entity object to identify the Primary Entity Object. If there are multiple non-reference entity objects within the view object, then it is most likely that the Oracle Social Network integration will choose the incorrect entity object to be the Primary Entity Object. The solution to this is to add the fnd:OSN_PRIMARY_EO property to the view object's properties and provide the EntityUsage name of the entity object to use as the Primary Entity Object. This property can only be added in the view object source because there intentionally is no Property Inspector fnd:OSN_PRIMARY_EO property.

This example demonstrates the use of the fnd:OSN_PRIMARY_EO property:

<ViewObject
 xmlns="http://xmlns.oracle.com/bc4j"
 Name="MeoDeptAttachNonReferenceVO"
 xmlns:fnd="http://xmlns.oracle.com/apps/entityview">
 <Properties>
 <SchemaBasedProperties>
 <fnd:OSN_PRIMARY_EO Value="MeoFndDemoDeptEO"/>
 </SchemaBasedProperties>
 </Properties>
 <EntityUsage
 Name="MeoFndDemoDeptEO"
 Entity="oracle.apps.fnd.applcore.socialnetwork.model.test.setup.multieo.attach.MeoFndDemoDeptEO"/>
</ViewObject>

By identifying which entity object is the Primary Entity Object for the view object, the Manage Oracle Social Network Objects UI will correctly configure the Oracle Social Network integration to ensure all send requests are sent using the declared Primary Entity Object.

Note:

fnd:OSN_PRIMARY_EO only needs to be implemented where there are multiple entity objects in the view objects that are flagged as non-reference. If there is only one entity object in the view object as non-reference, do not set this flag.

When not to use multiple updateable entity objects Oracle Social Network Integration for a view object

Consider this scenario:

  • There are two view objects: the first view object (FirstVO) has two entity objects contained within it (OneEO +TwoEO) and the second view object (SecondVO) has only one entity object in it (TwoEO).

  • The secondary entity object of the first view object (TwoEO) is the primary, and only, entity object of the second view object.

In this scenario, it does not make sense to use Oracle Social Network integration as there will be a synchronization issue. Since there are two view objects that contain data from TwoEO, there will be two Social Objects in Oracle Social Network that contain this data. When TwoEO data is updated from the SecondVO, only the Social Object that relates to the SecondVO will be updated. There is no way to determine that the FirstVO has been affected and its data should be re-synchronized to Oracle Social Network. The following is the recommended outcome to ensure that the data remains synchronized on Oracle Social Network:

  • Do not perform the Secondary entity object registration steps as outlined in the Additional Advanced Configuration - View Objects That Have Multiple Updatable Entities section.

  • Leave the second view object to send all updateable information relating to the secondary entity object (TwoEO).

  • In the first view object, only include attributes from the secondary entity object that will not change after the Social Object has been created. For example: Social Object title or primary key value.

  • In the first view object you should include attribute values that will help an end user find the associated Social Object for the second view object. For example: Social Object title or primary key value.

There is a future feature that has been mentioned (but has no schedule for implementation) where two social objects can be associated with each other. This feature, when implemented and uptaken by ATG-OSN integration, will allow the end user to quickly navigate between the two associated social network objects that will make the above recommendation more user friendly.

67.2.1.10 Configuring Multiple View Objects to Share the Same Social Object

A common scenario in Fusion Applicationsis to have two different UI pages for a single Business Object:

  • A summary page that outlines the information in a logical read-only way and may include other information that is logical to show with that object.

  • An edit page where the information about that object can be modified.

To achieve this in Fusion Applications, two different view objects are required (one per page) that refer to the same business object (such as Opportunity). Therefore, a logical business requirement would be to have both view objects update and view the exact same Social Object on the Oracle Social Network server. This would require Oracle Social Network to enable both view objects individually, because they need to be able to access the Oracle Social Network server independently of each other. The following instructions demonstrate how to share the same Social Object when there are two different view objects that can provide the attribute definitions, translations, and so on.

Before you begin

Pick one of your view objects which will be the Reference View Object. The Reference View Object:

  • Is a view object that has already been Oracle Social Network-enabled using these instructions.

  • Will be used as an "Oracle Social Network integration template" for all other view objects that will share the same Social Object.

In the Reference View Object, make a note of the following:

  • Property values for these properties:

    • Nav Web Application

    • Nav View Id

    • Nav Page Params List

    • Nav Taskflow Id

    • Nav Task Key List

    • Nav Task Params List

    • Task Label

    • Task Label Attribute

  • Names of all attributes that are Oracle Social Network-enabled.

  • For each attribute, note the attribute property values for these properties:

    • Oracle Social Network Attribute Name Override

    • Oracle Social Network Gadget Type

    • Oracle Social Network User Key

    • Object Key

    • Currency Code Attribute

67.2.1.10.1 Configuring the Reference View Object to Be Enabled by Oracle Social Network

To configure the Reference View Object to be enabled by Oracle Social Network:

  • Open the Reference View Object and in the property inspector set the Applications > Oracle Social Network > Definition Name property. This will ensure that the view object's Oracle Social Network definition name will be consistent among all the view objects that are sharing the Social Object. This definition name must have the application short name at the beginning, and should be unique from all other existing view objects that are not to share the Social Object.

  • [Optional] If there are any translated values that are different between the two view objects, set the Registration VO property on the view objects to true. This will set the fnd:OSN_REGISTRATION_VO property on the view objects and ensure that any translations are read from this view object.

67.2.1.10.2 Configuring the Other View Objects to Be Enabled by Oracle Social Network

For each view object (not the Reference View Object):

  1. Open the view object.
  2. Set the Applications > Oracle Social Network > Definition Name to be the exact same value as the Reference View Object set in the previous section.
  3. Set the property values to the values noted in the "Before you begin" steps.
  4. Open the Add OSN View Instances wizard by right-clicking the Application Module containing the view objects and selecting the wizard.
  5. For each attribute in the view object that matches an Oracle Social Network-enabled attribute in the Reference View Object:
    • Set the Oracle Social Network enabled flag to True.

    • Set the Oracle Social Network Gadget Type, Oracle Social Network User Key, Object Key and Currency Code Attribute property value to those noted in the Before you begin steps.

    • Has the Oracle Social Network Attribute Name Override been set in the attribute of the Reference View Object?

      • If Yes, set the Oracle Social Network Attribute Name Override to be the same value between the two attributes.

      • If No, set the Oracle Social Network Attribute Name Override to be the name of the attribute in the Reference View Object unless the two attribute names are the same.

  6. Open the Add OSN View Instances wizard by right-clicking the Application Module containing the view objects and selecting the wizard.
  7. Shuttle the view objects from the Available View Objects to the Data Model.

This will ensure that all view objects are set up to use the same Oracle Social Network Social Object.

Social Link Configuration

Because each view object now is set up to match the Social Object definition in Oracle Social Network, the row from the view object that is on the page that is being displayed can be used as the osnRow in the applications panel.

67.2.1.11 Configuring Transient Entity Objects and View Objects

Under certain circumstances, there is a requirement to send data to Oracle Social Network without having an entity object that is based upon a database table. For example, a team could be using an Oracle Enterprise Scheduler job to update data that does use an entity object but still want that data sent to Oracle Social Network. The way to do this would be to use a Transient entity object and Transient view object.

Sending to Oracle Social Network from a Transient view object or entity object is possible with Oracle Social Network integration, however, the solution does have some restrictions. Performing a send to Oracle Social Network that creates a record is relatively straightforward. The entity object and view object were created using the wizard in JDeveloper and all attributes manually entered. The view object was then added to an application module that will control the transaction in which this will occur. A transaction is required for this functionality because the send to Oracle Social Network happens upon the commit of the transaction. The configuration of the Oracle Social Network properties and setup UI is identical to a regular view object, except there must be a minor fix to the VOImpl to change its default of looking at database tables, to directly looking at the entity cache so that the Oracle Social Network integration can find the row upon commit. This is done using the following code:

@Override
protected void create()
{
 super.create();
 setQueryMode(QUERY_MODE_SCAN_ENTITY_ROWS |QUERY_MODE_SCAN_UNPOSTED_ENTITY_ROWS |QUERY_MODE_SCAN_VIEW_ROWS);
}

What happens when a transient entity object/view object is used for Oracle Social Network integration

When a row is created or inserted in the transient view object, populated with attribute data, and the commit happens, the row's data is sent to Oracle Social Network as a create request. This works well for transient entity objects and view objects.

It is during an Update that the situation becomes less clear. Due to the nature of transient view objects and entity objects, such as when they have no persistent state, it is impossible to change their entity state away from STATUS_NEW/INITIALIZED until a commit occurs on that instance of the transient entity object or view object. The Oracle Social Network integration uses the entity state to determine whether to perform a create/update/delete request to Oracle Social Network. However, the Oracle Social Network client library handles the update issue. When a second create request is sent to Oracle Social Network that contains all of the Social Object fields (view object attributes) that were sent to Oracle Social Network originally, it will detect that the Social Object was already created and only will perform an update of the fields whose values have changed between the two Oracle Social Network sends. The only issue with this is in the detail: all fields need to be sent the second time, even if the field value has not changed. If a field value is not supplied, it will be treated as if null was sent and the field value will be removed from Oracle Social Network, but if the field value is supplied and its value has not changed, then the field will be treated as not-updated.

Therefore, the update solution becomes a non-issue as the transient view object can be populated in the exact same mechanism and committed in the same way as the original insert. When the payload of the second create request gets to Oracle Social Network, it will determine the correct course of action for the insert/update of the Social Object data.

67.2.1.12 Working with Special Cases

This section discusses situations that are not covered elsewhere.

  • Date Effective Entity Objects

    A date effective entity object is one in which an update on an existing entity object row puts an end date on it and creates or inserts a new row with the updated details. In Oracle Social Network, this should only submit the details of the update and not the insert of the new row. Only the last chronological date effective row data will be sent to Oracle Social Network. This is the date effective row where the Effective End Date is 31-Dec-4712. Data from any other date effective row that does not contain that end date will not be sent to Oracle Social Network.

    It is possible for the last chronological date effective row to be effective from a future date. To communicate this to the viewer, a new attribute "As Of" automatically will be included for a date effective object when it is enabled for Oracle Social Network. The value of this attribute will come from the attribute that contains the start date of the date effective range.

  • Parent-Child View Objects

    You can send view object rows for both the parent and child rows individually, but you cannot send both Social Objects together as a Master - Detail since Oracle Social Network does not support this relationship. There are ways to view the parent from the details rows using the parent id and tie them together through URLs in the Oracle Social Network UI.

  • Descriptive Flexfields

    The Oracle Social Network integration supports descriptive flexfields which have been deployed for an Oracle Social Network-enabled view object. An Oracle Fusion applications developer does not need to configure any properties at design time to enable the descriptive flexfield integration. When the Functional Administrator uses the "Manage Social Network Objects" UI to add attributes to send to Oracle Social Network, the descriptive flexfields attributes will also be shown in the list in a tree structure organized by value set.

67.3 Implementing the Oracle Social Network Setup UI

There are several features of the Oracle Fusion Applications-Oracle Social Network integration that can be used when designing Oracle Fusion applications user interfaces and their application.

67.3.1 Configuring the Setup Application

The task flow shown here will be available for users who will configure the Oracle Social Network integration on a client site.

The "Manage Oracle Social Network Objects" task flow definition and its available parameters are:

  • Component: Oracle Social Network

  • Task flow: Manage Oracle Social Network Objects

  • Function Security Privilege: FND_MANAGE_SOCIAL_NETWORK_TRACKING_PRIV

    Display Name: Manage Oracle Social Network Tracking

  • Task Flow /Invocation Artifact:

    /WEB-INF/oracle/apps/fnd/applcore/socialnetwork/ui/flow/SocialNetworkTF.xml#SocialNetwork
    
  • Parameters

    • [moduleType] Note: If moduleType is passed, moduleKey also must be passed. Together they form a unique key for a module.

    • [moduleKey] Note: If moduleKey is passed, moduleType also must be passed. Together they form a unique key for a module.

    • [pageTitle]

  • Description: Manage the Social Network Tracking setup.

The parameter values that can be provided are shown in Table 67-4.

Table 67-4 Parameter Values for Configuring Setup Application

Parameter Description Default Value

moduleType

The type of module to filter the list of application modules shown. This parameter is used with the moduleKey to perform the filtering. The application modules contain the view objects that are available to be sent to Oracle Social Network.

Examples: APPLICATION, FAMILY

When no value is supplied, all modules will be shown.

moduleKey

The module key to filter the view objects in the task flow. The mapping between the module key and the application modules comes from the fnd-osn-integration.xml setup in the "Add OSN View Instances" wizard.

When no value is supplied, all modules will be shown.

pageTitle

The title to show at the top of the "Manage Oracle Social Network Objects" page.

"Manage Oracle Social Network Objects"

In Functional Setup Manager, Applications Corewill add the "Manage Oracle Social Network Objects" task to provide access to the setup task flow with no moduleType or moduleKey specified. This task will give access to the task flow for managing any Oracle Social Network object in Oracle Fusion Applications.

You can create your own product module-specific Oracle Social Network setup tasks in your own task lists that provide access to the setup task flow but that are filtered by the relevant modules. For example, Financials can create a Manage Financials Oracle Social Network Objects by passing in the correct moduleType and moduleKey.

If a valid moduleType and moduleKey pair is specified, the UI provides access to all objects whose modules roll up to the specified module. That is, if a family is specified, the UI displays all objects whose modules roll up to the family.

Note:

Oracle Social Network Object settings are moved using the customization sets on the Customization Migration page instead of using the export and import function in the Setup and Maintenance work area of Functional Setup Manager. Customization Migration is not module-specific.

67.3.2 Accessing the Credential Store

As part of the Provisioning role, credentials must be created that allow the Oracle Social Network client libraries (the interface between Applications Coreand Oracle Social Network) to create an authenticated connection to the Oracle Social Network server. To access the credential store, the Oracle Social Network library will need to be granted permission by the security of the containing application. The following code snippet must be added to the jazn-data.xml file so the Oracle Social Network client library can access the credential store:

<grant>
 <grantee>
 <codesource>
 <url>file:${domain.home}/servers/${weblogic.Name}/tmp/_WL_user/oracle.social.client/-</url>
 </codesource>
 </grantee>
 <permissions>
 <permission>
 <class>oracle.security.jps.service.credstore.CredentialAccessPermission</class>
 <name>context=SYSTEM,mapName=oracle.social.security,keyName=FUSION_APPS_OSN_INTEG_APPID-KEY</name>
 <actions>read</actions>
 </permission>
 </permissions>
</grant>

Before adding this block to the jazn-data.xml file, verify if there is already a grant block for the URL ${domain.home}/servers/${weblogic.Name}/tmp/_WL_user/oracle.social.client/-. If this already exists, then just add the <permission> node to the existing grant.

67.3.3 Avoiding Overwriting Registrations and Data

When there are multiple developers working on Oracle Social Network integration with the same view object, there is a high risk of the developers overwriting other developers' Social Object registrations and data on the Oracle Social Network server. To avoid this scenario, use the oracle.applcore.socialnetwork.registrationprefix system property. This property can be set on the Java Options command line to a different value for each developer and will be prefixed to the Oracle Social Network registration definition name. This will allow the same view object to be registered multiple times on the Oracle Social Network server, thus allowing each developer to have his or her own Social Object registration.

67.4 Adding Oracle Social Network to Your Application UI

Oracle Social Network provides an ADF declarative component to launch the Oracle Social Network UI within an Oracle Fusion application. This declarative component is rendered as a Social link and is available in two areas –Global Area and application panel.

Note that once the Social link is implemented, the application's end users can see the Social link only if they are internal to the organization. That is, if MegaCorp is the organization running the Oracle Fusion application's instance, MegaCorp's internal employees can access the Social link, but the company's external suppliers and partners cannot. Access to the Social link in the two aforementioned locations is controlled by the Launch Oracle Social Network privilege that is granted to internal users by the Worker duty role.

When the Social link is clicked, it launches the Oracle Social Network UI that is displayed in a layover panel on the right side of the Oracle Fusion application page.

The ADF declarative component is available in four versions for use in various areas of the Oracle Fusion applications pages:

  • image +link

  • link only

  • image +button

  • button only

The component itself has been integrated out of the box as a link in two places using Applications Coreand is available for use by developers.

The Social link has been added as a text-only link to the Global Area/Menu as shown in Figure 67-2. Therefore, the link will be available on all Oracle Fusion application pages.

Figure 67-2 Social Link in the Global Area

Social link in the Global Area

Note:

Language and time zone preference settings in Oracle Fusion Applications and Oracle Social Network are not integrated. Preferences set in Oracle Fusion Applications do not propagate to the Oracle Social Network server.

When the Social link is clicked, the Oracle Social Network UI is launched on the right side as shown in Figure 67-3. This view displays all the Conversations, Social Objects, Users and Groups to which a user has access (displayed within the All tab in the Oracle Social Network UI).

Figure 67-3 Example of the Oracle Social Network Popup

Oracle Social Network Popup

The Social link also is added to the left of the toolbar (buttons) in the application panel. The link will appear automatically in Oracle Fusion application pages if the application panel has been used for object detail pages.

Clicking the Social link in the application panel also launches the Oracle Social Network UI on the right side as a layover panel. In this view, Oracle Social Network UI is displayed in the context of the current Oracle Fusion application page or object.

The Social link in the Application Panel typically appears as shown in Figure 67-4.

Figure 67-4 Example Showing the Social Link in an Applications Panel

Example Showing the Social Link in an ApplicationsPanel

The link currently is supported only within the application panel. The Social link should not be directly consumed outside an application panel. Also, you should not use the Oracle Social Network ADF declarative component (link/button) directly.

When the Social link is clicked from within the application panel, the Oracle Social Network UI should appear as shown in Figure 67-5. Within the Oracle Social Network UI there are two tabs:

  • In the context of the Oracle Fusion application Object (depending on the context passed as explained below), the Oracle Social Network UI displays the associated Social Object and any Related Conversations.

  • The All tab displays all the Conversations, Social Objects, Users and Groups to which a user has access.

Figure 67-5 Example Showing Popup from Applications Panel

Example Showing Popup from ApplicationsPanel

67.4.1 How to Render the Behavior of the Social Link in an Application Panel

There are some checks made internally within the application panel and in the Oracle Social Network ADF declarative component that control the display of the Social link in the Oracle Fusion application pages.

The Social link in the application panel will render only when some context is passed to the application panel. The rules that control the rendering are:

  • If the Oracle Social Network URL is not configured, the link will not show (it also will not show in the Global Menu).

  • If there is no context passed to the application panel, the link will not render. The end-user will need to use the link from the Global Menu to see all Oracle Social Network Conversations and Social Objects.

  • If the view object is not enabled (out of the box using Design Time) for Oracle Social Network, then the link will not render. See Configuring the Business Object for Oracle Social Network Integration.

  • If the view object is enabled (out of the box using Design Time) for Oracle Social Network, but the Oracle Social Network task flow has not been enabled using Oracle Fusion Functional Setup Manager, then the link will not render.

Note:

Developers can control the rendering of the Social link by setting an Expression Language expression on the osnRendered attribute (see Table 67-5). For example, when the same UI is used for both create and edit cases, the developer may want to hide the Social link in the Create case because the business object may not be ready at that point.

67.4.2 How to Pass Context and Parameters to an Application Panel

This step must be performed for the objects (context) that are enabled for Oracle Social Network.

The application panel exposes a subset of parameters that can be used to control the behavior of the Oracle Social Network Social link. Some additional parameters exposed by the Oracle Social Network Social ADF component are used internally by the application panel and are not exposed. Table 67-5lists the parameters available to control the behavior of the Social link and pass the context to it:

Table 67-5 Parameters that Control the Behavior of the Social Link

Attribute Name Type Description Valid Values

osnDisabled

Boolean

Explicitly controls whether the Social link (if rendered) is disabled or not. This is optional.

true or false. The default is false.

osnRendered

Boolean

Explicitly controls (apart from internal checks made) whether or not to render the Social link. This is optional.

true or false. The default is true.

osnRow

oracle.jbo.Row

An Expression Language expression that returns a view object Row that must contain the Social Object ID (that is, the primary external ID).

 

osnType

String

The fully-qualified view object type/ID as registered with Oracle Social Network through Functional Setup Manager"Manage OSN task flow."

Do not use.

osnTypeGroup

String

The application module ID that was used to group together a set of view objects for Oracle Social Network.

Do not use.

osnDisableShare

Boolean

Controls whether the Oracle Social Network UI should show the Share button when the current row is not yet shared or sent to Oracle Social Network. This parameter is only useful when osnRow is passed.

true or false. The default is false.

osnDisableJoin

Boolean

Controls whether the Oracle Social Network UI should allow the current user to Join (become a member of) the Social Object (if shared). This parameter is only useful when osnRow is passed.

true or false. The default is false.

Examples of Parameters

  • For a specific object/row (only osnRow is specified)

    <fnd:applicationsPanel Id="ap1" 
    osnRow="#{bindings.Dept1.currentRow}"
     .../>
    
  • For a specific object/row ID but disabling Share

    <fnd:applicationsPanel Id="ap1" 
    osnRow="#{bindings.Dept1.currentRow}"
     osnDisableShare="true"/>
    

67.4.3 How Share and Join Behave

The Share and Join buttons are displayed within the Oracle Social Network UI that is launched from the Social link in the application panel. These actions are applicable only in the contextual view displayed for an Oracle Fusion application object.

The core state transitions for the Share and Join buttons are:

  • The Share button is displayed when the view object is enabled with Manual mode and the object has not yet been shared in Oracle Social Network. In this case, the Share button will be displayed and the user can choose to create the Oracle Social Network Social Object manually. In Automatic mode, you should not see the Share button unless the business object was created before it was Enabled for OSN. This is because the Oracle Social Network Social Object will be created automatically when the Oracle Fusion application business object is created.

  • Once a user clicks the Share button, the button will not be displayed again, unless there is an error in sharing with Oracle Social Network. The Oracle Social Network UI then displays the Social Object.

  • The Join button is displayed for both Manual and Automatic modes for the current user who is not yet a member of the Social Object in Oracle Social Network. The Join button will be displayed only after the object is shared, either automatically or manually by another user, in Oracle Social Network.

  • Once a user clicks the Join button, the user is made a member of the Social Object in Oracle Social Network. The Oracle Social Network UI then displays the Social Object and any related conversations.

  • The Join and Share buttons can be hidden by setting the osnDisableShare and osnDisableJoin parameters to the application panel. See Table 67-5.

67.5 What Happens When Functional Administrators Manage Oracle Social Network Objects

The Functional Administrator will use the Functional Setup Managersupplied by the product team to take the set of view objects available for Oracle Social Network integration and choose which are to be enabled for sending data to the site's Oracle Social Network instance.

Prerequisites

  • The deployed JAR files containing the view object definitions and the META-INF/fnd-osn-integration.xml file must be in the classpath of the product team's Functional Setup Manager.

  • The Functional Setup Managerhas had the "Manage Social Network Objects" task flow added to it.

  • The person fulfilling the provisioner role has set up the Oracle Social Network location and the Oracle Social Network credential.

67.5.1 Enabling a View Object for Oracle Social Network Integration

When the functional administrator loads the Functional Setup Manager, a list of tasks is displayed. One will be "Manage Social Network Objects." After this task is selected, the setup UI for enabling the view objects for Oracle Social Network integration will be shown. When the "Manage Social Network Objects" page has finished loading, the list of view objects that the developer made available for Oracle Social Network can be seen.

67.5.2 Change the Oracle Social Network Enabled Status

To enable or disable the view object for Oracle Social Network integration at the site when the "Manage Social Network Objects" page is loaded, the configurer can use the following steps:

  1. Select the view object in the Business Objects tree that is to be Oracle Social Network enabled.
  2. Click Enable OSN Tracking.
  3. When the popup window is displayed, choose either:
    • Manual - The end user consuming the Oracle Fusion application will need to click the Share button to send the view object row to Oracle Social Network.

    • Automatic - When the end user commits the view object row with which they are working, the send to Oracle Social Network will occur automatically.

    • None - Disable Oracle Social Network integration.

  4. Click OK.

The view object shown in the tree now will have the updated Enabled status to match the selection. There is a shortcut to disabling Oracle Social Network integration for a view object by selecting it in the Business Objects tree and clicking Disable OSN Tracking.

67.5.2.1 How to Add and Remove Attributes to Send to Oracle Social Network

Changing the OSN Enabled state of the view object is only the first half of the configuration that is required to send a Social Object to Oracle Social Network. The attribute values that will become the Social Object fields also need to be selected. Use these steps to select the attributes that will be Oracle Social Network enabled:

  1. Select the view object in the Business Objects tree that is to have attributes Oracle Social Network enabled. This should show the list of Oracle Social Network enabled attributes in the table at the bottom of the page.
  2. Click New. This will display a dialog showing all of the attributes that the developer marked as Oracle Social Network integration available.
  3. Check or uncheck the check boxes next to each attribute to add and remove attributes. Attributes that are selected are Oracle Social Network enabled.
  4. Click OK.

The attributes that were checked in the dialog will now be shown in the table at the bottom of the page. This is the list of attributes for the view object that have been marked as Oracle Social Network enabled. There is a shortcut for marking the attributes as not Oracle Social Network enabled. Select the attribute and click Delete to remove it from the list.

67.5.3 Committing the Oracle Social Network Enabled View Objects

Until this point, there has been no change to the stored configuration of the Oracle Social Network Enabled view objects. This means that if the functional administrator leaves this page or cancels, then the way in which the Oracle Fusion application integrates with Oracle Social Network at runtime will not have changed. By clicking Save at the top of the page, the information about all displayed view objects' Oracle Social Network enabled status and their attributes are committed locally for use at runtime and the definition of the Social Object based upon the selections made by the developer for the view object will be built and sent to Oracle Social Network.

What happens when Save is clicked

Two key functions happen when Save is clicked:

  • Oracle Social Network Enabled Configuration Is Saved Locally

    When the developer saved the Oracle Social Network configuration for the view object, all of that information was stored as properties in the view object XML definition file. A very similar process happens for enabling the view object for XML. When Save is clicked, the custom properties for these view objects are changed:

    • fnd:OSN_VO_ENABLED_BY_CUSTOMER - Stores whether the user selected Automatic/Manual/None for the Enabled status.

    • fnd:OSN_ENABLED_ATTR_BY_CUSTOMER - Will be set to "true" on all attributes that the user selected to be Oracle Social Network enabled.

    In addition to the view object property being modified, the primary entity object for the view object will have these custom properties set upon it:

    • fnd:OSN_EO_ENABLED_BY_CUSTOMER - A mirror of the view object's fnd:OSN_ENABLED_ATTR_BY_CUSTOMER property.

    • fnd:OSN_VIEW_OBJECT_NAME - The fully-qualified name of the view object that will need to be used to send data to Oracle Social Network when a Data Manipulation Language (DML) event occurs on this entity object.

    Since the view object and entity object definition XML cannot be changed at runtime, these modifications will be stored in Oracle Metadata Services (MDS) at the persdef layer. For each view object that was displayed in the "Manage Social Network Objects" there will be four persdef files and entries stored. An example of these files are for the SndDemoDeptVO:

    persdef/oracle/apps/model/entity/mdssys/cust/site/site/SndDemoDeptEO.xml.xml
    persdef/oracle/apps/model/entity/SndDemoDeptEO.xml
    persdef/oracle/apps/model/view/SndDemoDeptVO.xml
    persdef/oracle/apps/model/view/mdssys/cust/site/site/SndDemoDeptVO.xml.xml
    

    These entries can be imported and exported if the enabled Oracle Social Network integration configuration must be ported between server instances.

  • Social Object Definition Is Sent to Oracle Social Network

    After the view object Oracle Social Network enabled configuration has been stored into MDS view objects, the Oracle Social Network structure must be sent to Oracle Social Network as a Social Object definition. All view objects that have an Enabled status of Manual or Automatic will have the definition sent to Oracle Social Network. The Social Object definition provides details such as the attributes (name, data type) as Social Object field definitions and the translations for all of the attributes to be used as the field labels when a Social Object is shown to the user in Oracle Social Network.

    To see the registered definition on Oracle Social Network and confirm that it was correctly sent, the Oracle Social Network social definition can be directly retrieved using the REST API. To return the Social Object definition, create a request in the following structure from within a web browser: <Oracle Social Network URL>/social/api/v1/socialDefinition/<definition name>

    The definition name is either the value of the fnd:OSN_DEFINITION_NAME property set on the view object by the developer or the family module name concatenated with the view object name (if the definition name was not set).

    Using the SndDemoDeptVO example again, if it is in the FND family with an Oracle Social Network server of http://server_name.company.com:9003/osn, it would resolve to the Social Object definition URL of: http://server_name.company.com:9003/osn/social/api/v1/socialDefinition/FND.oracle.apps.model.view.SndDemoDeptVO.

    When Save is clicked, a progress popup will be shown that displays the current status of the save and send to the OSN server.

67.5.4 Updating Translations

"Manage Social Network Objects" also provides updated translations. When the Social Object definition has been sent to Oracle Social Network by clicking Save, the initial set of translations is sent to the Oracle Social Network server for the view objects. However, users on a site can choose to enable more languages within Oracle Fusion Applicationsby loading language bundles. The Update Translations button provides a quick way to send all the Oracle Social Network enabled view object translations for all enabled languages to Oracle Social Network. For example, a site has been running in English and has registered the view objects as Social Object definitions on Oracle Social Network. The site then loads the French language. The site then can use Update Translations to send both the English and French translations for the Oracle Social Network enabled view object to Oracle Social Network, thereby allowing the user to see all of the field labels in French.

An individual view object can have its translations updated in isolation by selecting a view object in the Business Objects table and clicking Update Translations at the top of the Business Objects table.

What happens when clicking Update Translations

Each view object that is displayed that has an Enabled state of Automatic or Manual will have its translated strings for the view object and its attributes loaded and sent as a social definition update to Oracle Social Network. The only values that can change in this upload are the translated strings. To confirm if the new translations are correctly seeded in Oracle Social Network, the social definition URL for the view object can be used to see the translated strings for the Social Object definition.

When the page-level Update Translations button is clicked, a progress popup will be shown that displays the current status of the save and send to the Oracle Social Network server. The progress indicator is not shown for the Update Translation button in the Business Objects table.

67.5.5 Synchronizing

If there is an issue with a previous send to the Oracle Social Network server within the "Manage Oracle Social Network Objects" UI, or if a migration of Oracle Social Network integration configuration has occurred between servers, then the state of the definition on the Oracle Social Network server will be different from what is stored in persdef. To correct this, the Synchronize button was added. This will take the definitions of all view objects and resend them to Oracle Social Network. An individual view object can be synchronized in isolation by selecting a view object in the Business Objects table and clicking Synchronize at the top of the Business Objects table.

What Happens When Clicking Synchronize

Each view object that is displayed and that has an Enabled state of Automatic/Manual, will have its Oracle Social Network definition re-created and sent to the Oracle Social Network server. To confirm if the synchronized view objects are correctly seeded in Oracle Social Network, the social definition URL for the view object can be used to verify the Social Object definition. When the page-level Synchronize button is clicked, a progress popup will be shown that displays the current status of the send to the Oracle Social Network server. The progress indicator is not shown for the Synchronize button in the Business Objects table.

67.6 What Happens When End Users Interact with Oracle Social Network Object Instances

The only decision an end user needs to make is to share instances when Manual integration mode is enabled.

Automatic Integration

When Oracle Social Network is enabled as Automatic for a view object, end users will not see any visual signs that a send to Oracle Social Network has occurred with the data they just committed. The first that they will know about this is when they check in Oracle Social Network and the record has been created in Oracle Social Network. Any future updates or deletes (Oracle Social Network Conversation Close) also will be reflected in Oracle Social Network upon any further commits of the row.

Manual Integration

When Oracle Social Network is enabled as Manual for a view object, end users will be able to see the Oracle Social Network Share button on the page. If the users create or update the record, they will not see any information about that view object row in Oracle Social Network. After they have committed the row, they can click Share, which will do the initial send of the row data to Oracle Social Network. By clicking Share, after the initial record has been sent to Oracle Social Network, a new window will appear with the Conversation displayed within it (if the socialShare component was set to launch=true when it was configured in the page). Any future updates or deletes (Oracle Social Network Conversation Close) also will be reflected in Oracle Social Network upon any further commits of the row.

67.7 Test End-To-End Flow

The end-to-end test flow provides a basis for testing the Oracle Social Network integration implementation points to prove the success of the integration.

Testing requires that the roles for Oracle Fusion Developer and Provisioner have been completed successfully.

Follow these steps to test the flow:

  1. After configuring the Oracle Fusion Developer role, deploy the model library that contains the META-INF/fnd-osn-integration.xml file and the view object definitions into an ADF Library JAR file.

  2. Include this JAR file as a library in the Functional Setup Manager project.

  3. Deploy and run the Functional Setup Manager in an Integrated WebLogic Server environment.

  4. Log into the Functional Setup Manager and choose the Manage Social Network Objects task.

  5. Find the view object that has been configured as available for Oracle Social Network integration, change it to have an Enabled state of Automatic and add all the attributes to the list of Oracle Social Network enabled attributes.

  6. Click Save to keep the Automatic enabled state and attribute configuration, and send the Social Object registration to Oracle Social Network.

  7. Deploy and run the application that uses the deployed library from the first step.

  8. Log in to the application and find the product page that uses the view object.

  9. Create a new row for the view object, fill in the required data and commit the row.

  10. Log in to Oracle Social Network using the same user as logged in to the application and see the Social Object representing the newly-created or committed view object row.

Note:

The same MDS partition must be used for both Functional Setup Manager and for Oracle Fusion Applications. If this is not done, the Oracle Social Network integration will not occur between the two applications.