mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Tidy up DataModel project split
- move related tests that needed their own context - should improve build speed a few seconds git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@20951 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,92 +0,0 @@
|
|||||||
<alfresco-config area="mimetype-map">
|
|
||||||
|
|
||||||
<config evaluator="string-compare" condition="Mimetype Map">
|
|
||||||
<mimetypes>
|
|
||||||
|
|
||||||
<!-- Open Office 2.x / Open Document -->
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.text" display="OpenDocument Text (OpenOffice 2.0)">
|
|
||||||
<extension>odt</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.text-template" display="OpenDocument Text Template">
|
|
||||||
<extension>ott</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.text-web" display="HTML Document Template">
|
|
||||||
<extension>oth</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.text-master" display="OpenDocument Master Document">
|
|
||||||
<extension>odm</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.graphics" display="OpenDocument Drawing">
|
|
||||||
<extension>odg</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.graphics-template" display="OpenDocument Drawing Template">
|
|
||||||
<extension>otg</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.presentation" display="OpenDocument Presentation">
|
|
||||||
<extension>odp</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.presentation-template" display="OpenDocument Presentation Template">
|
|
||||||
<extension>otp</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.spreadsheet" display="OpenDocument Spreadsheet">
|
|
||||||
<extension>ods</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.spreadsheet-template" display="OpenDocument Spreadsheet Template">
|
|
||||||
<extension>ots</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.chart" display="OpenDocument Chart">
|
|
||||||
<extension>odc</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.formula" display="OpenDocument Formula">
|
|
||||||
<extension>odf</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.database" display="OpenDocument Database">
|
|
||||||
<extension>odb</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.oasis.opendocument.image" display="OpenDocument Image">
|
|
||||||
<extension>odi</extension>
|
|
||||||
</mimetype>
|
|
||||||
|
|
||||||
<!-- OpenOffice 1.0 / StarOffice 6.0 -->
|
|
||||||
<mimetype mimetype="application/vnd.sun.xml.calc" display="OpenOffice 1.0/StarOffice6.0 Calc 6.0">
|
|
||||||
<extension>sxc</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.sun.xml.draw" display="OpenOffice 1.0/StarOffice6.0 Draw 6.0">
|
|
||||||
<extension>sxd</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.sun.xml.impress" display="OpenOffice 1.0/StarOffice6.0 Impress 6.0">
|
|
||||||
<extension>sxi</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.sun.xml.writer" display="OpenOffice 1.0/StarOffice6.0 Writer 6.0">
|
|
||||||
<extension>sxw</extension>
|
|
||||||
</mimetype>
|
|
||||||
|
|
||||||
<!-- StarOffice 5.x -->
|
|
||||||
<mimetype mimetype="application/vnd.stardivision.draw" display="StarDraw 5.x">
|
|
||||||
<extension>sda</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.stardivision.calc" display="StarCalc 5.x">
|
|
||||||
<extension>sdc</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.stardivision.impress" display="StarImpress 5.x">
|
|
||||||
<extension>sdd</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.stardivision.impress-packed" display="StarImpress Packed 5.x">
|
|
||||||
<extension>sdp</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.stardivision.chart" display="StaChart 5.x">
|
|
||||||
<extension>sds</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.stardivision.writer" display="StarWriter 5.x">
|
|
||||||
<extension>sdw</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.stardivision.writer-global" display="StarWriter 5.x global">
|
|
||||||
<extension>sgl</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.stardivision.math" display="StarMath 5.x">
|
|
||||||
<extension>smf</extension>
|
|
||||||
</mimetype>
|
|
||||||
</mimetypes>
|
|
||||||
</config>
|
|
||||||
|
|
||||||
</alfresco-config>
|
|
@@ -1,406 +0,0 @@
|
|||||||
<alfresco-config area="mimetype-map">
|
|
||||||
|
|
||||||
<config evaluator="string-compare" condition="Mimetype Map">
|
|
||||||
<mimetypes>
|
|
||||||
|
|
||||||
<mimetype mimetype="application/json" display="JSON">
|
|
||||||
<extension default="true">json</extension>
|
|
||||||
</mimetype>
|
|
||||||
|
|
||||||
<mimetype mimetype="application/eps" display="EPS Type PostScript">
|
|
||||||
<extension default="true">eps</extension>
|
|
||||||
</mimetype>
|
|
||||||
|
|
||||||
<mimetype mimetype="image/jp2" display="JPEG 2000 Image">
|
|
||||||
<extension default="true">jp2</extension>
|
|
||||||
<extension>jpx</extension>
|
|
||||||
<extension>jpm</extension>
|
|
||||||
<extension>jpc</extension>
|
|
||||||
<extension>j2k</extension>
|
|
||||||
<extension>jpf</extension>
|
|
||||||
</mimetype>
|
|
||||||
|
|
||||||
<mimetype mimetype="application/vnd.ms-project" display="Microsoft Project">
|
|
||||||
<extension default="true">mpp</extension>
|
|
||||||
</mimetype>
|
|
||||||
|
|
||||||
<mimetype mimetype="application/photoshop" display="Adobe Photoshop">
|
|
||||||
<extension default="true">psd</extension>
|
|
||||||
</mimetype>
|
|
||||||
|
|
||||||
<mimetype mimetype="application/framemaker" display="Adobe FrameMaker">
|
|
||||||
<extension default="true">fm</extension>
|
|
||||||
</mimetype>
|
|
||||||
|
|
||||||
<mimetype mimetype="application/pagemaker" display="Adobe PageMaker">
|
|
||||||
<extension default="true">pmd</extension>
|
|
||||||
<extension>pm6</extension>
|
|
||||||
<extension>p65</extension>
|
|
||||||
<extension>pm</extension>
|
|
||||||
</mimetype>
|
|
||||||
|
|
||||||
<mimetype mimetype="application/remote-printing" display="Printer Text File">
|
|
||||||
<extension default="true">prn</extension>
|
|
||||||
</mimetype>
|
|
||||||
|
|
||||||
<mimetype mimetype="text/plain" text="true" display="Plain Text">
|
|
||||||
<extension display="Plain Text" default="true">txt</extension>
|
|
||||||
<extension display="Comma Separated Values">csv</extension>
|
|
||||||
<extension display="Java Source">java</extension>
|
|
||||||
<extension display="Java Server Page">jsp</extension>
|
|
||||||
<extension display="SQL">sql</extension>
|
|
||||||
<extension display="Java Properties">properties</extension>
|
|
||||||
<extension display="FreeMarker Template">ftl</extension>
|
|
||||||
<extension display="Initialization Values">ini</extension>
|
|
||||||
<extension display="Windows Batch Script">bat</extension>
|
|
||||||
<extension display="Unix Shell Script">sh</extension>
|
|
||||||
<extension display="Log">log</extension>S
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="text/html" text="true" display="HTML">
|
|
||||||
<!-- first extension will be default unless otherwise specified -->
|
|
||||||
<extension default="true">html</extension>
|
|
||||||
<extension>htm</extension>
|
|
||||||
<extension>shtml</extension>
|
|
||||||
<extension>body</extension>
|
|
||||||
<extension display="xsd">xsd</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="text/mediawiki" text="true" display="MediaWiki Markup">
|
|
||||||
<extension display="MediaWiki Markup" default="true">mw</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/xhtml+xml" text="true" display="XHTML">
|
|
||||||
<extension default="true">xhtml</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/postscript" display="PostScript">
|
|
||||||
<!-- extension display will be same as mimetype's unless specified otherwise -->
|
|
||||||
<extension>ai</extension>
|
|
||||||
<extension default="true">ps</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="audio/x-aiff" display="AIFF Audio">
|
|
||||||
<extension>aiff</extension>
|
|
||||||
<extension>aif</extension>
|
|
||||||
<extension>aifc</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/acp" display="Alfresco Content Package">
|
|
||||||
<extension>acp</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/visio" display="Microsoft Visio">
|
|
||||||
<extension>vsd</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.adobe.xdp+xml" display="Adobe Acrobat XML Data Package">
|
|
||||||
<extension>xdp</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="audio/basic" display="Basic Audio">
|
|
||||||
<extension>au</extension>
|
|
||||||
<extension>snd</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="video/x-msvideo" display="MS Video">
|
|
||||||
<extension>avi</extension>
|
|
||||||
<extension>qvi</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="video/x-ms-asf" display="MS Streaming Video">
|
|
||||||
<extension>asf</extension>
|
|
||||||
<extension>asx</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="video/x-ms-wmv" display="MS Streaming Video">
|
|
||||||
<extension>wmv</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="video/x-ms-wma" display="MS Streaming Audio">
|
|
||||||
<extension>wma</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="video/x-rad-screenplay" display="RAD Screen Display">
|
|
||||||
<extension>avx</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-bcpio" display="">
|
|
||||||
<extension>bcpio</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/octet-stream" display="Octet Stream">
|
|
||||||
<extension display="Binary">bin</extension>
|
|
||||||
<extension display="Binary Executable">exe</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-netcdf" display="">
|
|
||||||
<extension>cdf</extension>
|
|
||||||
<extension>nc</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-x509-ca-cert" display="">
|
|
||||||
<extension>cer</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/cgm" display="CGM Image">
|
|
||||||
<extension>cgm</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/java" text="true" display="Java Class">
|
|
||||||
<extension>class</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-cpio" display="">
|
|
||||||
<extension>cpio</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-csh" display="">
|
|
||||||
<extension>csh</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="text/css" text="true" display="Style Sheet">
|
|
||||||
<extension>css</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/msword" display="Microsoft Word">
|
|
||||||
<extension default="true">doc</extension>
|
|
||||||
<extension>dot</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/wordperfect" display="WordPerfect">
|
|
||||||
<extension>wpd</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="text/xml" text="true" display="XML">
|
|
||||||
<extension default="true">xml</extension>
|
|
||||||
<extension display="DTD">dtd</extension>
|
|
||||||
<extension display="XSLT">xslt</extension>
|
|
||||||
<extension display="XSLT">xsl</extension>
|
|
||||||
<extension display="XSD">xsd</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-dvi" display="">
|
|
||||||
<extension>dvi</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="text/x-setext" text="true" display="">
|
|
||||||
<extension>etx</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/gif" display="GIF Image">
|
|
||||||
<extension>gif</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/sgml" display="SGML">
|
|
||||||
<extension>gml</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-gtar" display="GZIP Tarball">
|
|
||||||
<extension>gtar</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-gzip" display="GZIP">
|
|
||||||
<extension>gzip</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-hdf" display="">
|
|
||||||
<extension>hdf</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/mac-binhex40" display="">
|
|
||||||
<extension>hqx</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="text/calendar" text="true" display="iCalendar File">
|
|
||||||
<extension>ics</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/ief" display="IEF Image">
|
|
||||||
<extension>ief</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/bmp" display="Bitmap Image">
|
|
||||||
<extension>bmp</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/jpeg" display="JPEG Image">
|
|
||||||
<extension default="true">jpg</extension>
|
|
||||||
<extension>jpeg</extension>
|
|
||||||
<extension>jpe</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/svg" display="Scalable Vector Graphics Image">
|
|
||||||
<extension>svg</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-javascript" text="true" display="Java Script">
|
|
||||||
<extension>js</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-latex" text="true" display="Latex">
|
|
||||||
<extension>latex</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-troff-man" display="Man Page">
|
|
||||||
<extension>man</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-troff-me" display="">
|
|
||||||
<extension>me</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-troff-mes" display="">
|
|
||||||
<extension>ms</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-mif" display="">
|
|
||||||
<extension>mif</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="video/mpeg" display="MPEG Video">
|
|
||||||
<extension default="true">mpg</extension>
|
|
||||||
<extension>mpeg</extension>
|
|
||||||
<extension>mpe</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="audio/x-mpeg" display="MPEG Audio">
|
|
||||||
<extension default="true">mp3</extension>
|
|
||||||
<extension>mp2</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="video/mp4" display="MPEG4 Video">
|
|
||||||
<extension>mp4</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="video/mpeg2" display="MPEG2 Video">
|
|
||||||
<extension>mpeg2</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="video/quicktime" display="Quicktime Video">
|
|
||||||
<extension>mov</extension>
|
|
||||||
<extension>qt</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="video/x-sgi-movie" display="SGI Video">
|
|
||||||
<extension>movie</extension>
|
|
||||||
<extension>mpv2</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/oda" display="">
|
|
||||||
<extension>oda</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/x-portable-bitmap" display="Portable Bitmap">
|
|
||||||
<extension>pbm</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/pdf" display="Adobe PDF Document">
|
|
||||||
<extension>pdf</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/x-portable-graymap" display="Greymap Image">
|
|
||||||
<extension>pgm</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/png" display="PNG Image">
|
|
||||||
<extension>png</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/x-portable-anymap" display="Anymap Image">
|
|
||||||
<extension>pnm</extension>
|
|
||||||
<extension>rpnm</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/x-portable-pixmap" display="Pixmap Image">
|
|
||||||
<extension>ppm</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.ms-powerpoint" display="Microsoft PowerPoint">
|
|
||||||
<extension>ppt</extension>
|
|
||||||
<extension>pps</extension>
|
|
||||||
<extension>pot</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.powerpoint" display="Microsoft PowerPoint">
|
|
||||||
<extension>ppt</extension>
|
|
||||||
<extension>pps</extension>
|
|
||||||
<extension>pot</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/x-cmu-raster" display="Raster Image">
|
|
||||||
<extension>ras</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/x-rgb" display="RGB Image">
|
|
||||||
<extension>rgb</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-troff" display="">
|
|
||||||
<extension>tr</extension>
|
|
||||||
<extension>t</extension>
|
|
||||||
<extension>roff</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/rtf" display="Rich Text Format">
|
|
||||||
<extension>rtf</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="text/richtext" display="Rich Text">
|
|
||||||
<extension>rtx</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="text/sgml" display="SGML">
|
|
||||||
<extension>sgml</extension>
|
|
||||||
<extension>sgm</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-sh" text="true" display="Shell Script">
|
|
||||||
<extension>sh</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-shar" text="true" display="">
|
|
||||||
<extension>shar</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-wais-source" display="">
|
|
||||||
<extension>src</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-sv4cpio" display="">
|
|
||||||
<extension>sv4cpio</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-sv4crc" display="">
|
|
||||||
<extension>sv4crc</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.adobe.air-application-installer-package+zip" display="Adobe AIR">
|
|
||||||
<extension>air</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-shockwave-flash" display="Shockwave Flash">
|
|
||||||
<extension>swf</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="video/x-flv" display="Flash Video">
|
|
||||||
<extension>flv</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-tar" display="Tarball">
|
|
||||||
<extension>tar</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-tcl" display="">
|
|
||||||
<extension>tcl</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-tex" display="Tex">
|
|
||||||
<extension>tex</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-texinfo" display="Tex Info">
|
|
||||||
<extension>texinfo</extension>
|
|
||||||
<extension>texi</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/tiff" display="TIFF Image">
|
|
||||||
<extension>tiff</extension>
|
|
||||||
<extension>tif</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="text/tab-separated-values" text="true" display="Tab Separated Values">
|
|
||||||
<extension>tsv</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-ustar" display="">
|
|
||||||
<extension>ustar</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="audio/x-wav" display="WAV Audio">
|
|
||||||
<extension>wav</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="x-world/x-vrml" display="VRML">
|
|
||||||
<extension>wrl</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/x-xbitmap" display="XBitmap Image">
|
|
||||||
<extension>xbm</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.ms-excel" display="Microsoft Excel">
|
|
||||||
<extension display="Excel Spreadsheet" default="true">xls</extension>
|
|
||||||
<extension display="Excel Template">xlt</extension>
|
|
||||||
<extension display="Excel Macro">xlm</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.excel" display="Microsoft Excel">
|
|
||||||
<extension>xls</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/x-xpixmap" display="XPixmap Image">
|
|
||||||
<extension>xpm</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/x-xwindowdump" display="XWindow Dump">
|
|
||||||
<extension>xwd</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/x-compress" display="Z Compress">
|
|
||||||
<extension>z</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/zip" display="ZIP">
|
|
||||||
<extension display="ZIP" default="true">zip</extension>
|
|
||||||
<extension display="WAR">war</extension>
|
|
||||||
<extension display="JAR">jar</extension>
|
|
||||||
<extension display="EAR">ear</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/dwg" display="AutoCAD Drawing">
|
|
||||||
<extension>dwg</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/x-dwg" display="AutoCAD Drawing">
|
|
||||||
<extension>dwg</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="image/x-dwt" display="AutoCAD Template">
|
|
||||||
<extension>dwt</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="message/rfc822" display="EMail">
|
|
||||||
<extension>eml</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.ms-outlook" display="Outlook MSG">
|
|
||||||
<extension>msg</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.openxmlformats-officedocument.wordprocessingml.document" display="Microsoft Word 2007">
|
|
||||||
<extension>docx</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" display="Microsoft Excel 2007">
|
|
||||||
<extension>xlsx</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.openxmlformats-officedocument.presentationml.presentation" display="Microsoft PowerPoint 2007">
|
|
||||||
<extension>pptx</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.template" display="Microsoft Excel Template 2007">
|
|
||||||
<extension>xltx</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.ms-excel.template.macroEnabled.12" display="Microsoft Excel Macro">
|
|
||||||
<extension>xltm</extension>
|
|
||||||
</mimetype>
|
|
||||||
<mimetype mimetype="application/vnd.openxmlformats-officedocument.wordprocessingml.template" display="Microsoft Word Template 2007">
|
|
||||||
<extension>dotx</extension>
|
|
||||||
</mimetype>
|
|
||||||
</mimetypes>
|
|
||||||
</config>
|
|
||||||
|
|
||||||
</alfresco-config>
|
|
@@ -1,18 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_any.analyzer=org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
|
|
||||||
d_dictionary.datatype.d_int.analyzer=org.alfresco.repo.search.impl.lucene.analysis.IntegerAnalyser
|
|
||||||
d_dictionary.datatype.d_long.analyzer=org.alfresco.repo.search.impl.lucene.analysis.LongAnalyser
|
|
||||||
d_dictionary.datatype.d_float.analyzer=org.alfresco.repo.search.impl.lucene.analysis.FloatAnalyser
|
|
||||||
d_dictionary.datatype.d_double.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DoubleAnalyser
|
|
||||||
d_dictionary.datatype.d_date.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateAnalyser
|
|
||||||
d_dictionary.datatype.d_datetime.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateAnalyser
|
|
||||||
d_dictionary.datatype.d_boolean.analyzer=org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
|
|
||||||
d_dictionary.datatype.d_qname.analyzer=org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
|
|
||||||
d_dictionary.datatype.d_guid.analyzer=org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
|
|
||||||
d_dictionary.datatype.d_category.analyzer=org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
|
|
||||||
d_dictionary.datatype.d_noderef.analyzer=org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
|
|
||||||
d_dictionary.datatype.d_path.analyzer=org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
|
|
||||||
d_dictionary.datatype.d_locale.analyzer=org.alfresco.repo.search.impl.lucene.analysis.LowerCaseVerbatimAnalyser
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.apache.lucene.analysis.cz.CzechAnalyzer
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.apache.lucene.analysis.cz.CzechAnalyzer
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DanishSnowballAnalyser
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DanishSnowballAnalyser
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.apache.lucene.analysis.de.GermanAnalyzer
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.apache.lucene.analysis.de.GermanAnalyzer
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.apache.lucene.analysis.el.GreekAnalyzer
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.apache.lucene.analysis.el.GreekAnalyzer
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.alfresco.repo.search.impl.lucene.analysis.SpanishSnowballAnalyser
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.alfresco.repo.search.impl.lucene.analysis.SpanishSnowballAnalyser
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.alfresco.repo.search.impl.lucene.analysis.FinnishSnowballAnalyser
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.alfresco.repo.search.impl.lucene.analysis.FinnishSnowballAnalyser
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.apache.lucene.analysis.fr.FrenchAnalyzer
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.apache.lucene.analysis.fr.FrenchAnalyzer
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.alfresco.repo.search.impl.lucene.analysis.ItalianSnowballAnalyser
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.alfresco.repo.search.impl.lucene.analysis.ItalianSnowballAnalyser
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.apache.lucene.analysis.cjk.CJKAnalyzer
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.apache.lucene.analysis.cjk.CJKAnalyzer
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.apache.lucene.analysis.cjk.CJKAnalyzer
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.apache.lucene.analysis.cjk.CJKAnalyzer
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.apache.lucene.analysis.nl.DutchAnalyzer
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.apache.lucene.analysis.nl.DutchAnalyzer
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.alfresco.repo.search.impl.lucene.analysis.NorwegianSnowballAnalyser
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.alfresco.repo.search.impl.lucene.analysis.NorwegianSnowballAnalyser
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.alfresco.repo.search.impl.lucene.analysis.PortugueseSnowballAnalyser
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.alfresco.repo.search.impl.lucene.analysis.PortugueseSnowballAnalyser
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.apache.lucene.analysis.br.BrazilianAnalyzer
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.apache.lucene.analysis.br.BrazilianAnalyzer
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.apache.lucene.analysis.ru.RussianAnalyzer
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.apache.lucene.analysis.ru.RussianAnalyzer
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.alfresco.repo.search.impl.lucene.analysis.SwedishSnowballAnalyser
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.alfresco.repo.search.impl.lucene.analysis.SwedishSnowballAnalyser
|
|
@@ -1,4 +0,0 @@
|
|||||||
# Data Type Index Analyzers
|
|
||||||
|
|
||||||
d_dictionary.datatype.d_text.analyzer=org.apache.lucene.analysis.cn.ChineseAnalyzer
|
|
||||||
d_dictionary.datatype.d_content.analyzer=org.apache.lucene.analysis.cn.ChineseAnalyzer
|
|
@@ -1,102 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
|
||||||
*
|
|
||||||
* This file is part of Alfresco
|
|
||||||
*
|
|
||||||
* Alfresco is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Alfresco is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package org.alfresco.repo.content;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
|
||||||
|
|
||||||
import org.alfresco.service.ServiceRegistry;
|
|
||||||
import org.alfresco.service.cmr.repository.MimetypeService;
|
|
||||||
import org.alfresco.util.ApplicationContextHelper;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see org.alfresco.repo.content.MimetypeMap
|
|
||||||
*
|
|
||||||
* @author Derek Hulley
|
|
||||||
*/
|
|
||||||
public class MimetypeMapTest extends TestCase
|
|
||||||
{
|
|
||||||
private static ApplicationContext ctx = ApplicationContextHelper.getApplicationContext();
|
|
||||||
|
|
||||||
private MimetypeService mimetypeService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setUp() throws Exception
|
|
||||||
{
|
|
||||||
ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
|
|
||||||
mimetypeService = serviceRegistry.getMimetypeService();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testExtensions() throws Exception
|
|
||||||
{
|
|
||||||
Map<String, String> extensionsByMimetype = mimetypeService.getExtensionsByMimetype();
|
|
||||||
Map<String, String> mimetypesByExtension = mimetypeService.getMimetypesByExtension();
|
|
||||||
|
|
||||||
// plain text
|
|
||||||
assertEquals("txt", extensionsByMimetype.get("text/plain"));
|
|
||||||
assertEquals("text/plain", mimetypesByExtension.get("txt"));
|
|
||||||
assertEquals("text/plain", mimetypesByExtension.get("csv"));
|
|
||||||
assertEquals("text/plain", mimetypesByExtension.get("java"));
|
|
||||||
|
|
||||||
// JPEG
|
|
||||||
assertEquals("jpg", extensionsByMimetype.get("image/jpeg"));
|
|
||||||
assertEquals("image/jpeg", mimetypesByExtension.get("jpg"));
|
|
||||||
assertEquals("image/jpeg", mimetypesByExtension.get("jpeg"));
|
|
||||||
assertEquals("image/jpeg", mimetypesByExtension.get("jpe"));
|
|
||||||
|
|
||||||
// MS Word
|
|
||||||
assertEquals("doc", extensionsByMimetype.get("application/msword"));
|
|
||||||
assertEquals("application/msword", mimetypesByExtension.get("doc"));
|
|
||||||
|
|
||||||
// Star Office
|
|
||||||
assertEquals("sds", extensionsByMimetype.get("application/vnd.stardivision.chart"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testIsText() throws Exception
|
|
||||||
{
|
|
||||||
assertTrue(mimetypeService.isText(MimetypeMap.MIMETYPE_HTML));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testGetContentCharsetFinder() throws Exception
|
|
||||||
{
|
|
||||||
assertNotNull("No charset finder", mimetypeService.getContentCharsetFinder());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testMimetypeFromExtension() throws Exception
|
|
||||||
{
|
|
||||||
// test known mimetype
|
|
||||||
assertEquals("application/msword", mimetypeService.getMimetype("doc"));
|
|
||||||
// test case insensitivity
|
|
||||||
assertEquals("application/msword", mimetypeService.getMimetype("DOC"));
|
|
||||||
|
|
||||||
// test fallback for unknown and missing
|
|
||||||
assertEquals(MimetypeMap.MIMETYPE_BINARY, mimetypeService.getMimetype(null));
|
|
||||||
assertEquals(MimetypeMap.MIMETYPE_BINARY, mimetypeService.getMimetype("unknownext"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testGuessMimetypeForFilename() throws Exception
|
|
||||||
{
|
|
||||||
assertEquals("application/msword", mimetypeService.guessMimetype("something.doc"));
|
|
||||||
assertEquals("application/msword", mimetypeService.guessMimetype("SOMETHING.DOC"));
|
|
||||||
assertEquals(MimetypeMap.MIMETYPE_BINARY, mimetypeService.guessMimetype("noextension"));
|
|
||||||
assertEquals(MimetypeMap.MIMETYPE_BINARY, mimetypeService.guessMimetype("file.unknownext"));
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
|
||||||
*
|
|
||||||
* This file is part of Alfresco
|
|
||||||
*
|
|
||||||
* Alfresco is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Alfresco is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package org.alfresco.repo.content.encoding;
|
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
|
||||||
|
|
||||||
import org.alfresco.encoding.CharactersetFinder;
|
|
||||||
import org.alfresco.repo.content.MimetypeMap;
|
|
||||||
import org.alfresco.repo.content.transform.AbstractContentTransformerTest;
|
|
||||||
import org.alfresco.util.ApplicationContextHelper;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see CharsetFinderTest
|
|
||||||
* @see CharactersetFinder
|
|
||||||
*
|
|
||||||
* @author Derek Hulley
|
|
||||||
*/
|
|
||||||
public class CharsetFinderTest extends TestCase
|
|
||||||
{
|
|
||||||
private static ApplicationContext ctx = ApplicationContextHelper.getApplicationContext();
|
|
||||||
|
|
||||||
private ContentCharsetFinder charsetFinder;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setUp() throws Exception
|
|
||||||
{
|
|
||||||
charsetFinder = (ContentCharsetFinder) ctx.getBean("charset.finder");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testPlainText() throws Exception
|
|
||||||
{
|
|
||||||
File file = AbstractContentTransformerTest.loadQuickTestFile("txt");
|
|
||||||
InputStream is = new BufferedInputStream(new FileInputStream(file));
|
|
||||||
Charset charset = charsetFinder.getCharset(is, MimetypeMap.MIMETYPE_TEXT_PLAIN);
|
|
||||||
assertNotNull(charset);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -18,10 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.util;
|
package org.alfresco.util;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import org.springframework.beans.BeansException;
|
|
||||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||||
|
|
||||||
@@ -31,13 +27,8 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
|||||||
*
|
*
|
||||||
* @author Derek Hulley
|
* @author Derek Hulley
|
||||||
*/
|
*/
|
||||||
public class ApplicationContextHelper
|
public class ApplicationContextHelper extends BaseApplicationContextHelper
|
||||||
{
|
{
|
||||||
private static ClassPathXmlApplicationContext instance;
|
|
||||||
private static String[] usedConfiguration;
|
|
||||||
private static boolean useLazyLoading = false;
|
|
||||||
private static boolean noAutoStart = false;
|
|
||||||
|
|
||||||
/** location of required configuration files */
|
/** location of required configuration files */
|
||||||
public static final String[] CONFIG_LOCATIONS = new String[] { "classpath:alfresco/application-context.xml" };
|
public static final String[] CONFIG_LOCATIONS = new String[] { "classpath:alfresco/application-context.xml" };
|
||||||
|
|
||||||
@@ -52,99 +43,10 @@ public class ApplicationContextHelper
|
|||||||
*/
|
*/
|
||||||
public synchronized static ApplicationContext getApplicationContext()
|
public synchronized static ApplicationContext getApplicationContext()
|
||||||
{
|
{
|
||||||
return getApplicationContext(CONFIG_LOCATIONS);
|
return BaseApplicationContextHelper.getApplicationContext(CONFIG_LOCATIONS);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides a static, single instance of the application context. This method can be
|
|
||||||
* called repeatedly.
|
|
||||||
* <p/>
|
|
||||||
* If the configuration requested differs from one used previously, then the previously-created
|
|
||||||
* context is shut down.
|
|
||||||
*
|
|
||||||
* @return Returns an application context for the given configuration
|
|
||||||
*/
|
|
||||||
public synchronized static ApplicationContext getApplicationContext(String[] configLocations)
|
|
||||||
{
|
|
||||||
if (configLocations == null)
|
|
||||||
{
|
|
||||||
throw new IllegalArgumentException("configLocations argument is mandatory.");
|
|
||||||
}
|
|
||||||
if (usedConfiguration != null && Arrays.deepEquals(configLocations, usedConfiguration))
|
|
||||||
{
|
|
||||||
// The configuration was used to create the current context
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
// The config has changed so close the current context (if any)
|
|
||||||
closeApplicationContext();
|
|
||||||
|
|
||||||
if(useLazyLoading || noAutoStart) {
|
|
||||||
instance = new VariableFeatureClassPathXmlApplicationContext(configLocations);
|
|
||||||
} else {
|
|
||||||
instance = new ClassPathXmlApplicationContext(configLocations);
|
|
||||||
}
|
|
||||||
|
|
||||||
usedConfiguration = configLocations;
|
|
||||||
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Closes and releases the application context. On the next call to
|
|
||||||
* {@link #getApplicationContext()}, a new context will be given.
|
|
||||||
*/
|
|
||||||
public static synchronized void closeApplicationContext()
|
|
||||||
{
|
|
||||||
if (instance == null)
|
|
||||||
{
|
|
||||||
// Nothing to do
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
instance.close();
|
|
||||||
instance = null;
|
|
||||||
usedConfiguration = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Should the Spring beans be initilised in a lazy manner, or
|
|
||||||
* all in one go?
|
|
||||||
* Normally lazy loading/intialising shouldn't be used when
|
|
||||||
* running with the full context, but it may be appropriate
|
|
||||||
* to reduce startup times when using a small, cut down context.
|
|
||||||
*/
|
|
||||||
public static void setUseLazyLoading(boolean lazyLoading) {
|
|
||||||
useLazyLoading = lazyLoading;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Will the Spring beans be initilised in a lazy manner, or
|
|
||||||
* all in one go? The default it to load everything in one
|
|
||||||
* go, as spring normally does.
|
|
||||||
*/
|
|
||||||
public static boolean isUsingLazyLoading() {
|
|
||||||
return useLazyLoading;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Should the autoStart=true property on subsystems
|
|
||||||
* be honoured, or should this property be ignored
|
|
||||||
* and the auto start prevented?
|
|
||||||
* Normally we will use the spring configuration to
|
|
||||||
* decide what to start, but when running tests,
|
|
||||||
* you can use this to prevent the auto start.
|
|
||||||
*/
|
|
||||||
public static void setNoAutoStart(boolean noAutoStart) {
|
|
||||||
ApplicationContextHelper.noAutoStart = noAutoStart;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Will Subsystems with the autoStart=true property set
|
|
||||||
* on them be allowed to auto start? The default is to
|
|
||||||
* honour the spring configuration and allow them to,
|
|
||||||
* but they can be prevented if required.
|
|
||||||
*/
|
|
||||||
public static boolean isNoAutoStart() {
|
|
||||||
return noAutoStart;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String ... args)
|
public static void main(String ... args)
|
||||||
{
|
{
|
||||||
ClassPathXmlApplicationContext ctx = (ClassPathXmlApplicationContext) getApplicationContext();
|
ClassPathXmlApplicationContext ctx = (ClassPathXmlApplicationContext) getApplicationContext();
|
||||||
@@ -154,27 +56,4 @@ public class ApplicationContextHelper
|
|||||||
}
|
}
|
||||||
ctx.close();
|
ctx.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A wrapper around {@link ClassPathXmlApplicationContext} which
|
|
||||||
* allows us to enable lazy loading or prevent Subsystem
|
|
||||||
* autostart as requested.
|
|
||||||
*/
|
|
||||||
protected static class VariableFeatureClassPathXmlApplicationContext extends ClassPathXmlApplicationContext {
|
|
||||||
protected VariableFeatureClassPathXmlApplicationContext(String[] configLocations) throws BeansException {
|
|
||||||
super(configLocations);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
|
|
||||||
super.initBeanDefinitionReader(reader);
|
|
||||||
|
|
||||||
if(useLazyLoading) {
|
|
||||||
LazyClassPathXmlApplicationContext.postInitBeanDefinitionReader(reader);
|
|
||||||
}
|
|
||||||
if(noAutoStart) {
|
|
||||||
NoAutoStartClassPathXmlApplicationContext.postInitBeanDefinitionReader(reader);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,68 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
|
||||||
*
|
|
||||||
* This file is part of Alfresco
|
|
||||||
*
|
|
||||||
* Alfresco is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Alfresco is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package org.alfresco.util;
|
|
||||||
|
|
||||||
import org.springframework.beans.BeansException;
|
|
||||||
import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
|
|
||||||
import org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader;
|
|
||||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
|
||||||
import org.springframework.beans.factory.xml.XmlReaderContext;
|
|
||||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
|
||||||
import org.w3c.dom.Element;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A wrapper around {@link ClassPathXmlApplicationContext} which forces
|
|
||||||
* all beans to be loaded lazily.
|
|
||||||
* You shouldn't do this in production, but it can be handy with
|
|
||||||
* unit tests, as it allows a quicker startup when you don't touch
|
|
||||||
* much of the application.
|
|
||||||
*
|
|
||||||
* @author Nick Burch
|
|
||||||
*/
|
|
||||||
public class LazyClassPathXmlApplicationContext extends
|
|
||||||
ClassPathXmlApplicationContext {
|
|
||||||
|
|
||||||
public LazyClassPathXmlApplicationContext(String[] configLocations)
|
|
||||||
throws BeansException {
|
|
||||||
super(configLocations);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
|
|
||||||
super.initBeanDefinitionReader(reader);
|
|
||||||
|
|
||||||
postInitBeanDefinitionReader(reader);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Does the work of enabling Lazy Init on the xml bean reader
|
|
||||||
*/
|
|
||||||
protected static void postInitBeanDefinitionReader(XmlBeanDefinitionReader reader) {
|
|
||||||
reader.setDocumentReaderClass(AlwaysLazyInitBeanDefinitionDocumentReader.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static class AlwaysLazyInitBeanDefinitionDocumentReader extends DefaultBeanDefinitionDocumentReader {
|
|
||||||
@Override
|
|
||||||
protected BeanDefinitionParserDelegate createHelper(
|
|
||||||
XmlReaderContext readerContext, Element root) {
|
|
||||||
BeanDefinitionParserDelegate helper = super.createHelper(readerContext, root);
|
|
||||||
helper.getDefaults().setLazyInit("true");
|
|
||||||
return helper;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,92 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
|
||||||
*
|
|
||||||
* This file is part of Alfresco
|
|
||||||
*
|
|
||||||
* Alfresco is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Alfresco is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package org.alfresco.util;
|
|
||||||
|
|
||||||
import org.springframework.beans.BeansException;
|
|
||||||
import org.springframework.beans.factory.config.BeanDefinition;
|
|
||||||
import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
|
|
||||||
import org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader;
|
|
||||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
|
||||||
import org.springframework.beans.factory.xml.XmlReaderContext;
|
|
||||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
|
||||||
import org.w3c.dom.Element;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A wrapper around {@link ClassPathXmlApplicationContext} which
|
|
||||||
* stops Alfresco Subsystem (abstractPropertyBackedBean based)
|
|
||||||
* beans from being AutoStarted by tweaking their property definitions.
|
|
||||||
* You shouldn't do this in production, but it can be handy with
|
|
||||||
* unit tests, as it allows a quicker startup by preventing
|
|
||||||
* subsystems from starting up
|
|
||||||
*
|
|
||||||
* @author Nick Burch
|
|
||||||
*/
|
|
||||||
public class NoAutoStartClassPathXmlApplicationContext extends
|
|
||||||
ClassPathXmlApplicationContext {
|
|
||||||
|
|
||||||
public NoAutoStartClassPathXmlApplicationContext(String[] configLocations)
|
|
||||||
throws BeansException {
|
|
||||||
super(configLocations);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
|
|
||||||
super.initBeanDefinitionReader(reader);
|
|
||||||
|
|
||||||
postInitBeanDefinitionReader(reader);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Does the work of disabling the autostart of the
|
|
||||||
* Subsystem (abstractPropertyBackedBean) beans
|
|
||||||
* on the xml bean reader
|
|
||||||
*/
|
|
||||||
protected static void postInitBeanDefinitionReader(XmlBeanDefinitionReader reader) {
|
|
||||||
reader.setDocumentReaderClass(NoAutoStartBeanDefinitionDocumentReader.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static class NoAutoStartBeanDefinitionDocumentReader extends DefaultBeanDefinitionDocumentReader {
|
|
||||||
@Override
|
|
||||||
protected BeanDefinitionParserDelegate createHelper(
|
|
||||||
XmlReaderContext readerContext, Element root) {
|
|
||||||
BeanDefinitionParserDelegate delegate = new NoAutoStartBeanDefinitionParserDelegate(readerContext);
|
|
||||||
delegate.initDefaults(root);
|
|
||||||
return delegate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static class NoAutoStartBeanDefinitionParserDelegate extends BeanDefinitionParserDelegate {
|
|
||||||
protected NoAutoStartBeanDefinitionParserDelegate(XmlReaderContext readerContext) {
|
|
||||||
super(readerContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void parsePropertyElement(Element ele, BeanDefinition bd) {
|
|
||||||
String propertyName = ele.getAttribute("name");
|
|
||||||
if("autoStart".equals(propertyName)) {
|
|
||||||
if("abstractPropertyBackedBean".equals(bd.getParentName())) {
|
|
||||||
String id = ele.getParentNode().getAttributes().getNamedItem("id").getTextContent();
|
|
||||||
System.out.println("Preventing the autostart of Subsystem " + id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
super.parsePropertyElement(ele, bd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user