且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

露天共享中的未经身份验证的 FreeMarker 页面

更新时间:2023-12-01 16:05:16

问题可能不是需要登录的页面,而是它包含的组件.我看到组件区域网络预览,如果这默认为默认网络预览:site-webscriptsorgalfrescocomponentspreviewweb-preview.get.desc.xml>

那么这个组件需要认证,没有标签,所以默认为user.

如果您删除该 <@region....> 标签,您将看到该页面.

i have create a new page in alfresco share but the page cannot be displayed without login! how can i make this page enabled without login.

my file in "/alfresco/templates/blog/demo/custom-viewer.ftl".

and this file contains "custom-viewer.ftl":

<#include "include/alfresco-template.ftl" />
<@templateHeader>
   <@script type="text/javascript" src="${url.context}/res/modules/documentlibrary/doclib-actions.js" group="document-details"/>
   <@link rel="stylesheet" type="text/css" href="${url.context}/res/components/document-    details/document-details-panel.css" group="document-details"/>
   <@templateHtmlEditorAssets />
</@>

<@templateBody>
   <@region id="web-preview" scope="template"/>
</@>

<@templateFooter>

</@>

and the file in "/alfresco/site-data/pages/custom-viewer.xml".

and this file contains "custom-viewer.xml":

<?xml version='1.0' encoding='UTF-8'?>
<page>
   <title>Custom Viewer</title>
   <template-instance>custom-viewer</template-instance>
   <authentication>none</authentication>
</page>

the page is work correctly but i need it to work without login? any help please?!!

The thing is probably not your page which needs login but the components it's including. I'm seeing component regioun web-preview, if this defaults to the default web-preview: site-webscriptsorgalfrescocomponentspreviewweb-preview.get.desc.xml

Then this components needs authentication, there is no <authentication> tag, so it defaults to user.

If you delete that <@region....> tag, you'll see the page.