Produced by Araxis Merge on Fri Jun 13 14:30:55 2008 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 Firefox or Internet Explorer. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Fri Jun 13 14:30:55 2008 UTC | ||
| 2 | C:\devel_jahia\corp_V2TemplatesSP4\src\jsp\blogs | listing_filters.inc | Fri Jun 13 14:30:10 2008 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 139 |
| Removed | 0 | 0 |
| 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 | Not shown in the comparison detail |
No regular expressions were active.
| 1 | <%-- | |||||
| 2 | Copyright 2002-2006 Jahia Ltd | |||||
| 3 | ||||||
| 4 | Licensed u nder the J AHIA COMMO N DEVELOPM ENT AND DI STRIBUTION LICENSE ( JCDDL), | |||||
| 5 | Version 1. 0 (the "Li cense"), o r (at your option) a ny later v ersion; yo u may | |||||
| 6 | not use th is file ex cept in co mpliance w ith the Li cense. You should ha ve | |||||
| 7 | received a copy of t he License along wit h this pro gram; if n ot, you ma y obtain | |||||
| 8 | a copy of the Licens e at | |||||
| 9 | ||||||
| 10 | http://ww w.jahia.or g/license/ | |||||
| 11 | ||||||
| 12 | Unless req uired by a pplicable law or agr eed to in writing, s oftware | |||||
| 13 | distribute d under th e License is distrib uted on an "AS IS" B ASIS, | |||||
| 14 | WITHOUT WA RRANTIES O R CONDITIO NS OF ANY KIND, eith er express or implie d. | |||||
| 15 | See the Li cense for the specif ic languag e governin g permissi ons and | |||||
| 16 | limitation s under th e License. | |||||
| 17 | --%><% | |||||
| 18 | // filters | |||||
| 19 | Vector con tainerFilt erVector = new Vecto r(); | |||||
| 20 | ||||||
| 21 | //String b logSearchS tring = re quest.getP arameter(" blogSearch String"); | |||||
| 22 | ||||||
| 23 | // on non- edit mode, hide page s with emp ty title | |||||
| 24 | if (! jDat a.gui().is EditMode() ) { | |||||
| 25 | Co ntainerFil terBean em ptyEntryFi lter = new Container FilterBean ("blogTitl e",jParams .getEntryL oadRequest ()); | |||||
| 26 | em ptyEntryFi lter.addCl ause(Conta inerFilter Bean.COMP_ NOT_EQUAL, "<empty>") ; | |||||
| 27 | co ntainerFil terVector. add(emptyE ntryFilter ); | |||||
| 28 | } | |||||
| 29 | ||||||
| 30 | /* | |||||
| 31 | if (blogSe archString != null & & blogSear chString.l ength() > 0) { | |||||
| 32 | logger .debug("bl ogSearchSt ring is " + blogSear chString); | |||||
| 33 | Contai nerSearche r containe rSearcher = new Cont ainerSearc her( | |||||
| 34 | jD ata.params ().getSite ID(), "blo gEntries", blogSearc hString, | |||||
| 35 | jD ata.params ().getEntr yLoadReque st()); | |||||
| 36 | reques t.setAttri bute("blog Entries_se arch_handl er",contai nerSearche r); | |||||
| 37 | } else { | |||||
| 38 | // ser ch only in current p age and in container List "blog Entries" | |||||
| 39 | blogSe archString = ""; | |||||
| 40 | String Buffer sea rchBlogQue ry = new StringBuff er(); | |||||
| 41 | //sear chBlogQuer y.append(" pageid:" + jData.pa ge().getID ()); | |||||
| 42 | search BlogQuery. append("co ntainer_de finition_n ame:blogEn tries"); | |||||
| 43 | Contai nerSearche r containe rSearcher = new Cont ainerSearc her( | |||||
| 44 | jD ata.params ().getSite ID(), "blo gEntries", searchBlo gQuery.toS tring(), | |||||
| 45 | jD ata.params ().getEntr yLoadReque st()); | |||||
| 46 | reques t.setAttri bute("blog Entries_se arch_handl er",contai nerSearche r); | |||||
| 47 | } | |||||
| 48 | */ | |||||
| 49 | // get all blogs | |||||
| 50 | ContainerF ilterByCon tainerDefi nition ent riesDefFil ter = | |||||
| 51 | new Co ntainerFil terByConta inerDefini tion("blog Entries", jParams.ge tEntryLoad Request()) ; | |||||
| 52 | containerF ilterVecto r.add(entr iesDefFilt er); | |||||
| 53 | ||||||
| 54 | String blo gSearchStr ing = requ est.getPar ameter("bl ogSearchSt ring"); | |||||
| 55 | ||||||
| 56 | if (reques tedCategor y != null) { | |||||
| 57 | HashSe t cats = n ew HashSet (); | |||||
| 58 | Catego ry cat = C ategory.ge tCategory( requestedC ategory,us er); | |||||
| 59 | if (ca t != null) { | |||||
| 60 | ca ts.add(cat ); | |||||
| 61 | // boolean wi thAllConta inersOfCom poundConta inerList = false; | |||||
| 62 | // if (jData. gui().isEd itMode()){ | |||||
| 63 | // withAl lContainer sOfCompoun dContainer List = tru e; | |||||
| 64 | // } | |||||
| 65 | Co ntainerFil terByCateg ories cate goryFilter = | |||||
| 66 | new Cont ainerFilte rByCategor ies(cats, jParams.ge tEntryLoad Request(), false); | |||||
| 67 | co ntainerFil terVector. add(catego ryFilter); | |||||
| 68 | lo gger.debug ("Add filt er with ca tegory " + requested Category); | |||||
| 69 | } else { | |||||
| 70 | lo gger.debug ("Could no t find cat egory " + requestedC ategory); | |||||
| 71 | } | |||||
| 72 | } else { | |||||
| 73 | if (bl ogSearchSt ring != nu ll && blog SearchStri ng.length( ) > 0) { | |||||
| 74 | ||||||
| 75 | Co ntainerSea rcher cont ainerSearc her = new ContainerS earcher( | |||||
| 76 | jData.pa rams().get SiteID(), "blogEntri es", blogS earchStrin g, | |||||
| 77 | jData.pa rams().get EntryLoadR equest()); | |||||
| 78 | re quest.setA ttribute(" blogEntrie s_search_h andler",co ntainerSea rcher); | |||||
| 79 | bl ogSearchSt ring = ""; | |||||
| 80 | ||||||
| 81 | } else { | |||||
| 82 | bl ogSearchSt ring = ""; | |||||
| 83 | if (request. getParamet er("t") != null) { | |||||
| 84 | // add f ilter on f ield date | |||||
| 85 | // Addin g equality compariso n with sel ected valu es | |||||
| 86 | Calendar cal = new Gregorian Calendar() ; | |||||
| 87 | cal.setT ime(new Da te(t)); | |||||
| 88 | ||||||
| 89 | cal.set( Calendar. HOUR_OF_DA Y, 0 ); | |||||
| 90 | cal.set( Calendar. MINUTE, 0) ; | |||||
| 91 | cal.set( Calendar. SECOND, -1 ); | |||||
| 92 | ||||||
| 93 | if ("wee k".equals( range)){ | |||||
| 94 | cal. set( Calen dar.DAY_OF _WEEK, Cal endar.MOND AY); | |||||
| 95 | } | |||||
| 96 | if ("mon th".equals (range)){ | |||||
| 97 | cal. set( Calen dar.DAY_OF _MONTH, 1) ; | |||||
| 98 | } | |||||
| 99 | if ("yea r".equals( range)){ | |||||
| 100 | cal. set( Calen dar.DAY_OF _YEAR, 1); | |||||
| 101 | } | |||||
| 102 | Date low erVal = ca l.getTime( ); | |||||
| 103 | cal.add( Calendar. HOUR_OF_DA Y, 24 ); | |||||
| 104 | if ("wee k".equals( range)){ | |||||
| 105 | cal. add( Calen dar.HOUR_O F_DAY, 24* 6 ); | |||||
| 106 | } | |||||
| 107 | if ("mon th".equals (range)){ | |||||
| 108 | cal. add( Calen dar.MONTH, 1 ); | |||||
| 109 | } | |||||
| 110 | if ("yea r".equals( range)){ | |||||
| 111 | cal. add( Calen dar.YEAR, 1 ); | |||||
| 112 | } | |||||
| 113 | Date upp erVal = ca l.getTime( ); | |||||
| 114 | ||||||
| 115 | logger.d ebug("Filt er from " + sdf.form at( (new D ate(lowerV al.getTime ())) ) + " to " + | |||||
| 116 | sdf. format( (n ew Date(up perVal.get Time())) ) ); | |||||
| 117 | ||||||
| 118 | Containe rFilterBea n dateFilt er = new C ontainerFi lterBean(" blogDate", true,jPara ms.getEntr yLoadReque st()); | |||||
| 119 | dateFilt er.addClau se(Contain erFilterBe an.COMP_SM ALLER, Str ing.valueO f(upperVal .getTime() ) ); | |||||
| 120 | containe rFilterVec tor.add(da teFilter); | |||||
| 121 | ||||||
| 122 | dateFilt er = new C ontainerFi lterBean(" blogDate", true,jPara ms.getEntr yLoadReque st()); | |||||
| 123 | dateFilt er.addClau se(Contain erFilterBe an.COMP_BI GGER, Stri ng.valueOf (lowerVal. getTime()) ); | |||||
| 124 | containe rFilterVec tor.add(da teFilter); | |||||
| 125 | } | |||||
| 126 | } | |||||
| 127 | } | |||||
| 128 | if ( conta inerFilter Vector.siz e()>0 ) { | |||||
| 129 | Contai nerFilters container Filters ; | |||||
| 130 | contai nerFilters = new Con tainerFilt ers(contai nerFilterV ector,jDat a.params() .getSiteID (),"blogEn tries"); | |||||
| 131 | re quest.setA ttribute(" blogEntrie s_filter_h andler",co ntainerFil ters); | |||||
| 132 | } | |||||
| 133 | // sort by date desc | |||||
| 134 | ContainerS orterByCon tainerDefi nition ent ries_sort_ handler = | |||||
| 135 | new Co ntainerSor terByConta inerDefini tion(siteI d, "blogDa te", "blog Entries", true, entr yLoadReque st); | |||||
| 136 | entries_so rt_handler .setDescOr dering(); | |||||
| 137 | request.se tAttribute ("blogEntr ies_sort_h andler",en tries_sort _handler); | |||||
| 138 | ||||||
| 139 | %> |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2007 Araxis Ltd (www.araxis.com). All rights reserved.