Extending mashups by using differential extensibility

You can extend a mashup by using differential extensibility.

Procedure

  1. Create a mashup XML file with entries for the mashup file to be overridden. This file can have any name and does not need to replicate the relative directory structure of the XML file that contains the mashup to be extended.
  2. Copy the XML file to the INSTALL_DIR/extensions/app_dir/webpages directory. As this directory path is not part of the application-provided installation, create it within the INSTALL_DIR/extensions directory. The original mashup XML file is present in the INSTALL_DIR/repository/eardata/app_dir/war/mashupxmls/app_dir directory.

    Create an init servlet class to register the mashup XML file. Use the loadIncrementalMashupXml method in the SCUIMashupHelper class. The XML file contents are added to the respective mashups in the base screen that is based on mashup id.

    Consider the following application-provided mashup.
    
    <mashups>
        <mashup endpoint="EP_CONFIG" id="sample_getOrganizationList"
            mashuptype="XAPI" transactional="true">
            <classInformation name="com.ibm.wsc.common.mashups.WSCBaseMashup"/>name="com.ibm.isccs.common.mashups.SCCSBaseMashup"/>
            <API Name="getOrganizationList">
                <Input>
                    <Organization
                        DisplayLocalizedFieldInLocale="xml:CurrentUser:/User/@Localecode" MaximumRecords="">
                        <OrgRoleList>
                            <OrgRole RoleKey="ENTERPRISE"/>
                        </OrgRoleList>
                        <DataAccessFilter UserId="xml:CurrentUser:/User/@Loginid"/>
                        <OrderBy>
                            <Attribute Desc="N" Name="OrganizationName"/>
                        </OrderBy>
                    </Organization>
                </Input>
                <Template>
                    <OrganizationList>
                        <Organization CustomerMasterOrganizationCode=""
                            LocaleCode="" OrganizationCode="" OrganizationName="">
                            <BillingPersonInfo City="" Country="" ZipCode=""/>
                        </Organization>
                    </OrganizationList>
                </Template>
            </API>
            <APINamespace inputNS="getOrganizationList_input" outputNS="getOrganizationList_output"/>
            <AlternateResourceIds>
                <AlternateResourceId altResourceId="ISCCSSYS002"/>
                <AlternateResourceId altResourceId="ISCCRTORD0001"/>
                <AlternateResourceId altResourceId="ISCORD0001"/>
            </AlternateResourceIds><AlternateResourceIds>
                <AlternateResourceId altResourceId="WSCSYS00001"/>
                <AlternateResourceId altResourceId="WSC000001"/>
            </AlternateResourceIds>
        </mashup>
    </mashups>
    
    To use differential extensibility for the application-provided mashup, create an incremental or differential mashup with the same mashup ID provided in the following override_mashup.xml file that is present in the /myapps/override folder.
    <mashups>
        <mashup endpoint="EP_CONFIG" id="sample_getOrganizationList"
            mashuptype="XAPI" transactional="true">
            <classInformation name="com.ibm.wsc.common.mashups.WSCBaseMashup"/>name="com.ibm.isccs.common.mashups.SCCSBaseMashup"/>
            <API FlowName="MyService">
                <Input>
                    <Organization
                        DisplayLocalizedFieldInLocale="xml:CurrentUser:/User/@Localecode" MaximumRecords="">
                        <OrgRoleList>
                            <OrgRole RoleKey="ENTERPRISE"/>
                        </OrgRoleList>
                        <DataAccessFilter UserId="xml:CurrentUser:/User/@Loginid"/>
                        <OrderBy>
                            <Attribute Desc="N" Name="OrganizationName"/>
                        </OrderBy>
                    </Organization>
                </Input>
                <Template>
                    <OrganizationList>
                        <Organization CustomerMasterOrganizationCode=""
                            LocaleCode="" OrganizationCode="" OrganizationName="">
                            <BillingPersonInfo City="" Country="" ZipCode=""/>
                        </Organization>
                    </OrganizationList>
                </Template>
            </API>
            <APINamespace inputNS="getOrganizationList_input" outputNS="getOrganizationList_output"/>
            <AlternateResourceIds>
                <AlternateResourceId altResourceId="ISCCSSYS002"/>
                <AlternateResourceId altResourceId="ISCCRTORD0001"/>
                <AlternateResourceId altResourceId="ISCORD0001"/>
            </AlternateResourceIds><AlternateResourceIds>
                <AlternateResourceId altResourceId="WSCSYS00001"/>
                <AlternateResourceId altResourceId="WSC000001"/>
            </AlternateResourceIds>
        </mashup>
    </mashups>
    If you use the loadIncrementalMashupXml(/myapps/override/override_mashup.xml, ...) incremental load method, the inner elements in the override_mashup.xml file are merged into the original mashup, and behaves as though the mashup is coded as follows:
    <mashups>
        <mashup id="sample_getOrganizationList">
            <API>
                <Input>
                </Input>
                <Template>
                    <OrganizationList>
                        <Organization  IsEnterprise =""  OrganizationKey =""/>
                        </Organization>
                    </OrganizationList>
                </Template>
            </API>
        </mashup>
    </mashups>