1 package org.jahia.clipbuilder.html.web.html.Impl.ExtractorFilter; 2 3 import org.jahia.clipbuilder.html.web.html.*; 4 5 10 public class SimpleExtractorFilter extends AbsctractExtractoreFilter { 11 private String selectedPart; 12 private final String NAME = "SimpleExtractorFilter"; 13 14 15 20 public SimpleExtractorFilter(String key) { 21 super("SimpleExtractorFilter"); 22 addKeyPart(key); 23 } 24 25 26 29 public SimpleExtractorFilter() { 30 super("SimpleExtractorFilter"); 31 32 } 33 34 35 40 public void setSelectedPart(String selectedPart) { 41 this.selectedPart = selectedPart; 42 } 43 44 45 46 51 public String getName() { 52 return NAME.toString(); 53 } 54 55 56 57 62 public String getKeyPart() { 63 return this.selectedPart; 64 } 65 66 67 74 public String getSelectedPart(HTMLDocument doc, int action) { 75 String selectedPart = ""; 76 String encoded = ""; 77 String html = ""; 78 if (action == ACTION_BUILD_KEY_PART) { 79 html = doc.getTransformedDocumentAsString(); 81 } 82 else if (action == ACTION_RETRIEVE_SELECTED_PART) { 83 html = doc.getUserDocumentAsString(); 85 } 86 87 return selectedPart; 88 } 89 90 91 92 97 public void addKeyPart(String key) { 98 this.setSelectedPart(key); 99 } 100 101 } 102 | Popular Tags |