This is the first of a series of papers devoted to the study of classical
initial-boundary value problems of Dirichlet, Neumann and mixed type for the
Nonlinear Schr\"odinger equation on the segment. Considering proper periodic
discontinuous extensions of the profile, generated by suitable point-like
sources, we show that the above boundary value problems can be rewritten as
nonlinear dynamical systems for suitable sets of algebro-geometric spectral
data, generalizing the classical Dubrovin equations.
In this paper we consider, as a first illustration of the above method, the
case of the Dirichlet problem on the segment with zero-boundary value at one
end, and we show that the corresponding dynamical system for the spectral data
can be written as a system of ODEs with algebraic right-hand side.