-2

I'm starting using Alfresco Community 5.1 and I create a new Aikau page in Alfresco to use through an action button. I want to put the web preview of the document details, this web preview of this page:

Document Details Web Preview

How can I use this in another page?

Thanks! Please help me!

Petter S
  • 49
  • 8

1 Answers1

2

Let's assume that you're using at least Alfresco Community 5.0.d or Alfresco Enterprise 5.0... this would mean that you could create your new page using the Aikau framework. This gives you much more flexibility in how to build your page and re-use existing Alfresco components that are defined with Aikau. Although 5.0.d and 5.0 don't ship with the latest version of Aikau (which is released weekly) you can take advantage of the latest releases by following the information detailed here.

There is a detailed tutorial on using Aikau which contains a chapter on re-using the preview widgets. There is also the Aikau Sandpit which provides examples of using the preview widget.

Hopefully this will get you on your way!

Dave Draper
  • 1,837
  • 11
  • 25
  • Thanks !! Sorry. I'm using Alfresco Community 5.1 and i'm using Aikau page yes. But, i try to do this that you said, and I got an error: `org.springframework.extensions.webscripts.WebScriptException: 02180000 Failed to execute script 'classpath*:alfresco/site-webscripts/org/alfresco/dd/dd-document.get.js': invalid property id` ... Code: http://pastebin.com/uxz6BwVN Can you help me? – Petter S Mar 18 '16 at 12:12
  • 2
    Well, your JSON is invalid to start off with... you have an array that is not assigned to an id (that's what the error message is telling you). However, your model is also missing some key services, for example you're going to need the "alfresco/services/DocumentService" on the page in order to retrieve the full metadata for the nodeRef you're providing. – Dave Draper Mar 18 '16 at 12:16
  • But how can I define the last parte of the JSON `[ { "name": "alfresco/documentlibrary ...` with the above code that I have? Can you help me only with this part? – Petter S Mar 18 '16 at 12:19
  • 1
    Place lines 12 - 26 after line 9 (don't forget to add a comma) the square brackets on line 11 and line 27 aren't needed. – Dave Draper Mar 18 '16 at 12:21
  • 1
    This is what is should look like, try that: http://pastebin.com/sXJ5chGc – Dave Draper Mar 18 '16 at 12:25
  • Only one more question, how can i define the id? This continues to give me the error invalid property id . I put id="DOCUMENT_PREVIEW" – Petter S Mar 18 '16 at 12:36
  • Did you actually put id="DOCUMENT_PREVIEW"... because that also would not be valid, you'd need to use ":" rather than "=". – Dave Draper Mar 18 '16 at 12:48
  • Are you remembering to ensure that you have commas in the appropriate places? What editor are you using to edit the file, does it have any syntax highlighting that can help to ensure that you're using valid JavaScript. Can you create another pastebin entry so I can review what you currently have? – Dave Draper Mar 18 '16 at 13:13
  • 1
    All done! :) The error is mine. The resolution was with the link that you post of the github, step 4. I want to make only a question, but I already accept yours, if you can help me, I thanked! If I want to put the preview in a page that is not aikau, how can I do this? – Petter S Mar 18 '16 at 13:40