With what order does OpenCart executes vQmod xml files? - opencart

If there are 2 vQmods /vqmod/xml/mymod1.xml & /vqmod/xml/mymod2.xml to change a file (for example) catalog/model/tool/image.php, which vQmod will be executed first in an OpenCart installation?

vQmod loads and executes the xml files in alphabetical order. So for your example /vqmod/xml/mymod1.xml will be loaded and executed first, followed by /vqmod/xml/mymod2.xml

Related

Saxon C how to run multiple xslts on a cached xml

I want to run several Xslts with one cached xml . However I can only find ways to run several xml files with
a cachedxslt , but thats not what I want . As well as an XsltExecutable for Xslt , can there be an XsltExecutbale for Xmls, so that i can cache an xml , and run several xslts on it.
You can create a DocumentBuilder and use parseXmlFromFile (https://www.saxonica.com/saxon-c/doc11/html/classDocumentBuilder.html#a4fd6acc79cbed4ae3aa9bd062ffa080f) to parse your XML input file once into an XdmNode, then you can feed that XdmNode as the input to any transformTo... method you call on your XsltExecutable or run any applyTemplates.. method after setting that XdmNode as the initial match selection with the method setInitialMatchSelection.

Process Multiple input xml files and generate multiple xml files in XSLT

I have to pass multiple input xml files and generate multiple xml files as output.
If 'm having 3 files as 'File1.xml', 'File2.xml' and 'File3.xml',
I need to copy the full content of those xml's and also add a node to each xml and then display the output files as 'File1_op.xml', 'File2_op.xml' and 'File3_op.xml'. The output files will have a extra node added like
<Product>45896</Product>
I can't pass the file names as static, because it may change. So I need to pass the directory itself and process all the xml files in that particular directory.
Is this possible in xslt? Any help please.
Using Saxon XSLT 2.0 you're on the bright side - I don't have this on hand so I can't give detailled help. My suggestions are
for input file names Running a single stylesheet on multiple input documents and placing all their outputs in a single file
for output Why does Saxon evaluate the result-document URI to be the same?

How do I change TOC location in wkhtmltopdf output?

I need the TOC to be on the 3rd page. Apparently, if there is a way to control this, it has to be through the XSL stylesheet. All my search attempts didn't give me a clue though. Is it possible at all?
I can't use cover option since I need the header to show on both first and second pages.
OK I've found a way to do it using wkhtmltopdf 0.11. I've extracted the first two pages into a separate HTML document and then run it like this
wkhtmltopdf [options] page cover.html toc --xsl-style-sheet ... input_file.html out.pdf
Unfortunately it took a lot more effort than I expected, since I'm using it in a Rails application through wicked_pdf, and it doesn't play nice with the new options format, so I had to fork it and make the necessary changes as well.
The command line generated by wicked_pdf looks like this (long paths omitted):
"c:/program files (x86)/wkhtmltopdf/wkhtmltopdf.exe"
--header-html "file:///path/to/header" --footer-html "file:///path/to/footer"
--margin-top 20 --margin-bottom 15 --margin-left 5 --margin-right 40 page "file:///path/to/cover/page" --disable-javascript toc --xsl-style-sheet "path/to/style/sheet" - -

How do I make NSMetadataQuery see my saved documents' folders as packages?

I'm writing an app which saves and loads documents both locally and on iCloud. Locally is working fine, but I'm having a problem with iCloud.
The documents are saved as a package - the UIDocument reads and writes an NSFileWrapper which contains an image file, a thumbnail file, and an info plist. When I save the document to iCloud and then look at the files under 'Manage Storage', I see the individual files instead of the packages; and more importantly when I search for files using NSMetadataQuery it returns an NSMetadataItem for each of the individual files instead of the packages. As a result, my app doesn't realise there are any packages to load and iCloud is pretty useless.
I thought that if I set up the document type and exported the UTI correctly that the packages would be treated properly. Was that right? If so, what's the checklist for setting up a document type as a package? I have:
Added a document type
set LSTypeIsPackage to YES (I've tried string YES and bool YES)
set CFBundleTypeExtensions to an array containing one string: the file suffix
set LSHandlerRank to Owner
Exported a UTI with the same identifier
set it to conform to com.apple.package
added a UITypeTagSpecification dictionary, containing an array for the key public.filename-extension, which contains one string: the file suffix
I've also tried adding a matching Imported UTI to match the exported one, but no luck there.
What did I miss?
UPDATE: I notice that the OP in this question is seeing the behaviour I want (even though he doesn't want it) so it must be possible.
Based on this I tried removing the LSItemContentTypes from my plist, and it worked.

Cannot find CFML template for custom tag

I am not a ColdFusion coder. Doing a favor for a friend who ported his CF site from a Windows server to Unix on GoDaddy.
Site is displaying error:
Cannot find CFML template for custom tag jstk. ColdFusion
attempted looking in the tree of installed custom tags but did not
find a custom tag with this name.
The site as I found it has at document root /CustomTags with the jstk.cfm file and a set of files in cf_jstk
My Googling located this:
You must store custom tag pages in any one of the following:
The same directory as the calling page;
The cfusion\CustomTags directory;
A subdirectory of the cfusion\CustomTags directory;
A directory that you specify in the ColdFusion Administrator
So I have:
Tried creating placing /CustomTags in /cfusion/CustomTags
Tried copying /cfusion/CustomTags to above document root
Tried copying jstk.cfm and subfolders into same directory as calling file(index.cfm)
Update: Per GoDaddy support I have also tried adding the following to no effect: <cfmodule template="CustomTags/jstk.cfm">
Can any one give me some tips on this or should I just tell my guy to look for a CF coder?
Thanks!
I don't know how GoDaddy is setup, so as a quick test, please do the following:
Create file test.cfm in the webroot with contents:
<cf_testtag/>
<cfoutput>test</cfoutput><cfabort/>
Create file testtag.cfm in the webroot with contents:
<cfdump var=#ThisTag# />
Then in a browser visit the test.cfm page.
You should get two debug dumps, followed by the 'test'; this will confirm that custom tags in general are working.
If that works move the testtag.cfm to the CustomTags directory, and see if you get the same behaviour or an error.
If this produces an error, for CF8 and above, you can add <cfset This.CustomTagPaths = "/CustomTags" /> inside the Application.cfc file (assuming there is a App cfc and not an Application.cfm) to ensure that directory is checked for tags.
It is possible to convert Application.cfm to Application.cfc - how easy this is depends on how complex the code is in there - might be something you could figure out, or might need an experienced CF dev, it depends.
Depending on the outcome of this, we can attempt to debug why the jstk tag isn't working (unless one of the above solves it).
In an effort to check the simple things before worrying about complex things:
Remember that filenames on *nix systems are case sensitive, but on windows are not.
For example, a windows server will pick up "application.cfm" but a linux server won't. It requires "Application.cfm".
Check to make sure all filenames/paths are the correct case.
Normally, CFML check every custom tags in current directory first, if not found, second is in CFMX8/customtags/.