Eclipse Content Assist for composite components in JSF 2 don´t show - eclipse

I,m developing a composite component to generate a selectOneMenu from a DB data list according to name pass by parameter.
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:jsf="http://java.sun.com/jsf"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<cc:interface componentType="pseudocatalog" >
<cc:attribute name="paramsName" default="" displayName="paramsName" expert="false" hidden="false" preferred="true" shortDescription="Descripcion de prueba"/>
<cc:attribute name="paramsValue" default="" displayName="paramsValue" shortDescription="Descripcion de prueba"/>
<cc:attribute name="paramsType" type="java.lang.String" default="" displayName="paramsType" shortDescription="Descripcion de prueba"/>
<cc:attribute name="storedProcedure" type="java.lang.String" default="" displayName="storedProcedure" shortDescription="Descripcion de prueba"/>
<cc:attribute name="nextAutomatic" type="java.lang.Boolean" default="true" displayName="nextAutomatic"/>
<cc:attribute name="value" type="java.lang.String" default="" displayName="value"/>
<cc:attribute name="mode" type="java.lang.String" default="" shortDescription="" displayName="mode"/>
<cc:attribute name="autocomplete" type="java.lang.String" default="" displayName="autocomplete"/>
<cc:attribute name="loadDefaultOption" type="java.lang.Boolean" default="true" displayName="loadDefaultOption"/>
<cc:attribute name="order" type="java.lang.String" default="asc" displayName="order"/>
<cc:clientBehavior name="change" targets="#{cc.id}" event="change" />
</cc:interface>
<cc:implementation>
<h:selectOneMenu id="#{cc.id}" value="#{cc.attrs.value}" >
<f:selectItems value="#{cc.items}"/>
</h:selectOneMenu>
</cc:implementation>
</html>
And the new component renders fine but eclipse don´t show the content assistant for the attributes.
For another library components like rich or h the content assistant works fine
What´s wrong?

Not possible, at least, I couldn't achieve it. Eclipse is able to identify the tag name for the composite itself, but not its attributes. You can see it also in the docs. What you could do is to declare it as a tag library, so eclipse could recognize them parsing the declaration file.

Related

What's wrong with my trace compass analysis?

I've generated an event stream with an lttng-ust, using the header file, contatining the following event declaration:
TRACEPOINT_EVENT(
random_chart,
point,
TP_ARGS(
int, value_arg
),
TP_FIELDS(
ctf_integer( int, value, value_arg )
))
After successfully opening it in a TraceCompass, I've tried to write an analysis with an XYChart, showing this value stream as a simple plot. My XML file contains the following:
<?xml version="1.0" encoding="UTF-8"?>
<!-- The state provider assigns states from events -->
<stateProvider id="org.eclipse.linuxtools.ust.random_chart" version="1">
<head>
<traceType id="org.eclipse.linuxtools.lttng2.ust.tracetype" />
<label value="Value chart analysis" />
</head>
<!-- Event handlers -->
<eventHandler eventName="random_chart:point">
<stateChange>
<stateAttribute type="constant" value="Dummy" />
<stateAttribute type="constant" value="Value" />
<stateValue type="eventField" value="value" />
</stateChange>
</eventHandler>
</stateProvider>
<!-- This is the definition of the XY chart view -->
<xyView id="my.test.xy.chart.view">
<head>
<analysis id="org.eclipse.linuxtools.ust.random_chart" />
</head>
<entry path="Dummy/Value">
<display type="constant" value="Value" />
<name type="self" />
</entry>
</xyView>
I can't see what's wrong with it (even after reading all the related xml-schema files in a git-repository).
I can import this successfully, but after clicking on an 'XML XY Chart View' I see an empty plot and a single (last in the event stream) value under the 'type filter text'.
AFAIK the 'State System Explorer' shows me correct 'Value at timestamp' corresponding to the 'Full attribute path' equal to 'Dummy/Value'. Probably I miss something.
EDIT1: I've tried to fix, but still have no luck:
<entry path="Dummy"> <display type="constant" value="Value" /> <name type="self" /> </entry>
EDIT2: Same problem with:
<entry path="Dummy/Value">
<display type="self" />
<name type="self" />
</entry>
You have 2 possibilities to fix the problem, given that you have only one attribute with data:
1- Change the <entry path="Dummy/Value"> to <entry path="Dummy"> and keep the rest
or
2- Keep your entry and change the display element to <display type="self" />
A display of type constant means it tries to read an attribute of that name under the main path, so here, it was trying to read "Dummy/Value/Value", which doesn't exist
EDIT: Here's a working example of the view part for your analysis:
<xyView id="my.test.xy.chart.view">
<head>
<analysis id="org.eclipse.linuxtools.ust.random_chart" />
<label value="Random view" />
</head>
<entry path="Dummy">
<display type="constant" value="Value" />
<name type="self" />
</entry>
</xyView>

flux:form.section inside another flux:form.section not rendering flux:form.object Properly

I am creating a Layerslider with Fluid Content Element (FCE).
Below Is my code.
<flux:form.sheet name="elements" label="Elements">
<flux:form.section name="slides" label="Slides">
<flux:form.object name="slide" label="Slide">
<flux:field.input name="title" label="Slide Title" />
<flux:field.text name="layersliderdata" enableRichText="0" rows="4" label="Layerslider data" />
<flux:field.file name="background" allowed="jpg,png,jpeg,gif" label="Background" />
<flux:field.file name="thumbnail" allowed="jpg,png,jpeg,gif" label="Thumbnail" />
<flux:form.section name="elements" label="Elements">
<flux:form.object name="text" label="Text">
<flux:field.text name="content" rows="3" label="Text" />
<flux:field.select name="type" items="p,h1,h2,h3,h4,h5,h6,h7,h8" label="Type" />
<f:render section="SharedObjectFields" arguments="{_all}" />
</flux:form.object>
<flux:form.object name="image" label="Image">
<flux:field.file name="file" allowed="jpg,png,jpeg,gif" label="Image file" />
<f:render section="SharedObjectFields" arguments="{_all}" />
</flux:form.object>
</flux:form.section>
</flux:form.object>
</flux:form.section>
</flux:form.sheet>
<f:section name="SharedObjectFields">
<flux:field.text name="style" enableRichText="0" rows="4" label="CSS Styles" />
<flux:field.text name="layersliderdata" enableRichText="0" rows="4" label="Layerslider data" />
<flux:field.input name="class" label="Class" />
</f:section>
I am Getting Result Like this.
But I want Result as per below screenshot.
I Dont Know. What's going wrong.
I am using below Versions of fluid elements.
Typo3 6.2.14
vhs 2.3.3
fluidcontent 4.2.4
fluidpages 3.2.3
flux 7.2.1
I can confirm this on dcngmbh/moox_core for Split Button with DropDown FCE (Fluid Content Element) in which its display result in backend like this.
http://screencast.com/t/wIeYk8AUmGl
http://screencast.com/t/QLqnSmpy
I faced the same issue some days ago using fluidcontent. It seems, there is a bug in flux, which has been fixed in the GitHub repositories. You could try to switch to the development version of flux or wait for an official release on TER.

Joomla 3 cannot disable custom plugin

I just installed a custom plugin in Joomla 3 and now I cannot disable it.
When I click disable (or edit) I receive "Internal Server Error".
xml file:
<?xml version="1.0" encoding="utf-8"?>
<extension version="3.0" type="plugin" group="content">
<name>Content - Availability Calendar</name>
<author>Joomla! Project</author>
<creationDate>2010</creationDate>
<copyright>Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<authorEmail>support#msc.gr</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>1.5</version>
<description></description>
<files>
<filename plugin="calendar">calendar.php</filename>
<filename>index.html</filename>
</files>
<params>
<param name="unit_id" type="text" size="5" default="50" label="Villa ID" description="Villa ID"/>
</params>
</extension>
You're XML code is old and is based on the code used for Joomla 1.5. You need to replace the following:
<params>
<param name="unit_id" type="text" size="5" default="50" label="Villa ID" description="Villa ID"/>
</params>
with this:
<config>
<fields name="params">
<fieldset name="basic">
<field name="unit_id" type="text" size="5" default="50" label="Villa ID" description="Villa ID"/>
</fieldset>
</fields>
</config>
Then for each new parameter you want to add, simply add a new <field>

a slippery JSF syntax error

If I try to display a JSF 2 page on Tomcat 7.0.34 with:
jsf-api/impl 2.1.7
el-api 2.5
jstl 1.2
like this one:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:cis="http://java.sun.com/jsf/composite/comp">
<h:head>
<title>Prova errore di sintassi</title>
</h:head>
<h:body>
<f:view>
<ui:include src="/WEB-INF/include/menubar.xhtml" />
<h:form>
<p:ajaxStatus style="width: 32px;height: 32px;" />
<p:growl />
<p:panel id="pannello">
<p:focus />
<p:messages
showDetail="true"
globalOnly="true" />
<h:panelGrid columns="3">
<p:outputLabel
for="ckpensionat2"
value="Pens2"
title="tit x pens2"
style="padding-right: 3px; display: inline-block; min-width: 60px;" />
<p:selectBooleanCheckbox
id="ckpensionat2"
value="#{miocomp.pensionato}"
title="tit x pens2"
valueChangeListener="#{miocomp.pensCambiato}" />
</p:selectBooleanCheckbox>
<h:outputLabel value="pippo" />
</h:outputLabel>
<p:message for="ckpensionat2" />
<p:commandButton
value="agg"
update="pannello" />
</h:panelGrid>
</p:panel>
</h:form>
</f:view>
</h:body>
</html>
Nothing is showing!
please pay attention to the error of double closing tag
.../>
</p:selectBooleanCheckbox>
<h:outputLabel value="pippo" />
</h:outputLabel>
My questions are:
why </h:outputLabel> is evincted like a syntax error on Eclipse while </p:selectBooleanCheckbox> not
when I try to show this page I get a blank page. If I remove the error all goes fine.
no errors at all appears on my log view neither on tomcat 7 log dir
thanks in advance for any suggestions
It is a syntax error (invalid XML) since in <h:outputLabel value="pippo" />
</h:outputLabel> you close the tag twice; once with the /> end tag and secondly with the </h:outputLabel> element. Also, p:selectBooleanCheckbox doesn't have title attribute. I'm pretty sure IDE can't validate the rest of the document because of these errors, so it only complains about the first.
That's normal...
I believe you should increase the log level or change the javax.faces.PROJECT_STAGE parameter to Development in your app's web.xml

Formatting XML files in eclipse

When i try to format a xml file in eclipse it puts each of the fields on a new line. instead i want each property to be on one line. for e.g. now when i press CTRL+SHFT+F, eclipse formats it like this.
<hibernate-mapping package="com.server.entities">
<class
name="Branch"
table="Branch"
>
<meta attribute="sync-DAO">false</meta>
<id name="Id"
type="java.lang.Long"
column="id"
>
<generator class="native"/>
</id>
<property
name="Created"
column="created"
type="timestamp"
not-null="false"
length="23"
/>
<property
name="LastUpdated"
column="lastUpdated"
type="timestamp"
not-null="false"
length="23"
/>
<property
name="CreatedBy"
column="createdBy"
type="java.lang.Long"
not-null="false"
length="19"
/>
but what i want is
<hibernate-mapping package="com.kaizen.report.server.entities">
<class name="Branch" table="Branch">
<meta attribute="sync-DAO">false</meta>
<id name="Id" type="java.lang.Long" column="id">
<generator class="native"/>
</id>
<property name="Created" column="created" type="timestamp" not-null="false" length="23"/>
If you're using the XML Editor from eclipse.org, go tot he XML Editor preference page and change the options to allow much longer lines and to not split multiple attributes each onto new lines.