then you should try your query in Admin Central, then tools... theres a page where you can play with your querys in the different repositories like dms, data and website... if the query works there, then you know it has to work in your code...
hope that helps... Daniel 2009/12/9 Klaus, Daniel <[email protected]> > Are you sure that I am able to access dms entries while querying the > website-repository? > > for me the following statement works: > > QueryManager qm = MgnlContext.getQueryManager("website"); > my query looks like > > String queryString ="SELECT * FROM nt:base WHERE jcr:path like > '/magnolia/why magnolia enterprise edition'"; > I want to list files on my page uploaded into the document management > system. > > But the query doesn't seem to find entries. That's the reason why I first > tried to query the "dms" repository. > > Regards > Daniel > > ------------------------------ > *Von:* [email protected] [mailto: > [email protected]] *Im Auftrag von *Ing. Daniel Garcia > *Gesendet:* Mittwoch, 9. Dezember 2009 16:21 > > *An:* Magnolia User-List > *Betreff:* Re: [magnolia-user] getQueryManager("dms") returns null > > Use it this way... > > private static final String DEFAULT_REPOSITORY = ContentRepository.WEBSITE; > > .getQueryManager(DEFAULT_REPOSITORY); > > also... Im sending you a function that I use to do some query... you can try > to get it manually or using the QueryUtil Class... > > > > Collection typedContent = null; > String queryString ="your que"; > try { > info.magnolia.cms.core.search.QueryManager qm = > MgnlContext.getHierarchyManager(ContentRepository.WEBSITE).getQueryManager(); > > info.magnolia.cms.core.search.Query q = > qm.createQuery(queryString, "sql"); > info.magnolia.cms.core.search.QueryResult qr = q.execute(); > typedContent = > qr.getContent(CLConstants.getLeadClientInfoNodeType()); > > }catch(Exception e){ > log.debug("getLeadsByStatusManually: " + e.getMessage()); > } > > > typedContent will contain your info... > > Hope this help.. btw... this works fine using Magnolia 4.1... not 3.0 maybe > thats the main cause of your issue... > > > -- > > Ing. Daniel A. García González > Red Fox Information Technology > www.redfoxit.net > > > > 2009/12/9 Klaus, Daniel <[email protected]> > >> Hi John, which constant would you suggest? I can't see anything like >> 'dms'. Could it be a version (3.0) problem? >> The following constants exist: >> >> public static final String WEBSITE = "website"; >> public static final String USERS = "users"; >> public static final String USER_ROLES = "userroles"; >> public static final String USER_GROUPS = "usergroups"; >> public static final String CONFIG = "config"; >> public static final String DEFAULT_WORKSPACE = "default"; >> public static final String VERSION_STORE = "mgnlVersion"; >> public static final String NAMESPACE_PREFIX = "mgnl"; >> public static final String NAMESPACE_URI = " >> http://www.magnolia.info/jcr/mgnl"; >> private static Logger log; >> private static final String ELEMENT_REPOSITORY = "Repository"; >> private static final String ELEMENT_REPOSITORYMAPPING = >> "RepositoryMapping"; >> private static final String ELEMENT_PARAM = "param"; >> private static final String ELEMENT_WORKSPACE = "workspace"; >> private static final String ATTRIBUTE_NAME = "name"; >> private static final String ATTRIBUTE_LOAD_ON_STARTUP = >> "loadOnStartup"; >> private static final String ATTRIBUTE_PROVIDER = "provider"; >> private static final String ATTRIBUTE_VALUE = "value"; >> private static final String ATTRIBUTE_REPOSITORY_NAME = >> "repositoryName"; >> private static final String ATTRIBUTE_WORKSPACE_NAME = >> "workspaceName"; >> public static final String REPOSITORY_USER = >> SystemProperty.getProperty("magnolia.connection.jcr.userId"); >> public static final String REPOSITORY_PSWD = >> SystemProperty.getProperty("magnolia.connection.jcr.password"); >> Regards >> Daniel >> ------------------------------ >> *Von:* [email protected] [mailto: >> [email protected]] *Im Auftrag von *John Preston >> *Gesendet:* Mittwoch, 9. Dezember 2009 11:54 >> *An:* Magnolia User-List >> *Betreff:* Re: [magnolia-user] getQueryManager("dms") returns null >> >> Try specifying the Content Repository using the constants provided by the >> class info.magnolia.cms.beans.config.ContentRepository >> >> 2009/12/8 Klaus, Daniel <[email protected]> >> >>> I have Magnolia 3.0 running and I am trying to query the dms in a >>> template jsp. >>> >>> The following returns null and so makes it impossible to query the dms. >>> >>> info.magnolia.cms.core.search.QueryManager qm = >>> MgnlContext.getQueryManager("dms"); >>> >>> If I replace "dms" with "website" a propriate Query Manager is returned. >>> >>> Querying the DMS via the Magnolia Author / Tools / JCR Queries works and >>> it's also possible to store documents in the DMS. >>> >>> Any idea, why NULL is returned? >>> >>> Thanks >>> Daniel >>> >>> >>> ------------------------------ >>> ---------------------------------------------------------------- >>> For list details see >>> http://www.magnolia-cms.com/home/community/mailing-lists.html >>> To unsubscribe, E-mail to: <[email protected]> >>> ---------------------------------------------------------------- >>> >>> >> >> >> ------------------------------ >> ---------------------------------------------------------------- >> For list details see >> http://www.magnolia-cms.com/home/community/mailing-lists.html >> To unsubscribe, E-mail to: <[email protected]> >> ---------------------------------------------------------------- >> >> > > > > > > > ------------------------------ > ---------------------------------------------------------------- > For list details see > http://www.magnolia-cms.com/home/community/mailing-lists.html > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- > > -- Ing. Daniel A. García González Red Fox Information Technology www.redfoxit.net ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
