How to activate Fluid (TYPO3) autocompletion in Netbeans? - netbeans

I did what it said here: Extbase and Fluid Autocompletion
In NetBeans right-click your Extension project and choose Properties
in the opened context menu to edit the project properties. Select the
category PHP Include Path and use Add Folder... to add the directories
of Extbase and Fluid.
So I added the Fluid and Extbase Folders which I previously copied onto my computer from the Server at /var/www/typo3_src/typo3_src-6.2.25/typo3/sysext:
but it didn't work - here's my Project:
And here is fluid stuff that the editor still doesn't recognize:
What am I doing or thinking wrong?

Found info here, works for me:
It's an old topic but I have a trick so that you can add Auto-complete
function for fluid, vhs, flux.
First of all, download the XSD schema files from here :
https://fluidtypo3.org/viewhelpers/fluid/master.html put them
somewhere locally.
Next step, in Netbeans, go to menu Tools > DTD and XML Schemas, add
your 3 DTD in user catalog :
Flux : Public ID = http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers URI
= path to your flux XDS file
Fluid : Public ID = http://typo3.org/ns/TYPO3/Fluid/ViewHelpers URI =
path to your fluid XDS file
Vhs : Public ID = http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers URI =
path to your flux VHS file
Next, in project properties, go to 'testing' menu and add the folder
where you stored your DTD.
Now, in your Project > Test Files, add a new XML Document and choose
"XML Schema-Constrained Document" on next step, click the button
'Browse' and By File > Your Project > Test Files and select import for
all the xsd schema files.
Then, change the prefix f for fluid, flux for flux and vhs for vhs
choose fluid as primary and finish.
A file is created with this content :
And into the section <f:alias>, you have the auto-completion for
fluid, vhs and flux.
<f:alias
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:f='http://typo3.org/ns/TYPO3/Fluid/ViewHelpers'
xmlns:vhs='http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers'
xmlns:flux='http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers'
xsi:schemaLocation='http://typo3.org/ns/TYPO3/Fluid/ViewHelpers file:/home/florian/Documents/Docs/Netbeans/Autocomplete%20Fluid/Schemas/Fluid.xsd
http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers file:/home/florian/Documents/Docs/Netbeans/Autocomplete%20Fluid/Schemas/Vhs.xsd
http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers file:/home/florian/Documents/Docs/Netbeans/Autocomplete%20Fluid/Schemas/Flux.xsd'>
Auto-completion here
</f:alias>
http://netbeans-org.1045718.n5.nabble.com/Schemas-for-code-completion-with-xsd-tt5752294.html#none
take files from https://fluidtypo3.org/schemas/
Some more info Use Netbeans to Create Sample XML from XSD
From a project that contains the .xsd:
Click New File on the tool bar or File > New File from the menu
Choose XML > XML Document
Name your file, click next
Choose XML Schema-Constrained Document, click next
Click the Browse button and use By File to navigate to the .xsd
Click the Import check box beside the file name, click next
Review the options available and click Finish to generate
You can use more than one .xsd file to generate the .xml. In this case it will use whichever .xsd file you choose as Primary to resolve any conflicts.

Related

TYPO3: No template was found. View could not be resolved for action

I'm experimenting a bit with TYPO3 backend modules and I'm trying to get a view when I click my module in the left menu in the backend. However when I click this I get the following message:
Sorry, the requested view was not found.
The technical reason is: No template was found. View could not be resolved for action "list" in class "MyVendor\MyModule\Controller\ConnectionController".
I have the view for the list action in the folder Resources/Private/Backend/Templates/Connection and the file is called List.html (uppercamelcase)
I'm using TYPO3 version 7.6.15 and I made this module with the extension builder.
Any help would be appreciated.
Some possible reasons for this (or similar) errors:
1. Forgetting to include the TypoScript static templates
see Documentation: Include TypoScript from extensions
Choose WEB > Template module (in Module menu)
Select your start (root) page (in page tree)
Select Info / Modify (in Docheader)
Choose Edit the whole template record
Choose tab Includes
Select your extension under Available Items
This will activate the TypoScript under Configuration/TypoScript
2. Wrong path
The Template paths set via TypoScript must match the available template paths in the filesystem.
Usually, the default path is:
Resources/Private/Templates (for frontend plugins)
or
Resources/Private/Backend/Templates (for backend modules)
This must have been set correctly via TypoScript. For example:
Configuration/TypoScript/setup.typoscript:
# Module configuration
module.tx_myexample_web_myexamplelist {
view {
templateRootPaths.0 = EXT:myexample/Resources/Private/Backend/Templates/
...
module. is for backend modules
if you are working with frontend plugins, use plugin. instead of module.
the correct file ending for TypoScript is .typoscript since TYPO3 8 and no longer .ts or .txt. For version 7, it is correct to use .ts.
3. Incorrect filenames
Make sure that the name of the Controller matches the name of the subdirectory in the Templates directory. The name of the template file is capitalized.
Controller/SomeController.php: listAction()
matches
Resources/Private/Backend/Templates/Some/List.html
Where to define the TS:
either as described above e.g. in Configuration/TypoScript setup.typoscript (and load this via static include).
The file ext_typoscript_setup.typoscript in the extension root can be used to setup TypoScript independent of page-tree and template-records. This will be included in the setup section of all TypoScript templates. but also consider the warning in the documentation.
Load TypoScript or TypoScript files directly in the extension with functions from ExtensionManagementUtility
You can also change your template root path (the relative path from where the extension takes the tempaltes):
go to the
setup.ts
file (or setup.txt file; depends on personal preferences and local configuration) and add the following line
plugin.tx_myslider.view.templateRootPath = EXT:path/to/custom/directory/
for example it could look like this:
EXT:slider/Resources/Private/Templates/myAwesomeFolder/
NOTE: slider is just a placeholder. You can simply replace it with your extension name
Add your extension to the website node. Until you add it, the setup.ts won't work.

Generating the separate ecore files for the sub-Epackes present in the existing model

Problem: I have an ecore file which has the sub-E Packages. Using this model I am trying to create the GUI part using Sirius. But the problem with Sirius is that it does not support ecore files containing sub-E Packages. So we have to extract those sub-E Packages to separate ecore files. But each sub-E Packages has relation with the other sub-E Packages. So how can we extract those sub-E Packages to separate ecore files such that the relations still exists between separate ecore files after extracting them.
Thanks
By extracting them the ecore Editor will lose the information unfortunately, which means some extra work...
I had the same issue with sirius and sub e-packages leading to sirius crashing the diagram constantly.
Here is how i solved extracting a sub-epackage:
First Create a new .ecore file for your desired sub-package.
Open both .ecore files (your main and the new one) with the Sample
ecore model editor (treeview).
Copy the Package properties to your new epackage node(ns, praefix,
uri) you need to do this manually.
Then drag and drop your whole contents(excluding the purple package
node) from your subpackage into the new Epackage
Save and make sure no errors in your new file occur.
load your new .ecore file into your main file by clicking "Load
resource" Now your main file knows 2 kinds of the EClasses you have in your sub-package, their names are identical but their uri is
different.
you could now simply replace all occurrences of sub-epackage-eclasses with the newer ones or smarter and safer
Replace an etype one time (where actually use the etype in your root package)
open your main .ecore file as text, you will see that the etype values all
have a path like eType="ecore:EClass
../../org.eclipse.emf.ecore/model/Ecore.ecore#//EObject" Then You need to know how your etype paths (from your sub-epackage and your new one) differ so you can simply replace them all and your good.
finally delete the sub-epackage
Hope this helps
In eclipse ecore editor you can use "Load Resource" in pop-up menu to load any ecore file and use objects from it.

Create editor with multiple parts in Eclipse 4.x

I want to create an application that can open files. When opening a file, an editor should open like in the normal Eclipse IDE. but i want in this Editor multiple Parts (e.g. TreeView of the opened data and data in plaintext)
Is there a way to describe the contents of this editor in the Application.e4xmi and then just opening this "view"?
like this:
Application.e4xmi:
PartStack (id = "editor.partstack")
|- Part (DataTreeViewer.java)
|- Part (PlaintextViewer.java)
\- Part (ImagePart.java)
OpenHandler.java:
PartStack ps = openPartStack("editor.partstack");
addToMainPartstack(ps);
Or do i have to describe the editor contents programmatically in the OpenHandler? like this:
OpenHandler.java:
PartStack ps = createNewPartStack();
ps.add(new DataTreeViewer());
ps.add(new PlainTextViewer());
ps.add(new ImagePart());
addToMainPartstack(ps);
I just used a PartDescriptor for the editor part and an ordinary CTabFolder for the pages in the editor.

Eclipse RCP: programmatically associate file type with Editor?

How programmatically associate file type with Editor?
That is what Eclipse-RCP Java code can do what is archived with the following UI interaction:
Window -> Preferences
General -> Editors -> File Associations
Add... > File type: *.json
Select *.json file type
Add... (Associated editors) > JavaScript Editor
Make it default
Ralated to Q
https://stackoverflow.com/questions/12429221/eclipse-file-associations-determine-which-editor-in-list-of-associated-editors
Eclipse: associate an editor with a content type
Get associated file extensions for an Eclipse editor
Opening a default editor, on a treeviewer selection eclipse rcp(eg: as eclipse knows that j.java files must be opened in text editor)
eclipse rcp change icon for xml configuration file
I know your questions says "programmatically" but I'll give a complete run down of the methods.
If you are writing the plugin that provides the editor, then you should simply declare the extension in your plugin.xml.
<extension
point="org.eclipse.ui.editors">
<editor
...
extensions="json"
...
If you are distributing a complete RPC application, you can edit the plugin.xml for the plugin that provides the editor or add a plugin that just refers to that editor.
But, if you have to do it programmatically, you are manipulating the internals of an RPC instance. Eclipse does not provide a public API for that but this code will do it:
// error handling is omitted for brevity
String extension = "json";
String editorId = "theplugin.editors.TheEditor";
EditorRegistry editorReg = (EditorRegistry)PlatformUI.getWorkbench().getEditorRegistry();
EditorDescriptor editor = (EditorDescriptor) editorReg.findEditor(editorId);
FileEditorMapping mapping = new FileEditorMapping(extension);
mapping.addEditor(editor);
mapping.setDefaultEditor(editor);
IFileEditorMapping[] mappings = editorReg.getFileEditorMappings();
FileEditorMapping[] newMappings = new FileEditorMapping[mappings.length+1];
for (int i = 0; i < mappings.length; i++) {
newMappings[i] = (FileEditorMapping) mappings[i];
}
newMappings[mappings.length] = mapping;
editorReg.setFileEditorMappings(newMappings);
Associating file type means associating content of ur editor with a predefined one.
This can be easily achieved via plugin.xml..
Just follow the following link:-
Eclipse help Documentation
http://help.eclipse.org/indigo/index.jsp
and search for org.eclipse.core.contenttype.contentTypes.

Updating XCode project template details

Previously all file headers were being displayed as follows.
// Created by ABC_User_Name on 10/31/11.
I have modified user name from ABC_User_Name to XYZ_User_Name.
Now, even after logging out & logging in again, I am finding the same headers in all project templates. How to update those templates with current user-name ?
Do I need to modify manually all of them ?
The original templates use this header:
// Created by ___FULLUSERNAME___.
// Copyright ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
The words with the double underscore are placeholder references. There are 18 that I know of, and you can add more in your template definition. These options can be further modified using option variables. The ones you see above are:
___FULLUSERNAME___ Full user name of the current user (name + surname).
__YEAR__ Current year.
___ORGANIZATIONNAME___ The name of your organization as seen on your address book. You can change it for each project selecting the Project node and setting the Organization field.
Once the project is created, the header becomes plain text and is never updated.
For future projects I suggest you duplicate the templates and do the changes there. Otherwise you risk screwing up the original templates or having Xcode overwrite your changes.
The originals are at:
/Developer/Library/Xcode/Templates/
/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates
And I made a copy at:
mkdir -p ~/Library/Developer/Xcode/Templates/File\ Templates/Jano
mkdir -p ~/Library/Developer/Xcode/Templates/Project\ Templates/Jano
where "Jano" is my user and it will show as a template category in the new project selection screen.
Then you edit the header manually file by file, or from bash using sed.
Xcode 4 stores this on a per-project basis.
If you select the project in the Project Navigator (Cmd-1) and open the File Inspector (Cmd-Opt-1), you'll see a field for "Organization" under "Project Document".