Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
07414cf6
Commit
07414cf6
authored
Jan 27, 2012
by
shibakaneki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some metadata fields
parent
d6af845c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
224 additions
and
5 deletions
+224
-5
UBMetadataDcSubsetAdaptor.cpp
src/adaptors/UBMetadataDcSubsetAdaptor.cpp
+24
-0
UBSettings.cpp
src/core/UBSettings.cpp
+4
-0
UBSettings.h
src/core/UBSettings.h
+4
-0
UBDocumentProxy.cpp
src/document/UBDocumentProxy.cpp
+55
-0
UBDocumentProxy.h
src/document/UBDocumentProxy.h
+9
-0
UBTBDocumentEditWidget.cpp
src/gui/UBTBDocumentEditWidget.cpp
+77
-4
UBTBDocumentEditWidget.h
src/gui/UBTBDocumentEditWidget.h
+17
-0
UBTeacherBarDataMgr.cpp
src/gui/UBTeacherBarDataMgr.cpp
+8
-0
UBTeacherBarDataMgr.h
src/gui/UBTeacherBarDataMgr.h
+21
-0
UBTeacherBarWidget.cpp
src/gui/UBTeacherBarWidget.cpp
+5
-1
No files found.
src/adaptors/UBMetadataDcSubsetAdaptor.cpp
View file @
07414cf6
...
...
@@ -109,6 +109,10 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy)
xmlWriter
.
writeTextElement
(
UBSettings
::
uniboardDocumentNamespaceUri
,
UBSettings
::
sessionTitle
,
proxy
->
metaData
(
UBSettings
::
sessionTitle
).
toString
());
xmlWriter
.
writeTextElement
(
UBSettings
::
uniboardDocumentNamespaceUri
,
UBSettings
::
sessionTarget
,
proxy
->
metaData
(
UBSettings
::
sessionTarget
).
toString
());
xmlWriter
.
writeTextElement
(
UBSettings
::
uniboardDocumentNamespaceUri
,
UBSettings
::
sessionLicence
,
proxy
->
metaData
(
UBSettings
::
sessionLicence
).
toString
());
xmlWriter
.
writeTextElement
(
UBSettings
::
uniboardDocumentNamespaceUri
,
UBSettings
::
sessionKeywords
,
proxy
->
metaData
(
UBSettings
::
sessionKeywords
).
toString
());
xmlWriter
.
writeTextElement
(
UBSettings
::
uniboardDocumentNamespaceUri
,
UBSettings
::
sessionLevel
,
proxy
->
metaData
(
UBSettings
::
sessionLevel
).
toString
());
xmlWriter
.
writeTextElement
(
UBSettings
::
uniboardDocumentNamespaceUri
,
UBSettings
::
sessionTopic
,
proxy
->
metaData
(
UBSettings
::
sessionTopic
).
toString
());
xmlWriter
.
writeTextElement
(
UBSettings
::
uniboardDocumentNamespaceUri
,
UBSettings
::
sessionAuthors
,
proxy
->
metaData
(
UBSettings
::
sessionAuthors
).
toString
());
xmlWriter
.
writeEndElement
();
//dc:Description
xmlWriter
.
writeEndElement
();
//RDF
...
...
@@ -224,6 +228,26 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
{
metadata
.
insert
(
UBSettings
::
sessionLicence
,
xml
.
readElementText
());
}
else
if
(
xml
.
name
()
==
UBSettings
::
sessionKeywords
// introduced in OpenSankore 1.40.00
&&
xml
.
namespaceUri
()
==
UBSettings
::
uniboardDocumentNamespaceUri
)
{
metadata
.
insert
(
UBSettings
::
sessionKeywords
,
xml
.
readElementText
());
}
else
if
(
xml
.
name
()
==
UBSettings
::
sessionLevel
// introduced in OpenSankore 1.40.00
&&
xml
.
namespaceUri
()
==
UBSettings
::
uniboardDocumentNamespaceUri
)
{
metadata
.
insert
(
UBSettings
::
sessionLevel
,
xml
.
readElementText
());
}
else
if
(
xml
.
name
()
==
UBSettings
::
sessionTopic
// introduced in OpenSankore 1.40.00
&&
xml
.
namespaceUri
()
==
UBSettings
::
uniboardDocumentNamespaceUri
)
{
metadata
.
insert
(
UBSettings
::
sessionTopic
,
xml
.
readElementText
());
}
else
if
(
xml
.
name
()
==
UBSettings
::
sessionAuthors
// introduced in OpenSankore 1.40.00
&&
xml
.
namespaceUri
()
==
UBSettings
::
uniboardDocumentNamespaceUri
)
{
metadata
.
insert
(
UBSettings
::
sessionAuthors
,
xml
.
readElementText
());
}
metadata
.
insert
(
UBSettings
::
documentVersion
,
docVersion
);
}
...
...
src/core/UBSettings.cpp
View file @
07414cf6
...
...
@@ -39,6 +39,10 @@ QString UBSettings::documentUpdatedAt = QString("UpdatedAt");
QString
UBSettings
::
sessionTitle
=
QString
(
"sessionTitle"
);
QString
UBSettings
::
sessionTarget
=
QString
(
"sessionTarget"
);
QString
UBSettings
::
sessionLicence
=
QString
(
"sessionLicence"
);
QString
UBSettings
::
sessionKeywords
=
QString
(
"sessionAuthors"
);
QString
UBSettings
::
sessionLevel
=
QString
(
"sessionLevel"
);
QString
UBSettings
::
sessionTopic
=
QString
(
"sessionTopic"
);
QString
UBSettings
::
sessionAuthors
=
QString
(
"sessionAuthors"
);
QString
UBSettings
::
trashedDocumentGroupNamePrefix
=
QString
(
"_Trash:"
);
...
...
src/core/UBSettings.h
View file @
07414cf6
...
...
@@ -156,6 +156,10 @@ class UBSettings : public QObject
static
QString
sessionTitle
;
static
QString
sessionTarget
;
static
QString
sessionLicence
;
static
QString
sessionKeywords
;
static
QString
sessionLevel
;
static
QString
sessionTopic
;
static
QString
sessionAuthors
;
static
QString
trashedDocumentGroupNamePrefix
;
...
...
src/document/UBDocumentProxy.cpp
View file @
07414cf6
...
...
@@ -53,6 +53,10 @@ void UBDocumentProxy::init()
setSessionTitle
(
""
);
setSessionTarget
(
""
);
setSessionLicence
(
""
);
setSessionKeywords
(
""
);
setSessionLevel
(
""
);
setSessionTopic
(
""
);
setSessionAuthor
(
""
);
}
...
...
@@ -239,6 +243,57 @@ void UBDocumentProxy::setSessionLicence(const QString & sessionLicence)
setMetaData
(
UBSettings
::
sessionLicence
,
QVariant
(
sessionLicence
));
}
void
UBDocumentProxy
::
setSessionKeywords
(
const
QString
&
kw
)
{
setMetaData
(
UBSettings
::
sessionKeywords
,
QVariant
(
kw
));
}
QString
UBDocumentProxy
::
sessionKeywords
()
{
if
(
mMetaDatas
.
contains
(
UBSettings
::
sessionKeywords
))
return
metaData
(
UBSettings
::
sessionKeywords
).
toString
();
else
return
QString
();
}
void
UBDocumentProxy
::
setSessionLevel
(
const
QString
&
level
)
{
setMetaData
(
UBSettings
::
sessionLevel
,
QVariant
(
level
));
}
QString
UBDocumentProxy
::
sessionLevel
()
{
if
(
mMetaDatas
.
contains
(
UBSettings
::
sessionLevel
))
return
metaData
(
UBSettings
::
sessionLevel
).
toString
();
else
return
QString
();
}
void
UBDocumentProxy
::
setSessionTopic
(
const
QString
&
topic
)
{
setMetaData
(
UBSettings
::
sessionTopic
,
QVariant
(
topic
));
}
QString
UBDocumentProxy
::
sessionTopic
()
{
if
(
mMetaDatas
.
contains
(
UBSettings
::
sessionTopic
))
return
metaData
(
UBSettings
::
sessionTopic
).
toString
();
else
return
QString
();
}
void
UBDocumentProxy
::
setSessionAuthor
(
const
QString
&
authors
)
{
setMetaData
(
UBSettings
::
sessionAuthors
,
QVariant
(
authors
));
}
QString
UBDocumentProxy
::
sessionAuthors
()
{
if
(
mMetaDatas
.
contains
(
UBSettings
::
sessionAuthors
))
return
metaData
(
UBSettings
::
sessionAuthors
).
toString
();
else
return
QString
();
}
bool
UBDocumentProxy
::
isModified
()
const
{
...
...
src/document/UBDocumentProxy.h
View file @
07414cf6
...
...
@@ -51,6 +51,15 @@ class UBDocumentProxy : public QObject
void
setSessionTarget
(
const
QString
&
sessionTarget
);
QString
sessionLicence
()
const
;
void
setSessionLicence
(
const
QString
&
sessionLicence
);
void
setSessionKeywords
(
const
QString
&
kw
);
QString
sessionKeywords
();
void
setSessionLevel
(
const
QString
&
level
);
QString
sessionLevel
();
void
setSessionTopic
(
const
QString
&
topic
);
QString
sessionTopic
();
void
setSessionAuthor
(
const
QString
&
authors
);
QString
sessionAuthors
();
QSize
defaultDocumentSize
()
const
;
void
setDefaultDocumentSize
(
QSize
pSize
);
...
...
src/gui/UBTBDocumentEditWidget.cpp
View file @
07414cf6
...
...
@@ -11,6 +11,14 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW
,
mpMetadataLabel
(
NULL
)
,
mpLicenseLabel
(
NULL
)
,
mpLicenseCombox
(
NULL
)
,
mpKeywords
(
NULL
)
,
mpLevel
(
NULL
)
,
mpTopic
(
NULL
)
,
mpAuthor
(
NULL
)
,
mpKeywordLabel
(
NULL
)
,
mpLevelLabel
(
NULL
)
,
mpTopicLabel
(
NULL
)
,
mpAuthorLabel
(
NULL
)
{
setObjectName
(
name
);
...
...
@@ -27,7 +35,7 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW
// Title
mpTitleLabel
=
new
QLabel
(
tr
(
"Session Title"
),
mpContainer
);
mpTitleLabel
->
setAlignment
(
Qt
::
AlignLeft
);
//
mpTitleLabel->setObjectName("UBTeacherBarPreviewSubtitle");
mpTitleLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mContainerLayout
.
addWidget
(
mpTitleLabel
,
0
);
mpTitle
=
new
QLineEdit
(
mpContainer
);
mpTitle
->
setObjectName
(
"DockPaletteWidgetLineEdit"
);
...
...
@@ -36,7 +44,7 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW
// Target
mpTargetLabel
=
new
QLabel
(
tr
(
"Session Target"
),
mpContainer
);
//
mpTargetLabel->setObjectName("UBTeacherBarPreviewSubtitle");
mpTargetLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mContainerLayout
.
addWidget
(
mpTargetLabel
,
0
);
mpTarget
=
new
QTextEdit
(
mpContainer
);
mpTarget
->
setObjectName
(
"UBTeacherBarTargetBox"
);
...
...
@@ -45,15 +53,42 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW
// Metadata
mpMetadataLabel
=
new
QLabel
(
tr
(
"Metadata"
),
mpContainer
);
mpMetadataLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mpMetadataLabel
->
setAlignment
(
Qt
::
AlignLeft
);
//mpMetadataLabel->setObjectName("UBTeacherBarPreviewSubtitle");
mContainerLayout
.
addWidget
(
mpMetadataLabel
,
0
);
mpKeywords
=
new
QLineEdit
(
this
);
mpKeywords
->
setObjectName
(
"DockPaletteWidgetLineEdit"
);
mpLevel
=
new
QComboBox
(
this
);
mpLevel
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
mpTopic
=
new
QComboBox
(
this
);
mpTopic
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
mpAuthor
=
new
QLineEdit
(
this
);
mpAuthor
->
setObjectName
(
"DockPaletteWidgetLineEdit"
);
mpKeywordLabel
=
new
QLabel
(
tr
(
"Keywords:"
),
this
);
mpLevelLabel
=
new
QLabel
(
tr
(
"Level:"
),
this
);
mpTopicLabel
=
new
QLabel
(
tr
(
"Topic:"
),
this
);
mpAuthorLabel
=
new
QLabel
(
tr
(
"Author"
),
this
);
mKeywordLayout
.
addWidget
(
mpKeywordLabel
,
0
);
mKeywordLayout
.
addWidget
(
mpKeywords
,
1
);
mLevelLayout
.
addWidget
(
mpLevelLabel
,
0
);
mLevelLayout
.
addWidget
(
mpLevel
,
1
);
mTopicLayout
.
addWidget
(
mpTopicLabel
,
0
);
mTopicLayout
.
addWidget
(
mpTopic
,
1
);
mAuthorLayout
.
addWidget
(
mpAuthorLabel
,
0
);
mAuthorLayout
.
addWidget
(
mpAuthor
,
1
);
mContainerLayout
.
addLayout
(
&
mKeywordLayout
,
0
);
mContainerLayout
.
addLayout
(
&
mLevelLayout
,
0
);
mContainerLayout
.
addLayout
(
&
mTopicLayout
,
0
);
mContainerLayout
.
addLayout
(
&
mAuthorLayout
,
0
);
mContainerLayout
.
addWidget
(
&
mLicenseSeparator
);
// License
mpLicenseLabel
=
new
QLabel
(
tr
(
"License"
),
mpContainer
);
mpLicenseLabel
->
setAlignment
(
Qt
::
AlignLeft
);
//
mpLicenseLabel->setObjectName("UBTeacherBarPreviewSubtitle");
mpLicenseLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mContainerLayout
.
addWidget
(
mpLicenseLabel
,
0
);
mpLicenseCombox
=
new
QComboBox
(
this
);
mpLicenseCombox
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
...
...
@@ -81,6 +116,10 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW
connect
(
mpTitle
,
SIGNAL
(
textChanged
(
QString
)),
this
,
SLOT
(
onSessionTitleChanged
()));
connect
(
mpTarget
,
SIGNAL
(
textChanged
()),
this
,
SLOT
(
onSessionTargetChanged
()));
connect
(
mpLicenseCombox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
onLicenseCurrentIndexChanged
(
int
)));
connect
(
mpKeywords
,
SIGNAL
(
textChanged
(
QString
)),
this
,
SLOT
(
onKeywordChanged
(
QString
)));
connect
(
mpLevel
,
SIGNAL
(
currentIndexChanged
(
QString
)),
this
,
SLOT
(
onLevelChanged
(
QString
)));
connect
(
mpTopic
,
SIGNAL
(
currentIndexChanged
(
QString
)),
this
,
SLOT
(
onTopicChanged
(
QString
)));
connect
(
mpAuthor
,
SIGNAL
(
textChanged
(
QString
)),
this
,
SLOT
(
onAuthorChanged
(
QString
)));
}
UBTBDocumentEditWidget
::~
UBTBDocumentEditWidget
()
...
...
@@ -90,6 +129,14 @@ UBTBDocumentEditWidget::~UBTBDocumentEditWidget()
DELETEPTR
(
mpTargetLabel
);
DELETEPTR
(
mpTarget
);
DELETEPTR
(
mpMetadataLabel
);
DELETEPTR
(
mpKeywordLabel
);
DELETEPTR
(
mpLevelLabel
);
DELETEPTR
(
mpTopicLabel
);
DELETEPTR
(
mpAuthorLabel
);
DELETEPTR
(
mpKeywords
);
DELETEPTR
(
mpLevel
);
DELETEPTR
(
mpTopic
);
DELETEPTR
(
mpAuthor
);
DELETEPTR
(
mpLicenseLabel
);
DELETEPTR
(
mpLicenseCombox
);
DELETEPTR
(
mpPageViewButton
);
...
...
@@ -128,6 +175,10 @@ void UBTBDocumentEditWidget::updateFields()
{
mpTitle
->
setText
(
mpDataMgr
->
sessionTitle
());
mpTarget
->
setPlainText
(
mpDataMgr
->
sessionTarget
());
mpKeywords
->
setText
(
mpDataMgr
->
keywords
());
// TODO: retrieve the level
// TODO retrieve the topic
mpAuthor
->
setText
(
mpDataMgr
->
authors
());
}
void
UBTBDocumentEditWidget
::
clearFields
()
...
...
@@ -136,4 +187,26 @@ void UBTBDocumentEditWidget::clearFields()
mpTarget
->
setPlainText
(
""
);
}
void
UBTBDocumentEditWidget
::
onKeywordChanged
(
const
QString
&
kw
)
{
mpDataMgr
->
setKeywords
(
kw
);
emit
valueChanged
();
}
void
UBTBDocumentEditWidget
::
onLevelChanged
(
const
QString
&
level
)
{
mpDataMgr
->
setLevel
(
level
);
emit
valueChanged
();
}
void
UBTBDocumentEditWidget
::
onTopicChanged
(
const
QString
&
topic
)
{
mpDataMgr
->
setTopic
(
topic
);
emit
valueChanged
();
}
void
UBTBDocumentEditWidget
::
onAuthorChanged
(
const
QString
&
authors
)
{
mpDataMgr
->
setAuthors
(
authors
);
emit
valueChanged
();
}
src/gui/UBTBDocumentEditWidget.h
View file @
07414cf6
...
...
@@ -29,6 +29,10 @@ private slots:
void
onSessionTitleChanged
();
void
onSessionTargetChanged
();
void
onLicenseCurrentIndexChanged
(
int
selection
);
void
onKeywordChanged
(
const
QString
&
kw
);
void
onLevelChanged
(
const
QString
&
level
);
void
onTopicChanged
(
const
QString
&
topic
);
void
onAuthorChanged
(
const
QString
&
authors
);
private
:
QVBoxLayout
mLayout
;
...
...
@@ -41,6 +45,11 @@ private:
UBTBSeparator
mTargetSeparator
;
UBTBSeparator
mLicenseSeparator
;
QHBoxLayout
mKeywordLayout
;
QHBoxLayout
mLevelLayout
;
QHBoxLayout
mTopicLayout
;
QHBoxLayout
mAuthorLayout
;
QWidget
*
mpContainer
;
QLabel
*
mpTitleLabel
;
QLineEdit
*
mpTitle
;
...
...
@@ -49,6 +58,14 @@ private:
QLabel
*
mpMetadataLabel
;
QLabel
*
mpLicenseLabel
;
QComboBox
*
mpLicenseCombox
;
QLineEdit
*
mpKeywords
;
QComboBox
*
mpLevel
;
QComboBox
*
mpTopic
;
QLineEdit
*
mpAuthor
;
QLabel
*
mpKeywordLabel
;
QLabel
*
mpLevelLabel
;
QLabel
*
mpTopicLabel
;
QLabel
*
mpAuthorLabel
;
UBTeacherBarDataMgr
*
mpDataMgr
;
};
...
...
src/gui/UBTeacherBarDataMgr.cpp
View file @
07414cf6
...
...
@@ -59,6 +59,10 @@ void UBTeacherBarDataMgr::saveContent()
documentProxy
->
setSessionTitle
(
mSessionTitle
);
documentProxy
->
setSessionTarget
(
mSessionTarget
);
documentProxy
->
setSessionLicence
(
QString
(
"%0"
).
arg
(
mSessionLicence
));
documentProxy
->
setSessionKeywords
(
mAuthors
);
documentProxy
->
setSessionLevel
(
mLevel
);
documentProxy
->
setSessionTopic
(
mTopic
);
documentProxy
->
setSessionAuthor
(
mAuthors
);
UBMetadataDcSubsetAdaptor
::
persist
(
documentProxy
);
}
...
...
@@ -76,6 +80,10 @@ void UBTeacherBarDataMgr::loadContent(bool docChanged)
mSessionTitle
=
documentProxy
->
sessionTitle
();
mSessionTarget
=
documentProxy
->
sessionTarget
();
mSessionLicence
=
(
eLicense
)
documentProxy
->
sessionLicence
().
toInt
();
mKeywords
=
documentProxy
->
sessionKeywords
();
mLevel
=
documentProxy
->
sessionLevel
();
mTopic
=
documentProxy
->
sessionTopic
();
mAuthors
=
documentProxy
->
sessionAuthors
();
}
// Page Title
...
...
src/gui/UBTeacherBarDataMgr.h
View file @
07414cf6
...
...
@@ -99,6 +99,23 @@ public:
void
setComments
(
const
QString
&
c
){
mComments
=
c
;}
QString
comments
(){
return
mComments
;}
// Keywords
void
setKeywords
(
const
QString
&
kw
){
mKeywords
=
kw
;}
QString
keywords
(){
return
mKeywords
;}
// Level
void
setLevel
(
const
QString
&
level
){
mLevel
=
level
;}
QString
level
(){
return
mLevel
;}
// Topic
void
setTopic
(
const
QString
&
topic
){
mTopic
=
topic
;}
QString
topic
(){
return
mTopic
;}
// Authors
void
setAuthors
(
const
QString
&
authors
){
mAuthors
=
authors
;}
QString
authors
(){
return
mAuthors
;}
// Others
void
clearLists
();
void
saveContent
();
...
...
@@ -110,6 +127,10 @@ private:
eLicense
mSessionLicence
;
QString
mPageTitle
;
QString
mComments
;
QString
mKeywords
;
QString
mLevel
;
QString
mTopic
;
QString
mAuthors
;
QVector
<
sAction
>
mActionList
;
QVector
<
sLink
>
mUrlList
;
...
...
src/gui/UBTeacherBarWidget.cpp
View file @
07414cf6
...
...
@@ -143,7 +143,11 @@ bool UBTeacherBarWidget::isEmpty()
mData
.
urls
()
->
empty
()
&&
mData
.
actions
()
->
empty
()
&&
mData
.
medias
()
->
empty
()
&&
mData
.
comments
()
==
""
;
mData
.
comments
()
==
""
&&
mData
.
authors
()
==
""
&&
mData
.
keywords
()
==
""
&&
mData
.
level
()
==
""
&&
mData
.
topic
()
==
""
;
}
void
UBTeacherBarWidget
::
onShowEditMode
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment