JournalStructureServiceUtil is deprecated in Liferay 6.2 - service

I need to know why this class JournalStructureServiceUtil is deprecated and I can't find it's replacement.
Does it have any replacement ?
I am using Liferay 6.2 e ga2.

If you see source of JournalStructureLocalServiceUtil.java or JournalStructureServiceUtil.java, it clearly has class comment as below.
#deprecated As of 6.2.0, since Web Content Administration now uses the Dynamic
Data Mapping framework to handle structures
So DDMStructureLocalServiceUtil.java or DDMStructureServiceUtil.java is it's replacement.

Related

Where is FloatField?

I've added Lucene.Net to a .Net 6 Core project and indexing docs with TextField, StringFiled, and Int32Field all work fine but FloatField doesn't seem to be supported. I'm using LuceneVersion.LUCENE_48. According to https://lucene.apache.org/core/4_1_0/core/org/apache/lucene/document/FloatField.html, FloatField has been available since version 4.1 of Java Lucene. What am I missing? Thanks
See the Lucene.NET 4.8.0 migration guide. Numeric types and method names including numeric types have been changed to use .NET conventions.
Instead of Float use Single. Note that Lucene.Net.Queries.Function.ValueSources.SingleFunction was renamed Lucene.Net.Queries.Function.ValueSources.SingularFunction to distinguish it from the System.Single data type.
So, FloatField has been renamed to SingleField.

Strategies for supporting multiple TYPO3 versions in extensions

I am looking for potential pitfalls or best practices when supporting multiple TYPO3 major versions with extensions. There are some things to consider.
I noticed several extensions support several TYPO3 major version in one version, e.g.
extension version 1.0.0 supports 9.5.* and 10.4.*
However, this way, you can't really get rid of things as soon as they are deprecated. (For example, a function may be deprecated in 10 and there is a replacement function, but this is not available in 9, so in order to support both you use the deprecated function).
This has the disadvantage, that the extension scanner will point out lots of things which are just deprecated. I am a huge fan of the extension scanner and getting rid of deprecations as soon as possible.
When I created my extension migrate2composer I used a separate version branch 8.7. But this is more work if I fix bugs because it needs to be backported.
What is a good strategy and are there ways to keep the workload minimal?
One possibility to support multiple versions and already use the new functionality can be found in the bootstrap_package:
/***************
* Make the extension configuration accessible
*/
if (class_exists(\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class)) {
$extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
);
$bootstrapPackageConfiguration = $extensionConfiguration->get('bootstrap_package');
} else {
// Fallback for CMS8
// #extensionScannerIgnoreLine
$bootstrapPackageConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['bootstrap_package'];
if (!is_array($bootstrapPackageConfiguration)) {
$bootstrapPackageConfiguration = unserialize($bootstrapPackageConfiguration);
}
}
The line // #extensionScannerIgnoreLine will make the extension scanner ignore the following line and will not clutter up the report with this, see Extension scanner documentation.
Thanks goes to Simon Gilli for pointing this out ...
I release a unique version for each TYPO3 LTS version to be able to throw out old stuff. This also facilitates automated testing.
I am like you using different branches to manage that and cherry-pick commits between them.
It's a little bit more work but can be facilitated with helper scripts. I have written some sentences about our reasoning here https://docs.typo3.org/p/dmind/cookieman/master/en-us/Contributors/Index.html#branches
I've heard from some users being confused by the versioning scheme, so in hindsight for the next time I would choose to stick with 1 major version = 1 TYPO3 LTS.
E.g. starting with
v1 - TYPO3 v9
v2 - TYPO3 v10
v3 - TYPO3 v11
And then if our extension has breaking changes, continue with the next free major version, maybe removing the "new feature" support for an older LTS.
v4 - TYPO3 v10
v5 - TYPO3 v11
It is also a compromise however. This way you cannot say that feature X is "in version > 4.1" but maybe the composer scheme will be better understood in the future so you could say "^4.1 || ^5.1".

IMemberIdentifier missing from TypeLite.TsModels namespace

So I've been using TypeLite 1.0.1 with good results until I upgraded to the latest version (1.1.0). It seems the IMemberIdentifier interface is gone, which broke this part of my T4 script:
ts.WithFormatter((TypeLite.TsModels.IMemberIdentifier identifier) =>
Char.ToLower(identifier.Name[0]) + identifier.Name.Substring(1));
I was using this to camel case all my properties in the TypeScript interfaces I'm generating. I can't seem to find a workaround for it and the TypeLite site documentation still uses the above code in their example. I had the same problem with version 1.0.2.
Any comments or ideas much appreciated. Thanks.
It seems that method of formatting members has changed.
To camel case all properties use:
ts.WithMemberFormatter((TypeLite.TsModels.TsProperty identifier) => Char.ToLower(identifier.Name[0]) + identifier.Name.Substring(1));

Eclipse Javascript development with VJET

Using Eclipse Juno with VJet
Can you create typelib from javascripts yourself?
I know you can download jquery and a few others from: http://www.ebayopensource.org/p2/vjet/typelib/
But obviously you will need others.
Regards
Chris
Yes type libraries are just JavaScript files which use VJETDoc and VJOJS to define types for
object literals using vjo.otype
functions which do not change Function definition vjo.otype
functions which have additional properties using vjo.ftype
methods of a class using vjo.ctype
globals which can be define using a .globals section.
and more...
Many type libraries are located under this github address
https://github.com/ebayopensource/vjet-typelib
More info about VJETDoc[1] and VJOJS[2] and type library tutorial[3]
[1]http://www.ebayopensource.org/wiki/display/VJET/VJETDoc+Quick+Reference
[2]http://www.ebayopensource.org/wiki/display/VJET/Semantic+Comparison+-+Java+and+VJET+VJO
[3]http://www.ebayopensource.org/wiki/display/VJET/VJET+Type+lib+Tutorial+-+part+1

Struts2 + REST plugin XML output

I'm creating a Web Service with the Struts2 REST Plugin, which works great. I just have a problem with the entity names of the XML output.
I have a model class named "ModelClass" in the package "com.mycompany.implementation" with a few properties and a nested class "NestedModelClass", and the XML output looks like:
<com.mycompany.implementation.ModelClass>
...
<com.mycompany.implementation.ModelClass_-NestedModelClass>
...
</com.mycompany.implementation.ModelClass_-NestedModelClass>
</com.mycompany.implementation.ModelClass>
How can I change the XML Entity name to be displayed without package name - or even a different name?
Thanks!
The struts rest plugin uses XStream to serialize your model class to XML. Current versions of XStream support annotating classes and fields to customize the serialization. Unfortunately, the struts rest plugin uses a rather old version of XStream, ignoring those annotations.
The easiest way to get what you want is to write your own ContentTypeHandler and use that instead of the default one provided by the rest plugin. This blog describes how to do that.