code clean up
This commit is contained in:
parent
889b61eaab
commit
c4bab7b0e2
3 changed files with 3 additions and 78 deletions
|
@ -37,9 +37,7 @@ import org.codelibs.fess.helper.OpenSearchHelper;
|
|||
import org.codelibs.fess.helper.PopularWordHelper;
|
||||
import org.codelibs.fess.helper.QueryHelper;
|
||||
import org.codelibs.fess.helper.RoleQueryHelper;
|
||||
import org.codelibs.fess.helper.SystemHelper;
|
||||
import org.codelibs.fess.helper.UserInfoHelper;
|
||||
import org.codelibs.fess.helper.ViewHelper;
|
||||
import org.codelibs.fess.thumbnail.ThumbnailManager;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.dbflute.optional.OptionalThing;
|
||||
|
@ -62,9 +60,6 @@ public abstract class FessSearchAction extends FessBaseAction {
|
|||
@Resource
|
||||
protected LabelTypeHelper labelTypeHelper;
|
||||
|
||||
@Resource
|
||||
protected ViewHelper viewHelper;
|
||||
|
||||
@Resource
|
||||
protected QueryHelper queryHelper;
|
||||
|
||||
|
@ -74,9 +69,6 @@ public abstract class FessSearchAction extends FessBaseAction {
|
|||
@Resource
|
||||
protected UserInfoHelper userInfoHelper;
|
||||
|
||||
@Resource
|
||||
protected SystemHelper systemHelper;
|
||||
|
||||
@Resource
|
||||
protected OpenSearchHelper openSearchHelper;
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
break;
|
||||
}
|
||||
} catch (final TransformerException e) {
|
||||
logger.warn("Could not parse a value of " + entry.getKey() + ":" + entry.getValue());
|
||||
logger.warn("Could not parse a value of " + entry.getKey() + ":" + entry.getValue(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
}
|
||||
}
|
||||
} catch (final TransformerException e) {
|
||||
logger.warn("Could not parse a value of " + META_NAME_ROBOTS_CONTENT);
|
||||
logger.warn("Could not parse a value of " + META_NAME_ROBOTS_CONTENT, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -596,7 +596,7 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
buf.append("\n");
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
logger.warn("Could not parse a value of " + xpath);
|
||||
logger.warn("Could not parse a value of " + xpath, e);
|
||||
}
|
||||
return buf.toString().trim();
|
||||
}
|
||||
|
@ -667,11 +667,6 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
return new HashMap<String, Object>();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isValidPath(final String path) {
|
||||
return super.isValidPath(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addChildUrlFromTagAttribute(final List<String> urlList, final URL url, final String attrValue, final String encoding) {
|
||||
final String urlValue = attrValue.trim();
|
||||
|
|
|
@ -373,68 +373,6 @@ public class FessXpathTransformerTest extends UnitFessTestCase {
|
|||
|
||||
}
|
||||
|
||||
public void test_isValidPath_valid() {
|
||||
final FessXpathTransformer fessXpathTransformer = new FessXpathTransformer();
|
||||
fessXpathTransformer.init();
|
||||
fessXpathTransformer.convertUrlMap.put("feed:", "http:");
|
||||
|
||||
String value;
|
||||
|
||||
value = "foo.html";
|
||||
assertTrue(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = "./foo.html";
|
||||
assertTrue(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = "/foo.html";
|
||||
assertTrue(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = "http://www.seasar.org/foo.html";
|
||||
assertTrue(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = "a javascript:...";
|
||||
assertTrue(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
}
|
||||
|
||||
public void test_isValidPath_invalid() {
|
||||
final FessXpathTransformer fessXpathTransformer = new FessXpathTransformer();
|
||||
fessXpathTransformer.init();
|
||||
fessXpathTransformer.convertUrlMap.put("feed:", "http:");
|
||||
|
||||
String value;
|
||||
|
||||
value = "javascript:...";
|
||||
assertFalse(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = "mailto:...";
|
||||
assertFalse(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = "irc:...";
|
||||
assertFalse(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = " javascript:...";
|
||||
assertFalse(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = " mailto:...";
|
||||
assertFalse(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = " irc:...";
|
||||
assertFalse(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = "JAVASCRIPT:...";
|
||||
assertFalse(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = "MAILTO:...";
|
||||
assertFalse(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = "IRC:...";
|
||||
assertFalse(fessXpathTransformer.isValidPath(value));
|
||||
|
||||
value = "skype:...";
|
||||
assertFalse(fessXpathTransformer.isValidPath(value));
|
||||
}
|
||||
|
||||
public void test_convertChildUrlList() {
|
||||
final FessXpathTransformer fessXpathTransformer = new FessXpathTransformer();
|
||||
fessXpathTransformer.init();
|
||||
|
|
Loading…
Add table
Reference in a new issue