All Downloads are FREE. Search and download functionalities are using the official Maven repository.

HtmlDefaultRepresentation.defaultHtmlCollection.jsp Maven / Gradle / Ivy

<%--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
    
     http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
--%>

<%@page import="org.apache.wink.common.model.synd.SyndFeed"%>
<%@page import="java.util.List"%>
<%@page import="org.apache.wink.common.model.synd.SyndLink"%>
<%@page import="org.apache.wink.common.model.synd.SyndCategory"%>
<%@page import="org.apache.wink.common.model.synd.SyndEntry"%>

<%
	HtmlSyndFeedAdapter htmlRepresentationCollectionAdapter = (HtmlSyndFeedAdapter)request.getAttribute(HtmlConstants.RESOURCE_ATTRIBUTE_NAME_REQUEST);
	String id = htmlRepresentationCollectionAdapter.getId();
	String title = htmlRepresentationCollectionAdapter.getTitle();
	String subTitle = htmlRepresentationCollectionAdapter.getSubTitle();	
	String updated =  htmlRepresentationCollectionAdapter.getUpdated();
	String author =  htmlRepresentationCollectionAdapter.getAuthor();
	List links = htmlRepresentationCollectionAdapter.getLinks();
	List categories = htmlRepresentationCollectionAdapter.getCategories();
	int numOfEntries = htmlRepresentationCollectionAdapter.getNumOfEntries();
	HtmlSyndEntryAdapter htmlRepresentationEntryAdapter = null;
	SyndEntry documentResource = null;

	String borderSize = "0";
%>




<%			
	// Add Open Search Link
	if (links != null && links.size() > 0) {
	String linkHref = "";
	String linkRel = "";
	String linkType = "";
	String linkTitle = "";
	String searchLink = "";
	for(int i = 0; i < links.size(); ++i) { 
	    	SyndLink link = links.get(i);
			linkHref = link.getHref();
			linkRel = link.getRel();
			linkType = link.getType();
			linkTitle = link.getTitle();
			if(AtomConstants.ATOM_REL_SEARCH.equals(linkRel)) {
				if(linkTitle == null) {
					linkTitle = title;
				}
			%>
			
			<%
			}
		}
}
%>





<% if (links != null && links.size() > 0) { %> <% } if (categories != null && categories.size() > 0) { %> <% } if(numOfEntries > 0) { %> <% } %>
<%=title%>
<%=subTitle%>
<%=ExpandableSectionHelper.getFormHeaderHtml("Metadata","metadata",false)%>
Id: <%=id%>   Updated: <%=updated%>
Author: <%=author%>  
<%=ExpandableSectionHelper.getFormFooterHtml("metadata",false)%>
<%=ExpandableSectionHelper.getFormHeaderHtml("Links","linksId",true)%> <% String linkHref = ""; String linkRel = ""; for(int i = 0; i < links.size(); i++) { linkHref = links.get(i).getHref(); linkRel = links.get(i).getRel(); %> <% } %>
Rel Link Type
<%=linkRel%> <% //incase of edit link, don't display it linkable if(AtomConstants.ATOM_REL_EDIT.equals(linkRel)) { %> <%= linkHref%> <% } else { %> <%=linkHref%> <% } %> <% if(links.get(i).getType()!=null) { %><%=links.get(i).getType()%><% } %> 
<%=ExpandableSectionHelper.getFormFooterHtml("linksId",true)%>
<%=ExpandableSectionHelper.getFormHeaderHtml("Categories","categoryId",true)%> <% for(int i = 0; i < categories.size(); i++) { %> <% } %>
scheme term
<%=categories.get(i).getScheme()%> <% if (categories.get(i).getTerm() != null) {%> <%=categories.get(i).getTerm()%> <% } %> 
<%=ExpandableSectionHelper.getFormFooterHtml("categoryId",true)%>
<% for(int i = 0;i < numOfEntries; i++) { documentResource = htmlRepresentationCollectionAdapter.getSyndEntry(i); htmlRepresentationEntryAdapter = new HtmlSyndEntryAdapter(documentResource); %> <% } %>
<%= ExpandableSectionHelper.getFormHeaderHtml(htmlRepresentationEntryAdapter.getTitle(),"entry"+i,true)%>
<%= htmlRepresentationEntryAdapter.getSummary()%> 
Id: <%= htmlRepresentationEntryAdapter.getId()%>    Updated: <%= htmlRepresentationEntryAdapter.getUpdated()%> 
Published: <%= htmlRepresentationEntryAdapter.getPublished()%> 
Author: <%= htmlRepresentationEntryAdapter.getAuthor()%> 
<% links = htmlRepresentationEntryAdapter.getLinks(); if(links != null && links.size() > 0) { %> <% String linkRel = ""; for(int j=0;j <% } %>
Rel Link Type
<%=linkRel%> <% //incase of edit link, don't display it linkable if(AtomConstants.ATOM_REL_EDIT.equals(linkRel)) { %> <%= links.get(j).getHref()%> <% } else { %> <%= links.get(j).getHref() %> <% } %> <% if (links.get(j).getType()!=null) { %><%=links.get(j).getType()%><% } %> 
<% } %>
<% categories = htmlRepresentationEntryAdapter.getCategories(); if(categories != null && categories.size() > 0) { %> <% for(int j=0; j < categories.size(); j++) { %> <% } } %>
Scheme Term
<%= categories.get(j).getScheme() %> <% if (categories.get(j).getTerm() != null) { %><%= categories.get(j).getTerm()%><% } %> 
 
<%= ExpandableSectionHelper.getFormFooterHtml("entry"+i,true) %>
<%@page import="org.apache.wink.server.internal.providers.entity.html.HtmlSyndFeedAdapter"%> <%@page import="org.apache.wink.server.internal.providers.entity.html.HtmlSyndEntryAdapter"%> <%@page import="org.apache.wink.server.internal.providers.entity.html.HtmlConstants"%> <%@page import="org.apache.wink.common.model.atom.AtomConstants"%> <%@page import="org.apache.wink.server.internal.providers.entity.html.ExpandableSectionHelper"%>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy