Create a page programmatically

This might be a silly question.
Looking at the JSF 1.1_01 API, I don't see methods supporting creating pages programmatically. For example, I would expect the UIForm class to have something like an addChild method.
Does this mean JSF does not intend to support creating a page programatically?

The trick is
UIComponent.getChildren().add(UIComponent)That does seem like a solution or more accurately workaround. Look at the notes for the List returned by UIComponent.getChildren() such as
# Any attempt to add an object that does not implement UIComponent must throw a ClassCastException.
# Whenever a new child component is added, the parent property of the child must be set to this component instance. If the parent property of the child was already non-null, the child must first be removed from its previous parent (where it may have been either a child or a facet).
Wouldn't it be much nicer if an addChild method is provided (say in UIComponentBase class) to do all this?
Anyway, thanks for the quick response.

Similar Messages

  • How to get the page layouts programmatically and create a page for that pagelayout

    how get the page layouts programmatically and create a page for that pagelayout and add webpart
    please help me with da code.Thanks
    adityadugyala

    Hi if your page layouts alreday created then create new page programaticaaly  and apply your page ayouts to that page by coding you can do something like following
    PublishingWeb publishingWeb =
    PublishingWeb.GetPublishingWeb(web);
    PageLayout[] layouts = publishingWeb.GetAvailablePageLayouts();
    PageLayout layout = layouts[0];
    string pageName =
    "MyPublishingPage5.aspx";
    PublishingPage newPage = publishingWeb.GetPublishingPages().Add(newFolder.Folder.ServerRelativeUrl +
    "/"+ pageName, layout); 
    newPageUrl = web.Url +"/" + newPage.Url;
    newPage.Description = "This my sample publishing page";
    newPage.Title = "My Publishing Page";
    newPage.Update();
    Please follow link
    http://blogs.msdn.com/b/sowmyancs/archive/2008/03/15/create-publishing-pages-in-portal-sites-programmatically.aspx
    Please mark answer , if you think answer is helpful or correct.

  • Programmatically creating a page with portlets in it

    Hello!
    I need a little help figuring out how to programmatically create a page and add a couple portlets to it. I have figured out how to create the PageDefinition and that code works great. How can I add 2 portlets (the portlet definitions already exist in the Portal Library) to that page definition?
    I just need a couple hints & maybe some pseudo-code to get me going in the right direction.
    I'm stuck with using BEA 8.1 SP2 at the moment.
    Thanks for any help,
    John

    If you want to add the portlets to the page in the library and effect all instances of the page use the PageDefinitionManager.addPlaceable(...) EJB.
    javadoc
    http://edocs.beasys.com/wlp/docs81/javadoc/com/bea/netuix/application/manager/IPageDefinitionManager.html#addPlaceable(com.bea.netuix.application.manager.CustomizationContext,%20com.bea.netuix.application.identifier.PageDefinitionId,%20com.bea.netuix.application.identifier.PlaceableDefinitionId,%20com.bea.netuix.application.identifier.PlaceholderDefinitionId,%20int)
    If you want to just effect that page on a particulr desktop use the PortalCustomizationManager.addPlaceable(...) EJB
    http://edocs.beasys.com/wlp/docs81/javadoc/com/bea/netuix/application/manager/IPageInstanceManager.html#addPlaceable(com.bea.netuix.application.manager.CustomizationContext,%20com.bea.netuix.application.identifier.DesktopDefinitionId,%20com.bea.netuix.application.identifier.PageInstanceId,%20com.bea.netuix.application.identifier.PlaceableDefinitionId,%20com.bea.netuix.application.identifier.PlaceholderDefinitionId,%20int)
    Chris Jolley
    Portal Architect

  • Can I create page programmatically ?

    Hi
    I want to create pages by code using pdk PL/SQL or PDK Java.
    Is it possible ? How can I do this (API, etc.) ?
    Thanks in advance
    Alain.

    I did this using an unpublished API - it took some experimentation but worked great at the end. I used a page template in release 2 of Portal. the idea was that when a user added a project we would programatically create a page for that project. In that manner their portal would end up with several hundred pages, one for each project, that were created and look similar as they added project information for their company. Here is an example from the code using Oracle's API, wwpob_api_page.create_page - if you open up the specification for this package in a pl/sql browser such as TOAD you will see some comments that help explain how to use it:
              p_page_id := WWPOB_API_PAGE.create_page
    (p_id => null
    ,p_parent_id => 1
    ,p_type_id => WWPOB_API_PAGE.PAGETYPE_PORTLETS
    ,p_type_siteid => 0
    ,p_type_value => 1
    ,p_name => p_page_url_info
    ,p_title => v_page_title
    ,p_category_id => null
    ,p_site_id => p_page_group_id
    ,p_plsql_executemode => null
    ,p_username => v_user_name
    ,p_description => v_page_description
    ,p_image => null
    ,p_titleimage => null
    ,p_rolloverimage => null
    ,p_styleid => v_style_id
    ,p_style_siteid => 0
    ,p_exposure => WWPOB_API_PAGE.DONTEXPOSE_AS_PORTLET
    ,p_ispublic => WWPOB_API_PAGE.PAGE_PRIVATE
    ,p_inheritpriv => WWPOB_API_PAGE.OWN_PRIV
    ,p_isready => 1
    ,p_cachemode => WWPOB_API_PAGE.CACHE_MODE_PING
    ,p_cacheexpires => null
    ,p_template_id => p_template_id
    ,p_template_siteid => p_page_group_id
    ,p_allow_style => WWPOB_API_PAGE.NO_PAGE_STYLE
    ,p_allow_acl => WWPOB_API_PAGE.ALLOW_PAGE_ACL
    ,p_istemplate => WWPOB_API_PAGE.PAGE_TEMPLATE_NO
    ,p_dav_id => null
    ,p_init_jspfile => null
    ,p_displaybanner => WWPOB_API_PAGE.SHOW_BANNER
    ,p_region_type => WWPOB_API_REGION.region_type_portlet
    ,p_create_region => true
    ,p_navpage_id => null
    ,p_navpage_siteid => null
    ,p_uitemplate => null
    ,p_template_ispublic => WWPOB_API_PAGE.PAGE_TEMPLATE_PRIVATE
    ,p_use_def_template => false
    ,p_copy_from_template => true
    Good luck - Art

  • Add JavaScript file to ALL existing Task List pages and to newly created list pages

    We have several OOTB task lists that are in use on several subsites.  We want to add JavaScript to the NewForm.aspx and EditForm.aspx for these task lists. These lists have not been customized, they are based on the standard Task Content Type.
    Since there are several lists already created and in use, it would be far too much work to manually add a Content Editor web part to each page.
    We put the JavaScript file in the top-level site style library.
    Is there a way to programmatically attach a script reference to each existing page in all the subsites AND have the script reference placed on any NEW list pages created from the OOTB Task content type? Or, add a CEWP to all existing list pages using a feature?
    I could not find any examples of this.

    Hi,
    A solution would be like this: Add your script into a Content Editor Web Part in a page, then add this Content Editor Web Part into the NewForm page of these Task lists using
    SharePoint Object Model.
    More information:
    Use
    SPList.Forms property to retrieve the URLs of the specific form of these Task lists:
    http://sharepointcore.blogspot.com/2011/08/sharepoint-listitem-new-edit-and.html
    With
    SPLimitedWebPartManager object, we can retrieve the web parts of a page, choose one and add into another
    page:
    SPLimitedWebPartManager.WebParts
    property
    SPLimitedWebPartManager.AddWebPart
    Another two links about this for your reference:
    http://www.stefangordon.com/add-web-part-to-page-programmatically/
    http://sharepoint.stackexchange.com/questions/9442/how-to-programmatically-add-a-webpart-to-a-page
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they
    help and unmark them if they provide no help. If you have feedback for TechNet
    Subscriber Support, contact [email protected]
    Patrick Liang
    TechNet Community Support

  • Create Taskflow object programmatically

    Hi All:
    Could any one point me to any API that allows me to create Taskflow object programmatically?
    I would like to automatically create an Taskflow object that "wrap around" our object when the user drag n drop the object to an jspx page.
    Thanks

    Hi,
    Assuming that you are using ADF BC 11g and without fully knowing your case...
    I could say you could use ViewObjectImpl methods through your ApplicationModule..
    The methods are there.. and you will use them whenever you want.
    With this way you will not have to create any bindings programmatically..
    In fact, I am not certain if what you are asking is possible..
    However, here are some links that migh help you with the Binding Layer.
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/adfinsider-093342.html
    http://blogs.oracle.com/workingwithadf/entry/intro_to_adf_binding_layer
    http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/insiderBinding1/BindingsPart1.html
    http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/adfinsider-binding-internals-2/adfinsider-binding-internals-2.html
    Regards,
    Dimitris.

  • Adding Custom Webpart (Sandbox) to a page programmatically using CSOM

    I'm trying to add a webpart(sandboxed) to a page programmatically using CSOM.
    I've created a simple windows forms application and tried the below, it gives me error
    Error: "A first chance exception of type 'Microsoft.SharePoint.Client.ServerException'
    occurred in Microsoft.SharePoint.Client.Runtime.dll"- Server Exception occurred.
    Additional Information: Cannot Import this webpart "
    using (ClientContext context = new ClientContext("URL"))
    Web web = context.Web;
    File file = web.GetFileByServerRelativeUrl("/SitePages/Test.aspx");
    LimitedWebPartManager wpMgr = file.GetLimitedWebPartManager(PersonalizationScope.Shared);
    string webpartxml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
    "<webParts>" +
    "<webPart xmlns='http://schemas.microsoft.com/WebPart/v3'>" +
    "<metaData>" +
    "<type name=\"CustomVisualWebPartProject.VisualWebPart1.VisualWebPart1, CustomVisualWebPartProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=28942db35e131a1c\" />" +
    "<importErrorMessage>Cannot Import this webpart</importErrorMessage>" +
    "</metaData>"+
    "<data>"+
    "<properties>"+
    "<property name=\"Title\" type=\"string\">CustomVisualWebPartProject - VisualWebPart1</property> "+
    "<property name=\"Description\" type=\"string\">My Visual Web Part</property>" +
    "<property name=\"ChromeType\" type=\"chrometype\">None</property>" +
    "</properties>" +
    "</data>" +
    "</webPart></webParts>";
    WebPartDefinition webPartDef = wpMgr.ImportWebPart(webpartxml);
    wpMgr.AddWebPart(webPartDef.WebPart, "Left", 1);
    context.ExecuteQuery();
    Kindly let me know how to resolve it.
    Thanks,
    Pandiarajan

    Hi,
    I have the same issue with you, I also cannot add visual Webpart (Sandbox) to a page using CSOM,but I can add farm solution web part using CSOM, so I change it to farm solution web part.

  • Pages 5.5.1: When opening a document created with Pages '09 (Version 4.0) with Pages 5.5.1 the page header and the page footer are deleted. How can this be prevented? Or is this a bug in Pages 5.5.1?

    Pages 5.5.1: When opening a document created with Pages '09 (Version 4.0) with Pages 5.5.1 the page header and the page footer are deleted. How can this be prevented? Or is this a bug in Pages 5.5.1?

    Same problem here (no graphics in header or footer) and the problem has been reported months ago. It is another bug/feature lost when Apple moves from 09 to the iCloud-compatible versions.  Complain to Apple, you may have better chance than me and they may finally listen to their users....

  • Server Error on Create user page in 9iAS Portal 9.0.2.0

    Hi,
    I have installed Oracle 9iAS Portal 9.0.2.0 on WinNT
    I got the SSO page loging thru admin login and everything is fine .....i can get into build page groups etc.....
    Problem
    creation of users
    When i click Build --> Administer --> Create User
    Page error:
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.
    Oracle HTTP Server/1.3.22 Server at accentur-jpdq.accenture.com Port 7777
    Kindly let me know how to solve this and get the Create User page --> To Create users ....
    Thanks & Regards,
    Gopinath.G
    Accenture Technology services.
    Bangalore,INDIA

    Can you pls confirm if OC4J_DAS instance is up?
    Refer Oracle9i Application Server Administrator's Guide
    Release 2 (9.0.2) -> Starting and Stopping the Application Server for 'Starting an Infrastructure'
    link: http://download-west.oracle.com/docs/cd/A97329_01/core.902/a92171/start.htm#1011347

  • How to get pages list for a group space or create a page for a group space

    hi All,
    I am using wc11.1.1.3, I want to use java api to implementing the following functions in site template:
    1. Get pages list for a given group space
    2. Create a page for a given group space
    I researched the following codes from web site:
    PageDef newPage = mPageService.createPage(
    PERSONAL_USER_PAGE, pageNameFormat, pageTitle,
    "MyPageTemplate1.jspx",
    "/mytemplates/",
    null, null, null);
    What should be used instead of PERSONAL_USER_PAGE if a group space page is intended to be created? which parameter is for defining group space name that the page should be created for?
    By the way, PageService seems has method for getting list of pages, but how to use it to get page list which is in a specified gs?
    Best regards

    did you manage to get the page list using Page Service API?

  • I want to create home page for my application with short URL

    I want to create home page for my application with short URL
    as when I want user to use my application user must go to URL like this
    http://127.0.0.1:7101/My-Project/faces/app/empModule/allEmployees/viewMyEmployees.jspxI want the user to use short URL , How can I use shorter URL not all this one.
    I want shorter URL for my application not to write full path .
    thanks in advance.
    Edited by: user611775 on Oct 31, 2010 10:21 PM

    Well,
    it's up to you. The first part (Mcit-Project-ViewController-context-root) is the context root which you define in the view controller project. 'faces' is the name the servlet filter reacts on. You can't omit it but shorten it in web.xml. The rest is your directory structure. I'm not sure how to shorten this other as to move the jspx files back into the web root folder.
    By the way an ADF faces app never uses the .jspx at the end of the url. If you specify '.jspx', you only render the page but don't start the work flow.
    Timo

  • Need help in creating a page that populates 3 related tables

    Hi All,
    I am pretty new to Oracle and have been trying to use the wizards in HTML_DB to create one page that will populate three tables. I have thus far have NOT been able to find my solutions. I do not know enough experience in SQL/PL_SQL to create the code on my own.
    Here is my dilemma. I have three tables:
    con (for contacts) - with regular contact info = l_name, f_name, phone...
    pro (for different programs) - with different program info = pro_name, priority..
    procon (Contact/program) - that joins the two together with initial, follow-up and close date fields.
    I created a composite primary key in the procon table that consists of the two pk's of the other two tables (using fk relationships).
    I want to be able to use one page in HTML_DB to enter in the data which will populate all three tables. Is there a way to do this in PL/SQL?
    * Also: Is there a book out there that you can recommend that really teaches SQL/PL_SQL?
    I would really, really, REALLY appreciate the help!!!!!
    Thanks,
    d.

    This isn't as bad as you think. I would create one procedure in a package and pass the parameters to the package via htmldb
    procedure insval(in_a in number, in_b in number, in_c in number)
      begin
       insert into tablea(cola)
        values(in_a);
      insert into tableb(colb)
       values(in_b);
      insert into tablec(colc)
       values(in_c);
      end;and then you call it from htmldb using a process
    schema.package.insval(:p1_a,:p1_b,:p1_c);That's ultra-simplified, but will get the job done.
    -Scott

  • How to add/create additional page in Crystal Report Layout SAP B1

    Hi,
    I wanna ask about How to add/create additional page in Crystal Report Layout SAP B1 ?
    I want when user print Purchase Order then on last page also print some page like Penalty Clause etc.
    Pls help me to find the solution.
    Br,
    Thomas Marsetyo

    Hi,
    In your report footer, set it to create a new page before it is printed (In 'Section Expert', select the Report Footer -> 'Paging' tab -> Check 'New Page Before' checkbox). Throw your Terms & Conditions into the Report Footer section.
    If you already have a Report Footer that you want to keep, just split the footer into two sections (Right-click the Report Footer section -> 'Insert Section Below') and follow the same procedure for the newly created section.
         Check this Link
    http://stackoverflow.com/questions/9232239/adding-an-additional-page-to-end-of-a-crystal-report
    http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=18960
    Regards,
    Manish

  • .pages file created in Pages for Mac won't open in Pages for iPad

    Just created a pages document on my Mac, saved it to my google drive and when attempting to "open in" from my google drive the file won't open in pages for iPhone or iPad (mini).
    All versions of Pages are on latest release.
    Messge reads:
    Document can't be imported.
    The file format is invalid.
    I download both the mac app and ios app a week ago.
    Thank you for any info!

    I've been testing file structures via google drive this morning and have yet to find a solution.
    Compressed files will not open in Pages on the ipad and an upload to Google Drive of a .pages document re downloaded to my desktop will no longer open in Pages on the Mac.
    Somewhere in the google ecosystem during upload or download / "open in" (on the ipad) the file is being restructured so that it cannot be recognized.
    An hour call with the team at Google hasn't supplied an answer yet and they have opened a case file to investigate.
    I'll update when I hear back.
    Thanks!

  • Can't open documents created in Pages with macBook pro running maverick

    Hello,
    I just bought the new MacBook Pro and downloaded iWork.  Now when I create a document in Pages and save it to Documents, I can't open it.  I get an error messages saying a file is missing.  Also, all my old documents created with Pages that I transfered from my old MacBook won't open.  It says file too old, need to save to Pages 09. 
    Tried opening the old documents in Pages 08 and saving them, but still can't open them.
    Any suggestions?

    Further to my earlier post about this problem, our IT man came in to the office, by coincidence, so I grabbed him and it seems that he has cracked it.
    You need to proceed as follows :
    Select the document by single click on the icon (i.e. select it but don't double click which will try to open it.)
    Go to File Menu and chose "Get Info"
    Half way down the drop down menu, chose "Open with" then select Pages 4.0 (i.e. the iWorks 9 version)
    This process will open that particular iWorks 8 document.
    But, if you also tick the "Change All" box it means that opening with the new version of Pages will become the default and will apply to all iWork 8 documents so you should not need to bother with this ever again.
    So far, that seems to work.
    (One might have thought it would have been a good idea for Apple to have built this in as a default ?)

Maybe you are looking for