mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
@@ -4,15 +4,27 @@
|
||||
<table *ngIf="results" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp full-width">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<span class="mdl-data-table__cell--non-numeric"></span>
|
||||
</th>
|
||||
<th>
|
||||
<span class="mdl-data-table__cell--non-numeric">Name</span>
|
||||
</th>
|
||||
<th>
|
||||
<span class="mdl-data-table__cell--non-numeric">Modified by</span>
|
||||
</th>
|
||||
<th>
|
||||
<span class="mdl-data-table__cell--non-numeric">Modified at</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr *ngFor="#result of results; #idx = index">
|
||||
<td><img src="{{getDocumentThumbnailUrl(result)}}" /></td>
|
||||
<td>{{result.entry.name}}</td>
|
||||
<td>{{result.entry.modifiedByUser.displayName}}</td>
|
||||
<td>{{result.entry.modifiedAt}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@@ -55,6 +55,30 @@ export class AlfrescoSearchComponent {
|
||||
this.displaySearchResults(this.currentSearchTerm);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets content URL for the given node.
|
||||
* @param node Node to get URL for.
|
||||
* @returns {string} URL address.
|
||||
*/
|
||||
getContentUrl(node: any): string {
|
||||
if (this._alfrescoService) {
|
||||
return this._alfrescoService.getContentUrl(node);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets thumbnail URL for the given document node.
|
||||
* @param node Node to get URL for.
|
||||
* @returns {string} URL address.
|
||||
*/
|
||||
getDocumentThumbnailUrl(node: any): string {
|
||||
if (this._alfrescoService) {
|
||||
return this._alfrescoService.getDocumentThumbnailUrl(node);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads and displays folder content
|
||||
* @param searchTerm Search query entered by user
|
||||
|
@@ -91,6 +91,26 @@ export class AlfrescoService {
|
||||
.catch(this.handleError);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get thumbnail URL for the given document node.
|
||||
* @param document Node to get URL for.
|
||||
* @returns {string} URL address.
|
||||
*/
|
||||
getDocumentThumbnailUrl(document: any) {
|
||||
return this.getContentUrl(document) + '/thumbnails/doclib?c=queue&ph=true&lastModified=1&alf_ticket=' + this.getAlfrescoTicket();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get content URL for the given node.
|
||||
* @param document Node to get URL for.
|
||||
* @returns {string} URL address.
|
||||
*/
|
||||
getContentUrl(document: any) {
|
||||
return this._host +
|
||||
'/alfresco/service/api/node/workspace/SpacesStore/' +
|
||||
document.entry.id + '/content';
|
||||
}
|
||||
|
||||
private handleError(error: Response) {
|
||||
// in a real world app, we may send the error to some remote logging infrastructure
|
||||
// instead of just logging it to the console
|
||||
|
Reference in New Issue
Block a user