Skip to content

Commit 28b28e9

Browse files
committed
Merge branch 'hotfix/2021.1.1'
2 parents 32861fe + 245fb99 commit 28b28e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1628
-169
lines changed

Platform/Plugins/com.tle.platform.common/src/com/tle/core/plugins/AbstractPluginService.java

+4
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ public void ensureActivated(PluginDescriptor plugin) {
190190
}
191191
}
192192

193+
public boolean isActivated(String pluginId) {
194+
return pluginManager.getRegistry().isPluginDescriptorAvailable(pluginId);
195+
}
196+
193197
@SuppressWarnings("nls")
194198
@Override
195199
public ExtensionPoint getExtensionPoint(String pluginId, String pointId) {

Platform/Plugins/com.tle.platform.common/src/com/tle/core/plugins/PluginService.java

+10
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ public interface PluginService {
5252

5353
void ensureActivated(PluginDescriptor plugin);
5454

55+
/**
56+
* Check if a plugin is activated.
57+
*
58+
* @param pluginId The ID of plugin
59+
* @return `true` if plugin available otherwise false
60+
*/
61+
default boolean isActivated(String pluginId) {
62+
throw new UnsupportedOperationException();
63+
}
64+
5565
void registerExtensionListener(
5666
String pluginId, String extensionId, RegistryChangeListener listener);
5767

Source/Plugins/Core/com.equella.core/js/__mocks__/GallerySearchModule.mock.ts

+15
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
4242
preview: false,
4343
mimeType: "image/jpeg",
4444
hasGeneratedThumb: true,
45+
brokenAttachment: false,
4546
links: {
4647
view:
4748
"http://localhost:8080/ian/items/fe79c485-a6dd-4743-81e8-52de66494633/1/?attachment.uuid=dbd6dd98-d731-4a8f-907e-ceaf9608da3b",
@@ -89,6 +90,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
8990
preview: false,
9091
mimeType: "image/jpeg",
9192
hasGeneratedThumb: true,
93+
brokenAttachment: false,
9294
links: {
9395
view:
9496
"http://localhost:8080/ian/items/40e879db-393b-4256-bfe2-9a78771d6937/1/?attachment.uuid=4fddbeb7-8d16-4417-be60-8709ce9d7b15",
@@ -104,6 +106,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
104106
preview: false,
105107
mimeType: "image/jpeg",
106108
hasGeneratedThumb: true,
109+
brokenAttachment: false,
107110
links: {
108111
view:
109112
"http://localhost:8080/ian/items/40e879db-393b-4256-bfe2-9a78771d6937/1/?attachment.uuid=df55f129-1bbb-427f-b8a0-46792559bea9",
@@ -117,6 +120,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
117120
id: "44528005-fb39-4461-bac7-12cd33ce4330",
118121
description: "Australian Kelpie Pet Profile | Bondi Vet",
119122
preview: false,
123+
brokenAttachment: false,
120124
links: {
121125
view:
122126
"http://localhost:8080/ian/items/40e879db-393b-4256-bfe2-9a78771d6937/1/?attachment.uuid=44528005-fb39-4461-bac7-12cd33ce4330",
@@ -164,6 +168,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
164168
preview: false,
165169
mimeType: "image/jpeg",
166170
hasGeneratedThumb: true,
171+
brokenAttachment: false,
167172
links: {
168173
view:
169174
"http://localhost:8080/ian/items/8d25bfcc-f877-4cb6-84cd-391a79c7c67a/1/?attachment.uuid=a09056f0-c867-40ea-80c0-a1433f487182",
@@ -179,6 +184,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
179184
preview: false,
180185
mimeType: "application/pdf",
181186
hasGeneratedThumb: true,
187+
brokenAttachment: false,
182188
links: {
183189
view:
184190
"http://localhost:8080/ian/items/8d25bfcc-f877-4cb6-84cd-391a79c7c67a/1/?attachment.uuid=6411799f-052a-4926-8c67-0c851447c762",
@@ -194,6 +200,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
194200
preview: false,
195201
mimeType: "image/jpeg",
196202
hasGeneratedThumb: true,
203+
brokenAttachment: false,
197204
links: {
198205
view:
199206
"http://localhost:8080/ian/items/8d25bfcc-f877-4cb6-84cd-391a79c7c67a/1/?attachment.uuid=e3f96e6b-a6aa-4c8e-975c-c2c3870daa34",
@@ -209,6 +216,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
209216
preview: false,
210217
mimeType: "image/jpeg",
211218
hasGeneratedThumb: true,
219+
brokenAttachment: false,
212220
links: {
213221
view:
214222
"http://localhost:8080/ian/items/8d25bfcc-f877-4cb6-84cd-391a79c7c67a/1/?attachment.uuid=f226e79a-1d2c-4894-aaa1-032812351d29",
@@ -224,6 +232,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
224232
preview: false,
225233
mimeType: "image/jpeg",
226234
hasGeneratedThumb: true,
235+
brokenAttachment: false,
227236
links: {
228237
view:
229238
"http://localhost:8080/ian/items/8d25bfcc-f877-4cb6-84cd-391a79c7c67a/1/?attachment.uuid=3afceca2-63d0-47ea-b921-f199b73194fc",
@@ -279,6 +288,7 @@ export const basicVideoSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
279288
id: "398dbef0-7d12-4b72-af3d-095dd70b019d",
280289
description: "6 Tips For Caring for African Violets",
281290
preview: false,
291+
brokenAttachment: false,
282292
links: {
283293
view:
284294
"http://localhost:8080/ian/items/de8fcb0b-0b1c-4c34-9173-a83d1b0be6b5/1/?attachment.uuid=398dbef0-7d12-4b72-af3d-095dd70b019d",
@@ -324,6 +334,7 @@ export const basicVideoSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
324334
preview: false,
325335
mimeType: "video/mp4",
326336
hasGeneratedThumb: true,
337+
brokenAttachment: false,
327338
links: {
328339
view:
329340
"http://localhost:8080/ian/items/59139c45-788b-4200-a9cb-e4a39e76ad35/1/?attachment.uuid=d81a7599-89a2-474e-b756-50bda202b349",
@@ -370,6 +381,7 @@ export const basicVideoSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
370381
preview: false,
371382
mimeType: "image/jpeg",
372383
hasGeneratedThumb: true,
384+
brokenAttachment: false,
373385
links: {
374386
view:
375387
"http://localhost:8080/ian/items/9d5112d4-87b6-4ac1-b773-ceaa4a6c5205/1/?attachment.uuid=e82207be-a9f2-442a-a17f-5c834d5b36cc",
@@ -384,6 +396,7 @@ export const basicVideoSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
384396
description:
385397
"These Simple Words Will Help You Through Life's Most Difficult Situations | Ryan Holiday",
386398
preview: false,
399+
brokenAttachment: false,
387400
links: {
388401
view:
389402
"http://localhost:8080/ian/items/9d5112d4-87b6-4ac1-b773-ceaa4a6c5205/1/?attachment.uuid=33eb363d-77f4-4d40-84a3-d0ae1687b5f6",
@@ -398,6 +411,7 @@ export const basicVideoSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
398411
description:
399412
"Stoicism and the Art of Resilience | Ryan Holiday | Epictetus",
400413
preview: false,
414+
brokenAttachment: false,
401415
links: {
402416
view:
403417
"http://localhost:8080/ian/items/9d5112d4-87b6-4ac1-b773-ceaa4a6c5205/1/?attachment.uuid=9fc093fa-f03a-45a5-98df-17381d63972f",
@@ -412,6 +426,7 @@ export const basicVideoSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
412426
description:
413427
"Stoicism's Simple Secret To Being Happier | Ryan Holiday | Daily Stoic",
414428
preview: false,
429+
brokenAttachment: false,
415430
links: {
416431
view:
417432
"http://localhost:8080/ian/items/9d5112d4-87b6-4ac1-b773-ceaa4a6c5205/1/?attachment.uuid=97bc82ed-fda4-40a9-91ea-e32da76e66a2",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
/*
2+
* Licensed to The Apereo Foundation under one or more contributor license
3+
* agreements. See the NOTICE file distributed with this work for additional
4+
* information regarding copyright ownership.
5+
*
6+
* The Apereo Foundation licenses this file to you under the Apache License,
7+
* Version 2.0, (the "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at:
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
import * as OEQ from "@openequella/rest-api-client";
19+
20+
export const fileAttachment: OEQ.Search.Attachment = {
21+
attachmentType: "file",
22+
id: "9e751549-5cba-47dd-bccb-722c48072287",
23+
description: "broken.png",
24+
preview: false,
25+
mimeType: "image/png",
26+
hasGeneratedThumb: true,
27+
brokenAttachment: false,
28+
links: {
29+
view:
30+
"http://localhost:8080/rest/items/72558c1d-8788-4515-86c8-b24a28cc451e/1/?attachment.uuid=78b8af7e-f0f5-4b5c-9f44-16f212583fe8",
31+
thumbnail: "./thumb.jpg",
32+
},
33+
};
34+
35+
export const brokenFileAttachment: OEQ.Search.Attachment = {
36+
attachmentType: "file",
37+
id: "9e751549-5cba-47dd-bccb-722c48072287",
38+
description: "broken.png",
39+
preview: false,
40+
mimeType: "image/png",
41+
hasGeneratedThumb: true,
42+
brokenAttachment: true,
43+
links: {
44+
view:
45+
"http://localhost:8080/rest/items/72558c1d-8788-4515-86c8-b24a28cc451e/1/?attachment.uuid=78b8af7e-f0f5-4b5c-9f44-16f212583fe8",
46+
thumbnail: "./thumb.jpg",
47+
},
48+
};
49+
50+
export const resourceFileAttachment: OEQ.Search.Attachment = {
51+
attachmentType: "custom/resource",
52+
id: "2c663052-a472-4b3e-b4d1-a25a5cd45675",
53+
description: "miss-violet.jpg",
54+
brokenAttachment: false,
55+
preview: false,
56+
mimeType: "image/jpeg",
57+
links: {
58+
view:
59+
"http://localhost:8080/rest/items/9ba9a328-4697-4ae0-9dba-3f82f1876fb8/1/?attachment.uuid=2c663052-a472-4b3e-b4d1-a25a5cd45675",
60+
thumbnail: "./thumb.jpg",
61+
},
62+
};
63+
export const linkAttachment: OEQ.Search.Attachment = {
64+
attachmentType: "link",
65+
id: "7d84f75e-1756-4af0-b4e1-2553b52885f0",
66+
description: "https://www.google.com",
67+
brokenAttachment: false,
68+
preview: false,
69+
links: {
70+
view:
71+
"http://localhost:8080/rest/items/1dc04a21-9659-487f-b784-66726fa59bdc/1/?attachment.uuid=7d84f75e-1756-4af0-b4e1-2553b52885f0",
72+
thumbnail: "./thumb.jpg",
73+
},
74+
};
75+
76+
export const resourceLinkAttachment: OEQ.Search.Attachment = {
77+
attachmentType: "custom/resource",
78+
id: "02f8f12e-8222-4c5b-b89a-888cbbbc402d",
79+
description: "https://www.google.com",
80+
brokenAttachment: false,
81+
preview: false,
82+
mimeType: "equella/link",
83+
links: {
84+
view:
85+
"http://localhost:8080/rest/items/a321a2f7-2228-4853-8292-54f390976049/1/?attachment.uuid=02f8f12e-8222-4c5b-b89a-888cbbbc402d",
86+
thumbnail: "./thumb.jpg",
87+
},
88+
};
89+
90+
export const equellaItemAttachment: OEQ.Search.Attachment = {
91+
attachmentType: "custom/resource",
92+
id: "7140295f-7fe0-4b6b-b621-eb2adfbd386f",
93+
description: "a321a2f7-2228-4853-8292-54f390976049",
94+
brokenAttachment: false,
95+
preview: false,
96+
mimeType: "equella/item",
97+
links: {
98+
view:
99+
"http://localhost:8080/rest/items/475a5e1b-4558-43f9-aeb4-9d49408197be/1/?attachment.uuid=7140295f-7fe0-4b6b-b621-eb2adfbd386f",
100+
thumbnail:
101+
"http://localhost:8080/rest/thumbs/475a5e1b-4558-43f9-aeb4-9d49408197be/1/7140295f-7fe0-4b6b-b621-eb2adfbd386f",
102+
},
103+
};
104+
105+
export const htmlAttachment: OEQ.Search.Attachment = {
106+
attachmentType: "html",
107+
id: "ef533d4c-15fc-45d4-91ee-0873e17fa7cb",
108+
description: "New Page",
109+
brokenAttachment: false,
110+
preview: false,
111+
mimeType: "text/html",
112+
links: {
113+
view:
114+
"http://localhost:8080/rest/items/eb099d2a-d1a8-4e4e-98ff-fec42587adb4/1/?attachment.uuid=ef533d4c-15fc-45d4-91ee-0873e17fa7cb",
115+
thumbnail:
116+
"http://localhost:8080/rest/thumbs/eb099d2a-d1a8-4e4e-98ff-fec42587adb4/1/ef533d4c-15fc-45d4-91ee-0873e17fa7cb",
117+
},
118+
};
119+
120+
export const resourceHtmlAttachment: OEQ.Search.Attachment = {
121+
attachmentType: "custom/resource",
122+
id: "1fa39170-ad0a-4607-9e37-bac86a8dea32",
123+
description: "New Page",
124+
brokenAttachment: false,
125+
preview: false,
126+
mimeType: "text/html",
127+
links: {
128+
view:
129+
"http://localhost:8080/rest/items/550a3047-eb17-4db4-8b1e-6adbf6d63f3b/1/?attachment.uuid=1fa39170-ad0a-4607-9e37-bac86a8dea32",
130+
thumbnail:
131+
"http://localhost:8080/rest/thumbs/550a3047-eb17-4db4-8b1e-6adbf6d63f3b/1/1fa39170-ad0a-4607-9e37-bac86a8dea32",
132+
},
133+
};

0 commit comments

Comments
 (0)