mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
. RSS Feed logo now shown on the main Browse screen for a space if it has a feed template applied
. Fixed TemplateContentServlet to allow addition URL elements to specify filename for output stream git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3539 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -142,7 +142,7 @@ public class TemplateContentServlet extends BaseServlet
|
|||||||
|
|
||||||
templateRef = pathInfo.NodeRef;
|
templateRef = pathInfo.NodeRef;
|
||||||
}
|
}
|
||||||
else if (tokenCount == 7)
|
else if (tokenCount >= 7)
|
||||||
{
|
{
|
||||||
StoreRef storeRef = new StoreRef(t.nextToken(), t.nextToken());
|
StoreRef storeRef = new StoreRef(t.nextToken(), t.nextToken());
|
||||||
templateRef = new NodeRef(storeRef, t.nextToken());
|
templateRef = new NodeRef(storeRef, t.nextToken());
|
||||||
@@ -157,7 +157,7 @@ public class TemplateContentServlet extends BaseServlet
|
|||||||
|
|
||||||
if (nodeRef == null)
|
if (nodeRef == null)
|
||||||
{
|
{
|
||||||
throw new TemplateException("Not enough arguments supplied in URL.");
|
throw new TemplateException("Not enough elements supplied in URL or no 'path' argument specified.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the services we need to retrieve the content
|
// get the services we need to retrieve the content
|
||||||
|
@@ -698,6 +698,22 @@ public class NavigationBean
|
|||||||
return this.cifsServerPath;
|
return this.cifsServerPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if the current space has an RSS feed applied
|
||||||
|
*/
|
||||||
|
public boolean isRSSFeed()
|
||||||
|
{
|
||||||
|
return SpaceDetailsBean.hasRSSFeed(getCurrentNode());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return RSS Feed URL for the current space
|
||||||
|
*/
|
||||||
|
public String getRSSFeedURL()
|
||||||
|
{
|
||||||
|
return SpaceDetailsBean.buildRSSFeedURL(getCurrentNode());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Private helpers
|
// Private helpers
|
||||||
|
@@ -471,18 +471,41 @@ public class SpaceDetailsBean extends BaseDetailsBean
|
|||||||
*/
|
*/
|
||||||
public boolean isRSSFeed()
|
public boolean isRSSFeed()
|
||||||
{
|
{
|
||||||
return (getSpace().hasAspect(ContentModel.ASPECT_FEEDSOURCE) &&
|
return hasRSSFeed(getSpace());
|
||||||
getSpace().getProperties().get(ContentModel.PROP_FEEDTEMPLATE) != null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if the current space has an RSS feed applied
|
||||||
|
*/
|
||||||
|
public static boolean hasRSSFeed(Node space)
|
||||||
|
{
|
||||||
|
return (space.hasAspect(ContentModel.ASPECT_FEEDSOURCE) &&
|
||||||
|
space.getProperties().get(ContentModel.PROP_FEEDTEMPLATE) != null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return RSS Feed URL for the current space
|
||||||
|
*/
|
||||||
public String getRSSFeedURL()
|
public String getRSSFeedURL()
|
||||||
{
|
{
|
||||||
// build RSS feed template URL from selected template and current space NodeRef and
|
return buildRSSFeedURL(getSpace());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build URL for an RSS space based on the 'feedsource' aspect property.
|
||||||
|
*
|
||||||
|
* @param space Node to build RSS template URL for
|
||||||
|
*
|
||||||
|
* @return URL for the RSS feed for a space
|
||||||
|
*/
|
||||||
|
public static String buildRSSFeedURL(Node space)
|
||||||
|
{
|
||||||
|
// build RSS feed template URL from selected template and the space NodeRef and
|
||||||
// add the guest=true URL parameter - this is required for no login access and
|
// add the guest=true URL parameter - this is required for no login access and
|
||||||
// add the mimetype=text/xml URL parameter - required to return correct stream type
|
// add the mimetype=text/xml URL parameter - required to return correct stream type
|
||||||
return TemplateContentServlet.generateURL(getSpace().getNodeRef(),
|
return TemplateContentServlet.generateURL(space.getNodeRef(),
|
||||||
(NodeRef)getSpace().getProperties().get(ContentModel.PROP_FEEDTEMPLATE))
|
(NodeRef)space.getProperties().get(ContentModel.PROP_FEEDTEMPLATE))
|
||||||
+ "?guest=true" + "&mimetype=text%2Fxml";
|
+ "/rss.xml?guest=true" + "&mimetype=text%2Fxml";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -108,7 +108,11 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%-- Summary --%>
|
<%-- Summary --%>
|
||||||
<div class="mainTitle"><h:outputText value="#{NavigationBean.nodeProperties.name}" id="msg2" /> <a:actionLink image="/images/icons/opennetwork.gif" value="#{msg.network_folder} #{NavigationBean.nodeProperties.cifsPathLabel}" showLink="false" href="#{NavigationBean.nodeProperties.cifsPath}" rendered="#{NavigationBean.nodeProperties.cifsPath != null}" target="new" id="cifs" /></div>
|
<div class="mainTitle">
|
||||||
|
<h:outputText value="#{NavigationBean.nodeProperties.name}" id="msg2" />
|
||||||
|
<a:actionLink image="/images/icons/opennetwork.gif" value="#{msg.network_folder} #{NavigationBean.nodeProperties.cifsPathLabel}" showLink="false" href="#{NavigationBean.nodeProperties.cifsPath}" rendered="#{NavigationBean.nodeProperties.cifsPath != null}" target="new" id="cifs" />
|
||||||
|
<a:actionLink id="actRSS" value="#{msg.rss_feed_link}" showLink="false" image="/images/icons/rss.gif" href="#{NavigationBean.RSSFeedURL}" rendered="#{NavigationBean.RSSFeed == true}" />
|
||||||
|
</div>
|
||||||
<div class="mainSubText"><h:outputText value="#{msg.view_description}" id="msg3" /></div>
|
<div class="mainSubText"><h:outputText value="#{msg.view_description}" id="msg3" /></div>
|
||||||
<div class="mainSubText"><h:outputText value="#{NavigationBean.nodeProperties.description}" id="msg4" /></div>
|
<div class="mainSubText"><h:outputText value="#{NavigationBean.nodeProperties.description}" id="msg4" /></div>
|
||||||
</td>
|
</td>
|
||||||
|
Reference in New Issue
Block a user