cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Backoffice Classification Attributes Tab Performance

pratik_a_soni
Participant
1,902

Hi All,

We've good amount of classification attributes, spanned across multiple categories. Currently backoffice takes forever to load this tab and business users cannot do any manipulation on the attributes. It tries to load all the attributes from all the categories assigned to the product.

It was way more optimized in Product Cockpit where each category used to represent one section and hybris was not loading the attributes until someone clicks on the category section.

I know that OOTB backoffice tries to load all the locales by default on the UI which also takes time, but I've provided only one locale read/write access to the user. Even with single locale access the tab take huge amount of time.

This is critical for our business, will highly appreciate if someone can help in this.

Thanks Pratik

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member682593
Participant

Hi Pratik,

I think you should be able to achieve lazy loading of classification sections with following customizations:

  1. You need to override class ClassificationTabEditorAreaRenderer and the corresponding bean.

  2. Then you need to override method renderAttributes and leave it empty, so that it won't render the attributes straight away

  3. Then you override method renderSection with following code:

 super.rederSection(classificationClassModel, features, parent, widgetInstanceManager);
 Component expandButton = Selectors.find(parent, ".yw-expandCollapse").iterator().next();
 Component groupBox = Selectors.find(parent, ".yw-editorarea-tabbox-tabpanels-tabpanel-groupbox").iterator().next();
 expandButton.addEventListener(Events.ON_CLICK, e -> super.renderAttributes(groupBox, features, widgetInstanceManager));

The super.renderSection will create everything but the attributes, which will be later rendered by the ON_CLICK event listener, with a call to super.renderAttributes. The Selectors.find is a convenient ZK method to search elements using CSS-style selectors.

Maybe it's not the most convenient solution, but I think it will do the work, and I thinkg it's the only solution when you don't have access to the sources.

Thanks, Marcin

pratik_a_soni
Participant
0 Likes

Thanks Marcin for your inputs. I'll try your suggestion tomorrow.

Thanks Pratik

Former Member
0 Likes

did it work?

pratik_a_soni
Participant
0 Likes

Hi Shilpi, yes I was able to configure as he said. I had to make some other changes as well in the code to make it work for multiple classification classes.

I'll be adding my code in a separate comment.

pratik_a_soni
Participant
0 Likes

hi Marcin,

I've completed the code changes as you suggested. It works okay now. But still to render the tab with all the classification classes, it still takes huge amount. I saw that in the prepareDataForRendering method it fetches all the features associated to the product and then figures out how many classes should there be. This is again taking good amount of time 😞

Also since we've good amount of attributes, when I click on the expand icon it takes good amount of time to load it. 😞

I've made some tweaks from your code.

  • Made it to work when there are multiple classification classes

  • By default the sections will be in closed state

  • The UI for attribute editors will be loaded only once and if it is already loaded then it will show that.

Let me know if any performance improvements can be made.

MyClassificationTabEditorAreaRenderer

Thanks

Pratik

former_member682593
Participant
0 Likes

Hi Pratik,

Unfortunately I don't have any quick solution. Lazy loading usually is quick to do, but if it's slow even then, I think you need to search for more sophisticated solution, by looking what the code does right now and what you can tweak. As a last resort you can write your own classification tab renderer from scratch, but this will require a lot of work I suppose.

Perhaps you can do some profiling that will direct you where the optimizations should be done.

Thanks, Marcin

pratik_a_soni
Participant
0 Likes

I did some more analysis. There are two times it takes more time.

  1. When it fetches the categories to show them as section on the UI, it actually fetches all of their attributes which takes lot of time and the time grows as we've more data.

  2. When it loads the value on the Localized editor, it already knows data for all locales. Irrespective of whether the user has permission or not to see that locale it always load all the data and then cancels out the UI creation if the user doesn't have read/write access for locale.

All in all it is taking lot of time to load the attributes even if we've optimized the section load time.

I'm going to raise a SAP post on this and see if they have any answer for it.

Thanks for all the help. Pratik

0 Likes

Hi Pratik, did SAP Responded or do you hve any better solution you implemented. Anything helps.

Thanks.

pratik_a_soni
Participant
0 Likes

Hey Sriharsha, we got in touch with SAP Max Attention team and they accepted this issue and they further raised another SAP ticket. No updates on the solution yet. 😞