Programmatic "Content management API"?

Is there any programmatic (Java) "Content management API"?
I'm developing a webservice through which I want to "simulate" user activity in the portal - to add items, create folders etc.
My concept:
Deploy a Java webservice that calls CM API.
Call this webservice from a different (nonJava) application to do the task.
In other words, I need an API to connect to. Is it a good concept or possible at all?
Or is the only way PL\SQL?
Is this the right forum to ask?
Thank you, Peter

Emil,
even there are not yet Java APIs for Content management, you can rely on PL/SQL APIs that exist.
These APIs are provided trough a database plsql package which is : WWSBR_API.(since 9.0.2.6)
http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1012/wwsbr_api.html
You just need, either to generate a WebService based on the different procedures of functions, or create you own WebServices accessing to these pacakges via jdbc.
Jdeveloper provide a wizzard for generating a WS from an existing PLSQL package.
There are some limitations (restrictions on data types or collections), but that works for most of case.
About Content API, there is a good probability that these APIs become more rich (I don't know if it will be both for Java and PlSql).
Patrick.

Similar Messages

  • Using content management API

    Hi all,
    i'm a beginer in weblogic portal.
    i want to use content management API to publish content, such as add content type, add content, edit content . . .
    can anybody help me or give me document link.
    Thanks!!!

    There used to be a contentSamples App that pretty much did most of this, I cant find this online.
    i have the zip for 9.2 (there shouldnt be many changes between 9.2 and 10) , if you want a copy of this app send me your email

  • Content management API

    Hi all,
    We have few thousand contents in our content repository. I have developed code using CM API to checkout and approve them one by one and check-in back into the repository.
    But it fails after approving few hundred contents, with timeout exception.
    What is the way to overcome this?.
    Regards,
    Bharat.

    Hi Bharat,
    You could do a couple of things here - the easiest would be to increase your JTA timeout value, but you may also just chunk the work you're doing into more manageable pieces so you don't exceed the timeout value. For example, you could do this check-in over different areas of your node hierarchy at a time.
    If you have the use-case to automatically publish newly created content you could write an event listener to do so.
    Let me know if this helps or if your use case is different.
    -Ryan

  • EWS Managed API - Attachment content empty

    Exchange 2010
    Managed API 1.1
    I'm grabbing attachments through EWS and serving them through a web service (WCF).
    The code:
    ownerId = ServiceFactory.MakeEmailAddress(ownerId);
    var service = ServiceFactory.InstantiateService(ownerId);
    var id = new AlternateId(IdFormat.HexEntryId, mailId, ownerId);
    var convertedId = (AlternateId)service.ConvertId(id, IdFormat.EwsId);
    var mail = EmailMessage.Bind(service, convertedId.UniqueId);
    service.LoadPropertiesForItems(new[] { mail }, new PropertySet(ItemSchema.HasAttachments, ItemSchema.Attachments, ItemSchema.ParentFolderId));
    var folder = Folder.Bind(service, mail.ParentFolderId);
    var fileAttachment = (FileAttachment)mail.Attachments[int.Parse(index)];
    fileAttachment.Load();
    Response.ContentType = fileAttachment.ContentType;
    Response.AddHeader("Content-Disposition",
    "attachment; filename=\"{FILENAME}\""
    .Replace("{FILENAME}", fileAttachment.Name.Replace("\"", "'")));
    fileAttachment.Load(Response.OutputStream);
    The problem is an attachment that seems like any other that returns 0 bytes in content and writes 0 bytes to the outputstream. I'm serving thousands of attachments without problems but this single one returns nothing. 3 other attachments in the same email
    message download without problems and if I look at the email in the exchange store the attachment is there and can be opened with outlook without problems. When stepping through the code I can see that the .Content property of the attachment (after calling
    Load()) is a byte[] with length 0.
    Is there anything additional I need to look at to make sure the content of the email attachment is downloaded? Is there a known issue with certain types of attachments that I need to be aware of?
    Regards, Högni

    I'm also facing the same issue. Below is the test case
    Request
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
      <soap:Header>
        <t:RequestServerVersion Version="Exchange2007_SP1"/>
      </soap:Header>
      <soap:Body>
        <GetAttachment xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
          <AttachmentShape/>
          <AttachmentIds>
            <t:AttachmentId Id="AAMkADkxZTExYmYzLTNhNjYtNDVhZC1hMzAxLWIzMjJiOTZhNjc3MgBGAAAAAABDBmTDBIV/SrBeyEXp602zBwBvhQ5C5FifRa4nmfNLZFw2AAH1IZfuAAD9KAeK/K68QpkzVbTgFhg+AHy3pBsmAAABEgAQAM7EQkmoHfhNkjAyo4TroB0="/>
          </AttachmentIds>
        </GetAttachment>
      </soap:Body>
    </soap:Envelope>
    Response
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Header>
        <t:ServerVersionInfo xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" MajorVersion="8" MinorVersion="3" MajorBuildNumber="279"
    MinorBuildNumber="5" Version="Exchange2007_SP1"/>
      </soap:Header>
      <soap:Body>
        <m:GetAttachmentResponse xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
          <m:ResponseMessages>
            <m:GetAttachmentResponseMessage ResponseClass="Success">
              <m:ResponseCode>NoError</m:ResponseCode>
              <m:Attachments>
                <t:FileAttachment>
                  <t:AttachmentId Id="AAMkADkxZTExYmYzLTNhNjYtNDVhZC1hMzAxLWIzMjJiOTZhNjc3MgBGAAAAAABDBmTDBIV/SrBeyEXp602zBwBvhQ5C5FifRa4nmfNLZFw2AAH1IZfuAAD9KAeK/K68QpkzVbTgFhg+AHy3pBsmAAABEgAQAM7EQkmoHfhNkjAyo4TroB0="/>
                  <t:Name>@</t:Name>
                  <t:Content/>
                </t:FileAttachment>
              </m:Attachments>
            </m:GetAttachmentResponseMessage>
          </m:ResponseMessages>
        </m:GetAttachmentResponse>
      </soap:Body>
    </soap:Envelope>
    Regards,
    Somnath Panja

  • Accessing the user management API programmatically

    I am looking for the officially supported method that could be used to access the user management API via "curl" for CRX:
    There is a user management API described here:
    http://sling.apache.org/site/managing-users-and-groups-jackrabbitusermanager.html
    However, executing a command on CRX 2.2 such as:
    curl -u:admin:admin http://localhost:7402/system/userManager/user.tidy.1.json
    Only returns a message indicating that the contents have been redirected (without providing another URL).
    Using the Content Explorer in CRX shows the list of users at: /home/users but I am not sure if a curl command could access the user list via that URL.
    Any pointers on how this could be done are appreciated.  This is for a partner.
    Regards,
    Blair

    I am a co-worker of MorrellJ.  I am trying to do a change password request using the Jackrabbit User Manager with the REST URL /system/userManager/user/<username>.changePassword.json.  The problem I am having is that this request requires an oldPwd form param in the request.  The issue is that when I am trying to do this request it is in response to the user selecting "Forgot Password" so our logic has created a random password which we then email to the user so they can use that the next time they want to login.  We need to change that user's password in CRX so they can log in using it next time.  Since they haven't logged in there is no session, NOT the problem.  THE PROBLEMS, I don't know 1. how to use the userManager to get that user's old password, since /system/userManager/user/<username>.json doesn't appear to return the password and 2. if I could get the old password it most certainly will be encoded, some how, so I will need some decoding algorithm to pass it through in order to get the actual password to set as the oldPwd form param to my change password request.  Please let me know if you require any further explanation.  Any assistance would be greatly appreciated.  Thank you, in advance, for your assistance.
    Sincerely,
    Mike Sucena
    [email protected]

  • How to get the url of a document in content management?

    Hello,
    I have used API  'SKWF_PHIO_CONTENT_URL_GET to get the url of a file in CRM content management. But when I tried to open this url in explorer got error message "SSF error: Decoding not possible". Could any one please help me to resolve this problem.
    Thanks
    Nisha

    Thanks for replying - unfortunately, there is not much
    support on these forums.
    I wish there was some way to emulate the mouse from
    Javascript to click the play, pause, and slider buttons... but one
    would't even know, programmatically, the location on screen of the
    play, pause, and slider buttons.
    quote:
    Originally posted by:
    davexnet
    You'll notice that questions like this don't get answered on
    this
    forum. The Flash player has a philosophy that skews the power
    over almost everything about it to the content providers,
    and precious little control, if at all, to the client player.
    It's a crappy situation - I use Flashblock in Firefox and
    only view the
    content *I* want to see.
    It works for me, particularly since I'm using an older
    (slower )
    computer that really gets bogged down by aggressive Flash
    content.

  • Getting the message "The sharing message is not supported." while sharing the calendar using ews managed api.

      public void ShareCalendar(Calendar calendar)
                ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
                  service.Credentials = new NetworkCredential("user1", "password", "domain");
                service.Url = new Uri("https://sampleUrl/ews/exchange.asmx");
                try
                    // Bind to the folder
                    //Folder folderStoreInfo;
                    //folderStoreInfo = Folder.Bind(service, calendar.ExchangeId);
                    //string EwsID = folderStoreInfo.Id.UniqueId;
                    string EwsID = calendar.FolderExchangeId;
                    // The value of folderidHex will be what we need to use for the FolderId in the xml file
                    AutodiscoverService autoDiscover = new AutodiscoverService(ExchangeVersion.Exchange2013);
                    autoDiscover.Credentials =  new NetworkCredential("user1", "password", "domain");
                    autoDiscover.RedirectionUrlValidationCallback = RedirectionUrlValidationCallback;
                    Dictionary<string, string> userSettings = GetUserSettings(autoDiscover);
                    string folderidHex = GetConvertedEWSIDinHex(service, EwsID, "[email protected]");
                    string domainName = string.Empty;
                    string mailBoxServer = string.Empty;
                    string userName = string.Empty;
                    foreach (var item in userSettings)
                        switch (item.Key)
                            case "UserDN":
                                domainName = item.Value.ToString();
                                break;
                            case "InternalMailboxServer":
                                mailBoxServer = item.Value.ToString();
                                break;
                            case "UserDisplayName":
                                userName = item.Value.ToString();
                                break;
                    string entryId = GetIntiatorEntryID(domainName);
                    string mailboxId = GetInvitationMailboxId(mailBoxServer, domainName);
                    string sharedFilePath = CreateSharingMessageAttachment(folderidHex, userName, entryId, mailboxId, "[email protected]", "calendar", calendar.FolderName);
                    // Create a new message
                    EmailMessage invitationRequest = new EmailMessage(service);
                    invitationRequest.Subject = "I'd like to share my calendar with you";
                    invitationRequest.Body = "Sent by Exchange Administrator on behalf of user";                
                    //invitationRequest.Culture = "en-US";
                    invitationRequest.Sensitivity = Sensitivity.Normal;
                    // Set a sharing specific property on the message
                    invitationRequest.ItemClass = "IPM.Sharing"; /* Constant Required Value [MS-ProtocolSpec] */
                    byte[] byteEntryId = HexStringToByteArray(entryId);
                    // This is the Guid of the Sharing Provider in Exchange, and it's value does not change
                    Guid binSharingProviderGuid = new Guid("{AEF00600-0000-0000-C000-000000000046}");
                    // Even though I don't think setting this property is mandatory, 
                    // it just seemed like the right thing to do and it works so I \
                    // ain't messin with it!                                        
                    byte[] byteSharingProviderGuid = binSharingProviderGuid.ToByteArray();
                    string strPRBODYHTML = "<html dir=\"ltr\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n<meta name=\"GENERATOR\"
    content=\"MSHTML 8.00.7601.17514\">\r\n<style id=\"owaParaStyle\">P {\r\n   MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px \r\n}\r\n</style>\r\n</head>\r\n<body fPStyle=\"1\" ocsi=\"0\">\r\n<tt>\r\n<pre>SharedByUserDisplayName
    (SharedByUserSmtpAddress) has invited you to view his or her Microsoft Exchange Calendar.\r\n\r\nFor instructions on how to view shared folders on Exchange, see the following article:\r\n\r\nhttp://go.microsoft.com/fwlink/?LinkId=57561\r\n\r\n*~*~*~*~*~*~*~*~*~*\r\n\r\n</pre>\r\n</tt>\r\n<div>\r\n<div
    style=\"direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;\">this is a test message</div>\r\n</div>\r\n</body>\r\n</html>\r\n";
                    string strBODY = @"
    SharedByUserDisplayName (SharedByUserSmtpAddress) has invited you to view his or
    her Microsoft Exchange Calendar.
    For instructions on how to view shared folders on Exchange, see the
    following article:
    http://go.microsoft.com/fwlink/?LinkId=57561
    *~*~*~*~*~*~*~*~*~*
    test body
                    // Convert these to hex and binary equivelants to assign to their relevant
                    // extended properties
                    string hexPRBODYHTML = ConvertStringToHex(strPRBODYHTML);
                    byte[] binPRBODYHTML = HexStringToByteArray(hexPRBODYHTML);
                    Guid PropertySetSharing = Guid.Parse("00062040-0000-0000-C000-000000000046");//constant 
                    Guid PropertySetInternetHeaders = Guid.Parse("00020386-0000-0000-C000-000000000046");//constant
                    ExtendedPropertyDefinition PidLidSharingProviderGuidProperty = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.CLSID);
                    ExtendedPropertyDefinition ConversationIdProperty = new ExtendedPropertyDefinition(0x3013, MapiPropertyType.Binary);
                    // Sharing Properties (in order of reference according to protocol examples in: [MS-OXSHARE])
                    // Additional Property Constraints
                    // [MS-OXSHARE] 2.2.5.2
                    ExtendedPropertyDefinition PidTagMessageClass = new ExtendedPropertyDefinition(0x001A, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.5.1
                    //ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "Content-Class", MapiPropertyType.String);
                    ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "Content-class", MapiPropertyType.String);
                    // Common Message Object Properties               
                    // [MS-OXSHARE] 2.2.1
                    ExtendedPropertyDefinition PidTagNormalizedSubject = new ExtendedPropertyDefinition(0x0E1D, MapiPropertyType.String);
                    // The PidTagSubjectPrefix is a zero-length string, so I do not set it
                    // ExtendedPropertyDefinition PidTagSubjectPrefix = new ExtendedPropertyDefinition(0x003D, MapiPropertyType.String);
                    // Sharing Object Message Properties
                    // [MS-OXSHARE] 2.2.2.12
                    ExtendedPropertyDefinition PidLidSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.Binary);
                    // [MS-OXSHARE] 2.2.2.13
                    ExtendedPropertyDefinition PidNameXSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-GUID", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.14
                    ExtendedPropertyDefinition PidLidSharingProviderName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A02, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.15           
                    ExtendedPropertyDefinition PidNameXSharingProviderName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-Name", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.16
                    ExtendedPropertyDefinition PidLidSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A03, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.17
                    ExtendedPropertyDefinition PidNameXSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-URL", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.5
                    ExtendedPropertyDefinition PidLidSharingFlavor = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A18, MapiPropertyType.Integer);
                    // [MS-OXSHARE] 2.2.2.6
                    ExtendedPropertyDefinition PidNameXSharingFlavor = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Flavor", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.1
                    ExtendedPropertyDefinition PidLidSharingCapabilities = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A17, MapiPropertyType.Integer);
                    // [MS-OXSHARE] 2.2.2.2
                    ExtendedPropertyDefinition PidNameXSharingCapabilities = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Capabilities", MapiPropertyType.String);
                    // Sections 2.3 and 2.4 are also zero-length strings, so I won't set those either
                    // [MS-OXSHARE] 2.2.2.3
                    // ExtendedPropertyDefinition PidLidSharingConfigurationUrl = new   //ExtendedPropertyDefinition(PropertySetSharing, 0x8A24, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.4
                    //ExtendedPropertyDefinition PidNameXSharingConfigUrl = new //ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "X-Sharing-Config-Url", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.10
                    ExtendedPropertyDefinition PidLidSharingLocalType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A14, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.11
                    ExtendedPropertyDefinition PidNameXSharingLocalType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Local-Type", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.7
                    ExtendedPropertyDefinition PidLidSharingInitiatorEntryId = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A09, MapiPropertyType.Binary);
                    // [MS-OXSHARE] 2.2.2.8
                    ExtendedPropertyDefinition PidLidSharingInitiatorName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A07, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.9
                    ExtendedPropertyDefinition PidLidSharingInitiatorSMTP = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A08, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.1
                    ExtendedPropertyDefinition PidLidSharingRemoteName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A05, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.2 
                    ExtendedPropertyDefinition PidNameXSharingRemoteName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Name", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.5 
                    ExtendedPropertyDefinition PidLidSharingRemoteType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A1D, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.6 
                    ExtendedPropertyDefinition PidNameXSharingRemoteType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Type", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.7 
                    ExtendedPropertyDefinition PidLidSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A06, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.8 
                    ExtendedPropertyDefinition PidNameXSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Uid", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.3
                    ExtendedPropertyDefinition PidLidSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A48, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.4
                    ExtendedPropertyDefinition PidNameXSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Store-Uid", MapiPropertyType.String);
                    //From troubleshooting I noticed I was missing
                    ExtendedPropertyDefinition PidTagPriority = new ExtendedPropertyDefinition(0x0026, MapiPropertyType.Integer);
                    ExtendedPropertyDefinition PidTagSensitivity = new ExtendedPropertyDefinition(0x0036, MapiPropertyType.Integer);
                    ExtendedPropertyDefinition PR_BODY_HTML = new ExtendedPropertyDefinition(0x1013, MapiPropertyType.Binary); //PR_BOD
                    ExtendedPropertyDefinition PR_BODY = new ExtendedPropertyDefinition(0x1000, MapiPropertyType.String);
                    ExtendedPropertyDefinition RecipientReassignmentProhibited = new ExtendedPropertyDefinition(0x002b, MapiPropertyType.Boolean);
                    // Section 2.2.1
                    invitationRequest.SetExtendedProperty(PidTagNormalizedSubject, "I'd like to share my calendar with you"); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
                    //invitationRequest.SetExtendedProperty(PidTagSubjectPrefix, String.Empty); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
                    // Section 2.2.2
                    invitationRequest.SetExtendedProperty(PidLidSharingCapabilities, 0x40220); /* value for Special Folders */
                    invitationRequest.SetExtendedProperty(PidNameXSharingCapabilities, "40220"); /* Test representation of SharingCapabilities value */
                    //invitationRequest.SetExtendedProperty(PidLidSharingConfigurationUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.3 */
                    //invitationRequest.SetExtendedProperty(PidNameXSharingConfigUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.4 */
                    invitationRequest.SetExtendedProperty(PidLidSharingFlavor, 0x20310); /* Indicates Invitation for a special folder [MS-OXSHARE] 2.2.2.5 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingFlavor, "20310"); /* Text representation of SharingFlavor value [MS-OXSHARE] 2.2.2.6 */
                    invitationRequest.SetExtendedProperty(PidLidSharingInitiatorEntryId, byteEntryId); /* Value from the Initiator/EntryId value in the Sharing Message attachment .xml document */
                    invitationRequest.SetExtendedProperty(PidLidSharingInitiatorSMTP, "[email protected]"); /* Value from Initiator/Smtp Address in the Sharing message attachment .xml document */
                    invitationRequest.SetExtendedProperty(PidLidSharingInitiatorName, "User1"); /* Value from Initiator/Name Address in the Sharing message attachment .xml document */
                    invitationRequest.SetExtendedProperty(PidLidSharingLocalType, "IPF.Appointment"); /* MUST be set to PidTagContainerClass of folder to be shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingLocalType, "IPF.Appointment"); /* MUST be set to same value as PidLidSharingLocalType */
                    invitationRequest.SetExtendedProperty(PidLidSharingProviderGuid, byteSharingProviderGuid); /* Constant Required Value [MS-OXSHARE] 2.2.2.12 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingProviderGuid, "AEF0060000000000C000000000000046"); /* Constant Required Value [MS-OXSHARE] 2.2.2.13 */
                    invitationRequest.SetExtendedProperty(PidLidSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.14 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.15] */
                    invitationRequest.SetExtendedProperty(PidLidSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.16 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.17 */
                    // Section 2.2.3
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteName, calendar.FolderName); /* MUST be set to PidTagDisplayName of the folder being shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteName, calendar.FolderName); /* MUST be set to same value as PidLidSharingRemoteName */
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteStoreUid, mailboxId); /* Must be set to PidTagStoreEntryId of the folder being shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteStoreUid, mailboxId); /* MUST be set to same value as PidLidSharingRemoteStoreUid */
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.5 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.6 */
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteUid, folderidHex); /* MUST be set to PidTagEntryId of folder being shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteUid, folderidHex); /* Must be set to same value as PidLidSharingRemoteUid */
                    // Section 2.2.5
                    invitationRequest.SetExtendedProperty(PidNameContentClass, "Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
                    invitationRequest.SetExtendedProperty(PidTagMessageClass, "IPM.Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
                    // ********* ADDITIONAL MAPPED PROPERTIES IM FINDING AS I TROUBLESHOOT ********************** //
                    invitationRequest.SetExtendedProperty(PidTagPriority, 0); /* From troubleshooting I'm just trying to match up values that were missing */
                    invitationRequest.SetExtendedProperty(PidTagSensitivity, 0); /* From troubleshooting as well */
                    invitationRequest.SetExtendedProperty(PR_BODY_HTML, binPRBODYHTML); /* From troubleshooting OWA error pointing to serializing HTML failing */
                    invitationRequest.SetExtendedProperty(PR_BODY, strBODY);
                    invitationRequest.SetExtendedProperty(RecipientReassignmentProhibited, true); /* Because it seemed like a good idea */
                    // Add a file attachment by using a stream
                    // We need to do the following in order to prevent 3 extra bytes from being prepended to the attachment
                    string sharMetadata = File.ReadAllText(sharedFilePath, Encoding.ASCII);
                    byte[] fileContents;
                    UTF8Encoding encoding = new System.Text.UTF8Encoding();
                    fileContents = encoding.GetBytes(sharMetadata);
                    //fileContents = File.ReadAllBytes(sharedFilePath);
                    //// fileContents is a Stream object that represents the content of the file to attach.
                    invitationRequest.Attachments.AddFileAttachment("sharing_metadata.xml", fileContents);
                    ////invitationRequest.Attachments.AddFileAttachment(sharedFilePath);
                    //// This is where we set those "special" headers and other pertinent
                    //// information I noted in Part 1 of this series...
                    //Attachment thisAttachment = invitationRequest.Attachments[0];
                    //thisAttachment.ContentType = "application/x-sharing-metadata-xml";
                    //thisAttachment.Name = "sharing_metadata.xml";
                    //thisAttachment.IsInline = false;
                    // Add recipient info and send message
                    invitationRequest.ToRecipients.Add(new EmailAddress() { Address = "[email protected]" });
                    invitationRequest.SendAndSaveCopy();
                    // I always end my methods by returning the EWS 
                    // impersonated user to null to clean up
                    service.ImpersonatedUserId = null;
                catch (Exception ex)
            public String GetConvertedEWSIDinHex(ExchangeService esb, String sID, String strSMTPAdd)
                // Create a request to convert identifiers.
                AlternateId objAltID = new AlternateId();
                objAltID.Format = IdFormat.EwsId;
                objAltID.Mailbox = strSMTPAdd;
                objAltID.UniqueId = sID;
                //Convert  PR_ENTRYID identifier format to an EWS identifier.
                AlternateIdBase objAltIDBase = esb.ConvertId(objAltID, IdFormat.HexEntryId);
                AlternateId objAltIDResp = (AlternateId)objAltIDBase;
                return objAltIDResp.UniqueId.ToString();
            public String GetInvitationMailboxId(string mailBoxServer, string domainName)
                ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
                service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
                // Generate The Store Entry Id for the impersonated user
                StringBuilder MailboxIDPointer = new StringBuilder();          
                string fqdn = mailBoxServer;
                string legacyDN = domainName;
                MailboxIDPointer.Append("00000000"); /* Flags */
                MailboxIDPointer.Append("38A1BB1005E5101AA1BB08002B2A56C2"); /* ProviderUID */
                MailboxIDPointer.Append("00"); /* Version */
                MailboxIDPointer.Append("00"); /* Flag */
                MailboxIDPointer.Append("454D534D44422E444C4C00000000"); /* DLLFileName */
                MailboxIDPointer.Append("00000000"); /* Wrapped Flags */
                MailboxIDPointer.Append("1B55FA20AA6611CD9BC800AA002FC45A"); /* WrappedProvider UID (Mailbox Store Object) */
                MailboxIDPointer.Append("0C000000"); /* Wrapped Type (Mailbox Store) */
                MailboxIDPointer.Append(ConvertStringToHex(fqdn)); /* ServerShortname (FQDN) */
                MailboxIDPointer.Append("00"); /* termination bit */
                MailboxIDPointer.Append(ConvertStringToHex(legacyDN)); /* Returns the userDN of the impersonated user */
                MailboxIDPointer.Append("00"); /* terminator bit */
                service.ImpersonatedUserId = null;
                return MailboxIDPointer.ToString();
            static bool RedirectionUrlValidationCallback(String redirectionUrl)
                bool redirectionValidated = false;
                if (redirectionUrl.Equals("https://SampleUrl/autodiscover/autodiscover.xml"))          
                    redirectionValidated = true;
                return redirectionValidated;
            public String GetIntiatorEntryID(string domainName)
                String result = String.Empty;
                //// Bind to EWS
                //ExchangeService service = ExchangeConnection.ExchangeService();
                //service.ImpersonatedUserId =
                //new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
                //// Get LegacyDN Using the function above this one 
                string sharedByLegacyDN = domainName;
                // A conversion function from earlier
                string legacyDNinHex = ConvertStringToHex(sharedByLegacyDN);
                StringBuilder addBookEntryId = new StringBuilder();
                addBookEntryId.Append("00000000"); /* Flags */
                addBookEntryId.Append("DCA740C8C042101AB4B908002B2FE182"); /* ProviderUID */
                addBookEntryId.Append("01000000"); /* Version */
                addBookEntryId.Append("00000000"); /* Type - 00 00 00 00  = Local Mail User */
                addBookEntryId.Append(legacyDNinHex); /* Returns the userDN of the impersonated user */
                addBookEntryId.Append("00"); /* terminator bit */
                result = addBookEntryId.ToString();
                //service.ImpersonatedUserId = null;
                return result;
            public string ConvertStringToHex(string input)
                // Take our input and break it into an array
                char[] arrInput = input.ToCharArray();
                String result = String.Empty;
                // For each set of characters
                foreach (char element in arrInput)
                    if (String.IsNullOrEmpty(result))
                        result = String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
                    else
                        result += String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
                return result.ToString();
     public string CreateSharingMessageAttachment(string folderid, string userSharing, string userSharingEntryID, string invitationMailboxID, string userSharedTo, string dataType, string calendarName)
                XmlDocument sharedMetadataXML = new XmlDocument();
                string sharedMetaDataFilePath = string.Empty;
                try
                    // Create a String that contains our new sharing_metadata.xml file
                    StringBuilder metadataString = new StringBuilder("<?xml version=\"1.0\"?>");              
                    metadataString.Append("<SharingMessage xmlns=\"http://schemas.microsoft.com/sharing/2008\">");
                    metadataString.Append("<DataType>" + dataType + "</DataType>");
                    metadataString.Append("<Initiator>");
                    metadataString.Append("<Name>" + userSharing + "</Name>");
                    metadataString.Append("<SmtpAddress>" + "[email protected]" + "</SmtpAddress><EntryId>" + userSharingEntryID.Trim());
                    metadataString.Append("</EntryId>");
                    metadataString.Append("</Initiator>");
                    metadataString.Append("<Invitation>");
                    metadataString.Append("<Title>" + calendarName + "</Title>");
                    metadataString.Append("<Providers>");
                    metadataString.Append("<Provider Type=\"ms-exchange-internal\" TargetRecipients=\"" + userSharedTo + "\">");
                    metadataString.Append("<FolderId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
                    metadataString.Append(folderid);
                    metadataString.Append("</FolderId>");
                    metadataString.Append("<MailboxId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
                    metadataString.Append(invitationMailboxID);
                    metadataString.Append("</MailboxId>");
                    metadataString.Append("</Provider>");
                    metadataString.Append("</Providers>");
                    metadataString.Append("</Invitation>");
                    metadataString.Append("</SharingMessage>");
                    sharedMetadataXML.LoadXml(metadataString.ToString());
                    string tempPath = System.IO.Path.GetTempPath();
                    sharedMetaDataFilePath = tempPath + "sharing_metadata.xml";
                    sharedMetadataXML.Save(sharedMetaDataFilePath);
                catch (Exception eg)
                    throw eg;               
                return sharedMetaDataFilePath;
            public Dictionary<string, string> GetUserSettings(AutodiscoverService autodiscoverService)
                GetUserSettingsResponse userresponse = autodiscoverService.GetUserSettings(
                    "[email protected]",
                    UserSettingName.UserDisplayName,
                    UserSettingName.InternalMailboxServerDN,
                    UserSettingName.UserDN
                Dictionary<string, string> myUserSettings = new Dictionary<string, string>();
                foreach (KeyValuePair<UserSettingName, Object> usersetting in userresponse.Settings)
                    if (usersetting.Key.ToString() == "InternalMailboxServerDN")
                        int lastIndexOfEqual = usersetting.Value.ToString().LastIndexOf("=");
                        string subString = usersetting.Value.ToString().Substring(lastIndexOfEqual + 1);
                        string value = subString;
                        myUserSettings.Add("InternalMailboxServer", value.ToString());
                    if (usersetting.Key.ToString() == "UserDisplayName")
                        string[] arrResult = usersetting.Value.ToString().Split('.');
                        myUserSettings.Add("UserDisplayName", arrResult[0].ToString());
                    if (usersetting.Key.ToString() == "UserDN")
                        string[] arrResult = usersetting.Value.ToString().Split('.');
                        myUserSettings.Add("UserDN", arrResult[0].ToString());
                return myUserSettings;
            private static byte[] HexStringToByteArray(string input)
                byte[] Bytes;
                int ByteLength;
                string HexValue = "\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9|||||||\xA\xB\xC\xD\xE\xF";
                ByteLength = input.Length / 2;
                Bytes = new byte[ByteLength];
                for (int x = 0, i = 0; i < input.Length; i += 2, x += 1)
                    Bytes[x] = (byte)(HexValue[Char.ToUpper(input[i + 0]) - '0'] << 4);
                    Bytes[x] |= (byte)(HexValue[Char.ToUpper(input[i + 1]) - '0']);
                return Bytes;

    Hi,
    I'm trying to share a calendar through ews managed api v.2 and using exchange 2013 version.
    i'm preparing a shared calendar and providing values to extended properties .
    Here comes the problem when i'm trying to send the sharing request(email message) 
    The following is code snippet.
      public void ShareCalendar(Calendar calendar)
                ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
                  service.Credentials = new NetworkCredential("user1", "password", "domain");
                service.Url = new Uri("https://sampleUrl/ews/exchange.asmx");
                try
                    // Bind to the folder
                    //Folder folderStoreInfo;
                    //folderStoreInfo = Folder.Bind(service, calendar.ExchangeId);
                    //string EwsID = folderStoreInfo.Id.UniqueId;
                    string EwsID = calendar.FolderExchangeId;
                    // The value of folderidHex will be what we need to use for the FolderId in the xml file
                    AutodiscoverService autoDiscover = new AutodiscoverService(ExchangeVersion.Exchange2013);
                    autoDiscover.Credentials =  new NetworkCredential("user1", "password", "domain");
                    autoDiscover.RedirectionUrlValidationCallback = RedirectionUrlValidationCallback;
                    Dictionary<string, string> userSettings = GetUserSettings(autoDiscover);
                    string folderidHex = GetConvertedEWSIDinHex(service, EwsID, "[email protected]");
                    string domainName = string.Empty;
                    string mailBoxServer = string.Empty;
                    string userName = string.Empty;
                    foreach (var item in userSettings)
                        switch (item.Key)
                            case "UserDN":
                                domainName = item.Value.ToString();
                                break;
                            case "InternalMailboxServer":
                                mailBoxServer = item.Value.ToString();
                                break;
                            case "UserDisplayName":
                                userName = item.Value.ToString();
                                break;
                    string entryId = GetIntiatorEntryID(domainName);
                    string mailboxId = GetInvitationMailboxId(mailBoxServer, domainName);
                    string sharedFilePath = CreateSharingMessageAttachment(folderidHex, userName, entryId, mailboxId, "[email protected]", "calendar", calendar.FolderName);
                    // Create a new message
                    EmailMessage invitationRequest = new EmailMessage(service);
                    invitationRequest.Subject = "I'd like to share my calendar with you";
                    invitationRequest.Body = "Sent by Exchange Administrator on behalf of user";                
                    //invitationRequest.Culture = "en-US";
                    invitationRequest.Sensitivity = Sensitivity.Normal;
                    // Set a sharing specific property on the message
                    invitationRequest.ItemClass = "IPM.Sharing"; /* Constant Required Value [MS-ProtocolSpec] */
                    byte[] byteEntryId = HexStringToByteArray(entryId);
                    // This is the Guid of the Sharing Provider in Exchange, and it's value does not change
                    Guid binSharingProviderGuid = new Guid("{AEF00600-0000-0000-C000-000000000046}");
                    // Even though I don't think setting this property is mandatory, 
                    // it just seemed like the right thing to do and it works so I \
                    // ain't messin with it!                                        
                    byte[] byteSharingProviderGuid = binSharingProviderGuid.ToByteArray();
                    string strPRBODYHTML = "<html dir=\"ltr\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n<meta name=\"GENERATOR\"
    content=\"MSHTML 8.00.7601.17514\">\r\n<style id=\"owaParaStyle\">P {\r\n   MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px \r\n}\r\n</style>\r\n</head>\r\n<body fPStyle=\"1\" ocsi=\"0\">\r\n<tt>\r\n<pre>SharedByUserDisplayName
    (SharedByUserSmtpAddress) has invited you to view his or her Microsoft Exchange Calendar.\r\n\r\nFor instructions on how to view shared folders on Exchange, see the following article:\r\n\r\nhttp://go.microsoft.com/fwlink/?LinkId=57561\r\n\r\n*~*~*~*~*~*~*~*~*~*\r\n\r\n</pre>\r\n</tt>\r\n<div>\r\n<div
    style=\"direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;\">this is a test message</div>\r\n</div>\r\n</body>\r\n</html>\r\n";
                    string strBODY = @"
    SharedByUserDisplayName (SharedByUserSmtpAddress) has invited you to view his or
    her Microsoft Exchange Calendar.
    For instructions on how to view shared folders on Exchange, see the
    following article:
    http://go.microsoft.com/fwlink/?LinkId=57561
    *~*~*~*~*~*~*~*~*~*
    test body
                    // Convert these to hex and binary equivelants to assign to their relevant
                    // extended properties
                    string hexPRBODYHTML = ConvertStringToHex(strPRBODYHTML);
                    byte[] binPRBODYHTML = HexStringToByteArray(hexPRBODYHTML);
                    Guid PropertySetSharing = Guid.Parse("00062040-0000-0000-C000-000000000046");//constant 
                    Guid PropertySetInternetHeaders = Guid.Parse("00020386-0000-0000-C000-000000000046");//constant
                    ExtendedPropertyDefinition PidLidSharingProviderGuidProperty = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.CLSID);
                    ExtendedPropertyDefinition ConversationIdProperty = new ExtendedPropertyDefinition(0x3013, MapiPropertyType.Binary);
                    // Sharing Properties (in order of reference according to protocol examples in: [MS-OXSHARE])
                    // Additional Property Constraints
                    // [MS-OXSHARE] 2.2.5.2
                    ExtendedPropertyDefinition PidTagMessageClass = new ExtendedPropertyDefinition(0x001A, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.5.1
                    //ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "Content-Class", MapiPropertyType.String);
                    ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "Content-class", MapiPropertyType.String);
                    // Common Message Object Properties               
                    // [MS-OXSHARE] 2.2.1
                    ExtendedPropertyDefinition PidTagNormalizedSubject = new ExtendedPropertyDefinition(0x0E1D, MapiPropertyType.String);
                    // The PidTagSubjectPrefix is a zero-length string, so I do not set it
                    // ExtendedPropertyDefinition PidTagSubjectPrefix = new ExtendedPropertyDefinition(0x003D, MapiPropertyType.String);
                    // Sharing Object Message Properties
                    // [MS-OXSHARE] 2.2.2.12
                    ExtendedPropertyDefinition PidLidSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.Binary);
                    // [MS-OXSHARE] 2.2.2.13
                    ExtendedPropertyDefinition PidNameXSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-GUID", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.14
                    ExtendedPropertyDefinition PidLidSharingProviderName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A02, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.15           
                    ExtendedPropertyDefinition PidNameXSharingProviderName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-Name", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.16
                    ExtendedPropertyDefinition PidLidSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A03, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.17
                    ExtendedPropertyDefinition PidNameXSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-URL", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.5
                    ExtendedPropertyDefinition PidLidSharingFlavor = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A18, MapiPropertyType.Integer);
                    // [MS-OXSHARE] 2.2.2.6
                    ExtendedPropertyDefinition PidNameXSharingFlavor = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Flavor", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.1
                    ExtendedPropertyDefinition PidLidSharingCapabilities = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A17, MapiPropertyType.Integer);
                    // [MS-OXSHARE] 2.2.2.2
                    ExtendedPropertyDefinition PidNameXSharingCapabilities = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Capabilities", MapiPropertyType.String);
                    // Sections 2.3 and 2.4 are also zero-length strings, so I won't set those either
                    // [MS-OXSHARE] 2.2.2.3
                    // ExtendedPropertyDefinition PidLidSharingConfigurationUrl = new   //ExtendedPropertyDefinition(PropertySetSharing, 0x8A24, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.4
                    //ExtendedPropertyDefinition PidNameXSharingConfigUrl = new //ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "X-Sharing-Config-Url", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.10
                    ExtendedPropertyDefinition PidLidSharingLocalType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A14, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.11
                    ExtendedPropertyDefinition PidNameXSharingLocalType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Local-Type", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.7
                    ExtendedPropertyDefinition PidLidSharingInitiatorEntryId = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A09, MapiPropertyType.Binary);
                    // [MS-OXSHARE] 2.2.2.8
                    ExtendedPropertyDefinition PidLidSharingInitiatorName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A07, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.9
                    ExtendedPropertyDefinition PidLidSharingInitiatorSMTP = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A08, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.1
                    ExtendedPropertyDefinition PidLidSharingRemoteName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A05, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.2 
                    ExtendedPropertyDefinition PidNameXSharingRemoteName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Name", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.5 
                    ExtendedPropertyDefinition PidLidSharingRemoteType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A1D, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.6 
                    ExtendedPropertyDefinition PidNameXSharingRemoteType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Type", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.7 
                    ExtendedPropertyDefinition PidLidSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A06, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.8 
                    ExtendedPropertyDefinition PidNameXSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Uid", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.3
                    ExtendedPropertyDefinition PidLidSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A48, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.4
                    ExtendedPropertyDefinition PidNameXSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Store-Uid", MapiPropertyType.String);
                    //From troubleshooting I noticed I was missing
                    ExtendedPropertyDefinition PidTagPriority = new ExtendedPropertyDefinition(0x0026, MapiPropertyType.Integer);
                    ExtendedPropertyDefinition PidTagSensitivity = new ExtendedPropertyDefinition(0x0036, MapiPropertyType.Integer);
                    ExtendedPropertyDefinition PR_BODY_HTML = new ExtendedPropertyDefinition(0x1013, MapiPropertyType.Binary); //PR_BOD
                    ExtendedPropertyDefinition PR_BODY = new ExtendedPropertyDefinition(0x1000, MapiPropertyType.String);
                    ExtendedPropertyDefinition RecipientReassignmentProhibited = new ExtendedPropertyDefinition(0x002b, MapiPropertyType.Boolean);
                    // Section 2.2.1
                    invitationRequest.SetExtendedProperty(PidTagNormalizedSubject, "I'd like to share my calendar with you"); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
                    //invitationRequest.SetExtendedProperty(PidTagSubjectPrefix, String.Empty); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
                    // Section 2.2.2
                    invitationRequest.SetExtendedProperty(PidLidSharingCapabilities, 0x40220); /* value for Special Folders */
                    invitationRequest.SetExtendedProperty(PidNameXSharingCapabilities, "40220"); /* Test representation of SharingCapabilities value */
                    //invitationRequest.SetExtendedProperty(PidLidSharingConfigurationUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.3 */
                    //invitationRequest.SetExtendedProperty(PidNameXSharingConfigUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.4 */
                    invitationRequest.SetExtendedProperty(PidLidSharingFlavor, 0x20310); /* Indicates Invitation for a special folder [MS-OXSHARE] 2.2.2.5 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingFlavor, "20310"); /* Text representation of SharingFlavor value [MS-OXSHARE] 2.2.2.6 */
                    invitationRequest.SetExtendedProperty(PidLidSharingInitiatorEntryId, byteEntryId); /* Value from the Initiator/EntryId value in the Sharing Message attachment .xml document */
                    invitationRequest.SetExtendedProperty(PidLidSharingInitiatorSMTP, "[email protected]"); /* Value from Initiator/Smtp Address in the Sharing message attachment .xml document */
                    invitationRequest.SetExtendedProperty(PidLidSharingInitiatorName, "User1"); /* Value from Initiator/Name Address in the Sharing message attachment .xml document */
                    invitationRequest.SetExtendedProperty(PidLidSharingLocalType, "IPF.Appointment"); /* MUST be set to PidTagContainerClass of folder to be shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingLocalType, "IPF.Appointment"); /* MUST be set to same value as PidLidSharingLocalType */
                    invitationRequest.SetExtendedProperty(PidLidSharingProviderGuid, byteSharingProviderGuid); /* Constant Required Value [MS-OXSHARE] 2.2.2.12 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingProviderGuid, "AEF0060000000000C000000000000046"); /* Constant Required Value [MS-OXSHARE] 2.2.2.13 */
                    invitationRequest.SetExtendedProperty(PidLidSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.14 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.15] */
                    invitationRequest.SetExtendedProperty(PidLidSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.16 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.17 */
                    // Section 2.2.3
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteName, calendar.FolderName); /* MUST be set to PidTagDisplayName of the folder being shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteName, calendar.FolderName); /* MUST be set to same value as PidLidSharingRemoteName */
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteStoreUid, mailboxId); /* Must be set to PidTagStoreEntryId of the folder being shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteStoreUid, mailboxId); /* MUST be set to same value as PidLidSharingRemoteStoreUid */
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.5 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.6 */
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteUid, folderidHex); /* MUST be set to PidTagEntryId of folder being shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteUid, folderidHex); /* Must be set to same value as PidLidSharingRemoteUid */
                    // Section 2.2.5
                    invitationRequest.SetExtendedProperty(PidNameContentClass, "Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
                    invitationRequest.SetExtendedProperty(PidTagMessageClass, "IPM.Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
                    // ********* ADDITIONAL MAPPED PROPERTIES IM FINDING AS I TROUBLESHOOT ********************** //
                    invitationRequest.SetExtendedProperty(PidTagPriority, 0); /* From troubleshooting I'm just trying to match up values that were missing */
                    invitationRequest.SetExtendedProperty(PidTagSensitivity, 0); /* From troubleshooting as well */
                    invitationRequest.SetExtendedProperty(PR_BODY_HTML, binPRBODYHTML); /* From troubleshooting OWA error pointing to serializing HTML failing */
                    invitationRequest.SetExtendedProperty(PR_BODY, strBODY);
                    invitationRequest.SetExtendedProperty(RecipientReassignmentProhibited, true); /* Because it seemed like a good idea */
                    // Add a file attachment by using a stream
                    // We need to do the following in order to prevent 3 extra bytes from being prepended to the attachment
                    string sharMetadata = File.ReadAllText(sharedFilePath, Encoding.ASCII);
                    byte[] fileContents;
                    UTF8Encoding encoding = new System.Text.UTF8Encoding();
                    fileContents = encoding.GetBytes(sharMetadata);
                    //fileContents = File.ReadAllBytes(sharedFilePath);
                    //// fileContents is a Stream object that represents the content of the file to attach.
                    invitationRequest.Attachments.AddFileAttachment("sharing_metadata.xml", fileContents);
                    ////invitationRequest.Attachments.AddFileAttachment(sharedFilePath);
                    //// This is where we set those "special" headers and other pertinent
                    //// information I noted in Part 1 of this series...
                    //Attachment thisAttachment = invitationRequest.Attachments[0];
                    //thisAttachment.ContentType = "application/x-sharing-metadata-xml";
                    //thisAttachment.Name = "sharing_metadata.xml";
                    //thisAttachment.IsInline = false;
                    // Add recipient info and send message
                    invitationRequest.ToRecipients.Add(new EmailAddress() { Address = "[email protected]" });
                    invitationRequest.SendAndSaveCopy();
                    // I always end my methods by returning the EWS 
                    // impersonated user to null to clean up
                    service.ImpersonatedUserId = null;
                catch (Exception ex)
            public String GetConvertedEWSIDinHex(ExchangeService esb, String sID, String strSMTPAdd)
                // Create a request to convert identifiers.
                AlternateId objAltID = new AlternateId();
                objAltID.Format = IdFormat.EwsId;
                objAltID.Mailbox = strSMTPAdd;
                objAltID.UniqueId = sID;
                //Convert  PR_ENTRYID identifier format to an EWS identifier.
                AlternateIdBase objAltIDBase = esb.ConvertId(objAltID, IdFormat.HexEntryId);
                AlternateId objAltIDResp = (AlternateId)objAltIDBase;
                return objAltIDResp.UniqueId.ToString();
            public String GetInvitationMailboxId(string mailBoxServer, string domainName)
                ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
                service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
                // Generate The Store Entry Id for the impersonated user
                StringBuilder MailboxIDPointer = new StringBuilder();          
                string fqdn = mailBoxServer;
                string legacyDN = domainName;
                MailboxIDPointer.Append("00000000"); /* Flags */
                MailboxIDPointer.Append("38A1BB1005E5101AA1BB08002B2A56C2"); /* ProviderUID */
                MailboxIDPointer.Append("00"); /* Version */
                MailboxIDPointer.Append("00"); /* Flag */
                MailboxIDPointer.Append("454D534D44422E444C4C00000000"); /* DLLFileName */
                MailboxIDPointer.Append("00000000"); /* Wrapped Flags */
                MailboxIDPointer.Append("1B55FA20AA6611CD9BC800AA002FC45A"); /* WrappedProvider UID (Mailbox Store Object) */
                MailboxIDPointer.Append("0C000000"); /* Wrapped Type (Mailbox Store) */
                MailboxIDPointer.Append(ConvertStringToHex(fqdn)); /* ServerShortname (FQDN) */
                MailboxIDPointer.Append("00"); /* termination bit */
                MailboxIDPointer.Append(ConvertStringToHex(legacyDN)); /* Returns the userDN of the impersonated user */
                MailboxIDPointer.Append("00"); /* terminator bit */
                service.ImpersonatedUserId = null;
                return MailboxIDPointer.ToString();
            static bool RedirectionUrlValidationCallback(String redirectionUrl)
                bool redirectionValidated = false;
                if (redirectionUrl.Equals("https://SampleUrl/autodiscover/autodiscover.xml"))          
                    redirectionValidated = true;
                return redirectionValidated;
            public String GetIntiatorEntryID(string domainName)
                String result = String.Empty;
                //// Bind to EWS
                //ExchangeService service = ExchangeConnection.ExchangeService();
                //service.ImpersonatedUserId =
                //new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
                //// Get LegacyDN Using the function above this one 
                string sharedByLegacyDN = domainName;
                // A conversion function from earlier
                string legacyDNinHex = ConvertStringToHex(sharedByLegacyDN);
                StringBuilder addBookEntryId = new StringBuilder();
                addBookEntryId.Append("00000000"); /* Flags */
                addBookEntryId.Append("DCA740C8C042101AB4B908002B2FE182"); /* ProviderUID */
                addBookEntryId.Append("01000000"); /* Version */
                addBookEntryId.Append("00000000"); /* Type - 00 00 00 00  = Local Mail User */
                addBookEntryId.Append(legacyDNinHex); /* Returns the userDN of the impersonated user */
                addBookEntryId.Append("00"); /* terminator bit */
                result = addBookEntryId.ToString();
                //service.ImpersonatedUserId = null;
                return result;
            public string ConvertStringToHex(string input)
                // Take our input and break it into an array
                char[] arrInput = input.ToCharArray();
                String result = String.Empty;
                // For each set of characters
                foreach (char element in arrInput)
                    if (String.IsNullOrEmpty(result))
                        result = String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
                    else
                        result += String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
                return result.ToString();
     public string CreateSharingMessageAttachment(string folderid, string userSharing, string userSharingEntryID, string invitationMailboxID, string userSharedTo, string dataType, string calendarName)
                XmlDocument sharedMetadataXML = new XmlDocument();
                string sharedMetaDataFilePath = string.Empty;
                try
                    // Create a String that contains our new sharing_metadata.xml file
                    StringBuilder metadataString = new StringBuilder("<?xml version=\"1.0\"?>");              
                    metadataString.Append("<SharingMessage xmlns=\"http://schemas.microsoft.com/sharing/2008\">");
                    metadataString.Append("<DataType>" + dataType + "</DataType>");
                    metadataString.Append("<Initiator>");
                    metadataString.Append("<Name>" + userSharing + "</Name>");
                    metadataString.Append("<SmtpAddress>" + "[email protected]" + "</SmtpAddress><EntryId>" + userSharingEntryID.Trim());
                    metadataString.Append("</EntryId>");
                    metadataString.Append("</Initiator>");
                    metadataString.Append("<Invitation>");
                    metadataString.Append("<Title>" + calendarName + "</Title>");
                    metadataString.Append("<Providers>");
                    metadataString.Append("<Provider Type=\"ms-exchange-internal\" TargetRecipients=\"" + userSharedTo + "\">");
                    metadataString.Append("<FolderId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
                    metadataString.Append(folderid);
                    metadataString.Append("</FolderId>");
                    metadataString.Append("<MailboxId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
                    metadataString.Append(invitationMailboxID);
                    metadataString.Append("</MailboxId>");
                    metadataString.Append("</Provider>");
                    metadataString.Append("</Providers>");
                    metadataString.Append("</Invitation>");
                    metadataString.Append("</SharingMessage>");
                    sharedMetadataXML.LoadXml(metadataString.ToString());
                    string tempPath = System.IO.Path.GetTempPath();
                    sharedMetaDataFilePath = tempPath + "sharing_metadata.xml";
                    sharedMetadataXML.Save(sharedMetaDataFilePath);
                catch (Exception eg)
                    throw eg;               
                return sharedMetaDataFilePath;
            public Dictionary<string, string> GetUserSettings(AutodiscoverService autodiscoverService)
                GetUserSettingsResponse userresponse = autodiscoverService.GetUserSettings(
                    "[email protected]",
                    UserSettingName.UserDisplayName,
                    UserSettingName.InternalMailboxServerDN,
                    UserSettingName.UserDN
                Dictionary<string, string> myUserSettings = new Dictionary<string, string>();
                foreach (KeyValuePair<UserSettingName, Object> usersetting in userresponse.Settings)
                    if (usersetting.Key.ToString() == "InternalMailboxServerDN")
                        int lastIndexOfEqual = usersetting.Value.ToString().LastIndexOf("=");
                        string subString = usersetting.Value.ToString().Substring(lastIndexOfEqual + 1);
                        string value = subString;
                        myUserSettings.Add("InternalMailboxServer", value.ToString());
                    if (usersetting.Key.ToString() == "UserDisplayName")
                        string[] arrResult = usersetting.Value.ToString().Split('.');
                        myUserSettings.Add("UserDisplayName", arrResult[0].ToString());
                    if (usersetting.Key.ToString() == "UserDN")
                        string[] arrResult = usersetting.Value.ToString().Split('.');
                        myUserSettings.Add("UserDN", arrResult[0].ToString());
                return myUserSettings;
            private static byte[] HexStringToByteArray(string input)
                byte[] Bytes;
                int ByteLength;
                string HexValue = "\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9|||||||\xA\xB\xC\xD\xE\xF";
                ByteLength = input.Length / 2;
                Bytes = new byte[ByteLength];
                for (int x = 0, i = 0; i < input.Length; i += 2, x += 1)
                    Bytes[x] = (byte)(HexValue[Char.ToUpper(input[i + 0]) - '0'] << 4);
                    Bytes[x] |= (byte)(HexValue[Char.ToUpper(input[i + 1]) - '0']);
                return Bytes;
    am i missing anything 
    any help is appreciated 
    Thanks in advance

  • Oracle Content Management SDK

    Let's see if we can get a thread going in regards to Oracle's << apparent >> intent to cease bundling iFS with the
    Oracle 9i Database Server. In a statement shared with me just a little bit ago, Oracle states that licensing implications
    for current database customers using what is to be called << in 9.0.3 >> the Oracle Content Management SDK is to be
    determined...
    Bunk! Now that they have people roped in, they're going to break the API out, and license << big $$$$, no doubt >>
    it separately! Go Micro$oft! errrr... oracle...

    Robert,
    I would say that there are pro's and con's to both arguments. If you want to make use of iFS with ID, Web Cache etc then you're going to need a copy of 9iAS anyway and as iFS becomes more integrated with various applications then you can see where Oracle is coming from.
    If you are a software house developing solutions based on iFS then this makes the licensing issue much cleaner and simpler for clients to understand (something which we have come up against as iFS is availabe in 9iDB and 9iAS). It also means that iFS should receive greater exposure within Oracle as the account managers are more likely to do something with it as it is a revenue generator.
    Naturally the other side is if you are developing an application or just using iFS in house then having to purchase 9iAS can seem like unwanted overhead. I think over the coming months we are likely to see iFS more tightly integrated with iAS so eventually to make use of that additional functionality you will need a copy of iAS. I guess it depends what you are doing with it as the API is likely to be packaged in a similar way as other dev kits.
    Regards,
    Bernard Wright
    Technical Director
    Serengeti Systems

  • Oracle Payables Integration With Documentum Content Managment System

    Hi there,
    I'm working for a customer who has the requirement to add "attachments" to invoices in Oracle Payables. The attached documents will not be stored in Oracle, but will be links to documents stored in the Documentum content management system. Clicking on the link will retrieve the document and display it.
    The problem is I am a complete novice when it comes to developing for Oracle Payables. Documentum provides an extensive java API that I have a lot of experience using but can I get at that from within Payables?
    Can anyone point me at the correct documentation/websites to get me going?
    Many Thanks
    Paul

    You can attach a URL to an invoice using standard attachments, just query up an existing invoice and click on the "paperclip" attachments icon in the toolbar, enter the sequence, category, description and enter "Web Page" as the data type, then put the URL in the File or URL field.
    You could also do the above steps automatedly via PL/SQL (or Java) by calling the appropriate FND attached documents API to insert the data into the required tables.
    Gareth
    Blog: http://garethroberts.blogspot.com
    Web: http://www.virtuate.com

  • Any code samples for inputting content into content manager 8.1?

    Does anybody know where to find code samples of adding content to the Content Manager
    via the Java API?
    The only code I can find is the "Content Manager Example Portlet" and it is 7.0,
    not 8.1.
    It's not clear from the documentation what the Repository and Path are supposed
    to be named. Perhaps we had a working example, this might help.
    Thanks
    Dave

    Does anybody know where to find code samples of adding content to the Content Manager
    via the Java API?
    The only code I can find is the "Content Manager Example Portlet" and it is 7.0,
    not 8.1.
    It's not clear from the documentation what the Repository and Path are supposed
    to be named. Perhaps we had a working example, this might help.
    Thanks
    Dave

  • Answer:  814 content management gets ConcurrentModificationException

    I wanted to get this into this news group for others to find.
    Solution: Open a ticket and get patch patch_CR211051_81SP4
    Problem:
    WLP 814 using content management P13N tags or APIs. While your portal is up and users have browsed content, run the portalAdmin--content update content, or use load_cm_data.sh and you get exception.
    FYI I believe this bug will most likely happen on SMP boxes. IE you'll not likely see this on a single CPU box. Just my guess based on experience.
    <Jan 21, 2005 3:55:13 PM EST> <Info> <EJB> <BEA-010051> <EJB Exception occurred during invocation from home: [email protected]51
    threw exception: java.util.ConcurrentModificationException
    java.util.ConcurrentModificationException
    at java.util.Hashtable$Enumerator.next()Ljava.lang.Object;(Unknown Source)
    at com.bea.p13n.cache.CacheImpl.createSet(Z)Ljava.util.Set;(CacheImpl.java:764)
    at com.bea.p13n.cache.CacheImpl.keySet()Ljava.util.Set;(CacheImpl.java:350)
    at com.bea.content.manager.internal.CacheHelper.flushAllBinaryCacheEntries(Ljava.lang.String;Ljava.lang.String;)V(CacheHelper.java:482)
    at com.bea.content.manager.internal.NodeOpsBean.updateProperties(Lcom.bea.content.ID;[Lcom.bea.content.Property;)Lcom.bea.content.Node;(NodeOpsBean.java:1391)
    at com.bea.content.manager.internal.NodeOpsEJB_e40s0j_ELOImpl.updateProperties(Lcom.bea.content.ID;[Lcom.bea.content.Property;)Lcom.bea.content.Node;(NodeOpsEJB_e40s0j_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    iSync automatically takes the newest changes to data on your devices and applies them to all other devices when you sync.
    There is no manual override for similar content when syncing your phone. The ability to select data on one device or another appears on an initial sync when you choose to 'Merge' the data on the device and on the Mac. Doing this is often unsuccessful, so for an initial sync its better to start with a fully up-to-date Mac Address Book and a completely empty phone.
    Have you renamed the telephone number fields in the Mac Address Book? If you have, that can cause multiple phone numbers of the same type to appear. However Sony Ericsson phones only support one number of each type:
    work
    mobile
    home
    fax
    other
    If your fields in the Mac's Address Book are named anything other than this, set them back. Then make sure your Mac's Address Book is fully up-to-date, back it up, then click "Reset Sync History..." in iSync Preferences and re-sync your phone.
    .Mac Sync is separate to iSync and is for syncing Mac-to-Mac, so you can ignore any references to .Mac if you're just syncing your phone.
    For further iSync Tips see my web-site here:
    http://www.feisar.com/isync_tips.html

  • Content Management in jpf

    Hi,
    I need to retrieve some data from content management in my jpf file. How can I do that? Appreciate your reply.
    Thanks,
    mxa1097

    Look at the APIs for com.bea.content and com.bea.content.manager.
    You would probably start with
    com.bea.content.manager.RepositoryManagerFactory.connect(getSession()),
    e.g.:
    RepositoryManager rMgr =
    RepositoryManagerFactory.connect(getSession()).create();
    NodeOps nodeOps = rMgr.getNodeOps();
    SearchOps searchOps = rMgr.getSearchOps();
    The code-completion in workshop and javadoc (hit f1 while on class or
    method to open the javadoc) should help out. NodeOps has a variety of
    method for getting individual nodes and their children, plus
    create/update/delete methods for non-lifecycle repository.
    There's also an example of doing a content search via the APIs at
    http://e-docs.bea.com/wlp/docs81/whitepapers/p13n/body.html#1072362.
    Greg
    Mona Khanapurkar wrote:
    Hi,
    I need to retrieve some data from content management in my jpf file. How can I do that? Appreciate your reply.
    Thanks,
    mxa1097

  • Accessing same Content Management Repository from Multiple Domains

    I'm attempting to point many different domains to a single content management repository to avoid the duplication of data.
    All the domains are able to read content correctly, but when trying to create content (whether programmatically or through the admin tool), most of the domains will get this error:
    java.sql.SQLException: ORA-00001: unique constraint (SCHEMA_NAME.PK_CM_NODE) violated
    Since there's no sequence generated in the database, it appears that the primary key is defined by something in the portal code. This seems to imply that you can't have multiple domains pointing to the same repository. Can someone confirm that they've seen this work? And if you've gotten it to work, what I am doing wrong?
    Thanks for any help,
    Dan Turkenkopf

    This particular issue is inherent to the OOTB repository in WLP. The repository uses a sequencer to generate id's for created content. The way these ID's are generated causes the possibility of two applications attempting to create items with the same ID. This is due to the fact that the WLP repository manages the ID's used when creating content and doesn't currently use a GUID strategy for content id's.
    You could configure another repository which does ID generation in a different fashion and avoid the persistence problem I've described.
    The VCR layer which provides the access to the OOTB repository really only has the cache issue I described. This can be worked around with some custom event listener implementations that can manage stales caches. These would need to be aware of the other applications sharing the underlying content repository.
    -Ryan

  • Reading Images from DB2 content Manager

    Has anybody have read images from IBM db2 content manager using oracel forms.
    any links will be helpfu;
    or any links to how to make windows API calls in forms 5.0.

    OK, I found Greg's reply and that fixed it, once I played with it a bit.
    "Cory McGinnis" <[email protected]> wrote:
    >
    I am displaying an html page from a <cm:select> but the images do not
    display.
    I have set up the dmsbase directory as per the samplePortal, and loaded
    the content.
    The HTML displays, but with errors for the images.
    Here's the select from the portlet:
    <cm:select contentHome="<%=ContentHelper.DEF_CONTENT_MANAGER_HOME%>"
    query="type='page'"
    id="textDocs"/>
    <es:forEachInArray array="<%=textDocs%>" id="aTextDoc" type="com.bea.p13n.content.Content">
    <p><cm:printDoc id="aTextDoc" failOnError="true" /></p>
    </es:forEachInArray>

  • Get the latest approved version of a content management resource

    Hi I am using EP 6 with Content management.
    I my application I need to get resources form content management, approval process is enabled for the content items.
    I use this code
    RID rid = RID.getRID(path);
              if (rid != null) {
                   try {
                        resource = rf.getResource(rid, context);
    } catch (ResourceException e1) {
         //errorhandling
    where rf is a com.sapportals.wcm.repository.IResourceFactory
    created from a service user and a service context
    which work fine, When the resource has been approved.
    however if I change the specified content Item and do not approve it, the above code returns null as resource.
    I would expect the api to return the latest approved version of the resource.
    Have I misunderstood soemthing here or should I use another API?

    I solved my problem...
    first of all.
    Versioning was enabled for the folder but apparently it didnt work so i disabled it and enabled it again. Then I got the correct reource instead of null.
    second thing
    later in mycode I used this to get the path of the resource
    resource.getRID().getPath();
    but this gives the path to where the version of the document can be found... something like /documents/~System/xx/xxxxx/xxxx
    where x is numbers
    after doing a little debugging I found out that
    resource.getAccessRID().getPath()
    returns the path to where in CM the resource is stored.
    I hope My experience here can help others.
    I am glad that I solved my problem, but I find it extremely worrying that some settings in CM apparently stops working without any apparent reason.
    We have experienced this with other properties like Manual Ordering, Approval process, have any one else had these problems and found the cause then I would like to hear about it

Maybe you are looking for