Find property associated with PropertyDataFilter1D - ocean

I have a PropertyDataFilter1D input by the user. How do I figure out which pillar grid property is associated with that filter? The filter contains a PropertyVersionBase member, but I don't know how to look up the property with that.

There is a problem here: Ocean API allows you to create a PropertyDataFilter1D from a PropertyVersion, whereas native filters in Petrel are created from a property. And, Ocean doesn't expose any reference to the Petrel property. Other words, if you have two filters for two different porosity properties, but both properties are based on the same Porosity template, from the Ocean site it will be the same Porosity PropertyVersion (Template) for the both filters.

Related

Sensenet: Pagination on Document Library

It is possible to define pagination on document library?
I have a document library with more that 10000 documents... when I open the library occurs an timeout.
Actually SenseNet already does this! They just don't deliver it in the standard list control. If you open up the PRC and navigate to /Root/IMS/BuiltIn/Portal you'll see a list control with paging. The code can be found at /Root/Global/renderers/UserExploreGrid.ascx as User Control portlet. You can copy the code and change it to meet your needs.
Our company prefers to create User Control portlets and use Datatables with calls to the SenseNet OData API using skip and top to deliver pages.
Finally, given that SenseNet Content is stored as a tree structure (in SQL!), you can move the Content after creation so that data is organized hierarchically. A common solution is to take the first letter of the DisplayName and create a sub-folder from that letter, thereby reducing the number of items at a single node.
Here's what the paging looks like:
The short answer is no. Right now there isn't a built in functionality for that.
The long answer is that you can make a pagination yourself. One of the core member of sensenet made a grid where you can use pagination. It won't work with the current free to use releases because they lack the js files she used. But the idea behind it, is using a custom view. Which you can achieve by adding a system folder named Views under a the Document library and adding your custom view there.
You can use this grid for Explore, just follow these steps:
Go to the Explore action page, and switch editor mode on the PRC.
Place a ClientContext portlet (this can find under the Portlets->Application section in the portlet picker dialog) to the Wide column. Set portlet (client context porlet) properties, Apparance to None. It is a technical portlet, which allow get the CurrentContext in javascript. This is a very important element to work with this grid. The Grid use the client context.
Place a UserControlPortlet (In the portlet picker, Portlets->Application section) to the Wide Column.
Set portlet properties:
4.1. Portlet title: <%$ Resources: PortletTitles, Items%>
4.2. User Control path: /Root/Global/renderers/UserExploreGrid.ascx
Checkin Page modification on the PRC.
Enjoy your pageable explore portlet.
Keep in mind that this grid is specifically designed for users, so they will miss actions in the top menu. These must be handwritten. Then I suggest you copy the UserControl ( /Root/Global/renderers/UserExploreGrid.ascx)
and then put the action list on it . You can read more info about action list here: http://wiki.sensenet.com/ActionList
Br,
maros

How to reference to a Sitefinity Form in a Custom Field

I am working on a custom sitefinity module in which I need to add a custom field where I can select a Sitefinity Form from a list of existing defined forms on the backend. What is the best approach to do this? Precisely how should I approach in defining the field and making its UI?
Unfortunately when I select "Related Data" as field type, Sitefinity Form is not available in the list of built-in data types. The other option (advanced option) I see is a GUID (or array of GUIDs) field type among field types which suggest making a custom code.
CMS version is Sitefinity 8.2 and we are using MVC-based feather components as well as our custom MVC components to develop the website.
Anybody had similar requirement and experience on this?
I would probably create a custom field control. This can be streamlined by using Sitefinity Thunder (because there's a lot of boilerplate C# and JavaScript needed). Once that's in place, you can create a custom field of either type Short Text or GUID, and for the interface, you use your custom field.
In your custom field's code, you can do something like creating a drop down list, where the text for each option is the form name, and the value is either the "name for developers" field or the ID of the form. That way the input is always constrained to IDs pointing to Sitefinity forms. Then when you interact with your custom content items later, you can use this ID/name to look up the referenced form.
As an aside about Related Data: Indeed, that only refers to either built-in content types (blogs, news, etc.) or custom-build dynamic content types. You won't find things like Forms in there.

Core Data and bindings - binding checkbox to result of many-to-many relationship

Core Data model
I have a many-to-many relationship between two of the principal entities; call them Item and Tag. There will be a large number of Documents. Each may have 0 to an arbitrary number of tags.
Each Item entity relevantly has an attribute called name, and a to-many relationship to Tag called tags. Each Tag entity relevantly has an attribute called name, and a to-many relationship to Item called items.
To display them, within the same window, I have: (i) an NSTableView (itemTableView), fed by an NSArrayController (itemArrayController), showing all Items; and (ii) an NSTableView (tagTableView), fed by a different NSArrayController (tagArrayController) showing all Lists.
tagTableView
In the tagTableView, the Table View is bound to tagArrayController, with controllerKey arrangedObjects.
There is only a single table column. The textfield in it is bound to Table Cell View, to model key path objectValue.name. That works so far; it displays all of the lists as expected, and sorts properly when I add a sort descriptor.
Everything has been set up using interface builder in Xcode.
The problem
I have added a checkbox into the tagTableView, in the same table column as the textfield. I am trying to implement two things:
The checkbox should be checked if the user has previously associated the Item with the relevant Tag. If not, the checkbox should be unchecked.
If the user checks an unchecked checkbox, I want to establish a relationship between the two; if the user unchecked a checked checkbox, I want to break that relationship.
The underlying behavior pattern is that the user will not necessarily have control over the tags and may not be able to create them. They are to choose from existing tags, and therefore should be able to see which ones exist, and be able to check/uncheck those that apply.
However, I can't see how to implement this.
Part solutions so far
I can see a possible way to do at least the first task programmatically, roughly along these lines:
Monitor tableViewSelectionDidChange for itemTableView
For a change, update the data source for tagTableView manually, and work out checkbox state by checking them for those Tags which relate to the Item entity that has just been selected, and otherwise unchecking them
However, this looks likely to add complexity, and ideally I would like to do this with bindings if possible.
I have reviewed the Apple Core Data and Bindings references, all the Cocoa books I have, stack overflow and I've also done extensive googling. I have found lots of similar questions (e.g. http://lists.apple.com/archives/cocoa-dev/2011/Mar/msg00164.html) but no answers.
I've also found a way that might work programmatically, but which seems to be like my idea above, at the expense of being able to use bindings (e.g. http://www.raywenderlich.com/14742/core-data-on-ios-5-tutorial-how-to-work-with-relations-and-predicates)
The only relevant question on this site -- Core-Data Check Box Cell with many-to-many data -- is not answered to a level that I can make use of.
It would seem to me that this should be a prime candidate for bindings. I should be able to ask the itemArrayController what Tags (if any) have a relation to its selected item, and then set the checkbox to ticked if it matches the relevant Tag, and unset it if it doesn't. I would expect I should be able to do this within the bindings for the checkbox itself, in interface builder. But I can't work out what model key path or binding to use, or what to set the cocoa bindings for the checkbox to. Am I missing something obvious? Thanks

How to determine if a product is part of a hidden collection in Shopify liquid templates?

is it possible to programmatically (in liquid templates) access the products contained in a hidden collection? Or to find out if a particular product is in a hidden collection? My attempts so far indicate that a collection that is hidden is not accessible via the collections global variable and I don't see another mechanism to do this.
I think you're right. If a collection is hidden, you're SOL. Kinda makes sense. If it's hidden, yet accessible, it's not really hidden. Imagine the outrage generated if a hidden collection was visible on a shop. People would circle the wagons for a burning...

Silverlight Datagrid binding with Object with a List Property

I'm having trouble with some Silverlight functionality. My goal is to get some data from the database and display it in my grid. Sounds simple, however, there are 7 columns that are always going to be there.
The rest of the columns depends on the account. There could be 2 (called Actions) associated with a certain account, compared to another account that could have 5, and the action names can be completely different.
I have successfully been able to return a list of all the possible actions for the given account, and then adding the columns to the grid in the code bihind(VB), and I can bind my data to the grid for all the columns that
are already known. The way I store the item's actions, is a Property of type List. My problem is finding a way to iterate through the actions list of the Item object in order to bind those actions to the grid.
Any suggestions?
You can create extension that will create additional columns and bindings that will bind each value from list to column. Also you should create an additional Dependency Property which you'll bind
to your List.