Dynamic import
I want to include packages or classes at runtime of the java.
For example,
i am unsing Date class means i dont give
import java.util.Date;
instead with in the class i need to import. How can i?
- Muralidharan
IIRC the import statement really just helps javac resolve the namespace.
It doesn't actually add anything extra into your compiled class.
But anyway it sounds as if perhaps what you're looking for is reflection.
There are tutorials on this site about that. Search for "reflection" or check the tutorials link on your left.
Reflection is a powerful tool but it can also be abused. My advice is to use it when you really need it, but be sure to confirm that you really need it and you can't get the effect you're looking for by improving your design.
Similar Messages
-
Hi,
we need to dynamically import images to use them in smartforms. The images are stored on a file server (DMS) so we tried to use BAPI_DOCUMENT_CHECKOUTVIEWX to get the file from DMS and then use IMPORT_BITMAPS_DBS (to do what SE78 does) but this does not work. We realised that the file was not being transfered by the BAPI and that IMPORT only works with local files, so when we are printing (background), it does not work. Does anyone know of a way to import images as GRAPHICS as SE78 does but from a DMS server and in background mode.
TIAhi,
can you please elaborate your answer, i could not understand it completely.
Thanks,
Hasan -
Hi All,
Please help me how to do dynamic import file path since we have multiple environment where our reports will be migrated.
ThanksHi,
the link is helpful but it still throws an error from my end . . .
I set the xdo.cfg to
<config version="1.0.0" xmlns="http://xmlns.oracle.com/oxp/config/">
<properties>
<property name="xslt.FILE_LOCATION">D:\OraHome_1\xmlp\XMLP\Reports\Reports</property>
</properties>
</config>
and my import file is
<?import:file://${FILE_LOCATION}/Global_Logo/Global_Logo.rtf?>
<?import:file://${FILE_LOCATION}/Highlights/Highlights.rtf?>
<?import:file://${FILE_LOCATION}/Benefit/Benefit.rtf?>
in my main template it calls 3 sub templates . . .
even I put a single quote in the 'D:\OraHome_1\xmlp\XMLP\Reports\Reports' in the xdo.cfg, I still get the error
at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
at RTF2PDF.runRTFto(RTF2PDF.java:629)
at RTF2PDF.runXDO(RTF2PDF.java:439)
at RTF2PDF.main(RTF2PDF.java:289)
Caused by: java.net.UnknownHostException: ${FILE_LOCATION}
at oracle.xdo.parser.v2.XSLProcessor.reportException(XSLProcessor.java:806)
at oracle.xdo.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:571)
... 14 more
Thanks, -
Can I dynamically import pdf into swf?
Hi All,
I need to be able to dynamically import an external pdf file into my flash .swf and display it within a movie clip on the timeline. --with pagination. Is this possible with Flash CS4?
Thank you for reading. I have been out of the flash game for about a year now. However, a situation has arisen where I need to create a swf movie that loads an external pdf, paginates it, and displays it within a movie clip in the swf. Is this possible or will I be forced to only provide a hyperlink to the pdf?
Thank you so much for your time.
PeteYou should be able to use getURL("pdflocationhere.pdf"); - but I believe thats totally dependent on how the users computer is set up. If they don't have Adobe Reader, it will probably fail, or will attempt to load the pdf within a modern browser that should have the reader plug-in. From my experience, when using getURL() within a projector, it will attempt to open the filetype based on that specific filetype's default opening program which is set in the OS.
-
Is it possible in BPEL to dynamically import an xsd? If i have a string containing the location (locally) of that xsd or a url passed in as a variable, can I then import this schema and define a variable of that schema type?
Thanks for your help.private static Document loadXSD(String xsdFileID) throws SAXException, IOException {
String documentName = "com/...youpackage..../"+xsdFileName+".xsd";
Class c=null;
try{
c = Class.forName("load your class");
}catch(Exception e){
System.out.println(e.getMessage());
InputStream instream = c.getClassLoader().getResourceAsStream(documentName);
InputSource inputsrc = new InputSource(instream);
DOMParser xParser = new DOMParser();
xParser.parse(inputsrc);
Document xDoc = xParser.getDocument();
return xDoc;
} -
Dynamically Importing Hierarchies from R3 to BW
Hi All,
In continuation to my earlier question today, I have read almost all the material available on Hierarchies now, but it specifies that I have to use a FLAT FILE in any case to load a Hierarchy from R3.
Well, If I get a view or table or custom costcenter manager hierarchy ready in R3 then how can I import it into BW dynamically without using a flat file. As maintaining it on daily basis will be difficult.
As test I have a Z* object with hierarchy enabled in BW,
I want to replicate the existing hierarchy from R3 into this one.How to do this with out Flat File or manually selecting the nodes.
Please suggest any inputs on this will be valuable.
Thanks
SarahHi.
Please check the following notes which contain a rich information about this kind of error:
1026749 Hierarchies: Consistency check for duplicate nodes
1007842 RH 211 when you load hierarchy with no char value specified
Thanks,
Walter Oliveira. -
Dynamic import of metadata in owb?
hello,
I have to create a data warehouse in an Oracle database 11gR1, the production system is based on Oracle 9.2.0.1, to capture data changes I have to use synchronous cdc because the asynchronous mode requires at least version 9.2.0.6
in synchronous mode I must generate views each time I want to capture the changes but in owb 11gR1 I can not import views in dynamic mode
what can you suggest to me in this case?
thank you
tarekThat's unfortunate.
You'll probably have to write some PL/SQL that does one of two things. First, you could us a synonym to pull the view into OWB. You'll have to use some PL/SQL that drops and recreates the synonym every time you extend the window, to have the synonym point to the new name of the change view. You could do the same thing with a view if you are more comfortable with using a view. One of the parameters passed to the procedure would be the dynamic change view.
The other thing you could do is have a PL/SQL procedure that selects all the rows out of the change view and inserts them to a regular staging table. Similar to the procedure above, you could pass the dynamic name of the change view but the staging table would always be constant. That way it could be brought into OWB and used successfully.
Stewart Bryson -
Dynamically importing a .mov file into flash
Hi,
I need to import a .mov file into a flash file and create a
.swf movie. I can do it through File > Import Movies option. But
I want to make it dynamic and import the movie. I would like to use
ActionScripts rather than the File> Import options. Pls let me
know if this is possible. Let me know if you have any questions.
Appreciate any help.
Thanks & Regards,
MageshYou can only dynamically load at runtime FLV movies.
You can automate the authoring time environment but this is
only with the Authoring tool. See
Extending
Flash -
Dynamically importing packages
hello everybody!!!
can someone please tell me if there's another way to import packages, in execution time??
I mean , if i want to select which packages to import in the application and not to add a lot of imports.....
I mean, doesn't it slow an application to have like 20 packages imported????Import statements don't actually include theclasses
unless they're used in your code. It doesn't "include"anything, regardless ofwhether
it's used or not.What I meant was classes the aren't used in the code
aren't involved in the compilation process. I used
layman's terms for the OP's benefit. Just because you
import it, it won't stick it into your code, either
at compilation or runtime, which the OP seemed to
think.Okay. It sounded like you were saying that in some circumstances, importing could cause a class to be "loaded" or "included" when it wouldn't otherwise be. My misunderstanding. -
Dynamically import .m file into Matlab Script
I would like to dynamically load a Matlab .m file into the Matlab Script function in a VI.
In other words, based upon a path to a .m file (control on the FP), load the .m file into the Matlab Script and then execute it.
Does anyone know how to do this?
Solved!
Go to Solution.Hi RedSoxFanatic,
It's not possible to do what you're asking. However, I can think of a couple options that will give you the same behavior.
1. If you only have a few of your .m files that will be called you can use a case structure with these files already loaded. The user can then choose which case to run.
2. You can have the Matlab Script Node run you particular .m file based on an input (number maybe), but this does also require you to have a predefined list of your .m files.
Justin D.
Justin D.
Applications Engineer
National Instruments -
How to dynamically import data
Hi everyone,
I am trying to make a livecycle demo the stuff goes like this.
1.I have data on the server.
2.I open a form (created with livecycle designer).
3.When the form is loaded I want to
3.1 retrieve an xml from the server and apply it over my form, thus filling the fields with the data.
OR
3.2. retrieve a local xml and load it into the form.
Using the loadXML method I can write the data from the XML into the fields,but how can I get that string from a server (through a URL)?You can put a button on your form with this code on the click event:
xfa.host.importData();
When the button is clicked a file dialog wil come up and allow you to chose the xml file you want to import.
Paul -
Dynamically Importing and Exporting Video in Adobe Air
Hi all,
I am currently working on a project where I want the users to be able to download an application that allows them to be able to upload a video of them playing an instrument, and that also enables them to be able to create sheet music for the music they are playing in the video, and then the application will synchronise the two together and the sheet music will be scrolled across the bottom of the screen in synchronisation with the video that is being played. I then want the application to allow the user to be able to export the new synchronised video out as a video so that they can than upload it onto a website that can be viewed by others. I was just wondering if this would be possible in Adobe Air, or if anyone knows of another piece of software that would be better suited to this. Also if it is possible in adobe air are there any resources that I could turn to that would help me out.
Much thanks,
timmie_designHere is a software and device comparison chart with prices http://vhs-to-dvd-converters-review.toptenreviews.com/
-
Dynamic 3d-Party DS Import for Oracle in Java-App
Hi,
i'm currently trying to implement some sort of dynamic import-functionality from within a java-webapplication. The User should be able to select different datasources (MS Access, Excel, CSV, MS SQL-Server) from a browser-interface and then have them imported into one consolidated Server (on a regular/monthly baisis). Obviously it would be of great help if one could use the functionality offered by the Oracle-Server from within the java-application to support this process. I am currently exploring the Oracle-"Landscape" for a proper solution/concept for this matter and would be very greatful for some help or a slight push in the right direction.
Desired functionality:
- Build up Connections to Datasources on the filesystem (MS Access, MS Excel, CSV) (dynamically selectable from within the application)
- Import the Data into a Oracle-Server, whilst taking into account the different dialects and constrains etc.
What i found so far:
SQL Loader:
Not a valid option since the user would have to convert all databases into flatfiles before every import session.
Oracle Data Pump:
This one offers a complete Java-API, which is great, but i am not sure how i could use it to import Data from a 3d party datasource (is this possible?).
Oracle Generic Connectivity:
Allows the usage of excel or access databases from within oracle as if they were oracle tables(?). One big benefit would be the abstraction from the different dialects. Question is how to setup the connection from within the java-code (manipulate the initsid-files and probably setup the ole-db or odbc connections). I guess there is no java-API for some parts of this functionality?
Oracle SQL Developer Migration Workbench:
This tool actually comes quite close to the desired Import-functionality (which is why i choose this forum for my post). Would it be possible to access some of the functionality this tool offers from within a java-application, to automate the import on a regular basis as described?
Are there any other good options? Possibly even with a java-API?
Thank you very much in advance!Hi,
i'm currently trying to implement some sort of dynamic import-functionality from within a java-webapplication. The User should be able to select different datasources (MS Access, Excel, CSV, MS SQL-Server) from a browser-interface and then have them imported into one consolidated Server (on a regular/monthly baisis). Obviously it would be of great help if one could use the functionality offered by the Oracle-Server from within the java-application to support this process. I am currently exploring the Oracle-"Landscape" for a proper solution/concept for this matter and would be very greatful for some help or a slight push in the right direction.
Desired functionality:
- Build up Connections to Datasources on the filesystem (MS Access, MS Excel, CSV) (dynamically selectable from within the application)
- Import the Data into a Oracle-Server, whilst taking into account the different dialects and constrains etc.
What i found so far:
SQL Loader:
Not a valid option since the user would have to convert all databases into flatfiles before every import session.
Oracle Data Pump:
This one offers a complete Java-API, which is great, but i am not sure how i could use it to import Data from a 3d party datasource (is this possible?).
Oracle Generic Connectivity:
Allows the usage of excel or access databases from within oracle as if they were oracle tables(?). One big benefit would be the abstraction from the different dialects. Question is how to setup the connection from within the java-code (manipulate the initsid-files and probably setup the ole-db or odbc connections). I guess there is no java-API for some parts of this functionality?
Oracle SQL Developer Migration Workbench:
This tool actually comes quite close to the desired Import-functionality (which is why i choose this forum for my post). Would it be possible to access some of the functionality this tool offers from within a java-application, to automate the import on a regular basis as described?
Are there any other good options? Possibly even with a java-API?
Thank you very much in advance! -
I have been trying to import an .aep file into Premiere Pro CC from After Effects CC. As suggested, I import the file. The dynamic import window appears. It states connected to file along with the import files ... dialogue box. It stalls there.
I have been working off my network and have all the files collected on my machine.
My workaround to get me to deadline was to render my clips from AE and import them. Importing the .aep would make more sense from efficiency and workflow.
Thank youThank You, Jim -
Unfortunately that specifically did not work.
Based on another comment sent to me, here is what did.
In PProCC
File > Adobe Dynamic Link > New After Effects Composition
In AECC
From that composition created from PPro, I imported the project (aep) initially created in AECC from another team member. Saved the file.
Back in PProCC
File > Adobe Dynamic Link > Import After Effects Composition
Magic. -
Dynamically updating JList.
This is my code snippet for showing images as a preview in scrollpane.
In ListTableModel, u can get the Jlist and scrollpane of the JList.
setFileStats method is used to set those data (images) into the JList after making imageicon from the filepath which is available in ImageName vector. It is showing all the images in preview mode at a time after setting everything in jList, but i want to show the every images loading in JList dynamically.
import javax.swing.*;
import java.awt.*;
import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.util.Vector;
public class ListTableModel extends AbstractListModel {
public Vector data = new Vector();
public JList localList;
public JScrollPane tempPane;
public ListTableModel(JList initList, JScrollPane argPane) {
localList = initList; //Here i am pasing the list and scrollpane.
tempPane = argPane;
initList.setCellRenderer(new IVMListCellRenderer());
public Object getElementAt(int index) {
return (data.get(index));
public int getSize() {
return data.size();
public void addListDataListener(ListDataListener ldl) {
// since the list never changes, we don't need this :-)
public void removeListDataListener(ListDataListener ldl) {
// since the list never changes, we don't need this :-)
public void setFileStats(Vector imageNames) {
//data = new Object [imageNames.size()];
data = new Vector();
for ( int i = 0; i < imageNames.size(); i++ ) {
ImageIcon newScaled = new ImageIcon((String)imageNames.get(i));
newScaled.setDescription((String)imageNames.get(i));
data.add(newScaled);
localList.setListData(data);
fireIntervalAdded(data, 0, i);
fireContentsChanged(data, 0 , getSize());
localList.revalidate();
tempPane.revalidate();
localList.ensureIndexIsVisible(i);
class IVMListCellRenderer extends DefaultListCellRenderer {
public IVMListCellRenderer()
setOpaque(true);
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
ImageIcon tempValue = (ImageIcon)value;
setIcon(tempValue);
int lastPosition = tempValue.getDescription().lastIndexOf("/");
String sizeOfStR = tempValue.getDescription().substring(lastPosition + 1);
setText(sizeOfStR);
return this;
}This is my code snippet for showing images as a preview in scrollpane.
In ListTableModel, u can get the Jlist and scrollpane of the JList.
setFileStats method is used to set those data (images) into the JList after making imageicon from the filepath which is available in ImageName vector. It is showing all the images in preview mode at a time after setting everything in jList, but i want to show the every images loading in JList dynamically.
import javax.swing.*;
import java.awt.*;
import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.util.Vector;
public class ListTableModel extends AbstractListModel {
public Vector data = new Vector();
public JList localList;
public JScrollPane tempPane;
public ListTableModel(JList initList, JScrollPane argPane) {
localList = initList; //Here i am pasing the list and scrollpane.
tempPane = argPane;
initList.setCellRenderer(new IVMListCellRenderer());
public Object getElementAt(int index) {
return (data.get(index));
public int getSize() {
return data.size();
public void addListDataListener(ListDataListener ldl) {
// since the list never changes, we don't need this :-)
public void removeListDataListener(ListDataListener ldl) {
// since the list never changes, we don't need this :-)
public void setFileStats(Vector imageNames) {
//data = new Object [imageNames.size()];
data = new Vector();
for ( int i = 0; i < imageNames.size(); i++ ) {
ImageIcon newScaled = new ImageIcon((String)imageNames.get(i));
newScaled.setDescription((String)imageNames.get(i));
data.add(newScaled);
localList.setListData(data);
fireIntervalAdded(data, 0, i);
fireContentsChanged(data, 0 , getSize());
localList.revalidate();
tempPane.revalidate();
localList.ensureIndexIsVisible(i);
class IVMListCellRenderer extends DefaultListCellRenderer {
public IVMListCellRenderer()
setOpaque(true);
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
ImageIcon tempValue = (ImageIcon)value;
setIcon(tempValue);
int lastPosition = tempValue.getDescription().lastIndexOf("/");
String sizeOfStR = tempValue.getDescription().substring(lastPosition + 1);
setText(sizeOfStR);
return this;
}
Maybe you are looking for
-
MSE not showing 7921 phone on WCS map
Hi, We just installed MSE with CAS (7.0.201.204 software) and everything works fine and clients are shown on WCS floor maps except for Cisco 7921 wireless phones which dont appear in the WCS map. Has anybody come across this issue ? Any tips on tr
-
Upgrade question for iPhone 5 on Dumb Phone line
My current situation is (I am the authorized owner for all these 5 lines): Line 1 - smart phone with unlimited data -> eligible for upgrade Line 2 - smart phone with unlimited data -> eligible for upgrade Line 3 - dumb phones -> not eligible for upgr
-
I'm having a problem getting DPM configured to co-locate tapes the way I want. I have 6 protection groups, 3 configured for one Co-Located Protection Group Set, and 3 for another. I have a tape library with 2 drives (Dell TL2000). The problem I am ex
-
Different document types in PR?
What is the use of defining the different document types in PR? Can anybody expain the advantages of it? Regards, Kapil Joshi
-
Hi I used to have an app called Front Row, which seems to have disappeared, it enabled me to look at photos, movies and trailers. I have recently updated to Lion and not sure if the app disappeared at this point but, but I don't seem to be able to ge