forked from ceskaexpedice/kramerius
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
134 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
search/src/java/cz/incad/Kramerius/views/inc/MostDesirableViewObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package cz.incad.Kramerius.views.inc; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
|
||
import com.google.inject.Inject; | ||
import com.google.inject.Provider; | ||
|
||
import cz.incad.kramerius.MostDesirable; | ||
import cz.incad.kramerius.utils.conf.KConfiguration; | ||
|
||
public class MostDesirableViewObject { | ||
|
||
public static final Logger LOGGER = Logger.getLogger(MostDesirableViewObject.class.getName()); | ||
|
||
public static final int NUMBER_OF_DESIRABLE_ITEMS = 18; | ||
|
||
@Inject | ||
MostDesirable mostDesirable; | ||
|
||
|
||
|
||
public List<String> getPids() { | ||
|
||
List<String> pids = new ArrayList<String>(); | ||
List<String> list = KConfiguration.getInstance().getConfiguration().getList("most.desirable.models", | ||
Arrays.asList( | ||
"monograph", | ||
"periodical", | ||
"soundrecording", | ||
"manuscript", | ||
"map", | ||
"sheetmusic", | ||
"volume", | ||
"periodicalitem", | ||
"monographunit", | ||
"internalpart", | ||
"article", | ||
"supplement", | ||
"page") | ||
); | ||
|
||
for (String model : list) { | ||
List<String> found = this.mostDesirable.getMostDesirable(NUMBER_OF_DESIRABLE_ITEMS, 0, model); | ||
pids.addAll(found); | ||
if (pids.size() >= NUMBER_OF_DESIRABLE_ITEMS) { | ||
break; | ||
} | ||
} | ||
return pids; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters