My SQL files aren't being executed when I install or update a new component. Initially I found it weird that my workmate needed to execute his SQL files directly into PHPMyAdmin, but isn't Joomla! supposed to automatically run the files?
Here's how I set up my XML:
ReforcoDigital.xml
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="2.5.0" client="site" method="upgrade">
<name>Reforco Digital</name>
<author>Rodrigo Pereira</author>
<creationDate>14/05/2013</creationDate>
<copyright>Copyright</copyright>
<license>Licença</license>
<authorEmail>rodrigo-c-pereira#hotmail.com</authorEmail>
<authorUrl>http://www.site.com</authorUrl>
<version>0.1</version>
<description>Sistema de Reforço Digital</description>
<install>
<sql>
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
</sql>
</install>
<update>
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
<files folder="site">
<folder>language</folder>
<folder>models</folder>
<folder>views</folder>
<filename>reforcodigital.php</filename>
<filename>controller.php</filename>
<filename>index.html</filename>
</files>
<administration>
<menu>Reforco Digital</menu>
<files folder="admin">
<folder>sql</folder>
<folder>views</folder>
<filename>controller.php</filename>
<filename>reforcodigital.php</filename>
<filename>index.html</filename>
</files>
</administration>
</extension>
Folder admin/sql has the install.mysql.utf8.sql file, and admin/sql/updates/mysql has the file 0.1.sql; both have the very same SQL code. What am I possibly missing here?
The fact that I was updating my component with a 0.1.sql over and over was the problem. Changed the filename to 0.2.sql and it did the job.
My understanding is that Joomla! will look for the update files in alphabetical order, and judge if that version has been used or not; correct me if that's wrong. Since there was a higher version than 0.1, it did the job.
I commented earlier that I was having the same problem as you, but I'm not. Mine is a completely different problem that I'll describe after I explain what's happening with your file.
So, your sql folder resides within your admin component folder (this is normal), but your install/uninstall sql XML entries don't describe this. So, I believe that if you make this change, you'll find it working as expected:
<install>
<sql folder="admin">
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
</sql>
</install>
My problem is that the update section will only execute a schema update when a schema exists in the #__schema table - and install.sql isn't executed on update. So if you're upgrading your extension and adding a table to it, you can't really rely on the XML installer to create your new table unless your extension already had tables before the update.
I'm going with an install.php file to search for and create the table if necessary.
Related
I just wanted to generate a documentation of a schema with xs3p.
The problem is, as far as I understand it, that the schema is split into several files and that xs3p did not process the include-tags of the master file: The result is a documentation containing only the root element.
What did I do exactly?
I unzipped the xs3p-download into a certain directory
I copied all schema files into the directory
I called saxonb-xslt master.xsd xs3p.xsl >doku.html (under Ubuntu Trusty, if that matters)
Can you give me any help? I assume, there are two lines to solve the problem:
Making xs3p process the include-tags
Integrating all xsd-files into a single one — how would this work?
Thank you in advance!
You have to set the following xsl:param in xs3p.xsl :
<!-- If 'true', searches 'included' schemas for schema components
when generating links and XML Instance Representation tables. -->
<xsl:param name="searchIncludedSchemas">true</xsl:param>
<!-- If 'true', searches 'imported' schemas for schema components
when generating links and XML Instance Representation tables. -->
<xsl:param name="searchImportedSchemas">true</xsl:param>
<!-- File containing the mapping from file locations of external
(e.g. included, imported, refined) schemas to file locations
of their XHTML documentation. -->
<xsl:param name="linksFile">xs3p_links.xml</xsl:param>
Your included/imported schemas must have been previously transformed into a my_transformed_included_schema.html file, and you need to define a xs3p_links.xml file in order to assign some imported/included schema to theirs location such as :
<?xml version="1.0"?>
<links xmlns="http://titanium.dstc.edu.au/xml/xs3p">
<schema file-location="my-included-schema.xsd" docfile-location="./my_transformed_included_schema.html"/>
</links>
Hope that'll help !
Can I somehow use the same Eclipse plug-in project for both a generated EMF model and the corresponding generated EMF Edit code?
Normally these two components reside in two different projects, the EMF Edit one with the suffix .edit to its name. I find this superfluous, since there is so little code in the Edit project, and it is so closely related to the model code.
I have tried setting both the modelDirectory and the editDirectory Gen Model attributes to (different) directories in the same project, but that seems to lead to endless confusion and build problems. I think maybe the two generation steps overwrite each others project setting files.
After some more experimentation it seems like it works fine to have EMF and EMF Edit generated code in the same project.
The things I had to do to make it work are the following:
Setting the genmodel property modelDirectory and editDirectory to the same directory. Otherwise I got a build error saying "The type ... is already defined in ...".
Setting the genmodel property bundleManifest="false". Otherwise the plug-in ID is overwritten by the generation process.
Apart from this I also set updateClasspath="false" to avoid that the generation process messes around with that.
The automatic updates to the manifest and plugin.xml files seem to be the following:
Set plug-in ID
Add exported packages
Add EMF extensions to plugin.xml
2 and 3 needs to be performed manually if they are desired. That would involve adding entries to plugin.xml similar to these:
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- #generated model -->
<package
uri="somePackage"
class="somePackage.SomePackage"
genModel="model/model.xcore"/>
</extension>
<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
<!-- #generated model -->
<factory
uri="somePackage"
class="somePackage.someClass"
supportedTypes=
"org.eclipse.emf.edit.provider.IEditingDomainItemProvider
org.eclipse.emf.edit.provider.IStructuredItemContentProvider
org.eclipse.emf.edit.provider.ITreeItemContentProvider
org.eclipse.emf.edit.provider.IItemLabelProvider
org.eclipse.emf.edit.provider.IItemPropertySource"/>
</extension>
am already test my modifications on ver 2.0.2.0, 2.0.3.1, and find that modifications on muti file like:
<file path="system/{engine,library}/{action,loader,config,language}*.php">
not works now, am back to modifications docs, and its not update yet:
https://github.com/opencart/opencart/wiki/Modification-System
i is there change on multi file modifications? or its bug?
Same for me in 2.2.0.0.
This will not work in 2.2.0.0 (although it would in 2.1.0.x):
<file path="catalog/file-1.php,catalog/file-2.php,catalog/file-3.php">
But this will work in 2.2.0.0:
<file path="catalog/file-{1,2,3}.php">
yes i find it, in file system/modification.xml
it was
<file path="system/{engine,library}/{action,loader,config,language}*.php">
now you can do it like this
<file path="system/engine/action.php,system/engine/loader.php,system/library/config.php,system/library/language.php">
after i debug the code i found this
error in modifications
it seems there big hole there..
so you can use this to downgrade modifications to ver 2.0.1.1
modification.ocmod.zip
this mod will remove all current mods, so you need upload them again
you may need to use this ocmod, if you have error in FTP
localcopy.ocmod.xml
I'm working part of a project that needs to display a .xml file with .xsl files.
Here's part of the code:
FILE_PATH = "myxsl.xsl"
...
Label content = new Label("content",xmlContent);
content.setEscapeModelStrings(false);
content.add(new XsltTransformerBehavior(FILE_PATH));
add(content);
...
Currently the page works if I use only one .xsl file. However, because the .xsl files I need to deal with can be really long, they are separated into several components.
for example, I will have
mymain.xsl, head.xsl, tables.xsl
the mymain.xsl has inclusion of the other like this
<xsl:include href="head.xsl"/>
<xsl:include href="tables.xsl"/>
I tried to set FILE_PATH to mymain.xsl, but it didn't work. The program can find mymain.xsl but cannot compile the stylesheet because it cannot find head.xsl and tables.xsl
I've been searching for a long time but still have no clue how to do this. Really appreciate any help. Thanks in advance.
I looked at the documentation of XsltTransformerBehavior, and it looks like it doesn't expose the functionality to set a custom URI resolver (which is basically what you want to do).
However, in the case that no-one else has a better solution, I can propose a workaround: Write an XSLT that merges your XSLT files into one file. See here for an XSLT that does this. If you're using Maven as build system, you can do this automatically in the generate-resources phase using the transform goal of the Maven XML Plugin. You can then associate the XsltTransformerBehavior with the single-file XSLT which will be available at run-time.
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/.