How to obtain the config folder/file across platforms under Free Pascal/Lazarus? - cross-platform

Is there a set of functions that give you the file and/or the folder where to place an application's config?
I would like it to return the folder only and/or the file only on the appropriate place for each system.

The functions you are looking for are the following:
GetAppConfigDir - wiki page
GetAppConfigFile - wiki page
Those functions will use the ApplicationName content to determine the name of the application. You can change that behaviour with the OnGetApplicationName callback.
You can have a look at what they return for each system on the Multiplatform Programming Guide wiki page.

Related

TYPO3 CMS 9.5.5 most simple extension

I have to create a simple TYPO3 extension for version 9.5.5.
i installed TYPO3 CMS 9.5.5 from https://bitnami.com/stack/typo3
in docu for latest (9-dev)
https://docs.typo3.org/typo3cms/CoreApiReference/ExtensionArchitecture/FilesAndLocations/Index.html
they say "usually located in typo3conf/ext for local extensions, or typo3/sysext for system extensions."
i dont have a "typo3conf/ext", no "typo3conf" and "typo3/ext" . and yes there is a "typo3/sysext".
I have not found a guide online that takes this fact into account.
Then i read "... there is a tool which makes it easier to start. It is called Extension builder" ( https://docs.typo3.org/typo3cms/CoreApiReference/ExtensionArchitecture/CreateNewExtension/Index.html )
Ttherefore I have installed this "Extension Builder"
via Zip from https://extensions.typo3.org/extension/extension_builder/
Download ZIP file
Log into your TYPO3 backend
Go to Extension Manager module
Press the upload button on the top bar
Select the ZIP file and upload it.
and with me it looks very different as in the documentation:
then i read "Docs » Creating a first extension » Create Folder Structure And Configuration Files" (https://docs.typo3.org/typo3cms/ExtbaseFluidBook/4-FirstExtension/2-create-folder-structure-and-configuration-files.html)
There they talk about "unique identifier of our extension". whats this?
"as store_inventory". whats this?
anyway.
and "These are in the folder typo3conf/ext/"
but this folder does not exist in my installation.
I then looked into an installation of another computer days later and there was this folder also not.
anyway.
i created then "typo3conf/ext/store_inventory" (as described there).
then I wondered about the following formulation:
"The name of this folder must be written like the extension key"
So this folder probably had to be different named?
then i found this folder structure at the same page:
https://docs.typo3.org/typo3cms/ExtbaseFluidBook/_images/figure-4-1.png
and I wondered a lot about the amount of folders and files.
I just wanted to make a simple extension that just lists files.
I thought that's a few lines of source code.
is not that any easier?
I do not need all these things like eg. ext_icon.gif. i hope i do not need to create all that files and folder manually.
Here are some answers:
The extension key is the name of your folder inside of "typo3conf/ext". I recommend not using an underscore because it might be confusing for you later on as a beginner with TYPO3. Choose a simple and short name. To make sure the name is not available already, please check "extensions.typo3.org" to see if the key (extension name) is already taken. If you want to be 100% sure, you have to register an account there and register the extension key officially. This is all free of course.
The file ext_icon.gif is indeed not necessary, but looks nice when your extension is shown in the list of extensions in the Extension Manager of TYPO3.
You say you want to "list files". I guess you are talking about static files like images etc. that you have in your fileadmin folder already?
So in this case you need a minimum folder structure like this:
store_inventory
Classes
Controller
StoreController.php (Contains PHP function "filesList")
Configuration
TypoScript
Resources
Private
Templates
Files.html (Contains HTML/Fluid-Code for Frontend)
ext_emconf.php (Contains necessary information about your Ext.)
ext_localconf.php (Contains registration of Frontend-Plugin/Controller)
A more detailed answer requires more information about your extension's exact requirements. Here are some more links that I think you might need for this project:
ext_emconf.php
https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ExtensionArchitecture/DeclarationFile/Index.html#
ext_localconf.php
https://docs.typo3.org/m/typo3/book-extbasefluid/master/en-us/4-FirstExtension/7-configuring-the-plugin.html
Controllers and Actions:
https://docs.typo3.org/m/typo3/book-extbasefluid/master/en-us/7-Controllers/1-Creating-Controllers-and-Actions.html
Your Controller needs to have a function called for instance "fileAction" and the template file for this "Action" must be named "File.html" in order to work. If you name the action "fileListAction", your template file must be named "FileList.html" and so on...
There are some other small things to think about, but I don't know enough about your exact requirements. If you have any trouble, don't hesitate to ask more questions!
I know, TYPO3 can be frustrating. I do it for decades already ;)
Good luck

How to create a searchable central repository of code documentation using DocFx

I'm looking to create a central repository for all of our published API documentation using DocFx. I have documentation auto-generated via my build (using TFS) and published through my release (using Octopus) just fine for multiple individual sites. However, I'm wanting to pull it altogether in one location. The thinking is that through a parent site you could filter content in any of the individual sites without having to drill down into them. Do you have a recommendation on how to do this?
Also, within this same documentation repository I want to provide the capability to search by all of the meta data (project-level documentation) across the hundreds of projects in our portfolio. This will give our BA, DEV and QA teams easier access to what all our systems do. I like the "filtering" capability built into DocFx, but I'm wanting full-text search across all of the meta data. Do you have a recommendation for this functionality as well?
To change the location of the docfx output, edit the docfx.json file and specify the dest value. By default it is "dest": "_site". For more formatting guidance, reference: https://dotnet.github.io/docfx/tutorial/docfx.exe_user_manual.html.
Regarding full-text search, that is possible by simply ensuring the ExtractSearchIndex post-processor is invoked (in order to generate an index.json file of keywords) and that the global _enableSearch value is set to true in the docfx.json file. A snippet from that file would look like:
"postProcessors": [ "ExtractSearchIndex" ],
"globalMetadata": {
"_enableSearch": "true"
}
For your first question:
I think what you expect is like the .NET API Browser. The source code behind this page is not open to public, so you need create this page by yourself, through collecting xrefmap.yml from multiple sites, and extract the needed data into this page.
For your second question:
DocFX uses Luna to scan all the output files and generate an index file called index.json for later search use. In your case, you should want to limit the search scope only in the metadata you defined. This is also not supported by DocFX by default. You can also use Luna in your central place to search these meta. You can create your specific index.json for each project first, and the cental place to collect them for the search page.

How to know the url from a pdf component? (Tridion2009)

We have some pdf as a multimedia components. And I would like to know the url before I publish the page where we are using the pdf. The component is already published.
I was trying to guess looking another examples: domain/en/multimedia/Name_pdf.pdf
But didn't work...
¿Someone knows the rule?
Thank you,
A lot depends on how you are handling the multimedia component within your templates, whether you are creating variants (probably not for PDF files) and, to a certain extent, what kind of delivery environment you are using and how it is configured.
If you are trying to output a link to your published binary from a template, you should probably use the out-of-the-box functionality by outputting syntax like
text
from your templates and then using the other default TBBs to publish the component and resolve the link for you.
However, in a default, standard 2009 environment, with normal publishing, you should find that your file is simply published to the file system at
<Publication Images Path>\<Binary Filename>
With the link resolving to
http://<Your server>/<Publication Images URL>/<Binary Filename>
Note:
In earlier versions of Tridion the binary filename was manipulated to include the TCM Id for uniqueness, but by 2009 this was no longer the case

Where to store some information written in file in Cocoa?

I'm new in Cocoa. My app is getting information from server, and displaying UNC paths of shared folders. I want to be able to store information of my Absoulte paths for each folder, so later I can display them in my APP. With more details
UNC Path - //CompName/sharedFolder
Absoulte Path -/Users/user/desktop/SharedFolder
So I need to store somewhere all that ABsolute paths locally on computer, after I can browse UNC paths from server, and display their Absoule paths.
What is the best way to store information? I know it is possible to use Core DAta. But I haven't designed for that my App. Can I store infromation in hiden file, and read it from there? How can I do it?
Thanks a lot.
It looks like you are looking for the NSUserDefaults class. From the documentation:
The NSUserDefaults class provides a programmatic interface for interacting with the defaults system. The defaults system allows an application to customize its behavior to match a user’s preferences. For example, you can allow users to determine what units of measurement your application displays or how often documents are automatically saved. Applications record such preferences by assigning values to a set of parameters in a user’s defaults database. The parameters are referred to as defaults since they’re commonly used to determine an application’s default state at startup or the way it acts by default.
You just tell it what data you want to store.

How is the Trac Project List page customised?

We've been using Trac for a while now for our developers only. However we are now opening it up for our (internal) clients. We have a project listing page (based on the default one that comes with Trac). What we'd like to do, is display more information about the project than what is currently available.
I have searched google and here, to see if I can find how to get more information. There seems to be a variable called $project which has .name, .description and .href as attributes.
Is there somewhere, a list of the attributes available? Or perhaps a different solution altogether that will allow us to display more information on the project list page. Such as the number of open tickets etc.
As far as I known, you can use $project.env as well. It is an object, which provides a number of attributes:
$project.env.base_url
$project.env.base_url_for_redirect
$project.env.secure_cookies
$project.env.project_name
$project.env.project_description
$project.env.project_url
$project.env.project_admin
$project.env.project_admin_trac_url
$project.env.project_footer
$project.env.project_icon
$project.env.log_type
$project.env.log_file
$project.env.log_level
$project.env.log_format
More detail is available at env.py
On the project page customization page there is not much variables, indeed. Looking at the source code there is also trac.version, trac.time, but that's all. There is also project.env that may hold more information. I do not have a multiproject setup at hand, so you might be interested to see for yourself what variables are available with TracDeveloper plugin. It dumps variables if enabled and you add debug=true in the URL.