IBM FileNet P8, Version 5.2.1            

Working with VWAttachmentPanel

An example is provided here of how to work with the VWAttachmentPanel bean to access attachments. These attachments are stored in object stores by Java™ Step Processors or Launch Step Processors.

This method of instantiating VWAttachmentPanel is useful for the following people:
  • Developers who are not using an IDE
  • Anyone who is interested in understanding how to retrieve attachments without using the VWTabbedPane control
VWTabbedPane includes the VWAttachmentPanel, and supplies other menu items automatically. The following procedure demonstrates how to use VWattachmentPanel separately from VWTabbedPane.
Note: The code for instantiating the VWAttachmentPanel component is added automatically in the following circumstances:
  • When you drag the component onto a form
  • You use an IDE and added vwpanel.jar to the classpath for your project
  1. Initialize the bean properly by passing in the following information:
    • A VWStepElement object
    • A Frame object (the containing parent frame)
    • A valid VWSession object

    The following example assumes that you declare and initialize these three variables near the top of the class definition:

       VWStepElement   vwStepElement = null;
       Frame   parentFrame = null;
       VWSession   vwSession = null; 
  2. Instantiate the VWAttachmentPanel bean after testing for the VWStepElement field type:
        JComponent  newJComponent = null;
    
        if (vwStepElement.getParameters(VWFieldType.FIELD_TYPE_ATTACHMENT, VWStepElement.FIELD_USER_DEFINED) != null)
            newJComponent = (JComponent)Beans.instantiate(getClass().getClassLoader(), "filenet.vw.toolkit.runtime.step.beans.VWAttachmentPanel");
        if (newJComponent != null)
    
        \\While it is not shown here, you should include code to add the JComponent to the 
        \\containing VWPanel to expose the attachment list to the end user. 
    
        if (newJComponent instanceof IVWStepProcessorComponent)
            ((IVWStepProcessorComponent)newJComponent).init(vwStepElement, parentFrame, vwSession);


Last updated: March 2016
working_with_vwattachmentpanel.htm

© Copyright IBM Corporation 2016.