I have node override and a query generated by a view. I need to get results of that query in my node tpl file. What is the method can I use for that?
Thanks
Use views_embed_view.
Related
this is my first question, thanks in advance.
I am trying to customize the liferay results portlet and facets, with custom results. I need to filter the results once the search is launched, and remove the results that do not have layoutId :
with->
layoutIds = journalContentSearchLocalService.getLayoutIds(groupId,false,articleIdResult);
I´m doing this in a jsp fragment, but i think that it´s not correct.
I have been searching and i think the correct way is to modify the java class with the action, for example with acction coomand hook, is this correct?
Please, can you explain me the correct way to modify this functionalities?
Regards!!
ok. it looks you want result of journalarticle having display page is set. in that case, you need to look for JournalarticleModelPreFiltercontributor component extension or journalarticlepostprocessor if you are using legacy search api. when article gets indexed layoutuuid field is also indexed for each article. that field will have value if display page is set for specific web content or article.
So, you can use any of the above mentioned way to add check that this field should not be empty as search term. which will filter your result in request itself. instead adding overhead on result as later filtering in jsp.
I have my data model already defined and implemented. I can very easily write manually the filter to filter out non-authorized results for the user who sent the query (which would be in the style of: "collection.acl.personId": queryPersonId )
My problem is, where and how should I write this "thing" to be as automatic as possible?
I tried to do it with a custom query and a static method, but did not had any luck on both.
Static method con: I don't want to rewrite all my code to use .then(). I want to keep the current chaining.
Custom query: it simply did not worked, even by following the doc.
Ideal the result would be something like
Model.findWithAcl(filters).lean()
Model.findOneWithAcl(filters).lean()
Note that we are using Typescript. The priority would be to have something working, but having the ability to have a working type would be the second priority right after.
Thanks for any help
Casl mongoose gives a very good way of filtering both results (row level) and fields from collections. Note that it also can be used in the front end.
Great package that works very well with auth0 rights.
https://casl.js.org/v5/en/guide/intro
https://casl.js.org/v5/en/package/casl-mongoose
I have multiple views in multiple nsf databases that I want to perform a view.update on, build an array of records, and show the results in one ListView. What would be the best way to do this in regards to performance? One idea that came to mind was to:
Perform .update() method on views
In callback of each update, push records to a (global?) array
Set array to ListView
Am I thinking about this correctly? Is there an example of doing this in Domino To Go?
Thanks for any tips.
I would chain the .update() methods on the views and in the callback of the final update I would sue a DTGDatabase object with getAllEntriesByKey() method to get the records, it's faster than using NotesView.getAllEntriesByKey of each view.
Or use DTGDatabase.getAllEntriesBySQL with a proper SQL statement, that way you can do a JOIN and it's the fastest option.
Is it possible to get a list of all the views of a database in couchdb using [dscape/nano][1]? The closest I can get with just curl request is this:
http://URL/DBNAME/_all_docs?key=_design/views&include_docs=true.
The above returns all the views including the javascript functions. But I would like to extract only the view names.
In newer CouchDB versions, you can use "_design_docs" to only list the views:
GET /dbname/_design_docs
This will get you the wanted list much faster than if you'd have to go through all the docs (_all_docs).
See 1.3.3. /{db}/_design_docs of the official documentation.
Note: The documentation as of today states this is new in CouchDB version 2.2, but I successfully tested it on 2.1.
Unfortunately the only possible way of doing this is by extracting view names from the result of the query you've included in your question. Futon is doing it this way when populating drop-down list of views, so I think it is safe to assume this is the only solution.
You may also want to change your query to the following to include all design documents, instead of just the one named views:
GET /dbname/_all_docs?startkey="_design/"&endkey="_design0"&include_docs=true
I've got a Subsonic query that isn't returning any values. I think the problem is in my where clause, although I'm not sure why.
What I'm really looking for is a way to debug the query to see the SQL that's actually being spit out by Subsonic. I know there was a way to do this with the Query object with Inspect(), but I'm using Select objects (or could also probably use SQLQuerys) because I need joins. Is there any inspect() type option for a Subsonic Select?
Here's the code I'm using:
Dim qry As New [Select]("Contract_NO")
qry.From(<table1>.Schema)
qry.InnerJoin(<table2>.<table2columnA>, <table1>.<table1columnA)
qry.Where(NonInfoleaseLessor.Columns.LessorCode).Like("mystring")
If I comment out the where line, I get a full list of results. It doesn't like something about it, but I've manually run the query at the database with that where clause, and it works. How can I see what the difference is?
The problem with your query is that you should be using Contains("mystring") instead of Like("mystring").
The best way to see the SQL is to use the BuildSqlStatement() method of the query.
Use [a] profiler to see what SQL is actually being executed against the database.
As Adam spotted:
.Like("mystring")
should most probably be
.Like("%mystring%")
please try using Like("%mystring%")
It might have something to do with your choice of clause, or which column name you are using. Subsonic has a couple of column name field
OBJECT.xyzColumn
OBJECT.xyzColumn.QualifiedName
OBJECT.Columns.xyz
I have had to play with these in the past to get the values I wanted.