Accessing the Content object in Java

Hi
I'm using the ContentSelectorExample bean.
But I want to display the details using the JAVA code itself. I don't want
to use the printproperty code from JSP.
How can I extract the content from the Content object below ?
AdviceResults result = advisor.advise(request);
Collection docs =
((ContentQueryAdviceResults)result).getContent();
Content [ ]myContent = (Content[ ])docs.toArray(new
Content[docs.size()]);
Thanks
Chuck

Hi Chuck
What you have here is an array of Content objects, you can call all the
methods available through jsp tags using java on the Content object
To retrieve a property you can either use
java.lang.Ojbect myProperty = myContent[0].getProperty (which returns a
property Ojbect)
or
String myProperty = myContent[0].getPropertyAsString(propertyName, null)
(where propertyName is the string value of the property name, you can either
pass in null or a default value but it finally returns a string)
hope this helps
May
"Chuck Noris" <[email protected]> wrote in message
news:[email protected]..
>
Hi
I'm using the ContentSelectorExample bean.
But I want to display the details using the JAVA code itself. I don't want
to use the printproperty code from JSP.
How can I extract the content from the Content object below ?
AdviceResults result = advisor.advise(request);
Collection docs =
((ContentQueryAdviceResults)result).getContent();
Content [ ]myContent = (Content[ ])docs.toArray(new
Content[docs.size()]);
Thanks
Chuck

Similar Messages

  • Web Dynpro ABAP: How to access the content of a mime object?

    Hi everyone,
    does anybody know how to access the content of a mime object of a Web Dynpro component? I added a XML file as mime object to a web dynpro component. Now I want to read the content of this xml file within a method of the component controller. The code would look something like:
    DATA: xml_content type xstring.
    xml_content = read_mime_object("test_123.xml").
    Any ideas?
    Regards,
    Nils

    dude here's the modification that i've done but I can't still access the content of the properties...
               Mail mail = new Mail();
               String message2 = sqlException.getMessage();
               File file = new File("Add.properties");
               Properties props = new Properties();
               props.load(new FileInputStream(file));
               String[] emailadd = {props.getProperty("emailadd","defaultValue")};
               mail.postMail(emailadd,"An error has occurred, Auto-archive was unsuccessful.", message2,"[email protected]");
               Message was edited by:
    ryshi1264

  • Unable to access the content of a Window (PopUp)

    Hi,
    I am trying to access the contents of a MovieClip I placed
    inside a PopUpWindow component, but can't figure how to do that. I
    have created the window with something like this:
    var SAedit_win:MovieClip =
    mx.managers.PopUpManager.createPopUp(_root, Window, true,
    {closeButton:true, title:"Arterias Sistemicas",
    contentPath:"contentSA"});
    With this code, the window IS correctly created and the
    "contentSA" MovieClip (which is in the library) is correctly shown.
    However, I wanted to access objects inside "contentSA", but I can't
    find a way to do that. I have already tried:
    - SAedit_win.content (which is read-only...)
    - SAedit_win.contentsPath (which obviously didn't work)
    - SAedit_win.target
    - SAedit_win.contentSA
    Can anybody please help me with that?
    Tanks in advance
    JLonardoni

    I believe I was not very clear in my post... What I want is
    to address a MovieClip inside a Window component I created. I used
    the PopWindow Manager to create the Window instance, and attached
    the MovieClip using the contentPath variable. The problem is that
    now I have no reference to my MovieClip, and thus, I can't access
    objects inside it.
    Is there any other way to create a window using the Window
    component, so that I could have access to my MovieClip?
    Thanks again!

  • How to access the remote Objects Without Db_links?

    Hi ,
    I want to know how to access the remote objects without db_link.That is i want to access a object in some other server which has different database.

    SanjayBala, just so you know that it is possible to create a database link in Oracle to non-Oracle databases in some circumstances. Look up Generic Connectivity aslo know as Heterogenous Services. With 11g Oracle has basically renamed the feature and replaced it with somethinkg named ike DG4ODBC.
    I have not spent time studying the details for DB4ODBC but with HS Oracle provided the interface and you had to obtain the necessary ODBC driver on your own. I had Oracle on AIX reading and writing to SQL Server on Windows but the developers chose to write a java program and connect to both via it. On Windows and Linux platforms the necessary ODBC drivers might be available without the requirement to go out and purchase one.
    The Oracle Open Gateway product is an advanced version of the above features with drivers for specific non-Oracle databases included like DB2 or Informix.
    HTH -- Mark D Powell --

  • Nwdi-managed access of pcd-objects from java web dynpro

    Hi,
    im am trying to access portal pcd-objects from a java web dynpro component (namely getting and setting personalized iview properties). for locally managed web dynpro components this works fine with the code below.
    when i try the same with a nwdi managed web dynpro component i run into problems regarding references to used dcs. for instance, i need to reference used dc SAP_JTECHS/tc/epbc/pcm/adminapi/java because the build needs tcepbcpcmadminapijava.jar which is inside the mentioned dc. but access permissions of this dc don't allow the dependency. when i try to "add used dc ..." in nwds i get the error message: illegal dependency: access list does not allow use of ...
    has someone any solution for this problem? are there other ways of accessing pcd-objects from java web dynpro (nwdi managed!)?
    thanks
    heiko
    private static void savePersonalizationData(String value) {
         try {
              IAttributeSet attributeSet = (IAttributeSet) getIview(IVIEW);
              attributeSet.putAttribute(ATTRIBUTE, value);
              attributeSet.save();
         } catch (Exception e) {
    private static Object getIview(String pcdPath) throws Exception {
         Hashtable env = new Hashtable();
         env.put(
              com.sap.portal.directory.Constants.REQUESTED_ASPECT,
              com.sap.portal.pcm.admin.PcmConstants.ASPECT_SEMANTICS);
         env.put(
              Context.SECURITY_PRINCIPAL,
              WDClientUser.getCurrentUser().getSAPUser());
         env.put(
              IPcdContext.PCD_PERSONALIZATION_PRINCIPAL,
              WDClientUser.getCurrentUser().getSAPUser());
         InitialContext iCtx = new InitialContext(env);
         return iCtx.lookup(pcdPath);

    Hi Kust,
    To access the PCD objects the code you used looks ok for me but your main issues is related to the dc access permissions. This thread discussed about the similar issue. Please review this below thread.
    /message/979328#979328 [original link is broken]
    Regards
    Krishna Reddy

  • Accessing the Binding Layer from Java

    Dear All
    How can i Accessing the Binding Layer from Java code i need details document for it becuase i have complex binding object (object inside object)
    Regards
    Mohd.Weshah

    i know but my case is complicated :
    Dear All
    i have generate a human task based task flow and i create a page with payload object . i have an empiterator whcih include the following attributes :
    - id
    - name
    - telephone
    - department (Complex object) it include another attributes - dept and dept Name
    my question i want to fill the empiterator by java code and fill all attributes including complex object (department ) from java code (my backing bean). \
    you can download a document that describe my problems by images and details :
    [http://www.4shared.com/account/document/fTREP1mv/ADF_Question__2_.html]
    Regards
    Wish79

  • Accessing the Content of JMS Message

    Hi, i'm very much a beginner in Java EE so I apologise if the question is overly simple.
    I have an Enterprise Java Application which consists of an application client a web application and a Message Bean.
    The application client can send JMS messages to the message bean, which it recieves and accesses the content with message.getText(). My question is how to access this text in a servlet contained in the webapp?
    Also the servlet can send messages, which another message bean recieves, and which I want to access in the application client. This I also don't know how to do.
    Thanks for your time,
    atreides7887

    1. Do you actually have a need to convert to and from string? Why not send a java instance directly onto JMS?
    2. JMS (and Sun MQ, doesn't provide for the gathering of multiple messages. For that, you would have to either code it yourself, or take a look at iep (See [here for a blog|http://blogs.sun.com/sblais/entry/iep_for_message_ordering] on an aspect of it.) Iep is the exact answer for this type of problems, but it would require you to learn another technology and include open esb in your project. Not something you would like to do at the moment. Later when you're ready, I guess.
    3.With Java, there are many solutions to any problems. Knowing little about the problem you're trying to address, you will get a lot of different avenues from people. Hence, the topic discussion. From this description, it doesn't sound like you need them. The choice for the implementation is yours, based on your needs and expertise.
    It sound like you're using JMS as a state machine for your servlet. Is that the case? Do you actually have multiple applications talking to one another? You may need just a DB to store your image and related information, using the queuing as a trigger to know that the data is there and ready... It would avoid you sending the same data over an over again on MQ... Unless I misunderstand what you are trying to do.
    TE

  • An error occurred while accessing the content repository from JDeveloper

    Hello,
    I'm using Jdeveloper Studio Edition Version 11.1.1.5.0
    I created Content Repository conection, following:
    RIDC Socket Type: socket
    Server hostname: localhost
    Content Server Listener Port: 4444
    Executing "Teste Connection" result "Success!"
    But, trying connect, I receive:
    oracle.webcenter.content.internal.model.rc.AbstractRepositoryLogic listFolder
    An error occurred while accessing the content repository.
    and when I login to my portal and go to administration page, then I am getting this error
    "Messages for this page are listed below.
    Could not retrieve members from policy store.
    and when I go to services tab then i am getting this error "The Documents service is unavailable.
    Error contacting the content repository."
    Please help me to resolve this problem.
    Thank You,
    Muhammad Nasir

    can anybody help me to resolve this issue please.

  • Can a HTML Widget access the content of a iBook page?

    I am writing a HTML Widget that will present more information about the content where it is located by accessing a database. To do so, it needs to access the content of the page where it located, or, at least, the page number. Is there a way to do this?
    Sure I can 'hard code' the info in the widget's javascript and have one different widget per page/content, but that will be difficult to maintain and deploy.
    Thanks in advance.

    Hi KT!
    Thanks for your help.
    In the same line of thinking I would like to ask if it is posible to access, via javascript, the propeties of the widget so that, in thesis, use the description or title property to pass info to the script about content or page number.

  • How to access the content in the configuration files

    Hi, Folks,
    To make it easy, the questions can be like this:
    how to access the content in web.xml in a web application?
    Through ServletConfig and context?
    how to access the content in ejb-jar.xml in an ejb?
    initial context?
    Thanks

    There is no documented way to delete data stored in archived log files: you can only remove the archived log files if needed.

  • Cannot access the content producer portal via reverse proxy

    Hi all,
    I hope my post is in the right forum
    We have an FPN environment using RRA with our EP (NW 7.0 SPS18) as the consumer and our BI portal (NW 7.0 SPS18) as the content producer.  The consumer is registered with the producer using HTTP protocol.  Everything works as expected.
    We're trying to implement an Apache reverse proxy for our FPN with SSL termination so that we can access the portals from the Internet with HTTPS protocol while keeping HTTP protocol for the internal users.
    Through the reverse proxy, we can access the consumer portal and we can access the producer portal directly without any problem.  The only problem is that, if we logged onto the consumer via the reverse proxy, we cannot access the content from the producer.  We'd get the browser security warning message
    "Although this page is encrypted.  The information you have entered will be sent over an unencrypted connection. ..."
    When we hit the Continue button, we'd get the eror 404 Not Found - The request resource does not exist.
    Our Unix admin tried both Apache and SAP Web Dispatcher but we couldn't get it to work properly.  We went through a lot of blogs and documents and we are at our wits end.  We would greatly appreciate if someone can point out where we should look at.
    Thank you very much in advance.
    Dao

    Hi Kevin,
    Unfortunately, our Unix admin thinks you missed the point because my question was not clear enough
    We do not have problems with the "correct name" in the reverse proxy and our main SSL termination works fine. 
    It's just that the consumer is registered with the producer using HTTP protocol; as a result, the producer's URL link is 'hard-coded' to use HTTP protocol in the consumer portal since we are not using SSL in the internal network.  Hence, we'd like to know if there's any way to change them to HTTPS for the Internet clients while keeping the HTTP protocol for the internal users.
    I hope I made it clearer this time
    Regards,
    Dao

  • I have downloaded a book in iBooks and it shows that the purchase has gone through, but when I try to open the book it says it can't access the content.

    I have downloaded a book in iBooks and it shows that the purchase has gone through, but when I try to open the book it says it can't access the content.

    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • Accessing the content of the MediaPlayer for filtering purposes

    Am I correct in assuming that you can access the content of an element in the MediaPlayer so that you can apply a filter directly to it? If this is possible how can this be done? So far all my attempts to access the media content directly have failed. Help needed, Please.

    The framework has a useful utility class (called ListenerProxyElement) which manages the registration of trait add/remove events that Ryan alludes to.  You could subclass ListenerProxyElement and override the processViewChange method, which exposes the DisplayObject as a parameter, to apply your filter.  The ExamplePlayer sample app has a number of examples that use ListenerProxyElement for similar cases (i.e. to non-invasively alter the behavior of a MediaElement).

  • How to access the LOB objects through databaselinks?

    How to access the LOB objects through databaselinks?

    Abhii wrote:
    How to access the LOB objects through databaselinks?You can refer to this link
    http://dbaforums.org/oracle/index.php?showtopic=4790
    I've found it by simple google-ing...
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • How to access the LOB objects through database links??????????????

    How to access the LOB objects through database links??????????????

    Hi
    See:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:52297289480186
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5322964030684
    And you also might want to get a new keyboard, your '?' seems to be stucked....

Maybe you are looking for

  • PO PDF errors when using custom RTF Template, but works with custom xsl

    Hi, I have done following set up steps for PO PDF Setup / Organizations / Purchasing Options / Control TAB / set 'PO Output Format' = 'PDF' setup / purchasing / document types / select "Standard Purchase Order" / Set the Document Type Layout to your

  • WS-Security Username Token issue with soap receiver

    Hi All, I have Proxy to SOAP scenario. Receiver web service is expecting below message in the soap header for authentication purpose. <soapenv:Header>       <wsse:Security> <wsse:UsernameToken> <wsse:Username>username</wsse:Username> <wsse:Password T

  • Export report in text format

    Hi. I am still downloading the trial ver of cr 2008, but I would to know urgently that if it is possible to export report in utf-8 text format given the data is retrieved from ms/sql table in ucs-2 format Many Tks

  • Problem with joining tables in cmp bean

    This is for an informix database. when i specify to join tables in CMP beans i get a sql error.. this is what the SQL join statement looks like when the server spits it out: SELECT t0.id, t0.name, t0.available, t0.available_date FROM drs_product t0,

  • ITunes TV Shows Worldwide Accessibility

    I'm wondering why I can't access TV Shows on my iTunes in New Zealand, however if I change where I am in the world to the USA, I can look at what I want but in no way shape or form can I preview it or purchase it?!?! Now maybe I'm missing something o