Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Since version 1.1.2, columns in input and output products of work-plans plugin can be injected from other plugins.

Work-plans plugin injects 2 basic columns by itself so consider that as a good documentation.

In order to add a column

...

Code Block
languagehtml/xml
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 copyright comment 
 -->
  
 <column>
 <row IDENTIFIER="" NAME="" DESCRIPTION="" COLUMNFILLER="" ALIGNMENT="" TYPE="" ACTIVE="" />
 </column>
  • identifier - column identifier which you will use in columnFiller class (for ex. productName)
  • name - locale key for column name (it will show in column selection window, as well as in workplan raport)
  • description - locale key for column description (it will show up only in column selection window)
  • columnfiller - full path to the class that will fill the column values
  • alignment - column alignment on reports (01left,02right)
  • type - to which products column will be added (input, output or both)
  • active - if set to true, column will be added as active to all operations on all levels. If set to false column will be just available for user to select it in the column selection window.

...

Code Block
languagejava
 @Component
 public class SomeClass extends Module {
 
     @Autowired
     private PluginNameColumnLoader pluginNameColumnLoader;
 
     @Override
     @Transactional
     public void multiTenantEnable() {
         pluginNameColumnLoader.addPluginNameColumnsForProducts();
     }
 

     @Override
     @Transactional
     public void multiTenantDisable() {
         agfoColumnLoaderpluginNameColumnLoader.deletePluginNameColumnsForProducts();
     }
 }

 

In order to fill the column

...

that method takes a list of orders in the argument, and has to return map of the following structure:

  • the Entity key is an Entity of the model the model operationProductInComponent or operationProductOutComponent representing the row
  • the value is a map which
    • key is a columnIdentifier specified earlier in the xml with column definition
    • value is the value to put in that column
That's all there is to it.