public interface QueryAgent
Agent providing means to answer queries for project-related FirstSpirit elements stored in its repository. The query API is simple and takes a simple text satisfying the query syntax. In general, it is about getting the QueryAgent (example script):
//!Beanshell
import de.espirit.firstspirit.agency.QueryAgent;
agent = context.requireSpecialist(QueryAgent.TYPE);
hits = agent.answer("fs.uid = solar_concept_car");
iHit = hits.iterator();
while (iHit.hasNext()) {
hit = iHit.next();
print(hit);
}
Examples on the Mithras Energy demo project:
fs.uid = solar_concept_car
"solar_concept_car MEDIASTORE_LEAF"
"solar_concept_car MEDIASTORE_LEAF" or fs.uid = solar_concept_car
st_picture_zoomable = true
meta.md_content = *
meta.md_content = ""
fs.meta = 1
fs.width >= 468 and fs.height >= 60
fs.width >= 1000 or fs.height >= 1000
StoreElement.getElementType()
):fs.type = Dataset and fs.type = Page
fs.workflow = *
workflow id
/workflow state id
")
fs.workflowLock = 1
Modifier and Type | Field and Description |
---|---|
static SpecialistType<QueryAgent> |
TYPE
Agent providing means to answer queries for project-related FirstSpirit elements stored in its repository.
|
Modifier and Type | Method and Description |
---|---|
Iterable<IDProvider> |
answer(String query)
Answers a given query by giving iterable access to matching FirstSpirit elements.
|
static final SpecialistType<QueryAgent> TYPE
@NotNull Iterable<IDProvider> answer(@NotNull String query)
Note that, each time the iterable object returned is accessed to read elements (i.e., an iterator object gets requested), a new search gets started. Note further, that iterators provided do not support removing elements.
query
- A formal description a result-eligible element has to match.Copyright © 2014 e-Spirit AG. All Rights Reserved. Build 5.0_BETA.500