pvollenweider 2005/04/28 10:29:33 CEST
Modified files: (Branch: JAHIA-4-1-BRANCH)
src/view/jsp blog.jsp blog_listing.jsp
Added files: (Branch: JAHIA-4-1-BRANCH)
src/view/jsp/include blog_categories.inc blog_list.inc
blog_listing_filters.inc
blog_searchbox.inc
Log:
Right column with box layout
Revision Changes Path
1.1.2.23 +3 -38 corporate_portal_templates/src/view/jsp/blog.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/blog.jsp.diff?r1=1.1.2.22&r2=1.1.2.23&f=h
1.1.2.40 +6 -263 corporate_portal_templates/src/view/jsp/blog_listing.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/blog_listing.jsp.diff?r1=1.1.2.39&r2=1.1.2.40&f=h
1.1.2.1 +36 -0
corporate_portal_templates/src/view/jsp/include/blog_categories.inc (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/include/blog_categories.inc?rev=1.1.2.1&content-type=text/plain
1.1.2.1 +118 -0
corporate_portal_templates/src/view/jsp/include/blog_list.inc (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/include/blog_list.inc?rev=1.1.2.1&content-type=text/plain
1.1.2.1 +117 -0
corporate_portal_templates/src/view/jsp/include/blog_listing_filters.inc (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/include/blog_listing_filters.inc?rev=1.1.2.1&content-type=text/plain
1.1.2.1 +21 -0
corporate_portal_templates/src/view/jsp/include/blog_searchbox.inc (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/include/blog_searchbox.inc?rev=1.1.2.1&content-type=text/plain
Index: blog.jsp
===================================================================
RCS file:
/home/cvs/repository/corporate_portal_templates/src/view/jsp/Attic/blog.jsp,v
retrieving revision 1.1.2.22
retrieving revision 1.1.2.23
diff -u -r1.1.2.22 -r1.1.2.23
--- blog.jsp 27 Apr 2005 14:17:48 -0000 1.1.2.22
+++ blog.jsp 28 Apr 2005 08:29:32 -0000 1.1.2.23
@@ -49,44 +49,9 @@
<td valign="top">
<div class="calendar">
<%=printMonthView(t,bypassUrl,range,logger,false,jData,request)%>
- <br/>
-
- <h3><jahia:resourceBundle
resourceBundle="jahiatemplates.Corporate_portal_templates"
- resourceName="search"/> <jahia:resourceBundle
resourceBundle="jahiatemplates.Corporate_portal_templates"
- resourceName="blog.in"/> <jahia:currentPageTitle/></h3>
- <form action="<%=bypassUrl%>" method="get" name="searchblog">
- <input name="blogSearchString" type="text"
value="<%=blogSearchString%>"/>
- <a
href="javascript:checkMaxPageItems();document.searchblog.submit()"><img
- src="<jahia:contextURL/>/images/search.gif"
alt="<jahia:resourceBundle
-
resourceBundle="jahiatemplates.Corporate_portal_templates"
- resourceName="search"/>" width="15" height="15"
border="0" align="middle"/></a>
- </form>
-
- <h3><jahia:resourceBundle
resourceBundle="jahiatemplates.Corporate_portal_templates"
- resourceName="blog.categories"/></h3>
- <ul class="offsite">
- <li><a href="<%=bypassUrl%>"><jahia:resourceBundle
resourceBundle="jahiatemplates.Corporate_portal_templates"
- resourceName="blog.allCategories"/></a></li>
- <%
- for (int i = 0; i < categoriesAL.size(); i++) {
- String categoryKey = (String) categoriesAL.get(i);
- try {
- Category curCategory = Category.getCategory(categoryKey);
- if (curCategory != null) {
- String categoryTitle =
curCategory.getTitle(jParams.getLocale());
- if (categoryTitle == null) {
- categoryTitle = categoryKey;
- }
- %><li><a
href="<%=bypassUrl%>?category=<%=categoryKey%>"><%=categoryTitle%></a></li><%
- } else {
- logger.debug("Category is null for categoryKey
["+categoryKey+"]");
- }
- } catch (JahiaException je) {
- logger.debug("Could not get category with key [" +
categoryKey +"]");
- }
- }
- %>
- </ol>
+ <br/><br/>
+ <%@ include file="include/blog_searchbox.inc"%>
+ <%@ include file="include/blog_categories.inc"%>
<jsp:include page="include/box.jsp" flush="true">
<jsp:param name="id" value="right"/>
<jsp:param name="width" value="160"/>
Index: blog_listing.jsp
===================================================================
RCS file:
/home/cvs/repository/corporate_portal_templates/src/view/jsp/Attic/blog_listing.jsp,v
retrieving revision 1.1.2.39
retrieving revision 1.1.2.40
diff -u -r1.1.2.39 -r1.1.2.40
--- blog_listing.jsp 27 Apr 2005 14:17:48 -0000 1.1.2.39
+++ blog_listing.jsp 28 Apr 2005 08:29:32 -0000 1.1.2.40
@@ -1,8 +1,8 @@
<%@ include file="include/header.inc"%>
<%@ include file="include/blog_declarations.inc"%>
+<%@ include file="include/blog_listing_filters.inc"%>
<%@ include file="include/blog_definitions.inc"%>
-
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" valign="top" style="padding-left:10px;">
@@ -32,123 +32,6 @@
logger.debug("Could not get category with key [" +
requestedCategory +"]");
}
}
- %>
- <%
- // last entries
- Vector containerFilterVector = new Vector();
-
- // on non-edit mode, hide pages with empty title
- if (! jData.gui().isEditMode()) {
- ContainerFilterBean emptyEntryFilter = new
ContainerFilterBean("title",jParams.getEntryLoadRequest());
-
emptyEntryFilter.addClause(ContainerFilterBean.COMP_NOT_EQUAL,"");
- containerFilterVector.add(emptyEntryFilter);
- }
-
- // get all blogs
- ContainerFilterByContainerDefinition entriesDefFilter =
- new ContainerFilterByContainerDefinition("entries",
jParams.getEntryLoadRequest());
- containerFilterVector.add(entriesDefFilter);
-
- String blogSearchString =
request.getParameter("blogSearchString");
-
- if (requestedCategory != null) {
- HashSet cats = new HashSet();
- Category cat = Category.getCategory(requestedCategory);
- if (cat != null) {
- cats.add(cat);
- //boolean withAllContainersOfCompoundContainerList =
false;
- //if (jData.gui().isEditMode()){
- // withAllContainersOfCompoundContainerList =
true;
- //}
- ContainerFilterByCategories categoryFilter =
- new ContainerFilterByCategories(cats,
jParams.getEntryLoadRequest(),false);
- containerFilterVector.add(categoryFilter);
- logger.debug("Add filter with category " +
requestedCategory);
- } else {
- logger.debug("Could not fing category " +
requestedCategory);
- }
- } else {
- if (blogSearchString != null) {
- // get the list of child pages to construct the query
- StringBuffer searchBlogQuery = new
StringBuffer(blogSearchString);
- ContentPage startPage =
ContentPage.getPage(jData.page().getID());
- int pageInfosFlag = ContentPage.ACTIVE_PAGE_INFOS |
ContentPage.STAGING_PAGE_INFOS;
- FlatSiteMapViewHelper flatSiteMap = new
FlatSiteMapViewHelper(jParams.getUser(), startPage, pageInfosFlag,
-
jParams.getLocale().toString(), FlatSiteMapViewHelper.DEFAULT_LEVEL);
-
- searchBlogQuery.append(" AND (");
- for (int j = 0; j < flatSiteMap.size(); j++) {
- int pageId = flatSiteMap.getPageID(j);
- if (j > 0){
- searchBlogQuery.append(" OR ");
- }
- searchBlogQuery.append("pageid:" + pageId );
- }
- searchBlogQuery.append(")");
- searchBlogQuery.append(" AND
(container_definition_name:entries OR container_definition_name:comments)");
-
- logger.debug("Query is " +
searchBlogQuery.toString());
- ContainerSearcher containerSearcher = new
ContainerSearcher(jParams.getSiteID(),null,searchBlogQuery.toString(),jParams.getEntryLoadRequest());
-
request.setAttribute("entries_search_handler",containerSearcher);
-
- } else {
- blogSearchString = "";
- if (request.getParameter("t") != null) {
- // add filter on field date
- // Adding equality comparison with selected
values
- Calendar cal = Calendar.getInstance();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
- cal.setTime(new Date(t));
-
- cal.set( Calendar.HOUR_OF_DAY, 0 );
- cal.set( Calendar.MINUTE, 0);
- cal.set( Calendar.SECOND, -1);
-
- if ("week".equals(range)){
- cal.set( Calendar.DAY_OF_WEEK,
Calendar.MONDAY);
- }
- if ("month".equals(range)){
- cal.set( Calendar.DAY_OF_MONTH, 1);
- }
- if ("year".equals(range)){
- cal.set( Calendar.DAY_OF_YEAR, 1);
- }
- Date lowerVal = cal.getTime();
- cal.add( Calendar.HOUR_OF_DAY, 24 );
- if ("week".equals(range)){
- cal.add( Calendar.HOUR_OF_DAY, 24*6 );
- }
- if ("month".equals(range)){
- cal.add( Calendar.MONTH, 1 );
- }
- if ("year".equals(range)){
- cal.add( Calendar.YEAR, 1 );
- }
- Date upperVal = cal.getTime();
-
- logger.debug("Filter from " + sdf.format( (new
Date(lowerVal.getTime())) ) + " to " +
- sdf.format( (new Date(upperVal.getTime()))
));
-
- ContainerFilterBean dateFilter = new
ContainerFilterBean("date",true,jParams.getEntryLoadRequest());
-
dateFilter.addClause(ContainerFilterBean.COMP_SMALLER,
String.valueOf(upperVal.getTime()) );
- containerFilterVector.add(dateFilter);
-
- dateFilter = new
ContainerFilterBean("date",true,jParams.getEntryLoadRequest());
-
dateFilter.addClause(ContainerFilterBean.COMP_BIGGER,
String.valueOf(lowerVal.getTime()) );
- containerFilterVector.add(dateFilter);
- }
- }
- }
- if ( containerFilterVector.size()>0 ) {
- ContainerFilters containerFilters =
- new
ContainerFilters(containerFilterVector,jParams.getSiteID(),"entries");
-
request.setAttribute("entries_filter_handler",containerFilters);
- }
- // sort by date desc
- ContainerSorterByContainerDefinition entries_sort_handler =
- new ContainerSorterByContainerDefinition(-1, "date",
"entries",jParams.getEntryLoadRequest(), true);
- entries_sort_handler.setDescOrdering();
-
request.setAttribute("entries_sort_handler",entries_sort_handler);
JahiaContainerList entries =
jData.containers().getContainerList( "entries" );
// create container list if don't exist
@@ -373,151 +256,11 @@
<td><img src="<jahia:contextURL/>/images/pix.gif" width="25" height="12"
alt=""/></td>
<td valign="top">
<div class="calendar">
- <%=printMonthView(t,bypassUrl,range,logger,true,jData,request)%>
- <br/>
-
- <h3><jahia:resourceBundle
resourceBundle="jahiatemplates.Corporate_portal_templates"
- resourceName="search"/> <jahia:resourceBundle
resourceBundle="jahiatemplates.Corporate_portal_templates"
- resourceName="blog.in"/> <jahia:currentPageTitle/></h3>
- <form action="<%=bypassUrl%>" method="get" name="searchblog">
- <input name="blogSearchString" type="text"
value="<%=blogSearchString%>"/>
- <a
href="javascript:checkMaxPageItems();document.searchblog.submit()"><img
- src="<jahia:contextURL/>/images/search.gif"
alt="<jahia:resourceBundle
-
resourceBundle="jahiatemplates.Corporate_portal_templates"
- resourceName="search"/>" width="15" height="15"
border="0" align="middle"/></a>
- </form>
-
- <content:declareContainerList name="blogs" title="List of blogs">
- <content:declareContainer>
- <content:declareField name="blogPage" title="Title" type="Page"/>
- </content:declareContainer>
- </content:declareContainerList>
- <content:containerList name='blogs' id="blogs">
- <jahiaHtml:actionMenu name="blogs" namePostFix=""
- resourceBundle="jahiatemplates.Corporate_portal_templates">
- <h3><jahia:resourceBundle
resourceBundle="jahiatemplates.Corporate_portal_templates"
- resourceName="blog.blogs"/></h3>
- <%
- // get all pages with template definition name "Blog"
- JahiaPageDefinition pageDef =
- ServicesRegistry.getInstance().getJahiaPageTemplateService()
- .lookupPageTemplateByName ("Blog", jParams.getSiteID());
- Vector blogPagesId =
JahiaPageBaseService.getInstance().getPageIDsWithTemplate(pageDef.getID());
- Enumeration blogPagesIdEnum= blogPagesId.elements();
- request.removeAttribute("entries_filter_handler");
- request.removeAttribute("entries_sort_handler");
-
- ArrayList blogKeys = new ArrayList();
- Hashtable blogKeyToBlogPage = new Hashtable();
-
- while (blogPagesIdEnum.hasMoreElements()) {
- int blogPageId = ((Integer)
blogPagesIdEnum.nextElement()).intValue();
- ContentPage blogContentPage =
ContentPage.getPage(blogPageId);
- boolean displayBlog =
blogContentPage.getActiveAndStagingEntryStates().size() > 0;
- if (jData.gui().isNormalMode()) {
- displayBlog = blogContentPage.hasActiveEntries();
- }
- if (displayBlog) {
- JahiaPage blogPage =
blogContentPage.getPage(jParams.getEntryLoadRequest(),
- jParams.getOperationMode(),jParams.getUser());
- if (blogPage != null) {
- String blogTitle = blogPage.getTitle();
- if (blogTitle != null) {
- String blogKey = blogTitle.toLowerCase() + "_" +
blogPageId;
- blogKeys.add(blogKey);
- blogKeyToBlogPage.put(blogKey,blogPage);
- }
- }
- }
- }
- %>
- <%
- ContainerListBean blogsBean = (ContainerListBean)
pageContext.findAttribute("blogs");
- if
(blogsBean.getJahiaContainerList().checkWriteAccess(jParams.getUser())) {
- org.jahia.engines.JahiaEngine theAddContainerEngine =
- (org.jahia.engines.JahiaEngine)
org.jahia.registries.EnginesRegistry.getInstance().getEngine( "addcontainer" );
- StringBuffer addContName = new StringBuffer("addContainer_");
- addContName.append(blogsBean.getId());
-
addContName.append(jData.gui().html().cleanSessionID(jParams.getSessionID()));
- String addContHtml = theAddContainerEngine.renderLink(
jParams, blogsBean.getJahiaContainerList() );
- String launcher =
"OpenJahiaScrollableWindow('"+addContHtml+"','"+addContName+"',640,480)";
- %>
- <a
href="javascript:swithToEditMode();<%=launcher%>"><%=addButton%>
- <jahia:resourceBundle
resourceBundle="jahiatemplates.Corporate_portal_templates"
- resourceName="blog.addBlog"/>
- </a>
- <%
- }
-
-
- Collections.sort(blogKeys);
- %><ul class="offsite"><%
- savedCacheStatus = jParams.getCacheStatus();
- jParams.setCacheStatus(ParamBean.CACHE_BYPASS);
-
- for (int i = 0; i < blogKeys.size(); i++) {
- String blogKey = (String) blogKeys.get(i);
- JahiaPage blogPage = (JahiaPage)
blogKeyToBlogPage.get(blogKey);
-
- %>
- <li><a href="<%=blogPage.getURL(jParams)%>">
- <%=blogPage.getTitle()%></a>
- <%
-
- // get the entries container List
- int containerListId = ServicesRegistry.getInstance().
-
getJahiaContainersService().getContainerListID("entries", blogPage.getID());
- if (containerListId != -1) {
- JahiaContainerList entriesCl =
ServicesRegistry.getInstance().
- getJahiaContainersService().loadContainerList(
containerListId, LoadFlags.ALL, jParams );
-
- if (entriesCl != null) {
- %>(<%=entriesCl.getFullSize()%>)<%
- }
- }
- // if user is admin -> can delete blog
- if (jParams.getUser().isAdminMember( jParams.getSiteID() )) {
- //let's get the parent container
- PageBean blogPageBean = new PageBean(blogPage,jParams);
- FieldBean parentFieldBean =
(FieldBean)blogPageBean.getParent();
- ContainerBean parentContainerBean =
(ContainerBean)parentFieldBean.getParent();
-
jData.gui().html().drawBeginActionMenu(parentContainerBean ,
- null, null, false, "",
"jahiatemplates.Corporate_portal_templates", null, out);
- }
- }
- jParams.setCacheStatus(savedCacheStatus);
-
- %></li>
- </ul>
- </jahiaHtml:actionMenu>
- </content:containerList>
-
- <h3><jahia:resourceBundle
resourceBundle="jahiatemplates.Corporate_portal_templates"
- resourceName="blog.categories"/></h3>
- <ul class="offsite">
- <li><a href="<%=bypassUrl%>"><jahia:resourceBundle
resourceBundle="jahiatemplates.Corporate_portal_templates"
- resourceName="blog.allCategories"/></a></li>
- <%
- for (int i = 0; i < categoriesAL.size(); i++) {
- String categoryKey = (String) categoriesAL.get(i);
- try {
- Category curCategory = Category.getCategory(categoryKey);
- if (curCategory != null) {
- String categoryTitle =
curCategory.getTitle(jParams.getLocale());
- if (categoryTitle == null) {
- categoryTitle = categoryKey;
- }
- %><li><a
href="<%=bypassUrl%>?category=<%=categoryKey%>"><%=categoryTitle%></a></li><%
- } else {
- logger.debug("Category is null for categoryKey
["+categoryKey+"]");
- }
- } catch (JahiaException je) {
- logger.debug("Could not get category with key [" +
categoryKey +"]");
- }
- }
- %>
- </ol>
-
+ <%=printMonthView(t,bypassUrl,range,logger,true,jData,request)%>
+ <br/><br/>
+ <%@ include file="include/blog_searchbox.inc"%>
+ <%@ include file="include/blog_list.inc"%>
+ <%@ include file="include/blog_categories.inc"%>
<jsp:include page="include/box.jsp" flush="true">
<jsp:param name="id" value="right"/>
<jsp:param name="width" value="100"/>