[Solved] Writer+CMS for approval cycle w/ tracking changes

Creating a macro - Writing a Script - Using the API

[Solved] Writer+CMS for approval cycle w/ tracking changes

Postby mamkiks » Mon Apr 02, 2018 9:52 am

I need a way to use open office in "CMS" there are many user can access it and making changes in the document I want to record their changes by their names that stored in a database so I want to make method like login form in the beginning of the document

Ex:
I create Document on my machine You - as approver - try to open it to make some changes, Login form appear you enter "Mike" the records saved as "Mike" insert "abc"

another one login as "JOHN" record "JOHN" insert "xyz"
Last edited by mamkiks on Tue Apr 03, 2018 4:27 pm, edited 1 time in total.
OpenOffice 4.1.5 on Windows 10
mamkiks
 
Posts: 17
Joined: Sun Mar 25, 2018 1:00 pm

Re: Writer with CMS to make approval cycle with tracking cha

Postby Lupp » Mon Apr 02, 2018 12:55 pm

OpenOffice 'Wiriter' comes with a built-in change tracking system. See https://wiki.openoffice.org/wiki/Docume ... a_document.

Beyond that you would need to write a "minimally complete" CMS yourself. I would expect that to be complicated, inefficient, and unreliable - in specific if based on ordinary macro programming. The original question would be where the "macros" reside. Would you consider to use another document (spreadsheets e.g.) to act as a kind of CMS server? ...

There are CMS after all.
On Windows 10: LibreOffice 5.4.4 and older versions, PortableOpenOffice 4.1.5 and older, StarOffice 5.2
---
Maybe we might! (Create a powerful UFO: United Free Office)
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 1823
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Writer with CMS to make approval cycle with tracking cha

Postby mamkiks » Mon Apr 02, 2018 1:28 pm

Lupp wrote:OpenOffice 'Wiriter' comes with a built-in change tracking system. See https://wiki.openoffice.org/wiki/Docume ... a_document.

Beyond that you would need to write a "minimally complete" CMS yourself. I would expect that to be complicated, inefficient, and unreliable - in specific if based on ordinary macro programming. The original question would be where the "macros" reside. Would you consider to use another document (spreadsheets e.g.) to act as a kind of CMS server? ...

There are CMS after all.


I need the result to be as the image below
But the way to change who made changes before making it
go to Tools>> Options>> UserData and change First and lastName

I need to Hide the toolbar to disable changing the username by this way above
And I've already made that by macros

now I need to change this data using macros or any method
that enable to enter the username in inputbox then when i make changes >> the changes will record by username that entered in inputbox

Screenshot_from_2018_04_02_13_18_05.png
OpenOffice 4.1.5 on Windows 10
mamkiks
 
Posts: 17
Joined: Sun Mar 25, 2018 1:00 pm

Re: Writer with CMS to make approval cycle with tracking cha

Postby JeJe » Mon Apr 02, 2018 3:27 pm

This code will change the user name. You just need to add the Input Box or a dialog for the user to input their name.

I got the code to access/verify the change here - you might find this a helpful thread to look at.

https://forum.openoffice.org/en/forum/v ... onprovider

Code: Select all   Expand viewCollapse view

sub main
   ChangeUserName("Sally","S")
   test_UserProfileData
end sub

Sub ChangeUserName(givenname as string,initial)

   Dim oCP, oCUA

   Const sNodePath$ = "/org.openoffice.UserProfile/Data"
   Dim aProps(0) As New com.sun.star.beans.PropertyValue

   oCP = CreateUnoService("com.sun.star.configuration.ConfigurationProvider" )
   aProps(0).Name = "nodepath"
   aProps(0).Value = sNodePath
   oCUA = oCP.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", aProps )

   oCUA.givenname = givenname
   oCUA.initials = initial
   oCUA.commitChanges()

End Sub

'below code posted by Villeroy at
'https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=14750&start=0&st=0&sk=t&sd=a&hilit=configurationprovider

Sub test_UserProfileData() As String
REM look at file <<OOo-Profile/3/user/registry/data>> /org/openoffice/UserProfile.xcu, XML-node "Data":
   Const sNodePath$ = "/org.openoffice.UserProfile/Data"

   oNode = getOOoSetupNode(sNodePath$)
   snval = oNode.getByName("sn")
   gnval = oNode.getByName("givenname")
   ival = oNode.getByName("initials")


   print gnval,snval,ival
End Sub

Function getOOoSetupNode(sNodePath$)
   Dim aConfigProvider, oNode, args(0) As new com.sun.star.beans.PropertyValue
   aConfigProvider = createUnoService("com.sun.star.configuration.ConfigurationProvider")
   args(0).Name = "nodepath"
   args(0).Value = sNodePath
   getOOoSetupNode = aConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args())

End Function

Openoffice 4.1.2
Windows 8
JeJe
 
Posts: 217
Joined: Wed Mar 09, 2016 2:40 pm

Re: Writer with CMS to make approval cycle with tracking cha

Postby mamkiks » Tue Apr 03, 2018 3:19 pm

JeJe wrote:This code will change the user name. You just need to add the Input Box or a dialog for the user to input their name.

I got the code to access/verify the change here - you might find this a helpful thread to look at.

https://forum.openoffice.org/en/forum/v ... onprovider

Code: Select all   Expand viewCollapse view

sub main
   ChangeUserName("Sally","S")
   test_UserProfileData
end sub

Sub ChangeUserName(givenname as string,initial)

   Dim oCP, oCUA

   Const sNodePath$ = "/org.openoffice.UserProfile/Data"
   Dim aProps(0) As New com.sun.star.beans.PropertyValue

   oCP = CreateUnoService("com.sun.star.configuration.ConfigurationProvider" )
   aProps(0).Name = "nodepath"
   aProps(0).Value = sNodePath
   oCUA = oCP.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", aProps )

   oCUA.givenname = givenname
   oCUA.initials = initial
   oCUA.commitChanges()

End Sub

'below code posted by Villeroy at
'https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=14750&start=0&st=0&sk=t&sd=a&hilit=configurationprovider

Sub test_UserProfileData() As String
REM look at file <<OOo-Profile/3/user/registry/data>> /org/openoffice/UserProfile.xcu, XML-node "Data":
   Const sNodePath$ = "/org.openoffice.UserProfile/Data"

   oNode = getOOoSetupNode(sNodePath$)
   snval = oNode.getByName("sn")
   gnval = oNode.getByName("givenname")
   ival = oNode.getByName("initials")


   print gnval,snval,ival
End Sub

Function getOOoSetupNode(sNodePath$)
   Dim aConfigProvider, oNode, args(0) As new com.sun.star.beans.PropertyValue
   aConfigProvider = createUnoService("com.sun.star.configuration.ConfigurationProvider")
   args(0).Name = "nodepath"
   args(0).Value = sNodePath
   getOOoSetupNode = aConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args())

End Function



It works, Thanks Dude
OpenOffice 4.1.5 on Windows 10
mamkiks
 
Posts: 17
Joined: Sun Mar 25, 2018 1:00 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 4 guests