Viewflow: AllProcessListView return empty - django-viewflow

I'm trying to use viewflow in my project but I'm having a few problems with the views that start with "All" (AllProcessListView, AllQueueListView, ecc..).
I created some custom templates for them but they always return me empty querysets, even if the specific views for a process show the correct results. Any help please?
This is my url setup:
url(r'^flow_processes', AllProcessListView.as_view(), name='flow_processes'),
url(r'^flow_queues', AllQueueListView.as_view(), name='flow_queues'),

AllProcessListView need to be instanciated with information how flow classes are mapped into django url namespaces in your url config ex:
https://github.com/viewflow/viewflow/blob/57eafb964c0d599fba239144e02f739c8c91bb60/tests/test_views_list.py#L14
views.AllProcessListView.as_view(ns_map={ListViewTestFlow: 'listviewtest'})

Related

Customize search results and facets in Liferay 7.1

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.

How does my MVC5 controller find a View?

I was checking through the code on our project, and found an Action method in our code without a view. CustomForms.Index didn't have a matching View, but when I run the code, up comes the view listing the appropriate records.
I'm happy that we don't get an error. But I'm curious how to figure out what View it is using.
By convention, Razor searches for views in the following paths, in order:
~/Areas/{AreaName}/Views/{ControllerName}/{ActionName}.cshtml
~/Areas/{AreaName}/Views/Shared/{ActionName}.cshtml
~/Views/{ControllerName}/{ActionName}.cshtml
~/Views/Shared/{ActionName}.cshtml
Obviously, if you're not utilizing areas, the first two don't apply. Additionally, the view can be explicitly given, by passing a string to the return View call:
return View("Foo");
Would look for a view name Foo.cshtml in all of the above locations, instead of the action name.

how to filter inside Included model using Looback REST URL?

I want to do include with filters based on REST REQUEST. Something like :
Albums?filter=[include][favorites]&filter[where][favorites.type]=abc
I am using MYSQL connector.Any help would be greatly appreciated.
Thanks
It's not possible to filter the model based on included items directly. But you can have a few options here:
Set up a remote hook to remove entries that don't match the included items. See http://docs.strongloop.com/display/LB/Remote+hooks.
Create custom method that call Album.find with include and remove entries that don't match the included items. See http://docs.strongloop.com/display/LB/Remote+methods.

Xpage dynamic Id for data update or validation(CSJS)

Before describing the problem, I would like to add that I have looked for this problem on google and have found many solutions but none related to XPAGES. Since, Xpage have a unique method to generate the field id I am facing this problem. I have also posted the same question here on IBM forum and awaiting the reply there(http://www-10.lotus.com/ldd/ndseforum.nsf/xpTopicThread.xsp?documentId=EDEBB14BDF2E804F85257BE8001E4F76):
Problem:
I am trying to pass dynamic id to the default function getElementById with no success. To explain it clearly, I have a front end validation for specific fields. This fields are stored n database. So, I have a for loop running for all the fields. The problem here is that XPages generates the Id dynamically and hence for the same form if there is a hierarchical tabbed panel then the Id also included the tabbed panel Id in it.
Here is the code view of the problem:
The standard method to retrieve the value(CSJS) is:
document.getElementById("#{id:inputText1}").value;
However, if I try to pass in a dynamic id. It doesn't work. I have tried "n" number of approaches I found on Google but none regarding this problem. One solution I tried here was:
var x = "inputText1";
document.getElementById("#{id:"+x+"}").value;
Any help would really be appreciated. Really eager to hear some good suggestion.
The "#{id:inputText1}" part is computed at the server before the page is served so it's too late to set the ID in client side JS.
To set the ID in SSJS you can do this:
document.getElementById("#{javascript:var x='inputText1'; getClientId(x)}").value;
With getClientId you can also build a CSJS array of IDs in in SSJS. Then you can loop that array in CSJS. You would build the array this way:
var strIDs = ${javascript:'["a","b","c"]'};

How to access cck fields in tpl file?

I am working on one already created drupal site. In themes folder it has one tpl.php file, Where theme is done to display the content. Now it is as follows
print $content
And all the fields of cck are displayed properly. But I want to access every field like Title, Body etc. I have tried with $content['title'], But nothing is displayed.
Can anyone please tell me how to access different fields in my tpl file. I am using Drupal 6.
Thanks in advance.
try to
<pre>
print_r($content);
</pre>
then you will see what's exactly in the array.
You can use node-[type].tpl.php to see the different fields. There, by default, each CCK field is exposed in a variable named with the field's name, for example if you have a field called field_logo then you have a variable called $field_logo which is an array representing the field's processed values and can be print_r()'d.
More template suggestions are available in Drupal documentation. And more information on using node.tpl.php and its derivatives is available too.

Resources