Some documentation added to the PublicationExportLink component.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2102 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2013-03-21 20:31:25 +00:00
parent dd37a275c4
commit 48023b8f55
1 changed files with 17 additions and 6 deletions

View File

@ -9,20 +9,31 @@ import com.arsdigita.xml.Element;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.List; import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
/** /**
* * This component creates export links for all publications in a category. The export works with the descendCategories
* parameter set to true and false. Filters from a {@link CustomizableObjectList} are also supported. To add the
* component add the following to your JSP template:
*
* <pre>
* <define:component name="publicationExportLinks"
* classname="com.arsdigita.cms.scipublications.ui.PublicationExportLinks"/>
* <jsp:scriptlet>
* ((com.arsdigita.cms.scipublications.ui.PublicationExportLinks)publicationExportLinks).setObjList(objList);
* </jsp:scriptlet>
* </pre>
*
* {@code objList} is to be supposed the name of variable for the object list in the template.
*
* @author Jens Pelzetter <jens@jp-digital.de> * @author Jens Pelzetter <jens@jp-digital.de>
* @version $Id$ * @version $Id$
*/ */
public class PublicationExportLinks extends AbstractComponent { public class PublicationExportLinks extends AbstractComponent {
private CustomizableObjectList objList; private CustomizableObjectList objList;
public Element generateXML(final HttpServletRequest request, public Element generateXML(final HttpServletRequest request,
final HttpServletResponse response) { final HttpServletResponse response) {
@ -41,7 +52,7 @@ public class PublicationExportLinks extends AbstractComponent {
public void setObjList(final CustomizableObjectList objList) { public void setObjList(final CustomizableObjectList objList) {
this.objList = objList; this.objList = objList;
} }
private void createExportLink(final PublicationFormat format, private void createExportLink(final PublicationFormat format,
final Element parent, final Element parent,
final Category category) { final Category category) {
@ -59,7 +70,7 @@ public class PublicationExportLinks extends AbstractComponent {
filterSqlElem.setText(""); filterSqlElem.setText("");
} }
final Element desCatsElem = exportLinkElem.newChildElement("descendCategories"); final Element desCatsElem = exportLinkElem.newChildElement("descendCategories");
if (objList.getDefinition().getDescendCategories()) { if (objList.getDefinition().getDescendCategories()) {
desCatsElem.setText("true"); desCatsElem.setText("true");
} else { } else {
desCatsElem.setText("false"); desCatsElem.setText("false");