Produced by Araxis Merge on Fri Oct 19 14:26:00 2007 UTC. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a reasonably standards compliant browser such as the latest version of Internet Explorer. For optimum results when printing this report, enable printing of background images and colours in your browser and use landscape orientation.
| # | File | Location | Last Modified |
|---|---|---|---|
| 1 | lastNews.inc | C:\jahia\template_diff\V2_JAHIA_5_0_2\src\jsp\box | Fri Oct 19 14:17:31 2007 UTC |
| 2 | lastNews.inc | C:\jahia\template_diff\V2_JAHIA_5_0_3\src\jsp\box | Fri Oct 19 14:16:50 2007 UTC |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Blocks | Lines | |
| Unchanged | 4 | 142 |
| Changed | 0 | 0 |
| Inserted | 3 | 21 |
| Removed | 1 | 3 |
| Whitespace | All differences in whitespace within lines are ignored |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Hidden in comparison detail |
No regular expressions were active.
| 1 | <%@ page import="org.jahia.bin.Jahia" %> | |||||
| 2 | <%@ page import="org.jahia.data.beans.ContainerBean" %> | |||||
| 3 | <%@ page import="org.jahia.data.containers.*" %> | |||||
| 4 | <%@ page import="org.jahia.registries.ServicesRegistry" %> | |||||
| 5 | <%@ page import="org.jahia.resourcebundle.ResourceBundleMarker" %> | |||||
| 6 | <%@ page import="org.jahia.security.license.LicenseActionChecker" %> | |||||
| 7 | <%@ page import="org.jahia.services.categories.Category" %> | |||||
| 8 | <%@ page import="org.jahia.services.pages.JahiaPage" %> | |||||
| 9 | <%@ page import="org.jahia.taglibs.esi.JesiConst" %> | |||||
| 10 | <%@ page import="org.jahia.taglibs.esi.JesiFragmentTag" %> | |||||
| 11 | <%@ page import="java.text.SimpleDateFormat" %> | |||||
| 12 | <%@ page import="java.util.*" %> | |||||
| 1 | <%-- | 13 | <%-- | |||
| 2 | Copyright 2002-2006 Jahia Ltd | 14 | Copyright 2002-2006 Jahia Ltd | |||
| 3 | 15 | |||||
| 4 | Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (JCDDL), | 16 | Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (JCDDL), | |||
| 5 | Version 1.0 (the "License"), or (at your option) any later version; you may | 17 | Version 1.0 (the "License"), or (at your option) any later version; you may | |||
| 6 | not use this file except in compliance with the License. You should have | 18 | not use this file except in compliance with the License. You should have | |||
| 7 | received a copy of the License along with this program; if not, you may obtain | 19 | received a copy of the License along with this program; if not, you may obtain | |||
| 8 | a copy of the License at | 20 | a copy of the License at | |||
| 9 | 21 | |||||
| 10 | http://www.jahia.org/license/ | 22 | http://www.jahia.org/license/ | |||
| 11 | 23 | |||||
| 12 | Unless required by applicable law or agreed to in writing, software | 24 | Unless required by applicable law or agreed to in writing, software | |||
| 13 | distributed under the License is distributed on an "AS IS" BASIS, | 25 | distributed under the License is distributed on an "AS IS" BASIS, | |||
| 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 26 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| 15 | See the License for the specific language governing permissions and | 27 | See the License for the specific language governing permissions and | |||
| 16 | limitations under the License. | 28 | limitations under the License. | |||
| 17 | --%><% | 29 | --%><% | |||
| 30 | if(Jahia.getSettings().isEsiCacheActivated()) { | |||||
| 31 | JesiFragmentTag fragmentTag = (JesiFragmentTag) pageContext.getAttribute( JesiConst.FRAGMENT_IN_USE, PageContext.REQUEST_SCOPE ); | |||||
| 32 | fragmentTag.setExpiration("900"); | |||||
| 33 | } else { | |||||
| 34 | jParams.setCacheExpirationDelay(90000); | |||||
| 35 | } | |||||
| 18 | String categoriespackage="org.jahia.actions.server.admin.categories.ManageCategories"; | 36 | String categoriespackage="org.jahia.actions.server.admin.categories.ManageCategories"; | |||
| 19 | boolean licenseEnabled = LicenseActionChecker.isAuthorizedByLicense(categoriespackage, 0); | 37 | boolean licenseEnabled = LicenseActionChecker.isAuthorizedByLicense(categoriespackage, 0); | |||
| 20 | String windowSize = "10"; | 38 | String windowSize = "10"; | |||
| 21 | JahiaContainerList maxContainerList = boxContainer.getContainerList( "newsCl" ); | 39 | JahiaContainerList maxContainerList = boxContainer.getContainerList( "newsCl" ); | |||
| 22 | Enumeration newsEnumeration = maxContainerList.getContainers(); | 40 | Enumeration newsEnumeration = maxContainerList.getContainers(); | |||
| 23 | Set categories = Category.getObjectCategories(boxContainerBean.getContentContainer().getObjectKey()); | 41 | Set categories = Category.getObjectCategories(boxContainerBean.getContentContainer().getObjectKey()); | |||
| 24 | if (isEditMode) { | 42 | if (isEditMode) { | |||
| 25 | StringBuffer displayNewsFromCategories = new StringBuffer(""); | 43 | StringBuffer displayNewsFromCategories = new StringBuffer(""); | |||
| 26 | Iterator ite = categories.iterator(); | 44 | Iterator ite = categories.iterator(); | |||
| 27 | while (ite.hasNext()) { | 45 | while (ite.hasNext()) { | |||
| 28 | Category curCategory = (Category)ite.next(); | 46 | Category curCategory = (Category)ite.next(); | |||
| 29 | if (curCategory != null) { | 47 | if (curCategory != null) { | |||
| 30 | String categoryTitle = curCategory.getTitle(jParams.getLocale()); | 48 | String categoryTitle = curCategory.getTitle(jParams.getLocale()); | |||
| 31 | if (categoryTitle == null) { | 49 | if (categoryTitle == null) { | |||
| 32 | categoryTitle = curCategory.getKey(); | 50 | categoryTitle = curCategory.getKey(); | |||
| 33 | } | 51 | } | |||
| 34 | displayNewsFromCategories.append(categoryTitle); | 52 | displayNewsFromCategories.append(categoryTitle); | |||
| 35 | if (ite.hasNext()) { | 53 | if (ite.hasNext()) { | |||
| 36 | displayNewsFromCategories.append(", "); | 54 | displayNewsFromCategories.append(", "); | |||
| 37 | } | 55 | } | |||
| 38 | } | 56 | } | |||
| 39 | } | 57 | } | |||
| 40 | if(licenseEnabled){ | 58 | if(licenseEnabled){ | |||
| 41 | %><br/><content:resourceBundle resourceBundle="jahiatemplates.Corporate_portal_templates_v2" | 59 | %><br/><content:resourceBundle resourceBundle="jahiatemplates.Corporate_portal_templates_v2" | |||
| 42 | resourceName="blog.categories"/>: <%=displayNewsFromCategories.toString()%> | 60 | resourceName="blog.categories"/>: <%=displayNewsFromCategories.toString()%> | |||
| 43 | <% | 61 | <% | |||
| 44 | if ("".equals(displayNewsFromCategories.toString())) { | 62 | if ("".equals(displayNewsFromCategories.toString())) { | |||
| 45 | %> | 63 | %> | |||
| 46 | <content:resourceBundle resourceBundle="jahiatemplates.Corporate_portal_templates_v2" | 64 | <content:resourceBundle resourceBundle="jahiatemplates.Corporate_portal_templates_v2" | |||
| 47 | resourceName="message.addCategory"/> | 65 | resourceName="message.addCategory"/> | |||
| 48 | <% | 66 | <% | |||
| 49 | } | 67 | } | |||
| 50 | } | 68 | } | |||
| 51 | } | 69 | } | |||
| 52 | // create the filter | 70 | // create the filter | |||
| 53 | Vector filtersVector = new Vector(); | 71 | Vector filtersVector = new Vector(); | |||
| 54 | logger.debug("News filters"); | 72 | logger.debug("News filters"); | |||
| 55 | 73 | |||||
| 56 | // Set filters for box categ | 74 | // Set filters for box categ | |||
| 57 | if (! categories.isEmpty()) { | 75 | if (! categories.isEmpty()) { | |||
| 58 | ContainerFilterByCategories containerFilter = | 76 | ContainerFilterByCategories containerFilter = | |||
| 59 | new ContainerFilterByCategories(categories, jParams.getEntryLoadRequest(),false); | 77 | new ContainerFilterByCategories(categories, jParams.getEntryLoadRequest(),false); | |||
| 60 | filtersVector.add(containerFilter); | 78 | filtersVector.add(containerFilter); | |||
| 61 | } | 79 | } | |||
| 62 | 80 | |||||
| 63 | // set filter for date | 81 | // set filter for date | |||
| 64 | //if (! isEditMode) { | 82 | //if (! isEditMode) { | |||
| 65 | // long now = (new Date()).getTime(); | 83 | // long now = (new Date()).getTime(); | |||
| 66 | // ContainerFilterBean dateFilter = new ContainerFilterBean("date",true,jParams.getEntryLoadRequest()); | 84 | // ContainerFilterBean dateFilter = new ContainerFilterBean("date",true,jParams.getEntryLoadRequest()); | |||
| 67 | // dateFilter.addClause(ContainerFilterBean.COMP_SMALLER, String.valueOf(now) ); | 85 | // dateFilter.addClause(ContainerFilterBean.COMP_SMALLER, String.valueOf(now) ); | |||
| 68 | // filtersVector.add(dateFilter); | 86 | // filtersVector.add(dateFilter); | |||
| 69 | //} | 87 | //} | |||
| 70 | 88 | |||||
| 71 | // get all containers in site | 89 | // get all containers in site | |||
| 72 | ContainerFilterByContainerDefinition filterByContainerDefinition = | 90 | ContainerFilterByContainerDefinition filterByContainerDefinition = | |||
| 73 | new ContainerFilterByContainerDefinition("newsCl", jParams.getEntryLoadRequest()); | 91 | new ContainerFilterByContainerDefinition("newsCl", jParams.getEntryLoadRequest()); | |||
| 74 | filtersVector.add(filterByContainerDefinition); | 92 | filtersVector.add(filterByContainerDefinition); | |||
| 75 | logger.debug("create new filter by container definition"); | 93 | logger.debug("create new filter by container definition"); | |||
| 76 | 94 | |||||
| 77 | if ( filtersVector.size()>0 ) { | 95 | if ( filtersVector.size()>0 ) { | |||
| 78 | 96 | |||||
| 79 | ContainerFilters containerFilters = new ContainerFilters( | 97 | ContainerFilters containerFilters = new ContainerFilters( | |||
| 80 | filtersVector, jParams.getSiteID(), "newsCl"); | 98 | filtersVector, jParams.getSiteID(), "newsCl"); | |||
| 81 | request.setAttribute("newsCl_filter_handler", containerFilters); | 99 | request.setAttribute("newsCl_filter_handler", containerFilters); | |||
| 82 | 100 | |||||
| 83 | logger.debug("Set attibute news_filter_handler on request"); | 101 | logger.debug("Set attibute news_filter_handler on request"); | |||
| 84 | } | 102 | } | |||
| 85 | 103 | |||||
| 86 | // sort by date desc | 104 | // sort by date desc | |||
| 87 | ContainerSorterByContainerDefinition entries_sort_handler = | 105 | ContainerSorterByContainerDefinition entries_sort_handler = | |||
| 88 | new ContainerSorterByContainerDefinition(siteId, "date", "newsCl", true, entryLoadRequest) ; | 106 | new ContainerSorterByContainerDefinition(siteId, "date", "newsCl", true, entryLoadRequest) ; | |||
| 89 | entries_sort_handler.setDescOrdering(); | 107 | entries_sort_handler.setDescOrdering(); | |||
| 90 | request.setAttribute("newsCl_sort_handler",entries_sort_handler); | 108 | request.setAttribute("newsCl_sort_handler",entries_sort_handler); | |||
| 91 | 109 | |||||
| 110 | //logger.debug("Set container list pagination on newsContainerList to " + windowSize + " (" + pageContext.getAttribute("boxtitle") + ")"); | |||||
| 111 | request.setAttribute("newsCl_windowsize",windowSize); | |||||
| 112 | ||||||
| 92 | // if containerList empty then create it. | 113 | // if containerList empty then create it. | |||
| 93 | JahiaContainerList newsContainerList = jData.containers().getContainerList( "newsCl" ); | 114 | JahiaContainerList newsContainerList = jData.containers().getContainerList( "newsCl" ); | |||
| 94 | if ( newsContainerList !=null && newsContainerList.getID()==0 ) { | 115 | if ( newsContainerList !=null && newsContainerList.getID()==0 ) { | |||
| 95 | ServicesRegistry.getInstance().getJahiaContainersService(). | 116 | ServicesRegistry.getInstance().getJahiaContainersService(). | |||
| 96 | saveContainerListInfo(newsContainerList, jParams.getContentPage().getAclID()); | 117 | saveContainerListInfo(newsContainerList, jParams.getContentPage().getAclID()); | |||
| 97 | } else { | 118 | } else { | |||
| 98 | logger.debug("newsContainerList exist"); | 119 | logger.debug("newsContainerList exist"); | |||
| 99 | } | 120 | } | |||
| 100 | logger.debug("Set container list pagination on newsContainerList to " + windowSize + " (" + pageContext.getAttribute("boxtitle") + ")"); | |||||
| 101 | newsContainerList.getDefinition().setProperty("windowSize",windowSize); | |||||
| 102 | newsContainerList.getDefinition().setProperty("windowOffset","0"); | |||||
| 103 | newsContainerList.setIsContainersLoaded(false); | 121 | newsContainerList.setIsContainersLoaded(false); | |||
| 104 | logger.debug("newsContainerList has " + newsContainerList.getFullSize() + " elements"); | 122 | logger.debug("newsContainerList has " + newsContainerList.getFullSize() + " elements"); | |||
| 105 | Enumeration newsContainers = newsContainerList.getContainers(); | 123 | Enumeration newsContainers = newsContainerList.getContainers(); | |||
| 106 | SimpleDateFormat sdf = new SimpleDateFormat( "dd/MM/yyyy",jParams.getLocale() ); | 124 | SimpleDateFormat sdf = new SimpleDateFormat( "dd/MM/yyyy",jParams.getLocale() ); | |||
| 107 | 125 | |||||
| 108 | while (newsContainers.hasMoreElements()) { | 126 | while (newsContainers.hasMoreElements()) { | |||
| 109 | JahiaContainer newsContainer = (JahiaContainer) newsContainers.nextElement(); | 127 | JahiaContainer newsContainer = (JahiaContainer) newsContainers.nextElement(); | |||
| 110 | String newsTitle = newsContainer.getFieldValue("newsTitle",""); | 128 | String newsTitle = newsContainer.getFieldValue("newsTitle",""); | |||
| 111 | String newsDesc = newsContainer.getFieldValue("newsDesc",""); | 129 | String newsDesc = newsContainer.getFieldValue("newsDesc",""); | |||
| 112 | String excerpt = removeTags(newsDesc); | 130 | String excerpt = removeTags(newsDesc); | |||
| 113 | if ( (excerpt.length()) > 155 ) { | 131 | if ( (excerpt.length()) > 155 ) { | |||
| 114 | excerpt = excerpt.substring( 0, 155 - 3 ) + "..."; | 132 | excerpt = excerpt.substring( 0, 155 - 3 ) + "..."; | |||
| 115 | } | 133 | } | |||
| 116 | JahiaPage link = (JahiaPage) newsContainer.getFieldObject( "link" ); | 134 | JahiaPage link = (JahiaPage) newsContainer.getFieldObject( "link" ); | |||
| 117 | String newsPageUrl = jParams.composePageUrl(newsContainer.getPageID()); | 135 | String newsPageUrl = jParams.composePageUrl(newsContainer.getPageID()); | |||
| 118 | long dateLong = -1; | 136 | long dateLong = -1; | |||
| 119 | try { | 137 | try { | |||
| 120 | dateLong = Long.parseLong((String)newsContainer.getFieldObject("date")); | 138 | dateLong = Long.parseLong((String)newsContainer.getFieldObject("date")); | |||
| 121 | } catch (NumberFormatException nfe) { | 139 | } catch (NumberFormatException nfe) { | |||
| 122 | } | 140 | } | |||
| 123 | String dateStr = sdf.format( new Date(dateLong) ); | 141 | String dateStr = sdf.format( new Date(dateLong) ); | |||
| 124 | if(!newsTitle.equals("")){ | 142 | if(!newsTitle.equals("")){ | |||
| 125 | %> | 143 | %> | |||
| 126 | <div class="new"> | 144 | <div class="new"> | |||
| 127 | <a href="<%=newsPageUrl%>?newsContainerId=<%=newsContainer.getID()%>"><strong><%=newsTitle%></strong> - <%=dateStr%></a> | 145 | <a href="<%=newsPageUrl%>?newsContainerId=<%=newsContainer.getID()%>"><strong><%=newsTitle%></strong> - <%=dateStr%></a> | |||
| 128 | <% | 146 | <% | |||
| 129 | if(! jData.gui().html().drawUpdateContainerLauncher( newsContainer ).equals("") ) { | 147 | if(! jData.gui().html().drawUpdateContainerLauncher( newsContainer ).equals("") ) { | |||
| 130 | %><a href="javascript:<%= jData.gui().html().drawUpdateContainerLauncher( newsContainer )%>" | 148 | %><a href="javascript:<%= jData.gui().html().drawUpdateContainerLauncher( newsContainer )%>" | |||
| 131 | ><img src="<%=contextUrl%>/img/actions/update.gif" width="11" height="11" border="0" alt="Edit"></a><% | 149 | ><img src="<%=contextUrl%>/img/actions/update.gif" width="11" height="11" border="0" alt="Edit"></a><% | |||
| 132 | } | 150 | } | |||
| 133 | %> | 151 | %> | |||
| 134 | <br/> | 152 | <br/> | |||
| 135 | <%=excerpt%> | 153 | <%=excerpt%> | |||
| 136 | <% | 154 | <% | |||
| 137 | if (link != null) { | 155 | if (link != null) { | |||
| 138 | %><br/><a href="<%=link.getUrl(jData.params())%>"><%=link.getTitle()%></a><% | 156 | %><br/><a href="<%=link.getUrl(jData.params())%>"><%=link.getTitle()%></a><% | |||
| 139 | } | 157 | } | |||
| 140 | %> | 158 | %> | |||
| 141 | </div> | 159 | </div> | |||
| 142 | <% | 160 | <% | |||
| 143 | } | 161 | } | |||
| 144 | } | 162 | } | |||
| 145 | %> | 163 | %> | |||
Araxis Merge (but not this generated report) is Copyright © 1993-2003 Araxis Ltd (www.araxis.com). All rights reserved.