Defining Documents

From Projectivity Documentation

Jump to: navigation, search
Go back to Framework Development Guide main section

The Projectivity Framework technology allows you to predefine a document structure including directories and files (templates). This is a very powerful feature that allows the standardisation of your company's documentation.

Defining a Directory Structure

In our Customer Management application we have the following documentation requirements:

Each Customer workspace has the following pre-defined document structure:

  • Customer Profile (directory)
    • Orders (directory)
    • Invoices (directory)

Here is how this structure can be created:

// Lets create the Customer Profile directory
AssetDTO customerProfileAsset = new AssetDTO();
        
customerProfileAsset.setDescription("Profile of this customer");
VirtualPath pathCustomerProfile = new VirtualPath("/Customer Profile");
        
customerProfileAsset.setPath(pathCustomerProfile);
customerProfileAsset.setStatus(AssetDTO.AssetStatus.PUBLIC);
customerProfileAsset.setType(IFileSystemDataSource.FileType.DIR);

// Lets now create the Orders directory
AssetDTO ordersAsset = new AssetDTO();
        
ordersAsset.setDescription("Orders");
VirtualPath pathOrders = new VirtualPath("/Orders");
        
ordersAsset.setPath(pathOrders);
ordersAsset.setStatus(AssetDTO.AssetStatus.PUBLIC);
ordersAsset.setType(IFileSystemDataSource.FileType.DIR);

// Lets now create the Invoices directory
AssetDTO invoicesAsset = new AssetDTO();
        
ordersAsset.setDescription("Invoices");
VirtualPath pathInvoices = new VirtualPath("/Invoices");
        
invoicesAsset.setPath(pathInvoices);
invoicesAsset.setStatus(AssetDTO.AssetStatus.PUBLIC);
invoicesAsset.setType(IFileSystemDataSource.FileType.DIR);

// Lets now add this directory structure to the assets of the Customer workspace         
Collection<AssetDTO> customerAssets = new ArrayList<AssetDTO>();
        
customerAssets.add(customerProfileAsset);
customerAssets.add(ordersAsset);
customerAssets.add(invoicesAsset);
        
scopeDefCustomer.setScopeDefinitionAsset(customerAssets);

Lets now see how you can specify template file to add to your document structure.

Adding Documents to Directories

You can also specify some files in your document structure. This is the case of our Customer Management application where the final required structure is as follows:

  • Customer Profile (directory)
    • Customer Profile.doc
  • Orders (directory)
    • Order.doc
  • Invoices (directory)
    • Invoice.doc

In order to achieve this structure you need to login Projectivity as admin. Indeed we have designed this part so that document templates can be changed at any time. This is much more generic and much more appropriate since company template tend to change after some time.

In order to add these documents you will need to (this is effectively a post framework installation step):

  1. Install your framework
  2. Login Projectivity as Admin
  3. Go to the Document Explorer of the ROOT workspace
  4. Here you will see the directory structure auto created by your frameworks
  5. You can now upload your template files in the appropriate directories
  6. In the case of our Customer Management application find the directories Customer Profile, Orders, and Invoices (located in /Frameworks Documents/Customer Management Framework 1/Customer) and upload your templates. The directory structure and the documents you upload will be automatically copied to the document explorer of every Customer workspace you create. Note that if you also need to have some templates files for your Company or Region you just have to upload files in their respective directories.