Error while reading UcdContext [trying to read / set application values for users]

Hi,
I am trying to write a program to store user selected values on NW7.3 Portal using "User Content Directory". I can see and read some code snippets on how to set and read the context but I am getting one error after another.
The error message I am getting is
"com.sapportals.portal.pcd.gl.PcdGlContext:service:[email protected]entClassLoader@84507ed@alive incompatible with interface com.sapportals.portal.pcd.gl.IPcdContext:sap.com/[email protected]der@f46d103@alive ". Code snippet is as given below at the end of the message.
1) I tried different ways to have a lookup and always gave message as "look up not found" and for pcd:portal_content came up with above error.
2) Once I read the UCD context, I would like to store some values based on user selection and store them. User may change the values whenever they like and I will be using the values for other purposes in another application.
3) Has any one successful in setting and reading UCD Context in NW 7.3. Will it be possible to share such sample code as the code snippets at http://help.sap.com/saphelp_nw73ehp1/helpdata/en/4a/8e1bce28e24dd8abd9f4de05e5587d/content.htm are not much of use unless I am able to read the UCD.
Thanks for your help!
Regards,
Raju
TestingUCD is my test application and the following is code snippet
InitialContext initialContext = null;
IPcdContext pcdCtx;
Hashtable env = new Hashtable();
env.put(UCD_INITIAL_CONTEXT_FACTORY, UCD_INITIAL_CONTEXT_FACTORY);
env.put(Context.SECURITY_PRINCIPAL, request.getUser());
env.put(Constants.REQUESTED_ASPECT, IPcdAttribute.PERSISTENCY_ASPECT);
try{
initialContext = new InitialContext(env);
//response.write("Before pcdCtx lookup");
try {
pcdCtx = (com.sapportals.portal.pcd.gl.PcdGlContext) initialContext.lookup("pcd:portal_content");
} catch(Exception e){
response.write("Some problem with lookup" + e.getMessage());

Hi,
There are quite few differences in the standard code snippet given by SAP Help on UCD and the once that you put above in the question.
Below is standard snippet.
Hashtable<Object, Object> env = new Hashtable<Object, Object>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
IPcdContext.UCD_INITIAL_CONTEXT_FACTORY);
env.put(Context.SECURITY_PRINCIPAL, user);
InitialContext ctx = new InitialContext(env);
pcdCtx =  (IPcdContext) ctx.lookup("");
============================
Check the ones highlighted in BOLD and compare them in your code. In your code when ur doing initial lookup you are not using the Correct class type cast for the returned lookup object!
Your code shows as below:
pcdCtx = (com.sapportals.portal.pcd.gl.PcdGlContext) initialContext.lookup("pcd:portal_content");
But may be it shd have been something like below:
pcdCtx = (IPcdContext) initialContext.lookup("pcd:portal_content");
Pls verify and hopefully this resolves your issues around look up.
Thanks,
Swapna Priya.

Similar Messages

  • HT201320 Dear all,  while i was trying to dowload an application i received an error "your apple id has been disabled" . I need your assistance

    Dear all,  while i was trying to dowload an application i received an error "your apple id has been disabled" . I need your assistance

    You will need to contact Apple support: http://www.apple.com/support/itunes/contact/

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • Setting default values for field on screen.

    Hello,
    I am trying to set default value for one of the fields I have on screen when I execute the custom transaction.
    I am doing that in PBO as follows. But the default value is not set for Date field.
    PROCESS BEFORE OUTPUT.
    MODULE PBO_OUT.
    MODULE STATUS_5000.
    *&      Module  STATUS_5000  OUTPUT
          text
    MODULE STATUS_5000 OUTPUT.
      SET PF-STATUS 'NON_SAP_DOCUMENT'.
      SET TITLEBAR '001'.
    ENDMODULE.                 " STATUS_5000  OUTPUT
    *&      Module  PBO_OUT  OUTPUT
          text
    MODULE PBO_OUT OUTPUT.
      ERDAT = SY-DATUM.
    ENDMODULE.                 " PBO_OUT  OUTPUT
    Please help.
    Thanks.
    Regards,
    Rajesh.

    Works Now...

  • Is there any way we can set default value for a Date Attribute to current date in Master Data Services

    Is there any way we can set default value for a Date Attribute to current date in Master Data Services.
    I as well wants to know that is there any posibility to show Calendar control while input data into respective date attributes.
    Thanks.

    Hi Anagha,
    So far i havent found any way to set todays date by default from MMI, but i guess this flow should work as workaroud
    1. Add buisness rule which can set a default value when Date = NULL/Blank
    2.get the entity table ,use -select EntityTable from mdm.tblEntity where Name = '<enter entity name>'
    3.Go to that table and add a after update trigger like
    if uda_<entityid>_<attributeid(Date attribute)> = default value
    update uda_<entityid>_<attributeid(Date attribute)> =getdate() where id = <LastUpdatedRow>
    I will check on this too from my side.
    By the way AFAIK i dont think so calendar control integration is possible .

  • UDF - Set Valid Values for Field

    I have a UDF created in Marketing Docs / row level called UOM_Ordered (alphanumeric, length 2) using Set Valid Values for Field.  Values are:
    CS
    IN
    DZ
    PC
    Above are CS abrev for Case, IN abrev for Inner, DZ abrev for Dozen .................
    If possible could I have say for example "IN" not to appear in the drop down if the value in OITM (UDF called U_Inner_Qty) is either NULL or a Zero?  It's would be a way to stop mistakes when orders are inputted.
    Any help on this would be appreciated.
    Thks - Scott

    Hello
    You could try the following:
    Insert a formatted search on the field, which contain conditions, ie whether the condition that the value is 0 or null, then bring the required data, while if it is not the case, applies the search formatted with the available data.
    On the other hand, leave the form with all the options for disabled users. The latter through additional authorizations for users
    I hope it will help
    Best regards,

  • Set init values for Edit Form

    Hi!
    I'm using JDev 10.1.3+ADF+Struts
    I have some attributes in viewObject, and have related bindings in PageDef. I whant to set init values for that attributes in 2 cases:
    1. Edit Form doesn't contain fields for entring attribute value.
    For example:
    Current_User
    Creation_Date
    etc.
    2. Edit Form contain fields for entring attribute value. And i want that input fields display my init values.
    The purpose is to perform it in onCreate event in PageController.
    But i don't know where to put my values.
    Any help will be appriciated!

    Thank you very much!
    Maybe my question is not so clear.
    I mean, when we call event=Create i need to set values, but before Submit/Commit the Row in viewObject is not exist.
    So I founded solution for this issue - to set my values in method 'create' of Entity Object.
    I have another big problem i confused with. Would you help me, please?
    Description is here:
    Database Constraint Error Handling on create/edit (Struts ADF)

  • Set a value for a variable of type exit

    Hello,
    I am filling some variables with multiple values in user exit.
    Now, i would like to place some of these characteritics in Header area. It's of course impossible because there is multiple values but ...
    I will put dropdown box in the web application for these chars. The problem is that by default, any value is assigned to the dropdwom ( any variable value is set).
    Do you know how i can set a value for theses variable after filling all values by the user exit. SO that only one value is selected for the header and all others values available in the dropdown ?
    Regards,
    Jarod

    Hi,
    Off late, this seems to be a usual requirement.
    Just create a Z program to call the FM API_SEMBPS_VARIABLE_SET and then call the FM API_SEMBPS_POST.
    you should be preparing the content/set value to pass to the FMs. check the whereused list to see how this FMs can be used/called.
    finally, run this program for your variable, after the loading/filling the exit variable. Please note that to set 'exit' variables, the sourcing variable's content need to be read/set first before setting the exit varible.
    HTH,
    Regards,
    Nataraj.

  • Set default Value for a key figure

    Hi Experts,
    I need to enter a set o value for some char in a layout but for this set is not relevance a keyfigure. I know that there needs to be a keyfigure in the layout for the data to be saved to the transactional cube.
    So is there a way to write a default value to the keyfigure without the user having to enter the keyfigure in the layout?
    Any help will be rewarded.
    Many thanks,
    Fabio

    I gave an example of = 0.
    In youe case, if the default value is other than zero,
    then:
    = value.
    Ravi Thotahdri
    Pl let me know what fox code do you have.

  • Set Default values for Value mapping

    Hi All,
    I have some specific value set for which I have used a Value mapping into Message Mapping .
    My problem is I want to set a default value for the target value and I dont know how to set it in Value mapping ..
    And also if you can suggest me how to set target value for Null source value ...
    Thanks in Advance..

    hi
    Take a constant for sender side and give the value for that constant.After that take a value mapping function fron Conversions of Mapping Functions.
    And give the values of  Value Mapping Context as :http://sap.com/xi/XI
    After that define Agency and Schema for sender and Refceiver with values what ever u have manually.

  • Programatically setting column values for table

    hi...
    I am programatically setting column values for table.
    But these values are not getting reflected on table after commit.
    I mean to say,new values are not persisted after commit.
    The code is as follows,It is in Application Module class
    public void createRecord()
    OAViewObject vo = (OAViewObject)this.getOpptyLoeVO1();
    if (!vo.isPreparedForExecution())
    vo.executeQuery();
    Row row = vo.createRow();
    row.setAttribute("Id",new Number(850));
    row.setAttribute("Model","Honda");
    row.setAttribute("Role","Team Lead");
    row.setAttribute("Hours",new Number(35));
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    getTransaction().commit();
    Here "Id,Model,Role,Hours" are columns in table .

    Hi,
    is your VO based on an Entity Object?
    If not, you can't update values in the DB using only a View Object!
    If yes, you should control that, in your VO, you have not selected the flag "Read Only" for the EO you want to update.
    Hope this helps you.
    Bye
    Raffy

  • Set Application Parameter for Table

    Hi all,
    Can anyone explain me how to set application parameters for a web dynpro application. Is is embedded in an iView in Portal.
    I want to set the parameter WDTABLENAVIGATION to SCROLLBAR. I cant find it under Application properties.
    Thanks

    Florian,
    Please see [this document|http://help.sap.com/saphelp_nw04s/helpdata/en/7b/fb57412df8091de10000000a155106/frameset.htm] and [this thread|Re: Scrolling in tables using Mouse scroll button;. I'm not sure whether WDTABLENAVIGATION application parameter is available in Web Dynpro Java but it is available in Web Dynpro ABAP for sure.
    Hope this helps.
    Vishwas.

  • How to set defalut values for html:radio

    Hi all,
    can you please tell me how to set defalut values for radio buttons (html:radio) in struts?

    You may have more luck if you ask this Struts specific question in a forum devoted to Struts at their own homepage over there at apache.org. It may also help a lot to read its documentation and tutorials. I would really be surprised if they didn't even document such a trivial thing.

  • How to Set default value for taxonomywebtagging control with terms and nested terms

    Hi,
    I have created taxonomy control in custom aspx page and I am able to select terms but I am trying to setup default value to that control.
    Can anybody let me know how to set the default value for TaxonomyWebTagging control in custom.aspx page with nested terms?
    Any help would be greatly apprecited.
    Control code in aspx page:
    <td>
    <asp:Label runat="server" ID="lblLanguages">Field A: </asp:Label><asp:Label runat="server" ID="rfvlblLanguages" CssClass="errorMsg" ForeColor="Red">*</asp:Label>
    </td>
    <td>
    <Taxonomy:TaxonomyWebTaggingControl ID="term" Width="385px" runat="server" /></td>Mapping metedata code:TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
    //Set the Business Unit Field
    SPSite site = SPContext.Current.Web.Site;
    TermStore termStore = session.TermStores["Managed Metadata Service"];
    Group group = termStore.Groups["GROUPName"];
    TermSet termSet = group.TermSets["TERMSETNAME"];
    Term term = termSet.Terms["TermA"];
    Guid termGuid = term.Id;
    term.SspId.Add(termStore.Id);
    term.TermSetId.Add(termSet.Id);
    term.AllowFillIn = true;
    term.AnchorId = countryGuid;
    term.IsMulti = true;
    Thank you.
    AA.

    Hi,
    According to your description, you want to set default value for TaxonomyWebTaggingControl.
    I have a test in my environment. It could be achieved by setting the Text Property of TaxonomyWebTaggingControl.
    Here is the code snippet:
    TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
    SPSite site = SPContext.Current.Web.Site;
    TermStore termStore = session.TermStores["Managed Metadata Service"];
    Group group = termStore.Groups["GroupA"];
    TermSet termSet = group.TermSets["A"];
    Term term = termSet.Terms["A1"];
    TaxonomyWebTaggingControl1.SspId.Add(termStore.Id);
    TaxonomyWebTaggingControl1.SSPList = termStore.Id.ToString();
    TaxonomyWebTaggingControl1.TermSetId.Add(termSet.Id);
    TaxonomyWebTaggingControl1.TermSetList = termSet.Id.ToString();
    TaxonomyWebTaggingControl1.AllowFillIn = true;
    TaxonomyWebTaggingControl1.IsAddTerms = true;
    TaxonomyWebTaggingControl1.IsMulti = false;
    TaxonomyWebTaggingControl1.Text = string.Format("{0}|{1}", term.Name, term.Id.ToString());
    Here is a detailed article for your reference:
    http://blog.bugrapostaci.com/2010/09/23/taxonomywebtaggingcontrol-sharepoint/
    Feel free to Reply the test result.
    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

  • Extending flash: how do I set default values for filenames

    Hi,
    I am trying to set default values for filenames
    <choosefile> and <popupslider>s that will show up when
    my XMLpanel first loads in my jsfl extension file. It seems that I
    can only set default values for textbox items.
    How do I do this for filenames and popups?
    As a workaround, I also tried using a flash object dialog box
    to look like a <choosefile>, or any jsfl command, but then
    how do I return those values back to the XMLpanel that calls them.
    and pass the data back to my jsfl script.
    lemme know if you know a way,

    Create two constants for the Allocate Mode input (right click > create > constant). Place one in the true case of the case structure, and place the other one in the false case. Wire them to the same tunnel (border of the case structure), then wire the tunnel to the Allocate Mode terminal of the AO Config. I don't have Traditional DAQ installed, but that should do it.
    Misha

Maybe you are looking for