cancel
Showing results for 
Search instead for 
Did you mean: 

How to Extend Java class in UI Module

Former Member
0 Kudos

Hi All,

I am trying to make z for one of the java file GenericSearchDynamicContent.java in the standard package com.sap.wec.app.common.module.catalog.ui.utils. Can anyone please let me know what are steps do i need to follow to extend the same java file in our customer namespace and make use of it.

Thanks in Advance.

Regards,

Rahul.

Accepted Solutions (0)

Answers (2)

Answers (2)

steffen_mueller3
Participant
0 Kudos

Hi Rahul,

I recommend that you extend your module like described in the WCEM Dev & Extension Guide, chapter 9.2.

In the extended module, feel free to implement your Z GenericSearch class and to mention this class in your 'generic-searchbackend-config.xml' file.

Best regards,

  Steffen

Former Member
0 Kudos

Hi Steffen,

Thanks for your reply. We have extended the module and copied the java file and extended the class in my extended module and provided xml configurations in generic-searchbackend-config.xml and in factory-config.xml but, when i check it in debugging still the code is pointing to standard java file instead of extended java file. Please suggest any other configurations still needed.




Regards,

Rahul.

steffen_mueller3
Participant
0 Kudos

Hi Rahul,

did you build an application in WCB where you switched the module to your namespace?

Regards,

  Steffen

Former Member
0 Kudos

Hi Steffen,

Yes we have selected customer namespace in WCB.

Regards,

Rahul.

former_member193379
Active Contributor
0 Kudos

Hi Rahul,

Can you please check metadata.xml file ro confirm your namespace.

<dependencies>
    <interfaceDependency dependencyType="hard" interfaceName="xx.xx" namespace="yy.wcf"/>
</dependencies>

Please also go through the chapter 3 - Modules of Development & Extension Guide and I am sure it will help you.

Thanks,

Hamendra

steffen_mueller3
Participant
0 Kudos

Hi Rahul,

I can imagine that you forgot to add en entry about the <config-file>. Would you please check and add an entry for your type to be taken into account?

Best reagrds,

   Steffen

former_member193379
Active Contributor
0 Kudos

Hi Rahul,

It's upto you whether you want to keep seprate packages for custom changes (then create your own package and keep all the Z class under this) or create a Z_GenericSearchDynamicContent.java and extend this class by GenericSearchDynamicContent.java.

After doing this you can make your custom changes accordingly and you have to also make the changes in *config.xml (replace this entry GenericSearchDynamicContent by Z_GenericSearchDynamicContent.java.) files as mapping is done there.

Could you please let me know if you need any further information.

Thanks,

Hamendra

Former Member
0 Kudos

Hi Hamendra,

Thanks for your reply. Could you please elaborate on *.config.xml file is it faces-config.xml file or factory-config.xml file?. If it is a factory-config.xml file i do not find any  factory-config.xml file in the standard DC for mapping in my custom DC.

Thanks in Advance.

Regards,

Rahul.

former_member193379
Active Contributor
0 Kudos

Hi Rahul,

In JSF2.0, there is no faces-config.xml. If you have checked factory-config.xml then it's fine. But not forget to check the reference of original file (GenericSearchDynamicContent.java).

I mentioned it keeping in mind Struts as well.

Thanks,

Hamendra