Skip to Content

Module Interfaces – how to call a module from another module


This is just an example from the existing WCEM Standard Code.

Main module has headerView.xhtml which calls LoginRegisterAnchor using tag <wec:moduleInterface>


<wcf:moduleInterface id= "iSIn" name ="com.sap.user.LoginRegisterAnchorView" rendered ="#{cc.vch.userActive}" viewComponent ="mainpageLoginRegisterAnchorView"/>


Also, in the headerView.xhtml, we can see below one calling loginInfo.xhtml


<wcf:moduleInterface id= "iLI" name= "com.sap.user.LoginInfoView" viewComponent ="mainpageLoginInfoView"/>

For both loginInfo.xhtml and loginRegisterAnchor.xhtml – if you see ui-repository.xml, both point to VCH:


<ViewComponent name="loginRegisterAnchor"             componentHandlerClassName="com.sap.wec.app.common.module.user.ui.user.mainpage.vc.impl.MainPageLoginRegisterAnchorVCHandler" />
       <ViewComponent name="loginInfo"
             componentHandlerClassName="com.sap.wec.app.common.module.user.ui.user.mainpage.vc.impl.MainPageLoginRegisterAnchorVCHandler" />

——————————————————————–

Answer from forum:

In your case (headerView.xhtml):

Main module declares that it wants to use a module interface ‘com.sap.user.LoginInfoView’ in its metadata.xml


In the main module, sap -> md, you can see metadata.xml has


<interfaceDependency dependencyType="soft"

                  interfaceName="com.sap.user.LoginInfoView"namespace="sap"/>

<interfaceDependency dependencyType="soft"

                   interfaceName="com.sap.user.LoginRegisterAnchorView" namespace="sap" />




User module declares that it implements ‘com.sap.user.LoginInfoView’ in its interface-definition.xml, and that one view with name ‘mainpageLoginInfoView’ is exposed


<!–

            View Interface for the log on link and status used in the header

      –>

      <module-interfacename=“com.sap.user.LoginRegisterAnchorView”>

            <viewviewName=“mainpageLoginRegisterAnchorView”/>

      </module-interface>


      <!– View Interface for the user name display used in the header  –>

      <module-interfacename=“com.sap.user.LoginInfoView”>

            <viewviewName=“mainpageLoginInfoView”/>

      </module-interface>



User module provides the implementation details in its metadata.xml. It states

<uiInclude name=”mainpageLoginInfoView”

usedUiInclude=”user/systemlinks/loginInfo_INC”

<!– VIEW Interface implementations –>

                  <interfaceImplementationinterfaceName=“com.sap.user.LoginInfoView”>

                        <uiIncludename=“mainpageLoginInfoView”usedUiInclude=“user/systemlinks/loginInfo_INC”/>

           </interfaceImplementation>

So you need to look for include  user/systemlinks/loginInfo_INC!

– User Module – endter the UIInclude in the ui-repository.xml

<UIIncludename=“user/systemlinks/loginInfo_INC”/>

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply