[OFBiz] SVN: r6821 - in trunk/applications/content: entitydef servicedef src/org/ofbiz/content/openoffice widget/compdoc

byersa@svn.ofbiz.org byersa at svn.ofbiz.org
Wed Feb 22 03:02:50 CST 2006


Author: byersa
Date: 2006-02-22 03:02:42 -0600 (Wed, 22 Feb 2006)
New Revision: 6821

Added:
   trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeEvents.java
Modified:
   trunk/applications/content/entitydef/entitymodel.xml
   trunk/applications/content/servicedef/services.xml
   trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java
   trunk/applications/content/widget/compdoc/CompDocForms.xml
   trunk/applications/content/widget/compdoc/CompDocScreens.xml
Log:
Added renderCompDocPdf and renderContentPdf services but have not tested them.
renderContentPdf is NOT called by renderCompDocPdf because I did not know what the
side-effects of getting the XMultiComponentFactory object multiple times would be.

Also added an OpenOfficeEvents.genCompDocPdf method to call renderCompDocPdf and
stream the resulting byteWrapper via response.


Modified: trunk/applications/content/entitydef/entitymodel.xml
===================================================================
--- trunk/applications/content/entitydef/entitymodel.xml	2006-02-22 07:32:33 UTC (rev 6820)
+++ trunk/applications/content/entitydef/entitymodel.xml	2006-02-22 09:02:42 UTC (rev 6821)
@@ -1448,6 +1448,7 @@
       <member-entity entity-alias="CRI" entity-name="ContentRevisionItem"/>
       <member-entity entity-alias="CA" entity-name="ContentAssoc"/>
       <alias entity-alias="C" name="instanceOfContentId" group-by="true"/>
+      <alias entity-alias="C" name="dataResourceId" group-by="true"/>
       <alias entity-alias="CA" name="contentId" group-by="true"/>
       <alias entity-alias="CA" name="contentIdTo" group-by="true"/>
       <alias entity-alias="CA" name="contentAssocTypeId" group-by="true"/>

Modified: trunk/applications/content/servicedef/services.xml
===================================================================
--- trunk/applications/content/servicedef/services.xml	2006-02-22 07:32:33 UTC (rev 6820)
+++ trunk/applications/content/servicedef/services.xml	2006-02-22 09:02:42 UTC (rev 6821)
@@ -1374,4 +1374,30 @@
         <attribute name="thisUserLogin" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
         <attribute name="contentApprovalList" type="List" mode="OUT" optional="true"/>
     </service>
+    
+    <service name="renderCompDocPdf" engine="java"
+        location="org.ofbiz.content.openoffice.OpenOfficeEvents"
+        invoke="genCompDocPdf" auth="true">
+        <description>Convert all the CompDoc parts into PDF and concatenate and put in CMS</description>
+        <attribute name="contentId" type="String" mode="IN" optional="false"/>
+        <attribute name="contentRevisionSeqId" type="String" mode="IN" optional="false"/>
+        <attribute name="webSiteId" type="String" mode="IN" optional="true"/>
+        <attribute name="https" type="String" mode="IN" optional="true"/>
+        <attribute name="rootDir" type="String" mode="IN" optional="true"/>
+        <attribute name="locale" type="java.util.Locale" mode="IN" optional="true"/>
+        <attribute name="pdfByteWrapper" type="org.ofbiz.entity.util.ByteWrapper" mode="OUT" optional="false"/>
+    </service>
+    
+    <service name="renderContentPdf" engine="java"
+        location="org.ofbiz.content.openoffice.OpenOfficeEvents"
+        invoke="genContentPdf" auth="true">
+        <description>Convert all the CompDoc parts into PDF and concatenate and put in CMS</description>
+        <attribute name="contentId" type="String" mode="IN" optional="false"/>
+        <attribute name="contentRevisionSeqId" type="String" mode="IN" optional="false"/>
+        <attribute name="webSiteId" type="String" mode="IN" optional="true"/>
+        <attribute name="https" type="String" mode="IN" optional="true"/>
+        <attribute name="rootDir" type="String" mode="IN" optional="true"/>
+        <attribute name="locale" type="java.util.Locale" mode="IN" optional="true"/>
+        <attribute name="pdfByteWrapper" type="org.ofbiz.entity.util.ByteWrapper" mode="OUT" optional="false"/>
+    </service>
 </services>

Added: trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeEvents.java
===================================================================
--- trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeEvents.java	2006-02-22 07:32:33 UTC (rev 6820)
+++ trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeEvents.java	2006-02-22 09:02:42 UTC (rev 6821)
@@ -0,0 +1,75 @@
+package org.ofbiz.content.openoffice;
+
+import java.util.Locale;
+import java.util.Map;
+import java.util.HashMap;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.servlet.ServletContext;
+
+import org.ofbiz.base.util.UtilHttp;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.util.ByteWrapper;
+import org.ofbiz.service.LocalDispatcher;
+import org.ofbiz.service.GenericServiceException;
+import org.ofbiz.service.ServiceUtil;
+
+public class OpenOfficeEvents {
+
+    public static final String module = OpenOfficeServices.class.getName();
+
+    public static String genCompDocPdf(HttpServletRequest request, HttpServletResponse response) {
+        String responseStr = "success";
+        ByteWrapper byteWrapper = null;
+        HttpSession session = request.getSession();
+        ServletContext servletContext = session.getServletContext();
+        LocalDispatcher dispatcher = (LocalDispatcher)request.getAttribute("dispatcher");
+        Map paramMap = UtilHttp.getParameterMap(request);
+        String contentId = (String)paramMap.get("contentId");
+        Locale locale = UtilHttp.getLocale(request);
+        String rootDir = null;
+        String webSiteId = null;
+        String https = null;
+        
+        if (UtilValidate.isEmpty(rootDir)) {
+            rootDir = servletContext.getRealPath("/");
+        }
+        if (UtilValidate.isEmpty(webSiteId)) {
+            webSiteId = (String) servletContext.getAttribute("webSiteId");
+        }
+        if (UtilValidate.isEmpty(https)) {
+            https = (String) servletContext.getAttribute("https");
+        }
+        
+        Map mapIn = new HashMap();
+        mapIn.put("contentId", contentId);
+        mapIn.put("locale", locale);
+        mapIn.put("rootDir", rootDir);
+        mapIn.put("webSiteId", webSiteId);
+        mapIn.put("https", https);
+        
+        Map results = null;
+        try {
+            results = dispatcher.runSync("renderCompDocPdf", mapIn);
+        } catch(GenericServiceException e) {
+            ServiceUtil.returnError(e.getMessage());
+        }
+        
+        ByteWrapper pdfByteWrapper = (ByteWrapper)results.get("pdfByteWrapper");
+
+        // setup content type
+        String contentType = "application/pdf; charset=ISO-8859-1";
+
+        ByteArrayInputStream bais = new ByteArrayInputStream(pdfByteWrapper.getBytes());
+        try {
+            UtilHttp.streamContentToBrowser(response, bais, pdfByteWrapper.getLength(), contentType);
+        } catch(IOException e) {
+            
+        }
+        return responseStr;
+    }
+}

Modified: trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java
===================================================================
--- trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java	2006-02-22 07:32:33 UTC (rev 6820)
+++ trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java	2006-02-22 09:02:42 UTC (rev 6821)
@@ -36,15 +36,21 @@
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.StringTokenizer;
+import java.sql.Timestamp;
+import javax.servlet.ServletContext;
+
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilDateTime;
 import org.ofbiz.base.util.UtilHttp;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.content.data.DataResourceWorker;
 import org.ofbiz.entity.GenericDelegator;
+import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entity.util.ByteWrapper;
 import org.ofbiz.entity.condition.EntityConditionList;
@@ -53,6 +59,7 @@
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.service.ServiceUtil;
+import org.ofbiz.webapp.view.ViewHandlerException;
 
 import com.sun.star.beans.PropertyValue;
 import com.sun.star.beans.XPropertySet;
@@ -70,6 +77,24 @@
 import com.sun.star.lang.XMultiServiceFactory;
 import com.sun.star.container.XNameAccess;
 
+import com.lowagie.text.pdf.AcroFields;
+import com.lowagie.text.pdf.PdfStamper;
+import com.lowagie.text.pdf.PRAcroForm;
+import com.lowagie.text.pdf.PRIndirectReference;
+import com.lowagie.text.pdf.PdfArray;
+import com.lowagie.text.pdf.PdfDictionary;
+import com.lowagie.text.pdf.PdfLister;
+import com.lowagie.text.pdf.PdfName;
+import com.lowagie.text.pdf.PdfObject;
+import com.lowagie.text.pdf.PdfReader;
+import com.lowagie.text.pdf.PdfString;
+import com.lowagie.text.DocumentException;
+import com.lowagie.text.pdf.PdfWriter;
+import com.lowagie.text.pdf.PdfContentByte;
+import com.lowagie.text.pdf.PdfImportedPage;
+import com.lowagie.text.Document;
+import com.lowagie.text.Rectangle;
+
 /**
  * OpenOfficeServices Class
  * 
@@ -330,5 +355,185 @@
         return results;
 
     }
-    	
+    
+    /**
+     * Use OpenOffice to convert documents between types
+     */
+    public static Map renderCompDocPdf(DispatchContext dctx, Map context) {
+        
+        Map results = ServiceUtil.returnSuccess();
+        String dataResourceId = null;
+        ByteWrapper byteWrapper = null;
+        
+        Locale locale = (Locale)context.get("locale");
+        String rootDir = (String)context.get("rootDir");
+        String webSiteId = (String)context.get("webSiteId");
+        String https = (String)context.get("https");
+        
+        XMultiComponentFactory xmulticomponentfactory = null;
+        GenericDelegator delegator = dctx.getDelegator();
+        
+        String contentId = (String)context.get("contentId");
+        String contentRevisionSeqId = (String)context.get("contentRevisionSeqId");
+        String oooHost = (String)context.get("oooHost");
+        if (UtilValidate.isEmpty(oooHost)) oooHost = "localhost";
+        String oooPort = (String)context.get("oooPort");
+        if (UtilValidate.isEmpty(oooPort)) oooPort = "8100";
+        
+        try {   
+            xmulticomponentfactory = OpenOfficeWorker.getRemoteServer(oooHost, oooPort);
+            Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
+            List exprList = new ArrayList();
+            EntityExpr entityExpr = null;
+            entityExpr = new EntityExpr("contentIdTo", EntityOperator.EQUALS, contentId);
+            exprList.add(entityExpr);
+            entityExpr = new EntityExpr("rootRevisionContentId", EntityOperator.EQUALS, contentId);
+            exprList.add(entityExpr);
+            if (UtilValidate.isNotEmpty(contentRevisionSeqId)) {
+                entityExpr = new EntityExpr("contentRevisionSeqId", EntityOperator.LESS_THAN_EQUAL_TO, contentRevisionSeqId);
+                exprList.add(entityExpr);
+            }
+            entityExpr = new EntityExpr("contentAssocTypeId", EntityOperator.EQUALS, "COMPDOC_PART");
+            exprList.add(entityExpr);
+            entityExpr = new EntityExpr("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, nowTimestamp);
+            exprList.add(entityExpr);
+            List thruList = new ArrayList();
+            entityExpr = new EntityExpr("thruDate", EntityOperator.EQUALS, null);
+            thruList.add(entityExpr);
+            entityExpr = new EntityExpr("thruDate", EntityOperator.GREATER_THAN, nowTimestamp);
+            thruList.add(entityExpr);
+            EntityConditionList conditionThruList = new EntityConditionList(thruList, EntityOperator.OR);
+            exprList.add(conditionThruList);
+            EntityConditionList conditionList = new EntityConditionList(exprList, EntityOperator.AND);
+            String [] fields = {"rootRevisionContentId", "itemContentId", "maxRevisionSeqId", "contentId", "dataResourceId", "contentIdTo", "contentAssocTypeId", "fromDate", "sequenceNum"};
+            List selectFields = UtilMisc.toListArray(fields);
+            List compDocParts = delegator.findByCondition("ContentAssocRevisionItemView", conditionList, selectFields, null);
+            
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            Document document = new Document(new Rectangle(60, 120));
+            PdfWriter writer = PdfWriter.getInstance(document, baos);
+            document.open();
+            PdfContentByte cb = writer.getDirectContent();
+            Iterator iter = compDocParts.iterator();
+            while (iter.hasNext()) {
+                GenericValue contentAssocRevisionItemView = (GenericValue)iter.next();
+                String thisContentId = contentAssocRevisionItemView.getString("contentId");
+                String thisContentRevisionSeqId = contentAssocRevisionItemView.getString("maxRevisionSeqId");
+                String thisDataResourceId = contentAssocRevisionItemView.getString("dataResourceId");
+                GenericValue dataResource = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId));
+                String inputMimeType = null;
+                if(dataResource != null) {
+                    inputMimeType = (String)dataResource.getString("mimeTypeId");
+                }
+                byteWrapper = DataResourceWorker.getContentAsByteWrapper(delegator, dataResourceId, https, webSiteId, locale, rootDir);
+                OpenOfficeByteArrayInputStream oobais = new OpenOfficeByteArrayInputStream(byteWrapper.getBytes());
+                OpenOfficeByteArrayOutputStream oobaos = OpenOfficeWorker.convertOODocByteStreamToByteStream(xmulticomponentfactory, oobais, inputMimeType, "application/pdf");
+                PdfReader reader = new PdfReader(oobaos.toByteArray());
+                int n = reader.getNumberOfPages();
+                for (int i=0; i < n; i++) {
+                    PdfImportedPage pg = writer.getImportedPage(reader, i);
+                    cb.addTemplate(pg, .5f, 0, 0, .5f, 60, 120);
+                }
+                oobais.close();
+                oobaos.close();
+            }
+            ByteWrapper outByteWrapper = new ByteWrapper(baos.toByteArray());
+            results.put("pdfByteWrapper", outByteWrapper);
+        } catch (GenericEntityException e) {
+           ServiceUtil.returnError(e.getMessage());
+        } catch (IOException ioe) {
+            ioe.printStackTrace();
+           ServiceUtil.returnError(ioe.getMessage());
+        } catch( Exception e2 ) {
+            e2.printStackTrace();
+            ServiceUtil.returnError(e2.getMessage());
+        }
+        System.out.println("xmulticomponentfactory: " + xmulticomponentfactory);
+        return results;
+
+    }
+
+    
+    /**
+     * Use OpenOffice to convert documents between types
+     */
+    public static Map renderContentPdf(DispatchContext dctx, Map context) {
+        
+        Map results = ServiceUtil.returnSuccess();
+        String dataResourceId = null;
+        ByteWrapper byteWrapper = null;
+        
+        Locale locale = (Locale)context.get("locale");
+        String rootDir = (String)context.get("rootDir");
+        String webSiteId = (String)context.get("webSiteId");
+        String https = (String)context.get("https");
+        
+        XMultiComponentFactory xmulticomponentfactory = null;
+        GenericDelegator delegator = dctx.getDelegator();
+        
+        String contentId = (String)context.get("contentId");
+        String contentRevisionSeqId = (String)context.get("contentRevisionSeqId");
+        String oooHost = (String)context.get("oooHost");
+        if (UtilValidate.isEmpty(oooHost)) oooHost = "localhost";
+        String oooPort = (String)context.get("oooPort");
+        if (UtilValidate.isEmpty(oooPort)) oooPort = "8100";
+        
+        try {   
+            xmulticomponentfactory = OpenOfficeWorker.getRemoteServer(oooHost, oooPort);
+            Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            Document document = new Document(new Rectangle(60, 120));
+            PdfWriter writer = PdfWriter.getInstance(document, baos);
+            document.open();
+            PdfContentByte cb = writer.getDirectContent();
+
+            GenericValue dataResource = delegator.findByPrimaryKey("DataResource", UtilMisc.toMap("dataResourceId", dataResourceId));
+            if (UtilValidate.isEmpty(contentRevisionSeqId)) {
+                GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId));
+                dataResourceId = content.getString("dataResourceId");
+                Debug.logInfo("SCVH(0b)- dataResourceId:" + dataResourceId, module);
+             } else {
+                GenericValue contentRevisionItem = delegator.findByPrimaryKeyCache("ContentRevisionItem", UtilMisc.toMap("contentId", contentId, "itemContentId", contentId, "contentRevisionSeqId", contentRevisionSeqId));
+                if (contentRevisionItem == null) {
+                    throw new ViewHandlerException("ContentRevisionItem record not found for contentId=" + contentId
+                                                   + ", contentRevisionSeqId=" + contentRevisionSeqId + ", itemContentId=" + contentId);
+                }
+                Debug.logInfo("SCVH(1)- contentRevisionItem:" + contentRevisionItem, module);
+                Debug.logInfo("SCVH(2)-contentId=" + contentId
+                        + ", contentRevisionSeqId=" + contentRevisionSeqId + ", itemContentId=" + contentId, module);
+                dataResourceId = contentRevisionItem.getString("newDataResourceId");
+                Debug.logInfo("SCVH(3)- dataResourceId:" + dataResourceId, module);
+            }
+            String inputMimeType = null;
+            if(dataResource != null) {
+                inputMimeType = (String)dataResource.getString("mimeTypeId");
+            }
+            byteWrapper = DataResourceWorker.getContentAsByteWrapper(delegator, dataResourceId, https, webSiteId, locale, rootDir);
+            OpenOfficeByteArrayInputStream oobais = new OpenOfficeByteArrayInputStream(byteWrapper.getBytes());
+            OpenOfficeByteArrayOutputStream oobaos = OpenOfficeWorker.convertOODocByteStreamToByteStream(xmulticomponentfactory, oobais, inputMimeType, "application/pdf");
+            PdfReader reader = new PdfReader(oobaos.toByteArray());
+            int n = reader.getNumberOfPages();
+            for (int i=0; i < n; i++) {
+                PdfImportedPage pg = writer.getImportedPage(reader, i);
+                cb.addTemplate(pg, .5f, 0, 0, .5f, 60, 120);
+            }
+            oobais.close();
+            oobaos.close();
+            
+            ByteWrapper outByteWrapper = new ByteWrapper(baos.toByteArray());
+            results.put("pdfByteWrapper", outByteWrapper);
+        } catch (GenericEntityException e) {
+           ServiceUtil.returnError(e.getMessage());
+        } catch (IOException ioe) {
+            ioe.printStackTrace();
+           ServiceUtil.returnError(ioe.getMessage());
+        } catch( Exception e2 ) {
+            e2.printStackTrace();
+            ServiceUtil.returnError(e2.getMessage());
+        }
+        System.out.println("xmulticomponentfactory: " + xmulticomponentfactory);
+        return results;
+
+    }
+
 }

Modified: trunk/applications/content/widget/compdoc/CompDocForms.xml
===================================================================
--- trunk/applications/content/widget/compdoc/CompDocForms.xml	2006-02-22 07:32:33 UTC (rev 6820)
+++ trunk/applications/content/widget/compdoc/CompDocForms.xml	2006-02-22 09:02:42 UTC (rev 6821)
@@ -75,9 +75,9 @@
         </field>
     </form>
     
-    <form name="ListCompDocTemplate" default-title-style="tableheadtext" default-tooltip-style="tabletext" 
+    <form name="ListCompDocInstances" default-title-style="tableheadtext" default-tooltip-style="tabletext" 
         default-widget-style="tabletext" title="" type="list" list-name="compDocFindList"
-        target=""  paginate-target="ListCompDocTemplate">
+        target=""  paginate-target="ListCompDocInstances">
         <field name="contentId" title="Content Id"><display/></field>
         <field name="contentName" title="Name"><display/></field>
         <field name="caContentIdTo" title="Content Id To"><display/></field>
@@ -85,10 +85,10 @@
         <field name="caFromDate" title="From Date"><display/></field>
         <field name="caThruDate"><hidden/></field>
         <field name="editTemplate" title="">
-           <hyperlink also-hidden="false" description="Edit" target="EditRootCompDocTemplate?contentId=${contentId}&amp;caContentIdTo=${caContentIdTo}&amp;caContentAssocTypeId=${caContentAssocTypeId}&amp;caFromDate=${caFromDate}"/> 
+           <hyperlink also-hidden="false" description="Edit" target="EditCompDoc?contentId=${contentId}&amp;caContentIdTo=${caContentIdTo}&amp;caContentAssocTypeId=${caContentAssocTypeId}&amp;caFromDate=${caFromDate}"/> 
         </field>
         <field name="templateTree" title="">
-            <hyperlink also-hidden="false" description="Tree" target="CompDocTemplateTree?contentId=${contentId}&amp;contentName=${contentName}"/> 
+            <hyperlink also-hidden="false" description="Tree" target="ViewCompDocInstanceTree?rootInstanceContentId=${contentId}"/> 
         </field>
     </form>
     
@@ -99,15 +99,15 @@
         <auto-fields-entity entity-name="ContentRevision"/>
         
         <field name="contentId" title="" widget-style="buttontext"><lookup target-form-name="LookupContent"/></field>
-        <field name="contentRevisionSeqId" title="" widget-style="inputBox"></field>
+        <field name="contentRevisionSeqId" title="" widget-style="inputBox"><text/></field>
 <!--         <field name="contentRevisionSeqId">
             <drop-down allow-empty="true">
                 <entity-options description="${description}" entity-name="" key-field-name="contentRevisionSeqId"/>
             </drop-down>
         </field>
 -->
-        <field name="committedByPartyId" title="" widget-style="inputBox"></field>
-        <field name="comments" title="" widget-style="inputBox"></field>
+        <field name="committedByPartyId" title="" widget-style="inputBox"><text/></field>
+        <field name="comments" title="" widget-style="inputBox"><text/></field>
         <field name="submitButton" title="${uiLabelMap.CommonSave}" widget-style="smallSubmit"><submit/></field>
     </form>
 
@@ -141,10 +141,10 @@
         <auto-fields-entity entity-name="ContentRevisionItem"/>
         
         <field name="contentId" title="" widget-style="buttontext"><lookup target-form-name="LookupContent"/></field>
-        <field name="contentRevisionSeqId" title="" widget-style="inputBox"></field>
-        <field name="itemContentId" title="" widget-style="inputBox"></field>
-        <field name="oldDataResourceId" title="" widget-style="inputBox"></field>
-        <field name="newDataResourceId" title="" widget-style="inputBox"></field>
+        <field name="contentRevisionSeqId" title="" widget-style="inputBox"><text/></field>
+        <field name="itemContentId" title="" widget-style="inputBox"><text/></field>
+        <field name="oldDataResourceId" title="" widget-style="inputBox"><text/></field>
+        <field name="newDataResourceId" title="" widget-style="inputBox"><text/></field>
         <field name="submitButton" title="${uiLabelMap.CommonSave}" widget-style="smallSubmit"><submit/></field>
     </form>
 

Modified: trunk/applications/content/widget/compdoc/CompDocScreens.xml
===================================================================
--- trunk/applications/content/widget/compdoc/CompDocScreens.xml	2006-02-22 07:32:33 UTC (rev 6820)
+++ trunk/applications/content/widget/compdoc/CompDocScreens.xml	2006-02-22 09:02:42 UTC (rev 6821)
@@ -273,6 +273,7 @@
                 <set field="currentContentMenuItemName" value="" />
                 <set field="viewIndex" from-field="requestParameters.VIEW_INDEX" type="Integer"/>
                 <set field="viewSize" from-field="requestParameters.VIEW_SIZE" type="Integer" default-value="20"/>
+                <set field="contentTypeId" value="COMPDOC_INSTANCE"/>
                 <entity-and entity-name="Content"  list-name="compDocFindList">
                     <field-map field-name="instanceOfContentId" env-name="parameters.rootTemplateContentId"/>
                     <field-map field-name="contentTypeId" value="COMPDOC_INSTANCE"/>
@@ -282,7 +283,7 @@
                 <decorator-screen name="commonCompDocDecorator" location="component://content/widget/CommonScreens.xml">
                     <decorator-section name="body">
                         <link target="AddRootCompDocTemplate?contentId=${contentId}&amp;contentRevisionSeqId=${contentRevisionSeqId}&amp;rootTemplateContentId=${rootTemplateContentId}&amp;rootTemplateRevSeqId=${rootTemplateRevSeqId}&amp;rootInstanceContentId=${rootInstanceContentId}&amp;rootInstanceRevSeqId=${rootInstanceRevSeqId}" text="Create New Root CompDoc Template" style="buttontext"/>
-                        <include-form name="ListCompDoc" location="component://content/widget/compdoc/CompDocForms.xml"/>
+                        <include-form name="ListCompDocInstances" location="component://content/widget/compdoc/CompDocForms.xml"/>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -835,6 +836,7 @@
             <widgets>
                 <decorator-screen name="commonCompDocDecorator" location="component://content/widget/CommonScreens.xml">
                     <decorator-section name="body">
+                       <link target="GenCompDocPDF?contentId=${contentId}&amp;contentRevisionSeqId=${contentRevisionSeqId}" text="Generate Composite PDF" style="buttontext"/>
                        <include-tree  name="CompDocInstanceTree" location="component://content/widget/compdoc/CompDocTemplateTree.xml"/>
                     </decorator-section>
                 </decorator-screen>



More information about the Svn mailing list