Raystorm
Raystorm

Reputation: 6568

How can I add a custom Page to Alfresco share that copies the the look/feel of Alfresco Share?

Link to Project: https://github.com/raystorm/Alfresco-Smalgyax

I am trying to:

  1. Upload Documents into Alfresco/Share
  2. Set a custom Document Type
  3. Set Metadata
  4. Use a Form that matches the Look/Feel of Alfresco/Share

I have Added a menu Item to the Create... menu. The link points to the create-content Page. I was unable to upload the the file with that page. I set a custom file input field, but could not upload the file. I was unable to get a custom form template to work.

I have now switched tactics.
I have a custom share service that can:

  1. Upload the file
  2. Set Document Type
  3. Set Metadata.
  4. Bare-bones HTML page. Note: Does not match the Alfresco/Share look/feel.

How can I set the Share service page template to actually look like the create-content page?


UPDATE

I reset the get page to match the hello-world template.

the first line of the file:

<#include "/org/alfresco/include/alfresco-template.ftl" />

threw the following error:

smalgyax-share_1     | Caused by: freemarker.template.TemplateNotFoundException: Template not found for name "org/alfresco/include/alfresco-template.ftl".
smalgyax-share_1     | The name was interpreted by this TemplateLoader: MultiTemplateLoader(loader1 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader@3471b524, loader2 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader@e944270, loader3 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader@4a121f1c, loader4 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader@6aa5340e, loader5 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader@53c474eb, loader6 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader@7fef2b21, loader7 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader@255f313f, loader8 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader@661974de, loader9 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader@168a37da, loader10 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader@103ab009, loader11 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader@4c30bdf8, loader12 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader@61228f24).

The error occurs from both
service: http//:localhost:8180/share/service/hayts
and
Page: http://localhost:8180/share/page/upload-smalgyax-document

Upvotes: 0

Views: 600

Answers (2)

Arjun
Arjun

Reputation: 634

I have downloaded your source code and customized the share project and added a custom share page, it works perfectly for me without any issues.

Your project doesn't have the required css files that's the reason it doesn't looks like as like other alfresco pages.

Please follow the below project in github it will work, let me know if you face any issues. https://github.com/Alfresco/alfresco-sdk-samples/tree/alfresco-51/all-in-one/add-surf-dashlet-and-page-share

Custom Share Page Folder Structure

Update:

TemplateFolderMissing GitStructure

UPDATE:

Please add a entry in share-config-custom.xml and change the name from hayts.xml to helloworldhome.xml under /site-data/pages.

 <config evaluator="string-compare" condition="SitePages">
        <pages>
            <page id="helloworldhome">helloworldhome</page>
        </pages>
    </config>

Upvotes: 3

Sanjay
Sanjay

Reputation: 2503

You can place below line in share-config-custom.xml or you can create share extension module.

Change item id as per your custom type instead of cm:content.

You custom type form control should be properly configured in share-config-custom.xml.

<config evaluator="string-compare" condition="DocumentLibrary">
                    <create-content>
                        <content id="acme-plain-text" label="Custom Menu" icon="text" type="pagelink">
                            <param name="page">create-content?destination={nodeRef}&amp;itemId=cm:content&amp;mimeType=text/plain</param>
                        </content>
                    </create-content>
                </config>

Upvotes: 1

Related Questions