1 5 6 package org.exoplatform.services.jcr.impl.core.query; 7 8 import javax.jcr.query.QueryManager; 9 import javax.jcr.query.Query; 10 import javax.jcr.query.InvalidQueryException; 11 import java.util.HashMap ; 12 13 14 import javax.jcr.RepositoryException; 15 import org.exoplatform.services.jcr.impl.core.NodeImpl; 16 import org.exoplatform.services.jcr.impl.core.WorkspaceImpl; 17 18 24 25 public class QueryManagerImpl implements QueryManager { 26 27 private static QueryManagerImpl instance; 28 private HashMap languages; 29 private WorkspaceImpl workspace; 30 31 private QueryManagerImpl() { 32 languages = new HashMap (); 33 languages.put("JCRQL-SSES", "JCR query language"); 34 } 36 37 public static QueryManagerImpl getInstance() { 38 if (instance == null) 39 instance = new QueryManagerImpl(); 40 return instance; 41 } 42 43 public void init(WorkspaceImpl workspace) { 44 this.workspace = workspace; 45 } 46 47 51 public Query createQuery(String statement, int language) throws InvalidQueryException, RepositoryException { 52 if (workspace == null) 53 throw new RepositoryException("Query Manager is not initialized!"); 54 55 57 return null; 58 } 59 60 68 public Query getQuery(String absPath) throws InvalidQueryException, RepositoryException { 69 81 throw new RepositoryException("Not implemented yet !"); 82 83 } 84 85 92 public int[] getSupportedQueryLanguages() { 93 95 int[] langs = new int[1]; 96 langs[1] = 0; 97 return langs; 98 } 99 118 } 119 | Popular Tags |