@@ -94,6 +94,8 @@ private void init() {
9494 ApplicationContext context = new ClassPathXmlApplicationContext ("orcid-core-context.xml" );
9595 workDao = (WorkDao ) context .getBean ("workDao" );
9696 jpaJaxbWorkAdapter = (JpaJaxbWorkAdapter ) context .getBean ("jpaJaxbWorkAdapterV3" );
97+ contributorUtils = (ContributorUtils ) context .getBean ("contributorUtilsV3" );
98+ contributorsRolesAndSequencesConverter =context .getBean (ContributorsRolesAndSequencesConverter .class );
9799 bootstrapTogglz (context .getBean (OrcidTogglzConfiguration .class ));
98100 }
99101
@@ -131,7 +133,6 @@ private static void bootstrapTogglz(OrcidTogglzConfiguration togglzConfig) {
131133 private void anonymizeWorks () throws Exception {
132134 ArrayList <WorkPojoFromCsv > worksFromCsv = getAllWorks ();
133135 Work work ;
134-
135136 // delete all existent works for orcid provided
136137 workDao .removeWorks (orcid );
137138
@@ -151,6 +152,9 @@ private void anonymizeWorks() throws Exception {
151152 }
152153 workEntity .setVisibility (work .getVisibility ().name ());
153154 if (work .getWorkContributors () != null && work .getWorkContributors ().getContributor () != null && work .getWorkContributors ().getContributor ().size () > 0 ) {
155+ if (maxContributorsForUI == 0 ) {
156+ maxContributorsForUI = 50 ;
157+ }
154158 List <ContributorsRolesAndSequences > topContributors = contributorUtils .getContributorsGroupedByOrcid (work .getWorkContributors ().getContributor (), maxContributorsForUI );
155159 if (topContributors .size () > 0 ) {
156160 workEntity .setTopContributorsJson (contributorsRolesAndSequencesConverter .convertTo (topContributors , null ));
0 commit comments