How to replace DDMImpl constants? - liferay

i'm migratinga portlet modulo from liferay 7.0 to 7.4, and i need to implement some constants what was in the class DDMIMPL in the package com.liferay.dynamic.data.mapping.util.impl.DDMImpl, i replace this with com.liferay.dynamic.data.mapping.form.field.type.constants.DDMFormFieldTypeConstants and I managed to get some of the constants I need, then I added com.liferay.dynamic.data.mapping.internal.util.DDMImpl but I still need to get DDMImpl.TYPE_DDM_LINK_TO_PAGE, where can I get it from? some idea?

grep -r "LINK_TO_PAGE" liferay-src/ reveals DDMFormFieldType.LINK_TO_PAGE from com.liferay.dynamic.data.mapping.model.
Though deprecated it's still in use in a couple of places in Liferay's own source code

Related

Give an example of: groovyc --sourcepath

I am unable to get the --sourcepath option of groovyc to work at all. Can someone furnish a trivial example of it actually doing anything?
Ultimately I want to use "groovyc" at the command line with a directory a packaged organized tree of mixed groovy and java source. I don't want to reference each source file explicitly. And I don't want to use an ant or maven task either, on grounds of both principle (hey is there a bug here?) and because the production scenario that I might want to tweak the source in has neither but will have groovy. I know I could use unix find but must I resort to that?!
sourcepath isn't used anymore. It's only there for backwards compatibility and will be removed in the future.
The Groovy documentation is currently rewritten, you can find a snapshot including the documentation for groovyc here: https://dl.dropboxusercontent.com/u/20288797/groovy-documentation/index.html#ThegroovycAntTask-groovyc

JAXB-XJC Xpropertyaccessors

Per JAXB specification http://jaxb.java.net/2.2.4/docs/xjc.html if you want to run the JAXB-XJC compiler, one of the of the extensions/arguments you may pass is -Xpropertyaccessors even though it has been specfied in each of JAXB-RI till the latest one 2.2.5u2 still when I try to run it passing this argument I get 'unrecognized parameter -Xpropertyaccessors' is not specified in the help menu when I run it. It is important for me to have the access levels on properties not fields.
I have followed up with the JAXB RI lead, apparently the plugin is there but not enabled. The issue will be fixed in versions 2.1.14 and 2.2.6 of the JAXB RI. I would recommend entering a bug so that you will be able to track the status of the issue.
http://java.net/jira/browse/JAXB/

documentation for cabal-install configuration file

The ~/.cabal/config stores configuration which cabal-install uses. I wanted to do some hackery on it. (Specifically, having multiple GHC versions installed, I wish to have separate documentation indexes).
I couldn't, however, find any documentation about its' syntax or variables except for what is included in default file. Is there any documentation available?
Edit: I've stated the goal above, but let me add some details: If the same package (eg. GTK) is installed in two versions of GHC they end up in the same documentation index file. I wan't that local documentation index to be separate for each GHC installation. I believe it is possible in some way using documentation directory setting, but there has to be a variable for currently used GHC version. If there isn't one there might be some workarounds available, but I won't be able to say that unless I see the documentation.
This seems to work, although I've only tested it with one version of GHC:
documentation: True
doc-index-file: $datadir/doc/$compiler/index.html
install-dirs user
docdir: $datadir/doc/$compiler/$pkgid
With the other options left at the default, this generates documentation in .cabal/share/doc/<ghc-version>/<package-name>, and the index in .cabal/share/doc/<ghc-version>/index.html.
There appears to be very little online - not even the haddocks for the cabal-install code. So your best bet may be to puzzle it out from the source. cabal unpack cabal-install, or view the cabal-install repo online. Look at SavedConfig in Distribution/Client/Config.hs. As an example, it imports GlobalFlags from Setup.hs; the individual flags, eg globalCacheDir, are associated with their config-file syntax (which is also the command-line syntax) in the globalCommand function below, remote-repo-cache in this case.
You should also ask dcoutts in the #haskell channel on irc.freenode.net, in case he has new docs available.

How can I find out what functions are deprecated

I am trying to update an old X11/Motif application to use modern objects and libraries. I used ldd to get a list of all the shared objects being used, but I am trying to figure out what functions in particular link to those libraries so I can remove the deprecated functions. Any ideas? Thanks
In particular (but not limited to), libXp.so.6
To see what functions are in libXp.so.6, try:
nm -D --defined-only /usr/lib/libXp.so.6
Now you can see that they all start with Xp, except for a few weird ones that probably aren't meant to be in the public API.
Your simplest approach is probably to just use grep to search for Xp, or a regex like Xp[A-Za-z]+, in the source code.

How to load a text file from within an XQuery?

Is there an XQuery command to load a text file?
I can load an xml document by doing the following;
declare variable $text := doc("test.xml");
But it only seems to work if test.xml is a well-formed xml document. What I want is to load a plain test.txt file into a string variable. Something like this;
declare variable $str as xs:string := fn:loadfile("test.txt");
Can it be done?
I'm using the Saxon engine but I can't find an answer in the saxon documentation.
Indeed you can find one implementation of the file functions in Zorba: http://www.zorba-xquery.com/doc/zorba-1.4.0/zorba/xqdoc/xhtml/www.zorba-xquery.com_modules_file.html
XQuery 3.0 has the function fn:unparsed-text (which was originally defined in XSLT), which does exactly what you want. XQuery 3.0 is still a work in progress though, but whilst there are not many XQuery 3.0 processors available, many XQuery processors already support this function (including Saxon).
There is a standardization effort for this on EXPath. A spec already exists for an XQuery File module that is capable of doing what you describe: EXPath File Module Spec.
Yet, I don't know how many implementations are out there. Saxon doesn't seem to implement it unfortunately (Or, please point me to it). An example implementation is shipped with zorba (see XQDoc Site of Zorba). If you want to know how to get started with zorba, you can check out this tutorial: Get Started with XQuery and Zorba.
XQuery by default( means fn: namespace ) doesn;t have any file-access methods.
MarkLogic :
xdmp:filesystem-file()
xdmp:filesystem-directory()
Zorba:
already mentioned by user457056
Exist
Exist File Module
Saxon since version 9.2 has an extension of fn:collection that can be used to read unparsed text. Here is an example:
collection('file:///c:/TEMP?select=text.txt;unparsed=yes')
This is described under "Changes in this Release" for 9.2. Apparently it is not mentioned in the function library documentation. However it works well and I have been using it a lot.

Resources