Running extension cord and Cat6a through wood closet shelf?
I'm not 100% clear on your description but the NEC and CEC prohibit extension cords in the walls.  There is more info at this link, obviously biased but in this case correct:  

http://www.powerbridgesolution.com/info/extensioncordwarning.html  

From NEC:  


  400.8 Uses Not Permitted (ref. Extension Cord) Flexible cords and cables shall not be used for the following:

      (1) As a substitute for the fixed wiring of a structure 
      (2) Where run through holes in walls, structural ceilings, suspended ceilings, dropped ceilings, or floors 
      (3) Where run through doorways, windows, or similar openings 
      (4) Where attached to building surfaces 
      (5) Where concealed by walls, floors, or ceilings or located above suspended or dropped ceilings



The Cat6, generally nothing to worry about, may not be code compliant depending on the locale, but believe me telcos and cable tv companies do worse things on a daily basis most places, low voltage is much safer.