Is possible to make the options of properties dynamic in business template editor of WSO2? - dynamic

Context:
in Wso2, to make Siddhi apps dynamic, one uses business rules.
This business rules are created from templates like this:
Rule templates have some properties for each attribute. In this properties there are options to make a list of possible values for attributes.
What I wonder is how to make these options dynamic, like calling from an external API or from the DB.

We are not supporting this feature for now in Stream Processor. You can request this feature by opening an issue in WSO2 GitHub repository.

Related

Apache NiFi: Bootstrap UserGroups and Policies with a file based provider

Is it possible to bootstrap UserGroups and Policies with a file based provider?
Currently we use org.apache.nifi.authorization.FileUserGroupProvider to bootstrap an Initial User Identity and org.apache.nifi.authorization.FileAccessPolicyProvider to bootstrap the Initial Admin Identity when setting up a NiFi instance.
I inspected the code of the FileUserGroupProvider as well as the Authorizers.xml Setup in the Administration Guide and I couldn't find anything about bootstrapping UserGroups. I guess the same goes with bootstrapping AccessPolicies using the FileAccessPolicyProvider. I know that it is possible using LDAP, but we don't use that right now.
I already found a similar question her on StackOverflow but the solution is not satisfactory, as we don't want to use the nifi-api for that task, if not absolutely necessary. So what I would do is writing a new file based UserGroupProvider and AccessPolicyProvider to fulfill that task.
Is that the only possibility?
Would I use the CompositeUserGroupProvider or the CompositeConfigurableUserGroupProvider for that, so instead of re-implementing the functionality of the FileUserGroupProvider and adding my custom implementation could I use this to combine the functionality?
Meaning something like this:
<userGroupProvider>
<identifier>composite-user-group-provider</identifier>
<class>org.apache.nifi.authorization.CompositeUserGroupProvider</class>
<property name="User Group Provider 1">org.apache.nifi.authorization.FileUserGroupProvider</property>
<property name="User Group Provider 2">MyFileUserGroupProvider</property>
</userGroupProvider>
How would the configuration look like in the authorizers.xml file?
If my assumption about how to use a CompositeProvider is correct, is there something similar for bootstrapping Policies?
If I understand correctly, you want to automate setting users, groups, and policies to fixed, predefined values.
I would recommend using the FileUserGroupProvider and the FileAccessPolicyProvider, as those both give you the ability to configure users, groups, and policies directly in NiFi itself. You should not have to create custom implementations of a UserGroupProvider or AccessPolicyProvider unless you need to customize the functionality beyond what the included filed-based providers can supply.
You said you did not want to use the nifi-api, by which I assume you mean the HTTP REST API. (I am not trying to be pedantic, there is actually a library called nifi-api that is a collection of Java interfaces for nifi developers to use in writing extensions.) The REST APi is a good option I would normally recommend, as there are guarantees on backwards compatibility on for NiFI 1.x going forward, but it is not the only way to achieve what you want to do.
You can create users.xml and authorizations.xml files manually (or scripted), outside of NiFi, and you just have to configure the FileUserGroupProvider and AccessUserGroupProvider to use those files (or copy them to the default location for those files in the conf directory). On startup, NiFi reads the contents of these files into memory to create users, groups, and access policies. The Initial User and Initial Admin properties are only used to automate populating these files when they are absent or empty, so if you provide your own copies of these files, they will be used.
The structure of these XML files is fairly simple to create. You can use a NiFi instance to create users, groups, and policies through the UI, and see what is written to these files. You can then create them however you like: the NiFi UI, by hand, or scripted from another source file. Once you have the files created, you can do the "bootstrapping" part by placing them in the NiFi conf dir and (re)starting it. NiFi does not regenerate or modify these files unless users, groups, and policies are modified in the UI.
The only downside with these approach is that these files are not guaranteed to have a stable schema going forward. So new fields could be added or changed over time. That said, they have been stable for the last several versions of NiFi.

Where to put database Model for extensions?

I want to write a small extension that is able to take some informations from the database, based on some user filter preference, and show them on the main page.
I have read: PHPBB extensions development and took a look at: ACME DEMO extension but i didn't find an answer to where the database handling should be placed. Normally this should go into a Model that will handle the data to a Controller, in this case I was not able to figure out where the Model should be placed in to the structure and how it should work.
How should an extension database model should be handled? Where should it sit in to the extension structure?
I'm guessing you would need an event listener.
PHP event listeners work with core events to inject code into phpBB.
Core events are like hooks, and they can be found throughout phpBB’s
codebase at key points. They give your extension access to phpBB’s
variables and allow you to use and modify them or to inject additional
PHP code during phpBB’s execution. -per the Skeleton Extension
Page

Running Parameters Against an OpenShift Template Through the API

I'm developing a custom interface which will integrate with OpenShift Origins. At the moment, I have templates which I wish to instantiate. I know I can do this by running the template against the /processtemplate end-point. However, the only way I can find for setting the template parameters is to iterate through the parameter list and overwrite the fields manually.
Is it possible to send a parameter list, and have OpenShift run it against the template, or is this the only solution?
We do not have something like that today - it might be exposed in the future via a /templates/foo/process endpoint supporting form post, but we were hesitant in case we wanted to expose more complicated parameter values in the future.

Password Module for Expression Engine?

Just wondering if someone could help me approach a clients request.
Is there any modules for expression engine for password protected pages?
I need to set up a form for the user to fill out and choose a password and username, this would then give them access to a separate section/page on the site?
How could I approach this with EE?
There are several ways to password-protect pages in an ExpressionEngine site:
Template Preferences Manager
Conditional Global Variables
Third-Party Add-Ons
By far the easiest solution is to use the built-in Template Preferences Manager in the ExpressionEngine Control Panel.
1). Using the Template Access Restrictions feature, you can restrict an entire page/template to one or more defined groups (Banned, Guests, Members, Pending and Custom Groups).
When a restricted page is accessed, you can configure what should happen:
Show a Specific Template (e.g. a Login or Error Page)
Enable HTTP Authentication
2). If you need to conditionally show part of a page to a specific member or group, you can use Conditional Global Variables.
Conditional Variables are pair type variables, which allow you to conditionally show or hide information on your pages based on criteria being met. For example, a basic conditional variable will look like this:
{if username == "joe"}
Hi Joe!
{/if}
More advanced conditionals can use logical operators (ex: OR, AND) to compare multiple variables to multiple values. Consider this example:
{if username == "joe" OR username == "bob"}
Hey, Guys!
{/if}
There are many Global Conditionals you can use. See the Global Variables section of the ExpressionEngine User Guide for more information.
3). Finally, if you need more advanced or granular control for password-protecting content in ExpressionEngine, a Third-Party Add-On may give you what you need.
One such popular add-on is the Solspace User Module. It gives you a robust set of front-end member management tools and adds flexibility to the way your member management behaves.
Using other third-party add-ons, you can password protect files, certain channel entries for certain members or member groups and more! All of this is possible due to the ExpressionEngine Developer API.
You can leverage any number of the third-party Developer Add-Ons at Devot-ee -- the official community partner devoted to ExpressionEngine Add-Ons.
Any content in EE can be wrapped in a conditional statement using the logged_in_group_id global variable, so a module isn't really needed.
So you can have your users fill out a member registration form (I'd recommend the Solspace User module for this), setup to register them into your chosen member group.
Then, wrap your members-only content like this (use the appropriate ID for your member group):
{if logged_in_group_id == 6}
Members-only content here.
{/if}
Alternately, you could use something like this: http://devot-ee.com/add-ons/entry-access/

Semantic store and entity hub

I am working on a content platform that should provide semantic features such as querying with SPARQL and providing rdf documents for the contained content.
I would be very thankful for some
clarification on the following
questions:
Did I get that right, that an entity
hub can connect several semantic
stores to a single point of access?
And if not, what is the difference
between a semantic store and an
entity hub?
What frameworks would you use to
store content documents as well as
their semantic annotation?
It is important for the solution to be able to later on retrieve the document (html page / docs such as pdf, doc,...) and their annotated version.
Thanks in advance,
Chris
The only Entityhub term that I know is belong to Apache Stanbol project. And here is a paragraph from the original documentation explaining what Entityhub does:
The Entityhub provides two main services. The Entityhub provides the
connection to external linked open data sites as well as using indexes
of them locally. Its services allow to manage a network of sites to
consume entity information and to manage entities locally.
Entityhub documentation:
http://incubator.apache.org/stanbol/docs/trunk/entityhub.html
Enhancer component of Apache Stanbol provides extracting external entities related with the submitted content using the linked open data sites managed by Entityhub. These enhancements of contents are formed as RDF data. Then, it is also possible to store those content items in Apache Stanbol and run SPARQL queries on top of RDF enhancements. Contenthub component of Apache Stanbol also provides faceted search functionality over the submitted content items.
Documentation of Apache Stanbol:
http://incubator.apache.org/stanbol/docs/trunk/
Access to running demos:
http://dev.iks-project.eu/
You can also ask your further questions to stanbol-dev AT incubator.apache.org.
Alternative suggestion...
Drupal 7 has in-built RDFa support for annotation and is more of a general purpose CMS than Semantic MediaWiki
In more detail...
I'm not really sure what you mean by entity hub, where are you getting that definition from or what do you mean by it?
Yes one can easily write a system that connects to multiple semantic stores, given the context of your question I assume you are referring to RDF Triple Stores?
Any decent CMS should be assigning documents some form of unique/persistent ID to documents so even if the system you go with does not support semantic annotation natively you could build your own extension for this. The extension would simply store annotations against the documents ID in whatever storage layer you chose (I'd assume a Triple Store would be appropriate) and then you can build appropriate query and presentation layers for querying and viewing this data as required.
http://semantic-mediawiki.org/wiki/Semantic_MediaWiki
Apache Stanbol
Do you want to implement a traditional CMS extended with some Semantic capabilities, or do you want to build a Semantic CMS? It could look the same, but actually both a two completely opposite approaches.
It is important for the solution to be able to later on retrieve the document (html page / docs such as pdf, doc,...) and their annotated version.
You can integrate Apache Stanbol with a JCR/CMIS compliant CMS like Alfresco. To get custom annotations, I suggest creating your own custom enhancement engine (maven archetype) based on your domain and adding it to the enhancement engine chain.
https://stanbol.apache.org/docs/trunk/components/enhancer/
One this is done, you can use the REST API endpoints provided by Stanbol to retrieve the results in RDF/Turtle format.