ConfigConstants.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. package cn.keking.config;
  2. import cn.keking.utils.ConfigUtils;
  3. import org.springframework.beans.factory.annotation.Value;
  4. import org.springframework.stereotype.Component;
  5. import java.io.File;
  6. import java.util.Arrays;
  7. import java.util.Set;
  8. import java.util.concurrent.CopyOnWriteArraySet;
  9. /**
  10. * @author: chenjh
  11. * @since: 2019/4/10 17:22
  12. */
  13. @Component(value = ConfigConstants.BEAN_NAME)
  14. public class ConfigConstants {
  15. public static final String BEAN_NAME = "configConstants";
  16. static {
  17. //pdfbox兼容低版本jdk
  18. System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider");
  19. }
  20. private static Boolean cacheEnabled;
  21. private static String[] simTexts = {};
  22. private static String[] medias = {};
  23. private static String[] convertMedias = {};
  24. private static String mediaConvertDisable;
  25. private static String officePreviewType;
  26. private static String officePreviewSwitchDisabled;
  27. private static String ftpUsername;
  28. private static String ftpPassword;
  29. private static String ftpControlEncoding;
  30. private static String baseUrl;
  31. private static String fileDir = ConfigUtils.getHomePath() + File.separator + "file" + File.separator;
  32. private static String localPreviewDir;
  33. private static CopyOnWriteArraySet<String> trustHostSet;
  34. private static CopyOnWriteArraySet<String> notTrustHostSet;
  35. private static String pdfPresentationModeDisable;
  36. private static String pdfDisableEditing;
  37. private static String pdfOpenFileDisable;
  38. private static String pdfPrintDisable;
  39. private static String pdfDownloadDisable;
  40. private static String pdfBookmarkDisable;
  41. private static Boolean fileUploadDisable;
  42. private static String tifPreviewType;
  43. private static String beian;
  44. private static String[] prohibit = {};
  45. private static String size;
  46. private static String password;
  47. private static int pdf2JpgDpi;
  48. private static String officeTypeWeb;
  49. private static String cadPreviewType;
  50. private static Boolean deleteSourceFile;
  51. private static Boolean deleteCaptcha;
  52. private static String officePageRange;
  53. private static String officeWatermark;
  54. private static String officeQuality;
  55. private static String officeMaxImageResolution;
  56. private static Boolean officeExportBookmarks;
  57. private static Boolean officeExportNotes;
  58. private static Boolean officeDocumentOpenPasswords;
  59. private static String cadTimeout;
  60. private static int cadThread;
  61. private static String homePageNumber;
  62. private static String homePagination;
  63. private static String homePageSize;
  64. private static String homeSearch;
  65. public static final String DEFAULT_CACHE_ENABLED = "true";
  66. public static final String DEFAULT_TXT_TYPE = "txt,html,htm,asp,jsp,xml,json,properties,md,gitignore,log,java,py,c,cpp,sql,sh,bat,m,bas,prg,cmd,xbrl";
  67. public static final String DEFAULT_MEDIA_TYPE = "mp3,wav,mp4,flv";
  68. public static final String DEFAULT_OFFICE_PREVIEW_TYPE = "image";
  69. public static final String DEFAULT_OFFICE_PREVIEW_SWITCH_DISABLED = "false";
  70. public static final String DEFAULT_FTP_USERNAME = null;
  71. public static final String DEFAULT_FTP_PASSWORD = null;
  72. public static final String DEFAULT_FTP_CONTROL_ENCODING = "UTF-8";
  73. public static final String DEFAULT_VALUE = "default";
  74. public static final String DEFAULT_PDF_PRESENTATION_MODE_DISABLE = "true";
  75. public static final String DEFAULT_PDF_OPEN_FILE_DISABLE = "true";
  76. public static final String DEFAULT_PDF_PRINT_DISABLE = "true";
  77. public static final String DEFAULT_PDF_DOWNLOAD_DISABLE = "true";
  78. public static final String DEFAULT_PDF_BOOKMARK_DISABLE = "true";
  79. public static final String DEFAULT_PDF_DISABLE_EDITING = "true";
  80. public static final String DEFAULT_FILE_UPLOAD_DISABLE = "false";
  81. public static final String DEFAULT_TIF_PREVIEW_TYPE = "tif";
  82. public static final String DEFAULT_CAD_PREVIEW_TYPE = "pdf";
  83. public static final String DEFAULT_BEIAN = "无";
  84. public static final String DEFAULT_SIZE = "500MB";
  85. public static final String DEFAULT_PROHIBIT = "exe,dll";
  86. public static final String DEFAULT_PASSWORD = "123456";
  87. public static final String DEFAULT_PDF2_JPG_DPI = "105";
  88. public static final String DEFAULT_OFFICE_TYPE_WEB = "web";
  89. public static final String DEFAULT_DELETE_SOURCE_FILE = "true";
  90. public static final String DEFAULT_DELETE_CAPTCHA = "false";
  91. public static final String DEFAULT_CAD_TIMEOUT = "90";
  92. public static final String DEFAULT_CAD_THREAD = "5";
  93. public static final String DEFAULT_OFFICE_PAQERANQE = "false";
  94. public static final String DEFAULT_OFFICE_WATERMARK = "false";
  95. public static final String DEFAULT_OFFICE_QUALITY = "80";
  96. public static final String DEFAULT_OFFICE_MAXIMAQERESOLUTION = "150";
  97. public static final String DEFAULT_OFFICE_EXPORTBOOKMARKS = "true";
  98. public static final String DEFAULT_OFFICE_EXPORTNOTES = "true";
  99. public static final String DEFAULT_OFFICE_EOCUMENTOPENPASSWORDS = "true";
  100. public static final String DEFAULT_HOME_PAGENUMBER = "1";
  101. public static final String DEFAULT_HOME_PAGINATION = "true";
  102. public static final String DEFAULT_HOME_PAGSIZE = "15";
  103. public static final String DEFAULT_HOME_SEARCH = "true";
  104. public static Boolean isCacheEnabled() {
  105. return cacheEnabled;
  106. }
  107. @Value("${cache.enabled:true}")
  108. public void setCacheEnabled(String cacheEnabled) {
  109. setCacheEnabledValueValue(Boolean.parseBoolean(cacheEnabled));
  110. }
  111. public static void setCacheEnabledValueValue(Boolean cacheEnabled) {
  112. ConfigConstants.cacheEnabled = cacheEnabled;
  113. }
  114. public static String[] getSimText() {
  115. return simTexts;
  116. }
  117. @Value("${simText:txt,html,htm,asp,jsp,xml,json,properties,md,gitignore,log,java,py,c,cpp,sql,sh,bat,m,bas,prg,cmd,xbrl}")
  118. public void setSimText(String simText) {
  119. String[] simTextArr = simText.split(",");
  120. setSimTextValue(simTextArr);
  121. }
  122. public static void setSimTextValue(String[] simText) {
  123. ConfigConstants.simTexts = simText;
  124. }
  125. public static String[] getMedia() {
  126. return medias;
  127. }
  128. @Value("${media:mp3,wav,mp4,flv}")
  129. public void setMedia(String media) {
  130. String[] mediaArr = media.split(",");
  131. setMediaValue(mediaArr);
  132. }
  133. public static void setMediaValue(String[] Media) {
  134. ConfigConstants.medias = Media;
  135. }
  136. public static String[] getConvertMedias() {
  137. return convertMedias;
  138. }
  139. @Value("${convertMedias:avi,mov,wmv,mkv,3gp,rm}")
  140. public void setConvertMedias(String convertMedia) {
  141. String[] mediaArr = convertMedia.split(",");
  142. setConvertMediaValue(mediaArr);
  143. }
  144. public static void setConvertMediaValue(String[] ConvertMedia) {
  145. ConfigConstants.convertMedias = ConvertMedia;
  146. }
  147. public static String getMediaConvertDisable() {
  148. return mediaConvertDisable;
  149. }
  150. @Value("${media.convert.disable:true}")
  151. public void setMediaConvertDisable(String mediaConvertDisable) {
  152. setMediaConvertDisableValue(mediaConvertDisable);
  153. }
  154. public static void setMediaConvertDisableValue(String mediaConvertDisable) {
  155. ConfigConstants.mediaConvertDisable = mediaConvertDisable;
  156. }
  157. public static String getOfficePreviewType() {
  158. return officePreviewType;
  159. }
  160. @Value("${office.preview.type:image}")
  161. public void setOfficePreviewType(String officePreviewType) {
  162. setOfficePreviewTypeValue(officePreviewType);
  163. }
  164. public static void setOfficePreviewTypeValue(String officePreviewType) {
  165. ConfigConstants.officePreviewType = officePreviewType;
  166. }
  167. public static String getFtpUsername() {
  168. return ftpUsername;
  169. }
  170. @Value("${ftp.username:}")
  171. public void setFtpUsername(String ftpUsername) {
  172. setFtpUsernameValue(ftpUsername);
  173. }
  174. public static void setFtpUsernameValue(String ftpUsername) {
  175. ConfigConstants.ftpUsername = ftpUsername;
  176. }
  177. public static String getFtpPassword() {
  178. return ftpPassword;
  179. }
  180. @Value("${ftp.password:}")
  181. public void setFtpPassword(String ftpPassword) {
  182. setFtpPasswordValue(ftpPassword);
  183. }
  184. public static void setFtpPasswordValue(String ftpPassword) {
  185. ConfigConstants.ftpPassword = ftpPassword;
  186. }
  187. public static String getFtpControlEncoding() {
  188. return ftpControlEncoding;
  189. }
  190. @Value("${ftp.control.encoding:UTF-8}")
  191. public void setFtpControlEncoding(String ftpControlEncoding) {
  192. setFtpControlEncodingValue(ftpControlEncoding);
  193. }
  194. public static void setFtpControlEncodingValue(String ftpControlEncoding) {
  195. ConfigConstants.ftpControlEncoding = ftpControlEncoding;
  196. }
  197. public static String getBaseUrl() {
  198. return baseUrl;
  199. }
  200. @Value("${base.url:default}")
  201. public void setBaseUrl(String baseUrl) {
  202. setBaseUrlValue(baseUrl);
  203. }
  204. public static void setBaseUrlValue(String baseUrl) {
  205. ConfigConstants.baseUrl = baseUrl;
  206. }
  207. public static String getFileDir() {
  208. return fileDir;
  209. }
  210. @Value("${file.dir:default}")
  211. public void setFileDir(String fileDir) {
  212. setFileDirValue(fileDir);
  213. }
  214. public static void setFileDirValue(String fileDir) {
  215. if (!DEFAULT_VALUE.equalsIgnoreCase(fileDir)) {
  216. if (!fileDir.endsWith(File.separator)) {
  217. fileDir = fileDir + File.separator;
  218. }
  219. ConfigConstants.fileDir = fileDir;
  220. }
  221. }
  222. public static String getLocalPreviewDir() {
  223. return localPreviewDir;
  224. }
  225. @Value("${local.preview.dir:default}")
  226. public void setLocalPreviewDir(String localPreviewDir) {
  227. setLocalPreviewDirValue(localPreviewDir);
  228. }
  229. public static void setLocalPreviewDirValue(String localPreviewDir) {
  230. if (!DEFAULT_VALUE.equals(localPreviewDir)) {
  231. if (!localPreviewDir.endsWith(File.separator)) {
  232. localPreviewDir = localPreviewDir + File.separator;
  233. }
  234. }
  235. ConfigConstants.localPreviewDir = localPreviewDir;
  236. }
  237. @Value("${trust.host:default}")
  238. public void setTrustHost(String trustHost) {
  239. setTrustHostSet(getHostValue(trustHost));
  240. }
  241. public static void setTrustHostValue(String trustHost){
  242. setTrustHostSet(getHostValue(trustHost));
  243. }
  244. @Value("${not.trust.host:default}")
  245. public void setNotTrustHost(String notTrustHost) {
  246. setNotTrustHostSet(getHostValue(notTrustHost));
  247. }
  248. public static void setNotTrustHostValue(String notTrustHost){
  249. setNotTrustHostSet(getHostValue(notTrustHost));
  250. }
  251. private static CopyOnWriteArraySet<String> getHostValue(String trustHost) {
  252. if (DEFAULT_VALUE.equalsIgnoreCase(trustHost)) {
  253. return new CopyOnWriteArraySet<>();
  254. } else {
  255. String[] trustHostArray = trustHost.toLowerCase().split(",");
  256. return new CopyOnWriteArraySet<>(Arrays.asList(trustHostArray));
  257. }
  258. }
  259. public static Set<String> getTrustHostSet() {
  260. return trustHostSet;
  261. }
  262. private static void setTrustHostSet(CopyOnWriteArraySet<String> trustHostSet) {
  263. ConfigConstants.trustHostSet = trustHostSet;
  264. }
  265. public static Set<String> getNotTrustHostSet() {
  266. return notTrustHostSet;
  267. }
  268. public static void setNotTrustHostSet(CopyOnWriteArraySet<String> notTrustHostSet) {
  269. ConfigConstants.notTrustHostSet = notTrustHostSet;
  270. }
  271. public static String getPdfPresentationModeDisable() {
  272. return pdfPresentationModeDisable;
  273. }
  274. @Value("${pdf.presentationMode.disable:true}")
  275. public void setPdfPresentationModeDisable(String pdfPresentationModeDisable) {
  276. setPdfPresentationModeDisableValue(pdfPresentationModeDisable);
  277. }
  278. public static void setPdfPresentationModeDisableValue(String pdfPresentationModeDisable) {
  279. ConfigConstants.pdfPresentationModeDisable = pdfPresentationModeDisable;
  280. }
  281. public static String getPdfOpenFileDisable() {
  282. return pdfOpenFileDisable;
  283. }
  284. @Value("${pdf.openFile.disable:true}")
  285. public void setPdfOpenFileDisable(String pdfOpenFileDisable) {
  286. setPdfOpenFileDisableValue(pdfOpenFileDisable);
  287. }
  288. public static void setPdfOpenFileDisableValue(String pdfOpenFileDisable) {
  289. ConfigConstants.pdfOpenFileDisable = pdfOpenFileDisable;
  290. }
  291. public static String getPdfPrintDisable() {
  292. return pdfPrintDisable;
  293. }
  294. @Value("${pdf.print.disable:true}")
  295. public void setPdfPrintDisable(String pdfPrintDisable) {
  296. setPdfPrintDisableValue(pdfPrintDisable);
  297. }
  298. public static void setPdfPrintDisableValue(String pdfPrintDisable) {
  299. ConfigConstants.pdfPrintDisable = pdfPrintDisable;
  300. }
  301. public static String getPdfDownloadDisable() {
  302. return pdfDownloadDisable;
  303. }
  304. @Value("${pdf.download.disable:true}")
  305. public void setPdfDownloadDisable(String pdfDownloadDisable) {
  306. setPdfDownloadDisableValue(pdfDownloadDisable);
  307. }
  308. public static void setPdfDownloadDisableValue(String pdfDownloadDisable) {
  309. ConfigConstants.pdfDownloadDisable = pdfDownloadDisable;
  310. }
  311. public static String getPdfBookmarkDisable() {
  312. return pdfBookmarkDisable;
  313. }
  314. @Value("${pdf.bookmark.disable:true}")
  315. public void setPdfBookmarkDisable(String pdfBookmarkDisable) {
  316. setPdfBookmarkDisableValue(pdfBookmarkDisable);
  317. }
  318. public static void setPdfBookmarkDisableValue(String pdfBookmarkDisable) {
  319. ConfigConstants.pdfBookmarkDisable = pdfBookmarkDisable;
  320. }
  321. public static String getPdfDisableEditing() {
  322. return pdfDisableEditing;
  323. }
  324. @Value("${pdf.disable.editing:true}")
  325. public void setpdfDisableEditing(String pdfDisableEditing) {
  326. setPdfDisableEditingValue(pdfDisableEditing);
  327. }
  328. public static void setPdfDisableEditingValue(String pdfDisableEditing) {
  329. ConfigConstants.pdfDisableEditing = pdfDisableEditing;
  330. }
  331. public static String getOfficePreviewSwitchDisabled() {
  332. return officePreviewSwitchDisabled;
  333. }
  334. @Value("${office.preview.switch.disabled:true}")
  335. public void setOfficePreviewSwitchDisabled(String officePreviewSwitchDisabled) {
  336. ConfigConstants.officePreviewSwitchDisabled = officePreviewSwitchDisabled;
  337. }
  338. public static void setOfficePreviewSwitchDisabledValue(String officePreviewSwitchDisabled) {
  339. ConfigConstants.officePreviewSwitchDisabled = officePreviewSwitchDisabled;
  340. }
  341. public static Boolean getFileUploadDisable() {
  342. return fileUploadDisable;
  343. }
  344. @Value("${file.upload.disable:false}")
  345. public void setFileUploadDisable(Boolean fileUploadDisable) {
  346. setFileUploadDisableValue(fileUploadDisable);
  347. }
  348. public static void setFileUploadDisableValue(Boolean fileUploadDisable) {
  349. ConfigConstants.fileUploadDisable = fileUploadDisable;
  350. }
  351. public static String getTifPreviewType() {
  352. return tifPreviewType;
  353. }
  354. @Value("${tif.preview.type:tif}")
  355. public void setTifPreviewType(String tifPreviewType) {
  356. setTifPreviewTypeValue(tifPreviewType);
  357. }
  358. public static void setTifPreviewTypeValue(String tifPreviewType) {
  359. ConfigConstants.tifPreviewType = tifPreviewType;
  360. }
  361. public static String[] getProhibit() {
  362. return prohibit;
  363. }
  364. @Value("${prohibit:exe,dll}")
  365. public void setProhibit(String prohibit) {
  366. String[] prohibitArr = prohibit.split(",");
  367. setProhibitValue(prohibitArr);
  368. }
  369. public static void setProhibitValue(String[] prohibit) {
  370. ConfigConstants.prohibit = prohibit;
  371. }
  372. public static String maxSize() {
  373. return size;
  374. }
  375. @Value("${spring.servlet.multipart.max-file-size:500MB}")
  376. public void setSize(String size) {
  377. setSizeValue(size);
  378. }
  379. public static void setSizeValue(String size) {
  380. ConfigConstants.size = size;
  381. }
  382. public static String getPassword() {
  383. return password;
  384. }
  385. @Value("${delete.password:123456}")
  386. public void setPassword(String password) {
  387. setPasswordValue(password);
  388. }
  389. public static void setPasswordValue(String password) {
  390. ConfigConstants.password = password;
  391. }
  392. public static int getPdf2JpgDpi() {
  393. return pdf2JpgDpi;
  394. }
  395. @Value("${pdf2jpg.dpi:105}")
  396. public void pdf2JpgDpi(int pdf2JpgDpi) {
  397. setPdf2JpgDpiValue(pdf2JpgDpi);
  398. }
  399. public static void setPdf2JpgDpiValue(int pdf2JpgDpi) {
  400. ConfigConstants.pdf2JpgDpi = pdf2JpgDpi;
  401. }
  402. public static String getOfficeTypeWeb() {
  403. return officeTypeWeb;
  404. }
  405. @Value("${office.type.web:web}")
  406. public void setOfficeTypeWeb(String officeTypeWeb) {
  407. setOfficeTypeWebValue(officeTypeWeb);
  408. }
  409. public static void setOfficeTypeWebValue(String officeTypeWeb) {
  410. ConfigConstants.officeTypeWeb = officeTypeWeb;
  411. }
  412. public static Boolean getDeleteSourceFile() {
  413. return deleteSourceFile;
  414. }
  415. @Value("${delete.source.file:true}")
  416. public void setDeleteSourceFile(Boolean deleteSourceFile) {
  417. setDeleteSourceFileValue(deleteSourceFile);
  418. }
  419. public static void setDeleteSourceFileValue(Boolean deleteSourceFile) {
  420. ConfigConstants.deleteSourceFile = deleteSourceFile;
  421. }
  422. public static Boolean getDeleteCaptcha() {
  423. return deleteCaptcha;
  424. }
  425. @Value("${delete.captcha:false}")
  426. public void setDeleteCaptcha(Boolean deleteCaptcha) {
  427. setDeleteCaptchaValue(deleteCaptcha);
  428. }
  429. public static void setDeleteCaptchaValue(Boolean deleteCaptcha) {
  430. ConfigConstants.deleteCaptcha = deleteCaptcha;
  431. }
  432. /**
  433. * 以下为cad转换模块设置
  434. */
  435. public static String getCadPreviewType() {
  436. return cadPreviewType;
  437. }
  438. @Value("${cad.preview.type:svg}")
  439. public void setCadPreviewType(String cadPreviewType) {
  440. setCadPreviewTypeValue(cadPreviewType);
  441. }
  442. public static void setCadPreviewTypeValue(String cadPreviewType) {
  443. ConfigConstants.cadPreviewType = cadPreviewType;
  444. }
  445. public static String getCadTimeout() {
  446. return cadTimeout;
  447. }
  448. @Value("${cad.timeout:90}")
  449. public void setCadTimeout(String cadTimeout) {
  450. setCadTimeoutValue(cadTimeout);
  451. }
  452. public static void setCadTimeoutValue(String cadTimeout) {
  453. ConfigConstants.cadTimeout = cadTimeout;
  454. }
  455. public static int getCadThread() {
  456. return cadThread;
  457. }
  458. @Value("${cad.thread:5}")
  459. public void setCadThread(int cadThread) {
  460. setCadThreadValue(cadThread);
  461. }
  462. public static void setCadThreadValue(int cadThread) {
  463. ConfigConstants.cadThread = cadThread;
  464. }
  465. /**
  466. * 以下为OFFICE转换模块设置
  467. */
  468. public static String getOfficePageRange() {
  469. return officePageRange;
  470. }
  471. @Value("${office.pagerange:false}")
  472. public void setOfficePageRange(String officePageRange) {
  473. setOfficePageRangeValue(officePageRange);
  474. }
  475. public static void setOfficePageRangeValue(String officePageRange) {
  476. ConfigConstants.officePageRange = officePageRange;
  477. }
  478. public static String getOfficeWatermark() {
  479. return officeWatermark;
  480. }
  481. @Value("${office.watermark:false}")
  482. public void setOfficeWatermark(String officeWatermark) {
  483. setOfficeWatermarkValue(officeWatermark);
  484. }
  485. public static void setOfficeWatermarkValue(String officeWatermark) {
  486. ConfigConstants.officeWatermark = officeWatermark;
  487. }
  488. public static String getOfficeQuality() {
  489. return officeQuality;
  490. }
  491. @Value("${office.quality:80}")
  492. public void setOfficeQuality(String officeQuality) {
  493. setOfficeQualityValue(officeQuality);
  494. }
  495. public static void setOfficeQualityValue(String officeQuality) {
  496. ConfigConstants.officeQuality = officeQuality;
  497. }
  498. public static String getOfficeMaxImageResolution() {
  499. return officeMaxImageResolution;
  500. }
  501. @Value("${office.maximageresolution:150}")
  502. public void setOfficeMaxImageResolution(String officeMaxImageResolution) {
  503. setOfficeMaxImageResolutionValue(officeMaxImageResolution);
  504. }
  505. public static void setOfficeMaxImageResolutionValue(String officeMaxImageResolution) {
  506. ConfigConstants.officeMaxImageResolution = officeMaxImageResolution;
  507. }
  508. public static Boolean getOfficeExportBookmarks() {
  509. return officeExportBookmarks;
  510. }
  511. @Value("${office.exportbookmarks:true}")
  512. public void setOfficeExportBookmarks(Boolean officeExportBookmarks) {
  513. setOfficeExportBookmarksValue(officeExportBookmarks);
  514. }
  515. public static void setOfficeExportBookmarksValue(Boolean officeExportBookmarks) {
  516. ConfigConstants.officeExportBookmarks = officeExportBookmarks;
  517. }
  518. public static Boolean getOfficeExportNotes() {
  519. return officeExportNotes;
  520. }
  521. @Value("${office.exportnotes:true}")
  522. public void setExportNotes(Boolean officeExportNotes) {
  523. setOfficeExportNotesValue(officeExportNotes);
  524. }
  525. public static void setOfficeExportNotesValue(Boolean officeExportNotes) {
  526. ConfigConstants.officeExportNotes = officeExportNotes;
  527. }
  528. public static Boolean getOfficeDocumentOpenPasswords() {
  529. return officeDocumentOpenPasswords;
  530. }
  531. @Value("${office.documentopenpasswords:true}")
  532. public void setDocumentOpenPasswords(Boolean officeDocumentOpenPasswords) {
  533. setOfficeDocumentOpenPasswordsValue(officeDocumentOpenPasswords);
  534. }
  535. public static void setOfficeDocumentOpenPasswordsValue(Boolean officeDocumentOpenPasswords) {
  536. ConfigConstants.officeDocumentOpenPasswords = officeDocumentOpenPasswords;
  537. }
  538. /**
  539. * 以下为首页显示
  540. */
  541. public static String getBeian() {
  542. return beian;
  543. }
  544. @Value("${beian:default}")
  545. public void setBeian(String beian) {
  546. setBeianValue(beian);
  547. }
  548. public static void setBeianValue(String beian) {
  549. ConfigConstants.beian = beian;
  550. }
  551. public static String getHomePageNumber() {
  552. return homePageNumber;
  553. }
  554. @Value("${home.pagenumber:1}")
  555. public void setHomePageNumber(String homePageNumber) {
  556. setHomePageNumberValue(homePageNumber);
  557. }
  558. public static void setHomePageNumberValue(String homePageNumber) {
  559. ConfigConstants.homePageNumber = homePageNumber;
  560. }
  561. public static String getHomePagination() {
  562. return homePagination;
  563. }
  564. @Value("${home.pagination:true}")
  565. public void setHomePagination(String homePagination) {
  566. setHomePaginationValue(homePagination);
  567. }
  568. public static void setHomePaginationValue(String homePagination) {
  569. ConfigConstants.homePagination = homePagination;
  570. }
  571. public static String getHomePageSize() {
  572. return homePageSize;
  573. }
  574. @Value("${home.pagesize:15}")
  575. public void setHomePageSize(String homePageSize) {
  576. setHomePageSizeValue(homePageSize);
  577. }
  578. public static void setHomePageSizeValue(String homePageSize) {
  579. ConfigConstants.homePageSize = homePageSize;
  580. }
  581. public static String getHomeSearch() {
  582. return homeSearch;
  583. }
  584. @Value("${home.search:1}")
  585. public void setHomeSearch(String homeSearch) {
  586. setHomeSearchValue(homeSearch);
  587. }
  588. public static void setHomeSearchValue(String homeSearch) {
  589. ConfigConstants.homeSearch = homeSearch;
  590. }
  591. }