Drupal 8 - Config-Import how to skip some specifics *.settings.yml - symfony

I have a question about the Config-Import of Drupal 8.
I try to avoid the Config-Import to delete some of my custom_module.settings.yml files on production.
To achieve that goal I try to use the ConfigEvents::DELETE and the $event->stopPropagation(); but it seems not working.
So, How could I stop a config-import of a specific file for example : my_module.settings.yml to be delete by the cim ?
PS:
The --partial flag can't do the job, indeed I juste want to skip some
exception but not every delete.
The --skip-module flag only skip
module installation not deletion.

I realise my mistake by using the Configuration API instead of the State API.
I create an full article about this on my Agency Web Site: Drupal 8 - Differences between Configuration API & State API

Related

Can I run code at Alfresco startup?

I have an Alfresco module that I would like to have do some cleanup when a new version of it is installed.
In the current situation, an older version of the module created a folder node with custom properties at the root of the repository. We've since decided to have multiple such nodes, and none of them at that location. I'd like to put into the next version of the module code that would run at Alfresco startup, check for the existence of the old node, copy its properties into the appropriate new nodes, and delete the old node.
Is such a thing possible? I've looked at the Bootstrap configuration file, but that appears to only allow one to add things to the repository, not modify or delete them.
My suggestion is that you write a patch. That is a class that implements
org.alfresco.repo.admin.patch.AbstractPatch
Then you can do pretty much anything you want on bootstrap (except executing searches against solr since it wont be available).
Add some spring configuration, take a look at the file patch-services-context.xml for inspiration.
Yes you can do that, probably you missed the correct place in the documentation about that:
If you open Import Strategy you'll find a section Per BootstrapView, you should be using something like REPLACE_EXISTING or UPDATE_EXISTING for your ACP packaged content (if you're using ACPs as your bootstrap importing strategy).
Here is a more detailed description of the UUID Bindings values.
Hope that helps.
You can use patches.
When alfresco server starts it applies patches and executes database updates etc.
Definition :
A patch is a piece of Java code that executes once when Alfresco
Content Services starts. Custom patches can be implemented.
Documentation Link

What web platform has files that end in .sdo?

I am looking at a URL that ends in .sdo, as in
http://somesite/somefolder/doc.sdo
I know that if you have an asp.net site the files will end in
http://somesite/somefolder/doc.aspx
I also know that oracle has something called "sdo" -- but I don't totally understand what it does.
http://docs.oracle.com/cd/E15523_01/integration.1111/e10224/sca_sdo_ejb.htm#CCGHEBJF
What kind of platform supports sdo?
Check out this link - http://filext.com/file-extension/SDO
The SDO file type is primarily associated with 'DB/TextWorks' by Inmagic, Inc.. Inmagic TextWorks and WebPublisher PRO together provide a do-it-yourself customizable solution for information management.
.sdo is for DB/TextWorks (Database Deferred Update Directory)

How to find out what is the Query made by drupal solr module

I am unable to understand which folder is the logs for the drupal solr integration module. I am using drupal 7 and the module version is 7.x-1.1
I have the solr attachments module as well.
How do i know what is the request that is made when search results are displayed and how can i customize them ? Pls guide me.
The first place to look for customization of the query that is sent to Solr from Drupal is the api doc (included with the module and available online here). The hook you will want to look at is hook_apachesolr_query_alter(). It allows you to take a query that has been generated by the module and modify it before it is sent to Solr.
There is no log file generated by the Drupal module (other than watchdog messages), but you can enable logging in the Solr admin interface. There are also a few ways to enable logging in Solr (see here and here for examples). Here are some specific instructions from the Solr wiki on logging using the default Jetty container. I guess the logging settings you use depends on what you are looking for.
Hope that helps.
Not sure about the Drupal specifics but for SOLR you should look for a "catalina.txt" log file or something similar.
EDIT: It is "catalina.2013-03-31.log" to be more exact.
You are looking for something like this:
INFO: [catalog] webapp=/solr path=/select params={sort=startdate+asc&q=(((((_lang:en\-gb+AND)))+AND+startdate:[0001-01-01T00:00:00Z+TO+2013-02-18T00:01:17Z])+AND+enddate:[2013-02-18T00:01:17Z+TO+9999-12-31T23:59:59Z])} hits=6 status=0 QTime=0
Feb 18, 2013 12:01:38 AM org.apache.solr.core.SolrCore execute
What you have after the "&q=" will be the SOLR search query.

How to use Migration Commands for Entity Framework through User Defined Code

I need to be able to perform all of the available functions that the Package Manager Console performs for code first DB migrations. Does anyone know how I could accomplish these commands strictly through user defined code? I am trying to automate this whole migration process and my team has hit the dreaded issue of getting the migrations out of sync due to the number of developers on this project. I want to write a project that the developer can interact with that will create and if need be rescaffold their migrations for them automatically.
PM is invoking through PowerShell and PS cmdlets (like for active directory etc.)
http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference
The Package Manager Console is a PowerShell console within Visual
Studio
...there is essentially very little info about this - I've tried that before on couple occasions and it gets down to doing some 'dirty work' if you really need it (not really sure, it might not be that difficult - providing you have some PS experience)
Here are similar questions / answers - working out the PS comdlets is pretty involving - in this case it has some additional steps involved. And PS tends to get very version dependent - so you need to check this for the specific EF/CF you're using.
Run entityframework cmdlets from my code
Possible to add migration using EF DbMigrator
And you may want to look at the source code for EF that does Add-Migration
(correction: this is the link to official repository - thanks to #Brice for that)  
http://entityframework.codeplex.com/SourceControl/changeset/view/f986cb32d0a3#src/EntityFramework.PowerShell/Migrations/AddMigrationCommand.cs
http://entityframework.codeplex.com/SourceControl/BrowseLatest
(PM errors also suggest the origins of the code doing the Add-Migrations to be the 'System.Data.Entity.Migrations.Design.ToolingFacade')
If you need 'just' an Update - you could try using the DbMigrator.Update (this guy gave it a try http://joshmouch.wordpress.com/2012/04/22/entity-framework-code-first-migrations-executing-migrations-using-code-not-powershell-commands/) - but I'm not sure how relevant is that to you, I doubt it.
The scaffolding is the real problem (Add-Migration) which to my knowledge isn't accessible from C# directly via EF/CF framework.
Note: - based on the code in (http://entityframework.codeplex.com/SourceControl/changeset/view/f986cb32d0a3#src/EntityFramework.PowerShell/Migrations/AddMigrationCommand.cs) - and as the EF guru mentioned himself - that part of the code is calling into the System.Data.Entity.Migrations.Design library - which does most of the stuff. If it's possible to reference that one and actually repeat what AddMigrationCommand is doing - then there might not be a need for PowerShell at all. But I'm suspecting it's not that straight-forward, with possible 'internal' calls invisible to outside callers etc.
At least as of this post, you can directly access the System.Data.Entity.Migrations.Design.MigrationScaffolder class and directly call the Scaffold() methods on it, which will return you an object that contains the contents of the "regular" .cs file, the "Designer.cs" file and the .resx file.
What you do with those files is up to you!
Personally, I'm attempting to turn this into a tool that will be able to create EF6 migrations on a new ASPNET5/DNX project, which is not supported by the powershell commands.

Custom session id generator for Tomcat 7/JBoss7

Folks,
My webapp needs URL-safe session ids. Those generated by JBoss 7 (embedded Tomcat 7 inside JBoss) have characters like "+" which cause us some heartache. One of the avenues I am exploring is the generate URL-safe session ids. Does someone know the correct hook point in a J2EE web application where I can plug in my custom session id generator?
Ideally this hook point comes from the servlet API itself. If not, am happy with a Tomcat/JBoss specific solution too.
Thanks.
-Raj
I know this was asked more than 10 years ago but, I just had a chance of working on Custom Session Id Generator and found this unanswered question during my RND.
Here is a Tomcat specific solution. (Tomcat 10.0)
You can plug-in your Custom Session Id Generator in Tomcat by following the steps given below:
Implement org.apache.catalina.SessionIdGenerator interface.
Create jar file for this implementation and place it in {CATALINA_HOME}\lib folder (This step is important as you will get ClassNotFoundException in case you don't perform this step)
Add configuration for your session id generator in WEB-INF/context.xml file of your application. e.g.
<Context>
<Manager>
<SessionIdGenerator className="com.yourpackage.MySessionIdGenerator"/>
</Manager>
</Context>

Resources