You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+9-14Lines changed: 9 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,29 +36,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
36
36
- Fixed handling of unmanaged composition of many
37
37
- Proper casing of the operation enum type
38
38
39
-
40
39
### Changed
41
40
42
41
- Added warning and mitigation for multi-tenant deployments with MTX
43
42
- Added a disclaimer of upcoming new version having a minimum requirement of CDS 8.6 for multitenancy fix
44
43
- Changed the default limit on non-HANA databases from 255 to 5000 characters for all String values
45
44
- Updated peer dependency from CDS7 to CDS8
46
45
47
-
48
46
## Version 1.0.7 - 20.08.24
49
47
50
48
### Added
51
49
52
-
- A global switch to preserve change logs for deleted data
53
-
- For hierarchical entities, a method to determine their structure and a flag to indicate whether it is a root entity was introduced. For child entities, information about the parent is recorded.
54
-
50
+
- A global switch to preserve change logs for deleted data
51
+
- For hierarchical entities, a method to determine their structure and a flag to indicate whether it is a root entity was introduced. For child entities, information about the parent is recorded.
55
52
56
53
### Fixed
57
54
58
55
- CDS 8 does not support queries for draft-enabled entities on the application service anymore. This was causing: SqliteError: NOT NULL constraint failed: (...).DraftAdministrativeData_DraftUUID
59
56
- CDS 8 deprecated cds.transaction, causing change logs of nested documents to be wrong, replaced with req.event
60
57
- CDS 8 rejects all direct CRUD requests for auto-exposed Compositions in non-draft cases. This was affecting test cases, since the ChangeView falls into this category
61
-
- req._params and req.context are not official APIs and stopped working with CDS 8, replaced with official APIs
58
+
- req.\_params and req.context are not official APIs and stopped working with CDS 8, replaced with official APIs
62
59
- When running test cases in CDS 8, some requests failed with a status code of 404
63
60
- ServiceEntity is not captured in the ChangeLog table in some cases
64
61
- When modeling an inline entity, a non-existent association and parent ID was recorded
@@ -70,22 +67,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
70
67
- Data marked as personal data using data privacy annotations won't get change-tracked anymore to satisfy product standards
71
68
- Restructured Documentation
72
69
73
-
74
70
## Version 1.0.6 - 29.04.24
75
71
76
72
### Fixed
77
73
78
-
- Storage of wrong ObjectID in some special scenarios
79
-
- Missing localization of managed fields
80
-
- Views without keys won't get the association and UI facet pushed anymore
74
+
- Storage of wrong ObjectID in some special scenarios
75
+
- Missing localization of managed fields
76
+
- Views without keys won't get the association and UI facet pushed anymore
81
77
82
78
### Added
83
79
84
-
- A method to disable automatic generation of the UI Facet
80
+
- A method to disable automatic generation of the UI Facet
85
81
86
82
### Changed
87
83
88
-
- Improved documentation of the @changelog Annotation
84
+
- Improved documentation of the @changelog Annotation
89
85
90
86
## Version 1.0.5 - 15.01.24
91
87
@@ -112,7 +108,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
112
108
113
109
### Added
114
110
115
-
- Added note about using `SAPUI5 v1.120.0` or later for proper lazy loading of the *Change History* table.
111
+
- Added note about using `SAPUI5 v1.120.0` or later for proper lazy loading of the _Change History_ table.
116
112
- In README, add warning about tracking personal data.
117
113
118
114
### Changed
@@ -141,4 +137,3 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,11 @@ Instances of abusive, harassing, or otherwise unacceptable behavior may be repor
10
10
11
11
We use GitHub to manage reviews of pull requests.
12
12
13
-
* If you are a new contributor, see: [Steps to Contribute](#steps-to-contribute)
13
+
- If you are a new contributor, see: [Steps to Contribute](#steps-to-contribute)
14
14
15
-
* Before implementing your change, create an issue that describes the problem you would like to solve or the code that should be enhanced. Please note that you are willing to work on that issue.
15
+
- Before implementing your change, create an issue that describes the problem you would like to solve or the code that should be enhanced. Please note that you are willing to work on that issue.
16
16
17
-
* The team will review the issue and decide whether it should be implemented as a pull request. In that case, they will assign the issue to you. If the team decides against picking up the issue, the team will post a comment with an explanation.
17
+
- The team will review the issue and decide whether it should be implemented as a pull request. In that case, they will assign the issue to you. If the team decides against picking up the issue, the team will post a comment with an explanation.
18
18
19
19
## Steps to Contribute
20
20
@@ -28,11 +28,11 @@ You are welcome to contribute code in order to fix a bug or to implement a new f
28
28
29
29
The following rule governs code contributions:
30
30
31
-
* Contributions must be licensed under the [Apache 2.0 License](./LICENSE)
32
-
* Due to legal reasons, contributors will be asked to accept a Developer Certificate of Origin (DCO) when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses [the standard DCO text of the Linux Foundation](https://developercertificate.org/).
31
+
- Contributions must be licensed under the [Apache 2.0 License](./LICENSE)
32
+
- Due to legal reasons, contributors will be asked to accept a Developer Certificate of Origin (DCO) when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses [the standard DCO text of the Linux Foundation](https://developercertificate.org/).
33
33
34
34
## Issues and Planning
35
35
36
-
* We use GitHub issues to track bugs and enhancement requests.
36
+
- We use GitHub issues to track bugs and enhancement requests.
37
37
38
-
* Please provide as much context as possible when you open an issue. The information you provide must be comprehensive enough to reproduce that issue for the assignee.
38
+
- Please provide as much context as possible when you open an issue. The information you provide must be comprehensive enough to reproduce that issue for the assignee.
@@ -18,138 +18,92 @@ See [Getting Started](https://cap.cloud.sap/docs/get-started) on how to jumpstar
18
18
19
19
Usage of this plugin requires a valid subscription of the [SAP Print Service](https://help.sap.com/docs/SCP_PRINT_SERVICE).
20
20
21
-
To integrate the print functionality in your application, simply annotate any action with `@print`. This annotation automatically manages the process of sending documents to the print queues, requiring no additional setup for handling print jobs.
21
+
## Usage
22
22
23
-
### Required Fields
23
+
To use this plugin to print documents there are two main steps:
24
24
25
-
The following three fields should be annotated with the corresponding `@print` annotations:
25
+
1. Add required annotations to your CDS model:
26
+
a. Entity
27
+
b. Action
28
+
2. Configure print queues to select from available options. (Optional, but recommended)
26
29
27
-
1.**`@print.queue`**: Specifies the queue to which the document should be sent for printing.
28
-
2.**`@print.numberOfCopies`**: Defines the number of copies to be printed.
29
-
3.**`@print.fileContent`**: Provides the file content to be printed. You can also specify the file name using the `fileNameField` property.
30
+
### Annotations in CDS model
30
31
31
-
#### Example
32
+
#### Entity
33
+
34
+
First of all, the entity needs to be annotated to define the content and the name of the document to be printed.
Multiple fields can be annotated with `@print.fileContent` to send several documents to the print queue in a single action.
40
-
41
-
### Main Document
42
43
43
-
To designate a specific document as the primary document for printing, annotate it with `@print.MainDocument`:
44
-
45
-
```cds
46
-
@print.MainDocument
47
-
invoiceContent,
48
44
```
49
45
50
-
This ensures the specified document is treated as the main document when multiple documents are involved.
51
-
52
-
## Print Queue Configuration
53
-
54
-
You can retrieve all available print queues from the Print Service Application for selection by defining a `Queues` entity with **skip persistency**. This setup will offer a value help for the print queues, allowing users to select from available options.
46
+
-`@print.fileContent`: Annotates the field containing the document content to be printed.
47
+
-`@print.fileName`: Annotates the field containing the name of the document
55
48
56
-
###Define the `Queues` Entity
49
+
#### Annotation of actions
57
50
58
-
Define an entity like `Product` and associate it with the `Queues` entity as shown below:
51
+
Sending a print request works via bound actions annotated with `@print`. The parameter of the action are used to define the print job details.
59
52
60
-
#### Example
61
53
```cds
62
-
entity Product {
63
-
qName : Association to one Queues;
64
-
}
65
-
66
-
@cds.skip.persistence
67
-
entity Queues {
68
-
key ID : String;
69
-
description : String;
70
-
}
71
-
```
54
+
service IncidentService {
55
+
entity Incidents as projection on db.Incidents actions {
72
56
73
-
#### Annotating with `@print.queue`
74
-
75
-
Once the `Queues` entity is defined, specify it in the `@print.queue` annotation like so:
76
-
77
-
```cds
78
-
@print.queue: {
79
-
SourceEntity: 'Queues'
57
+
@print
58
+
action printIncidentFile(
59
+
@Common: {
60
+
ValueListWithFixedValues,
61
+
ValueList: {
62
+
$Type: 'Common.ValueListType',
63
+
CollectionPath: 'Queues',
64
+
Parameters: [{
65
+
$Type: 'Common.ValueListParameterInOut',
66
+
LocalDataProperty: qnameID,
67
+
ValueListProperty: 'ID'
68
+
}]
69
+
},
70
+
Label: 'Print Queues',
71
+
}
72
+
@print.queue
73
+
qnameID: String,
74
+
@print.numberOfCopies
75
+
@UI.ParameterDefaultValue : 1
76
+
copies: Integer
77
+
);
78
+
};
80
79
}
81
-
qName
82
80
```
83
81
84
-
### Parameterizing Print Queue in Actions
82
+
-`@print`: Annotates the action that triggers the print job.
83
+
-`@print.queue`: Annotates the parameter specifying the print queue. It is recommended to use a value help for this parameter to select from available print queues. See TOOD
84
+
-`@print.numberOfCopies`: Annotates the parameter specifying the number of copies to print
85
85
86
-
Alternatively, if the print queue is passed as a parameter in the action, you can annotate it directly within the action definition. This can be done as follows:
86
+
### Queues
87
87
88
-
#### In Database Definition:
88
+
Every print request needs to specify a print queue it is send to. It is recommended to provide a value help for the print queue selection. To enbale this, define an entity as projection on the `Queues` entity provided by the print service. When this projection is in place, the plugin automatically provides the available print queues coming from the print service.
89
89
90
90
```cds
91
-
entity Product {
92
-
qName : Association to one Queues;
93
-
}
94
-
95
-
@cds.skip.persistence
96
-
entity Queues {
97
-
key ID : String;
98
-
description : String;
99
-
}
100
-
```
101
-
102
-
#### In Service Definition:
91
+
using {sap.print as sp} from '@cap-js/print';
103
92
104
-
```cds
105
-
service MyService {
106
-
@print
107
-
action print(
108
-
@print.queue: {
109
-
SourceEntity: 'Queues'
110
-
}
111
-
@Common: {
112
-
ValueListWithFixedValues,
113
-
ValueList: {
114
-
$Type: 'Common.ValueListType',
115
-
CollectionPath: 'Queues',
116
-
Parameters: [{
117
-
$Type: 'Common.ValueListParameterInOut',
118
-
LocalDataProperty: qnameID,
119
-
ValueListProperty: 'ID'
120
-
}]
121
-
},
122
-
Label: 'Print Queues',
123
-
}
124
-
qnameID: String
125
-
);
126
-
127
-
entity Queues as projection on db.Queues;
93
+
service IncidentService {
94
+
entity Queues as projection on sp.Queues;
128
95
}
129
96
```
130
97
131
-
In this setup, the `qnameID` parameter will be used to dynamically select the print queue from the `Queues` entity. The `Common.ValueList` provides a drop-down selection for available queues during runtime.
98
+
## Local Development
132
99
100
+
When running the application locally, i.e. `cds watch`, the print service is mocked. This mock implementation prints the print job details to the console instead of sending it to the actual print service. It also provides a number of sample print queues for selection.
133
101
134
-
## Note
102
+
## Hybrid Testing
135
103
136
-
If you are running the application in a production way locally(E.g. adding VCAP_SERVICES in `default-env.json`), add the environmental variable `SUBSCRIBER_SUBDOMAIN_FOR_LOCAL_TESTING=<Your subscriber subdomain name>` in the `package.json` as shown below.
104
+
You can also run the application locally with a binding to the cloud print service with CAP profiles. For more information, see [Hybrid Testing](https://cap.cloud.sap/docs/advanced/hybrid-testing#hybrid-testing). You need an instance of the SAP Print Service.
If you are running the application in offline mode which is without remote connection to the online environment, you can add the environmental variable `PRINT_CONSOLE_MODE=true cds watch` in the `package.json` as shown below.
0 commit comments