how to implement Marquee in Oracle adf? - oracle-adf

How to use marquee tag in Oracle adf (version 12c - 12.2.1.3.0)? or some feature to scroll some message (Message should be picked from database) from right to left.
The below code worked in 11g, but after migrating to 12c message is not scrolling.
< marquee>< af:outputText id="ot1" value="#{pageFlowScope.MyBean.userMessage}"/>< /marquee>
I have tried the below oracle recommendation, even it is not working.
< af:outputText inlineStyle="height=100%" id="prdc2" escape="false" value="< marquee bgcolor=orange height=20 direction=right behavior=alternate scrollDelay='200' id='rates' dataFormatAs='text' behavior='alternate'>#{bindings.rateText}< /marquee>"/>
Link for recommendation: https://support.oracle.com/knowledge/Middleware/1140463_1.html

<marquee direction ="left" onmouseover="this.stop();"
onmouseout="this.start();" scrolldelay="120">
<af:outputFormatted id="marquee_text"
value="Welcome to ADF. Any warnings will be updated here. "
inlineStyle="color:Red; font-weight:bold;"/>
</marquee>
use this code inside the af form it worked for me

Related

Display project version in ASP.NET Core 1.0.0 web application

None of what used to work in RC.x helps anymore.
I have tried these:
PlatformServices.Default.Application.ApplicationVersion;
typeof(Controller).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
Assembly.GetEntryAssembly().GetName().Version.ToString();
They all return 1.0.0.0 instead of 1.0.0-9 which should be after execution of the dotnet publish --version-suffix 9 having this in project.json: "version": "1.0.0-*"
Basically they give me "File version" from the attached picture instead of "Product version" which dotnet publish actually seems to change.
For version 1.x:
Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
For version 2.0.0 this attribute contains something ugly:
2.0.0 built by: dlab-DDVSOWINAGE041 so use this one:
typeof(RuntimeEnvironment).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
I would do it like this on ASP.NET Core 2.0+
var assemblyVersion = typeof(Startup).Assembly.GetName().Version.ToString();
In .Net Core 3.1 I show the version directly in my View using:
#GetType().Assembly.GetName().Version.ToString()
This shows the Assembly Version you have in your csproj file:
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<FileVersion>2.2.2.2</FileVersion>
<Version>4.0.0-NetCoreRC</Version>
</PropertyGroup>
If you want to display the "other" FileVersion or "Informational" Version properties in the View add using System.Reflection:
using System.Reflection;
.... bunch of html and stuff
<footer class="main-footer">
<div class="float-right hidden-xs">
<b>Assembly Version</b> #(Assembly.GetEntryAssembly().GetName().Version)
<b>File Version</b> #(Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>().Version)
<b>Info Version</b> #(Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion)
</div>
</footer>
Note that after adding the System.Reflection the original #GetType().Assembly.GetName().Version.ToString() line returns 0.0.0.0 and you need to use the #Assembly.GetEntryAssembly().GetName().Version
There's a blog post here
Edit: Make sure to follow proper naming conventions for the Version strings. In general, they need to lead with a number. If you don't, your app will build but when you try to use NuGet to add or restore packages you'll get an error like 'anythingGoesVersion' is not a valid version string. Or a more cryptic error: Missing required property 'Name'. Input files: C:\Users....csproj.'
more here:
This work for me too:
#Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion
It works with csproj file - either <Version>1.2.3.4, or <VersionPrefix>1.2.3</VersionPrefix>. However the <VersionSuffix> isn't recoganized as this doc says.
The answer by Michael G should have been the accepted one since it works as expected. Just citing the answer by Michael G above.
var version = GetType().Assembly.GetName().Version.ToString();
works fine. It gets the Package version set in the Package tab of project properties.
As an addition, if we need to get the Description we set in the same tab, this code would work. (core 3.1)
string desc = GetType().Assembly.GetCustomAttribute<AssemblyDescriptionAttribute>().Description;
Just in case someone needs this.
Happy coding !!!

Unable to run Application Module Tester in Jdev 12c

Using MySQL DB, I made some EO and VO's in Jdev 12c - 12.2.1.0.0.
When I right click on AM and run, then it shows the following error
oracle.jbo.jbotester.app.ErrorHandler$ExceptionWrapper: JBO-29000: Unexpected exception caught: oracle.jbo.DMLException, msg=JBO-26061: Error while opening JDBC connection.
at oracle.jbo.jbotester.app.ErrorHandler.displayError(ErrorHandler.java:108)
at oracle.jbo.jbotester.app.ErrorHandler.displayError(ErrorHandler.java:94)
at oracle.jbo.jbotester.app.IErrorHandlerImpl.displayError(IErrorHandlerImpl.java:43)
at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:513)
Caused by: oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
at oracle.jbo.server.URLConnectionHelper.getConnection(URLConnectionHelper.java:218)
at oracle.jbo.server.URLConnectionHelper.getConnection(URLConnectionHelper.java:45)
at oracle.jbo.server.ConnectionPoolDataSource.getConnection(ConnectionPoolDataSource.java:75)
at oracle.jbo.server.DBTransactionImpl.establishNewConnection(DBTransactionImpl.java:999)
at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1184)
at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:7115)
at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:297)
at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:328)
at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:203)
at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:643)
at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:439)
at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:9909)
at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4538)
at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2453)
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2263)
at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3162)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:604)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:537)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:532)
at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:644)
at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:1017)
at oracle.jbo.jbotester.binding.TesterBinding.getConnectionInfo(TesterBinding.java:100)
at oracle.jbo.jbotester.MainFrame.initializeDataControl(MainFrame.java:1054)
at oracle.jbo.jbotester.MainFrame.loadConfiguration(MainFrame.java:697)
at oracle.jbo.jbotester.MainFrame.processArgs(MainFrame.java:674)
at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:501)
## Detail 0 ##
oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
at oracle.jbo.server.URLConnectionHelper.getConnection(URLConnectionHelper.java:218)
at oracle.jbo.server.URLConnectionHelper.getConnection(URLConnectionHelper.java:45)
at oracle.jbo.server.ConnectionPoolDataSource.getConnection(ConnectionPoolDataSource.java:75)
at oracle.jbo.server.DBTransactionImpl.establishNewConnection(DBTransactionImpl.java:999)
at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1184)
at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:7115)
at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:297)
at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:328)
at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:203)
at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:643)
at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:439)
at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:9909)
at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4538)
at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2453)
at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2263)
at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3162)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:604)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:537)
at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:532)
at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:644)
at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:1017)
at oracle.jbo.jbotester.binding.TesterBinding.getConnectionInfo(TesterBinding.java:100)
at oracle.jbo.jbotester.MainFrame.initializeDataControl(MainFrame.java:1054)
at oracle.jbo.jbotester.MainFrame.loadConfiguration(MainFrame.java:697)
at oracle.jbo.jbotester.MainFrame.processArgs(MainFrame.java:674)
at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:501)
The same runs fine in Jdev 11g.
A similar question was there in Oracle ADF community but it is not answered
Did you test your database connection before running the AppModule?

Play Slick config

I'm trying to get started with play and slick.
Strategy; take hello-slick-3.1 project from the activator tutorials.
If works fine with the H2 in memory database. I want to connect to a sql server. After a battle I have some configuration which appear to connect using jdts.
In application .conf
driver=net.sourceforge.jtds.jdbc.Driver
url="jdbc:jtds:sqlserver://%%%%:1433;databaseName=%%%%;user=%%%;password=%%%%%"
This is using the jtds driver instead of
com.typesafe.slick.driver.ms.SQLServerDriver
Which appears to have been made deliberately difficult to use. I have not found a sucessful config with it. JTDS manages to create the 'suppliers' table based on it's schema, but all subsequent requests fall over with a nebulous 'data truncation' message;
object HelloSlick extends App {
val db = Database.forConfig("sqlServerLocal")
try {
// The query interface for the Suppliers table
val suppliers: TableQuery[Suppliers] = TableQuery[Suppliers]
val setupAction: DBIO[Unit] = DBIO.seq(
// Create the schema by combining the DDLs for the Suppliers and Coffees
// tables using the query interfaces
//(suppliers.schema).create,
// Insert some suppliers
suppliers += (101, "Acme, Inc.", "99 Market Street", "Groundsville", "CA", "95199"),
suppliers += ( 49, "Superior Coffee", "1 Party Place", "Mendocino", "CA", "95460"),
suppliers += (150, "The High Ground", "100 Coffee Lane", "Meadows", "CA", "93966")
)
Telling me that
background log: info: 10:58:48.465 [sqlServerLocal-1] DEBUG slick.jdbc.JdbcBackend.statement - Preparing statement: insert into "SUPPLIERS" ("SUP_ID","SUP_NAME","STREET","CITY","STATE","ZIP") values (?,?,?,?,?,?)
background log: error: Exception in thread "main" java.sql.DataTruncation: Data truncation
Does anyone have any ideas? Is connecting to SQL server with slick - 3.1 even a sensible thing to attempt?
EDIT::
#szeiger makes the excellent point that I'm importing the wrong thing into the model classes. I had the old H2 driver import from the Hello Slick example, which should be replaced with this;
import com.typesafe.slick.driver.ms.SQLServerDriver.api._
In order to work as a SQL server language.
After making this change, the DB configuration which 'did something' no longer works, advertising this
background log: info: Running HelloSlick
background log: error: Exception in thread "main" java.lang.NoClassDefFoundError: slick/profile/BasicProfile$SimpleQL
I've tried altering the instantiation of the actual db variable to match the 'recommended' strategy suggested by szeiger.
val db = Database.forURL("jdbc:sqlserver://%%%:1433;user=%%%%;password=%%%%", driver="com.typesafe.slick.driver.ms.SQLServerDriver",
executor = AsyncExecutor("test1", numThreads=10, queueSize=1000))
Unfortunately, this fails like so;
background log: error: Exception in thread "main" java.lang.NoClassDefFoundError: slick/profile/BasicProfile$Implicits
with the jtds driver, it has the same error message with the slick MSSQL driver, and despite my best efforts, I cannot instantiate the MS JDBC driver. It's in a folder called 'lib' in the application , although I suspected that might be naive and the wrong place.
Managing this dependency through play-slick would be excellent. I had thought that I would be doing that via the inclusion of this line in SBT;
"com.typesafe.play" %% "play-slick" % "1.1.0",
but appears to have no effect in isolation, and I'm unsure how to configure this to reach the 'official' slick MS SQL driver.
EDIT 2:: Finally, this appears to build what I want.
name := """hello-slick-3.1"""
lazy val root = (project in file(".")).enablePlugins(PlayScala)
resolvers += "Typesafe Releases" at "http://repo.typesafe.com/typesafe/maven-releases/"
resolvers += "Scalaz Bintray Repo" at "https://dl.bintray.com/scalaz/releases"
resolvers += Resolver.url("Typesafe Ivy releases", url("https://repo.typesafe.com/typesafe/ivy-releases"))(Resolver.ivyStylePatterns)
scalaVersion := "2.11.6"
libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % "3.1.0",
"com.typesafe.slick" %% "slick-extensions" % "3.1.0",
"com.typesafe.play" %% "play-slick" % "1.1.0",
"org.scalatest" %% "scalatest" % "2.2.4" % "test"
)
I had lots of problems because I forgot to include the correct resolvers.
Don't forget to include the correct resolvers :-).
You're confusing Slick drivers and JDBC drivers. Which Slick driver are you using? The imports are missing from your snippet but there should be something like import com.typesafe.slick.driver.ms.SQLServerDriver.api._. Using a wrong driver here could explain String columns being created as VARCHAR(1).
The recommended way of configuring database connections in Slick 3.1 is via DatabaseConfig, which allows you to configure the Slick driver together with the actual connection parameters. When you're writing a Play app, use the play-slick plugin instead to handle database connections. It is also based on the DatabaseConfig syntax.
The alternative to net.sourceforge.jtds.jdbc.Driver would be Microsoft's own JDBC driver, com.microsoft.sqlserver.jdbc.SQLServerDriver which is available as a separate download from Microsoft. You have to manually add sqljdbc4.jar to your build to make this work.
BTW, Slick 3.2 will change terminology and use the word "driver" exclusively for JDBC drivers. Slick drivers will be called "profiles" in 3.2.
After bonus pain, it looks like slick creates columns in SQL Server as type 'varchar(1)'.
Which can't hold very much data.
Not using Slick to create the tables, and commenting out these lines then means that the intro works as advertised.

How to use MDS customization to add JSTL functions tag library?

I added the JSTL functions tag library into the folderViewer.jsff view in the WebCenter Portal 11.1.1.6.0 folderViewer taskflow (oracle.webcenter.doclib.view.jsf.taskflows.folderViewer), so that I can perform string operations prior to rendering the view.
I added it using the following mds:modify block in the folderViewer.jsff.xml MDS customization file:
<mds:modify element="(xmlns(jsp=http://java.sun.com/JSP/Page))/jsp:root">
<mds:attribute name="version" value="2.1"/>
<mds:attribute name="xmlns:fn" value="http://java.sun.com/jsp/jstl/functions"/>
</mds:modify>
This allows me to use the JSTL functions in EL statements, such as: startFolderPath=#{fn:replace(fn:substringAfter(item.url,'path'),'%20','%2520')}.
However, there seems to be an unintended side-effect of this in the folderViewer task flow. When there are over 50 subfolders in a folder, scrolling past the 50th subfolder and trying to navigate to one of the subfolders (i.e. navigating to subfolder #51) results in a WebCenter error page being displayed and the following error in the logs:
<Oct 28, 2013 3:10:54 PM CDT> <Error> <oracle.webcenter.webcenterapp.internal.view.webapp> <BEA-000000> <
oracle.mds.exception.MDSRuntimeException: invalid namespace http://java.sun.com/JSP/Page for prefix xmlns
invalid namespace http://java.sun.com/JSP/Page for prefix xmlns
at oracle.mds.core.MOTxnState.getDocument(MOTxnState.java:266)
at oracle.mds.core.UpdateableMOContent.getDocument(UpdateableMOContent.java:561)
at oracle.mds.core.MetadataObject.getDocument(MetadataObject.java:449)
at oracle.mds.core.MetadataObject.getDocument(MetadataObject.java:396)
...
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
>
<Oct 28, 2013 3:10:54 PM CDT> <Error> <oracle.webcenter.webcenterapp> <BEA-000000> <Internal Error (WCS#2013.10.28.15.10.54)>
If I remove the MDS customization to folderViewer.jsff.xml that adds the JSTL Functions tag library, this issue does not exist.
Does anyone know of a different way to add a new tag library via MDS customization?
Thanks,
Joe
It seems like its trying to give prefix xmlns instead of JSP
I'm just wonder if you changed the above code to the following, what will happen
<mds:modify element="jsp:root">
<mds:attribute name="version" value="2.1"/>
<mds:attribute name="xmlns:jsp" value="http://java.sun.com/JSP/Page"/>
<mds:attribute name="xmlns:fn" value="http://java.sun.com/jsp/jstl/functions"/>
</mds:modify>

Silverlight crashes FireFox 3.5, IE7, & IE8

One of my users has an HP Pavilion DV4-1430us laptop running Windows Vista Professional 64-bit. She is using the latest version of the Silverlight Plug-In, downloaded on 24 July from microsoft.com/silverlight.
While typing in a text box in a silverlight web application my company developed, all three browsers will occasionally crash. Nine times out of ten, she can go back to the page where the crash occurred and pick up from where she left off, only to have it crash again several minutes later.
This only occurs while she is typing in a text box, and it only occurs on her laptop. I have watched her to confirm there is no user error.
Any thoughts?
Edit 1: I replicated the error. In Firefox 3.5, the window in which I was working closed with no warning, and the Mozilla Crash Reporter popped up. I'm pasting the crash report code:
Add-ons: {20a82645-c095-46ed-80e3-08825760534b}:1.1,{972ce4c6-7e08-4474-a285-3208198ce6fd}:3.5.1
BuildID: 20090715094852
CrashTime: 1248713784
InstallTime: 1248455260
ProductName: Firefox
SecondsSinceLastCrash: 245055
StartupTime: 1248713511
Theme: classic/1.0
Throttleable: 1
URL: [redacted]
Vendor: Mozilla
Version: 3.5.1
Edit 2: I replicated the error in IE8. I highlighted the text in a text box and began to type. Instantly,
Internet Explorer has stopped working
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
appeared.
Here is the event log entry:
>Log Name: Application
>Source: Application Error
>Date: 7/27/2009 1:06:10 PM
>Event ID: 1000
>Task Category: (100)
>Level: Error
>Keywords: Classic
>User: N/A
>Computer: [computer name]
>Description:
>Faulting application iexplore.exe, version 8.0.6001.18702, time stamp 0x49b3ad2e, faulting module kernel32.dll, version 6.0.6000.16820, time stamp 0x4995210a, exception code 0xe0434352, fault offset 0x0001e05c, process id 0x1a54, application start time 0x01ca0edc4c7c0054.
>Event Xml:
><Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
> <System>
> <Provider Name="Application Error" />
> <EventID Qualifiers="0">1000</EventID>
> <Level>2</Level>
> <Task>100</Task>
> <Keywords>0x80000000000000</Keywords>
> <TimeCreated SystemTime="2009-07-27T17:06:10.000Z" />
> <EventRecordID>2636</EventRecordID>
> <Channel>Application</Channel>
> <Computer>[computer name]</Computer>
> <Security />
> </System>
> <EventData>
> <Data>iexplore.exe</Data>
> <Data>8.0.6001.18702</Data>
> <Data>49b3ad2e</Data>
> <Data>kernel32.dll</Data>
> <Data>6.0.6000.16820</Data>
> <Data>4995210a</Data>
> <Data>e0434352</Data>
> <Data>0001e05c</Data>
> <Data>1a54</Data>
> <Data>01ca0edc4c7c0054</Data>
> </EventData>
></Event>
The web app was written for Silverlight 2, and was trying to call System.ComponentModel.dll. The user was using the Silverlight 3 runtime, which does not include System.ComponentModel.
Solution: Downgrade user to Silverlight 2 until webapp can be rewritten for Silverlight 3.
Try disabling and re-enabling the Pen Tablet Service. It seems that Silverlight needs to access WispTis.exe or Wacomservice file for it to work properly. You can check to see if it is enabled by going to Control Panel > Administrative Tools > Services > Tablet PC Input Service. Make sure the service is started and set to automatic.
You should look at FireFox's bugzilla for issues in firefox. You'll get a lot better idea of what todo. If you look, you will see quite a number of simular faults.

Resources