* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* $Id$ */
-
+
function encodeResource($doc, $container, $resource) {
// oslc_cm attributes
foreach ($resource as $field => $value) {
$element = $doc->createElementNS($prefix, $field, $resource[$field]);
$child = $container->appendChild($element);
}
-
+
$mandatorytags = array('dc:title', 'dc:identifier');
-
+
}
function createRessourceCollectionView($view){
{
$doc = new DOMDocument();
$doc->formatOutput = true;
-
+
$root = $doc->createElementNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf:RDF");
$root = $doc->appendChild($root);
-
+
$child = $doc->createElementNS("http://open-services.net/xmlns/cm/1.0/","oslc_cm:ChangeRequest");
$changerequest = $root->appendChild($child);
-
+
$child = $doc->createAttributeNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf:about");
$about = $changerequest->appendChild($child);
$child = $doc->createTextNode($view->id);
$child = $about->appendChild($child);
-
+
encodeResource($doc, $changerequest, $view->resource);
-
+
return $doc->saveXML();
}