ktlili 2005/07/11 14:31:13 CEST
Modified files:
war/src/conf en_US.properties
war/src/java/com/jahia/clipping/Bean ClipperBean.java
FilterBean.java
war/src/java/com/jahia/clipping/XML ClipperDocument.java
ClipperParser.java
ElementBuilder.java
Label.java
war/src/java/com/jahia/clipping/database/hibernate
DatabaseManager.java
war/src/java/com/jahia/clipping/struts SelectPartAction.java
SelectPartForm.java
WebBrowserAction.java
war/src/java/com/jahia/clipping/web/html ExtractorFilter.java
HTMLDocument.java
HTMLTransformer.java
war/src/java/com/jahia/clipping/web/html/Impl/Dom
DomHTMLDocument.java
DomHTMLTransformer.java
war/src/java/com/jahia/clipping/web/html/Impl
EmptyHTMLDocument.java
war/src/java/com/jahia/clipping/web/html/Impl/ExtractorFilter
AbsctractExtractoreFilter.java
ChewExtractorFilter.java
war/src/java/com/jahia/clipping/web/html/Impl/HTMLParser
ChewBuilderVisitor.java
HTMLParserDocument.java
HTMLParserTransformer.java
war/src/java/com/jahia/clipping/web/html/Impl/JDom
JDomHTMLDocument.java
JDomHTMLTransformer.java
war/src/webapp/jsp/actions selectPartAction.jsp
Log:
- add chew whith any tag (chew form, table,...)
Revision Changes Path
1.18 +2 -1 webclip_builder/war/src/conf/en_US.properties
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/conf/en_US.properties.diff?r1=1.17&r2=1.18&f=h
1.18 +11 -5
webclip_builder/war/src/java/com/jahia/clipping/Bean/ClipperBean.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/Bean/ClipperBean.java.diff?r1=1.17&r2=1.18&f=h
1.2 +20 -13
webclip_builder/war/src/java/com/jahia/clipping/Bean/FilterBean.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/Bean/FilterBean.java.diff?r1=1.1&r2=1.2&f=h
1.13 +2 -2
webclip_builder/war/src/java/com/jahia/clipping/XML/ClipperDocument.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/XML/ClipperDocument.java.diff?r1=1.12&r2=1.13&f=h
1.14 +14 -5
webclip_builder/war/src/java/com/jahia/clipping/XML/ClipperParser.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/XML/ClipperParser.java.diff?r1=1.13&r2=1.14&f=h
1.14 +17 -8
webclip_builder/war/src/java/com/jahia/clipping/XML/ElementBuilder.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/XML/ElementBuilder.java.diff?r1=1.13&r2=1.14&f=h
1.12 +1 -0
webclip_builder/war/src/java/com/jahia/clipping/XML/Label.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/XML/Label.java.diff?r1=1.11&r2=1.12&f=h
1.7 +2 -2
webclip_builder/war/src/java/com/jahia/clipping/database/hibernate/DatabaseManager.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/database/hibernate/DatabaseManager.java.diff?r1=1.6&r2=1.7&f=h
1.13 +5 -3
webclip_builder/war/src/java/com/jahia/clipping/struts/SelectPartAction.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/struts/SelectPartAction.java.diff?r1=1.12&r2=1.13&f=h
1.3 +37 -9
webclip_builder/war/src/java/com/jahia/clipping/struts/SelectPartForm.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/struts/SelectPartForm.java.diff?r1=1.2&r2=1.3&f=h
1.16 +3 -1
webclip_builder/war/src/java/com/jahia/clipping/struts/WebBrowserAction.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/struts/WebBrowserAction.java.diff?r1=1.15&r2=1.16&f=h
1.8 +15 -3
webclip_builder/war/src/java/com/jahia/clipping/web/html/ExtractorFilter.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/ExtractorFilter.java.diff?r1=1.7&r2=1.8&f=h
1.10 +3 -2
webclip_builder/war/src/java/com/jahia/clipping/web/html/HTMLDocument.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/HTMLDocument.java.diff?r1=1.9&r2=1.10&f=h
1.9 +1 -1
webclip_builder/war/src/java/com/jahia/clipping/web/html/HTMLTransformer.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/HTMLTransformer.java.diff?r1=1.8&r2=1.9&f=h
1.2 +8 -9
webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/Dom/DomHTMLDocument.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/Dom/DomHTMLDocument.java.diff?r1=1.1&r2=1.2&f=h
1.2 +11 -9
webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/Dom/DomHTMLTransformer.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/Dom/DomHTMLTransformer.java.diff?r1=1.1&r2=1.2&f=h
1.5 +1 -1
webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/EmptyHTMLDocument.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/EmptyHTMLDocument.java.diff?r1=1.4&r2=1.5&f=h
1.2 +15 -4
webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/ExtractorFilter/AbsctractExtractoreFilter.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/ExtractorFilter/AbsctractExtractoreFilter.java.diff?r1=1.1&r2=1.2&f=h
1.3 +69 -55
webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/ExtractorFilter/ChewExtractorFilter.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/ExtractorFilter/ChewExtractorFilter.java.diff?r1=1.2&r2=1.3&f=h
1.7 +26 -3
webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/HTMLParser/ChewBuilderVisitor.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/HTMLParser/ChewBuilderVisitor.java.diff?r1=1.6&r2=1.7&f=h
1.8 +4 -5
webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/HTMLParser/HTMLParserDocument.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/HTMLParser/HTMLParserDocument.java.diff?r1=1.7&r2=1.8&f=h
1.15 +18 -15
webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/HTMLParser/HTMLParserTransformer.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/HTMLParser/HTMLParserTransformer.java.diff?r1=1.14&r2=1.15&f=h
1.10 +4 -4
webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/JDom/JDomHTMLDocument.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/JDom/JDomHTMLDocument.java.diff?r1=1.9&r2=1.10&f=h
1.16 +1 -1
webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/JDom/JDomHTMLTransformer.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/JDom/JDomHTMLTransformer.java.diff?r1=1.15&r2=1.16&f=h
1.5 +19 -1
webclip_builder/war/src/webapp/jsp/actions/selectPartAction.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclip_builder/war/src/webapp/jsp/actions/selectPartAction.jsp.diff?r1=1.4&r2=1.5&f=h
Index: en_US.properties
===================================================================
RCS file: /home/cvs/repository/webclip_builder/war/src/conf/en_US.properties,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- en_US.properties 7 Jul 2005 08:37:20 -0000 1.17
+++ en_US.properties 11 Jul 2005 12:31:09 -0000 1.18
@@ -149,7 +149,8 @@
select.editParams = Edit parameters
select.selectPart = Select part
select.clippingMethod = Clipping method
-select.typeContent = Type of th content
+select.typeContent = Type of content
+select.tagName = Tag name
select.typeContent.dynamic = Dynamic
select.typeContent.static = Static
select.clippingMethod.manual = Manual
Index: ClipperBean.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/Bean/ClipperBean.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ClipperBean.java 11 Jul 2005 10:03:16 -0000 1.17
+++ ClipperBean.java 11 Jul 2005 12:31:09 -0000 1.18
@@ -436,11 +436,12 @@
/**
* Gets the FilterKey attribute of the ClipperBean object
*
- [EMAIL PROTECTED] The FilterKey value
+ [EMAIL PROTECTED] keyName Description of Parameter
+ [EMAIL PROTECTED] The FilterKey value
*/
- public String getFilterKey() {
+ public String getFilterKey(String keyName) {
if (filterKey == null) {
- filterKey = getFilter().getKeyPart();
+ filterKey = getFilter().getKeyPart(keyName);
}
return filterKey;
}
@@ -689,8 +690,13 @@
}
else {
//set the key of the filter
- String key = parser.getFilterKey();
- filter.addKeyPart(key);
+ Map keysMap = parser.getKeysMap();
+ Iterator it = keysMap.keySet().iterator();
+ while (it.hasNext()) {
+ String name = (String) it.next();
+ String value = (String)
keysMap.get(name);
+ filter.addKeyPart(name, value);
+ }
// set the filter
setFilter(filter);
Index: FilterBean.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/Bean/FilterBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FilterBean.java 14 Mar 2005 16:29:33 -0000 1.1
+++ FilterBean.java 11 Jul 2005 12:31:09 -0000 1.2
@@ -1,12 +1,15 @@
package com.jahia.clipping.Bean;
+import java.util.*;
+
/**
* Description of the Class
*
[EMAIL PROTECTED] Tlili Khaled
*/
-public class FilterBean extends Bean{
+public class FilterBean extends Bean {
private String type;
+ private Hashtable keyHash = new Hashtable();
private String key;
@@ -17,26 +20,29 @@
}
+
/**
- * Sets the Key attribute of the FilterBean object
+ * Sets the Type attribute of the FilterBean object
*
- [EMAIL PROTECTED] key The new Key value
+ [EMAIL PROTECTED] type The new Type value
*/
- public void setKey(String key) {
- this.key = key;
+ public void setType(String type) {
+ this.type = type;
}
/**
- * Sets the Type attribute of the FilterBean object
+ * Gets the KeyPart attribute of the FilterBean object
*
- [EMAIL PROTECTED] type The new Type value
+ [EMAIL PROTECTED] name Description of Parameter
+ [EMAIL PROTECTED] The KeyPart value
*/
- public void setType(String type) {
- this.type = type;
+ public String getKeyPart(String name) {
+ return (String) keyHash.get(name);
}
+
/**
* Gets the Type attribute of the FilterBean object
*
@@ -48,12 +54,13 @@
/**
- * Gets the Key attribute of the FilterBean object
+ * Adds a feature to the KeyPart attribute of the FilterBean object
*
- [EMAIL PROTECTED] The Key value
+ [EMAIL PROTECTED] name The feature to be added to the KeyPart
attribute
+ [EMAIL PROTECTED] value The feature to be added to the KeyPart
attribute
*/
- public String getKey() {
- return key;
+ public void addKeyPart(String name, String value) {
+ keyHash.put(name, value);
}
}
Index: ClipperDocument.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/XML/ClipperDocument.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ClipperDocument.java 7 Jul 2005 08:37:21 -0000 1.12
+++ ClipperDocument.java 11 Jul 2005 12:31:10 -0000 1.13
@@ -95,9 +95,9 @@
[EMAIL PROTECTED] filter The new Filter value
*/
public void setFilter(ExtractorFilter filter) {
- String keyPart = filter.getKeyPart();
+ Map keysMap = filter.getKeyMap();
String name = filter.getName();
-
parser.getClipper().addContent(ElementBuilder.getInstance().buildFilter(name,
keyPart));
+
parser.getClipper().addContent(ElementBuilder.getInstance().buildFilter(name,
keysMap));
}
Index: ClipperParser.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/XML/ClipperParser.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ClipperParser.java 7 Jul 2005 08:37:21 -0000 1.13
+++ ClipperParser.java 11 Jul 2005 12:31:10 -0000 1.14
@@ -204,18 +204,27 @@
}
+
/**
- * Gets the FilterKey attribute of the ClipperParser object
+ * Gets the KeysMap attribute of the ClipperParser object
*
- [EMAIL PROTECTED] The FilterKey value
+ [EMAIL PROTECTED] The KeysMap value
*/
- public String getFilterKey() {
+ public Map getKeysMap() {
Element filter = getFilter();
- Element key = filter.getChild(Label.KEY);
- return key.getTextTrim();
+ List keys = filter.getChildren(Label.KEY);
+ Map m = new HashMap();
+ for (int i = 0; i < keys.size(); i++) {
+ Element key = (Element) keys.get(i);
+ String name = key.getAttributeValue(Label.KEY_NAME);
+ String value = key.getText();
+ m.put(name, value);
+ }
+ return m;
}
+
/**
* Gets the UrlValue attribute of the ClipperParser object
*
Index: ElementBuilder.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/XML/ElementBuilder.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ElementBuilder.java 7 Jul 2005 08:37:21 -0000 1.13
+++ ElementBuilder.java 11 Jul 2005 12:31:10 -0000 1.14
@@ -54,18 +54,26 @@
* Description of the Method
*
[EMAIL PROTECTED] type Description of Parameter
- [EMAIL PROTECTED] keyPart Description of Parameter
+ [EMAIL PROTECTED] keysMap Description of Parameter
[EMAIL PROTECTED] Description of the Returned Value
*/
- public Element buildFilter(String type, String keyPart) {
+ public Element buildFilter(String type, Map keysMap) {
//Filter
Element filterEle = new Element(Label.FILTER);
filterEle.setAttribute(Label.FILTER_TYPE, type);
- //Selected Part
- Element keyEle = new Element(Label.KEY);
- keyEle.setText(keyPart);
- filterEle.addContent(keyEle);
+ Iterator it = keysMap.keySet().iterator();
+ while (it.hasNext()) {
+ String name = (String) it.next();
+ String value = (String) keysMap.get(name);
+
+ // add key
+ Element keyEle = new Element(Label.KEY);
+ keyEle.setAttribute(Label.KEY_NAME, name);
+ keyEle.setText(value);
+ filterEle.addContent(keyEle);
+
+ }
return filterEle;
}
@@ -188,11 +196,12 @@
[EMAIL PROTECTED] type Description of Parameter
[EMAIL PROTECTED] possibleValues Description of Parameter
[EMAIL PROTECTED] visibility Description of Parameter
+ [EMAIL PROTECTED] update Description of Parameter
[EMAIL PROTECTED] position Description of Parameter
[EMAIL PROTECTED] Description of the Returned Value
*/
public Element buildUserParam(String formParentName, String
formParentId, int formParentPos, String name, String mapping, String type,
- ArrayList possibleValues, String visibility,String
update, int position) {
+ ArrayList possibleValues, String visibility, String
update, int position) {
//form-param
Element ele = new Element(Label.PARAMETER);
//form-param_attributes
@@ -201,7 +210,7 @@
ele.setAttribute(Label.PARAMETER_TYPE, type);
ele.setAttribute(Label.PARAMETER_VISIBILITY, visibility);
- ele.setAttribute(Label.PARAMETER_UPDATE, update);
+ ele.setAttribute(Label.PARAMETER_UPDATE, update);
ele.setAttribute(Label.PARAMETER_POSITION, "" + position);
ele.setAttribute(Label.FORM_PARENT_NAME, formParentName);
ele.setAttribute(Label.FORM_PARENT_ID, formParentId);
Index: Label.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/XML/Label.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Label.java 7 Jul 2005 08:37:21 -0000 1.11
+++ Label.java 11 Jul 2005 12:31:10 -0000 1.12
@@ -18,6 +18,7 @@
public static String FILTER_TYPE_STRINGTREE = "stringTree";
public static String FILTER_TYPE_JDOM = "jdom";
public static String KEY = "key";
+ public static String KEY_NAME = "name";
public static String NAME = "name";
public static String URL = "url";
public static String URL_FROM = "from";
Index: DatabaseManager.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/database/hibernate/DatabaseManager.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DatabaseManager.java 11 Jul 2005 10:03:16 -0000 1.6
+++ DatabaseManager.java 11 Jul 2005 12:31:10 -0000 1.7
@@ -94,8 +94,8 @@
}
//set the key of the filter
- String key = cBean.getFilterKey();
- filter.addKeyPart(key);
+ //String key = cBean.getFilterKey();
+ //filter.addKeyPart(key);
// set the filter
cBean.setFilter(filter);
Index: SelectPartAction.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/struts/SelectPartAction.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- SelectPartAction.java 11 Jul 2005 10:03:16 -0000 1.12
+++ SelectPartAction.java 11 Jul 2005 12:31:10 -0000 1.13
@@ -159,10 +159,12 @@
String hashSelectedPart =
httpServletRequest.getParameter(ChewExtractorFilter.NAME_INPUT_PARAM);
logger.debug("Selected tab: " + hashSelectedPart);
- ExtractorFilter filter = new
ChewExtractorFilter(hashSelectedPart);
+ ChewExtractorFilter filter = new ChewExtractorFilter();
//set the key of the filter
- String key = hashSelectedPart;
- filter.addKeyPart(key);
+ String hashKey = hashSelectedPart;
+ String tagName = selectPartForm.getWebClippingTagName();
+ filter.setHashKey(hashKey);
+ filter.setTagNameKey(tagName);
// set the filter
bean.setFilter(filter);
Index: SelectPartForm.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/struts/SelectPartForm.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SelectPartForm.java 10 Jun 2005 16:42:38 -0000 1.2
+++ SelectPartForm.java 11 Jul 2005 12:31:10 -0000 1.3
@@ -1,24 +1,25 @@
package com.jahia.clipping.struts;
-import org.apache.struts.action.*;
-import com.jahia.clipping.struts.Util.AbstractWizardForm;
import javax.servlet.http.*;
+
import com.jahia.clipping.Bean.*;
-import com.jahia.clipping.struts.Util.Constants;
+import com.jahia.clipping.struts.Util.*;
+import org.apache.struts.action.*;
/**
* Bean linked with selectPart.jsp
*
[EMAIL PROTECTED] Tlili Khaled
*/
-public class SelectPartForm
- extends AbstractWizardForm {
+public class SelectPartForm extends AbstractWizardForm {
+
private String clippingMethod = "0";
private String bodyContent;
private String targetUrl;
private String selectedContent;
private String webClippingTypeContent;
private String webClippingPartHashCode;
+ private String webClippingTagName;
/**
@@ -30,10 +31,6 @@
this.bodyContent = bodyContent;
}
- public int getId() {
- return Constants.SELECTPART;
- }
-
/**
@@ -87,6 +84,26 @@
/**
+ * Sets the WebClippingTagName attribute of the SelectPartForm object
+ *
+ [EMAIL PROTECTED] webClippingTagName The new WebClippingTagName value
+ */
+ public void setWebClippingTagName(String webClippingTagName) {
+ this.webClippingTagName = webClippingTagName;
+ }
+
+
+ /**
+ * Gets the Id attribute of the SelectPartForm object
+ *
+ [EMAIL PROTECTED] The Id value
+ */
+ public int getId() {
+ return Constants.SELECTPART;
+ }
+
+
+ /**
* Gets the Errors attribute of the SelectPartForm object
*
[EMAIL PROTECTED] The Errors value
@@ -158,6 +175,16 @@
/**
+ * Gets the WebClippingTagName attribute of the SelectPartForm object
+ *
+ [EMAIL PROTECTED] The WebClippingTagName value
+ */
+ public String getWebClippingTagName() {
+ return webClippingTagName;
+ }
+
+
+ /**
* Description of the Method
*
[EMAIL PROTECTED] actionMapping Description of Parameter
@@ -191,4 +218,5 @@
}
+
}
Index: WebBrowserAction.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/struts/WebBrowserAction.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- WebBrowserAction.java 11 Jul 2005 09:14:58 -0000 1.15
+++ WebBrowserAction.java 11 Jul 2005 12:31:10 -0000 1.16
@@ -225,7 +225,9 @@
else if
(showParam.equalsIgnoreCase(Constants.WEB_BROWSER_SHOW_CHEW)) {
logger.debug(" SHOW CHEW DOCUMENT ");
HTMLDocument doc =
getLastRecordedHTMLDocument(httpServletRequest, httpServletResponse, form);
- html = doc.getChewDocumentAsString();
+ SelectPartForm sForm = (SelectPartForm)
httpServletRequest.getSession().getAttribute(com.jahia.clipping.struts.Util.Constants.SELECTPART_FORM);
+ String tagName =
sForm.getWebClippingTagName();
+ html =
doc.getChewDocumentAsString(tagName);
}
else if (showParam.equalsIgnoreCase(
Constants.WEB_BROWSER_SHOW_PREVIEW)) {
Index: ExtractorFilter.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/ExtractorFilter.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ExtractorFilter.java 11 Jul 2005 10:03:16 -0000 1.7
+++ ExtractorFilter.java 11 Jul 2005 12:31:11 -0000 1.8
@@ -1,5 +1,7 @@
package com.jahia.clipping.web.html;
+import java.util.Map;
+
/**
* Object that aims at finding the selected part of an html document
*
@@ -17,17 +19,27 @@
/**
+ * Gets the KeyMap attribute of the ExtractorFilter object
+ *
+ [EMAIL PROTECTED] The KeyMap value
+ */
+ abstract Map getKeyMap();
+
+
+ /**
* Gets the KeyPart attribute of the ExtractorFilter object
*
- [EMAIL PROTECTED] The KeyPart value
+ [EMAIL PROTECTED] name Description of Parameter
+ [EMAIL PROTECTED] The KeyPart value
*/
abstract String getKeyPart(String name);
/**
- * Sets the KeyPart attribute of the ExtractorFilter object
+ * Adds a feature to the KeyPart attribute of the ExtractorFilter
object
*
- [EMAIL PROTECTED] key The new KeyPart value
+ [EMAIL PROTECTED] name The feature to be added to the KeyPart
attribute
+ [EMAIL PROTECTED] value The feature to be added to the KeyPart
attribute
*/
abstract void addKeyPart(String name, String value);
Index: HTMLDocument.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/HTMLDocument.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- HTMLDocument.java 1 Jul 2005 16:21:46 -0000 1.9
+++ HTMLDocument.java 11 Jul 2005 12:31:11 -0000 1.10
@@ -23,9 +23,10 @@
/**
* Gets the ChewDocumentAsString attribute of the HTMLDocument object
*
- [EMAIL PROTECTED] The ChewDocumentAsString value
+ [EMAIL PROTECTED] tagName Description of Parameter
+ [EMAIL PROTECTED] The ChewDocumentAsString value
*/
- public String getChewDocumentAsString();
+ public String getChewDocumentAsString(String tagName);
/**
Index: HTMLTransformer.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/HTMLTransformer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- HTMLTransformer.java 5 Jul 2005 15:44:09 -0000 1.8
+++ HTMLTransformer.java 11 Jul 2005 12:31:11 -0000 1.9
@@ -44,7 +44,7 @@
/**
* Build chew document
*/
- public void buildChewDocument();
+ public void buildChewDocument(String tagName);
/**
Index: DomHTMLDocument.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/Dom/DomHTMLDocument.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DomHTMLDocument.java 11 Jul 2005 09:49:15 -0000 1.1
+++ DomHTMLDocument.java 11 Jul 2005 12:31:11 -0000 1.2
@@ -175,14 +175,12 @@
/**
* Gets the ChewDocument attribute of the XercesHTMLDocument object
*
- [EMAIL PROTECTED] The ChewDocument value
+ [EMAIL PROTECTED] tagName Description of Parameter
+ [EMAIL PROTECTED] The ChewDocument value
*/
- public Document getChewDocument() {
+ public Document getChewDocument(String tagName) {
logger.debug("[ Get chew document ]");
- if (chewDocument == null) {
- logger.debug("Chew document is null, build it");
- getTransformer().buildChewDocument();
- }
+ getTransformer().buildChewDocument(tagName);
return chewDocument;
}
@@ -206,10 +204,11 @@
/**
* Gets the ChewDocumentAsString attribute of the HTMLDocument object
*
- [EMAIL PROTECTED] The ChewDocumentAsString value
+ [EMAIL PROTECTED] tagName Description of Parameter
+ [EMAIL PROTECTED] The ChewDocumentAsString value
*/
- public String getChewDocumentAsString() {
- return DomUtilities.getDocumentAsString(this.getChewDocument());
+ public String getChewDocumentAsString(String tagName) {
+ return
DomUtilities.getDocumentAsString(getChewDocument(tagName));
}
Index: DomHTMLTransformer.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/Dom/DomHTMLTransformer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DomHTMLTransformer.java 11 Jul 2005 09:49:15 -0000 1.1
+++ DomHTMLTransformer.java 11 Jul 2005 12:31:11 -0000 1.2
@@ -33,7 +33,6 @@
private final String META_ELE_XPATH = "//meta";
private final String SYTLE_ELE_XPATH = "//style";
private final String SCRIPT_ELE_XPATH = "//script";
- private final String CHEW_ELE_XPATH = "//table";
private final String TARGET_ATT_XPATH = "//@target";
private final String BASE_ELE_XPATH = "//base";
private final String JAVASCRIPT_EVENT_XPATH =
"//@onabort|//@onblur|//@onchange|//@onclick|//@ondblClick|//@ondragdrop|//@onerror|//@onfocus|//@onkeydown|//@onkeypress|//@onkeyup|//@onload|//@onmousedown|//@onmousemove|//@onmouseout|//@onmouseover|//@onmouseup|//@onmove|//@onreset|
//@onresize|//@onselect|//@onsubmit|//@onunload";
@@ -101,8 +100,10 @@
/**
* Description of the Method
+ *
+ [EMAIL PROTECTED] tagName Description of Parameter
*/
- public void buildChewDocument() {
+ public void buildChewDocument(String tagName) {
logger.debug("[ Build chew document ]");
logger.debug("[ Build Transformed document ]");
Document transformedDoc =
getDocument().getTransformedDocument();
@@ -112,7 +113,7 @@
chewDocument = (Document)
transformedDoc.cloneNode(true);
//process chew element
- processChewElement(chewDocument);
+ processChewElement(chewDocument, tagName);
}
@@ -422,14 +423,14 @@
*/
private String addChewLinkElementChild(Element ele, int position) {
Document ownerDoc = ele.getOwnerDocument();
- String idAtt = ele.getAttribute("id");
+ String idAtt = ele.getAttribute("id");
//create a link element
Element linkEle = ownerDoc.createElement("a");
linkEle.setAttribute(HTML.Attribute.TARGET.toString(),
"_parent");
// get hash and set the haah of the ele as it's id
- String hash = HashUtilities.buildTableHash(idAtt,position);
- ele.setAttribute("id",hash);
+ String hash = HashUtilities.buildTableHash(idAtt, position);
+ ele.setAttribute("id", hash);
String linkHref = getHrefChewLink(hash);
linkEle.setAttribute(HTML.Attribute.HREF.toString(), linkHref);
@@ -825,11 +826,12 @@
/**
* Extract css from link element and make it icluded css
*
- [EMAIL PROTECTED] doc Description of Parameter
+ [EMAIL PROTECTED] doc Description of Parameter
+ [EMAIL PROTECTED] tagName Description of Parameter
*/
- private void processChewElement(Document doc) {
+ private void processChewElement(Document doc, String tagName) {
logger.debug("[ Process link element ]");
- NodeList elements = DomUtilities.getNodeListByXPath(doc,
this.CHEW_ELE_XPATH);
+ NodeList elements = DomUtilities.getNodeListByXPath(doc, "//" +
tagName);
for (int i = 0; i < elements.getLength(); i++) {
try {
// Current chew element
Index: EmptyHTMLDocument.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/EmptyHTMLDocument.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- EmptyHTMLDocument.java 1 Jul 2005 16:21:46 -0000 1.4
+++ EmptyHTMLDocument.java 11 Jul 2005 12:31:11 -0000 1.5
@@ -49,7 +49,7 @@
*
[EMAIL PROTECTED] The ChewDocumentAsString value
*/
- public String getChewDocumentAsString() {
+ public String getChewDocumentAsString(String tagName) {
return "";
}
Index: AbsctractExtractoreFilter.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/ExtractorFilter/AbsctractExtractoreFilter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbsctractExtractoreFilter.java 11 Jul 2005 10:03:17 -0000 1.1
+++ AbsctractExtractoreFilter.java 11 Jul 2005 12:31:12 -0000 1.2
@@ -1,14 +1,15 @@
package com.jahia.clipping.web.html.Impl.ExtractorFilter;
-import com.jahia.clipping.web.html.*;
import java.util.*;
+import com.jahia.clipping.web.html.*;
+
/**
* Description of the Class
*
[EMAIL PROTECTED] Tlili Khaled
*/
public abstract class AbsctractExtractoreFilter implements ExtractorFilter {
- private Hashtable map = new Hashtable();
+ private Map keyMap = new Hashtable();
/**
@@ -18,7 +19,17 @@
[EMAIL PROTECTED] The KeyValue value
*/
public String getKeyPart(String name) {
- return (String) map.get(name);
+ return (String) keyMap.get(name);
+ }
+
+
+ /**
+ * Gets the KeyMap attribute of the AbsctractExtractoreFilter object
+ *
+ [EMAIL PROTECTED] The KeyMap value
+ */
+ public Map getKeyMap() {
+ return keyMap;
}
@@ -30,6 +41,6 @@
[EMAIL PROTECTED] value The feature to be added to the Key attribute
*/
public void addKeyPart(String name, String value) {
- map.put(name, value);
+ keyMap.put(name, value);
}
}
Index: ChewExtractorFilter.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/ExtractorFilter/ChewExtractorFilter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ChewExtractorFilter.java 11 Jul 2005 10:03:17 -0000 1.2
+++ ChewExtractorFilter.java 11 Jul 2005 12:31:12 -0000 1.3
@@ -3,22 +3,25 @@
import com.jahia.clipping.web.Constant.*;
import com.jahia.clipping.web.html.*;
import org.htmlparser.*;
+import com.jahia.clipping.util.*;
import org.htmlparser.tags.*;
import com.jahia.clipping.web.html.Impl.ExtractorFilter.util.*;
+import org.apache.log4j.Logger;
+
/**
* Description of the Class
*
[EMAIL PROTECTED] Tlili Khaled
*/
public class ChewExtractorFilter extends AbsctractExtractoreFilter {
- private String key;
private int mode;
+
/**
* Description of the Field
*/
private final String NAME = "ChewExtractorFilter";
- private final String CHEW_ID = "chewId";
- private final String CHEW_TAG_TARGET = "chewTag";
+ private final String CHEW_HASH = "chewId";
+ private final String CHEW_TAG_NAME = "chewTagName";
/**
* Description of the Field
*/
@@ -33,35 +36,34 @@
}
+
/**
- * Constructor for the FormExtractorFilter object
+ * Sets the Mode attribute of the ChewExtractorFilter object
*
- [EMAIL PROTECTED] tableId Description of Parameter
+ [EMAIL PROTECTED] mode The new Mode value
*/
- public ChewExtractorFilter(String tableId) {
- String key = tableId;
- addKeyPart(key);
+ public void setMode(int mode) {
+ this.mode = mode;
}
-
/**
- * Sets the Key attribute of the HTMLFilter object
+ * Sets the HashKey attribute of the ChewExtractorFilter object
*
- [EMAIL PROTECTED] key The new Key value
+ [EMAIL PROTECTED] hashKey The new HashKey value
*/
- public void addKeyPart(String key) {
- this.key = key;
+ public void setHashKey(String hashKey) {
+ addKeyPart(this.CHEW_HASH, hashKey);
}
/**
- * Sets the Mode attribute of the ChewExtractorFilter object
+ * Sets the TagNameKey attribute of the ChewExtractorFilter object
*
- [EMAIL PROTECTED] mode The new Mode value
+ [EMAIL PROTECTED] tagNameKey The new TagNameKey value
*/
- public void setMode(int mode) {
- this.mode = mode;
+ public void setTagNameKey(String tagNameKey) {
+ addKeyPart(CHEW_TAG_NAME, tagNameKey);
}
@@ -86,7 +88,7 @@
String selectedPart = "SelectePart Not found";
String html = doc.getTransformedDocumentAsString();
String encoded = doc.getCharEncoding();
- Parser parser = Parser.createParser(html,encoded);
+ Parser parser = Parser.createParser(html, encoded);
ChewBuilderVisitor visitor = new ChewBuilderVisitor();
try {
logger.debug("build selected part");
@@ -112,22 +114,32 @@
/**
- * Gets the KeyPart attribute of the HTMLFilter object
+ * Gets the Mode attribute of the ChewExtractorFilter object
*
- [EMAIL PROTECTED] The KeyPart value
+ [EMAIL PROTECTED] The Mode value
*/
- public String getKeyPart() {
- return key;
+ public int getMode() {
+ return mode;
}
/**
- * Gets the Mode attribute of the ChewExtractorFilter object
+ * Gets the HashKey attribute of the ChewExtractorFilter object
*
- [EMAIL PROTECTED] The Mode value
+ [EMAIL PROTECTED] The HashKey value
*/
- public int getMode() {
- return mode;
+ public String getHashKey() {
+ return getKeyPart(CHEW_HASH);
+ }
+
+
+ /**
+ * Gets the TagNameKey attribute of the ChewExtractorFilter object
+ *
+ [EMAIL PROTECTED] The TagNameKey value
+ */
+ public String getTagNameKey() {
+ return getKeyPart(CHEW_TAG_NAME);
}
@@ -190,33 +202,30 @@
/**
* Description of the Method
- *
- [EMAIL PROTECTED] tag Description of Parameter
- [EMAIL PROTECTED] Exception Description of Exception
*/
- /*private void processCssMode(Tag tag) throws Exception {
- if (count == 0) {
- setFirstNode(tag);
- }
- String visibility = "visibility: visible;";
- String position = "position:absolute;left:0px;top:0px;";
- if (tag instanceof TableTag) {
- if (countChewTag ==
Integer.parseInt(getKeyPart())) {
- //firstNode = tag;
- setStyleAndPosition(tag, visibility,
position);
- }
- else {
- setChildrenVisibilityAndPosition(tag,
count);
- }
- countChewTag++;
- }
- else {
- setChildrenVisibilityAndPosition(tag, count);
- }
- count++;
- }*/
-
-
+ /*
+ * private void processCssMode(Tag tag) throws Exception {
+ * if (count == 0) {
+ * setFirstNode(tag);
+ * }
+ * String visibility = "visibility: visible;";
+ * String position = "position:absolute;left:0px;top:0px;";
+ * if (tag instanceof TableTag) {
+ * if (countChewTag == Integer.parseInt(getKeyPart())) {
+ * //firstNode = tag;
+ * setStyleAndPosition(tag, visibility, position);
+ * }
+ * else {
+ * setChildrenVisibilityAndPosition(tag, count);
+ * }
+ * countChewTag++;
+ * }
+ * else {
+ * setChildrenVisibilityAndPosition(tag, count);
+ * }
+ * count++;
+ * }
+ */
/**
* Description of the Method
*
@@ -224,9 +233,14 @@
[EMAIL PROTECTED] Exception Description of Exception
*/
private void processViewMode(Tag tag) throws Exception {
- if (tag instanceof TableTag) {
- if (countChewTag ==
Integer.parseInt(getKeyPart())) {
- //firstNode = tag;
+ String tagName = getTagNameKey();
+ if (tagName == null || tagName.equalsIgnoreCase("")) {
+ logger.debug("Tag name key is null");
+ }
+ if (tag.getTagName().equalsIgnoreCase(getTagNameKey()))
{
+ String idAtt = tag.getAttribute("id");
+ String hash =
HashUtilities.buildTableHash(idAtt, countChewTag);
+ if (hash.equalsIgnoreCase(getHashKey())) {
setFirstNode(tag);
}
countChewTag++;
Index: ChewBuilderVisitor.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/HTMLParser/ChewBuilderVisitor.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ChewBuilderVisitor.java 11 Jul 2005 09:49:14 -0000 1.6
+++ ChewBuilderVisitor.java 11 Jul 2005 12:31:12 -0000 1.7
@@ -1,11 +1,13 @@
package com.jahia.clipping.web.html.Impl.HTMLParser;
+import javax.swing.text.html.*;
+
+import com.jahia.clipping.util.*;
import org.htmlparser.*;
+import org.htmlparser.Tag;
import org.htmlparser.tags.*;
import org.htmlparser.util.*;
import org.htmlparser.visitors.*;
-import javax.swing.text.html.*;
-import com.jahia.clipping.util.HashUtilities;
//import org.apache.ecs.html.*;
@@ -19,6 +21,7 @@
private int countTable = 0;
private Node firstNode = null;
private HTMLParserTransformer transformer;
+ private String tagName;
private static final String TABLE_ID = "chewWenClip";
private static org.apache.log4j.Logger logger =
org.apache.log4j.Logger.getLogger(ChewBuilderVisitor.class);
@@ -44,6 +47,16 @@
/**
+ * Sets the TagName attribute of the ChewBuilderVisitor object
+ *
+ [EMAIL PROTECTED] tagName The new TagName value
+ */
+ public void setTagName(String tagName) {
+ this.tagName = tagName;
+ }
+
+
+ /**
* Gets the FirstNode attribute of the ChewBuilderVisitor object
*
[EMAIL PROTECTED] The FirstNode value
@@ -54,6 +67,16 @@
/**
+ * Gets the TagName attribute of the ChewBuilderVisitor object
+ *
+ [EMAIL PROTECTED] The TagName value
+ */
+ public String getTagName() {
+ return tagName;
+ }
+
+
+ /**
* Description of the Method
*
[EMAIL PROTECTED] tag Description of Parameter
@@ -63,7 +86,7 @@
if (count == 0) {
setFirstNode(tag);
}
- if (tag instanceof TableTag) {
+ if (tag.getTagName().equalsIgnoreCase(getTagName())) {
TableTag ttag = (TableTag) tag;
logger.debug("Visit Table Tag");
NodeList list = ttag.getChildren();
Index: HTMLParserDocument.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/HTMLParser/HTMLParserDocument.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- HTMLParserDocument.java 7 Jul 2005 08:37:23 -0000 1.7
+++ HTMLParserDocument.java 11 Jul 2005 12:31:12 -0000 1.8
@@ -104,12 +104,11 @@
/**
* Gets the ChewDocumentAsString attribute of the HTMLDocument object
*
- [EMAIL PROTECTED] The ChewDocumentAsString value
+ [EMAIL PROTECTED] tagName Description of Parameter
+ [EMAIL PROTECTED] The ChewDocumentAsString value
*/
- public String getChewDocumentAsString() {
- if (getChewDocument() == null) {
- getTransformer().buildChewDocument();
- }
+ public String getChewDocumentAsString(String tagName) {
+ getTransformer().buildChewDocument(tagName);
return getDocumentAsString(getChewDocument());
}
Index: HTMLParserTransformer.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/HTMLParser/HTMLParserTransformer.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- HTMLParserTransformer.java 5 Jul 2005 06:49:42 -0000 1.14
+++ HTMLParserTransformer.java 11 Jul 2005 12:31:12 -0000 1.15
@@ -48,7 +48,7 @@
[EMAIL PROTECTED] metaEncoding The new MetaEncoding value
*/
public void setMetaEncoding(String metaEncoding) {
- getDocument().setCharEncoding(metaEncoding);
+ getDocument().setCharEncoding(metaEncoding);
}
@@ -79,20 +79,22 @@
[EMAIL PROTECTED] The MetaEncoding value
*/
public String getMetaEncoding() {
- return getDocument().getCharEncoding();
-
+ return getDocument().getCharEncoding();
}
/**
* Build chew document
+ *
+ [EMAIL PROTECTED] tagName Description of Parameter
*/
- public void buildChewDocument() {
+ public void buildChewDocument(String tagName) {
logger.debug("build chew document");
getDocument().setChewDocument("<p> Method not yet implemented
!!!</p>");
String charSet = getMetaEncoding();
Parser parser =
Parser.createParser(getDocument().getTransformedDocumentAsString(), charSet);
ChewBuilderVisitor visitor = new ChewBuilderVisitor(this);
+ visitor.setTagName(tagName);
try {
parser.visitAllNodesWith(visitor);
String chew = visitor.getFirstNode().toHtml();
@@ -110,7 +112,8 @@
* Build document whith label param
*/
public void buildDocumentWhithLabel() {
- String charSet = getMetaEncoding();;
+ String charSet = getMetaEncoding();
+ ;
Parser parser =
Parser.createParser(getDocument().getTransformedDocumentAsString(), charSet);
LabelBuilderVisitor visitor = new LabelBuilderVisitor(this);
try {
@@ -151,11 +154,11 @@
}
parser.visitAllNodesWith(visitor);
transformedHTML = visitor.getFirstNode().toHtml();
- String charSet = getMetaEncoding();
- if(charSet == null){
- charSet = WebConstants.ENCODING_ISO;
- setMetaEncoding(charSet);
- }
+ String charSet = getMetaEncoding();
+ if (charSet == null) {
+ charSet = WebConstants.ENCODING_ISO;
+ setMetaEncoding(charSet);
+ }
getDocument().setTransformedDocument(new
String(transformedHTML.getBytes(), charSet));
}
@@ -177,11 +180,11 @@
try {
parser.visitAllNodesWith(visitor);
String userHTML = visitor.getFirstNode().toHtml();
- charSet = getMetaEncoding();
- if(charSet == null){
- charSet = WebConstants.ENCODING_ISO;
- setMetaEncoding(charSet);
- }
+ charSet = getMetaEncoding();
+ if (charSet == null) {
+ charSet = WebConstants.ENCODING_ISO;
+ setMetaEncoding(charSet);
+ }
getDocument().setUserDocument(new
String(userHTML.getBytes(), charSet));
}
catch (Exception ex) {
Index: JDomHTMLDocument.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/JDom/JDomHTMLDocument.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- JDomHTMLDocument.java 5 Jul 2005 08:57:06 -0000 1.9
+++ JDomHTMLDocument.java 11 Jul 2005 12:31:12 -0000 1.10
@@ -171,8 +171,8 @@
*
[EMAIL PROTECTED] The ChewDocumentAsString value
*/
- public String getChewDocumentAsString() {
- return getDocumentAsString(getChewDocument());
+ public String getChewDocumentAsString(String tagName) {
+ return getDocumentAsString(getChewDocument(tagName));
}
@@ -350,9 +350,9 @@
*
[EMAIL PROTECTED] The ChewDocument value
*/
- protected org.jdom.Document getChewDocument() {
+ protected org.jdom.Document getChewDocument(String tagName) {
if (this.chewDocument == null) {
- getTransformer().buildChewDocument();
+ getTransformer().buildChewDocument(tagName);
}
return chewDocument;
}
Index: JDomHTMLTransformer.java
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/java/com/jahia/clipping/web/html/Impl/JDom/JDomHTMLTransformer.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- JDomHTMLTransformer.java 11 Jul 2005 09:49:15 -0000 1.15
+++ JDomHTMLTransformer.java 11 Jul 2005 12:31:12 -0000 1.16
@@ -220,7 +220,7 @@
/**
* Description of the Method
*/
- public void buildChewDocument() {
+ public void buildChewDocument(String tagName) {
logger.debug("[ Begin chew transform ]");
//prepare the original document (rewriting url and extract the
css)
Index: selectPartAction.jsp
===================================================================
RCS file:
/home/cvs/repository/webclip_builder/war/src/webapp/jsp/actions/selectPartAction.jsp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- selectPartAction.jsp 23 Jun 2005 16:15:52 -0000 1.4
+++ selectPartAction.jsp 11 Jul 2005 12:31:13 -0000 1.5
@@ -46,7 +46,15 @@
f.submit();
return;
}
-</script><table align="center" width="100%">
+</script><%
+ String options = "\n";
+ javax.swing.text.html.HTML.Tag[] tags =
javax.swing.text.html.HTML.getAllTags();
+ for (int i = 0; i < tags.length; i++) {
+ String name = tags[i].toString();
+ options = options+"\n" + "<option value=" + name + " > " + name +
"</option>";
+ }
+%>
+<table align="center" width="100%">
<html:form action="selectPart">
<html:hidden property="selectedContent"/>
<!-- Header -->
@@ -106,6 +114,7 @@
</td>
<!-- Selecting the type of the content-->
<logic:equal name="selectPartForm" value="0"
property="clippingMethod">
+ <!-- case: manual-->
<td class="topmenugreen bold waBG">
<bean:message key="select.typeContent"/>
<html:select property="webClippingTypeContent" size="1"
value="0">
@@ -118,6 +127,15 @@
</html:select>
</td>
</logic:equal>
+ <logic:equal name="selectPartForm" value="1"
property="clippingMethod">
+ <!-- case: chew-->
+ <td class="topmenugreen bold waBG">
+ <bean:message key="select.tagName"/>
+ <html:select property="webClippingTagName" size="1" value="0">
+ <%=options %>
+ </html:select>
+ </td>
+ </logic:equal>
</tr>
</table>
</html:form>