I am implementing this : Additional info for a Component Presentation for controlling a Page layout outside Tridion by custom GUI extension. That is adding a custom tab for every component presentation. (Second option that Mihai Cădariu has suggested in his answer).
This custom tab works fine except one hitch. When we save the Component presentation metadata to the APP_DATA table, we fire the data save to DB by extending the OnSave command. However for new pages, the page ID is not generated when we push the data to the DB. This causes a error of invalid page URI since the save to DB method is getting called before the page save is completed.
Is there any way to wait until page save is completed and then push the data to the DB? I have to implement this through Anguilla UI extension only.