Workspaces

From Projectivity Documentation

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

In this section you will see how the Projectivity Framework technology allows you to define how workspaces can be created in Projectivity.

Contents

Creating a New Type

Workspace types refer to the different workspaces Projectivity users will be able to create when using a specific framework. For example a type can be “Company” or “Research Project” or anything you want. Note that you will be able to associate metadata fields to each type, therefore giving them the exact “meaning” you want to (refer to section 1.2 for more information).

Projectivity allows you to create workspaces that models different parts of your company:

  • Structural workspaces: model all the different business entities of your company, e.g. a company, an office, a department, etc...
  • Project workspaces: model your projects. Project workspaces can only be located under structural workspaces
  • Dynamic workspaces: model a part of your project that has the notion of time, e.g. an activity
  • Folder workspaces: used to group dynamic workspaces


Creating a new workspace type is easy. Let follow the example of the Customer Management application (See specifications). This application contains the following types (all can be mapped to structural workspaces):

  • Company
  • Region
  • Customers


Lets create these 3 types:

MentorStructuralScopeDefinitionDVO scopeDefCompany  = new MentorStructuralScopeDefinitionDVO();        
MentorStructuralScopeDefinitionDVO scopeDefRegion   = new MentorStructuralScopeDefinitionDVO();
MentorStructuralScopeDefinitionDVO scopeDefCustomer = new MentorStructuralScopeDefinitionDVO();

// Specify the icons we want to show in the interface
scopeDefCompany.setKeyPrefix(Constants.KEY_PREFIX_SCOPE_DEFAULT_STRUCTURAL_COMPANY);
scopeDefRegion.setKeyPrefix(Constants.KEY_PREFIX_SCOPE_DEFAULT_STRUCTURAL_DEPARTMENT);
scopeDefCustomer.setKeyPrefix(Constants.KEY_PREFIX_SCOPE_DEFAULT_STRUCTURAL_OFFICE);


Note that other workspaces are mapped to the following objects:

  • Structural Workspaces: MentorStructuralScopeDefinitionDVO
  • Project Workspaces: MentorProjectScopeDefinitionDVO
  • Dynamic Workspaces: MentorDynamicScopeDefinitionDVO
  • Folder Workspaces: MentorFolderScopeDefinitionDVO

Defining Metadata Fields

There are several metadata types you can use in your workspace types. Note that all these metadata types are rendered as output text in read only mode.

Type Class Description Rendered As
String

StringMetaDataDTO

Represents a simple string with a maximum size of 64 characters

Text box

Large String

WideStringMetaDataDTO

Represents a large string with a maximum size of 256 characters

Text area

Date

DateMetaDataDTO

Represents a Date

Calendar/date

URL

URLMetaDataDTO

Represents a URL web address

Link

Email

EmailMetaDataDTO

Represents an email address

A link with mailto

CSV

CsvSingleListMetaDataDTO

Represents a list of comma separated value items that are defined externally in a the Projevctivity's property file

A combo box

Help

HelpMetaDataDTO

Represents a link to an help page for the workspace

Lightbox (custom component)

List

ListMetaDataDTO

Represents a list of items (hardcoded in the framework)

Combo box

Multi List

MultiListMetaDataDTO

Represents a list of multiple items

Checkbox

Number

NumberMetaDataDTO

Represents a number (with appropriate validation)

Text box

Progress Status

ProgressStatusMetaDataDTO

Represents a progress value on a project (%)

Text box

Reference

ReferenceMetaDataDTO

Represents a reference to another metadata field in a different workspace

None

Role List

RoleListMetaDataDTO

Represents a list of roles

Combo box

Currency

CurrencyMetaDataDTO

Represents a number in a certain currency

Text Box

Decorator

DecoratorMetaDataDTO

A simple decorator to visually group your metadata items

Panel Group


Following our Customer Management application we know that each of our 3 types contain a list of specific metadata fields (click here to see these fields). Lets now see below how to create these fields and associate them to their respective workspace types.

Lets first create the metadata fields for the type Company:

Date date = new Date();
MetaDataDTO mdCompanyWebSite = new UrlMetaDataDTO("Web Site", date, "http://www.mycompany.com/");
MetaDataDTO mdCompanySlogan  = new StringMetaDataDTO("Slogan", date, "");

Collection<MetaDataDTO> mdCompany = new ArrayList<MetaDataDTO>();
mdCompany.add(mdCompanyWebSite);
mdCompany.add(mdCompanySlogan);

Now lets create the metadata fields for the type Region:

MetaDataDTO mdRegionDefinition   = new WideStringMetaDataDTO("Region Definition", date, "");

Collection<MetaDataDTO> mdRegion = new ArrayList<MetaDataDTO>();
mdRegion.add(mdRegionDefinition);

Finally lets create the metadata fields for the type Customer:

List<String> industries = new ArrayList<String>();
industries.add("Telecom");
industries.add("Automotiv");

List<String> statuss = new ArrayList<String>();
statuss.add("Lead");
statuss.add("Customer");
statuss.add("Closed");

MetaDataDTO mdCustomerCode           = new SerialCodeMetaDataDTO("Customer Code", "YYYY", "000", true); 
MetaDataDTO mdCustomerCreationDate   = new DateMetaDataDTO("Creation Date", date, date);
MetaDataDTO mdCustomerFullName       = new StringMetaDataDTO("Full Name", date, "");
MetaDataDTO mdCustomerAddress        = new WideStringMetaDataDTO("Address", date, "");
MetaDataDTO mdCustomerBillingAddress = new WideStringMetaDataDTO("Billing Address", date, "");
MetaDataDTO mdCustomerVATNumber      = new NumberMetaDataDTO("VAT Number", date, new Integer(0));
MetaDataDTO mdCustomerIndustry       = new SingleListMetaDataDTO("Industry", date, industries);
MetaDataDTO mdCustomerStatus         = new SingleListMetaDataDTO("Status", date, statuss);

Collection<MetaDataDTO> mdCustomer = new ArrayList<MetaDataDTO>();
mdCustomer.add(mdCustomerCode);
mdCustomer.add(mdCustomerCreationDate);
mdCustomer.add(mdCustomerFullName);
mdCustomer.add(mdCustomerAddress);
mdCustomer.add(mdCustomerBillingAddress);
mdCustomer.add(mdCustomerVATNumber);
mdCustomer.add(mdCustomerIndustry);
mdCustomer.add(mdCustomerStatus);

Lets now associate the metadata fields to their respective workspace types:

scopeDefCompany.setMetaDataSet(mdCompany);
scopeDefRegion.setMetaDataSet(mdRegion);
scopeDefCustomer.setMetaDataSet(mdCustomer);

And that's it! We now have a set of workspace types together with their associated metadata. We can now specify the cardinality of each type and start specifying the way users will be able to create workspaces in Projectivity.

Specifying the Cardinality

Here we will see how you can specify how many of each workspace type can be created by the final user, e.g. “only 2 workspaces of type Region can be created by the final user”.

Following our Customer Management example, we have the following constraints:

  • 2 Regions must be created under a Company
  • Any number of Customers can be created under each Region

Lets first create our cardinalities. These are represented as Pair objects:

Pair<Integer, Integer> zeroStar = new Pair<Integer, Integer>(0, -1);
Pair<Integer, Integer> twoTwo   = new Pair<Integer, Integer>(2, 2);

We now must define 2 collections containing the parents for Company and region:

Collection<Pair<ScopeDefinitionName, Pair<Integer, Integer>>> parentsCompany = new ArrayList<Pair<ScopeDefinitionName, Pair<Integer, Integer>>>();
        
Collection<Pair<ScopeDefinitionName, Pair<Integer, Integer>>> parentsRegion = new ArrayList<Pair<ScopeDefinitionName, Pair<Integer, Integer>>>();

Collection<Pair<ScopeDefinitionName, Pair<Integer, Integer>>> parentsCustomer = new ArrayList<Pair<ScopeDefinitionName, Pair<Integer, Integer>>>();

Lets now integrate the cardinalities:

// Any number of Company can be created under the ROOT
parentsCompany.add(new Pair<ScopeDefinitionName, Pair<Integer, Integer>>(ScopeDefinitionName.getRootName(), zeroStar));        
parentsRegion.add(new Pair<ScopeDefinitionName, Pair<Integer, Integer>>(defNameCompany, twoTwo));
parentsCustomer.add(new Pair<ScopeDefinitionName, Pair<Integer, Integer>>(defNameRegion, zeroStar));

As easy as that! We now need to specify how the final user can create workspaces.

Organising Workspaces

Here we will see how the final user can create workspaces, I.e. in what order. Following our customer management application we have the following workspace structure:

  • A Region can be created under a Company
  • A Customer can be created under a Region
private String CUSTOMER_MANAGEMENT_FRAMEWORK_NAME    = "Customer Management Framework";
private int    CUSTOMER_MANAGEMENT_FRAMEWORK_VERSION = 1;
private String nameCompany  = "Company";
private String nameRegion   = "Region";
private String nameCustomer = "Customer";

private ScopeDefinitionName defNameCompany = new ScopeDefinitionName(CUSTOMER_MANAGEMENT_FRAMEWORK_NAME, nameCompany,  CUSTOMER_MANAGEMENT_FRAMEWORK_VERSION);
private ScopeDefinitionName defNameRegion = new ScopeDefinitionName(CUSTOMER_MANAGEMENT_FRAMEWORK_NAME , nameRegion, CUSTOMER_MANAGEMENT_FRAMEWORK_VERSION);
private ScopeDefinitionName defNameCustomer = new ScopeDefinitionName(CUSTOMER_MANAGEMENT_FRAMEWORK_NAME , nameCustomer, CUSTOMER_MANAGEMENT_FRAMEWORK_VERSION);

StructuralTemplateDTO customerManagementFramework = new StructuralTemplateDTO(CUSTOMER_MANAGEMENT_FRAMEWORK_NAME, CUSTOMER_MANAGEMENT_FRAMEWORK_VERSION);
        
customerManagementFramework.put2(defNameCompany, scopeDefCompany,  parentsCompany);
customerManagementFramework.put2(defNameRegion,  scopeDefRegion,   parentsRegion); 
customerManagementFramework.put2(defNameCustomer,  scopeDefCustomer,   parentsCustomer); 
Personal tools