As far as I know it should be enough to add customUI/customUI.xml file and modify _rels/.rels file.
Couple yeas ago I succesfully made file like that, but with newly created xlsm Excel file it fails.
i've tried:
add to .rels file:
<Relationship Type="http://schemas.microsoft.com/office/2007/relationships/ui/extensibility" Target="/customUI/customUI14.xml" Id="R131e66a518624244" />
with customUI14.xml:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<officeMenu>
<button id="MyCustomButton1" label="My Macro" imageMso="HappyFace" onAction="Macro1" />
</officeMenu>
</ribbon>
</customUI>
and I tried add to .rels file:
<Relationship Type="http://schemas.microsoft.com/office/2006/relationships/ui/extensibility" Target="/customUI/customUI.xml" Id="R131e66a518624244" />
with customUI.xml:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<officeMenu>
<button id="MyCustomButton1" label="My Macro" imageMso="HappyFace" onAction="Macro1" />
</officeMenu>
</ribbon>
</customUI>
in both scenarios Excel says that the file is corrupted. Any ideas?
Edit:
Probably I packed folder instead files inside folder...
Yeash... so the problem was that I manually was packing whole folder instead its content only
The Imagemagick security policy seems to be not allowing me perform this conversion from pdf to png. Converting other extensions seem to be working, just not from pdf. I haven't changed any of the imagemagick settings since I installed it... I am using Arch Linux, if the OS matters.
user#machine $ convert -density 300 -depth 8 -quality 90 input.pdf output.png
convert: attempt to perform an operation not allowed by the security policy `PDF' # error/constitute.c/IsCoderAuthorized/408.
convert: no images defined `output.png' # error/convert.c/ConvertImageCommand/3288.
Well, I added
<policy domain="coder" rights="read | write" pattern="PDF" />
just before </policymap> in /etc/ImageMagick-7/policy.xml and that makes it work again, but not sure about the security implications of that.
This issue is a workaround for a security vulnerability. The vulnerability has been addressed in Ghostscript 9.24, so if you have that or a newer version, you don't need the workaround anymore.
On Ubuntu 19.04 through 22.04 and probably any later versions with ImageMagick 6, here's how you fix the issue by removing that workaround:
Make sure you have Ghostscript ≥9.24:
gs --version
If yes, just remove this whole following section from /etc/ImageMagick-6/policy.xml:
<!-- disable ghostscript format types -->
<policy domain="coder" rights="none" pattern="PS" />
<policy domain="coder" rights="none" pattern="PS2" />
<policy domain="coder" rights="none" pattern="PS3" />
<policy domain="coder" rights="none" pattern="EPS" />
<policy domain="coder" rights="none" pattern="PDF" />
<policy domain="coder" rights="none" pattern="XPS" />
Removing just the line with pattern="PDF" inside would be enough to re-enable PDF conversion. I can't see a good reason to keep the workaround for other PostScript-based file types, though.
Attribution: #jakob-r's comment on an alternative answer. And the helpful comments here below 🙂
As pointed out in some comments, you need to edit the policies of ImageMagick in /etc/ImageMagick-7/policy.xml. More particularly, in ArchLinux at the time of writing (05/01/2019) the following line is uncommented:
<policy domain="coder" rights="none" pattern="{PS,PS2,PS3,EPS,PDF,XPS}" />
Just wrap it between <!-- and --> to comment it, and pdf conversion should work again.
For me on Arch Linux, I had to comment this:
<policy domain="delegate" rights="none" pattern="gs" />
For me on my archlinux system the line was already uncommented. I had to replace "none" by "read | write " to make it work.
The ImageMagick change was kept after Ghostscript was fixed because applications (especially web applications) often feed arbitrary user-supplied files to ImageMagick, don't always enforce format restrictions properly, and, since Postscript (which PDF uses) is a turing-complete programming language running in a sandbox, there's always the possibility of another hole in the sandbox.
It's much better to leave things configured so ImageMagick refuses to process files that require running a program and, instead, just invoke Ghostscript directly when you intentionally want to permit Postscript rendering.
That would be accomplished by a Ghostscript command like this:
gs -dSAFER -r600 -sDEVICE=pngalpha -o foo.png myfile.pdf
Yes, this is a variation on the GhostScript command ImageMagic calls. (see ImageMagick's delegates.xml. -o is shorthand for -dBATCH -dNOPAUSE -sOutputFile=)
What's important is that ImageMagick stays locked down, you don't needlessly invoke an intermediate program, and you get more control over the rendering parameters. (eg. -r600 is the DPI to render at and changing -sDEVICE=pngalpha allows you to render directly to your desired format)
Works in Ubuntu 20.04
Add this line inside <policymap>
<policy domain="module" rights="read|write" pattern="{PS,PDF,XPS}" />
Comment these lines:
<!--
<policy domain="coder" rights="none" pattern="PS" />
<policy domain="coder" rights="none" pattern="PS2" />
<policy domain="coder" rights="none" pattern="PS3" />
<policy domain="coder" rights="none" pattern="EPS" />
<policy domain="coder" rights="none" pattern="PDF" />
<policy domain="coder" rights="none" pattern="XPS" />
-->
As a highly active comment by #Richard Kiefer, a simple fix is like this
$ sudo sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml
Adding to Stefan Seidel's answer.
Well, at least in Ubuntu 20.04.2 LTS or maybe in other versions you can't really edit the policy.xml file directly in a GUI way. Here is a terminal way to edit it.
Open the policy.xml file in terminal by entering this command -
sudo nano /etc/ImageMagick-6/policy.xml
Now, directly edit the file in terminal, find
<policy domain="coder" rights="none" pattern="PDF" />
and replace none with read|write as shown in the picture. Then press Ctrl+X to exit.
I was experiencing this issue with nextcloud which would fail to create thumbnails for pdf files.
However, none of the suggested steps would solve the issue for me.
Eventually I found the reason: The accepted answer did work but I had to also restart php-fpm after editing the policy.xml file:
sudo systemctl restart php7.2-fpm.service
On Ubuntu 19.10, I have done this in /etc/ImageMagick-6/policy.xml
uncomment this
<policy domain="module" rights="read | write" pattern="{PS,PDF,XPS}" />
and comment this
<!-- <policy domain="coder" rights="none" pattern="PDF" /> -->
After that, this command work without error
convert -thumbnail x300 -background white -alpha remove sample.pdf sample.png
In my case i'm useing ubuntu 20.10 and the Imagick-7.
in my /etc/ImageMagick-6/policy.xml I've removed below lines,
restarted my machine and I'm done.
<policy domain="coder" rights="none" pattern="PS" />
<policy domain="coder" rights="none" pattern="PS2" />
<policy domain="coder" rights="none" pattern="PS3" />
<policy domain="coder" rights="none" pattern="EPS" />
<policy domain="coder" rights="none" pattern="PDF" />
<policy domain="coder" rights="none" pattern="XPS" />
Manjaro April 2021
Just remove uncommented line inside <policymap> in /etc/ImageMagick-7/policy.xml
Thank you #tanius and others for the detailed answers !
I'd just add to it the following points.
The path of the policy file policy.xml may change with the version of the ImageMagick like /etc/ImageMagick-6/policy.xml or /etc/ImageMagick-7/policy.xml etc. So update it accordingly.
As the policy to prevent or allow the conversion for some filetypes is a security measure, you may like to reset the changes to the policy.xml after the task is done so that there is no possibilty of the corresponding attack, if the system is accessible to attackers !
Happy speedy file conversions meanwhile !
For my system Ubuntu 20.04 wasnt working, but for my windows 10 was working just fine.
my main job was to add subtitles to a video and generate an output mp4.
After messing around with the policy.xml file i found a "potentially" bad workaround. which is delete all contents of the policy.xml, which has worked for me and i was able to add my subtitles to the video.
Please be aware this might be a temporary fix untill you dont find a better solution.
I have another problem:
1 I have configured and initialised the B2C Accelerator
2. I am running the B2C Accelerator, and I can run:
The MCC;
The PCM;
The hMC;
The WCMS;
The CS Cockpit;
The Admin Cockpit;
The Report Cockpit;
The Admin Console.
3. I cannot run however, the web store front-ends for:
Apparel Site DE : http://apparel-de.local:9001/yacceleratorstorefront/
Apparel Site UK :
http://apparel-uk.local:9001/yacceleratorstorefront/
Electronics Site :
http://electronics.local:9001/yacceleratorstorefront/
For each Google Chrome returns:
“This webpage is not available
ERR_CONNECTION_TIMED_OUT”
4. Chcking my hosts file:
##
# BEGIN section for OpenVPN Client SSL sites
127.94.0.1 client.openvpn.net
127.94.0.2 openvpn-client.vpn.contiigo.net
# END section for OpenVPN Client SSL sites
# This is the DNS for apparel-de.local
127.0.0.2 apparel-de.local
127.0.0.3 apparel-uk.local
127.0.0.4 electronics.local
5. Checking my /hybris/config/localextensions.xml file…*
<hybrisconfig xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='../bin/platform/resources/schemas/extensions.xsd'>
<extensions>
<path dir='${HYBRIS_BIN_DIR}' autoload='false' />
<extension name='mcc' />
<extension name='backoffice' />
<extension name='commercesearchbackoffice' />
<extension name='commerceservicesbackoffice' />
<extension name='solrfacetsearchbackoffice' />
<extension name='solrserver' />
<extension name='yacceleratorcockpits' />
<extension name='yacceleratorinitialdata' />
<extension name='yacceleratorfulfilmentprocess' />
<extension name='yacceleratorstorefront' />
<extension name='yaddon' />
<extension name='ycommercewebservices' />
<extension name='electronicsstore' />
<extension name='apparelstore' />
<extension name='liveeditaddon' />
<extension name='acceleratorwebservicesaddon' />
</extensions>
</hybrisconfig>
6.Clearly there is a mis-configuration: what do I need to do configure the web store front-ends correctly?
I think in your host file all your local "sub domains" should point to the local network device 127.0.0.1 ..
I have it e.g. something like this:
127.0.0.1 b2ctelco.local financialservices.local apparel-uk.local apparel-de.local electronics.local
Another approach (the so called site parameter approach, see e.g. https://wiki.hybris.com/display/pmtelco/Using+Modulegen+to+Create+a+B2C+Telco+Setup#UsingModulegentoCreateaB2CTelcoSetup-AccessingtheStorefront ) would be to have the explicit ?site=electronics parameter at the first request to a storefront present.
This is only needed for the first request of a session (to set the BaseSite into the hybris session).
E.g.:
http://localhost:9001/yacceleratorstorefront?site=electronics
That should work for you now already without any hosts file modifications.
Hope that helps!
127.0.0.1 is always used for localhost
change all .2 .3 .4 to .1 in DNS naming system as above mentioned post.
didn't understand why u write .2 .3 .4 for DNS system
I use TYPO3 CMS 6.2.14, vhs 2.3.3, Flux 7.2.1 and FluidContent 4.3.1 - my TYPO3 Editor need the opportunity to upload SVG-Images via vhs-ViewHelper. I've made a new FluidTYPO3 Content Element (FCE), but there's no SVG Image visible in frontend. Mmhh?
Flux-FlexForm
<flux:field.file name="imgIcon" allowed="jpg,gif,png,jpeg,svg" uploadFolder="uploads/tx_myext" minItems="0" maxItems="1" size="1" />
...
<v:media.image src="uploads/tx_myext/{imgIcon}" alt="Icon" />
Output
<div class="small-2 columns">
<img alt="Icon" src="" width="" height="">
</div>
Also I use the htaccess entry, but there is no success. Where's my fault? Do I need heightand widthfor this ViewHelper? Aren't vectors availible in vhs?
<IfModule mod_mime.c>
...
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
...
</Ifmodule>
EDIT: I also tried the Fluid ViewHelper, but the SVG Image has height/width = 0:
<f:image src="uploads/tx_myext/{imgIcon}" width="50" height="50" class="xy" alt="Icon" />
EDIT 2: The ImagePath is correct. At Developer Tools I "see" the Image ..
EDIT 3: Oh, I see at my Filemanager (FAL) 0x0 pixels ..
Thanks merec.
Use SVG Images / TYPO3 6.2 with FluidTYPO3
Answer: Use
<img src="{f:uri.image(src: 'uploads/tx_myext/{imgIcon}')}">
instead of
<v:media.image src="uploads/tx_myext/{imgIcon}" alt="Icon" />
// OR
<f:image src="uploads/tx_myext/{imgIcon}" width="50" height="50" class="xy" alt="Icon" />
I'd like to search for a string within my source files with Ant. (I'd like my build to fail in case certain string is found within my source files).
So, I should be able to recursively search for a certain string within a file set.
I already found that I can use loadfile task to check whether a string pattern is found within one file. But that seems to be working & sensible only with a single file.
On the other hand, replace task would provide recursively search-and-replace. I guess I could do that before build and replace my string with something that would break the build but I wonder if there is some cleaner solution?
br, Touko
You might consider using fileset selectors to do this. Selectors allow you to choose files based on content, size, editability and so on. You can combine selectors with name-based includes and excludes, or patternsets.
Below is an example. The second fileset is derived from the first, with a selector that simply matches on file content. For more sophisticated matching there is the containsregexp selector. The result is a fileset containing only files matching the string. A fail task with a resourcecount condition is then used to fail the build, unless that fileset is empty.
<property name="src.dir" value="src" />
<property name="search.string" value="BAD" />
<fileset id="existing" dir="${src.dir}">
<patternset id="files">
<!-- includes/excludes for your source here -->
</patternset>
</fileset>
<fileset id="matches" dir="${src.dir}">
<patternset refid="files" />
<contains text="${search.string}" />
</fileset>
<fail message="Found '${search.string}' in one or more files in '${src.dir}'">
<condition>
<resourcecount when="greater" count="0" refid="matches" />
</condition>
</fail>
(Old answer): If adjusting or reusing filesets might be problematic, here's an illustration of a relatively simple alternative.
The idea is to make a copy of the files,
then replace the string you wish to search for
with some flag value in the copied files.
This will update the last modified time on any matching file.
The uptodate task can then be used to look for affected files.
Finally, unless no files matched, you can fail the build.
<property name="src.dir" value="src" />
<property name="work.dir" value="work" />
<property name="search.string" value="BAD" />
<delete dir="${work.dir}" />
<mkdir dir="${work.dir}" />
<fileset dir="${src.dir}" id="src.files">
<include name="*.txt" />
</fileset>
<copy todir="${work.dir}" preservelastmodified="true">
<fileset refid="src.files" />
</copy>
<fileset dir="${work.dir}" id="work.files">
<include name="*.txt" />
</fileset>
<replaceregexp match="${search.string}"
replace="FOUND_${search.string}">
<fileset refid="work.files" />
</replaceregexp>
<uptodate property="files.clean">
<srcfiles refid="work.files" />
<regexpmapper from="(.*)" to="${basedir}/${src.dir}/\1" />
</uptodate>
<fail message="Found '${search.string}' in one or more files in dir '${src.dir}'"
unless="files.clean" />
This was very helpful as a start, but I have a list of strings which should be checked in a fileset.
My current code sofar is:
<property name="search4" value="XYZ"/>
<fileset id="existing" dir="../src">
<patternset id="files">
<include name="content/**/*.txt"/>
</patternset>
</fileset>
<resourcecount property="count">
<fileset id="matches" dir="../src">
<patternset refid="files" />
<contains text="${search4}" />
</fileset>
</resourcecount>
<echo message="Found '${search4}' in files : '${count}'"/>
That works well, but how to expand that so the ${search4} is read from a list. Actually the list can be read from a file containing each search item is on a separate line.
Slightly more concise variation on the first part of #martinclayton's answer:
<property name="log.dir" value="logs" />
<property name="fail.string" value=" FAILED " />
<fileset id="build.failures" dir="${log.dir}" includes="*.log">
<contains text="${fail.string}"/>
</fileset>
<fail status="1" message="One or more failures detected">
<condition>
<resourcecount when="greater" count="0" refid="build.failures" />
</condition>
</fail>