How do I copy User Properties from one user to another using Server API

Portal Version is 10GR3
I have two Users in the portal and I want to copy all the properties of user1 to user2.
the IPTProfileManager interface allows me to get all the properties of user 1. Accomplished through the use of
IPTObjectProperties user1Props = profileManager.GetUserProperties(userId, false);
IPTQueryResult qr = user1Props.GetPropertyData(PT_PROPIDS.PT_PROPID_OBJECTID |
               PT_PROPIDS.PT_PROPID_NAME |
               PT_PROPIDS.PT_PROPID_PROP_VALUE);
I beleive this is correct...
We now have all the properties in a Query Result. I'm lost as to how to get these values into user2's profile...
-Or- is there a easier way????
Any suggestions?
Phil Orion
Orion like the constellation, not the Irish guy.

Every object in the Server API extends the PTObject, which has function calls GetObjectProperties().
If you have the PTUser object you have to do the following:
IPTObjectProperties props = getObjectProperties(); // in your case this should be something like PTUser.GetObjectProperties();
Object[][] propData = new Object[PT_EDIT_PROPDATA_COLUMNS.PT_EDIT_PROPDATA_INVALID][1];
propData[PT_EDIT_PROPDATA_COLUMNS.PT_EDIT_PROPDATA_PROPERTYID][0] = new Integer(#PropertyID#);
propData[PT_EDIT_PROPDATA_COLUMNS.PT_EDIT_PROPDATA_VALUE][0] = "Property Value";
props.SetPropertyData(propData);
I don't forget on the end you have to call PTUser.Store() function
cheers
Edited by: Pelov on 14.07.2010 12:31

Similar Messages

  • I have no problems copying iMovie Events from one Mac to another, however, how can I copy iMovie Projects from one Mac to another?

    I have no problems copying iMovie Events from one Mac to another, however, how can I copy iMovie Projects from one Mac to another?  Any help will be appreciated.  Thank you.

    This should give you some good insight, I'd probably store them on an External HD on the old machine and then just drag and drop to the new machine.
    https://discussions.apple.com/docs/DOC-4141

  • How can I copy cell formatting from one range to another?

    How can I copy cell formatting from one range to another, including text fonts, colours, borders, etc., so that, for example, I can reuse a formatted reconciliation table again in different parts of a sheet?

    Hi George,
    Wayne found the Spinning Beachball of Death, and you will find it too.
    Numbers is not good at handling large datasets. Might I suggest that you group your data into smaller sets (each month, perhaps?) and save each group in a separate Numbers document. Numbers will not link between documents, but you could have a summary Table within each document. Then comes the "clunky" bit of copying all those summary tables into a master document where you do the final processing of the data.
    Regards,
    Ian.

  • How to copy List item from one list to another using SPD workflow using HTTP call web service

    Hi,
    How to copy List item from one list to another using SPD workflow using HTTP call web service.
    Both the Lists are in different Web applications.
    Regards, Shreyas R S

    Hi Shreyas,
    From your post, it seems that you are using SharePoint 2013 workflow platform in SPD.
    If that is the case, we can use Call HTTP web service action to get the item data, but we cannot use Call HTTP web service to create a new item in the list in another web application with these data.
    As my test, we would get Unauthorized error when using Call HTTP web service action to create a new item in a list in another web application.
    So I recommend to achieve this goal programmatically.
    More references:
    https://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    https://msdn.microsoft.com/en-us/library/office/dn292552.aspx?f=255&MSPPError=-2147217396
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • HT1349 How do I copy my playlists from one computer to another?

    How do I copy my playlists from one computer to another? Both Acer.

    The playlists are contained in the iTunesLIbrary.itl file.
    If you are moving your library from one computer to another, simply copy the ENTIRE iTunes folder from the old computer to the new computer.

  • How do I copy Secure Notes from one computer to another in Lion?

    How do I copy Secure Notes from one computer to another?
    Keychain sync is no longer available

    Move the entire keychain to any location on the new computer and double-click it. You can then drag the notes from one keychain to the other.
    (64538)

  • Upgarded to PE 13 - How do I drag an image from one screen to another (using 2 monitors)

    upgarded to PE 13 - How do I drag an image from one screen to another (using 2 monitors)

    upgarded to PE 13 - How do I drag an image from one screen to another (using 2 monitors)

  • How do I copy a photo from one folder to another one in Aperture

    I'm old and feeble      I cannot figure out how to copy a photo from one folder to another folder   and my 13 year old grandson can't figure it out either, so I feel better about it
    thanks
    canonmick

    Um ... that doesn't seem ... like a useful workflow.  When you say "folder" do you mean a Folder in Aperture (shown on the Library tab of the Inspector) or a folder in Finder?  They are not at all the same thing.
    Aperture is an image manager, with the requisite file management built-in.  Finder is a file manager.
    If you provide a full description of what are doing, and what you are trying to do, someone here can set your straight.
    Fwiw, IME, the learning curve if very long and uphill, but gentle.  What's unusual (esp. for Apple products) is that the landmass of Aperture is separated from the rest of your computer knowledge by a moat.  What I mean is, the first leap is the hardest.  After that, you'll be on firm ground, ready to explore.

  • How do i copy a layer from one psd to another

    how do i copy a layer from one psd to another

    Select...Select All, Ctrl+C to copy the contents to the Clipboard, then in the other PSD image use Ctrl+V to paste the contents in on its own layer.
    Ken

  • How can I copy GPS information from one image to another?

    I bought a Canon S100 specifically for its GPs and movie capability.  On a recent vacation, I used the S100 and a Nikon D300.  In cases where images were taken with both cameras in approximately the same place, I would like to copy the GPS information from the S100 CR2 files to the D300 NEF files.  Does anyone know how to do this or if there is any plugins that will do it?

    The added benefit of using GeoSetter to copy the information from one photo to another, is that you can see where every already-tagged photo is on a Google map to make sure the location is actually correct.  Sometimes the camera clock is off a few seconds or minutes and you can easily figure how what offset to use by watching where the existing photos show on the map.
    Using the MS Pro Photo Tools to generate a track from the existing S100 photos and then using that track in GeoSetter to assign the rest, with interpolation enabled, seems like the best course of action if the S100 track information is no longer available.
    When using an external program to Geotag images that are already in LR, to be safe you should first save all the metadata to XMP files in the folder you’re going to tag, then exit LR, then geotag the photos, then restart LR and read information from all the XMP files.
    Another benefit of GeoSetter is that you can assign the locality information to the photos that already have just coordinates in them.

  • How do I copy the style from one control to another?

    I need to programmatically copy the style from one graph to another. I'm currently using the importstyle and export style functions but I'd like to avoid that since: 1) I'm creating >100 of the same graphs in a scrolling window and execution time is a concern, and 2) it makes it harder to redistribute the application, and 3) you shouldn't have to import/export from disk just to copy a graph style.
    I noticed the copy constructor was disabled so you can't just create a new one from the original. I suppose I could iterate through all the styles and transfer them from the master graph to all the copies but is there an easier way to do that? If not, is there some sample code for that?
    I'm using MStudio 7.0 for C
    ++.
    Thanks,
    -Bob

    One way that you could do this would be to create a helper method that configures your graph rather than configuring it at design-time, then use that helper method to apply the settings to the new graphs that you create. However, this would only work if you wanted all graphs to be configured exactly the same way - this would not work if the settings of your master graph are changing at run-time and you want the new graphs to be configured with the current settings of the master graph.
    Another approach is to query each control for IPersistPropertyBag, create an IPropertyBag, pass the IPropertyBag to the master graph's IPersistPropertyBag:ave, then pass the IPropertyBag to the new graph's IPersistPropertyBag::Load implementation. I'm not aware of any implementations of IPropertyBag that are readily available for use in applications, so the tricky part is creating the IPropertyBag. Below is a very simple implementation of IPropertyBag that should be enough to get the job done for this example. First, add this to your stdafx.h:
    #include <atlbase.h>
    CComModule _Module;
    #include <atlcom.h>
    #include <atlcoll.h>
    Here's the simple IPropertyBag implementation:
    class ATL_NO_VTABLE CSimplePropertyBag :
    public CComObjectRootEx<CComSingleThreadModel>,
    public IPropertyBag
    private:
    CAtlMap<CComBSTR, CComVariant> m_propertyMap;
    public:
    BEGIN_COM_MAP(CSimplePropertyBag)
    COM_INTERFACE_ENTRY(IPropertyBag)
    END_COM_MAP()
    STDMETHODIMP Read(LPCOLESTR pszPropName, VARIANT* pVar, IErrorLog* pErrorLog)
    HRESULT hr = E_FAIL;
    if ((pszPropName == NULL) || (pVar == NULL))
    hr = E_POINTER;
    else
    if (SUCCEEDED(::VariantClear(pVar)))
    CComBSTR key = pszPropName;
    CComVariant value;
    if (!m_propertyMap.Lookup(key, value))
    hr = E_INVALIDARG;
    else
    if (SUCCEEDED(::VariantCopy(pVar, &value)))
    hr = S_OK;
    return hr;
    STDMETHODIMP Write(LPCOLESTR pszPropName, VARIANT* pVar)
    HRESULT hr = E_FAIL;
    if ((pszPropName == NULL) || (pVar == NULL))
    hr = E_POINTER;
    else
    m_propertyMap.SetAt(pszPropName, *pVar);
    hr = S_OK;
    return hr;
    Once you have a way to create an implementation of IPropertyBag, you can use IPropertyBag and IPersistPropertyBag to copy the settings from one control to another like this:
    void CopyGraphStyle(CNiGraph& source, CNiGraph& target)
    LPUNKNOWN pSourceUnknown = source.GetControlUnknown();
    LPUNKNOWN pTargetUnknown = target.GetControlUnknown();
    if ((pSourceUnknown != NULL) && (pTargetUnknown != NULL))
    CComQIPtr<IPersistPropertyBag> pSourcePersist(pSourceUnknown);
    CComQIPtr<IPersistPropertyBag> pTargetPersist(pTargetUnknown);
    if ((pSourcePersist != NULL) && (pTargetPersist != NULL))
    CComObject<CSimplePropertyBag>* pPropertyBag = 0;
    CComObject<CSimplePropertyBag>::CreateInstance(&pPropertyBag);
    if (pPropertyBag != NULL)
    CComQIPtr<IPropertyBag> spPropertyBag(pPropertyBag);
    if (spPropertyBag != NULL)
    if (SUCCEEDED(pSourcePersist->Save(spPropertyBag, FALSE, TRUE)))
    pTargetPersist->Load(spPropertyBag, NULL);
    (Note that "CreateInstan ce" above should be CreateInstance - a space gets added for some unknown reason after I click Submit.)
    Then you can use this CopyGraphStyle method to copy the settings of the master graph to the new graph. Hope this helps.
    - Elton

  • How do I copy a list from one site to another that has a column that appends changes to existing text?

    I want to move a list from one SharePoint site to another, within the same collection. I have created a template and included the content but the column that is selected to append changes to existing text, has not copied in all cases, although it has for
    some items.
    I have a limited knowledge so won't be able to implement any solutions that require the use of code.

    Hi,
    According to your post, my understanding is that you wanted to copy a list from one site to another that has a column that appends changes to existing text.
    I recommend to use the custom workflow activity  Copy List Item Extended Activityto
    copy list items and files cross site.
    You can do this with codeless SharePoint Designer workflows as long as you can install the
    Codeplex Custom SharePoint Designer Workflow Activities. 
    These activities are also built-in to SPD2010.
    To install the custom activities, please follow the steps as below:
    Download the solution file form
    Useful Sharepoint Designer Custom Workflow Activities
    Copy the wps file to the Disk C.
    Open the SharePoint 2010 Management Shell.
    Run the command: add spsolution c:\ dp.sharepoint.workflow.wsp
    Open the Center Administration, click System Setting->Manage Farm Solution-> dp.sharepoint.workflow.wsp->Deploy to one or more Web Application.
    Open the SharePoint designer, add action from Custom Actions.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How do I copy an art object from one document to another using illustrator API(C  )

    Hi, I'm trying to copy text and graphic elements from one document into another, does anybody has an idea how to do it using Illustrator SDK(C++)?
    Thanks in advance.

    If you call AIArtSuite::ReorderArt() giving the layer group handle from the target document and using art from the source document, it will move art between documents. That said, there are all sorts of caveats that come along with that -- some things move over automatically (graphic styles, symbols) while others cause problems. E.g. copying art that contains a swatch can cause a crash when you shut down the source document because it may keep the style reference to the swatch in the source document -- which goes away when the document is closed. Gradients in particular are a problem I believe. Straight up colours are (I think) fine. I've had to write a lot of workarounds for various headaches caused by moving art between documents.
    Bottom line: its very doable, but there are a lot of edge cases. This was clearly not an intended use of the SDK, though it is possible.

  • How can I copy a page from one wiki to another?

    Using the Wiki function in OSX server, I am able to move a page from one wiki to another by clicking the gear icon. Is there a way to copy the page to another wiki while leaving it intact in its existing wiki? I have tried to copy/paste while editing a page, however much of the formatting does not properly migrated to the pasted content.

    What you are looking for is how to "duplicate" ca page.

  • How can I copy a track from one session to another?

    I want to copy an entire track (strip setting and audio/midi) from one session to another. The only option I can seem to find is to bounce or export as audio.
    Is there any way to do this besides copy/paste the strip setting, copy/paste the software instrument, copy/paste the midi?

    Why don't you save the channel strip (including the Software instrument) as a preset and insert it in the new session? Doesn't affect Volume and panning though unless it is automated. Then you could copy+paste the Automation. Audio and Midi files have to be copied+pasted.

  • How can i copy and paste from one spreadsheet to another?

    Trying to shuffle around the rows as part of an everchanging schedule.  When i copy and paste from one spreadsheet to the other, the images overlay each other as if i were litterally cutting them out of paper and then sloppily pasting to another. Is there a way to set them up so crosscutting is more seamless in appearance?

    jrc1971 wrote:
    ...When i copy and paste from one spreadsheet to the other, the images overlay each other as if i were litterally cutting them out of paper and then sloppily pasting to another.
    JRC,
    The reason you get that result is that you are pasting the rows to the canvas of your second document instead of into an existing table.
    Instead, make a large blank table in your receiving document and paste into that table only after clicking on the cell where you want the first cell of the copied data to be positioned.
    Jerry

Maybe you are looking for

  • Two pages reuse a task flow -------how to reinitialize the task flow?

    Hi, i get a question. In general: In the navigation menu i have two commandlink that are "Service" and "Application". And when i click on each of the two command links, i go to a page. The detail: This two commandlinks use a same task flow-----that i

  • All ichat contacts gone

    HI. I recently upgraded to Snow Leopard. When I today, for the first time, open up ichat all my contacts are gone. Last time I used ichat was on Leopard. It then worked fine (with all my contacts there). Ideas anyone? /Anders

  • Customer master currency

    Customer master currency to be defaulted in the currency column of price master. what should be done ?

  • Managed bean in both adfc-config.xml and faces-config.xml file

    hi, i can see that it's possible to declare managed bean in both adfc-config.xml and faces-config.xml file. is there any difference? which one is recommended? read here - http://www.jaypillai.com/tag/adf/ but still not clear. thanks.

  • Reg:Logic required

    Hi , We are working on one development for this we are using exit:MV45AFZZ and written code on it.The logic we have written is when ever the field FPLT:FAKSP is blank at contarct level ,then it should trigger an intimation mail .First time it is trig