How to provide drop-down list of a specific resource types to choose from with ARM template - azure-resource-manager

I'm trying to create an ARM template which queries the list of resources (i.e. Cosmos DB instances) in the selected resource group so the user can pick from the list. I then want to use the selected resource to get a property and use it elsewhere in the template.
I don't want the user to have to know the resource name and type it in, rather I'd prefer to produce a list to choose from.
I've tried using a parameter type of string or array along with the [list(resourceId('<id>', resourceGroup().name, '<date>')] but it doesn't produce a drop-down list.
Is this even possible?

Related

Use the unique values from a field in one content type as a filter in another content type

I need some help with a Drupal views filter. I'm not a developer but I have been using Drupal for several years.
I have a content type named 'City/Town' that contains several fields including state and county. I'm using this content type as an entity reference field in another content type named 'Project'.
I would like to use a unique value list of States as a filter in a view of Projects.
I've installed the Views Entity Reference Filter (https://www.drupal.org/project/verf) module but I'm only able to access the entity reference title, not any of the fields that are part of the content type.
The project I'm working on is still in design phase so I can change my approach if there is a viable solution.
You need to get the relationship to the reference in views. Then you have access to the fields of the reference for viewing, sorting & filtering.

What is the syntax to add a column to the Custom Form list that shows where in WF it is used?

Super simple.
When viewing the list of Custom Forms in Setup, I want to add a column that shows where those Custom Forms are in use (or null if used nowhere).
This is similar in principle to viewing the list of fields, which has a list of forms on which those fields are used.
What is the syntax I can use to add the appropriate column(s) to the view?
As far as I know, there is no linkage in the backend that connects categories (custom forms) to their host objects. This is probably because the list could be massive and the query would take quite a while to execute as it would have to traverse every object in Workfront or each form would store every parent object ID.
Unfortunately, you can't even search for objects by associated category IDs, so if you wanted to build this yourself you would need to query each object and search its categories to see if your custom form appeared.

Sugar CRM - creating new module using module builder

I wanted to create a new module in my copy of Sugar CRM. I selected a package, and went to create a new module (using module builder). The last field in the form asks to select a module type . If we select module type, say, user, then around 10-15 fields comes up in the module. These cannot be edited. But I wanted to create a module which would consists of only those elements I wanted to. So is there any way to create a new module without having those fields?
For example, I wanted to create a module called 'donation' which would contain the list of all donations made by the users (1 'User' can make MANY 'donation'). Since user field will
always contain all the user detail (example, first name, last name, email etc), so we do not repeat them for each donations made by the user. So donation module should contain only field like
["user-id", "donation-amount", "payment-method", "cc-number"].
Any Sugar usercan help me in this issue?
Thanks.
Just simply hide the unwanted fields on the various views. Some of these fields are basically required by the framework in one way or another (name, date_modified, etc). But it doesn't mean that you need to utilize them. The other additional fields could be removed from the vardefs.php if desired, but it isn't worth the hassle usually.

How to find index for a field (if any)

I have some indexes in portal_catalog, for various types.
Given a portal_type and a fieldname, how can I find out the name of the index (if any) for that field?
Some relevant pointers to documentation about zcatalog might help me too!
Thanks..
There is no easy one-on-one way to determine this. In Plone 4, there are basically three different ways that an index in the catalog can obtain the information from your content type.
Index configuration
First and foremost, indexes can optionally be configured with the name(s) of the attributes or methods to index on a given object. Indexes generally have a getIndexSourceNames method that'll tell you what items they'll index.
Usually this is the same as the index id, but this is not a given. Generally, if your field accessor is listed in the result of getIndexSourceNames then that index will be indexing that field for a given type:
from Products.CMFCore.utils import getToolByName
catalog = getToolByName(context, 'portal_catalog')
for index in catalog.index_objects():
if field.accessor in index.getIndexSourceNames():
print 'Index %s indexes %s' % (index.getId(), field.getName()'
In the above examples, I assumed you already have a hold of your field object in the variable field, with an actual instance of your type in the variable context.
Custom indexing adapters
When an object is indexed, the catalog also constructs a wrapper around the object and will look up indexing adapters for your object. These adapters are registered both for the indexed name (so the name listed in getIndexSourceNames) and an interface or class. If your content class implements that interface or has an indexing adapter directly registered for it's class or a base class, the indexing adapter can be brought into play.
Indexing adapters are arbitrary snippets of code, and thus could call any field on your content object to produce their results. There is no programmatic way for you to determine if a given field on your content type will be used, or if any fields will be used at all.
The CMFPlone.CatalogTool module lists several examples of indexing adapters, these are all registered for Interface, meaning all objects:
allowedRolesAndUsers collects security information about your object.
getObjPositionInParent determines the position of the current object in it's container. Thus, this indexer does not need any information from the object itself to determine it's value.
sortable_title takes your content Title value and generates a value suitable for sorting catalog search results with. It normalizes the value, lowercases it, and prefixes numbers with leading zeros to make sorting on numbered titles easier.
Direct method access
Fields are basically generated methods on your content object. But your content class can also implement methods on it's class. The same remarks as for custom indexing adapters apply here; these are arbitrary Python code so they could be using your content type fields, aggregating and mangling the information before passing it to the index.
The Archetypes BaseObject class (used in all Archetypes content types) defines the SearchableText method for example. This method takes all available fields with the searchable property set to True, tries to get each field value as plain text, and aggregates the results for the SearchableText index.
Conclusion
You can only make educated guesses about index contents as they relate to your fields. By introspecting index configuration, you won't see if there might be a custom indexer adapter masking your field (register a getField index adapter and it'll be used instead of directly calling getField). Custom indexers and class methods can still access your fields and pass on the information to a catalog index.
You just add an index for the method or attribute name that you want to use for the index value--there's nothing too tricky about it and it can potentially all be done TTW
If you need a bit more logic to grab the index, check out this stackoverflow question: Problem with plone.indexer and Dexterity

flex query dialog or end user search wizard?

I am hoping there is a component or strategy someone can recommend for presenting the user in a flex (flash builder 4) application a search wizard or query dialog where they are presented a list of fields and can choose one and specify search criteria. This will be used to call a web service and return data to a flex data grid.
For example, if I have a client data grid/database they might see first name, last name, city, state, zip, etc. They could click first name, type a value in a box. Ideally then be able to click additional fields and specify values. Click search and see their results in a datagrid or similar.
I am used to having these helpers in other development/database environments, so I thought I should ask.
I am thinking if I need to create this from scratch, I will either use a combobox? type drop down where they can select multiple items and type a value next to each, OR possibly I will have to create some kind of custom dialog with multiple fields in it. Looking for ideas/thoughts/examples?

Resources