@@ -199,45 +199,19 @@ private void buildUrl(PreviewParams params, Document doc) throws DatabaseExcepti
199
199
/**
200
200
* Get PDF preview. Look into profile to get configured preview
201
201
*/
202
- private void pdfPreview (PreviewParams params ) throws ServletException , IOException , AccessDeniedException ,
203
- PathNotFoundException , DatabaseException , PrincipalAdapterException {
204
- String selectedPreview = getDesiredPreview (params );
205
-
206
- if (PREVIEWER_PDFJS .equals (selectedPreview )) {
207
- pdfjs (params );
208
- } else {
209
- flexpaper (params );
210
- }
202
+ private void pdfPreview (PreviewParams params ) throws IOException , PrincipalAdapterException {
203
+ pdfjs (params );
211
204
}
212
205
213
206
/**
214
207
* Show PDF.js preview
215
208
*/
216
209
private void pdfjs (PreviewParams params ) throws IOException {
217
210
String contextPath = params .request .getContextPath ();
218
- String url = contextPath + "/preview/pdfjs/index.jsp?pdfUrl=" + URLEncoder .encode (params .pdfUrl , "UTF-8" );
211
+ String url = contextPath + "/preview/pdfjs/index.jsp?pdfUrl=" + URLEncoder .encode (params .pdfUrl , "UTF-8" );
219
212
params .response .sendRedirect (url );
220
213
}
221
214
222
- /**
223
- * Get desired preview
224
- */
225
- private String getDesiredPreview (PreviewParams params ) throws PrincipalAdapterException {
226
- Profile profile = OKMAuth .getInstance ().getUserProfile (null , PrincipalUtils .getUser ());
227
- String desiredPreview = PREVIEWER_PDFJS ;
228
-
229
- // previewEngine should have priority over the other options
230
- if (params .previewEngine != null && !params .previewEngine .isEmpty () && (PREVIEWER_PDFJS .equals (params .previewEngine ))) {
231
- // Only use if there is a valid preview engine as parameter
232
- desiredPreview = params .previewEngine ;
233
- } else if (profile != null ) {
234
- // The first option is to use profile previewer
235
- desiredPreview = profile .getPrfMisc ().getPreviewer ();
236
- }
237
-
238
- return desiredPreview ;
239
- }
240
-
241
215
/**
242
216
* Show html preview
243
217
*/
0 commit comments