How do I disable the enabled feature when I enable a new feature in togglz? - togglz

Say I have features A, B, C, and A is enabled by default. B and C disabled.
When I enable B I want to disable A: only one feature should be enabled at a time.

You'll need to implement a custom version of the StateRepository interface. Information on this can be found on the togglz documentation
Next override the setFeatureState(...) function for the required functionality.
Disable active features (query via FeatureManager or Feature enum - you may need to implement custom versions of these classes for the desired functionality)
Enable the feature being set.

Related

Custom logic for BasketAddProductBehaviour app server configuration

Is there a way to add/implement custom logic for BasketAddProductBehaviour configuration value different from DisallowRepeats, MergeQuantities and AllowRepeats (https://support.intershop.com/kb/index.php/Display/2809G2#Concept-BasketHandlingandCheckout-Introduction)?
For example add logic that only one product from one catalog can be added to basket?
Tnx
Starting with IS 7.6 add to basket functionality is implemented as chain of so called handler classes. Each handler class fulfills a particular purpose and is wired to the chain by the Java Extension Point mechanism of Intershop ICM. The com.intershop.component.basket.orm.internal.handlers.BehaviorHandler controls the add-to-basket behavior. This handler can be replaced by another implementation.

CodeFluent Entities Add Runtime Design Attribute to False

Now that the site blog.codefluententities.com is down, there is no place to get answers to frequent questions.
Even the FAQ's and blog at their main website is poor and lacks of any search tool.
At the "knowledge center" you can try to search some basic questions but you'll need to custom search at google using the website: key.
I've finally found a clue about my last failure using this old promising tool at:
https://www.softfluent.com/product/codefluent-entities/knowledge-center/json-serialization-D2715E9D140C-A6080529C80C
but the key link is pointing to a lost domain and that's the end of the road.
My question is solved at:
CodeFluent Entities adds a TypeConverterAttribute that allows to convert an entity to string using the EntityDisplayName property. Json.NET detects this attribute and wrongly uses it to serialize the entity to JSON. There are 2 solutions:
Remove this attribute if you don't use it by setting Add Runtime Design Attribute to False
Use the Json.NET aspect to generate specific Json.NET attribute on generated classes and properties
but there's no information about how to do it.
As SoftFluent states, questions can be post to SO adding the codefluent tag, but user's community is poor at knowledge of the product and developer team #meziantou is overloaded
I really hope this project does not fail as it was one of my last bets to a hidden-source company and pray at every out-of-date free-license internet connection dependent renewal for their server not being closed.
CodeFluent Entities adds a TypeConverterAttribute that allows to convert an entity to string using the EntityDisplayName property. Json.NET detects this attribute and wrongly uses it to serialize the entity to JSON. There are 2 solutions:
Remove this attribute if you don't use it by setting Add Runtime Design Attribute to False
The following configuration will prevent CodeFluent Entities from generating [System.ComponentModel.TypeConverterAttribute(typeof(CodeFluent.Runtime.Design.NameTypeConverter))] on generated classes:
<cf:producer name="Business Object Model (BOM)" typeName="CodeFluent.Producers.CodeDom.CodeDomProducer, CodeFluent.Producers.CodeDom">
<cf:configuration addRuntimeDesignAttributes="false" ... />
</cf:producer>
You can also use the modeler to set this attribute.
Use the Json.NET aspect to generate specific Json.NET attribute on generated classes and properties
If you need to preserve the TypeConverter, you can instruct CodeFluent Entities to add custom JSON.Net attributes on generated classes and properties using the following aspect. The code and usage sample is available on GitHub: https://github.com/SoftFluent/CodeFluent-Entities/tree/master/Extensions/SoftFluent.Json.NET/
To make you more confident : yes this SO tag is still monitored at SoftFluent. There is also the support[at]softfluent.com mailbox that allows to contact the support team directly. The product is still supported and fixes are published when bugs are reported to us. We are preparing a new version targeting .Net Standard 2.0 but will still support the existing version as is. I can not provide yet any timeline though for this new version.

CRM 2015 - Show an alert based on records existing in another identity

I'm working on a project where I've been asked to show an alert in the "Account" form that notifies our users that an active record exists in a custom entity.
From the reading I have done so far I can see that
Xrm.Page.ui.setFormNotification('Message here', 'WARNING') appears to have the exact functionality that I need, but, how do I go about implementing the logic that shows this message. Presumably I need to do a count of associated records in this entity and if it's > 0 then show the alert, but, do I need to do this via a plug-in or is it Jquery? Or, am I vastly overcomplicating the issue when there is OOB functionality that will do this?
Any advice appreciated!
Adam
If your custom entity is a sub grid on the account form you can do this using JavaScript.
var count = Xrm.Page.getControl("custom_grid").getGrid().getTotalRecordCount();
if(count > 0) {
Xrm.Page.ui.setFormNotification('Message here', 'WARNING')
}
If its not a sub grid you will need to perform an API call to count the number of related records, you are best using the Web API, Use Microsoft Dynamics CRM web services.
The standard functionality you have at your disposal is roughly:
Workflows
Plugins
Business Rules
JavaScript
Of these options, only JavaScript currently supports setting form notifications. As a side-note, Business Rules do support showing error messages on specific fields (corresponding to setNotification from JavaScript).
You are thus correct that you would write JavaScript that determines whether the related records exist, and subsequently calls setFormNotification.

How does one implement a dexterity.membrane user and group?

On Plone 4.3.7, as per Products.Membrane & dexterity.membrane instructions, I've added a CustomMember & CustomGroup content type and assigned them the proper behaviors. After adding instances of them, going to membrane_tool, adding those types (seems this was required) to the selection of membrane content and reindexing, instances of custom member types show up in membrane_tool catalog.
However, groups do not show up (in membrane_tool catalog). Neither do the groups show up in the regular site management Users/Groups UI, but I guess that's to be expected (given they are not catalogued).
Neither can I log in using the credentials entered when adding CustomMember instances.
What additional steps are there to make custom Dexterity-based Users & Groups work? Is the group assignment done by containment (ie. a CustomUser must be added inside a CustomGroup) or via some other mechanism? And how are roles assigned?
P.S. I've also tried out the example member content type provided by dexterity.membrane, but trying to add that results in an error.
The default implementation expects the membrane user to have a "enabled" workdflow state.

How to create a Rule on Drupal that creates activity streams of followed users?

I'm using Flags, Commons follow, Message and Rules modules to create the ability for users to follow each other.
I use commons auto generated commons_follow_user flag to create a follow button. I generate that button through views on each node. If user A presses the button on the node submitted by user B, user A starts following user B. By default commons follow user module shows user B name on user A account page. What I also need is for user A to see activity stream of the user B, more specifically to see when user B adds new node. I understand that I have to use rules and messages modules. I have created a rule that triggers Message entity creation on new node creation but how do I make this stream only visible to users following the user that creates those nodes? Is there a way with rule conditions? Or should I look in the other direction to achieve this?
It looks like you're trying to create some sort of social network.
A module I'm pretty fond of us the Statuses module
If you're just looking for something that will post activity, there's also the heartbeat module
I hope that helps.

Resources