* @version $Revision$
*****************************************************************************/
-package org.splat.service;
+package org.splat.service;
import java.util.List;
import org.splat.service.dto.Proxy;
/**
- * @author rkv
- *
+ * Search service interface.
+ * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
*/
public interface SearchService {
- public List<Proxy> selectKnowledgeElementsWhere (KnowledgeElement.Properties... kprop);
- public List<Proxy> selectStudiesWhere (Study.Properties... sprop);
- public void indexStudy (Study study);
+ /**
+ * Refresh lucene index for studies.
+ *
+ * @param ridlist
+ * list of studies id's
+ */
+ public void reindexStudies(String[] ridlist);
+
+ /**
+ * Find knowledge elements with given properties.
+ * @param kprop search filter parameters
+ * @return the list of found knowledge elements as proxiy results of lucene search
+ */
+ public List<Proxy> selectKnowledgeElementsWhere(
+ KnowledgeElement.Properties... kprop);
+
+ /**
+ * Find studies with given properties.
+ * @param sprop search filter parameters
+ * @return the list of found studies as proxiy results of lucene search
+ */
+ public List<Proxy> selectStudiesWhere(Study.Properties... sprop);
+
+ /**
+ * Refresh lucene index for a study.
+ * @param study the study to reindex
+ */
+ public void indexStudy(Study study);
}
* @version $Revision$
*****************************************************************************/
-package org.splat.service;
+package org.splat.service;
import java.io.File;
import java.io.IOException;
import org.splat.dal.bo.som.SimulationContext;
import org.splat.dal.bo.som.Study;
import org.splat.dal.bo.som.Visibility;
-import org.splat.dal.dao.som.Database;
import org.splat.service.dto.Proxy;
import org.splat.service.technical.IndexService;
import org.splat.service.technical.IndexServiceImpl;
import org.splat.service.technical.RepositoryService;
+import org.springframework.transaction.annotation.Transactional;
/**
- * @author rkv
- *
+ * Search service implementation.
+ *
+ * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
*/
public class SearchServiceImpl implements SearchService {
- public final static Logger logger = Logger.getLogger(org.splat.service.SearchServiceImpl.class);
-
- private RepositoryService _repositoryService;
+ /**
+ * The service logger.
+ */
+ public final static Logger logger = Logger
+ .getLogger(org.splat.service.SearchServiceImpl.class);
+ /**
+ * Injected repository service.
+ */
+ private RepositoryService _repositoryService;
+ /**
+ * Injected index service.
+ */
private IndexService _indexService;
-
- public List<Proxy> selectKnowledgeElementsWhere (KnowledgeElement.Properties... kprop) {
- // ---------------------------------------------------------------------------------------------
- List<Proxy> result = new ArrayList<Proxy>();
- int hitsize = 20;
- try {
-
- // Creation of the Lucene query
- File indir = getRepositoryService().getRepositoryIndexDirectory();
- Directory index = FSDirectory.open(indir);
- IndexSearcher searcher = new IndexSearcher(index, true);
- BooleanQuery fulquery = new BooleanQuery();
-
- for (int i=0; i<kprop.length; i++) {
- BooleanQuery query = new BooleanQuery();
- Term input; // Supposed initialized below at least by the visibility
-
- Visibility area = kprop[i].getVisibility(); // Visibility
- if (area != null) {
- input = new Term("area");
- query.add(new TermQuery(input.createTerm(area.toString())), BooleanClause.Occur.MUST);
- }
- ProgressState state = kprop[i].getProgressState(); // State
- if (state != null) {
- input = new Term("state");
- query.add(new TermQuery(input.createTerm(state.toString())), BooleanClause.Occur.MUST);
- }
- String refid = kprop[i].getReference(); // Reference
- if (refid != null) {
- input = new Term("ref");
- query.add(new TermQuery(input.createTerm(refid)), BooleanClause.Occur.MUST);
- }
- KnowledgeElementType type = kprop[i].getType(); // Type
- if (type != null) {
- input = new Term("type");
- query.add(new TermQuery(input.createTerm(type.getName())), BooleanClause.Occur.MUST);
- }
- User manager = kprop[i].getAuthor(); // Author
- if (manager != null) {
- input = new Term("author");
- query.add(new TermQuery(input.createTerm(manager.toString())), BooleanClause.Occur.MUST);
- }
- User actor = kprop[i].getActor(); // Contributor, Reviewer or Approver of the owner study
- if (actor != null) {
- input = new Term("actor");
- query.add(new TermQuery(input.createTerm(actor.toString())), BooleanClause.Occur.MUST);
- }
- String title = kprop[i].getTitle(); // Title
- if (title != null) {
- input = new Term("contents");
- BooleanQuery critext = new BooleanQuery();
- String operator = "AND"; // Future user input
- BooleanClause.Occur clause = BooleanClause.Occur.MUST;
- if (operator.equals("OR")) clause = BooleanClause.Occur.SHOULD;
- String[] word = title.split(" ");
- for (int j=0; j<word.length; j++) {
- critext.add(new TermQuery(input.createTerm(word[j])), clause);
- }
- query.add(critext, BooleanClause.Occur.MUST);
- }
- List<SimulationContext> context = kprop[i].getSimulationContexts();
- if (context != null && context.size() > 0) {
- BooleanQuery critext = new BooleanQuery();
- for (Iterator<SimulationContext> j=context.iterator(); j.hasNext();) {
- SimulationContext seltext = j.next();
- input = new Term(String.valueOf(seltext.getType().getIndex()));
- critext.add(new TermQuery(input.createTerm(seltext.getValue())), BooleanClause.Occur.MUST);
- }
- query.add(critext, BooleanClause.Occur.MUST);
- }
- fulquery.add(query, BooleanClause.Occur.SHOULD);
- }
+
+ /**
+ * Injected study service.
+ */
+ private StudyService _studyService;
+
+ /**
+ * Refresh lucene index for studies.
+ *
+ * @param ridlist
+ * list of studies id's
+ */
+ @Transactional(readOnly = true)
+ public void reindexStudies(String[] ridlist) {
+ for (int i = 0; i < ridlist.length; i++) {
+ long index = Long.valueOf(ridlist[i].trim());
+ Study study = getStudyService().selectStudy(index);
+ indexStudy(study);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.splat.service.SearchService#selectKnowledgeElementsWhere(org.splat.dal.bo.som.KnowledgeElement.Properties[])
+ */
+ public List<Proxy> selectKnowledgeElementsWhere(
+ KnowledgeElement.Properties... kprop) {
+ List<Proxy> result = new ArrayList<Proxy>();
+ int hitsize = 20;
+ try {
+
+ // Creation of the Lucene query
+ File indir = getRepositoryService().getRepositoryIndexDirectory();
+ Directory index = FSDirectory.open(indir);
+ IndexSearcher searcher = new IndexSearcher(index, true);
+ BooleanQuery fulquery = new BooleanQuery();
+
+ for (int i = 0; i < kprop.length; i++) {
+ BooleanQuery query = new BooleanQuery();
+ Term input; // Supposed initialized below at least by the visibility
+
+ Visibility area = kprop[i].getVisibility(); // Visibility
+ if (area != null) {
+ input = new Term("area");
+ query.add(new TermQuery(input.createTerm(area.toString())),
+ BooleanClause.Occur.MUST);
+ }
+ ProgressState state = kprop[i].getProgressState(); // State
+ if (state != null) {
+ input = new Term("state");
+ query.add(
+ new TermQuery(input.createTerm(state.toString())),
+ BooleanClause.Occur.MUST);
+ }
+ String refid = kprop[i].getReference(); // Reference
+ if (refid != null) {
+ input = new Term("ref");
+ query.add(new TermQuery(input.createTerm(refid)),
+ BooleanClause.Occur.MUST);
+ }
+ KnowledgeElementType type = kprop[i].getType(); // Type
+ if (type != null) {
+ input = new Term("type");
+ query.add(new TermQuery(input.createTerm(type.getName())),
+ BooleanClause.Occur.MUST);
+ }
+ User manager = kprop[i].getAuthor(); // Author
+ if (manager != null) {
+ input = new Term("author");
+ query.add(new TermQuery(input
+ .createTerm(manager.toString())),
+ BooleanClause.Occur.MUST);
+ }
+ User actor = kprop[i].getActor(); // Contributor, Reviewer or Approver of the owner study
+ if (actor != null) {
+ input = new Term("actor");
+ query.add(
+ new TermQuery(input.createTerm(actor.toString())),
+ BooleanClause.Occur.MUST);
+ }
+ String title = kprop[i].getTitle(); // Title
+ if (title != null) {
+ input = new Term("contents");
+ BooleanQuery critext = new BooleanQuery();
+ String operator = "AND"; // Future user input
+ BooleanClause.Occur clause = BooleanClause.Occur.MUST;
+ if (operator.equals("OR"))
+ clause = BooleanClause.Occur.SHOULD;
+ String[] word = title.split(" ");
+ for (int j = 0; j < word.length; j++) {
+ critext.add(new TermQuery(input.createTerm(word[j])),
+ clause);
+ }
+ query.add(critext, BooleanClause.Occur.MUST);
+ }
+ List<SimulationContext> context = kprop[i]
+ .getSimulationContexts();
+ if (context != null && context.size() > 0) {
+ BooleanQuery critext = new BooleanQuery();
+ for (Iterator<SimulationContext> j = context.iterator(); j
+ .hasNext();) {
+ SimulationContext seltext = j.next();
+ input = new Term(String.valueOf(seltext.getType()
+ .getIndex()));
+ critext.add(new TermQuery(input.createTerm(seltext
+ .getValue())), BooleanClause.Occur.MUST);
+ }
+ query.add(critext, BooleanClause.Occur.MUST);
+ }
+ fulquery.add(query, BooleanClause.Occur.SHOULD);
+ }
if (logger.isInfoEnabled()) {
- logger.info("Searching knowledges by Lucene query \"" + fulquery.toString() + "\".");
- }
- // Creation of the knowledge filter
- BooleanFilter filter = new BooleanFilter();
- TermsFilter select = new TermsFilter();
- Term mytype = new Term("class");
- select.addTerm( mytype.createTerm("KnowledgeElement") );
- filter.add(new FilterClause(select, BooleanClause.Occur.SHOULD));
-
- // Creation of the sort criteria
- Sort sort = new Sort(new SortField("title", SortField.STRING));
-
- // Search
- TopFieldDocs found = searcher.search(fulquery, filter, hitsize, sort);
-
- if (found.totalHits < 1) return result; // No study found
-
- // Construction of the result list
- ScoreDoc[] hits = found.scoreDocs;
- for (int i=0; i<hits.length; i++) {
- result.add( new IndexServiceImpl.ObjectProxy(searcher.doc(hits[i].doc)) );
- }
- searcher.close();
- }
- catch (Exception error) {
- logger.error("Error during Lucene search, reason:", error);
- }
- return result;
+ logger.info("Searching knowledges by Lucene query \""
+ + fulquery.toString() + "\".");
+ }
+ // Creation of the knowledge filter
+ BooleanFilter filter = new BooleanFilter();
+ TermsFilter select = new TermsFilter();
+ Term mytype = new Term("class");
+ select.addTerm(mytype.createTerm("KnowledgeElement"));
+ filter.add(new FilterClause(select, BooleanClause.Occur.SHOULD));
+
+ // Creation of the sort criteria
+ Sort sort = new Sort(new SortField("title", SortField.STRING));
+
+ // Search
+ TopFieldDocs found = searcher.search(fulquery, filter, hitsize,
+ sort);
+
+ if (found.totalHits < 1)
+ return result; // No study found
+
+ // Construction of the result list
+ ScoreDoc[] hits = found.scoreDocs;
+ for (int i = 0; i < hits.length; i++) {
+ result.add(new IndexServiceImpl.ObjectProxy(searcher
+ .doc(hits[i].doc)));
+ }
+ searcher.close();
+ } catch (Exception error) {
+ logger.error("Error during Lucene search, reason:", error);
}
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.splat.service.SearchService#selectStudiesWhere(org.splat.dal.bo.som.Study.Properties[])
+ */
+ public List<Proxy> selectStudiesWhere(Study.Properties... sprop) {
+ List<Proxy> result = new ArrayList<Proxy>();
+ int hitsize = 20;
+ try {
- public List<Proxy> selectStudiesWhere (Study.Properties... sprop) {
- // ------------------------------------------------------------------------
- List<Proxy> result = new ArrayList<Proxy>();
- int hitsize = 20;
- try {
-
- // Creation of the Lucene query
- File indir = getRepositoryService().getRepositoryIndexDirectory();
- Directory index = FSDirectory.open(indir);
- IndexSearcher searcher = new IndexSearcher(index, true);
- BooleanQuery fulquery = new BooleanQuery();
-
- for (int i=0; i<sprop.length; i++) {
- BooleanQuery query = new BooleanQuery();
- Term input; // Supposed initialized below at least by the visibility
-
- Visibility area = sprop[i].getVisibility(); // Visibility
- if (area != null) {
- input = new Term("area");
- query.add(new TermQuery(input.createTerm(area.toString())), BooleanClause.Occur.MUST);
- }
- ProgressState state = sprop[i].getProgressState(); // State
- if (state != null) {
- input = new Term("state");
- if (state == ProgressState.inPROGRESS) {
- BooleanQuery cristate = new BooleanQuery();
- cristate.add(new TermQuery(input.createTerm("inWORK")), BooleanClause.Occur.SHOULD);
- cristate.add(new TermQuery(input.createTerm("inDRAFT")), BooleanClause.Occur.SHOULD);
- cristate.add(new TermQuery(input.createTerm("inCHECK")), BooleanClause.Occur.SHOULD);
- query.add(cristate, BooleanClause.Occur.MUST);
- } else {
- query.add(new TermQuery(input.createTerm(state.toString())), BooleanClause.Occur.MUST);
- }
- }
- String refid = sprop[i].getReference(); // Reference
- if (refid != null) {
- input = new Term("ref");
- query.add(new TermQuery(input.createTerm(refid)), BooleanClause.Occur.MUST);
- }
- User manager = sprop[i].getManager(); // Author
- if (manager != null) {
- input = new Term("author");
- query.add(new TermQuery(input.createTerm(manager.toString())), BooleanClause.Occur.MUST);
- }
- User actor = sprop[i].getActor(); // Contributor, Reviewer or Approver
- if (actor != null) {
- input = new Term("actor");
- query.add(new TermQuery(input.createTerm(actor.toString())), BooleanClause.Occur.MUST);
- }
- String title = sprop[i].getTitle(); // Title
- if (title != null) {
- input = new Term("contents");
- BooleanQuery critext = new BooleanQuery();
- String operator = "AND"; // Future user input
- BooleanClause.Occur clause = BooleanClause.Occur.MUST;
- if (operator.equals("OR")) clause = BooleanClause.Occur.SHOULD;
- String[] word = title.split(" ");
- for (int j=0; j<word.length; j++) {
- critext.add(new TermQuery(input.createTerm(word[j])), clause);
- }
- query.add(critext, BooleanClause.Occur.MUST);
- }
- List<SimulationContext> context = sprop[i].getSimulationContexts();
- if (context != null && context.size() > 0) {
- BooleanQuery critext = new BooleanQuery();
- for (Iterator<SimulationContext> j=context.iterator(); j.hasNext();) {
- SimulationContext seltext = j.next();
- input = new Term(String.valueOf(seltext.getType().getIndex()));
- critext.add(new TermQuery(input.createTerm(seltext.getValue())), BooleanClause.Occur.MUST);
- }
- query.add(critext, BooleanClause.Occur.MUST);
- }
- fulquery.add(query, BooleanClause.Occur.SHOULD);
- }
+ // Creation of the Lucene query
+ File indir = getRepositoryService().getRepositoryIndexDirectory();
+ Directory index = FSDirectory.open(indir);
+ IndexSearcher searcher = new IndexSearcher(index, true);
+ BooleanQuery fulquery = new BooleanQuery();
+
+ for (int i = 0; i < sprop.length; i++) {
+ BooleanQuery query = new BooleanQuery();
+ Term input; // Supposed initialized below at least by the visibility
+
+ Visibility area = sprop[i].getVisibility(); // Visibility
+ if (area != null) {
+ input = new Term("area");
+ query.add(new TermQuery(input.createTerm(area.toString())),
+ BooleanClause.Occur.MUST);
+ }
+ ProgressState state = sprop[i].getProgressState(); // State
+ if (state != null) {
+ input = new Term("state");
+ if (state == ProgressState.inPROGRESS) {
+ BooleanQuery cristate = new BooleanQuery();
+ cristate.add(new TermQuery(input.createTerm("inWORK")),
+ BooleanClause.Occur.SHOULD);
+ cristate.add(
+ new TermQuery(input.createTerm("inDRAFT")),
+ BooleanClause.Occur.SHOULD);
+ cristate.add(
+ new TermQuery(input.createTerm("inCHECK")),
+ BooleanClause.Occur.SHOULD);
+ query.add(cristate, BooleanClause.Occur.MUST);
+ } else {
+ query.add(new TermQuery(input.createTerm(state
+ .toString())), BooleanClause.Occur.MUST);
+ }
+ }
+ String refid = sprop[i].getReference(); // Reference
+ if (refid != null) {
+ input = new Term("ref");
+ query.add(new TermQuery(input.createTerm(refid)),
+ BooleanClause.Occur.MUST);
+ }
+ User manager = sprop[i].getManager(); // Author
+ if (manager != null) {
+ input = new Term("author");
+ query.add(new TermQuery(input
+ .createTerm(manager.toString())),
+ BooleanClause.Occur.MUST);
+ }
+ User actor = sprop[i].getActor(); // Contributor, Reviewer or Approver
+ if (actor != null) {
+ input = new Term("actor");
+ query.add(
+ new TermQuery(input.createTerm(actor.toString())),
+ BooleanClause.Occur.MUST);
+ }
+ String title = sprop[i].getTitle(); // Title
+ if (title != null) {
+ input = new Term("contents");
+ BooleanQuery critext = new BooleanQuery();
+ String operator = "AND"; // Future user input
+ BooleanClause.Occur clause = BooleanClause.Occur.MUST;
+ if (operator.equals("OR"))
+ clause = BooleanClause.Occur.SHOULD;
+ String[] word = title.split(" ");
+ for (int j = 0; j < word.length; j++) {
+ critext.add(new TermQuery(input.createTerm(word[j])),
+ clause);
+ }
+ query.add(critext, BooleanClause.Occur.MUST);
+ }
+ List<SimulationContext> context = sprop[i]
+ .getSimulationContexts();
+ if (context != null && context.size() > 0) {
+ BooleanQuery critext = new BooleanQuery();
+ for (Iterator<SimulationContext> j = context.iterator(); j
+ .hasNext();) {
+ SimulationContext seltext = j.next();
+ input = new Term(String.valueOf(seltext.getType()
+ .getIndex()));
+ critext.add(new TermQuery(input.createTerm(seltext
+ .getValue())), BooleanClause.Occur.MUST);
+ }
+ query.add(critext, BooleanClause.Occur.MUST);
+ }
+ fulquery.add(query, BooleanClause.Occur.SHOULD);
+ }
if (logger.isInfoEnabled()) {
- logger.info("Searching studies by Lucene query \"" + fulquery.toString() + "\".");
- }
- // Creation of the studies filter
- BooleanFilter filter = new BooleanFilter();
- TermsFilter select = new TermsFilter();
- Term mytype = new Term("class");
- select.addTerm( mytype.createTerm("Study") );
- filter.add(new FilterClause(select, BooleanClause.Occur.SHOULD));
-
- // Creation of the sort criteria
- Sort sort = new Sort(new SortField("title", SortField.STRING));
-
- // Search
- TopFieldDocs found = searcher.search(fulquery, filter, hitsize, sort);
-
- if (found.totalHits < 1) return result; // No study found
-
- // Construction of the result list
- ScoreDoc[] hits = found.scoreDocs;
- for (int i=0; i<hits.length; i++) {
- result.add( new IndexServiceImpl.ObjectProxy(searcher.doc(hits[i].doc)) );
- }
- searcher.close();
- }
- catch (Exception error) {
- logger.error("Error during Lucene search, reason:", error);
- }
- return result;
- }
-
- public void indexStudy (Study study) {
- // -------------------------------------------
- try {
- Study.Properties sprop = new Study.Properties();
- List<Proxy> index = selectStudiesWhere(sprop.setReference(study.getReference()));
-
- if (index.size() != 0) return; // The given study is already indexed
-
- IndexService lucin = getIndex();
- Scenario[] scenes = study.getScenarii();
-
- lucin.add(study);
- if (study.getProgressState() != ProgressState.inWORK) for (int i=0; i<scenes.length; i++) {
- List<KnowledgeElement> list = scenes[i].getAllKnowledgeElements();
- for (Iterator<KnowledgeElement> j=list.iterator(); j.hasNext(); ) {
- lucin.add(j.next());
- }
- }
- }
- catch (Exception error) {
- Database.logger.error("Unable to index the study '" + study.getIndex() + "', reason:", error);
- }
- }
-
- public IndexService getIndex () throws IOException {
+ logger.info("Searching studies by Lucene query \""
+ + fulquery.toString() + "\".");
+ }
+ // Creation of the studies filter
+ BooleanFilter filter = new BooleanFilter();
+ TermsFilter select = new TermsFilter();
+ Term mytype = new Term("class");
+ select.addTerm(mytype.createTerm("Study"));
+ filter.add(new FilterClause(select, BooleanClause.Occur.SHOULD));
+
+ // Creation of the sort criteria
+ Sort sort = new Sort(new SortField("title", SortField.STRING));
+
+ // Search
+ TopFieldDocs found = searcher.search(fulquery, filter, hitsize,
+ sort);
+
+ if (found.totalHits < 1)
+ return result; // No study found
+
+ // Construction of the result list
+ ScoreDoc[] hits = found.scoreDocs;
+ for (int i = 0; i < hits.length; i++) {
+ result.add(new IndexServiceImpl.ObjectProxy(searcher
+ .doc(hits[i].doc)));
+ }
+ searcher.close();
+ } catch (Exception error) {
+ logger.error("Error during Lucene search, reason:", error);
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.splat.service.SearchService#indexStudy(org.splat.dal.bo.som.Study)
+ */
+ public void indexStudy(Study study) {
+ logger.debug("Index study: id=" + study.getRid() + "; reference=" + study.getReference());
+ try {
+ Study.Properties sprop = new Study.Properties();
+ List<Proxy> index = selectStudiesWhere(sprop.setReference(study
+ .getReference()));
+
+ if (index.size() != 0) {
+ logger.debug("The given study is already indexed.");
+ return; // The given study is already indexed
+ }
+
+ IndexService lucin = getIndex();
+ Scenario[] scenes = study.getScenarii();
+
+ logger.debug("Number of study " + study.getReference() + " actors: " + study.getActor().size());
+ lucin.add(study);
+ if (study.getProgressState() != ProgressState.inWORK)
+ for (int i = 0; i < scenes.length; i++) {
+ List<KnowledgeElement> list = scenes[i]
+ .getAllKnowledgeElements();
+ for (Iterator<KnowledgeElement> j = list.iterator(); j
+ .hasNext();) {
+ lucin.add(j.next());
+ logger.debug("Knowlegge added: id=" + j.next().getIndex());
+ }
+ }
+ } catch (Exception error) {
+ logger.error("Unable to index the study '"
+ + study.getIndex() + "', reason:", error);
+ }
+ }
+
+ /**
+ * Get lucene index handler. Create the index if it is not exist.
+ *
+ * @return IndexService
+ * @throws IOException
+ * if error when creating a new lucene index
+ */
+ private IndexService getIndex() throws IOException {
IndexService lucin = getIndexService();
- if ( !lucin.exists() ) lucin.create(); // Happens when re-indexing all studies
+ if (!lucin.exists())
+ lucin.create(); // Happens when re-indexing all studies
return lucin;
- }
-
+ }
+
/**
* Get the repositoryService.
+ *
* @return the repositoryService
*/
public RepositoryService getRepositoryService() {
/**
* Set the repositoryService.
- * @param repositoryService the repositoryService to set
+ *
+ * @param repositoryService
+ * the repositoryService to set
*/
public void setRepositoryService(RepositoryService repositoryService) {
_repositoryService = repositoryService;
/**
* Get the indexService.
+ *
* @return the indexService
*/
public IndexService getIndexService() {
/**
* Set the indexService.
- * @param indexService the indexService to set
+ *
+ * @param indexService
+ * the indexService to set
*/
public void setIndexService(IndexService indexService) {
_indexService = indexService;
}
+
+ /**
+ * Get the studyService.
+ * @return the studyService
+ */
+ public StudyService getStudyService() {
+ return _studyService;
+ }
+
+ /**
+ * Set the studyService.
+ * @param studyService the studyService to set
+ */
+ public void setStudyService(StudyService studyService) {
+ _studyService = studyService;
+ }
}
package org.splat.service.technical;
+
/**
*
* @author Daniel Brunier-Coulin
import org.splat.dal.bo.som.Scenario;
import org.splat.dal.bo.som.SimulationContext;
import org.splat.dal.bo.som.Study;
-import org.splat.dal.dao.som.Database;
import org.splat.service.ProjectElementService;
import org.splat.service.dto.Proxy;
import org.splat.som.Step;
-
public class IndexServiceImpl implements IndexService {
- private Directory index;
- private org.apache.lucene.document.Document body;
+ private Directory index;
+ private org.apache.lucene.document.Document body;
private ProjectElementService _projectElementService;
- private RepositoryService _repositoryService;
-
- protected static StandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_29);
- private static final Logger logger = Logger.getLogger(IndexServiceImpl.class);
-
- private class Entry extends IndexWriter {
-// ---------------------------------------
- private org.apache.lucene.document.Document entry;
-
- private Entry (Study study) throws CorruptIndexException, LockObtainFailedException, IOException
- {
- super(index, analyzer, false, IndexWriter.MaxFieldLength.UNLIMITED);
-
-// Addition of mandatory fields
- entry = new org.apache.lucene.document.Document();
- Field field;
- field = body.getField("index");
- field.setValue(String.valueOf(study.getIndex()));
- entry.add(field);
- field = body.getField("class");
- field.setValue("Study");
- entry.add(field);
- field = body.getField("type");
- field.setValue(""); // Reserved for configurable Study type
- entry.add(field);
- field = body.getField("ref");
- field.setValue(study.getReference());
- entry.add(field);
- field = body.getField("area");
- field.setValue(study.getVisibility().toString());
- entry.add(field);
- field = body.getField("state");
- field.setValue(study.getProgressState().toString());
- entry.add(field);
- field = body.getField("author");
- field.setValue(study.getAuthor().toString());
- entry.add(field);
- field = body.getField("title");
- field.setValue(study.getTitle());
- entry.add(field);
- field = body.getField("contents");
- field.setValue(study.getTitle());
- entry.add(field);
-
-// Addition of optional fields
- setActorsOf(study);
- setContextAt(getProjectElementService().getSteps(study));
- }
- private Entry (KnowledgeElement kelm) throws CorruptIndexException, LockObtainFailedException, IOException
- {
- super(index, analyzer, false, IndexWriter.MaxFieldLength.UNLIMITED);
-
-// Addition of mandatory fields
- entry = new org.apache.lucene.document.Document();
- Field field;
- field = body.getField("index");
- field.setValue(String.valueOf(kelm.getIndex()));
- entry.add(field);
- field = body.getField("class");
- field.setValue("KnowledgeElement");
- entry.add(field);
- field = body.getField("type");
- field.setValue(kelm.getType().getName());
- entry.add(field);
- field = body.getField("ref");
- field.setValue(kelm.getReference());
- entry.add(field);
- field = body.getField("area");
- field.setValue(kelm.getVisibility().toString());
- entry.add(field);
- field = body.getField("state");
- field.setValue(kelm.getProgressState().toString());
- entry.add(field);
- field = body.getField("author");
- field.setValue(kelm.getAuthor().toString());
- entry.add(field);
- field = body.getField("title");
- field.setValue(kelm.getTitle());
- entry.add(field);
- field = body.getField("contents");
- field.setValue(kelm.getTitle());
- entry.add(field);
-
-//TODO: Addition of optional fields
- Scenario scene = kelm.getOwnerScenario();
- Study study = scene.getOwnerStudy();
- setActorsOf(study); // For restricting the visibility of knowledges attached to private studies
- setContextAt(getProjectElementService().getSteps(study));
- setContextAt(getProjectElementService().getSteps(scene));
- }
- private void add () throws CorruptIndexException, IOException
- {
- addDocument(entry);
-// Save the new entry
- optimize(); // Should be called before committing the index
- close(); // Commits the index
- }
- private void update () throws CorruptIndexException, IOException
- {
- String value = entry.getField("ref").stringValue(); // Only field with unique value
- Term term = new Term("ref").createTerm(value);
- updateDocument(term, entry);
-// Save the updated entry
- optimize(); // Should be called before committing the index
- close(); // Commits the index
- }
- private void setContextAt (Step[] step)
- {
- for (int i=0; i<step.length; i++) {
- List<SimulationContext> contexts = step[i].getAllSimulationContexts();
- for (Iterator<SimulationContext> j=contexts.iterator(); j.hasNext();) {
- SimulationContext context = j.next();
- String type = String.valueOf(context.getType().getIndex());
- String value = context.getValue();
- entry.add( new Field(type, value, Field.Store.NO, Field.Index.NOT_ANALYZED) );
- }
- }
- }
- private void setActorsOf (Study study)
- {
-//RKV: This set is always not null. Let's assume that it must be initialized before reindexing: Set<User> actors = study.getActors();
- Set<User> actors = study.getActor(); //RKV
- for (Iterator<User> i=actors.iterator(); i.hasNext(); ) {
- String value = i.next().toString();
- entry.add( new Field("actor", value, Field.Store.NO, Field.Index.NOT_ANALYZED) );
- }
- }
- }
- public static class ObjectProxy implements Proxy, Serializable {
-// --------------------------------------------------------------
- private Long rid;
- private String sid;
- private ProgressState state;
- private String title;
- private String type;
- private String name;
- private static final long serialVersionUID = -4386494192709562221L;
-
- public ObjectProxy (org.apache.lucene.document.Document ludoc) {
- rid = Long.valueOf(ludoc.get("index"));
- sid = ludoc.get("ref");
- state = ProgressState.valueOf(ludoc.get("state"));
- title = ludoc.get("title");
- name = ludoc.get("author");
- }
- public String getAuthorName () {
- return name;
- }
- public Long getIndex () {
- return rid;
- }
- public ProgressState getProgressState () {
- return state;
- }
- public String getReference () {
- return sid;
- }
- public String getTitle () {
- return title;
- }
- public String getType () {
- return type;
- }
- }
-
-// ==============================================================================================================================
-// Construction
-// ==============================================================================================================================
-
- public void configure () throws IOException {
- File indir = getRepositoryService().getRepositoryIndexDirectory();
- index = FSDirectory.open(indir);
- body = new org.apache.lucene.document.Document();
- body.add( new Field("index", "", Field.Store.YES, Field.Index.NOT_ANALYZED) );
- body.add( new Field("class", "", Field.Store.NO, Field.Index.NOT_ANALYZED) );
- body.add( new Field("type", "", Field.Store.YES, Field.Index.NOT_ANALYZED) );
- body.add( new Field("ref", "", Field.Store.YES, Field.Index.NOT_ANALYZED) );
- body.add( new Field("area", "", Field.Store.NO, Field.Index.NOT_ANALYZED) );
- body.add( new Field("state", "", Field.Store.YES, Field.Index.NOT_ANALYZED) );
- body.add( new Field("author", "", Field.Store.YES, Field.Index.NOT_ANALYZED) );
- body.add( new Field("title", "", Field.Store.YES, Field.Index.NOT_ANALYZED) );
- body.add( new Field("contents","", Field.Store.NO, Field.Index.ANALYZED) );
- if ( !this.exists() ) this.create(); // Happens when re-indexing all studies
- }
-
- public void create () throws IOException {
-// -------------------------------
- Directory index = FSDirectory.open(getRepositoryService().getRepositoryIndexDirectory());
- IndexWriter writer = new IndexWriter(index, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED);
- writer.close(); // ==== Creates an empty index
- }
-
-// ==============================================================================================================================
-// Member functions
-// ==============================================================================================================================
-
- public void add (Study study) throws IOException {
-// --------------------------------
- IndexServiceImpl.Entry entry = new Entry(study);
- entry.add();
- if (logger.isInfoEnabled()) {
- logger.info("Study \"" + study.getIndex() + "\" indexed.");
- }
- }
-
- public void add (KnowledgeElement kelm) throws IOException {
-// ------------------------------------------
- IndexServiceImpl.Entry entry = new Entry(kelm);
- entry.add();
- if (logger.isInfoEnabled()) {
- logger.info("Knowledge \"" + kelm.getIndex() + "\" indexed.");
- }
- }
-
- public boolean exists () {
-// ---------------------------
- try {
- return IndexReader.indexExists(index);
- }
- catch (IOException error) {
- error.printStackTrace();
- return false;
+ private RepositoryService _repositoryService;
+
+ protected static StandardAnalyzer analyzer = new StandardAnalyzer(
+ Version.LUCENE_29);
+ private static final Logger logger = Logger
+ .getLogger(IndexServiceImpl.class);
+
+ private class Entry extends IndexWriter {
+ private org.apache.lucene.document.Document entry;
+
+ private Entry(Study study) throws CorruptIndexException,
+ LockObtainFailedException, IOException {
+ super(index, analyzer, false, IndexWriter.MaxFieldLength.UNLIMITED);
+
+ // Addition of mandatory fields
+ entry = new org.apache.lucene.document.Document();
+ Field field;
+ field = body.getField("index");
+ field.setValue(String.valueOf(study.getIndex()));
+ entry.add(field);
+ field = body.getField("class");
+ field.setValue("Study");
+ entry.add(field);
+ field = body.getField("type");
+ field.setValue(""); // Reserved for configurable Study type
+ entry.add(field);
+ field = body.getField("ref");
+ field.setValue(study.getReference());
+ entry.add(field);
+ field = body.getField("area");
+ field.setValue(study.getVisibility().toString());
+ entry.add(field);
+ field = body.getField("state");
+ field.setValue(study.getProgressState().toString());
+ entry.add(field);
+ field = body.getField("author");
+ field.setValue(study.getAuthor().toString());
+ entry.add(field);
+ field = body.getField("title");
+ field.setValue(study.getTitle());
+ entry.add(field);
+ field = body.getField("contents");
+ field.setValue(study.getTitle());
+ entry.add(field);
+
+ // Addition of optional fields
+ setActorsOf(study);
+ setContextAt(getProjectElementService().getSteps(study));
+ }
+
+ private Entry(KnowledgeElement kelm) throws CorruptIndexException,
+ LockObtainFailedException, IOException {
+ super(index, analyzer, false, IndexWriter.MaxFieldLength.UNLIMITED);
+
+ // Addition of mandatory fields
+ entry = new org.apache.lucene.document.Document();
+ Field field;
+ field = body.getField("index");
+ field.setValue(String.valueOf(kelm.getIndex()));
+ entry.add(field);
+ field = body.getField("class");
+ field.setValue("KnowledgeElement");
+ entry.add(field);
+ field = body.getField("type");
+ field.setValue(kelm.getType().getName());
+ entry.add(field);
+ field = body.getField("ref");
+ field.setValue(kelm.getReference());
+ entry.add(field);
+ field = body.getField("area");
+ field.setValue(kelm.getVisibility().toString());
+ entry.add(field);
+ field = body.getField("state");
+ field.setValue(kelm.getProgressState().toString());
+ entry.add(field);
+ field = body.getField("author");
+ field.setValue(kelm.getAuthor().toString());
+ entry.add(field);
+ field = body.getField("title");
+ field.setValue(kelm.getTitle());
+ entry.add(field);
+ field = body.getField("contents");
+ field.setValue(kelm.getTitle());
+ entry.add(field);
+
+ // TODO: Addition of optional fields
+ Scenario scene = kelm.getOwnerScenario();
+ Study study = scene.getOwnerStudy();
+ setActorsOf(study); // For restricting the visibility of knowledges attached to private studies
+ setContextAt(getProjectElementService().getSteps(study));
+ setContextAt(getProjectElementService().getSteps(scene));
+ }
+
+ private void add() throws CorruptIndexException, IOException {
+ addDocument(entry);
+ // Save the new entry
+ optimize(); // Should be called before committing the index
+ close(); // Commits the index
+ }
+
+ private void update() throws CorruptIndexException, IOException {
+ String value = entry.getField("ref").stringValue(); // Only field with unique value
+ Term term = new Term("ref").createTerm(value);
+ updateDocument(term, entry);
+ // Save the updated entry
+ optimize(); // Should be called before committing the index
+ close(); // Commits the index
+ }
+
+ private void setContextAt(Step[] step) {
+ for (int i = 0; i < step.length; i++) {
+ List<SimulationContext> contexts = step[i]
+ .getAllSimulationContexts();
+ for (Iterator<SimulationContext> j = contexts.iterator(); j
+ .hasNext();) {
+ SimulationContext context = j.next();
+ String type = String.valueOf(context.getType().getIndex());
+ String value = context.getValue();
+ entry.add(new Field(type, value, Field.Store.NO,
+ Field.Index.NOT_ANALYZED));
+ }
+ }
+ }
+
+ private void setActorsOf(Study study) {
+ // RKV: This set is always not null. Let's assume that it must be initialized before reindexing: Set<User> actors =
+ // study.getActors();
+ Set<User> actors = study.getActor(); // RKV
+ if (logger.isDebugEnabled()) {
+ logger.debug("Study " + study.getReference()
+ + " actors number to be added to the lucen index: "
+ + actors.size());
+ }
+ for (Iterator<User> i = actors.iterator(); i.hasNext();) {
+ String value = i.next().toString();
+ entry.add(new Field("actor", value, Field.Store.NO,
+ Field.Index.NOT_ANALYZED));
+ if (logger.isDebugEnabled()) {
+ logger.debug(" actor added to the lucen index: " + value);
+ }
+ }
+ }
+ }
+
+ public static class ObjectProxy implements Proxy, Serializable {
+ // --------------------------------------------------------------
+ private Long rid;
+ private String sid;
+ private ProgressState state;
+ private String title;
+ private String type;
+ private String name;
+ private static final long serialVersionUID = -4386494192709562221L;
+
+ public ObjectProxy(org.apache.lucene.document.Document ludoc) {
+ rid = Long.valueOf(ludoc.get("index"));
+ sid = ludoc.get("ref");
+ state = ProgressState.valueOf(ludoc.get("state"));
+ title = ludoc.get("title");
+ name = ludoc.get("author");
+ }
+
+ public String getAuthorName() {
+ return name;
+ }
+
+ public Long getIndex() {
+ return rid;
+ }
+
+ public ProgressState getProgressState() {
+ return state;
+ }
+
+ public String getReference() {
+ return sid;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public String getType() {
+ return type;
+ }
+ }
+
+ // ==============================================================================================================================
+ // Construction
+ // ==============================================================================================================================
+
+ public void configure() throws IOException {
+ File indir = getRepositoryService().getRepositoryIndexDirectory();
+ index = FSDirectory.open(indir);
+ body = new org.apache.lucene.document.Document();
+ body.add(new Field("index", "", Field.Store.YES,
+ Field.Index.NOT_ANALYZED));
+ body.add(new Field("class", "", Field.Store.NO,
+ Field.Index.NOT_ANALYZED));
+ body.add(new Field("type", "", Field.Store.YES,
+ Field.Index.NOT_ANALYZED));
+ body
+ .add(new Field("ref", "", Field.Store.YES,
+ Field.Index.NOT_ANALYZED));
+ body
+ .add(new Field("area", "", Field.Store.NO,
+ Field.Index.NOT_ANALYZED));
+ body.add(new Field("state", "", Field.Store.YES,
+ Field.Index.NOT_ANALYZED));
+ body.add(new Field("author", "", Field.Store.YES,
+ Field.Index.NOT_ANALYZED));
+ body.add(new Field("title", "", Field.Store.YES,
+ Field.Index.NOT_ANALYZED));
+ body
+ .add(new Field("contents", "", Field.Store.NO,
+ Field.Index.ANALYZED));
+ if (!this.exists())
+ this.create(); // Happens when re-indexing all studies
+ }
+
+ public void create() throws IOException {
+ // -------------------------------
+ Directory index = FSDirectory.open(getRepositoryService()
+ .getRepositoryIndexDirectory());
+ IndexWriter writer = new IndexWriter(index, analyzer, true,
+ IndexWriter.MaxFieldLength.UNLIMITED);
+ writer.close(); // ==== Creates an empty index
+ }
+
+ // ==============================================================================================================================
+ // Member functions
+ // ==============================================================================================================================
+
+ public void add(Study study) throws IOException {
+ // --------------------------------
+ IndexServiceImpl.Entry entry = new Entry(study);
+ entry.add();
+ if (logger.isInfoEnabled()) {
+ logger.info("Study \"" + study.getIndex() + "\" indexed.");
+ }
+ }
+
+ public void add(KnowledgeElement kelm) throws IOException {
+ // ------------------------------------------
+ IndexServiceImpl.Entry entry = new Entry(kelm);
+ entry.add();
+ if (logger.isInfoEnabled()) {
+ logger.info("Knowledge \"" + kelm.getIndex() + "\" indexed.");
+ }
+ }
+
+ public boolean exists() {
+ // ---------------------------
+ try {
+ return IndexReader.indexExists(index);
+ } catch (IOException error) {
+ error.printStackTrace();
+ return false;
+ }
}
- }
-
- public void update (Study study) throws IOException {
-// -----------------------------------
- IndexServiceImpl.Entry entry = new Entry(study);
- entry.update();
- if (logger.isInfoEnabled()) {
- logger.info("Study \"" + study.getIndex() + "\" re-indexed.");
- }
- }
-
- public void update (KnowledgeElement kelm) throws IOException {
-// ---------------------------------------------
- IndexServiceImpl.Entry entry = new Entry(kelm);
- entry.update();
- if (logger.isInfoEnabled()) {
- logger.info("Knowledge \"" + kelm.getIndex() + "\" re-indexed.");
- }
- }
+
+ public void update(Study study) throws IOException {
+ // -----------------------------------
+ IndexServiceImpl.Entry entry = new Entry(study);
+ entry.update();
+ if (logger.isInfoEnabled()) {
+ logger.info("Study \"" + study.getIndex() + "\" re-indexed.");
+ }
+ }
+
+ public void update(KnowledgeElement kelm) throws IOException {
+ // ---------------------------------------------
+ IndexServiceImpl.Entry entry = new Entry(kelm);
+ entry.update();
+ if (logger.isInfoEnabled()) {
+ logger.info("Knowledge \"" + kelm.getIndex() + "\" re-indexed.");
+ }
+ }
+
/**
* Get the projectElementService.
+ *
* @return the projectElementService
*/
public ProjectElementService getProjectElementService() {
/**
* Set the projectElementService.
- * @param projectElementService the projectElementService to set
+ *
+ * @param projectElementService
+ * the projectElementService to set
*/
- public void setProjectElementService(ProjectElementService projectElementService) {
+ public void setProjectElementService(
+ ProjectElementService projectElementService) {
_projectElementService = projectElementService;
}
/**
* Get the repositoryService.
+ *
* @return the repositoryService
*/
public RepositoryService getRepositoryService() {
/**
* Set the repositoryService.
- * @param repositoryService the repositoryService to set
+ *
+ * @param repositoryService
+ * the repositoryService to set
*/
public void setRepositoryService(RepositoryService repositoryService) {
_repositoryService = repositoryService;
<bean id="searchService"
class="org.splat.service.SearchServiceImpl">
<property name="indexService" ref="indexService" />
- <property name="repositoryService" ref="repositoryService" />
+ <property name="repositoryService" ref="repositoryService" />
+ <property name="studyService" ref="studyService" />
</bean>
<bean id="stepService" class="org.splat.service.StepServiceImpl">
</s:if><s:else>
<input type=radio name="state" value="inCHECK" onClick="changeFilter()"><s:text name="criterion.incheck"/><br/>
</s:else>
- <s:if test="state == 'END'">
- <input type=radio name="state" value="END" checked onClick="changeFilter()"><s:text name="criterion.end"/>
+ <s:if test="state == 'APPROVED'">
+ <input type=radio name="state" value="APPROVED" checked onClick="changeFilter()"><s:text name="criterion.end"/>
</s:if><s:else>
- <input type=radio name="state" value="END" onClick="changeFilter()"><s:text name="criterion.end"/>
+ <input type=radio name="state" value="APPROVED" onClick="changeFilter()"><s:text name="criterion.end"/>
</s:else>
</div>
</td>
fprop.put("visibility", "PRIVATE");
fprop.put("matchamong", "all");
fprop.put("matcontext", "all");
- fprop.put("state", "END");
+ fprop.put("state", "APPROVED");
fprop.put("author", "0");
fprop.put("reference", "");
fprop.put("title", "");
import java.util.List;
import java.util.Map;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
import org.splat.kernel.InvalidPropertyException;
import org.splat.dal.bo.kernel.User;
-import org.splat.dal.dao.som.Database;
import org.splat.dal.bo.som.ProgressState;
import org.splat.service.SearchService;
import org.splat.service.SimulationContextService;
import org.splat.dal.bo.som.Study;
import org.splat.dal.bo.som.Visibility;
-
+/**
+ * Search studies form action.
+ *
+ * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
+ */
public class SearchStudyAction extends SearchBaseAction {
- private String visibility = null; // "Private", "Public", "All"
- private String state = null; // "In-Work", "In-Draft", "In-Check"...
- private String matchamong = null; // "all" or "any"
- private String matcontext = null; // "all" or "any"
- private String refid = null; // Study reference
- private String words = null; // Full text search words
- private SearchService _searchService;
+ private String visibility = null; // "Private", "Public", "All"
+ private String state = null; // "In-Work", "In-Draft", "In-Check"...
+ private String matchamong = null; // "all" or "any"
+ private String matcontext = null; // "all" or "any"
+ private String refid = null; // Study reference
+ private String words = null; // Full text search words
+ /**
+ * Injected project settings service.
+ */
private ProjectSettingsService _projectSettingsService;
+ /**
+ * Injected search service.
+ */
+ private SearchService _searchService;
/**
* Injected simulation context service.
*/
*/
private static final long serialVersionUID = -1910481357051393077L;
- enum UserAction { refreshResult, selectContextType, selectContextValue, cancelSelect, removeContext }
-
-// ==============================================================================================================================
-// Action methods
-// ==============================================================================================================================
-
- public String doInitialize () {
-// -----------------------------
- Session connex = Database.getCurSession();
- Transaction transax = connex.beginTransaction();
- try {
- loadFilter();
- doSearch();
-
-// Final initialization of the form
- setCandidates();
- setContextTypeOptions(getInvolvedContexts());
-
- transax.commit();
- return SUCCESS;
- }
- catch (Exception error) {
-// No need to roll back the transaction as it is read only
- logger.error("Reason: ", error);
- return ERROR;
- }
- }
-
- protected String doSearch () throws InvalidPropertyException {
-// ----------------------------
- Map<String, Object> session = getSession();
- User user = getConnectedUser();
-
- Study.Properties sprop = new Study.Properties();
-
-// Search matching all criteria
- if (!this.state.equals("ANY")) sprop.setState( ProgressState.valueOf(this.state) );
- if (words.length() > 0) sprop.setTitle(words);
- if (refid.length() > 0) sprop.setReference(refid);
- if (context.size() > 0) sprop.setSimulationContexts(context);
- int index = Integer.valueOf(author);
- if (index > 0) {
- User him = getUserService().selectUser(index);
- sprop.setManager(him);
- }
-// Set of the visibility
- if (visibility.equals("all")) {
- Study.Properties other = sprop.copy();
-
- other.setVisibility(Visibility.PUBLIC);
- sprop.setVisibility(Visibility.PRIVATE);
- sprop.setActor(user);
-
- result = getSearchService().selectStudiesWhere(sprop, other);
- }
- else {
- Visibility reparea = null;
- if (visibility.equals("onlypublic")) reparea = Visibility.PUBLIC;
- else reparea = Visibility.valueOf(visibility);
- sprop.setVisibility(reparea);
- if (reparea == Visibility.PRIVATE) sprop.setActor(user);
-
- result = getSearchService().selectStudiesWhere(sprop);
- }
- session.put("search.result", result); // For redisplaying the page without re-executing the search
- return "refresh";
- }
-
-// ==============================================================================================================================
-// Getters
-// ==============================================================================================================================
-
- public String getContextMatch () {
-// --------------------------------
- return matcontext;
- }
- public String getCriteriaMatch () {
-// ---------------------------------
- return matchamong;
- }
- public String getReference () {
-// -----------------------------
- return refid;
- }
- public String getState () {
-// -------------------------
- return state;
- }
- public String getVisibility () {
-// ------------------------------
- return visibility;
- }
- public String getWords () {
-// -------------------------
- return words;
- }
-
-// ==============================================================================================================================
-// Setters
-// ==============================================================================================================================
-
- public void setContextMatch (String value) {
-// ------------------------------------------
- this.matcontext = value;
- }
- public void setCriteriaMatch (String value) {
-// -------------------------------------------
- this.matchamong = value;
- }
- public void setReference (String value) {
-// ---------------------------------------
- this.refid = value;
- }
- public void setState (String value) {
-// -----------------------------------
- this.state = value;
- }
- public void setVisibility (String value) {
-// ----------------------------------------
- this.visibility = value;
- }
- public void setWords (String value) {
-// -----------------------------------
- this.words = value;
- }
-
-// ==============================================================================================================================
-// Implementation of abstract services
-// ==============================================================================================================================
-
- protected List<SimulationContextType> getInvolvedContexts () {
-// ------------------------------------------------------------
- List<ProjectSettingsService.Step> steps = getProjectSettings().getStepsOf(Study.class);
- ProjectSettingsService.Step[] number = steps.toArray(new ProjectSettingsService.Step[steps.size()]);
-
- return getSimulationContextService().selectTypesOf(number);
+ enum UserAction {
+ refreshResult, selectContextType, selectContextValue, cancelSelect, removeContext
+ }
+
+ // ==============================================================================================================================
+ // Action methods
+ // ==============================================================================================================================
+
+ /**
+ * Initialize study search form.
+ * @return SUCCESS if no exception, otherwise return ERROR
+ */
+ public String doInitialize() {
+ try {
+ loadFilter();
+ doSearch();
+
+ // Final initialization of the form
+ setCandidates();
+ setContextTypeOptions(getInvolvedContexts());
+
+ return SUCCESS;
+ } catch (Exception error) {
+ // No need to roll back the transaction as it is read only
+ logger.error("Reason: ", error);
+ return ERROR;
+ }
+ }
+
+ protected String doSearch() throws InvalidPropertyException {
+ // ----------------------------
+ Map<String, Object> session = getSession();
+ User user = getConnectedUser();
+
+ Study.Properties sprop = new Study.Properties();
+
+ // Search matching all criteria
+ if (!this.state.equals("ANY"))
+ sprop.setState(ProgressState.valueOf(this.state));
+ if (words.length() > 0)
+ sprop.setTitle(words);
+ if (refid.length() > 0)
+ sprop.setReference(refid);
+ if (context.size() > 0)
+ sprop.setSimulationContexts(context);
+ int index = Integer.valueOf(author);
+ if (index > 0) {
+ User him = getUserService().selectUser(index);
+ sprop.setManager(him);
+ }
+ // Set of the visibility
+ if (visibility.equals("all")) {
+ Study.Properties other = sprop.copy();
+
+ other.setVisibility(Visibility.PUBLIC);
+ sprop.setVisibility(Visibility.PRIVATE);
+ sprop.setActor(user);
+
+ result = getSearchService().selectStudiesWhere(sprop, other);
+ } else {
+ Visibility reparea = null;
+ if (visibility.equals("onlypublic"))
+ reparea = Visibility.PUBLIC;
+ else
+ reparea = Visibility.valueOf(visibility);
+ sprop.setVisibility(reparea);
+ if (reparea == Visibility.PRIVATE)
+ sprop.setActor(user);
+
+ result = getSearchService().selectStudiesWhere(sprop);
+ }
+ session.put("search.result", result); // For redisplaying the page without re-executing the search
+ return "refresh";
+ }
+
+ // ==============================================================================================================================
+ // Getters
+ // ==============================================================================================================================
+
+ public String getContextMatch() {
+ // --------------------------------
+ return matcontext;
+ }
+
+ public String getCriteriaMatch() {
+ // ---------------------------------
+ return matchamong;
+ }
+
+ public String getReference() {
+ // -----------------------------
+ return refid;
+ }
+
+ public String getState() {
+ // -------------------------
+ return state;
+ }
+
+ public String getVisibility() {
+ // ------------------------------
+ return visibility;
+ }
+
+ public String getWords() {
+ // -------------------------
+ return words;
+ }
+
+ // ==============================================================================================================================
+ // Setters
+ // ==============================================================================================================================
+
+ public void setContextMatch(String value) {
+ // ------------------------------------------
+ this.matcontext = value;
}
- @SuppressWarnings("unchecked")
- protected void loadFilter () {
-// ----------------------------
- Map<String,Object> session = getSession();
- User user = getConnectedUser();
- Map<String,Object> filter = (Map<String, Object>)session.get("study.filter"); // A default filter is supposed being set at start
-
- visibility = (String)filter.get("visibility");
- matchamong = (String)filter.get("matchamong");
- matcontext = (String)filter.get("matcontext");
- state = (String)filter.get("state");
- author = (String)filter.get("author");
- refid = (String)filter.get("reference");
- words = (String)filter.get("title");
- context = (List<SimulationContext>)filter.get("context");
-
- if (user == null) {
- visibility = "onlypublic";
- }
- }
-
- @SuppressWarnings("unchecked")
- protected void saveFilter () {
-// ----------------------------
- Map<String, Object> session = getSession();
- Map<String, Object> filter = (Map<String, Object>)session.get("study.filter"); // A default filter is supposed being set at start
-
- filter.put("visibility", this.visibility);
- filter.put("matchamong", this.matchamong);
- filter.put("matcontext", this.matcontext);
- filter.put("state", this.state);
- filter.put("author", this.author);
- filter.put("reference", this.refid);
- filter.put("title", this.words);
-
- context = (List<SimulationContext>)filter.get("context"); // Only criteria not part of the form
-
- }
- /**
+ public void setCriteriaMatch(String value) {
+ // -------------------------------------------
+ this.matchamong = value;
+ }
+
+ public void setReference(String value) {
+ // ---------------------------------------
+ this.refid = value;
+ }
+
+ public void setState(String value) {
+ // -----------------------------------
+ this.state = value;
+ }
+
+ public void setVisibility(String value) {
+ // ----------------------------------------
+ this.visibility = value;
+ }
+
+ public void setWords(String value) {
+ // -----------------------------------
+ this.words = value;
+ }
+
+ // ==============================================================================================================================
+ // Implementation of abstract services
+ // ==============================================================================================================================
+
+ protected List<SimulationContextType> getInvolvedContexts() {
+ // ------------------------------------------------------------
+ List<ProjectSettingsService.Step> steps = getProjectSettings()
+ .getStepsOf(Study.class);
+ ProjectSettingsService.Step[] number = steps
+ .toArray(new ProjectSettingsService.Step[steps.size()]);
+
+ return getSimulationContextService().selectTypesOf(number);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void loadFilter() {
+ // ----------------------------
+ Map<String, Object> session = getSession();
+ User user = getConnectedUser();
+ Map<String, Object> filter = (Map<String, Object>) session
+ .get("study.filter"); // A default filter is supposed being set at start
+
+ visibility = (String) filter.get("visibility");
+ matchamong = (String) filter.get("matchamong");
+ matcontext = (String) filter.get("matcontext");
+ state = (String) filter.get("state");
+ author = (String) filter.get("author");
+ refid = (String) filter.get("reference");
+ words = (String) filter.get("title");
+ context = (List<SimulationContext>) filter.get("context");
+
+ if (user == null) {
+ visibility = "onlypublic";
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void saveFilter() {
+ // ----------------------------
+ Map<String, Object> session = getSession();
+ Map<String, Object> filter = (Map<String, Object>) session
+ .get("study.filter"); // A default filter is supposed being set at start
+
+ filter.put("visibility", this.visibility);
+ filter.put("matchamong", this.matchamong);
+ filter.put("matcontext", this.matcontext);
+ filter.put("state", this.state);
+ filter.put("author", this.author);
+ filter.put("reference", this.refid);
+ filter.put("title", this.words);
+
+ context = (List<SimulationContext>) filter.get("context"); // Only criteria not part of the form
+
+ }
+
+ /**
* Get the searchService.
+ *
* @return the searchService
*/
public SearchService getSearchService() {
/**
* Set the searchService.
- * @param searchService the searchService to set
+ *
+ * @param searchService
+ * the searchService to set
*/
public void setSearchService(SearchService searchService) {
_searchService = searchService;
}
- /**
- * Get project settings.
+
+ /**
+ * Get project settings.
+ *
* @return Project settings service
*/
private ProjectSettingsService getProjectSettings() {
/**
* Set project settings service.
- * @param projectSettingsService project settings service
+ *
+ * @param projectSettingsService
+ * project settings service
*/
- public void setProjectSettings(
- ProjectSettingsService projectSettingsService) {
+ public void setProjectSettings(ProjectSettingsService projectSettingsService) {
_projectSettingsService = projectSettingsService;
}
/**
* Get the userService.
+ *
* @return the userService
*/
public UserService getUserService() {
/**
* Set the userService.
- * @param userService the userService to set
+ *
+ * @param userService
+ * the userService to set
*/
public void setUserService(UserService userService) {
_userService = userService;
import java.util.List;
import java.util.Map;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
import org.splat.service.SearchService;
-import org.splat.service.SearchServiceImpl;
-import org.splat.service.StudyService;
import org.splat.simer.Action;
-import org.splat.dal.dao.som.Database;
-import org.splat.dal.bo.som.Study;
-
+/**
+ * Action for updating lucene index.
+ *
+ * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
+ */
public class DatabaseIndexingAction extends Action {
/**
* Serial version ID.
*/
- private static final long serialVersionUID = 4194268823457749655L;
+ private static final long serialVersionUID = 4194268823457749655L;
- private List<ImportedStudy> newstudies;
- private String indices;
- private SearchService _searchService;
+ private List<ImportedStudy> newstudies;
+ private String indices;
private ImportedStudy _importedStudy;
- private StudyService _studyService;
-
-// ==============================================================================================================================
-// Action methods
-// ==============================================================================================================================
-
- public String doInitialize () {
-// -----------------------------
- Session connex = Database.getCurSession();
- Transaction transax = connex.beginTransaction();
-
- newstudies = getImportedStudy().selectAll();
- indices = "";
-
- transax.commit();
- return SUCCESS;
- }
-
- public String doIndexing () {
-// ---------------------------
- Session connex = Database.getCurSession();
- Transaction transax = connex.beginTransaction();
- String[] ridlist = indices.split(",");
- @SuppressWarnings("unchecked")
- Map<String, Object> filter = (Map<String, Object>)getSession().get("study.filter");
-
- for (int i=0; i<ridlist.length; i++) {
- int index = Integer.valueOf(ridlist[i].trim());
- Study study = getStudyService().selectStudy(index);
- getSearchService().indexStudy(study);
- }
- filter.put("owner", "all"); // Just in case of 1st study search
-
- transax.commit();
- return SUCCESS;
- }
-
-// ==============================================================================================================================
-// Getters and setters
-// ==============================================================================================================================
-
- public List<ImportedStudy> getNewStudies () {
-// -------------------------------------------
- return newstudies;
- }
- public String getIndices () {
-// ---------------------------
- return indices;
- }
-
- public void setIndices (String indices) {
-// ---------------------------------------
- this.indices = indices;
- }
+ /**
+ * Injected search service.
+ */
+ private SearchService _searchService;
+
+ // ==============================================================================================================================
+ // Action methods
+ // ==============================================================================================================================
/**
- * Get the searchService.
- * @return the searchService
+ * Initialize the action.
+ * @return SUCCESS
*/
- public SearchService getSearchService() {
- return _searchService;
+ public String doInitialize() {
+ newstudies = getImportedStudy().selectAll();
+ indices = "";
+ return SUCCESS;
}
/**
- * Set the searchService.
- * @param searchService the searchService to set
+ * Reindex studies.
+ * @return SUCCESS
*/
- public void setSearchService(SearchService searchService) {
- _searchService = searchService;
+ public String doIndexing() {
+ String[] ridlist = indices.split(",");
+ @SuppressWarnings("unchecked")
+ Map<String, Object> filter = (Map<String, Object>) getSession().get(
+ "study.filter");
+ getSearchService().reindexStudies(ridlist);
+ filter.put("owner", "all"); // Just in case of 1st study search
+
+ return SUCCESS;
+ }
+
+ // ==============================================================================================================================
+ // Getters and setters
+ // ==============================================================================================================================
+
+ /**
+ * Get the new studies.
+ *
+ * @return the new studies
+ */
+ public List<ImportedStudy> getNewStudies() {
+ // -------------------------------------------
+ return newstudies;
}
/**
* Get the importedStudy.
+ *
* @return the importedStudy
*/
public ImportedStudy getImportedStudy() {
/**
* Set the importedStudy.
- * @param importedStudy the importedStudy to set
+ *
+ * @param importedStudy
+ * the importedStudy to set
*/
public void setImportedStudy(ImportedStudy importedStudy) {
_importedStudy = importedStudy;
}
/**
- * Get the studyService.
+ * Get the indices.
+ * @return the indices
+ */
+ public String getIndices() {
+ return indices;
+ }
+
+ /**
+ * Set the indices.
+ * @param indices the indices to set
+ */
+ public void setIndices(String indices) {
+ this.indices = indices;
+ }
+
+ /**
+ * Get the searchService.
*
- * @return the studyService
+ * @return the searchService
*/
- public StudyService getStudyService() {
- return _studyService;
+ public SearchService getSearchService() {
+ return _searchService;
}
/**
- * Set the studyService.
+ * Set the searchService.
*
- * @param studyService
- * the studyService to set
+ * @param searchService
+ * the searchService to set
*/
- public void setStudyService(StudyService studyService) {
- _studyService = studyService;
+ public void setSearchService(SearchService searchService) {
+ _searchService = searchService;
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
<!-- configuration i18n -->
<bean id="i18nUtils" class="org.splat.i18n.I18nUtils">
- <property name="resourceBundleMessageSource" ref="messageSource" />
+ <property name="resourceBundleMessageSource"
+ ref="messageSource" />
</bean>
<bean id="messageSource"
<!-- ref 'baseMessageSource' into Siman-common\src\spring\globalContext.xml -->
<!-- property name="parentMessageSource" ref="baseMessageSource"/ -->
- <bean id="applicationSettings" class="org.splat.simer.ApplicationSettings"
- factory-method="getMe">
+ <bean id="applicationSettings"
+ class="org.splat.simer.ApplicationSettings" factory-method="getMe">
<property name="projectSettings" ref="projectSettings" />
<property name="documentTypeService" ref="documentTypeService" />
</bean>
<bean id="importedStudy" class="org.splat.simer.admin.ImportedStudy"
- scope="prototype" />
+ scope="prototype">
+ <property name="searchService" ref="searchService" />
+ </bean>
<bean id="slidMenu" scope="session" abstract="true">
- <property name="projectElementService" ref="projectElementService" />
+ <property name="projectElementService"
+ ref="projectElementService" />
<property name="scenarioService" ref="scenarioService" />
</bean>
- <bean id="studyMenu" class="org.splat.simer.StudyMenu" scope="session"
- parent="slidMenu" />
+ <bean id="studyMenu" class="org.splat.simer.StudyMenu"
+ scope="session" parent="slidMenu" />
<bean id="newScenarioMenu" class="org.splat.simer.NewScenarioMenu"
scope="session" parent="slidMenu" />
- <bean id="openObject" abstract="true" class="org.splat.simer.OpenObject"
- scope="session">
- <property name="projectElementService" ref="projectElementService" />
+ <bean id="openObject" abstract="true"
+ class="org.splat.simer.OpenObject" scope="session">
+ <property name="projectElementService"
+ ref="projectElementService" />
<property name="projectSettings" ref="projectSettings" />
- <property name="knowledgeElementTypeService" ref="knowledgeElementTypeService" />
+ <property name="knowledgeElementTypeService"
+ ref="knowledgeElementTypeService" />
</bean>
- <bean id="openStudy" class="org.splat.simer.OpenStudy" parent="openObject"
- scope="session">
- <property name="projectElementService" ref="projectElementService" />
+ <bean id="openStudy" class="org.splat.simer.OpenStudy"
+ parent="openObject" scope="session">
+ <property name="projectElementService"
+ ref="projectElementService" />
<property name="publicationService" ref="publicationService" />
<property name="studyService" ref="studyService" />
<property name="stepService" ref="stepService" />
<property name="repositoryService" ref="repositoryService" />
<property name="menu" ref="studyMenu" />
<property name="documentTypeService" ref="documentTypeService" />
- <property name="documentService" ref="documentService" />
+ <property name="documentService" ref="documentService" />
</bean>
<bean id="openKnowledge" class="org.splat.simer.OpenKnowledge"
parent="openObject" scope="session">
</bean>
- <bean id="baseAction" class="org.splat.simer.Action" scope="prototype"
- abstract="true">
+ <bean id="baseAction" class="org.splat.simer.Action"
+ scope="prototype" abstract="true">
<property name="openStudy" ref="openStudy" />
<property name="openKnowledge" ref="openKnowledge" />
</bean>
<bean id="newStudyAction" class="org.splat.simer.NewStudyAction"
parent="baseAction" scope="prototype">
- <property name="simulationContextService" ref="simulationContextService" />
+ <property name="simulationContextService"
+ ref="simulationContextService" />
<property name="scenarioService" ref="scenarioService" />
<property name="studyService" ref="studyService" />
</bean>
- <bean id="newScenarioAction" class="org.splat.simer.NewScenarioAction"
- parent="baseAction" scope="prototype">
- <property name="projectElementService" ref="projectElementService" />
+ <bean id="newScenarioAction"
+ class="org.splat.simer.NewScenarioAction" parent="baseAction"
+ scope="prototype">
+ <property name="projectElementService"
+ ref="projectElementService" />
<property name="scenarioService" ref="scenarioService" />
<property name="menu" ref="newScenarioMenu" />
</bean>
- <bean id="importDocumentAction" class="org.splat.simer.ImportDocumentAction"
- scope="prototype" parent="baseAction">
+ <bean id="importDocumentAction"
+ class="org.splat.simer.ImportDocumentAction" scope="prototype"
+ parent="baseAction">
<property name="stepService" ref="stepService" />
<property name="projectSettings" ref="projectSettings" />
<property name="publicationService" ref="publicationService" />
<property name="documentTypeService" ref="documentTypeService" />
</bean>
- <bean id="displayStudyStepAction" class="org.splat.simer.DisplayStudyStepAction"
- parent="baseAction" scope="prototype">
+ <bean id="displayStudyStepAction"
+ class="org.splat.simer.DisplayStudyStepAction" parent="baseAction"
+ scope="prototype">
<property name="studyService" ref="studyService" />
</bean>
<!--========= Inherited from displayStudyStepAction ========= -->
- <bean id="studyPropertiesAction" class="org.splat.simer.StudyPropertiesAction"
- scope="prototype" parent="displayStudyStepAction">
+ <bean id="studyPropertiesAction"
+ class="org.splat.simer.StudyPropertiesAction" scope="prototype"
+ parent="displayStudyStepAction">
<property name="documentTypeService" ref="documentTypeService" />
- <property name="userService" ref="userService" />
+ <property name="userService" ref="userService" />
</bean>
<bean id="editStudyAction" class="org.splat.simer.EditStudyAction"
scope="prototype" parent="displayStudyStepAction">
</bean>
- <bean id="editScenarioPropertiesAction" class="org.splat.simer.EditScenarioPropertiesAction"
- scope="prototype" parent="displayStudyStepAction">
- <property name="projectElementService" ref="projectElementService" />
+ <bean id="editScenarioPropertiesAction"
+ class="org.splat.simer.EditScenarioPropertiesAction" scope="prototype"
+ parent="displayStudyStepAction">
+ <property name="projectElementService"
+ ref="projectElementService" />
<property name="scenarioService" ref="scenarioService" />
</bean>
- <bean id="editSimulationContextAction" class="org.splat.simer.EditSimulationContextAction"
- scope="prototype" parent="displayStudyStepAction">
+ <bean id="editSimulationContextAction"
+ class="org.splat.simer.EditSimulationContextAction" scope="prototype"
+ parent="displayStudyStepAction">
<property name="stepService" ref="stepService" />
- <property name="simulationContextService" ref="simulationContextService" />
+ <property name="simulationContextService"
+ ref="simulationContextService" />
</bean>
- <bean id="editDocumentAction" class="org.splat.simer.EditDocumentAction"
- scope="prototype" parent="displayStudyStepAction">
+ <bean id="editDocumentAction"
+ class="org.splat.simer.EditDocumentAction" scope="prototype"
+ parent="displayStudyStepAction">
<property name="stepService" ref="stepService" />
<property name="publicationService" ref="publicationService" />
<property name="repositoryService" ref="repositoryService" />
</bean>
- <bean id="editKnowledgeElementAction" class="org.splat.simer.EditKnowledgeElementAction"
- scope="prototype" parent="displayStudyStepAction">
- <property name="knowledgeElementService" ref="knowledgeElementService" />
- <property name="knowledgeElementTypeService" ref="knowledgeElementTypeService" />
+ <bean id="editKnowledgeElementAction"
+ class="org.splat.simer.EditKnowledgeElementAction" scope="prototype"
+ parent="displayStudyStepAction">
+ <property name="knowledgeElementService"
+ ref="knowledgeElementService" />
+ <property name="knowledgeElementTypeService"
+ ref="knowledgeElementTypeService" />
<property name="scenarioService" ref="scenarioService" />
</bean>
<!-- End of Inherited from displayStudyStepAction -->
- <bean id="startAction" class="org.splat.simer.StartAction" scope="prototype">
+ <bean id="startAction" class="org.splat.simer.StartAction"
+ scope="prototype">
<property name="applicationSettings" ref="applicationSettings" />
<property name="projectSettings" ref="projectSettings" />
</bean>
scope="prototype">
</bean>
- <bean id="menuAction" class="org.splat.simer.MenuAction" scope="prototype">
+ <bean id="menuAction" class="org.splat.simer.MenuAction"
+ scope="prototype">
</bean>
- <bean id="notYetImplementedAction" class="org.splat.simer.NotYetImplementedAction"
- scope="prototype">
+ <bean id="notYetImplementedAction"
+ class="org.splat.simer.NotYetImplementedAction" scope="prototype">
</bean>
- <bean id="searchStudyAction" class="org.splat.simer.SearchStudyAction"
- scope="prototype">
+ <bean id="searchStudyAction"
+ class="org.splat.simer.SearchStudyAction" scope="prototype">
<property name="projectSettings" ref="projectSettings" />
<property name="searchService" ref="searchService" />
- <property name="simulationContextService" ref="simulationContextService" />
- <property name="userService" ref="userService" />
+ <property name="simulationContextService"
+ ref="simulationContextService" />
+ <property name="userService" ref="userService" />
</bean>
- <bean id="searchKnowledgeAction" class="org.splat.simer.SearchKnowledgeAction"
- scope="prototype">
+ <bean id="searchKnowledgeAction"
+ class="org.splat.simer.SearchKnowledgeAction" scope="prototype">
<property name="searchService" ref="searchService" />
- <property name="simulationContextService" ref="simulationContextService" />
- <property name="knowledgeElementTypeService" ref="knowledgeElementTypeService" />
- <property name="userService" ref="userService" />
+ <property name="simulationContextService"
+ ref="simulationContextService" />
+ <property name="knowledgeElementTypeService"
+ ref="knowledgeElementTypeService" />
+ <property name="userService" ref="userService" />
</bean>
- <bean id="searchDocumentAction" class="org.splat.simer.SearchDocumentAction"
- scope="prototype">
+ <bean id="searchDocumentAction"
+ class="org.splat.simer.SearchDocumentAction" scope="prototype">
</bean>
- <bean id="displayKnowledgeAction" class="org.splat.simer.DisplayKnowledgeAction"
- scope="prototype">
- <property name="knowledgeElementService" ref="knowledgeElementService" />
+ <bean id="displayKnowledgeAction"
+ class="org.splat.simer.DisplayKnowledgeAction" scope="prototype">
+ <property name="knowledgeElementService"
+ ref="knowledgeElementService" />
</bean>
<bean id="uploadAction" class="org.splat.simer.UploadAction"
<property name="repositoryService" ref="repositoryService" />
</bean>
- <bean id="versionDocumentAction" class="org.splat.simer.VersionDocumentAction"
- scope="prototype">
+ <bean id="versionDocumentAction"
+ class="org.splat.simer.VersionDocumentAction" scope="prototype">
<property name="projectSettings" ref="projectSettings" />
<property name="publicationService" ref="publicationService" />
<property name="stepService" ref="stepService" />
<property name="repositoryService" ref="repositoryService" />
</bean>
- <bean id="databaseIndexingAction" class="org.splat.simer.admin.DatabaseIndexingAction"
+ <bean id="databaseIndexingAction"
+ class="org.splat.simer.admin.DatabaseIndexingAction"
scope="prototype">
- <property name="studyService" ref="studyService" />
<property name="importedStudy" ref="importedStudy" />
<property name="searchService" ref="searchService" />
</bean>
- <bean id="importUserAction" class="org.splat.simer.admin.ImportUserAction"
- scope="prototype">
+ <bean id="importUserAction"
+ class="org.splat.simer.admin.ImportUserAction" scope="prototype">
<property name="repositoryService" ref="repositoryService" />
- <property name="userService" ref="userService" />
+ <property name="userService" ref="userService" />
</bean>
- <bean id="simulationContextAction" class="org.splat.simer.admin.SimulationContextAction"
+ <bean id="simulationContextAction"
+ class="org.splat.simer.admin.SimulationContextAction"
scope="prototype">
- <property name="knowledgeElementService" ref="knowledgeElementService" />
+ <property name="knowledgeElementService"
+ ref="knowledgeElementService" />
<property name="searchService" ref="searchService" />
<property name="projectSettings" ref="projectSettings" />
- <property name="simulationContextService" ref="simulationContextService" />
+ <property name="simulationContextService"
+ ref="simulationContextService" />
</bean>
- <bean id="knowledgeElementAction" class="org.splat.simer.admin.KnowledgeElementAction"
+ <bean id="knowledgeElementAction"
+ class="org.splat.simer.admin.KnowledgeElementAction"
scope="prototype">
</bean>
- <bean id="saveDocumentAction" class="org.splat.module.SaveDocumentAction"
- scope="prototype">
+ <bean id="saveDocumentAction"
+ class="org.splat.module.SaveDocumentAction" scope="prototype">
<property name="documentTypeService" ref="documentTypeService" />
<property name="publicationService" ref="publicationService" />
<property name="repositoryService" ref="repositoryService" />
<property name="scenarioService" ref="scenarioService" />
<property name="stepService" ref="stepService" />
- <property name="simulationContextService" ref="simulationContextService" />
+ <property name="simulationContextService"
+ ref="simulationContextService" />
</bean>
</beans>