001/* 002 * (C) Copyright 2011 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Anahide Tchertchian 018 */ 019package org.nuxeo.ecm.platform.contentview.jsf; 020 021import java.util.List; 022 023import org.nuxeo.ecm.core.api.DocumentModel; 024import org.nuxeo.ecm.core.api.SortInfo; 025 026/** 027 * Default implementation of {@link ContentViewState} 028 * 029 * @since 5.4.2 030 */ 031public class ContentViewStateImpl implements ContentViewState { 032 033 private static final long serialVersionUID = 1L; 034 035 protected String contentViewName; 036 037 protected String pageProviderName; 038 039 protected Long pageSize; 040 041 protected Long currentPage; 042 043 protected Object[] parameters; 044 045 protected DocumentModel searchDocument; 046 047 protected List<SortInfo> sortInfos; 048 049 protected ContentViewLayout resultLayout; 050 051 protected List<String> resultColumns; 052 053 // default to true for BBB 054 protected boolean executed = true; 055 056 @Override 057 public String getContentViewName() { 058 return contentViewName; 059 } 060 061 @Override 062 public void setContentViewName(String contentViewName) { 063 this.contentViewName = contentViewName; 064 } 065 066 @Override 067 public Long getPageSize() { 068 return pageSize; 069 } 070 071 @Override 072 public void setPageSize(Long pageSize) { 073 this.pageSize = pageSize; 074 } 075 076 @Override 077 public Long getCurrentPage() { 078 return currentPage; 079 } 080 081 @Override 082 public void setCurrentPage(Long currentPage) { 083 this.currentPage = currentPage; 084 } 085 086 @Override 087 public Object[] getQueryParameters() { 088 return parameters; 089 } 090 091 @Override 092 public void setQueryParameters(Object[] parameters) { 093 this.parameters = parameters; 094 } 095 096 @Override 097 public DocumentModel getSearchDocumentModel() { 098 return searchDocument; 099 } 100 101 @Override 102 public void setSearchDocumentModel(DocumentModel searchDocument) { 103 this.searchDocument = searchDocument; 104 } 105 106 @Override 107 public List<SortInfo> getSortInfos() { 108 return sortInfos; 109 } 110 111 @Override 112 public void setSortInfos(List<SortInfo> sortInfos) { 113 this.sortInfos = sortInfos; 114 } 115 116 @Override 117 public ContentViewLayout getResultLayout() { 118 return resultLayout; 119 } 120 121 @Override 122 public void setResultLayout(ContentViewLayout resultLayout) { 123 this.resultLayout = resultLayout; 124 } 125 126 @Override 127 public List<String> getResultColumns() { 128 return resultColumns; 129 } 130 131 @Override 132 public void setResultColumns(List<String> resultColumns) { 133 this.resultColumns = resultColumns; 134 } 135 136 @Override 137 public String getPageProviderName() { 138 return pageProviderName; 139 } 140 141 @Override 142 public void setPageProviderName(String pageProviderName) { 143 this.pageProviderName = pageProviderName; 144 } 145 146 @Override 147 public void setExecuted(boolean executed) { 148 this.executed = executed; 149 } 150 151 @Override 152 public boolean isExecuted() { 153 return executed; 154 } 155 156}