NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Schemas for code completion with xsd

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
dohomi



Joined: 29 Feb 2012
Posts: 2

PostPosted: Wed Feb 29, 2012 2:20 am    Post subject: Schemas for code completion with xsd Reply with quote

Hello all,

I want to use Netbeans 7.1 for fluid templating (FLOW3 and extbase/fluid TYPO3) and created XSD schema files for code completion.

I added the XSD file under
Tools->DTDs and Schemas->User Catalog->Add Local Schema

But I dont get the auto completion work in HTML files. Is there anything I need to do after adding the XSD files to the local schema?

Thanks for any help!

domi
Back to top
dohomi



Joined: 29 Feb 2012
Posts: 2

PostPosted: Mon Mar 05, 2012 5:09 am    Post subject: still no success Reply with quote

Hello,

is there nobody out there, who needs code completion out of xsd schema files? I tried now with the new 7.1.1 version but still have no clue how to get the autocomplete working. This is how it looks like in my *.html files:

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"
xmlns:flux="http://fedext.net/ns/flux/ViewHelpers"
xmlns:fed="http://fedext.net/ns/fed/ViewHelpers"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">

<(...)

</html>

The schema file is specified in Schema -> User Catalog but nothing happens if I press "<"+Strg+Space. I checked the manual:
http://wiki.netbeans.org/SchemaAwareCodeCompletion
But couldn't find my mistake.

Thanks for any hint! Dominic
Back to top
sinabiant



Joined: 10 Mar 2012
Posts: 1

PostPosted: Sat Mar 10, 2012 6:33 pm    Post subject: Reply with quote

I have the same problem and no clue how to get it work. I neither can find a tutorial how to do something like that at all.

I added
Code:
<test:test xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"
    xmlns:flux="http://fedext.net/ns/flux/ViewHelpers"
    xmlns:fed="http://fedext.net/ns/fed/ViewHelpers"
    xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://fedext.net/ns/fed/ViewHelpers FEDViewHelpers.xsd
   http://fedext.net/ns/flux/ViewHelpers FLUXViewHelpers.xsd
   http://typo3.org/ns/fluid/ViewHelpers FLUIDViewHelpers.xsd">

to the top of the file and at the end:
Code:
</test:test>
.
Nothing happened until I renamed the file ending to xml. Then it said, that its loading, but after a few tries I only get the message: "No suggestions".

The XSD files are in my main folder of my project (direct in source files).

My second try was to add the schemas directly: Tools->DTDs and XML Schemas -> User Catalog [read-writer] -> Add Local DTD or Schema
Now I added the three ViewHelpers.xsd as URI and the name like "http://typo3.org/ns/fluid/ViewHelpers" as "System ID".

Next I created a new file with the netbeans wizard: File Type XML Document. After a few next clicks I selected the document type to XML Schema-Constrained Document. I added all three schemas via the browse button on the schema options page.

The result was the following:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->


<ns1:alias
   xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
   xmlns:ns3='1'
   xmlns:ns2='http://fedext.net/ns/fed/ViewHelpers'
   xmlns:ns1='http://typo3.org/ns/fluid/ViewHelpers'>

   

</ns1:alias>


Autocomplete still does not work. I changed even the prefixes to f, fed and fluid.

Any ideas? PHPStorm does not have these problems, so I think the XDSs are correct.
Back to top
rleuthold



Joined: 25 Jan 2012
Posts: 16
Location: Switzerland

PostPosted: Thu May 31, 2012 2:25 pm    Post subject: Reply with quote

I would like to use code completion based on xsd schemas as well.

Do we need to create a feature request for this?
Back to top
shredding



Joined: 02 May 2012
Posts: 2

PostPosted: Mon Oct 01, 2012 9:11 am    Post subject: News? Reply with quote

Any news on that one=?
Back to top
madii



Joined: 02 Feb 2014
Posts: 1

PostPosted: Sun Feb 02, 2014 1:16 pm    Post subject: Phpstorm and Fluid Reply with quote

Hi together,

well i have accomplished to add the Auto-complete Function for fluid, vhs, etc.

Well i don't know if it will help some1 cause the posts are so old, but maybe it gonna help.

I am doing this now for typo3 fluid. For other scheme the procedure is the same.

1. Add the typoscript extension for Phpstorm. // This is not necessary but its good to have it
2. Add for fluid this code in your file:
Code:

<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
     xmlns:f="https://fedext.net/schemas/fluid-master.xsd">
 <!-- ... Your Code here ... //-->
</div>

Now Phpstorm will complain about unknown source. So go on the line with
Code:

xmlns:f="https://fedext.net/schemas/fluid-master.xsd">

and press Alt + Enter and chose "Fetch External Resource".
After clicking that your scheme is now automaticly added in your local "DTS and schema".
Now Fluid code is accepted by PhpStorm.
3. Now we can add Autocompete...Autocomplete is definede in the Live-Templates of Phpstorm. Go To File->Settings and under IDE Settings there is a option "Live Templates". Click on it. Now u see diffrent types. I don't know why but for me there were already some defintions installed for Fluid, Flexforms and Fluidinline. Well if nothing exists create a new group e.g. "Fluid"and then an new Live Template with your code. An code can look like this:
Code:

<f:form enctype="multipart/form-data" arguments="$arguments$" action="$action$" controller="$controller$" method="post" name="$name$">   
   $END$
</f:form>

name it f:form.
Now when u start enter a code "<f:form" and press tab your code will be autocompleted and u can set the variables u defined.

Have fun with Auto-Complete Function
Gregor
Back to top
Oktopuce



Joined: 17 Mar 2017
Posts: 1

PostPosted: Fri Mar 17, 2017 3:11 pm    Post subject: Reply with quote

Hi all,

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 :

Code:
<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>


And into the section <f:alias>, you have the auto-completion for fluid, vhs and flux.

I also suggest to use the Netbeans plugin : http://plugins.netbeans.org/plugin/41543/typoscript-support-for-netbeans-ide

Florian
Back to top
markus_84



Joined: 18 Jul 2017
Posts: 1

PostPosted: Tue Jul 18, 2017 7:28 am    Post subject: Netbeans and Typo3 Fluid Autocompletition Reply with quote

Hello,

the last solution of Florian does works on NetBeans 8.2.
But the problem are, it only works on xml-Files, not on html files.

Is there still a solution for this?

Markus
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo