Showing posts with label XML. Show all posts
Showing posts with label XML. Show all posts

January 04, 2022

Top 20 Apache Ant Interview Questions and Answers

 

                        According to James Duncan Davidson, the ANT stands for "Another Neat Tool." Ants are tiny, but they can carry a lot of weight. As with the Apache ant's job. Apache Ant is a command-line program and Java library for automating software construction processes. In the early 2000s, it arose from the Apache Tomcat project. It was built as a replacement for Unix's Make build tool due to a number of issues with Unix's make. It is responsible for driving the processes or instructions provided in build files as targets and extension points that are interdependent. Ant's most well-known application is the creation of Java applications. Ant comes with a number of built-in jobs for compiling, assembling, testing, and running Java programs.

                        Ant can also be used to create non-Java applications, such as those written in C or C++. Ant can be used to pilot any process that can be specified in terms of targets and tasks in general. For developers looking for Apache Ant Interview questions and answers, we've compiled a list of possible Apache Ant Interview questions and answers.

Apache Tomcat Interview Questions and Answers

Ques: 1): What does the acronym ANT stand for?

Answer:

The ant, according to James Duncan Davidson, is an acronym for "Another Neat Tool." Ants are little but strong. The Apache ant's job is similar. For automating software build processes, Apache Ant is a Java library and command-line programme. It was developed in the early 2000s as part of the Apache Tomcat project. It was developed to replace Unix's Make build tool, which had a number of flaws. It controls the processes or instructions provided as targets and extension points in build files.

Apache Kafka Interview Questions and Answers

Ques. 2): What Are The Ant Concepts?

Answer:

Ant is a build tool that is based on Java. The following are the functions of a build tool:

Open: Ant is an open source project available under the Apache license. Therefore, its source code can be downloaded and modified.

Additionally, Ant uses XML build files which make its development easy.

Cross Platform: Use of XML along with Java makes Ant makes it the perfect solution for developing programs designed to run or be built across a range of different operating systems.

Extensible: New tasks are used to extend the capabilities of the build process, while build listeners are used to help hook into the build process to add extra error tracking functionality.

Integration: As Ant is extensible and open, it can be integrated with any editor or development environment easily.

Apache Tapestry Interview Questions and Answers

Ques. 3): Why Is Ant A Fantastic Construction Tool?

Answer:

Ant is a fantastic build tool for the following reasons:

  • Ant is a cross-platform, user-friendly, extensible, and scalable Java-based build tool.
  • Ant can be utilised in a small personal project as well as a large, multi-team software development effort.
  • Ant syntax is simple to grasp.
  • The XML format was utilised in the Ant syntax.
  • We only need to provide our task in the build.xml file.
  • Ant is simple to use.
  • On large Make-based software projects, eliminating the full-time make file engineer is usual.

Apache Ambari interview Questions & Answers

Ques. 4):  Explain Ant Functionality?

Answer :

Ant is an open source project available under the Apache license. Therefore, its source code can be downloaded and modified.

Additionally, Ant uses XML build files which make its development easy.

Cross Platform: Use of XML along with Java makes Ant makes it the perfect solution for developing programs designed to run or be built across a range of different operating systems.

Extensible: New tasks are used to extend the capabilities of the build process, while build listeners are used to help hook into the build process to add extra error tracking functionality.

As Ant is extensible and open, it can be integrated with any editor or development environment easily.

Apache Hive Interview Questions & Answers

 Ques. 5):  How Do You Make An Ant User Interactive?

Answer:

org.apache.tools.ant.input is the correct answer.

The user input is implemented using the InputHandler interface. The programme creates an InputRequest object, which is sent to InputHandler to perform user input. If the user input is invalid, it will be denied.

handleInput is the only method on the InputHandler interface (InputRequest request). If the input is invalid, this function throws an org.apache.tools.ant.BuildException.

Apache Spark Interview Questions & Answers

Ques. 6):  Explain with the help of Ant and a small example?

Answer: Before we begin using ANT, we must be certain of the project name, the.java files, and, most crucially, the location of the.class files.

For example, we want to use the HelloWorld programme with ant. The Java source files should be placed in the Dirhelloworld subdirectory, and the.class files should be placed in the Helloworldclassfiles subdirectory.

1. The build file by name build.xml is to be written. The script is as follows

<project name=”HelloWorld” default=”compiler” basedir=”.”>

<target name=”compiler”>

<mkdir dir = “Helloworldclassfiles”>

<javac srcdir=”Dirhelloworld” destdir=”Helloworldclassfiles”>

</target>

</project>

2. Now run the ant script to perform the compilation:

C :\> ant

Buildfile: build.xml

and see the results in the extra files and directory created:

c:\>dir Dirhelloworld

c:\>dir Helloworldclassfiles

All the .java files are in Dirhelloworld directory and all the corresponding .class are in Helloworldclassfiles directory.

Apache NiFi Interview Questions & Answers

Ques. 7):  Explain How To Use Runtime In Ant?

Answer :

There is no need to use Runtime in ant. Because ant has Runtime counterpart by name ExecTask. ExecTask is in the package org.apache.tools.ant.taskdefs. The Task is created by using the code in the customized ant Task. The code snippet is as follows:

ExecTask execTask = (ExecTask)project.createTask (“exec”);

 

Ques. 8):  How to do conditional statement in ant?

There are many ways to solve the problem.

Since target if/unless all depend on some property is defined or not, you can use condition to define different NEW properties, which

in turn depends on your ant property values. This makes your ant script very flexible, but a little hard to read.

Ant-contrib has <if> <switch> tasks for you to use.

Ant-contrib also has <propertyregex> which can make very complicate decisions.

 

Ques. 9):  How many different ways are there to set properties in a Build Ant file?

Answer:

There are six different ways to set properties:

Both the name and value attributes must be provided.

/>src.dir/>src.dir/>src.dir/>src.dir/>src.dir/>src.dir/>src.dir/

Both the name and the refid property must be provided.

Setting the filename of the property file to load as the file attribute.

Setting the url property to the url from which the properties should be loaded.

Setting the resource attribute to the property file's resource name to load.

Setting a prefix for the environment attribute.

All of the above can be combined in our build files.

However, only one should be used at any given moment.

 

Ques. 10):  How Can We Make A Jar With Ant?

Answer:

To make a jar of classes, change the target to jar. This target requires the creation of a directory in which the jar will be kept. To finish the jar, we'll need a jar tag. We have passed two attributes in this tag: the first is the name of the destination directory, and the second is the name of the base directory, which contains all of our class files. To make a jar file, we'll need a manifest. We have two attributes in the manifest tag: the first is the name of the manifest file and the second is its value.

 

Ques. 11): What Exactly Is Ivy?

Answer:

Ivy is a well-known dependency manager. IVY is primarily concerned with adaptability and simplicity.

Ivy 2.1.0 is the most recent version.

The following are some of the highlights of the 2.1.0 release:

Ivy's main feature is improved Maven2 compatibility, which includes various bug fixes and more pom functionality.

several bug fixes and improvements as stated in Jira and the release notes additional options for the Ivy Ant jobs and commandline configuration intersections and configuration groups

 

Ques. 12): What method does ant use to read properties? How do I set up my property management system?

Answer:

Ant sets properties in a sequential order, thus once something is set, later properties with the same name cannot replace the prior ones. This is the polar opposite of the Java setters. This allows us to preset all properties in one location and just overwrite the ones that are needed. Let me give you an example. You need a password for a task but don't want to disclose it with anyone on your team, even outside engineers.

Store your password in your ${user.home}/prj.properties

pswd=yourrealpassword

In your include directory master prj.properties

pswd=password

In your build-common.xml read properties files in this order

The commandline will prevail, if you use it: ant -Dpswd=newpassword

${user.home}/prj.properties (personal)

yourprojectdir/prj.properties (project team wise)

your_master_include_directory/prj.properties (universal)

[code lang=”java”]<cvsnttask password="${pswd} … />[/code]

 

Ques. 13): How can I use ant to perform a command from the command line? How can I get the outcome of a perl script running?

Answer:

Use the exec ant task to solve the problem.

Don't forget that ant is a Java programme. That is why the ant is so useful, strong, and adaptable. You must consider Unix if you want ant to get unix commands and results. In MS-Windows, it's the same. Ant just assists you in automating the procedure.

 

Ques. 14): How to copy files without extention?

Answer:

If files are in the directory:

[code lang=”xml”]<include name="a,b,c"/>[/code]

If files are in the directory or subdirectories:

[code lang=”xml”]<include name="**/a,**/b,**/c"/>[/code]

If you want all files without extension are in the directory or subdirectories:

[code lang=”xml”]<exclude name="**/*.*"/>[/code]

 

Ques. 15): How can I troubleshoot my Ant script?

Answer:

There are a variety of options.

Do an echo on the areas where you are unsure. You'll quickly figure out what the issue is. Like the classic printf() function in C or the Java System. println()

In your javascript or custom ant task, use project.log("msg"). Run Ant with -verbose or -debug to learn more about what it's doing and where it's doing it. However, you may grow tired of it quickly because it provides you with too much information.

 

Ques. 16). Why did I get such warning in ant?

Answer:

compile:

[javac] Warning: commons-logging.properties modified in the future.

[javac] Warning: dao\\DAO.java modified in the future.

[javac] Warning: dao\\DBDao2.java modified in the future.

[javac] Warning: dao\\HibernateBase.java modified in the future.

Possible causes of the system time problem include:

You altered the system's clock.

I encountered the same issue before, when I checked out files from cvs to windows and transferred them to a unix machine, I received a large number of these warnings due to a system timing issue.

You'll have the same trouble transferring files from Australia, China, or India to the United States. True, I've done it before and encountered the issue.

 

Ques. 17): How can I dynamically add pieces to an existing path?

Answer:

Yes, this is conceivable. You must, however, create a custom ant job, obtain the path, add/modify it, and use it. What I'm doing is defining a path reference to lib.classpath, then using my own task to add/modify the lib.classpath.

 

Ques. 18): How can I reorganize my jar/war/ear/zip file's directory structure? Is it necessary for me to unarchive them first?

No, you are not required to unarchive them first. To put the files into your destination jar/ear/war files, you don't need to unzip them from the archive.

To extract files from an old archive to a separate directory in your new archive, utilise zipfileset in your jar/war/ear task.

You can also use zipfileset in your jar/war/ear operation to send files from a local directory to a new archive location.

See the follow example:

[code lang=”java”] <jar destfile="${dest}/my.jar">

<zipfileset src="old_archive.zip" includes="**/*.properties" prefix="dir_in_new_archive/prop"/>

<zipfileset dir="curr_dir/abc" prefix="new_dir_in_archive/xyz"/>

</jar>[/code]

 

Ques. 19): How to exclude multi directories in copy or delete task?

Answer:

Here is an example.

[code lang=”xml”]<copy todir="${to.dir}" >

<fileset dir="${from.dir}" >

<exclude name="dirname1" />

<exclude name="dirname2" />

<exclude name="abc/whatever/dirname3" />

<exclude name="**/dirname4" />

</fileset>

</copy>[/code]

  

Ques. 20): How do I get started to use ant? Can you give me a “Hello World” ant script?

Answer:

Download the most recent version of ant from Apache; unzip it somewhere on your machine.

Install j2sdk 1.4 or above.

Set JAVA_HOME and ANT_HOME to the directory your installed them respectively.

Put %JAVA_HOME%/bin;%ANT_HOME%/bin on your Path. Use ${JAVA_HOME}/bin:${ANT_HOME}/bin on UNIX. Yes, you can use forward slash on windows.

Write a “Hello world” build.xml

[code lang=”xml”]

<project name="hello" default="say.hello" basedir="." >

<property name="hello.msg" value="Hello, World!" />

<target name="say.hello" >

<echo>${hello.msg}</echo>

</target>

</project>[/code]

* Type ant in the directory your build.xml located.




February 10, 2021

Top 20 Oracle BI Publisher Interview Questions and Answers

 

 

Ques. 1): What is the main difference between BI publisher and XML publisher?

Answer: BI publisher can be installed as a standalone version running off of several OC4J compliant engines, such as Application Server and Tomcat. BI publisher can be pointed anywhere, so that reports can be run out of an OLTP or warehouse database, MSSQL and even within EBS. Licensing is already included in EBS, and the standalone costs whatever plus maintenance. XML Pub operates entirely within EBS and can only be used within EBS.


Oracle Fusion Applications interview Questions and Answers


Ques. 2): What is a data template in BI publisher?

Answer: Data template is an xml structure which have the queries to be run for a database so that output can be generated in xml format, this generated xml output is further applied on a layout template for the final required output.


Oracle Accounts Payables Interview Questions and Answers


Ques. 3): What is the default output format of the report in BI publisher?

Answer: The default output format defined during the layout template creation will be used to generate the output, the same can be modified during the request submission and it will overwrite the one defined at layout template.


Oracle ADF Interview Questions and Answers                                 


Ques. 4): What are the various sections in the data template?

Ans: The various sections in the data template in BI publisher are as:

  • Parameter section
  • Lexical Section
  • Trigger Section
  • SQL statement section
  • Data Structure section

Oracle Access Manager Interview Questions and Answers


Ques. 5): In BIP, how do you display the company logo in the report output?

Ans: In BIP, you can just copy and paste the logo (.gif, .jpg or any format) on the header section of .rtf file. Resize the log per the company standards.


Oracle Fusion HCM Interview Questions and Answers


Ques. 6): What is a layout template in BI publisher?

Answer: Layout template defines how the user views the output, basically it can be developed using Microsoft word document in rft (rich text format) or Adobe pdf format. The data output in xml format (from Data template) will be loaded in layout template at run time and the required final output file is generated.


Oracle SCM Interview Questions and Answers


Ques. 7): How do we create subtotals and Grand Total in BI Publisher?

Answer: If I have a report in OBIEE Answers with three columns –

Brand, Type and Revenue.

An OBIEE Report can be created as follows:

  • Create the BI Publisher Report
  • Login into bi publisher through word and open the BIP report
  • Insert the table wizard and Add the columns Brand, Type and Revenue
  • In the Group by – select Brand
  • click the radio button of Group left
  • click on finish.

Oracle Financials Interview questions and Answers


Ques. 8): In how many ways you can display images in a BI Publisher Report?

Answer:
 The images can be displayed in below 5 ways:

  •     Direct Insertion into RTF Template
  •     URL Reference
  •     OA_MEDIA directory reference
  •     Image from BLOB datatype from database
  •     Using UI Beans

Oracle Cloud Interview Questions and Answers


Ques. 9): How to submit a layout in the backend?

Answer: 
we must write a procedure for this using the below code

FND_REQUEST.ADD_LAYOUT (

 TEMPLATE_APPL_NAME     => 'application name',

TEMPLATE_CODE           => 'your template code',

TEMPLATE_LANGUAGE       => 'En',

TEMPLATE_TERRITORY      => 'US',

OUTPUT_FORMAT           => 'PDF'

);

Oracle PL/SQL Interview Questions and Answers


Ques. 10): What are the various XML publisher tables?

Answer:

  • PER_GB_XDO_TEMPLATES
  • XDO_DS_DEFINITIONS_B
  • XDO_DS_DEFINITIONS_TL
  • XDO_DS_DEFINITIONS_VL
  • XDO_LOBS
  • XDO_TEMPLATES_B
  • XDO_TEMPLATES_TL
  • XDO_TEMPLATES_VL
  • XDO_TEMPLATE_FIELDS
  • XDO_TRANS_UNITS
  • XDO_TRANS_UNIT_PROPS
  • XDO_TRANS_UNIT_VALUES

Oracle SQL Interview Questions and Answers


Ques. 11): How to get SYSDATE in the header section dynamically when we run the report?

Answer: You cannot insert form fields in the Header section, but you can just insert the code to achieve this. For example: insert this in the header section to view the sysdate: You could format the date as you would like.

<?xdofx: sysdate(‘YYYY-MM-DD’)?>

Oracle RDMS Interview Questions and Answers


Ques. 12): How do you create a BI Publisher report with two sub reports?

Answer: If I have a report in OBIEE Answers with these columns –

  • Year, Brand, Revenue
  • Region, District, Revenue

An OBIEE Report can be created as follows:

  • Create the BI Publisher Report
  • Login into bi publisher through word and open the BIP report
  • Insert the table wizard
  • Add the columns Year, Brand and Revenue
  • In the Group by select Year and Brand
  • click the radio button of Group left
  • click on finish.
  • delete the ones indicated in circles
  • create a table with 2 rows and 3 columns
  • Give the column headings in the first row
  • copy paste the following indicated by the arrow mark
  • apply the necessary formating and delete the first table
  • give the necessary aggregation as shown below
  • create the other sub report similarly
  • publish the template
  • view it in bi publisher
  • Thus, we can create sub reports in BI Publisher


Oracle 10g Interview Questions and Answers

 

Ques. 13): How to calculate the running total in XMLP?

Answer:

  • <?xdoxslt:set_variable($_XDOCTX, ‘RTotVar’, xdoxslt:get_variable($_XDOCTX, ‘RTotVar’) + ACCTD_AMT(This is column name) )?>
  • <?xdoxslt:get_variable($_XDOCTX, ‘RTotVar’)?>

 

Ques. 14): How to use Variables in XML publisher?

Answer: In XML publisher the declaration of variables can be done as:

Declaring the Variable R and Assigning the Values 4 to R


<?xdoxslt:set_variable($_XDOCTX, ‘R’, 4)?>

Get the Variable value
<?xdoxslt:get_variable($_XDOCTX, ‘R’)?>

This adds 5 to variable R and displays it
<?xdoxslt:set_variable($_XDOCTX, ‘R’, xdoxslt:get_variable($_XDOCTX, ‘R’)+5)?>

This subtracting 2 to varaible R and displays it

<?xdoxslt:set_variable($_XDOCTX, ‘R’, xdoxslt:get_variable($_XDOCTX, ‘R’)-2)?>