001/*
002 * (C) Copyright 2006 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 *     Florent Guillaume
018 */
019package org.nuxeo.project.sample;
020
021import java.util.List;
022
023import javax.faces.component.UIComponent;
024import javax.faces.context.FacesContext;
025import javax.faces.model.SelectItem;
026
027import org.jboss.seam.annotations.remoting.WebRemote;
028import org.nuxeo.ecm.core.api.DocumentModelList;
029import org.nuxeo.project.sample.BookManagerBean.BookInfo;
030
031/**
032 * Interface for the <code>bookManager</code> Seam component.
033 * <p>
034 * Use of this interface would be of course necessary if the Seam component was also an EJB3. In that latter case, the
035 * <code>WebRemote</code> annotation has to be put on the interface method, instead of the implementation method.
036 * </p>
037 */
038public interface BookManager {
039
040    public List<SelectItem> getAvailableKeywords();
041
042    public List<String> getKeywords();
043
044    public void setKeywords(List<String> keywords);
045
046    public void changeData();
047
048    public String getFirstName();
049
050    public void setFirstName(String s);
051
052    public void randomFirstName();
053
054    public String getLastName();
055
056    public void setLastName(String s);
057
058    public void randomLastName();
059
060    public String getIsbn();
061
062    public void setIsbn(String s);
063
064    public String toWizardPage(String page);
065
066    public String getWizardPage();
067
068    public String validateWizard();
069
070    public void resetKeywordValues();
071
072    public int getRating();
073
074    public void setRating(int rating);
075
076    public void validation(FacesContext context, UIComponent component, Object value);
077
078    public DocumentModelList getSearchResults();
079
080    public String getParentTitle();
081
082    public String duplicateSiblings();
083
084    public List<BookInfo> getBooksInFolder();
085
086    public boolean hasFilter();
087
088    public String getFilter();
089
090    public void setFilter(String filter);
091
092    /**
093     * Method to demonstrate Seam Remoting.
094     * <p>
095     * The annotation has to be on the interface in EJB3 situation. Otherwise it has to be on the component
096     * implementation.
097     * </p>
098     *
099     * @param param parameter used from the javascript code.
100     * @return something that uses the parameter
101     */
102    @WebRemote
103    public String something(String param);
104
105}