Sunday, 30 August 2015

Hybris Certification Questions 4

Hotelwatchdog
1. If you want to extend/create your own UI component for a cockpit the GUI web framework you have to use is:
ZK
Spring MVC
AJAX
JSP
2. Eachtime you implement a custom webservice resource in hybris to complete the build and deploy process you must
Run the ant webservice_nature task
Run the ant clean all task
Edit the relevant spring.xml file and run ant
Do nothing. New webservice resources are auto compiled and hot deployed
3. The hybris platform is configured to run against HSQL by default, which of the following is true?
HSQL is the recommended DB to use for production environments
Configuring HSQL to run in memory is a useful configuration for debugging transactions
HSQL is only recommended for development or test environments
Configuring HSQL is run in memory is the recommended way to guarantee good performance in clustered production environments.
4. When defining enum types for  use by hybris item type which of the following is true?
Enum types must be defined in java code before being reference by hybris generated item classes
Enum types can be defined by using the <enumtyype> tag in relevant –items.xml
Enum types can be defined inside the <itemtype> tag of the item type which needs to reference them
A default value can be set using the <defaultvalue> tag in relevant –tems.xml
5. When your extension has dependency on one of the platform extensions (like validation or catalog) you need to:
Use the requires tag in extensioninfo.xml file of your extension
Use the requires tag in local.properties  file of config project
Usually nothing, dependencies on platform are resolved by default
Use the importextension in your java code to import the extension you wish to import
6. In which case you must restart the hybris server for your changes to take effect
After initializing the system data for first time
After creating or updating cockpit configuration file
After adding a new spring bean to one of the spring configuration file
After editing any JSP files
7. In the development environment you wanted to configure a setting to specify a JDBC url the best place to put it would be
The extensioninfo.xml file of your extension
The project.properties file in platform bin directory
The localextensions.xml in configuration directory/Eclipse project
The local.properties in configuration directory/Eclipse project
8. Which of the following is true about the configuration setting in project.properties file in the server platform directory?
System configuration setting should not be added to this file, because the file will be overridden when you update the platform version
After any changes are made to this file a complete clean and rebuild should be performed using ant clean all
 Any setting in this file will be override any local propertied you set in your extensions or in the configuration folder/Eclipse project
Any local properties you set in your extensions or in the configuration folder/Eclipse project will override any properties in this file
9. When implementing dynamic attributes in hybris which of the following applies?
You can read and or write logic by implementing the DynamicAttributeHandler interface
You must define a custom type which is specifically enabled for dynamic attributes
You must specify  <persistence  type=”property” > in your –items.xml file
You don’t need to create any configuration information. Hybris uses the type interface to detect dynamic types
10. Which of the following are true about cronjobs in hybris platform?
A cronjob is a means for  performing business logic at particular times and intervals
Cronjobs are a thin wrapper around your OS’s cronjob mechanism
They can only use when hybris is running on Linux
You can use some existing useful cronjobs in platform or you can create own using java code

Hybris Certification Questions 3

Save over 78% off Hotel Deals and Get Expert-analyzed Hotel Deals based on Price, Location & Review Ratings at Hotelwatchdog!
-----------------------------------------------------------------------------------------------------------------------------------------------
1. After you have run Ant task from the command prompt you may see build errors in your eclipse project navigatior or explorer this is because:
Your ant script might have generated source files which are not yet loaded into eclipse. You need to refresh the eclipse project
When using ant and eclipse together, you need use the embedded version of eclipse otherwise you won’t be able to see files generated by ant in eclipse navigator.
You have errors in your project which are not shown in ant build because the ant build is not as complete as the eclipse build.
You should not build hybris projects from the command prompt.
2. When updating the running system in hybris, what should you do about handling incoming requests from the front end?
Nothing. Hybris will buffer and synchronize all requests  allowing the system to remain fully functional whilst data is updating
Temporarily  change the port settings in the local properties file so that incoming requests are prevented from disturbing the update process
Make sure that  you use maintenance extension or some other technique to redirect the requests to a maintenance page
The isUpdating() method in the http session should be implemented so that every request can be synchronized with updates
3. Which of the following statements is true regarding the use of inheritance in the hybris item type definition?
If you specify a deployment for your type, you will get one table which contains all of the attributes from your type and its ancestors
If you specify a deployment for your type, you will get one table which only contains all of the attributes defined on your type
You cannot specify a deployment, the hybris system definitions will always create a single table for the entire hierarchy
4. You cannot specify a deployment, the hybris system definitions will always create on What kind of data is cached in hybris cache?
Item instances
Spring bean instances
Results of flexible search queries
Dynamic attribute values
e table for the each item in the hierarchy
5. When defining relationships between itemtypes in an –items.xml file
The relation tag is used to specify sourceElement, targetElement and their conditions
The relation tag can be used to specify the relationship between two types defined in two different extensions
The generate attribute not specified because no table is generated for a relationship between two items
Relations are only defined in the java code. They are not a feature of object / Relational mapping

6. What might influence which data is returned in the result set of a flexible search query?
The session catalog version
Whether or not the specified database columns are indexed 
The contents of the flexible search cache
A personalization rule or search restriction created in the hMC
7. Examine the following piece of xml
<itemtype code=”MyProduct” autocreate=”true” generate=”true” extends=”Product”>
which statement below is/are true?
This defines a subtype of MyProduct
This defines a supertype of MyProduct
This is probably defined locally in –items.xml file of an extension
This is probably defined locally in local.properties file of a config folder
8. To configure a hybris instance to run your e-shop on different database which of the following are necessary steps?
Specifying the connection parameters like JDBC driver, username and password in the relevant configuration file
Create a DB for each tenant that you want in the new configuration Example junit
Checking the items .xml files in any extensions you have created to ensure that all of your item type definitions are compatible with the new DB
Initializing the system for example by using HAC
9. In the hybris platform, when you create a new extension, which of the following is true?
You must use the ant extgen task from the command prompt, because the embedded ant cannot create a new extension from within eclipse
If you use the  the ant extgen task from within eclipse, your new extension will automatically be loaded into the eclipse workspace as new project
Wherever you ruin the ant extgen task you will need to import the project file into eclipse using the “Import existing project” feature
Wherever you run the ant extgen task, new extension will automatically be loaded into the eclipse workspace as new project next time you restart eclipse 
10. When you define an item type in the –items.xml  in your extension which of the following is/are true?
You may add attributes to an item type which has already been defined in another  -items.xml file in another extension
You may specify the database table which is used to persist your item using the table attribute of the deployment tag <deployment table=”tablename”>
You may specify the database table which is used to persist your item using the table attribute of the databasetable tag < databasetable table=”tablename”>
You cannot specify the database table which is used to persist your item because hybris configures it automatically

Hybris Certification Questions 2

Hotelwatchdog
1. Which of the following are bad principles of OOD?
Tight coupling of objects for robust code
Tight cohesion of methods for modular approach
Encapsulation of data to enable loose coupling
Naming classes with verbs or doing words like cleanDatabase or VerifyCustomer to make it clear to other developers
2. Examine the following SQL statement
        Select p.code from Product as p where p.p_ean like “%123%”  Which of the following is true??
A plain SQL Query must be used in this case because flexible search doesn’t support the use of aliases (the “as p” clause)  
This is plain SQL and cannot be executed successfully as a valid flexible search query
This is plain SQL but can be executed successfully as a valid flexible search query
This query will fail if Code isn’t declared as an attribute of  Product in the type system (relevant –items.xml) even if the column exists on the Products database table
3. In a development environment, if you wanted to configure a setting to specify a JDBC URL, the best place to put it would be…
The localextensions.xml file in the configuration directory/Eclipse project
The extensioninfo.xml file of you extension
The local.properties file in the configuration directory/Eclipse project
The project.properties file in the platform bin directory

4. To configure a hybris instance to run your e-shop on a different database, which of the following are necessary step?
Specifying the correction parameters, like JDBC driver, which of the following are necessary steps
Checking the items.xml files in any extensions you have created to ensure that all of your item type definitions are compatible with you new database.
Initializing the system, for example by using the hybris Administration Console.
Creating a database for each tenant that you want (e.g. JUNIT) in the new configuration.
5. Examine the following incomplete spring descriptor xml fragment
<bean id=”myservice” class=”de.hybris.plateform.example.DEfaultMyservice” XXX=”tenant”?/>
<property name=”modelservice” ref=”modelservice”/>
<property name=”userservice” ref=”userservice”/>
</bean>
which of the following is true
This bean has a tenant scope which means that you are guaranteed that exactly one instance of the DEfaultMyservicebean will be injected per tenant
This bean has a tenant scope which means that you are guaranteed that exactly one instance of the DEfaultMyservicebean will be injected across all tenants
This bean has a tenant scope whichis the hybris implementation of a prototype scope in spring
This bean has a tenant scope whichis the hybris implementation of a session scope in spring
6. A good reason to use Dynamic Attributes would be
To increase the efficiency of working with large numbers like BigDecimal and Double.
To hold calculated fields for increased efficiency and less database activity.
To implement any non-persistent domain class which is not defined as an item type, and is not mapped to the database.
To implement attributes that are written directly to the database when modified and override the caching mechanism.
7. Which of the following would be good uses for hybris cronjob?
Synchronizing the stock level with external warehouse once per day
Perform an inventory once per week at midnight
Notify the system administrator when the server load passes a critical point
Any task that is not database related, hybris cronjobs are designed to perform Operating system tasks, not database tasks
8. What would a possible solution be if you got  the following error?
AntMacros.xml:94:Error while evaluating file ‘\hybris\config\localextensions.xml’ 
ExtensionInfo file ‘\bin\<directory>\<extensionname>\extensioninfo.xml’ could not be found!
Check the extensions path specified in your \hybris\config/localextensions.xml?
Checking t6hat you need the extensions <extensionname> and if you don’t then removing or commenting out the extension list in the localextensions.xml
Running the clean task in the ant build script to remove unused extension references
Running the extgen ant task to create the extension info.xml file for all referenced extensions
Checking that you need the extension <extensionname> and if you do, then making sure that the extension is a valid project in the specified directory and has a valid extensioninfo.xml
9. In the hybris platform when you write an extension A which has dependency on another extension B which of the following is true?
You must specify that A has dependcy on B using <requires-extension> tag in the localextensions.xml of the configuration or eclipse project
You must specify the dependency on B using <requires-extension> tag in the extensioninfo.xml in the extension A project
You must specify the dependency using the <requires-by> tag  in the locationextensions.xml file in the extension B project
Nothing additional needs to be done, dependencies are automatically resolved by the hybris build tools.
10. Which of the following is true about creating your own cockpit extension?
You can create a new extension using the ycokcpit template
You can reuse functionality from standard hybris cockpits
You cannot create your own cockpit extension
You should create the configuration for all types you wish to manage in the cockpit.xml file in your extension

Hybris Certification Questions 1

Hotelwatchdog
1. Examine the following piece of XML <itemtype code=”MyProduct” autocreate=”true” generate=”true” extends=Product” > Which statements below is/are true
This defines a super type of MyProduct
This is probably defined locally in the –items.xml file of an extension
This is probably defined in the localextensions.xml file in the config folder/ Eclipse project
This defines a subtype of MyProduct 


2. When your extension has a dependency on one of  the extensions from the platform/ext folder (like validation or catalog) you need to 
Use the required tag in the extensionsinfo.xml of your extension
Use the importextension statement in your Java Code to import the extension you want to use
Use the requires tag in the localextensions.xml file of the config project
Usually nothing, dependencies on platform extensions are defined by default


3. When updating a running system in hybris, what should you do about handling/processing requests from the   front end??
Nothing , hybris will buffer and synchronize all requests, allowing the system to remain fully functional whilst the data is updating
Make sure that you use the Maintenance extension or some other technique or redirect requests to maintenance page.
Temporarily change the port settings in the local.properties file so that incoming requests are prevented from disturbing the update process.
The isUpdating() method in the http session should be implemented so that every request can be synchronized with updates.


4. In which cases is it mandatory to restart the hybris server for your changes to take effect??
After editing any JSP page
After adding a new Spring bean to one of the Spring Configuration files
After initializing the system data for the first time
After creating or updating a cockpit configuration file


5. Restrictions could be applied in which of the following cases?
When executing a flexible search query as a member of the admin group
When executing a flexible search query as a member of the customer group
When executing any raw SQL query against the database
When querying hybris items via webservices


6. If you are writing a query to test a flexible search restriction in the hybris platform, the user you are running the as
must always be part of the admin group in order for restrictions to be applied
must be a member of the Customer group in order for any restrictions to be applied
must have read rights for the restriction type you are testing
must never be part of the admin group in order for restriction to be applied


7. When you have edited an impex file and ensure it is in appropriate place for a “convention over configuration” style import. You must
Run the ant import all task
Run the ant clean import all task
Initialize or Update the hybris system
Do nothing. New impex coc files are auto imported if they are in the correct directory


8. Examine the following SQL statement which has been translated from a flexi search query 
SELECT item_t0.code FROM products item_t0 where (item_t).TypePkString IN (?,?,?,?,?))
Which of the following statement is the original flexi search query?
Select {p.code} from {product as p} where {TypePKString} in (?session.catelogversions)
Select p.code from product as p where TypePKString in (:types)
Select {p.code} from {product as p}
Select Product.getcode() from Product 


9. If you want to execute a native SQL query using flexible search service which of the following is true?
You can use the search type parameter in flex  search method flexibleSearchService.search(SearchType.NATIVE_SQL,fq); to issue a native SQL search
You can execute a native SQL query as it is using flexible search service without needing any parameters
You cannot execute a native SQL using flexi service
A native SQL query will be automatically converted to a flexi search query by flexibleSearchService


10. What is the Spring framework?
It is an open source framework designed to make it easier to build large, scalable applications.
It is a framework that allows you to easily manage the lifecycle of java classes(POJO’s)and treat them as application objects or components.
It is a GUI framework that provides a large library of Rich GUI components.
It is a hybris core extension designed to allow the use of dependency injection in hybris systems.