Index: openacs-4/contrib/packages/general-comments/PORTING.status =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/Attic/PORTING.status,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/PORTING.status 2 May 2003 15:48:43 -0000 1.1 @@ -0,0 +1,29 @@ +Author: Pascal Scheffers (Pascal@Scheffers.net) + +Porting status notes for general-comments + +General + +As of June 6, 2001 mostly done. You can add and administer comments. +* Delete does not seem to work [related to pg fk_ bug?] +* file attachements not yet ported: some BLOB issues in acs-messaging + are still pending, need to confer with OpenACS.org + +Tested with Postgresql and Oracle, sofar it seems to work. + +Notes + +file:/packages/general-comments/tcl/general-comments-procs.tcl +Moved most queries from variables to in-line for the QueryExtractor +appended '_deprecated' to query-names in 'ad_proc -deprecated' functions. +Left one duplicate + +Other TODOs +In .../sql/[pg and oracle]/gc-drop.sql: + Is the explicit deletion of image-attachments still required? + A: It seems not, commented out in Postgresql version. + Still todo: testing and Oracle + +Dates are hardcoded to MM-DD-YYYY format, need to move date handling +from SQL Tcl + Index: openacs-4/contrib/packages/general-comments/general-comments.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/Attic/general-comments.info,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/general-comments.info 2 May 2003 15:48:43 -0000 1.1 @@ -0,0 +1,132 @@ + + + + + General Comments + General Comments + f + t + comments + + + + oracle + postgresql + + Don Baccus + Provides commenting facility on objects. + 2003-01-30 + OpenACS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.da_DK.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.da_DK.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.da_DK.ISO-8859-1.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,106 @@ + + + + + Handlinger + Tilf�j en kommentar til + Tilf�j kommentar + Tilf�j filvedh�ftning + Tilf�j URL-kommentar + Administr�r + alt + godkend + Godkendt + godkendt + Vedh�ft et internetlink + Vedh�ftede filer/links + Forfatter + af + bytes + Annull�r + Kommentar: + Kommentarer + Bekr�ft + Bekr�ft kommentar + Bekr�ft kommentar til + slet + Slet en kommentar + Slet vedh�ftning + detaljer + redig�r + Redig�r kommentar + Redig�r kommentar til + Redig�r filvedh�ftning + Redig�r URL-kommentar + (redig�r dine kommentarer) + Filnavn: + Fulde Kommentarer + gc er ikke mountet + Generelle kommentarer + G� tilbage til kommentar + Har en synlig version + HTML + ID-nummer + Hvis + Billedvedh�ftning + Navn: + seneste 24 timer + Senest Godkendt + seneste m�ned + seneste uge + (synlig) + , da vil en fejl blive logget. Dette skyldes, at disse kald tilbagesender hyperlinks, der n�dvendigvis skal referere til en mountet + Tilf�j en filvedh�ftning til kommentaren + Tilf�j en URL-vedh�ftning til kommentaren + godkendt denne revision + Vedh�ft en fil eller et billede + Muligheden for filvedh�ftning er sl�et fra. + Muligheden for linkvedh�ftning er sl�et fra. + Nuv�rende v�rdier for pakken Generel Comments + �nsker du virkeligt at slette den f�lgende kommentar og dens vedh�ftede filer og links? + Er sikker p�, at du vil slette denne vedh�ftning? + Redig�r filen vedh�ftet til kommentaren + Redig�r URL'en vedh�ftet til kommentaren + Eksempel: http://www.openacs.org/ + Administration af Generelle Kommentarer + G� tilbage til d�r, hvor du kom fra + har valgt at begr�nse kommentarer til + S�dan vil din kommentar se ud: + Jeg vil gerne uploade en fil eller tilf�je et link til min kommentar + er ikke monteret og der kaldes til + Der er ingen tilg�ngelige kommentarer + ingen gc-pakkeinstanser + Bem�rk: Hvis teksten ovenfor har mistet alle sine linjeskift, skulle du sikkert have valgt "Ren tekst" fremfor "HTML". Brug "Tilbage"-knappen i din browser til at returnere til indsendelsesformularen. + Bem�rk: Hvis teksten ovenfor har mistet alle sine linjeskift, skulle du sikkert have valgt "Ren tekst" fremfor "HTML". Brug "Tilbage"-knappen i din browser til at returnere til indsendelsesformularen. + Testside til Generelle Kommentarer + Din comment_id peger ikke p� en gyldig kommentar. + Denne revision er synlig + Denne revision er ikke synlig. + Brug "Gennemse..."-knappen til at finde din fil og klik herefter p� "�bn". + Din fil er for stor. + Din fil har nul-l�ngde. Enten har du fors�gt at uploade en tom fil eller en fil, der ikke eksisterer. Ellers er der g�et noget galt under filoverf�rslen. + ingen vedh�ftninger + ingen + ikke defineret + Nummer + den + eller + pakkeinstans. + Ren tekst + Forts�t + afvis + afvis denne revision + Revisioner + Status + test + Teksten ovenfor er + Udgiveren af + Titel: + Titel + ikke godkendt + URL: + Vis kommentar + Vis kommentareren til + vis detaljer + dig + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.de_DE.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.de_DE.ISO-8859-1.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,108 @@ + + + + + Aktionen + Kommentar hinzuf�gen zu + Kommentar hinzuf�gen + Hinzuf�gen einer Anlage-Datei + URL Kommentar hinzuf�gen + Administrieren + alle + freigeben + Freigegeben + freigegeben + Anf�gen einer Web-Verkn�pfung + Anh�nge + Autor + von + Bytes + Abbrechen + Kommentar: + Kommentare + Best�tigen + Kommentar best�tigen + Best�tigung des Kommentars zu + l�schen + Einen Kommentar l�schen + Anhang l�schen + Details + bearbeiten + Kommentar bearbeiten + Bearbeiten des Kommentars zu + Bearbeiten der Datei-Anlage + Bearbeiten der Webadressen-Anf�gung + (bearbeiten Ihres Kommentars) + Dateiname: + Vollst�ndige Kommentare + gc ist nicht montiert. + General Comments + Zur�ck zum Kommentar + Hat eine "lebende" Version + HTML + ID Nr. + Falls + Bildanhang + Beschriftung: + letzte 24 Stunden + Letzte �nderung + letzter Monat + letzte Woche + (live) + , dann wird ein Fehler notiert werden. Das kommt daher, weil diese Aufrufe Hyperlinks ausgeben, welche folgendes referenzieren m�ssen: ein montiertes + Hinzuf�gen einer Anlage-Datei zum Kommentar + Hinzuf�gen einer URL-Anheftung zum Kommentar + �berarbeitete Version annehmen + Anheften einer Datei oder eines Bildes + Das Anheften von Dateien an Kommentare ist deaktiviert. + Das Anheften von Verkn�pfungen an Kommentare ist deaktiviert. + Aktuelle Werte f�r das Paket "Beliebige Kommentare" + Wollen Sie den folgenden Kommentar und seine Anheftungen wirklich l�schen? + M�chten Sie diese Anlage wirklich l�schen? + Bearbeiten einer Datei-Anlage zum Kommentar + Bearbeiten einer URL-Anheftung zum Kommentar. + Beispiel: http://www.dotlrn.org + General Comments Administration + Kehren Sie dorthin zur�ck wo Sie waren + hat festgelegt dass Anlagen limitiert werden auf + So w�rde Ihr Kommentar erscheinen: + Ich m�chte eine Datei hochladen oder eine Verkn�pfung zu meinem Kommentar hinzuf�gen: + ist nicht montiert, und Aufrufe werden get�tigt nach + Keine Kommentare verf�gbar + keine Instantiierung des gc-Pakets + Hinweis: Falls der obige Text alle Absatz-Abst�nde verloren gegangen sind, dann h�tten Sie m�glicherweise "einfaches Textformat" anstelle von "HTML" ausw�hlen sollen. +Benutzen Sie die "Zur�ck"-Schaltfl�che Ihres Browsers um zum Einsende-Formular zur�ckzukehren. + Hinweis: Falls der obige Text lauter sichtbare HTML-Tags aufweist, dann h�tten Sie m�glicherweise "HTML" anstelle von "einfaches Textformat" ausw�hlen sollen. +Benutzen Sie die "Zur�ck"-Schaltfl�che Ihres Browsers um zum Einsende-Formular zur�ckzukehren. + Testseite f�r General Comments + Die Kommentar-Identifikation bezieht sich nicht auf einen g�ltigen Kommentar. + Diese Version wird zur Zeit verwendet. + Diese Version wird zur Zeit nicht verwendet. + Benutzen Sie die Schaltfl�che "Durchsuchen..." um Ihre Datei zu finden und klicken Sie dann auf "�ffnen". + Die Datei ist zu gross. + Ihre Datei hat die L�nge 0. Entweder Sie haben wirklich versucht eine Datei der L�nge 0 hochzuladen, oder eine Datei die es nicht gibt, oder irgendetwas ist beim Transfer schiefgelaufen. + keine Anlagen + keines + nicht eingestellt + Nr. + auf + oder + Paket-Instantiierung. + Nur Text + Fortfahren + ablehnen + diese �berarbeitete Version ablehnen + �berarbeitete Versionen + Status + Test + Obiger Text ist + Der Herausgeber von + Titel: + Titel + nicht genehmigt + URL: + Kommentar ansehen + Ansicht des Kommentars zu + Detailansicht + Sie + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.en_US.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.en_US.ISO-8859-1.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,113 @@ + + + + + Actions + Add a comment to + Add comment + Add file attachment + Add url comment + Administer + all + approve + Approved + approved + Attach a web link + Attachments + Author + by + bytes + Cancel + Comment: + Comments + Confirm + Confirm comment + Confirm comment on + delete + Delete a comment + Delete attachment + details + edit + Edit comment + Edit comment on + Edit file attachment + Edit url attachment + (edit your comment) + Filename: + Full Comments + gc is not mounted + General Comments + Go back to comment + Has live version + HTML + ID# + If + Image attachment + Label: + last 24 hours + Last Modified + last month + last week + (live) + , then an error + will be logged. This is because these calls output hyperlinks + that would need to reference a mounted + Add a file attachment to comment + Add url attachment to comment + approve this revision + Attach a file or picture + Attaching files to comments has been disabled. + Attaching links to comments has been disabled. + Current values for General Comments package + Do you really wish to delete the following comment and its attachments? + Do you really wish to delete this attachment? + Edit file attachment on comment + Edit url attachment on comment + Example: http://www.arsdigita.com/ + General Comments Administration + Go back to where you were + has chosen to limit attachments to + Here is how your comment would appear: + I would like to upload a file or add a link to my comment + is not mounted and + calls are made to + No comments available + no gc package instance + Note: if the text above has lost all of its paragraph breaks then you + probably should have selected "Plain Text" rather than HTML. Use + your browser's Back button to return to the submission form. + Note: if the text above has a bunch of visible HTML tags then you probably + should have selected "HTML" rather than "Plain Text". Use your + browser's Back button to return to the submission form. + Test page for General Comments + The comment_id does not refer to a valid comment. + This revision is live. + This revision is not live. + Use the "Browse..." button to locate your file, then click "Open". + Your file is too large. + Your file is zero-length. Either you attempted to upload a zero length file, a file which does not exists, or something went wrong during the transfer. + no attachments + none + not set + Num + on + or + package instance. + Plain text + Proceed + reject + reject this revision + Revisions + Status + test + Text above is + The publisher of + Title: + Title + unapproved + URL: + View comment + View comment on + view details + you + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.es_ES.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.es_ES.ISO-8859-1.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,106 @@ + + + + + Acciones + A�adir un comentario a + A�adir comentario + Adjuntar archivo + A�adir URL + Administrar + todo + aprobar + Aprobado + aprobado + Adjuntar un enlace + Adjuntos + Autor + por + bytes + Cancelar + Comentario: + Comentarios + Confirmar + Confirmar comentario + Confirmar comentario sobre + borrar + Borrar un comentario + Borrar adjunto + detalles + editar + Editar comentario + Editar comentario sobre + Editar adjunto + Editar URL + (editar su comentario) + Nombre de archivo: + Comentarios completos: + gc no est� montado + Comentarios generales + Volver al comentario + Tiene versi�n actual + HTML + Identificador + Si + Imagen adjunta + Etiqueta: + �ltimas 24 horas + Ultima modificaci�n + �ltimo mes + �ltima semana + (actual) + , y el error ser� archivado. Es porque estas llamadas producen hiperenlaces que deber�an referenciar un + Adjuntar un archivo al comentario + Adjuntar una URL al comentario + aprobar esta revisi�n + Adjuntar un archivo o una imagen + Los adjuntos a comentarios han sido desactivados. + Los enlaces adjuntos a comentarios han sido desactivados. + Valores actuales para el paquete Comentarios Generales + Desea realmente borrar el comentario siguiente y sus adjuntos? + Desea realmente borrar este adjunto? + Editar el adjunto del comentario + Editar la URL adjunta al comentario + Ejemplo: http://www.arsdigita.com/ + Administraci�n de Comentarios Generales + Volver donde estaba + ha elegido limitar los adjuntos a + Vista previa de su comentario: + Quisiera subir un archivo o adjuntar un enlace a mi comentario + no est� montado y las llamadas se hacen a + No hay comentarios disponibles + no hay instancia del paquete gc + Nota: si el texto ha perdido su formato, deber�a elegir la opci�n "Texto plano" en lugar de HTML. Utilice el bot�n Atr�s de su navegador para volver al formulario. + Nota: si aparecen etiquetas HTML en el texto, deber�a elegir la opci�n "HTML" en lugar de "Texto plano". Utilice le bot�n Atr�s de su navegador para volver al formulario. + P�gina de pruebas de Comentarios Generales + El identificador de comentario no es v�lido. + Revisi�n actual. + Revisi�n no actual. + Utilice el bot�n "Browse..." para localizar su archivo, y pulse "Abrir". + Archivo demasiado grande. + Archivo de longitud 0. Est� tratando de subir un archivo vac�o, un archivo inexistente o bien ha ocurrido un error durante la transmisi�n. + sin adjuntos + ninguno + sin especificar + Nro + sobre + o + instancia de paquete. + Texto plano + Continuar + rechazar + rechazar esta revisi�n + Revisiones + Estado + prueba + Formato del texto + El editor de + T�tulo: + T�tulo + no aprobado + URL: + Ver comentario + Ver comentario sobre + ver detalles + Ud. + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.fi_FI.ISO-8859-15.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.fi_FI.ISO-8859-15.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.fi_FI.ISO-8859-15.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,74 @@ + + + + + Toimenpiteet + Lisää kommentti kohteeseen + Lisää kommentti + Lisää liitetiedosto + Lisää kommentti + Kommenttien hallinta + kaikki + hyväksy + Hyväksytty + hyväksy + Liitä www-linkki + Liitetiedostot + Lisääjä + kommentin jätti + tavua + Peruuta + Kommentti: + Kommentit + Vahvista + Vahvista kommentti + Vahvista kommenttisi kohteeseen + poista + Poista kommentti + Poista liitetiedosto + näytä yksityiskohdat + muokkaa + Muokkaa kommenttia + Muokkaa kommenttiasi kohteeseen + Muokkaa liitetiedostoa + Muokkaa lisäämääsi URL-linkkiä + (muokkaa kommenttiasi) + Tiedostonimi: + Täydet kommentit + gc-pakettia ei ole mountattu + Yleiset kommentit + Palaa takaisin kommenttiin + Sisältää näkyvissä olevan version + HTML + ID# + Jos pakettia + Kuvaliitetiedosto + Otsikko: + viimeisen 24 tunnin kuluessa + Muokattu viimeksi + viimeisen kuukauden aikana + viimeisen viikon aikana + (näkyvillä oleva versio) + , kirjataan virhe ylös. Tämä johtuu siitä, että nämä kutsut tuottavat hyperlinkkejä joiden pitää pystyä viittaamaan mountattuun + Lisää liitetiedosto kommenttiin + Lisää URL-linkki kommenttiin + hyväksy tämä versio + Liitä tiedosto tai kuva + Liitetiedostojen liittäminen kommentteihin on estetty. + Linkkien liittäminen kommentteihin on estetty. + Tämänhetkiset arvot Yleiset kommentit -paketille + Haluatko todellakin poistaa tämän kommentin ja sen kaikki liitteet? + Haluatko todellakin poistaa tämän liitetiedoston? + Tiedostoliite + WWW-linkki + Esimerkki: http://www.collaboraid.biz/ + Yleisten kommenttien hallinta + Palaa takaisin sinne, mistä tulit + on suuressa viisaudessaan päättänyt rajoittaa liitteiden koon + Kommenttisi näyttäisi tältä: + Haluan liittää tiedoston tai linkin kommenttiini + ei ole mountattu ja kutsutaan funktiota + Huom: Jos kaikki kappalevaihdot ovat hävinneet tekstistäsi, sinun kannattaisi valita muodoksi "Pelkkä teksti" HTML-merkkauksen sijaan. Voit palata selaimesi Back-napilla takaisin syöttölomakkeeseen. + Tiedostosi on liian suuri. + -paketin instanssiin. + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.gl_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.gl_ES.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.gl_ES.ISO-8859-1.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,106 @@ + + + + + Acci�ns + Engadir un comentario a + Engadir comentario + Engadir ficheiro anexo + Engadir comentario ao URL + Administrar + todos + aprobar + Aprobado + aprobado + Anexar un enderezo web + Anexos + Autor + por + bytes + Cancelar + Comentario: + Comentarios + Confirmar + Confirmar comentario + Confirmar comentario en + eliminar + Eliminar un comentario + Eliminar anexo + detalles + editar + Editar comentario + Editar comentario en + Editar ficheiro anexo + Editar URL anexo + (edite o seu comentario) + Nome do ficheiro: + Comentarios Completos + gc non est� montado + Comentarios + Voltar para comentario + Ten unha versi�n activa + HTML + ID# + Se + Imaxe anexa + Etiqueta: + �ltimas 24 horas + �ltima Modificaci�n + �ltimo mes + �ltima semana + (activo) + , ent�n un erro ser� arquivado. Isto porque estas chamadas crean ligaz�ns que precisar�an referenciar un (montado) + Engadir ficheiro anexo ao comentario + Engadir URL anexo ao comentario + aprobar esta revisi�n + Anexar un ficheiro ou imaxe + Anexar ficheiros a comentarios est� desactivado. + Anexar ligaz�ns a comentarios est� desactivado. + Valores actuais para o paquete de Comentarios + Vostede realmente desexa eliminar o seguinte comentario e os seus anexos? + Vostede realmente desexa eliminar este anexo? + Editar ficheiro anexo ao comentario + Editar URL anexo ao comentario + Exemplo: http://www.arsdigita.com/ + Administraci�n de Comentarios + Volte para o lugar de onde vostede veu + escolleu limitar anexos para + O seu comentario aparecer� as�: + Gostaba de cargar un ficheiro ou engadir unha ligaz�n ao meu comentario + non est� montado e fanse chamadas para + Ning�n comentario dispon�bel + ningunha instancia do paquete gc + Nota: se o texto de riba perdeu todas as s�as quebras de par�grafo, vostede probabelmente deber�a ter seleccionado "Texto Simple" ao inv�s de HTML. Use o bot�n de Voltar do seu navegador para retornar ao formulario de env�o. + Nota: se o texto de riba cont�n un feixe de etiquetas HTML, vostede probabelmente deber�a ter seleccionado "HTML" ao inv�s de "Texto Simple". Use o bot�n de Voltar do seu navegador para retornar ao formulario de env�o. + P�xina de teste para Comentarios + O comment_id non se refire a un comentario v�lido. + Esta revisi�n est� activa. + Esta revisi�n non est� activa. + Use o bot�n "Procurar..." para localizar o seu ficheiro, ent�n clique en "Abrir". + O seu ficheiro � grande demais. + O seu ficheiro ten tama�o cero. Ou vostede tentou cargar un ficheiro vac�o, ou un ficheiro que non existe, ou algo sa�u errado durante a transferencia. + ning�n anexo + ning�n + non configurado + N�m + en + ou + instancia do paquete. + Texto simple + Continuar + rexeitar + rexeitar esta revisi�n + Revisi�ns + Estado + teste + O texto de riba � + O publicador de + T�tulo: + T�tulo + non aprobado + URL: + Ver comentario + Ver comentario en + ver detalles + vostede + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.it_IT.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.it_IT.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.it_IT.ISO-8859-1.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,24 @@ + + + + + Azioni + Aggiungi un commento a + Amministra + Allegati + bytes + Cancella un commento + ommenti Generali + HTML + Se + Aggiungi un file allegato al commento + Allega un file o un'immagine + Vuoi veramente cancellare il commento seguente e i suoi allegati? + Esempio: http://www.arsdigita.com/ + Torna indietro a dove eri + Ecco come apparir� il tuo commento: + Nesun commento disponibile + File troppo grande. + oppure + URL: + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.nl_NL.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.nl_NL.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.nl_NL.ISO-8859-1.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,106 @@ + + + + + Handelingen + Voeg een commentaar toe aan + Toevoegen Commentaar + Toevoegen Bijlage + Toevoegen URL Commentaar + Beheer + alle + goedkeuren + Goedgekeurd + goedgekeurd + Voeg een weblink toe + Bijlagen + Auteur + door + bytes + Annuleer + Commentaar: + Commentaar + Bevestig + Bevestig commentaar + Bevestig commentaar op + verwijder + Verwijder commentaar + Verwijder bijlage + details + wijzig + Wijzig commentaar + Wijzig commentaar op + Wijzig Bijlage + Wijzig URL Bijlage + (wijzig commentaar) + Bestandsnaam: + Compleet Commentaar + gc is niet geactiveerd + Algemeen Commentaar + Ga terug naar commentaar + Heeft live versie + HTML + ID# + Als + Afbeelding als Bijlage + Label: + laatste 24 uur + Laatste Wijziging + afgelopen maand + afgelopen week + (live) + , dan zal een fout worden geregistreerd. Dit komt omdat deze oproepen hyperlinks produceren die moeten verwijzen naar een geactiveerd + Bestand toevoegen aan commentaar + Weblink toevoegen aan commentaar + keur deze wijziging goed + Toevoegen bestand of foto + Bestanden aan commentaar toevoegen is geblokkeerd. + Links aan commentaar toevoegen is geblokkeerd. + Huidige instellingen voor 'Algemeen Commentaar'. + Wilt u het volgende commentaar met bijlagen echt verwijderen? + Wilt u de bijlage echt verwijderen? + Wijzig bijlage van commentaar + Wijzig weblink van commentaar + Voorbeeld: http://www.arsdigita.com/ + Beheer Algemeen Commentaar + Ga terug naar waar u vandaan kwam + heeft besloten om bijlagen te limiteren tot + Zo zal uw commentaar verschijnen: + Ik wil een bestand of een link toevoegen aan het commentaar + is niet geactiveerd en 'calls' worden gedaan aan + Geen commentaar beschikbaar + geen 'gc package instance' + Bericht: als de paragraafindeling van bovenstaande tekst is verstoord, dan had u waarschijnlijk beter "Platte Tekst" dan "HTML" kunnen kiezen. Gebruik de Back-Terug knop van uw browser om dit te corrigeren. + Bericht: als bovenstaande tekst HTML tags bevat, dan had u waarschijnlijk "HTML" moeten kiezen in plaats van "Platte Tekst". Gebruik de Back-Terug knop van uw browser om dit te corrigeren. + Testpagina voor Algemeen Commentaar + Het commentaar_id verwijst niet naar een geldig commentaar. + Deze wijziging is live. + Deze wijziging is niet live. + Gebruik de "Snuffel/Browse..." knop om uw bestand te vinden en klik dan op "Open". + Het bestand is te groot. + De omvang van het bestand is nul. Of u heeft een bestand aangeboden dat niet bestaat of er is iets misgegaan tijdens de overdracht. + geen bijlagen + geen + niet ingesteld + Nr + op + or + package instance. + Platte Tekst + Ga verder + weiger + weiger deze wijziging + Wijzigingen + Status + test + Tekst hierboven is + De redacteur van + Titel: + Titel + niet goedgekeurd + URL: + Bekijk commentaar + Bekijk commentaar op + Bekijk details + u + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.no_NO.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.no_NO.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.no_NO.ISO-8859-1.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,106 @@ + + + + + Oppgaver + Legg en kommentar til + Legg inn kommentar + Legg til filtillegg + Ligg til URL-kommentar + Administrer + hele + godkjenn + Godkjent + godkjent + Legg ved en web-adresse + Vedlegg + Forfatter + av + bytes + Avbryt + Kommentar: + Kommentarer + Bekreft + Bekreft kommentar + Bekreft kommentar om + slett + Slett en kommentar + Slett vedlegg + detaljer + rediger + Rediger kommentar + Rediger kommentar p� + Rediger filvedlegg + Rediger URL-vedlegg + (rediger din kommentar) + Filnavn: + Fulle kommentarer + gc er ikke tilkoblet + Generelle kommentarer + G� tilbake til kommentarer + Har aktiv versjon + HTML + ID# + Hvis + Bildevedlegg + Merkelapp: + siste 24 timer + Sist endret + siste m�ned + siste uke + (p� luften) + , s� vil en feil logges. Dette fordi disse sp�rsm�lene om hyperlinks som ville ha behov for � referere en tilkoblet + Lett ved en fil til kommentaren + Legg ved en URL til kommentaren + godkjenn denne utgaven + Legg ved fil eller bilde + Vedlegg av filer til kommentarer er avsl�tt + Vedlegg av web-adresser til kommentarer er avsl�tt + Aktuelle verdier for generell kommentar-pakke + �nsker du virkelig � slett f�lgende kommentar med vedlegg? + �nsker du virkelig � slette dette vedlegget? + Rediger filen som er vedlagt kommentaren + Rediger web-adressen som er vedlagt kommentaren + Eksempel: http://www.arsdigita.com/ + Administrasjon av generelle kommentarer + G� tilbake til der du var + har valgt � begrense vedlegg til + Slik kommer dine kommentarer til � se ut: + Jeg vil legge ved en fil eller en web-adresse til kommentaren min + er ikke tilkoblet og meldinger sendes til + Ingen kommentarer tilgjengelig + no gc package instance + Obs: dersom teksten over har mistet alle sine linjeskift, har du sannsynligvis valgt "Enkel tekst" i stedet for HTML. Bruk tilbake-knappen p� nettleseren for � komme tilbake til innsendelsesskjemaet. + Obs: dersom teksten over har en rekke synlige HTML-tagger, skulle du sannsynligvis ha valgt "HTML" i stedet for "Enkel tekst". Bruk tilbake-knappen p� nettleseren for � komme tilbake til innsendelsesskjemaet. + Test-side for generelle kommentarer + Kommentar-ID viser ikke til en gyldig kommentar. + Dette utgaven er p� luften. + Denne utgaven er ikke p� luften. + Bruk "List..."-knappen til � finne filen din, og klikk "�pne". + Filen din er for stor. + Filen din har null lengde. Enten har du pr�vd � laste opp en fil med null lengde, en fil som ikke eksisterer, eller noe kan ha g�tt galt under overf�ringen. + ingen vedlegg + intet + Ikke satt + Num + p� + eller + package instance. + Enkel tekst + G� videre + forkast + forkast denne utgaven + Utgaver + Status + test + Teksten over er + Den som publiserer + Tittel: + Tittel + ikke godkjent + URL: + Se kommentar + Se kommentar om + se detaljer + du + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.pl_PL.ISO-8859-2.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.pl_PL.ISO-8859-2.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.pl_PL.ISO-8859-2.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,106 @@ + + + + + Czynno�ci + Dodaj komentarz do + Dodaj komentarz + Do��cz plik + Dodoaj komentarz o URL + Administruj + wszystkie + zatwierd� + Zatwierdzony + zatwierdzony + Za��cz link + Za��czniki + Autor + przez + bajt�w + Anuluj + Komentarz: + Komentarze + Potwierd� + Potwierd� komentarz + Potwierd� komentarz do + usu� + Usu� komentarz + Usu� za��cznik + szczeg�y + edytuj + Edytuj komentarz + Edytuj komentarz do + Edytuj za��cznik + Edytuj URL + (edytuj sw�j komentarz) + Nazwa pliku: + Pe�ny Komentarz + gc nie jest zamontowane + Komentarze + Wr�� do komentarza + Ma wersj� aktywn� + HTML + ID# + Je�li + Zdj�cie/Rysunek + Etykieta: + ostatnich 24 godzin + Ostatnio zmieniany + ostatniego miesi�ca + ostatniego tygodnia + (aktywne) + , b��d zostanie zapisany. Wyj�cie tych wywo�a� stanowi� linki, kt�re odnosz� si� do zamontowanych + Za��cz plik do komentarza + Za��cz URL do komentarza + zatwierd� t� wersj� + Za��cz plik lub obraz + Wy��czono mo�liwo�� za��czania plik�w. + Wy��czono mo�liwo�� dodawania link�w. + Aktualne parametry pakietu Komentarze + Czy na pewno usun�� ten komentarz i jego za��czniki? + Czy na pewno usun�� ten za��cznik? + Edytuj za��cznik plikowy do komentarza + Edytuj za��cznik-URL do komentarza + Przyk�ad: http://www.gtf.w.pl/ + Administracja Komentarzami + Powr�� + ograniczy� za��czniki do + Tak b�dzie wygl�da� Tw�j komentarz: + Chc� wgra� plik lub do��czy� link do mojego komentarza + nie jest zamontowany i wywo�ania kierowane do + Brak komentarzy + brak pakietu gc + Uwaga: je�li powy�szy tekst straci� podzia� na akapity, prawdopodobnie wybrano "Zwyk�y Tekst" zamiast "HTML". Powr�� do edycji formularza za pomoc� przyciku przegl�darki. + Uwaga: je�li powy�szy tekst zawiera widoczne znaczniki HTML, powiniene� prawdopodobnie wybra� HTML zamiast "Zwyk�y Tekst". Powr�� do edycji formularza za pomoc� przyciku przegl�darki. + Strona Testowa pakietu Komentarze + Id komentarza nie odnosi si� do wa�nej tre�ci + Ta wersja jest aktywna. + Ta wersja jest nieaktywna. + Wybierz plik za pomoc� przycisku "Przegl�daj..." lub "Browse...", nast�pnie kliknij "Otw�rz" lub "Open". + Tw�j plik jest zbyt du�y. + Tw�j plik jest zerowej wielko�ci. Albo �adowano nieistniej�cy plik, albo podczas transmisji nast�pi�a usterka. + brak za��cznik�w + �aden + nie ustawiony + Numer + na + lub + instancja pakietu. + Zwyk�y Tekst + Kontynuuj + odrzu� + odrzu� t� wersj� + Wersje + Status + testuj + Powy�szy tekst jest + Wydawca + Tytu�: + Tytul + niezatwierdzony + URL: + Zobacz zawarto�� + Zobacz komentarz do + zobacz szczeg�y + Ty + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.pt_BR.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.pt_BR.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.pt_BR.ISO-8859-1.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,107 @@ + + + + + A��es + Adicionar um coment�rio a + Adicionar coment�rio + Anexar arquivo + Adicionar coment�rio ao link + Administrar + todos + aprovar + Aprovado + aprovado + Anexar um link da web + Anexos + Autor + por + bytes + Cancelar + Coment�rio: + Coment�rios + Confirmar + Confirmar coment�rio + Confirmar coment�rio em + apagar + Apagar um coment�rio + Apagar anexo + detalhes + editar + Editar coment�rio + Editar coment�rio em + Editar arquivo anexo + Editar URL anexo + (edite seu coment�rio) + Nome do arquivo: + Coment�rio Completo + gc n�o est� montado + Coment�rios + Voltar para coment�rio + Tem uma vers�o ativa + HTML + ID# + Se + Imagem anexa + Etiqueta: + �ltimas 24 horas + �ltima Modifica��o + �ltimo m�s + �ltima semana + (ativo) + , ent�o um erro ser� arquivado. Isto porque estas chamadas criam links que precisariam referenciar um (montado) + Anexar um arquivo ao coment�rio + Anexar um link ao coment�rio + aprovar esta revis�o + Anexar um arquivo ou imagem + Anexar arquivos a coment�rios est� desativado. + Anexar links a coment�rios est� desativado. + Valores correntes para o pacote de Coment�rios + Voc� realmente deseja apagar o seguinte coment�rio e seus anexos? + Voc� realmente deseja apagar este anexo? + Editar arquivo anexo ao coment�rio + Editar link anexo ao coment�rio + Exemplo: http://www.arsdigita.com/ + Administra��o de Coment�rios + Volte para o lugar de onde voc� veio + escolheu limitar anexos para + Seu coment�rio aparecer� assim: + Eu gostaria de carregar um arquivo ou adicionar um link ao meu coment�rio + n�o est� montado e chamadas s�o feitas para + Nenhum coment�rio dispon�vel + nenhuma inst�ncia do pacote gc + Nota: se o texto acima perdeu todas as suas quebras de par�grafo, voc� provavelmente deveria ter selecionado "Texto Simples" ao inv�s de HTML. Use o bot�o de Voltar do seu navegador para retornar ao formul�rio de envio. + Nota: se o texto acima cont�m un feixe de etiquetas HTML, voc� provavelmente deveria ter selecionado "HTML" ao inv�s de "Texto Simples". Use o bot�o de Voltar do seu navegador para retornar ao formul�rio de envio. + P�gina teste para Coment�rios + O comment_id n�o se refere a um coment�rio v�lido. + Esta revis�o est� ativa. + Esta revis�o n�o est� ativa. + Use o bot�o "Procurar..." para localizar seu arquivo, ent�o clique em "Abrir". + Seu arquivo � muito grande. + Seu arquivo tem tamanho zero. Ou voc� tentou carregar um arquivo vazio, ou um arquivo que n�o existe, ou algo saiu errado durante a transfer�ncia. + nenhum anexo + nenhum + n�o configurado + Num + em + + ou + inst�ncia do pacote. + Texto simples + Continuar + rejeitar + rejeitar esta revis�o + Revis�es + Estado + teste + A texto acima � + O publicador de + T�tulo: + T�tulo + n�o aprovado + Link: + Ver coment�rio + Ver coment�rio em + ver detalhes + voc� + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.ru_RU.windows-1251.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.ru_RU.windows-1251.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.ru_RU.windows-1251.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,106 @@ + + + + + �������� + �������� ����������� � + �������� ����������� + ���������� ���� + �������� ������ (URL) + ���������������� + ��� + ��������� + ��������(�) + ��������(�) + ��������� WWW ������ + ���������� + ����� + : + ���� + �������� + �����������: + ����������� + ����������� + ����������� ����������� + ����������� ����������� � + ������� + ������� ����������� + ������� ���������� + ������ + ������������� + ������������� ����������� + ������������� ����������� � + ������������� ���������� + ������������� WWW ������ + (������������� ���� �����������) + ��� �����: + ������ ����������� + ����� gc �� ����������� + ����� ����������� + ��������� � ����������� + ����� �������������� ������ + HTML + ID# + ���� + ����������� �������� + �������: + ��������� 24 ���� + ��������� ���������� + ��������� ����� + ��������� ������ + (������������) + , ����� ����� ���������������� ������. ������ ��� ��� ������ ������ �����������, ������� ������ ��������� �� ������������� + ���������� ���� � ����������� + �������� � ����������� ������ (URL) + ��������� ��� �������� + ���������� ���� ��� �������� + ������������ ������ � ������������ �� ���������. + ���������� ������ � ������������ �� ���������. + ������� �������� ��� ������ ����� ����������� + �� ������������� ������ ������� ������������� ����������� � ������������� � ���� �����? + �� ������������� ������ ������� ��� ��������? + ��������/������� ������������� ���� + ������������� ������ + ������: http://www.vad1.com/ + ����������������� ����� ������������ + ��������� ����� + ����������, ��� ������������� ����� �� ����� ���� ������ + ��� ����� ��������� ��� �����������: + � ���� ���������� ���� ��� �������� ������ � ����� ����������� + �� �����������, � ������ �������� �� + ��� ������������ + ��� ����������� ����� ������ gc + ���� ����� ����������� ������������ ��� ��������� ����� � ��� ������, ��� �� �� ������, �� ��� �������� ���� ��������� � ����� �� ���������� �������� � �������� ��� ����� "HTML" �� "������� �����". + ���� � ������ ����������� �� ���� ������ HTML ����, ��� ������, ���� ��������� � ����� �� ���������� �������� � ������� ��� ����� "HTML" ������ "������� �����". + �������� �������� ��� ������ ����� ����������� + ��� ����������� � ���� comment_id. + ��� �������� ������������. + ��� �������� �� ������������. + ����� �� ������ "Browse..." (��� ��� ��� ��� ��-������ ����������), ������� ��� ���� � ������� �� "Open/�������". + ��� ���� ������� �����. + ��� ���� �������� �������� �������. ��������� �������: �� ����������� ���������� ������ ����, �������������� ����, ��� ���-�� �� ��������� � �������� ��������. + �������� ��� + ������� + �� ����������� + Num +   + ��� + ����������� ����� ������. + ������� ����� + ������ + ��������� + ��������� ��� �������� + �������� + ������ + ���� + ���� ������ + ��������� + ���������: + ��������� + �������������� + URL: + ����������� + ����������� � + �������� ������ + �� + Index: openacs-4/contrib/packages/general-comments/catalog/general-comments.sv_SE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/catalog/Attic/general-comments.sv_SE.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/catalog/general-comments.sv_SE.ISO-8859-1.xml 2 May 2003 15:48:59 -0000 1.1 @@ -0,0 +1,106 @@ + + + + + Funktioner + L�gg till en kommentar till + L�gg till kommentar + Bifoga fil + L�gg till url-kommentar + Administrera + alla + godk�nn + Godk�nd + godk�nd + Bifoga en l�nk + Bifogade filer + F�rfattare + av + bytes + Avbryt + Kommentar: + Kommentarer + Bekr�fta + Bekr�fta kommentar + Bekr�fta kommentar p� + radera + Radera en kommentar + Radera bifogad fil + detaljer + redigera + Redigera kommentar + Redigera kommentar p� + Redigera bifogad fil + Redigera bifogad url + (redigera din kommentar) + Filnamn: + Fullst�ndiga kommentarer + general-comments �r inte "mountad" + Kommentarer + Tillbaka till kommentaren + Live-version finns + HTML + ID# + Ifall + Bifogad bild + Beteckning: + senaste 24 timmarna + Senast �ndrad + senaste m�naden + senaste veckan + (live) + , s� kommer ett fel att loggas. Detta beror p� att dessa anrop returnerar hyperl�nkar som skulle beh�va h�nvisa till en "mountad" + Bifoga en fil till kommentaren + Bifoga url till kommentaren + godk�nn den h�r revisionen + Bifoga en fil eller bild + Bifogning av filer till kommentarer har avaktiverats. + Bifogning av l�nkar till kommentarer har avaktiverats. + Nuvarande v�rden f�r paketet "General Comments" + Vill du verkligen radera f�ljande kommentar och dess bifogade filer? + Vill du verkligen radera den h�r bifogade filen? + Redigera kommentarens bifogade fil + Redigera kommentarens bifogade url + Exempel: http://www.openacs.org/ + Administration av kommentarer + Tillbaka + har valt att begr�nsa bifogade filers storlek till + S� h�r kommer din kommentar se ut: + Jag vill ladda upp en fil eller l�gga till en l�nk till min kommentar + �r inte "mountad" och anrop g�rs till + Inga tillg�ngliga kommentarer + ingen general-comments-instans + Observera: Om texten ovan saknar ev. styckeindelningar skulle du antagligen ha valt "Enkel text" ist�llet f�r "HTML". Var god �terv�nd till formul�ret genom att anv�nda webbl�sarens "Tillbaka"-knapp och f�rs�k igen. + Observera: Om texten ovan har synliga HTML-taggar skulle du antagligen ha valt "HTML" ist�llet f�r "Enkel text". Var god �terv�nd till formul�ret genom att anv�nda webbl�sarens "Tillbaka"-knapp och f�rs�k igen. + Testsida f�r "General Comments" + comment_id h�nvisar inte till en giltig kommentar. + Den h�r revisionen �r live. + Den h�r revisionen �r inte live. + Anv�nd "Bl�ddra"-knappen f�r att finna din fil och klicka sedan p� "�ppna". + Din fil �r f�r stor. + Din fil har storlek 0. Antingen f�rs�kte du ladda upp en fil som var av storlek 0, en fil som inte finns eller s� gick n�gonting fel vid �verf�ringen. + inga bifogade filer + inga + inte satt + Nr. + den + eller + paketinstans. + Enkel text + N�sta + avsl� + avsl� den h�r revisionen + Revisioner + Status + test + Texten ovan �r + De ansvariga f�r + Titel: + Titel + icke godk�nda + URL: + Visa kommentar + Visa kommentar p� + visa detaljer + du + Index: openacs-4/contrib/packages/general-comments/sql/oracle/general-comments-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/sql/oracle/Attic/general-comments-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/sql/oracle/general-comments-create.sql 2 May 2003 15:49:13 -0000 1.1 @@ -0,0 +1,84 @@ +-- +-- packages/general-comments/sql/general-comments-create.sql +-- +-- @author Phong Nguyen (phong@arsdigita.com) +-- @creation-date 2000-10-12 +-- +-- @cvs-id $Id: general-comments-create.sql,v 1.1 2003/05/02 15:49:13 daveb Exp $ +-- +-- General comments: Commenting facility for any object in ACS 4.0 +-- + +-- create a table to extend cr_items +create table general_comments ( + comment_id constraint general_comments_comment_id_fk + references acs_messages (message_id) on delete cascade + constraint general_comments_pk + primary key, + object_id constraint general_comments_object_id_fk + references acs_objects (object_id) on delete cascade, + category varchar2(1000) +); +comment on table general_comments is ' + Extends the acs_messages table to hold item level data. +'; +comment on column general_comments.object_id is ' + The id of the object to associate message with +'; +comment on column general_comments.category is ' + This feature is not complete. The purpose is to allow separation of + comments into categories. +'; + +-- create an index on foreign key constraint +create index general_comments_object_id_idx on general_comments (object_id); + +-- define and grant privileges +declare + registered_users acs_objects.object_id%TYPE; + default_context acs_objects.object_id%TYPE; +begin + + -- retreive object ids for magic objects + registered_users := acs.magic_object_id('registered_users'); + default_context := acs.magic_object_id('default_context'); + + -- create privileges + acs_privilege.create_privilege('general_comments_create'); + + -- associte privileges to global privileges + acs_privilege.add_child('create','general_comments_create'); + + -- allow registered users to create comments + acs_permission.grant_permission ( + object_id => default_context, + grantee_id => registered_users, + privilege => 'general_comments_create' + ); + +end; +/ +show errors + +-- NOTE: this is only temporary until we figure out how +-- packages will register child types to an acs-message +begin + + content_type.register_child_type ( + parent_type => 'acs_message_revision', + child_type => 'content_revision' + ); + content_type.register_child_type ( + parent_type => 'acs_message_revision', + child_type => 'image' + ); + content_type.register_child_type ( + parent_type => 'acs_message_revision', + child_type => 'content_extlink' + ); + +end; +/ +show errors + + Index: openacs-4/contrib/packages/general-comments/sql/oracle/general-comments-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/sql/oracle/Attic/general-comments-drop.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/sql/oracle/general-comments-drop.sql 2 May 2003 15:49:13 -0000 1.1 @@ -0,0 +1,45 @@ +-- +-- packages/general-comments/sql/general-comments-drop.sql +-- +-- @author Phong Nguyen phong@arsdigita.com +-- @creation-date 2000-10-12 +-- +-- @cvs-id $Id: general-comments-drop.sql,v 1.1 2003/05/02 15:49:13 daveb Exp $ +-- + + +-- revoke all 'general_comments_create' permissions +delete from + acs_permissions +where + privilege = 'general_comments_create'; + +-- remove create privilege from the system +begin + acs_privilege.remove_child('create','general_comments_create'); + acs_privilege.drop_privilege('general_comments_create'); +end; +/ + +-- remove all comments from the system +declare + cursor comment_cur is + select comment_id + from general_comments; +begin + for comment_rec in comment_cur loop + -- There is a bug in content_item.delete that results in + -- referential integrity violations when deleting a content + -- item that has an image attachment. This is a temporary fix + -- until ACS 4.1 is released. + delete from images + where image_id in (select latest_revision + from cr_items + where parent_id = comment_rec.comment_id); + + acs_message.delete(comment_rec.comment_id); + end loop; +end; +/ + +drop table general_comments; Index: openacs-4/contrib/packages/general-comments/sql/postgresql/general-comments-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/sql/postgresql/Attic/general-comments-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/sql/postgresql/general-comments-create.sql 2 May 2003 15:49:31 -0000 1.1 @@ -0,0 +1,101 @@ +-- +-- packages/general-comments/sql/general-comments-create.sql +-- +-- @author Phong Nguyen (phong@arsdigita.com) +-- @author Pascal Scheffers (pascal@scheffers.net) +-- @creation-date 2000-10-12 +-- +-- @cvs-id $Id: general-comments-create.sql,v 1.1 2003/05/02 15:49:31 daveb Exp $ +-- +-- General comments: Commenting facility for any object in ACS 4.0 +-- + +-- create a table to extend cr_items +create table general_comments ( + comment_id integer constraint general_comments_comment_id_fk + references acs_messages (message_id) on delete cascade + constraint general_comments_pk + primary key, + object_id integer constraint general_comments_object_id_fk + references acs_objects (object_id) on delete cascade, + category varchar(1000) +); +comment on table general_comments is ' + Extends the acs_messages table to hold item level data. +'; +comment on column general_comments.object_id is ' + The id of the object to associate message with +'; +comment on column general_comments.category is ' + This feature is not complete. The purpose is to allow separation of + comments into categories. +'; + +-- create an index on foreign key constraint +create index general_comments_object_id_idx on general_comments (object_id); + +create function inline_0 () +returns integer as ' +-- define and grant privileges +declare + registered_users acs_objects.object_id%TYPE; + default_context acs_objects.object_id%TYPE; +begin + + -- retreive object ids for magic objects + registered_users := acs__magic_object_id(''registered_users''); + default_context := acs__magic_object_id(''default_context''); + + -- create privileges + PERFORM acs_privilege__create_privilege(''general_comments_create'', null, null); + + -- associte privileges to global privileges + PERFORM acs_privilege__add_child(''create'',''general_comments_create''); + + -- allow registered users to create comments + PERFORM acs_permission__grant_permission ( + default_context, + registered_users, + ''general_comments_create'' + ); + + return 0; +end;' language 'plpgsql'; + +select inline_0 (); + +drop function inline_0 (); + +-- show errors + +-- NOTE: this is only temporary until we figure out how +-- packages will register child types to an acs-message +create function inline_1 () +returns integer as ' +begin + + PERFORM content_type__register_child_type ( + /* parent_type => */ ''acs_message_revision'', + /* child_type => */ ''content_revision'', + ''generic'', 0, null + ); + PERFORM content_type__register_child_type ( + /* parent_type => */ ''acs_message_revision'', + /* child_type => */ ''image'', + ''generic'', 0, null + ); + PERFORM content_type__register_child_type ( + /* parent_type => */ ''acs_message_revision'', + /* child_type => */ ''content_extlink'', + ''generic'', 0, null + ); + return 0; +end;' language 'plpgsql'; + +select inline_1 (); + +drop function inline_1 (); + +-- show errors + + Index: openacs-4/contrib/packages/general-comments/sql/postgresql/general-comments-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/sql/postgresql/Attic/general-comments-drop.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/sql/postgresql/general-comments-drop.sql 2 May 2003 15:49:31 -0000 1.1 @@ -0,0 +1,59 @@ +-- +-- packages/general-comments/sql/general-comments-drop.sql +-- +-- @author Phong Nguyen phong@arsdigita.com +-- @author Pascal Scheffers (pascal@scheffers.net) +-- @creation-date 2000-10-12 +-- +-- @cvs-id $Id: general-comments-drop.sql,v 1.1 2003/05/02 15:49:31 daveb Exp $ +-- + +-- revoke all 'general_comments_create' permissions +delete from + acs_permissions +where + privilege = 'general_comments_create'; + +-- remove create privilege from the system +-- begin + select acs_privilege__remove_child('create','general_comments_create'); + select acs_privilege__drop_privilege('general_comments_create'); +-- end; +-- / + +-- remove all comments from the system +create function inline_0 () +returns integer as ' +declare + comment_rec RECORD; +begin + + FOR comment_rec IN select comment_id from general_comments LOOP + + -- There is a bug in content_item.delete that results in + -- referential integrity violations when deleting a content + -- item that has an image attachment. This is a temporary fix + -- until ACS 4.1 is released. + + /* + delete from images + where image_id in (select latest_revision + from cr_items + where parent_id = comment_rec.comment_id); + */ + + perform acs_message__delete(comment_rec.comment_id); + + END LOOP; + + return 0; +end;' language 'plpgsql'; + +select inline_0 (); + +drop function inline_0 (); + +-- / + +drop table general_comments; + Index: openacs-4/contrib/packages/general-comments/tcl/general-comments-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/tcl/Attic/general-comments-procs-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/tcl/general-comments-procs-oracle.xql 2 May 2003 15:49:59 -0000 1.1 @@ -0,0 +1,87 @@ + + + + oracle8.1.6 + + + + + select g.comment_id, + r.title, + r.mime_type, + o.creation_user, + acs_object.name(o.creation_user) as author, + to_char(o.creation_date, 'MM-DD-YYYY') as pretty_date, + to_char(o.creation_date, 'Month DD, YYYY HH12:MI PM') as pretty_date2 + $content_select + from general_comments g, + cr_revisions r, + acs_objects o + where g.object_id = :object_id and + r.revision_id = content_item.get_live_revision(g.comment_id) and + o.object_id = g.comment_id + order by o.creation_date + + + + + + + + select site_node.url(s.node_id) as package_url + from site_nodes s, apm_packages a + where s.object_id = a.package_id and + lower(a.package_key) = 'general-comments' and + RowNum = 1 + + + + + + + + select site_node.url(s.node_id) + from site_nodes s, apm_packages a + where s.object_id = a.package_id and + a.package_key = 'general-comments' + + + + + + + + select g.comment_id, + r.title, + r.content, + r.mime_type, + o.creation_user, + to_char(o.creation_date, 'MM-DD-YYYY') as creation_date, + p.first_names || ' ' || p.last_name as author + from general_comments g, + cr_items i, + cr_revisions r, + acs_objects o, + persons p + where g.object_id = :object_id and + i.item_id = g.comment_id and + r.revision_id = i.live_revision and + o.object_id = g.comment_id and + p.person_id = o.creation_user + order by creation_date + + + + + + + + select site_node.url(s.node_id) + from site_nodes s, apm_packages a + where s.object_id = a.package_id and + a.package_key = 'general-comments' + + + + + Index: openacs-4/contrib/packages/general-comments/tcl/general-comments-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/tcl/Attic/general-comments-procs-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/tcl/general-comments-procs-postgresql.xql 2 May 2003 15:49:59 -0000 1.1 @@ -0,0 +1,87 @@ + + + + postgresql7.1 + + + + + select g.comment_id, + r.title, + r.mime_type, + o.creation_user, + acs_object__name(o.creation_user) as author, + to_char(o.creation_date, 'MM-DD-YYYY') as pretty_date, + to_char(o.creation_date, 'Month DD, YYYY HH12:MI PM') as pretty_date2 + $content_select + from general_comments g, + cr_revisions r, + acs_objects o + where g.object_id = :object_id and + r.revision_id = content_item__get_live_revision(g.comment_id) and + o.object_id = g.comment_id + order by o.creation_date + + + + + + + + select site_node__url(s.node_id) as package_url + from site_nodes s, apm_packages a + where s.object_id = a.package_id and + lower(a.package_key) = 'general-comments' + LIMIT 1 + + + + + + + + select site_node__url(s.node_id) + from site_nodes s, apm_packages a + where s.object_id = a.package_id and + a.package_key = 'general-comments' + + + + + + + + select g.comment_id, + r.title, + r.content, + r.mime_type, + o.creation_user, + to_char(o.creation_date, 'MM-DD-YYYY') as creation_date, + p.first_names || ' ' || p.last_name as author + from general_comments g, + cr_items i, + cr_revisions r, + acs_objects o, + persons p + where g.object_id = :object_id and + i.item_id = g.comment_id and + r.revision_id = i.live_revision and + o.object_id = g.comment_id and + p.person_id = o.creation_user + order by creation_date + + + + + + + + select site_node__url(s.node_id) + from site_nodes s, apm_packages a + where s.object_id = a.package_id and + a.package_key = 'general-comments' + + + + + Index: openacs-4/contrib/packages/general-comments/tcl/general-comments-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/tcl/Attic/general-comments-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/tcl/general-comments-procs.tcl 2 May 2003 15:49:59 -0000 1.1 @@ -0,0 +1,270 @@ +# /packages/general-comments/tcl/general-comments-procs.tcl + +# Porting: Moved most queries from variables to in-line +# for the QueryExtractor, appended '_deprecated' to +# query-names in 'ad_proc -deprecated' functions. +# Left one duplicate with 100% identical SQL (pascal) + +ad_library { + Utility procs for general-comments + + @author Phong Nguyen + @author Pascal Scheffers + + @creation-date 2000-10-12 + @cvs-id $Id: general-comments-procs.tcl,v 1.1 2003/05/02 15:49:59 daveb Exp $ +} + +ad_proc -public general_comments_get_comments { + { -print_content_p 0 } + { -print_attachments_p 0 } + object_id + {return_url {}} +} { + Generates a line item list of comments for the object_id. + + @param print_content_p Pass in 1 to print out content of comments. + @param print_attachments_p Pass in 1 to print out attachments of comments, + only works if print_content_p is 1. + @param object_id The object_id to retrieve the comments for. + @param return_url A url for the user to return to after viewing a comment. +} { + + # get the package url + set package_url [general_comments_package_url] + if { [empty_string_p $package_url] } { + return "" + } + + # initialize variables + if { $print_content_p == 0 } { + set content_select "" + set content "" + } else { + set content_select [db_map content_select] ;# ", r.content" + } + # ns_log notice "content_select: $content_select" + + set html "" + db_foreach get_comments " + select g.comment_id, + r.title, + r.mime_type, + o.creation_user, + acs_object.name(o.creation_user) as author, + to_char(o.creation_date, 'MM-DD-YYYY') as pretty_date, + to_char(o.creation_date, 'Month DD, YYYY HH12:MI PM') as pretty_date2 + $content_select + from general_comments g, + cr_revisions r, + acs_objects o + where g.object_id = :object_id and + r.revision_id = content_item.get_live_revision(g.comment_id) and + o.object_id = g.comment_id + order by o.creation_date" { + # call on helper proc to print out comment + append html [general_comments_print_comment $comment_id $title $mime_type \ + $creation_user $author $pretty_date $pretty_date2 $content \ + $print_content_p $print_attachments_p $package_url $return_url] + } + return $html +} + +ad_proc -private general_comments_print_comment { + comment_id + title + mime_type + creation_user + author + pretty_date + pretty_date2 + content + print_content_p + print_attachments_p + package_url + return_url +} { + Helper proc to format and print out a single comment. + @param comment_id The id of the comment. + @param title The title of the comment. + @param mime_type The mime_type of the comment. + @param creation_user The creation user of the comment. + @param author The name of the author. + @param pretty_date A short pretty date of the comment. + @param pretty_date2 A long pretty date of the comment. + @param content The content of the comment. + @param print_content_p Pass in 1 to print out content of comments. + @param print_attachments_p Pass in 1 to print out attachments of comments. + @param package_url The url to the mounted general-comments package instance. + @param return_url A url for the user to return to after viewing a comment. +} { + + # -- create query statements to retrieve attachments + # PRS: Moved inline for QueryExtractor + + # This part is really ugly. This will remain here until we figure out a way to + # move this into a template. + set html "" + if { $print_content_p == 1 } { + append html "

$title

\n" + if { $mime_type == "text/plain" } { + append html "[util_convert_plaintext_to_html $content]\n" + } else { + append html "$content\n" + } + if { $print_attachments_p == 1 } { + set attachments_html "" + db_foreach get_attachments " + select r.title, r.mime_type, i.name, i.item_id + from cr_items i, cr_revisions r + where i.parent_id = :comment_id + and r.revision_id = i.live_revision" { + + append attachments_html "
  • $title " + if { $mime_type == "image_gif" || $mime_type == "image/jpeg" } { + append attachments_html "($name)\n" + } else { + append attachments_html "($name)\n" + } + } + + db_foreach get_links " + select i.item_id, e.label, e.url + from cr_items i, cr_extlinks e + where i.parent_id = :comment_id and e.extlink_id = i.item_id" { + append attachments_html "
  • $label\n" + } + if { ![empty_string_p $attachments_html] } { + append html "
    [_ general-comments.Attachments]
    \n
      \n$attachments_html
    \n" + } else { + append html "

    " + } + } + append html "

    -- $author [_ general-comments.on] $pretty_date2 ([_ general-comments.view_details])

    \n" + } else { + append html "
  • $title [_ general-comments.by] $author [_ general-comments.on] $pretty_date
    \n" + } + + return $html +} + + +ad_proc -public general_comments_create_link { + -object_name + { -link_text {Add a comment} } + -context_id + { -category {} } + object_id + {return_url {}} +} { + Generates an html link to add a comment to an object. + + @param object_id The object to comment on. + @param return_url A url for the user to return to after viewing a comment. + @param object_name The name of the object. + @param link_text The text to display for the link. + @param context_id The context_id for the comment. + @param category A category to associate comment to. +} { + # get the package url + set package_url [general_comments_package_url] + if { [empty_string_p $package_url] } { + return "" + } + + # initialize variables + if { ![info exists object_name] } { set object_name [acs_object_name $object_id] } + if { ![info exists context_id] } { set context_id $object_id } + + set html "$link_text" + + return $html +} + +ad_proc -private general_comments_package_url {} { + Returns a url pointing to the mounted general-comments package. + Uses util_memoize for caching. +} { + return [util_memoize [list general_comments_package_url_not_cached]] +} + +ad_proc -private general_comments_package_url_not_cached {} { + Returns a url pointing to the mounted general-comments package. + Goes to the database on every invocation. +} { + + if { [db_0or1row get_package_url "" ] } { + return $package_url + } else { + # log an error message + ns_log "Notice" "The General Comments package is not mounted." + return "" + } +} + +# these are being replaced with the above procs +namespace eval general_comments { + +ad_proc -deprecated get_comments {object_id return_url} { + Generates a line item list of comments for the object_id. + + @param object_id The object_id to retrieve the comments for. + @param return_url A url for the user to return to after viewing a comment. + + @see general_comments_get_comments +} { + + # get the package url + set package_url [db_string get_package_url_deprecated " + select site_node.url(s.node_id) + from site_nodes s, apm_packages a + where s.object_id = a.package_id and + a.package_key = 'general-comments'"] + + set html "" + db_foreach get_comments_deprecated " + select g.comment_id, + r.title, + r.content, + r.mime_type, + o.creation_user, + to_char(o.creation_date, 'MM-DD-YYYY') as creation_date, + p.first_names || ' ' || p.last_name as author + from general_comments g, + cr_items i, + cr_revisions r, + acs_objects o, + persons p + where g.object_id = :object_id and + i.item_id = g.comment_id and + r.revision_id = i.live_revision and + o.object_id = g.comment_id and + p.person_id = o.creation_user + order by creation_date" { + append html "
  • $title by $author, $creation_date
    \n" + } + return "$html" +} + +ad_proc -deprecated create_link {object_id object_name return_url link_text {context_id ""} {category ""}} { + Generates an html link to add a comment to an object. + @param object_id The object to comment on. + @param object_name The name of the object. + @param return_url A url for the user to return to after viewing a comment. + @param link_text The text to display for the link. + @param category A category to associate comment to. + + @see general_comments_create_link +} { + # get the package url + set package_url [db_string get_package_url_deprecated " + select site_node.url(s.node_id) + from site_nodes s, apm_packages a + where s.object_id = a.package_id and + a.package_key = 'general-comments'"] + + set html "$link_text" + return $html +} + +} Index: openacs-4/contrib/packages/general-comments/tcl/general-comments-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/tcl/Attic/general-comments-procs.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/tcl/general-comments-procs.xql 2 May 2003 15:49:59 -0000 1.1 @@ -0,0 +1,33 @@ + + + + + + + , r.content + + + + + + + + select r.title, r.mime_type, i.name, i.item_id + from cr_items i, cr_revisions r + where i.parent_id = :comment_id + and r.revision_id = i.live_revision + + + + + + + + select i.item_id, e.label, e.url + from cr_items i, cr_extlinks e + where i.parent_id = :comment_id and e.extlink_id = i.item_id + + + + + Index: openacs-4/contrib/packages/general-comments/www/comment-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-add-2.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-add-2.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,48 @@ +# /packages/general-comments/www/comment-add-2.tcl + +ad_page_contract { + Confirms a comment for an object_id + + @author Phong Nguyen + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: comment-add-2.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + object_id:integer,notnull + { object_name "[acs_object_name $object_id]" } + title:notnull + content:html,notnull + comment_mime_type:notnull + { context_id "$object_id" } + { category {} } + { return_url {} } +} -properties { + page_title:onevalue + context:onevalue + comment_mime_type:onevalue + title:onevalue + content:onevalue + target:onevalue + object_id:onevalue + object_name:onevalue + category:onevalue + return_url:onevalue +} + +# check to see if the user can create comments on this object +ad_require_permission $object_id general_comments_create + +# ad_page_contract does not set object_name to +# [acs_object_name $object_id] if object_name is passed +# in as an empty string. +if { [empty_string_p $object_name] } { + set object_name [acs_object_name $object_id] +} + +set comment_id [db_nextval acs_object_id_seq] +set page_title "[_ general-comments.Confirm_comment_on] $object_name" +set context "\"[_ general-comments.Confirm_comment]\"" +set target "comment-add-3" +set html_content [ad_html_text_convert -from $comment_mime_type -- $content] + +ad_return_template "comment-ae-2" Index: openacs-4/contrib/packages/general-comments/www/comment-add-3-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-add-3-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-add-3-oracle.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,68 @@ + + + + oracle8.1.6 + + + + + begin + :1 := acs_message.new ( + message_id => :comment_id, + title => :title, + mime_type => :comment_mime_type, + data => empty_blob(), + context_id => :context_id, + creation_user => :user_id, + creation_ip => :creation_ip, + is_live => :is_live + ); + end; + + + + + + + + + select content_item.get_latest_revision(:comment_id) as revision_id + from dual + + + + + + + + + update cr_revisions + set content = empty_blob() + where revision_id = :revision_id + returning content into :1 + + + + + + + + + begin + acs_permission.grant_permission ( + object_id => :comment_id, + grantee_id => :user_id, + privilege => 'read' + ); + acs_permission.grant_permission ( + object_id => :comment_id, + grantee_id => :user_id, + privilege => 'write' + ); + end; + + + + + + Index: openacs-4/contrib/packages/general-comments/www/comment-add-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-add-3-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-add-3-postgresql.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,73 @@ + + + + postgresql7.1 + + + + select acs_message__new ( + :comment_id, -- 1 p_message_id + NULL, -- 2 p_reply_to + current_timestamp, -- 3 p_sent_date + NULL, -- 4 p_sender + NULL, -- 5 p_rfc822_id + :title, -- 6 p_title + NULL, -- 7 p_description + :comment_mime_type, -- 8 p_mime_type + NULL, -- 9 p_text + NULL, -- empty_blob(), -- 10 p_data + 0, -- 11 p_parent_id + :context_id, -- 12 p_context_id + :user_id, -- 13 p_creation_user + :creation_ip, -- 14 p_creation_ip + 'acs_message', -- 15 p_object_type + :is_live -- 16 p_is_live + ) + + + + + + + + select content_item__get_latest_revision(:comment_id) as revision_id + + + + + + + + + + update cr_revisions + set content = :content + where revision_id = :revision_id + + + + + + + + + begin + perform acs_permission__grant_permission ( + /* object_id => */ :comment_id, + /* grantee_id => */ :user_id, + /* privilege => */ 'read' + ); + perform acs_permission__grant_permission ( + /* object_id => */ :comment_id, + /* grantee_id => */ :user_id, + /* privilege => */ 'write' + ); + return 0; + end; + + + + + + + Index: openacs-4/contrib/packages/general-comments/www/comment-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-add-3.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-add-3.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,95 @@ +# /packages/general-comments/www/comment-add-3.tcl + +ad_page_contract { + Inserts a comment for object_id into the database + + @author Phong Nguyen + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: comment-add-3.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + comment_id:integer,notnull + object_id:integer,notnull + title:notnull + content:html,notnull + comment_mime_type + { context_id "$object_id" } + { category "" } + { return_url "" } + { attach_p "f" } +} + +# authenticate the user +set user_id [ad_maybe_redirect_for_registration] + +# check to see if the user can create comments on this object +ad_require_permission $object_id general_comments_create + +# insert the comment into the database +set creation_ip [ad_conn peeraddr] +set is_live [ad_parameter AutoApproveCommentsP {general-comments} {t}] +db_transaction { + db_exec_plsql insert_comment { + begin + :1 := acs_message.new ( + message_id => :comment_id, + title => :title, + mime_type => :comment_mime_type, + data => empty_blob(), + context_id => :context_id, + creation_user => :user_id, + creation_ip => :creation_ip, + is_live => :is_live + ); + end; + } + + db_dml add_entry { + insert into general_comments + (comment_id, + object_id, + category) + values + (:comment_id, + :object_id, + :category) + } + + db_1row get_revision { + select content_item.get_latest_revision(:comment_id) as revision_id + from dual + } + + db_dml set_content { + update cr_revisions + set content = empty_blob() + where revision_id = :revision_id + returning content into :1 + } -blobs [list $content] + + # Grant the user sufficient permissions to + # created comment. This is done here to ensure that + # a fail on permissions granting will not leave + # the comment with incorrect permissions. + db_exec_plsql grant_permission { + begin + acs_permission.grant_permission ( + object_id => :comment_id, + grantee_id => :user_id, + privilege => 'read' + ); + acs_permission.grant_permission ( + object_id => :comment_id, + grantee_id => :user_id, + privilege => 'write' + ); + + end; + } +} + +if { [string equal $attach_p "f"] && ![empty_string_p $return_url] } { + ad_returnredirect $return_url +} else { + ad_returnredirect "view-comment?[export_vars { comment_id return_url }]" +} Index: openacs-4/contrib/packages/general-comments/www/comment-add-3.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-add-3.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-add-3.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,20 @@ + + + + + + + insert into general_comments + (comment_id, + object_id, + category) + values + (:comment_id, + :object_id, + :category) + + + + + + Index: openacs-4/contrib/packages/general-comments/www/comment-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-add.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-add.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,53 @@ +# /packages/general-comments/www/comment-add.tcl + +ad_page_contract { + Displays a form for adding a commment to a page + + @author Phong Nguyen + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: comment-add.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + object_id:integer,notnull + { object_name "[acs_object_name $object_id]" } + { context_id "$object_id" } + { category "" } + { return_url "" } +} -properties { + page_title:onevalue + context:onevalue + target:onevalue + title:onevalue + content:onevalue + comment_mime_type:onevalue + object_id:onevalue + object_name:onevalue + context_id:onevalue + category:onevalue + return_url:onevalue +} + +# check to see if the user can create comments on this object +ad_require_permission $object_id general_comments_create + +# ad_page_contract does not set object_name to +# [acs_object_name $object_id] if object_name is passed +# in as an empty string. +if { [empty_string_p $object_name] } { + set object_name [acs_object_name $object_id] +} + +set page_title "[_ general-comments.Add_a_comment_to]: $object_name" +set context "\"[_ general-comments.Add_comment]\"" +set target "comment-add-2" +set title "" +set content "" +set comment_mime_type "text/plain" + +ad_return_template "comment-ae" + + + + + + Index: openacs-4/contrib/packages/general-comments/www/comment-ae-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-ae-2.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-ae-2.adp 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,28 @@ + +@page_title@ +@context@ + +#general-comments.lt_Here_is_how_your_comm# + +
    +

    @title@

    +@html_content@ +
    + + + #general-comments.lt_Note_if_the_text_abov# + + + #general-comments.lt_Note_if_the_text_abov_1# + + +
    +
    +<%= [export_form_vars comment_id object_id object_name context_id title content comment_mime_type category return_url] %> + +

    + +

    +
    + + Index: openacs-4/contrib/packages/general-comments/www/comment-ae.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-ae.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-ae.adp 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,37 @@ + +@page_title@ +@context@ +comment.title + +@page_title@ + +
    +
    +<%= [export_form_vars comment_id object_id object_name context_id return_url] %> +#general-comments.Title#
    + +

    +#general-comments.Comment#
    +
    +#general-comments.Text_above_is# + +

    +
    +
    + +
    + + + + + Index: openacs-4/contrib/packages/general-comments/www/comment-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-edit-2.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-edit-2.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,43 @@ +# /packages/general-comments/www/comment-edit-2.tcl + +ad_page_contract { + Confirms a comment for an object_id + + @param comment_id The id of the comment to edit + @param object_name The name of the object this comment refers to + @param title The title of the comment + @param content The actual comment + @param mime_type The type of format for the comment + + @author Phong Nguyen + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: comment-edit-2.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + comment_id:integer,notnull + object_id:integer,notnull + title:notnull + content:notnull,html + comment_mime_type + { return_url {} } +} -properties { + page_title:onevalue + context:onevalue + mime_type:onevalue + title:onevalue + content:onevalue + target:onevalue +} + +# check to see if the user can edit this comment +ad_require_permission $comment_id write + +set page_title "[_ general-comments.Confirm_comment_on]: [acs_object_name $object_id]" +set context "\"[_ general-comments.Confirm_comment]\"" +set target "comment-edit-3" + +set html_content [ad_html_text_convert -from $comment_mime_type -- $content] + +ad_return_template "comment-ae-2" + + Index: openacs-4/contrib/packages/general-comments/www/comment-edit-3-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-edit-3-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-edit-3-oracle.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,47 @@ + + + + oracle8.1.6 + + + + + begin + :1 := acs_message.edit ( + message_id => :comment_id, + title => :title, + mime_type => :comment_mime_type, + data => empty_blob(), + creation_user => :user_id, + creation_ip => :creation_ip, + is_live => :is_live + ); + end; + + + + + + + + + select content_item.get_latest_revision(:comment_id) as revision_id + from dual + + + + + + + + + update cr_revisions + set content = empty_blob() + where revision_id = :revision_id + returning content into :1 + + + + + + Index: openacs-4/contrib/packages/general-comments/www/comment-edit-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-edit-3-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-edit-3-postgresql.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,52 @@ + + + + postgresql7.1 + + + + declare + v_revision_id integer; + begin + select acs_message__edit ( + /* message_id => */ :comment_id, + /* title => */ :title, + /* p_description */ NULL, + /* mime_type => */ :comment_mime_type, + /* text */ NULL, + /* data => */ NULL, -- was empty_blob(), + /* creation_date */ now(), + /* creation_user => */ :user_id, + /* creation_ip => */ :creation_ip, + /* is_live => */ :is_live + ) into v_revision_id; + + return v_revision_id; + end; + + + + + + + + + select content_item__get_latest_revision(:comment_id) as revision_id + + + + + + + + + + update cr_revisions + set content = :content + where revision_id = :revision_id + + + + + + Index: openacs-4/contrib/packages/general-comments/www/comment-edit-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-edit-3.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-edit-3.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,57 @@ +# /packages/general-comments/www/comment-edit-3.tcl + +ad_page_contract { + Creates a new revision of a comment. + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: comment-edit-3.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + comment_id:integer,notnull + title + content:html + comment_mime_type + { return_url {} } +} + +# check to see if the user can edit this comment +ad_require_permission $comment_id write + +# authenticate the user +set user_id [ad_verify_and_get_user_id] + +# insert the revision into the database +set is_live [ad_parameter AutoApproveCommentsP {general-comments} {t}] +set creation_ip [ad_conn peeraddr] +db_transaction { + db_exec_plsql insert_comment { + begin + :1 := acs_message.edit ( + message_id => :comment_id, + title => :title, + mime_type => :comment_mime_type, + data => empty_blob(), + creation_user => :user_id, + creation_ip => :creation_ip, + is_live => :is_live + ); + end; + } + + db_1row get_revision { + select content_item.get_latest_revision(:comment_id) as revision_id + from dual + } + + db_dml set_content { + update cr_revisions + set content = empty_blob() + where revision_id = :revision_id + returning content into :1 + } -blobs [list $content] + +} + +ad_returnredirect "view-comment?[export_url_vars comment_id return_url]" + Index: openacs-4/contrib/packages/general-comments/www/comment-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-edit-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-edit-oracle.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,13 @@ + + + + oracle8.1.6 + + + + select content_item.get_latest_revision(:comment_id) from dual + + + + + Index: openacs-4/contrib/packages/general-comments/www/comment-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-edit-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-edit-postgresql.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,13 @@ + + + + postgresql7.1 + + + + select content_item__get_latest_revision(:comment_id) + + + + + Index: openacs-4/contrib/packages/general-comments/www/comment-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-edit.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-edit.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,58 @@ +# /packages/general-comments/www/comment-edit.tcl + +ad_page_contract { + Displays a form for editing a commment + + @param comment_id The id of the comment to edit + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: comment-edit.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + comment_id:integer,notnull + { revision_id {} } + { return_url {} } +} -properties { + page_title:onevalue + context:onevalue + target:onevalue + title:onevalue + content:onevalue + comment_mime_type:onevalue + comment_id:onevalue + revision_id:onevalue + return_url:onevalue +} + +# check to see if the user can edit this comment +ad_require_permission $comment_id write + +# if revision_id is not passed in, assume that the user +# wishes to edit the latest revision +if { [empty_string_p $revision_id] } { + set revision_id [db_string get_latest_revision \ + "select content_item.get_latest_revision(:comment_id) from dual"] +} + +# get the values from the database +if { ![db_0or1row get_comment { + select g.object_id, + r.title, + r.content, + r.mime_type as comment_mime_type + from general_comments g, + cr_revisions r + where g.comment_id = :comment_id and + r.revision_id = :revision_id +}] } { + ad_return_complaint 1 "The comment_id does not refer to a valid comment." +} + +set page_title "[_ general-comments.Edit_comment_on]: [acs_object_name $object_id]" +set context "\"[_ general-comments.Edit_comment]\"" +set target "comment-edit-2" + +ad_return_template "comment-ae" + + Index: openacs-4/contrib/packages/general-comments/www/comment-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/comment-edit.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/comment-edit.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,20 @@ + + + + + + + select g.object_id, + r.title, + r.content, + r.mime_type as comment_mime_type + from general_comments g, + cr_revisions r + where g.comment_id = :comment_id and + r.revision_id = :revision_id + + + + + + Index: openacs-4/contrib/packages/general-comments/www/delete-attachment-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/delete-attachment-2-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/delete-attachment-2-oracle.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,61 @@ + + + + oracle8.1.6 + + + + + select mime_type + from cr_revisions + where item_id = :attach_id + and revision_id = content_item.get_latest_revision (:attach_id) + + + + + + + + + delete from images + where image_id = content_item.get_latest_revision(:attach_id) + + + + + + + + + begin + acs_message.delete_image(:attach_id); + end; + + + + + + + + + begin + acs_message.delete_file(:attach_id); + end; + + + + + + + + + begin + content_extlink.delete(:attach_id); + end; + + + + + + Index: openacs-4/contrib/packages/general-comments/www/delete-attachment-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/delete-attachment-2-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/delete-attachment-2-postgresql.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,58 @@ + + + + postgresql7.1 + + + + + select mime_type + from cr_revisions + where item_id = :attach_id + and revision_id = content_item__get_latest_revision (:attach_id) + + + + + + + + + delete from images + where image_id = content_item__get_latest_revision(:attach_id) + + + + + + + + + select acs_message__delete_image(:attach_id); + + + + + + + + + select acs_message__delete_file(:attach_id); + + + + + + + + + begin + perform content_extlink__delete(:attach_id); + return 0; + end; + + + + + + Index: openacs-4/contrib/packages/general-comments/www/delete-attachment-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/delete-attachment-2.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/delete-attachment-2.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,84 @@ +# /packages/general-comments/www/delete-attachment-2.tcl + +ad_page_contract { + Deletes an attachment + + @param attach_id The id of the attachment to delete + @param parent_id The id of the comment this attachment refers to + @param submit Determines the action to take + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: delete-attachment-2.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + attach_id:integer,notnull + parent_id:integer,notnull + submit:notnull + { return_url {} } +} + +# check for permissions +ad_require_permission $attach_id delete + +# all of this messy code will be replaced by +# a single content_item.delete after the bug fix +# is released + +#Commented out during i18n convertion, Steffen +#if { $submit == "Proceed" } { + + + # get the type of the attachment + db_1row get_type { + select content_type + from cr_items + where item_id = :attach_id + } + if { $content_type == "content_revision" } { + # get the mime_type + db_1row get_mime_type { + select mime_type + from cr_revisions + where item_id = :attach_id + and revision_id = content_item.get_latest_revision (:attach_id) + } + if { $mime_type == "image/jpeg" || $mime_type == "image/gif" } { + # delete row from images table, we should only have one row + # this is only temporary until CR provides a delete image function + db_dml delete_image_row { + delete from images + where image_id = content_item.get_latest_revision(:attach_id) + } + db_exec_plsql delete_image { + begin + acs_message.delete_image(:attach_id); + end; + } + } else { + db_exec_plsql delete_attachment { + begin + acs_message.delete_file(:attach_id); + end; + } + } + } elseif { $content_type == "content_extlink" } { + db_exec_plsql delete_extlink { + begin + content_extlink.delete(:attach_id); + end; + } + } + +#/ i18n +#} + +ad_returnredirect "view-comment?comment_id=$parent_id&[export_url_vars return_url]" + + + + + + + + Index: openacs-4/contrib/packages/general-comments/www/delete-attachment-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/delete-attachment-2.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/delete-attachment-2.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + + select content_type + from cr_items + where item_id = :attach_id + + + + + + Index: openacs-4/contrib/packages/general-comments/www/delete-attachment.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/delete-attachment.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/delete-attachment.adp 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,28 @@ + +@page_title@ +@context@ + +#general-comments.lt_Do_you_really_wish_to_1# +

    +

    + + + + + +
    +
    + <%= [export_form_vars attach_id parent_id return_url] %> + +
    +
    +
    + + <%= [export_form_vars return_url] %> + +
    +
    +
    + + Index: openacs-4/contrib/packages/general-comments/www/delete-attachment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/delete-attachment.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/delete-attachment.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,32 @@ +# /packages/general-comments/www/admin/delete-attachment.tcl + +ad_page_contract { + Delete an attachment + + @param attach_id The id of the file attachment to delete + @param parent_id The id of the comment this attachment refers to + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: delete-attachment.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + attach_id:integer,notnull + parent_id:integer,notnull + { return_url {} } +} -properties { + page_title:onevalue + context:onevalue + attach_id:onevalue + parent_id:onevalue + return_url:onevalue +} + +# check for permissions +ad_require_permission $attach_id delete + +# set template variables +set page_title "[_ general-comments.Delete_attachment]" +set context "\"[_ general-comments.Delete_attachment]\"" + +ad_return_template Index: openacs-4/contrib/packages/general-comments/www/file-add-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-add-2-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-add-2-oracle.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,70 @@ + + + + oracle8.1.6 + + + + + begin + :1 := acs_message.new_image ( + message_id => :parent_id, + image_id => :attach_id, + file_name => :client_filename, + title => :title, + mime_type => :guessed_file_type, + content => empty_blob(), + width => :original_width, + height => :original_height, + creation_user => :user_id, + creation_ip => :creation_ip, + is_live => :is_live + ); + end; + + + + + + + + + begin + :1 := acs_message.new_file ( + message_id => :parent_id, + file_id => :attach_id, + file_name => :client_filename, + title => :title, + mime_type => :guessed_file_type, + content => empty_blob(), + creation_user => :user_id, + creation_ip => :creation_ip, + is_live => :is_live + ); + end; + + + + + + + + + select content_item.get_latest_revision(:attach_id) as revision_id + from dual + + + + + + + + update cr_revisions + set filename = '$tmp_filename', + content_length = $tmp_size + where revision_id = :revision_id + + + + + Index: openacs-4/contrib/packages/general-comments/www/file-add-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-add-2-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-add-2-postgresql.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,65 @@ + + + + postgresql7.1 + + + + + select acs_message__new_image ( + /* message_id => */ :parent_id, + /* image_id => */ :attach_id, + /* file_name => */ :client_filename, + /* title => */ :title, + /* description => */ NULL, + /* mime_type => */ :guessed_file_type, + /* data => */ NULL, + /* width => */ :original_width, + /* height => */ :original_height, + /* create_date => */ current_timestamp, + /* creation_user => */ :user_id, + /* creation_ip => */ :creation_ip, + /* is_live => */ :is_live, + /* storage_type => */ 'file' + ); + + + + + + + + select acs_message__new_file ( + /* message_id => */ :parent_id, + /* file_id => */ :attach_id, + /* file_name => */ :client_filename, + /* title => */ :title, + /* description => */ NULL, + /* mime_type => */ :guessed_file_type, + /* data => */ NULL, + /* creation_date => */ current_timestamp, + /* creation_user => */ :user_id, + /* creation_ip => */ :creation_ip, + /* is_live => */ :is_live, + /* storage_type => */ 'file' + ); + + + + + + + select content_item__get_latest_revision(:attach_id) as revision_id + + + + + + update cr_revisions + set content = '$tmp_filename', + content_length = $tmp_size + where revision_id = :revision_id + + + + Index: openacs-4/contrib/packages/general-comments/www/file-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-add-2.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-add-2.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,153 @@ +# /packages/general-comments/www/file-add-2.tcl + +ad_page_contract { + Creates a new file attachment + + @param attach_id A new id to create the file attachment with + @param parent_id The id of the comment to attach file + @param title The title of the file attachment + @param upload_file The name of the file + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: file-add-2.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + attach_id:integer,notnull + parent_id:integer,notnull + title:notnull + upload_file:notnull + upload_file.tmpfile:tmpfile + { return_url {} } +} -validate { + allow_file_attachments { + set allow_files_p [ad_parameter AllowFileAttachmentsP {general-comments} {t}] + if { $allow_files_p != "t" } { + ad_complain "[_ general-comments.lt_Attaching_files_to_co]" + } + } + check_file_size { + set tmp_size [file size ${upload_file.tmpfile}] + set max_file_size [ad_parameter MaxFileSize {general-comments} {0}] + if { $tmp_size > $max_file_size && $max_file_size > 0 } { + ad_complain "[_ general-comments.lt_Your_file_is_too_larg] [_ general-comments.The_publisher_of] [ad_system_name] [_ general-comments.lt_has_chosen_to_limit_a] [util_commify_number $max_file_size] [_ general-comments.bytes].\n" + } + if { $tmp_size == 0 } { + ad_complain "[_ general-comments.lt_Your_file_is_zero-len]\n" + } + } +} + + +# authenticate the user +set user_id [ad_verify_and_get_user_id] + +# check to see if the user can create comments +ad_require_permission $parent_id write + +# get the file extension +set tmp_filename ${upload_file.tmpfile} +set file_extension [string tolower [file extension $upload_file]] + +# remove the first . from the file extension +regsub {\.} $file_extension "" file_extension +set guessed_file_type [ns_guesstype $upload_file] + +# if the guessed_file_type is not an entry in +# cr_mime_types, then set it as null +if { ![db_0or1row is_mime_type_valid { + select mime_type + from cr_mime_types + where mime_type = :guessed_file_type }] } { + set guessed_file_type [db_null] +} + +# strip off the C:\directories... crud and just get the file name +if ![regexp {([^/\\]+)$} $upload_file match client_filename] { + # couldn't find a match + set client_filename $upload_file +} + +set what_aolserver_told_us "" +if { $file_extension == "jpeg" || $file_extension == "jpg" } { + catch { set what_aolserver_told_us [ns_jpegsize $tmp_filename] } +} elseif { $file_extension == "gif" } { + catch { set what_aolserver_told_us [ns_gifsize $tmp_filename] } +} + +# the AOLserver jpegsize command has some bugs where the height comes +# through as 1 or 2 +if { ![empty_string_p $what_aolserver_told_us] && [lindex $what_aolserver_told_us 0] > 10 && [lindex $what_aolserver_told_us 1] > 10 } { + set original_width [lindex $what_aolserver_told_us 0] + set original_height [lindex $what_aolserver_told_us 1] +} else { + set original_width "" + set original_height "" +} + + +# insert the file comment into the database +set creation_ip [ad_conn peeraddr] +set is_live "t" +db_transaction { + if { $file_extension == "jpeg" || $file_extension == "jpg" || $file_extension == "gif" } { + db_exec_plsql insert_image { + begin + :1 := acs_message.new_image ( + message_id => :parent_id, + image_id => :attach_id, + file_name => :client_filename, + title => :title, + mime_type => :guessed_file_type, + content => empty_blob(), + width => :original_width, + height => :original_height, + creation_user => :user_id, + creation_ip => :creation_ip, + is_live => :is_live + ); + end; + } + } else { + db_exec_plsql insert_file { + begin + :1 := acs_message.new_file ( + message_id => :parent_id, + file_id => :attach_id, + file_name => :client_filename, + title => :title, + mime_type => :guessed_file_type, + content => empty_blob(), + creation_user => :user_id, + creation_ip => :creation_ip, + is_live => :is_live + ); + end; + } + } + + db_1row get_revision { + select content_item.get_latest_revision(:attach_id) as revision_id + from dual + } + +# db_dml set_content { +# update cr_revisions +# set content = empty_blob() +# where revision_id = :revision_id +# returning content into :1 +# } -blob_files [list $tmp_filename] + +# DRB: Since we're using acs_message to store the file, it is automatically +# stuffed into the file system rather than database whether we need it or +# not. This needs to be *changed* ... the whole way we read and write CR content +# based on storage type needs cleaning up. + + set tmp_filename [cr_create_content_file $attach_id $revision_id ${upload_file.tmpfile}] + + db_dml set_content_size "" + +} + +ad_returnredirect "view-comment?comment_id=$parent_id&[export_url_vars return_url]" + Index: openacs-4/contrib/packages/general-comments/www/file-add-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-add-2.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-add-2.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,14 @@ + + + + + + + select mime_type + from cr_mime_types + where mime_type = :guessed_file_type + + + + + Index: openacs-4/contrib/packages/general-comments/www/file-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-add.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-add.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,46 @@ +# /packages/general-comments/www/file-add.tcl + +ad_page_contract { + Creates a new file attachment + + @param parent_id The id of the comment to attach to + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: file-add.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + parent_id:notnull,integer + {return_url {} } +} -properties { + page_title:onevalue + context:onevalue + parent_id:onevalue + target:onevalue + title:onevalue + file_name:onevalue +} -validate { + allow_file_attachments { + set allow_files_p [ad_parameter AllowFileAttachmentsP {general-comments} {t}] + if { $allow_files_p != "t" } { + ad_complain "Attaching files to comments has been disabled." + } + } +} + +# check to see if the user can add an attachment +ad_require_permission $parent_id write + +# set variables for template +set attach_id [db_nextval acs_object_id_seq] +set page_title "[_ general-comments.lt_Add_a_file_attachment] #$parent_id" +set context [list [list "view-comment?comment_id=$parent_id" "[_ general-comments.Go_back_to_comment]"] "[_ general-comments.Add_file_attachment]"] +set target "file-add-2" +set title "" +set file_name "" + +ad_return_template "file-ae" + + + + Index: openacs-4/contrib/packages/general-comments/www/file-ae.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-ae.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-ae.adp 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,34 @@ + +@page_title@ +@context@ +@parent_id@ + +
    +<%= [export_form_vars attach_id parent_id return_url] %> +
    + + + + + + + + + +
    #general-comments.Title#
    #general-comments.Filename# + +
    + #general-comments.lt_Use_the_Browse_button# +
    + + @file_name@ + +
    +
    + +

    +

    + +
    +
    + Index: openacs-4/contrib/packages/general-comments/www/file-download.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-download.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-download.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,19 @@ +# /packages/general-comments/www/file-download.tcl + +ad_page_contract { + Downloads a file + + @param item_id The id of the file attachment + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: file-download.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + item_id:notnull +} + +# check for permissions +ad_require_permission $item_id read + +cr_write_content -item_id $item_id Index: openacs-4/contrib/packages/general-comments/www/file-edit-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-edit-2-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-edit-2-oracle.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,15 @@ + + + + oracle8.1.6 + + + + + select content_item.get_latest_revision(:attach_id) as revision_id from dual + + + + + + Index: openacs-4/contrib/packages/general-comments/www/file-edit-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-edit-2-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-edit-2-postgresql.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,15 @@ + + + + postgresql7.1 + + + + + select content_item__get_latest_revision(:attach_id) as revision_id + + + + + + Index: openacs-4/contrib/packages/general-comments/www/file-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-edit-2.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-edit-2.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,36 @@ +# /packages/general-comments/www/file-edit-2.tcl + +ad_page_contract { + Edit the title for a file attachment + + @param attach_id The id of the attachment to edit + @param parent_id The id of the comment this attachment refers to + @param title The value of the new title + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: file-edit-2.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + attach_id:integer,notnull + parent_id:integer,notnull + title:notnull + { return_url {} } +} + +# check to see if the user can edit this comment +ad_require_permission $attach_id write + +db_1row get_revision_id { + select content_item.get_latest_revision(:attach_id) as revision_id from dual +} +db_dml edit_title { + update cr_revisions + set title = :title + where revision_id = :revision_id +} + +ad_returnredirect "view-comment?comment_id=$parent_id&[export_url_vars return_url]" + + + Index: openacs-4/contrib/packages/general-comments/www/file-edit-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-edit-2.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-edit-2.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + + update cr_revisions + set title = :title + where revision_id = :revision_id + + + + + + Index: openacs-4/contrib/packages/general-comments/www/file-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-edit-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-edit-oracle.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,19 @@ + + + + oracle8.1.6 + + + + + select r.title, + i.name as file_name + from cr_items i, cr_revisions r + where i.item_id = :attach_id and + r.revision_id = content_item.get_latest_revision(i.item_id) + + + + + + Index: openacs-4/contrib/packages/general-comments/www/file-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-edit-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-edit-postgresql.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,19 @@ + + + + postgresql7.1 + + + + + select r.title, + i.name as file_name + from cr_items i, cr_revisions r + where i.item_id = :attach_id and + r.revision_id = content_item__get_latest_revision(i.item_id) + + + + + + Index: openacs-4/contrib/packages/general-comments/www/file-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/file-edit.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/file-edit.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,43 @@ +# /packages/general-comments/www/file-edit.tcl + +ad_page_contract { + Edits a file comment + + @param attach_id The id of the attachment to edit + @param parent_id The id of the comment this attachment refers to + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: file-edit.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + attach_id:integer,notnull + parent_id:integer,notnull + { return_url {} } +} -properties { + page_title:onevalue + context:onevalue + parent_id:onevalue + target:onevalue + title:onevalue + file_name:onevalue +} + +# check to see if the user can edit this comment +ad_require_permission $attach_id write + +# get the values from the database +db_1row get_comment { + select r.title, + i.name as file_name + from cr_items i, cr_revisions r + where i.item_id = :attach_id and + r.revision_id = content_item.get_latest_revision(i.item_id) +} + +# set variables for template +set page_title "[_ general-comments.lt_Edit_file_attachment_] #$parent_id" +set context [list [list "view-comment?comment_id=$parent_id" "[_ general-comments.Go_back_to_comment]"] "[_ general-comments.Edit_file_attachment]"] +set target "file-edit-2" + +ad_return_template "file-ae" Index: openacs-4/contrib/packages/general-comments/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/index-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/index-oracle.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,57 @@ + + + + oracle8.1.6 + + + + + select g.comment_id, + r.title, + acs_object.name(o.creation_user) as author, + o.creation_user, + decode(i.live_revision,null,0,1) as live_version_p, + decode(i.live_revision,r.revision_id,1,0) as approved_p, + to_char(o.creation_date, 'MM-DD-YYYY HH12:MI:AM') as pretty_date + from general_comments g, + cr_items i, + cr_revisions r, + acs_objects o + where g.comment_id = i.item_id and + r.revision_id = o.object_id and + r.revision_id = content_item.get_latest_revision(g.comment_id) and + o.creation_user = :user_id + [ad_dimensional_sql $dimensional] + [ad_order_by_from_sort_spec $orderby $table_def] + + + + + + + + creation_date + 1 > sysdate + + + + + + + + creation_date + 7 > sysdate + + + + + + + + creation_date + 30 > sysdate + + + + + + + + Index: openacs-4/contrib/packages/general-comments/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/index-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/index-postgresql.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,56 @@ + + + + postgresql7.1 + + + + select * from ( + select g.comment_id, + r.title, + acs_object__name(o.creation_user) as author, + o.creation_user, + case when i.live_revision=null then 0 else 1 end as live_version_p, + case when i.live_revision=r.revision_id then 0 else 1 end as approved_p, + to_char(o.creation_date, 'MM-DD-YYYY HH12:MI:AM') as pretty_date, + o.creation_date + from general_comments g, + cr_items i, + cr_revisions r, + acs_objects o + where g.comment_id = i.item_id and + r.revision_id = o.object_id and + r.revision_id = i.latest_revision and + o.creation_user = :user_id + [ad_dimensional_sql $dimensional]) as unordered + [ad_order_by_from_sort_spec $orderby $table_def] + + + + + + + + + creation_date > now() - '1 days'::interval + + + + + + + + creation_date > now() - '7 days'::interval + + + + + + + + creation_date > now() - '30 days'::interval + + + + + Index: openacs-4/contrib/packages/general-comments/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/index.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/index.adp 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,16 @@ + +@page_title@ +@context@ + + + [ #general-comments.Administer# ] + +

    +@dimensional_bar@ +

    +@comments_table@ + + + + + Index: openacs-4/contrib/packages/general-comments/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/index.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/index.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,91 @@ +# /packages/general-comments/www/index.tcl + +ad_page_contract { + General comments main page + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: index.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + {orderby {pretty_date*} } +} -properties { + page_title:onevalue + context:onevalue + dimensional_bar:onevalue + comments_table:onevalue +} + +# authenticate the user +set user_id [ad_maybe_redirect_for_registration] + +# check for admin privileges +set package_id [ad_conn package_id] +set admin_p [ad_permission_p $package_id admin] + +# return_url to be passed to various helper pages so that we return to +# this page with the proper parameters +set return_url [ns_urlencode index?[export_ns_set_vars url]] + + +set dimensional [list \ + [list approval "[_ general-comments.Status]" any [list \ + [list approved "[_ general-comments.approved]" {where "[db_map status_approved]"}] \ + [list unapproved "[_ general-comments.unapproved]" {where "[db_map status_unapproved]"}] \ + [list any "[_ general-comments.all]" {} ] \ + ]] \ + [list modified "[_ general-comments.Last_Modified]" 1m [list \ + [list 1d "[_ general-comments.last_24_hours]" {where "[db_map modified_last_24hours]"}] \ + [list 1w "[_ general-comments.last_week]" {where "[db_map modified_last_week]"}] \ + [list 1m "[_ general-comments.last_month]" {where "[db_map modified_last_month]"}] \ + [list any "[_ general-comments.all]" {} ] \ +]] +] +set dimensional_bar [ad_dimensional $dimensional] + +# ad_table definition +set table_def [list \ + [list num "[_ general-comments.Num]" {} {$Tcount}] \ + [list comment_id "[_ general-comments.ID]" {} \ + {$comment_id}] \ + [list title "[_ general-comments.Title_1]" {} {}] \ + [list approved_p "[_ general-comments.Approved]" {} 01] \ + [list live_version_p "[_ general-comments.Has_live_version]" {} 01] \ + [list pretty_date "[_ general-comments.Last_Modified]" {creation_date $order} {}] \ +] + +# sql to retrieve comments +set sql " + select g.comment_id, + r.title, + acs_object.name(o.creation_user) as author, + o.creation_user, + decode(i.live_revision,null,0,1) as live_version_p, + decode(i.live_revision,r.revision_id,1,0) as approved_p, + to_char(o.creation_date, 'MM-DD-YYYY HH12:MI:AM') as pretty_date + from general_comments g, + cr_items i, + cr_revisions r, + acs_objects o + where g.comment_id = i.item_id and + r.revision_id = o.object_id and + r.revision_id = content_item.get_latest_revision(g.comment_id) and + o.creation_user = :user_id + [ad_dimensional_sql $dimensional] + [ad_order_by_from_sort_spec $orderby $table_def] +" + +# create the table to display the comments +set bind_ns_set [ad_tcl_vars_to_ns_set user_id] +set extra_var_list [list return_url $return_url] +set comments_table [ad_table -Torderby $orderby \ + -Tmissing_text "[_ general-comments.lt_No_comments_available]" \ + -Textra_vars $extra_var_list \ + -bind $bind_ns_set \ + comments_select $sql $table_def] + +set page_title "[_ general-comments.General_Comments]" +set context {} + +ad_return_template + Index: openacs-4/contrib/packages/general-comments/www/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/index.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/index.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,21 @@ + + + + + + + i.live_revision is not null + + + + + + + + i.live_revision is null + + + + + + Index: openacs-4/contrib/packages/general-comments/www/test.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/test.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/test.adp 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,99 @@ + +@page_title@ +@context@ + + +

    + + + + + + + + + + + + + + + + + + + + + +
    #general-comments.lt_Current_values_for_Ge#
    package_id + + #general-comments.lt_no_gc_package_instanc# + + + @package_id@ +
    package_url + + #general-comments.gc_is_not_mounted# + + + @package_url@ +
    AutoApproveCommentsP + + #general-comments.not_set# + + + + @auto_approve_comments_p@ +
    AllowFileAttachmentsP + + #general-comments.not_set# + + + + @allow_file_attachments_p@ +
    AllowLinkAttachmentsP + + #general-comments.not_set# + + + + @allow_link_attachments_p@ +
    MaxFileSize + + #general-comments.not_set# + + + + @max_file_size@ +
    + + +

    +

    #general-comments.Comments#

    +
      + +
    • #general-comments.none# + + + @comments@ + +
    +

    +

    #general-comments.Full_Comments#

    +
    + +
  • #general-comments.none# + + + @full_comments@ + +
  • +

    + @link@ + + +

    #general-comments.If# general-comments #general-comments.lt_is_not_mounted_and___# general_comments_get_comments + #general-comments.or# general_comments_create_link#general-comments.lt__then_an_error___will# general-comments + #general-comments.package_instance# + + Index: openacs-4/contrib/packages/general-comments/www/test.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/test.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/test.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,52 @@ +# /packages/general-comments/www/test.tcl + +ad_page_contract { + Test page for general-comments + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: test.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { +} -properties { + page_title:onevalue + context:onevalue + package_id:onevalue + gc_package_id:onevalue + package_url:onevalue + gc_package_url:onevalue + auto_approve_comments_p:onevalue + allow_file_attachments_p:onevalue + allow_link_attachments_p:onevalue + max_file_size:onevalue + comments:onevalue + full_comments:onevalue + link:onevalue +} + +set page_title "[_ general-comments.lt_Test_page_for_General]" +set context "\"[_ general-comments.test]\"" + +if { ![db_0or1row get_gc_package_id { + select package_id + from apm_packages + where package_key = 'general-comments' +}] } { + set package_id "" +} +set package_url [general_comments_package_url] + +set auto_approve_comments_p [ad_parameter -package_id $package_id \ + AutoApproveCommentsP {general-comments} {}] +set allow_file_attachments_p [ad_parameter -package_id $package_id \ + AllowFileAttachmentsP {general-comments} {}] +set allow_link_attachments_p [ad_parameter -package_id $package_id \ + AllowLinkAttachmentsP {general-comments} {}] +set max_file_size [ad_parameter -package_id $package_id \ + MaxFileSize {general-comments} {}] + +set comments [general_comments_get_comments $package_id "${package_url}test"] +set full_comments [general_comments_get_comments -print_content_p 1 -print_attachments_p 1 $package_id "${package_url}test"] +set link [general_comments_create_link $package_id "${package_url}test" ] + +ad_return_template Index: openacs-4/contrib/packages/general-comments/www/url-add-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/url-add-2-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/url-add-2-oracle.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,25 @@ + + + + oracle8.1.6 + + + + + begin + :1 := content_extlink.new ( + name => :name, + url => :url, + label => :label, + parent_id => :parent_id, + extlink_id => :attach_id, + creation_user => :user_id, + creation_ip => :creation_ip + ); + end; + + + + + + Index: openacs-4/contrib/packages/general-comments/www/url-add-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/url-add-2-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/url-add-2-postgresql.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,31 @@ + + + + postgresql7.1 + + + + declare + v_extlink_id cr_extlinks.extlink_id%TYPE; + + begin + select content_extlink__new ( + /* name => */ :name, + /* url => */ :url, + /* label => */ :label, + /* description */ NULL, + /* parent_id => */ :parent_id, + /* extlink_id => */ :attach_id, + /* creation_date */ now(), + /* creation_user => */ :user_id, + /* creation_ip => */ :creation_ip + ) into v_extlink_id; + + return v_extlink_id; + end; + + + + + + Index: openacs-4/contrib/packages/general-comments/www/url-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/url-add-2.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/url-add-2.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,54 @@ +# /packages/general-comments/www/url-add-2.tcl + +ad_page_contract { + Inserts a url for object_id into the database + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: url-add-2.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + attach_id:integer,notnull + parent_id:integer,notnull + label:notnull + url:notnull + { return_url {} } +} -validate { + allow_link_attachments { + set allow_links_p [ad_parameter AllowLinkAttachmentsP {general-comments} {t}] + if { $allow_links_p != "t" } { + ad_complain "[_ general-comments.lt_Attaching_links_to_co]" + } + } +} + +# authenticate the user +set user_id [ad_verify_and_get_user_id] + +# check to see if the user can add an attachment +ad_require_permission $parent_id write + +# insert the url into database +set creation_ip [ad_conn peeraddr] +set name "extlink_$attach_id" +db_exec_plsql insert_comment { + begin + :1 := content_extlink.new ( + name => :name, + url => :url, + label => :label, + parent_id => :parent_id, + extlink_id => :attach_id, + creation_user => :user_id, + creation_ip => :creation_ip + ); + end; +} + +ad_returnredirect "view-comment?comment_id=$parent_id&[export_url_vars return_url]" + + + + + + Index: openacs-4/contrib/packages/general-comments/www/url-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/url-add.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/url-add.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,47 @@ +# /packages/general-comments/www/url-add.tcl + +ad_page_contract { + Attaches a url to a comment + + @param parent_id The id of the comment to attach to + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: url-add.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + parent_id:notnull,integer + { return_url {} } +} -properties { + page_title:onevalue + context:onevalue + parent_id:onevalue + target:onevalue + label:onevalue + url:onevalue + parent_id:onevalue + return_url:onevalue +} -validate { + allow_link_attachments { + set allow_links_p [ad_parameter AllowLinkAttachmentsP {general-comments} {t}] + if { $allow_links_p != "t" } { + ad_complain "[_ general-comments.lt_Attaching_links_to_co]" + } + } +} + +# check to see if the user can add an attachment +ad_require_permission $parent_id write + +# set variables for template +set attach_id [db_nextval acs_object_id_seq] +set page_title "[_ general-comments.lt_Add_url_attachment_to] #$parent_id" +set context [list [list "view-comment?comment_id=$parent_id" "[_ general-comments.Go_back_to_comment]"] "[_ general-comments.Add_url_comment]"] +set target "url-add-2" +set label "" +set url "" + +ad_return_template "url-ae" + + + Index: openacs-4/contrib/packages/general-comments/www/url-ae.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/url-ae.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/url-ae.adp 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,28 @@ + +@page_title@ +@context@ +@parent_id@ + +

    +<%= [export_form_vars attach_id parent_id return_url] %> +
    + + + + + + + + + +
    #general-comments.Label#
    #general-comments.URL# +
    + #general-comments.lt_Example_httpwwwarsdig# +
    +

    +

    + +
    +
    +
    + Index: openacs-4/contrib/packages/general-comments/www/url-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/url-edit-2.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/url-edit-2.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,34 @@ +# /packages/general-comments/www/url-edit-2.tcl + +ad_page_contract { + Creates a new revision of the url comment. + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: url-edit-2.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + attach_id:integer,notnull + parent_id:integer,notnull + label:notnull + url:notnull + { return_url {} } +} + +# authenticate the user +set user_id [ad_verify_and_get_user_id] + +# check to see if the user can edit this attachment +ad_require_permission $attach_id write + +db_dml edit_url { + update cr_extlinks + set label = :label, + url = :url + where extlink_id = :attach_id +} + +ad_returnredirect "view-comment?comment_id=$parent_id&[export_url_vars return_url]" + + + Index: openacs-4/contrib/packages/general-comments/www/url-edit-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/url-edit-2.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/url-edit-2.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,16 @@ + + + + + + + update cr_extlinks + set label = :label, + url = :url + where extlink_id = :attach_id + + + + + + Index: openacs-4/contrib/packages/general-comments/www/url-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/url-edit.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/url-edit.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,40 @@ +# /packages/general-comments/www/url-edit.tcl + +ad_page_contract { + Edits a url comment + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: url-edit.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + attach_id:integer,notnull + parent_id:integer,notnull + { return_url {} } +} -properties { + page_title:onevalue + context:onevalue + parent_id:onevalue + target:onevalue + label:onevalue + url:onevalue +} + +# check to see if the user can edit this attachment +ad_require_permission $attach_id write + +# get the values from the database +if { ![db_0or1row get_comment { + select label, + url + from cr_extlinks + where extlink_id = :attach_id +}] } { + ad_return_complaint 1 "The attach_id does not refer to a valid url attachment." +} + +set page_title "[_ general-comments.lt_Edit_url_attachment_o] #$parent_id" +set context [list [list "view-comment?comment_id=$parent_id" "[_ general-comments.Go_back_to_comment]"] "[_ general-comments.Edit_url_attachment]"] +set target "url-edit-2" + +ad_return_template "url-ae" Index: openacs-4/contrib/packages/general-comments/www/url-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/url-edit.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/url-edit.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,16 @@ + + + + + + + select label, + url + from cr_extlinks + where extlink_id = :attach_id + + + + + + Index: openacs-4/contrib/packages/general-comments/www/view-comment-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/view-comment-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/view-comment-oracle.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,79 @@ + + + + oracle8.1.6 + + + + + select content_item.get_latest_revision(:comment_id) from dual + + + + + + + + + select g.object_id, + g.comment_id, + content_item.get_live_revision(g.comment_id) as live_revision, + r.revision_id, + r.title, + r.content, + r.mime_type, + o.creation_user, + o.creation_date, + acs_object.name(o.creation_user) as author + from general_comments g, + cr_revisions r, + acs_objects o + where g.comment_id = o.object_id and + g.comment_id = r.item_id and + r.revision_id = :revision_id + + + + + + + + + select g.object_id, + g.comment_id, + r.revision_id as live_revision, + r.revision_id, + r.title, + r.content, + r.mime_type, + o.creation_user, + o.creation_date, + acs_object.name(o.creation_user) as author + from general_comments g, + acs_objects o, + cr_revisions r + where g.comment_id = :comment_id and + g.comment_id = o.object_id and + g.comment_id = r.item_id and + r.revision_id = content_item.get_live_revision(:comment_id) + + + + + + + + + select r.revision_id, + to_char(o.creation_date, 'MM-DD-YY HH24:MI:SS') as revision_date + from cr_revisions r, + acs_objects o + where r.item_id = :comment_id and + o.object_id = r.revision_id + order by o.creation_date desc + + + + + + Index: openacs-4/contrib/packages/general-comments/www/view-comment-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/view-comment-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/view-comment-postgresql.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,79 @@ + + + + postgresql7.1 + + + + + select content_item__get_latest_revision(:comment_id) + + + + + + + + + select g.object_id, + g.comment_id, + content_item__get_live_revision(g.comment_id) as live_revision, + r.revision_id, + r.title, + r.content, + r.mime_type, + o.creation_user, + o.creation_date, + acs_object__name(o.creation_user) as author + from general_comments g, + cr_revisions r, + acs_objects o + where g.comment_id = o.object_id and + g.comment_id = r.item_id and + r.revision_id = :revision_id + + + + + + + + + select g.object_id, + g.comment_id, + r.revision_id as live_revision, + r.revision_id, + r.title, + r.content, + r.mime_type, + o.creation_user, + o.creation_date, + acs_object__name(o.creation_user) as author + from general_comments g, + acs_objects o, + cr_revisions r + where g.comment_id = :comment_id and + g.comment_id = o.object_id and + g.comment_id = r.item_id and + r.revision_id = content_item__get_live_revision(:comment_id) + + + + + + + + + select r.revision_id, + to_char(o.creation_date, 'MM-DD-YY HH24:MI:SS') as revision_date + from cr_revisions r, + acs_objects o + where r.item_id = :comment_id and + o.object_id = r.revision_id + order by o.creation_date desc + + + + + + Index: openacs-4/contrib/packages/general-comments/www/view-comment.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/view-comment.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/view-comment.adp 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,108 @@ + +@page_title@ +@context@ +@return_url@ +@object_name@ + + +[#general-comments.lt_Go_back_to_where_you_#]
    +
    + +
    +

    @title@

    + +@html_content@ + +

    + + -- #general-comments.you# + + #general-comments.edit_your_comment#

    +
    + + -- @author@ + + +
    + + + +

    #general-comments.Attachments#

    + + + +

    #general-comments.Actions#

    + +
    + + +

    #general-comments.Revisions#

    + +
    + + + + #general-comments.lt_This_revision_is_not_# + + (#general-comments.lt_approve_this_revision#) + + + + + + #general-comments.lt_This_revision_is_live# + + (#general-comments.reject_this_revision#) + + + + Index: openacs-4/contrib/packages/general-comments/www/view-comment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/view-comment.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/view-comment.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,146 @@ +# /packages/general-comments/www/view-comment.tcl + +ad_page_contract { + Views a comment + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: view-comment.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + comment_id:notnull + { revision_id {} } + { object_name {} } + { return_url {} } +} -properties { + page_title:onevalue + context:onevalue + return_url:onevalue + object_name:onevalue + title:onevalue + mime_type:onevalue + content:onevalue + user_id:onevalue + creation_user:onevalue + comment_id:onevalue + revision_id:onevalue + attachments:multirow + write_perm_p:onevalue + revisions:multirow + admin_p:onevalue + return_url_view:onevalue +} + +# authenticate the user +set user_id [ad_conn user_id] + +# check for permissions +set package_id [ad_conn package_id] +ad_require_permission $comment_id read +set write_perm_p [ad_permission_p $comment_id write] +set admin_p [ad_permission_p $package_id admin] + +# if the user has write permissions then allow +# viewing of selected revision +if { $write_perm_p == 1 } { + if { [empty_string_p $revision_id] } { + # get the latest revision + set revision_id [db_string get_latest_revision { + select content_item.get_latest_revision(:comment_id) from dual + }] + } + # get revision data from the database + if { ![db_0or1row get_revision_comment { + select g.object_id, + g.comment_id, + content_item.get_live_revision(g.comment_id) as live_revision, + r.revision_id, + r.title, + r.content, + r.mime_type, + o.creation_user, + o.creation_date, + acs_object.name(o.creation_user) as author + from general_comments g, + cr_revisions r, + acs_objects o + where g.comment_id = o.object_id and + g.comment_id = r.item_id and + r.revision_id = :revision_id + }] } { + ad_return_complaint 1 "[_ general-comments.lt_The_comment_id_does_n]" + } + +} else { + # get live revision data from the database + if { ![db_0or1row get_comment { + select g.object_id, + g.comment_id, + r.revision_id as live_revision, + r.revision_id, + r.title, + r.content, + r.mime_type, + o.creation_user, + o.creation_date, + acs_object.name(o.creation_user) as author + from general_comments g, + acs_objects o, + cr_revisions r + where g.comment_id = :comment_id and + g.comment_id = o.object_id and + g.comment_id = r.item_id and + r.revision_id = content_item.get_live_revision(:comment_id) + }] } { + ad_return_complaint 1 "[_ general-comments.lt_The_comment_id_does_n]" + } +} + +db_multirow attachments get_attachments { + select r.title, + r.mime_type, + i.name, + i.item_id + from cr_items i, + cr_revisions r + where i.parent_id = :comment_id and + r.revision_id = i.live_revision +} + +db_multirow links get_links { + select i.item_id, + e.label, + e.url + from cr_items i, cr_extlinks e + where i.parent_id = :comment_id and + e.extlink_id = i.item_id +} + +db_multirow revisions get_revisions { + select r.revision_id, + to_char(o.creation_date, 'MM-DD-YY HH24:MI:SS') as revision_date + from cr_revisions r, + acs_objects o + where r.item_id = :comment_id and + o.object_id = r.revision_id + order by o.creation_date desc +} + +set allow_file_p [ad_parameter AllowFileAttachmentsP {general-comments} {t}] +set allow_link_p [ad_parameter AllowLinkAttachmentsP {general-comments} {t}] +set allow_attach_p "t" +if { $allow_file_p == "f" && $allow_link_p == "f" } { + set allow_attach_p "f" +} +set comment_on_id [db_string get_object_id "select object_id from general_comments where comment_id = :comment_id"] +set page_title "[_ general-comments.View_comment_on]: [acs_object_name $comment_on_id]" +set context "\"[_ general-comments.View_comment]\"" +set return_url_view "[ad_urlencode view-comment?[export_ns_set_vars url]]" +set is_creator_p "f" +if { $user_id == $creation_user } { + set is_creator_p "t" +} + +set html_content [ad_html_text_convert -from $mime_type -- $content] + +ad_return_template Index: openacs-4/contrib/packages/general-comments/www/view-comment.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/view-comment.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/view-comment.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,41 @@ + + + + + + + select r.title, + r.mime_type, + i.name, + i.item_id + from cr_items i, + cr_revisions r + where i.parent_id = :comment_id and + r.revision_id = i.live_revision + + + + + + + + + select i.item_id, + e.label, + e.url + from cr_items i, cr_extlinks e + where i.parent_id = :comment_id and + e.extlink_id = i.item_id + + + + + + + + select object_id from general_comments where comment_id = :comment_id + + + + + Index: openacs-4/contrib/packages/general-comments/www/view-image.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/view-image.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/view-image.adp 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,11 @@ + +@page_title@ +@context@ +@return_url@ + +
    +@title@ +

    + +

    + Index: openacs-4/contrib/packages/general-comments/www/view-image.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/view-image.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/view-image.tcl 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,43 @@ +# /packages/general-comments/www/view-image.tcl + +ad_page_contract { + Views an attached image + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: view-image.tcl,v 1.1 2003/05/02 15:50:44 daveb Exp $ +} { + image_id:notnull + { return_url {} } +} -properties { + page_title:onevalue + context:onevalue + return_url:onevalue + image_id:onevalue + width:onevalue + height:onevalue +} + +# check that user can view the image +ad_require_permission $image_id read + +# get the image attributes +db_1row get_image { + select i.name, + r.title, + m.width, + m.height + from cr_items i, + cr_revisions r, + images m + where i.item_id = :image_id and + r.revision_id = i.live_revision and + r.revision_id = m.image_id +} + +set page_title "[_ general-comments.Image_attachment]" +set context [list [list "$return_url" "[_ general-comments.Go_back_to_comment]"] "[_ general-comments.Image_attachment]"] + +ad_return_template + Index: openacs-4/contrib/packages/general-comments/www/view-image.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/view-image.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/view-image.xql 2 May 2003 15:50:44 -0000 1.1 @@ -0,0 +1,22 @@ + + + + + + + select i.name, + r.title, + m.width, + m.height + from cr_items i, + cr_revisions r, + images m + where i.item_id = :image_id and + r.revision_id = i.live_revision and + r.revision_id = m.image_id + + + + + + Index: openacs-4/contrib/packages/general-comments/www/admin/delete-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/delete-2-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/delete-2-oracle.xql 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,17 @@ + + + + oracle8.1.6 + + + + + begin + acs_message.delete(:comment_id); + end; + + + + + + Index: openacs-4/contrib/packages/general-comments/www/admin/delete-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/delete-2-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/delete-2-postgresql.xql 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,18 @@ + + + + postgresql7.1 + + + + + begin + PERFORM acs_message__delete(:comment_id); + return 1; + end; + + + + + + Index: openacs-4/contrib/packages/general-comments/www/admin/delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/delete-2.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/delete-2.tcl 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,38 @@ +# /packages/general-comments/www/admin/delete-2.tcl + +ad_page_contract { + Deletes a comment and its attachments + + @param comment_id The id of the comment to delete + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: delete-2.tcl,v 1.1 2003/05/02 15:50:59 daveb Exp $ +} { + comment_id:integer,notnull + { return_url {} } +} + +# There is a bug in content_item.delete that results in +# referential integrity violations when deleting a content +# item that has an image attachment. This is a temporary fix +# until ACS 4.1 is released. +db_dml delete_image_attachments { + delete from images + where image_id in (select latest_revision + from cr_items + where parent_id = :comment_id) +} + +# Only need to call on acs_message.delete since +# deletion of row from general_comments table +# relies on "on delete cascade" +db_exec_plsql delete_comment { + begin + acs_message.delete(:comment_id); + end; +} + +ad_returnredirect $return_url + Index: openacs-4/contrib/packages/general-comments/www/admin/delete-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/delete-2.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/delete-2.xql 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,16 @@ + + + + + + + delete from images + where image_id in (select latest_revision + from cr_items + where parent_id = :comment_id) + + + + + + Index: openacs-4/contrib/packages/general-comments/www/admin/delete-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/delete-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/delete-oracle.xql 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,28 @@ + + + + oracle8.1.6 + + + + + select r.title, + r.content, + r.mime_type, + o.creation_user, + to_char(o.creation_date, 'MM-DD-YYYY') as pretty_date, + acs_object.name(o.creation_user) as author + from acs_objects o, + cr_revisions r, + general_comments g + where g.comment_id = :comment_id and + g.comment_id = o.object_id and + r.revision_id = content_item.get_latest_revision(g.comment_id) + + + + + + + + Index: openacs-4/contrib/packages/general-comments/www/admin/delete-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/delete-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/delete-postgresql.xql 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,26 @@ + + + + postgresql7.1 + + + + + + select r.title, + r.content, + r.mime_type, + o.creation_user, + to_char(o.creation_date, 'MM-DD-YYYY') as pretty_date, + acs_object__name(o.creation_user) as author + from acs_objects o, + cr_revisions r, + general_comments g + where g.comment_id = :comment_id and + g.comment_id = o.object_id and + r.revision_id = content_item__get_latest_revision(g.comment_id) + + + + + Index: openacs-4/contrib/packages/general-comments/www/admin/delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/delete.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/delete.adp 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,38 @@ + +@page_title@ +@context@ + + +#general-comments.lt_Do_you_really_wish_to# +
    + @title@ (#general-comments.details#)

    + + <%= [util_convert_plaintext_to_html $content] %> + + + @content@ + +

    -- @author@ + (@pretty_date@) +
    +
    + + + + + +
    +
    + <%= [export_form_vars comment_id return_url] %> + +
    +
    +
    + +
    +
    +
    + + + Index: openacs-4/contrib/packages/general-comments/www/admin/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/delete.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/delete.tcl 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,50 @@ +# /packages/general-comments/www/admin/delete.tcl + +ad_page_contract { + Delete a comment + + @param comment_id The id of the comment to delete + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: delete.tcl,v 1.1 2003/05/02 15:50:59 daveb Exp $ +} { + comment_id:integer,notnull + { return_url {}} +} -properties { + page_title:onevalue + context:onevalue + title:onevalue + comment_id:onevalue + mime_type:onevalue + content:onevalue + creation_user:onevalue + author:onevalue + pretty_date:onevalue + return_url:onevalue +} + +# get data from database +set sql " + select r.title, + r.content, + r.mime_type, + o.creation_user, + to_char(o.creation_date, 'MM-DD-YYYY') as pretty_date, + acs_object.name(o.creation_user) as author + from acs_objects o, + cr_revisions r, + general_comments g + where g.comment_id = :comment_id and + g.comment_id = o.object_id and + r.revision_id = content_item.get_latest_revision(g.comment_id)" + +if { ![db_0or1row get_comment $sql] } { + ad_return_complaint 1 "[_ general-comments.lt_The_comment_id_does_n]" +} + +set page_title "[_ general-comments.Delete_a_comment]" +set context [list "[_ general-comments.Delete_a_comment]"] + +ad_return_template Index: openacs-4/contrib/packages/general-comments/www/admin/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/index-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/index-oracle.xql 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,55 @@ + + + + oracle8.1.6 + + + + + select g.comment_id, + r.title, + acs_object.name(o.creation_user) as author, + o.creation_user, + case when i.live_revision = null then 0 else 1 end as live_version_p, + case when i.live_revision = r.revision_id then 1 else 0 end as approved_p, + to_char(o.creation_date, 'MM-DD-YYYY HH12:MI:AM') as pretty_date + from general_comments g, + cr_items i, + cr_revisions r, + acs_objects o + where g.comment_id = i.item_id and + r.revision_id = o.object_id and + r.revision_id = content_item.get_latest_revision(g.comment_id) + [ad_dimensional_sql $dimensional] + [ad_order_by_from_sort_spec $orderby $table_def] + + + + + + + creation_date + 1 > sysdate + + + + + + + + creation_date + 7 > sysdate + + + + + + + + creation_date + 30 > sysdate + + + + + + + + Index: openacs-4/contrib/packages/general-comments/www/admin/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/index-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/index-postgresql.xql 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,54 @@ + + + + postgresql7.1 + + + + select * from ( + select g.comment_id, + r.title, + acs_object__name(o.creation_user) as author, + o.creation_user, + case when i.live_revision = null then 0 else 1 end as live_version_p, + case when i.live_revision = r.revision_id then 1 else 0 end as approved_p, + to_char(o.creation_date, 'MM-DD-YYYY HH12:MI:AM') as pretty_date, + o.creation_date + from general_comments g, + cr_items i, + cr_revisions r, + acs_objects o + where g.comment_id = i.item_id and + r.revision_id = o.object_id and + r.revision_id = i.latest_revision + [ad_dimensional_sql $dimensional]) as unordered + [ad_order_by_from_sort_spec $orderby $table_def] + + + + + + + + + creation_date > now() - '1 days'::interval + + + + + + + + creation_date > now() - '7 days'::interval + + + + + + + + creation_date > now() - '30 days'::interval + + + + Index: openacs-4/contrib/packages/general-comments/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/index.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/index.adp 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,12 @@ + +@page_title@ +@context@ + +

    +@dimensional_bar@ +

    +@comments_table@ + + + + Index: openacs-4/contrib/packages/general-comments/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/index.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/index.tcl 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,91 @@ +# /packages/general-comments/www/admin/index.tcl + +ad_page_contract { + General comments administration main page + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: index.tcl,v 1.1 2003/05/02 15:50:59 daveb Exp $ +} { + {orderby {} } +} -properties { + page_title:onevalue + context:onevalue + dimensional_bar:onevalue + comments_table:onevalue +} + +# return_url to be passed to various helper pages so that we return to +# this page with the proper parameters +set return_url [ad_urlencode index?[export_ns_set_vars url]] + +# dimensional slider definition +set dimensional [list \ + [list approval "[_ general-comments.Status]" unapproved [list \ + [list approved "[_ general-comments.approved]" {where "[db_map status_approved]"} ] \ + [list unapproved "[_ general-comments.unapproved]" {where "[db_map status_unapproved]"} ] \ + [list any "[_ general-comments.all]" {} ] \ + ]] \ + [list modified "[_ general-comments.Last_Modified]" any [list \ + [list 1d "[_ general-comments.last_24_hours]" {where "[db_map modified_last_24hours]"}] \ + [list 1w "[_ general-comments.last_week]" {where "[db_map modified_last_week]"}] \ + [list 1m "[_ general-comments.last_month]" {where "[db_map modified_last_month]"}] \ + [list any "[_ general-comments.all]" {} ] \ + ]] +] +set dimensional_bar [ad_dimensional $dimensional] + +# ad_table definition +set table_def [list \ + [list num "[_ general-comments.Num]" {} {$Tcount}] \ + [list comment_id "[_ general-comments.ID]" {} \ + {$comment_id}] \ + [list title "[_ general-comments.Title_1]" {} {}] \ + [list author "[_ general-comments.Author]" {upper(author) $order} \ + {$author}] \ + [list approved_p "[_ general-comments.Approved]" {} 01] \ + [list live_version_p "[_ general-comments.Has_live_version]" {} 01] \ + [list pretty_date "[_ general-comments.Last_Modified]" {creation_date $order} {}] \ + [list actions "[_ general-comments.Actions]" {} \ + { + [if {$approved_p} { + subst {[_ general-comments.reject]} + } else { + subst {[_ general-comments.approve]} + }] | [_ general-comments.delete]}]\ +] + +# sql to retrieve comments +set sql " + select g.comment_id, + r.title, + acs_object.name(o.creation_user) as author, + o.creation_user, + decode(i.live_revision,null,0,1) as live_version_p, + decode(i.live_revision,r.revision_id,1,0) as approved_p, + to_char(o.creation_date, 'MM-DD-YYYY HH12:MI:AM') as pretty_date + from general_comments g, + cr_items i, + cr_revisions r, + acs_objects o + where g.comment_id = i.item_id and + r.revision_id = o.object_id and + r.revision_id = content_item.get_latest_revision(g.comment_id) + [ad_dimensional_sql $dimensional] + [ad_order_by_from_sort_spec $orderby $table_def] +" + +# create the table to display the comments +set extra_var_list [list return_url $return_url] + +set comments_table [ad_table -Torderby $orderby \ + -Tmissing_text "[_ general-comments.lt_No_comments_available]" \ + -Textra_vars $extra_var_list \ + comments_select $sql $table_def] + +set page_title "[_ general-comments.lt_General_Comments_Admi]" +set context {} + +ad_return_template + Index: openacs-4/contrib/packages/general-comments/www/admin/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/index.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/index.xql 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,29 @@ + + + + + + + i.live_revision is not null + + + + + + + + i.live_revision is null + + + + + + + + 1 = 1 + + + + + + Index: openacs-4/contrib/packages/general-comments/www/admin/toggle-approval-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/toggle-approval-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/toggle-approval-oracle.xql 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,42 @@ + + + + oracle8.1.6 + + + + select content_item.get_live_revision(:comment_id) from dual + + + + + + + select content_item.get_latest_revision(:comment_id) from dual + + + + + + + + begin + content_item.set_live_revision(:revision_id); + end; + + + + + + + + + begin + content_item.unset_live_revision(:comment_id); + end; + + + + + + Index: openacs-4/contrib/packages/general-comments/www/admin/toggle-approval-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/toggle-approval-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/toggle-approval-postgresql.xql 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,44 @@ + + + + postgresql7.1 + + + + select content_item__get_live_revision(:comment_id) + + + + + + + select content_item__get_latest_revision(:comment_id) + + + + + + + + begin + PERFORM content_item__set_live_revision(:revision_id); + return 0; + end; + + + + + + + + + begin + PERFORM content_item__unset_live_revision(:comment_id); + return 0; + end; + + + + + + Index: openacs-4/contrib/packages/general-comments/www/admin/toggle-approval.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/admin/Attic/toggle-approval.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/admin/toggle-approval.tcl 2 May 2003 15:50:59 -0000 1.1 @@ -0,0 +1,49 @@ +# /packages/general-comments/www/admin/toggle-approval.tcl + +ad_page_contract { + Toggles the approval state of a comment + + @param comment_id The id of the comment + + @author Phong Nguyen (phong@arsdigita.com) + @author Pascal Scheffers (pascal@scheffers.net) + @creation-date 2000-10-12 + @cvs-id $Id: toggle-approval.tcl,v 1.1 2003/05/02 15:50:59 daveb Exp $ +} { + comment_id:integer,notnull + {revision_id {}} + {return_url {}} +} + +# get the live revision of the item for comparison +set live_revision [db_string get_live_revision \ + "select content_item.get_live_revision(:comment_id) from dual"] + +# if the user did not pass in a revision_id, then +# assume that the user wishes to toggle the approval +# state of the latest revision +if { [empty_string_p $revision_id] } { + set revision_id [db_string get_latest_revision \ + "select content_item.get_latest_revision(:comment_id) from dual"] +} + +# if the current live revision is not the same as the passed in +# revision then set the passed in revision as live +if { $live_revision != $revision_id } { + db_exec_plsql set_live_revisions { + begin + content_item.set_live_revision(:revision_id); + end; + } + +# if the current live revision is the same as the passed in +# revision, then unset it +} else { + db_exec_plsql unset_live_revisions { + begin + content_item.unset_live_revision(:comment_id); + end; + } +} + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/general-comments/www/doc/design.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/doc/Attic/design.gif,v diff -u -N Binary files differ Index: openacs-4/contrib/packages/general-comments/www/doc/design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/doc/Attic/design.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/doc/design.html 2 May 2003 15:51:13 -0000 1.1 @@ -0,0 +1,771 @@ + +Design Document

    General Comments
    PrevChapter 1. Developer's guideNext

    1.2. Design Document

    1.2.1. Essentials

    1.2.2. Introduction

    General Comments enables all users in the community to add a + comment to any object in the system. Any comment can have files or + hyperlinks attached.

    This package is intended to utilize the users' engagement in the + community by letting them voice their opinion on any topic (object) + on the site. Commenting an article, a press release or any other + object is never more than a click away.

    Administrators can choose to put comments on hold until they've + been approved or moderated.

    User feedback is an invaluable resource for improvements. For + example, the usage of General Comments on documentation not only + allows feedback, it can shape, extend and refine draft ideas before + they are taken to the next level.

    1.2.3. Historical Considerations

    General Comments in ACS 4.0 differs from previous versions by + utilizing the ACS Object system, introduced in 4.0. The data-model + has been changed to accomodate this adoption.

    In ACS 3.x, general comments did not have revisioning. Let's + assume that in an ACS 3.x installation, the policy for comments was + set to "closed", meaning comments must be approved by an + administrator before it goes live. The following unwanted scenario + could occur:

    • A user posted a comment which was approved by the + administrator.

    • The user notices that there was a spelling error, and makes a + change to the posted comment.

    • From the time of the user's correction to the time the + adminstrator re-approves the comment, other users will not be able + to read the comment, since the new data replaced the old one.

    General Comments implements the revisioning feature provided by + the Content Repository. Users are able to view all of their + revisions for a comment, along with an indication of which revision + is live. This allows the contents of an older revision to be seen + by the public while a newer revision is awaiting adminstrative + approval.

    1.2.6. API

    TCL API

    There is one core procedure, + general_comments_get_comments, + that will show comments on an object and make appropriate links to + files from the general-comments package for recording + and editing user comments. An optional return_url can + be specified which will be provided as a link to the user within + the general-comments pages. This is useful for the + user to return to the original page after making a comment.

    The other procedure, + general_comments_create_link, + is a wrapper procedure that returns an html fragment for a link + which points to the location of the mounted + general_comments package. There are various switches + that will be useful to package developers:

    • object_name: A name for the object being commented on is + displayed throughout the general-comments pages. + Defaults to [acs_object_name].

    • link_text: The text of the link returned. Defaults to + "Add a comment".

    • context_id: The context_id to set for the comment. + Defaults to the object_id of the object being commented on.

    • category: This feature is not complete. The purpose is + to allow separation of comments on the same object into + categories.

    A problem that may occur is when any of the two tcl procedures + are called when the general-comments package is not + mounted. Both general_comments_get_comments and + general_comments_create_link needs to find out the + location of the mounted general-comments instance to + generate correct links. In this case, both procedures will return + nothing and log a notice.

    Note: In the alpha release of + general-comments, the tcl procedures were defined + within a namespace and encountered problems with the api browser + not being able to display them properly. These procedures have now + been moved out of the namespace and the old ones are marked as + deprecated. The final version will completely remove all traces of + the namespace procedures.

    PL/SQL API

    None. Uses PL/SQL functions provided by ACS Messaging.

    1.2.7. Data Model Discussion

    The majority of the functionality of general comments has been + merged with acs-messaging. Comments are stored as acs-messages.

    The general_comments table extends + acs_messages to provide categorization of comments on + a particular object. general_comments also stores the + object_id of the object the comment refers to. Relationships from + attachments to acs-message is done by using the + cr_items.parent_id column.

    A general-comment can be associated with any object + in the system by using the general_comments.object_id + column. Because each comment is itself an object, we could + implement comments on comments. However, this functionality is not + needed in the general-comments model and the UI does + not support comments on comments.

    There are three types of attachments a user can create: file, + image, and url. The underlying data representation of an attachment + is a content item with different content_types. File attachments + are stored with a content_revision type. Image attachments are + stored with a image type. Url attachments are stored with a + content_extlink type.

    One problem we face is how to allow designers to modify the + presentation of the comments on an object without modifying tcl + code. The proc general_comments_get_comments has html + code which should really be placed into a template. Karl Goldstein + code reviewed general comments and has an interesting solution:

    • Add an -uplevel parameter to + db_multirow.

    • In the general_comments_get_comments proc, create + an upleveled datasource.

    • From the .tcl page, make a call to + general_comments_get_comments, which would set up the + multirow datasource in the current environment.

    • From the .adp page, loop through the multirow + datasource.

    1.2.8. User Interface

    General Comments provides two similar sets of UIs for + adminstrators and normal users. The adminstrator UI allows + approval/unapproval of comments as well as deletion of comments. + The normal user UI presents to users all of their created comments, + with links to editing and creating attachments.

    1.2.9. Configuration/Parameters

    • AutoApproveCommentsP: Sets whether comments go + live immediately.

    • AllowFileAttachmentsP: Sets whether files can be + attached to comments.

    • AllowLinkAttachmentsP: Sets whether links can be + attached to comments.

    • MaxFileSize: Maximum file size that can be + uploaded in bytes.

    1.2.10. Future Improvements/Areas of Likely Change

    • Subsite administration

    • Cascading parameters to depending packages.

    • Revisioning of attachments

    1.2.12. Revision History

    Document Revision # Action Taken, NotesWhen?By Whom?
    0.2Revision12/11/2000Phong Nguyen
    0.1Creation10/26/2000Phong Nguyen

    Last modified: $Id: design.html,v 1.1 2003/05/02 15:51:13 daveb Exp $ +


    PrevHomeNext
    Developer's guideUpUser's guide
    \ No newline at end of file Index: openacs-4/contrib/packages/general-comments/www/doc/design.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/doc/Attic/design.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/doc/design.xml 2 May 2003 15:51:13 -0000 1.1 @@ -0,0 +1,300 @@ + + Design Document + + + Essentials + + + User directory: /general-comments/ + + ACS administrator directory: /general-comments/admin/ + + TCL API: + + + + general-comments-procs.tcl + + + + PL/SQL API: + + + none + + + + Data model: + + + + general-comments-create.sql + + + general-comments-drop.sql + + + + + + + + + Introduction + + General Comments enables all users in the community to add a + comment to any object in the system. Any comment can have files or + hyperlinks attached. + + This package is intended to utilize the users' engagement in the + community by letting them voice their opinion on any topic (object) + on the site. Commenting an article, a press release or any other + object is never more than a click away. + + Administrators can choose to put comments on hold until they've + been approved or moderated. + + User feedback is an invaluable resource for improvements. For + example, the usage of General Comments on documentation not only + allows feedback, it can shape, extend and refine draft ideas before + they are taken to the next level. + + + + Historical Considerations + + General Comments in ACS 4.0 differs from previous versions by + utilizing the ACS Object system, introduced in 4.0. The data-model + has been changed to accomodate this adoption. + + In ACS 3.x, general comments did not have revisioning. Let's + assume that in an ACS 3.x installation, the policy for comments was + set to "closed", meaning comments must be approved by an + administrator before it goes live. The following unwanted scenario + could occur: + + + A user posted a comment which was approved by the + administrator. + + The user notices that there was a spelling error, and makes a + change to the posted comment. + + From the time of the user's correction to the time the + adminstrator re-approves the comment, other users will not be able + to read the comment, since the new data replaced the old one. + + + General Comments implements the revisioning feature provided by + the Content Repository. Users are able to view all of their + revisions for a comment, along with an indication of which revision + is live. This allows the contents of an older revision to be seen + by the public while a newer revision is awaiting adminstrative + approval. + + + + Competitive Analysis + + not available + + + + Design Tradeoffs + + not available + + + + API + + TCL API + + There is one core procedure, + general_comments_get_comments, + that will show comments on an object and make appropriate links to + files from the general-comments package for recording + and editing user comments. An optional return_url can + be specified which will be provided as a link to the user within + the general-comments pages. This is useful for the + user to return to the original page after making a comment. + + The other procedure, + general_comments_create_link, + is a wrapper procedure that returns an html fragment for a link + which points to the location of the mounted + general_comments package. There are various switches + that will be useful to package developers: + + + object_name: A name for the object being commented on is + displayed throughout the general-comments pages. + Defaults to [acs_object_name]. + + link_text: The text of the link returned. Defaults to + "Add a comment". + + context_id: The context_id to set for the comment. + Defaults to the object_id of the object being commented on. + + category: This feature is not complete. The purpose is + to allow separation of comments on the same object into + categories. + + + A problem that may occur is when any of the two tcl procedures + are called when the general-comments package is not + mounted. Both general_comments_get_comments and + general_comments_create_link needs to find out the + location of the mounted general-comments instance to + generate correct links. In this case, both procedures will return + nothing and log a notice. + + Note: In the alpha release of + general-comments, the tcl procedures were defined + within a namespace and encountered problems with the api browser + not being able to display them properly. These procedures have now + been moved out of the namespace and the old ones are marked as + deprecated. The final version will completely remove all traces of + the namespace procedures. + + PL/SQL API + + None. Uses PL/SQL functions provided by ACS Messaging. + + + + Data Model Discussion + + The majority of the functionality of general comments has been + merged with acs-messaging. Comments are stored as acs-messages. + + The general_comments table extends + acs_messages to provide categorization of comments on + a particular object. general_comments also stores the + object_id of the object the comment refers to. Relationships from + attachments to acs-message is done by using the + cr_items.parent_id column. + + + + + + A general-comment can be associated with any object + in the system by using the general_comments.object_id + column. Because each comment is itself an object, we could + implement comments on comments. However, this functionality is not + needed in the general-comments model and the UI does + not support comments on comments. + + There are three types of attachments a user can create: file, + image, and url. The underlying data representation of an attachment + is a content item with different content_types. File attachments + are stored with a content_revision type. Image attachments are + stored with a image type. Url attachments are stored with a + content_extlink type. + + One problem we face is how to allow designers to modify the + presentation of the comments on an object without modifying tcl + code. The proc general_comments_get_comments has html + code which should really be placed into a template. Karl Goldstein + code reviewed general comments and has an interesting solution: + + + Add an -uplevel parameter to + db_multirow. + + In the general_comments_get_comments proc, create + an upleveled datasource. + + From the .tcl page, make a call to + general_comments_get_comments, which would set up the + multirow datasource in the current environment. + + From the .adp page, loop through the multirow + datasource. + + + + + User Interface + + General Comments provides two similar sets of UIs for + adminstrators and normal users. The adminstrator UI allows + approval/unapproval of comments as well as deletion of comments. + The normal user UI presents to users all of their created comments, + with links to editing and creating attachments. + + + + Configuration/Parameters + + + AutoApproveCommentsP: Sets whether comments go + live immediately. + + AllowFileAttachmentsP: Sets whether files can be + attached to comments. + + AllowLinkAttachmentsP: Sets whether links can be + attached to comments. + + MaxFileSize: Maximum file size that can be + uploaded in bytes. + + + + + Future Improvements/Areas of Likely Change + + + Subsite administration + + Cascading parameters to depending packages. + + Revisioning of attachments + + + + + Authors + + + Phong Nguyen + + + + + Revision History + + + + + Document Revision # + + Action Taken, Notes + When? + By Whom? + + + + 0.2 + Revision + 12/11/2000 + Phong Nguyen + + + + 0.1 + Creation + 10/26/2000 + Phong Nguyen + + + + + + Last modified: $Id: design.xml,v 1.1 2003/05/02 15:51:13 daveb Exp $ + + + Index: openacs-4/contrib/packages/general-comments/www/doc/dev-guide.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/doc/Attic/dev-guide.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/doc/dev-guide.html 2 May 2003 15:51:14 -0000 1.1 @@ -0,0 +1,536 @@ + +Developer's guide
    General Comments
    PrevNext

    Chapter 1. Developer's guide

    1.1. Requirements Document

    1.1.1. Introduction

    This is the requirements document for the General Comments + package for ACS 4.0. General Comments is an application that takes + advantage of the ACS Messaging service package.

    1.1.2. Vision Statement

    User feedback and engagement is the very heart of a + collaborative community. General Comments allows users to comment + on any object in the community, such as articles, white papers, + press releases or pictures.

    Comments are not limited to text, but can include attachments + such as links, pictures or other documents.

    Users can edit their own comments and an administrator can + choose to moderate all or particular comments before they go live + on the site.

    1.1.3. Application Overview

    General Comments is an application package that relies on the + ACS Messaging package. Comments can be associated with any object + in ACS 4.0, which gives you the benefits of the Permission System. + Comments are stored as ACS Messages.

    When a user creates a comment, General Comments stores the + comment as an ACS Message and associates the comment to the object + commented on. The value set by the adminstrator on whether comments + go live immediately or needs approval first is stored along with + the comment during this phase. After this, the user is presented + with a page that displays contents of the comment along with + revision history, attachments, and links to perform actions on the + comment such as adding attachments or editing the comment.

    1.1.4. Use-cases and User-scenarios

    This package supports empowering all users with the option of + adding comments to objects in the system, and editing their own + comments later on.

    A user adding a comment:

    Nurse Nancy is browsing through an ACS 4.0 site that has a page for + medical emergencies. Upon reaching the bottom of the page, Nancy + sees a posting that reads, "Please help, my child has just + swallowed some cleaning solution!!!". Nancy sees that this + posting was made only 30 seconds ago and quickly posts a remedy for + this situation. After she makes her posting, she immediately + revisits the page and happily sees that her posting is already + available.

    A user editing an old comment:

    George Genius is reviewing all of the comments he has posted over + the last 24 hours. In one of his postings, George notices that his + mathematical formula for earthquake prediction was incorrect. He + then clicks on the edit link, makes changes to his formula and + submits his changes. Since comments are moderated, others will only + see his older incorrect version until his changes are approved. + George eagerly awaits for his changes to be approved so that he + won't be ridiculed by his colleagues for his mistakes.

    An adminstrator moderating:

    Adam Admin is looking over all recently unnapproved changes to + comments. Adam sees that George Genius has made a correction to the + earthquake prediction formula in which he helped write. He believes + that the their original formaula is correct, so Adam does not + approve of the changes. Several days later, George barges into + Adam's office wondering why his changes were not approved. After a + few hours George convinces Adam that the new modifications were + correct, and so Adam approves George's comment. +

    1.1.6. Requirements: Data Model

    10.0 Comments can be attached to any object in the system.

    10.10 Maintain revisioning of comments.

    10.20 Store comment as an acs-message.

    10.30 Allow separation of comments on an object.

    10.40 Allow file and url attachments to comments.

    10.50 Allow limitations on size of file attachments.

    10.60 Use permissioning system to control creation of comments.

    1.1.7. Requirements: API

    20.0 A summary type function that retrieves all + comments for a particular object.

    20.10 A link function that generates an + appropriate link to add a comment.

    1.1.8. Requirements: Interface

    The Community Member's Interface

    The user interface for community members is a set of HTML pages + that allow creation and editing of comments.

    30.0 Customized presentation.

    30.0.10 Show all comments that the user created.

    30.0.20 Have sliders to show approved/uapproved comments.

    30.0.30 Have sliders to show comments by age.

    30.10 Comments can be viewed in detail.

    30.20 Provide ways for a user to add attachments to a comment.

    30.30 Allow editing of comments.

    30.40 Provide a way to display attached images.

    30.50 Allow download of attached files.

    The Administrator's Interface

    The user interface for adminstrative members is a set of HTML pages + that allows deletion and approval of comments.

    40.0 Customized presentation.

    40.0.10 Show all created comments.

    40.0.20 Have sliders to show approved/unapproved comments.

    40.0.30 Have sliders to show comments by age.

    40.10 Allow deletion of comments.

    1.1.9. Revision History

    Document Revision # Action Taken, NotesWhen?By Whom?
    0.2Revision12/11/2000Phong Nguyen
    0.1Creation10/26/2000Phong Nguyen

    Last modified: $Id: dev-guide.html,v 1.1 2003/05/02 15:51:14 daveb Exp $ +


    PrevHomeNext
    General Comments Design Document
    \ No newline at end of file Index: openacs-4/contrib/packages/general-comments/www/doc/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/doc/Attic/index.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/doc/index.html 2 May 2003 15:51:14 -0000 1.1 @@ -0,0 +1,245 @@ + +General Comments

      Next
      Developer's guide
    \ No newline at end of file Index: openacs-4/contrib/packages/general-comments/www/doc/index.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/doc/Attic/index.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/doc/index.xml 2 May 2003 15:51:14 -0000 1.1 @@ -0,0 +1,32 @@ + + + +]> + + + General Comments + + + Phong + Nguyen + +
    phong@arsdigita.com
    +
    +
    +
    + + + Developer's guide + &requirements; + &design; + + + + User's guide + + + + +
    Index: openacs-4/contrib/packages/general-comments/www/doc/requirements.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/doc/Attic/requirements.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/doc/requirements.xml 2 May 2003 15:51:14 -0000 1.1 @@ -0,0 +1,193 @@ + + Requirements Document + + + Introduction + + This is the requirements document for the General Comments + package for ACS 4.0. General Comments is an application that takes + advantage of the ACS Messaging service package. + + + + Vision Statement + + User feedback and engagement is the very heart of a + collaborative community. General Comments allows users to comment + on any object in the community, such as articles, white papers, + press releases or pictures. + + Comments are not limited to text, but can include attachments + such as links, pictures or other documents. + + Users can edit their own comments and an administrator can + choose to moderate all or particular comments before they go live + on the site. + + + + Application Overview + + General Comments is an application package that relies on the + ACS Messaging package. Comments can be associated with any object + in ACS 4.0, which gives you the benefits of the Permission System. + Comments are stored as ACS Messages. + + When a user creates a comment, General Comments stores the + comment as an ACS Message and associates the comment to the object + commented on. The value set by the adminstrator on whether comments + go live immediately or needs approval first is stored along with + the comment during this phase. After this, the user is presented + with a page that displays contents of the comment along with + revision history, attachments, and links to perform actions on the + comment such as adding attachments or editing the comment. + + + + Use-cases and User-scenarios + + This package supports empowering all users with the option of + adding comments to objects in the system, and editing their own + comments later on. + + A user adding a comment: + Nurse Nancy is browsing through an ACS 4.0 site that has a page for + medical emergencies. Upon reaching the bottom of the page, Nancy + sees a posting that reads, "Please help, my child has just + swallowed some cleaning solution!!!". Nancy sees that this + posting was made only 30 seconds ago and quickly posts a remedy for + this situation. After she makes her posting, she immediately + revisits the page and happily sees that her posting is already + available. + + A user editing an old comment: + George Genius is reviewing all of the comments he has posted over + the last 24 hours. In one of his postings, George notices that his + mathematical formula for earthquake prediction was incorrect. He + then clicks on the edit link, makes changes to his formula and + submits his changes. Since comments are moderated, others will only + see his older incorrect version until his changes are approved. + George eagerly awaits for his changes to be approved so that he + won't be ridiculed by his colleagues for his mistakes. + + An adminstrator moderating: + Adam Admin is looking over all recently unnapproved changes to + comments. Adam sees that George Genius has made a correction to the + earthquake prediction formula in which he helped write. He believes + that the their original formaula is correct, so Adam does not + approve of the changes. Several days later, George barges into + Adam's office wondering why his changes were not approved. After a + few hours George convinces Adam that the new modifications were + correct, and so Adam approves George's comment. + + + + + Related Links + + + + ACS Messaging + + + + + Requirements: Data Model + + 10.0 Comments can be attached to any object in the system. + + 10.10 Maintain revisioning of comments. + + 10.20 Store comment as an acs-message. + + 10.30 Allow separation of comments on an object. + + 10.40 Allow file and url attachments to comments. + + 10.50 Allow limitations on size of file attachments. + + 10.60 Use permissioning system to control creation of comments. + + + + Requirements: API + + 20.0 A summary type function that retrieves all + comments for a particular object. + + 20.10 A link function that generates an + appropriate link to add a comment. + + + + Requirements: Interface + + The Community Member's Interface + The user interface for community members is a set of HTML pages + that allow creation and editing of comments. + + 30.0 Customized presentation. + + 30.0.10 Show all comments that the user created. + + 30.0.20 Have sliders to show approved/uapproved comments. + + 30.0.30 Have sliders to show comments by age. + + 30.10 Comments can be viewed in detail. + + 30.20 Provide ways for a user to add attachments to a comment. + + 30.30 Allow editing of comments. + + 30.40 Provide a way to display attached images. + + 30.50 Allow download of attached files. + + The Administrator's Interface + The user interface for adminstrative members is a set of HTML pages + that allows deletion and approval of comments. + + 40.0 Customized presentation. + + 40.0.10 Show all created comments. + + 40.0.20 Have sliders to show approved/unapproved comments. + + 40.0.30 Have sliders to show comments by age. + + 40.10 Allow deletion of comments. + + + + Revision History + + + + + Document Revision # + + Action Taken, Notes + When? + By Whom? + + + + 0.2 + Revision + 12/11/2000 + Phong Nguyen + + + + 0.1 + Creation + 10/26/2000 + Phong Nguyen + + + + Last modified: $Id: requirements.xml,v 1.1 2003/05/02 15:51:14 daveb Exp $ + + + Index: openacs-4/contrib/packages/general-comments/www/doc/users-guide.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/doc/Attic/users-guide.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/general-comments/www/doc/users-guide.html 2 May 2003 15:51:14 -0000 1.1 @@ -0,0 +1,122 @@ + +User's guide
    General Comments
    Prev 


    PrevHome 
    Design Document  
    \ No newline at end of file