Book a Demo

Author Topic: Problems modifying a template  (Read 3024 times)

Emilio

  • EA User
  • **
  • Posts: 78
  • Karma: +0/-0
    • View Profile
Problems modifying a template
« on: April 29, 2008, 09:07:11 pm »
I am trying to modify the File template for C# so that the header has our in-house standards header. There is a problem though, and that is that apparently the template generator of EA is not very happy with Visual Source Safe keyword expansion tokens!

In our template we have items such as $Archive::           $ and $Revision: 0 $  so those are two separate types of allowed VSS syntax for keyword expansion. However when the source code is generated these tokens are removed and only the "::" or ":" remains. I tried to escape the $ token marker with \ and $ but the problem persists in one form or another.

Basically this is an example of what I want:

/*
 *                   Copyright (c)2000-2008 Our Company
 *                         All Rights Reserved
 * ---------------------------------------------------------------------------
 *\$Archive::                                                                 $
 *$Revision:      $             $Date::                                      $
 *$Author::                                                                  $
 * Project   : ProjectName
 * Component : ComponentName
 * Package   :
 * Filename  : %fileName%
 * Implements: %elemType% %className%
 * Created   : %eaDateTime% by Enterprise Architect
%if classAuthor != ""%
 * Modelled  : %classAuthor%
%endIf% */\n

$COMMENT="WARNING: DO NOT MODIFY THIS TEMPLATE BELOW THIS POINT"
\n\n
%ImportSection%
%list="Namespace" @separator="\n\n"%


but this is what the generator produces:

/*
 *                   Copyright (c)2000-2008 Our Company
 *                         All Rights Reserved
 * ---------------------------------------------------------------------------
 *\::                                                                 $
 *:      $             ::                                      $
 *::                                                                  $
 * Project   : ProjectName
 * Component : ComponentName
 * Package   :
 * Filename  : CommunicationToken.cs
 * Implements: Class CommunicationToken
 * Created   : 29-apr-2008 12:58:10 by Enterprise Architect
 * Modelled  : D. Emilio Grimaldo
 */

What needs to be corrected? I did not find any better explanation in the SDK only that you CAN modify and create templates.

Likewise and to avoid having to do extensive editing of the generated code we would also like to change how the property accessors (get/set are generated. We get this:

public VariableType ValueType{
                  get{
                        return _typeId;
                  }
                  set{
                        _typeId = value;
                  }
            }

but we would like this to generate as this (to comply with our coding standards):


public VariableType ValueType
{
      get { return _typeId; }
      set { _typeId = value; }
}
« Last Edit: April 29, 2008, 09:13:58 pm by emilio.tlx »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Problems modifying a template
« Reply #1 on: April 30, 2008, 08:06:12 am »
Dollar signs denote variables in the template framework.  To generate a literal dollar sign you will need to use %dl%.

http://www.sparxsystems.com.au/EAUserGuide/index.html?literaltext.htm