Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Copyright generation practices
Copyright generation practices [message #420886] Tue, 15 July 2008 17:04 Go to next message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

This is a multi-part message in MIME format.
--------------090209040309060409030800
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I had a look at EMF copyright stamping through the "Copyright Text"
attribute in a genmodel. There come my questions:

1) The JET template "header.javajetinc" writes "<copyright></copyright>"
for empty copyrights. I have never seen such tags except in Ecore source
code where they enclose the copyright. Do they have a particular purpose?

2) When I generate a copyright I get a trailing "$Id$" due to the
<%="$"%>Id<%="$"%> JET instruction (that I don't understand and for
which I haven't found documentation). According to the other posts I
found on this subject, it seems to be parametrizable. If this is
correct, how and most of all: what is the standard use of it?

Thanks,

Quentin

--------------090209040309060409030800
Content-Type: text/x-vcard; charset=utf-8;
name="quentin_glineur.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="quentin_glineur.vcf"

begin:vcard
fn:Quentin GLINEUR
n:GLINEUR;Quentin
org:Obeo - Model Driven Company;Research and Development
adr;quoted-printable:;;2 rue Robert Schumann;Rez=C3=A9;;44400;France
email;internet:quentin.glineur@obeo.fr
title:MDA Consultant
tel;work:+332 51 13 54 18
x-mozilla-html:TRUE
url:http://www.obeo.fr
version:2.1
end:vcard


--------------090209040309060409030800--
Re: Copyright generation practices [message #420889 is a reply to message #420886] Tue, 15 July 2008 17:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090701000102000808010802
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Quentin,

Comments below.

Quentin Glineur wrote:
> Hi,
>
> I had a look at EMF copyright stamping through the "Copyright Text"
> attribute in a genmodel. There come my questions:
>
> 1) The JET template "header.javajetinc" writes
> "<copyright></copyright>" for empty copyrights. I have never seen such
> tags except in Ecore source code where they enclose the copyright. Do
> they have a particular purpose?
We just put them like that so one could have a script replace it. Our
source files end up looking like this:

/**
* <copyright>
*
* Copyright (c) 2002-2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
*
* </copyright>
*
* $Id: EModelElementItemProvider.java,v 1.15 2008/07/11 16:50:17
davidms Exp $
*/

>
> 2) When I generate a copyright I get a trailing "$Id$" due to the
> <%="$"%>Id<%="$"%> JET instruction (that I don't understand and for
> which I haven't found documentation).
That's a CVS tag. See how it expands above?
> According to the other posts I found on this subject, it seems to be
> parametrizable. If this is correct, how and most of all: what is the
> standard use of it?
When you extract a file, CVS will expand it with information about the
version so looking at the source file you can determine which specific
CVS version it corresponds to.

Note that the latest templates are like this:

/**
<%{GenBase copyrightHolder = argument instanceof GenBase ?
(GenBase)argument : argument instanceof Object[] &&
((Object[])argument)[0] instanceof GenBase ?
(GenBase)((Object[])argument)[0] : null;%>
<%if (copyrightHolder != null && copyrightHolder.hasCopyright()) {%>
*
< %=copyrightHolder.getCopyright(copyrightHolder.getGenModel() .getIndentation(stringBuffer))% >
<%} else {%>
* <copyright>
* </copyright>
<%}}%>
*
* <%="$"%>Id<%="$"%>
*/

So if you set the copyright property on your GenModel that will be
generated instead. But note that the package header comment, once the
file exists, is never changed anymore.
>
>
> Thanks,
>
> Quentin

--------------090701000102000808010802
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Quentin,<br>
<br>
Comments below.<br>
<br>
Quentin Glineur wrote:
<blockquote cite="mid:g5ilac$i78$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
I had a look at EMF copyright stamping through the "Copyright Text"
attribute in a genmodel. There come my questions:
<br>
<br>
1) The JET template "header.javajetinc" writes
"&lt;copyright&gt;&lt;/copyright&gt;" for empty copyrights. I have
never seen such tags except in Ecore source code where they enclose the
copyright. Do they have a particular purpose?
<br>
</blockquote>
We just put them like that so one could have a script replace it.&nbsp; Our
source files end up looking like this:<br>
<blockquote><small>/**</small><br>
<small>&nbsp;* &lt;copyright&gt;</small><br>
<small>&nbsp;*</small><br>
<small>&nbsp;* Copyright (c) 2002-2006 IBM Corporation and others.</small><br>
<small>&nbsp;* All rights reserved.&nbsp;&nbsp; This program and the accompanying
materials</small><br>
<small>&nbsp;* are made available under the terms of the Eclipse Public
License v1.0</small><br>
<small>&nbsp;* which accompanies this distribution, and is available at</small><br>
<small>&nbsp;* <a class="moz-txt-link-freetext" href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></small><br>
<small>&nbsp;*</small><br>
<small>&nbsp;* Contributors:</small><br>
<small>&nbsp;*&nbsp;&nbsp; IBM - Initial API and implementation</small><br>
<small>&nbsp;*</small><br>
<small>&nbsp;* &lt;/copyright&gt;</small><br>
<small>&nbsp;*</small><br>
<small>&nbsp;* $Id: EModelElementItemProvider.java,v 1.15 2008/07/11
16:50:17 davidms Exp $</small><br>
<small>&nbsp;*/</small><br>
</blockquote>
<blockquote cite="mid:g5ilac$i78$1@build.eclipse.org" type="cite"><br>
2) When I generate a copyright I get a trailing "$Id$" due to the
&lt;%="$"%&gt;Id&lt;%="$"%&gt; JET instruction (that I don't understand
and for which I haven't found documentation).</blockquote>
That's a CVS tag.&nbsp; See how it expands above?<br>
<blockquote cite="mid:g5ilac$i78$1@build.eclipse.org" type="cite">
According to the other posts I found on this subject, it seems to be
parametrizable. If this is correct, how and most of all: what is the
standard use of it?</blockquote>
When you extract a file, CVS will expand it with information about the
version so looking at the source file you can determine which specific
CVS version it corresponds to.<br>
<br>
Note that the latest templates are like this:<br>
<blockquote><small>/**<br>
&lt;%{GenBase copyrightHolder = argument instanceof GenBase ?
(GenBase)argument : argument instanceof Object[] &amp;&amp;
((Object[])argument)[0] instanceof GenBase ?
(GenBase)((Object[])argument)[0] : null;%&gt;<br>
&lt;%if (copyrightHolder != null &amp;&amp;
copyrightHolder.hasCopyright()) {%&gt;<br>
&nbsp;*
&lt;%=copyrightHolder.getCopyright(copyrightHolder.getGe nModel().getIndentation(stringBuffer))%&gt; <br>
&lt;%} else {%&gt;<br>
&nbsp;* &lt;copyright&gt;<br>
&nbsp;* &lt;/copyright&gt;<br>
&lt;%}}%&gt;<br>
&nbsp;*<br>
&nbsp;* &lt;%="$"%&gt;Id&lt;%="$"%&gt;<br>
&nbsp;*/</small><br>
</blockquote>
So if you set the copyright property on your GenModel that will be
generated instead.&nbsp; But note that the package header comment, once the
file exists, is never changed anymore.<br>
<blockquote cite="mid:g5ilac$i78$1@build.eclipse.org" type="cite"><br>
<br>
Thanks,
<br>
<br>
Quentin
<br>
</blockquote>
</body>
</html>

--------------090701000102000808010802--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Copyright generation practices [message #420897 is a reply to message #420889] Wed, 16 July 2008 08:08 Go to previous message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

This is a multi-part message in MIME format.
--------------080106010905010903090206
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Thanks Ed,

Quentin

Ed Merks a
Previous Topic:"Eclipse forms" editor in Eclipse 3.4: disposing the editor when a resource is changed cau
Next Topic:the filling the "mixed: EFeatueMapEntry" and "s: AnySimpleType" information
Goto Forum:
  


Current Time: Sat Apr 27 00:37:09 GMT 2024

Powered by FUDForum. Page generated in 0.03775 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top