AEM 6.4: Using wildcards in filter definition - wildcard

I'm facing following issue:
In one of my content project exists the file "filter.xml". It contains following entries:
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<filter root="/content/sites/de/produktpartner/a/rep:policy" mode="merge" />
...
<filter root="/content/sites/de/produktpartner/z/rep:policy" mode="merge" />
</workspaceFilter>
My question is: To limit the entries in filter.xml can I use wildcards? If so, how?
I tried
<filter root="/content/sites/de/produktpartner/*/rep:policy" mode="merge" />
but it seemed not work.

The root must be a path but you can further specify filters that allow regular expressions.
<filter root="/content/sites" mode="merge" />
<include pattern="/content/sites/[a-z]{2}/produktpartner/(.*)/rep:policy"/>
</filter>
However, managing permissions using CRX packages can be very cumbersome. Check out AEM Permission Management
It's a tool that supports a permission management DSL that makes the whole ordeal a lot easier. I work for the company that developed it and we use it on the vast majority of our projects.
The Access Control Tool for Adobe Experience Manager is another option that has worked for me in the past.

Related

Xamrin Forms Android backup Exclude File

I would like to exclude my apps SQLite database file in my Android backup. The backup currently
includes all of my .CSV/.JPG backups in the below paths which are required but the SQLite database
always seems to get included even when I use an <exclude> rule in my backup rules XML file.
Paths:
/data/user/0/com.CompanyName.AppName/files/.csv (required, all CSV files backed up)
/data/user/0/com.CompanyName.AppName/files/.jpg (required, all JPG files backed up)
/data/user/0/com.CompanyName.AppName/files/.local/share/myappdb.db (not required, but backed up anyway!)
AndroidManifest.xml
<application>
...
android:allowBackup="true" android:fullBackupContent="#xml/backuprules"
...
</application>
backuprules.xml (does not work)
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<exclude domain="database" path="myappdb.db"/>
</full-backup-content>
backuprules.xml (does not work)
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<exclude domain="database" path="."/>
</full-backup-content>
Don't know if I need domain="files" path="???" to exclude the database. I don't want to use
<include> for the CSV/JPG files as wildcards are not supported and I require all CSV/JPG
files to be backed up.
Any help appreciated.
Thanks
Paul.

How adapt extension to Visual Studio 2019?

I read that adapting of extension for VS 2019 is quite easy - https://devblogs.microsoft.com/visualstudio/visual-studio-extensions-and-version-ranges-demystified/#.
But I got an error if I do all the actions from the post:
It's not possible to install because there is no following links:
Microsoft.VisualStudio.Component.CoreEditor.
The author of the post shows the exactly same row when he adapts his extensions:
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,)" />
So it seems that this prerequisite was not a problem for him.
My updated extension.vsixmanifest is:
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011">
<Metadata>
<Identity Id="PowerQuerySDK.Microsoft.30831070-f420-4649-a031-6f679996b182" Version="1.0.0.20" Language="en-US" Publisher="Microsoft" />
<DisplayName>Power Query SDK</DisplayName>
<Description xml:space="preserve">A Power Query language service for Visual Studio</Description>
<License>Microsoft Power Query SDK - Pre-Release or Evaluation Use Terms.rtf</License>
<Icon>dataconnector_128.png</Icon>
<PreviewImage>EATIcon.ico</PreviewImage>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0,17.0)" />
<InstallationTarget Version="[14.0,17.0)" Id="Microsoft.VisualStudio.Pro" />
<InstallationTarget Version="[14.0,17.0)" Id="Microsoft.VisualStudio.Enterprise" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" Version="[4.5,)" />
</Dependencies>
<Assets>
<Asset Type="Microsoft.VisualStudio.ProjectTemplate" Path="ProjectTemplates" />
<Asset Type="Microsoft.VisualStudio.ItemTemplate" Path="ProjectTemplates" />
<Asset Type="Microsoft.VisualStudio.VsPackage" Path="Dependencies\Microsoft.Mashup.Tools.VisualStudio.pkgdef" />
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="Dependencies\Microsoft.Mashup.Tools.VisualStudio.dll" />
</Assets>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,)" />
</Prerequisites>
</PackageManifest>
Please could you say what may be the workaround for the problem?
I found the solution for the problem. It is in catalog.json file inside PowerQuerySdk.vsix file. You should change part of the file from:
"Microsoft.VisualStudio.Component.CoreEditor":"[15.0,16.0)"}
to:
"Microsoft.VisualStudio.Component.CoreEditor":"[15.0,17.0)"}
.
I didn't suspect that the mention of CoreEditor may be in this file. But obviously you should change the version of MSBuild to 17, just as you should do in extension.vsixmanifest, as it is described in the post of Mads Kristensen above.
Up to now all works fine for me :-).
I also ran into this issue while porting a Visual Studio Extension forward from 2017 to 2019.
The change was 2-fold:
Firstly updating the 'Installation Target' range in the 'vsixmanifest' file.
Secondly, updating the Prerequisite 'Microsoft.VisualStudio.Component.CoreEditor'
Below is an example of the Manifest file I changed.
Pull Request
Mads Kristensen's original Blog Post on forward porting Visual Studio Extensions from VS 2017 to VS 2019.

Issues with custom URLRewrite rules in 7.9

Currently I'm having some issues with custom URL rewrite rules within ISH 7.9.
For some of our environments it works fine (like local and test), but on ACC and PROD it only seems to work from time to time after multiple deploys/restarts of the system.
We have created a custom cartridge that has a deploy.gradle file to exclude the files urlrewriterules.xml, domainsplittings.xml and syndication-targets.properties from the original cartridges. They get replaced by our custom files in the share/system/config/cluster folder. The static rules applied in the urlrewriterules.xml always work fine. However the rules that are coming from custom Java classes sometimes don't get well loaded by the RewriteRuleFactoryImpl returning back the below error:
[2018-11-07 08:20:37.906 +0100] WARN localhost ES1 appserver0 [ShipSupport-ebusiness-Site] [-] com.intershop.component.urlrewrite.internal.factory.RewriteRuleFactoryImpl [] [Storefront] [wJ5DCcg2CM5DCZPUUqdNu2D2fj8NZHaXjvP9qIZb] [yFAAAFvikjkOsqjA-0-00] "yFAAAFvikjkOsqjA-0-00" An implementation of rewrite rule type 'CustomCategory' does not exist.
The part of code in the urlrewriterules.xml that will call this java class is the following:
<!-- Custom Category Rule /c/<NAME_OF_LOWEST_CATEGORY> -->
<rule type="CustomCategory" priority="1000" name="custom category rule">
<configurations>
<configuration id="pathPrefix">/catalog</configuration>
<configuration id="partsCatalogID">4393</configuration>
</configurations>
</rule>
We also have the classes well created in our own cartridge such as CustomCategoryRewriteRule that extends BaseRewriteRule. URL Rewrite is enabled for those channels and we always Invalidate the cache in the channels that have it enabled.
The extension for the CustomCategory (defined in the same cartridge) is defined as below:
<?xml version="1.0" encoding="UTF-8"?>
<extensionpoint:ExtensionPointModel xmlns:extensionpoint="http://www.intershop.de/extensionpoint/2011" name="CustomCategoryRewriteRule">
<extensionBindings type="java" extensionPoint="com.intershop.component.urlrewrite.capi.RewriteRule-RewriteRule.create" extension="com.package.CustomCategoryRewriteRule" priority="1"/>
</extensionpoint:ExtensionPointModel>
Also the app-extension.component is defined in the same cartridge as below:
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://www.intershop.de/component/2010" scope="global">
<fulfill requirement="selectedCartridge" value="cartridge_name" of="intershop.SLDSystem.Cartridges"/>
<fulfill requirement="selectedCartridge" value="cartridge_name" of="intershop.EnterpriseBackoffice.Cartridges"/>
</components>
We followed this article to confirm on how to do it: https://support.intershop.com/kb/index.php/Display/B28069 We also have it working fine in another project, but using Intershop 7.8.
Do you have any idea on what might be the cause?
Thank you!
We ended up solving it out by apply the SMBResponsive cartridge as well.
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://www.intershop.de/component/2010" scope="global">
<fulfill requirement="selectedCartridge" value="royalihc_sldsystem" of="intershop.SLDSystem.Cartridges"/>
<fulfill requirement="selectedCartridge" value="royalihc_sldsystem" of="intershop.EnterpriseBackoffice.Cartridges"/>
<fulfill requirement="selectedCartridge" value="royalihc_sldsystem" of="intershop.SMBResponsive.Cartridges" />
</components>
Thanks Andreas for all the help.
Besides the implementation, you also need to create an extension file in <cartridge>/staticfiles/cartridge/extensions. This is the actual registration of the rewrite rule for the lookup mechanism. See the following example:
<?xml version="1.0" encoding="UTF-8"?>
<extensionpoint:ExtensionPointModel xmlns:extensionpoint="http://www.intershop.de/extensionpoint/2011" name="CustomRewriteRule.extension">
<extensionBindings type="java" extensionPoint="com.intershop.component.urlrewrite.capi.RewriteRule-RewriteRule.create" extension="com.package.CustomCategoryRewriteRule " priority="1"/>
</extensionpoint:ExtensionPointModel>
Also the cartridge that contains these extensions needs to be registered at the application types via a component file in <cartridge>/staticfiles/cartridge/components. This is needed so that the extension is loaded correctly in the correct application context. See this example:
<?xml version="1.0" encoding="UTF-8" ?>
<components xmlns="http://www.intershop.de/component/2010">
<fulfill requirement="selectedCartridge" value="your_custom_cartridge" of="intershop.SLDSystem.Cartridges" />
<fulfill requirement="selectedCartridge" value="your_custom_cartridge" of="intershop.B2CBackoffice.Cartridges" />
<fulfill requirement="selectedCartridge" value="your_custom_cartridge" of="intershop.B2CResponsive.Cartridges" />
</components>
I'm not quite sure if you need to register it for all of these applications, but these are the ones we used in our last project. If you use different application types or have custom ones, make sure to add those accordingly.

How do I enable Directory Browsing for an virtual web directory using wix?

I want to enable "Directory Browsing" for the for the following virtual web directory using WIX.
<iis:WebVirtualDir Id="LogsVirDir" Alias="Logs" Directory="ESGLOGFILES" />
How do I accomplish this using WIX?
Wouldn't a simpler solution be to use the web.config system.webserver property like :
<directoryBrowse enabled="true"/>
Based on my research Wix currently does not have any capability to enable Directory Browsing using the standard set of actions. The one way I have found to do this is using a combination of Wix Custom Actions and IIS's Appcmd.exe. Note this command will create a web.config file if one does not exist.
<CustomAction Id="EnableDirectoryBrowsing"
Execute="deferred"
ExeCommand='[WindowsFolder]system32\inetsrv\APPCMD.EXE set config "ESG Website/logs" /section:directoryBrowse /enabled:true'
Directory="TARGETDIR"
Return="check"
Impersonate="no"/>
<InstallExecuteSequence>
<Custom Action="EnableDirectoryBrowsing" Before="InstallFinalize">Not Installed</Custom>
</InstallExecuteSequence>
Im using wix v3.8
try adding ConfigurableDirectory in your Feature
ex: <Feature Id='TestName' Title='Test Web' ConfigurableDirectory='INSTALLDIR' Level='1'>
Use the following code
<Control Id="Browse" Type="PushButton" X="304" Y="210" Width="56" Height="17" Text="!(loc.CustomizeDlgBrowse)">
<Publish Event="SelectionBrowse" Value="BrowseDlg">1</Publish>
</Control>
Take the value of this in the variable you want and use it.

Flash Builder (Flex) ANT build and Debug

I'm trying to use ANT with Flash Builder 4 to compile and debug.
The compiling is the easy part but having trouble to get the debugger to work.
I want to use ANT to Debug SWF file inside Flash Builder, so that breakpoints, console traces and everything works as it should.
My script so far. Builds The *.as to *.swf and moves from bin-debug to deploy folder. How can I start a Flash Builder Debugger for the created SWF?
<target name="Compile level 1">
<antcall target="compile flex file">
<param name="file" value="GameOffice"/>
</antcall>
<antcall target="open player">
<param name="file" value="GameOffice.swf"/>
</antcall>
</target>
<target name="compile flex file">
<mxmlc file="${SRC_DIR}/${file}.as" output="${BUILD_DIR}/${file}.swf"
actionscript-file-encoding="UTF-8"
keep-generated-actionscript="true"
incremental="true"
static-link-runtime-shared-libraries="true"
show-actionscript-warnings="true"
failonerror="true"
debug="true"
optimize="false">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
<source-path path-element="${FLEX_HOME}/frameworks" />
<compiler.include-libraries dir="${basedir}/libs" append="true">
<include name="HelloThereLibGames.swc" />
<include name="HelloThereLibStructure.swc" />
<include name="HelloThereLibUtils.swc" />
</compiler.include-libraries>
<metadata description="Hello There Production">
<contributor name="Fredrick Bäcker" />
</metadata>
</mxmlc>
<copy todir="${DEPLOY_DIR}" file="${BUILD_DIR}/${file}.swf"/>
</target>
I did a 1 try one hit on google: http://blogs.4point.com/armaghan.chaudhary/2009/04/remote-debugging-using-flex-builder-ide.html
I do not get why you would want to build with ant inside flashbuilder. Seems like crossing the stream for water?
IMHO automated build scripts belong in CI environments like hudson. I consider it doing myself a favor, letting my development environment handle the fuzz of local builds and debugging.
Anyways, best of luck
Assuming you are working off a local web server, you can simply open the debug socket in Flash Builder by setting your debug launch config to a blank html page (eg. about:blank) and then opening your browser to your localhost (or whatever url you've set up).
In this case you would run the build with ant, hit debug to open the socket, then switch over to your web browser and load localhost.
I realise this answer is probably a little late, but better late than never!
Is pretty simple really when you know how. I did a blog entry on it a while back that should show you how:
http://blog.tiltdigital.com/flex/running-flash-builder-4-in-debug-mode-from-apache-ant/
Basically you just need to add an Ant Builder to Flash Builder 'Builders' properties in your project properties. You can then use that to compile/debug using your build script as you'd normally do using the Flash Builder Compiler/Debugger.

Resources