Merge branch 'master' into 10.3.x

This commit is contained in:
Shinsuke Sugaya 2016-10-01 15:54:05 +09:00
commit a8a2be9310
17 changed files with 498 additions and 1685 deletions

View file

@ -81,6 +81,7 @@ public class AdminBackupAction extends FessAdminAction {
if (logger.isDebugEnabled()) {
logger.debug("Bulk Response:\n" + response.getContentAsString());
}
systemHelper.reloadConfiguration();
} catch (final Exception e) {
logger.warn("Failed to process bulk file: " + form.bulkFile.getFileName(), e);
}

View file

@ -30,17 +30,23 @@ public class LoginAction extends FessLoginAction {
@Execute
public HtmlResponse index() {
return asIndexPage(null).useForm(LoginForm.class);
}
private HtmlResponse asIndexPage(final LoginForm form) {
if (form != null) {
form.clearSecurityInfo();
}
return asHtml(path_Login_IndexJsp).renderWith(data -> {
RenderDataUtil.register(data, "notification", fessConfig.getNotificationLogin());
}).useForm(LoginForm.class);
saveToken();
});
}
@Execute
public HtmlResponse login(final LoginForm form) {
validate(form, messages -> {}, () -> {
form.clearSecurityInfo();
return asHtml(path_Login_IndexJsp);
});
validate(form, messages -> {}, () -> asIndexPage(form));
verifyToken(() -> asIndexPage(form));
final String username = form.username;
final String password = form.password;
form.clearSecurityInfo();
@ -50,9 +56,7 @@ public class LoginAction extends FessLoginAction {
return getHtmlResponse();
});
} catch (final LoginFailureException lfe) {
throwValidationError(messages -> messages.addErrorsLoginError(GLOBAL), () -> {
return asHtml(path_Login_IndexJsp);
});
throwValidationError(messages -> messages.addErrorsLoginError(GLOBAL), () -> asIndexPage(form));
}
return redirect(getClass());
}

View file

@ -347,8 +347,20 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
protected String getCanonicalUrl(final ResponseData responseData, final Document document) {
final String canonicalUrl = getSingleNodeValue(document, fessConfig.getCrawlerDocumentHtmlCannonicalXpath(), false);
if (StringUtil.isNotBlank(canonicalUrl)) {
return canonicalUrl;
if (StringUtil.isBlank(canonicalUrl)) {
return null;
}
if (canonicalUrl.startsWith("/")) {
return normalizeCanonicalUrl(responseData.getUrl(), canonicalUrl);
}
return canonicalUrl;
}
protected String normalizeCanonicalUrl(final String baseUrl, final String canonicalUrl) {
try {
return new URL(new URL(baseUrl), canonicalUrl).toString();
} catch (MalformedURLException e) {
logger.warn("Invalid canonical url: " + baseUrl + " : " + canonicalUrl, e);
}
return null;
}

View file

@ -48,13 +48,9 @@ public class LabelTypeHelper {
protected volatile List<LabelTypePattern> labelTypePatternList;
protected LabelTypeService getLabelTypeService() {
return ComponentUtil.getComponent(LabelTypeService.class);
}
@PostConstruct
public void init() {
final List<LabelType> labelTypeList = getLabelTypeService().getLabelTypeList();
final List<LabelType> labelTypeList = ComponentUtil.getComponent(LabelTypeService.class).getLabelTypeList();
buildLabelTypeItems(labelTypeList);
}
@ -112,7 +108,7 @@ public class LabelTypeHelper {
if (labelTypePatternList == null) {
synchronized (this) {
if (labelTypePatternList == null) {
final List<LabelType> labelTypeList = getLabelTypeService().getLabelTypeList();
final List<LabelType> labelTypeList = ComponentUtil.getComponent(LabelTypeService.class).getLabelTypeList();
final List<LabelTypePattern> list = new ArrayList<>();
for (final LabelType labelType : labelTypeList) {
final String includedPaths = labelType.getIncludedPaths();

View file

@ -290,4 +290,12 @@ public class SystemHelper {
return type + name;
}
public void reloadConfiguration() {
ComponentUtil.getLabelTypeHelper().init();
ComponentUtil.getPathMappingHelper().init();
ComponentUtil.getSuggestHelper().init();
ComponentUtil.getPopularWordHelper().init();
// TODO restart jobs
}
}

View file

@ -761,6 +761,72 @@ public class FessLabels extends UserMessages {
/** The key of the message: TAR Archive */
public static final String LABELS_facet_filetype_tar = "{labels.facet_filetype_tar}";
/** The key of the message: RAR Archive */
public static final String LABELS_facet_filetype_rar = "{labels.facet_filetype_rar}";
/** The key of the message: 3gp Video */
public static final String LABELS_facet_filetype_3gp = "{labels.facet_filetype_3gp}";
/** The key of the message: 3g2 Video */
public static final String LABELS_facet_filetype_3g2 = "{labels.facet_filetype_3g2}";
/** The key of the message: AVI Video */
public static final String LABELS_facet_filetype_avi = "{labels.facet_filetype_avi}";
/** The key of the message: FLV Video */
public static final String LABELS_facet_filetype_flv = "{labels.facet_filetype_flv}";
/** The key of the message: MPEG Video */
public static final String LABELS_facet_filetype_mpeg = "{labels.facet_filetype_mpeg}";
/** The key of the message: MP4 Video */
public static final String LABELS_facet_filetype_mp4 = "{labels.facet_filetype_mp4}";
/** The key of the message: OGV Video */
public static final String LABELS_facet_filetype_ogv = "{labels.facet_filetype_ogv}";
/** The key of the message: QuickTime Video */
public static final String LABELS_facet_filetype_qt = "{labels.facet_filetype_qt}";
/** The key of the message: M4V Video */
public static final String LABELS_facet_filetype_m4v = "{labels.facet_filetype_m4v}";
/** The key of the message: WAV Audio */
public static final String LABELS_facet_filetype_wav = "{labels.facet_filetype_wav}";
/** The key of the message: AIF Audio */
public static final String LABELS_facet_filetype_aif = "{labels.facet_filetype_aif}";
/** The key of the message: MIDI Audio */
public static final String LABELS_facet_filetype_mid = "{labels.facet_filetype_mid}";
/** The key of the message: MPGA Audio */
public static final String LABELS_facet_filetype_mpga = "{labels.facet_filetype_mpga}";
/** The key of the message: MP4A Audio */
public static final String LABELS_facet_filetype_mp4a = "{labels.facet_filetype_mp4a}";
/** The key of the message: OGA Audio */
public static final String LABELS_facet_filetype_oga = "{labels.facet_filetype_oga}";
/** The key of the message: WEBP Image */
public static final String LABELS_facet_filetype_wepb = "{labels.facet_filetype_wepb}";
/** The key of the message: BMP Image */
public static final String LABELS_facet_filetype_bmp = "{labels.facet_filetype_bmp}";
/** The key of the message: ICO Image */
public static final String LABELS_facet_filetype_ico = "{labels.facet_filetype_ico}";
/** The key of the message: PNG Image */
public static final String LABELS_facet_filetype_png = "{labels.facet_filetype_png}";
/** The key of the message: SVG Image */
public static final String LABELS_facet_filetype_svg = "{labels.facet_filetype_svg}";
/** The key of the message: TIFF Image */
public static final String LABELS_facet_filetype_tiff = "{labels.facet_filetype_tiff}";
/** The key of the message: Others */
public static final String LABELS_facet_filetype_others = "{labels.facet_filetype_others}";

View file

@ -469,16 +469,16 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
*/
String QUERY_LANGUAGE_MAPPING = "query.language.mapping";
/** The key of the configuration. e.g. 1.6 */
/** The key of the configuration. e.g. 0.2 */
String QUERY_BOOST_TITLE = "query.boost.title";
/** The key of the configuration. e.g. 2.0 */
/** The key of the configuration. e.g. 1.0 */
String QUERY_BOOST_TITLE_LANG = "query.boost.title.lang";
/** The key of the configuration. e.g. 1.0 */
/** The key of the configuration. e.g. 0.1 */
String QUERY_BOOST_CONTENT = "query.boost.content";
/** The key of the configuration. e.g. 1.3 */
/** The key of the configuration. e.g. 0.5 */
String QUERY_BOOST_CONTENT_LANG = "query.boost.content.lang";
/** The key of the configuration. e.g. true */
@ -2278,7 +2278,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/**
* Get the value for the key 'query.boost.title'. <br>
* The value is, e.g. 1.6 <br>
* The value is, e.g. 0.2 <br>
* comment: boost
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
@ -2286,7 +2286,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/**
* Get the value for the key 'query.boost.title' as {@link java.math.BigDecimal}. <br>
* The value is, e.g. 1.6 <br>
* The value is, e.g. 0.2 <br>
* comment: boost
* @return The value of found property. (NotNull: if not found, exception but basically no way)
* @throws NumberFormatException When the property is not decimal.
@ -2295,14 +2295,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/**
* Get the value for the key 'query.boost.title.lang'. <br>
* The value is, e.g. 2.0 <br>
* The value is, e.g. 1.0 <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getQueryBoostTitleLang();
/**
* Get the value for the key 'query.boost.title.lang' as {@link java.math.BigDecimal}. <br>
* The value is, e.g. 2.0 <br>
* The value is, e.g. 1.0 <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
* @throws NumberFormatException When the property is not decimal.
*/
@ -2310,14 +2310,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/**
* Get the value for the key 'query.boost.content'. <br>
* The value is, e.g. 1.0 <br>
* The value is, e.g. 0.1 <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getQueryBoostContent();
/**
* Get the value for the key 'query.boost.content' as {@link java.math.BigDecimal}. <br>
* The value is, e.g. 1.0 <br>
* The value is, e.g. 0.1 <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
* @throws NumberFormatException When the property is not decimal.
*/
@ -2325,14 +2325,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/**
* Get the value for the key 'query.boost.content.lang'. <br>
* The value is, e.g. 1.3 <br>
* The value is, e.g. 0.5 <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getQueryBoostContentLang();
/**
* Get the value for the key 'query.boost.content.lang' as {@link java.math.BigDecimal}. <br>
* The value is, e.g. 1.3 <br>
* The value is, e.g. 0.5 <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
* @throws NumberFormatException When the property is not decimal.
*/

View file

@ -68,6 +68,28 @@
"filetype:bz",
"filetype:bz2",
"filetype:tar",
"filetype:rar",
"filetype:3gp",
"filetype:3g2",
"filetype:avi",
"filetype:flv",
"filetype:mpeg",
"filetype:mp4",
"filetype:ogv",
"filetype:qt",
"filetype:m4v",
"filetype:aif",
"filetype:mid",
"filetype:mpga",
"filetype:mp4a",
"filetype:oga",
"filetype:wav",
"filetype:webp",
"filetype:bmp",
"filetype:ico",
"filetype:png",
"filetype:svg",
"filetype:tiff",
"filetype:others"
]</property>
</component>
@ -210,10 +232,95 @@
<arg>"labels.facet_filetype_tar"</arg>
<arg>"filetype:tar"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_rar"</arg>
<arg>"filetype:rar"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_3gp"</arg>
<arg>"filetype:3gp"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_3g2"</arg>
<arg>"filetype:3g2"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_avi"</arg>
<arg>"filetype:avi"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_flv"</arg>
<arg>"filetype:flv"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_mpeg"</arg>
<arg>"filetype:mpeg"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_mp4"</arg>
<arg>"filetype:mp4"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_ogv"</arg>
<arg>"filetype:ogv"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_qt"</arg>
<arg>"filetype:qt"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_m4v"</arg>
<arg>"filetype:m4v"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_aif"</arg>
<arg>"filetype:aif"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_mid"</arg>
<arg>"filetype:mid"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_mpga"</arg>
<arg>"filetype:mpga"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_ogg"</arg>
<arg>"filetype:ogg"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_wav"</arg>
<arg>"filetype:wav"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_webp"</arg>
<arg>"filetype:webp"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_bmp"</arg>
<arg>"filetype:bmp"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_ico"</arg>
<arg>"filetype:ico"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_png"</arg>
<arg>"filetype:png"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_svg"</arg>
<arg>"filetype:svg"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_tiff"</arg>
<arg>"filetype:tiff"</arg>
</postConstruct>
<postConstruct name="addQuery">
<arg>"labels.facet_filetype_others"</arg>
<arg>"filetype:others"</arg>
</postConstruct>
</component>
</arg>
</postConstruct>

View file

@ -250,10 +250,10 @@ zh-tw=zh-tw\n\
# boost
query.boost.title=1.6
query.boost.title.lang=2.0
query.boost.content=1.0
query.boost.content.lang=1.3
query.boost.title=0.2
query.boost.title.lang=1.0
query.boost.content=0.1
query.boost.content.lang=0.5
# acl
smb.role.from.file=true

View file

@ -244,6 +244,28 @@ labels.facet_filetype_7z=7z Archive
labels.facet_filetype_bz=Bz Archive
labels.facet_filetype_bz2=Bz2 Archive
labels.facet_filetype_tar=TAR Archive
labels.facet_filetype_rar=RAR Archive
labels.facet_filetype_3gp=3gp Video
labels.facet_filetype_3g2=3g2 Video
labels.facet_filetype_avi=AVI Video
labels.facet_filetype_flv=FLV Video
labels.facet_filetype_mpeg=MPEG Video
labels.facet_filetype_mp4=MP4 Video
labels.facet_filetype_ogv=OGV Video
labels.facet_filetype_qt=QuickTime Video
labels.facet_filetype_m4v=M4V Video
labels.facet_filetype_wav=WAV Audio
labels.facet_filetype_aif=AIF Audio
labels.facet_filetype_mid=MIDI Audio
labels.facet_filetype_mpga=MPGA Audio
labels.facet_filetype_mp4a=MP4A Audio
labels.facet_filetype_oga=OGA Audio
labels.facet_filetype_wepb=WEBP Image
labels.facet_filetype_bmp=BMP Image
labels.facet_filetype_ico=ICO Image
labels.facet_filetype_png=PNG Image
labels.facet_filetype_svg=SVG Image
labels.facet_filetype_tiff=TIFF Image
labels.facet_filetype_others=Others
labels.facet_label_reset=Reset
labels.searchoptions_all=All

View file

@ -244,6 +244,28 @@ labels.facet_filetype_7z=7z Archive
labels.facet_filetype_bz=Bz Archive
labels.facet_filetype_bz2=Bz2 Archive
labels.facet_filetype_tar=TAR Archive
labels.facet_filetype_rar=RAR Archive
labels.facet_filetype_3gp=3gp Video
labels.facet_filetype_3g2=3g2 Video
labels.facet_filetype_avi=AVI Video
labels.facet_filetype_flv=FLV Video
labels.facet_filetype_mpeg=MPEG Video
labels.facet_filetype_mp4=MP4 Video
labels.facet_filetype_ogv=OGV Video
labels.facet_filetype_qt=QuickTime Video
labels.facet_filetype_m4v=M4V Video
labels.facet_filetype_wav=WAV Audio
labels.facet_filetype_aif=AIF Audio
labels.facet_filetype_mid=MIDI Audio
labels.facet_filetype_mpga=MPGA Audio
labels.facet_filetype_mp4a=MP4A Audio
labels.facet_filetype_oga=OGA Audio
labels.facet_filetype_wepb=WEBP Image
labels.facet_filetype_bmp=BMP Image
labels.facet_filetype_ico=ICO Image
labels.facet_filetype_png=PNG Image
labels.facet_filetype_svg=SVG Image
labels.facet_filetype_tiff=TIFF Image
labels.facet_filetype_others=Others
labels.facet_label_reset=Reset
labels.searchoptions_all=All

View file

@ -240,6 +240,28 @@ labels.facet_filetype_7z=7z\u30a2\u30fc\u30ab\u30a4\u30d6
labels.facet_filetype_bz=Bz\u30a2\u30fc\u30ab\u30a4\u30d6
labels.facet_filetype_bz2=Bz2\u30a2\u30fc\u30ab\u30a4\u30d6
labels.facet_filetype_tar=TAR\u30a2\u30fc\u30ab\u30a4\u30d6
labels.facet_filetype_rar=RAR Archive
labels.facet_filetype_3gp=3gp Video
labels.facet_filetype_3g2=3g2 Video
labels.facet_filetype_avi=AVI Video
labels.facet_filetype_flv=FLV Video
labels.facet_filetype_mpeg=MPEG Video
labels.facet_filetype_mp4=MP4 Video
labels.facet_filetype_ogv=OGV Video
labels.facet_filetype_qt=QuickTime Video
labels.facet_filetype_m4v=M4V Video
labels.facet_filetype_wav=WAV Audio
labels.facet_filetype_aif=AIF Audio
labels.facet_filetype_mid=MIDI Audio
labels.facet_filetype_mpga=MPGA Audio
labels.facet_filetype_mp4a=MP4A Audio
labels.facet_filetype_oga=OGA Audio
labels.facet_filetype_wepb=WEBP Image
labels.facet_filetype_bmp=BMP Image
labels.facet_filetype_ico=ICO Image
labels.facet_filetype_png=PNG Image
labels.facet_filetype_svg=SVG Image
labels.facet_filetype_tiff=TIFF Image
labels.facet_filetype_others=\u305d\u306e\u4ed6
labels.facet_label_reset=\u30ea\u30bb\u30c3\u30c8
labels.searchoptions_all=\u3059\u3079\u3066

View file

@ -236,6 +236,28 @@ labels.facet_filetype_7z=7z Archive
labels.facet_filetype_bz=Bz Archive
labels.facet_filetype_bz2=Bz2 Archive
labels.facet_filetype_tar=TAR Archive
labels.facet_filetype_rar=RAR Archive
labels.facet_filetype_3gp=3gp Video
labels.facet_filetype_3g2=3g2 Video
labels.facet_filetype_avi=AVI Video
labels.facet_filetype_flv=FLV Video
labels.facet_filetype_mpeg=MPEG Video
labels.facet_filetype_mp4=MP4 Video
labels.facet_filetype_ogv=OGV Video
labels.facet_filetype_qt=QuickTime Video
labels.facet_filetype_m4v=M4V Video
labels.facet_filetype_wav=WAV Audio
labels.facet_filetype_aif=AIF Audio
labels.facet_filetype_mid=MIDI Audio
labels.facet_filetype_mpga=MPGA Audio
labels.facet_filetype_mp4a=MP4A Audio
labels.facet_filetype_oga=OGA Audio
labels.facet_filetype_wepb=WEBP Image
labels.facet_filetype_bmp=BMP Image
labels.facet_filetype_ico=ICO Image
labels.facet_filetype_png=PNG Image
labels.facet_filetype_svg=SVG Image
labels.facet_filetype_tiff=TIFF Image
labels.facet_filetype_others = \uae30\ud0c0
labels.facet_label_reset = \uc7ac\uc124\uc815
labels.searchoptions_all = \ubaa8\ub4e0

View file

@ -242,6 +242,28 @@ labels.facet_filetype_7z=7z Архив
labels.facet_filetype_bz=Bz Архив
labels.facet_filetype_bz2=Bz2 Архив
labels.facet_filetype_tar=TAR Архив
labels.facet_filetype_rar=RAR Archive
labels.facet_filetype_3gp=3gp Video
labels.facet_filetype_3g2=3g2 Video
labels.facet_filetype_avi=AVI Video
labels.facet_filetype_flv=FLV Video
labels.facet_filetype_mpeg=MPEG Video
labels.facet_filetype_mp4=MP4 Video
labels.facet_filetype_ogv=OGV Video
labels.facet_filetype_qt=QuickTime Video
labels.facet_filetype_m4v=M4V Video
labels.facet_filetype_wav=WAV Audio
labels.facet_filetype_aif=AIF Audio
labels.facet_filetype_mid=MIDI Audio
labels.facet_filetype_mpga=MPGA Audio
labels.facet_filetype_mp4a=MP4A Audio
labels.facet_filetype_oga=OGA Audio
labels.facet_filetype_wepb=WEBP Image
labels.facet_filetype_bmp=BMP Image
labels.facet_filetype_ico=ICO Image
labels.facet_filetype_png=PNG Image
labels.facet_filetype_svg=SVG Image
labels.facet_filetype_tiff=TIFF Image
labels.facet_filetype_others=Другие
labels.facet_label_reset=Сброс
labels.searchoptions_all=Все

View file

@ -137,6 +137,98 @@
<arg>"application/x-tar"</arg>
<arg>"tar"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"application/x-rar-compressed"</arg>
<arg>"rar"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"video/3gp"</arg>
<arg>"3gp"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"video/3g2"</arg>
<arg>"3g2"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"video/x-msvideo"</arg>
<arg>"avi"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"video/x-flv"</arg>
<arg>"flv"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"video/mpeg"</arg>
<arg>"mpeg"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"video/mp4"</arg>
<arg>"mp4"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"video/ogv"</arg>
<arg>"ogv"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"video/quicktime"</arg>
<arg>"qt"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"video/x-m4v"</arg>
<arg>"m4v"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"audio/x-aif"</arg>
<arg>"aif"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"audio/midi"</arg>
<arg>"midi"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"audio/mpga"</arg>
<arg>"mpga"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"audio/mp4"</arg>
<arg>"mp4a"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"audio/ogg"</arg>
<arg>"oga"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"audio/x-wav"</arg>
<arg>"wav"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"image/webp"</arg>
<arg>"webp"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"image/bmp"</arg>
<arg>"bmp"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"image/x-icon"</arg>
<arg>"ico"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"image/x-icon"</arg>
<arg>"ico"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"image/png"</arg>
<arg>"png"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"image/svg+xml"</arg>
<arg>"svg"</arg>
</postConstruct>
<postConstruct name="add">
<arg>"image/tiff"</arg>
<arg>"tiff"</arg>
</postConstruct>
</component>
<component name="fessCrawler" class="org.codelibs.fess.exec.Crawler"
instance="prototype">

View file

@ -297,4 +297,30 @@ public class FessXpathTransformerTest extends UnitFessTestCase {
value = transformer.getSingleNodeValue(document, "//META[@name='keywords']/@content|//BODY", false);
assertEquals("bbb aaa", value);
}
public void test_normalizeCanonicalUrl() throws Exception {
final FessXpathTransformer transformer = new FessXpathTransformer();
String value;
value = transformer.normalizeCanonicalUrl("http://hoge.com/", "a");
assertEquals("http://hoge.com/a", value);
value = transformer.normalizeCanonicalUrl("http://hoge.com/", "aaa");
assertEquals("http://hoge.com/aaa", value);
value = transformer.normalizeCanonicalUrl("http://hoge.com/", "/aaa");
assertEquals("http://hoge.com/aaa", value);
value = transformer.normalizeCanonicalUrl("http://hoge.com/bbb", "aaa");
assertEquals("http://hoge.com/aaa", value);
value = transformer.normalizeCanonicalUrl("http://hoge.com/bbb/", "aaa");
assertEquals("http://hoge.com/bbb/aaa", value);
value = transformer.normalizeCanonicalUrl("http://hoge.com/bbb/", "/aaa");
assertEquals("http://hoge.com/aaa", value);
value = transformer.normalizeCanonicalUrl("http://hoge.com/bbb", "/aaa");
assertEquals("http://hoge.com/aaa", value);
}
}

File diff suppressed because it is too large Load diff