Self Reference Model Class - How to populate using Entity Framework

Hi,i have table in SQL Server named Employees as follows:
EmployeeId lastName FirstName reportsTo
1 Davolio Nancy 2
2 Fuller Andrew NULL
3 Leverling Janet 2
4 Peacock Margaret 2
5 Buchanan Steven 2
6 Suyama Michael 5
7 King Robert 5
8 Callahan Laura 2
9 Dodsworth Anne 5
I would like to use Entity Framework to populate my Model Class .My model class looks as follows:
public class Employees
    readonly List<Employees> _children = new List<Employees>();
    public IList<Employees> Children
        get { return _children; }
    public string FirstName { get; set; }
    public string LastName {get; set;}
I want to use this class in ViewModel  to populate my TreeView control. Can anyone help me in order to define Linq to Entities in order to populate my model class Employees from table in SQL Server as defined. Thanks in advance.
Almir

Hello Fred,
unfortunately it does not work, maybe I can be more specific about what I'm trying to get. I'm following Josh Smith's article on CodeProject related to WFP TreeView
Josh Smith article. He has Class named Person with the following structure
public class Person
readonly List<Person> _children = new List<Person>();
public List<Person> Children
get
return _children;
public string Name { get; set; }
The same is populated from Database class using method named GetFamilyTree() which look as follows:
public static Person GetFamilyTree()
// In a real app this method would access a database.
return new Person
Name = "David Weatherbeam",
Children =
new Person
Name="Alberto Weatherbeam",
Children=
new Person
Name="Zena Hairmonger",
Children=
new Person
Name="Sarah Applifunk",
new Person
Name="Jenny van Machoqueen",
Children=
new Person
Name="Nick van Machoqueen",
new Person
Name="Matilda Porcupinicus",
new Person
Name="Bronco van Machoqueen",
new Person
Name="Komrade Winkleford",
Children=
new Person
Name="Maurice Winkleford",
Children=
new Person
Name="Divinity W. Llamafoot",
new Person
Name="Komrade Winkleford, Jr.",
Children=
new Person
Name="Saratoga Z. Crankentoe",
new Person
Name="Excaliber Winkleford",
I'm trying to figure out how should I write
GetFamilyTree() method using Entity Framework in order to connect to my SQL Server database and populate this Person class as it was populated manually in Joshs Example. The table I'm using in SQL Server is described in
my first post named Employees (it's self reference table)

Similar Messages

  • [b]What is content Provider java Class & How is it useful?.[/b]

    Hi,
    I would like to know more details on What is content Provider java Class & How is it useful?. Appreciate precise answers on this.
    Thank you,
    Renga
    Email : [email protected]

    Portal Server allows multiple sources of information, applications, and services to be displayed within a single page or set of pages that the user can view in a browser. The page in which the content is included is known as the desktop. The various sources of content are displayed in rectangular areas arranged in rows and columns within the desktop called channels. A Java class, called a provider, is responsible for converting the content in a file, or the output of an application or service into the proper format for a channel. A number of providers are shipped with the Portal Server including a bookmark provider, an application provider, and a notes provider. As the desktop is imaged, each provider is queried in turn for the content of its associated channel.

  • MVC 4 Using Entity Framework How to save Images in Database

    Iam Beginner to
    MVC 4 ... I want to Upload Image from my form and save to the SQL Database by Using Entity Framework . I have searched alot but couldnt succeed yet,,

    http://forums.asp.net/
    You should post to the MVC section of above forum first.

  • Using Entity Framework with Crystal Master Detail Reporting

    My project is a WPF project connected to a SQL Server Compact Edition database.  Since Crystal does not support nullable types, I have created classes specifically for the report to consume.  This is a simplified version of what I am attempting to do.
    For example...
    class Band
    public string BandName { get; set; }
    public string BandCity { get; set; }
    public List<BandRecording> RecordingsList { get; set; }
    class BandRecording
    public string Year { get; set; }
    public string Description { get; set; }
    In my code behind for this report, I am using Entity Framework to pull the data.  Just pulling information for one band...
    using (RockEntities re = new RockEntities())
    var bandinfo = (from b in re.Band
    where b.BandName == "BT"
    select new
    b.BandName,
    b.BandCity,
    Recordings = b.Recordings.OrderBy(z => z.Year)
    }).FirstOrDefault();
    OK, now I start moving to the data to class I have defined...
    Band b = new Band();
    b.RecordingsList = new List<BandRecording>();
    b.BandName = bandinfo.BandName;
    b.BandCity = bandinfo.BandCity;
    foreach(var Recording in bandinfo.Recordings)
    BandRecording br = new BandRecording();
    br.Year = Recording.Year;
    br.Description = Recording.Description;
    b.RecordingsList.Add(br);
    Since Crystal Supports IEnumerable, I create a list to hold the main record (although I am only reporting on one band)...
    List<Band> lb = new List<Band>();
    lb.Add(lb);
    ReportDocument rd = new ReportDocument();
    rd.Load("BandReport.rpt");
    rd.SetDataSource(lb);
    I have put the Band info in the Report Header section.  This is all working fine. In the details section I would like to put the Band Recording info.  I haven't figured out how to do this.  I have put the fields in the Details section, but how do I tell the details section to use the inner List<BandRecordings>?
    Any help would be greatly appreciated.

    Only way I can see of doing this would be to place emprty formulas into the section. The populate the formula(s) with the required field;
    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Shared
    Public Class Form1
    Inherits System.Windows.Forms.Form
    Dim Report As New CrystalReport1()
    Dim FormulaFields As FormulaFieldDefinitions
    Dim FormulaField As FormulaFieldDefinition
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    FormulaFields = Report.DataDefinition.FormulaFields
    FormulaField = FormulaFields.Item(0)
    FormulaField.Text = "[formula text]"
    CrystalReportViewer1.ReportSource = Report
    End Sub
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Using Entity Framework with SQL Azure - Reliability

    (This is a cross post from http://stackoverflow.com/questions/5860510/using-entity-framework-with-sql-azure-reliability since I have yet to receive any replies there)
    I'm writing an application for Windows Azure. I'm using Entity Framework to access SQL Azure. Due to throttling and other mechanisms in SQL Azure, I need to make sure that my code performs retries if an SQL statement has failed. I'm trying to come up with
    a solid method to do this.
    (In the code below, ObjectSet returns my EFContext.CreateObjectSet())
    Let's say I have a function like this:
      public Product GetProductFromDB(int productID)
         return ObjectSet.Where(item => item.Id = productID).SingleOrDefault();
    Now, this function performs no retries and will fail sooner or later in SQL Azure. A naive workaround would be to do something like this:
      public Product GetProductFromDB(int productID)
         for (int i = 0; i < 3; i++)
            try
               return ObjectSet.Where(item => item.Id = productID).SingleOrDefault();
            catch
    Of course, this has several drawbacks. I will retry regardless of SQL failure (retry is waste of time if it's a primary key violation for instance), I will retry immediately without any pause and so on.
    My next step was to start using the Transient Fault Handling library from Microsoft. It contains RetryPolicy which allows me to separate the retry logic from the actual querying code:
      public Product GetProductFromDB(int productID)
         var retryPolicy = new RetryPolicy<SqlAzureTransientErrorDetectionStrategy>(5);
         var result = _retryPolicy.ExecuteAction(() =>
               return ObjectSet.Where(item => item.Id = productID).SingleOrDefault;
         return result;
    The latest solution above is described as ahttp://blogs.msdn.com/b/appfabriccat/archive/2010/10/28/best-practices-for-handling-transient-conditions-in-sql-azure-client-applications.aspx Best Practices for Handling Transient Conditions in SQL Azure Client
    Application (Advanced Usage Patterns section).
    While this is a step forward, I still have to remember to use the RetryPolicy class whenever I want to access the database via Entity Framework. In a team of several persons, this is a thing which is easy to miss. Also, the code above is a bit messy in my
    opinion.
    What I would like is a way to enforce that retries are always used, all the time. The Transient Fault Handling library contains a class called ReliableSQLConnection but I can't find a way to use this with Entity Framework.
    Any good suggestions to this issue?

    Maybe some usefull posts
    http://blogs.msdn.com/b/appfabriccat/archive/2010/12/11/sql-azure-and-entity-framework-connection-fault-handling.aspx
    http://geekswithblogs.net/iupdateable/archive/2009/11/23/sql-azure-and-entity-framework-sessions-from-pdc-2009.aspx

  • Unable to Update .mdf using Entity Framework

    I am trying to insert Data in an .mdf file using Entity Framework but there is no data saved in the database. (I am using VS 2013)
    Code against the button is
    private void BtnSubmit_Click(object sender, RoutedEventArgs e)
    Product record = new Product();
    record.ProductName = txtProductName.Text;
    AzadIndustryEntities1 Db = new AzadIndustryEntities1();
    Db.Products.Add(record);
    Db.SaveChanges();
    MessageBox.Show("Record Inserted");
    samEE

    My problem is solved. Going to explain it so that it could help others also.
    As the default property of .mdf file Copy to Output Directory is
    Copy always so when we debug our program a copy of the .mdf file is copied in the
    debug folder which is in the bin folder  (Select
    Show All Files in Solution Explorer to view the bin folder) so, whatever changes we make in database through
    code it is saved in the copied .mdf that is in the debug folder. When we
    debug our program again the same steps are performed again and the previous database is
    overwritten. To prevent such happening the property of .mdf file mentioned above should be set to
    Copy if newer so, if there is any change in the model only then the .mdf will be overwritten
    samEE

  • Flex 4 tree component - how to populate using an array?

    It's unclear how to populate a tree control using an array as the dataprovider like you could in Flex 3.
    Here is a Flex 3 example. Even when I replace the mx:Object tags with fx:Object tags things don't work ... there seems to be no mx:children tag ...
    http://blog.flexexamples.com/2007/12/03/using-an-array-as-a-data-provider-in-a-flex-tree-c ontrol/
    Please advise.

    This should do it:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo">
        <fx:Script>
            <![CDATA[
                private function tree_labelFunc(item:Object):String {
                    var suffix:String = "";
                    if (tree.dataDescriptor.hasChildren(item)) {
                        suffix = " (" + item.children.length + ")";
                    return item.name.toUpperCase() + suffix;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:Array id="arr">
                <fx:Object name="One">
                    <fx:children>
                        <fx:Array>
                            <fx:Object name="Two" />
                            <fx:Object name="Three" />
                            <fx:Object name="Four">
                                <fx:children>
                                    <fx:Array>
                                        <fx:Object name="Five" />
                                        <fx:Object name="Six" />
                                    </fx:Array>
                                </fx:children>
                            </fx:Object>
                            <fx:Object name="Seven">
                                <fx:children>
                                    <fx:Array>
                                        <fx:Object name="Eight" />
                                    </fx:Array>
                                </fx:children>
                            </fx:Object>
                            <fx:Object name="Nine" />
                        </fx:Array>
                    </fx:children>
                </fx:Object>
            </fx:Array>
        </fx:Declarations>
        <mx:Tree id="tree"
                dataProvider="{arr}"
                labelFunction="tree_labelFunc"
                width="200"
                horizontalCenter="0"
                verticalCenter="0" />
    </s:Application>
    Peter
    Update: I also posted the updated Spark example at http://blog.flexexamples.com/2007/12/03/using-an-array-as-a-data-provider-in-a-flex-tree-c ontrol/.

  • How to create ViewModel in an MVVM application using entity framework where database has many-to-many relationship?

    I have started developing a small application in WPF. Since I am completely new to it, to start with I took a microsoft's sample available at
    Microsoft Sample Application and following the pattern of the sampke I have been so far successful  in creating four different views for their corresponding
    master tables. Unfortunately, I have got stuck up as the sample does not contain pattern for creating ViewModel when there is a many-to-many relationship in the database. In my application, I have the following data structure:
    1. Table Advocate(advId, Name)
    2. Table Party (partyId, Name)
    3 Table Case (caseId, CaseNo)
    4. Link Table Petitioner (CaseId, PartyId)
    5. Link Table Respondent (CaseId, PartyId)
    6. Link Table EngagedAdvocate(CaseId, advId)
    7. Link Table EngagedSrAdvocate(CaseId, advId)
    In the scenario above, I am a bit confused about how to go forward creating the required ViewModel which would render me to have multiple instances of Petitioners, Respondents, Advocates and SrAdvocates.
    Please explain details in step by step manner considering that whatever work I have completed so far is a replica of Microsoft's sample referred above. I would also like to mention that I have developed my application
    using VB.net. So please provide solution in vb.net.
    After getting many-to-many relationship introduced into my application, it would achieve one level above the sample application and I would like to share with the community so that it could be helpful to many aspiring developers seeking help with MVVM.

    Hi ArunKhatri,
    I would suggest you referring to Magnus's article, it provides an example of how you could display and let the user edit many-to-many relational data from the Entity Framework in a dynamic and data-bound DataGrid control in WPF:
    http://social.technet.microsoft.com/wiki/contents/articles/20719.wpf-displaying-and-editing-many-to-many-relational-data-in-a-datagrid.aspx
    You can learn how to design the ViewModel and the relationship between the entities.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can I use WebCenter Framework in JDev11g or JDev10.1.3.4

    Hi,
    I tried to use WebCenter Framework in JDev. First I installed JDev11g bit I couldn't find WebCenter Application Template. They said that because WebCenter 11 hasn't released yet. So I changed to JDev 10.1.3.4 but I didn't find neither this Template. So I tried to install WebCenter Suite but there's no WebCenter Template. Is there anyone who can show me step-by-step how to use WebCenter. Thank you.

    Make sure that you installed the studio edition of JDeveloper 10.1.3.4 and not another edition.
    Then follow the tutorials here:
    http://www.oracle.com/technology/products/webcenter/index.html
    and use the WebCenter forum for further questions on this specific topic.

  • RFC lookup with java proxy class, how do I use "fromXml()"?

    Hi,
    I'm trying to do an RFC lookup in XI using java proxy classes (SAP Enterprise Connector).
    The XMLPayload comes from a java proxy class which has been converted to xml using a method called
    .fromXml() for this. I just don't know how to use and I can't find any documentation for it.
    Would very much appreciate if someone could provide me with an example of how to use this class
    Best Regards
    Olof Trönnberg

    http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/XStreamer.html#fromXML(com.thoughtworks.xstream.io.HierarchicalStreamDriver,%20java.io.Reader)

  • Where we can see calculation model and how we can use in HANA ?

    Hi to all,
    A small doubt.
    While activating database procedure in HANA, system optimize the procedure and create calculation model that resemble a graphical calculation view.
    1. Where and under which schema we can see calculation mode created for procedure.
    and
    2. Can we use this calculation mode in SAP HANA as calculation view, any PDF or weblink for same ?
    Thanks
    Pavneet Rana

    Hi Pavneet,
    not sure from where you got the idea that SAP HANA would create a calculation model that resembles a graphical calc view.
    This is not true.
    Stored Procedures, Attribute/Analytic views and Calculation views of any flavor are activated as Column Views. These column views can instantiate so-called calculation scenarios - which basically are the data flow definitions of your procedure or calculation views.
    Upon execution of the column views, SAP HANA takes into account what data is actually asked for and re-optimizes the data flow dynamically.
    For the end-user there is no way to have a visual display of the calculation scenario.
    - Lars

  • How can I create a database from a sharepoint using entity framework

    Hello All,
    I want to develop a data base from SharePoint list independently. The column name are based on a SharePoint list eg: Contact-list (will be having 10 columns)
    can any one please suggest me an idea on how to do this task? Which Visual Studio template is suitable for this purpose?
    I confused with starting with following Visual studio template!!!
    Empty SharePoint Project??, Business Data Connectivity Model??, ASP.Net Web application??
    Somebody please help me soon....
    I am using SharePoint 2010 and Visual Studio 2010

    Hey,
    basically you should start with an empty SharePoint 2010 project where you add an List-EventReceiver. This Receiver should point to the url of the list and handle the ItemAdded-Event. In this method you place the code to create the database, for example
    with a SQL-Statement.

  • How to reload changes using Entity Framework POCO?

    I have my WPF app using EF on loading, save etc. my problem is if someone make changes on SQL table directly and if my app is open, I am not able to see those changes. I know that EF caches the table and i have force to reload or refresh. But how this
    can be done automaticly. I always thought that therefor we have the INotifyPropertyChanged implementation. Does it not serve for this purpose together with Observeable objects?
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."

    Nope.
    inpc is property in viewmodel to view notification.
    There is no automatic thing there in EF which says a record has changed.  EF is based on ado and there's no push  notification mechanism.
    I have several approaches to the issue.
    1)
    Re-read everything when the user decides to.  That's that refresh button in my sample.
    2)
    Add trigger to table which writes away when a record has changed the id, type of change and timestamp.
    I then can read  changes to a table since a given time ( when the data was last read eg ) and do stuff.
    3)
    Adds push notifications to the client on changing records.  This involves tracking who has what data and it's quite involved.
    Bear in mind that sample of mine is step 1.
    This sort of thing is several steps down the line from something which just does basic crud in a datagrid.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • How to  we  use Tiles Framework  with ADF Faces  ?

    Hello Every body,
    Can anyone tell me whether We mix Tiles framework of Struts, and ADF Faces Framework?
    I 've found that we can mix JSF and Tiles, but can we use ADF Faces and Tiles together?
    Waiting for your answer!
    Thanking you ,
    Samba.

    Dear Experts,
    Please help me !
    As I could not get enough help from you masters,
    I set out to do on my own, hoping that at some time you would come to my rescue.
    I designed a simple jspx page SiteLayout.jspx whose code is given below:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces"
    xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:tiles="http://jakarta.apache.org/struts/tags-tiles">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
    doctype-system="http://www.w3.org/TR/html4/loose.dtd"
    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>SiteLayout</title>
    </head>
    <body>
    <h:form binding="#{backing_SiteLayout.form1}" id="form1">
    <af:table id="PageLayout" width="100%" >
    <!-- <tiles:getAsString name="title" /> -->
    <f:subview id="siteview">
    <tiles:insert definition="siteLayoutDef">
    <af:table id="headertable" width="100%">
    <tr>
    <td width="100%" colspan="2">
    <f:subview id="header">
    <tiles:insert attribute="header"/>
    </f:subview>
    </td>
    </tr>
    <tr>
    <td width="100%" colspan="2">
    <f:subview id="topview">
    <tiles:insert attribute="topmenu"/>
    </f:subview>
    </td>
    </tr>
    <tr>
    <td width="100%" colspan="2">
    <f:subview id="navigationview">
    <tiles:insert attribute="navigationbar"/>
    </f:subview>
    </td>
    </tr>
    <tr>
    <td width="30%">
    <f:subview id="leftview">
    <tiles:insert attribute="leftmenu"/>
    </f:subview>
    </td>
    <td width="70%">
    <f:subview id="contentview">
    </f:subview>
    <tiles:insert attribute="content"/>
    </td>
    </tr>
    <tr>
    <td width="100%" colspan="2">
    <f:subview id="footerview">
    <tiles:insert attribute="footer"/>
    </f:subview>
    </td>
    </tr>
    </af:table>
    </tiles:insert>
    </f:subview>
    </af:table>
    </h:form></body>
    </html>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_SiteLayout-->
    </jsp:root>
    My SiteLayout.jspx defines the layout of the pages on my Web application.
    My Home page is this:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:afc="http://xmlns.oracle.com/adf/faces/webcache"
    xmlns:af="http://xmlns.oracle.com/adf/faces"
    xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
    xmlns:afi="http://xmlns.oracle.com/adf/industrial/faces"
    xmlns:graph="/webapp/graph.tld"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:tiles="http://jakarta.apache.org/struts/tags-tiles">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
    doctype-system="http://www.w3.org/TR/html4/loose.dtd"
    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>Home</title>
    </head>
    <body>
    <!-- <tiles:getAsString name="title" ignore="true" /> -->
    <h:form binding="#{backing_Home.form1}" id="form1">
    <tiles:insert definition="siteLayoutDef" flush="false">
    <tiles:put name="header" value="/Header.jspx" />
    <tiles:put name="footer" value="/Footer.jspx" />
    <tiles:put name="leftmenu" value="/LeftMenu.jspx" />
    <tiles:put name="content" value="/Content.jspx" />
    <tiles:put name="header" value="/TopMenu.jspx" />
    <tiles:put name="footer" value="/NavigationBar.jspx" />
    </tiles:insert>
    </h:form>
    </body>
    </html>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_Home-->
    </jsp:root>
    My <tiles-defs> page is this:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
    <tiles-definitions>
    <definition name="tiles-defs"/>
    <definition name="siteLayoutDef" path="/SiteLayout.jspx">
    <!--<put name="title" value="SiteBean.getQuoteofDay()" /> -->
    <put name="header" value="/header.jspx" />
    <put name="footer" value="/footer.jspx" />
    <put name="content" value=""/>
    <put name="topmenu" value="/TopMenu.jspx"/>
    <put name= "leftmenu" value="/LeftMenu.jspx"/>
    <put name="navigationbar" value="/NavigationBar.jspx"/>
    </definition>
    </tiles-definitions>
    My Web.xml is this:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    <description>Empty web.xml file for Web Application</description>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <!-- Tiles ViewHandler config file -->      
    <context-param>      
    <description>Tiles configuration      
    definition files and a listener need to be defined.      
    the listener will initialize JspTilesViewHandlerImpl with tiles definitions.      
    </description>
    <param-name>tiles-definitions</param-name>      
    <param-value>/WEB-INF/tiles-defs.xml</param-value>      
    </context-param>
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml, /WEB-INF/tiles-defs.xml</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.jspx</param-value>
    </context-param>
    <context-param>
    <param-name>oracle.adf.view.faces.ALTERNATE_VIEW_HANDLER</param-name>
    <param-value>
    org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl
    </param-value>
    </context-param>
    <filter>
    <filter-name>adfFaces</filter-name>
    <filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>adfFaces</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>resources</servlet-name>
    <servlet-class>oracle.adf.view.faces.webapp.ResourceServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>35</session-timeout>
    </session-config>
    <servlet>
    <servlet-name>Tiles Servlet</servlet-name>
    <servlet-class>
    org.apache.struts.tiles.TilesServlet
    </servlet-class>
    <init-param>
    <param-name>definitions-config</param-name>
    <param-value>/WEB-INF/tiles-defs.xml</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    </web-app>
    The Error I'm getting is :
    IllegalStateException :No ADFRenderingContext;
    What happened?
    Where did I go wrong?
    could you please help me?
    Thanking you in advance,
    Waiting for your response,
    Samba.
    Message was edited by:
    saasira
    Message was edited by:
    saasira
    Message was edited by:
    saasira

  • How i can use Cocoa framework APIs in indesign CC version

    Like NSString,NSFileManager.
    Thanks
    Qamar khan

    Add Cocoa.framework to your project, then add an Objective-C source file (with the extension ".m") to the project, and at the top, #import <Cocoa/Cocoa.h>.

Maybe you are looking for