From e3c8950e265573c6f002b3922298473545e706d1 Mon Sep 17 00:00:00 2001 From: HOS Date: Tue, 17 Dec 2024 15:25:21 +0100 Subject: [PATCH 1/8] Be consistent with example. --- chapters/annotations.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chapters/annotations.tex b/chapters/annotations.tex index 08df4c888..0183f41b9 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -2350,15 +2350,17 @@ \subsection{Licensing}\label{licensing} In order that the protected class can be used either a tool specific license manager, or a license file (called \lstinline!licenseFile!) must be present. The license file is standardized. -It is a Modelica package without classes that has a \lstinline!Protection! annotation of the following form which specifies a sequence of target records, which makes it natural to define start/end dates for different sets of targets individually: +It is a Modelica package without classes that has a \lstinline!Authorization! annotation of the following form which specifies a sequence of target records, which makes it natural to define start/end dates for different sets of targets individually: \begin{lstlisting}[language=modelica] -record Protection record Authorization /*literal*/ constant String licensor = "" "Optional string to show information about the licensor"; /*literal*/ constant String libraryKey "Matching the key in the class. Must be encrypted and not visible"; /*literal*/ constant License license[:] "Definition of the license options and of the access rights"; end Authorization; - +\end{lstlisting}% +\index{Authorization@\robustinline{Authorization}!license file}\index{License@\robustinline{License}!license file} +using the following definition: +\begin{lstlisting}[language=modelica] record License /*literal*/ constant String licensee = "" "Optional string to show information about the licensee"; /*literal*/ constant String id[:] "Unique machine identifications, e.g., MAC addresses"; @@ -2367,9 +2369,7 @@ \subsection{Licensing}\label{licensing} /*literal*/ constant String expirationDate = "" "Optional expiration date in UTCformat YYYY-MM-DD"; /*literal*/ constant String operations[:] "Library usage conditions"; end License; -end Protection; -\end{lstlisting}% -\index{Authorization@\robustinline{Authorization}!license file}\index{License@\robustinline{License}!license file} +\end{lstlisting} The format of the strings used for \lstinline!libraryKey! and \lstinline!id! are not specified (they are vendor specific). The \lstinline!libraryKey! is a secret of the library developer. From 61f2106c3e8e33f18f2261cc2b41ee3e7ee2cba5 Mon Sep 17 00:00:00 2001 From: HOS Date: Tue, 17 Dec 2024 15:25:50 +0100 Subject: [PATCH 2/8] Skip unneeded indentation. --- chapters/annotations.tex | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/chapters/annotations.tex b/chapters/annotations.tex index 0183f41b9..22d661642 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -2352,23 +2352,23 @@ \subsection{Licensing}\label{licensing} The license file is standardized. It is a Modelica package without classes that has a \lstinline!Authorization! annotation of the following form which specifies a sequence of target records, which makes it natural to define start/end dates for different sets of targets individually: \begin{lstlisting}[language=modelica] - record Authorization - /*literal*/ constant String licensor = "" "Optional string to show information about the licensor"; - /*literal*/ constant String libraryKey "Matching the key in the class. Must be encrypted and not visible"; - /*literal*/ constant License license[:] "Definition of the license options and of the access rights"; - end Authorization; +record Authorization + /*literal*/ constant String licensor = "" "Optional string to show information about the licensor"; + /*literal*/ constant String libraryKey "Matching the key in the class. Must be encrypted and not visible"; + /*literal*/ constant License license[:] "Definition of the license options and of the access rights"; +end Authorization; \end{lstlisting}% \index{Authorization@\robustinline{Authorization}!license file}\index{License@\robustinline{License}!license file} using the following definition: \begin{lstlisting}[language=modelica] - record License - /*literal*/ constant String licensee = "" "Optional string to show information about the licensee"; - /*literal*/ constant String id[:] "Unique machine identifications, e.g., MAC addresses"; - /*literal*/ constant String features[:] "Activated library license features"; - /*literal*/ constant String startDate = "" "Optional start date in UTCformat YYYY-MM-DD"; - /*literal*/ constant String expirationDate = "" "Optional expiration date in UTCformat YYYY-MM-DD"; - /*literal*/ constant String operations[:] "Library usage conditions"; - end License; +record License + /*literal*/ constant String licensee = "" "Optional string to show information about the licensee"; + /*literal*/ constant String id[:] "Unique machine identifications, e.g., MAC addresses"; + /*literal*/ constant String features[:] "Activated library license features"; + /*literal*/ constant String startDate = "" "Optional start date in UTCformat YYYY-MM-DD"; + /*literal*/ constant String expirationDate = "" "Optional expiration date in UTCformat YYYY-MM-DD"; + /*literal*/ constant String operations[:] "Library usage conditions"; +end License; \end{lstlisting} The format of the strings used for \lstinline!libraryKey! and \lstinline!id! are not specified (they are vendor specific). From 92b7ef01b33b71867f328b73a8de012312f2d49b Mon Sep 17 00:00:00 2001 From: HOS Date: Tue, 17 Dec 2024 15:32:39 +0100 Subject: [PATCH 3/8] Remove incorrect referene. --- chapters/annotations.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapters/annotations.tex b/chapters/annotations.tex index 22d661642..feeedf6c3 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -2318,14 +2318,14 @@ \subsection{Licensing}\label{licensing} record Protection /*literal*/ constant Access access; /*literal*/ constant String features[:] "Required license features"; - + record License /*literal*/ constant String libraryKey; /*literal*/ constant String licenseFile = "" "Optional, default mapping if empty"; end License; end Protection; \end{lstlisting} -See \cref{protection-of-classes} for a description of \lstinline!access!, and note that licensing information uses another record \lstinline!Protection! with different contents given below. +See \cref{protection-of-classes} for a description of \lstinline!access!. The \fmtannotationindex{License} annotation has only an effect on the top of an encrypted class and is then valid for the whole class hierarchy. (Usually the licensed class is a package.) The \lstinline!libraryKey! is a secret string from the library vendor and is the protection mechanism so that a user cannot generate his/her own authorization file since the \lstinline!libraryKey! is unknown to him/her. From a893150872b940691a582a39a32a3d57d9615f2d Mon Sep 17 00:00:00 2001 From: HOS Date: Tue, 17 Dec 2024 15:34:11 +0100 Subject: [PATCH 4/8] Try to be clearer. --- chapters/annotations.tex | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/chapters/annotations.tex b/chapters/annotations.tex index feeedf6c3..c1f5e7806 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -2318,12 +2318,13 @@ \subsection{Licensing}\label{licensing} record Protection /*literal*/ constant Access access; /*literal*/ constant String features[:] "Required license features"; - - record License - /*literal*/ constant String libraryKey; - /*literal*/ constant String licenseFile = "" "Optional, default mapping if empty"; - end License; + /*literal*/ constant IntLicense License; end Protection; + +record IntLicense "Internal class name, do not use" + /*literal*/ constant String libraryKey; + /*literal*/ constant String licenseFile = "" "Optional, default mapping if empty"; +end IntLicense; \end{lstlisting} See \cref{protection-of-classes} for a description of \lstinline!access!. The \fmtannotationindex{License} annotation has only an effect on the top of an encrypted class and is then valid for the whole class hierarchy. From 8f1076414bd807ae7d82e1188a6742cff8a7504d Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Fri, 3 Jan 2025 14:39:15 +0100 Subject: [PATCH 5/8] Apply suggestions from code review Co-authored-by: Henrik Tidefelt --- chapters/annotations.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chapters/annotations.tex b/chapters/annotations.tex index c1f5e7806..6e16b061e 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -2323,7 +2323,7 @@ \subsection{Licensing}\label{licensing} record IntLicense "Internal class name, do not use" /*literal*/ constant String libraryKey; - /*literal*/ constant String licenseFile = "" "Optional, default mapping if empty"; + /*literal*/ constant String licenseFile = "" "Default mapping if empty"; end IntLicense; \end{lstlisting} See \cref{protection-of-classes} for a description of \lstinline!access!. @@ -2351,10 +2351,10 @@ \subsection{Licensing}\label{licensing} In order that the protected class can be used either a tool specific license manager, or a license file (called \lstinline!licenseFile!) must be present. The license file is standardized. -It is a Modelica package without classes that has a \lstinline!Authorization! annotation of the following form which specifies a sequence of target records, which makes it natural to define start/end dates for different sets of targets individually: +It is a Modelica package without classes that has an \lstinline!Authorization! annotation of the following form which specifies a sequence of target records, which makes it natural to define start/end dates for different sets of targets individually: \begin{lstlisting}[language=modelica] record Authorization - /*literal*/ constant String licensor = "" "Optional string to show information about the licensor"; + /*literal*/ constant String licensor = "" "Information about the licensor"; /*literal*/ constant String libraryKey "Matching the key in the class. Must be encrypted and not visible"; /*literal*/ constant License license[:] "Definition of the license options and of the access rights"; end Authorization; @@ -2363,11 +2363,11 @@ \subsection{Licensing}\label{licensing} using the following definition: \begin{lstlisting}[language=modelica] record License - /*literal*/ constant String licensee = "" "Optional string to show information about the licensee"; + /*literal*/ constant String licensee = "" "Information about the licensee"; /*literal*/ constant String id[:] "Unique machine identifications, e.g., MAC addresses"; /*literal*/ constant String features[:] "Activated library license features"; - /*literal*/ constant String startDate = "" "Optional start date in UTCformat YYYY-MM-DD"; - /*literal*/ constant String expirationDate = "" "Optional expiration date in UTCformat YYYY-MM-DD"; + /*literal*/ constant String startDate = "" "Start date in UTCformat YYYY-MM-DD"; + /*literal*/ constant String expirationDate = "" "Expiration date in UTCformat YYYY-MM-DD"; /*literal*/ constant String operations[:] "Library usage conditions"; end License; \end{lstlisting} From 3aaa9076de2ebbe6e93717dea5610ba78fc503c9 Mon Sep 17 00:00:00 2001 From: HOS Date: Fri, 3 Jan 2025 14:40:46 +0100 Subject: [PATCH 6/8] Default for dates. --- chapters/annotations.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chapters/annotations.tex b/chapters/annotations.tex index 6e16b061e..a41825ac9 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -2372,6 +2372,8 @@ \subsection{Licensing}\label{licensing} end License; \end{lstlisting} +If \lstinline!startDate! or \lstinline!expirationDate! are empty (the default) it is a perpetual license. + The format of the strings used for \lstinline!libraryKey! and \lstinline!id! are not specified (they are vendor specific). The \lstinline!libraryKey! is a secret of the library developer. The \lstinline!operations! define the usage conditions and the following are default names: From c0ae9112c2f1be1e7f9792a7be9600f736b637ac Mon Sep 17 00:00:00 2001 From: HOS Date: Fri, 3 Jan 2025 14:42:41 +0100 Subject: [PATCH 7/8] Rename class a suggested. --- chapters/annotations.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chapters/annotations.tex b/chapters/annotations.tex index a41825ac9..3b5bee34c 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -2318,13 +2318,13 @@ \subsection{Licensing}\label{licensing} record Protection /*literal*/ constant Access access; /*literal*/ constant String features[:] "Required license features"; - /*literal*/ constant IntLicense License; + /*literal*/ constant UserLicense License; end Protection; -record IntLicense "Internal class name, do not use" +record UserLicense "Internal class name, do not use" /*literal*/ constant String libraryKey; /*literal*/ constant String licenseFile = "" "Default mapping if empty"; -end IntLicense; +end UserLicense; \end{lstlisting} See \cref{protection-of-classes} for a description of \lstinline!access!. The \fmtannotationindex{License} annotation has only an effect on the top of an encrypted class and is then valid for the whole class hierarchy. From 2e1f703a67d21a00bffb64f0ab59c16bf4f213bf Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Wed, 8 Jan 2025 16:42:49 +0100 Subject: [PATCH 8/8] Update chapters/annotations.tex --- chapters/annotations.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/annotations.tex b/chapters/annotations.tex index 3b5bee34c..ce4904f83 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -2372,7 +2372,7 @@ \subsection{Licensing}\label{licensing} end License; \end{lstlisting} -If \lstinline!startDate! or \lstinline!expirationDate! are empty (the default) it is a perpetual license. +If \lstinline!startDate! and \lstinline!expirationDate! are empty (the default) it is a perpetual license. The format of the strings used for \lstinline!libraryKey! and \lstinline!id! are not specified (they are vendor specific). The \lstinline!libraryKey! is a secret of the library developer.