12-06-2014 07:56 AM
previewAction: function () {
console.log("Within Preview try");
var vs = win.getBox();
var nodeRef = "workspace://SpacesStore/" + this.entry.id;
this.payload = {
contentWidth: (vs.w*0.7) + "px",
contentHeight: (vs.h-64) + "px",
handleOverflow: false,
dialogTitle: "PreviewTitle",
additionalCssClasses: "no-padding",
widgetsContent: [
{
name: "alfresco/documentlibrary/AlfDocument",
nodeRef: nodeRef,
config: {
widgets: [
{
name: "alfresco/preview/AlfDocumentPreview"
}
]
}
}
],
widgetsButtons: [
{
name: "alfresco/buttons/AlfButton",
config: {
label: "close",
publishTopic: "NO_OP"
}
}
],
publishOnShow: [
{
publishTopic: "ALF_RETRIEVE_SINGLE_DOCUMENT_REQUEST",
publishPayload: {
nodeRef: nodeRef
}
}
]
};
12-08-2014 09:14 AM
12-09-2014 03:32 AM
model.jsonModel = {
services: ["alfresco/services/ContentService",
"alfresco/services/DocumentService",
"alfresco/dialogs/AlfDialogService"],
widgets: [
{
name: "softwareloop/preview/Preview"
}
]
};
define([
'dijit/_TemplatedMixin',
'dijit/_WidgetBase',
'dojo/_base/declare',
'dojo/text!./templates/Preview.html',
"dojo/date/locale",
"alfresco/core/Core",
"dojo/_base/lang",
"dojo/window"
], function (TemplatedMixin, WidgetBase, declare, template, locale, Core, lang, win ) {
return declare([WidgetBase, TemplatedMixin, Core], {
templateString: template,
payload: null,
buildRendering: function () {
this.inherited(arguments);
},
previewAction: function () {
console.log("Within Preview try");
var vs = win.getBox();
var nodeRef = "workspace://SpacesStore/" + "1a0b110f-1e09-4ca2-b367-fe25e4964a4e";
this.payload = {
contentWidth: (vs.w*0.7) + "px",
contentHeight: (vs.h-64) + "px",
handleOverflow: false,
dialogTitle: "PreviewTitle",
additionalCssClasses: "no-padding",
widgetsContent: [
{
name: "alfresco/documentlibrary/AlfDocument",
nodeRef: nodeRef,
config: {
widgets: [
{
name: "alfresco/preview/AlfDocumentPreview"
}
]
}
}
],
widgetsButtons: [
{
name: "alfresco/buttons/AlfButton",
config: {
label: "close",
publishTopic: "NO_OP"
}
}
],
publishOnShow: [
{
publishTopic: "ALF_RETRIEVE_SINGLE_DOCUMENT_REQUEST",
publishPayload: {
nodeRef: nodeRef
}
}
]
};
this.alfPublish("ALF_CREATE_DIALOG_REQUEST", this.payload);
}
});
});
<div class="inboxes-item">
<button class="inboxes-item-button" data-dojo-attach-event="click:previewAction">Preview</button>
</div>
12-09-2014 07:01 AM
define([
'dijit/_TemplatedMixin',
'dijit/_WidgetBase',
'dojo/_base/declare',
'dojo/text!./templates/Container.html',
"dojo/date/locale",
"alfresco/core/Core",
"dojo/_base/lang",
"dojo/window"
], function (TemplatedMixin, WidgetBase, declare, template, locale, Core, lang, win ) {
return declare([WidgetBase, TemplatedMixin, Core], {
templateString: template,
payload: null,
buildRendering: function () {
this.inherited(arguments);
},
postCreate: function () {
var containerNode = this.containerNode;
containerNode.innerHTML = "…";
require(["softwareloop/preview/Preview"], lang.hitch(this, function (Preview) {
var previewItem = new Preview();
previewItem.placeAt(containerNode).startup();
}));
}
});
});
define([
'dijit/_TemplatedMixin',
'dijit/_WidgetBase',
'dojo/_base/declare',
'dojo/text!./templates/Preview.html',
"dojo/date/locale",
"alfresco/core/Core",
"dojo/_base/lang",
"dojo/window"
], function (TemplatedMixin, WidgetBase, declare, template, locale, Core, lang, win ) {
return declare([WidgetBase, TemplatedMixin, Core], {
templateString: template,
payload: null,
buildRendering: function () {
this.inherited(arguments);
},
previewAction: function () {
console.log("Within Preview try");
var vs = win.getBox();
var nodeRef = "workspace://SpacesStore/" + "1a0b110f-1e09-4ca2-b367-fe25e4964a4e";
this.payload = {
contentWidth: (vs.w*0.7) + "px",
contentHeight: (vs.h-64) + "px",
handleOverflow: false,
dialogTitle: "PreviewTitle",
additionalCssClasses: "no-padding",
widgetsContent: [
{
name: "alfresco/documentlibrary/AlfDocument",
nodeRef: nodeRef,
config: {
widgets: [
{
name: "alfresco/preview/AlfDocumentPreview"
}
]
}
}
],
widgetsButtons: [
{
name: "alfresco/buttons/AlfButton",
config: {
label: "close",
publishTopic: "NO_OP"
}
}
],
publishOnShow: [
{
publishTopic: "ALF_RETRIEVE_SINGLE_DOCUMENT_REQUEST",
publishPayload: {
nodeRef: nodeRef
}
}
]
};
this.alfPublish("ALF_CREATE_DIALOG_REQUEST", this.payload);
}
});
});
model.jsonModel = {
services: ["alfresco/services/ContentService",
"alfresco/services/DocumentService",
"alfresco/dialogs/AlfDialogService"],
widgets: [
{
name: "softwareloop/preview/Container"
}
]
};
<div class="inboxes-results" data-dojo-attach-point="containerNode">
</div>
<div class="inboxes-item">
<button class="inboxes-item-button" data-dojo-attach-event="click:previewAction">Preview</button>
</div>
12-09-2014 10:29 AM
define([
'dijit/_TemplatedMixin',
'dijit/_WidgetBase',
'dojo/_base/declare',
'dojo/text!./templates/Container.html',
"dojo/date/locale",
"alfresco/core/Core",
"dojo/_base/lang",
"dojo/window",
"softwareloop/preview/Preview"
], function (TemplatedMixin, WidgetBase, declare, template, locale, Core, lang, win, Preview ) {
return declare([WidgetBase, TemplatedMixin, Core], {
templateString: template,
payload: null,
buildRendering: function () {
this.inherited(arguments);
},
postCreate: function () {
var containerNode = this.containerNode;
containerNode.innerHTML = "…";
var previewItem = new Preview();
previewItem.placeAt(containerNode).startup();
}
});
});
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.