1: <?php
2:
3: namespace LaravelUi5\Core;
4:
5: use Illuminate\Support\Facades\File;
6: use LaravelUi5\Core\Attributes\HideIntent;
7: use LaravelUi5\Core\Enums\ArtifactType;
8: use LaravelUi5\Core\Ui5\AbstractUi5App;
9: use LaravelUi5\Core\Ui5\Capabilities\LaravelUi5ManifestInterface;
10:
11: #[HideIntent]
12: class ReportApp extends AbstractUi5App
13: {
14: public function getType(): ArtifactType
15: {
16: return ArtifactType::Application;
17: }
18:
19: public function getNamespace(): string
20: {
21: return 'com.laravelui5.report';
22: }
23:
24: public function getVersion(): string
25: {
26: return '1.0.0';
27: }
28:
29: public function getTitle(): string
30: {
31: return 'Report';
32: }
33:
34: public function getDescription(): string
35: {
36: return 'Generic Ui5 Report Application';
37: }
38:
39: public function getUi5BootstrapAttributes(): array
40: {
41: return array (
42: 'theme' => 'sap_horizon',
43: 'oninit' => 'module:com/laravelui5/report/Component',
44: 'async' => 'true',
45: 'compatversion' => 'edge',
46: 'frameoptions' => 'trusted',
47: 'xx-waitfortheme' => 'true',
48: 'xx-supportedlanguages' => 'en,de',
49: );
50: }
51:
52: public function getResourceNamespaces(): array
53: {
54: return [
55: ];
56: }
57:
58: public function getAdditionalHeadScript(): ?string
59: {
60: return <<<JS
61: sap.ui.getCore().attachInit(function () {
62: sap.ui.core.Component.create({
63: name: "com.laravelui5.report",
64: manifest: true,
65: async: true
66: }).then(function (oComponent) {
67: new sap.ui.core.ComponentContainer({
68: component: oComponent,
69: height: "100%"
70: }).placeAt("content");
71: }).catch(function (err) {
72: console.error("Component load failed:", err);
73: });
74: });
75: JS;
76: }
77:
78: public function getAdditionalInlineCss(): ?string
79: {
80: return <<<CSS
81:
82: CSS;
83: }
84:
85: public function getAssetPath(string $filename): ?string
86: {
87: $path = __DIR__ . '/../resources/report-app/' . ltrim($filename, '/');
88: return File::exists($path) ? $path : null;
89: }
90:
91: public function getVendor(): string
92: {
93: return 'Pragmatiqu IT GmbH';
94: }
95:
96: public function getManifestPath(): string
97: {
98: return __DIR__ . '/../resources/report-app/manifest.json';
99: }
100:
101: public function getLaravelUiManifest(): LaravelUi5ManifestInterface
102: {
103: return app(CoreManifest::class);
104: }
105: }
106: