How do I get the user information for a page?

I would like to display information about the person that created a page in CQ.  I know I can get the createdBy information from the page properties, but how can I turn that into a user object where I can get more detialed information about that user?

If you are within an OSGi bundle you can use the SlingRepository Service. Now it depends how you develop your OSGi services and components. I use the maven scr plugin for this. With this plugin it is possible to get references to services with java annotaions.
Example:
@Component(name="SampleService",
        label = "SampleService",
        description = "SampleService",
        immediate = true, enabled = true, metatype = true)
@Services({ @Service(value = SampleService.class) })
@Properties({
@Property(name = "service.description", value = "SampleService"),
@Property(name = "service.vendor", value = ") })
public class SampleServiceImpl implements SampleService
@Reference(policy = ReferencePolicy.STATIC)
private SlingRepository repository;
    public void openAdminSession() {
        Session session = null;
        if (repository != null) {
            try {
                session = repository.loginAdministrative(null);
                //do something here
            } catch (RepositoryException e) {
                LOG.error("Unable to open admin session:" + e.toString());
            } finally{
                                          if(session != null){
                      session.logout();
To access a service from a JSP page you can use the reference of the SlingScriptHelper. You have to use the <cq:defineObjects/> tag.
Example jsp:
<cq:defineObjects/>
SlingRepository repository = sling.getService(SlingRepository.class);
Session session = null;
        if (repository != null) {
            try {
                session = repository.loginAdministrative(null);
                //do something here
            } catch (RepositoryException e) {
                LOG.error("Unable to open admin session:" + e.toString());
            } finally{
                                          if(session != null){
                      session.logout();

Similar Messages

  • How do I get the following information for setting up AirPort Extreme?

    Getting these two messages when attempting to set up brand new Airport Extreme. Where do I get the information needed to resolve these problems?  Thank you

    The messages are related.
    What modem router do you have? Is it adsl and is it working in as router at the moment?
    The way apple run the Airport now is to try and take over as the main router.. this is not always possible and sadly because no choice is given you have to work through the setup again and deliberately force it to the correct setting.. ie off bridge mode.
    Assuming you do have a modem router..
    Click on edit settings on the bottom..
    Go to the internet tab and change it to dhcp.
    Go to the network tab.
    Change it from dhcp and nat to off bridge mode.
    The AE will then work as wireless AP and switch which is fine.
    Otherwise you need to bridge your modem and supply the pppoe info that the ISP passed to you.

  • How to I get the card information to none so I can download my free apps it won't let me it keeps asking for card information

    How to I get the card information to none so I can download my free apps it won't let me it keeps asking for card information

    Is it a new account ? If it is then unless the instructions on this page are followed when creating an account : http://support.apple.com/kb/HT2534
    then credit card details will need to be entered before the account can be used to download any item from the store - you should be able to remove your card details after entering them

  • How do I get the user name and password for the Apple Extreme Router to connect to a Slingbox

    How do I get the user name and password for the Apple Extreme Router to set up my Slingbox?  It will not accept the Apple Extreme Name and password.

    The AirPort Extreme does not have a User Name, but it does have a device name and device password, which you may have already tried.
    There is also a Wireless Network Name and Wireless Network Password for the AirPort Extreme, which might be what the Slingbox is looking for if you are trying to connect it to your wireless network.
    There are no other "user names" or "passwords" on the AirPort Extreme.
    You established the device name, device password, wireless network name and wireless network password when you originally configured the AirPort Extreme.
    If you cannot remember these, you will need to perform a Soft Rest to reset everything. Follow the instructions in this Apple support document:
    Resetting an AirPort Base Station or Time Capsule FAQ

  • How can I get a user manual for my inherited Blackberry ...

    How can I get a user manual for my inherited Blackberry Curve 8330?

    Hi and Welcome to the Forums!
    Here is a link to the manuals:
    http://na.blackberry.com/eng/support/docs/subcategories/?userType=1&category=BlackBerry+Smartphones&...
    Cheers!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How can I get the elapse time for execution of a Query for a session

    Hi ,
    How can I get the elapse time for execution of a Query for a session?
    Example - I have a report based on the procedure ,when the user execute that it takes say 3 min. to return rows.
    Is there any possible way to capture this session info. for this particular execution of query along with it's execution elapse time?
    Thanks in advance.

    Hi
    You can use the dbms_utility.get_time tool (gives binary_integer type value).
    1/ Initialize you time and date of beginning :
    v_beginTime := dbms_utility.get_time ;
    2/ Run you procedure...
    3/ Get end-time with :
    v_endTime := dbms_utility.get_time ;
    4/ Thus, calculate elapsed time by difference :
    v_elapsTime := v_endTime - v_beginTime ;
    This will give you time elapsed in of 100th of seconds...
    Then you can format you result to give correct print time.
    Hope it will help you.
    AL

  • I've change device Ipone4s to Ipnoe 5 . How to i get the old game for game center

    I've change device Ipone4s to Ipnoe 5 . How to i get the old game for game center

    Regarding the old iMac.  Just delete your USER NAME from the Control Panel.  Go into System Preferences - then User/Groups and delete your account from there.
    Just a bit of advice though before you do all this, go and buy yourself a remote Hard Drive, they're really good value today and copy off all of your sacred files from your old computer onto the new drive.  You could also do the same via the Backup.app    
    It's well worth doing....    You can easily delay the switch over for a few days and you'll then have a backup disc that you'll start to use again and again.

  • HT201269 I have lost my iPhone 3GS. It was backed up to my computer using iTunes. I now have a new iPhone 4 series from a friend. How can I restore the backup information for my previous phone to the new phone?

    I have lost my iphone 3GS. It was backed up to my macbook pro using itunes. I now have a new iphone series 4 (china model). How can I access the backup information for my old phone and put it on my new one?

    Thank you again for all of your help!! I really appreciate it!
    I think I am following -- I was able to upload to my iPhoto and all photos and videos are there that is a plus! I tried to create an Event in my iPhoto and put all of my photos in that event but for some reason, now my iTunes it not recognizing that Event in my iPhoto. It is not allowing me to import just that event at the moment but I may be doing something wrong. At least all of my pics and vids are in iPhoto so that is a plus and I know they are at least saved somewhere. Just for some reason, my iTunes it not locating the event that I created with only those photos.
    Thank you for letting me know about my contacts! How do I know if I have the contacts app?
    Also, I had no clue that my iCloud could be backed up via cellular data! However, is this a new feature with the most updated iOS?? Unforutnatly I am like 2 iOS updates behind because I don't have enough storage on my phone. I still get the notification that my phone needs to be plugged in and connected to wifi in order to back up to the cloud :-(
    How can I sync using USB? Right now when i click on the info tab for my iPhone in my iTunes this is the answer that I get -- I am a little unclear as to what it means.
    Sync Contacts:
    Your contacts are being synced with you iPhone over the air from iCloud. Over-the-air sync settings can be changed on you iPhone
    Sync Calendars:
    Your calendars are being synced with you iPhone over the air from iCloud. Over-the-air sync settings can be changed on you iPhone

  • How can I get the serial number for Premiere 11?

    In october 2012 I´ve bought a bundle pack with Photoshop Elements 11 and Premiere 11. After a hard disk crash i was about to reinstall them both but my wife has trown the envelope in the garbage... = No Serial number available!!
    I´ve registered the serial number for Photoshop Element 11 on Adobe, but not the key for Premiere (they are on the same dvd).
    How can I get the serial number for Premiere 11?

    I do not think there is any way for anyone here to help you (we are just other users) so you are going to have to contact Adobe
    Forum for Download & Install & Setup problems
    http://forums.adobe.com/community/download_install_setup
    Chat http://www.adobe.com/support/download-install/supportinfo/
    -or http://www.adobe.com/support/chat/ivrchat.html
    And tell your wife to be more careful about throwing things away

  • How can I get a "user guide" for Elements 8?

    How can I get a "user guide" for Elements 8?

    See here (scroll down.):
    http://muvipix.com/products.php?subcat_id=44http://muvipix.com/products.php?subcat_id=44http://muvipix.com/products.php?subcat_id=44
    and here (Scroll to the bottom of page 2):
    http://www.amazon.com/s/ref=sr_pg_2?rh=n%3A283155%2Cn%3A%211000%2Cn%3A5%2Cp_27%3ASteve+Gri setti&page=2&ie=UTF8&qid=1370352322

  • How can I get the Application DVD for IMAC Late 2009?

    How can I get the Application DVD for IMAC Late 2009?

    Disk 2 of the original disks that came with the computer?
    Call Apple, give them your computer serial number, and they will ship you disks for a small charge if disks are available. Go to the Apple Store for your country, then to the bottom of the page//Contact Us for the correct telephone number.
    If that isn't what you ant, can you provide more information?

  • HT2589 Could you show me the full account information (account information)? How can I get the detail information that who charge me?

    Could you show me the full account information (account information)? How can I get the detail information that who charge me?

    I'm not entirely sure what you are asking, but you can view the purchase history on your account (and view your payment method) on your computer's iTunes : if you log into your account on your computer's iTunes via the Store > View Account menu option, you should then see a Purchase History section with a 'see all' link to the right of it. Click on that and you should then see a list of your purchases. On your iPad you can only see a cut-down version via this page (which also allows you to contact iTunes Support if you have a problem with a purchase) : http://reportaproblem.apple.com
    There are instructions on this page for managing and stopping auto-renewing subscriptions : http://support.apple.com/kb/HT4098
    Or do you mean something else ?

  • How can I get the AirPlay information box to stop floating around my screen while looking at photos?

    How can I get the AirPlay information box to stop floating around my screen while looking at photos?

    Thanks for answering
    Well, the CS2 was my 1st full program that now my son is using in his new Laptop...
    The CS4 Master Collection is my full program that I bought when I was in College course and now I use for my own works...
    Both came in their own serial numbers and discs ... I install both completely to each computer but at the end on the registration asked for this "Validation code" and the message says that I can't do it on-line nor by mail; so to call to this phone 1-800-833-6687 and in there have the message to come to the "support " Adobe website and do all this going around.
    Now I saw previously that page you send me... I really don't understand it ... I got CS2 installed but I just need the validation code to get rid of that 30 days message...
    Why I have to uninstall it??? Could you explain me please..

  • Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address.  My other devices all have the correct address.  How can I get the correct address for my iPhone?  The only Apple ID that works for logging in is my new one.

    Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address.  My other devices all have the correct address.  How can I get the correct address for my iPhone?  The only Apple ID that works for logging in is my new one.

    To change the iCloud ID you have to go to Settings>iCloud, tap Delete Account, provide the password for the old ID when prompted to turn off Find My iPhone (if you're using iOS 7), then sign back in with the ID you wish to use.  If you don't know the password for your old ID, or if it isn't accepted, go to https//appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Tap edit next to the primary email account, tap Edit, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iPhone on your device, even though it prompts you for the password for your old account ID. Then go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https//appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • The bookmarks toolbar is there but has no item buttons on it. How do I get the items back for this toolbar? Also would like to know if the toolbars can be put on the same line to make more room on the page (drag & drop) ??

    The bookmarks toolbar is there but has no item buttons on it. How do I get the items back for this toolbar?
    Also would like to know if the toolbar can be put on the same line to make more room on the page (drag & drop) ?? Like the menu & bookmarks toolbar could/should fit on same line. This would add more page view...
    Floyd Perry
    Thanks

    Check that you still have the "Bookmarks Toolbar items" placed on the Bookmarks Toolbar
    * Make sure that you have the "Bookmarks Toolbar" visible: "View > Toolbars"
    * Check in "View > Toolbars > Customize" that the "Bookmarks Toolbar items" is on the Bookmarks Toolbar
    * If the "Bookmarks Toolbar items" is not on the Bookmarks Toolbar then drag it back from the Customize window onto the Bookmarks Toolbar
    * If you do not see the "Bookmarks Toolbar items" then click the "Restore Default Set" button
    You can only move the content from a toolbar onto other toolbars if all toolbars support that feature. You need to check that in the options of each toolbar.

Maybe you are looking for