Author: ssmiweve
Date: 2008-01-16 14:11:54 +0100 (Wed, 16 Jan 2008)
New Revision: 5972
Removed:
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/AccountingYear.java
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/CatalogueBannerSearchResultItem.java
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/CatalogueSearchResultItem.java
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/CompanyAccounting.java
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductResult.java
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductResultItem.java
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductSearchResult.java
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductSearchResultItem.java
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ShareHolder.java
Log:
SEARCH-3997 - Apply CatalogueSearchResutlItem diff to SESAT/generic.sesam
Deleted:
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/AccountingYear.java
===================================================================
---
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/AccountingYear.java
2008-01-16 11:43:42 UTC (rev 5971)
+++
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/AccountingYear.java
2008-01-16 13:11:54 UTC (rev 5972)
@@ -1,117 +0,0 @@
-package no.sesat.search.result;
-
-
-public final class AccountingYear extends BasicResultItem {
- private long sumDriftsinntekter;
- private long driftsresultat;
- private long resultatFoerSkatt;
- private long aarsresultat;
- private long sumAnleggsmidler;
- private long sumOmloepsmidler;
- private long sumEgenkapital;
- private long langsiktigGjeld;
- private long kortsiktigGjeld;
- private long sumEgenkapitalOgGjeld;
- private long sumEiendeler;
- private int year;
-
- public int getYear() {
- return year;
- }
-
- public void setYear(int year) {
- this.year = year;
- }
-
- public long getSumDriftsinntekter() {
- return sumDriftsinntekter;
- }
-
- public void setSumDriftsinntekter(long sumDriftsinntekter) {
- this.sumDriftsinntekter = sumDriftsinntekter;
- }
-
- public long getDriftsresultat() {
- return driftsresultat;
- }
-
- public void setDriftsresultat(long driftsresultat) {
- this.driftsresultat = driftsresultat;
- }
-
- public long getResultatFoerSkatt() {
- return resultatFoerSkatt;
- }
-
- public void setResultatFoerSkatt(long resultatFoerSkatt) {
- this.resultatFoerSkatt = resultatFoerSkatt;
- }
-
- public long getAarsresultat() {
- return aarsresultat;
- }
-
- public void setAarsresultat(long aarsresultat) {
- this.aarsresultat = aarsresultat;
- }
-
- public long getSumAnleggsmidler() {
- return sumAnleggsmidler;
- }
-
- public void setSumAnleggsmidler(long sumAnleggsmidler) {
- this.sumAnleggsmidler = sumAnleggsmidler;
- }
-
- public long getSumOmloepsmidler() {
- return sumOmloepsmidler;
- }
-
- public void setSumOmloepsmidler(long sumOmloepsmidler) {
- this.sumOmloepsmidler = sumOmloepsmidler;
- }
-
- public long getSumEgenkapital() {
- return sumEgenkapital;
- }
-
- public void setSumEgenkapital(long sumEgenkapital) {
- this.sumEgenkapital = sumEgenkapital;
- }
-
- public long getLangsiktigGjeld() {
- return langsiktigGjeld;
- }
-
- public void setLangsiktigGjeld(long langsiktigGjeld) {
- this.langsiktigGjeld = langsiktigGjeld;
- }
-
- public long getKortsiktigGjeld() {
- return kortsiktigGjeld;
- }
-
- public void setKortsiktigGjeld(long kortsiktigGjeld) {
- this.kortsiktigGjeld = kortsiktigGjeld;
- }
-
- public long getSumEgenkapitalOgGjeld() {
- return sumEgenkapitalOgGjeld;
- }
-
- public void setSumEgenkapitalOgGjeld(long sumEgenkapitalOgGjeld) {
- this.sumEgenkapitalOgGjeld = sumEgenkapitalOgGjeld;
- }
-
- public long getSumGjeld(){
- return this.kortsiktigGjeld+this.langsiktigGjeld;
- }
-
- public long getSumEiendeler() {
- return sumEiendeler;
- }
-
- public void setSumEiendeler(long sumEiendeler) {
- this.sumEiendeler = sumEiendeler;
- }
-}
Deleted:
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/CatalogueBannerSearchResultItem.java
===================================================================
---
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/CatalogueBannerSearchResultItem.java
2008-01-16 11:43:42 UTC (rev 5971)
+++
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/CatalogueBannerSearchResultItem.java
2008-01-16 13:11:54 UTC (rev 5972)
@@ -1,89 +0,0 @@
-/* Copyright (2006-2007) Schibsted Søk AS
- * This file is part of SESAT.
- * You can use, redistribute, and/or modify it, under the terms of the SESAT
License.
- * You should have received a copy of the SESAT License along with this
program.
- * If not, see https://dev.sesat.no/confluence/display/SESAT/SESAT+License
-
- */
-package no.sesat.search.result;
-
-/**
- * Result object holding one banner that should be displayed in the
- * catalogue search result page.
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Daniel Engfeldt</a>
- * @version <tt>$Id$</tt>
- */
-public final class CatalogueBannerSearchResultItem extends BasicResultItem {
-
-
- /**
- * Constructor to initialize the object with default values.
- *
- * @param keyword
- * @param url
- */
- public CatalogueBannerSearchResultItem(String keyword, String url,
String homepage){
- addField("iypbannerkw4", keyword);
- addField("iypbannerkw4url", url);
- addField("iypurl", homepage);
- }
-
- /**
- * The url to go to when cliking on the banner.
- *
- * @return
- */
- public String getHomepage(){
- return getField("iypurl");
- }
-
-
- public void setHomepage(String s){
- addField("iypurl", s);
- }
-
- /**
- * Get the banner url
- * @return string representing a url.
- */
- public String getBannerUrl(){
- return getField("iypbannerkw4url");
- }
-
- /**
- * Set the banner url
- *
- * @param s String that represents a url.
- */
- public void setBannerUrl(String s){
- addField("iypbannerkw4url", s);
- }
-
- /**
- * Set the banner keyword.
- * This is the keyword that the banner was registered on.
- *
- * @param bannerKeyword
- */
- public void setBannerKeyword(String bannerKeyword) {
- addField("iypbannerkw4",bannerKeyword);
- }
-
- /**
- * Get the keyword that the banner was registered on.
- * @return the keyword.
- */
- public String getBannerKeyword() {
- return getField("iypbannerkw4");
- }
-
-
- /**
- * To string method with a pretty output.
- */
- public String toString(){
- return
"CatalogueBannerSearchResultItem[bannerKeyword="+getBannerKeyword()+",
bannerUrl="+ getBannerUrl()+"]";
- }
-
-}
\ No newline at end of file
Deleted:
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/CatalogueSearchResultItem.java
===================================================================
---
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/CatalogueSearchResultItem.java
2008-01-16 11:43:42 UTC (rev 5971)
+++
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/CatalogueSearchResultItem.java
2008-01-16 13:11:54 UTC (rev 5972)
@@ -1,389 +0,0 @@
-/* Copyright (2006-2007) Schibsted Søk AS
- * This file is part of SESAT.
- * You can use, redistribute, and/or modify it, under the terms of the SESAT
License.
- * You should have received a copy of the SESAT License along with this
program.
- * If not, see https://dev.sesat.no/confluence/display/SESAT/SESAT+License
-
- */
-package no.sesat.search.result;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-/**
- * A simple implementation of a search result item that may contain products.
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Lars Johansson</a>
- * @version <tt>$Id$</tt>
- */
-public final class CatalogueSearchResultItem extends BasicResultItem {
-
- private static final int PRODUCT_STORKUNDE_M = 152;
- private static final int PRODUCT_STORKUNDE_L = 151;
- private static final int PRODUCT_STORKUNDE_XL = 150;
- private static final int PRODUCT_STORKUNDE_EKSKL = 149;
- private static final int PRODUCT_PAKKE_L = 123;
- private static final int PRODUCT_PAKKE_M = 122;
- private static final int PRODUCT_PAKKE_S = 121;
- private static final int PRODUCT_INFOSIDE = 120;
- private static final int PRODUCT_UTVIDET_OPPFORING = 119;
- private static final int PRODUCT_PAKKE_EKSKLUSIV = 116;
- private static final int PRODUCT_PAKKE_XL = 3;
-
- private static final Logger LOG =
Logger.getLogger(CatalogueSearchResultItem.class);
- private static final String SEPARATOR = ", ";
-
- private CompanyAccounting companyAccounting = null;
-
- /**
- * TODO: javadoc.
- */
- private ProductResult products = null;
-
- /**
- * TODO javadoc.
- *
- * @param products
- */
- public void addProducts(final ProductResult products) {
- this.products = products;
- }
-
- /**
- * TODO javadoc.
- *
- * @return
- */
- public boolean hasProducts(){
- return this.products != null ? true : false;
- }
-
- /**
- * TODO javadoc.
- *
- * @return
- */
- public ProductResult getProducts(){
- return this.products;
- }
-
- /**
- * Responsible for building html meta description content. <meta
- * name='description' content="data from method." />
- *
- * @return Comma separated values for content attribute.
- */
- public String getHtmlMetaDescriptionContent(){
- StringBuffer metaDataDescrption = new StringBuffer();
-
- if(getMarketName() != null){
- metaDataDescrption.append(
- getMarketName().substring(0,1).toUpperCase() +
- getMarketName().substring(1,
getMarketName().length()));
-
- metaDataDescrption.append(SEPARATOR);
- }
-
- if(getDescription() != null && getDescription().trim().length()>0){
- metaDataDescrption.append(getDescription());
- metaDataDescrption.append(SEPARATOR);
- }
-
- if(getPhoneNumber()!=null && getPhoneNumber().trim().length()>0){
- metaDataDescrption.append("Tlf: "+getPhoneNumber());
- metaDataDescrption.append(SEPARATOR);
- }
-
- if(getFax() != null && getFax().trim().length()>0){
- metaDataDescrption.append("Fax: " + getFax());
- metaDataDescrption.append(SEPARATOR);
- }
-
- if(getHomePageURL()!=null && getHomePageURL().trim().length()>0){
- metaDataDescrption.append(getHomePageURL());
- metaDataDescrption.append(SEPARATOR);
- }
-
- if(getAddress()!=null && getAddress().trim().length()>0){
- metaDataDescrption.append("Adresse: " + getAddress());
- metaDataDescrption.append(SEPARATOR);
- }
-
- if(getField("iypkommune")!=null &&
getField("iypkommune").trim().length()>0){
- metaDataDescrption.append(getField("iypkommune"));
- }
-
- return metaDataDescrption.toString();
- }
-
- /**
- * Responsible for building the value of the keyword metadata content
- * attribute. <meta name='keywords' content='result from this method' />
- *
- * @return Comma separated values for keywords.
- */
- public String getHtmlMetaKeywordsContent(){
- StringBuffer metaDataKeywords
- = new StringBuffer(getHtmlMetaDescriptionContent());
-
- if(getKeywords() != null){
- metaDataKeywords.append(SEPARATOR);
- metaDataKeywords.append(getKeywords());
- }
-
- return metaDataKeywords.toString();
- }
-
- /**
- * Util method for getting keywords from search result.
- *
- * @return Comma separated keywords.
- */
- private String getKeywords() {
- if (products != null) {
- final List<ProductResultItem> infoPageProducts =
products.getInfoPageProducts();
- if (infoPageProducts != null && infoPageProducts.size() > 0) {
- return infoPageProducts.get(0).getField("keywords");
- }
- }
-
- return null;
- }
-
- /**
- * Return all keywords.
- *
- * @return
- */
- public Collection<String> getKeywordsCollection() {
- List<String> keywordsList = null;
- final String keywords = getKeywords();
- if (keywords != null && !keywords.trim().equals("")) {
- final String[] keywordsArray = keywords.split(",");
- keywordsList = Arrays.asList(keywordsArray);
- }
- return keywordsList;
- }
-
-
- private String getDescription(){
- if(products != null && products.getInfoPageProducts() != null &&
products.getInfoPageProducts().size() > 0){
- return
products.getInfoPageProducts().get(0).getField("textShort");
- }
- return null;
- }
-
- public String getMarketName(){
- if(products != null && products.getInfoPageProducts() != null &&
products.getInfoPageProducts().size() > 0){
- return
products.getInfoPageProducts().get(0).getField("marketname");
- }
- return null;
- }
-
- private String getFax(){
- if(products != null && products.getInfoPageProducts() != null &&
products.getInfoPageProducts().size() > 0){
- return products.getInfoPageProducts().get(0).getField("fax");
- }
-
- return null;
- }
-
-
- /**
- * Utility method for checking if the entry belongs to a paying
customer.
- *
- * @return true if the result item is an entry for a paying customer.
- */
- public boolean isCommercial(){
- String productPackage = getField("iyppakke");
- if(productPackage != null && productPackage.length() > 0){
- return true;
- }
- return false;
- }
-
- /**
- * Responsible for getting the phone number to display for this result
item.
- *
- * @return The phone number to display for this result item.
- */
- public String getPhoneNumber(){
- String phoneNumber = getField("iypnrtelefon");
- if(phoneNumber != null && phoneNumber.length() > 0){
- return phoneNumber;
- }
- return null;
- }
-
- /**
- * Returns a description of the result item.
- *
- * @return a description of the result item.
- */
- public String getCompanyDescription(){
- String description = getField("iyplogotekst");
-
- if(isCommercial() && (description != null && description.length() > 0)){
- return description;
- }
-
- return null;
- }
-
- /**
- * Returns the url for the logo to display for this result item.
- *
- * @return URL for the logo to display.
- */
- public String getLogoURL(){
- // TODO: check product
- if(!isCommercial()){
- return null;
- }
-
- final String logoURL = getField("iyplogourl");
- if(logoURL != null && logoURL.length() > 0){
- return logoURL;
- }
- return null;
- }
-
-
- /**
- * Returns the address for for this result item.
- *
- * @return The address in format: street, zipcode city.
- */
- public String getAddress(){
-
- String address = getField("iypadresse");
- String zipCode = getField("iyppostnr");
- String city = getField("iyppoststed");
-
- StringBuffer compositAddress = new StringBuffer();
- if(address != null && address.length() > 0){
- compositAddress.append(address);
- compositAddress.append(", ");
- }
-
- if(zipCode != null && zipCode.length() > 0){
- compositAddress.append(zipCode);
- }
-
- if(city != null && city.length() > 0){
- compositAddress.append(" ");
- compositAddress.append(city);
- }
-
- if(compositAddress.length() > 0){
- return compositAddress.toString();
- }
- return null;
- }
-
- public String getEmailAddress(){
- // TODO: check product.
- if(!isCommercial()){
- return null;
- }
-
- String email = getField("iypepost");
- if(email != null && email.length() > 0){
- return email;
- }
- return null;
- }
-
- /**
- * Returns the url of the homepage for this result item.
- *
- * @return The URL of the homepage for a paying customer.
- */
- public String getHomePageURL(){
- if(!isCommercial()){
- return null;
- }
- // TODO: check product.
- String homePageURL = getField("iypurl");
- if(homePageURL != null && homePageURL.length() > 0){
- return "http://"+homePageURL;
- }
- return null;
- }
-
- public String imagePart(final String stringToSplit){
-
- if(stringToSplit == null || stringToSplit.length() < 1){
- return null;
- }
-
- String[] imageAndUrl = stringToSplit.split(";");
- return imageAndUrl[0];
- }
-
- public String urlPart(final String stringToSplit){
- if(stringToSplit == null || stringToSplit.length() < 1 ||
!stringToSplit.contains(";")
- || stringToSplit.lastIndexOf(";") ==
(stringToSplit.length()-1)) {
- return null;
- }
-
- String[] imageAndUrl = stringToSplit.split(";");
- return imageAndUrl[1];
- }
-
-
-
- /**
- * Checks if the result item should be rendered with a bold title.
- *
- * @return true if the product has bold title.
- */
- public boolean isTitleBold(){
- String productPackage = getField("iyppakke");
- if(productPackage != null && productPackage.length() > 0){
- try{
- // TODO: move bold indicator to index to avoid
hardcoding of
- // product and rules.
- int packageId = Integer.parseInt(productPackage);
- if (packageId == PRODUCT_PAKKE_XL || packageId ==
PRODUCT_PAKKE_EKSKLUSIV
- || packageId == PRODUCT_UTVIDET_OPPFORING || packageId
== PRODUCT_INFOSIDE
- || packageId == PRODUCT_PAKKE_S || packageId ==
PRODUCT_PAKKE_M || packageId == PRODUCT_PAKKE_L
- || packageId == PRODUCT_STORKUNDE_EKSKL || packageId
== PRODUCT_STORKUNDE_XL
- || packageId == PRODUCT_STORKUNDE_L || packageId ==
PRODUCT_STORKUNDE_M) {
- return true;
-
-
- }else if(packageId>=1002){
- /**
- * If packageId is greater than 1002,
then this packageId is
- * not a productId but a priority
rating from the new
- * priority system that will replace
the old system with
- * hard coded values of productId.
- */
- return true;
- }
- }catch(NumberFormatException e){
- return false;
- }
- }
- return false;
- }
-
-
- public void setCompanyAccounting(CompanyAccounting accounting){
- companyAccounting = accounting;
- }
-
- public CompanyAccounting getCompanyAccounting(){
- return companyAccounting;
- }
-
- public boolean hasCompanyAccounting(){
- return companyAccounting!=null;
- }
-}
Deleted:
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/CompanyAccounting.java
===================================================================
---
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/CompanyAccounting.java
2008-01-16 11:43:42 UTC (rev 5971)
+++
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/CompanyAccounting.java
2008-01-16 13:11:54 UTC (rev 5972)
@@ -1,38 +0,0 @@
-package no.sesat.search.result;
-
-import java.util.List;
-
-public final class CompanyAccounting extends BasicResultItem {
-
- private int lederlonn;
- private String orgnr;
- private List<ShareHolder> shareholders;
- private List<AccountingYear> accountingYears;
- public int getLederlonn() {
- return lederlonn;
- }
- public void setLederlonn(int lederlonn) {
- this.lederlonn = lederlonn;
- }
- public String getOrgNr() {
- return orgnr;
- }
-
-
- public void setOrgNr(String orgnr) {
- this.orgnr = orgnr;
- }
- public List<ShareHolder> getShareholders() {
- return shareholders;
- }
- public void setShareholders(List<ShareHolder> shareholders) {
- this.shareholders = shareholders;
- }
- public List<AccountingYear> getAccountingYears() {
- return accountingYears;
- }
- public void setAccountingYears(List<AccountingYear> accountingYears) {
- this.accountingYears = accountingYears;
- }
-
-}
Deleted:
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductResult.java
===================================================================
---
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductResult.java
2008-01-16 11:43:42 UTC (rev 5971)
+++
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductResult.java
2008-01-16 13:11:54 UTC (rev 5972)
@@ -1,37 +0,0 @@
-/* Copyright (2007) Schibsted Søk AS
- * This file is part of SESAT.
- *
- * SESAT is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published
by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * SESAT is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with SESAT. If not, see <http://www.gnu.org/licenses/>.
- */
-package no.sesat.search.result;
-
-import java.util.List;
-
-
-/** @deprecated use ResultList instead, subclassing to add infoPageProducts.
- * @version <tt>$Id$</tt>
- * @author <a href="mailto:[EMAIL PROTECTED]">Lars Johansson</a>
- */
-public interface ProductResult {
-
- List<ProductResultItem> getInfoPageProducts();
- List<ProductResultItem> getListingProducts();
-
- void addInfoPageResult(ProductResultItem item);
- void addListingResult(ProductResultItem item);
-
- boolean hasInfoPageProducts();
- boolean hasListingProducts();
-
-}
Deleted:
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductResultItem.java
===================================================================
---
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductResultItem.java
2008-01-16 11:43:42 UTC (rev 5971)
+++
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductResultItem.java
2008-01-16 13:11:54 UTC (rev 5972)
@@ -1,36 +0,0 @@
-/* Copyright (2007) Schibsted Søk AS
- * This file is part of SESAT.
- *
- * SESAT is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published
by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * SESAT is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with SESAT. If not, see <http://www.gnu.org/licenses/>.
- */
-package no.sesat.search.result;
-
-import java.util.Collection;
-import java.util.HashMap;
-
-/** @deprecated use ResultItem instead **/
-public interface ProductResultItem {
-
- void addField(String field, String value);
-
- String getField(String field);
-
- HashMap<String,Object> getFields();
-
- void setFields(HashMap<String,Object> map);
-
- Collection<String> getMultivaluedField(String field);
-
- void addToMultivaluedField(String field, String value);
-}
Deleted:
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductSearchResult.java
===================================================================
---
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductSearchResult.java
2008-01-16 11:43:42 UTC (rev 5971)
+++
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductSearchResult.java
2008-01-16 13:11:54 UTC (rev 5972)
@@ -1,63 +0,0 @@
-/* Copyright (2006-2007) Schibsted Søk AS
- * This file is part of SESAT.
- *
- * SESAT is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published
by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * SESAT is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with SESAT. If not, see <http://www.gnu.org/licenses/>.
-
- */
-package no.sesat.search.result;
-
-import no.sesat.search.result.*;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-/**
- * @author <a href="mailto:[EMAIL PROTECTED]">Lars Johansson</a>
- * @version <tt>$Revision: 1 $</tt>
- */
-public class ProductSearchResult implements ProductResult {
-
- private static final Logger LOG =
Logger.getLogger(ProductSearchResult.class);
-
- private final List<ProductResultItem> listingResults = new
ArrayList<ProductResultItem>();
- private final List<ProductResultItem> infoPageResults = new
ArrayList<ProductResultItem>();
-
- public void addInfoPageResult(ProductResultItem item) {
- infoPageResults.add(item);
- }
-
- public void addListingResult(ProductResultItem item) {
- listingResults.add(item);
- }
-
- public List<ProductResultItem> getInfoPageProducts() {
- return infoPageResults;
- }
-
- public List<ProductResultItem> getListingProducts() {
- return listingResults;
- }
-
- public boolean hasInfoPageProducts() {
- return infoPageResults.size() > 0 ? true: false;
- }
-
- public boolean hasListingProducts() {
- return listingResults.size() > 0 ? true: false;
- }
-
-}
-
-
Deleted:
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductSearchResultItem.java
===================================================================
---
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductSearchResultItem.java
2008-01-16 11:43:42 UTC (rev 5971)
+++
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ProductSearchResultItem.java
2008-01-16 13:11:54 UTC (rev 5972)
@@ -1,108 +0,0 @@
-/* Copyright (2006-2007) Schibsted Søk AS
- * This file is part of SESAT.
- *
- * SESAT is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published
by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * SESAT is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with SESAT. If not, see <http://www.gnu.org/licenses/>.
-
- */
-package no.sesat.search.result;
-
-
-import no.sesat.search.result.*;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-
-/**
- * A simple implementation of a product result item.
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Lars Johansson</a>
- * @version <tt>$Revision: 1 $</tt>
- */
-public class ProductSearchResultItem implements ProductResultItem {
-
- private HashMap fields = new HashMap();
-
- public void addField(final String field, final String value) {
- fields.put(field, value);
- }
-
- public String getField(final String field) {
- final String fieldValue = (String) fields.get(field);
- return fieldValue;
- }
-
- public Object getObjectField(final String field) {
- return fields.get(field);
- }
-
- public Integer getInteger(final String field) {
- final String fieldValue = (String) fields.get(field);
-
- if (fieldValue != null) {
- return Integer.valueOf(Integer.parseInt(fieldValue));
- } else {
- return null;
- }
- }
-
- public String getField(final String field, final int maxLength) {
- final String fieldValue = (String) fields.get(field);
-
- if (fieldValue != null) {
- if (fieldValue.equals(" ")) {
- return null;
- } else {
- return StringChopper.chop(fieldValue, maxLength);
- }
- }
- return fieldValue;
- }
-
- public Collection getFieldNames() {
- return fields.keySet();
- }
-
- public Collection getMultivaluedField(final String field) {
- return (Collection) fields.get(field);
- }
-
- public void addToMultivaluedField(final String field, final String value) {
- if (! fields.containsKey(field)) {
- fields.put(field, new ArrayList());
- }
-
- final Collection previousValues = (Collection) fields.get(field);
- previousValues.add(value);
- }
-
- //TODO:
- public boolean equals(final Object obj) {
- return super.equals(obj);
- }
-
- //TODO:
- public int hashCode() {
-
- return super.hashCode();
- }
-
- public HashMap getFields() {
- return fields;
- }
-
- public void setFields(HashMap fields) {
- this.fields = fields;
- }
-
-}
Deleted:
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ShareHolder.java
===================================================================
---
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ShareHolder.java
2008-01-16 11:43:42 UTC (rev 5971)
+++
trunk/generic.sesam/result/src/main/java/no/sesat/search/result/ShareHolder.java
2008-01-16 13:11:54 UTC (rev 5972)
@@ -1,28 +0,0 @@
-package no.sesat.search.result;
-
-
-public final class ShareHolder extends BasicResultItem {
-
-
- private String id;
- private String name;
- private Float shares;
- public String getId() {
- return id;
- }
- public void setId(String id) {
- this.id = id;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public Float getShares() {
- return shares;
- }
- public void setShares(Float shares) {
- this.shares = shares;
- }
-}
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits