Best Practices

Adding an Innovation context with dossiers of type project
Bona pràctica
BS.D - BrightSide Dossier » Projectes « JavaEE « BrightSide

Lluís Turró Cutiller
Creació
02
gen.
2018
Activitat
21
febr.
2018
0 revisio(ns)

By default, BrightSide comes with a Project context, where participating users may access their data. What we are about to create is a public context. Data will be visible to every visitor able to see the context. To be thorough, the exact case will cover:

Intention

Context type

Generic visitors

Public context.

Users with certain role

Context protected by the specific role.

Only project participants

You don't need to create a context. The default /user/myprojects will work for you.

Requirements

  • Elephant based web site.
  • BrightSide Dossiers installed and functioning.

Creating de context

In this example the context will be at root and named projects: /projects. Follow the usual steps creating a context. Edit _internal/context.xml and add this element tag within elephant-context:

<element id="20091021131026676" type="dossiers">
  <attrib name="sclass" value="" />
  <attrib name="dossierStatus" value="DOSSIER_OPENED" />
  <attrib name="dossierTypes" value="TYPE_PROJECT" />
  <attrib name="count" value="12" />
  <attrib name="onlyDossiers" value="true" />
  <attrib name="allowedCategories" value="all" />
  <attrib name="summaryTemplate" value="dossierProjects" />
  <attrib name="fullTemplate" value="dossierProject" />
  <attrib name="categoryTemplate" value="full" />
  <attrib name="phaseTemplate" value="phaseFilter" />
  <attrib name="showSubject" value="false" />
  <attrib name="restricted" value="false" />
  <attrib name="issuePath" value="/user/myissues" />
</element>

Now, you have a context that lists all dossiers being projects.

Both, summary and full templates, are provided. Feel free to copy and play around with styles, fields and edit permissions.

Directing notifications to the created context

Dossiers of type Project are redirected to /user/myprojects by default. To change this notification behavior you need to edit the file /WEB-INF/elephant/conf/entity-web-context.properties. Add this line:

dossier=/projects

In case you used a different name for the context, change the value with the used name.

Adding the Edit ability

Create a subcontext named edit: /projects/edit. Edit this context and add this macro:

{@include:/WEB-INF/_zul/dossier/www/editProject.zul}

Notice that you can add text before and after the macro in order to provide instruccions, if necessary.

An example of this type of context is located at Projects. The best practice is based in this example.

Comentaris