@@ -15,7 +15,7 @@ Property owner As %String;
15
15
16
16
Index Owner On owner ;
17
17
18
- Property description As %String (MAXLEN = 200 , TRUNCATE = 1 );
18
+ Property description As %String (MAXLEN = 1000 , TRUNCATE = 1 );
19
19
20
20
Property keywords As list Of %String ;
21
21
@@ -173,6 +173,28 @@ ClassMethod Populate(Path As %String, kill = 0)
173
173
}
174
174
}
175
175
176
+ Method UpdateDescriptionFromManifest () As %Status
177
+ {
178
+ Try {
179
+ //save xml to file
180
+ Set tFileName = $$$FileTempDir_" /manifest.xml"
181
+ Set stream =##class (%Stream.FileCharacter ).%New ()
182
+ $$$ThrowOnError(stream .LinkToFile (tFileName ))
183
+ $$$ThrowOnError(stream .CopyFrom (..manifest ))
184
+ $$$ThrowOnError(stream .%Save ())
185
+ Kill stream
186
+ $$$ThrowOnError(##class (%XML.XPATH.Document ).CreateFromFile (tFileName , .tDocument ))
187
+ $$$ThrowOnError(tDocument .EvaluateExpression (" /Module/Description" , " text()" , .tRes ))
188
+ If (tRes .Count ()>0 ) {
189
+ Set ..description = tRes .GetAt (1 ).Value
190
+ }
191
+ } Catch ex {
192
+ Do ex .Log ()
193
+ return ex .AsStatus ()
194
+ }
195
+ return $$$OK
196
+ }
197
+
176
198
ClassMethod LoadPackage (Path As %String , repository As %String = " " , silent As %Boolean = 0 ) As %Status
177
199
{
178
200
SET tStream = ##class (%Stream.FileCharacter ).%New ()
@@ -205,6 +227,10 @@ ClassMethod LoadPackage(Path As %String, repository As %String = "", silent As %
205
227
WRITE !," Version: " , version
206
228
}
207
229
230
+ SET tSC =tDocument .EvaluateExpression (" /Export/Document/Module/Description" , " text()" , .tRes )
231
+ IF $$$ISERR(tSC ) Return tSC
232
+ SET description = tRes .GetAt (1 ).Value
233
+
208
234
SET archive = ##class (%Stream.FileBinary ).%New ()
209
235
SET archiveFileName = ##class (%File ).TempFilename (" tgz" )
210
236
SET archive .Filename = archiveFileName
@@ -220,6 +246,7 @@ ClassMethod LoadPackage(Path As %String, repository As %String = "", silent As %
220
246
do ..%DeleteId (name _ " ||" _version )
221
247
SET package = ..%New ()
222
248
SET package .name = name
249
+ Set package .description = description
223
250
Set package .repository = repository
224
251
SET package .version = version
225
252
SET package .package = archive
@@ -387,9 +414,9 @@ ClassMethod GetSSLConfiguration(host) As %String
387
414
QUIT host
388
415
}
389
416
390
- Query ListLatest (searchTerm As %String = " " ) As %SQLQuery (ROWSPEC = " name:%String,repository:%String,version:%String" )
417
+ Query ListLatest (searchTerm As %String = " " ) As %SQLQuery (ROWSPEC = " name:%String,description:%String, repository:%String,version:%String" )
391
418
{
392
- SELECT name , repository , (
419
+ SELECT name , description , repository , (
393
420
SELECT TOP 1 version FROM ZPM .Package p2 WHERE p1 .name =p2 .name
394
421
ORDER BY versionMajor DESC , versionMinor DESC , versionPatch DESC , versionPrerelease DESC , versionBuildmetadata DESC ) version
395
422
FROM ZPM .Package p1
0 commit comments