Creating and populating subfolders Joomla manifest XML - joomla

I've become fairly confused when I'm trying to create a subfolder and populate it with things in my plugin manifest XML.
If I want to create a subfolder and at the same time add files to it, how would that be done? Read comments in the code draft (all names are of course more distinct than used here).
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="2.5.0" group="group" method="upgrade">
<name>Handelsbanken Finans Delbetalning</name>
<!-- The following elements are optional and free of formatting conttraints -->
<creationDate>July 2013</creationDate>
<author>Emil Carlsson</author>
<authorUrl>http://valid.url</authorUrl>
<copyright>Copyright (C) 2013</copyright>
<version status="BETA">0.0.1</version>
<!-- The description is optional and defaults to the name -->
<description>Plugin description.</description>
<update> <!-- Runs on update; New in 1.6 -->
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
<!-- Site Main File Copy Section -->
<!-- Note the folder attribute: This attribute describes the folder
to copy FROM in the package to install therefore files copied
in this section are copied from /site/ in the package -->
<files folder="site">
<filename>plgName.xml</filename>
<filename>plgName.php</filename>
<folder>helpers</folder>
</files>
</extension>
This gives me nothing really. I can't find the folder I shouldhave been created from what I gathered from the documentation. It also doesn't specifies how I populate these folder :(. I am assuming that it is possible to more or less just package all files I want and then it will create the subfolders where I want/need them. But that it is a question of how to write the manifest file. If anyone have a good tutorial about this I would be very thankful :). I've googled until my fingers are almost at the Point of bleeding :(. I guess I could put all the files in the same folder, but I want to have some sort of structure to visualize for other developers what's part of the core of the plugin and what's not part of the plugin core.

Problem is solved. In my not installation script I linked in the files for what I thought only was used by the configuration XML (a field to configurate the plugin). In this file I had the node "files" as well, in this node I'd not linked in the helpers directory. When this was done all the subdirectories was added as well. So in short - Don't forget to link in the folder in all places where you have a files-node.

Related

How generate documentation on maven?

I am new with Maven, and now I am trying to generate the project documentation. Until now, I find that I only need to run the command
mvn site
or
mvn clean site
and thats all this command will generate the folder site inside target folder, and does it but also should generate some files main is index.html and here its the problem, command doesn't generetate those files, only the folders
I will hope the file index.html looks like
and those folders have files, like images and files *.css,
So I don't know if I need to do some steps before?
Also If you can recommend me a tutorial or documentation about it, thanks
I found the correct way to do it, because the tutorial that I was following it isn't full descriptive, it is why I'm confused. But I found the guide of maven to do it. Check it here Creating a site. So I need to create the folder site inside src path, and this folder should contain file site.xml which relates the different components of the site, those could be developed in different document types, in the page there are some links to know how to do it. So this is mine site.xml
<?xml version="1.0" encoding="UTF-8"?>
<project>
<body>
<menu name="Overview">
<item name="Introduction" href="index.html"/>
<item name="Goals" href="plugin-info.html"/>
</menu>
</body>
</project>
And I use the xDoc type, so I create xdoc folder inside site, this contains all the files related in site.xml (index.xml and plgin-info.xml in example)
so after that run the command mvn site and got this in targe\site

WebAPI Core, set a custom nuget/packge folder

I am trying to figure out how to override the package folder from the user folder to a custom folder location like inside my project folder
I have a webapi Core project with an appSetting.json
I read a few posts and may suggests using nuget.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<clear />
<add key="globalPackagesFolder" value="d:\\packages" />
</config>
</configuration>
I added in my WebAPI project which show along side with appsetting.json.
When I build the project, I see no package folder.
I also read about packages.config but I can't find that file anywhere.
Any help is appreciated.
Thanks
The nuget.config file should be placed in a directory one level above the project and then it will work.
For an example, the ConsoleApp152 folder is the folder which contains all your project files. And nuget.config file should be placed at the one level above the project files.
When you finish it, please close VS and then restart your project to enable this setting. And it will act on all projects in the directory level where the current nuget.config file is located and also all projects in the subordinate directories.

Cannot copy folder with nuget package in .net core

I Create a NuGet package and install into another project. but don't copy a file into the location project. only my file reference to NuGet package and I change the code, The package also changes! I want to copy the package to the target project.
<?xml version="1.0"?>
<package>
<metadata minClientVersion="3.3.0">
<id>MyPackage</id>
<version>1.0.0</version>
<authors>Meysam</authors>
<owners>Meysam</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Package description</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>Copyright 2018</copyright>
<tags>Tag1 Tag2</tags>
<contentFiles>
<files include="cs/*.*/**" buildAction="Compile" />
</contentFiles>
</metadata>
<files>
<file src="ConsoleApp1\CustomClass\CustomClass.cs" target="contentFiles\cs\any\CustomClass" />
</files>
</package>
Copying files into the project that uses a nuget package is only supported when using packages.config, which isn't supported by SDK-style projects, which are required for .NET Core projects. As your screenshots show, contentFiles in PackageReferences projects are included at build time. The little arrow icon in the bottom right corner of the C# and folder icons you pointed to in your screenshot are visual indicators that the file and folder are different to the other files and folders in your project. In fact, that little icon overlay is similar to what Windows adds for shortcuts, so if you understand a shortcut is a file that "points to" another file, it should make sense that these are shortcuts to files outside your project, but are included as part of your project.
Anyway, it's working as designed.
You'll need to find another way to do whatever you want, but you didn't describe why you're trying to include a file in the project that references your package, so I can't give direct advice. My best advice, if you are experienced with ASP.NET and ASP.NET Core is think about how ASP.NET used to read a lot of settings directly from web.config, but ASP.NET Core instead uses a builder pattern, so that users are not forced to store settings in web.config and can store settings anywhere they want. If what you're doing is similar, your package users will have a better experience if you provide them with a configuration builder that they can override, rather than having a file in their project that they must edit and gets overwritten every time they upgrade to a new version of your package.
Cannot copy folder with nuget package in .net core
Yes, just like zivkan said:
Copying files into the project that uses a nuget package is only
supported when using packages.config
But, we could use a workaround to resolve this issue. We could add a copy task in the xx.targets file, and set this file in the \build folder in the .nuspec file.
The content of mypackage.targets file:
<Target Name="CopyFile" AfterTargets="AfterBuild">
<ItemGroup>
<CopyFiles Include="$(NuGetPackageRoot)\mypackage\4.0.0\cs\*.*\**" />
</ItemGroup>
<Copy
SourceFiles="#(CopyFiles)"
DestinationFolder="$(ProjectDir)"
/>
</Target>
And the .nuspec file:
<file src="xxx\xxx\mypackage.targets" target="build" />
Hope this helps.

newly created template's templateDetails.xml is not working in joomla 1.5

I've created a joomla templates. As instructed I have placed my files and folders inside and linked to css file in index.php but when I cut up all the text in templateDetails.xml it is still showing as previous in the browsers and also at positions even after doing a clean refresh. Why is it taking its position and css, I'm surprised.
Edit
as per comments I have been placing my templateDetails.xml contents
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/1.5/template-install.dtd">
<install version="1.5" type="template">
<name>bini7a</name>
<creationDate>Mon, Jun-10, 2013</creationDate>
<author>Bhojendra Rauniyar</author>
<authorEmail></authorEmail>
<authorUrl></authorUrl>
<copyright>Bhojendra Rauniyar</copyright>
<license>GNU/GPL</license>
<version>1.0</version>
<description>bini7a: Bhojendra Template</description>
<files>
<filename>index.php</filename>
<filename>templateDetails.xml</filename>
<folder>images</folder>
<folder>css</folder>
</files>
<positions>
<position>headera1</position>
<position>headera2</position>
<position>mid</position>
<position>headerb1</position>
<position>headerc1</position>
<position>headerd</position>
<position>left</position>
<position>right</position>
</positions>
</install>
But even if I delete all these all the positions work correctly as defined position and also the css
The positions specified within Joomla's templateDetails.xml are only really needed when configuring module positions within the administrator's Module Manager. Once the position has been set it would appear the templateDetails.xml file does not need to be referenced again to display the module in that requested position.
To remove these positions permanently, either uninstall the template and reinstall with the new XML file or (the better) remove the positions from the template's index.php file.
You're looking for JDoc statements like the below:
<jdoc:include type="modules" name="headera1" />
See http://docs.joomla.org/Jdoc_statements for more information on the JDoc statements.
I hope this helps solve your dilemma.

How to create NuGet package that includes XML intellisense data

This link How do I create an XML Intellisense file for my DLL? explains how to build your dlls so that an XML file is included containing all your documentation headers so that they are available in those IntelliSense popups.
In my company we frequently distribute our own dlls using an internal NuGet package source. When I create NuGet packages for the package source, how do I ensure that someone else gets the dll from the package source, IntelliSense displays the documentation headers for them?
If you distribute your XML files with your NuGet package in the same folder as your Dlls then Visual Studio will then find these XML files and show IntelliSense for your assemblies.
To distribute the IntelliSense XML files you will need to add them to your .nuspec file, for example:
<files>
<file src="bin\IronPython.dll" target="lib\Net40" />
<file src="bin\IronPython.xml" target="lib\Net40" />
</files>
tl;dr documentation files need to be .xml not .XML
I was able to get the XML files included by first enabling the production using the Build tab, checking XML Documentation File in the Output section. Note: for some reason I had to manually change the extension from .XML to lowercase .xml. YMMV. This is the same as the question you referenced, How do I create an XML Intellisense file for my DLL?.
Once done, I created the Nuspec file in the project directory. Here's a sample, you can also generate it with nuget spec MyAssembly.dll - but make sure to edit it and set the values appropriately.
<?xml version="1.0"?>
<package >
<metadata>
<id>$id$</id>
<version>1.0.0</version>
<title>Title for your package</title>
<authors>Package Author</authors>
<owners>Package Owner</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A description of your library</description>
<releaseNotes>Release notes for this version.</releaseNotes>
<copyright>Copyright 2013</copyright>
<tags>tag1 tag2</tags>
</metadata>
</package>
Once that was done, I used Nuget to package. Note I had to specify the platform because I'm using a 64-bit OS, but I don't have any targets in the project for x64, only AnyCPU
nuget pack MyAssembly.csproj -Prop Configuration=Release;Platform=AnyCPU -build
The assembly and it's associated documentation were automatically included in the package. In addition any packages that you've used in your project are added to the dependency list.
See http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package for more information.

Resources